Skip to content

feat(pi): replay-mode flag on RunOptions (Batch 3 Unit 3) - #12

Merged
srdjan merged 1 commit into
mainfrom
feat/unit-3-replay-mode
Apr 20, 2026
Merged

feat(pi): replay-mode flag on RunOptions (Batch 3 Unit 3)#12
srdjan merged 1 commit into
mainfrom
feat/unit-3-replay-mode

Conversation

@srdjan

@srdjan srdjan commented Apr 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add replay_mode: bool = false to loop.RunOptions.
  • When replay_mode is true, a verified apply_edit skips both the approval callback and applyPreparedEdit; the proof card still flows through the transcript. This unblocks Batch 4 replay/resume code that reconstructs transcripts from events.jsonl without re-applying edits against a possibly-diverged workspace.
  • Plan reference: /Users/srdjans/.claude/plans/study-the-plan-provided-clever-wadler.md (Batch 3 Unit 3).

Test plan

  • zig build test-expert-app
  • zig build test
  • zig build
  • printf 'help\nquit\n' | timeout 10 ./zig-out/bin/zigts expert — stdout contains /verify and Registered tools:
  • printf '/meta\nquit\n' | timeout 10 ./zig-out/bin/zigts expert — stdout contains compiler_version
  • New tests: replay_mode skips filesystem write; replay_mode skips approval callback; replay_mode off preserves existing write behavior.

🤖 Generated with Claude Code

Add replay_mode: bool = false to loop.RunOptions. When set, a verified
apply_edit skips both the approval callback and applyPreparedEdit, but
still emits the proof_card transcript entry. This lets future replay/
resume code reconstruct transcripts from events.jsonl without writing
edits back against a possibly-diverged workspace.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@srdjan
srdjan merged commit 017b4ab into main Apr 20, 2026
@srdjan
srdjan deleted the feat/unit-3-replay-mode branch April 20, 2026 13:51
srdjan added a commit that referenced this pull request Jul 12, 2026
#10 Cap a tool_result body at 32 KB before it enters the transcript, with a
marker pointing the model at a workspace_read_file range re-read. A single large
output (a full-file read, a long diagnostic blob) no longer inflates the input
token count of every subsequent roundtrip in the turn.

#12 Auto-compact after each RPC turn, mirroring the interactive REPL, so a
long-lived IDE session on the RPC surface never dead-ends on a PromptTooLong the
machine client cannot resolve with /compact. A notification is emitted when
compaction fires.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
srdjan added a commit that referenced this pull request Jul 13, 2026
Move the eight post-v0.17.0 expert commits (#1-#12) into a new [0.18.0]
CHANGELOG section and bump the version in lockstep: build.zig.zon and
root.zig's major/minor/string (release.yml enforces tag == zon == root).

The engine, runtime, and analyzer contract are unchanged from 0.17.0 (same
policy hash and semantics hash); 0.18.0 is purely the `zigttp expert` loop -
Sonnet default, model-aware output budget + truncation detection, surfaced
Cost Contracts + comptime property drift gate, tool_result byte cap + RPC
auto-compact, OpenAI honest demotion, transcript-fidelity retry, and the
`zigttp ledger stats` subcommand.

Refresh the version-pinned test assertions that read the live version
(root version test, expert persona/meta) and the self-contained fixtures
that carried a stale 0.17.0 (capsule manifest sample, release-doctor
fixture, meta golden illustrative value).

Co-Authored-By: Claude Opus 4.8 (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