feat: include source-file content in packet (closes #2)#3
Merged
Conversation
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
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
filesparameter to theceptMCP tool and--file(repeatable) tocept-cli.files, keyed by the verbatim path so model citations line up with what the agent sees.cept.filesmodule with caps (50 KB/file, 256 KB total, 24 files), truncation marker, binary-file skip, dedupe by resolved path. Redaction still applies viaredact_obj.path:line-rangecitations when files are present.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
$5Mfigure, contingent recommendation treated as confirmed) were invisible to cept until the content was read in context. cept itself diagnosed the blind spot in itsblind_spotsfield. This PR closes that loop without an extra tool round-trip.Test plan
uv run pytest -x -q— 74 passeduv run ruff check src/cept tests— clean--file README.md --file CHANGELOG.md --dry-runagainst a real session and confirm thefilesblock in the packet contains the expected content + truncation metadatapath:line-range🤖 Generated with Claude Code