ralphception 0.1.0__tar.gz

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.
Files changed (158) hide show
  1. ralphception-0.1.0/.github/workflows/release.yml +30 -0
  2. ralphception-0.1.0/.gitignore +5 -0
  3. ralphception-0.1.0/.mise.toml +14 -0
  4. ralphception-0.1.0/PKG-INFO +381 -0
  5. ralphception-0.1.0/README.md +371 -0
  6. ralphception-0.1.0/docs/superpowers/plans/2026-03-15-ralphception-core-runtime.md +988 -0
  7. ralphception-0.1.0/docs/superpowers/plans/2026-03-17-ralphception-bootstrap-loop.md +530 -0
  8. ralphception-0.1.0/docs/superpowers/plans/2026-03-20-codex-app-server-backend.md +169 -0
  9. ralphception-0.1.0/docs/superpowers/plans/2026-03-20-headless-mission-supervisor.md +267 -0
  10. ralphception-0.1.0/docs/superpowers/plans/2026-03-20-mission-cleanup.md +81 -0
  11. ralphception-0.1.0/docs/superpowers/plans/2026-03-20-runtime-state-simplification.md +53 -0
  12. ralphception-0.1.0/docs/superpowers/plans/2026-03-20-shared-runtime-frontends.md +405 -0
  13. ralphception-0.1.0/docs/superpowers/plans/2026-03-20-terminal-live-logging.md +126 -0
  14. ralphception-0.1.0/docs/superpowers/plans/2026-03-21-parallel-actor-runtime.md +507 -0
  15. ralphception-0.1.0/docs/superpowers/specs/2026-03-15-ralphception-design.md +1614 -0
  16. ralphception-0.1.0/docs/superpowers/specs/2026-03-17-ralphception-bootstrap-loop-design.md +427 -0
  17. ralphception-0.1.0/docs/superpowers/specs/2026-03-20-mission-cleanup-design.md +102 -0
  18. ralphception-0.1.0/docs/superpowers/specs/2026-03-20-runtime-state-simplification-design.md +86 -0
  19. ralphception-0.1.0/docs/superpowers/specs/2026-03-20-shared-runtime-frontends-design.md +255 -0
  20. ralphception-0.1.0/docs/superpowers/specs/2026-03-20-terminal-live-logging-design.md +81 -0
  21. ralphception-0.1.0/docs/superpowers/specs/2026-03-21-parallel-actor-runtime-design.md +507 -0
  22. ralphception-0.1.0/pyproject.toml +41 -0
  23. ralphception-0.1.0/ralph.sh +33 -0
  24. ralphception-0.1.0/src/parser.py +1 -0
  25. ralphception-0.1.0/src/ralphception/__init__.py +8 -0
  26. ralphception-0.1.0/src/ralphception/_version.py +34 -0
  27. ralphception-0.1.0/src/ralphception/actor_runtime/__init__.py +20 -0
  28. ralphception-0.1.0/src/ralphception/actor_runtime/intake_actor.py +116 -0
  29. ralphception-0.1.0/src/ralphception/actor_runtime/merge_actor.py +88 -0
  30. ralphception-0.1.0/src/ralphception/actor_runtime/orchestrator.py +110 -0
  31. ralphception-0.1.0/src/ralphception/actor_runtime/planner_actor.py +47 -0
  32. ralphception-0.1.0/src/ralphception/actor_runtime/scheduler_actor.py +65 -0
  33. ralphception-0.1.0/src/ralphception/actor_runtime/worker_actor.py +59 -0
  34. ralphception-0.1.0/src/ralphception/app.py +467 -0
  35. ralphception-0.1.0/src/ralphception/audit/__init__.py +5 -0
  36. ralphception-0.1.0/src/ralphception/audit/service.py +193 -0
  37. ralphception-0.1.0/src/ralphception/bootstrap/__init__.py +25 -0
  38. ralphception-0.1.0/src/ralphception/bootstrap/contracts.py +252 -0
  39. ralphception-0.1.0/src/ralphception/bootstrap/prompting.py +110 -0
  40. ralphception-0.1.0/src/ralphception/bootstrap/runner.py +406 -0
  41. ralphception-0.1.0/src/ralphception/bootstrap/script.py +56 -0
  42. ralphception-0.1.0/src/ralphception/bootstrap/storage.py +320 -0
  43. ralphception-0.1.0/src/ralphception/bundled_skills/__init__.py +1 -0
  44. ralphception-0.1.0/src/ralphception/bundled_skills/audit.review.md +3 -0
  45. ralphception-0.1.0/src/ralphception/bundled_skills/bootstrap.loop.md +104 -0
  46. ralphception-0.1.0/src/ralphception/bundled_skills/brainstorm.default.md +3 -0
  47. ralphception-0.1.0/src/ralphception/bundled_skills/execute.task.md +3 -0
  48. ralphception-0.1.0/src/ralphception/bundled_skills/merge.coordinator.md +3 -0
  49. ralphception-0.1.0/src/ralphception/bundled_skills/plan.write.md +3 -0
  50. ralphception-0.1.0/src/ralphception/bundled_skills/run.summary.md +3 -0
  51. ralphception-0.1.0/src/ralphception/bundled_skills/spec.write.md +3 -0
  52. ralphception-0.1.0/src/ralphception/cli.py +100 -0
  53. ralphception-0.1.0/src/ralphception/codex/__init__.py +33 -0
  54. ralphception-0.1.0/src/ralphception/codex/client.py +714 -0
  55. ralphception-0.1.0/src/ralphception/codex/session_manager.py +411 -0
  56. ralphception-0.1.0/src/ralphception/config.py +337 -0
  57. ralphception-0.1.0/src/ralphception/git/__init__.py +52 -0
  58. ralphception-0.1.0/src/ralphception/git/identity.py +46 -0
  59. ralphception-0.1.0/src/ralphception/git/merge.py +1185 -0
  60. ralphception-0.1.0/src/ralphception/git/worktrees.py +643 -0
  61. ralphception-0.1.0/src/ralphception/headless.py +1715 -0
  62. ralphception-0.1.0/src/ralphception/models/__init__.py +103 -0
  63. ralphception-0.1.0/src/ralphception/models/artifacts.py +32 -0
  64. ralphception-0.1.0/src/ralphception/models/commit_intents.py +38 -0
  65. ralphception-0.1.0/src/ralphception/models/events.py +167 -0
  66. ralphception-0.1.0/src/ralphception/models/mission.py +55 -0
  67. ralphception-0.1.0/src/ralphception/models/runtime.py +272 -0
  68. ralphception-0.1.0/src/ralphception/models/session.py +47 -0
  69. ralphception-0.1.0/src/ralphception/models/todos.py +44 -0
  70. ralphception-0.1.0/src/ralphception/models/verification.py +168 -0
  71. ralphception-0.1.0/src/ralphception/models/worktree.py +34 -0
  72. ralphception-0.1.0/src/ralphception/paths.py +83 -0
  73. ralphception-0.1.0/src/ralphception/runtime/__init__.py +23 -0
  74. ralphception-0.1.0/src/ralphception/runtime/frontends.py +121 -0
  75. ralphception-0.1.0/src/ralphception/runtime/supervisor.py +694 -0
  76. ralphception-0.1.0/src/ralphception/runtime/terminal.py +193 -0
  77. ralphception-0.1.0/src/ralphception/skills/__init__.py +41 -0
  78. ralphception-0.1.0/src/ralphception/skills/contracts.py +148 -0
  79. ralphception-0.1.0/src/ralphception/skills/registry.py +177 -0
  80. ralphception-0.1.0/src/ralphception/storage/__init__.py +31 -0
  81. ralphception-0.1.0/src/ralphception/storage/artifacts.py +74 -0
  82. ralphception-0.1.0/src/ralphception/storage/bootstrap.py +34 -0
  83. ralphception-0.1.0/src/ralphception/storage/checkpoints.py +52 -0
  84. ralphception-0.1.0/src/ralphception/storage/commit_intents.py +47 -0
  85. ralphception-0.1.0/src/ralphception/storage/events.py +186 -0
  86. ralphception-0.1.0/src/ralphception/storage/files.py +75 -0
  87. ralphception-0.1.0/src/ralphception/storage/lease.py +211 -0
  88. ralphception-0.1.0/src/ralphception/storage/mission_store.py +54 -0
  89. ralphception-0.1.0/src/ralphception/storage/todos.py +31 -0
  90. ralphception-0.1.0/src/ralphception/testing/__init__.py +1 -0
  91. ralphception-0.1.0/src/ralphception/testing/fakes.py +353 -0
  92. ralphception-0.1.0/src/ralphception/ui/__init__.py +3 -0
  93. ralphception-0.1.0/src/ralphception/ui/app.py +666 -0
  94. ralphception-0.1.0/src/ralphception/ui/screens/__init__.py +24 -0
  95. ralphception-0.1.0/src/ralphception/ui/screens/review.py +584 -0
  96. ralphception-0.1.0/src/ralphception/ui/screens/startup.py +232 -0
  97. ralphception-0.1.0/src/ralphception/ui/widgets/__init__.py +16 -0
  98. ralphception-0.1.0/src/ralphception/ui/widgets/command_bar.py +16 -0
  99. ralphception-0.1.0/src/ralphception/ui/widgets/detail_pane.py +37 -0
  100. ralphception-0.1.0/src/ralphception/ui/widgets/event_feed.py +27 -0
  101. ralphception-0.1.0/src/ralphception/ui/widgets/workflow_tree.py +56 -0
  102. ralphception-0.1.0/src/ralphception/verification/__init__.py +15 -0
  103. ralphception-0.1.0/src/ralphception/verification/service.py +348 -0
  104. ralphception-0.1.0/src/ralphception/workflow/__init__.py +1 -0
  105. ralphception-0.1.0/src/ralphception/workflow/_identifiers.py +12 -0
  106. ralphception-0.1.0/src/ralphception/workflow/approvals.py +170 -0
  107. ralphception-0.1.0/src/ralphception/workflow/bundles.py +424 -0
  108. ralphception-0.1.0/src/ralphception/workflow/engine.py +322 -0
  109. ralphception-0.1.0/src/ralphception/workflow/recovery.py +240 -0
  110. ralphception-0.1.0/tests/e2e/fixtures/generic_repo/pyproject.toml +4 -0
  111. ralphception-0.1.0/tests/e2e/fixtures/generic_repo/src/app.py +2 -0
  112. ralphception-0.1.0/tests/e2e/fixtures/source_repo/src/port_me.ts +3 -0
  113. ralphception-0.1.0/tests/e2e/fixtures/source_repo/tests/test_port_me.py +9 -0
  114. ralphception-0.1.0/tests/e2e/fixtures/target_repo/pyproject.toml +4 -0
  115. ralphception-0.1.0/tests/e2e/fixtures/target_repo/src/__init__.py +2 -0
  116. ralphception-0.1.0/tests/e2e/test_core_runtime.py +492 -0
  117. ralphception-0.1.0/tests/integration/test_actor_runtime_merge_selection.py +49 -0
  118. ralphception-0.1.0/tests/integration/test_actor_runtime_parallel.py +74 -0
  119. ralphception-0.1.0/tests/integration/test_actor_runtime_resume.py +87 -0
  120. ralphception-0.1.0/tests/integration/test_bootstrap_runner.py +341 -0
  121. ralphception-0.1.0/tests/integration/test_headless_supervisor.py +243 -0
  122. ralphception-0.1.0/tests/integration/test_merge_coordinator.py +1322 -0
  123. ralphception-0.1.0/tests/integration/test_recovery.py +442 -0
  124. ralphception-0.1.0/tests/integration/test_session_manager.py +163 -0
  125. ralphception-0.1.0/tests/integration/test_startup_flow.py +1100 -0
  126. ralphception-0.1.0/tests/integration/test_terminal_frontend.py +743 -0
  127. ralphception-0.1.0/tests/integration/test_workflow_engine.py +291 -0
  128. ralphception-0.1.0/tests/integration/test_worktree_coordinator.py +1186 -0
  129. ralphception-0.1.0/tests/test_parser.py +2 -0
  130. ralphception-0.1.0/tests/unit/test_actor_runtime_models.py +44 -0
  131. ralphception-0.1.0/tests/unit/test_approvals.py +241 -0
  132. ralphception-0.1.0/tests/unit/test_audit_service.py +220 -0
  133. ralphception-0.1.0/tests/unit/test_bootstrap_contracts.py +140 -0
  134. ralphception-0.1.0/tests/unit/test_bootstrap_prompting.py +122 -0
  135. ralphception-0.1.0/tests/unit/test_bootstrap_script.py +19 -0
  136. ralphception-0.1.0/tests/unit/test_bootstrap_storage.py +161 -0
  137. ralphception-0.1.0/tests/unit/test_bundles.py +510 -0
  138. ralphception-0.1.0/tests/unit/test_cli_bootstrap.py +259 -0
  139. ralphception-0.1.0/tests/unit/test_codex_client.py +304 -0
  140. ralphception-0.1.0/tests/unit/test_config.py +343 -0
  141. ralphception-0.1.0/tests/unit/test_dashboard_app.py +64 -0
  142. ralphception-0.1.0/tests/unit/test_event_store.py +287 -0
  143. ralphception-0.1.0/tests/unit/test_git_identity.py +89 -0
  144. ralphception-0.1.0/tests/unit/test_headless_contracts.py +82 -0
  145. ralphception-0.1.0/tests/unit/test_merge_actor.py +41 -0
  146. ralphception-0.1.0/tests/unit/test_mission_store.py +46 -0
  147. ralphception-0.1.0/tests/unit/test_runtime_models.py +1423 -0
  148. ralphception-0.1.0/tests/unit/test_runtime_supervisor.py +95 -0
  149. ralphception-0.1.0/tests/unit/test_scheduler_actor.py +80 -0
  150. ralphception-0.1.0/tests/unit/test_session_models.py +86 -0
  151. ralphception-0.1.0/tests/unit/test_skill_registry.py +167 -0
  152. ralphception-0.1.0/tests/unit/test_storage_artifacts.py +95 -0
  153. ralphception-0.1.0/tests/unit/test_storage_bootstrap.py +131 -0
  154. ralphception-0.1.0/tests/unit/test_ui_commands.py +458 -0
  155. ralphception-0.1.0/tests/unit/test_verification_models.py +547 -0
  156. ralphception-0.1.0/tests/unit/test_verification_service.py +369 -0
  157. ralphception-0.1.0/tests/unit/test_worktree_models.py +133 -0
  158. ralphception-0.1.0/uv.lock +376 -0
@@ -0,0 +1,30 @@
1
+ name: Release to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ jobs:
9
+ build-and-publish:
10
+ runs-on: ubuntu-latest
11
+ environment:
12
+ name: pypi
13
+ url: https://pypi.org/p/ralphception
14
+ permissions:
15
+ contents: read
16
+ id-token: write
17
+ steps:
18
+ - name: Check out repository
19
+ uses: actions/checkout@v5
20
+ with:
21
+ fetch-depth: 0
22
+
23
+ - name: Set up uv
24
+ uses: astral-sh/setup-uv@v7
25
+
26
+ - name: Build distributions
27
+ run: uv build
28
+
29
+ - name: Publish to PyPI
30
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,5 @@
1
+ .ralphception/
2
+ .worktrees/
3
+ src/ralphception/_version.py
4
+ __pycache__/
5
+ *.pyc
@@ -0,0 +1,14 @@
1
+ [tools]
2
+ python = "3.12"
3
+
4
+ [tasks.install]
5
+ run = "uv sync"
6
+
7
+ [tasks.test]
8
+ run = "uv run pytest -v"
9
+
10
+ [tasks.typecheck]
11
+ run = "uv run ty check src tests"
12
+
13
+ [tasks.run]
14
+ run = "uv run ralphception"
@@ -0,0 +1,381 @@
1
+ Metadata-Version: 2.4
2
+ Name: ralphception
3
+ Version: 0.1.0
4
+ Summary: Codex-native orchestration runtime.
5
+ Requires-Python: >=3.12
6
+ Requires-Dist: pydantic<3,>=2
7
+ Requires-Dist: textual<1.0,>=0.61
8
+ Requires-Dist: typer<1.0,>=0.12
9
+ Description-Content-Type: text/markdown
10
+
11
+ # Ralphception
12
+
13
+ `ralphception` is a Codex-native agent orchestrator for "Ralph loops of Ralph loops":
14
+
15
+ - one outer run per target repo
16
+ - child runs for spec extraction, planning, execution, merge, and audit
17
+ - parallel child work where it is safe
18
+ - repeated audit/reopen cycles until blocking gaps are gone
19
+
20
+ The core runtime is implemented and tested. The current repo is best understood as an alpha runtime with real storage, workflow, recovery, review, and dashboard layers, but not yet a fully polished one-command product UX.
21
+
22
+ ## Current Status
23
+
24
+ What is implemented today:
25
+
26
+ - repo-local `.ralphception/` runtime state and config
27
+ - XDG-backed lease and resume state
28
+ - workflow engine, approvals, bundles, recovery, verification, audit, worktrees, and merge coordination
29
+ - one shared runtime supervisor with two frontends:
30
+ - a Textual TUI launched by `uv run ralphception`
31
+ - a traditional terminal frontend launched by `uv run ralphception terminal`
32
+ - interactive startup and review screens backed by the same shared runtime supervisor
33
+ - automatic first-child execution startup from the TUI launch path once an execution bundle is approved and a session backend is available
34
+ - long-running terminal execution that uses the same durable mission loop as the TUI
35
+ - end-to-end tests with deterministic fake Codex/session behavior
36
+
37
+ What is not fully polished yet:
38
+
39
+ - `ralphception resume` now resumes the current workspace root run in `read` or `repair` mode, but the top-level CLI still does not expose historical-run selection
40
+ - release automation / PyPI publishing / final `uvx` polish are still follow-on work
41
+
42
+ ## How To Think About It
43
+
44
+ There is one runtime and two frontends today:
45
+
46
+ ```mermaid
47
+ flowchart TD
48
+ A["Shared runtime supervisor"] --> B["Textual frontend"]
49
+ A --> C["Terminal frontend"]
50
+ B --> D["Startup / review / dashboard surfaces"]
51
+ C --> E["Logs + focused prompts"]
52
+ ```
53
+
54
+ The intended product flow is:
55
+
56
+ ```mermaid
57
+ flowchart TD
58
+ A["Seed prompt + optional source repos"] --> B["Startup / intake"]
59
+ B --> C["Spec generation"]
60
+ C --> D["Spec review"]
61
+ D --> E["Plan / bundle generation"]
62
+ E --> F["Bundle review"]
63
+ F --> G["Execution child runs"]
64
+ G --> H["Merge + verification"]
65
+ H --> I["Audit loop"]
66
+ I --> J{"Open P0/P1/P2?"}
67
+ J -- yes --> E
68
+ J -- no --> K["Done"]
69
+ ```
70
+
71
+ The important distinction is that the runtime loop is now shared. The Textual and terminal entrypoints are different surfaces over the same durable mission state and the same execution/audit/reopen cycle.
72
+
73
+ ## Quick Start
74
+
75
+ Local development usage today:
76
+
77
+ ```bash
78
+ mise run install
79
+ mise run run
80
+ ```
81
+
82
+ Equivalent `uv` commands:
83
+
84
+ ```bash
85
+ uv sync
86
+ uv run ralphception
87
+ uv run ralphception terminal
88
+ ```
89
+
90
+ Once the package is published, the intended entrypoint is:
91
+
92
+ ```bash
93
+ uvx ralphception
94
+ ```
95
+
96
+ ## What Happens On Launch
97
+
98
+ `uv run ralphception` resolves the current workspace and does one of three things in the TUI frontend:
99
+
100
+ 1. Startup mode if `.ralphception/runs/run-root/startup.json` does not exist.
101
+ 2. Review mode if spec approval, execution-bundle approval, or blocked-run recovery is pending.
102
+ 3. Dashboard mode otherwise.
103
+
104
+ `uv run ralphception terminal` resolves the same runtime state, but renders it as logs and prompts instead of panes.
105
+
106
+ The runtime always works inside the target repo and writes ephemeral runtime state under `.ralphception/`.
107
+ That directory is intentionally disposable and should not be committed to git.
108
+ When dashboard mode opens against an approved execution bundle with no existing child runs, the launch path still starts the first execution child run before rendering the dashboard.
109
+
110
+ ## How To Use It Today
111
+
112
+ ### 1. Bootstrap a workspace
113
+
114
+ Run:
115
+
116
+ ```bash
117
+ uv run ralphception
118
+ ```
119
+
120
+ If the workspace has not been bootstrapped yet, the startup screen now prompts for:
121
+
122
+ - a seed prompt for the outer run
123
+ - optional source repository paths, one path per line
124
+
125
+ Submitting the form persists `.ralphception/runs/run-root/startup.json`, writes the intake
126
+ artifact, and then launches the resolved runtime view for the workspace.
127
+
128
+ If you want the same top-level mission loop without opening Textual, use the terminal frontend:
129
+
130
+ ```bash
131
+ uv run ralphception terminal \
132
+ --seed-prompt "port parser" \
133
+ --source-repo /path/to/source-repo \
134
+ --approve-all
135
+ ```
136
+
137
+ `uv run ralphception headless ...` remains as a compatibility alias during the transition.
138
+
139
+ Useful flags:
140
+
141
+ - `--repo-root <path>` to operate on another workspace
142
+ - `--approve-all` to auto-approve spec and execution-bundle review targets so the supervisor can run to terminal completion without a human
143
+ - `--fake-session-manager` to inject the deterministic fake Codex backend used by the test suite when you want to verify the full loop without a live session backend
144
+
145
+ Terminal execution requires either the `codex` CLI on your `PATH` or `--fake-session-manager`.
146
+ `uv sync` only installs Ralphception's Python dependencies; the live session backend comes from the Codex CLI's `app-server`.
147
+ If neither is available, `uv run ralphception terminal ...` now exits immediately with a backend error instead of falling back to dashboard mode.
148
+
149
+ The terminal frontend behaves as a long-running mission supervisor:
150
+
151
+ - bootstrap intake if needed
152
+ - generate or reuse spec and plan artifacts
153
+ - approve the spec and execution bundle when `--approve-all` is set
154
+ - create child worktrees, execute, verify, merge, and audit
155
+ - reopen execution automatically when audit leaves blocking `P0`/`P1`/`P2` findings open
156
+ - exit only after terminal completion or failure
157
+
158
+ While the mission is running, the terminal frontend now streams readable high-level progress such as stage changes, turn start/completion, approvals, child-run creation, verification outcomes, merges, audit reopen decisions, and mission completion.
159
+
160
+ The durable mission-loop state for the root run lives at:
161
+
162
+ ```text
163
+ .ralphception/runs/run-root/headless-state.json
164
+ ```
165
+
166
+ The default stage artifacts are:
167
+
168
+ ```text
169
+ .ralphception/specs/mission-spec.md
170
+ .ralphception/plans/mission-plan.md
171
+ .ralphception/plans/mission-plan.json
172
+ .ralphception/runs/<child-run-id>/handoff.json
173
+ .ralphception/runs/run-root/audit-findings.json
174
+ ```
175
+
176
+ To monitor a running terminal mission, tail the root event log from another shell:
177
+
178
+ ```bash
179
+ tail -f .ralphception/events/run-root.jsonl
180
+ ```
181
+
182
+ ### 1a. Bootstrap finisher helper
183
+
184
+ When you are using Ralphception to finish Ralphception itself, the helper-only loop state lives under:
185
+
186
+ ```text
187
+ .ralphception/bootstrapping/
188
+ |- finish-criteria.md
189
+ |- gaps.json
190
+ |- gaps.md
191
+ |- inputs.json
192
+ |- prompt.txt
193
+ `- iterations/
194
+ ```
195
+
196
+ There is now a repo-root `ralph.sh` loop entrypoint. It repeatedly runs one bootstrap iteration at a time until the loop is done, stops for human review, or exits on failure:
197
+
198
+ ```bash
199
+ ./ralph.sh
200
+ ```
201
+
202
+ It calls `uv run python -m ralphception.bootstrap.runner --loop-once`, refreshes the bootstrap prompt and command, launches a fresh `codex exec` iteration, and lets Python decide whether to continue, stop for review, or finish.
203
+
204
+ ### 2. Understand what the runtime wrote
205
+
206
+ The workspace layout looks like this:
207
+
208
+ ```text
209
+ .ralphception/
210
+ |- config.toml
211
+ |- approvals/
212
+ |- events/
213
+ |- findings/
214
+ |- merge/
215
+ |- plans/
216
+ |- runs/
217
+ |- skills/
218
+ |- specs/
219
+ |- todos/
220
+ `- verification/
221
+ ```
222
+
223
+ Important files early in the flow:
224
+
225
+ - `.ralphception/config.toml`
226
+ The persisted runtime config.
227
+ - `.ralphception/runs/run-root/startup.json`
228
+ The seed prompt and source repo capture.
229
+ - `.ralphception/runs/run-root/intake.md`
230
+ The intake artifact written from the seed prompt.
231
+
232
+ ### 3. Use the dashboard when the runtime reaches dashboard mode
233
+
234
+ The dashboard supports these slash commands:
235
+
236
+ - `/help`
237
+ - `/model <name>`
238
+ - `/resume [repair]`
239
+ - `/status`
240
+ - `/artifacts`
241
+ - `/approve`
242
+ - `/retry`
243
+ - `/restart`
244
+ - `/replace`
245
+ - `/abort`
246
+
247
+ Right now the dashboard is the main interactive surface that is actually wired.
248
+ It now launches with recovery configured, and if the workspace already has an approved execution bundle the initial execution child run is scheduled before the dashboard renders.
249
+
250
+ ### 4. Use review mode when review is pending
251
+
252
+ When the workspace has a pending spec review, execution-bundle approval, or recovery-eligible blocked run, `uv run ralphception` now opens an interactive review screen. It shows:
253
+
254
+ - the pending review and recovery targets for the workspace
255
+ - a details pane for the selected target
256
+ - a diff pane for spec or execution-bundle artifacts
257
+ - approve, resume, retry, restart, and replace actions when they apply
258
+
259
+ The Python controller surface still exists for scripting and tests. If you want to inspect the current target programmatically:
260
+
261
+ ```bash
262
+ uv run python - <<'PY'
263
+ from pathlib import Path
264
+ from ralphception.app import resolve_runtime_view
265
+
266
+ launch = resolve_runtime_view(Path.cwd())
267
+ assert launch.review_controller is not None
268
+
269
+ target = launch.review_controller.current_target()
270
+ print(target)
271
+ print()
272
+ print(launch.review_controller.diff_current_target().rendered_text)
273
+ PY
274
+ ```
275
+
276
+ ## Default Runtime Config
277
+
278
+ By default, Ralphception writes `.ralphception/config.toml` with:
279
+
280
+ - model: `gpt-5.4`
281
+ - reasoning: `high`
282
+ - latency profile: `fast`
283
+ - sandbox: `danger-full-access`
284
+ - approval policy: `never`
285
+ - worktrees for edit runs: enabled
286
+ - max parallel children: `4`
287
+ - audit reopen priorities: `P0`, `P1`, `P2`
288
+
289
+ The dashboard `/model` command updates the persisted config.
290
+
291
+ ## How Resume Works
292
+
293
+ Repo-local state lives in `.ralphception/`, but authoritative lease state is stored in XDG state:
294
+
295
+ ```text
296
+ $XDG_STATE_HOME/ralphception/<workspace-hash>/lease.json
297
+ ```
298
+
299
+ The recovery layer can:
300
+
301
+ - read durable event logs
302
+ - reconcile checkpoints
303
+ - refuse healthy foreign leases
304
+ - steal stale leases in repair mode
305
+ - retry, restart, or replace blocked runs
306
+
307
+ The top-level CLI now exposes the current workspace root-run resume path:
308
+
309
+ ```bash
310
+ uv run ralphception resume
311
+ uv run ralphception resume repair
312
+ uv run ralphception terminal --approve-all --fake-session-manager
313
+ ```
314
+
315
+ The dashboard `/resume` command uses the same `read` or `repair` recovery flow. Explicit historical-run targeting is still a recovery-layer capability rather than a CLI surface.
316
+
317
+ ## The Mental Model For Porting
318
+
319
+ If you are using Ralphception for porting, think about it as:
320
+
321
+ 1. Run it in the destination repo.
322
+ 2. Point it at one or more source repos elsewhere on disk.
323
+ 3. Reduce source behavior into specs under `.ralphception/specs/`.
324
+ 4. Turn approved specs into plans and execution bundles.
325
+ 5. Execute child runs against the target repo.
326
+ 6. Verify, merge, audit, and reopen until blocking gaps are gone.
327
+
328
+ The source repo is input, not the place where Ralphception writes its state.
329
+
330
+ ## Development Commands
331
+
332
+ ```bash
333
+ mise run install
334
+ mise run run
335
+ mise run test
336
+ mise run typecheck
337
+ ```
338
+
339
+ Equivalent:
340
+
341
+ ```bash
342
+ uv sync
343
+ uv run ralphception
344
+ uv run pytest -v
345
+ uv run ty check src tests
346
+ ```
347
+
348
+ ## What To Read In The Codebase
349
+
350
+ If you want to understand the implementation, start here:
351
+
352
+ - `src/ralphception/app.py`
353
+ Runtime mode resolution and app bootstrap.
354
+ - `src/ralphception/ui/app.py`
355
+ Dashboard controller and slash commands.
356
+ - `src/ralphception/ui/screens/startup.py`
357
+ First-run bootstrap capture.
358
+ - `src/ralphception/ui/screens/review.py`
359
+ Approval and recovery review logic.
360
+ - `src/ralphception/workflow/engine.py`
361
+ Core run/stage/bundle orchestration.
362
+ - `src/ralphception/workflow/recovery.py`
363
+ Resume, retry, restart, replace, lease reconciliation.
364
+ - `src/ralphception/git/worktrees.py`
365
+ Worktree lifecycle.
366
+ - `src/ralphception/git/merge.py`
367
+ Merge coordination.
368
+ - `src/ralphception/audit/service.py`
369
+ Audit findings and reopen behavior.
370
+ - `src/ralphception/verification/service.py`
371
+ Verification task construction and result persistence.
372
+
373
+ ## Short Version
374
+
375
+ If you want the practical answer:
376
+
377
+ - today, use `uv run ralphception` locally
378
+ - bootstrap the first run with the `StartupBootstrapController` snippet above
379
+ - inspect `.ralphception/` to understand what the runtime has written
380
+ - use the dashboard slash commands for the currently wired interactive surface
381
+ - think of the project as a real core runtime that still needs a final layer of polished operator UX