@event4u/agent-config 17.2.1 → 17.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.augment-plugin/marketplace.json +3 -3
- package/.augment-plugin/plugin.json +1 -1
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/skills/install-agent-config/SKILL.md +9 -9
- package/CHANGELOG.md +152 -0
- package/dist/agent-src/skills/code-intelligence/SKILL.md +13 -12
- package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
- package/dist/agent-src/templates/scripts/check_memory.ts +1 -1
- package/dist/cli/commands/recordTriggerEval.js +1 -1
- package/dist/cli-delegate/{chunk-KR5ZIFPO.js → chunk-DHSSP7V3.js} +1 -1
- package/dist/cli-delegate/chunk-E7ACTJTJ.js +6792 -0
- package/dist/cli-delegate/{chunk-BZJ4Y3CI.js → chunk-MT2WOOCY.js} +1 -1
- package/dist/cli-delegate/{chunk-CMZEKSNN.js → chunk-ORJPBER2.js} +2 -2
- package/dist/cli-delegate/{chunk-VYZGJLCA.js → chunk-RKNT4LIK.js} +22 -1286
- package/dist/cli-delegate/cmd_conformance.js +20 -14
- package/dist/cli-delegate/cmd_doctor.js +3 -3
- package/dist/cli-delegate/cmd_doctor_neighbours.js +2 -2
- package/dist/cli-delegate/cmd_explain.js +1 -1
- package/dist/cli-delegate/cmd_export.js +2 -2
- package/dist/cli-delegate/cmd_prune.js +2 -2
- package/dist/cli-delegate/cmd_settings_migrate.js +2 -2
- package/dist/cli-delegate/cmd_settings_set.js +8 -4
- package/dist/cli-delegate/cmd_sync.js +2 -2
- package/dist/cli-delegate/cmd_uninstall.js +2 -2
- package/dist/cli-delegate/cmd_validate.js +2 -2
- package/dist/discovery/deprecation-report.md +1 -1
- package/dist/discovery/discovery-manifest.json +3 -3
- package/dist/discovery/discovery-manifest.json.sha256 +1 -1
- package/dist/discovery/discovery-manifest.summary.md +1 -1
- package/dist/discovery/dormancy-report.md +1 -1
- package/dist/discovery/orphan-report.md +1 -1
- package/dist/discovery/packs.json +2 -2
- package/dist/discovery/trust-report.md +1 -1
- package/dist/discovery/workspaces.json +2 -2
- package/dist/hooks/code_graph_refresh.chunk.cjs +414 -0
- package/dist/hooks/code_graph_refresh.chunk.cjs.sha256 +1 -0
- package/dist/hooks/dispatch.js +21 -11
- package/dist/hooks/dispatch.sha256 +1 -1
- package/dist/hooks/egress_engine.chunk.cjs +1 -1
- package/dist/hooks/egress_engine.chunk.cjs.sha256 +1 -1
- package/dist/install/install.mjs +6974 -6037
- package/dist/mcp/mcp-cloudflare-catalogue.json +1 -0
- package/dist/mcp/registry-manifest.json +3 -2
- package/dist/mcp/server.json +13 -4
- package/dist/mcp/server.mjs +5561 -2463
- package/dist/scripts/_lib/egress_rules.js +8 -2
- package/dist/scripts/condense.js +9 -9
- package/dist/server/routes/discovery.js +1 -1
- package/dist/server/routes/install.js +1 -1
- package/dist/server/routes/ping.js +1 -1
- package/dist/server/routes/schema.js +4 -4
- package/dist/server/routes/settings.js +2 -6
- package/dist/server/routes/wizard.js +6 -6
- package/dist/server/schemas/settings.js +42 -42
- package/dist/shared/settingsSurface.js +1 -1
- package/dist/shared/userMd/schema.js +1 -1
- package/dist/shared/zodJsonSchema.js +47 -0
- package/dist/ui/assets/index-B0bcIgi0.js +77 -0
- package/dist/ui/index.html +1 -1
- package/package.json +3 -3
- package/src/agent-src/templates/scripts/check_memory.ts +1 -1
- package/src/config/ci-local-parity.yml +11 -0
- package/src/config/continuity-surface.json +9 -2
- package/src/config/gate-violation-baselines.json +3 -3
- package/src/config/gitignore-block.txt +6 -5
- package/src/config/hook-bundle-budget.json +16 -1
- package/src/config/pack-size-budget.json +12 -1
- package/src/config/packed-binary-manifest.json +9 -0
- package/src/scripts/_cli/cmd_settings_set.ts +3 -2
- package/src/scripts/_dispatch.bash +1 -1
- package/src/scripts/_lib/egress_rules.ts +8 -2
- package/src/scripts/_lib/listing_manifests.ts +85 -0
- package/src/scripts/_lib/neighbour_census.ts +1 -0
- package/src/scripts/_lib/release_settings_surface.ts +2 -6
- package/src/scripts/adoption_status.ts +231 -27
- package/src/scripts/build_mcp_registry_manifest.ts +23 -12
- package/src/scripts/check_dependency_floors.ts +7 -0
- package/src/scripts/check_release_manifest_content.ts +17 -2
- package/src/scripts/check_release_pr_shape.ts +5 -0
- package/src/scripts/code_graph/build.ts +80 -44
- package/src/scripts/code_graph/cli.ts +260 -16
- package/src/scripts/code_graph/conventions_default.ts +228 -0
- package/src/scripts/code_graph/extract.ts +5 -2
- package/src/scripts/code_graph/extract_more.ts +105 -1
- package/src/scripts/code_graph/loader.ts +10 -2
- package/src/scripts/code_graph/map.ts +174 -41
- package/src/scripts/code_graph/map_model.ts +53 -15
- package/src/scripts/code_graph/map_verify.ts +12 -0
- package/src/scripts/code_graph/map_viewer/viewer.css +6 -0
- package/src/scripts/code_graph/map_viewer/viewer.js +114 -13
- package/src/scripts/code_graph/passes.ts +173 -0
- package/src/scripts/code_graph/providers/angular.ts +55 -0
- package/src/scripts/code_graph/providers/aspnetcore.ts +182 -0
- package/src/scripts/code_graph/providers/catalog.ts +290 -0
- package/src/scripts/code_graph/providers/django.ts +163 -0
- package/src/scripts/code_graph/providers/express.ts +25 -0
- package/src/scripts/code_graph/providers/fastapi.ts +49 -0
- package/src/scripts/code_graph/providers/flask.ts +99 -0
- package/src/scripts/code_graph/providers/go_http.ts +121 -0
- package/src/scripts/code_graph/providers/index.ts +101 -0
- package/src/scripts/code_graph/{laravel_overlay.ts → providers/laravel.ts} +113 -7
- package/src/scripts/code_graph/providers/nestjs.ts +34 -0
- package/src/scripts/code_graph/providers/nextjs.ts +91 -0
- package/src/scripts/code_graph/providers/nuxt.ts +55 -0
- package/src/scripts/code_graph/providers/react-router.ts +58 -0
- package/src/scripts/code_graph/providers/shared/detect.ts +78 -0
- package/src/scripts/code_graph/providers/shared/extractors.ts +249 -0
- package/src/scripts/code_graph/providers/shared/js.ts +252 -0
- package/src/scripts/code_graph/providers/shared/kit.ts +210 -0
- package/src/scripts/code_graph/providers/shared/php.ts +64 -0
- package/src/scripts/code_graph/providers/shared/python.ts +223 -0
- package/src/scripts/code_graph/providers/spring.ts +138 -0
- package/src/scripts/code_graph/providers/sqlalchemy.ts +62 -0
- package/src/scripts/code_graph/providers/sveltekit.ts +59 -0
- package/src/scripts/code_graph/providers/symfony.ts +142 -0
- package/src/scripts/code_graph/providers/typeorm.ts +58 -0
- package/src/scripts/code_graph/providers/types.ts +56 -0
- package/src/scripts/code_graph/providers/vue-router.ts +21 -0
- package/src/scripts/code_graph/providers/wordpress.ts +128 -0
- package/src/scripts/code_graph/refresh_cli.ts +81 -0
- package/src/scripts/code_graph/refresh_lock.ts +193 -0
- package/src/scripts/code_graph/resolution_tiers.ts +19 -7
- package/src/scripts/code_graph/scip_reader.ts +2 -2
- package/src/scripts/code_graph/sqlite_store.ts +10 -4
- package/src/scripts/code_graph/types.ts +75 -41
- package/src/scripts/code_graph/validate.ts +6 -8
- package/src/scripts/condense.ts +9 -9
- package/src/scripts/generate_settings_reference.ts +2 -6
- package/src/scripts/hook_chunks.mjs +4 -0
- package/src/scripts/hook_manifest.json +1 -1
- package/src/scripts/hook_manifest.yaml +24 -7
- package/src/scripts/hooks/code_graph_refresh_hook.ts +160 -0
- package/src/scripts/hooks/lazy_concern.ts +4 -0
- package/src/scripts/install-hooks.sh +54 -33
- package/src/scripts/install.ts +2 -6
- package/src/scripts/lint_hook_manifest.ts +2 -0
- package/src/scripts/lint_marketplace.ts +33 -0
- package/src/scripts/lint_mcp_registry_manifest.ts +36 -0
- package/src/scripts/mcp_server/consumer_tool_catalog.json +1 -0
- package/src/scripts/mcp_server/graph_tools.ts +5 -1
- package/src/scripts/release.ts +2 -5
- package/src/scripts/release_drill.ts +4 -1
- package/src/scripts/release_env.ts +17 -0
- package/src/scripts/release_mix_taxonomy.json +3 -0
- package/src/server/schemas/settings.ts +42 -42
- package/src/shared/settingsSurface.ts +1 -1
- package/src/shared/userMd/schema.ts +1 -1
- package/src/shared/zodJsonSchema.ts +41 -0
- package/src/vendor/grammars/README.md +6 -5
- package/src/vendor/grammars/tree-sitter-c_sharp.wasm +0 -0
- package/dist/cli-delegate/chunk-XIAPY44N.js +0 -4587
- package/dist/ui/assets/index-w70Ado09.js +0 -23
package/dist/ui/index.html
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
document.documentElement.setAttribute('data-theme', theme);
|
|
28
28
|
})();
|
|
29
29
|
</script>
|
|
30
|
-
<script type="module" crossorigin src="/assets/index-
|
|
30
|
+
<script type="module" crossorigin src="/assets/index-B0bcIgi0.js"></script>
|
|
31
31
|
<link rel="stylesheet" crossorigin href="/assets/index-Cyjy8bWO.css">
|
|
32
32
|
</head>
|
|
33
33
|
<body>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@event4u/agent-config",
|
|
3
3
|
"mcpName": "io.github.event4u-app/agent-config",
|
|
4
|
-
"version": "17.
|
|
4
|
+
"version": "17.3.0",
|
|
5
5
|
"description": "Governed skills, rules and commands for AI coding tools (Claude Code, Cursor, Windsurf, Copilot) — every claim machine-checked, including the artifact counts in these badges.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"private": false,
|
|
@@ -143,13 +143,13 @@
|
|
|
143
143
|
"preact": "^10.29.0",
|
|
144
144
|
"web-tree-sitter": "0.24.7",
|
|
145
145
|
"yaml": "^2.9.0",
|
|
146
|
-
"zod": "^
|
|
147
|
-
"zod-to-json-schema": "^3.25.0"
|
|
146
|
+
"zod": "^4.6.6"
|
|
148
147
|
},
|
|
149
148
|
"overrides": {
|
|
150
149
|
"@hono/node-server": "^2.0.5"
|
|
151
150
|
},
|
|
152
151
|
"agentConfig": {
|
|
152
|
+
"registryDescription": "Governed skills, rules and commands for AI coding agents, served by a read-only MCP server.",
|
|
153
153
|
"impact": {
|
|
154
154
|
"17.0.0": {
|
|
155
155
|
"impact": "notice"
|
|
@@ -136,7 +136,7 @@ export const REDACTION_PATTERNS: ReadonlyArray<readonly [RegExp, string]> = [
|
|
|
136
136
|
// Key=value secret with a clear credential-word prefix. The value must
|
|
137
137
|
// be a single token (no spaces, no "/" — skips filepaths and URLs).
|
|
138
138
|
[
|
|
139
|
-
/\b(api[_-]?key|auth[_-]?token|access[_-]?token|bearer|secret|password|passwd|private[_-]?key)\b\s*
|
|
139
|
+
/\b(api[_-]?key|auth[_-]?token|access[_-]?token|bearer|secret|password|passwd|private[_-]?key)\b\s*(?::|=(?!==|=\s|>)=?)\s*[A-Za-z0-9+/=_\-]{8,}(?![/.\w])/i,
|
|
140
140
|
'inline credential',
|
|
141
141
|
],
|
|
142
142
|
[/https?:\/\/[^\s"'/]*:[^\s"'/]*@/, 'url with credentials'],
|
|
@@ -109,6 +109,17 @@ ci_only:
|
|
|
109
109
|
# self-test is the half that IS worth running locally, and it is reachable —
|
|
110
110
|
# `classify_change_risk --self-test` — but the workflow invokes it as a step of
|
|
111
111
|
# its own rather than through the aggregate, which is what this checker sees.
|
|
112
|
+
# road-to-listings-a-release-keeps-current Phase 5. The daily release-adjacent
|
|
113
|
+
# health job runs `adoption_status --check-upstream --fail-on-action`, which
|
|
114
|
+
# reads every ledger row's live upstream (gh for a pull request, curl for a
|
|
115
|
+
# listing or registry query). Its verdict is a property of third-party sites on
|
|
116
|
+
# the day it runs, not of a change, so it does not belong in `task ci`; the
|
|
117
|
+
# judging logic is covered offline by tests/scripts/adoption_status.test.ts.
|
|
118
|
+
# Reachable on demand: `./scripts-run src/scripts/adoption_status --check-upstream --fail-on-action`.
|
|
119
|
+
- id: adoption_status
|
|
120
|
+
class: network
|
|
121
|
+
reason: "reads live third-party upstreams (gh pr view, listing pages, the MCP registry); the verdict describes those sites on the day it runs, not the change, and the judging logic runs offline in the vitest suite"
|
|
122
|
+
|
|
112
123
|
# road-to-npm-payload-reduction Phase 3.1. `report_pack_delta` measures the
|
|
113
124
|
# BRANCH-vs-BASE packed payload, which has no meaning without a pull request:
|
|
114
125
|
# locally `--base origin/main --head HEAD` on main reads +0.0 KB every time, and
|
|
@@ -96,8 +96,15 @@
|
|
|
96
96
|
"id": "code-graph-refresh.lock",
|
|
97
97
|
"axis": "persistent_continuity_artefacts",
|
|
98
98
|
"disposition": "excluded",
|
|
99
|
-
"reason": "A concurrency lock guarding the code-graph refresh so two checkouts do not rebuild the index at once. Held for the duration of one refresh; it carries no state anyone reads afterwards.",
|
|
100
|
-
"locus": "src/scripts/
|
|
99
|
+
"reason": "A concurrency lock guarding the code-graph refresh so two checkouts do not rebuild the index at once, taken by `code-graph refresh --single-flight` (which the git hooks and the session concern run) and by `code-graph map`. Its sibling `.owner.json` names the holding pid so a crashed holder's lock can be reclaimed, and a sibling `.reclaim` directory is the short-lived mutex a reclaim holds. Held for the duration of one refresh; it carries no state anyone reads afterwards.",
|
|
100
|
+
"locus": "src/scripts/code_graph/refresh_lock.ts:24"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"id": "code-graph-auto-refresh.json",
|
|
104
|
+
"axis": "persistent_continuity_artefacts",
|
|
105
|
+
"disposition": "excluded",
|
|
106
|
+
"reason": "A per-project opt-in written by `code-graph auto-refresh on` and removed by `off`. The session-start refresh concern reads only its presence; it carries a timestamp nobody restores anything from, and a successor session that finds it learns a preference, not where the work stood.",
|
|
107
|
+
"locus": "src/scripts/code_graph/refresh_lock.ts:26"
|
|
101
108
|
},
|
|
102
109
|
{
|
|
103
110
|
"id": "code-graph-v1.json",
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
"note": "Lowered 47 -> 46 on 2026-08-30 by road-to-source-silence-cutover step 3.1, and the gain was INCIDENTAL rather than sought: narrowing the `source-header` class replaced a whole-value scan with a per-token one, and one hardcoded scan root went with the code that no longer needed it. Set to the EXACT live total, per this file's convention — the gate reported the tree at 46 against a baseline of 47 and said so, which is how a loose ratchet surfaces here rather than by inspection. `landed` refreshed deliberately: checkRatchet returns `improved` BEFORE it evaluates staleness, so an entry left at the old number while the tree measures lower would never expire at any age. Prior entry: Lines under src/scripts/**/*.{ts,mts,mjs} that pass the retired `.agent-src.uncondensed` directory into `path.join(...)` — a filesystem path CONSTRUCTED against the tree ADR-051 abandoned, which is the exact shape of all 14 dead gates. Deliberately narrow so the number is signal, not noise: 236 raw mentions under src/scripts → 147 string-literal lines → 67 path-constructing lines when the pass was written, after exempting src/scripts/_lib/agent_src.ts (the shared resolver, whose job IS owning the constant — gates that route through it survived the move). Detectors holding the literal as data t"
|
|
36
36
|
},
|
|
37
37
|
"check_source_size_budget": {
|
|
38
|
-
"count":
|
|
39
|
-
"landed": "2026-10-
|
|
40
|
-
"note": "Lowered 17,354 -> 17,337 on 2026-10-23 by road-to-a-map-that-draws-itself: trimming the chat_history_read and memory_lookup descriptions to fit the two map tools into the kernel payload band removed seventeen lines from src/scripts/mcp_server/tools.ts, which sits above the 1500-line budget. Prior entry: Lowered 17,358 -> 17,354 on 2026-10-22 by fix/release-without-review-gate: release.ts step 7 no longer reads the findings ledger, which removed four lines above the 1500-line budget. Prior entry: Lowered 17,363 -> 17,358 on 2026-10-22 by feat/subagent-system-2583: the seat launch environment (model-ceiling memo, CLI version probe) moved out of src/scripts/ai_council/clients.ts into cli_launch_env.ts, which more than offset the light-launch and seat-resume additions there and in council_cli.ts and orchestrator.ts. Set to the exact live total, per this file's convention. Prior entry: Lowered 17,365 -> 17,363 on 2026-10-21 by fix/release-no-trailer-refusal: removing the Consumer-Impact span refusal took two lines out of src/scripts/release.ts, which sits above the 1,500-line cap. Set to the exact live total, per this file's convention. Prior entry: MERGE RECONCILIATION 2026-10-21, 17,369/17,368 -> 17,365: main lowered 17,372 -> 17,368 (cmd_doctor.ts, below) and this branch lowered 17,372 -> 17,369; the two gains are independent and add. Branch entry: lowered 17,372 -> 17,369 on 2026-10-21 by drain/road-to-one-detector-senders-20261020, and the gate asked for it by name (ratchet is loose, naming 17,369). The branch's CLI egress refusal (+16 in ai_council/clients.ts) and the injection filter (+2 in hooks/dispatch_hook.ts, which crossed 1,500) were paid for by folding five identical CliClient.ask failure constructions into one _cliFailure helper; dispatch_hook.ts is a ratified hook-plumbing source and was left untouched. Main entry: LOWERED 17,372 -> 17,368 on 2026-10-21 by fix/install-runtime-resolution-20261021, and the gate asked for it by name. The gain IS this branch's: cmd_doctor.ts loses four lines because the no-project-install message moved into doctor_ownership_ledger.ts, where it now reports the global scope too. install.ts stays net-zero — a dry-run block that first added sixteen lines there was moved to wizard-plan.ts rather than paid for. PRIOR ENTRY: LOWERED 17,386 -> 17,375 on 2026-10-19 by drain/road-to-skills-that-arrive-when-called-20261019z, measured by CI (the baseline-equals-live test named 17,375): install.ts's _prune_scoped_modules wrapper became a one-line alias of scoped_projection.prune_scoped_modules, which now carries the declared-skill closure. Before that: LOWERED 17,407 -> 17,386 on 2026-10-18 by drain/road-to-a-release-that-says-whether-it-needs-you-20261018x, and the gate asked for it by name (ratchet is loose, naming 17,386). The gain is an EXTRACTION paying for doctor --json's new update_verdict block (two lines in cmd_doctor.ts): STATUS_SYMBOLS and _emit_checks_text moved verbatim into _doctor_emit.ts, re-exported unchanged, so cmd_doctor.ts goes 3,560 -> 3,539. No ceiling was edited. PRIOR ENTRY: LOWERED 17,410 -> 17,407 on 2026-10-18 by drain/road-to-an-ownership-record-20261018, and the gate asked for it by name (ratchet is loose, naming 17,407). The gain is a compaction inside the function this branch changed: _deploy_claude_desktop's marker call collapsed onto one line beside the new one-line claude-desktop ledger record, leaving src/scripts/install.ts 3 lines shorter than on main. PRIOR ENTRY: MERGE RECONCILIATION 2026-10-18, 17,415/17,414 -> 17,410 — merging origin/main into drain/road-to-one-detector-and-the-senders-we-own-20261018b: main lowered to 17,415 (subagent_native_fields extraction) and this branch to 17,414 (ai_council/config.ts onto the shared rule table) from different reductions; the gate measured the merged tree at 17,410 and named it. PRIOR ENTRY: LOWERING 2026-10-18, 17,419 -> 17,415 — the gate asked for it by name (`ratchet is loose`, naming 17,415), and `check_source_size_budget.test.ts` pins baseline == live total. The gain is an EXTRACTION: road-to-a-cold-start-paid-once 2.2 needed the subagent projector to emit four new optional native fields, so the per-field logic, including the existing `effort` pass-through, moved out of `condense.ts` into `src/scripts/_lib/subagent_native_fields.ts`, which owns nothing else; condense.ts goes 2,695 -> 2,691. No ceiling was edited and no file was split to game the metric. PRIOR ENTRY: LOWERING 2026-10-18, 17,424 -> 17,419 — the gate asked for it by name (`ratchet is loose`, naming 17,419). The gain is an EXTRACTION: `install --full` (road-to-a-setup-that-decides-itself 3.5) needed seven lines in `src/scripts/install.ts`, a file 3,618 lines past the ceiling, so the `--tools`/`--ai` merge helper moved out to `src/install/toolsArg.ts`, which owns nothing else; install.ts goes 5,118 -> 5,113. No ceiling was edited and no file was split to game the metric. PRIOR ENTRY: LOWERING 2026-10-13, 17,485 -> 17,466 — the gate asked for it by name (`ratchet is loose`, naming 17,466), and `check_source_size_budget.test.ts` pins baseline == live total, so it is required rather than optional. The gain is an EXTRACTION, which is the shape this convention accepts: the settings-surface assertion needed three lines in `src/scripts/release.ts`, a file 211 lines past the ceiling, so `set_template_pin` moved out to `src/scripts/release_env.ts`, which already owns its two manifest-version siblings for exactly this stated reason and sits far under the ceiling; release.ts goes 1,730 -> 1,711. The `die` call is inlined there as a stderr write plus `SystemExitError`, because `release_publication.ts` imports from `release_env.ts` and reaching back for `die` would be a cycle. No ceiling was edited and no file was split to game the metric. PRIOR ENTRY: LOWERING 2026-10-13, 17,516 -> 17,485 — the gate asked for it by name (`ratchet is loose`, naming 17,485), and the gain is an EXTRACTION, which is the shape this convention accepts. road-to-a-search-answer-a-model-can-choose-from 1.1/1.2 described `suggest_skill_for_task` properly in `tools.ts` — what a row now carries, and why the default depth is 8 — which cost six lines in a file 521 lines past the ceiling and reddened this ratchet by exactly those six. Rather than re-pin the baseline, the whole allowlist ENTRY moved to `src/scripts/mcp_server/suggest_skill.ts`, which already owns that tool’s handler for the same stated reason; `tools.ts` goes 2,021 -> 1,984 and the net is -31. The import back is TYPE-only, so the cycle is erased at runtime. No ceiling was edited and no file was split to game the metric. PRIOR ENTRY: LOWERING 2026-10-09, 17,550 -> 17,516 — the gate asked for it by name after `REMOVED_KEYS` and its once-per-run warning moved out of `src/scripts/_lib/agent_settings.ts` (1,510 lines) into `src/scripts/_lib/settings_removed_keys.ts`, so the settings-key retirement batch adds its registry entries in a file under the ceiling instead of growing the excess; the retirement itself also deletes legacy rename-map rows and the setup-hint settings read from `src/scripts/install.ts`. Earlier: LOWERING 2026-10-05, 17,571 -> 17,550 — a lowering commit, and the gate asked for it BY NAME: it reported `ratchet is loose` and named 17,550; `check_source_size_budget.test.ts` then pins baseline == live total, so this is required rather than optional. The gain IS this branch's own work and it is a DEDUPLICATION, which this convention accepts: all five CliClient subclass constructors forwarded six option fields to super() by name, which is why a seventh (`consumer`) was silently dropped and every CLI call booked as `unknown`. Replacing the five field lists with `{ ...opts, model: ... }` removes 27 lines from src/scripts/ai_council/clients.ts (2,858 -> 2,831) against the +6 the consumer fix added, so the net is -21. No ceiling was edited and no file was split to game the metric. The count is tree-derived (line counts over src/**/*.ts) and container-independent, unlike the projection-surface gates whose local readings diverge. Verified with `npx tsc --noEmit` clean and the clients suite green in this checkout. PRIOR ENTRY: LOWERING 2026-10-05, 17,585 -> 17,571 — a lowering commit, and the gate asked for it BY NAME: it reported `ratchet is loose` and named 17,571. The gain IS this branch's own work and it is an EXTRACTION, which is the only shape this convention accepts: road-to-an-installed-layer-that-is-thinned step 1.1 adds a thinning call to the global deploy loop, and pays for those lines by moving `_resolve_global_rule_scope` out of `src/scripts/install.ts` into `src/install/globalRuleScope.ts` behind a same-signature wrapper, and removes the two imports the extraction orphaned (install.ts 5,180 -> 5,156). The user-global whitelist rows in `src/scripts/_lib/agent_settings.ts` push that file 1,499 -> 1,510, so the net is -5 rather than -15. No ceiling was edited and no file was split to game the metric. Verified by running the gate in this worktree after `npx tsc --noEmit` passed clean. PRIOR ENTRY: LOWERING 2026-10-02, 17,620 -> 17,592 — a lowering commit, and the gate asked for it BY NAME: it reported `ratchet is loose` and named 17,592. The gain IS this branch's own work, and it is a deduplication rather than a sweep. `GLOBAL_DEPLOY_SOURCES` was defined TWICE — in `src/scripts/install.ts` and in `src/install/wizard-plan.ts` — and the two copies were byte-identical across all 18 host rows, which is a duplicate that stays correct exactly until somebody edits one of them. road-to-rule-triggers-and-links-that-hold step 1.2 did that: it added `contexts/` and `guidelines/` to the install.ts copy and the wizard kept installing without them, so the deduplication is the fix for a defect this branch introduced, not an opportunistic tidy. install.ts now imports and re-exports the wizard-plan definition, so every caller is unchanged, and the file goes 5,231 -> 5,175 lines. Verified by running the gate in this worktree after `npm run typecheck` passed clean. PRIOR ENTRY: LOWERING 2026-10-02, 17,734 -> 17,620 — a lowering commit, and the gate asked for it BY NAME: it reported `ratchet is loose` and named 17,620 as the number to write. The gain is not this branch's own work; it is the net of the lanes that merged into main while this branch was in flight, which is exactly the case the clause below exists for — a tree that got smaller while a baseline stood still would let the gain be given back silently by the next change. Verified in a FRESH detached checkout of the pushed head rather than in the working worktree, because the first reading was taken in a tree that had not finished its base sync and reported the two numbers the other way round; the fresh checkout measures 17,620 against a 17,734 baseline over 1,582 scanned files. `landed` is refreshed deliberately, for the reason every entry below gives: checkRatchet returns `improved` BEFORE it evaluates staleness, so an entry left high while the tree measures lower would never expire at any age. PRIOR ENTRY: LOWERING 2026-10-01, 17,745 -> 17,734 — a lowering commit, and the gate asked for it by name. road-to-a-hook-bundle-with-one-yaml-reader 3.1 split the windsurf renderer out of `condense.ts` into the new under-cap `src/scripts/_lib/windsurf_render.ts`, and `strip_frontmatter` moved with it as the render's one non-trivial dependency. `condense.ts` went 2,728 -> 2,717 excess lines. The direction is honest about its own history: an earlier commit on this branch kept the renderer INLINE in `condense.ts` and CI caught it as 20 new violations — this entry is that fix, not a sweep, and the lowering is the by-product of putting the code where it belonged. Nothing was deleted: the renderer and the stripper are both still called, by TWO callers now rather than one, and `condense.ts` re-exports `strip_frontmatter` so no importer's path changed. The new module lands at 64 lines, far under its own cap, so it contributes zero excess. LOCAL READING, same discriminator every entry below uses: the gate walks authored source under `src/`, and the only untracked path `git status --porcelain -uall -- src` reports is that new module, committed in this same change — so a clean CI checkout of this commit measures the same 17,734. If CI reads anything else, CI's number is the correct one and this note is the record of why. `landed` is refreshed deliberately, for the reason the prior entry gives: checkRatchet returns `improved` BEFORE it evaluates staleness, so an entry left high while the tree measures lower would never expire at any age. PRIOR ENTRY: LOWERING 2026-09-30, 17,746 -> 17,745 — a lowering commit, and the gate asked for it by name. The direction is the surprising one again: this branch ADDED a feature to `install.ts` (an opt-in host env write) and that file came out SHORTER than it went in, 5,270 -> 5,269. The whole mechanism — the two-row allow table, the settings reader, the env-block builder and the bridge wrapper — lives in the new under-cap `src/scripts/_lib/host_env_write.ts`, so `install.ts` pays ONE import line and one expression for it; and the three-line `for` loop over healed plugin ids in the same function collapsed to one, which is inside the function the change already edits. The gain is a MOVE plus one tightening, never a deletion: nothing was dropped and nothing was swept. That module boundary is also the better one on its own terms — one place now owns which host variable this package may write, which is the question the owner decision of 2026-09-30 turns on. LOCAL READING, on the same discriminator every entry below uses: the gate walks authored source under `src/`, and `git status --porcelain -uall -- src` reported ZERO untracked files, so a clean CI checkout of this commit measures the same 17,745. If CI reads anything else, CI's number is the correct one and this note is the record of why. `landed` is refreshed deliberately: checkRatchet returns `improved` BEFORE it evaluates staleness, so an entry left at 17,746 while the tree measures 17,745 would never expire at any age. PRIOR ENTRY: LOWERING 2026-09-29, 17,748 -> 17,746 — a lowering commit, same doctrine as every entry below, and the gate asked for it by name. This branch ADDED two gate scripts, a guard and a shared lib under `src/`, so the direction is the surprising one and worth stating: the new files each land under their own cap and contribute zero EXCESS, while factoring the shell write shapes out of `block_kernel_rule_writes` into `_lib/shell_write_shapes.ts` moved lines out of a file that was over its cap and into one that is not. Net -2. LOCAL READING, on the same discriminator every entry below uses: the gate walks authored source under `src/`, and `git status --porcelain -uall -- src` reported ZERO untracked files, so a clean CI checkout of this commit measures the same 17,746. If CI reads anything else, CI's number is the correct one and this note is the record of why. `landed` is refreshed deliberately: checkRatchet returns `improved` BEFORE it evaluates staleness, so an entry left at 17,748 while the tree measures 17,746 would never expire at any age. PRIOR ENTRY: LOWERING 2026-09-29, 17,762 -> 17,748 — a lowering commit, same doctrine as every entry below, and the gate asked for it by name. Reporting the host traffic environment in `doctor` needed a new surface; rather than pay those lines against `src/scripts/_cli/cmd_doctor.ts`, already far over the cap, the whole network-posture block moved out into the new under-cap `src/scripts/_cli/doctor_network_posture.ts`, which is also where the new logic lives: one module owns which traffic variables exist, how each is read, and how an absent one is reported, so the unit is coherent rather than a line-count trim. cmd_doctor.ts 3,618 -> 3,604; total 17,762 -> 17,748. The gain is a MOVE, not a deletion — nothing was dropped and nothing was swept. `landed` is refreshed deliberately, for the reason the prior entries record: checkRatchet returns `improved` BEFORE it evaluates staleness, so an entry left at 17,762 while the tree measures 17,748 would never expire at any age, and the gate only ADVISES on a loose ratchet while `check_source_size_budget.test.ts` blocks — that asymmetry is what forces a lowering commit to carry its own baseline update. PRIOR ENTRY: LOWERING 2026-09-27, 17,765 -> 17,762 — the second half of the same repair, and a lowering for the same reason. Closing the remaining preservation defects needed lines in two over-cap files: `src/scripts/install.ts` (route the generated Claude Desktop marker through the tracker, hand the rule-rewrite its skip set) and `src/server/routes/wizard.ts` (surface the conflict count, stop reporting exit 3 as a failure). Both were paid from the same subject rather than from the ratchet: `_files_by_tool_from_bridges` joined its sibling in `src/install/manifestFiles.ts`, which now owns the whole per-tool inventory, and the wizard's exit-code semantics moved into `src/install/preserve.ts` beside `installDoneSummary`, which already lives there for this exact reason. install.ts 5,277 -> 5,270; wizard.ts 1,500 -> 1,504. PRIOR ENTRY: LOWERING 2026-09-27, 17,784 -> 17,765 — a lowering commit, same doctrine as the entry it replaces. Repairing the install-manifest digest loss needed new state in `_update_installed_tools_manifest` (a recorded-inventory read, a preserved-path index, a reconciliation call). Rather than pay that against `src/scripts/install.ts`, already 3,777 over the cap, the manifest file-inventory block (`_sha256_of_file`, `_file_entry`, `_files_by_tool_from_deploy` — 29 lines) moved out into the under-cap `src/install/manifestFiles.ts`, which is where the new logic lives too: one module now owns what the manifest's per-tool `files[]` holds, how it is read back, and how the two reconcile, so the unit is coherent rather than a line-count trim. install.ts 5,296 -> 5,277; total 17,784 -> 17,765. PRIOR ENTRY: LOWERING 2026-09-20, 17,858 -> 17,784 — a lowering commit, not a reconciliation, but measured under the same doctrine the four entries below carry: the committed number is the gate's own reading on the MERGED tree, taken after origin/main was merged into drain/headless-log-write rather than from either side. The branch's transaction-log write added 27 lines to `src/scripts/install.ts`, already 3,897 over the cap, taking the total to 17,885. Rather than pay that, the `json.dumps` byte-parity block (`jsonStrNoAscii`, `_jsonScalar`, `_dumpIndent`, `jsonDumpsIndent`, `jsonDumpsCompact` — 101 lines) moved out of `install.ts` into the under-cap `src/scripts/_lib/json_python_parity.ts`: pure, total functions of their input carrying no installer state, so the unit is coherent rather than a line-count trim. install.ts 5,397 -> 5,296; total 17,885 -> 17,784, a net -74 against the prior baseline. PRIOR ENTRY: MERGE RECONCILIATION 2026-09-14, 17,861 -> 17,858 — the FOURTH reconciliation of this entry, same doctrine as the three below: the committed number is the gate's own reading on the MERGED tree, never either side's. Neither branch earned the -3; it falls out of main having absorbed drain/release-head-field, whose `derive_head_prefill` extraction moved the span-to-prefill composition into an under-cap module. Taking this branch's 17,861 would have silently given that gain back. PRIOR ENTRY: MERGE RECONCILIATION 2026-09-13, 17,863 -> 17,861 — the THIRD reconciliation of this entry in one day, and re-measured on the merged tree rather than taken from either side, which is the only resolution that converges. drain/adversarial-verification reached 17,864 by paying for a `forge_protection` block and a cascade-base module entirely in files under the 1,500-line cap; the incoming reconciliation reached 17,863 from different work. Neither describes the merge. PRIOR ENTRY: MERGE RECONCILIATION 2026-09-13, 17,944/17,866 -> 17,863. drain/decision-closure and drain/breaking-line-contradiction each lowered from the SAME 17,947 base in parallel -- this branch to 17,944 (net -3: the ownership vocabulary, its two Iron-Law sets and the merged default-mode map moved out of ai_council/config.ts into ai_council/ownership_classes.ts, and the settings-rename block moved out of _lib/agent_settings.ts into _lib/settings_renamed_keys.ts, both UNDER the 1500 cap so both cost nothing) and main to 17,866. Taking either side alone is wrong in a different direction, which is the doctrine this entry already carries from 2026-09-03 and 2026-09-07: main's value silently discards this branch's earned -3, and this branch's value RAISES the baseline against main and weakens the gate. The committed number is neither -- it is the gate's own output on the MERGED tree, where both reductions apply. MAIN-SIDE ENTRY, carried so neither branch's record is lost: Lowered 17,947 -> 17,866 on 2026-09-13 by drain/breaking-line-contradiction, on this entry's own doctrine. The branch adds the BACKWARD half of the MIGRATION.md obligation -- a refusal for a major cut whose BREAKING section has no migration entry -- and writing it into release.ts came in at +61, because that file sits ~375 lines PAST the 1500 cap so every line there is one unit. Paid down rather than baselined, and the move was the coherent unit rather than the minimum one: BOTH refusals went, the new backward half and the pre-existing forward half (assert_scheduled_deprecations_clear), into _lib/release_migration_gate.ts at 184 lines and therefore UNDER the cap, so the pair and all their rationale now cost nothing. They moved on merit rather than only on arithmetic -- they are the two halves of one obligation, written eleven months apart, and release.ts held only the two call sites. parse_version stayed module-private in release.ts and the lib carries a two-line _minor_patch instead: exporting a private helper to serve one caller would widen the surface of the file the move exists to narrow. release.ts 1,875 -> 1,733: a branch that ADDED a pipeline refusal leaves the file eighty-one lines shorter than it found it. LOCAL READING, ADMISSIBLE ON THIS ENTRY'S OWN DISCRIMINATOR: the gate walks only SOURCE_ROOTS=['src'] counting excess over the 1500-line ceiling, and `git status --porcelain -uall -- src/` reports nothing staged and nothing untracked at this commit, so a clean CI checkout measures the same 17,866. If CI reads anything else, CI's number is the correct one and this note is the record of why. Carried in this commit because tests/scripts/check_source_size_budget.test.ts asserts baseline == live and therefore BLOCKS where the gate only advises -- which is how CI found it: the gate exited 0 with a loose-ratchet warning and the test went red. PRIOR ENTRY: Lowered 17,959 -> 17,947 on 2026-09-11 by the findings-ledger branch, on this entry's own doctrine. The branch adds step 7 to release.ts, which sits ~326 lines PAST the 1500 cap so every line there is one unit, and it came in at +145. Paid down rather than baselined, in two moves. `settle_findings_ledger` and `_blocking_without_disposition` moved out of release.ts into _lib/release_findings_ingest.ts -- 95 lines, and that module is under the cap, so the step and its rationale now cost nothing. It moved on merit rather than only on arithmetic: the module already owns every message the step prints and every argv it builds, and release.ts held only the sequencing. Then the `--ci` fallback dispatch of the three tag-triggered workflows -- 24 lines of loop and warning with no reader elsewhere in step 10 -- moved into _lib/release_tag_dispatch.ts, also under the cap. release.ts 1,826 -> 1,814: a branch that ADDED a pipeline step leaves the file twelve lines shorter than it found it. LOCAL READING, ADMISSIBLE ON THIS ENTRY'S OWN DISCRIMINATOR: the gate walks only SOURCE_ROOTS=['src'] counting excess over the 1500-line ceiling, and `git status --porcelain -uall -- src/` reports the branch's new src/ file staged and nothing untracked, so a clean CI checkout of this commit measures the same 17,947. If CI reads anything else, CI's number is the correct one and this note is the record of why. Carried in this commit because tests/scripts/check_source_size_budget.test.ts asserts baseline == live and therefore BLOCKS where the gate only advises. PRIOR ENTRY: Lowered 17,963 -> 17,959 on 2026-09-09 by feat/cdd-fidelity-council, on the same shape as the entry below and with the same discriminator. The branch's src-link rewrite (a blind review found 253 of 268 links under dist/agent-src/guidelines/ dead, because condense.ts folded only the docs/ prefixes and never (../)+src/rules|skills) came in at +15 excess: condense.ts sits ~1,208 lines PAST the 1500 cap, so every line there is one unit. Paid down rather than baselined, in the way this entry's doctrine prescribes. `_rewrite_body_links` and its two regex constants moved out of condense.ts into _lib/guidelines_lane.ts, 151 lines and therefore UNDER the cap, so the function and its prose now cost nothing. It moved on merit rather than only on arithmetic: every rule the rewriter applies is a statement about which source tree projects where, which is that module's own subject, and condense.ts held it only because that is where the projector lives. condense.ts 2,712 -> 2,708 net, after the one import line and the one call-site rename -- a branch that ADDED a rewrite rule leaves the file four lines shorter than it found it. LOCAL READING, ADMISSIBLE ON THIS ENTRY'S OWN DISCRIMINATOR: the gate walks only SOURCE_ROOTS=['src'] counting excess over the 1500-line ceiling, and `git status --porcelain -uall -- src/` reports the branch's new src/ files tracked and nothing untracked, so a clean CI checkout of this commit measures the same 17,959. If CI reads anything else, CI's number is the correct one and this note is the record of why. Carried in this commit because tests/scripts/check_source_size_budget.test.ts asserts baseline == live and therefore BLOCKS where the gate only advises. PRIOR ENTRY: Lowered 17,973 -> 17,963 on 2026-09-08 by drain/graph-shipped-close. The branch registers five code-graph MCP tools (road-to-a-graph-that-is-shipped 4.1). Their five records and schemas are ~250 lines, and putting them in mcp_server/tools.ts -- which sits ~500 lines PAST the 1500 cap, so every line there is one unit -- would have cost ~250 excess. They live in mcp_server/graph_tools.ts instead (~280 lines, UNDER the cap, so they and their prose cost nothing), and tools.ts spreads them into ALLOWLIST in two lines: one import and one `...GRAPH_TOOLS,`. Those two were paid for rather than baselined, in the way this entry's doctrine prescribes: `_strip` and `_resolvePath` -- a whitespace trim and a tolerant realpath, generic by nature -- moved out of tools.ts into mcp_server/path_util.ts, also under the cap. They are imported under their original underscore names, so all 28 call sites are unchanged and a two-function move does not read as a sweep. tools.ts 2,025 -> 2,015: -12 from the extraction, +2 from the registration, net -10 for a branch that ADDED a feature. CORRECTED 2026-09-08 after an independent review checked the figure against the tree -- this sentence read '2,025 -> 2,013, net -12, against the +2 the registration needed', which states an intermediate file length as the final one and leaves the arithmetic (-12) and the conclusion (-10) describing different trees. `git show origin/main:...tools.ts | wc -l` is 2025 and the working tree is 2015. The TOTAL, 17,963, was always the gate's own output and is unchanged. Every other file this branch touches or creates -- code_graph/verbs.ts, code_graph/cli.ts, code_graph/build.ts, code_graph/detect.ts, code_graph/query.ts, code_graph/sqlite_store.ts, code_graph/types.ts, _lib/regression_neighbourhood.ts -- is under the 1500 ceiling before and after, so it contributes zero excess whatever it grew by. LOCAL READING, ADMISSIBLE ON THIS ENTRY'S OWN DISCRIMINATOR: the gate walks only SOURCE_ROOTS=['src'] counting excess over the 1500-line ceiling, and `git status --porcelain -uall -- src/` reports the two new src/ files staged and nothing untracked, so a clean CI checkout of this commit measures the same 17,963. If CI reads anything else, CI's number is the correct one and this note is the record of why. Carried in this commit because tests/scripts/check_source_size_budget.test.ts asserts baseline == live and therefore BLOCKS where the gate only advises. PRIOR ENTRY: Lowered 17,974 -> 17,973 on 2026-09-08 by drain/topology-c1. The branch adds a live-path emit to council_cli.ts, which sits 2,454 lines PAST the 1500 cap so every line there is one unit, and paid its own way down rather than raising the baseline, in the way this entry's doctrine prescribes. The twelve-line `all_responses` assembly (a spread, three conditionals and a push) moved out of council_cli.ts into ai_council/deliberation_metrics.ts::runCallsFrom, 353 lines and therefore UNDER the cap, so the six stage labels and their prose cost nothing. It moved on merit rather than only on arithmetic: 'which calls did this run make, and at which stage' is that module's own subject, and the CLI held the list only as a flat array with the stage boundaries implicit in the order -- both readings now come out of one walk, so the billing total and the attribution can never be computed over different sets. council_cli.ts 3,955 -> 3,954 net, after the two call lines, the import and the one payload key the feature needed. LOCAL READING, ADMISSIBLE ON THIS ENTRY'S OWN DISCRIMINATOR: the gate walks only SOURCE_ROOTS=['src'] counting excess over the 1500-line ceiling, and `git status --porcelain -uall -- src/` reports the two new src/ files staged and nothing untracked, so a clean CI checkout of this commit measures the same 17,973. If CI reads anything else, CI's number is the correct one and this note is the record of why. Carried in this commit because tests/scripts/check_source_size_budget.test.ts asserts baseline == live and therefore BLOCKS where the gate only advises. PRIOR ENTRY: Lowered 18,016 -> 17,974 on 2026-09-07 by fix/single-delivery-unconditional. SETTLED FIGURE, and it supersedes an intra-session 17,962 this same branch committed earlier — read the direction against MAIN, which is what the ratchet protects: main is 18,016, the branch leaves 17,974, net -42. The 17,962 was this branch's own low before a neutral review returned twelve findings; fixing them added a real mechanism to mcp_server and condense.ts (the flat-wrapper carriage gate the review showed was missing, plus its four-skip predicate), and condense.ts sits ~1,215 lines PAST the cap so each of those lines is one unit. Paid down first, in the way this entry's doctrine prescribes: _suggestSkillForTaskHandler and its 18-line docstring moved out of mcp_server/tools.ts (2,079 -> 2,025) into mcp_server/suggest_skill.ts, 72 lines and UNDER the cap, so its prose costs nothing. The residual +12 against the intra-session low is the gate's own output on the settled tree and is recorded rather than engineered away, because the alternative was extracting _nested_command_subpath and its two callers out of condense.ts - which needs MODULE_STATE, _relativeToPosix and _domains_command_logical passed in, a wider diff than the finding warrants and one no review asked for. LOCAL READING, ADMISSIBLE ON THIS ENTRY'S OWN DISCRIMINATOR: the gate walks only SOURCE_ROOTS=['src'] counting excess over the 1500-line ceiling, and `git status --porcelain -uall -- src/` reports the three new src/ files staged and nothing untracked, so a clean CI checkout of this commit measures the same 17,974. If CI reads anything else, CI's number is the correct one and this note is the record of why. Carried in this commit because tests/scripts/check_source_size_budget.test.ts asserts baseline == live and therefore BLOCKS where the gate only advises. PRIOR ENTRY: MERGE RECONCILIATION 2026-09-07, 18,061/18,017 -> 18,016. drain/admissible-council-seats and fix/release-obligation-answerable each lowered from the SAME 18,062 base in parallel — main to 18,061 (net -1: curlJsonPost, the seat-status helpers and the per-seat config parsing moved out of the three over-ceiling council files) and the branch to 18,017 (net -45: the /dev/tty prompt helpers moved out of release.ts into _lib/tty_prompt.ts, 76 lines and UNDER the cap, taking release.ts 1871 -> 1826). Taking either side alone is wrong in a different direction, which is the reconciliation doctrine this entry already carried from 2026-09-03: main's value silently discards the branch's earned -45, and the branch's value RAISES the baseline against main and weakens the gate. The committed number is neither — it is the gate's own output on the MERGED tree, where both reductions apply, and it equals the arithmetic (18,062 - 45 - 1 = 18,016) rather than being reconciled by it. LOCAL READING, ADMISSIBLE ON THIS ENTRY'S OWN DISCRIMINATOR: the gate walks only SOURCE_ROOTS=['src'] counting excess over the 1500-line ceiling, and `git status --porcelain -uall -- src/` reports ZERO untracked files, so a clean CI checkout of this commit measures the same 18,016. If CI reads anything else, CI's number is the correct one and this note is the record of why. Carried in the merge commit because tests/scripts/check_source_size_budget.test.ts asserts baseline == live and therefore BLOCKS where the gate only advises. PRIOR ENTRY: Lowered 18,062 -> 18,061 on 2026-09-07 by drain/admissible-council-seats. The branch's own additions to the three over-ceiling files (ai_council/config.ts, council_cli.ts, ai_council/clients.ts) came in at +96 excess and were paid down to -1 rather than baselined, in the four ways this entry's doctrine prescribes: `curlJsonPost` moved out of clients.ts into ai_council/api_transport.ts (UNDER the cap, so the prose and the three new provider shims cost nothing); the seat-status helpers moved out of council_cli.ts into ai_council/status_surface.ts, taking an orphaned doc comment with them; the three new per-seat config fields' parsing moved out of config.ts into ai_council/seat_policy.ts::parseSeatFields; and three prose blocks that the branch's own transport repair made FACTUALLY FALSE (the `openai` / `google-genai` Python-SDK claims, and a `_curlJsonPost` pointer to a function that had moved) were corrected and shortened in the same change. LOCAL READING, ADMISSIBLE ON THIS ENTRY'S OWN DISCRIMINATOR: the gate walks only SOURCE_ROOTS=['src'] counting excess over the 1500-line ceiling, and `git status --porcelain -uall -- src/` reports zero untracked files with the five new src/ files staged, so a clean CI checkout of this commit measures the same 18,061. If CI reads anything else, CI's number is the correct one and this note is the record of why. Carried here because tests/scripts/check_source_size_budget.test.ts:166 asserts baseline == live and therefore blocks where the gate only advises -- the lowering commit must carry its own baseline update. Lowered 18,068 -> 18,062 on 2026-09-06 by drain/host-enforcement-truth. Collapsing the five per-host binding constants in install.ts into src/scripts/hooks/host_lowering.yaml removed 29 lines from a file ~3,900 past the 1500 cap, where every line costs one excess; the journal's surface column and its extracted migration helper gave 23 back. Lowered 18,245 -> 18,230 on 2026-09-02 by drain/publication-integrity-option-a. Phase 2 Option A moved the authoring instruction out of the generator: release.ts, which sits ~530 lines PAST the 1500 cap so every line there costs one excess, loses the comment emission, a 16-line HEAD_DEFAULT doc block and its alias const, and gains a shorter writer docstring. The doc block moved to _lib/release_material.ts, which is 289 lines and therefore UNDER the cap, so the same prose now costs nothing. Net -15. The branch first came in at +8 and paid its own way down rather than raising the baseline. BRANCH-SIDE ENTRY: Lowered 17,947 -> 17,944 on 2026-09-13 by drain/decision-closure, on this entry's own doctrine and at the gate's own request. The branch's ownership-axis additions to ai_council/config.ts came in at +86 excess: that file sits ~700 lines PAST the 1500 cap, so every line there is one unit. Paid down rather than baselined, in one move. The eight ownership class names, the two Iron-Law sets, the merged default-mode map and the mode-check function moved out of config.ts into ai_council/ownership_classes.ts -- 91 lines, UNDER the cap, so the vocabulary and its prose now cost nothing. It moved on merit rather than only on arithmetic: the roadmap-side gate lint_decision_classes needs the same eight names and has no business importing the council's whole schema to learn them, and the loader now carries three lines where it carried twenty-four. config.ts 2,182 -> 2,179: a branch that ADDED an entire decision axis leaves the file three lines shorter than it found it. Every other src/ file this branch creates -- lint_decision_classes.ts, lint_roadmap_producers.ts, closure_scan.ts, council_record_shape.ts, scope_growth.ts, ownership_classes.ts -- is under the 1500 ceiling, so it contributes zero excess whatever it grew by. LOCAL READING, ADMISSIBLE ON THIS ENTRY'S OWN DISCRIMINATOR: the gate walks only SOURCE_ROOTS=['src'] counting excess over the 1500-line ceiling, and `git status --porcelain -uall -- src/` reports the branch's new src/ files tracked and nothing untracked, so a clean CI checkout of this commit measures the same 17,944. If CI reads anything else, CI's number is the correct one and this note is the record of why. Carried in this commit because tests/scripts/check_source_size_budget.test.ts asserts baseline == live and therefore BLOCKS where the gate only advises. PRIOR ENTRY: Lowered 17,959 -> 17,947 on 2026-09-11 by the findings-ledger branch, on this entry's own doctrine. The branch adds step 7 to release.ts, which sits ~326 lines PAST the 1500 cap so every line there is one unit, and it came in at +145. Paid down rather than baselined, in two moves. `settle_findings_ledger` and `_blocking_without_disposition` moved out of release.ts into _lib/release_findings_ingest.ts -- 95 lines, and that module is under the cap, so the step and its rationale now cost nothing. It moved on merit rather than only on arithmetic: the module already owns every message the step prints and every argv it builds, and release.ts held only the sequencing. Then the `--ci` fallback dispatch of the three tag-triggered workflows -- 24 lines of loop and warning with no reader elsewhere in step 10 -- moved into _lib/release_tag_dispatch.ts, also under the cap. release.ts 1,826 -> 1,814: a branch that ADDED a pipeline step leaves the file twelve lines shorter than it found it. LOCAL READING, ADMISSIBLE ON THIS ENTRY'S OWN DISCRIMINATOR: the gate walks only SOURCE_ROOTS=['src'] counting excess over the 1500-line ceiling, and `git status --porcelain -uall -- src/` reports the branch's new src/ file staged and nothing untracked, so a clean CI checkout of this commit measures the same 17,947. If CI reads anything else, CI's number is the correct one and this note is the record of why. Carried in this commit because tests/scripts/check_source_size_budget.test.ts asserts baseline == live and therefore BLOCKS where the gate only advises. PRIOR ENTRY: Lowered 17,963 -> 17,959 on 2026-09-09 by feat/cdd-fidelity-council, on the same shape as the entry below and with the same discriminator. The branch's src-link rewrite (a blind review found 253 of 268 links under dist/agent-src/guidelines/ dead, because condense.ts folded only the docs/ prefixes and never (../)+src/rules|skills) came in at +15 excess: condense.ts sits ~1,208 lines PAST the 1500 cap, so every line there is one unit. Paid down rather than baselined, in the way this entry's doctrine prescribes. `_rewrite_body_links` and its two regex constants moved out of condense.ts into _lib/guidelines_lane.ts, 151 lines and therefore UNDER the cap, so the function and its prose now cost nothing. It moved on merit rather than only on arithmetic: every rule the rewriter applies is a statement about which source tree projects where, which is that module's own subject, and condense.ts held it only because that is where the projector lives. condense.ts 2,712 -> 2,708 net, after the one import line and the one call-site rename -- a branch that ADDED a rewrite rule leaves the file four lines shorter than it found it. LOCAL READING, ADMISSIBLE ON THIS ENTRY'S OWN DISCRIMINATOR: the gate walks only SOURCE_ROOTS=['src'] counting excess over the 1500-line ceiling, and `git status --porcelain -uall -- src/` reports the branch's new src/ files tracked and nothing untracked, so a clean CI checkout of this commit measures the same 17,959. If CI reads anything else, CI's number is the correct one and this note is the record of why. Carried in this commit because tests/scripts/check_source_size_budget.test.ts asserts baseline == live and therefore BLOCKS where the gate only advises. PRIOR ENTRY: Lowered 17,973 -> 17,963 on 2026-09-08 by drain/graph-shipped-close. The branch registers five code-graph MCP tools (road-to-a-graph-that-is-shipped 4.1). Their five records and schemas are ~250 lines, and putting them in mcp_server/tools.ts -- which sits ~500 lines PAST the 1500 cap, so every line there is one unit -- would have cost ~250 excess. They live in mcp_server/graph_tools.ts instead (~280 lines, UNDER the cap, so they and their prose cost nothing), and tools.ts spreads them into ALLOWLIST in two lines: one import and one `...GRAPH_TOOLS,`. Those two were paid for rather than baselined, in the way this entry's doctrine prescribes: `_strip` and `_resolvePath` -- a whitespace trim and a tolerant realpath, generic by nature -- moved out of tools.ts into mcp_server/path_util.ts, also under the cap. They are imported under their original underscore names, so all 28 call sites are unchanged and a two-function move does not read as a sweep. tools.ts 2,025 -> 2,015: -12 from the extraction, +2 from the registration, net -10 for a branch that ADDED a feature. CORRECTED 2026-09-08 after an independent review checked the figure against the tree -- this sentence read '2,025 -> 2,013, net -12, against the +2 the registration needed', which states an intermediate file length as the final one and leaves the arithmetic (-12) and the conclusion (-10) describing different trees. `git show origin/main:...tools.ts | wc -l` is 2025 and the working tree is 2015. The TOTAL, 17,963, was always the gate's own output and is unchanged. Every other file this branch touches or creates -- code_graph/verbs.ts, code_graph/cli.ts, code_graph/build.ts, code_graph/detect.ts, code_graph/query.ts, code_graph/sqlite_store.ts, code_graph/types.ts, _lib/regression_neighbourhood.ts -- is under the 1500 ceiling before and after, so it contributes zero excess whatever it grew by. LOCAL READING, ADMISSIBLE ON THIS ENTRY'S OWN DISCRIMINATOR: the gate walks only SOURCE_ROOTS=['src'] counting excess over the 1500-line ceiling, and `git status --porcelain -uall -- src/` reports the two new src/ files staged and nothing untracked, so a clean CI checkout of this commit measures the same 17,963. If CI reads anything else, CI's number is the correct one and this note is the record of why. Carried in this commit because tests/scripts/check_source_size_budget.test.ts asserts baseline == live and therefore BLOCKS where the gate only advises. PRIOR ENTRY: Lowered 17,974 -> 17,973 on 2026-09-08 by drain/topology-c1. The branch adds a live-path emit to council_cli.ts, which sits 2,454 lines PAST the 1500 cap so every line there is one unit, and paid its own way down rather than raising the baseline, in the way this entry's doctrine prescribes. The twelve-line `all_responses` assembly (a spread, three conditionals and a push) moved out of council_cli.ts into ai_council/deliberation_metrics.ts::runCallsFrom, 353 lines and therefore UNDER the cap, so the six stage labels and their prose cost nothing. It moved on merit rather than only on arithmetic: 'which calls did this run make, and at which stage' is that module's own subject, and the CLI held the list only as a flat array with the stage boundaries implicit in the order -- both readings now come out of one walk, so the billing total and the attribution can never be computed over different sets. council_cli.ts 3,955 -> 3,954 net, after the two call lines, the import and the one payload key the feature needed. LOCAL READING, ADMISSIBLE ON THIS ENTRY'S OWN DISCRIMINATOR: the gate walks only SOURCE_ROOTS=['src'] counting excess over the 1500-line ceiling, and `git status --porcelain -uall -- src/` reports the two new src/ files staged and nothing untracked, so a clean CI checkout of this commit measures the same 17,973. If CI reads anything else, CI's number is the correct one and this note is the record of why. Carried in this commit because tests/scripts/check_source_size_budget.test.ts asserts baseline == live and therefore BLOCKS where the gate only advises. PRIOR ENTRY: Lowered 18,016 -> 17,974 on 2026-09-07 by fix/single-delivery-unconditional. SETTLED FIGURE, and it supersedes an intra-session 17,962 this same branch committed earlier — read the direction against MAIN, which is what the ratchet protects: main is 18,016, the branch leaves 17,974, net -42. The 17,962 was this branch's own low before a neutral review returned twelve findings; fixing them added a real mechanism to mcp_server and condense.ts (the flat-wrapper carriage gate the review showed was missing, plus its four-skip predicate), and condense.ts sits ~1,215 lines PAST the cap so each of those lines is one unit. Paid down first, in the way this entry's doctrine prescribes: _suggestSkillForTaskHandler and its 18-line docstring moved out of mcp_server/tools.ts (2,079 -> 2,025) into mcp_server/suggest_skill.ts, 72 lines and UNDER the cap, so its prose costs nothing. The residual +12 against the intra-session low is the gate's own output on the settled tree and is recorded rather than engineered away, because the alternative was extracting _nested_command_subpath and its two callers out of condense.ts - which needs MODULE_STATE, _relativeToPosix and _domains_command_logical passed in, a wider diff than the finding warrants and one no review asked for. LOCAL READING, ADMISSIBLE ON THIS ENTRY'S OWN DISCRIMINATOR: the gate walks only SOURCE_ROOTS=['src'] counting excess over the 1500-line ceiling, and `git status --porcelain -uall -- src/` reports the three new src/ files staged and nothing untracked, so a clean CI checkout of this commit measures the same 17,974. If CI reads anything else, CI's number is the correct one and this note is the record of why. Carried in this commit because tests/scripts/check_source_size_budget.test.ts asserts baseline == live and therefore BLOCKS where the gate only advises. PRIOR ENTRY: MERGE RECONCILIATION 2026-09-07, 18,061/18,017 -> 18,016. drain/admissible-council-seats and fix/release-obligation-answerable each lowered from the SAME 18,062 base in parallel — main to 18,061 (net -1: curlJsonPost, the seat-status helpers and the per-seat config parsing moved out of the three over-ceiling council files) and the branch to 18,017 (net -45: the /dev/tty prompt helpers moved out of release.ts into _lib/tty_prompt.ts, 76 lines and UNDER the cap, taking release.ts 1871 -> 1826). Taking either side alone is wrong in a different direction, which is the reconciliation doctrine this entry already carried from 2026-09-03: main's value silently discards the branch's earned -45, and the branch's value RAISES the baseline against main and weakens the gate. The committed number is neither — it is the gate's own output on the MERGED tree, where both reductions apply, and it equals the arithmetic (18,062 - 45 - 1 = 18,016) rather than being reconciled by it. LOCAL READING, ADMISSIBLE ON THIS ENTRY'S OWN DISCRIMINATOR: the gate walks only SOURCE_ROOTS=['src'] counting excess over the 1500-line ceiling, and `git status --porcelain -uall -- src/` reports ZERO untracked files, so a clean CI checkout of this commit measures the same 18,016. If CI reads anything else, CI's number is the correct one and this note is the record of why. Carried in the merge commit because tests/scripts/check_source_size_budget.test.ts asserts baseline == live and therefore BLOCKS where the gate only advises. PRIOR ENTRY: Lowered 18,062 -> 18,061 on 2026-09-07 by drain/admissible-council-seats. The branch's own additions to the three over-ceiling files (ai_council/config.ts, council_cli.ts, ai_council/clients.ts) came in at +96 excess and were paid down to -1 rather than baselined, in the four ways this entry's doctrine prescribes: `curlJsonPost` moved out of clients.ts into ai_council/api_transport.ts (UNDER the cap, so the prose and the three new provider shims cost nothing); the seat-status helpers moved out of council_cli.ts into ai_council/status_surface.ts, taking an orphaned doc comment with them; the three new per-seat config fields' parsing moved out of config.ts into ai_council/seat_policy.ts::parseSeatFields; and three prose blocks that the branch's own transport repair made FACTUALLY FALSE (the `openai` / `google-genai` Python-SDK claims, and a `_curlJsonPost` pointer to a function that had moved) were corrected and shortened in the same change. LOCAL READING, ADMISSIBLE ON THIS ENTRY'S OWN DISCRIMINATOR: the gate walks only SOURCE_ROOTS=['src'] counting excess over the 1500-line ceiling, and `git status --porcelain -uall -- src/` reports zero untracked files with the five new src/ files staged, so a clean CI checkout of this commit measures the same 18,061. If CI reads anything else, CI's number is the correct one and this note is the record of why. Carried here because tests/scripts/check_source_size_budget.test.ts:166 asserts baseline == live and therefore blocks where the gate only advises -- the lowering commit must carry its own baseline update. Lowered 18,068 -> 18,062 on 2026-09-06 by drain/host-enforcement-truth. Collapsing the five per-host binding constants in install.ts into src/scripts/hooks/host_lowering.yaml removed 29 lines from a file ~3,900 past the 1500 cap, where every line costs one excess; the journal's surface column and its extracted migration helper gave 23 back. Lowered 18,245 -> 18,230 on 2026-09-02 by drain/publication-integrity-option-a. Phase 2 Option A moved the authoring instruction out of the generator: release.ts, which sits ~530 lines PAST the 1500 cap so every line there costs one excess, loses the comment emission, a 16-line HEAD_DEFAULT doc block and its alias const, and gains a shorter writer docstring. The doc block moved to _lib/release_material.ts, which is 289 lines and therefore UNDER the cap, so the same prose now costs nothing. Net -15. The branch first came in at +8 and paid its own way down rather than raising the baseline.",
|
|
38
|
+
"count": 17330,
|
|
39
|
+
"landed": "2026-10-24",
|
|
40
|
+
"note": "Lowered 17,333 -> 17,330 on 2026-10-24 by road-to-listings-a-release-keeps-current: folding release.ts's two augment-manifest version calls into one set_plugin_manifest_versions call took 3 lines out of that over-cap file, measured after merging main's own 17,333. Previous note: Lowered 17,337 -> 17,333 on 2026-10-24 by fix/zod-4-advisory: the zod 4 migration replaced the multi-line zodToJsonSchema(settingsSchema, {...}) call in src/scripts/install.ts with one toJsonSchema7(settingsSchema, name) line, which removed four lines above the 1500-line budget. Set to the exact live total, per this file's convention. Prior entry: Lowered 17,354 -> 17,337 on 2026-10-23 by road-to-a-map-that-draws-itself: trimming the chat_history_read and memory_lookup descriptions to fit the two map tools into the kernel payload band removed seventeen lines from src/scripts/mcp_server/tools.ts, which sits above the 1500-line budget. Prior entry: Lowered 17,358 -> 17,354 on 2026-10-22 by fix/release-without-review-gate: release.ts step 7 no longer reads the findings ledger, which removed four lines above the 1500-line budget. Prior entry: Lowered 17,363 -> 17,358 on 2026-10-22 by feat/subagent-system-2583: the seat launch environment (model-ceiling memo, CLI version probe) moved out of src/scripts/ai_council/clients.ts into cli_launch_env.ts, which more than offset the light-launch and seat-resume additions there and in council_cli.ts and orchestrator.ts. Set to the exact live total, per this file's convention. Prior entry: Lowered 17,365 -> 17,363 on 2026-10-21 by fix/release-no-trailer-refusal: removing the Consumer-Impact span refusal took two lines out of src/scripts/release.ts, which sits above the 1,500-line cap. Set to the exact live total, per this file's convention. Prior entry: MERGE RECONCILIATION 2026-10-21, 17,369/17,368 -> 17,365: main lowered 17,372 -> 17,368 (cmd_doctor.ts, below) and this branch lowered 17,372 -> 17,369; the two gains are independent and add. Branch entry: lowered 17,372 -> 17,369 on 2026-10-21 by drain/road-to-one-detector-senders-20261020, and the gate asked for it by name (ratchet is loose, naming 17,369). The branch's CLI egress refusal (+16 in ai_council/clients.ts) and the injection filter (+2 in hooks/dispatch_hook.ts, which crossed 1,500) were paid for by folding five identical CliClient.ask failure constructions into one _cliFailure helper; dispatch_hook.ts is a ratified hook-plumbing source and was left untouched. Main entry: LOWERED 17,372 -> 17,368 on 2026-10-21 by fix/install-runtime-resolution-20261021, and the gate asked for it by name. The gain IS this branch's: cmd_doctor.ts loses four lines because the no-project-install message moved into doctor_ownership_ledger.ts, where it now reports the global scope too. install.ts stays net-zero — a dry-run block that first added sixteen lines there was moved to wizard-plan.ts rather than paid for. PRIOR ENTRY: LOWERED 17,386 -> 17,375 on 2026-10-19 by drain/road-to-skills-that-arrive-when-called-20261019z, measured by CI (the baseline-equals-live test named 17,375): install.ts's _prune_scoped_modules wrapper became a one-line alias of scoped_projection.prune_scoped_modules, which now carries the declared-skill closure. Before that: LOWERED 17,407 -> 17,386 on 2026-10-18 by drain/road-to-a-release-that-says-whether-it-needs-you-20261018x, and the gate asked for it by name (ratchet is loose, naming 17,386). The gain is an EXTRACTION paying for doctor --json's new update_verdict block (two lines in cmd_doctor.ts): STATUS_SYMBOLS and _emit_checks_text moved verbatim into _doctor_emit.ts, re-exported unchanged, so cmd_doctor.ts goes 3,560 -> 3,539. No ceiling was edited. PRIOR ENTRY: LOWERED 17,410 -> 17,407 on 2026-10-18 by drain/road-to-an-ownership-record-20261018, and the gate asked for it by name (ratchet is loose, naming 17,407). The gain is a compaction inside the function this branch changed: _deploy_claude_desktop's marker call collapsed onto one line beside the new one-line claude-desktop ledger record, leaving src/scripts/install.ts 3 lines shorter than on main. PRIOR ENTRY: MERGE RECONCILIATION 2026-10-18, 17,415/17,414 -> 17,410 — merging origin/main into drain/road-to-one-detector-and-the-senders-we-own-20261018b: main lowered to 17,415 (subagent_native_fields extraction) and this branch to 17,414 (ai_council/config.ts onto the shared rule table) from different reductions; the gate measured the merged tree at 17,410 and named it. PRIOR ENTRY: LOWERING 2026-10-18, 17,419 -> 17,415 — the gate asked for it by name (`ratchet is loose`, naming 17,415), and `check_source_size_budget.test.ts` pins baseline == live total. The gain is an EXTRACTION: road-to-a-cold-start-paid-once 2.2 needed the subagent projector to emit four new optional native fields, so the per-field logic, including the existing `effort` pass-through, moved out of `condense.ts` into `src/scripts/_lib/subagent_native_fields.ts`, which owns nothing else; condense.ts goes 2,695 -> 2,691. No ceiling was edited and no file was split to game the metric. PRIOR ENTRY: LOWERING 2026-10-18, 17,424 -> 17,419 — the gate asked for it by name (`ratchet is loose`, naming 17,419). The gain is an EXTRACTION: `install --full` (road-to-a-setup-that-decides-itself 3.5) needed seven lines in `src/scripts/install.ts`, a file 3,618 lines past the ceiling, so the `--tools`/`--ai` merge helper moved out to `src/install/toolsArg.ts`, which owns nothing else; install.ts goes 5,118 -> 5,113. No ceiling was edited and no file was split to game the metric. PRIOR ENTRY: LOWERING 2026-10-13, 17,485 -> 17,466 — the gate asked for it by name (`ratchet is loose`, naming 17,466), and `check_source_size_budget.test.ts` pins baseline == live total, so it is required rather than optional. The gain is an EXTRACTION, which is the shape this convention accepts: the settings-surface assertion needed three lines in `src/scripts/release.ts`, a file 211 lines past the ceiling, so `set_template_pin` moved out to `src/scripts/release_env.ts`, which already owns its two manifest-version siblings for exactly this stated reason and sits far under the ceiling; release.ts goes 1,730 -> 1,711. The `die` call is inlined there as a stderr write plus `SystemExitError`, because `release_publication.ts` imports from `release_env.ts` and reaching back for `die` would be a cycle. No ceiling was edited and no file was split to game the metric. PRIOR ENTRY: LOWERING 2026-10-13, 17,516 -> 17,485 — the gate asked for it by name (`ratchet is loose`, naming 17,485), and the gain is an EXTRACTION, which is the shape this convention accepts. road-to-a-search-answer-a-model-can-choose-from 1.1/1.2 described `suggest_skill_for_task` properly in `tools.ts` — what a row now carries, and why the default depth is 8 — which cost six lines in a file 521 lines past the ceiling and reddened this ratchet by exactly those six. Rather than re-pin the baseline, the whole allowlist ENTRY moved to `src/scripts/mcp_server/suggest_skill.ts`, which already owns that tool’s handler for the same stated reason; `tools.ts` goes 2,021 -> 1,984 and the net is -31. The import back is TYPE-only, so the cycle is erased at runtime. No ceiling was edited and no file was split to game the metric. PRIOR ENTRY: LOWERING 2026-10-09, 17,550 -> 17,516 — the gate asked for it by name after `REMOVED_KEYS` and its once-per-run warning moved out of `src/scripts/_lib/agent_settings.ts` (1,510 lines) into `src/scripts/_lib/settings_removed_keys.ts`, so the settings-key retirement batch adds its registry entries in a file under the ceiling instead of growing the excess; the retirement itself also deletes legacy rename-map rows and the setup-hint settings read from `src/scripts/install.ts`. Earlier: LOWERING 2026-10-05, 17,571 -> 17,550 — a lowering commit, and the gate asked for it BY NAME: it reported `ratchet is loose` and named 17,550; `check_source_size_budget.test.ts` then pins baseline == live total, so this is required rather than optional. The gain IS this branch's own work and it is a DEDUPLICATION, which this convention accepts: all five CliClient subclass constructors forwarded six option fields to super() by name, which is why a seventh (`consumer`) was silently dropped and every CLI call booked as `unknown`. Replacing the five field lists with `{ ...opts, model: ... }` removes 27 lines from src/scripts/ai_council/clients.ts (2,858 -> 2,831) against the +6 the consumer fix added, so the net is -21. No ceiling was edited and no file was split to game the metric. The count is tree-derived (line counts over src/**/*.ts) and container-independent, unlike the projection-surface gates whose local readings diverge. Verified with `npx tsc --noEmit` clean and the clients suite green in this checkout. PRIOR ENTRY: LOWERING 2026-10-05, 17,585 -> 17,571 — a lowering commit, and the gate asked for it BY NAME: it reported `ratchet is loose` and named 17,571. The gain IS this branch's own work and it is an EXTRACTION, which is the only shape this convention accepts: road-to-an-installed-layer-that-is-thinned step 1.1 adds a thinning call to the global deploy loop, and pays for those lines by moving `_resolve_global_rule_scope` out of `src/scripts/install.ts` into `src/install/globalRuleScope.ts` behind a same-signature wrapper, and removes the two imports the extraction orphaned (install.ts 5,180 -> 5,156). The user-global whitelist rows in `src/scripts/_lib/agent_settings.ts` push that file 1,499 -> 1,510, so the net is -5 rather than -15. No ceiling was edited and no file was split to game the metric. Verified by running the gate in this worktree after `npx tsc --noEmit` passed clean. PRIOR ENTRY: LOWERING 2026-10-02, 17,620 -> 17,592 — a lowering commit, and the gate asked for it BY NAME: it reported `ratchet is loose` and named 17,592. The gain IS this branch's own work, and it is a deduplication rather than a sweep. `GLOBAL_DEPLOY_SOURCES` was defined TWICE — in `src/scripts/install.ts` and in `src/install/wizard-plan.ts` — and the two copies were byte-identical across all 18 host rows, which is a duplicate that stays correct exactly until somebody edits one of them. road-to-rule-triggers-and-links-that-hold step 1.2 did that: it added `contexts/` and `guidelines/` to the install.ts copy and the wizard kept installing without them, so the deduplication is the fix for a defect this branch introduced, not an opportunistic tidy. install.ts now imports and re-exports the wizard-plan definition, so every caller is unchanged, and the file goes 5,231 -> 5,175 lines. Verified by running the gate in this worktree after `npm run typecheck` passed clean. PRIOR ENTRY: LOWERING 2026-10-02, 17,734 -> 17,620 — a lowering commit, and the gate asked for it BY NAME: it reported `ratchet is loose` and named 17,620 as the number to write. The gain is not this branch's own work; it is the net of the lanes that merged into main while this branch was in flight, which is exactly the case the clause below exists for — a tree that got smaller while a baseline stood still would let the gain be given back silently by the next change. Verified in a FRESH detached checkout of the pushed head rather than in the working worktree, because the first reading was taken in a tree that had not finished its base sync and reported the two numbers the other way round; the fresh checkout measures 17,620 against a 17,734 baseline over 1,582 scanned files. `landed` is refreshed deliberately, for the reason every entry below gives: checkRatchet returns `improved` BEFORE it evaluates staleness, so an entry left high while the tree measures lower would never expire at any age. PRIOR ENTRY: LOWERING 2026-10-01, 17,745 -> 17,734 — a lowering commit, and the gate asked for it by name. road-to-a-hook-bundle-with-one-yaml-reader 3.1 split the windsurf renderer out of `condense.ts` into the new under-cap `src/scripts/_lib/windsurf_render.ts`, and `strip_frontmatter` moved with it as the render's one non-trivial dependency. `condense.ts` went 2,728 -> 2,717 excess lines. The direction is honest about its own history: an earlier commit on this branch kept the renderer INLINE in `condense.ts` and CI caught it as 20 new violations — this entry is that fix, not a sweep, and the lowering is the by-product of putting the code where it belonged. Nothing was deleted: the renderer and the stripper are both still called, by TWO callers now rather than one, and `condense.ts` re-exports `strip_frontmatter` so no importer's path changed. The new module lands at 64 lines, far under its own cap, so it contributes zero excess. LOCAL READING, same discriminator every entry below uses: the gate walks authored source under `src/`, and the only untracked path `git status --porcelain -uall -- src` reports is that new module, committed in this same change — so a clean CI checkout of this commit measures the same 17,734. If CI reads anything else, CI's number is the correct one and this note is the record of why. `landed` is refreshed deliberately, for the reason the prior entry gives: checkRatchet returns `improved` BEFORE it evaluates staleness, so an entry left high while the tree measures lower would never expire at any age. PRIOR ENTRY: LOWERING 2026-09-30, 17,746 -> 17,745 — a lowering commit, and the gate asked for it by name. The direction is the surprising one again: this branch ADDED a feature to `install.ts` (an opt-in host env write) and that file came out SHORTER than it went in, 5,270 -> 5,269. The whole mechanism — the two-row allow table, the settings reader, the env-block builder and the bridge wrapper — lives in the new under-cap `src/scripts/_lib/host_env_write.ts`, so `install.ts` pays ONE import line and one expression for it; and the three-line `for` loop over healed plugin ids in the same function collapsed to one, which is inside the function the change already edits. The gain is a MOVE plus one tightening, never a deletion: nothing was dropped and nothing was swept. That module boundary is also the better one on its own terms — one place now owns which host variable this package may write, which is the question the owner decision of 2026-09-30 turns on. LOCAL READING, on the same discriminator every entry below uses: the gate walks authored source under `src/`, and `git status --porcelain -uall -- src` reported ZERO untracked files, so a clean CI checkout of this commit measures the same 17,745. If CI reads anything else, CI's number is the correct one and this note is the record of why. `landed` is refreshed deliberately: checkRatchet returns `improved` BEFORE it evaluates staleness, so an entry left at 17,746 while the tree measures 17,745 would never expire at any age. PRIOR ENTRY: LOWERING 2026-09-29, 17,748 -> 17,746 — a lowering commit, same doctrine as every entry below, and the gate asked for it by name. This branch ADDED two gate scripts, a guard and a shared lib under `src/`, so the direction is the surprising one and worth stating: the new files each land under their own cap and contribute zero EXCESS, while factoring the shell write shapes out of `block_kernel_rule_writes` into `_lib/shell_write_shapes.ts` moved lines out of a file that was over its cap and into one that is not. Net -2. LOCAL READING, on the same discriminator every entry below uses: the gate walks authored source under `src/`, and `git status --porcelain -uall -- src` reported ZERO untracked files, so a clean CI checkout of this commit measures the same 17,746. If CI reads anything else, CI's number is the correct one and this note is the record of why. `landed` is refreshed deliberately: checkRatchet returns `improved` BEFORE it evaluates staleness, so an entry left at 17,748 while the tree measures 17,746 would never expire at any age. PRIOR ENTRY: LOWERING 2026-09-29, 17,762 -> 17,748 — a lowering commit, same doctrine as every entry below, and the gate asked for it by name. Reporting the host traffic environment in `doctor` needed a new surface; rather than pay those lines against `src/scripts/_cli/cmd_doctor.ts`, already far over the cap, the whole network-posture block moved out into the new under-cap `src/scripts/_cli/doctor_network_posture.ts`, which is also where the new logic lives: one module owns which traffic variables exist, how each is read, and how an absent one is reported, so the unit is coherent rather than a line-count trim. cmd_doctor.ts 3,618 -> 3,604; total 17,762 -> 17,748. The gain is a MOVE, not a deletion — nothing was dropped and nothing was swept. `landed` is refreshed deliberately, for the reason the prior entries record: checkRatchet returns `improved` BEFORE it evaluates staleness, so an entry left at 17,762 while the tree measures 17,748 would never expire at any age, and the gate only ADVISES on a loose ratchet while `check_source_size_budget.test.ts` blocks — that asymmetry is what forces a lowering commit to carry its own baseline update. PRIOR ENTRY: LOWERING 2026-09-27, 17,765 -> 17,762 — the second half of the same repair, and a lowering for the same reason. Closing the remaining preservation defects needed lines in two over-cap files: `src/scripts/install.ts` (route the generated Claude Desktop marker through the tracker, hand the rule-rewrite its skip set) and `src/server/routes/wizard.ts` (surface the conflict count, stop reporting exit 3 as a failure). Both were paid from the same subject rather than from the ratchet: `_files_by_tool_from_bridges` joined its sibling in `src/install/manifestFiles.ts`, which now owns the whole per-tool inventory, and the wizard's exit-code semantics moved into `src/install/preserve.ts` beside `installDoneSummary`, which already lives there for this exact reason. install.ts 5,277 -> 5,270; wizard.ts 1,500 -> 1,504. PRIOR ENTRY: LOWERING 2026-09-27, 17,784 -> 17,765 — a lowering commit, same doctrine as the entry it replaces. Repairing the install-manifest digest loss needed new state in `_update_installed_tools_manifest` (a recorded-inventory read, a preserved-path index, a reconciliation call). Rather than pay that against `src/scripts/install.ts`, already 3,777 over the cap, the manifest file-inventory block (`_sha256_of_file`, `_file_entry`, `_files_by_tool_from_deploy` — 29 lines) moved out into the under-cap `src/install/manifestFiles.ts`, which is where the new logic lives too: one module now owns what the manifest's per-tool `files[]` holds, how it is read back, and how the two reconcile, so the unit is coherent rather than a line-count trim. install.ts 5,296 -> 5,277; total 17,784 -> 17,765. PRIOR ENTRY: LOWERING 2026-09-20, 17,858 -> 17,784 — a lowering commit, not a reconciliation, but measured under the same doctrine the four entries below carry: the committed number is the gate's own reading on the MERGED tree, taken after origin/main was merged into drain/headless-log-write rather than from either side. The branch's transaction-log write added 27 lines to `src/scripts/install.ts`, already 3,897 over the cap, taking the total to 17,885. Rather than pay that, the `json.dumps` byte-parity block (`jsonStrNoAscii`, `_jsonScalar`, `_dumpIndent`, `jsonDumpsIndent`, `jsonDumpsCompact` — 101 lines) moved out of `install.ts` into the under-cap `src/scripts/_lib/json_python_parity.ts`: pure, total functions of their input carrying no installer state, so the unit is coherent rather than a line-count trim. install.ts 5,397 -> 5,296; total 17,885 -> 17,784, a net -74 against the prior baseline. PRIOR ENTRY: MERGE RECONCILIATION 2026-09-14, 17,861 -> 17,858 — the FOURTH reconciliation of this entry, same doctrine as the three below: the committed number is the gate's own reading on the MERGED tree, never either side's. Neither branch earned the -3; it falls out of main having absorbed drain/release-head-field, whose `derive_head_prefill` extraction moved the span-to-prefill composition into an under-cap module. Taking this branch's 17,861 would have silently given that gain back. PRIOR ENTRY: MERGE RECONCILIATION 2026-09-13, 17,863 -> 17,861 — the THIRD reconciliation of this entry in one day, and re-measured on the merged tree rather than taken from either side, which is the only resolution that converges. drain/adversarial-verification reached 17,864 by paying for a `forge_protection` block and a cascade-base module entirely in files under the 1,500-line cap; the incoming reconciliation reached 17,863 from different work. Neither describes the merge. PRIOR ENTRY: MERGE RECONCILIATION 2026-09-13, 17,944/17,866 -> 17,863. drain/decision-closure and drain/breaking-line-contradiction each lowered from the SAME 17,947 base in parallel -- this branch to 17,944 (net -3: the ownership vocabulary, its two Iron-Law sets and the merged default-mode map moved out of ai_council/config.ts into ai_council/ownership_classes.ts, and the settings-rename block moved out of _lib/agent_settings.ts into _lib/settings_renamed_keys.ts, both UNDER the 1500 cap so both cost nothing) and main to 17,866. Taking either side alone is wrong in a different direction, which is the doctrine this entry already carries from 2026-09-03 and 2026-09-07: main's value silently discards this branch's earned -3, and this branch's value RAISES the baseline against main and weakens the gate. The committed number is neither -- it is the gate's own output on the MERGED tree, where both reductions apply. MAIN-SIDE ENTRY, carried so neither branch's record is lost: Lowered 17,947 -> 17,866 on 2026-09-13 by drain/breaking-line-contradiction, on this entry's own doctrine. The branch adds the BACKWARD half of the MIGRATION.md obligation -- a refusal for a major cut whose BREAKING section has no migration entry -- and writing it into release.ts came in at +61, because that file sits ~375 lines PAST the 1500 cap so every line there is one unit. Paid down rather than baselined, and the move was the coherent unit rather than the minimum one: BOTH refusals went, the new backward half and the pre-existing forward half (assert_scheduled_deprecations_clear), into _lib/release_migration_gate.ts at 184 lines and therefore UNDER the cap, so the pair and all their rationale now cost nothing. They moved on merit rather than only on arithmetic -- they are the two halves of one obligation, written eleven months apart, and release.ts held only the two call sites. parse_version stayed module-private in release.ts and the lib carries a two-line _minor_patch instead: exporting a private helper to serve one caller would widen the surface of the file the move exists to narrow. release.ts 1,875 -> 1,733: a branch that ADDED a pipeline refusal leaves the file eighty-one lines shorter than it found it. LOCAL READING, ADMISSIBLE ON THIS ENTRY'S OWN DISCRIMINATOR: the gate walks only SOURCE_ROOTS=['src'] counting excess over the 1500-line ceiling, and `git status --porcelain -uall -- src/` reports nothing staged and nothing untracked at this commit, so a clean CI checkout measures the same 17,866. If CI reads anything else, CI's number is the correct one and this note is the record of why. Carried in this commit because tests/scripts/check_source_size_budget.test.ts asserts baseline == live and therefore BLOCKS where the gate only advises -- which is how CI found it: the gate exited 0 with a loose-ratchet warning and the test went red. PRIOR ENTRY: Lowered 17,959 -> 17,947 on 2026-09-11 by the findings-ledger branch, on this entry's own doctrine. The branch adds step 7 to release.ts, which sits ~326 lines PAST the 1500 cap so every line there is one unit, and it came in at +145. Paid down rather than baselined, in two moves. `settle_findings_ledger` and `_blocking_without_disposition` moved out of release.ts into _lib/release_findings_ingest.ts -- 95 lines, and that module is under the cap, so the step and its rationale now cost nothing. It moved on merit rather than only on arithmetic: the module already owns every message the step prints and every argv it builds, and release.ts held only the sequencing. Then the `--ci` fallback dispatch of the three tag-triggered workflows -- 24 lines of loop and warning with no reader elsewhere in step 10 -- moved into _lib/release_tag_dispatch.ts, also under the cap. release.ts 1,826 -> 1,814: a branch that ADDED a pipeline step leaves the file twelve lines shorter than it found it. LOCAL READING, ADMISSIBLE ON THIS ENTRY'S OWN DISCRIMINATOR: the gate walks only SOURCE_ROOTS=['src'] counting excess over the 1500-line ceiling, and `git status --porcelain -uall -- src/` reports the branch's new src/ file staged and nothing untracked, so a clean CI checkout of this commit measures the same 17,947. If CI reads anything else, CI's number is the correct one and this note is the record of why. Carried in this commit because tests/scripts/check_source_size_budget.test.ts asserts baseline == live and therefore BLOCKS where the gate only advises. PRIOR ENTRY: Lowered 17,963 -> 17,959 on 2026-09-09 by feat/cdd-fidelity-council, on the same shape as the entry below and with the same discriminator. The branch's src-link rewrite (a blind review found 253 of 268 links under dist/agent-src/guidelines/ dead, because condense.ts folded only the docs/ prefixes and never (../)+src/rules|skills) came in at +15 excess: condense.ts sits ~1,208 lines PAST the 1500 cap, so every line there is one unit. Paid down rather than baselined, in the way this entry's doctrine prescribes. `_rewrite_body_links` and its two regex constants moved out of condense.ts into _lib/guidelines_lane.ts, 151 lines and therefore UNDER the cap, so the function and its prose now cost nothing. It moved on merit rather than only on arithmetic: every rule the rewriter applies is a statement about which source tree projects where, which is that module's own subject, and condense.ts held it only because that is where the projector lives. condense.ts 2,712 -> 2,708 net, after the one import line and the one call-site rename -- a branch that ADDED a rewrite rule leaves the file four lines shorter than it found it. LOCAL READING, ADMISSIBLE ON THIS ENTRY'S OWN DISCRIMINATOR: the gate walks only SOURCE_ROOTS=['src'] counting excess over the 1500-line ceiling, and `git status --porcelain -uall -- src/` reports the branch's new src/ files tracked and nothing untracked, so a clean CI checkout of this commit measures the same 17,959. If CI reads anything else, CI's number is the correct one and this note is the record of why. Carried in this commit because tests/scripts/check_source_size_budget.test.ts asserts baseline == live and therefore BLOCKS where the gate only advises. PRIOR ENTRY: Lowered 17,973 -> 17,963 on 2026-09-08 by drain/graph-shipped-close. The branch registers five code-graph MCP tools (road-to-a-graph-that-is-shipped 4.1). Their five records and schemas are ~250 lines, and putting them in mcp_server/tools.ts -- which sits ~500 lines PAST the 1500 cap, so every line there is one unit -- would have cost ~250 excess. They live in mcp_server/graph_tools.ts instead (~280 lines, UNDER the cap, so they and their prose cost nothing), and tools.ts spreads them into ALLOWLIST in two lines: one import and one `...GRAPH_TOOLS,`. Those two were paid for rather than baselined, in the way this entry's doctrine prescribes: `_strip` and `_resolvePath` -- a whitespace trim and a tolerant realpath, generic by nature -- moved out of tools.ts into mcp_server/path_util.ts, also under the cap. They are imported under their original underscore names, so all 28 call sites are unchanged and a two-function move does not read as a sweep. tools.ts 2,025 -> 2,015: -12 from the extraction, +2 from the registration, net -10 for a branch that ADDED a feature. CORRECTED 2026-09-08 after an independent review checked the figure against the tree -- this sentence read '2,025 -> 2,013, net -12, against the +2 the registration needed', which states an intermediate file length as the final one and leaves the arithmetic (-12) and the conclusion (-10) describing different trees. `git show origin/main:...tools.ts | wc -l` is 2025 and the working tree is 2015. The TOTAL, 17,963, was always the gate's own output and is unchanged. Every other file this branch touches or creates -- code_graph/verbs.ts, code_graph/cli.ts, code_graph/build.ts, code_graph/detect.ts, code_graph/query.ts, code_graph/sqlite_store.ts, code_graph/types.ts, _lib/regression_neighbourhood.ts -- is under the 1500 ceiling before and after, so it contributes zero excess whatever it grew by. LOCAL READING, ADMISSIBLE ON THIS ENTRY'S OWN DISCRIMINATOR: the gate walks only SOURCE_ROOTS=['src'] counting excess over the 1500-line ceiling, and `git status --porcelain -uall -- src/` reports the two new src/ files staged and nothing untracked, so a clean CI checkout of this commit measures the same 17,963. If CI reads anything else, CI's number is the correct one and this note is the record of why. Carried in this commit because tests/scripts/check_source_size_budget.test.ts asserts baseline == live and therefore BLOCKS where the gate only advises. PRIOR ENTRY: Lowered 17,974 -> 17,973 on 2026-09-08 by drain/topology-c1. The branch adds a live-path emit to council_cli.ts, which sits 2,454 lines PAST the 1500 cap so every line there is one unit, and paid its own way down rather than raising the baseline, in the way this entry's doctrine prescribes. The twelve-line `all_responses` assembly (a spread, three conditionals and a push) moved out of council_cli.ts into ai_council/deliberation_metrics.ts::runCallsFrom, 353 lines and therefore UNDER the cap, so the six stage labels and their prose cost nothing. It moved on merit rather than only on arithmetic: 'which calls did this run make, and at which stage' is that module's own subject, and the CLI held the list only as a flat array with the stage boundaries implicit in the order -- both readings now come out of one walk, so the billing total and the attribution can never be computed over different sets. council_cli.ts 3,955 -> 3,954 net, after the two call lines, the import and the one payload key the feature needed. LOCAL READING, ADMISSIBLE ON THIS ENTRY'S OWN DISCRIMINATOR: the gate walks only SOURCE_ROOTS=['src'] counting excess over the 1500-line ceiling, and `git status --porcelain -uall -- src/` reports the two new src/ files staged and nothing untracked, so a clean CI checkout of this commit measures the same 17,973. If CI reads anything else, CI's number is the correct one and this note is the record of why. Carried in this commit because tests/scripts/check_source_size_budget.test.ts asserts baseline == live and therefore BLOCKS where the gate only advises. PRIOR ENTRY: Lowered 18,016 -> 17,974 on 2026-09-07 by fix/single-delivery-unconditional. SETTLED FIGURE, and it supersedes an intra-session 17,962 this same branch committed earlier — read the direction against MAIN, which is what the ratchet protects: main is 18,016, the branch leaves 17,974, net -42. The 17,962 was this branch's own low before a neutral review returned twelve findings; fixing them added a real mechanism to mcp_server and condense.ts (the flat-wrapper carriage gate the review showed was missing, plus its four-skip predicate), and condense.ts sits ~1,215 lines PAST the cap so each of those lines is one unit. Paid down first, in the way this entry's doctrine prescribes: _suggestSkillForTaskHandler and its 18-line docstring moved out of mcp_server/tools.ts (2,079 -> 2,025) into mcp_server/suggest_skill.ts, 72 lines and UNDER the cap, so its prose costs nothing. The residual +12 against the intra-session low is the gate's own output on the settled tree and is recorded rather than engineered away, because the alternative was extracting _nested_command_subpath and its two callers out of condense.ts - which needs MODULE_STATE, _relativeToPosix and _domains_command_logical passed in, a wider diff than the finding warrants and one no review asked for. LOCAL READING, ADMISSIBLE ON THIS ENTRY'S OWN DISCRIMINATOR: the gate walks only SOURCE_ROOTS=['src'] counting excess over the 1500-line ceiling, and `git status --porcelain -uall -- src/` reports the three new src/ files staged and nothing untracked, so a clean CI checkout of this commit measures the same 17,974. If CI reads anything else, CI's number is the correct one and this note is the record of why. Carried in this commit because tests/scripts/check_source_size_budget.test.ts asserts baseline == live and therefore BLOCKS where the gate only advises. PRIOR ENTRY: MERGE RECONCILIATION 2026-09-07, 18,061/18,017 -> 18,016. drain/admissible-council-seats and fix/release-obligation-answerable each lowered from the SAME 18,062 base in parallel — main to 18,061 (net -1: curlJsonPost, the seat-status helpers and the per-seat config parsing moved out of the three over-ceiling council files) and the branch to 18,017 (net -45: the /dev/tty prompt helpers moved out of release.ts into _lib/tty_prompt.ts, 76 lines and UNDER the cap, taking release.ts 1871 -> 1826). Taking either side alone is wrong in a different direction, which is the reconciliation doctrine this entry already carried from 2026-09-03: main's value silently discards the branch's earned -45, and the branch's value RAISES the baseline against main and weakens the gate. The committed number is neither — it is the gate's own output on the MERGED tree, where both reductions apply, and it equals the arithmetic (18,062 - 45 - 1 = 18,016) rather than being reconciled by it. LOCAL READING, ADMISSIBLE ON THIS ENTRY'S OWN DISCRIMINATOR: the gate walks only SOURCE_ROOTS=['src'] counting excess over the 1500-line ceiling, and `git status --porcelain -uall -- src/` reports ZERO untracked files, so a clean CI checkout of this commit measures the same 18,016. If CI reads anything else, CI's number is the correct one and this note is the record of why. Carried in the merge commit because tests/scripts/check_source_size_budget.test.ts asserts baseline == live and therefore BLOCKS where the gate only advises. PRIOR ENTRY: Lowered 18,062 -> 18,061 on 2026-09-07 by drain/admissible-council-seats. The branch's own additions to the three over-ceiling files (ai_council/config.ts, council_cli.ts, ai_council/clients.ts) came in at +96 excess and were paid down to -1 rather than baselined, in the four ways this entry's doctrine prescribes: `curlJsonPost` moved out of clients.ts into ai_council/api_transport.ts (UNDER the cap, so the prose and the three new provider shims cost nothing); the seat-status helpers moved out of council_cli.ts into ai_council/status_surface.ts, taking an orphaned doc comment with them; the three new per-seat config fields' parsing moved out of config.ts into ai_council/seat_policy.ts::parseSeatFields; and three prose blocks that the branch's own transport repair made FACTUALLY FALSE (the `openai` / `google-genai` Python-SDK claims, and a `_curlJsonPost` pointer to a function that had moved) were corrected and shortened in the same change. LOCAL READING, ADMISSIBLE ON THIS ENTRY'S OWN DISCRIMINATOR: the gate walks only SOURCE_ROOTS=['src'] counting excess over the 1500-line ceiling, and `git status --porcelain -uall -- src/` reports zero untracked files with the five new src/ files staged, so a clean CI checkout of this commit measures the same 18,061. If CI reads anything else, CI's number is the correct one and this note is the record of why. Carried here because tests/scripts/check_source_size_budget.test.ts:166 asserts baseline == live and therefore blocks where the gate only advises -- the lowering commit must carry its own baseline update. Lowered 18,068 -> 18,062 on 2026-09-06 by drain/host-enforcement-truth. Collapsing the five per-host binding constants in install.ts into src/scripts/hooks/host_lowering.yaml removed 29 lines from a file ~3,900 past the 1500 cap, where every line costs one excess; the journal's surface column and its extracted migration helper gave 23 back. Lowered 18,245 -> 18,230 on 2026-09-02 by drain/publication-integrity-option-a. Phase 2 Option A moved the authoring instruction out of the generator: release.ts, which sits ~530 lines PAST the 1500 cap so every line there costs one excess, loses the comment emission, a 16-line HEAD_DEFAULT doc block and its alias const, and gains a shorter writer docstring. The doc block moved to _lib/release_material.ts, which is 289 lines and therefore UNDER the cap, so the same prose now costs nothing. Net -15. The branch first came in at +8 and paid its own way down rather than raising the baseline. BRANCH-SIDE ENTRY: Lowered 17,947 -> 17,944 on 2026-09-13 by drain/decision-closure, on this entry's own doctrine and at the gate's own request. The branch's ownership-axis additions to ai_council/config.ts came in at +86 excess: that file sits ~700 lines PAST the 1500 cap, so every line there is one unit. Paid down rather than baselined, in one move. The eight ownership class names, the two Iron-Law sets, the merged default-mode map and the mode-check function moved out of config.ts into ai_council/ownership_classes.ts -- 91 lines, UNDER the cap, so the vocabulary and its prose now cost nothing. It moved on merit rather than only on arithmetic: the roadmap-side gate lint_decision_classes needs the same eight names and has no business importing the council's whole schema to learn them, and the loader now carries three lines where it carried twenty-four. config.ts 2,182 -> 2,179: a branch that ADDED an entire decision axis leaves the file three lines shorter than it found it. Every other src/ file this branch creates -- lint_decision_classes.ts, lint_roadmap_producers.ts, closure_scan.ts, council_record_shape.ts, scope_growth.ts, ownership_classes.ts -- is under the 1500 ceiling, so it contributes zero excess whatever it grew by. LOCAL READING, ADMISSIBLE ON THIS ENTRY'S OWN DISCRIMINATOR: the gate walks only SOURCE_ROOTS=['src'] counting excess over the 1500-line ceiling, and `git status --porcelain -uall -- src/` reports the branch's new src/ files tracked and nothing untracked, so a clean CI checkout of this commit measures the same 17,944. If CI reads anything else, CI's number is the correct one and this note is the record of why. Carried in this commit because tests/scripts/check_source_size_budget.test.ts asserts baseline == live and therefore BLOCKS where the gate only advises. PRIOR ENTRY: Lowered 17,959 -> 17,947 on 2026-09-11 by the findings-ledger branch, on this entry's own doctrine. The branch adds step 7 to release.ts, which sits ~326 lines PAST the 1500 cap so every line there is one unit, and it came in at +145. Paid down rather than baselined, in two moves. `settle_findings_ledger` and `_blocking_without_disposition` moved out of release.ts into _lib/release_findings_ingest.ts -- 95 lines, and that module is under the cap, so the step and its rationale now cost nothing. It moved on merit rather than only on arithmetic: the module already owns every message the step prints and every argv it builds, and release.ts held only the sequencing. Then the `--ci` fallback dispatch of the three tag-triggered workflows -- 24 lines of loop and warning with no reader elsewhere in step 10 -- moved into _lib/release_tag_dispatch.ts, also under the cap. release.ts 1,826 -> 1,814: a branch that ADDED a pipeline step leaves the file twelve lines shorter than it found it. LOCAL READING, ADMISSIBLE ON THIS ENTRY'S OWN DISCRIMINATOR: the gate walks only SOURCE_ROOTS=['src'] counting excess over the 1500-line ceiling, and `git status --porcelain -uall -- src/` reports the branch's new src/ file staged and nothing untracked, so a clean CI checkout of this commit measures the same 17,947. If CI reads anything else, CI's number is the correct one and this note is the record of why. Carried in this commit because tests/scripts/check_source_size_budget.test.ts asserts baseline == live and therefore BLOCKS where the gate only advises. PRIOR ENTRY: Lowered 17,963 -> 17,959 on 2026-09-09 by feat/cdd-fidelity-council, on the same shape as the entry below and with the same discriminator. The branch's src-link rewrite (a blind review found 253 of 268 links under dist/agent-src/guidelines/ dead, because condense.ts folded only the docs/ prefixes and never (../)+src/rules|skills) came in at +15 excess: condense.ts sits ~1,208 lines PAST the 1500 cap, so every line there is one unit. Paid down rather than baselined, in the way this entry's doctrine prescribes. `_rewrite_body_links` and its two regex constants moved out of condense.ts into _lib/guidelines_lane.ts, 151 lines and therefore UNDER the cap, so the function and its prose now cost nothing. It moved on merit rather than only on arithmetic: every rule the rewriter applies is a statement about which source tree projects where, which is that module's own subject, and condense.ts held it only because that is where the projector lives. condense.ts 2,712 -> 2,708 net, after the one import line and the one call-site rename -- a branch that ADDED a rewrite rule leaves the file four lines shorter than it found it. LOCAL READING, ADMISSIBLE ON THIS ENTRY'S OWN DISCRIMINATOR: the gate walks only SOURCE_ROOTS=['src'] counting excess over the 1500-line ceiling, and `git status --porcelain -uall -- src/` reports the branch's new src/ files tracked and nothing untracked, so a clean CI checkout of this commit measures the same 17,959. If CI reads anything else, CI's number is the correct one and this note is the record of why. Carried in this commit because tests/scripts/check_source_size_budget.test.ts asserts baseline == live and therefore BLOCKS where the gate only advises. PRIOR ENTRY: Lowered 17,973 -> 17,963 on 2026-09-08 by drain/graph-shipped-close. The branch registers five code-graph MCP tools (road-to-a-graph-that-is-shipped 4.1). Their five records and schemas are ~250 lines, and putting them in mcp_server/tools.ts -- which sits ~500 lines PAST the 1500 cap, so every line there is one unit -- would have cost ~250 excess. They live in mcp_server/graph_tools.ts instead (~280 lines, UNDER the cap, so they and their prose cost nothing), and tools.ts spreads them into ALLOWLIST in two lines: one import and one `...GRAPH_TOOLS,`. Those two were paid for rather than baselined, in the way this entry's doctrine prescribes: `_strip` and `_resolvePath` -- a whitespace trim and a tolerant realpath, generic by nature -- moved out of tools.ts into mcp_server/path_util.ts, also under the cap. They are imported under their original underscore names, so all 28 call sites are unchanged and a two-function move does not read as a sweep. tools.ts 2,025 -> 2,015: -12 from the extraction, +2 from the registration, net -10 for a branch that ADDED a feature. CORRECTED 2026-09-08 after an independent review checked the figure against the tree -- this sentence read '2,025 -> 2,013, net -12, against the +2 the registration needed', which states an intermediate file length as the final one and leaves the arithmetic (-12) and the conclusion (-10) describing different trees. `git show origin/main:...tools.ts | wc -l` is 2025 and the working tree is 2015. The TOTAL, 17,963, was always the gate's own output and is unchanged. Every other file this branch touches or creates -- code_graph/verbs.ts, code_graph/cli.ts, code_graph/build.ts, code_graph/detect.ts, code_graph/query.ts, code_graph/sqlite_store.ts, code_graph/types.ts, _lib/regression_neighbourhood.ts -- is under the 1500 ceiling before and after, so it contributes zero excess whatever it grew by. LOCAL READING, ADMISSIBLE ON THIS ENTRY'S OWN DISCRIMINATOR: the gate walks only SOURCE_ROOTS=['src'] counting excess over the 1500-line ceiling, and `git status --porcelain -uall -- src/` reports the two new src/ files staged and nothing untracked, so a clean CI checkout of this commit measures the same 17,963. If CI reads anything else, CI's number is the correct one and this note is the record of why. Carried in this commit because tests/scripts/check_source_size_budget.test.ts asserts baseline == live and therefore BLOCKS where the gate only advises. PRIOR ENTRY: Lowered 17,974 -> 17,973 on 2026-09-08 by drain/topology-c1. The branch adds a live-path emit to council_cli.ts, which sits 2,454 lines PAST the 1500 cap so every line there is one unit, and paid its own way down rather than raising the baseline, in the way this entry's doctrine prescribes. The twelve-line `all_responses` assembly (a spread, three conditionals and a push) moved out of council_cli.ts into ai_council/deliberation_metrics.ts::runCallsFrom, 353 lines and therefore UNDER the cap, so the six stage labels and their prose cost nothing. It moved on merit rather than only on arithmetic: 'which calls did this run make, and at which stage' is that module's own subject, and the CLI held the list only as a flat array with the stage boundaries implicit in the order -- both readings now come out of one walk, so the billing total and the attribution can never be computed over different sets. council_cli.ts 3,955 -> 3,954 net, after the two call lines, the import and the one payload key the feature needed. LOCAL READING, ADMISSIBLE ON THIS ENTRY'S OWN DISCRIMINATOR: the gate walks only SOURCE_ROOTS=['src'] counting excess over the 1500-line ceiling, and `git status --porcelain -uall -- src/` reports the two new src/ files staged and nothing untracked, so a clean CI checkout of this commit measures the same 17,973. If CI reads anything else, CI's number is the correct one and this note is the record of why. Carried in this commit because tests/scripts/check_source_size_budget.test.ts asserts baseline == live and therefore BLOCKS where the gate only advises. PRIOR ENTRY: Lowered 18,016 -> 17,974 on 2026-09-07 by fix/single-delivery-unconditional. SETTLED FIGURE, and it supersedes an intra-session 17,962 this same branch committed earlier — read the direction against MAIN, which is what the ratchet protects: main is 18,016, the branch leaves 17,974, net -42. The 17,962 was this branch's own low before a neutral review returned twelve findings; fixing them added a real mechanism to mcp_server and condense.ts (the flat-wrapper carriage gate the review showed was missing, plus its four-skip predicate), and condense.ts sits ~1,215 lines PAST the cap so each of those lines is one unit. Paid down first, in the way this entry's doctrine prescribes: _suggestSkillForTaskHandler and its 18-line docstring moved out of mcp_server/tools.ts (2,079 -> 2,025) into mcp_server/suggest_skill.ts, 72 lines and UNDER the cap, so its prose costs nothing. The residual +12 against the intra-session low is the gate's own output on the settled tree and is recorded rather than engineered away, because the alternative was extracting _nested_command_subpath and its two callers out of condense.ts - which needs MODULE_STATE, _relativeToPosix and _domains_command_logical passed in, a wider diff than the finding warrants and one no review asked for. LOCAL READING, ADMISSIBLE ON THIS ENTRY'S OWN DISCRIMINATOR: the gate walks only SOURCE_ROOTS=['src'] counting excess over the 1500-line ceiling, and `git status --porcelain -uall -- src/` reports the three new src/ files staged and nothing untracked, so a clean CI checkout of this commit measures the same 17,974. If CI reads anything else, CI's number is the correct one and this note is the record of why. Carried in this commit because tests/scripts/check_source_size_budget.test.ts asserts baseline == live and therefore BLOCKS where the gate only advises. PRIOR ENTRY: MERGE RECONCILIATION 2026-09-07, 18,061/18,017 -> 18,016. drain/admissible-council-seats and fix/release-obligation-answerable each lowered from the SAME 18,062 base in parallel — main to 18,061 (net -1: curlJsonPost, the seat-status helpers and the per-seat config parsing moved out of the three over-ceiling council files) and the branch to 18,017 (net -45: the /dev/tty prompt helpers moved out of release.ts into _lib/tty_prompt.ts, 76 lines and UNDER the cap, taking release.ts 1871 -> 1826). Taking either side alone is wrong in a different direction, which is the reconciliation doctrine this entry already carried from 2026-09-03: main's value silently discards the branch's earned -45, and the branch's value RAISES the baseline against main and weakens the gate. The committed number is neither — it is the gate's own output on the MERGED tree, where both reductions apply, and it equals the arithmetic (18,062 - 45 - 1 = 18,016) rather than being reconciled by it. LOCAL READING, ADMISSIBLE ON THIS ENTRY'S OWN DISCRIMINATOR: the gate walks only SOURCE_ROOTS=['src'] counting excess over the 1500-line ceiling, and `git status --porcelain -uall -- src/` reports ZERO untracked files, so a clean CI checkout of this commit measures the same 18,016. If CI reads anything else, CI's number is the correct one and this note is the record of why. Carried in the merge commit because tests/scripts/check_source_size_budget.test.ts asserts baseline == live and therefore BLOCKS where the gate only advises. PRIOR ENTRY: Lowered 18,062 -> 18,061 on 2026-09-07 by drain/admissible-council-seats. The branch's own additions to the three over-ceiling files (ai_council/config.ts, council_cli.ts, ai_council/clients.ts) came in at +96 excess and were paid down to -1 rather than baselined, in the four ways this entry's doctrine prescribes: `curlJsonPost` moved out of clients.ts into ai_council/api_transport.ts (UNDER the cap, so the prose and the three new provider shims cost nothing); the seat-status helpers moved out of council_cli.ts into ai_council/status_surface.ts, taking an orphaned doc comment with them; the three new per-seat config fields' parsing moved out of config.ts into ai_council/seat_policy.ts::parseSeatFields; and three prose blocks that the branch's own transport repair made FACTUALLY FALSE (the `openai` / `google-genai` Python-SDK claims, and a `_curlJsonPost` pointer to a function that had moved) were corrected and shortened in the same change. LOCAL READING, ADMISSIBLE ON THIS ENTRY'S OWN DISCRIMINATOR: the gate walks only SOURCE_ROOTS=['src'] counting excess over the 1500-line ceiling, and `git status --porcelain -uall -- src/` reports zero untracked files with the five new src/ files staged, so a clean CI checkout of this commit measures the same 18,061. If CI reads anything else, CI's number is the correct one and this note is the record of why. Carried here because tests/scripts/check_source_size_budget.test.ts:166 asserts baseline == live and therefore blocks where the gate only advises -- the lowering commit must carry its own baseline update. Lowered 18,068 -> 18,062 on 2026-09-06 by drain/host-enforcement-truth. Collapsing the five per-host binding constants in install.ts into src/scripts/hooks/host_lowering.yaml removed 29 lines from a file ~3,900 past the 1500 cap, where every line costs one excess; the journal's surface column and its extracted migration helper gave 23 back. Lowered 18,245 -> 18,230 on 2026-09-02 by drain/publication-integrity-option-a. Phase 2 Option A moved the authoring instruction out of the generator: release.ts, which sits ~530 lines PAST the 1500 cap so every line there costs one excess, loses the comment emission, a 16-line HEAD_DEFAULT doc block and its alias const, and gains a shorter writer docstring. The doc block moved to _lib/release_material.ts, which is 289 lines and therefore UNDER the cap, so the same prose now costs nothing. Net -15. The branch first came in at +8 and paid its own way down rather than raising the baseline.",
|
|
41
41
|
"earlier_history": "LOWERED 17,426 -> 17,424 on 2026-10-18 by drain/road-to-a-hook-carrier-that-is-never-silent-20261018, and the gate asked for it BY NAME (ratchet is loose, naming 17,424). The gain is an EXTRACTION: the claude-code thin call site in src/scripts/install.ts became one call to deployClaudeCarrier in src/install/stagedRuntime.ts, which is under the cap, and the new doctor hook-carrier check lives there too rather than in cmd_doctor.ts. The branch first measured +58 against this baseline and paid its own way down. If CI reads a different number, CI's number wins. Prior entry: LOWERED 17,434 -> 17,426 on 2026-10-17 as the merged-tree reading of #2421 + #2422: merging main into drain/road-to-a-release-that-says-whether-it-needs-you, the gate reported `17426 violation(s), baseline 17434 - ratchet is loose` and named 17,426, because both PRs had lowered 17,442 -> 17,434 through DIFFERENT reductions and both now apply. #2421: `src/scripts/release.ts` went 1,711 -> 1,703 lines when its commit parsing moved into `src/scripts/_lib/consumer_impact.ts`; #2422: see the entry that follows. If CI reads a different number, CI's number wins. Prior entry: LOWERED 17,442 -> 17,434 on 2026-10-16 by drain/road-to-an-ownership-record-that-belongs-to-the-user, and the gate asked for it BY NAME (ratchet is loose, naming 17,434), with CI shard 4/4 measuring the same live total. The gain is an EXTRACTION: the inventory load, both reapers, the record and the save that src/scripts/install.ts ran inline for each global deploy moved into src/install/ownershipLedger.ts (recordGlobalDeploy), install.ts 5,132 -> 5,124. Prior entry: LOWERED 17,466 -> 17,442 on 2026-10-13 by drain/what-was-built-never-ran, and the gate asked for it BY NAME: it reported `17442 violation(s), baseline 17466 - ratchet is loose` and named 17,442 itself. The gain is a DELETION rather than an extraction: `src/scripts/hooks/run_continuation_hook.ts` (1,529 lines, 29 past the 1500 cap) was removed with its concern, which was withdrawn on its own pre-registered kill date (road-to-what-was-built-and-never-ran Phase 4, executing a dated kill criterion a converged two-seat council set on 2026-09-12). Only the 29 lines past the cap are what this gate counts, and the remaining movement comes from comment edits the same sweep made in files that also sit past it. LOCAL READING, ADMISSIBLE ON THIS ENTRY'S OWN DISCRIMINATOR, which the paragraphs below establish: the gate walks only SOURCE_ROOTS=['src'] counting excess over the 1500 ceiling, and a porcelain status over that root reports ZERO untracked files, so a clean CI checkout of this commit measures the same 17,442. If CI reads anything else, CI's number is the correct one and this note is the record of why. PRIOR REASON: Lowered 17,585 -> 17,571 on 2026-10-05 by lane/installed-layer-thinned, and the gate asked for it BY NAME. The gain is this branch's own, through two extractions rather than a sweep: `_resolve_global_rule_scope` to `src/install/globalRuleScope.ts` and the thinning mechanism to `src/scripts/_lib/thin_rules.ts`. PRIOR REASON: Lowered 17,590 -> 17,585 on 2026-10-03 by drain/rule-carrier-phase1b-20261002, and the gate asked for it BY NAME: it reported `ratchet is loose` and named 17,585. The gain is INCIDENTAL rather than sought, and it comes from two files that sit past the 1500-line cap. `src/scripts/ai_council/clients.ts` (2,852 lines, 1,352 past) lost the 18-line doc comment and declaration of `OPENAI_CLI_VENDOR_DEFAULT`, which moved to a new `ai_council/vendor_defaults.ts` well under the cap, so those lines stopped being charged; the move itself was made to break an import edge costing 51,523 B of composed hook bundle, not to shed lines. `src/scripts/install.ts` (5,229 lines, 3,729 past) gained a three-line call site for the headless `.gitignore` block and NOT the 44-line function behind it, which was written into `_lib/gitignore_block.ts` instead — that placement was chosen when this gate reported +44 and said a ratchet only turns one way, and it is the better home anyway. Net across both: -5. LOCAL READING, on the same discriminator the entries above use: the gate walks authored source under src/, and a porcelain status over that root reports no untracked files, so a clean CI checkout of this commit measures the same 17,585. `landed` is refreshed deliberately — checkRatchet returns `improved` BEFORE it evaluates staleness, so an entry left at 17,590 while the tree measures 17,585 would never expire at any age. PRIOR ENTRY: Lowered 17,592 -> 17,590 on 2026-10-03 by drain/rule-carrier-phase1-20261002, and the gain was INCIDENTAL rather than sought. The branch replaced `condense.ts::_lean_projection_settings` — an eight-line private reader of `lean_projection.mode` and `.hosts` — with one call to the shared `resolveLeanProjection`, net -2 lines in a file that sits ~1,195 lines PAST the 1500 cap, so every line removed there is one excess removed. Nothing was deleted to make a number: the projector reads the same settings file it always read, and `task sync` plus `task generate-tools` produce zero changes under `dist/agent-src/`, which is how that roadmap's risk 2 (one mode resolver moves the projector) was discharged. The gate reported the tree at 17,590 against a baseline of 17,592 and asked for exactly this lowering, so the gain cannot be silently given back. LOCAL READING, ADMISSIBLE ON THE SAME DISCRIMINATOR THIS FILE'S OTHER ENTRIES USE: the gate walks `src/` only, and a porcelain status over that root reported no untracked files, so a clean CI checkout of this commit measures the same 17,590. If CI reads anything else, CI's number is the correct one and this note is the record of why. PRIOR ENTRY: Lowered 18,230 -> 18,209 on 2026-09-03 by drain/artifact-location. `doctor --strict` needed 16 lines of integration wiring in cmd_doctor.ts, which sits ~2,100 lines PAST the 1500 cap so every line there costs one excess. The branch first came in at +137 and paid its own way down rather than raising the baseline: the strict semantics, threshold, kill switch, payload helper and argv fragments moved to _cli/_doctor_strict.ts (~160 lines, under the cap, costs nothing), taking it to +15; then the 37-line drift renderer moved to _cli/_doctor_emit.ts. Net -21. The renderer was chosen deliberately: pure rendering, two dependencies, no argparse involvement and therefore none of the byte-parity risk the parser surface carries against the retired Python implementation; nothing outside cmd_doctor.ts imported it. An AI council on the residual split (a: raise by 15 / d: descope the feature); neither was taken, because a parallel branch demonstrated the same day that paying down is achievable in this codebase, which is the evidence the split lacked. This gate's own test comment prescribes it: a commit that splits a god-file lowers the excess and must carry the lowered baseline. MERGE RECONCILIATION 2026-09-03, 18,209 -> 18,205: drain/wired-instruments and drain/artifact-location each lowered from the SAME 18,230 base in parallel -- the branch to 18,226 (net -4, run_continuation_hook.ts's termination ladder moved to _lib/continuation_ladder.ts and runtime_journal.ts's prose to _lib/outcome_vocabularies.ts, both under the cap) and main to 18,209 (net -21, the doctor --strict split above). Taking either side alone is wrong in a different direction: main's value silently discards the branch's earned -4, and the branch's value RAISES the baseline against main and weakens the gate. The committed number is neither -- it is the gate's own output on the merged tree, where both reductions apply. THIS LOCAL READING IS ADMISSIBLE HERE, and the discriminator matters because this file's ci-parity:local-only entry records a 165 -> 164 lowering that was reverted for exactly the opposite case: that count depends on how the environment resolves the projection surface, whereas this gate walks only SOURCE_ROOTS = ['src'] (check_source_size_budget.ts:88) counting excess lines over the 1500 ceiling, and `git status --porcelain -uall -- src/` reported ZERO untracked files, so a clean CI checkout of this commit measures the same 18,205. If CI reads anything else, CI's number is the correct one and this note is the record of why. LOWERED 18,205 -> 18,193 on 2026-09-03 by fix/release-curation-ask. The change adds a fifth publication guard, and its own additions landed at +10 excess: release.ts 2,008 -> 2,018, every line of which is past the 1500 cap. Paid down rather than baselined, in the two ways this gate's doctrine prescribes. The guard's rationale (~13 lines of docstring, including why prMerged is a parameter rather than a call-site if) lives in release_publication.ts, 915 lines and therefore UNDER the cap, so the prose costs nothing; and the two pure text helpers _splitlines and _rstrip moved out of release.ts into release_env.ts (333 lines, also under the cap), taking release.ts to 1,996 -- 12 BELOW where it started. The branch came in at +10 and leaves at -12. Recorded while moving them: _splitlines is duplicated a third and fourth time at adoption_report.ts:106 and readme_linter.ts:418; collapsing all three onto one definition touches three modules and was left out of this change rather than done silently. LOWERED 18,193 -> 18,180 on 2026-09-03 by fix/release-branch-reuse. The step-1 branch decision -- twenty lines of if/else in release.ts -- became one call to checkout_release_branch in release_publication.ts, which is 1,019 lines and therefore UNDER the 1500 cap, so the twenty lines plus a ~35-line rationale now cost nothing. release.ts 1,996 -> 1,983, every one of those lines being past the cap. The drill grew 765 -> 918 for two new scenarios and the snapshot/restore that keeps them from writing the real CHANGELOG, and it is under the cap too. A change that adds a feature and lowers the excess is the shape this gate's doctrine asks for; the alternative was a +13 raise for logic that had no business in the god-file. LOWERED 18,180 -> 18,068 on 2026-09-05 by fix/release-gate-producer-parity. The change wires the governance-mix obligation into the writer and the two local guards and adds a release-gate locality registry; its own additions to release.ts landed at +19 excess, every one of those lines past the 1500 cap. Paid down rather than baselined, in the way this entry's doctrine prescribes: the 132-line test-count-trend unit (_TEST_COUNT_LINE_RE, _TEST_LIST_MAX_BUFFER, _count_from_list_result, _count_tests_current, _previous_test_count_from_changelog, _render_test_trend_line) moved from release.ts into release_publication.ts, which is under the cap and where it now belongs on merit rather than only on arithmetic -- the same diff makes the missing `Tests: N` footer a section-level publication blocker, so the writer that emits the footer and the guard that refuses its absence sit in one module. release.ts 1,983 -> 1,871. All four names are re-exported from release.ts, so tests/scripts/release.test.ts is unchanged. LOCAL READING, ADMISSIBLE ON THIS ENTRY'S OWN DISCRIMINATOR: the gate walks only SOURCE_ROOTS=['src'] counting excess over the ceiling, and `git status --porcelain -uall -- src/` reports ZERO untracked files with the two new src/ files staged, so a clean CI checkout of this commit measures the same 18,068. If CI reads anything else, CI's number is the correct one and this note is the record of why."
|
|
42
42
|
},
|
|
43
43
|
"ci-parity:local-only": {
|
|
@@ -138,11 +138,12 @@
|
|
|
138
138
|
# above, and named anyway rather than left implicit — do not delete as
|
|
139
139
|
# duplication:
|
|
140
140
|
#
|
|
141
|
-
# · Some hosts key a prompt cache on a hash of the workspace file list.
|
|
142
|
-
# index is rewritten
|
|
143
|
-
# -
|
|
144
|
-
# never edits. An entry a reader
|
|
145
|
-
# is what makes that cost
|
|
141
|
+
# · Some hosts key a prompt cache on a hash of the workspace file list. After
|
|
142
|
+
# `agent-config code-graph auto-refresh on` the index is rewritten at every
|
|
143
|
+
# agent session start (the `code-graph-refresh` hook concern), so it is the
|
|
144
|
+
# most frequently-changing file a consumer never edits. An entry a reader
|
|
145
|
+
# can find by grepping the index's own name is what makes that cost
|
|
146
|
+
# traceable.
|
|
146
147
|
# · The twin and the lock are created beside the index by machinery a
|
|
147
148
|
# consumer never invokes directly; naming them says they are ours.
|
|
148
149
|
#
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"registered_at": "2026-10-01",
|
|
5
5
|
"owner": "maintainer",
|
|
6
6
|
"review_by": "2027-10-01",
|
|
7
|
-
"max_bytes":
|
|
7
|
+
"max_bytes": 1551000,
|
|
8
8
|
"max_bytes_derivation": "Measured 1,514,715 bytes on origin/main at 213d87055 (the gate's own reading, APFS-cloned node_modules so no worktree path artefacts). The ceiling is that reading plus ~2.3 % of headroom, rounded to 1,550,000, on the same doctrine as the 2026-10-01 registration: a bundle is rebuilt from source on every run, so an esbuild minor that renames symbols moves the figure by hundreds of bytes with no change to this tree, and a ceiling one byte above the reading would red on that. Composition is healthy at this reading and was checked rather than assumed: one YAML package (258,833 bytes) and 1,238,525 bytes of own source, so the growth is own code, not a re-entered dependency. The 1,564,211-byte pre-swap regression this roadmap closed still cannot reappear under it. RAISED to 1,550,500 on 2026-10-23 for the InstructionsLoaded binding (237 bytes against 51 of headroom); the reasoning and the measured alternative are the last `raise_log` entry, so this paragraph describes the 1,550,000 registration and the raise is recorded there rather than restated.",
|
|
9
9
|
"shrink_only": true,
|
|
10
10
|
"shrink_only_note": "A RAISE needs a recorded reason in `raise_log` below naming what was added and why it could not be avoided. Enforced since road-to-a-ratification-fence-that-follows-its-imports 3.2: the gate reads `max_bytes` at the base revision, and a working value above it fails unless `raise_log` gained an entry whose `to` equals the new value. A lowering needs no entry. This file is also on the ratification gate's watched set, so a raise carries a record as well as a log entry.",
|
|
@@ -36,6 +36,15 @@
|
|
|
36
36
|
"what_was_added": "The `InstructionsLoaded` binding: one `LAZY_CONCERNS` row for the observer (its 11,097-byte body ships in its own chunk, never in this bundle) and the event name in the three vocabularies the bundle carries (dispatcher, collector, journal). Measured 1,550,186 bytes with the binding by the gate; the same esbuild invocation on the base and on this branch differs by 237 bytes, so the base sat at 1,549,949 — 51 bytes of headroom.",
|
|
37
37
|
"why_it_could_not_be_avoided": "D8 (council, 2026-10-18) asked for room before a raise. Room was tried and measured: moving `session-eol` (27,708 B in-bundle, `stop` alone) into a chunk freed 29,948 B (same esbuild invocation, with and without the move) but produced a 259,330-byte chunk (`yaml` external) required on every `stop` — about 8.5 times the bytes that event parses today, to buy 186. The observer itself was already moved out. What remains in the bundle is the row and three event-name strings, which no chunk can carry.",
|
|
38
38
|
"what_would_have_caught_it": "Nothing earlier: the base sat 51 bytes under the ceiling, so any new event in the vocabulary would have tripped it. Sized to this binding plus about 300 bytes; step 3.3's promotion is sized when it is built."
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"date": "2026-10-24",
|
|
42
|
+
"from": 1550500,
|
|
43
|
+
"to": 1551000,
|
|
44
|
+
"by": "agent, feat/code-graph-auto-refresh (PR #2604) merged onto docs/inbox-2026-10-ac-roadmap (PR #2603) on the owner's instruction to target #2603",
|
|
45
|
+
"what_was_added": "One `LAZY_CONCERNS` row for the `code-graph-refresh` session concern (its 12,726-byte body ships in its own chunk). Each branch fit alone: #2603 measured 1,550,498 B, #2604 added 153 B to a base that sat 356 B under. Merged, the gate measured 1,550,617 B — 117 over. With the `provider_id` type check restored in validate.ts (the one #2603 had dropped for its last 2 bytes, asked for by both ratification seats of round 12) the final combined measurement is 1,550,751 B, 249 under the new ceiling.",
|
|
46
|
+
"why_it_could_not_be_avoided": "Room was tried and measured, as D8 asks: moving `handoff-context` (10,433 B in-bundle, `session_start` alone) into a chunk would free about 10 KB but produces a 581,613-byte chunk inlined, 319,233 bytes with `yaml` external — required on every `session_start` to buy 117 bytes, the same trade the 2026-10-23 entry refused for `session-eol`. Shortening the row's strings saves under 20 bytes. What remains is the row, which no chunk can carry. Sized to the merged measurement plus about 380 bytes.",
|
|
47
|
+
"what_would_have_caught_it": "Measuring the two branches together before the merge: two lanes that each fit a ceiling with a few hundred bytes to spare do not fit it together, and #2603 had already spent its last 2 bytes by dropping a provider_id type check in validate.ts."
|
|
39
48
|
}
|
|
40
49
|
],
|
|
41
50
|
"chunks": [
|
|
@@ -62,6 +71,12 @@
|
|
|
62
71
|
"max_bytes": 12000,
|
|
63
72
|
"registered_at": "2026-10-23",
|
|
64
73
|
"derivation": "Measured 11,097 bytes on 2026-10-23 (the observe-only `InstructionsLoaded` capture, its classifier, and the CLI entry the spawn fallback needs). The ceiling is that reading plus about 10 %, rounded, with no growth queued. Bound on `instructions_loaded` alone, so a chunk keeps it off every other dispatch's parse; the observer body ships here, never in the dispatch bundle. The binding that reaches it (one registry row and the event name in three vocabularies, 237 bytes) does sit in the bundle and is the 2026-10-23 raise of `max_bytes` recorded in `raise_log`. Like `chat_history` it carries a concern, so a missing chunk falls back to the spawn path and costs latency, never the capture."
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"entry": "src/scripts/hooks/code_graph_refresh_hook.ts",
|
|
77
|
+
"max_bytes": 15400,
|
|
78
|
+
"registered_at": "2026-10-23",
|
|
79
|
+
"derivation": "Measured 14,284 bytes on 2026-10-24 (the session-start code-graph refresh concern with its opt-in, tracked-file and PATH-trust checks, the CLI capability probe and outcome record of the PR #2604 review follow-up, the refresh-lock staleness check it shares with `code-graph refresh --single-flight`, and the hardened spawn environment). The ceiling is that reading plus about 8 %, rounded, with no growth queued; it was registered at 14,000 against 12,726 B and re-derived in the same PR, before any release carried it. Bound on `session_start` alone; a chunk keeps it off every other dispatch's parse, and the dispatch bundle carries only its `LAZY_CONCERNS` row. Like `chat_history` it carries a concern, so a missing chunk falls back to the spawn path and costs latency, never the refresh."
|
|
65
80
|
}
|
|
66
81
|
],
|
|
67
82
|
"chunks_note": "A chunk is loaded only when a caller needs it, so its bytes are not paid by every dispatch; its ceiling exists so that the move out of dispatch.js stays a measured place rather than an unmeasured one. The gate builds each chunk with the exact esbuild segment `build:hook-chunks` uses for its entry.",
|
|
@@ -123,5 +123,16 @@
|
|
|
123
123
|
"measured_at": "2026-10-17",
|
|
124
124
|
"measured_on": "One machine, one clean checkout of origin/main at 8c90aad26, plus the earlier readings taken in a separate worktree of the same content. Node and npm as resolved by the repo's engines field (node >=20.11.0). From this change onward the required Consistency job also produces a CI reading of the built surface, which the 2026-09-10 record said was impossible."
|
|
125
125
|
},
|
|
126
|
-
"built_surface_enforcement_2026_08_30": "How the two surfaces this file records are now ENFORCED, which until 2026-08-30 they were not. `check_pack_size` compared every payload against `budgets.packed_size_mb.max`, and that cap was measured on the UNBUILT tree — this file has said so since 2026-08-24 in `measurement_conditions` and in `built_surface_measurement_2026_08_24`, and the gate did not read it. Measured on the day this note was written: main packed 8.985 MB over 2715 entries with `--ignore-scripts` and passed; a branch adding six source files packed 9.922 over 2827 and failed `max: 9.1`. The 112-entry difference is `dist/cli` plus `dist/cli-delegate` — the build, not the diff. The gate now reads the payload it is judging (`payloadIsBuilt`, keyed on `dist/cli/**`, already used by the content classes for the same reason) and routes: an UNBUILT payload against `max` and the `last_measured` creep line, unchanged; a BUILT payload against `built_surface_measurement_*.built.packed_mb` with the same `regression_pct`. A built payload with no recorded built figure is a FINDING, not a pass — otherwise removing the record would silently disable the built path. What this does NOT do: it does not raise `max`, and it does not gate the built surface against an absolute cap. The built surface gets a regression line only, because no absolute figure for it was ever set by a maintainer and inventing one here would be exactly the invented number the `_comment` warns about. Revisit-if: a maintainer sets an absolute built cap, or the built figure is re-measured (add a new `built_surface_measurement_<date>` key — the newest is read, so no code changes)."
|
|
126
|
+
"built_surface_enforcement_2026_08_30": "How the two surfaces this file records are now ENFORCED, which until 2026-08-30 they were not. `check_pack_size` compared every payload against `budgets.packed_size_mb.max`, and that cap was measured on the UNBUILT tree — this file has said so since 2026-08-24 in `measurement_conditions` and in `built_surface_measurement_2026_08_24`, and the gate did not read it. Measured on the day this note was written: main packed 8.985 MB over 2715 entries with `--ignore-scripts` and passed; a branch adding six source files packed 9.922 over 2827 and failed `max: 9.1`. The 112-entry difference is `dist/cli` plus `dist/cli-delegate` — the build, not the diff. The gate now reads the payload it is judging (`payloadIsBuilt`, keyed on `dist/cli/**`, already used by the content classes for the same reason) and routes: an UNBUILT payload against `max` and the `last_measured` creep line, unchanged; a BUILT payload against `built_surface_measurement_*.built.packed_mb` with the same `regression_pct`. A built payload with no recorded built figure is a FINDING, not a pass — otherwise removing the record would silently disable the built path. What this does NOT do: it does not raise `max`, and it does not gate the built surface against an absolute cap. The built surface gets a regression line only, because no absolute figure for it was ever set by a maintainer and inventing one here would be exactly the invented number the `_comment` warns about. Revisit-if: a maintainer sets an absolute built cap, or the built figure is re-measured (add a new `built_surface_measurement_<date>` key — the newest is read, so no code changes).",
|
|
127
|
+
"built_surface_measurement_2026_10_23": {
|
|
128
|
+
"purpose": "Re-measure of the BUILT surface for PR #2603 (road-to-graph-providers-for-every-stack). It vendors one itemised addition: the C# tree-sitter grammar (src/vendor/grammars/tree-sitter-c_sharp.wasm, 3,978,594 B uncompressed, about 0.25 MB packed), which brings C# extraction and the ASP.NET Core provider. CI measured the built tarball at 16.036 MB against the 15.949 line derived from built_surface_measurement_2026_10_17. AI council 2026-10-23, round 2, two seats convergent: record a dated built measurement for the C# grammar and carry Ruby + Rails to road-to-graph-providers-for-every-stack-carried. The re-anchor is OWNER-RESERVED under the 2026-10-17 precedent (the agent proposing a reset is the one it unblocks); the owner chose it on 2026-10-24.",
|
|
129
|
+
"built": {
|
|
130
|
+
"packed_mb": 16.036,
|
|
131
|
+
"command": "CI: Sync + Generate Tools Consistency job, check_pack_size on the BUILT surface (the same callers built_surface_measurement_2026_10_17 aligned)",
|
|
132
|
+
"note": "The derived ceiling becomes 17.640 at regression_pct 10. Local pristine builds read about 0.1 MB lower (base 15.683, with the C# grammar 15.937); the CI figure is recorded because CI is the caller that gates."
|
|
133
|
+
},
|
|
134
|
+
"policy_clarification": "REQUIRED BY BOTH SEATS. This re-anchor admits the itemised C# grammar only. It does NOT authorise the roughly 1.6 MB of headroom the 10 % rule now derives for unrelated growth: the next built re-anchor must itemise every payload addition since this record, and a grammar (Ruby, blocker built-pack-budget-for-grammars in the carried roadmap) is decided on its own. Revisit-if: an addition lands under this line without being itemised here or in a later record, or a maintainer sets an absolute built cap.",
|
|
135
|
+
"measured_at": "2026-10-23",
|
|
136
|
+
"measured_on": "GitHub Actions, PR #2603 head 2c06e7881, required job Sync + Generate Tools Consistency."
|
|
137
|
+
}
|
|
127
138
|
}
|
|
@@ -55,6 +55,15 @@
|
|
|
55
55
|
"grammar_id": "java",
|
|
56
56
|
"abi": 14,
|
|
57
57
|
"why": "The Java grammar (road-to-a-map-that-draws-itself 6.1). Same reason as the php entry: the engine indexes .java files in a consumer install with no manual parser step."
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"path": "src/vendor/grammars/tree-sitter-c_sharp.wasm",
|
|
61
|
+
"sha256": "6266a7e32d68a3459104d994dc848df15d5672b0ea8e86d327274b694f8e6991",
|
|
62
|
+
"size": 3978594,
|
|
63
|
+
"kind": "tree-sitter-wasm-grammar",
|
|
64
|
+
"grammar_id": "c_sharp",
|
|
65
|
+
"abi": 13,
|
|
66
|
+
"why": "The C# grammar (road-to-graph-providers-for-every-stack 5.2). Same reason as the php entry: the engine indexes .cs files in a consumer install with no manual parser step. ABI 13, not 14: tree-sitter-wasms@0.1.13 compiles this one grammar at ABI 13, which the pinned web-tree-sitter loads, so the loader pins it per language."
|
|
58
67
|
}
|
|
59
68
|
]
|
|
60
69
|
}
|
|
@@ -44,7 +44,7 @@ import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
|
44
44
|
|
|
45
45
|
import { dump as yamlDump, load as yamlLoad } from 'js-yaml';
|
|
46
46
|
|
|
47
|
-
import
|
|
47
|
+
import * as z from 'zod';
|
|
48
48
|
|
|
49
49
|
import { mergeIntoTemplate } from '../../server/io/yamlIO.js';
|
|
50
50
|
import { settingsSchema } from '../../server/schemas/settings.js';
|
|
@@ -269,10 +269,11 @@ function _unwrap(schema: z.ZodTypeAny): z.ZodTypeAny {
|
|
|
269
269
|
let current: z.ZodTypeAny = schema;
|
|
270
270
|
while (
|
|
271
271
|
current instanceof z.ZodDefault ||
|
|
272
|
+
current instanceof z.ZodPrefault ||
|
|
272
273
|
current instanceof z.ZodOptional ||
|
|
273
274
|
current instanceof z.ZodNullable
|
|
274
275
|
) {
|
|
275
|
-
current = (current._def as { innerType: z.ZodTypeAny }).innerType;
|
|
276
|
+
current = (current._def as unknown as { innerType: z.ZodTypeAny }).innerType;
|
|
276
277
|
}
|
|
277
278
|
return current;
|
|
278
279
|
}
|
|
@@ -227,7 +227,7 @@ Tier 2 — maintenance / internal (hooks, MCP, memory, telemetry):
|
|
|
227
227
|
benchmark Report context-token reduction vs the full always-loaded
|
|
228
228
|
projection (from the pinned token baseline). Flags: --format
|
|
229
229
|
code-graph Deterministic code-graph engine (ADR-124, Class A).
|
|
230
|
-
Usage: code-graph build|validate|detect|query|explain|affected|path [options]
|
|
230
|
+
Usage: code-graph build|refresh|map|validate|detect|query|explain|affected|path [options]
|
|
231
231
|
sessions:list List live agent sessions on this repository (shared
|
|
232
232
|
session register) PLUS the unmerged branches checked
|
|
233
233
|
out in other worktrees — the axis that needs no
|
|
@@ -133,12 +133,18 @@ export interface AssignmentShape {
|
|
|
133
133
|
readonly gap?: string;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
/**
|
|
136
|
+
/**
|
|
137
|
+
* Source of a keyword-assignment shape: keyword group, operator, then the consumer's value.
|
|
138
|
+
* Not an assignment: `===` (strict equality), `==` followed by whitespace (a spaced
|
|
139
|
+
* comparison) and `=>` (an arrow) — read as one, `token === 'x'` yielded the value `==` and
|
|
140
|
+
* the council bundle refused every later `==`. A shell `name==value` stays an assignment,
|
|
141
|
+
* and its second `=` belongs to the operator, so the value read is `value`, never a lone `=`.
|
|
142
|
+
*/
|
|
137
143
|
export function assignmentSource(shape: AssignmentShape): string {
|
|
138
144
|
const alt = shape.keywords.map((k) => ASSIGNMENT_KEYWORDS[k]).join('|');
|
|
139
145
|
const group = shape.capture === true ? `(${alt})` : `(?:${alt})`;
|
|
140
146
|
const gap = shape.gap ?? '\\s*';
|
|
141
|
-
const head = `${shape.before ?? ''}${group}${shape.after ?? ''}${gap}
|
|
147
|
+
const head = `${shape.before ?? ''}${group}${shape.after ?? ''}${gap}(?::|=(?!==|=\\s|>)=?)`;
|
|
142
148
|
return shape.value === undefined ? head : `${head}${gap}${shape.value}`;
|
|
143
149
|
}
|
|
144
150
|
|