Skip to content

refactor: modularize parallel runtime and harden safety#6

Draft
dickymoore wants to merge 14 commits into
NathanJ60:mainfrom
dickymoore:feat/parallel-safety-modularization
Draft

refactor: modularize parallel runtime and harden safety#6
dickymoore wants to merge 14 commits into
NathanJ60:mainfrom
dickymoore:feat/parallel-safety-modularization

Conversation

@dickymoore
Copy link
Copy Markdown
Contributor

This is the third PR in the parallel execution stack. It is opened as a draft to avoid accidental merge before the earlier stack entries land.

Please review/merge order:

  1. fix: codex loop robustness #2: Codex bug fixes.
  2. feat: add parallel story execution MVP #4: parallel execution MVP.
  3. feat: add parallel runtime controls and recovery #5: runtime controls and recovery.
  4. This PR: safety, review semantics, and modularization cleanup.

Scope:

  • Replaces source result.env worker result loading with explicit allowlisted key/value parsing.
  • Uses private mktemp -d script snapshot directories.
  • Updates code-review gate return codes so 0 means clean/success and nonzero means follow-up/error.
  • Simplifies worker wait state so wait_for_worker_completion no longer takes nine nameref parameters.
  • Splits the large core into sourced modules:
    • lib/runtime.sh
    • lib/review-loop.sh
    • lib/parallel.sh
  • Updates wrappers and installer so modules load correctly from repo and installed layouts.

Tested:

  • bash -n on core, wrappers, installer, and all lib modules.
  • Direct source ./ralph-loop-core.sh smoke test proving sourced functions are available.
  • Wrapper snapshot --help smoke test.
  • Simulated installed-layout smoke test using ralph-loop-lib.
  • Worker result parser rejection test for an unexpected/malicious result key.
  • Fake Codex parallel smoke test with RALPH_CONCURRENCY=2 in a temporary git project: two ready-for-dev stories ran through worker worktrees, fake dev/code-review workflows completed, controller integrated both worker outputs, and both stories ended as done in sprint status.

No live Claude/Codex agent workflow was invoked; the provider was faked to avoid spending real model calls during branch validation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant