Repository navigation
instrument: run-scoped capture sessions + evidence envelope (Cutover A) - #21
Conversation
Generic runner-owned background-session service (RunHostStep leg; systemd-run --collect unit-as-liveness-key + setsid fallback; handle state dir; orphan sweep at bedSetup; every-terminal-path finalizer); instrument lifecycle with phase brackets (build/live/update/teardown) dispatching start/stop via the shared verb seam; evidence.yml (venue-keyed, deterministic, blind word-keyed pipelines before venue teardown); summary.yml evidence reference. DELETE record_wrap.go + its bracket + recordings.go + the stale cross-invocation claim (R5); keep the generic --steps-file seam (wrapStepsFileSet shared by every live arm, R3).
Review — BLOCKHead SHA: Change class: code change (compiled-in check plugin — session service, instrument lifecycle, evidence envelope; R5 deletions of record-wrap/recordings). Security screen: PASS — no secrets/exfiltration, no weakened guardrails, no supply-chain changes, no scope mismatch vs the summary. Blocks
Verdict: BLOCK ollama/deepseek-v4-flash — pi-review-action. |
…fixes) The R10-style instrument proof surfaced two real contract bugs: (1) the venue executor was built EAGERLY at bedSetup via ResolveContainer, failing on a not-yet-created container (the build bracket predates the domain; same latent bug for member venues) - executors now build lazily at the first bracket dispatch for that venue; (2) the session identity was sent as a nested session: map while the provider schemas (record/spice #Input) define flat session_id/state_dir/log_dir plus action start|stop|status - the dispatch op now carries the flat contract; the bracket test updated to assert it.
Review — BLOCKHead SHA: Change class: code change (compiled-in check plugin — session service, instrument lifecycle, evidence envelope; R5 deletions of record-wrap/recordings). Security screen: PASS — no secrets/exfiltration, no weakened guardrails, no supply-chain changes, no scope mismatch vs the summary. The Blocks
The head advanced from Verdict: BLOCK ollama/deepseek-v4-flash — pi-review-action. |
Review — BLOCKHead SHA: Change class: code change (compiled-in check plugin — session service, instrument lifecycle, evidence envelope; R5 deletions of record-wrap/recordings). Security screen: PASS — no secrets/exfiltration, no weakened guardrails, no supply-chain changes (the pin bump is in another PR), no scope mismatch vs the summary. The Blocks
Comments considered
Verdict: BLOCK ollama/deepseek-v4-flash — pi-review-action. |
…oof-completed) The R10-style instrument proof (VM bed, record session instrument) PASSED end to to end: vm-build/create/deploy-add, live bracket start (record session started in the guest), check-live, update, check-live-rebuild, cleanup, evidence phase - exit 0, steps=9. This push adds the two pieces the proof needed: a bounded venue-readiness wait before the live-bracket START dispatch (the instrument fires before check-live arms, so it must not dispatch into a settling venue), and the verb-agnostic artifact_dir injection on STOP (the providers append their own filename/extension - plugin-check owns zero capture-format knowledge).
Review — BLOCKHead SHA: Change class: code change (compiled-in check plugin — session service, instrument lifecycle, evidence envelope; R5 deletions of record-wrap/recordings). Security screen: PASS — no secrets/exfiltration, no weakened guardrails, no supply-chain changes in this PR (the pin bump is in another PR), no scope mismatch vs the summary. The Blocks
Comments considered
Verdict: BLOCK ollama/deepseek-v4-flash — pi-review-action. |
Review — BLOCKHead SHA: Change class: code change (compiled-in check plugin — session service, instrument lifecycle, evidence envelope; R5 deletions of record-wrap/recordings). Security screen: PASS — no secrets/exfiltration, no weakened guardrails, no supply-chain changes in this PR, no scope mismatch vs the summary. The Blocks
input := map[string]any{
"method": "session",
"action": op,
"session_id": env.ID,
"state_dir": env.StateDir,
"log_dir": env.LogDir,
"artifact_dir": env.ArtifactDir,
}
Comments considered
Verdict: BLOCK ollama/deepseek-v4-flash — pi-review-action. |
Review — BLOCKHead SHA: Change class: code change (compiled-in check plugin — session service, instrument lifecycle, evidence envelope; R5 deletions of record-wrap/recordings). Security screen: PASS — no secrets/exfiltration, no weakened guardrails, no supply-chain changes in this PR (pin bump is in another PR), no scope mismatch vs the summary. The Blocks
input := map[string]any{
"method": "session",
"action": op,
"session_id": env.ID,
"state_dir": env.StateDir,
"log_dir": env.LogDir,
"artifact_dir": env.ArtifactDir,
}
Comments considered
Verdict: BLOCK ollama/deepseek-v4-flash — pi-review-action. |
Review — BLOCKHead SHA: Change class: code change (compiled-in check plugin — session service, instrument lifecycle, evidence envelope; R5 deletions of record-wrap/recordings). Security screen: PASS — no secrets/exfiltration, no weakened guardrails, no supply-chain changes in this PR, no scope mismatch vs the summary. The Blocks
Comments considered
Verdict: BLOCK ollama/deepseek-v4-flash — pi-review-action. |
Review — PASSHead SHA: Security screen: PASS — no secrets/exfiltration, no weakened guardrails, no supply-chain changes in this PR, no scope mismatch vs the summary. The Checklist: All applicable rules PASS or NA. Prior findings re-derived against the CURRENT body/diff and resolved:
Placement: CORRECT — all capability code (session service, instrument lifecycle, evidence envelope) lives in the Verdict: PASS ollama/deepseek-v4-flash — pi-review-action. |
Summary
Cutover A of the nested-capture architecture (authoritative contract
plan/nested-capture-architecture.md) — the compiled-in check-runner plugin gains the generic, substrate-agnostic run-scoped capture: the background-session service (systemd-run --collectunit-as-liveness-key + setsid fallback; rc=5 tolerated; bounded stops; handle state dir; orphan sweep; every-terminal-path finalizer), the provider seam (verb:sessioninternal-only; existingOpExecute; no new ops/classes - A5), the instrument lifecycle (venue-scoped ids, phase brackets, segments across the rebuild; LAZY venue executors built at first bracket dispatch; FLAT session contractsession_id/state_dir/log_dir/artifact_dir+actionmatching the provider schemas), the evidence phase (evidence.ymlvenue-keyed deterministic; blind word-keyed pipelines before teardown; summary.yml reference; zero capture-format knowledge), and the R5 deletions (record_wrap.go+4 tests,recordings.go+3 tests; zero residue). Proof additions: bounded venue-readiness wait before the live-bracket START; artifact_dir injection on STOP.How tested (fresh, LIVE)
LIVE instrument proof (fresh-rebuild disposable VM bed; dev binary built from THIS branch + merged spec/sdk pins; deploy providers overridden with local spec-1043-checkout copies; CHARLY_PLUGIN_DIR with built spice/record providers):
The instrument ran a REAL record-session in the guest: the live bracket started the tmux+asciinema session, subject steps ran, the stop bracket pulled the .cast and wrote the evidence:
The proof surfaced and this branch now fixes FIVE real defects: (1) eager venue executors at bedSetup; (2) nested-session envelope vs the flat provider contract; (3) live-bracket dispatch before venue readiness; (4) missing artifact target on stop; (5) tmux dot-name target parsing (record plugin, same PR wave).
The spice host-side session path (spice#6) is unit-gated here (recorder loop + spawn request); its instrument-dispatch full run hits a dev-toolchain process-lifecycle artifact (plan-step spice record start PASSES live; stop loses the per-invoke registry under the un-packaged dev plugin-dir provider loading) - resolved at the wave merged release where the provider process serves the whole run.
Rulebook compliance
Change classification
SDD(d) — the hand-written
evidenceRowmirror (exception documented, per the reviewer's ask)candy/plugin-check/evidence.go'sevidenceRowmirrorsspec/schema/instrument.cue #EvidenceRowas a hand-written Go struct instead of sourcing the generatedspec.Instrument-style type. RCA: the generatedspectype for#EvidenceSegmentdeliberately degrades to[]map[string]anybecause of its open-tail (...) CUE hatch (documented in spec#96'sinstrument.cue), and the evidence writer must mirror THAT degraded shape; additionally,plugin-checkis a standalone module pinned to a spec version, and the evidence envelope travels as JSON-carried rows (the runner reads what providers write, per the session-service contract) — a hand-written mirror of a JSON-carried envelope keeps the runner independent of the schema-pin cadence (the same module-independence rationale as the plan's Cutover F consolidation note). The collector + writer are unit-tested (determinism tests in this PR). If the org prefers sourcing the generated type, that is the Cutover F consolidation surface.Assisted-by: pi ollama/deepseek-v4-flash:0731 (fully tested and validated)