T-REME-sdlc-p2-tests
State: closed/done · Impact: medium · Complexity: medium
T-A7PL, T-AD81 and T-XRFD each land their own module-level unit tests as part of
their implementation. This task is the closing pass: verify the four
cross-cutting behaviors the plan calls out explicitly as Phase 2 verification
criteria actually exist and pass together, fill any gap left by the three
implementation tasks, and confirm the whole phase’s test suite is green under
local CI (quality run --trust and just ci).
| Location | Role today |
|---|---|
solutions/ontological/lib/config/workflows.test.ts | workflow resolution tests (from T-A7PL) |
solutions/ontological/lib/services/session/launch.test.ts | headless session-record test (from T-AD81) |
solutions/ontological/lib/services/orchestrator/ticks/*.test.ts | dry-run planning + verdict-mapping tests (from T-XRFD) |
Proposed
Section titled “Proposed”- The four Phase-2 verification criteria from
docs/planning/notes/N-S4AJ-sdlc-0-8-plan.md(“Phase 2” bullet under Verification) each have a passing, clearly-named test:- workflow resolution: default, override, append, prepend (T-A7PL).
- verdict → workflow mapping (T-XRFD’s
prs/mergesticks): each of CLEAN, BEHIND, NEEDS-RESPONSE, CONFLICTS, CI-FAILED, MERGED, CLOSED, ERROR maps to the correct action (including “no action” for CLEAN/BEHIND/CLOSED/ERROR where that’s correct). - each loop’s
--dry-runplanning against fixture PRs, roadmap and tasks (T-XRFD). - a lease double-dispatch test (T-XRFD) and a session-record test with a fake engine binary (T-AD81).
bun solutions/ontological/cli/sdlc.ts quality run --config sdlc.yaml --trustandjust ciboth pass in the worktree.- Any gap found in the above (e.g. a verdict left untested, a fixture missing) is filled here rather than reopening the upstream task.
Approach
Section titled “Approach”- Enumerate the tests T-A7PL, T-AD81 and T-XRFD actually shipped; diff against the four verification criteria above.
- Write fixtures under a shared test-fixtures location (follow existing
conventions — check
lib/services/pr/andlib/services/task/test directories for the repo’s fixture pattern before inventing a new one) for: PR verdict fixtures covering all eight enum values, a roadmap fixture with milestones/tasks in a defined order, and task fixtures at various readiness/status states. - Fill any gap test directly; do not duplicate a test that already exists.
- Run
quality run --trustandjust ci; fix any failures surfaced only at the whole-suite level (cross-module interactions, shared fixture collisions). - Record final pass/fail output in the phase run log
(
.sdlc/runs/p2.md) for the phase-gate review report.
| Area | Note |
|---|---|
solutions/ontological/lib/services/orchestrator/fixtures/ | shared PR/roadmap/task fixtures for dry-run + verdict-mapping tests |
solutions/ontological/lib/services/orchestrator/ticks/prs.verdict-mapping.test.ts | one test per verdict enum value |
solutions/ontological/lib/services/lease/*.double-dispatch.test.ts | two concurrent acquirers, one winner |
.sdlc/runs/p2.md | record local CI results |
Acceptance criteria
Section titled “Acceptance criteria”- AC-1: a single test run (
bun testor the project’s test runner) coveringlib/config/workflows.test.ts,lib/services/session/launch.test.ts, andlib/services/orchestrator/**/*.test.tsis green. - AC-2: every one of the eight
pr classifyverdict values has an explicit assertion of the action (or explicit no-action) it produces in theprsandmergesticks. - AC-3:
bun solutions/ontological/cli/sdlc.ts quality run --config sdlc.yaml --trustexits 0 in the worktree. - AC-4:
just ciexits 0 in the worktree. - AC-5: the lease double-dispatch test fails (red) if the lease-acquire call
is removed from the
worktick’s dispatch path — i.e. it actually exercises the race, not just a mock.
Out of scope
Section titled “Out of scope”- Writing the module implementations under test — that’s T-A7PL, T-AD81, T-XRFD.
- Live/E2E tests against real GitHub — explicitly excluded from Phase 2 per the brief (“Don’t start the loops live against GitHub”).
- The judge/adversarial-review pass itself — that’s the phase gate, not this task.
Dependencies
Section titled “Dependencies”[T-A7PL-sdlc-p2-workflows](/planning/tasks/sdlc-p2-workflows/),[T-AD81-sdlc-p2-session-launch](/planning/tasks/sdlc-p2-session-launch/),[T-XRFD-sdlc-p2-orchestrate-loops](/planning/tasks/sdlc-p2-orchestrate-loops/)— this task closes the loop after all three land their own module tests.
Discovery context
Section titled “Discovery context”Phase 2 of docs/planning/notes/N-S4AJ-sdlc-0-8-plan.md (“Tests” bullet) and the Phase 2
verification criteria in the same document’s “Verification” section.
Depends on
Section titled “Depends on”T-A7PL-sdlc-p2-workflows, T-AD81-sdlc-p2-session-launch, T-XRFD-sdlc-p2-orchestrate-loops