feat(detection-core): derive exact evaluation feasibility

This commit is contained in:
Marius Ciepluch
2026-11-10 07:56:20 +01:00
parent c810a559ec
commit 8cdd2de692
5 changed files with 671 additions and 5 deletions
+14
View File
@@ -2972,6 +2972,20 @@ The feasibility rows equal the canonical product of every arm and its exact clai
Every row rederives minimum sizes, threshold reachability, and interval precision from the
reviewed label-blind census. `may_spend` is true only when every row is feasible.
Feasibility uses the shipped V2 jointly-optimal reachability arithmetic independently for
each exact `ArmScopeKey`; it does not predict a post-spend quality result. Denominator
capacities map to the row's pair, vulnerable-side, fixed-side, semantic-site, and model-call
capacities, while ordinary capacity comes only from the ordinary census row for that exact
scope's ecosystem. The reachable witness is `(capacity, capacity)` for at-least metrics and
`(0, capacity)` for fixed or ordinary false-alarm metrics. Precision uses
`(vulnerable_side_count, vulnerable_side_count)` when vulnerable capacity is nonzero,
otherwise `(0, 1)` when fixed-side or same-ecosystem ordinary capacity is nonzero, and
otherwise `(0, 0)`. Each threshold is evaluated from that witness through the fixed metric
algebra and its registered statistic/comparator. Each interval-precision rule uses the same
witness, requires its registered minimum denominator, and compares the derived Wilson 95%
width with the registered maximum. A zero-denominator witness is unattainable and therefore
insufficient. These are pre-spend feasibility facts only: they never produce GO or NO-GO.
#### Observation authority and atomic spend
```python
+2 -2
View File
@@ -1,7 +1,7 @@
{
"feature_name": "detection-core",
"created_at": "2026-10-30T13:55:30Z",
"updated_at": "2026-11-06T12:21:47Z",
"updated_at": "2026-11-10T06:56:01Z",
"language": "en",
"phase": "tasks-generated",
"approvals": {
@@ -19,5 +19,5 @@
}
},
"ready_for_implementation": true,
"approval_note": "2026-11-06: Requirements and the merged V3 design were auto-approved by the maintainer's explicit -y request. Additive V3 task groups 12-18 passed the task-plan review and an independent graph sanity review; existing groups 1-11 remain historical V2 context, and blocked task 11.4 is not a V3 prerequisite. Tasks are approved for implementation."
"approval_note": "2026-11-10: The maintainer approved the regenerated merge-mode task plan after the feasibility witness amendment. Requirements, design, and tasks remain approved; Task 13.4 and plan/preflight group 13 have now passed independent implementation review and fresh verification."
}
+5 -3
View File
@@ -486,7 +486,7 @@ contract work and use synthetic/in-memory workflow boundaries only.
- _Boundary: Evaluation Version Compatibility_
- _Depends: 12.1, 12.3_
- [ ] 13. Register reviewed multi-arm plans and exact preflight
- [x] 13. Register reviewed multi-arm plans and exact preflight
- [x] 13.1 Define component, combined-arm, and declarative combination configurations
- Represent component and combined arm configurations with exact scopes, policies, thresholds, sufficiency rules, outcome mapping, and a closed declarative combination rule.
- Require component identities and a finite normalized decision table for every combined arm, with identical-component-candidate-only proof retention.
@@ -510,9 +510,10 @@ contract work and use synthetic/in-memory workflow boundaries only.
- Done when one reviewed multi-arm manifest validates with labels sealed and every review, census, scope, ordinary-ecosystem, or slot substitution is refused before feasibility.
- _Requirements: 17.1, 17.2, 17.3, 18.1, 18.3_
- _Boundary: Evaluation Plan Review_
- [ ] 13.4 Derive feasibility independently for every planned arm and exact scope
- [x] 13.4 Derive feasibility independently for every planned arm and exact scope
- Produce exactly one feasibility row for the canonical product of planned arms and their claimed scopes.
- Recompute minimum sample size, threshold reachability, and Wilson interval precision from the reviewed label-blind census for each row.
- Derive each metric's witness from the exact-scope pair, vulnerable-side, fixed-side, semantic-site, and model-call capacities plus only the same-ecosystem ordinary capacity; preserve the fixed V2 precision fallback of vulnerable-over-vulnerable, otherwise zero-over-one when false-positive capacity exists, otherwise zero-over-zero.
- Evaluate registered thresholds, minimum denominators, and Wilson-width rules from that same witness through the fixed metric algebra; treat a zero denominator as insufficiency and never as GO or NO-GO.
- Derive shared spend eligibility only when every row is feasible; keep insufficiency and its reasons distinct from GO and NO-GO.
- Refuse missing, extra, duplicated, or caller-summarized rows and prevent preparation when one row is insufficient.
- Done when a single insufficient scope blocks the shared spend without opening labels, while the complete feasible plan yields one reproducible preflight digest.
@@ -714,6 +715,7 @@ contract work and use synthetic/in-memory workflow boundaries only.
- Task 13.1 closed the arm-configuration gap by requiring at least two canonical non-self component identities for a combined arm and proving its complete finite decision table, proof-retention policy, and every configuration input remain digest-bound without executable behavior.
- Task 13.2 established a label-blind non-circular plan declaration, an authoritative canonical input-set identity and complete arm-by-input slot product, exact component-kind lineage, and one declaration-derived baseline per arm.
- Task 13.3 added exact label-sealed scope/ecosystem census contracts and an independently reviewed plan manifest that binds the declaration, baselines, census, readiness, custody, and bounded trust-resolved review evidence before feasibility.
- Task 13.4 revalidates the reviewed manifest before deriving one exact arm/scope feasibility row, preserves the V2 reachability witnesses and same-ecosystem ordinary capacity, and keeps insufficiency and zero denominators outside GO/NO-GO while blocking shared spend.
- The frozen migration inventory is a reviewed worklist with stable identities, not a semantic-use census. It may only close entries as `v2_migrated` or `retired`; it never grows, deletes entries, or proves absence by interpreting Python flow.
- Cutover is proved by explicit syntax checks plus deletion of the compatibility and v1 write capability. No task extends the discarded alias/data-flow interpreter.
- Task 10.5 debug established that executable owner probes cannot compensate for blanket source-closure acceptance; resumed hunt attempts also require collision-resistant attempt identity and create-only persistence before handoff validation is authoritative.