devrites 5.14.0 → 5.14.2
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/CHANGELOG.md +17 -0
- package/README.md +6 -3
- package/docs/adr/0033-rite-fast-own-agents.md +45 -0
- package/docs/adr/README.md +2 -1
- package/docs/architecture.md +6 -4
- package/docs/command-map.md +2 -1
- package/docs/flow.md +3 -2
- package/docs/orchestration.md +3 -0
- package/docs/quick-reference.md +2 -1
- package/docs/skills.md +13 -8
- package/docs/usage.md +2 -2
- package/engine/internal/install/apply.go +5 -3
- package/engine/internal/install/binary.go +3 -1
- package/engine/internal/install/install.go +0 -25
- package/engine/internal/lib/claims.go +15 -0
- package/engine/internal/lib/claims_test.go +28 -0
- package/engine/internal/lib/context_next_test.go +53 -0
- package/engine/internal/lib/dispatch.go +28 -7
- package/engine/internal/lib/manifest_union.go +14 -0
- package/engine/internal/overhaul/admit/admit_test.go +9 -0
- package/engine/internal/overhaul/admit/run.go +9 -0
- package/engine/internal/overhaul/bench/run.go +327 -38
- package/engine/internal/overhaul/bench/run_test.go +131 -0
- package/engine/internal/overhaul/bench/stats.go +154 -0
- package/engine/internal/overhaul/ovio/ovio.go +4 -0
- package/engine/internal/overhaul/records/check.go +3 -0
- package/engine/internal/overhaul/records/consistency.go +217 -0
- package/engine/internal/overhaul/records/records_test.go +81 -0
- package/engine/internal/overhaul/records/run.go +1 -1
- package/engine/internal/overhaul/render/run.go +2 -0
- package/engine/internal/overhaul/render/run_test.go +5 -1
- package/engine/internal/overhaul/score/run.go +58 -9
- package/engine/internal/overhaul/score/run_test.go +84 -8
- package/engine/internal/parallel/ops.go +5 -0
- package/engine/internal/state/write.go +8 -2
- package/engine/internal/version/version_test.go +27 -0
- package/engine/main.go +2 -2
- package/pack/.claude/agents/fast-builder.md +90 -0
- package/pack/.claude/agents/fast-checker.md +60 -0
- package/pack/.claude/agents/fast-critic.md +70 -0
- package/pack/.claude/agents/fast-planner.md +95 -0
- package/pack/.claude/agents/overhaul-backend-engineer.md +5 -4
- package/pack/.claude/agents/overhaul-boundary.md +2 -2
- package/pack/.claude/agents/overhaul-craft.md +1 -1
- package/pack/.claude/agents/overhaul-frontend-engineer.md +5 -3
- package/pack/.claude/agents/overhaul-implementer.md +9 -5
- package/pack/.claude/agents/overhaul-specialist.md +6 -3
- package/pack/.claude/agents/overhaul-verifier.md +3 -3
- package/pack/.claude/settings.json +1 -1
- package/pack/.claude/skills/devrites-lib/reference/intent-map.md +2 -0
- package/pack/.claude/skills/overhaul/SKILL.md +2 -1
- package/pack/.claude/skills/overhaul/references/audit-domains.md +139 -12
- package/pack/.claude/skills/overhaul/references/lifecycle.md +2 -0
- package/pack/.claude/skills/overhaul/references/orchestration.md +13 -5
- package/pack/.claude/skills/overhaul/references/records.md +12 -3
- package/pack/.claude/skills/overhaul/references/repair-and-measurement.md +108 -5
- package/pack/.claude/skills/overhaul/references/scope-and-safety.md +17 -2
- package/pack/.claude/skills/overhaul/references/scoring.md +36 -7
- package/pack/.claude/skills/overhaul/references/stack-profiles.md +52 -0
- package/pack/.claude/skills/rite/SKILL.md +4 -1
- package/pack/.claude/skills/rite-doctor/SKILL.md +2 -0
- package/pack/.claude/skills/rite-fast/SKILL.md +183 -0
- package/pack/.claude/skills/rite-fast/reference/artifacts.md +107 -0
- package/pack/.claude/skills/rite-fast/reference/check-and-triage.md +51 -0
- package/pack/.claude/skills/rite-quick/SKILL.md +2 -0
- package/pack/.claude/skills/rite-spec/reference/state-workspace.md +1 -0
- package/pack/generated/claude/agents/fast-builder.md +90 -0
- package/pack/generated/claude/agents/fast-checker.md +60 -0
- package/pack/generated/claude/agents/fast-critic.md +70 -0
- package/pack/generated/claude/agents/fast-planner.md +95 -0
- package/pack/generated/claude/agents/overhaul-backend-engineer.md +5 -4
- package/pack/generated/claude/agents/overhaul-boundary.md +2 -2
- package/pack/generated/claude/agents/overhaul-craft.md +1 -1
- package/pack/generated/claude/agents/overhaul-frontend-engineer.md +5 -3
- package/pack/generated/claude/agents/overhaul-implementer.md +9 -5
- package/pack/generated/claude/agents/overhaul-specialist.md +6 -3
- package/pack/generated/claude/agents/overhaul-verifier.md +3 -3
- package/pack/generated/claude/settings.json +1 -1
- package/pack/generated/claude/skills/devrites-lib/reference/intent-map.md +2 -0
- package/pack/generated/claude/skills/overhaul/SKILL.md +2 -1
- package/pack/generated/claude/skills/overhaul/references/audit-domains.md +139 -12
- package/pack/generated/claude/skills/overhaul/references/lifecycle.md +2 -0
- package/pack/generated/claude/skills/overhaul/references/orchestration.md +13 -5
- package/pack/generated/claude/skills/overhaul/references/records.md +12 -3
- package/pack/generated/claude/skills/overhaul/references/repair-and-measurement.md +108 -5
- package/pack/generated/claude/skills/overhaul/references/scope-and-safety.md +17 -2
- package/pack/generated/claude/skills/overhaul/references/scoring.md +36 -7
- package/pack/generated/claude/skills/overhaul/references/stack-profiles.md +52 -0
- package/pack/generated/claude/skills/rite/SKILL.md +4 -1
- package/pack/generated/claude/skills/rite-doctor/SKILL.md +2 -0
- package/pack/generated/claude/skills/rite-fast/SKILL.md +183 -0
- package/pack/generated/claude/skills/rite-fast/reference/artifacts.md +107 -0
- package/pack/generated/claude/skills/rite-fast/reference/check-and-triage.md +51 -0
- package/pack/generated/claude/skills/rite-quick/SKILL.md +2 -0
- package/pack/generated/claude/skills/rite-spec/reference/state-workspace.md +1 -0
- package/pack/generated/codex/AGENTS.md +1 -0
- package/pack/generated/codex/agents/fast-builder.toml +90 -0
- package/pack/generated/codex/agents/fast-checker.toml +60 -0
- package/pack/generated/codex/agents/fast-critic.toml +70 -0
- package/pack/generated/codex/agents/fast-planner.toml +95 -0
- package/pack/generated/codex/agents/overhaul-backend-engineer.toml +5 -4
- package/pack/generated/codex/agents/overhaul-boundary.toml +2 -2
- package/pack/generated/codex/agents/overhaul-craft.toml +1 -1
- package/pack/generated/codex/agents/overhaul-frontend-engineer.toml +5 -3
- package/pack/generated/codex/agents/overhaul-implementer.toml +9 -5
- package/pack/generated/codex/agents/overhaul-specialist.toml +6 -3
- package/pack/generated/codex/agents/overhaul-verifier.toml +3 -3
- package/pack/generated/codex/skills/devrites-lib/reference/intent-map.md +2 -0
- package/pack/generated/codex/skills/overhaul/SKILL.md +2 -1
- package/pack/generated/codex/skills/overhaul/references/audit-domains.md +139 -12
- package/pack/generated/codex/skills/overhaul/references/lifecycle.md +2 -0
- package/pack/generated/codex/skills/overhaul/references/orchestration.md +13 -5
- package/pack/generated/codex/skills/overhaul/references/records.md +12 -3
- package/pack/generated/codex/skills/overhaul/references/repair-and-measurement.md +108 -5
- package/pack/generated/codex/skills/overhaul/references/scope-and-safety.md +17 -2
- package/pack/generated/codex/skills/overhaul/references/scoring.md +36 -7
- package/pack/generated/codex/skills/overhaul/references/stack-profiles.md +52 -0
- package/pack/generated/codex/skills/rite/SKILL.md +4 -1
- package/pack/generated/codex/skills/rite-doctor/SKILL.md +2 -0
- package/pack/generated/codex/skills/rite-fast/SKILL.md +183 -0
- package/pack/generated/codex/skills/rite-fast/agents/openai.yaml +2 -0
- package/pack/generated/codex/skills/rite-fast/reference/artifacts.md +107 -0
- package/pack/generated/codex/skills/rite-fast/reference/check-and-triage.md +51 -0
- package/pack/generated/codex/skills/rite-quick/SKILL.md +2 -0
- package/pack/generated/codex/skills/rite-spec/reference/state-workspace.md +1 -0
- package/pack/generated/devin/AGENTS.md +1 -0
- package/pack/generated/devin/agents/fast-builder.md +96 -0
- package/pack/generated/devin/agents/fast-checker.md +63 -0
- package/pack/generated/devin/agents/fast-critic.md +73 -0
- package/pack/generated/devin/agents/fast-planner.md +98 -0
- package/pack/generated/devin/agents/overhaul-backend-engineer.md +5 -4
- package/pack/generated/devin/agents/overhaul-boundary.md +2 -2
- package/pack/generated/devin/agents/overhaul-craft.md +1 -1
- package/pack/generated/devin/agents/overhaul-frontend-engineer.md +5 -3
- package/pack/generated/devin/agents/overhaul-implementer.md +9 -5
- package/pack/generated/devin/agents/overhaul-specialist.md +6 -3
- package/pack/generated/devin/agents/overhaul-verifier.md +3 -3
- package/pack/generated/devin/skills/devrites-lib/reference/intent-map.md +2 -0
- package/pack/generated/devin/skills/overhaul/SKILL.md +2 -1
- package/pack/generated/devin/skills/overhaul/references/audit-domains.md +139 -12
- package/pack/generated/devin/skills/overhaul/references/lifecycle.md +2 -0
- package/pack/generated/devin/skills/overhaul/references/orchestration.md +13 -5
- package/pack/generated/devin/skills/overhaul/references/records.md +12 -3
- package/pack/generated/devin/skills/overhaul/references/repair-and-measurement.md +108 -5
- package/pack/generated/devin/skills/overhaul/references/scope-and-safety.md +17 -2
- package/pack/generated/devin/skills/overhaul/references/scoring.md +36 -7
- package/pack/generated/devin/skills/overhaul/references/stack-profiles.md +52 -0
- package/pack/generated/devin/skills/rite/SKILL.md +4 -1
- package/pack/generated/devin/skills/rite-doctor/SKILL.md +2 -0
- package/pack/generated/devin/skills/rite-fast/SKILL.md +183 -0
- package/pack/generated/devin/skills/rite-fast/reference/artifacts.md +107 -0
- package/pack/generated/devin/skills/rite-fast/reference/check-and-triage.md +51 -0
- package/pack/generated/devin/skills/rite-quick/SKILL.md +2 -0
- package/pack/generated/devin/skills/rite-spec/reference/state-workspace.md +1 -0
- package/pack/generated/omp/agents/fast-builder.md +89 -0
- package/pack/generated/omp/agents/fast-checker.md +59 -0
- package/pack/generated/omp/agents/fast-critic.md +69 -0
- package/pack/generated/omp/agents/fast-planner.md +94 -0
- package/pack/generated/omp/agents/overhaul-backend-engineer.md +5 -4
- package/pack/generated/omp/agents/overhaul-boundary.md +2 -2
- package/pack/generated/omp/agents/overhaul-craft.md +1 -1
- package/pack/generated/omp/agents/overhaul-frontend-engineer.md +5 -3
- package/pack/generated/omp/agents/overhaul-implementer.md +9 -5
- package/pack/generated/omp/agents/overhaul-specialist.md +6 -3
- package/pack/generated/omp/agents/overhaul-verifier.md +3 -3
- package/pack/generated/omp/commands/rite-fast.md +5 -0
- package/pack/generated/omp/skills/devrites-lib/reference/intent-map.md +2 -0
- package/pack/generated/omp/skills/overhaul/SKILL.md +2 -1
- package/pack/generated/omp/skills/overhaul/references/audit-domains.md +139 -12
- package/pack/generated/omp/skills/overhaul/references/lifecycle.md +2 -0
- package/pack/generated/omp/skills/overhaul/references/orchestration.md +13 -5
- package/pack/generated/omp/skills/overhaul/references/records.md +12 -3
- package/pack/generated/omp/skills/overhaul/references/repair-and-measurement.md +108 -5
- package/pack/generated/omp/skills/overhaul/references/scope-and-safety.md +17 -2
- package/pack/generated/omp/skills/overhaul/references/scoring.md +36 -7
- package/pack/generated/omp/skills/overhaul/references/stack-profiles.md +52 -0
- package/pack/generated/omp/skills/rite/SKILL.md +4 -1
- package/pack/generated/omp/skills/rite-doctor/SKILL.md +2 -0
- package/pack/generated/omp/skills/rite-fast/SKILL.md +183 -0
- package/pack/generated/omp/skills/rite-fast/reference/artifacts.md +107 -0
- package/pack/generated/omp/skills/rite-fast/reference/check-and-triage.md +51 -0
- package/pack/generated/omp/skills/rite-quick/SKILL.md +2 -0
- package/pack/generated/omp/skills/rite-spec/reference/state-workspace.md +1 -0
- package/pack/generated/pi/AGENTS.md +1 -0
- package/pack/generated/pi/agents/fast-builder.md +90 -0
- package/pack/generated/pi/agents/fast-checker.md +60 -0
- package/pack/generated/pi/agents/fast-critic.md +70 -0
- package/pack/generated/pi/agents/fast-planner.md +95 -0
- package/pack/generated/pi/agents/overhaul-backend-engineer.md +5 -4
- package/pack/generated/pi/agents/overhaul-boundary.md +2 -2
- package/pack/generated/pi/agents/overhaul-craft.md +1 -1
- package/pack/generated/pi/agents/overhaul-frontend-engineer.md +5 -3
- package/pack/generated/pi/agents/overhaul-implementer.md +9 -5
- package/pack/generated/pi/agents/overhaul-specialist.md +6 -3
- package/pack/generated/pi/agents/overhaul-verifier.md +3 -3
- package/pack/generated/pi/prompts/rite-fast.md +5 -0
- package/pack/generated/pi/skills/devrites-lib/reference/intent-map.md +2 -0
- package/pack/generated/pi/skills/overhaul/SKILL.md +2 -1
- package/pack/generated/pi/skills/overhaul/references/audit-domains.md +139 -12
- package/pack/generated/pi/skills/overhaul/references/lifecycle.md +2 -0
- package/pack/generated/pi/skills/overhaul/references/orchestration.md +13 -5
- package/pack/generated/pi/skills/overhaul/references/records.md +12 -3
- package/pack/generated/pi/skills/overhaul/references/repair-and-measurement.md +108 -5
- package/pack/generated/pi/skills/overhaul/references/scope-and-safety.md +17 -2
- package/pack/generated/pi/skills/overhaul/references/scoring.md +36 -7
- package/pack/generated/pi/skills/overhaul/references/stack-profiles.md +52 -0
- package/pack/generated/pi/skills/rite/SKILL.md +4 -1
- package/pack/generated/pi/skills/rite-doctor/SKILL.md +2 -0
- package/pack/generated/pi/skills/rite-fast/SKILL.md +183 -0
- package/pack/generated/pi/skills/rite-fast/reference/artifacts.md +107 -0
- package/pack/generated/pi/skills/rite-fast/reference/check-and-triage.md +51 -0
- package/pack/generated/pi/skills/rite-quick/SKILL.md +2 -0
- package/pack/generated/pi/skills/rite-spec/reference/state-workspace.md +1 -0
- package/package.json +1 -1
- package/scripts/codex-generate.sh +2 -1
- package/scripts/devin-generate.sh +4 -3
- package/scripts/omp-generate.sh +3 -3
- package/scripts/pi-generate.sh +4 -3
|
@@ -19,9 +19,9 @@ specialization:
|
|
|
19
19
|
|
|
20
20
|
| Specialization | Question to answer |
|
|
21
21
|
| --- | --- |
|
|
22
|
-
| `finding-verify` | Is this candidate real? Look for existing defenses, counterexamples, unreachable prerequisites, wrong locations, duplicate root causes |
|
|
23
|
-
| `repair-verify` | Does the fix hold, including neighboring failure modes,
|
|
24
|
-
| `coverage-critic` | Which surfaces, ranges, boundaries
|
|
22
|
+
| `finding-verify` | Is this candidate real? Look for existing defenses, counterexamples, unreachable prerequisites, wrong locations, duplicate root causes. For an absence claim (unused, one implementation, never varies), rerun the population search yourself, including dynamic, reflective, generated, entry-point and external-consumer paths, and check each "never flag" case in `.pi/skills/overhaul/references/audit-domains.md` § Over-engineering and dead weight |
|
|
23
|
+
| `repair-verify` | Does the fix hold, including neighboring failure modes, does the new test still fail against the old implementation in a disposable baseline copy (for other repair kinds, the red that `.pi/skills/overhaul/references/repair-and-measurement.md` § Oracles by finding kind names), and does every added comment meet `.pi/skills/overhaul/references/repair-and-measurement.md` § Comments in repairs (a violation is a finding, not a pass)? |
|
|
24
|
+
| `coverage-critic` | Which surfaces, ranges, boundaries, check classes or applicability cells did the last wave miss, leave stuck or close without a receipt that lists the domain? |
|
|
25
25
|
| `final-clean-critic` | Is there any remaining coverage work? Only a clean answer lets coverage count as complete |
|
|
26
26
|
| `catalog-adequacy` | Does the rubric cover the inventory, profile risk families, journeys and trust boundaries, without duplicate or diluting controls? |
|
|
27
27
|
| `profile-challenge` | Do a provisional profile's rules fit the installed versions, fail on a known-bad fixture and stay quiet on a known-good one? |
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Fast lane for mid-size work: one spec-and-plan step with clarifying questions, up to ten slices built without per-slice gates, one completeness check with gap fixes, review, polish, proof."
|
|
3
|
+
argument-hint: "<task | slug>"
|
|
4
|
+
---
|
|
5
|
+
Read and follow the DevRites skill at `.pi/skills/rite-fast/SKILL.md`, applying it to: ${ARGUMENTS:-the current request}.
|
|
@@ -43,6 +43,7 @@ One binary test per pair; both true ⇒ ask once.
|
|
|
43
43
|
| `devrites-frontend-craft` vs `rite-polish` | Building new UI vs finishing built UI; craft sets standards at build, polish runs the catch pass. |
|
|
44
44
|
| `devrites-ux-shape` vs `rite-spec` | Interaction/state/flow design question vs behavior-contract gap; shaped UX feeds the spec. |
|
|
45
45
|
| `devrites-prose-craft` vs `devrites-frontend-craft` | Long-form prose (docs/README/replies) vs visible product copy; boundary lives in [`browser-proof-checklist.md`](standards/browser-proof-checklist.md). |
|
|
46
|
+
| `rite-quick` vs `rite-fast` vs `rite-spec` | One reversible change → `/rite-quick`; mid-size work the user explicitly runs as `/rite-fast` (≤10 slices, one check after build) → `/rite-fast`; work needing strategy review, a vetted plan, or per-slice gates → `/rite-spec`. |
|
|
46
47
|
| `rite-frame` vs `rite-quick` | Ask underspecified/vague vs small, reversible, unambiguous; frame first when the ask cannot name its outcome. |
|
|
47
48
|
| `devrites-interview` vs `rite-pressure-test` | No stated idea yet (extract intent) vs idea exists (stress-test it). |
|
|
48
49
|
| `rite-handoff` vs `rite-status` | Syncing chat-only context into the workspace for a fresh agent vs read-only current-state report. |
|
|
@@ -73,6 +74,7 @@ Wrong-skill fire: stop, admit it, switch rites.
|
|
|
73
74
|
| Reslice, reorder, or repair an existing plan | `/rite-plan` | Slices exist and evidence invalidates them. |
|
|
74
75
|
| Review plan before code | `/rite-vet` | Every plan; depth scales to risk. |
|
|
75
76
|
| Small safe fix | `/rite-quick` | Escalates auth, migration, public API, destructive, ambiguous, or multi-slice work. |
|
|
77
|
+
| Mid-size work, fast lane (explicit only) | `/rite-fast` | Spec + plan + questions once, ≤10 slices, one completeness check, review, polish, proof; risk deepens questions. |
|
|
76
78
|
| Prove UI/runtime | `/rite-prove` + `devrites-browser-proof` | Capture real evidence. |
|
|
77
79
|
| Stuck/unfamiliar | `/rite-zoom-out` | Map before editing. |
|
|
78
80
|
| Teach me | `/rite-explain` | Human learning loop. |
|
|
@@ -103,7 +103,8 @@ deployment, or anything the user did not start with this command.
|
|
|
103
103
|
|
|
104
104
|
1. Dispatch `recon` ([`overhaul-recon`](.pi/agents/overhaul-recon.md)); admit its inventory,
|
|
105
105
|
components, lanes, partitions, contract seeds and journeys into `coverage.json`,
|
|
106
|
-
`stack-profiles.json` and `contracts.json
|
|
106
|
+
`stack-profiles.json` and `contracts.json`, and record the applicability matrix
|
|
107
|
+
in `coverage.json` ([`references/audit-domains.md`](references/audit-domains.md#applicability-matrix)).
|
|
107
108
|
2. Compose profiles per component ([`references/stack-profiles.md`](references/stack-profiles.md));
|
|
108
109
|
research unknown stacks through the unknown-stack procedure.
|
|
109
110
|
3. Launch the concurrent engineering wave: when both lanes apply,
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
- [Concurrency, caching, retries and distributed reliability](#concurrency-caching-retries-and-distributed-reliability)
|
|
9
9
|
- [Security, privacy and trust boundaries](#security-privacy-and-trust-boundaries)
|
|
10
10
|
- [Architecture, maintainability and anti-slop](#architecture-maintainability-and-anti-slop)
|
|
11
|
+
- [Over-engineering and dead weight](#over-engineering-and-dead-weight)
|
|
11
12
|
- [Tests and verification quality](#tests-and-verification-quality)
|
|
12
13
|
- [Dependencies and supply chain](#dependencies-and-supply-chain)
|
|
13
14
|
- [Backend performance](#backend-performance)
|
|
@@ -15,17 +16,23 @@
|
|
|
15
16
|
- [Frontend craft, interaction and accessibility](#frontend-craft-interaction-and-accessibility)
|
|
16
17
|
- [Classifying frontend guidance](#classifying-frontend-guidance)
|
|
17
18
|
- [Cross-layer contracts](#cross-layer-contracts)
|
|
19
|
+
- [Public API and developer experience](#public-api-and-developer-experience)
|
|
20
|
+
- [Documentation](#documentation)
|
|
18
21
|
- [Operations and project-specific extensions](#operations-and-project-specific-extensions)
|
|
19
22
|
|
|
20
23
|
## Applicability matrix
|
|
21
24
|
|
|
22
25
|
Before a review shard starts, build the matrix domain × component × lane × active
|
|
23
|
-
profile
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
profile and record it in `coverage.json` `applicability[]` (`domain` as one of the
|
|
27
|
+
eight [score keys](scoring.md#audit-sections-and-score-domains), `component`, `lane`,
|
|
28
|
+
`state`, `reason`, `receipts[]`). Each cell is `applicable` (reviewed under the
|
|
29
|
+
correct semantics), `not-applicable` (with a reason and evidence), or `blocked` (with
|
|
30
|
+
the missing capability). Missing expertise, tools or browser access is `blocked`,
|
|
31
|
+
never `not-applicable`. Extend the matrix for discovered stacks, risks and
|
|
32
|
+
requirements. Every item below is a question to answer with evidence, not a finding
|
|
33
|
+
to assume. A cell is closed only by an admitted receipt that lists its domain in
|
|
34
|
+
`domains_checked`; a cell with no such receipt is not checked, never clean, and
|
|
35
|
+
`G-COVERAGE` cannot pass over it.
|
|
29
36
|
|
|
30
37
|
## Correctness and data integrity
|
|
31
38
|
|
|
@@ -107,7 +114,8 @@ globals; duplicated sources of truth; over-centralized modules; abstraction leak
|
|
|
107
114
|
expensive coupling; error semantics; resource ownership; unsafe casts and type
|
|
108
115
|
escapes; broad catches; shotgun changes; superficial wrappers; cargo-cult patterns;
|
|
109
116
|
speculative infrastructure; copy-paste divergence; placeholder code;
|
|
110
|
-
performance-obscuring indirection.
|
|
117
|
+
performance-obscuring indirection. Complexity without a current need has its own
|
|
118
|
+
floor in [Over-engineering and dead weight](#over-engineering-and-dead-weight).
|
|
111
119
|
|
|
112
120
|
A refactor needs a concrete defect, inconsistency, maintenance cost or measurable
|
|
113
121
|
risk. Never rewrite working idiomatic code toward a personal style. Similar-looking
|
|
@@ -119,13 +127,77 @@ Prose clean-up applies only to approved docs, comments or report text and must k
|
|
|
119
127
|
facts, terminology, identifiers and meaning. No UI or copy change rides on a backend
|
|
120
128
|
approval.
|
|
121
129
|
|
|
130
|
+
## Over-engineering and dead weight
|
|
131
|
+
|
|
132
|
+
Code that serves no current requirement still costs reading, testing, securing and
|
|
133
|
+
migrating. Agent-written code shows these patterns more often — larger patches, more
|
|
134
|
+
duplicated blocks, fewer reuses of existing helpers — but authorship is never
|
|
135
|
+
evidence: check every codebase the same way. Tag each candidate with its cheapest cut:
|
|
136
|
+
|
|
137
|
+
- `delete`: unreferenced code, exports, routes, flags, config keys and environment
|
|
138
|
+
variables; scratch and debug files, commented-out blocks, leftover debug output;
|
|
139
|
+
parameters and options every caller leaves at the default; compatibility shims,
|
|
140
|
+
aliases and "legacy" branches for forms that never shipped; features and edge-case
|
|
141
|
+
paths no requirement, caller or test needs.
|
|
142
|
+
- `yagni`: an interface, abstract base or protocol with one implementation (fakes
|
|
143
|
+
count); a factory, builder, registry or plugin system with one product; a type
|
|
144
|
+
parameter used with one type; a strategy, hook or options bag nobody varies; a
|
|
145
|
+
layer that only passes data along; configuration or a flag whose value never
|
|
146
|
+
differs across real deployments.
|
|
147
|
+
- `reuse`: a near-duplicate of a helper, type or pattern that already exists under
|
|
148
|
+
another name. Search by what the code does, not by its name.
|
|
149
|
+
- `stdlib` / `native`: hand-written code that the standard library, the platform
|
|
150
|
+
(HTML, CSS, database constraints, the runtime) or an installed dependency already
|
|
151
|
+
provides. Name the replacement and the version that has it.
|
|
152
|
+
- `dependency`: a package used for a few lines, a manifest entry nothing imports, two
|
|
153
|
+
packages doing one job, or a name that does not resolve on its registry
|
|
154
|
+
(hallucinated or typosquat risk: route to security).
|
|
155
|
+
- `shrink`: wrappers that only delegate; single-use helpers whose name says no more
|
|
156
|
+
than their body; checks for states the types or an internal caller already exclude;
|
|
157
|
+
the same validation repeated across internal layers; broad catches and
|
|
158
|
+
success-shaped fallbacks that hide failure; retries, timeouts or circuit breakers
|
|
159
|
+
around local work, or nested retry layers; caching without a measurement; one error
|
|
160
|
+
logged at every layer; comments and docstrings that restate the code.
|
|
161
|
+
|
|
162
|
+
Evidence for each candidate: the population count (implementations, callers,
|
|
163
|
+
non-default arguments, importers, values across deploy configuration) with tool,
|
|
164
|
+
scope and file count reconciled with `git ls-files`, covering tests, reflection and
|
|
165
|
+
string dispatch, dependency injection, generated code, entry points (CLI, handlers,
|
|
166
|
+
plugins, serverless), public exports and external consumers; history (`git log -S`)
|
|
167
|
+
showing whether the form shipped or the value ever varied; the lines and dependencies
|
|
168
|
+
removable; and the concrete cost. Dead-code, unused-dependency and clone tools yield
|
|
169
|
+
candidates, not findings; token clone detectors miss renamed copies, so a low
|
|
170
|
+
duplication figure proves nothing.
|
|
171
|
+
|
|
172
|
+
Never flag: validation at trust boundaries (user input, network, files,
|
|
173
|
+
deserialization, environment, IPC) — generated code misses these more often than it
|
|
174
|
+
repeats them; exported, published or persisted contracts and their documented
|
|
175
|
+
migration windows; test seams that tests use; real plural implementations, including
|
|
176
|
+
fakes and plugins; audit, security and compliance logging; caching, retries or
|
|
177
|
+
low-level code backed by a linked measurement, incident or SLO; decisions recorded in
|
|
178
|
+
an ADR (report a mismatch with the ADR instead); refactoring and tests that make
|
|
179
|
+
change easier; a single smoke test or assertion self-check. When nobody can say why
|
|
180
|
+
code exists, check its history and owners before proposing removal.
|
|
181
|
+
|
|
182
|
+
Severity follows consequence: most cuts are low or medium `maintainability`.
|
|
183
|
+
Duplicated logic that can diverge on money, authorization, tenancy or time is a
|
|
184
|
+
correctness finding; a swallowed error is correctness or reliability; an unresolvable
|
|
185
|
+
dependency is security.
|
|
186
|
+
|
|
122
187
|
## Tests and verification quality
|
|
123
188
|
|
|
124
189
|
Check assertion strength, observable behavior, unhappy paths, boundaries, state
|
|
125
190
|
transitions, retries, races, idempotency, time dependence, migrations, rollback,
|
|
126
191
|
compatibility, tenant and security isolation, service contracts, flakiness and test
|
|
127
192
|
isolation. Mocks must not remove the database, network or concurrency behavior the
|
|
128
|
-
defect lives in. Confirm tests are discovered and actually run.
|
|
193
|
+
defect lives in. Confirm tests are discovered and actually run. Detect flakiness by rerunning, in
|
|
194
|
+
random order with a recorded seed (`go test -shuffle=on -count=N`, `pytest -p
|
|
195
|
+
randomly`, Jest `--randomize`): a test that fails then passes on unchanged code is
|
|
196
|
+
flaky and cannot serve as an oracle; order dependence is its most common cause.
|
|
197
|
+
Flag tautological
|
|
198
|
+
tests (asserting what a mock returns, or only "not null"), mocks of internal
|
|
199
|
+
collaborators or of the unit under test, near-duplicate tests that differ by one
|
|
200
|
+
literal, and production code special-cased to pass a test.
|
|
129
201
|
|
|
130
202
|
Line and branch coverage locate gaps; they never prove correctness. Use focused
|
|
131
203
|
mutation testing, property-based tests, fuzzing, differential checks or fault
|
|
@@ -137,7 +209,8 @@ that merely restate the implementation.
|
|
|
137
209
|
|
|
138
210
|
Inventory direct and transitive **resolved** versions, their runtime/build/test
|
|
139
211
|
roles, origins, licenses, support and end-of-life status, advisories, deprecated
|
|
140
|
-
APIs, provenance, integrity and install scripts
|
|
212
|
+
APIs, provenance, integrity and install scripts, plus the unused, redundant or
|
|
213
|
+
unresolvable entries named under [Over-engineering and dead weight](#over-engineering-and-dead-weight). Verify the latest compatible and
|
|
141
214
|
the latest upstream versions separately against official registries, releases and
|
|
142
215
|
advisories at run time; "newer" alone justifies nothing.
|
|
143
216
|
|
|
@@ -251,11 +324,65 @@ documented or observed contract evidence from unverifiable internals. A coordina
|
|
|
251
324
|
interface change needs one reconciled contract revision, explicit write owners,
|
|
252
325
|
ordered tasks and approval.
|
|
253
326
|
|
|
327
|
+
## Public API and developer experience
|
|
328
|
+
|
|
329
|
+
For libraries, SDKs, CLIs, plugins and configuration consumed outside the repository:
|
|
330
|
+
|
|
331
|
+
- **Compatibility:** diff the exported surface against the last release with the
|
|
332
|
+
ecosystem's checker (`gorelease` or `apidiff`, `cargo-semver-checks`, `griffe
|
|
333
|
+
check`, api-extractor with publint and `attw`, japicmp); a breaking change needs a
|
|
334
|
+
major version or a documented migration. `gorelease` does not fail on `v0`
|
|
335
|
+
modules; report their breaking changes anyway.
|
|
336
|
+
- **CLI:** data on stdout and diagnostics on stderr; exit 0 only on success, with
|
|
337
|
+
distinct non-zero codes for usage and runtime errors; `--help` and `--version`;
|
|
338
|
+
machine-readable output where scripts consume it; no color when not a TTY or when
|
|
339
|
+
`NO_COLOR` is set; never prompt without a TTY, and a flag for every prompt.
|
|
340
|
+
- **Errors:** name the cause and the offending value, the constraint, and how to fix
|
|
341
|
+
it; no stack trace as the only message; never rely on color alone.
|
|
342
|
+
- **Configuration:** documented precedence (flags, environment, project, user,
|
|
343
|
+
system); unknown keys rejected with a suggestion; a validate command or dry run.
|
|
344
|
+
|
|
345
|
+
Each claim gets an executed check: the compatibility diff, `cmd --json` parsing,
|
|
346
|
+
`NO_COLOR=1 cmd` containing no escape codes, a bad argument giving a non-zero exit
|
|
347
|
+
with empty stdout, golden tests on error text.
|
|
348
|
+
|
|
349
|
+
## Documentation
|
|
350
|
+
|
|
351
|
+
Inventoried docs are reviewed, not skipped. Check that install, setup and quick-start
|
|
352
|
+
commands run on a clean checkout; examples compile or run (Go `Example` tests,
|
|
353
|
+
doctests, `cargo test --doc`); generated references (CLI help, OpenAPI, config
|
|
354
|
+
schemas) match a fresh regeneration with no diff (`cog --check`, `mdox fmt --check`,
|
|
355
|
+
`git diff --exit-code`); documented flags, endpoints and settings exist in code and
|
|
356
|
+
the reverse; local links and anchors resolve (`lychee --offline`). Wrong docs that
|
|
357
|
+
send a user down a broken path are findings with the same severity rules as code.
|
|
358
|
+
|
|
254
359
|
## Operations and project-specific extensions
|
|
255
360
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
361
|
+
For every long-running service, check with a fault test where possible:
|
|
362
|
+
|
|
363
|
+
- **Signals:** structured logs carrying the trace or correlation ID from the inbound
|
|
364
|
+
`traceparent` to outbound calls and jobs; RED metrics per endpoint and USE metrics
|
|
365
|
+
per resource under stable OpenTelemetry semantic-convention names; no secrets,
|
|
366
|
+
tokens or personal data in logs, spans or metrics; bounded metric cardinality.
|
|
367
|
+
- **Health:** liveness checks only the process, never a dependency; readiness checks
|
|
368
|
+
what serving needs; a startup probe covers slow boot. Stop the database: readiness
|
|
369
|
+
fails, liveness stays up.
|
|
370
|
+
- **Shutdown:** on SIGTERM readiness fails first, in-flight work drains and consumers
|
|
371
|
+
stop fetching, all within the platform's grace period.
|
|
372
|
+
- **Timeouts and retries:** every outbound call has connect and total timeouts from
|
|
373
|
+
the caller's deadline; retries are bounded, jittered, at one layer, only for
|
|
374
|
+
idempotent work; queues and concurrency are bounded.
|
|
375
|
+
- **Configuration:** from environment or mounted files, never secrets in the
|
|
376
|
+
repository or image; a missing required setting fails startup and names it.
|
|
377
|
+
- **Change safety:** rollback or roll-forward path, staged rollout, feature-flag
|
|
378
|
+
kill switches with owners and removal dates, expand-and-contract migrations with
|
|
379
|
+
lock and statement timeouts (squawk, `atlas migrate lint`), version skew between
|
|
380
|
+
old and new instances.
|
|
381
|
+
- **Recovery:** backups proven by a restore that queries data against RTO and RPO;
|
|
382
|
+
alerts on symptoms and SLO burn, each with a runbook; SLOs on user-visible
|
|
383
|
+
behavior; CPU and memory requests and a memory limit.
|
|
384
|
+
|
|
385
|
+
Also check deployment order, configuration drift, resilience and diagnosability.
|
|
259
386
|
Add language- or domain-specific extensions when applicable: memory ownership and
|
|
260
387
|
FFI, native sanitizers, embedded constraints, GPU and frame budgets, numerical, data
|
|
261
388
|
and ML reproducibility, regulated or safety requirements. An unfamiliar domain is
|
|
@@ -145,6 +145,8 @@ interface one write owner with explicit ordering; let a shared-contract change l
|
|
|
145
145
|
only with evidence from both consumers. Independent frontend and backend tasks may
|
|
146
146
|
run concurrently. A task like "improve architecture", "optimize queries" or "add
|
|
147
147
|
tests" with no concrete failing case and acceptance evidence is not approvable.
|
|
148
|
+
Each task names the oracle its kind requires
|
|
149
|
+
([`repair-and-measurement.md`](repair-and-measurement.md#oracles-by-finding-kind)).
|
|
148
150
|
Rejected and deferred findings stay visible and keep failing their controls.
|
|
149
151
|
|
|
150
152
|
## Revisions, evidence and freshness
|
|
@@ -35,13 +35,15 @@ directory names or file extensions. One package or file can serve several lanes.
|
|
|
35
35
|
| Backend engineering | Service, domain, API, job, data, concurrency, authorization and service performance, including server parts of full-stack frameworks | [`overhaul-backend-engineer`](.pi/agents/overhaul-backend-engineer.md) |
|
|
36
36
|
| Boundary / integration | Producer/consumer contracts, shared packages, serialization, trust transitions, deployment skew | [`overhaul-boundary`](.pi/agents/overhaul-boundary.md) |
|
|
37
37
|
| Frontend craft | Design system fit, interaction states, keyboard/focus, accessibility, responsive and motion evidence | [`overhaul-craft`](.pi/agents/overhaul-craft.md) |
|
|
38
|
-
| Other | Build tooling, infrastructure, libraries, data/ML workloads — explicit extra profiles, never forced into frontend/backend | [`overhaul-specialist`](.pi/agents/overhaul-specialist.md) |
|
|
38
|
+
| Other | Build tooling, CI, infrastructure, libraries, data/ML workloads, operations readiness, public API and CLI experience, documentation — explicit extra profiles, never forced into frontend/backend | [`overhaul-specialist`](.pi/agents/overhaul-specialist.md) |
|
|
39
39
|
|
|
40
40
|
Frontend and backend engineering are always different agent invocations with
|
|
41
41
|
different active profiles, even in a same-language codebase. The boundary reviewer
|
|
42
42
|
supplements them; it never absorbs them into one generic "full-stack" review. The
|
|
43
43
|
craft reviewer supports the frontend lane; it never approves code correctness or
|
|
44
|
-
imposes a redesign.
|
|
44
|
+
imposes a redesign. Dispatch the `operations`, `devex` and `docs` specializations
|
|
45
|
+
whenever the matrix marks their cells applicable: a deployable service, a published
|
|
46
|
+
library, CLI or SDK, and inventoried documentation.
|
|
45
47
|
|
|
46
48
|
For every lane record `present`, `not present`, `not impacted within scope`, or
|
|
47
49
|
`blocked/unavailable`. Only the first three are facts about the target; only
|
|
@@ -148,14 +150,17 @@ Each worker writes one immutable `overhaul.receipt/1` JSON file:
|
|
|
148
150
|
```json
|
|
149
151
|
{"schema": "overhaul.receipt/1", "run_id": "", "task_id": "", "attempt_id": "", "role": "",
|
|
150
152
|
"lane": "", "context_id": "", "started_at": "", "finished_at": "", "snapshot": "",
|
|
151
|
-
"profiles": [], "inspected": [{"path": "", "ranges": [[1, 80]]}], "rules_applied": [],
|
|
153
|
+
"profiles": [], "inspected": [{"path": "", "ranges": [[1, 80]]}], "domains_checked": [], "rules_applied": [],
|
|
152
154
|
"rules_unassessed": [], "commands": [{"cmd": "", "exit": 0, "log": "evidence/..."}],
|
|
153
155
|
"outcome": "findings|no-findings|gap|patch|verdict", "findings": [], "questions": [],
|
|
154
156
|
"changed_paths": [], "evidence": [], "limitations": [], "basis": ""}
|
|
155
157
|
```
|
|
156
158
|
|
|
157
159
|
`no-findings` names the checks and ranges inspected; a bare "looks good" is
|
|
158
|
-
malformed. `
|
|
160
|
+
malformed. `domains_checked` lists the score domains (`correctness`, `security`,
|
|
161
|
+
`reliability`, `performance`, `tests`, `architecture`, `ux`, `operations`) the
|
|
162
|
+
reviewer applied to those ranges; admission rejects an unknown key and a
|
|
163
|
+
`no-findings` without it, and only a listed domain can close an applicability cell. `gap` names the missing input, failed check or capability limit.
|
|
159
164
|
Timeouts, null output and malformed receipts are `gap`, never `no-findings`. A
|
|
160
165
|
generic full-stack receipt cannot close a missing lane, language or profile
|
|
161
166
|
assignment. Admit receipts only through `devrites-engine overhaul admit receipt`; a duplicate or
|
|
@@ -170,7 +175,10 @@ finding cannot be confirmed.
|
|
|
170
175
|
## Finding proposals
|
|
171
176
|
|
|
172
177
|
Workers propose; the coordinator assigns canonical `F-` IDs after admission. Fields:
|
|
173
|
-
`title`; `domain
|
|
178
|
+
`title`; `domain` (one score domain key, per the
|
|
179
|
+
[section map](scoring.md#audit-sections-and-score-domains)); `controls` (the rubric
|
|
180
|
+
control IDs it fails, required once a rubric is frozen and the finding is
|
|
181
|
+
confirmed); `lanes`; `component_ids`; `profile_ids` with revisions;
|
|
174
182
|
`rule_ids`; `contract_or_journey_ids`; `kind` (`defect`, `hardening`,
|
|
175
183
|
`maintainability`, `opportunity`); `scope_origin` (`introduced`, `exposed-existing`,
|
|
176
184
|
`pre-existing`); `locations` (paths, line ranges, symbols, file hashes);
|
|
@@ -32,11 +32,11 @@ Placement rules: [`scope-and-safety.md`](scope-and-safety.md#run-area-and-checkp
|
|
|
32
32
|
| File (in a generation) | Role and key fields |
|
|
33
33
|
| --- | --- |
|
|
34
34
|
| `run.json` | `run_id`, `repo_root`, `mode` (`full`/`pr`/`branch`), `assessment_only`, `phase`, `readiness_verdict`, `execution_outcome`, `identities` (comparison, baseline, candidate), `capabilities` (tools + digests, concurrency, isolation, browser), `budget`, `revisions.plan`/`revisions.rubric` (`rev`, `file`), `degradation`, `questions[]`, `stop`, `task_outcomes` |
|
|
35
|
-
| `coverage.json` | `files[]`: `path`, `sha256`, `lines`, `component`, `lanes`, `eligible`, `exclusion.reason`, `binary`, `ranges[]` (`start`, `end`, `lanes`, `profiles`, `receipts{lane: [...]}`, `tools[]`, `state`) |
|
|
35
|
+
| `coverage.json` | `files[]`: `path`, `sha256`, `lines`, `component`, `lanes`, `eligible`, `exclusion.reason`, `binary`, `ranges[]` (`start`, `end`, `lanes`, `profiles`, `receipts{lane: [...]}`, `tools[]`, `state`); `applicability[]`: `domain`, `component`, `lane`, `state` (`applicable`/`not-applicable`/`blocked`), `reason`, `receipts[]` ([matrix](audit-domains.md#applicability-matrix)) |
|
|
36
36
|
| `stack-profiles.json` | `components[]` (B6 component record), `profiles[]` (`id`, `rev`, `file`, `sha256`, `status`), `dependencies[]` (dependency decisions) |
|
|
37
37
|
| `dispatch.json` | `attempts[]`: `task_id`, `attempt_id`, `wave`, `role`, `lane`, `profiles`, `snapshot`, `write_paths`, `authorized_by`, `status`, `dispatched_at`, `started_at`, `finished_at`, `receipt`, `changed_paths` |
|
|
38
38
|
| `contracts.json` | `contracts[]`: producer/consumer graph, schema/version, journeys, both-side evidence, open compatibility questions |
|
|
39
|
-
| `findings.json` | `findings[]` with the fields in [`orchestration.md`](orchestration.md#finding-proposals) plus `status`, `severity`, `verified_by`, `history[]` |
|
|
39
|
+
| `findings.json` | `findings[]` with the fields in [`orchestration.md`](orchestration.md#finding-proposals) (including `domain` and `controls`) plus `status`, `severity`, `verified_by`, `history[]` |
|
|
40
40
|
| `evidence.json` | `items[]`: `id`, `kind`, `path`, `sha256`, `command`, `exit`, `fingerprint`, `inputs`, `limitations`, `by`; benchmarks add `measurement` |
|
|
41
41
|
| `approval.json` | append-only `events[]` ([fields](lifecycle.md#the-approval-gate)) |
|
|
42
42
|
| `results-baseline.json`, `results-candidate.json`, `gates.json`, `scorecard*.json` | scoring inputs and calculator output ([`scoring.md`](scoring.md)) |
|
|
@@ -132,7 +132,16 @@ per path (case-folded, symlink-resolved); no `dispatched`, `running` or `returne
|
|
|
132
132
|
attempt once the outcome leaves `RUNNING`; one outcome per approved task at the end;
|
|
133
133
|
a coverage denominator that never shrinks; append-only cycles, findings history and
|
|
134
134
|
approval events; immutable revisions; view stamps; manifest integrity; stale stages
|
|
135
|
-
and interrupted publishes.
|
|
135
|
+
and interrupted publishes. Across records: every finding's `domain` is a score key;
|
|
136
|
+
once a rubric is frozen every confirmed finding names known `controls`, and none of
|
|
137
|
+
an open finding's controls is PASS in the current results; applicability cells use a
|
|
138
|
+
score key, a known state, a reason unless `applicable`, unique keys and receipts
|
|
139
|
+
inside the run; coverage ranges use the seven coverage states; a scorecard's
|
|
140
|
+
`G-NO-CRITICAL-HIGH` PASS needs no open critical or high finding,
|
|
141
|
+
`G-NO-OPEN-SERIOUS-LEAD` PASS no open lead with critical or high potential impact,
|
|
142
|
+
and `G-COVERAGE` PASS a non-empty matrix with no blocked cell, every applicable cell
|
|
143
|
+
closed by an admitted, non-gap receipt whose `domains_checked` lists its domain, and every range of
|
|
144
|
+
every eligible file reviewed or excluded.
|
|
136
145
|
|
|
137
146
|
Receipt admission and quote anchoring live in `devrites-engine overhaul admit`
|
|
138
147
|
([`orchestration.md`](orchestration.md#admission-tool)).
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
## Contents
|
|
4
4
|
|
|
5
5
|
- [One approved repair slice](#one-approved-repair-slice)
|
|
6
|
+
- [Simplification repairs](#simplification-repairs)
|
|
7
|
+
- [Oracles by finding kind](#oracles-by-finding-kind)
|
|
8
|
+
- [Comments in repairs](#comments-in-repairs)
|
|
6
9
|
- [Oracles by lane](#oracles-by-lane)
|
|
7
10
|
- [Never do this to get green](#never-do-this-to-get-green)
|
|
8
11
|
- [False-green defenses](#false-green-defenses)
|
|
@@ -24,10 +27,12 @@ and only after the coordinator recorded the approval.
|
|
|
24
27
|
failing line), **broken test** (setup, import or compile error — not a valid red
|
|
25
28
|
for a logic defect), **false pass** (passes on the unfixed code — the oracle does
|
|
26
29
|
not reach the defect), or **not run** (not discovered, filtered or skipped). Only a
|
|
27
|
-
good red continues
|
|
30
|
+
good red continues; a repair other than a defect fix gets its red from
|
|
31
|
+
[Oracles by finding kind](#oracles-by-finding-kind).
|
|
28
32
|
3. Implement the smallest coherent fix. Keep supported contracts and UX unchanged
|
|
29
33
|
except for the exact approved change. No formatting sweep, no speculative
|
|
30
|
-
abstraction.
|
|
34
|
+
abstraction. Add comments only as [Comments in repairs](#comments-in-repairs)
|
|
35
|
+
allows.
|
|
31
36
|
4. Run the same oracle to green, then the relevant unit, integration, contract,
|
|
32
37
|
end-to-end, static and security checks plus the impact cascade on dependents.
|
|
33
38
|
Capture commands, exit codes and output as evidence.
|
|
@@ -47,13 +52,80 @@ never leave unaccounted changes; the coordinator compares observed changed paths
|
|
|
47
52
|
the contract before admitting a patch.
|
|
48
53
|
|
|
49
54
|
A pure refactor starts with characterization or contract tests and strengthens weak
|
|
50
|
-
oracles; never damage correct code just to see red.
|
|
55
|
+
oracles; never damage correct code just to see red. A simplification follows
|
|
56
|
+
[Simplification repairs](#simplification-repairs). Performance work starts with a
|
|
51
57
|
reproducible benchmark or query-budget oracle; ordinary unit tests do not assert
|
|
52
58
|
flaky wall-clock times — use controlled benchmarks plus deterministic query counts or
|
|
53
59
|
complexity bounds. When a bug cannot be reproduced safely, record the exact missing
|
|
54
60
|
fact, propose a safe alternative and obtain a documented exception where needed; a
|
|
55
61
|
waived verification stays a visible gap and may block readiness.
|
|
56
62
|
|
|
63
|
+
## Simplification repairs
|
|
64
|
+
|
|
65
|
+
A confirmed [over-engineering](audit-domains.md#over-engineering-and-dead-weight)
|
|
66
|
+
finding — delete, inline, reuse, replace with standard library, platform or installed
|
|
67
|
+
dependency, remove a dependency, shrink — preserves behavior, so its oracle proves
|
|
68
|
+
preservation instead of a defect:
|
|
69
|
+
|
|
70
|
+
1. **Population evidence**, rerun on the current fingerprint: the search that shows
|
|
71
|
+
the removed element is unused, single-implementation or never varied, with the
|
|
72
|
+
same scope rules as the finding.
|
|
73
|
+
2. **Reach:** characterization or contract tests over the behavior that stays. Show
|
|
74
|
+
they reach it: a seeded mutant in the affected code turns them red on a disposable
|
|
75
|
+
baseline copy (this is the good red; quote it). Code with zero references has no
|
|
76
|
+
behavior to reach; the population evidence stands in for the red.
|
|
77
|
+
3. **Green on the candidate:** the same tests, the full relevant suite, build,
|
|
78
|
+
typecheck and lint, with discovered and executed counts; for a dependency removal
|
|
79
|
+
also a clean install from the lockfile.
|
|
80
|
+
4. **Result:** lines, files and dependencies removed, recorded as evidence. A
|
|
81
|
+
simplification that changes a public, persisted or wire contract is not a
|
|
82
|
+
simplification: it needs its own approved contract task.
|
|
83
|
+
|
|
84
|
+
## Oracles by finding kind
|
|
85
|
+
|
|
86
|
+
Every approved task needs a check that fails before the repair and passes after
|
|
87
|
+
it. When correct code has no natural red, seed a known fault on a disposable
|
|
88
|
+
baseline copy and show the new artifact catches it; when neither exists, the
|
|
89
|
+
finding stays audit-only. A zero-mutant, zero-test or zero-link run is never a
|
|
90
|
+
pass.
|
|
91
|
+
|
|
92
|
+
| Repair | Red on the baseline | Green on the candidate |
|
|
93
|
+
| --- | --- | --- |
|
|
94
|
+
| Defect | Regression test fails at the named assertion | Same test passes |
|
|
95
|
+
| Missing or weak test | A seeded mutant (or reverted behavior) in the covered lines survives the old suite; name the mutation tool and version | The new test kills it; diff-scoped mutation score recorded |
|
|
96
|
+
| Simplification | [Simplification repairs](#simplification-repairs) | |
|
|
97
|
+
| Documentation | The documented command, example, generated reference or link check fails, or `git diff --exit-code` shows drift after regeneration | It runs, compiles or regenerates without a diff |
|
|
98
|
+
| Observability | A test with an in-memory log, metric or trace sink finds no record with the required keys (trace ID, stable semantic-convention names) | The record is present; deleting the new line turns it red again |
|
|
99
|
+
| CI, build, IaC or container config | The linter or policy tool reports the named rule ID (actionlint, zizmor, hadolint, Checkov, conftest) | That ID is gone and nothing new appears |
|
|
100
|
+
| Dependency | The advisory scanner reports the advisory against a pinned database snapshot | Same scanner and snapshot report nothing new; lockfile diff limited to the approved package and its required closure |
|
|
101
|
+
| Contract or public API | The compatibility or schema diff (oasdiff, buf breaking, cargo-semver-checks, gorelease, griffe, api-extractor) or a consumer contract test fails | Zero breaking findings, or the approved version bump |
|
|
102
|
+
| Operations | A fault test fails: a hanging dependency, SIGTERM during a request, a stopped database, a missing required setting | The call fails within its timeout, the request drains, readiness goes unready while liveness stays up, startup names the setting |
|
|
103
|
+
| Flaky test | At least one failure in N ≥ 10 shuffled runs of the unchanged code | Zero failures in the same N runs |
|
|
104
|
+
| Performance | [Benchmark tool](#benchmark-tool) verdict or a deterministic budget | |
|
|
105
|
+
|
|
106
|
+
## Comments in repairs
|
|
107
|
+
|
|
108
|
+
Default to no new comments: names, types and the regression test carry the meaning.
|
|
109
|
+
Add one only when the code cannot show why it is written this way: an invariant, an
|
|
110
|
+
ordering, locking or security trap, a workaround for a named external bug (link it),
|
|
111
|
+
a measured performance trade-off, or a compatibility constraint. Doc comments on a
|
|
112
|
+
public API are the exception when the project's convention requires them (for
|
|
113
|
+
example Go exported identifiers); match the neighboring style.
|
|
114
|
+
|
|
115
|
+
Never write in target code:
|
|
116
|
+
|
|
117
|
+
- finding, task, run or plan IDs, or the word "overhaul": they belong in the receipt;
|
|
118
|
+
- comments that restate the code, or test comments that restate the test name or
|
|
119
|
+
label Arrange/Act/Assert;
|
|
120
|
+
- edit narration ("Fixed", "Added to handle", "Now correctly") or what the code did
|
|
121
|
+
before the change; history belongs in the commit, not the source;
|
|
122
|
+
- chat residue, guesses stated as fact, stacked hedges, or sales words ("robust",
|
|
123
|
+
"seamless", "comprehensive").
|
|
124
|
+
|
|
125
|
+
Put the constraint first, in literal words, in one sentence where possible. Keep a
|
|
126
|
+
hedge only when it names a real, specific uncertainty ("unverified on Windows").
|
|
127
|
+
Leave existing comments alone unless the change makes one false; then correct it.
|
|
128
|
+
|
|
57
129
|
## Oracles by lane
|
|
58
130
|
|
|
59
131
|
- **Frontend:** reproduce the behavior — stale or out-of-order responses,
|
|
@@ -203,5 +275,36 @@ controlled window; a contaminated ratio never passes a gate.
|
|
|
203
275
|
raw per-invocation `baseline` and `candidate` samples, the recorded run `order`, the
|
|
204
276
|
`target` ratio, `materiality`, optional `resolution`, `resamples` and `seed`.
|
|
205
277
|
Verdicts: `SUPPORTS_TARGET`, `IMPROVEMENT_BELOW_TARGET`, `IMPROVEMENT`,
|
|
206
|
-
`INCONCLUSIVE`, `REGRESSION`, `NO_RATIO`. Fewer than 10 samples per arm
|
|
207
|
-
recorded as interleaved cap any improvement at
|
|
278
|
+
`INCONCLUSIVE`, `REGRESSION`, `NO_RATIO`. Fewer than 10 samples per arm, arms not
|
|
279
|
+
recorded as interleaved, or a missing interval cap any improvement at
|
|
280
|
+
`INCONCLUSIVE`.
|
|
281
|
+
|
|
282
|
+
The ratio carries two 95% intervals: the seeded bootstrap of the median ratio
|
|
283
|
+
(`ci95`) and the distribution-free Hodges–Lehmann ratio bounds (`hodges_lehmann`),
|
|
284
|
+
exact from the Mann–Whitney distribution and needing no seed. A claim uses the
|
|
285
|
+
smaller lower bound; either upper bound below 1 is `REGRESSION`. A zero or negative
|
|
286
|
+
sample, or more than four million baseline × candidate pairs, leaves no
|
|
287
|
+
Hodges–Lehmann bounds and caps the verdict. Optional inputs:
|
|
288
|
+
|
|
289
|
+
- `quantile` (for example `0.99`) compares a tail. Give each invocation as its raw
|
|
290
|
+
request latencies (the tool takes their quantile) or as its own quantile with
|
|
291
|
+
`requests_per_invocation`, never both in one arm. Fewer than `10 / (1 − quantile)`
|
|
292
|
+
requests per invocation (1000 for p99) caps the verdict and any budget PASS. Never pool requests across invocations: the
|
|
293
|
+
invocation stays the resampling unit.
|
|
294
|
+
- `tolerance` (for example `0.05`) adds a `guardrail` for metrics that must not get
|
|
295
|
+
worse: `NON_INFERIOR` when the lower bound is at least `1 / (1 + tolerance)`,
|
|
296
|
+
`REGRESSION` when the upper bound is below it, otherwise `INCONCLUSIVE`. "Not
|
|
297
|
+
significant" is never "no regression".
|
|
298
|
+
- `budget` (`value`, `quantile` default `0.5`, `deterministic`) tests the candidate
|
|
299
|
+
against an absolute target with one-sided 95% order-statistic bounds: `PASS` only
|
|
300
|
+
when the bound clears the target, `FAIL` when the opposite bound misses it,
|
|
301
|
+
`INSUFFICIENT_DATA` when there are too few invocations for that quantile (p75 needs
|
|
302
|
+
11, p95 59, p99 299). `deterministic: true` (bytes, query or request counts) needs
|
|
303
|
+
every invocation to agree, else `NONDETERMINISTIC`.
|
|
304
|
+
- `error_rates` (`baseline`, `candidate` per-invocation rates, absolute `tolerance`,
|
|
305
|
+
optional `requests` totals) guards failures: the candidate-minus-baseline interval
|
|
306
|
+
is the wider of an invocation bootstrap and the Newcombe score interval; `PASS`
|
|
307
|
+
only when its upper bound is within tolerance. Pair every latency claim under load
|
|
308
|
+
with it: fast failures flatter latency.
|
|
309
|
+
- `load` (`offered` and `completed` per arm) marks a run where either arm completed
|
|
310
|
+
under 98% of offered load as saturated and caps every verdict.
|
|
@@ -76,13 +76,28 @@ these limits:
|
|
|
76
76
|
- Never install, update or fetch dependencies, and never run commands that
|
|
77
77
|
deploy, migrate or seed a real database, call paid or production services, or send
|
|
78
78
|
data out. When a check needs one of those, record it `BLOCKED` with the missing
|
|
79
|
-
step, or ask.
|
|
79
|
+
step, or ask. The one exception is an approved dependency task, described below.
|
|
80
80
|
- Treat any change to a non-ignored path as a write. Run `snapshot state`
|
|
81
81
|
before a command and `delta` after it: build output and caches the repository
|
|
82
82
|
ignores are expected; any other changed path stops the run for reconciliation,
|
|
83
83
|
exactly like an unexpected writer change.
|
|
84
84
|
- Run each baseline command once and give its log to every lane that needs it,
|
|
85
|
-
rather than rerunning it per lane.
|
|
85
|
+
rather than rerunning it per lane. When a baseline test fails, or touches time,
|
|
86
|
+
concurrency, network or randomness, rerun that test at least 3 times (10 before it
|
|
87
|
+
serves as an oracle) in shuffled order with a recorded seed, and record each
|
|
88
|
+
outcome: a fail-then-pass is flaky, never evidence for or against a repair.
|
|
89
|
+
|
|
90
|
+
**Approved dependency tasks.** When the approved plan changes a manifest or lockfile,
|
|
91
|
+
the implementer changes only the task's exact manifest and lockfile paths, through
|
|
92
|
+
the package manager's own lockfile-only command with install scripts disabled (for
|
|
93
|
+
example `npm install --package-lock-only --ignore-scripts`, `pnpm install
|
|
94
|
+
--lockfile-only`, `uv lock --upgrade-package`, `cargo update -p <name> --precise`,
|
|
95
|
+
`go get <module>@<version>` then `go mod tidy`). Network is limited to the configured
|
|
96
|
+
package registry or proxy, and the plan records that effect. Afterwards verify the
|
|
97
|
+
lockfile (`npm ci`, `go mod verify`, `uv lock --check`, `cargo metadata --locked`):
|
|
98
|
+
the diff holds only the approved package and its required closure, with no new
|
|
99
|
+
install scripts or registry hosts. Do not adopt a release younger than the project's
|
|
100
|
+
cooldown (or one day) unless it is the security fix itself.
|
|
86
101
|
|
|
87
102
|
**Isolated (`--isolate`, or code the user did not write).** Use this mode when the
|
|
88
103
|
user passes `--isolate`, and ask before running in place when the code under review
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
- [What the index is and is not](#what-the-index-is-and-is-not)
|
|
6
6
|
- [Freeze the control catalog before repairs](#freeze-the-control-catalog-before-repairs)
|
|
7
|
+
- [Audit sections and score domains](#audit-sections-and-score-domains)
|
|
7
8
|
- [Credit and arithmetic](#credit-and-arithmetic)
|
|
8
9
|
- [Lane scores](#lane-scores)
|
|
9
10
|
- [Thresholds and hard gates](#thresholds-and-hard-gates)
|
|
@@ -35,13 +36,17 @@ immutable `rubric-r<N>.json` before any repair; the plan pins its digest.
|
|
|
35
36
|
Each control definition carries: stable `id`; exactly one `domain`; `lanes` it
|
|
36
37
|
belongs to; components, requirement, profile rule and contract IDs; `failure_case`;
|
|
37
38
|
risk `rationale`; `weight` (1 modest, 3 material, 5 high-consequence);
|
|
38
|
-
`hard_gate`; `evaluation` (`executed`, `static`, `source-proof`, `human
|
|
39
|
+
`hard_gate`; `evaluation` (`executed`, `static`, `source-proof`, `human`; a
|
|
40
|
+
`performance` control passes only on `executed`, `source-proof` or `human` evidence,
|
|
41
|
+
because static inspection establishes no metric);
|
|
39
42
|
`evidence_required`; `independent_verification`; and `na` (null, or an approved
|
|
40
43
|
exclusion with reason and evidence). Candidate status, verifier receipts and
|
|
41
44
|
evidence live in separate results files that reference the rubric digest.
|
|
42
45
|
|
|
43
|
-
|
|
44
|
-
approval before remediation
|
|
46
|
+
The calculator accepts control weights 1, 3 or 5 only. Default domain weights
|
|
47
|
+
(tailor only with a stated project-risk reason and user approval before remediation;
|
|
48
|
+
each changed domain needs a `weight_deviations` entry with `domain`, `reason` and the
|
|
49
|
+
`approval` reference, or the calculator rejects the rubric):
|
|
45
50
|
|
|
46
51
|
| Domain key | Meaning | Weight |
|
|
47
52
|
| --- | --- | ---: |
|
|
@@ -66,6 +71,25 @@ an opportunity to add easy passing controls that dilute the denominator.
|
|
|
66
71
|
Mark hard-gate controls for every mandatory safety, security, data-integrity,
|
|
67
72
|
compatibility and critical-user-journey requirement.
|
|
68
73
|
|
|
74
|
+
## Audit sections and score domains
|
|
75
|
+
|
|
76
|
+
Every finding, receipt `domains_checked` entry and applicability cell uses one of the
|
|
77
|
+
eight score keys. The [audit floor](audit-domains.md) sections map to them:
|
|
78
|
+
|
|
79
|
+
| Audit section | Score domain |
|
|
80
|
+
| --- | --- |
|
|
81
|
+
| Correctness and data integrity; Database, queries, migrations and storage (integrity, migrations) | `correctness` |
|
|
82
|
+
| Security, privacy and trust boundaries; Dependencies (advisories, provenance, unresolvable names) | `security` |
|
|
83
|
+
| Concurrency, caching, retries and distributed reliability | `reliability` |
|
|
84
|
+
| Backend performance; Database (query cost); Frontend performance | `performance` |
|
|
85
|
+
| Tests and verification quality | `tests` |
|
|
86
|
+
| Architecture, maintainability and anti-slop; Over-engineering and dead weight; Frontend engineering (structure) | `architecture` |
|
|
87
|
+
| Frontend craft, interaction and accessibility; Public API and developer experience; Cross-layer contracts (compatibility) | `ux` |
|
|
88
|
+
| Operations and project-specific extensions; Documentation; Dependencies (support, end of life, build integrity) | `operations` |
|
|
89
|
+
|
|
90
|
+
A finding that spans two domains takes the domain of its consequence and names the
|
|
91
|
+
other's control in `controls`.
|
|
92
|
+
|
|
69
93
|
## Credit and arithmetic
|
|
70
94
|
|
|
71
95
|
Binary credit only, from current evidence meeting the predeclared acceptance
|
|
@@ -146,7 +170,7 @@ High numbers never compensate for a failed gate.
|
|
|
146
170
|
| `G-REPORT-CONSISTENCY` | Records validate; views carry the current stamp | all |
|
|
147
171
|
| `G-APPROVAL` | Authentic, current approval of the exact plan revision and tasks | repair |
|
|
148
172
|
| `G-TASKS-COMPLETE` | Every approved task met its acceptance evidence | repair |
|
|
149
|
-
| `G-ORACLES` |
|
|
173
|
+
| `G-ORACLES` | Each task's oracle red on baseline and green on candidate as [its kind requires](repair-and-measurement.md#oracles-by-finding-kind), independently verified | repair |
|
|
150
174
|
| `G-NO-REGRESSION` | No new regression, skipped required check, or unapproved behavior change | repair |
|
|
151
175
|
| `G-PERF-TARGETS` | Approved targets and guardrails demonstrated (N/A only when none approved) | repair |
|
|
152
176
|
| `G-PRESERVATION` | Behavior, UI/UX and public-contract preservation evidence | repair |
|
|
@@ -215,8 +239,13 @@ frontend `Q_l = 9.0` → `NOT_READY`.
|
|
|
215
239
|
`devrites-engine overhaul score --rubric <rubric.json> --results <results.json> --gates <gates.json>
|
|
216
240
|
[--out <scorecard.json>]` computes the scorecard; `devrites-engine overhaul score compare --rubric
|
|
217
241
|
<rubric.json> --baseline <a.json> --candidate <b.json>` labels control transitions.
|
|
218
|
-
Inputs: the immutable rubric, a results file (`overhaul.results/1`: `rubric_digest
|
|
219
|
-
|
|
242
|
+
Inputs: the immutable rubric, a results file (`overhaul.results/1`: `rubric_digest`
|
|
243
|
+
(required; the SHA-256 of the rubric file, checked by `score` and by both arms of
|
|
244
|
+
`compare`), `subject`, `fingerprint`, `results{control_id: {status, evidence[],
|
|
245
|
+
verified_by}}`)
|
|
220
246
|
and a gates file (`overhaul.gates/1`: `mode` `audit|remediation`, `gates{id: {status,
|
|
221
247
|
evidence[], reason, approval}}`). Exit 2 means invalid input: nothing may be treated
|
|
222
|
-
as scored.
|
|
248
|
+
as scored. `G-THRESHOLDS` and `G-MANDATORY` are computed; `validate` rejects a
|
|
249
|
+
scorecard whose `G-NO-CRITICAL-HIGH`, `G-NO-OPEN-SERIOUS-LEAD` or `G-COVERAGE` PASS
|
|
250
|
+
contradicts `findings.json` or `coverage.json`, and a control recorded PASS while a
|
|
251
|
+
linked finding is still open ([`records.md`](records.md#enforced-versus-review-only)).
|