Skip to content

v3.18.1 — Concurrency & Determinism Fixes

Choose a tag to compare

@noahgift noahgift released this 12 Jun 16:17
· 10 commits to master since this release
7251df4

Concurrency and determinism fixes for multi-agent / parallel-invocation use, found by an adversarially-verified multi-agent audit of 3.18.0. Each fix ships with regression tests.

Fixed

  • pmat record-metric no longer loses historyrecord() previously overwrote <metric>.json with only its own observation. It now reloads under an exclusive fs2 advisory lock (bounded 5s wait), appends, and persists via atomic scratch-then-rename. Torn pre-3.18.1 history files self-heal (moved aside to .json.corrupt).
  • Fixed machine-global temp paths in tdg check-regression, tdg baseline compare, and tdg check-quality — concurrent invocations no longer clobber each other's ephemeral comparison state (PID + per-process-counter unique paths).
  • Deterministic TDG baseline serializationfiles, grade_distribution, languages are now BTreeMaps: sorted keys, byte-stable output across runs and machines. Pre-3.18.1 baselines load unchanged. TdgBaseline::save() is now atomic.
  • tdg baseline create --name is honored — previously accepted and silently discarded; now a persisted label, shown in baseline list --format json and preserved by baseline update.
  • SQLite index save scratch is process-unique — concurrent savers can no longer rename each other's half-built DB into place; crash-orphaned scratch files (50–275 MB) are swept after 1h via the new utils::scratch helper.
  • pmat verify spec drift — removed a fixable field from the spec example that the shipped struct doesn't have.

Validation

  • pmat verify --format jsonok: true (format, complexity, satd, clippy -D warnings, full test suite)
  • 111-command full-CLI dogfood with the release binary: 0 regressions, 0 release blockers
  • End-to-end: 6-way concurrent record-metric with zero lost updates; parallel check-regression with zero scratch leftovers; byte-identical baseline re-creation

Full details: CHANGELOG and pmat-book ch73.

🤖 Generated with Claude Code