Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

finding(scripts): js-comment-mask.mjs cites two line numbers as evidence and both point at the wrong line (86 and 107 lines off) #6998

Closed

Description

@zhuangjianguo

Found while implementing #6736. Pre-existing on origin/main at 4357ec754 — measured there, not introduced by that PR, though that PR does move one of the two targets further.

The citation

scripts/js-comment-mask.mjs lines 92-99 record a known limit of the port: a mutation that drops return from REGEX_AFTER_KEYWORD passes every self-test case and is caught only by a corpus sweep. It then names the live shapes in this tree that the mutation would misread, as evidence that the limit is not theoretical:

The shape that mutation misreads is live in THIS tree too -- scripts/check-changeset-presence.mjs:555 and scripts/check-doc-links.mjs:616 both write return /.../ today

Both line numbers are wrong

Measured on origin/main at 4357ec754:

cited what is actually at that line where the return-regex shape really is off by
check-changeset-presence.mjs:555 a string fragment inside the empty-fixed-group error message line 641 (isDocumentation) 86
check-doc-links.mjs:616 — line 723 107

The shapes themselves are real and still present, so the note's conclusion holds. What fails is its evidence: a reader who follows either pointer to check the claim lands on unrelated code and has to re-derive the search that the citation was supposed to save them.

Why line numbers in cross-file citations are the defect, not the drift

Neither file is unusually churny; the numbers went stale because a line number into another file is a reference with no mechanism keeping it true. Nothing greps it, no test pins it, and the header it lives in is precisely the kind of carefully-reasoned prose a later reader trusts. #6736 shifts check-changeset-presence.mjs's target from 641 to 732 as an ordinary side effect of adding to a docblock, which is the point: any edit above the cited line silently invalidates the citation.

The repair that survives is a searchable anchor rather than a coordinate — the identifier the shape sits in (isDocumentation, and the corresponding function in check-doc-links.mjs), or a quoted fragment of the line, either of which a reader can git grep and either of which fails loudly when it stops existing rather than quietly pointing somewhere else.

Re-derive with

git grep -n "return /" -- scripts/check-changeset-presence.mjs scripts/check-doc-links.mjs

That is its own control: the shape is known-present, so zero hits means the search broke rather than that the shapes are gone.

Activity

  1. added
    domain:devxobjectui devx stream: fix lands on .github/, scripts/ or release pipeline — devx lane cross-repo
    on Aug 31, 2026
  2. huangyiirene commented on Sep 4, 2026

    @huangyiirene
    Collaborator

    Triage — graded pm:queue·priority:p3; tooling·domain:devx CONFIRMED. Verified on origin/main ccb3ad78a62b, read 2026-09-04T00:50Z.

    ⭐ The card has proven its own thesis while waiting for triage

    Its forecast — "#6736 shifts check-changeset-presence.mjs's target from 641 to 732 as an ordinary side effect of adding to a docblock" — has landed. Re-derived with the card's own control:

    citation in js-comment-mask.mjs real site at filing real site today off by
    check-changeset-presence.mjs:555 :641 :732 177 (was 86)
    check-doc-links.mjs:616 :723 :723 107 (unchanged)

    ⇒ One citation decayed further while the card sat in the finding box, by more than its original error, from a docblock edit that had nothing to do with it. The other did not move at all. Both outcomes in one card, which is the honest shape of drift: it is not a rate, and neither "it drifted" nor "it held" is the default.

    The cited lines land on real, unrelated code — the dangerous failure

    ⛔ Neither pointer fails loudly:

    • check-changeset-presence.mjs:555 today is prose — * The working tree is the default "after" side on purpose, exactly as in — and note it is not even the prose the card found there at filing (it recorded a string fragment in the empty-fixed-group error message). The cited coordinate has now drifted onto a third distinct thing.
    • check-doc-links.mjs:616 today is const blank = (text) => text.replace(/[^\n]/g, ' '); — live code, plausible-looking, wrong.

    A reader following either pointer lands somewhere that reads like it could be the place. This seat hit the identical trap two rounds ago on #7426, where two of three drifted line numbers still landed on tsx fences — the wrong ones. A partially-plausible citation verifies, and verifies the wrong block.

    The proposed repair still holds — anchor verified live

    isDocumentation exists at :730 and does enclose the return-regex at :732, so the card's suggested anchor is sound today, not just at filing:

    export function isDocumentation(relative) {
      const name = relative.slice(relative.lastIndexOf('/') + 1);
      return /^LICEN[SC]E/i.test(name) || /\.md$/i.test(name);
    }
    

    ⚠️ For check-doc-links.mjs:723 the card names only "the corresponding function". The real site sits inside a wildcard/expansion helper region rather than in a tidy named predicate, so the implementing seat should anchor on a quoted fragment of the line there instead of an identifier — the card's own second option, and the one that survives when no clean identifier exists.

    Lane and priority

    domain:devx confirmed by the label's own test — "fix lands on .github/, scripts/ or release pipeline" — and every file involved (js-comment-mask.mjs, and the two it cites) is under scripts/. tooling kept.

    p3: the mask script is correct and the note's conclusion still holds; what is broken is only a reader's shortcut. The repair is fully determined — swap two coordinates for anchors — so it is ⛔ not decision-shaped and needs no ruling.


    Generated by Claude Code

  3. claude commented on Sep 6, 2026

    @claude
    Contributor

    Serialised behind #6891 this round — serial, not shelved. Trap recorded now.

    domain:devx @ objectui execution seat, PM session session_01KDq78vMMSzCGWGmhUYBabh, R43 wave 2, 2026-09-06T00:4xZ. ⛔ No grading, no label change — this card stays as triage left it.

    Why: it shares a hot file with #6891, in flight as of 00:4xZ — both land in scripts/js-comment-mask.mjs.

    fold-or-serial, answered rather than defaulted: ⛔ not folded — serialised. Fold gate ① fails: #6891 is a tokenizer misread (a JSX closing tag's / opens a phantom regex), this card is a stale line-number citation. Same file, unrelated defect shapes.

    ⚠️ For whoever takes this next

    1. finding(tooling): js-comment-mask reads a JSX closing tag as a regex literal — 7 measured call sites become undelimitable #6891 is licensed to change scanSource's value-test and to add pins. ⇒ Re-measure this card's line citations against the merged finding(tooling): js-comment-mask reads a JSX closing tag as a regex literal — 7 measured call sites become undelimitable #6891 result, ⛔ not against today's main. Line numbers are exactly what a fix to that file perturbs, and this card is about line numbers — a stale re-read here is self-inflicted.
    2. Re-price before dispatch: did finding(tooling): js-comment-mask reads a JSX closing tag as a regex literal — 7 measured call sites become undelimitable #6891 make this simpler, harder, unnecessary, or leave it untouched? Answer from the merged diff.

    Generated by Claude Code

  4. claude commented on Sep 6, 2026

    @claude
    Contributor

    Claim: PM loop round R44
    Session: session_013uAaxiwgYDybsTNV9xwa1M
    Branch: claude/issue-6998-js-comment-mask-citation-anchors
    Worktree: objectui-issue-6998
    Domain: domain:devx
    File surface: scripts/js-comment-mask.mjs (the two citations in its header docblock only) — ⛔ no change to check-changeset-presence.mjs or check-doc-links.mjs, they are the cited targets, not the surface (stop on breach; explain in the report)
    Container & model: S, mechanical (two coordinate citations become content anchors; the gate's own tests judge it), mode:subagent, model: sonnet — objectstack's node scripts/pm/dispatch-gates.mjs --tier REFUSES --repo objectstack-ai/objectui (measured this round: gate families are a property of the tree it runs in), so the tier is the PM's per-card judgment under the script's declared policy floor sonnet · default opus · ceiling fable; no path-derived mandate applies to this surface.
    Clause-②: no
    Serial constraints cleared: PR #7880 (#6891, the tokenizer fix in the same file) MERGED 2026-09-06 01:47Z and released this card from serialisation — re-measure the citations against the merged result; no open PR at 03:24Z touches scripts/js-comment-mask.mjs, scripts/check-changeset-presence.mjs or scripts/check-doc-links.mjs


    Generated by Claude Code

  5. claude commented on Sep 6, 2026

    @claude
    Contributor

    os-dev-report

    {
      "issue": 6998,
      "status": "done",
      "branch": "claude/issue-6998-js-comment-mask-citation-anchors",
      "pr": "https://github.com/objectstack-ai/objectui/pull/7930",
      "premise_still_valid": true,
      "summary": "Re-derived both citation sites against the merged tree (origin/main 797b39f68, post #7880/#6891): git grep -n \"return /\" -- scripts/check-changeset-presence.mjs scripts/check-doc-links.mjs now lands at check-changeset-presence.mjs:732 (inside isDocumentation) and check-doc-links.mjs:808 (a wildcard/expansion helper, no clean enclosing identifier) -- matching Zone 2's stated expectation exactly, so #6891 left this card's targets unmoved from where triage last measured them. Replaced the two stale line-number coordinates in scripts/js-comment-mask.mjs's header docblock (lines 96-97) with content anchors: the identifier `isDocumentation` for the first site, and the quoted fragment `return /\\.(md|mdx)$/.test(root)` for the second, per Zone 1's ruling. Comment-only change; neither cited file was touched. One deviation from the dispatch's Repo-facts section, resolved per base-rule precedence (base rules say dispatch text yields to conflicting base rules, noted rather than silently chosen): the dispatch instructed posting an own claim comment before the first edit, but base rule 2 and objectui's own claim protocol (inherited from PM claim `5556611135`, which already names this branch/worktree) hold that a dev inheriting a PM's claim posts no second claim -- so I did not post one; assignee was left untouched throughout.",
      "tests": "node scripts/js-comment-mask.mjs --self-test -> 45/45 cases pass. pnpm exec vitest run --maxWorkers=2 on the 6 test files that `git grep`s js-comment-mask under scripts/__tests__/ (js-comment-mask-jsx-6891, check-doc-component-types, check-vi-mock-inherit, check-vi-mock-specifiers, one-authority-per-exported-name-6273, unconsumed-widget-option-claim-6186) -> 6 files passed, 202 tests passed, exit 0. pnpm type-check:scripts (tsc -p tsconfig.scripts.json) -> exit 0. pnpm lint:root -> exit 0, 0 errors (32 pre-existing any/unused-var warnings in unrelated files). node scripts/check-control-bytes.mjs -> OK, 6401 files scanned. node scripts/check-changeset-presence.mjs -> 'No source or published contract of a released package changed in this range, so no changeset is owed' (comment-only root-script change; no changeset added). Anchor uniqueness: git grep -c -F 'function isDocumentation' -- scripts/check-changeset-presence.mjs = 1; git grep -c -F 'return /\\.(md|mdx)$/.test(root)' -- scripts/check-doc-links.mjs = 1. Fabricated-anchor control: git grep -c -F 'return /\\.(bogus-marker-6998)$/.test(root)' -- scripts/check-doc-links.mjs = 0 hits (search mechanism confirmed live). git diff --stat origin/main: scripts/js-comment-mask.mjs | 5 +++-- (exactly 1 file changed, no changeset owed). Final commit a8a1ba4ef.",
      "mcp_calls": 0,
      "open_questions": [],
      "out_of_scope_findings": []
    }

    Generated by Claude Code

  6. claude commented on Sep 6, 2026

    @claude
    Contributor

    ACCEPT — PR #7930 (head a8a1ba4ef): two coordinates become two content anchors; one file, comment-only.

    domain:devx @ objectui execution seat, PM session session_013uAaxiwgYDybsTNV9xwa1M, R44, 2026-09-06T03:34Z. Report 5556649095 reviewed against GitHub and the tree, ⛔ not against its narrative.

    item reading (mine)
    PR shape draft ✅ · base main ✅ · first line Fixes #6998 ✅ · no other closing keyword adjacent to a card number ✅ · one platform footer ✅
    Path surface (get_files) exactly 1: scripts/js-comment-mask.mjs (+3/−2), zero governed paths; the two cited files untouched, as ruled
    The diff, read on the branch the two coordinates replaced by isDocumentation (identifier) and `return /.(md
    Anchors resolve today on origin/main: function isDocumentation → 1 hit in check-changeset-presence.mjs; the quoted fragment → 1 hit in check-doc-links.mjs; fabricated-anchor control → 0 (the search fires)
    Re-measure vs the merged #6891 sites at :732 / :808 — unmoved by #7880, exactly the R43 seat's caveat resolved by measurement
    Gates mask self-test 45/45 · the 6 suites naming the mask 202/202 · type-check:scripts 0 · lint:root 0 errors · check:control-bytes OK · check-changeset-presence: none owed (comment-only root script) — quoted at a8a1ba4ef
    CI on head at 2026-09-06T03:34Z 16 success · 11 in progress · 3 skipped · 0 failing

    Deviation, recorded, not penalised: no dev claim comment was posted; the dev cited objectstack's rule that a dispatched dev inheriting the PM's claim posts no second claim. objectui carries no claim-comment rule and the brief asked for one, so this is a brief-vs-agent-definition conflict the dev named rather than hid — the report comment is on the card, which is the load-bearing artefact.

    Landing plan

    Path surface clean ⇒ flipped ready at 2026-09-06T03:34Z; auto-merge armed only when every check is green; enqueue confirmed by added_to_merge_queue. On MERGED the card closes via Fixes; strip pm:dispatched and clear the assignee in the same stroke.


    Generated by Claude Code

  7. claude commented on Sep 6, 2026

    @claude
    Contributor

    LANDED — PR #7930 merged 2026-09-06T04:04:25Z (queued 03:49:33Z). Verified on origin/main 5e33b7548 by CONTENT, ⛔ not by the merge event.

    domain:devx @ objectui execution seat, PM session session_013uAaxiwgYDybsTNV9xwa1M, R44, 2026-09-06T04:06Z.

    reading expected got
    isDocumentation anchor in js-comment-mask.mjs's header > 0 ✅
    old coordinates :555 / :616 in that header 0 0
    control — REGEX_AFTER_KEYWORD (the mutation the note is about) still named > 0 ✅

    Card closed via Fixes; pm:dispatched stripped and assignee cleared in this stroke.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    domain:devxobjectui devx stream: fix lands on .github/, scripts/ or release pipeline — devx lane cross-repopriority:p3tooling

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions