Repository navigation
Wire the researcher role into the agent loop (WI-042) - #123
Merged
Merged
Conversation
planCycle already resolved a generic crew role (WI-040); this closes the two gaps left open. prompts/roles/researcher.txt has it read the repo's own state, draft one proposal, run it past the independent check at Checkpoint 1 (review-proposals.mjs, ADR-040), and, only on approval, author and self-validate a schema-valid work item. It never claims, makes, or checks the item itself. A new --roles CLI override on run-cycle.mjs lets a single invocation run just the researcher, or any other subset, on its own schedule, without editing role_sequence in config. Absent the override, behavior is unchanged. planCycle now also fails closed during planning when a role in the executed sequence has no prompt file, caught at dry-run time rather than surfacing only as an ENOENT deep inside a real --execute run.
Resolves conflicts against WI-041 (runtime model fallback, #122), which merged first: both branches touched run-cycle.mjs and CHANGELOG.md's Unreleased section for complementary, non-overlapping features. Regenerates the snapshot from scratch.
nateshpp
added a commit
that referenced
this pull request
Jul 7, 2026
Resolves conflicts against WI-042 (the researcher role, #123), which merged just after WI-041 was already reconciled here. Only generated artifacts conflicted this time (snapshot, RELEASE-EVIDENCE.md, site/index.html); run-cycle.mjs and CHANGELOG.md auto-merged cleanly since the two branches touch different regions.
nateshpp
added a commit
that referenced
this pull request
Jul 28, 2026
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.
What this PR does
planCyclealready resolved a generic crew role (WI-040): a role named inrole_sequencebeyond the built-in maker/checker pair resolves its provider, transport, and route with no
core-code change. What was missing was the researcher's own prompt, and a way to run it on
an independent schedule. This closes both gaps.
prompts/roles/researcher.txthas the agent read the repo's own durable state(
STATUS.md,DECISIONS.md, the existing work items), draft one well-scoped proposal, runit past the independent check at Checkpoint 1 (
scripts/agent/review-proposals.mjs,ADR-040), and, only on
APPROVE: yes, author and self-validate (validate-work-item.mjs) aschema-valid work item. It never claims, makes, or checks the item itself, a researcher
proposes, it does not build.
A new
--roles a,b,cCLI override onrun-cycle.mjs(resolveRoleSequencenow takes anoptsargument) lets a single invocation run just the researcher, or any other subset, onits own schedule (matching ADR-040's operating model: research, make, and check can run
independently), without editing
role_sequencein config. Absent the override, behavior isunchanged:
cfg.role_sequence, then the maker/checker default.planCyclealso now fails closed during planning when a role in the executed sequence hasno prompt file at
prompts/roles/<role>.txt, caught at dry-run time rather than surfacingonly as an
ENOENTdeep inside a real--executerun. Closes WI-042.Governance checklist
npm run verifypasses locally (drift guard + style check + tests + AgentProof)bundle edit)
Test evidence
New coverage:
tests/researcher-role.test.mjs(8 tests) covers the researcher promptrendering with its substitutions, the
--rolesCLI parser,resolveRoleSequence's overrideprecedence,
planCyclerunning the researcher alone and in an extended sequence, and thenew fail-closed check for a role with no prompt file (both for a real run and for dry-run).