feat(phase0): codify compatibility contracts - #4
Conversation
|
Rework update:
Verification remains green locally: format, warnings-as-errors compile, full tests, and |
Rework summary
Verification:
|
There was a problem hiding this comment.
🟡 Changes recommended
Workflow normalization, Codex event handling, and several normative fixtures currently violate their stated contracts.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Codifies Phase 0 compatibility contracts, fixtures, runtime boundaries, and cross-platform escript verification.
Changes:
- Adds compatibility ADRs, ledger validation, and behavioral fixtures.
- Implements workflow normalization, Codex event handling, tracking, environment, and replay contracts.
- Adds deterministic versioning and CI artifact smoke tests.
File summaries
| File | Description |
|---|---|
workflow.yaml |
Uses fresh Codex sessions. |
Readme.adoc |
Documents Phase 0 verification. |
mix.lock |
Locks new dependencies. |
mix.exs |
Reads the shared version. |
mise.toml |
Pins Codex 0.154.0. |
documents/decisions/0001-phase-0-compatibility-and-provenance.adoc |
Records compatibility provenance. |
documents/decisions/0002-parser-prompt-http-and-tracking.adoc |
Defines parser and tracking contracts. |
documents/decisions/0003-runner-permissions-session-and-lifecycle.adoc |
Defines runner boundaries. |
documents/decisions/0004-continuum-recovery.adoc |
Defines replay authority. |
documents/decisions/0005-distribution-and-release.adoc |
Defines Phase 0 packaging. |
apps/stokowski/test/support/stubborn_process_tree.py |
Provides lifecycle test process tree. |
apps/stokowski/test/stokowski/workflow_test.exs |
Tests workflow normalization. |
apps/stokowski/test/stokowski/runner_tracking_test.exs |
Tests runner and tracking contracts. |
apps/stokowski/test/stokowski/process_lifecycle_test.exs |
Tests POSIX group cleanup. |
apps/stokowski/test/stokowski/phase0_flow_test.exs |
Tests immutable replay. |
apps/stokowski/test/stokowski/compatibility_test.exs |
Tests ledger validation. |
apps/stokowski/test/stokowski/cli_test.exs |
Tests version output. |
apps/stokowski/test/stokowski_test.exs |
Tests application versioning. |
apps/stokowski/test/fixtures/tracking/comments.yaml |
Adds tracking evidence. |
apps/stokowski/test/fixtures/tracking/comments.json |
Adds tracking input data. |
apps/stokowski/test/fixtures/runners/provenance.yaml |
Records Codex provenance. |
apps/stokowski/test/fixtures/runners/process-lifecycle.yaml |
Records cleanup expectations. |
apps/stokowski/test/fixtures/runners/environment.yaml |
Records environment policy. |
apps/stokowski/test/fixtures/runners/distribution.yaml |
Records packaging targets. |
apps/stokowski/test/fixtures/runners/codex.yaml |
Records Codex arguments. |
apps/stokowski/test/fixtures/runners/codex-events.jsonl |
Adds Codex event samples. |
apps/stokowski/test/fixtures/prompts/context.yaml |
Adds prompt context. |
apps/stokowski/test/fixtures/linear/responses.yaml |
Adds Linear response scenarios. |
apps/stokowski/test/fixtures/config/normalized-flow.yaml |
Adds normalized replay input. |
apps/stokowski/test/fixtures/config/full-workflow.yaml |
Adds comprehensive YAML input. |
apps/stokowski/test/fixtures/config/duplicate-keys.yaml |
Adds duplicate-key input. |
apps/stokowski/test/fixtures/compatibility_ledger.yaml |
Indexes compatibility evidence. |
apps/stokowski/mix.exs |
Configures dependencies and escript. |
apps/stokowski/lib/stokowski/workflow.ex |
Implements normalization and fingerprints. |
apps/stokowski/lib/stokowski/tracking.ex |
Parses tracking markers. |
apps/stokowski/lib/stokowski/runner/codex.ex |
Builds argv and normalizes events. |
apps/stokowski/lib/stokowski/phase0_flow.ex |
Implements replay proof. |
apps/stokowski/lib/stokowski/environment.ex |
Builds child environments. |
apps/stokowski/lib/stokowski/compatibility.ex |
Validates the ledger. |
apps/stokowski/lib/stokowski/cli.ex |
Implements the version command. |
apps/stokowski/lib/stokowski.ex |
Exposes the application version. |
apps/repo_management/test/mix/tasks/stokowski_test.exs |
Tests deterministic Codex resolution. |
apps/repo_management/lib/mix/tasks/stokowski.ex |
Verifies the managed Codex executable. |
apps/repo_management/lib/mix/tasks/phase0.verify.ex |
Adds Phase 0 verification. |
AGENTS.md |
Documents verification procedures. |
.version.txt |
Defines the canonical version. |
.gitignore |
Ignores the generated escript. |
.github/workflows/phase0.yaml |
Runs cross-platform Phase 0 CI. |
Review details
- Files reviewed: 46/48 changed files
- Comments generated: 8
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Rework summaryAddressed all eight material review threads in signed commit
Verification completed:
No force-push was used. |
There was a problem hiding this comment.
🟡 Changes recommended
Environment containment remains unenforced, and parsing plus process-readiness edge cases can violate the declared contracts.
Get a fresh assessment by requesting another Copilot review.
Review details
Suppressed comments (2)
Previously missed (2) — in code that hasn't changed since the last review.
apps/stokowski/lib/stokowski/tracking.ex:26
- A marker without an embedded timestamp is accepted using the Linear comment creation time. That contradicts the new contract to validate embedded marker timestamps and lets an incomplete marker participate in recovery ordering. Require
payload["timestamp"]to be present and parseable instead of falling back tocreatedAt.
apps/stokowski/test/support/stubborn_process_tree.py:22 - The PID file is used as a readiness signal, but the child records the grandchild immediately after
Popen, before the grandchild necessarily installs its SIGTERM handler. There is also a race where this append can happen before the session leader opens the same file with"w", truncating the grandchild PID. Initialize the file before spawning and use an explicit readiness acknowledgement from each descendant before the test sends TERM; also register cleanup before waiting so a failed handshake cannot leak the detached tree.
- Files reviewed: 46/48 changed files
- Comments generated: 3
- Review effort level: Balanced
Rework summaryAddressed the three remaining inline comments and both material suppressed findings in signed Fantasia commit
Verification completed:
Both commits are SSH-signed and were pushed without force. |
There was a problem hiding this comment.
🟡 Changes recommended
Ledger validation currently accepts required fields with empty or non-string values.
Get a fresh assessment by requesting another Copilot review.
Review details
- Files reviewed: 46/49 changed files
- Comments generated: 1
- Review effort level: Balanced
# Conflicts: # vendor/stokowski # workflow.yaml
Rework verification — ledger validationThe existing PR branch is aligned locally with head Verification from the PR head:
The PR remains mergeable and no new limitations were introduced. |
Rework summaryAddressed the adversarial review findings on signed commit
Local verification:
The branch was pushed without force-pushing; Ubuntu x86_64 and macOS arm64 checks are queued. |
Rework updateAddressed the latest adversarial review on signed commit
Verification:
|
Summary
b80db05, current Stokowski79fa1bb, Continuum237dfbb, Linear CLI1cc36ff, and Codex 0.154.0 compatibility evidence in validated fixtures and ADRseffort, native session resume, tracking timestamps, environment containment, and POSIX process-group cleanuplcpriority and timestamp output as a deferred contract blocked by EXT-64fantasia versionescript smoke on Linux x86_64 and macOS arm64 CIVerification
mise exec -- mix format --check-formattedmise exec -- mix compile --warnings-as-errorsmise exec -- mix test(35 tests)mise exec -- mix phase0.verifymise exec -- mix stokowski --dry-runArchitecture and deferred work
The Codex module in this Phase 0 spike is provider-protocol characterization, not the production adapter boundary. Production runner and tracker adapters remain governed by the accepted pluggable registry, capability, shared command-owner, and conformance-suite ADRs.
Continuum owns durable workflow history, replay, state-announcement idempotency, and gate recovery after restart. Tracker comments remain durable external signals and legacy reconstruction inputs, not a competing workflow state machine.
Burrito/native standalone packaging, Drafter, publishing, and production process supervision remain follow-up work. Linear CLI priority and stable timestamp metadata is explicitly blocked by EXT-64; Fantasia will not bypass that CLI boundary with a direct Linear client.
Linear: https://linear.app/the-rubyists/issue/EXT-57/fantasia-phase-0-contract-and-distribution-spikes