chore: auto-commit before merge (loop primary)

This commit is contained in:
2026-02-17 02:26:42 +00:00
parent 01a48ce691
commit 9a58b3c312
18 changed files with 1446 additions and 483 deletions
+71 -69
View File
@@ -1,11 +1,11 @@
cli:
backend: "codex"
backend: "claude"
event_loop:
prompt_file: "Ralph/PROMPT.md"
starting_event: "work.start"
completion_promise: "LOOP_COMPLETE"
max_iterations: 60
max_iterations: 50
backpressure:
gates:
@@ -21,116 +21,118 @@ backpressure:
hats:
planner:
name: "Content Refactor Planner"
description: "Plans one rollout stage at a time for centralizing all descriptive text into a single editable source."
name: "Refactor Planner"
description: "Analyses codebase and selects the next refactoring target from the ordered checklist."
triggers: ["work.start", "review.changes_requested"]
publishes: ["plan.ready"]
memory:
path: ".ralph/agent/memories.md"
scope: "global"
instructions: |
You are the Planner. Read PROMPT.md first.
You are the Refactor Planner. Read Ralph/PROMPT.md for the full task and checklist.
Terminal rule (run this first):
- If PROMPT.md already shows all rollout stages complete and contains LOOP_COMPLETE,
print LOOP_COMPLETE immediately.
Terminal rule (check first):
- If Ralph/PROMPT.md shows all checklist items complete, print LOOP_COMPLETE immediately.
- Do NOT emit plan.ready for verification-only or closure-only passes.
- Do NOT create additional backpressure-recovery tasks when no unchecked stage exists.
- Do NOT create tasks when no unchecked item exists.
If triggered by review.changes_requested, read .ralph/review.md and incorporate feedback.
Your job:
1. Identify the NEXT unchecked rollout stage in PROMPT.md.
2. Inspect the codebase and map only the files needed for that stage.
3. Write/update .ralph/plan.md with:
- stage name and objective
- explicit file list with planned edits
- migration approach that minimizes breakage
- compatibility strategy (temporary adapters/re-exports if needed)
- rollback-safe checkpoints
4. Keep scope to one stage per iteration.
5. Emit plan.ready.
1. Read .ralph/plan.md (if it exists) to see what's been completed so far
2. Check the refactoring checklist in Ralph/PROMPT.md against the current codebase
3. Select the NEXT uncompleted item from the checklist (work IN ORDER)
4. Analyse the specific files involved — read them, understand current state
5. Write a focused, concrete plan for THIS iteration only
Planning only. Do not modify source files.
Write your plan to .ralph/plan.md with:
- Which checklist item you're tackling
- Specific files to modify (absolute paths)
- Precise changes: which functions/exports/imports change
- What to verify after changes (imports resolve, no broken references)
- Updated completion status of the overall checklist
IMPORTANT: One checklist item per iteration. Don't skip ahead.
Do NOT write any code. Planning only. Emit plan.ready when done.
builder:
name: "Content Refactor Builder"
description: "Implements the current stage, centralizes text content, and preserves behavior."
name: "Refactor Builder"
description: "Executes planned refactoring changes while preserving identical runtime behaviour."
triggers: ["plan.ready"]
publishes: ["build.done"]
memory:
path: ".ralph/agent/memories.md"
scope: "global"
instructions: |
You are the Builder. Read PROMPT.md and .ralph/plan.md.
You are the Refactor Builder. Read Ralph/PROMPT.md for context and .ralph/plan.md
for the specific changes to make this iteration.
Terminal rule:
- If planner signaled completion or PROMPT.md is already fully complete, print LOOP_COMPLETE.
- If planner signaled completion or Ralph/PROMPT.md is fully complete, print LOOP_COMPLETE.
- Do not emit build.done for verification-only closure cycles.
Your job:
1. Implement ONLY the currently planned stage.
2. Centralize descriptive/profile text into the single source defined by PROMPT.md.
3. Update consumers for that stage to read from centralized content.
4. Preserve runtime behavior and existing interactions.
5. Run quality checks after meaningful changes:
- npm run lint
- npm run typecheck
- npm run build
6. Mark completed stage checkboxes in PROMPT.md.
7. Emit build.done when the stage is complete and checks pass.
1. Read the plan carefully — understand every change before starting
2. Execute the refactoring changes described in the plan
3. After each file change, verify:
- All imports/exports still resolve
- No TypeScript errors introduced
- The public API of modified modules is preserved (or consumers updated)
4. Run validation: npm run lint && npm run typecheck && npm run build
5. Fix any errors introduced by the refactoring
6. Mark completed checklist items in Ralph/PROMPT.md
7. Commit completed work with conventional commit (refactor: ...)
Backpressure payload format requirement for build.done:
- Include these exact evidence fields in plain text:
- tests: pass
- lint: pass
- typecheck: pass
- audit: pass
- coverage: pass
- complexity: <score>
- duplication: pass
- For unconfigured checks, still use `pass` and append `(not-configured)`.
- Keep field names lowercase and exact.
CRITICAL RULES:
- Do NOT change any visual output or runtime behaviour
- Do NOT add new features or change functionality
- If the plan says to move code, ensure ALL consumers are updated
- If you encounter unexpected complexity, note it but still complete the planned work
- Prefer incremental migration with compatibility exports where useful
Constraints:
- Keep TypeScript strictness intact.
- Do not rewrite unrelated logic.
- Prefer incremental migration with compatibility exports where useful.
- Avoid duplicate text sources after each stage is completed.
Emit build.done when changes are complete and all gates pass.
reviewer:
name: "Content Refactor Reviewer"
description: "Validates each stage against requirements and requests focused rework when needed."
name: "Refactor Reviewer"
description: "Validates refactoring quality, checks nothing is broken, tracks overall checklist progress."
triggers: ["build.done"]
publishes: ["review.changes_requested"]
memory:
path: ".ralph/agent/memories.md"
scope: "global"
instructions: |
You are the Reviewer. Read PROMPT.md, .ralph/plan.md, and current source changes.
You are the Refactor Reviewer. Read Ralph/PROMPT.md for success criteria
and .ralph/plan.md for what was attempted this iteration.
Terminal rule:
- If all stage checkboxes in PROMPT.md are complete and success criteria are complete,
print LOOP_COMPLETE immediately and do not emit review.changes_requested.
- If all checklist items in Ralph/PROMPT.md are complete and success criteria are met,
print LOOP_COMPLETE immediately. Do not emit review.changes_requested.
- Do not request verification-only recovery work after completion.
Validate in this order:
1. Run gates:
- npm run lint
- npm run typecheck
- npm run build
1. Run gates: npm run lint && npm run typecheck && npm run build
All must pass.
2. Confirm the stage objective was fully delivered.
3. Confirm migrated files now read from centralized content instead of hardcoded/duplicated text.
4. Confirm no behavior regressions for navigation, detail panels, search/chat context, and timeline/constellation wiring.
5. Confirm PROMPT.md status reflects reality.
2. Confirm the planned refactoring was fully delivered
3. Verify no dangling imports, unused exports, or dead code left behind
4. Verify the refactoring actually simplified things (fewer lines, less duplication)
5. Visual inspection with Playwright MCP (run after Phase 0 bypass is in place):
- Ensure the dev server is running (npm run dev, or start it if not)
- Use mcp__playwright__browser_navigate to open http://localhost:5173
- Use mcp__playwright__browser_snapshot to capture an accessibility snapshot
- Verify key dashboard elements are present: sidebar, constellation/graph area, tiles, top bar
- Use mcp__playwright__browser_take_screenshot for a visual record
- If any section is missing, visually broken, or shows errors, flag it immediately
- For the final task (4.3 — re-enable boot sequence), verify the full boot → ECG → login → dashboard flow completes
6. Confirm no behavior regressions for navigation, detail panels, search, constellation
7. Confirm Ralph/PROMPT.md status reflects reality
Decision rules:
- If current stage is incomplete or quality fails: write actionable fixes to .ralph/review.md and emit review.changes_requested.
- If current stage is complete but more stages remain: note approval in .ralph/review.md and emit review.changes_requested for the next stage.
- If all stages and success criteria are complete: write final approval to .ralph/review.md and print LOOP_COMPLETE.
- Current item incomplete or quality fails write actionable fixes to .ralph/review.md, emit review.changes_requested
- Current item complete but more remain note approval in .ralph/review.md, emit review.changes_requested for next item
- ALL items and success criteria complete write final approval to .ralph/review.md, print LOOP_COMPLETE
Circuit breaker:
- If the same blocker class repeats across 3 consecutive review cycles with materially identical evidence,
stop retrying. Record blocker/evidence in .ralph/review.md with status "needs-human",
assign owner + target date, and request human clarification before further loop progress.
- If the same blocker repeats across 3 consecutive cycles with identical evidence:
stop retrying, record in .ralph/review.md with status "ESCALATE",
skip that item and move to the next checklist item.
Note the skipped item for human review.