# NEXT temporary contract 3.24 — Complete debug capture and semantic refactoring {#root}

@status:impl/plan

[p01] @fact:NEXT-A24-SCOPE Temporary normative staging unit. Its body is the accepted architecture from refined plan revision 4, section 3.24. Before production code cites this law, promote the relevant clauses into permanent specifications. This file is consumed only after semantic coverage, implemented behavior and retained evidence are accepted. The task/retirement checker cannot perform semantic acceptance. @status:spec/done

[p02] @fact:NEXT-A24-U001 ETO extends D-007 beyond the boot viewer. Every relevant domain stage provides addressable inputs, applied configuration/constraints, decisions and rejection reasons, transformation identity, outputs, provenance, timings where measured, diagnostics and effect/evidence links. For the solver this includes rejected candidates and why selected edges survive; for compiler/boot it includes actual intermediate carriers and occurrence mappings; for install/deploy it includes ownership/preconditions and partial journal; for environments/images/services it includes backend closure, runtime/image identities, health and permission decisions. @status:spec/done

[p03] @fact:NEXT-A24-U002 Use existing compiler_ir/trace-index snapshots and observation seams. Live record capture, retained trace inspection and a new diagnostic rerun are different operations. Opening a recorded trace must not acquire a writer role, sweep retention, recreate it or invoke providers. Absent/evicted/not-captured/redacted/snapshot-failed states are explicit; a missing snapshot does not silently become a rerun. Keep inspection after failed runs and API exit possible through retained captures/exported bundles with provenance. @status:spec/done

[p04] @fact:NEXT-A24-U003 Capture is configurable by declared detail/stage/filter/sink/retention policy with progress and cancellation; full-detail on-demand capture is supported where the engine has the data, including large streamed structures. Existing hardcoded 128 MiB/nine-run diagnostic retention (E50) is not a boot quota, but it cannot silently define “all internal structures exposed.” Reconcile capture policy so required detail can be retained/exported or marked unavailable with exact missing portions; no hidden completeness claim. Observer failures do not change compiler semantics or turn successful domain execution into a failure; a requested observability proof can separately fail its own completeness requirement. Exposing an internal field must not change solver choices or compilation bytes. @status:spec/done

[p05] @fact:NEXT-A24-U004 External package providers register their namespaced model/operation/diagnostic schemas and observation capabilities through the existing extension registry. Retained data remains structurally inspectable after removal/revocation, using captured schema/host-owned readers, without executing the revoked provider. Package descriptions do not inject arbitrary renderers/scripts into a client. A generic client can display structured nodes/properties/relations/actions; richer future clients may specialize by schema without moving domain decisions into UI code. @status:spec/done

[p06] @fact:NEXT-A24-U005 **Package rename full path (required backend capability, no plugin):** @status:spec/done

[p07] @fact:NEXT-A24-U006 Requirement: 1. Distinguish display-name edit, owned package-coordinate change, file/root move, specification-anchor rename and local alias. Select one explicitly; do not reuse one string-replace operation for all. 2. Capture the editable owned source package, selected consumer roots and complete affected reference universe from authoritative declarations/parsers. Include manifests/choice/dependency/provider references, declared spec links/code markers/resource exports, configured paths and environment definitions where applicable. Existing tree in-place-marker inventory is incomplete and cannot certify this universe (E46). 3. Return a typed plan of exact edits/moves, old→new identities, conflicts/case aliases, reference resolutions, generated outputs to regenerate, excluded external/history/foreign data and unknown/dynamic reference zones. Full-source scanning is declared and bounded by the selected authorized scope; ordinary Markdown/XML/opaque payload is not parsed as Vibe instructions or bulk rewritten. 4. Unknown references require explicit resolution, expanded capture or a bounded incomplete disposition. A rename claiming complete compatibility cannot close with unresolved mandatory in-scope references. Outside consumers are reported as outside scope, not silently assumed absent. Rename of an external installed package requires its own owned derivative/new identity or editing its authorized source; never mutate a foreign slot in place. 5. Validate new coordinates, target paths, dependency/address graph and generated projections in memory against exact captured versions. The caller receives reviewable changes and effects. Service apply requires the saved-disk synchronization boundary; optional buffer edits remain proposals until saved/replanned. 6. Revalidate all affected inputs/ownership/lock and target generations; apply with retained before-images and a journal, regenerate derived lock/boot/index outputs from authored intent, then re-resolve and inspect postconditions. Partial multi-file failure and recovery remain truthful; no physical atomicity promise across roots/backends. Expose action status/events and versioned diagnostics throughout. 7. Historical captures/receipts/signatures/closure evidence retain their original identities. Published registry identity changes are a separate prepared publication/migration action under D-015. Existing deployed environments are not silently retargeted: update/adopt through their own plan. An alias/redirect requires an explicit supported contract, never invented resolver fallback. D-019 future Redbook roster version offer remains applicable when the actual change touches that definition. @status:spec/done

[p08]
```text
1. Distinguish display-name edit, owned package-coordinate change, file/root move, specification-anchor rename and local alias. Select one explicitly; do not reuse one string-replace operation for all.
2. Capture the editable owned source package, selected consumer roots and complete affected reference universe from authoritative declarations/parsers. Include manifests/choice/dependency/provider references, declared spec links/code markers/resource exports, configured paths and environment definitions where applicable. Existing tree in-place-marker inventory is incomplete and cannot certify this universe (E46).
3. Return a typed plan of exact edits/moves, old→new identities, conflicts/case aliases, reference resolutions, generated outputs to regenerate, excluded external/history/foreign data and unknown/dynamic reference zones. Full-source scanning is declared and bounded by the selected authorized scope; ordinary Markdown/XML/opaque payload is not parsed as Vibe instructions or bulk rewritten.
4. Unknown references require explicit resolution, expanded capture or a bounded incomplete disposition. A rename claiming complete compatibility cannot close with unresolved mandatory in-scope references. Outside consumers are reported as outside scope, not silently assumed absent. Rename of an external installed package requires its own owned derivative/new identity or editing its authorized source; never mutate a foreign slot in place.
5. Validate new coordinates, target paths, dependency/address graph and generated projections in memory against exact captured versions. The caller receives reviewable changes and effects. Service apply requires the saved-disk synchronization boundary; optional buffer edits remain proposals until saved/replanned.
6. Revalidate all affected inputs/ownership/lock and target generations; apply with retained before-images and a journal, regenerate derived lock/boot/index outputs from authored intent, then re-resolve and inspect postconditions. Partial multi-file failure and recovery remain truthful; no physical atomicity promise across roots/backends. Expose action status/events and versioned diagnostics throughout.
7. Historical captures/receipts/signatures/closure evidence retain their original identities. Published registry identity changes are a separate prepared publication/migration action under D-015. Existing deployed environments are not silently retargeted: update/adopt through their own plan. An alias/redirect requires an explicit supported contract, never invented resolver fallback. D-019 future Redbook roster version offer remains applicable when the actual change touches that definition.
```

[p09] @fact:NEXT-A24-U007 Other existing refactor/conversion/clean/settings operations use the same preview/apply/result contract, preserving their domain rules. General programming-language rename/move engines and wholesale PROP-032 code:// expansion are not prerequisites for Vibe package rename; their current supported providers expose capabilities and missing semantic coverage honestly. @status:spec/done

