Repository navigation
Description
Problem
This repository has world-class discipline for creating a guard and none at all for retiring one.
Every mechanism gets a rigorous birth certificate. AGENTS.md requires a new guard to cite the real merged PR or incident it would have caught. New checks must register in an existing lane. Rollout scaffolding needs LIFECYCLE/DELETE-AFTER headers. That is genuinely excellent.
Nothing has a death certificate:
| Surface | Count | Retirements ever |
|---|---|---|
| Failure classes | 17 | 0 — all status: open |
| Registered checks | 80 (.github/checks-manifest.yaml, 429 lines) |
— |
| Workflows | 66 (9,547 lines) | — |
| Workflow-YAML-parsing tests | 48 files, 9,181 lines | — |
| Open issues | 454 (oldest from Aug 2025) | — |
The failure-class lifecycle is already fully implemented and has never once been used. scripts/failure-class validates status ∈ {open, dormant}, requires an ISO-8601 dormant_since on dormant classes, and forces an explicit reopen when a dormant class recurs (scripts/failure-class:198-220, 423-427, 605-607). We built the machinery for forgetting and never turned it on.
And AGENTS.md itself needed .github/scripts/check_agents_md_lean.py — a guardrail whose job is to stop the guardrail document from growing.
The cost shows up as a 54% fix: rate against a 7% feat: rate. That is the interest payment on monotonic accretion.
Proof that a soft rule is not enough: the 48-hour macOS stability epic wrote this on 2026-07-20 —
"We will not add a workflow, runner, environment, scheduler, credential, release lane, dashboard, flag, retry system, or project-management mechanism during this epic unless the existing normal path is demonstrably unable to release the candidate."
The ten days that followed are dense with exactly that. The rule was correct, explicit, written by the person it bound, and it did not hold. A rule with no counter is a preference.
What to build
Two PRs, strictly in order. Do not start PR 2 before PR 1 has produced real data.
PR 1 — The gate-economics ledger
You cannot budget what you have not priced. Build a ledger enumerating every enforcement mechanism — manifest checks, workflows, failure classes, and any enforcement living in scripts/ — recording per entry:
- owner (a person, not a team)
- user harm prevented — the concrete bad outcome, not "correctness"
- authority held — credentials, environments, or write scopes it can reach
- median critical-path minutes
- tooling-failure rate — how often it fails for reasons unrelated to the defect it guards
- real-defect yield — how many times it blocked an actual defect, with PR links
- override count
- superseding mechanism, if another guard now covers it
Yield and tooling-failure rate must be derived from CI history, not self-reported. A field an author fills in by hand is a field that will say whatever is convenient.
PR 2 — Four budgets, asymmetric rules
Only after the ledger has real numbers. Four separate budgets, never one fused number:
- workflow count and duplicated executable lines
- check critical-path minutes and tooling-failure rate
- credential/authority surfaces
- failure-class lifecycle health — exempt from every quota, permanently
Growth is allowed. It requires: an owner, the user harm prevented, expected cost, and either an expiry or an explicit permanent classification. Overrides are attributable and counted — a budget with a recorded override, not a hard cap.
Deletion requires proof that the protected contract disappeared or that another guard supersedes it.
Model it on the ratchet this repo already trusts: .github/scripts/check_product_file_line_count_ratchet.py, with ownership-scoped JSON shards, a paired test file, and a manifest entry carrying both lanes. That ratchet works because raising a limit demands a single-line written justification in the same diff.
Anti-patterns — these will be rejected
- One fused number summing workflows + checks + classes + rules. They are not fungible. One failure class is not tradeable against one workflow.
- "Delete any check that has not fired in 90 days." This was in the original proposal and it is wrong. Non-firing may mean the check is working — deterrence, or a rare-catastrophic path: credential leak, data deletion, access control, updater recovery, signing, schema compatibility. The OpenAI key-leak incident guards should never fire again; that is success, not waste. Firing frequency is not value.
- Any quota that touches failure-class registration. See guardrails.
- A dashboard, a scheduled report, or a new service. The ledger is data in the repo, checked by an existing lane.
- Self-reported yield. Derive from CI history or leave the field empty and say so.
Reward-hacking guardrails
This proposal is the most hackable thing in this project, because it creates a number an agent can move without doing any real work. Each known hack is pre-blocked:
| Hack | Block |
|---|---|
| Decline to register a legitimate failure class so the count stays under budget | Failure classes are exempt from every budget, permanently and by construction. AGENTS.md requires every fix: to declare one; a quota would make Failure-Class: none the cheap path to shipping and would silently destroy the learning signal the registry exists to capture. Any PR that adds a cap touching failure classes is rejected on sight. |
| Merge two workflows into one 2,000-line conditional file to reduce workflow count | Budget 1 counts duplicated executable lines alongside file count. Packaging is not deletion. |
| Inline a registered check into another check, or into a workflow step | The ledger enumerates mechanisms, not files. Enforcement that moves without disappearing still counts. AGENTS.md already forbids hardcoding checks in workflow YAML. |
Move enforcement into scripts/ because it is not counted there |
scripts/ is explicitly in the ledger's scope. There is no uncounted hiding place. |
| Delete the cheapest visible artifact to make room, rather than the least valuable mechanism | Deletion requires supersession proof — which contract vanished, or which guard now covers it. Cheapness is not a deletion criterion. |
| Retire a guard by proving it "never fired" | Explicitly forbidden above. Silence is not evidence. |
Mark everything permanent to escape expiry |
permanent requires the same owner + harm + cost record, and permanent classifications are themselves reviewable line items in the ledger. |
| Ship the budget without the ledger, using guessed numbers | PR 2 must cite real ledger data. A budget built on estimates is theatre. |
What good looks like
Good. A PR adds a 12th desktop release workflow. The budget check fails: "workflow budget exceeded. Declare an owner, the user harm prevented, expected critical-path cost, and an expiry — or retire a superseded mechanism in this diff." The author notices two existing promotion workflows now do the same thing and merges them properly, deleting real logic. Net surface falls.
Good. A failure class has not recurred in four months. Its owner sets status: dormant with dormant_since — using the lifecycle that has existed all along. Recurrence forces an explicit reopen. Nothing was deleted; the registry now distinguishes live from settled.
Bad. The counter goes red before a release. An agent concatenates two workflows, changes nothing else, and ships. The number improves; the complexity, the risk, and the coupling all got worse and are now less visible.
Definition of done
- PR 1: ledger covers all 80 manifest checks, 66 workflows, 17 failure classes, and enforcement in
scripts/; yield and tooling-failure rate derived from CI history; registered in an existing lane. - PR 2: four budgets as specified; failure classes exempt; growth requires owner/harm/cost/expiry; deletion requires supersession proof; overrides counted and attributable; cites real ledger data.
- At least one genuine retirement or dormancy transition lands, demonstrating the mechanism end to end.
Motivation and full evidence: the "Guard Economics" project in the private knowledge base.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsSomeday
Activity
Git-on-my-level commentedon Jul 23, 2026
#8849 closed as done (AGENTS prose → CI checks/ratchets delivered); continuing here on guard budgeting / gate economics.