Skip to content

chore(ratchet): raise the two src/sales token ceilings to their anchor() (59,000 / 107,000) - #1953

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-1951-sales-ceiling-raise
Oct 3, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-1951-sales-ceiling-raise

Conversation

@os-elon-musk

@os-elon-musk os-elon-musk commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #1951

Raises exactly two src/sales ratchet ceilings in scripts/check-source-token-ratchet.mjs.
Nothing under src/ is touched, so the measured surface does not move.

src/sales row was now is anchor() of
business semantics 55,000 59,000 55,986
authored total 100,000 107,000 101,395
interaction layer 31,000 31,000 — unchanged —

⛔ No other package's ceiling changes. ⛔ No kind changes.

The maintainer ruling this raise stands on

The gate's own header states the condition: raising an anchored ceiling "requires a
maintainer ruling quoted in the raising PR's body". Quoting it, verbatim and
untranslated — maintainer reply of 2026-09-16T11:04Z, recorded in
#1951's ruling comment:

「同意」

That is the maintainer's whole text, so here is the letter it answers, from the same comment:

Raise the two src/sales ratchet ceilings to business semantics = 59,000 and
authored total = 107,000.
These are the anchor() values — ceil(reading × 1.05 / 1000) × 1000
on the post-landing readings 55,986 / 101,395 — i.e. the 5% buffer the maintainer set on
2026-08-17 (「给 5% 缓冲」), the same arithmetic #1928 used. ⛔ Not 57,000 / 103,000: that pair
carries a 1.8% buffer and breaks the rule it claims to follow.

The arithmetic, re-derived here with the gate's own exported anchor() rather than copied
from the ruling:

business semantics   55,986 × 1.05 =  58,785 -> ceil 1k ->  59,000
authored total      101,395 × 1.05 = 106,465 -> ceil 1k -> 107,000

⚠️ That ruling reached the card as a transcription rather than in the maintainer's own hand,
and the PM seat stopped and checked the channel before executing rather than assuming it.
The answer was that it counts, with one standing constraint — this PR stays a draft and the
merge decision is the maintainer's
. The trail is
PM comment 5696983500
(the question) and
PM comment 5723611009
(the answer, and the dispatch).

That constraint was lifted on 2026-10-03. The repo:hotcrm seat (session_01ER8ntXZhYebyQ66aXWdjfT) took this PR over, as recorded in
takeover claim 5965002201.
In the seat's chat, the maintainer ordered 「hotcrm一大堆pr你全部接手处理」. Asked who lands this PR once it is refreshed and green, the maintainer answered, verbatim, 「席位落地(推荐)」. So the seat lands it through the merge queue once review passes and CI is green on the refreshed head.

The kind stays ANCHORED, and that was decided rather than defaulted

There is real tension in it: the header defines an ANCHORED ceiling as anchor() of "a reading
this gate actually printed", and origin/main at 087b7c5 prints 54,179 / 99,340. It has never
printed 55,986 / 101,395 — those are true on the tree of the REQ-0006 branch (PR #1950, head
85e5dbd).

The resolution is to keep ANCHORED and make the rows name the tree their reading came
from
, which is the format this header already carries (the existing anchoring run names
origin/main at 4d7ae9f, and #1905's re-scoping run could not have been taken on main at
all). Switching the kind to RULED was refused on a property the gate itself states: a RULED
ceiling is symmetric, so lowering these two would then need a maintainer ruling too,
forever. The maintainer agreed to a number derived by anchor(), not to pinning these two
rows against future tightening, and a long-term property of the gate is not a fair price for an
easier PR.

The header's ledger had to be reconciled, and this is why

test/source-token-ratchet.test.ts holds the header table to four invariants at once: one row
per committed ceiling in the committed order, anchor(row reading) == the committed constant,
every row dated to a recorded run that actually produced its reading, and — the one that bites
— every ceiling the latest recorded run left alone owes a "declined re-anchoring" row proving
it would have been a raise
.

So a new run block cannot record two rows and ignore ten. This PR records one real run, on one
tree, and reconciles all twelve rows against it:

node scripts/check-source-token-ratchet.mjs   # 2026-09-18 01:37 UTC, `refs/pull/1950/head` at 85e5dbd
  • Nine rows re-anchor onto it, including the two the ruling raises. For the seven module
    rows anchor(reading) is the constant they already carry, so re-anchoring them moves a date
    and a reading, never a ceiling.
  • Three rows keep their 2026-09-16 row because anchor() of the new reading lands above
    the ceiling they carry, and raising one of those is a ruling of its own that nobody gave.
    They are recorded as declined re-anchorings:
src/sales      interaction layer  anchor( 29,725) =  32,000  > ceiling  31,000  2026-09-18
src/service    authored total     anchor( 21,127) =  23,000  > ceiling  22,000  2026-09-18
src/revenue    authored total     anchor( 18,279) =  20,000  > ceiling  19,000  2026-09-18

⚠️ The three modules are byte-identical on 85e5dbd and on origin/main at 087b7c5 — the
REQ-0006 branch touches src/sales/ alone — so the module readings recorded above are
origin/main's own, re-measured on that run rather than carried across. Verified by running
the gate on both trees: the module blocks are identical line for line.

Refresh onto main 25cd8d78 (2026-10-03)

Merge commit e7287a65 (parents deb4563c + 25cd8d78, 26 commits from main, clean, no hand resolution). The PR's four files are byte-identical to deb4563c, so the ruled numbers, every kind and the changeset are untouched. The readings below are on the refreshed head. The original 2026-09-18 readings stay further down as history.

  • pnpm verify, exit 0 on e7287a65: Test Files 174 passed (174) · Tests 3701 passed | 1 skipped (3702). CI on e7287a65: 9/9 success.
  • The gate on the refreshed head. main's own src/sales reading moved down since 087b7c5, so these differ from the 2026-09-18 block:
    business semantics          45   5,417   213,732    53,433    59,000
    interaction layer           25   3,350   110,585    27,646    31,000
    authored total             115  10,062   386,232    96,558   107,000
  ✓ src/sales business semantics ~53,433 tokens (ceiling ~59,000; headroom ~5,567).
      ℹ️  headroom is 5,567 tokens, over twice the 5% buffer — re-anchor this ceiling to ~57,000 in your PR; shrink-only ratchets tighten opportunistically.
  ✓ src/sales authored total ~96,558 tokens (ceiling ~107,000; headroom ~10,442).
      ℹ️  headroom is 10,442 tokens, over twice the 5% buffer — re-anchor this ceiling to ~102,000 in your PR; shrink-only ratchets tighten opportunistically.

⛔ Do not act on it in this PR. It is a console.log (exit 0). The ceilings are anchored to the REQ-0006 tree by the ruling, and that tree lands next as PR #1950. Measured on a git merge-tree of #1950's head 85e5dbd onto e7287a65, the gate reads 55,240 / 98,614, and neither row prints the advisory:

scenario row reading ceiling headroom trigger (10%) anchor(reading) prints
main + this PR business semantics 53,433 59,000 5,567 5,343 57,000 yes
main + this PR authored total 96,558 107,000 10,442 9,656 102,000 yes
+ #1950 (merge-tree) business semantics 55,240 59,000 3,760 5,524 59,000 no
+ #1950 (merge-tree) authored total 98,614 107,000 8,386 9,861 104,000 no

Measurements (original, 2026-09-18, on deb4563c; kept as history)

pnpm verify — the full chain package.json defines, exit 0. pnpm validate && pnpm typecheck && pnpm lint && pnpm lint:i18n-gate && pnpm hygiene && pnpm hygiene:tokens && pnpm build && pnpm test.
Exit code captured to a file before any pipe.

✓ source hygiene clean
✓ source token ratchet clean
 Test Files  172 passed (172)
      Tests  3685 passed | 1 skipped (3686)

The gate itself, on this branch — node scripts/check-source-token-ratchet.mjs, exit 0:

  src/sales   ← the README headline claim (ADR-0130 §1.3(b))
    scope                    files   lines     chars   ~tokens   ceiling
    business semantics          46   5,522   216,717    54,179    59,000
    interaction layer           25   3,516   117,906    29,477    31,000
    other authored metadata     45   1,307    62,735    15,684         —
    ──────────────────────────────────────────────────────────────────
    authored total             116  10,345   397,358    99,340   107,000

  ✓ src/sales business semantics ~54,179 tokens (ceiling ~59,000; headroom ~4,821).
  ✓ src/sales interaction layer ~29,477 tokens (ceiling ~31,000; headroom ~1,523).
  ✓ src/sales authored total ~99,340 tokens (ceiling ~107,000; headroom ~7,660).

The opportunistic-tightening advisory did NOT fire on deb4563c. That was true on the 2026-09-18 base; on the refreshed head it prints (see the refresh section above). Measured on this branch, not assumed.
The gate prints no over twice the 5% buffer line anywhere in that run (grep -c on the
captured output: 0). Substituting into the gate's own expression
row.ceiling - row.tokens > row.tokens * 2 * BUFFER && anchor(row.tokens) < row.ceiling:

row reading new ceiling headroom trigger (10%) anchor(reading) fires
business semantics 54,179 59,000 4,821 5,418 57,000 no
authored total 99,340 107,000 7,660 9,934 105,000 no

Both sit inside the relative trigger, so the second half never gets asked. And the advisory is
a console.log that never sets failed, so it could not have moved the exit code either way.

Both importing suites are green, and one of them moved: test/docs-readme-token-figures.test.ts
imports CEILINGS and pins its own docstring band row against it, so the row's ceiling column
follows 55,000 to 59,000. The README banner does not move — it is pinned to the measured
reading, not to a ceiling (「解耦:banner 钉实测,ceiling 独立」), origin/main's reading did not
change as of 2026-09-18 (it has since moved to 53,433, see the refresh section), and ~54k stays inside its 51,300–56,700 band at 53,433, 54,179 and 55,986 alike.

pnpm exec vitest run test/source-token-ratchet.test.ts test/docs-readme-token-figures.test.ts
 Test Files  2 passed (2)
      Tests  50 passed (50)

Changeset: an empty-frontmatter declaration, not the label

The ruling's parenthetical suggested skip-changeset; checked against what comparable PRs in
this repo actually did rather than taken as fact. .github/workflows/changeset-check.yml counts
changesets added by the PR and treats an empty-frontmatter file as the sanctioned "this PR
releases nothing" declaration, on par with the label — and the script-only precedents all chose
the file, including #1928, which raised two of these same ceilings
(.changeset/per-module-token-ratchet.md), plus derive-the-src-roster-package-list.md and
config-globs-must-match-something.md. The file is the better of the two because it leaves the
reasoning in the repository instead of in a label. package.json is private: true and this
diff opens no file objectstack build reads, so the artifact and the docs site are
byte-identical to main.

What this PR deliberately does not do

Acceptance notes

  • Noted, not filed: src/service authored total and src/revenue authored total have both
    drifted past their own 5% anchor since [decision] Track A has ~621 tokens of business-semantics headroom left and two rings to go — raising the ceiling needs a maintainer ruling quoted in the raising PR #1928 — anchor() of today's reading is 23,000 and
    20,000 against committed 22,000 and 19,000. Neither is over its ceiling and neither is a
    defect; they are now recorded as declined re-anchorings in the gate header, which is the
    first written record that these two are the next rows likely to need a conversation.
    Successor: whoever next raises or re-anchors a module ceiling reads those rows.
  • Noted, not filed: the header's declined-row invariant means a partial re-anchoring PR must
    re-date every row it can and write a declined row for every row it cannot. That is the
    suite working as designed, not a defect, but it is why a two-constant raise touches ten rows.
    Successor: the next raising PR, which will meet the same invariant.

Generated by Claude Code

`business semantics` 55,000 -> 59,000 and `authored total` 100,000 -> 107,000
in `scripts/check-source-token-ratchet.mjs`. Both are `anchor()` — the ruled
`ceil(reading x 1.05 / 1000) x 1000` — of the readings PR #1950's tree prints
(55,986 and 101,395), so the kind stays ANCHORED and the 5% working buffer is
the whole of the raise. The maintainer ruling authorising it is quoted in the
gate's own header and in the PR body, which is the condition the gate states
for raising an anchored ceiling.

The reading those two rows anchor from is not one `origin/main` prints, so the
recorded anchoring run names the tree it was taken on (`refs/pull/1950/head` at
85e5dbd) — the format this header already uses for a run that cannot be taken
on `main`. Nine of the twelve worked rows re-anchor onto that run; the three
whose `anchor()` now lands above the ceiling they carry keep their 2026-09-16
row and are recorded as declined re-anchorings, which is what keeps the
header's ledger self-consistent and `test/source-token-ratchet.test.ts` green.

No other ceiling moves, and nothing under `src/` is touched.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T3YsvpK1PvYf9n1YUhYP6W
@vercel

vercel Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
hotcrm Ignored Ignored Oct 3, 2026 3:27am UTC

Request Review

@github-actions github-actions Bot added the ci/cd CI plumbing and the verification pipeline label Sep 18, 2026
Refresh of PR #1953 onto main 25cd8d7 (26 commits). The merge is clean:
main touched none of the PR's four files. Its one README edit (31 -> 30
flows, #1988) is not a figure test/docs-readme-token-figures.test.ts pins,
and that test stays green on the merged tree.

Claude-Session: https://claude.ai/code/session_01ER8ntXZhYebyQ66aXWdjfT
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 3, 2026 04:55
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 3, 2026
Merged via the queue into main with commit a8c77e8 Oct 3, 2026
10 checks passed
hotlong pushed a commit that referenced this pull request Oct 3, 2026
… raise, #1994, #1963

No conflicts. #1953 raises the src/sales ceilings to 59,000 / 107,000, the
ruled answer to this branch's measurement. #1994 (tenant_admin profile) and
#1963 (tsx bump, pnpm-lock.yaml) do not touch this branch's file surface.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ER8ntXZhYebyQ66aXWdjfT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/cd CI plumbing and the verification pipeline

Projects

None yet

3 participants