Skip to content

chore(test): retire the field-consumer scanner and its guard — detection belongs to the platform (#1543) - #1580

Merged
os-zhuang merged 2 commits into
mainfrom
claude/issue-1543-retire-field-consumer-scanner
Sep 5, 2026
Merged

chore(test): retire the field-consumer scanner and its guard — detection belongs to the platform (#1543)#1580
os-zhuang merged 2 commits into
mainfrom
claude/issue-1543-retire-field-consumer-scanner

Conversation

@os-zhuang

@os-zhuang os-zhuang commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Fixes #1543

Maintainer ruling of 2026-09-05, option F (recorded on #1543, verbatim 「1543 选 F」): retire this repo's field-consumer scanner and its guard outright, rather than re-point, redesign or partially keep it. The basis is the standing 2026-08-31 ruling in AGENTS.md § "Scope — a pure metadata application", rule 3: "Lint, validation, gates and diagnostics belong to the platform, uniformly … Tests in this repo pin this repo's own business facts and nothing else … ⛔ Do not grow a gate farm." "Does a declared field have any consumer" is a property of every metadata app, not a HotCRM business fact. The scanner (created 2026-08-17) predates that ruling and was never reconciled with it.

Platform successor: objectstack#15922 — a "declared field with zero consumers" diagnostic in os lint / os validate, with HotCRM as the measured corpus and the retired scanner as design input. Not part of this PR.

No metadata is deleted here. crm_product.tax_rate and every other field are untouched; #1198 and #1199 stay separate cards, released after this merges.

What changed

file change
scripts/scan-field-consumers.ts deleted (573 lines)
test/field-consumer-scan.test.ts deleted (318 lines)
package.json scan:fields script dropped (pnpm verify never referenced it)
test/script-main-guard.test.ts GUARDED entry for the retired script removed; a tombstone added where the doc comment records its entry-point spelling
test/verify-log-decoy-pin.test.ts KNOWN_SPAWNING_FILES drops the deleted suite; the dated table keeps its figures and gains a tombstone
scripts/lib/main-module.d.mts the comment cited the retired script as its reason; now cites the measured one
.changeset/retire-the-field-consumer-scanner.md added, empty frontmatter

916 lines deleted, 41 added. The empty frontmatter is the route .github/workflows/changeset-check.yml documents for a PR that releases nothing ("on par with the skip-changeset label"), so no label is applied.

The rosters are enforced — measured, not assumed

Reverse verification in three legs on committed trees, pnpm exec vitest run test/script-main-guard.test.ts test/verify-log-decoy-pin.test.ts:

  1. before, base b1599507Test Files 2 passed (2) · Tests 14 passed (14), exit 0.
  2. deletion only, commit fd7f2b9d, rosters untouched — exit 1, Tests 4 failed | 10 passed (14): exercises every guarded script found on disk (expected [ …(3) ] to deeply equal [ …(2) ]), both symlinked spawn legs for the deleted script, and decoy-pin rule C (expected [ 'test/field-consumer-scan.test.ts' ] to deeply equal []). Neither roster is decorative.
  3. after the roster edit, commit 93044cfeTest Files 2 passed (2) · Tests 12 passed (12), exit 0. Twelve, not fourteen: the two spawn cases belonged to the retired script.

Why the two dated tables keep their numbers

test/verify-log-decoy-pin.test.ts's -line table is a measurement of a specific tree (ec4c5ac6) whose total is asserted in prose to reconcile at 64, and test/script-main-guard.test.ts's three-spellings table is the record of why the shared entry-point helper exists. Editing a figure out of either would falsify a dated measurement rather than reconcile a roster. Both keep their rows and gain a tombstone naming #1543; only the live rosters — GUARDED and KNOWN_SPAWNING_FILES — changed.

scripts/lib/main-module.d.mts justified itself by the deleted .ts script. The replacement reason is measured with tsc --noEmit --listFiles, which still lists the declaration after the deletion: first-party TypeScript reaches the helper through the gate it imports (test/source-token-ratchet.test.ts imports scripts/check-source-token-ratchet.mjs under allowJs, and tsc resolves that gate's own ./lib/main-module.mjs to this file).

Gates — the repo's own chain, each command run separately, exit code captured by redirect

command exit verdict line
pnpm validate 0 validation passed (pre-existing loop/try_catch advisories unchanged)
pnpm typecheck 0 tsc --noEmit, silent
pnpm lint 0 90 warning(s), 12 suggestion(s) — pre-existing
pnpm lint:i18n-gate 0 ✓ i18n lint gate: 0 i18n/missing-* issues
pnpm hygiene 0 ✓ source hygiene clean
pnpm hygiene:tokens 0 ✓ source token ratchet clean
pnpm build 0 Artifact: dist/objectstack.json (2012.2 KB)
pnpm test 0 Test Files 159 passed (159) · Tests 3380 passed | 1 skipped (3381)

One dispatch assumption falsified. The token ratchet was expected to fall with ~900 deleted lines. It cannot: its surface is src/**/*.ts minus src/translations and src/data, and nothing under scripts/ or test/ is measured. Both figures are identical before and after — business semantics ~84,060 · interaction layer ~37,429 · authored total ~135,830 — the second measured by running the gate against the base checkout. No ceiling was touched.

content/docs/** never referenced pnpm scan:fields (grepped; the only surviving mentions are CHANGELOG.md and two existing .changeset/*.md, all history, all left alone). src/**, content/docs/** and every governed surface are untouched.


🤖 Generated with Claude Code

https://claude.ai/code/session_01TezFG8ZMrNH6n5VTNpPpdH

Deletion leg only — the rosters that name these files are reconciled in the
next commit, so this commit is the ablation that proves they are enforced.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TezFG8ZMrNH6n5VTNpPpdH
…omment

test/script-main-guard.test.ts drops its scan-field-consumers.ts entry and
test/verify-log-decoy-pin.test.ts drops the deleted suite from
KNOWN_SPAWNING_FILES; the dated decoy-line table keeps its measured figures and
gains a tombstone. scripts/lib/main-module.d.mts stops citing the retired
script as its reason and states the one measured with tsc --listFiles.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TezFG8ZMrNH6n5VTNpPpdH
@vercel

vercel Bot commented Sep 5, 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 Sep 5, 2026 2:47pm UTC

Request Review

@github-actions github-actions Bot added ci/cd CI plumbing and the verification pipeline dependencies Dependency bumps and lockfile changes labels Sep 5, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review September 5, 2026 14:57
@os-zhuang
os-zhuang added this pull request to the merge queue Sep 5, 2026
Merged via the queue into main with commit 021db54 Sep 5, 2026
10 checks passed
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 dependencies Dependency bumps and lockfile changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Decision] #1198 and #1199 together empty the inert-field ledger to zero — so #1193's live-vs-inert guard loses its subject, not just its fixture

2 participants