# NEXT temporary contract 3.22 — Addressable models, live editing and coherent observations {#root}

@status:impl/plan

[p01] @fact:NEXT-A22-SCOPE Temporary normative staging unit. Its body is the accepted architecture from refined plan revision 4, section 3.22. 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-A22-U001 Publish versioned semantic projections of resolver candidates/constraints/selected edges, compiler input/intermediate/output carriers, boot occurrences/inclusion mappings, source facts/references, artifact/provider records, operation state, effect plans/grants/receipts, cache/store/generations, image stages/layers and service/backend observations. Links compose a navigable typed graph view over domain-owned records. Querying the graph never becomes a new source of truth for authored intent or installed state. @status:spec/done

[p03] @fact:NEXT-A22-U002 Identity has four distinct levels: a logical entity reference, exact capture/content identity, observation/snapshot identity, and a presentation occurrence ID. Repeated inclusion of the same package/fragment has separate occurrences; display coordinate/order/line alone is not a persistent ID. Use existing stable domain identities where real; otherwise identify the object within its exact capture and state its stability. Package coordinate rename is an explicit old→new identity transition, not a claim that an FQID never changes. A code analyzer can contribute existing code-symbol identities/references without forcing minted code IDs onto every function; unsupported language semantics remain scoped and explicit. @status:spec/done

[p04] @fact:NEXT-A22-U003 Every view exposes schema, context/target, authority/source captures, source-location basis, completeness and diagnostics. A CompositeSnapshot is an explicit vector of compatible source/world/target/operation observations; independently changing domains are not falsely called one atomic global snapshot. If coherent composition cannot be established, return inconsistent/stale/partial rather than a plausible merged current tree. Filters, pages, children and large-value chunks bind the same snapshot/query projection; paging must eventually expose the full authorized structure, not enforce a hidden total object/boot limit. @status:spec/done

[p05] @fact:NEXT-A22-U004 Resource navigation uses opaque resource IDs plus captured raw/projection locations and a host-provided URI mapping. Range offsets refer to a declared encoding and exact document revision; conversion to negotiated editor positions is mechanical. Preserve non-UTF8/XML-data, generated projections and explicit source maps. Do not treat a projected Markdown line as a raw XML position or reveal unrestricted host paths to a target-bound client. @status:spec/done

[p06] @fact:NEXT-A22-U005 **Document overlays:** a client owns versioned open/change/close buffers with resource identity, buffer version/content digest, underlying disk capture, encoding, created/deleted/moved intent and context. A captured overlay set is immutable and client-scoped. Pure validation, references, diagnostics, configuration preview and builtin boot what-if run on one disk-plus-overlay snapshot. Invalid/partial editor syntax yields diagnostics and partial semantic availability; raw text remains visible. Overlays neither save files nor change lock/installed/profile state and do not contaminate another client's view. Native/effectful analysis is an explicit prepared action even when the input originated in an editor. @status:spec/done

[p07] @fact:NEXT-A22-U006 **Two explicit edit modes:** (1) analysis/code-action returns a versioned proposed edit for the owning client buffer; applying it changes only that client's working state and is not a committed package mutation; (2) service-managed multi-file/refactoring/domain apply uses saved/captured disk state. If relevant buffers are dirty or disk versions changed, return save-required/dirty-conflict/stale with the affected resources; never auto-save or overwrite. The client can explicitly save and request a fresh plan. A plan prepared against dirty buffer bytes is not admitted merely because the buffer later saved: disk preconditions are recaptured and checked. Actual source/artifact mutations use one writer/transaction owner; the editor and service must not both apply the same edit. @status:spec/done

[p08] @fact:NEXT-A22-U007 Service-managed apply acquires a cooperative EditBarrier for the complete affected resource set and registered participating client/buffer versions. Participants acknowledge the barrier and suspend conflicting buffer/save operations or refuse it; hold it through disk revalidation and commit. A changed version, failed acknowledgement, expired lease or disconnected participant returns conflict/unknown and prevents starting further writes; after any landed write, preserve partial/recovery truth. No assumption that a once-clean buffer remained clean merely because the disk digest stayed equal. Cleanliness is proven only for registered participating buffers, not every unrelated editor; disk CAS and post-state validation still govern other writers. Cross-client conflict metadata reveals affected authorized resources/versions, never another client's buffer contents. Barrier identity/lease and participant versions bind the operation; release/failed-owner recovery cannot silently endorse an unfinished edit. @status:spec/done

[p09] @fact:NEXT-A22-U008 Disk changes, package/lock updates, policy/target changes and overlay edits invalidate the relevant observations. Watchers are hints; events carry affected IDs/revisions and recovery/resnapshot requirements, not magical proof of a lossless filesystem stream. A missed watch/replay window produces gap/expired and a fresh capture. Do not automatically rerun install, native probes or publication in response to a watch event. @status:spec/done

