Skip to content

Viewer evidence inherits the target row's repository (decision #212 A) #305

Closed

Description

@abogartz

Implements the accepted decision on #212 (accept A, maintainer 2026-11-04): viewer-originated evidence inherits the target row's repository.

Problem

The viewer's record() calls emit unstamped lines, and evidenceVisibleTo (src/store/model/visibility.ts) reads unstamped/no-sid lines as global. Any repository's session can read operator reasons and row ids for edits, deletes and quarantine releases performed on another repository's private rows via the viewer. Verified current at 06e4e28.

Fix direction

src/viewer/mutate.ts — the three event sites (viewer_edit ~L118, prune, quarantine_released/quarantine_release_noop ~L245) already hold target.repo/target.repoPath in scope; pass them into record() (src/evidence/record.ts) so the emitted line carries the target's repo. Acting on a genuinely global row must still yield a globally visible line; admin reader unchanged.

Acceptance

  • RED: scenario test — in a viewer-shaped process, edit a repo-B row with a distinctive reason; a repo-A session's memory_evidence returns the viewer_edit line. Fails on main for exactly that reason.
  • GREEN: the line carries repo=B, is invisible to the repo-A reader, visible to the admin reader; an edit of a repo=global row still reads as global.
  • Existing viewer mutate tests updated, none weakened; bun run typecheck && bun run lint && bun run test green, bun run test:e2e since src/ changed.

Activity

  1. added
    store-security
    severity:high
    agent:ready
    on Nov 4, 2026
  2. added
    fix:working
    on Nov 4, 2026
  3. ocsi-triager commented on Nov 4, 2026

    @ocsi-triager

    osi-spec-hash: 039dcec7535ae281 2026-11-04T23:38:06Z - acceptance criteria frozen at this text. A later edit to the body changes this hash, and the reviewer will withhold approval until a maintainer replies spec ok.

  4. added
    fix:pr-open
    fix:blocked
    and removed
    fix:working
    on Nov 5, 2026
  5. added a commit that references this issue on Nov 5, 2026
  6. abogartz-opencode-self-improvement commented on Nov 5, 2026

    @abogartz-opencode-self-improvement

    🎉 This issue has been resolved in version 0.15.38 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent:readyfix:blockedfix:pr-openreleasedseverity:highstore-security

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions