devrites 5.12.0 → 5.13.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/CHANGELOG.md +6 -0
- package/README.md +5 -3
- package/docs/architecture.md +2 -2
- package/docs/command-map.md +3 -1
- package/docs/engine/commands.md +21 -0
- package/docs/flow.md +2 -1
- package/docs/skills.md +13 -4
- package/engine/help.go +4 -1
- package/engine/help_test.go +2 -0
- package/engine/internal/overhaul/admit/admit_test.go +170 -0
- package/engine/internal/overhaul/admit/run.go +416 -0
- package/engine/internal/overhaul/bench/run.go +248 -0
- package/engine/internal/overhaul/bench/run_test.go +139 -0
- package/engine/internal/overhaul/overhaul.go +64 -0
- package/engine/internal/overhaul/ovio/ovio.go +158 -0
- package/engine/internal/overhaul/records/check.go +834 -0
- package/engine/internal/overhaul/records/records_test.go +577 -0
- package/engine/internal/overhaul/records/run.go +392 -0
- package/engine/internal/overhaul/render/run.go +776 -0
- package/engine/internal/overhaul/render/run_test.go +293 -0
- package/engine/internal/overhaul/score/run.go +600 -0
- package/engine/internal/overhaul/score/run_test.go +405 -0
- package/engine/internal/overhaul/snapshot/run.go +563 -0
- package/engine/internal/overhaul/snapshot/run_test.go +360 -0
- package/engine/main.go +4 -0
- package/engine/root_routing_test.go +2 -1
- package/pack/.claude/skills/overhaul/SKILL.md +201 -0
- package/pack/.claude/skills/overhaul/references/audit-domains.md +263 -0
- package/pack/.claude/skills/overhaul/references/lifecycle.md +308 -0
- package/pack/.claude/skills/overhaul/references/orchestration.md +264 -0
- package/pack/.claude/skills/overhaul/references/records.md +137 -0
- package/pack/.claude/skills/overhaul/references/repair-and-measurement.md +207 -0
- package/pack/.claude/skills/overhaul/references/review-and-report.md +137 -0
- package/pack/.claude/skills/overhaul/references/scope-and-safety.md +191 -0
- package/pack/.claude/skills/overhaul/references/scoring.md +222 -0
- package/pack/.claude/skills/overhaul/references/stack-profiles.md +264 -0
- package/pack/.claude/skills/overhaul/roles/backend-engineer.md +61 -0
- package/pack/.claude/skills/overhaul/roles/boundary.md +56 -0
- package/pack/.claude/skills/overhaul/roles/craft.md +77 -0
- package/pack/.claude/skills/overhaul/roles/frontend-engineer.md +63 -0
- package/pack/.claude/skills/overhaul/roles/implementer.md +59 -0
- package/pack/.claude/skills/overhaul/roles/recon.md +60 -0
- package/pack/.claude/skills/overhaul/roles/specialist.md +56 -0
- package/pack/.claude/skills/overhaul/roles/verifier.md +60 -0
- package/pack/generated/claude/skills/overhaul/SKILL.md +201 -0
- package/pack/generated/claude/skills/overhaul/references/audit-domains.md +263 -0
- package/pack/generated/claude/skills/overhaul/references/lifecycle.md +308 -0
- package/pack/generated/claude/skills/overhaul/references/orchestration.md +264 -0
- package/pack/generated/claude/skills/overhaul/references/records.md +137 -0
- package/pack/generated/claude/skills/overhaul/references/repair-and-measurement.md +207 -0
- package/pack/generated/claude/skills/overhaul/references/review-and-report.md +137 -0
- package/pack/generated/claude/skills/overhaul/references/scope-and-safety.md +191 -0
- package/pack/generated/claude/skills/overhaul/references/scoring.md +222 -0
- package/pack/generated/claude/skills/overhaul/references/stack-profiles.md +264 -0
- package/pack/generated/claude/skills/overhaul/roles/backend-engineer.md +61 -0
- package/pack/generated/claude/skills/overhaul/roles/boundary.md +56 -0
- package/pack/generated/claude/skills/overhaul/roles/craft.md +77 -0
- package/pack/generated/claude/skills/overhaul/roles/frontend-engineer.md +63 -0
- package/pack/generated/claude/skills/overhaul/roles/implementer.md +59 -0
- package/pack/generated/claude/skills/overhaul/roles/recon.md +60 -0
- package/pack/generated/claude/skills/overhaul/roles/specialist.md +56 -0
- package/pack/generated/claude/skills/overhaul/roles/verifier.md +60 -0
- package/pack/generated/codex/skills/overhaul/SKILL.md +201 -0
- package/pack/generated/codex/skills/overhaul/agents/openai.yaml +2 -0
- package/pack/generated/codex/skills/overhaul/references/audit-domains.md +263 -0
- package/pack/generated/codex/skills/overhaul/references/lifecycle.md +308 -0
- package/pack/generated/codex/skills/overhaul/references/orchestration.md +264 -0
- package/pack/generated/codex/skills/overhaul/references/records.md +137 -0
- package/pack/generated/codex/skills/overhaul/references/repair-and-measurement.md +207 -0
- package/pack/generated/codex/skills/overhaul/references/review-and-report.md +137 -0
- package/pack/generated/codex/skills/overhaul/references/scope-and-safety.md +191 -0
- package/pack/generated/codex/skills/overhaul/references/scoring.md +222 -0
- package/pack/generated/codex/skills/overhaul/references/stack-profiles.md +264 -0
- package/pack/generated/codex/skills/overhaul/roles/backend-engineer.md +61 -0
- package/pack/generated/codex/skills/overhaul/roles/boundary.md +56 -0
- package/pack/generated/codex/skills/overhaul/roles/craft.md +77 -0
- package/pack/generated/codex/skills/overhaul/roles/frontend-engineer.md +63 -0
- package/pack/generated/codex/skills/overhaul/roles/implementer.md +59 -0
- package/pack/generated/codex/skills/overhaul/roles/recon.md +60 -0
- package/pack/generated/codex/skills/overhaul/roles/specialist.md +56 -0
- package/pack/generated/codex/skills/overhaul/roles/verifier.md +60 -0
- package/pack/generated/devin/skills/overhaul/SKILL.md +201 -0
- package/pack/generated/devin/skills/overhaul/references/audit-domains.md +263 -0
- package/pack/generated/devin/skills/overhaul/references/lifecycle.md +308 -0
- package/pack/generated/devin/skills/overhaul/references/orchestration.md +264 -0
- package/pack/generated/devin/skills/overhaul/references/records.md +137 -0
- package/pack/generated/devin/skills/overhaul/references/repair-and-measurement.md +207 -0
- package/pack/generated/devin/skills/overhaul/references/review-and-report.md +137 -0
- package/pack/generated/devin/skills/overhaul/references/scope-and-safety.md +191 -0
- package/pack/generated/devin/skills/overhaul/references/scoring.md +222 -0
- package/pack/generated/devin/skills/overhaul/references/stack-profiles.md +264 -0
- package/pack/generated/devin/skills/overhaul/roles/backend-engineer.md +61 -0
- package/pack/generated/devin/skills/overhaul/roles/boundary.md +56 -0
- package/pack/generated/devin/skills/overhaul/roles/craft.md +77 -0
- package/pack/generated/devin/skills/overhaul/roles/frontend-engineer.md +63 -0
- package/pack/generated/devin/skills/overhaul/roles/implementer.md +59 -0
- package/pack/generated/devin/skills/overhaul/roles/recon.md +60 -0
- package/pack/generated/devin/skills/overhaul/roles/specialist.md +56 -0
- package/pack/generated/devin/skills/overhaul/roles/verifier.md +60 -0
- package/pack/generated/omp/skills/overhaul/SKILL.md +201 -0
- package/pack/generated/omp/skills/overhaul/references/audit-domains.md +263 -0
- package/pack/generated/omp/skills/overhaul/references/lifecycle.md +308 -0
- package/pack/generated/omp/skills/overhaul/references/orchestration.md +264 -0
- package/pack/generated/omp/skills/overhaul/references/records.md +137 -0
- package/pack/generated/omp/skills/overhaul/references/repair-and-measurement.md +207 -0
- package/pack/generated/omp/skills/overhaul/references/review-and-report.md +137 -0
- package/pack/generated/omp/skills/overhaul/references/scope-and-safety.md +191 -0
- package/pack/generated/omp/skills/overhaul/references/scoring.md +222 -0
- package/pack/generated/omp/skills/overhaul/references/stack-profiles.md +264 -0
- package/pack/generated/omp/skills/overhaul/roles/backend-engineer.md +61 -0
- package/pack/generated/omp/skills/overhaul/roles/boundary.md +56 -0
- package/pack/generated/omp/skills/overhaul/roles/craft.md +77 -0
- package/pack/generated/omp/skills/overhaul/roles/frontend-engineer.md +63 -0
- package/pack/generated/omp/skills/overhaul/roles/implementer.md +59 -0
- package/pack/generated/omp/skills/overhaul/roles/recon.md +60 -0
- package/pack/generated/omp/skills/overhaul/roles/specialist.md +56 -0
- package/pack/generated/omp/skills/overhaul/roles/verifier.md +60 -0
- package/pack/generated/pi/skills/overhaul/SKILL.md +201 -0
- package/pack/generated/pi/skills/overhaul/references/audit-domains.md +263 -0
- package/pack/generated/pi/skills/overhaul/references/lifecycle.md +308 -0
- package/pack/generated/pi/skills/overhaul/references/orchestration.md +264 -0
- package/pack/generated/pi/skills/overhaul/references/records.md +137 -0
- package/pack/generated/pi/skills/overhaul/references/repair-and-measurement.md +207 -0
- package/pack/generated/pi/skills/overhaul/references/review-and-report.md +137 -0
- package/pack/generated/pi/skills/overhaul/references/scope-and-safety.md +191 -0
- package/pack/generated/pi/skills/overhaul/references/scoring.md +222 -0
- package/pack/generated/pi/skills/overhaul/references/stack-profiles.md +264 -0
- package/pack/generated/pi/skills/overhaul/roles/backend-engineer.md +61 -0
- package/pack/generated/pi/skills/overhaul/roles/boundary.md +56 -0
- package/pack/generated/pi/skills/overhaul/roles/craft.md +77 -0
- package/pack/generated/pi/skills/overhaul/roles/frontend-engineer.md +63 -0
- package/pack/generated/pi/skills/overhaul/roles/implementer.md +59 -0
- package/pack/generated/pi/skills/overhaul/roles/recon.md +60 -0
- package/pack/generated/pi/skills/overhaul/roles/specialist.md +56 -0
- package/pack/generated/pi/skills/overhaul/roles/verifier.md +60 -0
- package/package.json +1 -1
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# Records, generations and freshness
|
|
2
|
+
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
- [Run area](#run-area)
|
|
6
|
+
- [Canonical records](#canonical-records)
|
|
7
|
+
- [Publishing a generation](#publishing-a-generation)
|
|
8
|
+
- [Finding lifecycle](#finding-lifecycle)
|
|
9
|
+
- [Enforced versus review-only](#enforced-versus-review-only)
|
|
10
|
+
- [Validator tool](#validator-tool)
|
|
11
|
+
|
|
12
|
+
## Run area
|
|
13
|
+
|
|
14
|
+
JSON is canonical for every machine decision; Markdown and HTML are projections
|
|
15
|
+
rendered from it. The coordinator is the only writer of canonical records.
|
|
16
|
+
|
|
17
|
+
```text
|
|
18
|
+
<run>/ # default ~/code-overhaul-runs/<repo-id>/<run-id>/, mode 0700
|
|
19
|
+
CURRENT # name of the active generation, replaced last and atomically
|
|
20
|
+
g0007/ # one coherent generation of mutable records + manifest.json + views/
|
|
21
|
+
revisions/ # immutable plan-r<N>.json, rubric-r<N>.json, profile-<id>-r<N>.json, bench-<id>-r<N>.json
|
|
22
|
+
packets/ # dispatch packets, one per attempt
|
|
23
|
+
receipts/ proposals/ # immutable worker outputs, named <run>__<task>__<attempt>__<role>.json
|
|
24
|
+
evidence/ # sanitized logs, samples, traces, screenshots, red/green output
|
|
25
|
+
baseline/ # snapshot from `devrites-engine overhaul snapshot capture` (outside the target tree)
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Placement rules: [`scope-and-safety.md`](scope-and-safety.md#run-area-and-checkpoints).
|
|
29
|
+
|
|
30
|
+
## Canonical records
|
|
31
|
+
|
|
32
|
+
| File (in a generation) | Role and key fields |
|
|
33
|
+
| --- | --- |
|
|
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`) |
|
|
36
|
+
| `stack-profiles.json` | `components[]` (B6 component record), `profiles[]` (`id`, `rev`, `file`, `sha256`, `status`), `dependencies[]` (dependency decisions) |
|
|
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
|
+
| `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[]` |
|
|
40
|
+
| `evidence.json` | `items[]`: `id`, `kind`, `path`, `sha256`, `command`, `exit`, `fingerprint`, `inputs`, `limitations`, `by`; benchmarks add `measurement` |
|
|
41
|
+
| `approval.json` | append-only `events[]` ([fields](lifecycle.md#the-approval-gate)) |
|
|
42
|
+
| `results-baseline.json`, `results-candidate.json`, `gates.json`, `scorecard*.json` | scoring inputs and calculator output ([`scoring.md`](scoring.md)) |
|
|
43
|
+
| `cycles.json` | append-only `cycles[]` ([`lifecycle.md`](lifecycle.md#cycle-records)) |
|
|
44
|
+
| `views/` | `review.*`, `report.*`, `plan.md`, each carrying the generation stamp |
|
|
45
|
+
|
|
46
|
+
`null` means "not applicable by design"; a missing value means "not recorded" —
|
|
47
|
+
never "passed". Worker receipts become canonical only after admission
|
|
48
|
+
([`orchestration.md`](orchestration.md#receipts)). An unreadable or missing record
|
|
49
|
+
blocks the run; it never reads as zero findings.
|
|
50
|
+
|
|
51
|
+
## Publishing a generation
|
|
52
|
+
|
|
53
|
+
1. `devrites-engine overhaul records stage <run>` copies the current generation to
|
|
54
|
+
`g<N+1>.tmp` (views and manifest excluded).
|
|
55
|
+
2. Edit only the staged JSON. Write any new plan, rubric, profile or benchmark
|
|
56
|
+
revision as a new file under `revisions/`; never rewrite an existing one.
|
|
57
|
+
3. Render views into the staged generation with `devrites-engine overhaul render`.
|
|
58
|
+
4. `devrites-engine overhaul records publish <run>` validates the staged generation
|
|
59
|
+
against the previous one, writes `manifest.json` (SHA-256 of every generation file
|
|
60
|
+
and every revision), renames the directory, then replaces `CURRENT` last.
|
|
61
|
+
5. Any reader runs `validate <run>` first. A mismatch between `CURRENT`, the manifest
|
|
62
|
+
and file bytes is a mixed generation: stop applying and republish.
|
|
63
|
+
|
|
64
|
+
A crash leaves an incomplete `g<N+1>.tmp` or a complete `g<N+1>` not yet current:
|
|
65
|
+
`validate` reports both, `stage` refuses until you inspect it, and the previous
|
|
66
|
+
generation stays intact. One atomic rename is not a transaction; readers verify
|
|
67
|
+
digests.
|
|
68
|
+
Give run files restrictive permissions, redact secrets before storing evidence, and
|
|
69
|
+
never store credentials, tokens or private keys.
|
|
70
|
+
|
|
71
|
+
## Finding lifecycle
|
|
72
|
+
|
|
73
|
+
| From | Allowed next statuses |
|
|
74
|
+
| --- | --- |
|
|
75
|
+
| `candidate` | `needs-validation`, `confirmed`, `rejected` |
|
|
76
|
+
| `needs-validation` | `confirmed`, `rejected` |
|
|
77
|
+
| `confirmed` | `approved-for-fix`, `deferred`, `accepted-risk`, `rejected` (only after disproof) |
|
|
78
|
+
| `approved-for-fix` | `in-progress`, `deferred` |
|
|
79
|
+
| `in-progress` | `fixed-unverified`, `approved-for-fix` (attempt failed) |
|
|
80
|
+
| `fixed-unverified` | `verified`, `in-progress` (verification failed) |
|
|
81
|
+
| `verified` | `confirmed` (regressed or evidence invalidated) |
|
|
82
|
+
| `deferred`, `accepted-risk` | `approved-for-fix`, `confirmed` |
|
|
83
|
+
| `rejected` | `candidate` (new evidence) |
|
|
84
|
+
|
|
85
|
+
Each finding carries a `fingerprint`: its root-cause identity (component, symbol,
|
|
86
|
+
contract and failure class — never line numbers, agent, wave, severity or verdict),
|
|
87
|
+
unique across the record so one root cause keeps one record across cycles.
|
|
88
|
+
`needs-validation` names its missing fact in `blockers` and carries no severity.
|
|
89
|
+
Locations are repository-relative (`external: true` marks a label such as
|
|
90
|
+
`mobile-app:src/api.ts` for code outside the repository); a host path is rejected. A rejection
|
|
91
|
+
suppresses re-raising only while the cited files keep the hashes it was judged on.
|
|
92
|
+
|
|
93
|
+
Severity exists only once impact is established (`confirmed` onward). `rejected`
|
|
94
|
+
with reason `false_positive` requires disproving evidence. A user-declined confirmed
|
|
95
|
+
defect keeps `confirmed` impact and moves to `deferred` or `accepted-risk`; its
|
|
96
|
+
control still fails. `not reproducible yet`, `environment unavailable`,
|
|
97
|
+
`requirement disputed` and `proven unreachable under the approved scope` are distinct
|
|
98
|
+
recorded reasons, and none means safe. History is append-only: a finding never
|
|
99
|
+
disappears between generations.
|
|
100
|
+
|
|
101
|
+
## Enforced versus review-only
|
|
102
|
+
|
|
103
|
+
`validate`/`publish` enforce: schema tags, enums and unique IDs and fingerprints;
|
|
104
|
+
evidence inside the run area with a matching `sha256`; finding history that starts at
|
|
105
|
+
`candidate`, legal transitions (a same-status entry needs a `reason`), severity only
|
|
106
|
+
from `confirmed` onward, a history entry for any severity or kind change, blockers
|
|
107
|
+
for needs-validation, evidence for decided findings, `verified_by` naming an admitted
|
|
108
|
+
verifier attempt, repository-relative locations (external ones are labels, never
|
|
109
|
+
host paths); `revisions.plan.file` equal to `revisions/plan-r<rev>.json`, required
|
|
110
|
+
once approvals or writers exist; plan digest pins; known, acyclic dependencies;
|
|
111
|
+
allowed paths that are exact files inside the repository (no `*` or `?`, no
|
|
112
|
+
directories, no `.git`, no symlink or traversal escape); a separate verifier role;
|
|
113
|
+
approval and `accept-degradation` events with quote and trusted channel, approvals
|
|
114
|
+
matching the plan digest, closure and current revision, none active after a later
|
|
115
|
+
stop; a scorecard only with `revisions.rubric` and the same verdict as `run.json`;
|
|
116
|
+
no approval or writer in an assessment-only run; unchanged `run_id`, `repo_root`,
|
|
117
|
+
`mode` and `assessment_only`; writers authorized for their task; one live writer
|
|
118
|
+
per path (case-folded, symlink-resolved); no `dispatched`, `running` or `returned`
|
|
119
|
+
attempt once the outcome leaves `RUNNING`; one outcome per approved task at the end;
|
|
120
|
+
a coverage denominator that never shrinks; append-only cycles, findings history and
|
|
121
|
+
approval events; immutable revisions; view stamps; manifest integrity; stale stages
|
|
122
|
+
and interrupted publishes.
|
|
123
|
+
|
|
124
|
+
Receipt admission and quote anchoring live in `devrites-engine overhaul admit`
|
|
125
|
+
([`orchestration.md`](orchestration.md#admission-tool)).
|
|
126
|
+
|
|
127
|
+
Review-only (the coordinator and verifiers must judge): whether evidence is
|
|
128
|
+
sufficient, whether a finding is real, whether coverage receipts reflect genuine
|
|
129
|
+
semantic review, catalog adequacy, benchmark comparability, and whether a quote in
|
|
130
|
+
`approval.json` really came from the user. JSON Schema tooling may add structural
|
|
131
|
+
checks when installed; its absence is a recorded limitation, not a pass.
|
|
132
|
+
|
|
133
|
+
## Validator tool
|
|
134
|
+
|
|
135
|
+
`devrites-engine overhaul records digest <file>` prints the SHA-256 of exact bytes; `stage <run>`,
|
|
136
|
+
`publish <run>` and `validate <run>` implement the generation protocol above. Exit
|
|
137
|
+
codes: 0 ok, 1 violations (each printed as `VIOLATION: …`), 2 usage or I/O error.
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# Repair and measurement
|
|
2
|
+
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
- [One approved repair slice](#one-approved-repair-slice)
|
|
6
|
+
- [Oracles by lane](#oracles-by-lane)
|
|
7
|
+
- [Never do this to get green](#never-do-this-to-get-green)
|
|
8
|
+
- [False-green defenses](#false-green-defenses)
|
|
9
|
+
- [The assembled candidate](#the-assembled-candidate)
|
|
10
|
+
- [Performance measurement](#performance-measurement)
|
|
11
|
+
- [Measurement windows](#measurement-windows)
|
|
12
|
+
- [Benchmark tool](#benchmark-tool)
|
|
13
|
+
|
|
14
|
+
## One approved repair slice
|
|
15
|
+
|
|
16
|
+
Only an `implementer` context writes, only inside one approved task's exact paths,
|
|
17
|
+
and only after the coordinator recorded the approval.
|
|
18
|
+
|
|
19
|
+
1. Recheck the task's input file hashes, ownership, requirement, baseline failures
|
|
20
|
+
and approval; re-read the code to edit.
|
|
21
|
+
2. Write the smallest meaningful failing regression test or other falsifiable oracle
|
|
22
|
+
for the confirmed defect and run it against the unfixed code. Classify the first
|
|
23
|
+
run: **good red** (fails at the named assertion for the expected reason — quote the
|
|
24
|
+
failing line), **broken test** (setup, import or compile error — not a valid red
|
|
25
|
+
for a logic defect), **false pass** (passes on the unfixed code — the oracle does
|
|
26
|
+
not reach the defect), or **not run** (not discovered, filtered or skipped). Only a
|
|
27
|
+
good red continues.
|
|
28
|
+
3. Implement the smallest coherent fix. Keep supported contracts and UX unchanged
|
|
29
|
+
except for the exact approved change. No formatting sweep, no speculative
|
|
30
|
+
abstraction.
|
|
31
|
+
4. Run the same oracle to green, then the relevant unit, integration, contract,
|
|
32
|
+
end-to-end, static and security checks plus the impact cascade on dependents.
|
|
33
|
+
Capture commands, exit codes and output as evidence.
|
|
34
|
+
5. Refactor only while the meaningful tests stay green. Update affected docs,
|
|
35
|
+
schemas, contracts, migrations and lockfiles inside the approved scope through the
|
|
36
|
+
project's canonical generators, never by hand-editing generated output.
|
|
37
|
+
6. A fresh `verifier` context verifies the fix and its neighboring failure modes and
|
|
38
|
+
runs the new test against the old implementation in a disposable baseline copy
|
|
39
|
+
(apply the recorded baseline patches) to prove it still catches the original
|
|
40
|
+
defect.
|
|
41
|
+
7. Remeasure approved performance targets; compare guardrails and side effects. If
|
|
42
|
+
the slice fails, revert only the agent-owned hunks (preserving user work), record
|
|
43
|
+
the failed attempt, and revise or re-approve material plan changes.
|
|
44
|
+
|
|
45
|
+
Workers never run git write commands (stage, commit, stash, checkout, reset) and
|
|
46
|
+
never leave unaccounted changes; the coordinator compares observed changed paths with
|
|
47
|
+
the contract before admitting a patch.
|
|
48
|
+
|
|
49
|
+
A pure refactor starts with characterization or contract tests and strengthens weak
|
|
50
|
+
oracles; never damage correct code just to see red. Performance work starts with a
|
|
51
|
+
reproducible benchmark or query-budget oracle; ordinary unit tests do not assert
|
|
52
|
+
flaky wall-clock times — use controlled benchmarks plus deterministic query counts or
|
|
53
|
+
complexity bounds. When a bug cannot be reproduced safely, record the exact missing
|
|
54
|
+
fact, propose a safe alternative and obtain a documented exception where needed; a
|
|
55
|
+
waived verification stays a visible gap and may block readiness.
|
|
56
|
+
|
|
57
|
+
## Oracles by lane
|
|
58
|
+
|
|
59
|
+
- **Frontend:** reproduce the behavior — stale or out-of-order responses,
|
|
60
|
+
cancellation, state transitions, optimistic failure and rollback, focus loss, the
|
|
61
|
+
broken keyboard path — not "the component renders". A DOM-only unit test does not
|
|
62
|
+
prove real browser or native-engine behavior.
|
|
63
|
+
- **Backend:** the native service, data or concurrency oracle: deterministic
|
|
64
|
+
interleavings, transaction outcomes, idempotent replays, query counts.
|
|
65
|
+
- **Boundary:** producer and consumer evidence plus the integrated journey; a mock
|
|
66
|
+
client never proves server compatibility, and separately green sides with
|
|
67
|
+
incompatible mocks prove nothing about the real contract.
|
|
68
|
+
- **UI or contract-changing repairs:** compare against baseline journeys, the
|
|
69
|
+
relevant UI states and every compatible consumer; backend unit tests alone never
|
|
70
|
+
approve them.
|
|
71
|
+
|
|
72
|
+
## Never do this to get green
|
|
73
|
+
|
|
74
|
+
Delete or skip failing tests; weaken assertions; update snapshots blindly; suppress
|
|
75
|
+
diagnostics; reduce workloads; loosen quality gates, retries, timeouts, tolerances or
|
|
76
|
+
statistical thresholds; mock away the failure; change expected outcomes to match the
|
|
77
|
+
patch. Quarantine an unrelated flaky test only with baseline evidence and explicit
|
|
78
|
+
user authorization. A justified correction to a test or harness needs independent
|
|
79
|
+
evidence that the old oracle was wrong, a versioned explanation, baseline and
|
|
80
|
+
candidate re-evaluation, and approval when the acceptance meaning changes.
|
|
81
|
+
|
|
82
|
+
## False-green defenses
|
|
83
|
+
|
|
84
|
+
Record test discovery and selection as well as the exit status. None of these can
|
|
85
|
+
satisfy a required oracle:
|
|
86
|
+
|
|
87
|
+
- zero tests discovered or executed; an unintended filter, shard or "only changed"
|
|
88
|
+
mode that silences "no tests found";
|
|
89
|
+
- skipped, pending or expected-failure cases counted as passes; a runner summary that
|
|
90
|
+
counts flaky or skipped tests as success;
|
|
91
|
+
- cached output from different inputs, or reused output where fresh execution is
|
|
92
|
+
required;
|
|
93
|
+
- a subprocess failure swallowed by a wrapper, or a pipeline that masks the exit
|
|
94
|
+
status (`cmd | tail` without `pipefail`);
|
|
95
|
+
- a snapshot run that only created missing baselines; a replay command that exits 0
|
|
96
|
+
with nothing to replay;
|
|
97
|
+
- an unsupported platform or a test that matches implementation details without
|
|
98
|
+
exercising the contract.
|
|
99
|
+
|
|
100
|
+
Confirm that a seeded failing example actually reaches the assertion, and keep both
|
|
101
|
+
the observed failure and the candidate's observed pass. For flaky checks, record
|
|
102
|
+
every attempt, its environment and reset conditions, and the first-run outcome: a
|
|
103
|
+
pass only after retry is a flaky observation, not proof that the defect is gone.
|
|
104
|
+
|
|
105
|
+
## The assembled candidate
|
|
106
|
+
|
|
107
|
+
Test the integrated candidate, never only each worker's isolated result. Before
|
|
108
|
+
combining patches, check they apply cleanly together (for example `git apply --check`
|
|
109
|
+
or `git merge-tree` on copies). When individually green patches fail together, bisect
|
|
110
|
+
the combination to find the interacting pair; fix the interaction under existing task
|
|
111
|
+
authority when covered, otherwise propose a plan amendment. Keep the last
|
|
112
|
+
independently verified candidate reference and a per-slice patch and evidence history
|
|
113
|
+
in the run area — never as commits in the user's repository. Roll back only
|
|
114
|
+
attributable changes whose ownership is verified; never jump back to an earlier high
|
|
115
|
+
score or erase a failed experiment. An edit after final verification invalidates the
|
|
116
|
+
affected final evidence.
|
|
117
|
+
|
|
118
|
+
## Performance measurement
|
|
119
|
+
|
|
120
|
+
The goal is substantial wins on genuine bottlenecks — preferably at least 2×, ideally
|
|
121
|
+
3× or more — never a promise for every path. First establish the baseline and the
|
|
122
|
+
bottleneck's share of the user-visible outcome. If profiling does not support the
|
|
123
|
+
requested gain, or it would break correctness or UX, or exceed the approved risk, show
|
|
124
|
+
the evidence and ask the user to approve an alternative target, a broader intervention
|
|
125
|
+
or no change; never lower the target quietly. A correctness or security fix needs no
|
|
126
|
+
speedup to be valuable, and a trivial absolute gain is never sold as transformational
|
|
127
|
+
through a flattering percentage.
|
|
128
|
+
|
|
129
|
+
A versioned benchmark contract (`revisions/bench-<id>-r<N>.json`) fixes, before any
|
|
130
|
+
comparison: baseline and candidate fingerprints; one harness revision for both; build
|
|
131
|
+
mode, flags and compiler/runtime/database versions; hardware, OS, resources,
|
|
132
|
+
background load, network, browser and device; datasets with cardinality, skew, seeds
|
|
133
|
+
and correctness checksums; scenario, concurrency and arrival model (open or closed),
|
|
134
|
+
warm/cold cache policy and reset procedure; primary metric and direction, percentiles
|
|
135
|
+
or throughput criterion, absolute user or SLO targets, the 2× minimum and 3× stretch
|
|
136
|
+
where justified, materiality threshold and regression tolerances; warmup, repetitions
|
|
137
|
+
and the statistical method; raw-sample location; error and timeout treatment; stop
|
|
138
|
+
conditions.
|
|
139
|
+
|
|
140
|
+
Run arms interleaved (ABAB or randomized blocks) on the same host, never all
|
|
141
|
+
baseline runs under one system state and all candidate runs under another. Warm JIT
|
|
142
|
+
runtimes fairly and measure cold start separately when it matters. Use production
|
|
143
|
+
builds for production-facing claims. Profile during benchmarking to confirm what is
|
|
144
|
+
measured. Include realistic service, database and network work; never drop failures
|
|
145
|
+
or slow requests to improve an average. Choose the load model on purpose, account for
|
|
146
|
+
coordinated omission and dropped work, and report offered versus completed load; a
|
|
147
|
+
result at lower load or a higher error rate is not an equivalent speedup.
|
|
148
|
+
|
|
149
|
+
```text
|
|
150
|
+
lower is better: speedup = baseline / candidate reduction% = 100 × (baseline − candidate) / baseline
|
|
151
|
+
higher is better: gain = candidate / baseline increase% = 100 × (candidate − baseline) / baseline
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
A 2× latency speedup is a 50% reduction, not 200%. Report absolute values and
|
|
155
|
+
uncertainty with every ratio. Zero or near-zero baselines, or values at the timer's
|
|
156
|
+
resolution, get no ratio. Never average unlike ratios into an "overall speedup"; a
|
|
157
|
+
workload-weighted aggregate needs predeclared weights. The resampling unit is one
|
|
158
|
+
independent invocation — never inner iterations. Use at least 10 invocations per
|
|
159
|
+
arm and more when the interval is wide. The benchmark tool below reports the ratio of
|
|
160
|
+
medians with a seeded 95% bootstrap interval: claim "at least k×" only when the
|
|
161
|
+
interval's lower bound is at least k; an interval spanning 1 or k is inconclusive
|
|
162
|
+
and is never rounded up. Confirm a selected win on fresh runs; do not try variants
|
|
163
|
+
until one lucky sample passes. An unmeasured change earns no credit, and an
|
|
164
|
+
optimization with no measurable benefit is reverted (agent-owned hunks only) and
|
|
165
|
+
logged so it is not retried.
|
|
166
|
+
|
|
167
|
+
For databases keep query counts, plans where safe, rows scanned and returned, buffer
|
|
168
|
+
and IO behavior, and write, storage and lock costs. For UI keep critical journeys,
|
|
169
|
+
render and interaction traces and metrics under matched fixtures and devices, and
|
|
170
|
+
label every number:
|
|
171
|
+
|
|
172
|
+
| Signal | Measures | Does not establish |
|
|
173
|
+
| --- | --- | --- |
|
|
174
|
+
| Field p75 (CrUX or first-party RUM) | Real users over a window, by route and device | Effect of an undeployed change; routes without data (unavailable ≠ pass) |
|
|
175
|
+
| Lab trace | One session under stated conditions; LCP parts, INP phases, long tasks | How common the problem is in the field |
|
|
176
|
+
| Lighthouse score | One synthetic navigation, version-weighted | User experience, INP, cross-version comparison |
|
|
177
|
+
| TBT | Lab main-thread blocking during load | Field INP or post-load responsiveness |
|
|
178
|
+
| CLS | Unexpected layout-shift clusters | Latency; the shift initiator |
|
|
179
|
+
| Bundle size | Bytes per route | Runtime cost unless runtime metrics move |
|
|
180
|
+
| Automated a11y scan | A subset of criteria (`incomplete` is not a pass) | Conformance, keyboard or screen-reader usability |
|
|
181
|
+
| Static inspection | A hypothesis | Any metric value |
|
|
182
|
+
|
|
183
|
+
Never deploy to obtain measurements. Keep frontend, backend and boundary benchmark
|
|
184
|
+
views tied to one workload graph: a 3× faster query is not a 3× faster page until the
|
|
185
|
+
page is measured; a faster server never excuses a slower client or a broken keyboard
|
|
186
|
+
journey; CLS never gets a latency ratio. Track guardrails for correctness, security,
|
|
187
|
+
stale-data behavior, memory, CPU, write latency, tail latency, errors, accessibility
|
|
188
|
+
and visual or interaction stability; surface any trade-off and get approval. Explain
|
|
189
|
+
a smaller end-to-end gain with the bottleneck analysis.
|
|
190
|
+
|
|
191
|
+
## Measurement windows
|
|
192
|
+
|
|
193
|
+
Review agents may run concurrently; measurements may not share CPU, browser,
|
|
194
|
+
database, network or caches with other tests or agents. Record the isolation evidence
|
|
195
|
+
(what else was running, load average, governor). When isolation is unavailable,
|
|
196
|
+
disclose the contamination, mark the comparison inconclusive and rerun in a
|
|
197
|
+
controlled window; a contaminated ratio never passes a gate.
|
|
198
|
+
|
|
199
|
+
## Benchmark tool
|
|
200
|
+
|
|
201
|
+
`devrites-engine overhaul bench <result.json>` prints the comparison. Input: `direction` (exactly
|
|
202
|
+
`lower_is_better` or `higher_is_better`; anything else is rejected, never guessed),
|
|
203
|
+
raw per-invocation `baseline` and `candidate` samples, the recorded run `order`, the
|
|
204
|
+
`target` ratio, `materiality`, optional `resolution`, `resamples` and `seed`.
|
|
205
|
+
Verdicts: `SUPPORTS_TARGET`, `IMPROVEMENT_BELOW_TARGET`, `IMPROVEMENT`,
|
|
206
|
+
`INCONCLUSIVE`, `REGRESSION`, `NO_RATIO`. Fewer than 10 samples per arm or arms not
|
|
207
|
+
recorded as interleaved cap any improvement at `INCONCLUSIVE`.
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# Review page, report and terminal summary
|
|
2
|
+
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
- [Views are projections](#views-are-projections)
|
|
6
|
+
- [The review page](#the-review-page)
|
|
7
|
+
- [Decisions and the approval message](#decisions-and-the-approval-message)
|
|
8
|
+
- [The end-of-run report](#the-end-of-run-report)
|
|
9
|
+
- [Terminal summary](#terminal-summary)
|
|
10
|
+
- [Renderer tool](#renderer-tool)
|
|
11
|
+
|
|
12
|
+
## Views are projections
|
|
13
|
+
|
|
14
|
+
`review.html`/`.md`, `report.html`/`.md` and `plan.md` (the task table and approval
|
|
15
|
+
message, written with a review) are rendered by the renderer tool
|
|
16
|
+
below from one generation's canonical JSON; never hand-write or hand-edit them. Each
|
|
17
|
+
carries the stamp `overhaul-stamp run=… generation=… plan=r<N>:<sha256>`, and the
|
|
18
|
+
validator rejects a view whose stamp does not match its generation, so a stale page
|
|
19
|
+
can never be applied. Human feedback on a view becomes a proposed change that the
|
|
20
|
+
coordinator reconciles into a new plan revision; views are then re-rendered — there
|
|
21
|
+
are never three competing versions of the plan.
|
|
22
|
+
|
|
23
|
+
## The review page
|
|
24
|
+
|
|
25
|
+
The page opens as a local file and works offline: one self-contained document, no
|
|
26
|
+
scripts, no CDNs, no remote fonts or analytics, a hash-pinned stylesheet under a
|
|
27
|
+
restrictive Content-Security-Policy, system font stacks, explicit light and dark
|
|
28
|
+
backgrounds, visible `:focus-visible` outlines, semantic tables with captions and
|
|
29
|
+
column headers inside keyboard-focusable scroll regions, no horizontal page scroll at
|
|
30
|
+
phone width, text as well as color for every status, and a print-friendly layout.
|
|
31
|
+
Every repository-derived string — filenames, snippets, finding titles, comments, JSON
|
|
32
|
+
— is HTML-escaped before formatting and never interpolated as markup or script;
|
|
33
|
+
absolute home paths are redacted to `~`. Never publish the page or serve it beyond
|
|
34
|
+
loopback without a separate user decision.
|
|
35
|
+
|
|
36
|
+
Order: summary and decision first, then evidence. Sections, each with a stable
|
|
37
|
+
anchor, and rows anchored by their IDs (`#F-012`, `#T-003`, `#C-040`) so feedback can
|
|
38
|
+
cite them:
|
|
39
|
+
|
|
40
|
+
- scope, baseline, candidate and comparison identities, capabilities, known limits,
|
|
41
|
+
open questions;
|
|
42
|
+
- one section per lane — frontend, backend, boundary, other — with actual attempts,
|
|
43
|
+
profiles, timings and receipts (no duplicate independent plans);
|
|
44
|
+
- the coverage ledger and stack profiles; contracts and boundaries;
|
|
45
|
+
- confirmed findings (location, failing case, impact, evidence, uncertainty, proposed
|
|
46
|
+
action), then unvalidated leads without severity, then rejected candidates with
|
|
47
|
+
reasons; opportunities stay separate from defects;
|
|
48
|
+
- before-state measurements with benchmark conditions, proposed minimum and stretch
|
|
49
|
+
targets and regression guardrails;
|
|
50
|
+
- the repair plan: tasks with dependencies, exact allowed paths, oracles, migration
|
|
51
|
+
and rollback needs, expected benefits, costs and alternatives, and the continuation
|
|
52
|
+
envelope ([`lifecycle.md`](lifecycle.md#what-one-approval-permits));
|
|
53
|
+
- the rubric controls with lane membership and shared-control marking, the baseline
|
|
54
|
+
global, lane and domain scorecards, hard blockers and why readiness does or does
|
|
55
|
+
not qualify; frontend engineering evidence, interaction/accessibility proof and
|
|
56
|
+
optional aesthetic proposals visibly separate;
|
|
57
|
+
- approvals and decisions as recorded events, never as page state.
|
|
58
|
+
|
|
59
|
+
The renderer derives the report tables below from the records: lane coverage
|
|
60
|
+
(admitted reviewers with their windows, profiles, reviewed versus eligible ranges,
|
|
61
|
+
open ranges, lane score), findings and repairs (finding and task, severity, previous
|
|
62
|
+
failure, changed paths, oracle, verification, remaining risk), and the transparent
|
|
63
|
+
scorecard (baseline versus candidate per scope, applicable control weight, evidence
|
|
64
|
+
gaps, hard blockers). Columns it cannot fill from records render as "not recorded".
|
|
65
|
+
|
|
66
|
+
When a diagram clarifies architecture, trust boundaries, data flow or the task DAG,
|
|
67
|
+
add a textual equivalent (a dependency table or indented list); an image never
|
|
68
|
+
carries information the text lacks.
|
|
69
|
+
|
|
70
|
+
## Decisions and the approval message
|
|
71
|
+
|
|
72
|
+
The user decides per item — approve, reject, defer, ask for explanation or change —
|
|
73
|
+
and approves one complete plan revision. The page never contains an "Approve" button:
|
|
74
|
+
nothing a page can do (a checkbox, localStorage, a form, an edited file, a local
|
|
75
|
+
server request) authenticates the user, and a script or any local process can forge
|
|
76
|
+
such signals. Instead the page shows a read-only, copyable message:
|
|
77
|
+
|
|
78
|
+
```text
|
|
79
|
+
Approve overhaul <run-id> plan revision <N>, digest <sha256>, tasks T-001 T-002 T-005.
|
|
80
|
+
Keep all listed constraints and exclusions.
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
The approval exists only when the user sends such a decision in the active trusted
|
|
84
|
+
conversation (or a genuinely authenticated host action), and the coordinator
|
|
85
|
+
re-hashes the plan revision and matches the digest before recording it
|
|
86
|
+
([`lifecycle.md`](lifecycle.md#the-approval-gate)).
|
|
87
|
+
|
|
88
|
+
## The end-of-run report
|
|
89
|
+
|
|
90
|
+
Produce `report.{md,html}` from the same generation for every ending —
|
|
91
|
+
interim, blocked, stopped, audit-only or final. Use real measurements only; a missing
|
|
92
|
+
value renders as "not recorded", never as a sample number. Zero findings is a valid
|
|
93
|
+
result; report counts always equal record counts.
|
|
94
|
+
|
|
95
|
+
State separately: mode, lifecycle phase, readiness verdict and execution outcome
|
|
96
|
+
(`AUDIT_COMPLETE`, `AUDIT_INCOMPLETE`, `AWAITING_APPROVAL`, `READY_FOR_USER_REVIEW`,
|
|
97
|
+
`COMPLETED_WITH_APPROVED_DEGRADATION`, `STOPPED_BY_USER`, or the exact blocked state).
|
|
98
|
+
`AUDIT_COMPLETE` never means the target passed. Include revisions, coverage and
|
|
99
|
+
exclusions, applicable stacks, authentic approvals and actual changes, the three
|
|
100
|
+
identities, environment limitations and remaining unknowns. Never write "every bug is
|
|
101
|
+
fixed", "cannot break" or "fully secure".
|
|
102
|
+
|
|
103
|
+
Required tables (column order fixed):
|
|
104
|
+
|
|
105
|
+
| Table | Columns |
|
|
106
|
+
| --- | --- |
|
|
107
|
+
| Lane, stack and boundary coverage | Lane/component · actual reviewer and overlap evidence · language/runtime/framework versions · active profile/rule revisions · reviewed vs eligible ranges · mandatory proof gaps · verdict/evidence |
|
|
108
|
+
| Findings and repairs | Finding/task · severity and evidence confidence · previous failure · change made · regression proof · independent result · remaining risk |
|
|
109
|
+
| Performance before/after (grouped frontend, backend, end-to-end) | Scenario and workload · metric/direction · before · after · absolute delta · relative change/speedup · uncertainty/repetitions · approved target · guardrails · verdict/evidence |
|
|
110
|
+
| Transparent scorecard | Global or lane/domain · weight · unique applicable control weight · baseline · candidate · evidence/profile gaps · hard blockers · evidence |
|
|
111
|
+
| Iteration history | Cycle · starting deficient lanes/controls · hypothesis or proof gap · approved tasks/agents · code changes vs evidence-only work · tests/benchmarks/independent outcome · global and affected lane/domain scores · gate changes/remaining gaps · next action or stop reason |
|
|
112
|
+
| Dependency decisions | Dependency · resolved before · resolved after/unchanged · keep/patch/upgrade/replace/remove · official evidence date · reason and alternatives · migration/compatibility proof · risk |
|
|
113
|
+
|
|
114
|
+
Show lanes separately — never one "full-stack checked" row — plus justified absent or
|
|
115
|
+
not-impacted lanes, inaccessible external components, embedded-language and
|
|
116
|
+
generated-source boundaries, actual scanner coverage and manual review gaps. Keep
|
|
117
|
+
candidate, rejected, deferred and accepted-risk counts apart from confirmed, fixed and
|
|
118
|
+
verified. Show full-precision global and lane results, domain floors, rubric and
|
|
119
|
+
profile revisions, shared-control accounting, N/A decisions, accepted risks and a
|
|
120
|
+
separate hard-gate verdict, and explain score deltas by control transitions (fix,
|
|
121
|
+
evidence-only, regression, invalidated evidence, rubric correction). Include original
|
|
122
|
+
versus revised performance targets with the user's recorded decision, checks run and
|
|
123
|
+
not run, failures proven pre-existing versus introduced, questions and decisions,
|
|
124
|
+
resource and cost totals (estimates labeled), rollback and deploy-order notes (without
|
|
125
|
+
deploying), the final changed-path summary, and remaining work.
|
|
126
|
+
|
|
127
|
+
## Terminal summary
|
|
128
|
+
|
|
129
|
+
First line: outcome, verdict and the one next action. Then the full-precision global
|
|
130
|
+
and lane scores, open gates, counts, the report path and the approval message when
|
|
131
|
+
awaiting approval. Last line: the next action again. No praise, no preamble, no
|
|
132
|
+
estimates presented as measurements.
|
|
133
|
+
|
|
134
|
+
## Renderer tool
|
|
135
|
+
|
|
136
|
+
`devrites-engine overhaul render <run> <staged-generation> review|report` writes the views into
|
|
137
|
+
`<staged-generation>/views/`, before `publish`.
|