feat(workflow): ground blocker transitions - #68
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The reconciliation helper has a confirmed logic mismatch (conflict detection vs Object.is decision semantics) and a likely ineffective context-digest stale-check that should be resolved to keep the experiment’s results trustworthy.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds a provider-neutral, test-only “claim/observe/decide” reconciliation experiment around workflow blocker handling, and exercises the real LoopStore.transitionWorkflow CAS path while asserting file-backed LoopStore/TaskStore byte stability. This fits into the codebase’s workflow contract validation by probing reconciliation edge-cases without changing production code.
Changes:
- Introduces a new test-only reconciliation helper (
reconcileClaim+attemptClaimedTransition) for claimed blocker admission. - Adds a Vitest suite covering contradiction, authority scoping, monitor-shaped facts, abstention/errors/conflicts, expiry/context mismatch, malformed provenance, competing transitions, and admin pause distinction.
File summaries
| File | Description |
|---|---|
| test/experiments/blocker-reconciliation-experiment.ts | Adds the test-only reconciliation types and logic, plus a helper that gates actual LoopStore.transitionWorkflow via a confirmed claim. |
| test/blocker-reconciliation-experiment.test.ts | Adds end-to-end tests that drive the experiment and assert CAS behavior plus on-disk byte preservation. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Refinement complete at |
Summary
Convert the blocker-reconciliation experiment into production workflow transition admission.
pausedterminal stateLoopStorelockstatus,exitCode, andstopReason; raw output is never evidenceThe original test-only helper and experiment suite were removed after their replay, conflict, expiry/error, authority, byte-preservation, race, and restart cases were ported to production tests.
Trust and authority boundaries
WorkflowTransitionsnapshots workflow/state/revision/execution plus an independently sourced workspace context.LoopStore/workflow reducer rejects any paused-terminal mutation without a valid bounded admission receipt.Admission verifies an exact fact, not whether that fact should be policy. The workflow author's declared edge remains the policy boundary. Machine evidence never grants user consent or authority.
Pause provenance
New pauses record one of:
semantic_terminaladministrativecontroller_limitorchestration_settlementLegacy paused snapshots remain valid and may be unattributed. Malformed new pause/admission provenance fails closed during load.
LoopListdisplays available cause and admission details.Review hardening
Addressed the earlier Copilot findings:
Object.is, including0versus-0A separate adversarial implementation review found and fixed:
Validation
npm run lint— four established optional-chain warnings onlynpm run typechecknpm test— 51 files, 792 testsnpm run buildnpm run test:package— 112 filesnpm audit --audit-level=moderate— 0 vulnerabilitiesgit diff --checkPI_LOOP_LIVE_MODELRemaining limits
Closes no issue automatically; keep open for review until current Linux, Windows, and CodeQL checks settle.