Files
claw/docs/superpowers/plans/2026-04-19-g3-real-sample-runtime-contract-correction-plan.md

167 lines
5.6 KiB
Markdown

# G3 Real Sample Runtime Contract Correction Plan
> Date: 2026-04-19
> Status: Draft
> Upstream Spec: [2026-04-19-g3-real-sample-runtime-contract-correction-design.md](D:/data/ideaSpace/rust/sgClaw/claw-new/docs/superpowers/specs/2026-04-19-g3-real-sample-runtime-contract-correction-design.md)
> Trigger Report: [2026-04-19-g3-real-sample-archetype-correction-closure-report.md](D:/data/ideaSpace/rust/sgClaw/claw-new/docs/superpowers/reports/2026-04-19-g3-real-sample-archetype-correction-closure-report.md)
## Plan Intent
This plan implements the next bounded scope selected after `G3` archetype correction:
`mainline G3 real-sample runtime / contract correction`
Its purpose is to narrow the remaining real-sample gap from a coarse runtime-scope failure to the smallest accurate contract state.
## Scope Guardrails
1. do not reopen the completed `G3` archetype-correction scope
2. do not broaden this work into `G8` runtime implementation
3. do not open `G4 / G5`
4. do not add new family-expansion fixtures unrelated to the real-sample mismatch
5. do not weaken fail-closed behavior for incomplete `G3` scenes
6. do not update validation assets until the rerun result changes
## Workstreams
1. `WS1` Runtime-Scope Differential
2. `WS2` G3 Runtime-Scope Gate Narrowing
3. `WS3` Regression and Fail-Closed Integrity
4. `WS4` Real-Sample Rerun and Closure
## Phase 0: Freeze the Correction Boundary
### Objective
Lock the scope to one remaining mismatch: `G3` real-sample runtime scope compatibility.
### Tasks
1. freeze `95598工单明细表` as the only correction anchor
2. freeze current remaining mismatch:
- `runtime_scope_gap`
- `output_contract_not_verified`
3. freeze current `G8` behavior as a boundary-family constraint that must not regress
### Deliverables
1. correction-boundary note
2. fixed runtime-gap statement
### Acceptance Criteria
1. no additional family or runtime scope is added under this plan
2. the correction target is explicitly `G3 runtime scope`, not a broader runtime program
## Phase 1: Build the Runtime-Scope Differential
### Objective
Understand why the current gate still marks the real sample as runtime-incompatible.
### Tasks
1. compare current `G3` runtime-scope gate logic against the corrected real-sample evidence
2. isolate which localhost evidence should remain subordinate
3. isolate what dominant-runtime pattern should still fail closed
4. write a minimum gate-narrowing summary before code changes begin
### Deliverables
1. runtime-scope differential note
2. gate-narrowing summary
### Acceptance Criteria
1. the minimum change to `g3_runtime_scope_compatible` is explicit
2. the team can distinguish subordinate host-runtime evidence from dominant runtime takeover
## Phase 2: Narrow the G3 Runtime-Scope Gate
### Objective
Allow valid `G3` real samples with subordinate localhost evidence to stay runtime-compatible.
### Tasks
1. narrow `g3_runtime_scope_compatible` so it considers business-chain dominance, not only localhost evidence count
2. preserve fail-closed behavior for scenes whose business chain is still not dominant
3. keep `G8` representative behavior intact
### Deliverables
1. generator gate update
2. explicit regression rule for subordinate localhost evidence inside `G3`
### Acceptance Criteria
1. the corrected real sample no longer fails the runtime-scope gate for the old coarse reason
2. `G8` representative classification remains intact
3. incomplete `G3` scenes still fail closed for `G3` reasons
## Phase 3: Lock Regression and Fail-Closed Integrity
### Objective
Prove the narrowed gate does not create a pseudo-runnable class of scenes.
### Tasks
1. add regression for real-sample-like `G3` with subordinate localhost evidence
2. retain `G8` regression and mixed-boundary regression
3. verify unresolved `G3` scenes still fail closed when business-chain dominance is absent
### Deliverables
1. regression tests for `G3 runtime scope`
2. updated assertions where needed
### Acceptance Criteria
1. no regression causes `G8` to disappear as a boundary archetype
2. no regression causes unrelated `single_request_table` or other families to drift
3. test coverage explicitly names the corrected runtime-scope pattern
## Phase 4: Rerun the Real Sample and Close the Loop
### Objective
Use the actual real sample to confirm the narrowed runtime-scope outcome and record the next state.
### Tasks
1. rerun `sg_scene_generate` on `95598工单明细表`
2. record whether:
- `g3_runtime_scope_compatible` now passes
- remaining mismatch, if any, is narrower than runtime-scope failure
3. update the real-sample validation record layer
4. write a formal closure report
### Deliverables
1. rerun output
2. updated real-sample validation assets
3. `G3` runtime-contract-correction closure report
### Acceptance Criteria
1. the rerun no longer fails for `g3_runtime_scope`
2. the validation layer records the narrowed family outcome
3. the next scope recommendation can move from `G3 runtime correction` to the next remaining mainline gap
## Completion Criteria
This plan is complete when:
1. the `G3` real sample no longer fails for the old coarse runtime-scope reason
2. the narrowed gate is covered by automated regression
3. real-sample validation assets are updated with the new outcome
4. `G8` remains a valid boundary-family archetype with no unintended regression
## Next Step
After this plan completes:
1. if `G3` still has a narrower output or data-verification gap, move to `G3` real-sample output or contract verification
2. if `G3` stabilizes, return to the next mainline mismatch in priority order, which is `G2` real-sample contract correction