ralph-teams 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -41,6 +41,7 @@ When spawning sub-agents with Copilot, respect explicit config first and only fa
41
41
  - SPAWN for: new features, new files/modules, new routes/pages/APIs, refactors, cross-layer changes, external integrations, anything requiring architectural judgment, or anything requiring non-trivial sequencing decisions across stories
42
42
  - Choose the planner model using the policy above
43
43
  - When you delegate planning, include the exact output path for the epic plan file, for example `plans/plan-EPIC-001.md`, and require the Planner to write the plan there before it returns
44
+ 3. **Do NOT create a long-lived Builder or Validator mailbox.** For Copilot, Builder and Validator must be one-shot `task` invocations scoped to a single story attempt. Do NOT ask them to wait for future instructions across stories.
44
45
 
45
46
  ## Workflow Per Story
46
47
 
@@ -53,22 +54,23 @@ Before starting a story, check the `passes` field in the PRD file.
53
54
 
54
55
  ### Build Phase
55
56
  1. Before spawning the Builder, check whether a guidance file exists at `guidance/guidance-{story-id}.md` (substituting the actual story ID, e.g. `guidance/guidance-US-003.md`).
56
- 2. Use the `task` tool to spawn the `builder` agent with:
57
+ 2. Use the `task` tool to spawn a fresh `builder` agent for this one story attempt with:
57
58
  - The story details and acceptance criteria
58
59
  - The relevant section from the implementation plan
59
60
  - Any context from previous stories
60
61
  - **If the guidance file exists**, include this line explicitly: `Guidance file for this story: guidance/guidance-{story-id}.md — read it before implementing and follow the instructions in it.`
61
62
  - Choose the builder model using the policy above
62
- 3. Wait for Builder to complete and return the commit SHA
63
+ 3. Wait for Builder to complete and inspect its final output.
64
+ 4. Do NOT treat task lifecycle notifications, waiting messages, or generic completion prose as success. A Builder result only counts if it includes a concrete commit SHA in the expected format.
63
65
 
64
66
  ### Validate Phase
65
- 3. **Validator — only spawn if truly needed.** Ask: "Can I verify this story is correct just by reading the file and checking the build output?" If YES → **do NOT spawn the Validator** — self-verify instead. If NO → spawn it via the `task` tool.
67
+ 5. **Validator — only spawn if truly needed.** Ask: "Can I verify this story is correct just by reading the file and checking the build output?" If YES → **do NOT spawn the Validator** — self-verify instead. If NO → spawn a fresh Validator via the `task` tool for this one story attempt.
66
68
  - DO NOT spawn for: "add X to file Y" (read the file, check X is there), build/typecheck checks (trust Builder's output or run the command)
67
69
  - SPAWN for: logic correctness, new behaviour, API contracts, anything requiring judgment to verify
68
70
  - When self-verifying: read the changed file(s), check each criterion, decide PASS or FAIL.
69
71
  - If spawning: provide acceptance criteria + commit SHA + "Use `git diff <sha>~1 <sha>` to see exactly what changed."
70
72
  - Choose the validator model using the policy above
71
- 4. Wait for Validator verdict (if spawned)
73
+ 6. Wait for Validator verdict (if spawned)
72
74
 
73
75
  ### Pushback Loop (max 2 total build+validate cycles)
74
76
 
@@ -77,7 +79,7 @@ The first build+validate cycle is attempt 1. If it fails, you get one retry (att
77
79
  5. If Validator reports **PASS** → mark story as passed in PRD, move to next story
78
80
  6. If Validator reports **FAIL**:
79
81
  - Increment attempt counter for this story
80
- - If attempt count < 2: re-spawn Builder with the failure details (this is the retry)
82
+ - If attempt count < 2: spawn a new Builder for the retry and include the failure details
81
83
  - If attempt count = 2: **document the failure and move on**
82
84
 
83
85
  ## Failure Documentation
@@ -128,6 +130,7 @@ After processing ALL stories in the epic:
128
130
  ## Rules
129
131
 
130
132
  - NEVER write code yourself
133
+ - Builder and Validator must be one-shot story-scoped tasks. Do NOT keep them alive across stories.
131
134
  - Only skip the Planner for genuinely simple epics — when in doubt, run it
132
135
  - Only skip the Validator for genuinely simple stories — when in doubt, spawn it; for complex stories the Validator must always run
133
136
  - NEVER exceed 2 total build+validate cycles per story
@@ -135,3 +138,4 @@ After processing ALL stories in the epic:
135
138
  - ALWAYS check `passes` field before starting a story
136
139
  - ALWAYS pass the commit SHA from Builder to Validator
137
140
  - ALWAYS exit the session immediately after writing and printing the final result
141
+ - NEVER treat task notifications, idle teammate output, or summary prose as a substitute for a real Builder result and PRD update
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ralph-teams",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "CLI tool for Ralph Teams",
5
5
  "bin": {
6
6
  "ralph-teams": "dist/index.js",
package/ralph.sh CHANGED
@@ -930,20 +930,23 @@ $PENDING_STORIES_JSON
930
930
  - DO NOT spawn for: adding/removing lines in named files, adding console.log statements, changing config values, renaming things, isolated copy tweaks, or similarly trivial low-risk edits
931
931
  - When you do spawn the Planner, explicitly tell it to write the plan to $ROOT_DIR/plans/plan-${EPIC_ID}.md, and wait for that file.
932
932
  - If your agent runtime supports named sub-agents, use the dedicated planner role for this and choose its model using the policy above
933
- 2. Process ALL user stories in priority order do NOT stop until every story has been attempted
934
- 3. For each story: check if passes=true in the PRD (skip those they are already done), then Builder implements verify → max 2 total cycles
935
- - If your agent runtime supports named sub-agents, use the dedicated builder role for implementation and choose its model using the policy above
933
+ 2. Do NOT create long-lived Builder or Validator mailboxes. Builder and Validator must be one-shot story-scoped teammate runs. Do NOT ask them to wait for future instructions across stories.
934
+ 3. Process ALL user stories in priority orderdo NOT stop until every story has been attempted
935
+ 4. For each story: check if passes=true in the PRD (skip those they are already done), then Builder implements verify → max 2 total cycles
936
+ - Spawn a fresh Builder for each story attempt. If your agent runtime supports named sub-agents, use the dedicated builder role for implementation and choose its model using the policy above
936
937
  - Before assigning each story, check if guidance/guidance-{story-id}.md exists (e.g. guidance/guidance-US-003.md). If it does, explicitly include this in your Builder assignment: Guidance file for this story: guidance/guidance-{story-id}.md — read it before implementing and follow the instructions in it.
938
+ - Do NOT treat task lifecycle notifications, idle output, or generic completion summaries as success. A Builder result only counts if it includes a concrete commit SHA you can hand to verification.
937
939
  - **Validator — only spawn if truly needed.** Ask yourself: \"Can I verify this story is correct just by reading the changed files?\" If YES → do NOT spawn the Validator — self-verify by reading the files and checking each criterion. If NO → spawn the Validator.
938
940
  - DO NOT spawn Validator for: adding a line to a named file (read the file, check the line is there), build/typecheck (trust Builder output or run the command yourself)
939
941
  - SPAWN Validator for: logic correctness, new behaviour, API contracts, anything requiring judgment to verify
940
- - If your agent runtime supports named sub-agents, use the dedicated validator role when spawning and choose its model using the policy above
942
+ - If you do spawn a Validator, spawn a fresh Validator for that one story attempt. If your agent runtime supports named sub-agents, use the dedicated validator role when spawning and choose its model using the policy above
941
943
  - After each story attempt, update the story object in $PRD_ABS_PATH:
942
944
  - if the story passes, set passes=true and failureReason=null
943
945
  - if the story fails, set passes=false and failureReason to a short concrete reason string from the validator feedback
944
- 4. Document any failures and move on to the next story
945
- 5. When ALL stories have been processed (or skipped because already passed), verify the PRD file has been updated for every story (passes: true or false).
946
- 6. Print a summary line \"DONE: X/Y stories passed\" and exit the session. Do not remain idle.
946
+ 5. If a story fails validation and still has retries left, spawn a new Builder for the retry instead of reusing the previous Builder run.
947
+ 6. Document any failures and move on to the next story
948
+ 7. When ALL stories have been processed (or skipped because already passed), verify the PRD file has been updated for every story (passes: true or false).
949
+ 8. Print a summary line \"DONE: X/Y stories passed\" and exit the session. Do not remain idle.
947
950
 
948
951
  ## Critical Rules
949
952
  - Do NOT stop after the first story — process ALL stories before exiting
@@ -951,6 +954,7 @@ $PENDING_STORIES_JSON
951
954
  - Once the final PRD updates are complete and you have printed the DONE summary, end the session immediately. Do not wait for more input.
952
955
  - Process stories sequentially: build → validate → next. Do not stop early.
953
956
  - After each story result (pass or fail), update $PRD_ABS_PATH to keep both passes and failureReason accurate for that story
957
+ - NEVER treat task notifications, idle teammate output, or summary prose as a substitute for a real Builder result and PRD update
954
958
 
955
959
  Begin."
956
960