Skip to content

feat: include source-file content in packet (closes #2)#3

Merged
dshanklin-bv merged 1 commit into
mainfrom
feat/files-param
Apr 29, 2026
Merged

feat: include source-file content in packet (closes #2)#3
dshanklin-bv merged 1 commit into
mainfrom
feat/files-param

Conversation

@dshanklin-bv

Copy link
Copy Markdown
Contributor

Summary

  • Adds optional files parameter to the cept MCP tool and --file (repeatable) to cept-cli.
  • Caller-supplied paths are read into the packet under files, keyed by the verbatim path so model citations line up with what the agent sees.
  • New cept.files module with caps (50 KB/file, 256 KB total, 24 files), truncation marker, binary-file skip, dedupe by resolved path. Redaction still applies via redact_obj.
  • System prompt now asks for path:line-range citations when files are present.
  • 9 new unit tests (74 total, all green); ruff clean.

Why

Issue #2 documented a real failure case: cept's audit packet can describe what the agent did but not what's in the file. In a pre-meeting adversarial audit of a research-findings README, three exploitable issues (unsourced statute quotes treated as primary, made-up $5M figure, contingent recommendation treated as confirmed) were invisible to cept until the content was read in context. cept itself diagnosed the blind spot in its blind_spots field. This PR closes that loop without an extra tool round-trip.

Test plan

  • uv run pytest -x -q — 74 passed
  • uv run ruff check src/cept tests — clean
  • Manual: run cept-cli with --file README.md --file CHANGELOG.md --dry-run against a real session and confirm the files block in the packet contains the expected content + truncation metadata
  • Manual: live model call with a known-flawed README and confirm the response cites path:line-range

🤖 Generated with Claude Code

Adds an optional `files` parameter to the cept MCP tool and a repeatable
`--file` flag to cept-cli. Caller-supplied paths are read into the
packet under `files`, keyed by the path the caller passed (so the
model's citations line up with the agent's own context). Caps are 50 KB
per file, 256 KB total, 24 files per call; truncation leaves a marker;
binary files (NUL detected) are skipped with a note; redaction still
applies. When files are present, the system prompt asks the model to
return citations as `path:line-range`.

This closes the gap surfaced in #2: trajectory alone tells the model
*what the agent did*; without file content, "audit this README" can
only critique workflow shape, not content shape, and exploitable
issues (unsourced quotes, made-up figures, contingent recommendations
treated as confirmed) slip through.

Closes #2.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@dshanklin-bv dshanklin-bv merged commit 1d81884 into main Apr 29, 2026
3 checks passed
@dshanklin-bv dshanklin-bv deleted the feat/files-param branch April 29, 2026 18:20
dshanklin-bv added a commit that referenced this pull request Apr 29, 2026
Releases the `files` parameter / `--file` flag added in #3.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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