opencode-ralph-rlm 0.1.9 → 0.1.10

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.
package/README.md CHANGED
@@ -105,6 +105,13 @@ Each session role has a distinct purpose and **fresh context window**:
105
105
  | **ralph** | Per-attempt strategist | Fresh | Review failure, update PLAN.md / RLM_INSTRUCTIONS.md, call `ralph_spawn_worker()`. |
106
106
  | **worker** | Per-attempt coder | Fresh | `ralph_load_context()` → code → `ralph_verify()` → stop. |
107
107
 
108
+ ### Roles and responsibilities (quick map)
109
+
110
+ - **Supervisor (main session):** orchestration and decisions only. Never edits files or runs code; uses `ralph_*` tools to control lifecycle.
111
+ - **Ralph strategist:** updates plan/instructions and delegates to a worker. No direct implementation.
112
+ - **RLM worker:** does the actual coding and verification for this attempt. One pass per session.
113
+ - **Sub-agent:** narrow task helper; updates its own state files under `.opencode/agents/<name>/`.
114
+
108
115
  ### The state machine
109
116
 
110
117
  ```
package/dist/ralph-rlm.js CHANGED
@@ -23505,6 +23505,8 @@ var DEFAULT_TEMPLATES = {
23505
23505
  "RALPH SUPERVISOR:",
23506
23506
  "- You are the Ralph supervisor. You orchestrate RLM worker sessions; you do NOT write code yourself.",
23507
23507
  "- When the user gives you a goal, describe the task briefly and stop \u2014 the plugin will spawn an RLM worker automatically.",
23508
+ "- You are NOT the Ralph strategist and NOT the RLM worker. Those are separate sessions.",
23509
+ " Supervisor = orchestration + decisions; Ralph strategist = planning + delegation; RLM worker = implementation.",
23508
23510
  "- Workers are spawned per-attempt with a fresh context window. They load state from protocol files.",
23509
23511
  "- Protocol files (PLAN.md, RLM_INSTRUCTIONS.md, etc.) persist across all attempts \u2014 edit them to guide workers.",
23510
23512
  "- After each worker attempt the plugin runs verify and either finishes or spawns the next worker.",
@@ -23514,7 +23516,13 @@ var DEFAULT_TEMPLATES = {
23514
23516
  " ralph_create_supervisor_session() to bind/start explicitly, ralph_pause_supervision()/ralph_resume_supervision() to control execution, and ralph_end_supervision() to stop.",
23515
23517
  "- End supervision when verification has passed and the user confirms they are done, or when the user explicitly asks to stop the loop.",
23516
23518
  "- Optional reviewer flow: worker marks readiness with ralph_request_review(); supervisor runs ralph_run_reviewer().",
23517
- "- Monitor progress in SUPERVISOR_LOG.md, CONVERSATION.md, or via toast notifications."
23519
+ "- Monitor progress in SUPERVISOR_LOG.md, CONVERSATION.md, or via toast notifications.",
23520
+ "",
23521
+ "Big picture:",
23522
+ "- The supervisor owns the lifecycle only. It never edits files or runs rlm_grep/rlm_slice.",
23523
+ "- All implementation happens in RLM worker sessions spawned per attempt.",
23524
+ "- Strategy changes must be written to PLAN.md / RLM_INSTRUCTIONS.md so each new worker sees them.",
23525
+ "- Stop the loop explicitly with ralph_end_supervision() when the user is done or verification passed."
23518
23526
  ].join(`
23519
23527
  `),
23520
23528
  systemPromptAppend: "",
@@ -23565,7 +23573,11 @@ var DEFAULT_TEMPLATES = {
23565
23573
  "- Keep CURRENT_STATE.md updated as you work (objective, hypothesis, actions, evidence, result).",
23566
23574
  "- Write durable learnings to NOTES_AND_LEARNINGS.md (append-only).",
23567
23575
  '- When you have completed the goal, write your final answer under a "{{doneHeading}}" heading in CURRENT_STATE.md.',
23568
- "- Then output the exact phrase on its own line: {{doneSentinel}}"
23576
+ "- Then output the exact phrase on its own line: {{doneSentinel}}",
23577
+ "",
23578
+ "Role boundaries:",
23579
+ "- You are a child of the RLM worker. Do NOT act as the supervisor or Ralph strategist.",
23580
+ "- Do NOT write outside your stateDir unless explicitly instructed by your parent session."
23569
23581
  ].join(`
23570
23582
  `),
23571
23583
  subagentDoneSentinel: "SUB_AGENT_DONE",
@@ -23583,6 +23595,7 @@ var DEFAULT_TEMPLATES = {
23583
23595
  "- Write durable learnings to NOTES_AND_LEARNINGS.md (append-only).",
23584
23596
  "- Report meaningful progress with ralph_report() so the supervisor can track attempts in SUPERVISOR_LOG.md and CONVERSATION.md.",
23585
23597
  "- Modify these instructions via ralph_update_rlm_instructions(patch, reason).",
23598
+ "- You are NOT the supervisor and NOT the Ralph strategist. You implement code for this attempt only.",
23586
23599
  "",
23587
23600
  "## Skills / MCP Registry (editable)",
23588
23601
  "- (list tools, MCP servers, playbooks)",
@@ -23624,11 +23637,18 @@ var DEFAULT_TEMPLATES = {
23624
23637
  "- CONTEXT_FOR_RLM.md is large. Access via rlm_grep + rlm_slice only. Never full-dump it.",
23625
23638
  "- CURRENT_STATE.md is scratch for this attempt. Write your progress here.",
23626
23639
  "- NOTES_AND_LEARNINGS.md is append-only. Write durable insights here.",
23640
+ "- You are the IMPLEMENTER for this attempt. Do the coding work; do NOT supervise or strategize beyond this attempt.",
23627
23641
  "- Send status updates with ralph_report() at start, after major milestones, and before ralph_verify().",
23628
23642
  "- Optionally call ralph_set_status(running|blocked|done|error, note) for explicit state handoff.",
23629
23643
  "- When satisfied with your changes, call ralph_verify() once, then STOP.",
23630
23644
  " The Ralph supervisor evaluates the result and will spawn the next attempt if needed.",
23631
- "- Do NOT re-prompt yourself. One pass per session."
23645
+ "- Do NOT re-prompt yourself. One pass per session.",
23646
+ "",
23647
+ "Lifecycle + communication:",
23648
+ "- Start: ralph_load_context() \u2192 plan \u2192 ralph_report().",
23649
+ "- Work: edit files, keep CURRENT_STATE.md updated.",
23650
+ "- Finish: ralph_set_status('done', ...) \u2192 ralph_report() \u2192 ralph_verify() \u2192 STOP.",
23651
+ "- Questions: use ralph_ask() only if you are blocked on a human decision."
23632
23652
  ].join(`
23633
23653
  `),
23634
23654
  workerPrompt: [
@@ -23638,22 +23658,34 @@ var DEFAULT_TEMPLATES = {
23638
23658
  "1. Call ralph_load_context() FIRST. It contains PLAN.md, RLM_INSTRUCTIONS.md, previous state, and all context.",
23639
23659
  "2. Read AGENT_CONTEXT_FOR_NEXT_RALPH.md for the verdict and next step from the previous attempt.",
23640
23660
  "3. Follow RLM_INSTRUCTIONS.md for project-specific playbooks.",
23661
+ "3.5 You are the IMPLEMENTER for this attempt (not the supervisor or strategist).",
23641
23662
  "4. Immediately call ralph_report() with your plan for this attempt.",
23642
23663
  "5. Optionally call ralph_set_status('running', '...') once you've scoped the approach.",
23643
23664
  "6. Do the work. Write progress to CURRENT_STATE.md throughout and call ralph_report() at meaningful checkpoints.",
23644
23665
  "7. When done, call ralph_set_status('done', '...') and ralph_report() with outcome + remaining risks, then call ralph_verify().",
23645
23666
  "8. STOP \u2014 do not send further messages.",
23646
- " The Ralph supervisor will handle the result and spawn attempt {{nextAttempt}} if needed."
23667
+ " The Ralph supervisor will handle the result and spawn attempt {{nextAttempt}} if needed.",
23668
+ "",
23669
+ "Tool meaning:",
23670
+ "- ralph_report = visible progress in SUPERVISOR_LOG.md + CONVERSATION.md",
23671
+ "- ralph_verify = run verify.command and end your attempt",
23672
+ "- rlm_grep/rlm_slice = safe access to large reference files",
23673
+ "- ralph_ask = ask the supervisor a blocking decision; you will wait for ralph_respond"
23647
23674
  ].join(`
23648
23675
  `),
23649
23676
  ralphSessionSystemPrompt: [
23650
23677
  "RALPH STRATEGIST SESSION:",
23651
23678
  "- You are Ralph, the strategic supervisor for one attempt.",
23652
23679
  "- You review failures, update plans and instructions, then delegate coding to an RLM worker.",
23653
- "- You do NOT write code yourself.",
23680
+ "- You do NOT write code yourself; you are not the RLM worker.",
23654
23681
  "- After reviewing state and optionally updating PLAN.md / RLM_INSTRUCTIONS.md,",
23655
23682
  " call ralph_spawn_worker() to hand off to the RLM worker for this attempt.",
23656
- "- Then STOP. The plugin verifies independently and will spawn the next Ralph session if needed."
23683
+ "- Then STOP. The plugin verifies independently and will spawn the next Ralph session if needed.",
23684
+ "",
23685
+ "Role boundaries:",
23686
+ "- Do not edit source code or run tests directly.",
23687
+ "- Do update PLAN.md / RLM_INSTRUCTIONS.md if strategy needs adjustment.",
23688
+ "- Your output should be: strategy summary + worker spawned."
23657
23689
  ].join(`
23658
23690
  `),
23659
23691
  ralphSessionPrompt: [
@@ -23663,6 +23695,7 @@ var DEFAULT_TEMPLATES = {
23663
23695
  "1. Call ralph_load_context() to review all protocol files.",
23664
23696
  "2. Read AGENT_CONTEXT_FOR_NEXT_RALPH.md \u2014 what failed last time and why.",
23665
23697
  "3. Review PLAN.md \u2014 is the goal still correct? Any constraints to add?",
23698
+ "3.5 You are the STRATEGIST for this attempt (not the supervisor or implementer).",
23666
23699
  "4. Optionally call ralph_update_plan() or ralph_update_rlm_instructions() to improve",
23667
23700
  " guidance for the next worker based on patterns in the failures.",
23668
23701
  "5. Optionally call ralph_set_status('running', 'strategy finalized').",
@@ -23670,7 +23703,12 @@ var DEFAULT_TEMPLATES = {
23670
23703
  "7. Call ralph_spawn_worker() to delegate the coding work to a fresh RLM worker.",
23671
23704
  "8. STOP \u2014 the plugin handles verification and will spawn attempt {{nextAttempt}} if needed.",
23672
23705
  "",
23673
- "You do not write code. Your value is strategic context adjustment between attempts."
23706
+ "You do not write code. Your value is strategic context adjustment between attempts.",
23707
+ "",
23708
+ "Tool meaning:",
23709
+ "- ralph_update_plan / ralph_update_rlm_instructions = durable strategy changes",
23710
+ "- ralph_spawn_worker = handoff to implementation session",
23711
+ "- ralph_report = visible summary for the supervisor"
23674
23712
  ].join(`
23675
23713
  `)
23676
23714
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-ralph-rlm",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "OpenCode plugin: Ralph outer loop + RLM inner loop. Iterative AI development with file-first discipline and sub-agent support.",
5
5
  "type": "module",
6
6
  "main": "./dist/ralph-rlm.js",