Skip to content

feat: add value-free share disclosure preview core - #259

Open
harshitethic wants to merge 3 commits into
Siddhant-K-code:mainfrom
harshitethic:feat/share-disclosure-preview-core
Open

harshitethic wants to merge 3 commits into
Siddhant-K-code:mainfrom
harshitethic:feat/share-disclosure-preview-core

Conversation

@harshitethic

Copy link
Copy Markdown

Summary

Adds a small, dependency-free disclosure calculation layer for #252 so a future agent-strace share SESSION --dry-run path can report what would be exposed without printing the sensitive values themselves.

New core

agent_trace.disclosure.build_disclosure_preview() reports only counts/metadata for:

  • prompts
  • responses
  • tool inputs/results
  • command-bearing events
  • path-bearing events
  • annotations
  • content-rich events
  • redacted events
  • unredacted content-rich events

The preview is versioned and records either minimized or explicit include_content mode.

Privacy invariant

The preview never copies prompt text, tool payload values, command strings, paths, result text, or annotation text. The tests serialize the preview and assert representative secret values and private paths are absent.

Tests

tests/test_disclosure.py covers:

  • category counting
  • redaction/unredacted counts
  • minimized vs include-content mode
  • value-free serialization even in include-content mode
  • invalid negative annotation counts

Documentation

docs/share-disclosure-preview.md defines the trust boundary and makes clear that this PR does not yet change the current share output or claim perfect secret detection.

Scope

This is a focused calculation-layer foundation for #252, not a claim to close the whole issue. Follow-up wiring can use this core for share --dry-run, the minimized default share mode, the disclosure manifest embedded in HTML/stdout, and migration handling for existing full-content users.

Validation

The implementation is stdlib-only and the tests use the existing TraceEvent model. I could not execute the suite locally because the connected development machine is offline; upstream CI is the verification gate for this branch.

Refs #252.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant