Repository navigation
fix(knowledge): status phrases are matched across wrapped lines - #14101
Conversation
Red: check:knowledge reads status phrases one physical line at a time, so "not" at the end of one line and "built." at the start of the next is missed. Two list items or two table rows that only touch must not join.
check:knowledge matched each status phrase within one physical line, so a phrase wrapped across a line break went unreported. It now matches each run of wrapped lines (a list item or table row starts its own run) and reports the hit at the line where the phrase starts. AST-057 gets the one newly found phrase reworded; the two in AST-103 are reworded by #14089.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec 84a8d3e |
PR Analysis Report🔎 Preview ·
|
There was a problem hiding this comment.
Changes requested. Matching each run of wrapped lines works: the new cases pass, the two wrap cases fail without the change, and over the records on main the check keeps every existing warning and adds only the three wrapped phrases the description names. One stated guarantee does not hold yet:
scripts/lib/knowledge-status-phrases.mjs:102treats a line as a table row only when it starts with|, so a GitHub table written without outer pipes (Label | notabovebuilt | here) is joined into one run and warns"not built", which contradicts "a table row is a run of its own, so a phrase never joins two items or two rows" in the description and thewrapRunscomment.
Treating any line with a | outside code spans as a row (for example const TABLE_ROW = /\|/;), plus a pipe-less table in the "does not join" case, fixes it without changing any current warning; narrowing the comment and the description to rows that start with | would also resolve it.
Claims and files checked
Review mode: same-head; reason: none
- Title (live): status phrases are matched across wrapped lines — verified (the head passes the wrap cases at test lines 56-68 and 86-92).
- Claim: a phrase that wraps across a line break now warns at the line where it starts — verified (both wrap cases assert the starting line).
- Claim: the old check split each paragraph back into physical lines before matching — verified (the base matched each prose line on its own).
- Claim: every phrase pattern already allows any whitespace between its words — verified (
wordPatternbuilds every pattern with\s+). - Claim: a list item starts a new run and a table row is a run of its own, so a phrase never joins two items or two rows — false (rows without a leading pipe are joined).
- Claim: output stays one entry per phrase and line in phrase-list order, with the Status line, in-progress and blanking rules unchanged — verified (lines 215-229;
proseLinesis unchanged). - Claim:
mainholds two wrapped phrases in the reorderable spec and one in the row-actions spec — verified (run over all 335 checked records). - Claim: across those 335 records, 5 existing warnings are kept, 3 are added and none is removed — verified (same run, every checked path).
- Claim: the row-actions rewording handles the only other new find and keeps its meaning — verified (bullet read; the head reports nothing in that record).
- Claim: with this and the companion pull request's wording, no new warning remains — verified (0 warnings with both).
- Claim: the two new cases fail before the change, and the negative case passes before and after — verified (head test file against the base module fails exactly those two).
- Claim: all 23 cases pass — verified (23 of 23 at this head).
- Claim:
pnpm check:knowledgepasses and the check stays advisory — verified (CI's lint at this head runs it, prints 7 warnings and passes). - Claim: overlap with other open pull requests was checked, and this merges after the companion pull request — reported.
- File:
scripts/lib/knowledge-status-phrases.mjs— finding (table-row boundary). - File:
scripts/lib/knowledge-status-phrases.test.mjs— clear (its negative case covers only pipe-led rows). - File:
docs/specs/AST-057-row-actions/spec.md— clear.
Red: a GitHub table may leave out the outer pipes, so a row need not start with one, and the wrapped-phrase match joins two such rows.
In a paragraph with a table's delimiter row, every line with a pipe is a row, as GitHub tables may leave out the outer pipes.
|
/approve-spec cd39f53 |
There was a problem hiding this comment.
Approved pending CI: the heavy CI jobs (build, test and docsite-test) run once review passes and must pass before merge.
Wrapped status phrases now warn at the line where they start, and a table written without outer pipes keeps its rows apart, pinned by the new test case. Merge after #14089, so main does not pick up the two wrapped AST-103 phrases this check now reports.
Claims and files checked
Review mode: incremental; reason: none
- changed rules (0): none
- Claim: a status phrase that wraps across a line break now warns at the line where it starts. Verified: the wrap test passes on the head and fails on the base, and the record line numbers match.
- Claim: the base matched each physical line on its own, so wrapped phrases were missed. Verified: base code, and the wrap tests fail against it.
- Claim: each phrase pattern already allows any whitespace, a line break included. Verified: the pattern builder turns each space into one-or-more whitespace.
- Claim: a list item starts a new run and a table row is a run of its own, with or without outer pipes, so a phrase never joins two items or two rows. Verified: the list, piped-table and pipe-less-table cases stay silent, and so do item, row and header-row probes.
- Claim: the Status line and in-progress checks stay per line, blanking is unchanged, and output stays one entry per phrase and line in phrase-list order. Verified: code read, and every earlier case passes.
- Claim: the check stays advisory and never fails. Verified: the warning-only printer is unchanged, and Lint passes with 7 warnings.
- Claim: over the 335 checked records, 5 existing warnings are kept, 3 are added (AST-057:169, AST-103:189, AST-103:291) and none are removed. Verified: own run over the base and main records.
- Claim: with this pull request's AST-057 wording and #14089's AST-103 wording no new warning remains. Verified: own run, 0 warnings.
- Claim: the AST-057 rewording keeps its meaning. Verified: the same requirement, approved by an engineering owner at this head.
- Claim: all 24 test cases pass, the two wrap cases fail before the fix, the pipe-less table case fails at the previous head, and the new negative case passes before and after. Verified: own runs of the test file against each version of the module.
- Claim:
pnpm check:knowledgepasses. Verified: Lint at this head. - Claim: overlap with other open pull requests was checked. Reported.
- File
scripts/lib/knowledge-status-phrases.mjs: clear - File
scripts/lib/knowledge-status-phrases.test.mjs: clear - File
docs/specs/AST-057-row-actions/spec.md: clear
User impact
A spec author runs
pnpm check:knowledgeto catch temporary project status before a record lands (INV32). When a status phrase wraps across a line break, as "Implementation gap: not" at the end of one line and "built; …" at the start of the next, the check says nothing, so the phrase reachesmainin a current record: two such wrapped phrases are in AST-103 onmaintoday, and one is in AST-057. After this change the check warns on a wrapped phrase at the line where it starts, as it does for a phrase on one line.Problem and solution fit
findStatusPhrasesstrips code spans and quotes from a whole paragraph, but then splits the paragraph back into physical lines before it matches. Each phrase pattern already allows any whitespace between its words, a line break included, but it never sees two lines at once.currentrecord.Expected behavior and authority
architecture:knowledge-contractsINV32 (records state behavior and decisions, not project status), whose verification row reads: "pnpm check:knowledgewarns on each build-status or sequencing phrase in a spec or architecture record and does not fail (DEC-20)". A wrapped phrase is such a phrase. The check stays advisory: it prints warnings and never fails (DEC-20).Smallest restoration
scripts/lib/knowledge-status-phrases.mjs: phrase matching runs over each run of wrapped prose lines and reports each hit at its starting line, one entry per phrase and line, in the phrase list's order as before. TheStatus:line and in-progress checks stay per line. Code-span, quote and behavior-context blanking are unchanged.docs/specs/AST-057-row-actions/spec.md: the one phrase the fixed check newly finds outside AST-103 ("A second / consumer") is reworded; meaning unchanged.Evidence
knowledge-status-phrases.test.mjspass.main(5f9d5ee): 5 existing warnings, all kept; the fixed check adds 3 (AST-057:169, AST-103:189, AST-103:291) and removes none. With this pull request's AST-057 wording and docs(spec): AST-103 says what is absent, not what is not built #14089's AST-103 wording, no new warning remains.Scope
Components: knowledge checks (
scripts/lib/knowledge-status-phrases.mjs); spec:AST-057 wordingOverlap checked: #14089 (AST-103 wording only, the two wrapped phrases this check now finds; this pull request merges after it), #12237, #11176, #12562, #8485, #8217, #8121, #10462 (each edits other parts of AST-057, such as #12237's FR4 row, none the "Public out-of-flow slots" bullet), #8288, #12592 (edit
scripts/check-knowledge.mjs, not this module)Writing rubric results
For the AST-057 edit (one bullet in Non-goals):
R1 narration: none.
R2 research: none.
R3 evidence: none touched.
R4 rejected alternatives: none touched.
R5 change references: none.
R6 open questions: none touched.
R7 project status: "A second consumer" (sequencing) restated as "Any other out-of-flow part … needs its own
component:Itemanatomy record".Testing
pnpm vitest run --project node scripts/lib/knowledge-status-phrases.test.mjs: 24 pass. The case for a table without outer pipes fails at 9e11f23 and passes at this head.findStatusPhrasesbefore and after over every record underdocs/specs/anddocs/architecture/: the counts above.pnpm check:knowledge: passes (the status check warns only).