Repository navigation
feat(handoff): brief, repo evidence, --verify, redaction, c0mpute target - #602
Merged
Merged
Conversation
`moshcode handoff` used to hand the next engine a pointer to up to 200 raw messages. It now writes a brief first (~/.moshcode/handoffs/<id>.md), built without a model inside --budget tokens (4000), with every fact tagged by where it came from: [user], [agent-reported], [observed], [inferred]. - git evidence: branch, uncommitted changes, diffstat, commits since the session started - --verify [auto|none] / --verify="<cmd>": runs the project's own typecheck/lint/test with no shell and records the real exit codes; failure lines are kept even when a suite's output overflows the capture - secrets are redacted from every carried message and check output, always - `moshcode handoff <engine> c0mpute` hands off to the c0mpute agent in process, with the brief as its first turn (warns that peers read prompts) - c0agent REPL submits a command-line prompt as its first turn; `--` ends flags - portable transcript 0.2: optional redactions, evidence, checks - MCP moshcode_handoff takes budget and verify Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
||
| test("redaction removes the common secret shapes and says which", () => { | ||
| const secrets = [ | ||
| "sk-ant-api03-abcdefghijklmnopqrstuvwxyz0123", |
|
|
||
| test("redaction removes the common secret shapes and says which", () => { | ||
| const secrets = [ | ||
| "sk-ant-api03-abcdefghijklmnopqrstuvwxyz0123", |
| test("redaction removes the common secret shapes and says which", () => { | ||
| const secrets = [ | ||
| "sk-ant-api03-abcdefghijklmnopqrstuvwxyz0123", | ||
| "sk-proj-abcdefghijklmnopqrstuvwxyz012345", |
| const secrets = [ | ||
| "sk-ant-api03-abcdefghijklmnopqrstuvwxyz0123", | ||
| "sk-proj-abcdefghijklmnopqrstuvwxyz012345", | ||
| "ghp_abcdefghijklmnopqrstuvwxyz0123456789", |
| "sk-ant-api03-abcdefghijklmnopqrstuvwxyz0123", | ||
| "sk-proj-abcdefghijklmnopqrstuvwxyz012345", | ||
| "ghp_abcdefghijklmnopqrstuvwxyz0123456789", | ||
| "AKIAIOSFODNN7EXAMPLE", |
| const text = [ | ||
| ...secrets.map((s) => `token ${s} here`), | ||
| "curl -H 'Authorization: Bearer abcdefghijklmnopqrstuvwxyz012345' https://api", | ||
| "DATABASE_URL=postgres://app:hunter2hunter2@db:5432/app", |
| "curl -H 'Authorization: Bearer abcdefghijklmnopqrstuvwxyz012345' https://api", | ||
| "DATABASE_URL=postgres://app:hunter2hunter2@db:5432/app", | ||
| "OPENAI_API_KEY=notarealkeybutlongenough", | ||
| "-----BEGIN OPENSSH PRIVATE KEY-----\nb3BlbnNzaC1rZXktdjEAAAA\n-----END OPENSSH PRIVATE KEY-----", |
| test("the transcript is redacted and counts what it removed", () => { | ||
| const doc = buildTranscript({ | ||
| engine: "claude", id: "x", cwd: CWD, start: 0, end: 1, changes: [], | ||
| messages: [{ role: "user", text: "use GITHUB_TOKEN=ghp_abcdefghijklmnopqrstuvwxyz0123456789", at: 0 }], |
| try { | ||
| const results = await runChecks([ | ||
| { label: "ok", bin: process.execPath, args: ["-e", "process.exit(0)"] }, | ||
| { label: "bad", bin: process.execPath, args: ["-e", "console.log('leaked sk-ant-api03-abcdefghijklmnopqrstuvwxyz0123'); process.exit(3)"] }, |
| try { | ||
| const results = await runChecks([ | ||
| { label: "ok", bin: process.execPath, args: ["-e", "process.exit(0)"] }, | ||
| { label: "bad", bin: process.execPath, args: ["-e", "console.log('leaked sk-ant-api03-abcdefghijklmnopqrstuvwxyz0123'); process.exit(3)"] }, |
ThreatCrush Security Scan20 finding(s) in the 11 file(s) this pull request changes. MEDIUM: 9 | LOW: 11
105 pre-existing finding(s) elsewhere in the repository — **HIGH/CRITICAL**: 8 | **MEDIUM**: 78 | **LOW**: 19Not introduced by this pull request. The full set is in the Security tab.
…and 85 more. Full results in the Security tab. Snippets are redacted; ThreatCrush never prints matched credential material. |
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.
Brings the useful parts of Relayvora (agent-to-agent work handoff) into
moshcode handoff, which already had the reading and launching half.What changes
~/.moshcode/handoffs/<id>.md, a short brief built without a model inside--budgettokens (default 4000), instead of opening with up to 200 raw messages. Every fact is tagged:[user](goal and recent requests, quoted),[agent-reported](the previous engine's last report),[observed](repo state, check exit codes),[inferred](e.g. "failing checks come first"). The full transcript stays alongside it as the record.--verify: runs the project's own typecheck/lint/test (package.json scripts by lockfile's package manager, Cargo, Go, ormake test) with no shell and records the real exit codes.--verify="<cmd>"runs a specific command. Failure lines (not ok,FAIL,Error:and similar) are captured as the output streams, so they survive a suite whose output overflows the 256 KB tail.*_SECRET=/*_TOKEN=style assignments are replaced with[redacted:<kind>]in every message and every check output.moshcode handoff <engine> c0mpute: hands off to the c0mpute agent in process, with the brief as its first turn (no argv limit, so no extra read-tool round trip on a CPU node). It prints a warning that c0mpute peers read prompts. The c0agent REPL now actually submits a command-line[prompt]as its first turn, as its usage already said, and--ends flags.redactions,evidenceandchecksfields (documented). MCPmoshcode_handofftakesbudgetandverify.Briefs are deliberately not written by c0mpute: job prompts are gossiped to peers, and a transcript is private code conversation.
Tested
test/handoff-brief.test.mjs(new): redaction shapes and prose left alone, check detection, real exit codes, early failures surviving output overflow, evidence on a real temp repo, brief tags and budget clamp, the 0600 brief, the c0mpute in-process launch.apps/pwacoinpay-checkout and ring-footer also fail on a cleanorigin/main.dns start closes the parking serveris flaky alone (1 of 3 runs) and does not touch this code.moshcode handoff claude codex --verifyread a live Claude session and wrote a ~585-token brief. It named the two real failing tests, listed the 10 uncommitted files, and pointed the codex seed at the brief.🤖 Generated with Claude Code