Skip to content

feat(pi): events.jsonl writer + schema-version gate (Batch 3 Unit 2) - #13

Merged
srdjan merged 1 commit into
mainfrom
feat/unit-2-events-jsonl
Apr 20, 2026
Merged

feat(pi): events.jsonl writer + schema-version gate (Batch 3 Unit 2)#13
srdjan merged 1 commit into
mainfrom
feat/unit-2-events-jsonl

Conversation

@srdjan

@srdjan srdjan commented Apr 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds packages/pi/src/session/events.zig: NDJSON appendEvent writer for transcript events plus atomic readMeta / writeMeta guarded by a forward-only schema_version check.
  • No loop wiring yet — Batch 4 consumes these primitives.

Plan reference: /Users/srdjans/.claude/plans/study-the-plan-provided-clever-wadler.md (Batch 3 Unit 2).

Test plan

  • zig build test-expert-app
  • zig build test
  • zig build
  • printf 'help\nquit\n' | timeout 10 ./zig-out/bin/zigts expert prints /verify and Registered tools:
  • printf '/meta\nquit\n' | timeout 10 ./zig-out/bin/zigts expert prints "compiler_version"

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

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
srdjan force-pushed the feat/unit-2-events-jsonl branch from 86e3c75 to 4f53bae Compare April 20, 2026 13:54
@srdjan
srdjan merged commit 6bee8c9 into main Apr 20, 2026
@srdjan
srdjan deleted the feat/unit-2-events-jsonl branch April 20, 2026 14:00
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>
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