Repository navigation
fix(workflow): three role fixes from #1668's review: command-first clones, named workflows, members.yaml - #1672
Conversation
…nches A clone that runs with a role checked, as its first step was prepared, that every tool its install delivers to takes the role's knowledge inside the clone. A command step that opens the clone names no tool, so the check covered every tool the member enables, and a member with Hermes, which takes skills from their home, could not run a role workflow that starts with `npm ci` in a clone. The clone's setup now checks the tools the step that opens it launches, none for a command, as a worktree copy does. Each later step in the clone is checked as it is prepared, for the tools it launches, so a later step on Hermes fails role_unavailable rather than run without the role.
A workflow file whose steps continue a copy a step running it opens was checked on its own, as if that copy ran with the team pulled now. A continuing step that named a pinned clone's role, or took it from the file's defaults.role, was refused with bad_role once the team renamed the role, though the clone checks it at its own revision. Such a file now leaves the role to the file that runs it, whose walk sees the copy: a pinned clone's setup checks the role at its revision, a copy of the team pulled now is checked against its manifest, and a role other than the copy's is a conflict there. The lease checks it again.
…errides A clone writes its team selection's primaryRole and additionalRoles as its install's own, and every load in the clone then applies manifest/members.yaml at the clone's revision, which decides a member's roles while it exists. A selection naming other roles installed the assigned ones instead, and nothing said so. The clone's setup now resolves the roles that file assigns before the clone's own pull, and fails clone_prepare_failed when they differ from the ones the selection names, saying how to run as that role's knowledge instead. members.yaml still decides the roles, so a workflow cannot give a step the hooks, MCP servers or env of a role the member does not hold.
The PR description documents sufficient testing, including a representative real-CLI run at the reviewed head. No testing-related blocking finding. Nothing from the PR was run, built, or installed. |
…n's roles removed even with role: The refusal offered role: on the step as an alternative to removing the selection's roles, but the selection is checked first, so adding role: alone fails the same way.
|
Fixed in
Both guide pages now say the same: leave the roles out, and also set |
|
No new findings in the scoped diff.
|
SaulMoro
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
Approving. I built main (8135591) and this head and checked all three rows on an isolated home. The body's real-CLI record covers row 1 only, so here is a record for rows 2 and 3 you can paste in:
Real-CLI check of rows 2 and 3 (built CLI; the claude and hermes tools are stand-ins that log the copy they run in).
Builds: main 813559197 and 95995fd0, each `npm run build`. Setup: isolated HOME, local bare team and app origins through insteadOf,
`init --provider git --agent claude,hermes --scope workspace`, `workflows.sandbox: false`, `max_parallel: 1`, `workflow start <name> --driver local`.
Row 2 (pinned clone runs the named workflow `look`; its step names the role `old-review`, renamed at HEAD):
- main: `pull` warns that look.yaml has role old-review, which manifest/roles.yaml does not declare; `workflow start` exits 1 (workflow_not_found).
- 95995fd0: `pull` is silent; `workflow start` exits 0; the clone's step runs with old-review as the pinned revision declares it.
When the pinned revision does not declare old-review: exits 1, role_unavailable on the step.
Row 3 (team selection primaryRole review; members.yaml at the pinned revision assigns audit):
- main: `workflow start` exits 0; the clone installs audit and the review skill is absent.
- 95995fd0: exits 1, clone_prepare_failed, which names the audit assignment at the pinned revision.
Remove primaryRole and additionalRoles from the selection: exits 0.
Keep the selection and add `role: review` to the step: exits 1, the same error.
Remove the selection and add `role: review`: exits 0, and the review skill is in the copy.
The refusal text from 95995fd fixes the CI review's point: following its advice now works.
[P2 non-blocking] A top-level continuing step with an undeclared role no longer fails at pull
On main, pull warns bad_role. Here pull is silent and workflow start fails with workspace_base ("continues a workspace, but no enclosing step opens one"). Nothing runs, so this is safe. But docs/guide/workflow-advanced.md line 539 (and the zh-CN page) still says pull refuses this as bad_role. The cause is the enclosing_copy branch in parse-roles.ts: it skips ownRoleDeclared for every continuing step with no known copy, including steps in files no other workflow runs. Keeping the current-team check for those, and the caller's-copy check only for named sub-workflows, would keep the pull warning.
[P2 non-blocking] Benchmark arms pinned to an older revision now refuse, with no test
Plan selection now applies to every pulled and ref clone arm (start.ts:197,496, plan.ts:394). An arm pinned to a revision whose members.yaml assigns the member differently now fails clone_prepare_failed. The body and the guide disclose this, but benchmark-team-arms.test.ts never writes members.yaml, so nothing covers it.
[P3 nit] Smaller points
- The sub-workflow message's second option ("set it on step outer") works only when the role is declared; with the same undeclared role pull still fails
bad_role. The message could say so. - The body says a Hermes step fails
role_unavailable. On--driver localit failstool_unavailablefirst ("the driver of this run cannot launch here"). Say which driver that row describes. - The members.yaml item came from your comment on #1668, not from a maintainer review's P3.
…ng step no workflow runs by name A step that continues a copy no step in its file opens left its role to the workflow running the file, even in a file no workflow runs by name. Pull then cached it silently, though it can only run with the team pulled now. The sync now tells the parse whether another workflow runs the file by name, and checks the role against the current manifest/roles.yaml when none does.
…at opens the copy A step continuing a copy with another role was told to set its role on the step that opens the copy. When manifest/roles.yaml does not declare that role, doing so fails pull again; the message now says so, and lists the roles the manifest declares.
…ion assigns other roles An arm's clone takes its selection from the member's roles as the run starts, so the refusal's advice to edit the selection did not apply to it. The refusal now says to run the arm on a team revision whose manifest/members.yaml assigns the same roles, and the arm case is covered end to end.
|
Each point is addressed, and your record for rows 2 and 3 is in the body:
Each new test failed first for the reason it names. Unit suite: 687 files, 21454 tests. The rest of the e2e suite is left to CI. |
|
No new findings in the scoped diff.
|
SaulMoro
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
Approving again at a5f7e4c. I built it and re-ran the fixtures from my last review:
Top-level continuing step with an undeclared role:
pull: steps[0].role: step "look" has role nope, which manifest/roles.yaml does not declare (refused at pull again, as on main)
Sub-workflow whose continuing step has an undeclared role:
pull: ... remove role from step "look", or set it on step "outer" once manifest/roles.yaml declares nope, which it does not: it declares frontend, review
Row 2 (pinned clone, named workflow, role renamed at HEAD): succeeds; the copy has rv-only and the review rule.
The undeclared-role case is refused at pull again, so docs/guide/workflow-advanced.md line 539 is accurate again. The sub-workflow message now says the role must be declared first. The new benchmark-team-arms case covers an arm pinned to a revision whose members.yaml assigns other roles. That covers all three of my notes.
Summary
#1668 merged before three findings from its review were fixed. Each makes a role workflow fail, or run with roles other than the ones it names:
role: reviewclone whose first step iscommand: npm ci, for a member with Claude and Hermes enabledrole_unavailable: Hermes takes its skills from~/.hermes/skillscan.rolethat launches it, failsrole_unavailable;--driver localwithout Hermes on PATH fails ittool_unavailablefirstworkflow: look, whose continuing step names the clone's roleold-review, since renamedlookwithbad_roleteam.selectionnamesprimaryRole: review, whilemanifest/members.yamlat its revision assigns the memberauditaudit, and nothing says soclone_prepare_failed, saying to drop the roles from the selection, and to give the steprole: reviewfor that role's knowledge. A benchmark arm, whose selection holds the member's roles at start, is told to run on a revision whosemembers.yamlassigns the same onesWhere a clone's role is checked:
And at sync:
Type of Change
Test Plan
npx tsc --noEmitpasses (npm run typecheck)npm run lintpasses, including the docs checksnpx vitest runpasses: 687 files, 21454 tests, 24 skippedEach new test failed before its fix, for the reason it names:
workflow-clone-place: prepares a clone that runs with a role for the command step that opens it, though the member enables Hermesrole_unavailable: hermes takes its skills from<home>/.hermes/skillsworkflow-clone-place: fails a later step in a clone that runs with a role when that step launches Hermesworkflow-cache: caches a workflow a pinned clone runs by name, whose step continues the clone with its role, by its own role or its defaults.rolebad_roleonlook.yamlanddefaulted-look.yamlworkflow-clone-place: fails a clone whose team selection names a role members.yaml at the clone's revision does not assign the memberworkflow-cache: refuses a role the team pulled now does not declare on a step that continues a copy no step opens, in a file no workflow runs by namelookcached, no diagnosticworkflow-parse: says to declare a role manifest/roles.yaml does not declare before setting it on the step that opens the copyor set it on step "change"benchmark-team-arms: fails an arm on a team revision whose manifest/members.yaml assigns the member other roles than the ones they run witherrorand the step'sclone_prepare_failedmessagenpm run test:e2e -- workflow-clone-role workflow-worktree-role workflow-container-role workflow-item-role benchmark-team-arms score-delivered-run-1247: 6 files, 24 tests pass atfb82153d. Ata5f7e4cconly the newbenchmark-team-armstest was run locally; the rest of the e2e suite is left to CI. Codex, CodeBuddy and OpenCode, and thegitlabandgithubproviders: left to CI.Real-CLI verification
Built from this branch at
fb82153d(npm run build) and run on 2026-11-02 with Claude Code 2.1.316, macOS and Node 24.21.0, in a throwaway HOME with local bareteam.gitandbilling.gitorigins. The member holdsfrontendand enablesclaudeandhermes. The team declaresreviewwith therv-onlyskill.Before this branch, the same workflow failed its first step:
role_unavailable, hermes takes its skills from~/.hermes/skills.95995fd0, after this run, changes only the text of themembers.yamlrefusal.SaulMoro's check of rows 2 and 3, at
95995fd0(built CLI; the claude and hermes tools are stand-ins that log the copy they run in). Builds: main813559197and95995fd0, eachnpm run build. Setup: isolated HOME, local bare team and app origins through insteadOf,init --provider git --agent claude,hermes --scope workspace,workflows.sandbox: false,max_parallel: 1,workflow start <name> --driver local.At
a5f7e4cc(npm run build), in the same throwaway HOME, with a team filelone-look.yamlwhose only step continues a copy withrole: old-reviewand that no workflow runs:At
95995fd0the same pull was silent and start failedworkspace_base. The newbenchmark-team-armse2e runs the built CLI for the arm case.Related Issues
Follow-up to #1668: the CI review's P1 and P2, and
members.yamloverriding a clone's recorded roles, which #1668 left as pre-existing.Notes for Reviewers
members.yamlstill decides a member's roles. The clone refuses a selection the file overrides instead of honoring it, so a workflow cannot give a step the hooks, MCP servers or env of a role the member does not hold. For a role's knowledge,role:on the step does that. A benchmark arm records the member's assigned roles, so the same member at the same revision passes. An arm pinned to a revision whosemembers.yamlassigned the member other roles now fails rather than run with them, and the refusal says to run the arm on a revision that assigns the same ones; the e2e covers it.members.yamlassigns, while its selection named others, now fails.