Repository navigation
Conversation
Issue #1182: a sealed stage's arguments_sha256 is kept in ledger.json, but the tool-call bytes it covers live only in the conversation, which compaction under context_budget can drop. A later audit then cannot reproduce the match. Write the exact bytes the digest covers to arguments/<arguments_sha256>.json beside ledger.json, under the same lock, owner-only permissions, O_NOFOLLOW, and temporary-then-rename write. The file holds serde_json::to_vec bytes of the call's asked arguments (expected_revision removed), so sha256(file) equals arguments_sha256. Only a sealed commit writes it; a call carrying a registered secret value withholds the bytes and keeps only the digest and a withheld mark. A file is written once and never removed. 判断: 提案1のみを実装し、run_trace.rs と musubi-ca-pack 側の追従は Non-goals どおり変えない。 判断: 本文の「秘密はユーザー確認中」に対し既定案(登録済み秘密検出時は bytes を書かず digest と withheld のみ)を採った。 Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
Issue #1182 review (blocker): record_commit_archiving sealed in ledger.json first and wrote the argument file second, so a failed file write left a sealed record on disk with no file for its arguments_sha256. Resume would not write it, and the failure sat outside apply so StageLedger::failed stayed clear. Decide the commit on a copy of the machine, write arguments/<digest>.json under the same lock only when the decision is Sealed, and only then persist the record. A failed write ends the call without recording the seal, and the ledger keeps no state it cannot vouch for. A commit that does not seal leaves a file nothing refers to; a later call with the same digest reuses it (write-once), so no seal exists without its file. Also make an existing arguments directory owner-only (0700) on write, and align the docs with the actual order. Tests: a_failed_argument_write_leaves_no_sealed_record (arguments turned into a plain file between turns: the failed call is not sealed), and a unit test that an existing directory with another mode is corrected. Each fails on the previous order and passes now. Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
6 tasks
Kewton
deleted the
feature/issue-1182-persist-immutable-committed-tool-call-arguments
branch
December 1, 2026 16:15
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.
Refs #1182 (close by hand after merge; this PR targets develop).
Summary
src/planner/structured_stages/argument_archive.rs.{"arguments_sha256":…,"withheld":true}is kept, as the user decided (option A, 2026-12-01). No cleanup mechanism is added.loop_run.rsandrunner.rsare untouched, and no guardrail baseline is raised.docs/dev/structured-stages.mddescribes where the files go, what they hold, the withheld form and the no-delete rule.Verification
commandmate verifyrun 835 on 0d67ed9: exit 0, 17 gates pass.🤖 Generated with Claude Code