Skip to content

Files Changed: harden external assessment isolation and egress privacy #975

Description

@jeonghun-jj-lee

Files Changed: harden external assessment isolation and egress privacy

Important

Problem - A basic external assessment can still misattribute a same-path write, inherit ownership through a fork, lose or retain host-local artifacts incorrectly, or leak generated external content through persistence and sharing paths.

Approach - Make expected-digest assessment conservative, keep external ownership strictly session-local across fork, restart, and deletion, and make the assessed detail response the sole carrier of generated external patches.

Scope - in: contention, baseline lifecycle persistence and cleanup, generated-artifact redaction, and legacy compatibility. out: new mutation sources, arbitrary shell attribution, client presentation redesign, and global writer locking.

Assumptions - Earlier children provide durable baselines, mutation reservations, and changed/unchanged/unavailable detail assessment.

Acceptance Criteria

  • When sessions commit different bytes to one external reference, an owner whose expected digest no longer matches current bytes receives unavailable with no patch.
  • A later session whose expected digest matches current bytes may receive its own changed assessment.
  • Restoring a baseline reports unchanged rather than fabricated contention.
  • A fork has no owned external references or baseline artifacts, even if copied transcript data mentions historic opaque references.
  • A same-host restart rehydrates committed ownership and preserves truthful assessment.
  • Removing a session deletes records and artifacts; orphan cleanup is idempotent and never removes live artifacts.
  • A sentinel in a baseline or generated patch is absent from result and permission metadata, events, summaries, exports, share payloads, and the legacy diff response.
  • The sentinel appears only in the authenticated no-store assessed detail response when a changed patch is requested.
  • Legacy session diffs remain a wire-compatible array of in-worktree changed rows.

Testing Decisions

  • Extend the session-scoped diff harness for the two-session expected-digest matrix and legacy exclusion.
  • Extend session lifecycle tests for fork isolation and recursive removal.
  • Extend the reload harness for same-host baseline rehydration.
  • Extend sharing payload interception and tool metadata tests with a generated-artifact sentinel.
  • Extend HTTP and SDK contract tests for no-store detail responses and unchanged legacy array behavior.

Key Decisions

  • Current bytes are attributed only when they match the session's expected digest or are provably unchanged from its baseline.
  • Identical-byte restoration is not detectable history and is reported by final byte state.
  • Generated external patches are transient; ordinary tool arguments retain their existing session policy.
  • Cleanup failures are repaired by an orphan sweep, never by serializing host-local artifacts into session data.

Constraints & Invariants

  • Do not copy external ownership into a session fork.
  • Do not widen or version-break the legacy diff array.
  • Do not infer authorship for undeclared writers.
  • Do not add UI behavior or new mutation sources in this slice.

Prior Art

Source

Part of #972. Blocked by #974.

Notes

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

Activity

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