feat(adapters): opencode dev/review synthesis parity (Phase 4)#166
Merged
Conversation
OpencodeDevAdapter composes _DevSynthesisMixin over OpencodeHttpAdapter, so hookless dev/review sessions run the real bmad-dev-auto loop: terminal- spec synthesis via devcontract, stories-mode id-keyed resolve, DW bundles, plan-halt, and the #61 post-kill rescue — all mixin-shared with GenericDevAdapter, never duplicated. - _probe_alive = poll() on a per-task Popen stash kept past kill(): the kill pops the _ServerSession registry before _post_kill_reconcile runs, and the retained handle answers liveness truthfully (never unknown). - _make_adapters: synthesizing hookless roles dispatch OpencodeDevAdapter (paths= wired); the temporary Phase 3 SystemExit guard is gone, and cmd_validate's mirroring FAIL goes with it. - FakeOpencode grows a spec-write mechanic (FAKE_OPENCODE_SPEC_PATH/_TEXT, no-op when unset); dev E2E covers terminal-spec synthesis, stories mode, and the timeout->rescue path, plus unit pins for the dev knobs, the never-None probe, and the result.json-shadowing MRO.
Collaborator
Author
|
@CodeRabbit review |
Action performedReview triggered.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 4 of the opencode-http adapter plan (#163 → #164 → #165 → this): hookless dev/review roles now run the real bmad-dev-auto loop over HTTP/SSE.
What
OpencodeDevAdapter(_DevSynthesisMixin, OpencodeHttpAdapter)— the Phase 2 synthesis mixin composed over the Phase 3 transport,paths=kwarg +_configure_dev_knobs(), mirroringGenericDevAdapter. Terminal-spec synthesis, stories mode, DW bundles, plan-halt, and the Hardening: reconcile seam is unreachable for stalled sessions — a finished-but-lost-Stop session cannot be recovered as completed #61 post-kill rescue all arrive via the mixin unchanged (no fork of the synthesis logic;devcontract.pyandgeneric.pyuntouched)._probe_alive(the one seam the host must implement) =poll()on a per-taskPopenstash populated instart_sessionand kept pastkill()— the kill pops the_ServerSessionregistry before_post_kill_reconcileruns, and the retained handle answers liveness truthfully: neverNone(no probe that can hang),Truewhen a force-kill-surviving process means the live-server invariant still applies._result_json(spec synthesis) deliberately shadows the core adapter's result.json read-back — the dev skill writes no result.json, and a unit test pins that._make_adapters: synthesizing hookless roles constructOpencodeDevAdapter(shared per(cfg, synthesizes)key); the temporary Phase 3SystemExitguard is deleted, andcmd_validate's mirroring FAIL (added in feat(adapters): core opencode-http adapter over HTTP/SSE (Phase 3) #165's review round to match the guard) is removed with it.Tests
FakeOpencode gains a spec-write mechanic (
FAKE_OPENCODE_SPEC_PATH/_SPEC_TEXT, no-op when unset — existing scenarios byte-compatible). New coverage:status: done+## Auto Run Resultspec → synthesized dict matches devcontract (auto-dev,baseline_commit,story_key), usage captured, template-rendered prompt, clean teardown, and noFAKE_OPENCODE_RESULT_PATHset — proving dev never leans on result.json.BMAD_LOOP_SPEC_FOLDERid-keyed resolve with the mtime scan monkeypatched to raise.timeoutunder a live server → run()'s kill settles liveness → rescuedcompletedwithpost_kill_reconciled: true.Noneprobe tri-state, result.json-shadowing MRO pin.test_cli.py: guard tests flipped to their post-Phase-4 counterparts (dispatch + validate-passes).All tests bind 127.0.0.1 and reuse the Phase 3 Windows-safe harness mechanics. CHANGELOG deferred to Phase 5 by plan design.
Verification
trunk fmt(black) + fulltrunk check(no filter): clean