From 79b0c4d5b5f94b5158b1e8db013885e08ad962e4 Mon Sep 17 00:00:00 2001 From: John Michael Manlupig Date: Tue, 17 Nov 2026 06:29:46 +0800 Subject: [PATCH] docs: add feedback budgets and the code comment ban Feedback loops get time budgets that CI measures, so checks stay fast as code grows. New check specs stop comments, dead code, and duplicate code from piling up. --- BOOTSTRAP.md | 8 ++++++- CONTEXT.md | 9 ++++++++ README.md | 2 ++ checks/README.md | 4 ++++ checks/feedback-budget.md | 39 +++++++++++++++++++++++++++++++++ checks/no-comments.md | 38 ++++++++++++++++++++++++++++++++ checks/no-dead-code.md | 29 ++++++++++++++++++++++++ checks/no-duplicate-code.md | 28 +++++++++++++++++++++++ checks/test-oracle-guard.md | 1 + core/agents/documentation.md | 1 + core/agents/engineering.md | 21 ++++++++++++++++++ core/agents/issue-tracker.md | 2 ++ core/agents/review-and-merge.md | 2 +- core/agents/testing.md | 37 +++++++++++++++++++++++++++++++ core/rules-file.md | 2 ++ 15 files changed, 221 insertions(+), 2 deletions(-) create mode 100644 checks/feedback-budget.md create mode 100644 checks/no-comments.md create mode 100644 checks/no-dead-code.md create mode 100644 checks/no-duplicate-code.md diff --git a/BOOTSTRAP.md b/BOOTSTRAP.md index f9d675b..4e76a85 100644 --- a/BOOTSTRAP.md +++ b/BOOTSTRAP.md @@ -109,6 +109,7 @@ The plan lists: - Each check that Bootstrap will build, and each check spec that an existing check already covers. - Each conflict and the Owner's answer. - Each label that Bootstrap will create in the tracker. +- For an existing Project, one `cleanup` issue per module that holds comments, dead code, or duplicate code. Get the Owner's approval of the plan before Step 5. @@ -154,6 +155,11 @@ For each check spec in the plan: A check that you cannot prove both ways is not done. After two failed attempts on one check, record it in the plan as open, tell the Owner, and continue with the next check. +When you build [feedback-budget](./checks/feedback-budget.md), measure each Feedback loop once. +A loop that is already over its budget is a conflict for the Owner. +Recommend making the loop fast before the check turns on. +When the Owner chooses a higher budget for now, record it in an ADR with the date to return to the Default, and open a `budget` issue. + ## Step 7: prove the setup 1. Start a fresh agent session that has seen none of this work. @@ -179,6 +185,6 @@ After two failed attempts on one check, record it in the plan as open, tell the - which checks run, and where; - the open items and the known-red list; - what to do next: usually the first real task. -4. After the merge, create the tracker labels. +4. After the merge, create the tracker labels, then the `cleanup` issues from the plan. Bootstrap is done when the pull request is merged and the labels exist. diff --git a/CONTEXT.md b/CONTEXT.md index a359f2d..606a115 100644 --- a/CONTEXT.md +++ b/CONTEXT.md @@ -98,6 +98,15 @@ Its issue carries the `escaped` label and links the pull request that caused it. **Known-red baseline**: The list of failing tests that a session records before its first edit. +**Feedback loop**: +One automatic run of checks that an agent or a human waits on before work continues. +A Project has three: the Git hook, the Relevant tier of the check ladder, and the CI gate on each pull request. +The full suite is not a Feedback loop, because it runs only when the Owner asks. + +**Feedback budget**: +The maximum wall-clock time of one Feedback loop. +_Avoid_: speed limit, SLA, performance budget. + ## Verification **Verification contract**: diff --git a/README.md b/README.md index 9a9897b..bd77169 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,8 @@ The agent that bootstraps a project reads the project's own stack and fits the k - One rules file that every coding agent reads, with a short reading map to task pages. - Task pages for engineering, testing, git, review and merge, delegation, documentation, domain language, the issue tracker, runtime verification, corrections, and security. - A set of check specs, each built as a real check in the project's own stack and proved with a failing case and a passing case. +- A time budget for the Git hook, the affected tests, and CI, so that checks stay fast as the code grows. +- No code comments, no dead code, and no duplicate code, so that each fact has one home and there is less code to check. - A risk tier for every change, set by a check from the changed paths, never by the agent. - A review mode that fits the person who owns the project, from "I review every diff" to "I do not read code". - Light records that show what to enforce next and when autonomy is earned: corrections, evidence in each pull request, and escaped defects. diff --git a/checks/README.md b/checks/README.md index 4eb1479..4a588a5 100644 --- a/checks/README.md +++ b/checks/README.md @@ -53,6 +53,10 @@ A check that a hook runs must also run in CI, because a hook can be skipped on a | [no-suppressions](./no-suppressions.md) | The Project has a linter or type checker | | [no-network-in-tests](./no-network-in-tests.md) | The Project has automated tests | | [merged-result](./merged-result.md) | Always | +| [feedback-budget](./feedback-budget.md) | Always | +| [no-comments](./no-comments.md) | The Project has application code | +| [no-dead-code](./no-dead-code.md) | The Project has application code | +| [no-duplicate-code](./no-duplicate-code.md) | The Project has application code | ## Adding a check spec to a Project diff --git a/checks/feedback-budget.md b/checks/feedback-budget.md new file mode 100644 index 0000000..0da776f --- /dev/null +++ b/checks/feedback-budget.md @@ -0,0 +1,39 @@ +# feedback-budget + +**Invariant**: +Each Feedback loop finishes within its Feedback budget, measured in CI on the Project's standard runner. +The Default budgets are 30 seconds for the Git hook, 2 minutes for the Relevant tier, and 10 minutes for the CI gate. +When a loop takes 80% of its budget or more, the check opens one issue with the `budget` label for that loop, or updates the open one. +When a loop takes more than its budget, the check fails. + +**Why**: +Code grows with every change, and each Feedback loop grows with it. +A loop that gets a little slower each week stops nobody until agents and humans wait minutes for each answer, or skip the loop. + +**Applies when**: always. +Skip a loop that the Project does not have. + +**Runs in**: CI, on every pull request. + +**How CI measures each loop**: + +- Git hook: a CI job runs the hook command on the files that the pull request changes, and records its wall-clock time. +- Relevant tier: a CI job runs the affected-tests command on the files that the pull request changes, and records its wall-clock time. +- CI gate: a final required job records the time from the start of the first required job to the end of the last one. + +Local times are not evidence, because local machines differ in speed. + +**Budget file**: +The Project keeps its budget numbers in one file that the check reads. +The numbers change only by an ADR. +A change to the budget file is Tier 3; see [test-oracle-guard](./test-oracle-guard.md). + +**Failing case**: +The CI gate takes 11 minutes on a pull request. + +**Passing case**: +The CI gate takes 7 minutes, and the check opens no issue. +Also passing: the CI gate takes 8 minutes 30 seconds, and the check opens a `budget` issue for the CI gate. + +**Error text**: +` took