Codex-native orchestration runtime.
Project description
Ralphception
ralphception is a Codex-shaped orchestrator for long-running Ralph-loop work:
- one durable task/session per target repo
- Socratic intake that turns a starting prompt into durable artifacts
- explicit PRD, plan, loop-plan, and todo artifacts before execution
- child runs in worktrees for loop execution, verification, merge, and audit
- reopen and continue until the task is explicitly complete or explicitly blocked
The runtime is durable and repo-local. The product surface is now simple:
uv run ralphceptionlaunches the inline interactive shelluv run ralphception exec "..."runs non-interactivelyuv run ralphception e "..."is the short alias
Quick Start
mise run install
mise run run
Equivalent uv commands:
uv sync
uv run ralphception
uv run ralphception exec "port parser"
Once the package is published, the intended entry points are:
uvx ralphception
uvx ralphception exec "port parser"
Interactive Shell
uv run ralphception opens the default inline shell in the current repo.
The primary transcript lives in normal terminal scrollback, not inside a boxed full-screen viewport. Ralphception writes durable milestones and loop progress directly into the terminal so you can rely on normal scrollback while work runs.
The default lifecycle is artifact-first:
- Socratic intake
- durable intake summary / PRD / plan / todos
- explicit Ralph-loop planning
- loop execution in child worktrees
- consolidation, merge, audit, and reopen if needed
The shell drives the same durable runtime used everywhere else. User replies, blockers, loop progress, and settled outcomes all write into the same .ralphception/ workspace state.
Non-Interactive Exec
uv run ralphception exec "..." runs the task loop without opening Textual.
Example:
uv run ralphception exec \
"port parser" \
--source-repo /path/to/source-repo
Useful flags:
--repo-root <path>to operate on another workspace--source-repo <path>to attach one or more source repos--approve-all/--no-approve-allto control automatic approval of spec and execution-bundle gates--fake-session-managerto inject the deterministic fake backend used by the test suite
exec defaults to --approve-all because it is the non-interactive path. If you want to stop at reviews, use --no-approve-all and switch back to the chat shell.
Prompt input can also come from stdin:
printf '%s\n' "port parser" | uv run ralphception exec -
Live execution requires the codex CLI backend on your PATH. If you are only verifying the local runtime loop, use --fake-session-manager.
Runtime Flow
The durable task loop is:
flowchart TD
A["Initial prompt + optional source repos"] --> B["Socratic intake"]
B --> C["Write intake summary / PRD / plan / todos"]
C --> D["Build explicit plan graph and loop graph"]
D --> E["Execute one or more Ralph loops in child worktrees"]
E --> F["Verification + merge"]
F --> G["Audit + consolidation"]
G --> H{"Blocked or more loops needed?"}
H -- yes --> D
H -- no --> I["Done"]
Runtime State
Ralphception writes disposable runtime state under .ralphception/:
.ralphception/
|- approvals/
|- config.toml
|- events/
|- findings/
|- merge/
|- plans/
|- runs/
|- specs/
|- todos/
`- verification/
Important early files:
.ralphception/runs/run-root/startup.jsonThe captured seed prompt and source repos..ralphception/runs/run-root/intake.mdThe intake artifact derived from startup..ralphception/specs/mission-spec.mdThe current root spec artifact..ralphception/plans/mission-plan.mdThe current root plan artifact..ralphception/events/run-root.jsonlThe root event log.
The directory is intentionally disposable and should not be committed.
Continuity
Repo-local task state is backed by XDG lease state:
$XDG_STATE_HOME/ralphception/<workspace-hash>/lease.json
The recovery layer can:
- replay durable event logs
- reconcile checkpoints
- refuse healthy foreign leases
- steal stale leases in repair mode
- retry, restart, resume, or replace blocked runs
Development Commands
mise run install
mise run run
mise run test
mise run typecheck
Equivalent:
uv sync
uv run ralphception
uv run pytest -v
uv run ty check src tests
Codebase Map
If you want to understand the implementation, start here:
src/ralphception/app.pyProduct entry points for the inline shell and exec mode.src/ralphception/cli.pyPublic CLI surface.src/ralphception/runtime/inline_shell.pyDefault scrollback-first interactive shell.src/ralphception/runtime/supervisor.pyShared runtime mode resolution and artifact-first orchestration entry points.src/ralphception/runtime/bootstrap.pyDurable startup capture and intake artifact creation.src/ralphception/headless.pyLong-running headless orchestrator.src/ralphception/workflow/engine.pyCore run, stage, and bundle orchestration.src/ralphception/workflow/recovery.pyLease reconciliation and resume operations.src/ralphception/git/worktrees.pyWorktree lifecycle.src/ralphception/git/merge.pyMerge coordination.src/ralphception/audit/service.pyAudit findings and reopen behavior.
Mental Model For Porting
When using Ralphception for a port:
- run it in the destination repo
- point it at one or more source repos on disk
- reduce source behavior into approved specs
- turn approved specs into plans and execution bundles
- execute child runs against the destination repo
- verify, merge, audit, and reopen until blocking gaps are gone
The source repo is input, not where Ralphception writes its state.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ralphception-0.2.0.tar.gz.
File metadata
- Download URL: ralphception-0.2.0.tar.gz
- Upload date:
- Size: 576.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de90a0d928c8ee7101783b05cb731ec4d20f9387a215a87beef1f57fe37d0c6a
|
|
| MD5 |
5f390f35f0d99eb3a05e12fafe70f92c
|
|
| BLAKE2b-256 |
d08a54415155e823447b94706d29eca4ae6c7b47cc8cc868f3b04e5104918b8f
|
Provenance
The following attestation bundles were made for ralphception-0.2.0.tar.gz:
Publisher:
release.yml on shayne/ralphception
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ralphception-0.2.0.tar.gz -
Subject digest:
de90a0d928c8ee7101783b05cb731ec4d20f9387a215a87beef1f57fe37d0c6a - Sigstore transparency entry: 1191573348
- Sigstore integration time:
-
Permalink:
shayne/ralphception@9413e21aafc434a55143244992e113c5c9f12f8e -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/shayne
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9413e21aafc434a55143244992e113c5c9f12f8e -
Trigger Event:
push
-
Statement type:
File details
Details for the file ralphception-0.2.0-py3-none-any.whl.
File metadata
- Download URL: ralphception-0.2.0-py3-none-any.whl
- Upload date:
- Size: 304.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
348c9114f2039354a396447af457dc831af3a1c26b354f370204f1e2c1aaf2c8
|
|
| MD5 |
725040c50d4887a10d367d3d8083edf9
|
|
| BLAKE2b-256 |
bf0f3a7a036a5113fca6ac3862af207a23ea5736c143d747f1546c88555d19ce
|
Provenance
The following attestation bundles were made for ralphception-0.2.0-py3-none-any.whl:
Publisher:
release.yml on shayne/ralphception
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ralphception-0.2.0-py3-none-any.whl -
Subject digest:
348c9114f2039354a396447af457dc831af3a1c26b354f370204f1e2c1aaf2c8 - Sigstore transparency entry: 1191573352
- Sigstore integration time:
-
Permalink:
shayne/ralphception@9413e21aafc434a55143244992e113c5c9f12f8e -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/shayne
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9413e21aafc434a55143244992e113c5c9f12f8e -
Trigger Event:
push
-
Statement type: