Shared memory and context tools for agentic work.
Code Rooms
---
Protocol: L1GHT/1.0
Node: UltraEditContracts
State: draft
Color: yellow
Glyph: π»
Completeness: 28%
Proof: first contract surface documented
Depends on:
- UltraEdit
- SurgicalContextV2
- ApplyBatch
Next:
- EditPreviewAPI
- EditCommitAPI
- SemanticEditAPI
# Ultra Edit β Contracts
## API Surface
[β entity: EditPreviewAPI]
[β entity: EditCommitAPI]
[β entity: EditAbortAPI]
[β entity: SemanticEditAPI]
[β entity: MultiEditTransactionAPI]
## Core Contract
Ultra Edit is split into preview and commit phases.
[β entity: PreviewHandle]
[β entity: CandidateSnapshot]
[β entity: ValidationReport]
[β entity: CommitReceipt]
### Preview
- Receives edit intent.
- Produces an in-memory candidate.
- Returns diff, validation, risk, and metadata.
- Does not modify disk.
[β binds_to: m1nd.edit_preview]
[β tests: preview_returns_diff_and_validation]
### Commit
- Accepts an approved preview handle or snapshot.
- Checks source freshness.
- Writes atomically.
- Reingests graph once.
[β binds_to: m1nd.edit_commit]
[β tests: commit_requires_fresh_snapshot]
## Required Inputs
[β entity: EditIntent]
[β entity: EditTarget]
[β entity: EditOperation]
[β entity: ValidationMode]
Possible target modes:
- exact_text
- symbol
- ast_node
- insert_after_symbol
- insert_before_symbol
- replace_function_body
- transaction_batch
## Required Guarantees
[β state: required]
- preview is side-effect free
- commit is atomic by default
- snapshot mismatch aborts commit
- validation report is machine-readable
- semantic target resolution returns ambiguity score
- batch edits preserve deterministic ordering
## Compatibility
Ultra Edit must complement, not break:
[β depends_on: apply]
[β depends_on: apply_batch]
[β depends_on: surgical_context_v2]
[β binds_to: VerifyPipeline]
[AMBER warning: legacy apply remains necessary for full-file replacement workflows]