Repository navigation
Files Changed: adopt app and extension user mutation routes #1080
Description
Files Changed: adopt app and extension user mutation routes
Important
Problem - Sidebar, Preview, and Files Changed editing can currently mutate through client or extension paths that have weaker session identity and fallback guarantees than the proposed ledger contract.
Approach - Make user-initiated file operations host-mediated mutation intents. Use the negotiated capability to create registered operation groups; preserve clearly labelled legacy behavior only when protocol discovery selects legacy.
Scope - in: Sidebar leaf, move, Trash, restore, directory, and recursive operations; Preview and review editing; panel ownership; opaque host transport; and watcher revalidation. out: engine tool adoption and plugin/runner records.
Assumptions - The mutation gate and privacy policy are available. Existing #976 remains the v1 foundation pending its release and pin gate.
Acceptance Criteria
- User-initiated file operations bind to the initiating panel and active session before storage work begins.
- Sidebar create, move, Trash, restore, directory, and recursive operations use registered contexts or deny before mutation in full-provenance mode.
- Preview and Files Changed editing cannot bypass host-mediated context validation.
- A capability-discovery legacy result preserves existing behavior with a visible legacy label; an invalid mutation context never falls back to untracked mutation.
- Watchers only revalidate server-owned receipts and cannot determine ownership or lifecycle locally.
- User-originated receipts remain distinguishable from agent, child-agent, and system receipts.
Testing Decisions
- Extend extension-host, panel ownership, Sidebar, Preview, review-editing, watcher, and legacy-fallback tests.
- Add paired app-extension integration coverage for invalid context denial and exact idempotent retry.
Key Decisions
- Browser code never receives a mutation capability or determines externality.
- User actions are first-class session origins, not anonymous filesystem events.
Constraints & Invariants
- Existing Files Changed: session-bind Sidebar external file mutations #976 remains a foundation and is not rewritten around a merged v1 implementation.
- UI transport never exposes host-only paths, hashes, evidence, or capabilities.
Prior Art
- Parent Files Changed: full session-lineage mutation ledger #972
- Existing Files Changed: session-bind Sidebar external file mutations #976 and its merged extension implementation
Deliberation Resolution
- The browser sends a display-safe
MutationIntentcontaining operation, user-selected display target, and idempotency key. The extension host resolves resource identity, snapshots the active panel and session before input or confirmation, obtains the context, and returns only a display-safe operation result. - Capability discovery has
full,partial,legacy, andunavailableoutcomes. Onlylegacyselects existing behavior;partialuses a labelled partial epoch, while invalid or expired mutation contexts deny without fallback. - All user operations consume the operation-group contract from Files Changed: enforce mutation registry, contexts, and resource identity #1077: the same idempotency key returns the prior result, preflight failures have no applied resources, and execution failures return explicit partial outcomes.
- Watchers receive only receipt references and assessment revisions, emit invalidation, and never receive or derive ownership, lifecycle, canonical paths, hashes, or evidence.
- Test fixtures from Files Changed: session-bind Sidebar external file mutations #976 provide legacy reservation behavior; Files Changed: enforce mutation registry, contexts, and resource identity #1077 and Files Changed: enforce provenance privacy and serializer policy #1078 provide full-mode context and display-safe transport fixtures.
Activity