feat: support Nextrade app reviews in Firstmate - #53
Merged
Merged
Conversation
…te verification references
…nt-nextrade.test.sh by removing redundant failure exits and using the retry counter in an arithmetic loop. Pinned ShellCheck 0.11.0 and git diff --check pass. Requested regressions all exit 0: Nextrade 12130 ms, procevent 316883 ms, captain-hold lifecycle 413995 ms. Runner: total=3 failed=0 skipped_gate=0; seven Beads capability cases skipped internally. Workspace UI remains untested and deferred to W4
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.
Nextrade’s in-app experiment reviews could not participate in Firstmate’s captain-hold lifecycle because the review adapter supported Lavish boards only.
Without an app adapter, app feedback and answered decisions would not reach the hosting task or release its keyed holds through the shared lifecycle.
This change adds the Nextrade adapter and routes its captured results through the existing inbox, acknowledgement, and captain-hold owners.
Scope: the adapter polls in the hosting task’s target context and may post its staged agent reply; it never answers or consumes an app decision.
Reconciliation and wakes remain owned by the generic runner, and the Lavish adapter remains available for design reviews.
Acceptance covers adapter/stub-server regressions and six live CLI/API scenarios.
The real Workspace-page round (ask a decision through the CLI, answer it on the page, and release the held task through
fm-captain-hold.sh answers) is deferred to the programme W4 acceptance run because slice 2b’s Workspace page is not yet built.Intent
The captain commissioned the in-app research workflows programme for nextrade, which moves the backtester-optimization and strategy-experiment review loops from Lavish boards into the nextrade app, and authorized dispatching each slice without a per-stage ask ("you can begin dispatching the in-app research workflow builds without needing my approval for each stage"), then on 2026-10-01: "please dispatch the builds now and anything that can run in parallel please do so."
This is slice 2d of that plan: the firstmate adapter, so firstmate's captain-hold lifecycle keeps working when a review runs in the app instead of on a Lavish board.
Its dependency, nextrade slice 1b (experiment messages, listener lease, inbox poll: https://github.com/knowttl/nextrade/pull/1111), has landed; slice 1a (decisions and arm verdicts: https://github.com/knowttl/nextrade/pull/1090) has landed too.
What Changed
Risk Assessment
✅ Low: The adapter is bounded, reuses existing lifecycle controls, and matches the pinned Nextrade contracts without a substantiated material defect.
Testing
All three reported current-head automated regressions passed without skips; these do not establish a live scenario result. Six earlier live CLI/API passes from this run are preserved. No implementation changes were made. Workspace UI was not tested and has no visual evidence because slice 2b is unavailable; its W4 deferral is explicitly accepted.
Evidence: Preserved live CLI/API evidence from earlier rounds of this run
Source: Preserved live CLI/API evidence from earlier rounds of this run
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
🔧 **Test** - 2 issues found → auto-fixed → no changes applied ✅
tests/fm-procevent.test.sh:3834- The pre-existing shared-runner test requires an orphan listener's parent to be PID 1. This host correctly reparents orphans to systemd --user, PID 1076, independently confirmed by a process probe. The assertion stops the regression before its remaining lifecycle checks. A private PID-namespace workaround was denied at /proc/self/uid_map. Make the test verify reparenting without assuming PID 1, or run it on a compatible host.bash bin/fm-test-run.sh tests/fm-procevent-nextrade.test.sh tests/fm-captain-hold-lifecycle.test.sh tests/fm-procevent.test.shgit clone --depth 1 https://github.com/knowttl/nextrade.git .test-nextrade-stackWorkspace-local PostgreSQL initialization, startup, and shutdown using extracted PostgreSQL 16.15 binaries..test-nx-py14/bin/python .test-nx-lab/launch.pydriving the installed nextrade-axi CLI, unmodified backend routers, public decision API, and real Firstmate lifecycle commands.python3 ~/.no-mistakes/evidence/01M3W3HY36EH5FBN14VJDPAN4M/reparent-probe.pyunshare --user --map-root-user --pid --fork --mount-proc truegit status --shortafter disposable setup cleanup🔧 Fix applied.
1 warning still open:
Initial round: installed nextrade-axi CLI against disposable PostgreSQL-backed Nextrade experiment, decision, message, and listener routes; evidence retained in nextrade-live.txt.TMPDIR="$PWD/.test-phase-tmp" bash bin/fm-test-run.sh --jobs 1 tests/fm-procevent-nextrade.test.sh tests/fm-procevent.test.sh tests/fm-captain-hold-lifecycle.test.shenv -u TMPDIR bash bin/fm-test-run.sh --jobs 1 tests/fm-captain-hold-lifecycle.test.shRemoved the disposable worktree test directory and confirmed clean git status.🔧 No changes applied.
✅ Re-checked - no issues remain.
git rev-parse HEADconfirmed e0ac78dcf4c79d4464b238e055adb39b153a5cd8.env -u TMPDIR bash bin/fm-test-run.sh tests/fm-procevent-nextrade.test.sh tests/fm-procevent.test.sh tests/fm-captain-hold-lifecycle.test.shexited 0.tests/fm-procevent-nextrade.test.sh: exit=0, duration_ms=13043, gate_skip=false.tests/fm-procevent.test.sh: exit=0, duration_ms=330711, gate_skip=false.tests/fm-captain-hold-lifecycle.test.sh: exit=0, duration_ms=433052, gate_skip=false.Reviewed retainednextrade-live.txtandlive-setup.mdto preserve the six previously passing live CLI/API scenarios.git status --shortconfirmed no working-tree changes after testing.✅ **Document** - passed
✅ No issues found.
🔧 **Lint** - 1 issue found → auto-fixed ✅
🔧 Fix applied.
✅ Re-checked - no issues remain.
✅ **Push** - passed
✅ No issues found.