Home / Projects / Orchestrata Ultimate / Decisions / ADR index / ADR-0073

ADR-0073: ERR-110-002 amended: the default-on review engine aborts a commit on findings the change introduced (delta baseline)

field value
Status Accepted — Accepted (ruling, Mohamed, 2026-10-07: "accept adr-0073")
Date 2026-10-06
Register factory (docs/adr, 4-digit ids)
Source docs/adr/0073-err-110-002-amended-default-review-engine-aborts-on-introduced-findings-delta-baseline.md — permalink at 16edf7c68 (unchanged on master since that commit)
Wiki register entry ADR-0073 (wiki status: Accepted)

← ADR-0072 · ADR-0074 →

The record

Status: Accepted (ruling, Mohamed, 2026-10-07: "accept adr-0073") · Date: 2026-10-06

Context

SPEC-110 FR-012 puts an InMemoryReviewEngine in front of every CodemodWorkspace.commit() (REQ-110-033/035: review runs on commit) and ERR-110-002 says what an error-severity finding does:

| ERR-110-002 | REQ-110-013 | Review pass produces error-severity finding | ERROR | Abort commit, return CommitReport with findings, write nothing to disk |

The spec names no legacy carve-out, so plan decision D6 (plans/spec-110-completion-plan.md §1) gave the engine baseline='absolute'|'delta' with 'absolute' as the default and wrote: "Flipping the default is a spec amendment and needs its own ADR; none is minted until a packet measures a legacy-file abort in practice."

Packet S3 (commits 24b856ccd, 81c5ea708, 32a56e4d9 on feat/spec-110-completion) built the engine and wired it on by default. The S3 reviewer measured the abort in practice (2026-10-06, probe probe_engine.py: load the default include of src, scripts and tests, pass every file as an identity change through InMemoryReviewEngine(include_phase3=False)):

measurement value
files loaded 3,234
error-severity findings 419 (plus 12,737 warnings)
files with at least one error 134 (38 of them under src/ or scripts/)
errors by rule SF_MOCK_PATTERNS 157, SF_EVAL_EXEC (secret/API-key aliases) 157, SF_FLUSHDB 29, CO_THIRD_PARTY_DECLARED 29, TI_MODULE_FIXTURES 22, SF_ENVIRON_SUBSCRIPT 16, TI_GLOBAL_STATE 9
end-to-end scripts/codemod.py run --pass docstring-sweep --apply on a repo whose one file holds a mock-pattern regex table: exit 1, "Files written: 0", success=False, finding ('SF_MOCK_PATTERNS', 'error'); before S3 the same command wrote the file

Most of the 419 are false positives with named causes, all fixable without a ruling: the token-scanner path hands raw lines including string literals to the reused regexes (the mock-pattern tables in refactor/codemod/review.py, verification/review/checks_safety.py, agents/volks/codedirector/review_checks.py and agents/volks/qa/volk.py flag themselves); CO_THIRD_PARTY_DECLARED reads only [project] dependencies (so google from protobuf and pytest are "undeclared"); _is_test_path treats the production module core/threading/test_scheduler.py as a test file; a narrow --include makes CO_LOCAL_MODULE_EXISTS report same-package imports outside the include as missing. The S3 fix round 1 (commits ace6149cb, 32b00b303, 13f063277) removed those four causes (token-blanked lexical scans, every dependency declaration site plus packages_distributions(), the test-path rule, narrow-include scoping) and re-ran the same probe once on the same tree (3,234 files; load 35.7 s, review 88.1 s, 3,385 MB maxrss):

re-measurement after fix round 1 value
error-severity findings 247 (was 419); warnings 12,777
files with at least one error 100 (was 134): 2 under src/, 17 under scripts/, 81 under tests/
errors by rule SF_EVAL_EXEC 159 (136 hardcoded-secret, 8 API-key, 15 exec()), SF_FLUSHDB 29, TI_MODULE_FIXTURES 22, SF_ENVIRON_SUBSCRIPT 16, CO_THIRD_PARTY_DECLARED 13, TI_GLOBAL_STATE 8; SF_MOCK_PATTERNS 0 (was 157)
reviewer's CLI case now exit 0, 0 findings (was exit 1, nothing written)

Of the 25 src/+scripts/ errors that remain, the true positives by the rules as written are gateway/config.py:59 (_DEV_JWT_SECRET = "dev-secret") and the two deliberate exec() module loaders (scripts/serialize_codebase_ast.py:6957, scripts/_janus_patched/janus/janus.py:411); the rest are two further false-positive causes left for the next round so the measurement stays single: the sk- alternative of the key regex in verification/review's check_security has no word boundary (it matches task-management-… and ask-openrouter in docstrings), and CO_THIRD_PARTY_DECLARED does not yet treat sibling-script stems under scripts/ as local the way check-deps does (about 11 to 13 errors). The 222 tests/ errors are literal test credentials and flushdb/DELETE calls in shared fixtures: true positives by the rules as shipped, and exactly the legacy debt an 'absolute' default turns into a veto on every codemod that touches those files. The structural question therefore stands at either count: with 'absolute' the engine refuses to apply ANY codemod to a file that already carries one error-severity finding, including the codemod that would remove it.

A separate conformance gap the same review found, phase 2 not reading a CIG built from the mutated forest (REQ-110-035), is not part of this decision; it is carried in the plan's S3 row.

Decision (proposed)

Amend ERR-110-002 for the engine commit() runs by default: an error-severity finding aborts the commit when the change INTRODUCED it, measured as the delta between the review of the pre-mutation forest and the review of the mutated forest, matched on (path, rule, message) with line numbers stripped from the message. InMemoryReviewEngine keeps baseline='absolute'|'delta'; the default becomes 'delta'; 'absolute' stays available for clean-slate gates and scripts/codemod.py exposes it as --baseline absolute. Plan D6 is superseded by this record on acceptance. Pre-existing error findings are still reported (as findings on the CommitReport), they no longer veto the write.

Alternatives rejected

Consequences

Provenance

No other ADR is named in this record.

Rulings cited

None.

Specs cited