Skip to content

Files Changed: trace one server-assessed non-Git external edit #973

Closed

Description

@jeonghun-jj-lee

Files Changed: trace one server-assessed non-Git external edit

Important

Problem - A completed edit or write outside the active worktree is currently visible only through a stale tool patch. A non-Git sibling file has no independent current-diff assessment.

Approach - Capture a process-local, session-scoped baseline after permission and before a successful external edit or write. Expose one authenticated, no-store assessed detail response and render its server-produced changed row in Files Changed instead of the tool patch.

Scope - in: one existing UTF-8 text file in a non-Git sibling directory, edit and write tools, one settled changed assessment, and one visible Files Changed row. out: durable cleanup, zero-net lifecycle, aliases, binary and move cases, concurrent writers, privacy hardening, and extension mutations.

Assumptions - Parent #972 remains the governing contract. This tracer intentionally proves only the smallest external path end to end.

Acceptance Criteria

  • After edit permission succeeds and before mutation, an external edit or write captures an immutable server-local baseline for the active session.
  • Denied permission creates no baseline record.
  • A record becomes visible only after the final write and formatter complete successfully.
  • The assessed-detail response is authenticated, no-store, and reports one settled changed assessment with a server-produced patch and line counts.
  • Files Changed renders exactly one row for the sibling file after the detail response succeeds.
  • The rendered patch comes from the assessed response, never the completed tool patch.
  • While assessment is loading, failing, or absent, the app does not promote a tagged external tool patch.
  • A second session has no assessment for the first session's sibling file.
  • Existing in-worktree diff behavior and legacy consumers remain unchanged.

Testing Decisions

  • Extend the existing session-scoped server-diff integration harness with one non-Git sibling fixture and a second-session isolation assertion.
  • Extend edit and write tool tests to prove permission, baseline capture, mutation, and settlement ordering.
  • Extend the app's existing diff-accumulation test surface so assessed external data wins and an unresolved assessment produces no external row.
  • Extend the HTTP API coverage matrix for the assessed detail response.

Key Decisions

  • This slice is a vertical tracer bullet, not the full external-file lifecycle.
  • The baseline is process-local for this slice; later children own durable storage and cleanup.
  • The assessed response is the only external truth the UI may render.
  • The detail response uses an opaque session-owned reference; titles are never identity.

Constraints & Invariants

  • Do not use the Git snapshot path as authority for the non-Git fixture.
  • Do not modify extension file operations or watcher behavior.
  • Do not expose baseline bytes in new metadata or the response outside the transient assessed patch.
  • Keep the OpenCode fork as source of truth and synchronize the Amicode overlay afterward.

Prior Art

Source

Part of #972.

Notes

This child starts as hitl because the parent review is degraded. Its own deliberate review must pass before implementation begins.

Activity

  1. jeonghun-jj-lee commented on Sep 10, 2026

    @jeonghun-jj-lee
    ContributorAuthor

    Deliberation addendum: mechanical checks are degraded because model critics were unavailable; an independent adversarial review found no remaining blocker. The accepted local contract conforms to parent #972's versioned detail and error semantics, uses a formatter-distinguishing regression test, defines conservative write and formatter failure states, scopes legacy behavior to tracer references, and defers durable restart handling to #975. This issue remains hitl pending implementation review.

  2. jeonghun-jj-lee commented on Sep 11, 2026

    @jeonghun-jj-lee
    ContributorAuthor

    Merged into the #972 integration branch after TDD verification; continuing with dependent slice #974.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

hitlNeeds human review before merge

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions