Repository navigation
feat(scripts): report-only present-tense phrase reading on the spec docblock corpus - #20057
Merged
Merged
Conversation
…ocblock corpus
The spec docblock anchor gate gains a second, separate reading: the four
narrow present-tense phrases the ruling names ("this phase",
"is a follow-up", "not yet implemented", "currently no"), matched
case-insensitively and whole-word over the corpus's own comment-prose
projection with test sources skipped, folded across the JSDoc gutter so a
wrapped phrase is one hit.
Report-only by construction: printed before the anchor verdict, inside a
catch that prints NOT MEASURED instead of throwing, with no exit path. The
anchor gate's exit code and every line it printed before are unchanged; a
`--present-tense` arm prints the reading alone and exits 0. A separate
self-test battery plants one hit per phrase, refuses the wide phrase and
near misses, skips a test source, and spawns the arm to hold exit 0 with
hits. The header records the list, its growth rule and today's reading.
Claude-Session: https://claude.ai/code/session_019c3Hi6ZMU1p6m6aA6Bz45d
Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
PM review — ACCEPT at head
|
os-litant
marked this pull request as ready for review
September 25, 2026 01:12
os-litant
enabled auto-merge
September 25, 2026 01:12
os-litant
deleted the
claude/issue-19017-present-tense-docblock-report
branch
September 25, 2026 02:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #19017
Clause-②: no
Executes ruling
5805901449on #19017 (batch #219 item 2, letter 甲, 「只报告」; maintainer 「同意」): the spec docblock gate family gains a narrow present-tense phrase reading, report-only.What changed
One file:
scripts/check-spec-docblock-symbol-anchors.mjs(+403 / -3).PRESENT_TENSE_PHRASESis exactly the ruled list:this phase,is a follow-up,not yet implemented,currently no. Matching is case-insensitive and whole-word (currently nodoes not matchcurrently none). Comment delimiters and the JSDoc gutter are blanked and whitespace is folded across lines, so a phrase wrapped over two lines is one hit, reported at the line where it starts.sweepCorpuswalked (itsbyDoc), read throughcommentProse. So "docblock" means what it means for this gate: every comment, line or block, and never code or a string literal. Test sources are skipped.reportPresentTensehas no exit path and sets no exit code. It turns any throw into aNOT MEASUREDline. It runs before the anchor verdict, so it also prints on a red run and cannot move the verdict. Each hit prints as a📝 [present-tense] FILE:LINE "phrase"line, followed by one summary line.--present-tensearm prints the reading alone and always exits 0. It is also what the exit-0 self-test spawns.PRESENT_TENSE_CENSUS, and the self-test goes red on a listed phrase that has no reading. The header also records today's count per phrase.PRESENT_TENSE_REFUSED_WIDErecords whythere is nostays out.package.jsonedit, no required check, and no docblock edited.Extend vs sibling: extended, and why
I extended the existing script instead of adding a sibling script. It is the smaller change:
lint.ymlalready runs this script's default arm and--self-teston every PR, so the report lands in that step's log with no new wiring. A sibling would need either a workflow edit (out of scope for this claim) or nothing to run it at all. An instrument no one runs takes no reading.byDoc), so the corpus definition is the family's and cannot drift from it. A sibling would need its own walker, or would have to import this one's internals.Today's reading, and the judgement on each hit
origin/mainat5581d3000f27daa19991cf9d13d5ad1ed8cf8913: 1,046 non-test sources read and 504 test sources skipped.this phaseis a follow-upnot yet implementedpackages/spec/src/api/errors.zod.tsline 114NOT_IMPLEMENTEDerror code means. It defines the code and makes no claim about the repository's state.currently noPositive control. I also ran the same instrument on the card's own tree,
43f4766889e39d7a4590c5787d38e5956d0b4cb6. It reads 2, 1, 1 and 0 for the four phrases. The first three are thepackages/spec/src/data/api-derivation.tssites that #18991 repaired (lines 129, 130 and 196, all rotted). I checked on that tree thatplugin-hono-server'scurrent-user-endpoints.tsalready passed a realallowExport-deriveduserExportAllowed. The fourth is the sameerrors.zod.tsgloss. The card's probe also counted onecurrently no. That one is in a string literal (packages/spec/src/data/driver/common.zod.ts), outside this projection.The wide phrase, measured with this instrument.
there is nogets 320 comment-prose hits in 149 files today, and 286 on the card's tree. It stays out.Proof the existing gate is unchanged apart from the report lines
I ran the default arm on
5581d3000fbefore any edit and again on27cd45335eafter the edit:📝 [present-tense]hit line, its excerpt line, and the summary line. Every other line is byte-identical:diffreports a single34a35,37hunk.--self-teststill exits 0 and gains one line (the new battery's success line). The existing verdict line is unchanged. The existing battery was probed at exactly 124 cases, and the new battery registers 38.The exit-0-with-hits case lives in the self-test. It spawns
--present-tenseover a fixture tree with one planted hit per phrase, then asserts exit 0 and each printedFILE:LINE "phrase"line. It also asserts the following:currently none,this phased,follow-upper) and a string literal print nothing..test.tsthat carries all four phrases is in the population but skipped.there is nowhen asked directly, so it is kept out by the list and not by a blind matcher.process.exitCodeuntouched and printNOT MEASUREDinstead of throwing.Ablations (one-time, run through
scripts/ablation-replace.mjs, which checks the mutation landed on disk and proves the restore: blob equals HEAD andgit diff HEADis empty; no permanent test file):process.exit(1)when the report has hits. Red atthe report arm must exit 0 WITH hits, got 1. My first A1 attempt was a no-op, because the replacement still contained the anchor and the tool refused (anchor count 1 to 1, restored). I discarded it and re-ran with a different anchor.the planted "this phase" must be ONE hit at packages/spec/src/pt/rotted.ts line 3, got [].there is noadded to the list. Red atthe fixture must plant exactly one hit per listed phrase.Gates (on
27cd45335e)node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 31 commands. Results:check-spec-docblock-symbol-anchors(both arms),check-scripts-symbol-anchors(both),check-self-test-wired(both),check-self-test-workflow-commands(both),check-comment-mask-corpus,check:nul-bytes,check:entry-guard,check:parse-guardandcheck:watch-hint-literal.pnpm check:pm-dispatch-gatesis longer than the foreground cap on this shared box, so I ran its two halves separately. The--self-testhalf exits 0. The scan half also exits 0 (dispatch-gates self-test: 1925 cases pass; it took 876 s).--ranreconciliation:31 derived famil(ies) accounted for — 31 run, 0 NOT-MEASURED, with every exit code recorded before any pipe.scripts/that the derivation flagged:check-published-list-mirrors(both),check:console-injection,check:engine-double-contract,check:i18n-stale-fillandcheck-dts-references --self-testexit 0.check:dts-closureandcheck:published-readme-exportsexit 3 (their ownPREREQUISITE NOT MET: no built packagedist/in this worktree). These are NOT MEASURED, and this diff touches no package.files: ['**/*.{ts,tsx,mts,cts,js,jsx,mjs,cjs}'], and--print-configresolves 2 rules for it; ②--format jsonreports 1 file, 0 errors and 0 warnings; ③ the config never enables type-aware linting (the resolvedparserOptionscarry onlyecmaVersionandsourceType), so this diff cannot move any other file's verdict.scripts/**change and the root package is"private": true, so nothing publishes. The repo's documented route is theskip-changesetlabel. This dispatch forbids me any label write, so the owning seat applies it, andCheck Changesetstays red until it does.Acceptance notes
.test.tsfiles too; one of its day-one residual rows is infilter-array-declaration.test.ts. The report's exclusion is borrowed from the package's own test runner: thelocalproject inpackages/spec/vitest.config.tsincludes every.test.tsundersrc/. I did not invent a new definition./** */blocks only, today's count would be 0, because the one hit is a trailing//comment.for nowgets 4 comment-prose hits today and is not on the ruled list. Adding it would need its own measured reading, so I recorded it here and did not add it.PHASE2_IMPLEMENTATION.mdsections 4 and 5 as teaching the unresolvable@objectstack/core/securitysubpath, which PR #16205 repaired #16208 (the card's other two instances) are not addressed here. They remain open under their own cards.Generated by Claude Code