Skip to content

Re-anchor the interaction-layer token ceiling after #1307: the ratchet itself asks for 42,000 → ~40,000, and its own discipline sanctions the lowering #1317

Description

@hotlong

Filed by the repo:hotcrm PM seat. The #1307 dev surfaced the advisory on its own run and could not act on it — scripts/check-source-token-ratchet.mjs was outside the fence this seat gave it (see the note at the bottom, which is this seat's error, not the dev's). Dedupe search run before filing: no existing card.

What the gate is asking for

scripts/check-source-token-ratchet.mjs is a shrink-only ceiling on the authored surface (#1183). Its ceilings are anchored at measured × 1.05, rounded up to the next 1,000 — the maintainer-ruled 5% working buffer:

scripts/check-source-token-ratchet.mjs:147   const BUFFER = 0.05;
scripts/check-source-token-ratchet.mjs:155   export const anchor = (tokens) => Math.ceil((tokens * (1 + BUFFER)) / 1000) * 1000;
scripts/check-source-token-ratchet.mjs:183   ['interaction layer', 42000],

anchored from a reading of 39,084 (39,084 × 1.05 = 41,038 → 42,000, headroom 2,916 / 7.5%).

PR #1316 (card #1307) deletes 91 lines of list.tabs[] from src/views/**, which is inside the interaction layer (src/views/ src/pages/ src/dashboards/ src/apps/, :31). The reading drops by ~1,027 tokens, headroom rises past twice the buffer, and the gate emits its re-anchor advisory — status 0, not a failure, so nothing is broken today.

anchor(new reading) lands on ~40,000.

⚠️ This is a TIGHTENING, and the script explicitly sanctions it

⛔ This seat's standing rule is that weakening a gate sits on the maintainer floor and neither the PM nor a dev may do it. This is the opposite — and the ratchet's own docstring says so in its own words (:96-99):

A ceiling may be LOWERED by any PR that shrinks its scope. Lowering is …

⇒ Lowering 42000 → 40000 needs no maintainer ruling. ⛔ Raising any ceiling still does, and the script says that too (:349: "raise the ceiling in a PR that quotes a maintainer ruling approving …"). Do not confuse the two directions.

Scope

  1. Re-run the gate on main after refactor(views): remove the inert list.tabs[] block from every view file #1316 lands and read the advisory's own suggested figure — ⛔ do not copy the ~40,000 above; it is derived from the dev's pre-merge reading and main moves.
  2. Set CEILINGS.get('interaction layer') to anchor(measured) using the script's own exported helper, not a hand-rounded number.
  3. Update the worked table in the docstring (:170-172) — it spells out reading × 1.05 → ceil → ceiling (headroom N, X%) for all three layers, and the interaction row becomes false the moment the constant moves. ⚠️ This is the same hand-maintained-figure class this round has been clearing (The hand-written "15 lookups on sys_user" figure in two event_attendee comments has no guard, and had already drifted to 16 #1188, forecast-seeds.test.ts says "these eight authored records" where the seed holds seven — in the one file whose job is to state the seed's invariants exactly #1282, A third hand-maintained integer in prose — sharing-coverage.test.ts says "the other 14 zh-Hans doc pages" where 21 use the word, and 0 use the spelling it contrasts against #1310, flow-scheduled.test.ts opens with "All six scheduled flows" — there are nine, and this very file imports and tests all nine #1312, scanHeaderPosition's "all 282 .ts files … 274 of them on line 1" is stale in both halves — it is 324 and 324, and the 8-file gap it was hedging against has closed #1315) — with one difference: here the figures have a producer (the gate prints them), so the right fix is to make the row match, not to delete it.
  4. Check whether the authored total (140000, anchored from 133,302) also moved past its advisory line — the same 91 lines count toward it. Re-anchor it in the same pass if so.

⛔ Do not touch business semantics (85,000) — #1316 changed nothing under it.
⛔ Do not touch BUFFER — 5% is a maintainer ruling (quoted in the script as 「给 5% 缓冲」).
⛔ Do not touch scripts/check-source-hygiene.mjs — a different gate; its cap and advisory band are #1287's and are unrelated.

Acceptance

  • node scripts/check-source-token-ratchet.mjs exits 0 with no re-anchor advisory printed.
  • The docstring's worked table matches the constants, line for line.
  • A changeset (empty frontmatter, or the skip-changeset label) — this publishes nothing.

⚠️ Note on why this is a card rather than a line in #1316

The fence this seat gave the #1307 dev named 19 files and did not include the ratchet script. That was this seat's omission: deleting 91 lines from src/views/** mechanically moves the interaction-layer reading, so the ratchet was a foreseeable consequence of the change and belonged in the enumeration.

The dev did the right thing — it reported rather than widening its own fence, and the PR body records the advisory in full. This is the third instance this round of the same root cause (the other two are on #1296 and #1236): an enumerated fence must be derived from what the change mechanically touches, not transcribed from the card. Recorded here so the card carries its own provenance.

Related

Activity

  1. added
    ci/cdCI plumbing and the verification pipeline
    pm:queueReady for the PM dispatch loop
    on Aug 26, 2026
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

    ci/cdCI plumbing and the verification pipelinepm:dispatchedDispatched to a dev agent by /pm-dispatch

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions