Skip to content

[finding] Once system-context.mdx carries no line numbers, the os-regen mixed: 'line-anchors' comparator is the IDENTITY — the routing's stated safety argument, and three prose blocks, go stale together #16612

Description

@baozhoutao

Filed unassigned by the execution seat working #15921. Ungraded and unrouted — domain:*, priority and type are triage's.

Blocked-by: #15921 — nothing here is true on origin/main today. It becomes true the moment #15921's branch lands, so the card exists before the landing rather than after it.

The mechanism

content/docs/permissions/system-context.mdx is routed merge=os-regen in .gitattributes, and it is the ONE row carrying a mixed field (scripts/regen-artifacts.mjs, mixed: 'line-anchors'). The comparator that field names is blankAnchorLineNumbers in scripts/doc-line-anchors.mjs, wired through MIXED_COMPARATORS in scripts/git-merge-regen.mjs. Its job (#14064) is to decide whether two revisions differ ONLY in the half a generator re-derives — if so the driver may defer, and if not it must not, because dropping a side would delete hand-written prose.

That comparator blanks file:line anchors. #15921 removes every one of them.

Measured in the #15921 worktree, on the same two revisions of the page:

base f2f6684cd5   | line anchors: 141 | blankAnchorLineNumbers is the identity: false
issue-15921 head  | line anchors:   0 | blankAnchorLineNumbers is the identity: true

An identity comparator makes "equal modulo the generated half" mean "byte-identical". So after #15921 lands, this row defers essentially never and falls back to a text merge or a loud conflict.

Why this is a finding and not a bug

The behaviour change is in the SAFE direction and is not a regression to repair by reverting anything: silent prose deletion (the whole of #14064) becomes unreachable, because the driver can no longer conclude "lossless" on a page whose two revisions differ at all. What is lost is the #13646 convenience — 24 of the last 25 main commits to this page were pure anchor renumberings the driver absorbed for free, and none of those commits can exist any more either, because there are no numbers left to renumber.

What is left behind is stale text and an inert declaration, and both are the kind that read as current forever:

  1. scripts/regen-artifacts.mjs — the row's comment block argues at length from "the merged tree's correct anchors are on NEITHER side (measured on fix(rest): require the resolved environment to belong to the caller at GET /ui/view/:object/:type #13625 — five conflicted anchors resolve to 4408/5771/6019/6382/6575 …)". That measurement is about line numbers this page no longer has. The mixed: 'line-anchors' value itself is now a comparator that can never say yes.
  2. .gitattributes — the paragraph above the row calls the page "a generated file:line anchor table" and says the census gate "catches the stale anchors a merge leaves behind". There are no stale anchors of that kind to catch.
  3. scripts/doc-line-anchors.mjs — its module header opens on this page ("Measured on content/docs/permissions/system-context.mdx over 19 days, 101 of its 111 anchors rotted") and describes itself as the one reader of line anchors in docs prose. After [finding] system-context.mdx re-conflicts faster than one verification lap — the resolve→land window is measurably smaller than the gate union it requires #15921 the module has exactly one consumer left, scripts/git-merge-regen.mjs, and the page it was built for is not in its population any more.

What the decision actually is

Not for this seat. Stated as options rather than a recommendation, because the routing is the merge driver's territory and #15921 was explicitly fenced out of it:

pnpm check:merge-driver reconciles .gitattributes against regen-artifacts.mjs in both directions and is green on the #15921 branch, so nothing mechanical will raise this.

Re-check

git show origin/main:scripts/regen-artifacts.mjs | grep -n "line-anchors"
git show origin/main:scripts/git-merge-regen.mjs | grep -n "MIXED_COMPARATORS" 
node -e "import('./scripts/doc-line-anchors.mjs').then(m=>{const t=require('fs').readFileSync('content/docs/permissions/system-context.mdx','utf8');console.log(m.extractLineAnchors(t).length, m.blankAnchorLineNumbers(t)===t)})"

What is deliberately NOT claimed

Related: #14064 (the ruling that created the mixed field) · #13646 (the routing) · #13625 (the five-anchor measurement it argues from) · #15921 (the migration that makes the comparator vacuous).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions