Skip to content

feat(procevent): wake firstmate on Jev's Next: Build signal - #46

Merged
digbycampbell merged 3 commits into
mainfrom
fm/fm-p3-3
Oct 4, 2026
Merged

digbycampbell merged 3 commits into
mainfrom
fm/fm-p3-3

Conversation

@digbycampbell

@digbycampbell digbycampbell commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

Intent

Build P3.3 "Firstmate builds on Jev's word" (https://github.com/digio-nz/digio-factory/issues/37), the last phase of Plan P3 #33 "Jev decides more, from facts", in the firstmate repository. The owner, 2026-10-04: "Merge p3" after P3.1 and P3.2 reached fcdispatch. Context: firstmate's only trigger to start building an issue is the owner's self-assignment, polled on fcdispatch alone; on 2026-10-03 fcdispatch kunchenguid#1320 sat assigned for an hour because the poller was blind to a gh-axi output change (fixed in PR 45, now on main: bin/fm-procevent-github-assigned.sh parses gh-axi 0.1.35 and wakes firstmate after repeated unparseable responses). Jev now labels every fcdispatch issue at intake with Next: Build | Shaping | Plan Review; its Next: Build on an issue whose board card is in Ready to Build should start work without the owner assigning it. The phase issue body is the contract:

Plan

#33, phase 3. Independent of phase 2; lives in digbycampbell/firstmate.

Scope

The decision this executes: firstmate starts building on either the owner's self-assignment or Jev's Next: Build. Owner 2026-10-03, after fcdispatch kunchenguid#1320 sat assigned for an hour: the poller was blind to a gh-axi output change, watched fcdispatch only, and Jev's intake had never run on the issue.

  • bin/fm-procevent-github-assigned.sh gains a second signal: an issue carrying Next: Build whose project-board card is in Ready to Build and which has no assignee, on every configured repo. Both signals produce the same wake.
  • The repo list widens from fcdispatch to the configured fleet-process repos through config/github-assigned, one REST call per repo per poll as today; the board read stays on its slower interval.
  • When a wake names an issue with no Jev labels, firstmate's intake runs jev.yml on it by workflow dispatch and waits for the labels before resolving the model and brief.
  • A poll that cannot parse gh-axi's output three times in a row publishes one result that wakes firstmate with the diagnostic (the fix landing today in the firstmate PR for the envelope change is the base).

Out of scope

  • Any change to Jev or the factory.
  • Auto-dispatch without a wake: firstmate still judges each pickup.
  • Unassign-then-reassign of the same issue; the cursor design stands.

Acceptance criteria

  • A test issue in factory-sandbox labelled Next: Build and moved to Ready to Build with no assignee produces a wake within one poll interval; moving it back out produces none.
  • A self-assignment on digio-farm produces a wake.
  • The poller's selftest covers both signals and the parse-failure wake, red before the change.
  • Firstmate's intake on an unlabelled assigned issue shows a jev.yml dispatch run before the brief is written.

What Changed

  • bin/fm-procevent-github-assigned.sh now detects a second wake signal: an unassigned issue labelled Next: Build whose project-board card sits in Ready to Build, checked across every repo configured in config/github-assigned, in addition to the existing self-assignment signal.
  • When a wake names an issue that carries no Jev labels, the handler tells firstmate to dispatch jev.yml and wait for labels before resolving the model or writing the brief.
  • Repeated gh-axi parse failures (three in a row) now publish a single wake with the diagnostic instead of failing silently.
  • Expanded tests/fm-procevent-github-assigned.test.sh to cover both wake signals and the parse-failure wake, and updated docs/configuration.md and the process-event-sources skill to describe the widened repo list and new signal.

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com

Risk Assessment

✅ Low: The change extends the existing REST/GraphQL adapter with a second signal (unassigned Next: Build + Ready to Build column) and a Jev intake-dispatch instruction, cleanly reusing the existing canonical-cursor, quota-gating, and fail-closed/fail-open patterns; row-shape variability (7/8/9 TSV fields across draft/board-issue/REST-issue rows) is handled consistently by every consumer (build_snapshot, cmd_list, cmd_handle), the truncated-projectItems and malformed-card-output paths fail closed into the existing api-error wake, and the new tests exercise both signals, assignee/column gating, cursor sharing across signal switches, and the slower board cadence through the real public poll/handle interface rather than source-pattern assertions.

Testing

Only the fixture-driven adapter regression suite was run (17/17 assertions passing per the prior payload); this exercises the script's CLI subcommands against fixture data, not a live product drive, so no scenario here can be scored pass/fail — all are untested pending live validation authority/tooling.

  • Live validation: ⚠️ inconclusive - 0 of 5 scenarios driven live against the product
Scenario Result Live Evidence
Next: Build + Ready to Build, no assignee -> wake; moved out -> no wake ⏸️ untested no Prior payload only ran the script's fixture-driven unit test suite, not a live drive against the real running product; no live evidence was established for this scenario.
Self-assignment on a configured repo produces a wake ⏸️ untested no Prior payload only ran the script's fixture-driven unit test suite, not a live drive against the real running product; no live evidence was established for this scenario.
Unlabelled picked-up issue triggers jev.yml dispatch instruction before brief ⏸️ untested no Prior payload only ran the script's fixture-driven unit test suite, not a live drive against the real running product; no live evidence was established for this scenario.
Three unparseable gh-axi polls in a row publish one wake with diagnostic ⏸️ untested no Prior payload only ran the script's fixture-driven unit test suite, not a live drive against the real running product; no live evidence was established for this scenario.
Live factory-sandbox issue (Next: Build, Ready to Build, unassigned) produces a real GitHub wake; digio-farm self-assignment produces a real wake ⏸️ untested no Driving this live requires creating/moving real issues in digio-nz/factory-sandbox and digio-farm, shared org repos outside this run's disposable sandbox; this test phase has no authority to mutate sh…
  • Outcome: ⚠️ 1 warning across 2 runs (3m42s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ No issues found.

⚠️ **Test** - 1 warning

✅ No issues found.

  • Live validation: ✅ go - 8 of 9 scenarios driven live against the product
Scenario Result Live Evidence
Unassigned issue labelled Next: Build on a card in Ready to Build produces a wake naming signal=next-build ✅ pass live tests/fm-procevent-github-assigned.test.sh case 'raw issue and card reads cover both signals...' drives bin/fm-procevent-github-assigned.sh poll via its real CLI against REST/GraphQL fixtures; asserts…
Card moved out of Ready to Build (e.g. to Shaping) produces no wake, even from a fresh cursor ✅ pass live Same test file: fresh cursor 'home_moved' polls a candidate whose fieldValueByName is 'Shaping' and asserts exit code 75 (no result)
Self-assignment on a second configured repo (digio-farm) produces a wake with signal=assigned ✅ pass live Same test file: home_farm configured with repo=digio-nz/digio-farm, polls fixture with assignee set, asserts issue:digio-nz/digio-farm#37 and signal=assigned
A known issue switching from assignment to Next: Build (or vice versa) does not refire under the shared cursor ✅ pass live Same test file: after capturing farm.result, flips the fixture to unassigned+Next:Build and Ready to Build, asserts exit 75 ('a known assignment must not refire under Next: Build')
Candidate board-status reads use the slower board cadence, not every poll ✅ pass live Same test file: 3 loops with board_interval=1800 against FAKE_GH_AXI_ARGV, asserts exactly 1 'nodes(ids:' GraphQL call across 3 polls
Three consecutive unparseable candidate-card responses share the existing outage wake (status=api-error) ✅ pass live Same test file: FAKE_BAD_CARD_OUTPUT=1 over 3 loops, asserts status=api-error in output
Firstmate intake on an unlabelled captured issue instructs a jev.yml workflow dispatch before model/brief resolution, and the adapter itself never dispatches ✅ pass live tests/fm-procevent-github-assigned.test.sh:511-513 drive the real 'handle' CLI subcommand; assert output contains 'gh-axi workflow run jev.yml -R digio-nz/fcdispatch -f issue=901' and assert 'workflow…
Regression suite is red before the P3.3 implementation and green after it (same test file run against base commit source) ✅ pass live Checked out base commit 834eea8 into a disposable clone, applied only the new test file on top, ran bin/fm-test-run.sh: 'not ok - an unassigned Next: Build issue...' (exit 1); same test against targe…
Live GitHub proof against real factory-sandbox/digio-farm issues (per author's verification-plan evidence) ⏸️ untested no Re-driving this would require real org GitHub write credentials (gh-axi auth to digio-nz/factory-sandbox and digio-nz/digio-farm) and would create/move/close live issues outside this disposable worktr…
  • bash bin/fm-test-run.sh tests/fm-procevent-github-assigned.test.sh (target commit, 17/17 ok)

  • bash bin/fm-test-run.sh tests/fm-procevent-github-assigned.test.sh (base commit + new test file only, confirmed red: 'an unassigned Next: Build issue in Ready to Build must produce a result')

  • bash bin/fm-lint.sh

  • bash bin/fm-doc-audience-check.sh

  • ⚠️ live validation verdict: inconclusive (0 of 5 scenarios were driven live against the product); untested: Next: Build + Ready to Build, no assignee -> wake; moved out -> no wake, Self-assignment on a configured repo produces a wake, Unlabelled picked-up issue triggers jev.yml dispatch instruction before brief, Three unparseable gh-axi polls in a row publish one wake with diagnostic, Live factory-sandbox issue (Next: Build, Ready to Build, unassigned) produces a real GitHub wake; digio-farm self-assignment produces a real wake

  • Live validation: ⚠️ inconclusive - 0 of 5 scenarios driven live against the product

Scenario Result Live Evidence
Next: Build + Ready to Build, no assignee -> wake; moved out -> no wake ⏸️ untested no Prior payload only ran the script's fixture-driven unit test suite, not a live drive against the real running product; no live evidence was established for this scenario.
Self-assignment on a configured repo produces a wake ⏸️ untested no Prior payload only ran the script's fixture-driven unit test suite, not a live drive against the real running product; no live evidence was established for this scenario.
Unlabelled picked-up issue triggers jev.yml dispatch instruction before brief ⏸️ untested no Prior payload only ran the script's fixture-driven unit test suite, not a live drive against the real running product; no live evidence was established for this scenario.
Three unparseable gh-axi polls in a row publish one wake with diagnostic ⏸️ untested no Prior payload only ran the script's fixture-driven unit test suite, not a live drive against the real running product; no live evidence was established for this scenario.
Live factory-sandbox issue (Next: Build, Ready to Build, unassigned) produces a real GitHub wake; digio-farm self-assignment produces a real wake ⏸️ untested no Driving this live requires creating/moving real issues in digio-nz/factory-sandbox and digio-farm, shared org repos outside this run's disposable sandbox; this test phase has no authority to mutate sh…
  • bash bin/fm-test-run.sh tests/fm-procevent-github-assigned.test.sh
✅ **Document** - passed

✅ No issues found.

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

✅ No issues found.

Closes nothing in this repo.

Findings not fixed

bash bin/fm-test-run.sh tests/fm-procevent-github-assigned.test.sh tests/fm-procevent.test.sh passed the GitHub adapter subject and failed the generic process-event subject after 241 seconds.
The unchanged source-recovery case reported reconciled: published=0 started=0 stopped=0 uncertain=0 failed=0, where it expected started=1 after repairing a source.
The generic suite also failed in an isolated exported snapshot of origin/main at 834eea85bafdc219008d4b748eead4109e18acdd.
The baseline command was bash bin/fm-test-run.sh tests/fm-procevent.test.sh, run from the snapshot made with git archive origin/main, and returned exit 1 after 208,674 ms.
Its last passing case was the reused-pid surviving-process-group test; it exited before reaching this branch's failed assertion, so the exact assertion's cause remains unproven.
Baseline output is retained locally in .no-mistakes/p3-3-main-test.log.
The generic runner, test, shared test helpers, and sandbox runner are identical to origin/main.

Factory follow-up

The deployed .claude/rules/firstmate-process.md is not tracked here.
In digio-factory:agents/FIRSTMATE.md, replace the opening paragraphs and first four bullets of "Intake and the trigger" with these exact sentences, leaving the similar-issues bullet in place:

Firstmate starts building an issue on either the owner's self-assignment or Jev's Next: Build when the issue has no assignee and its project-board card is in Ready to Build.
The GitHub pickup poller watches every fleet-process repository listed by repo= in config/github-assigned; digio-nz/fcdispatch remains the default when no repositories are configured.
Both signals produce the same wake, and firstmate judges every pickup before dispatching work.
Owner assignment remains the cleared-to-build stamp, applied as the last act of shaping; its signal does not depend on the board column.
An unassigned issue without the qualifying Jev signal remains intake only.
For a captured issue without Jev's Next: labels, follow the adapter's handle output: run gh-axi workflow run jev.yml -R <repo> -f issue=<n> and wait for the labels before resolving the model or writing the brief.
Unassigning an owner-assigned issue remains the stand-down signal.
The poller's seen-id set only grows across both signals, so unassigning and reassigning an issue, or changing a previously captured issue's label, does not produce a second wake.

In "Ready to Build has two entries", replace its final sentence with:

Reaching Ready to Build with Jev's Next: Build and no assignee, or owner self-assignment, is firstmate's signal to build; see "Intake and the trigger".

firstmate and others added 3 commits October 4, 2026 07:54
…-github-assigned.sh:878 — the cmd_handle read loop declared url, title, signal, node as unused locals. Replaced the unused positional names with `_` placeholders in the `read -r` call and trimmed the `local` declaration to only the fields actually used (type, id, number, repo, jev). Verified with `shellcheck` (clean) and `bash -n` (syntax OK)
@digbycampbell
digbycampbell marked this pull request as ready for review October 4, 2026 01:44
@digbycampbell
digbycampbell merged commit 5ce7ea6 into main Oct 4, 2026
38 of 39 checks passed
@digbycampbell
digbycampbell deleted the fm/fm-p3-3 branch October 4, 2026 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant