|
| 1 | +# Phase 15 — Self-Hosting Remediation Contract |
| 2 | + |
| 3 | +Phase name: self-hosting-remediation (Phase 15) |
| 4 | + |
| 5 | +## Objective |
| 6 | +- Remediate the blocking defects discovered during Phase 14 self-hosting validation so the self-host pipeline deterministically passes the full test suite and artifact validation. |
| 7 | + |
| 8 | +## Scope and Allowed Actions |
| 9 | +- Allowed actions: |
| 10 | + - Targeted code fixes mapped to triaged failure categories in `docs/self_hosting_failure_triage.md`. |
| 11 | + - Spec/schema changes where explicitly required to resolve contract mismatches; spec changes must follow the spec-first rule and correspond to an RFC or a patch entry created by the product team. |
| 12 | + - Test updates or additions that validate the intended authoritative behavior. |
| 13 | + - Backwards-compatibility guards (e.g., feature flags, migration environment variables) where the fix would otherwise break legacy behavior. |
| 14 | +- Forbidden actions: |
| 15 | + - No new features, DSL extensions, or broad refactors unrelated to the triaged categories. |
| 16 | + - No cross-RFC work; a PR must implement a single triaged failure category or a single RFC. |
| 17 | + |
| 18 | +## Process Rules |
| 19 | +- One triaged failure category per PR. A PR can include multiple tests and small refactors that directly support that single category, but not multi-category changes. |
| 20 | +- Spec-first rule: If a change requires a spec update, the first commit in the PR must be the spec/schema change, followed by code and test changes implementing it. |
| 21 | +- PRs must include a deterministic test harness showing deterministic outputs remain stable (self-host manifest/hash comparison) and a CI run with pytest -q passing for modified areas. |
| 22 | +- Migration guards: If a fix alters default behavior for older specs, include a guard (environment variable or `feature_gate` in metadata) and tests that show both migration and canonical behavior. |
| 23 | +- Backwards-compatibility: Ensure code remains compatible with canonical DSL; test both canonical and sample legacy specs preserved by migration guard. |
| 24 | + |
| 25 | +## Determinism and Compatibility Requirements |
| 26 | +- Determinism: The self-host run must produce byte-for-byte identical `manifest.json` and `summary.json` hashes across repeated runs on the same environment and spec. |
| 27 | +- No randomization: No runtime timestamps or environment-based paths should pollute deterministic artifacts. |
| 28 | +- Compatibility: When changes break legacy flows, a migration guard must be provided and the documentation updated. |
| 29 | + |
| 30 | +## Entry Conditions |
| 31 | +- `docs/self_hosting_failure_triage.md` and `docs/phase_14_closure.md` exist and are authoritative snapshots of the triage and closure. |
| 32 | +- PRs must be scoped to a single triaged failure category and include the spec-first commit when required. |
| 33 | +- No new RFCs outside the triage scope should be introduced in Phase 15. |
| 34 | + |
| 35 | +## Exit Criteria |
| 36 | +- All triaged failure categories marked as remediated with passing PRs. |
| 37 | +- Full test suite (`pytest -q`) passes locally and in CI, including the deterministic self-host run run twice with identical artifacts. |
| 38 | +- Updated migration guidance and docs where backward compatibility guards are provided. |
| 39 | +- All changes merged into a Phase 15 `remediation` branch and tested in the CI pipeline before re-attempting Phase 14 validation. |
| 40 | + |
| 41 | +## Governance |
| 42 | +- Approvals required: Code changes must pass a code review by the engineering lead and a spec validation review if spec changes are included. |
| 43 | +- All PRs must include tests that reproduce the original failure and validate the remediation. |
| 44 | + |
| 45 | +## Priorities |
| 46 | +- Fixes are prioritized in the following order: |
| 47 | + 1. Generator lockfile / preflight contract behavior |
| 48 | + 2. Engine/DSL mapping (`spec_format` => `dsl_version` mapping) |
| 49 | + 3. Evidence bundle compatibility |
| 50 | + 4. Codegen output shape standardization |
| 51 | + 5. Pointer map canonicalization |
| 52 | + 6. Pointer coverage shape |
| 53 | + 7. Checklist ID canonicalization |
| 54 | + 8. JSON canonical formatting |
| 55 | + 9. Cross-section types enforcement |
| 56 | + 10. Self-host summary completeness |
| 57 | + |
0 commit comments