feat(pi): events.jsonl writer + schema-version gate (Batch 3 Unit 2) - #13
Merged
Conversation
Add packages/pi/src/session/events.zig with NDJSON append for transcript events plus atomic meta.json read/write guarded by a forward-only schema-version check. Zero wiring into the loop yet; Batch 4 will consume these primitives. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
srdjan
force-pushed
the
feat/unit-2-events-jsonl
branch
from
April 20, 2026 13:54
86e3c75 to
4f53bae
Compare
srdjan
added a commit
that referenced
this pull request
Jun 28, 2026
…high #10/#13) Two lower-severity cleanups from the xhigh review: - pool.zig deinit ran an O(n^2) scan of all later slots for a duplicate publication on every shutdown. That case is a poisoned slot table that runtime-safety release() already rejects, so gate the scan behind std.debug.runtime_safety like the sibling poison checks: a release-build pool (esp. a large `-n N`) no longer pays N^2/2 atomic loads to guard an unchecked precondition. - smt_solver tmpQueryPath keyed the query file only on pid, so it was not safe to parallelize the obligation loop (the natural optimization, since the z3 calls dominate runtime): two concurrent solve() calls would clobber one file. Add a monotonic per-call suffix so each query gets a unique path. spec-check --audit green; pool and zigts-cli tests pass. Co-Authored-By: Claude Opus 4.8 (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
packages/pi/src/session/events.zig: NDJSONappendEventwriter for transcript events plus atomicreadMeta/writeMetaguarded by a forward-onlyschema_versioncheck.Plan reference:
/Users/srdjans/.claude/plans/study-the-plan-provided-clever-wadler.md(Batch 3 Unit 2).Test plan
zig build test-expert-appzig build testzig buildprintf 'help\nquit\n' | timeout 10 ./zig-out/bin/zigts expertprints/verifyandRegistered tools:printf '/meta\nquit\n' | timeout 10 ./zig-out/bin/zigts expertprints"compiler_version"Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com