コミットを比較
1 コミット
| 作成者 | SHA1 | 日付 | |
|---|---|---|---|
| 46e6d94edb |
@@ -574,8 +574,32 @@ and layout reuse, follow `frontend/AGENTS.md`.
|
|||||||
wording and placement before implementing it.
|
wording and placement before implementing it.
|
||||||
- Do not invent replacement copy when removing unrequested wording.
|
- Do not invent replacement copy when removing unrequested wording.
|
||||||
- Do not create, modify, or run tests unless the user explicitly asks for
|
- Do not create, modify, or run tests unless the user explicitly asks for
|
||||||
test work. When the user asks for tests, keep working and rerun them until
|
test work. When the user asks for tests, keep working within the permitted
|
||||||
they pass or the remaining failure is clearly blocked.
|
test-file scope and rerun them until they pass or the remaining failure is
|
||||||
|
clearly blocked.
|
||||||
|
- Test-only work includes adding, updating, deleting, reorganising, or fixing
|
||||||
|
SyntaxError in tests. During test-only work, do not modify production code.
|
||||||
|
- During test-only work, do not change production constants, behaviour, API
|
||||||
|
contracts, validation, routes, authentication, permissions, UI, copy,
|
||||||
|
dependencies, limits, thresholds, defaults, migrations, schema, or
|
||||||
|
environment settings to satisfy tests.
|
||||||
|
- Do not make production code match failing tests, mock assumptions, fixtures,
|
||||||
|
snapshots, old expectations, or stale setup. This includes changing
|
||||||
|
production constants merely because a test expects a different value.
|
||||||
|
- If test work reveals a production bug, spec mismatch, or missing behaviour,
|
||||||
|
stop without modifying production code and report: the failing test or
|
||||||
|
discovered issue, the related production file, the actual behaviour, the
|
||||||
|
expected behaviour, and why a production change appears necessary.
|
||||||
|
- Modify production code for test failures only when the user explicitly asks
|
||||||
|
for that production change. Do not expand a test task into a production task
|
||||||
|
on your own authority.
|
||||||
|
- If the user explicitly asks for both production implementation and test
|
||||||
|
updates, implement production code to the confirmed specification first,
|
||||||
|
then add or update tests to verify that specification. Never roll production
|
||||||
|
behaviour back to satisfy old tests.
|
||||||
|
- If it is unclear whether the test or the production implementation is stale,
|
||||||
|
or a test cannot be corrected without changing production code, ask the user
|
||||||
|
instead of guessing.
|
||||||
|
|
||||||
## Backend rules
|
## Backend rules
|
||||||
|
|
||||||
|
|||||||
@@ -29,15 +29,15 @@ describe ('post new review URL state', () => {
|
|||||||
.toEqual (['one', 'two'])
|
.toEqual (['one', 'two'])
|
||||||
})
|
})
|
||||||
|
|
||||||
it ('allows at most a 4095-byte request target', () => {
|
it ('allows at most a 6 143 byte request target', () => {
|
||||||
const baseUrl = 'https://example.com/'
|
const baseUrl = 'https://example.com/'
|
||||||
const baseLength = postNewReviewPathByteLength ([baseUrl])
|
const baseLength = postNewReviewPathByteLength ([baseUrl])
|
||||||
const allowed = `${ baseUrl }${ 'a'.repeat (4_095 - baseLength) }`
|
const allowed = `${ baseUrl }${ 'a'.repeat (6_143 - baseLength) }`
|
||||||
const denied = `${ allowed }a`
|
const denied = `${ allowed }a`
|
||||||
|
|
||||||
expect (postNewReviewPathByteLength ([allowed])).toBe (4_095)
|
expect (postNewReviewPathByteLength ([allowed])).toBe (6_143)
|
||||||
expect (isPostNewReviewPathWithinLimit ([allowed])).toBe (true)
|
expect (isPostNewReviewPathWithinLimit ([allowed])).toBe (true)
|
||||||
expect (postNewReviewPathByteLength ([denied])).toBe (4_096)
|
expect (postNewReviewPathByteLength ([denied])).toBe (6_144)
|
||||||
expect (isPostNewReviewPathWithinLimit ([denied])).toBe (false)
|
expect (isPostNewReviewPathWithinLimit ([denied])).toBe (false)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
const POST_NEW_REVIEW_PATH_PREFIX = '/posts/new?urls='
|
const POST_NEW_REVIEW_PATH_PREFIX = '/posts/new?urls='
|
||||||
const MAX_POST_NEW_REVIEW_TARGET_BYTES = 4_096
|
const MAX_POST_NEW_REVIEW_TARGET_BYTES = 6_144
|
||||||
|
|
||||||
const textEncoder = new TextEncoder ()
|
const textEncoder = new TextEncoder ()
|
||||||
|
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ describe ('PostImportSourcePage', () => {
|
|||||||
const input = screen.getByRole ('textbox', { name: '' })
|
const input = screen.getByRole ('textbox', { name: '' })
|
||||||
|
|
||||||
fireEvent.change (input, {
|
fireEvent.change (input, {
|
||||||
target: { value: `https://example.com/${ 'a'.repeat (4_100) }` } })
|
target: { value: `https://example.com/${ 'a'.repeat (6_200) }` } })
|
||||||
|
|
||||||
expect (screen.getByRole ('button', { name: '次へ' })).toBeDisabled ()
|
expect (screen.getByRole ('button', { name: '次へ' })).toBeDisabled ()
|
||||||
})
|
})
|
||||||
|
|||||||
新しい課題から参照
ユーザをブロックする