Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
6f7f23d
Add Ralph mode config and state model for #335 (#341)
codejeet Apr 1, 2026
9413282
Reduce blocker alert churn for #340 (#342)
codejeet Apr 1, 2026
f3ebb43
Add first-class web deploy flow (#339) (#343)
codejeet Apr 1, 2026
430efba
Fix plan control-path canonical repo sync (#337) (#344)
codejeet Apr 1, 2026
a4b0cfd
Harden live-state recovery and continuation binding for #338 (#346)
codejeet Apr 1, 2026
0387b1e
Fix plan continuation underfill recovery (#336) (#347)
codejeet Apr 1, 2026
be79f77
Fix Ralph continuation refill handling (#350) (#352)
codejeet Apr 1, 2026
8c5fc0c
Fix #348 plan continuation reconcile and scoped refresh (#353)
codejeet Apr 1, 2026
4cf78a2
Implement President Ralph refill decisions (#351)
codejeet Apr 1, 2026
af23acf
Fix mayor notify fail-open path for #354 (#355)
codejeet Apr 1, 2026
fbb15a9
Add Ralph latest-main proof path for #361 (#362)
codejeet Apr 1, 2026
4c54fa2
Fix plan-task duplicate redispatch fallout for #364 (#365)
codejeet Apr 1, 2026
ab4493e
Expose Ralph controls in cockpit and status surfaces (#367) (#369)
codejeet Apr 1, 2026
d813c00
Keep per-rig mayors resident under President mode (#371) (#372)
codejeet Apr 1, 2026
de65a9a
Fix per-rig mayor scope restoration
codejeet Apr 1, 2026
9bd46b5
Fix per-rig mayor scope restoration under President mode (#373)
codejeet Apr 1, 2026
a6379d2
Add Ralph redispatch regression for #363 (#374)
codejeet Apr 1, 2026
a32de68
Fix Ralph acceptance drift (#366) (#381)
codejeet Apr 1, 2026
ba3d771
Fence President interventions on hibernated rigs (#378) (#382)
codejeet Apr 1, 2026
779ddff
Skip President refreshes for hibernated rigs (#357) (#383)
codejeet Apr 1, 2026
041c9fb
Add regression coverage for #356 duplicate-closeout refill (#385)
codejeet Apr 1, 2026
c8e05b8
Fix Ralph acceptance snapshot drift (#379)
codejeet Apr 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

- Added per-rig Ralph mode config via `sgt config ralph`, with a normalized Ralph state model in status/plan-state/cockpit output and explicit concurrency-accounting rules for admissible vs support-only vs duplicate lanes.
- President and rig-activity logic now treat an enabled unmet Ralph condition as active work, emit dedicated Ralph underfill/idle intervention reasons, and keep stale `verified` / `waived` acceptance metadata from falsely terminating plan completion while Ralph remains unmet.
- Added `test_ralph_mode_latest_main_proof.sh` plus README guidance as the explicit latest-main proof path for Ralph mode, bundling config/state, President supervision, refill recovery, and cockpit visibility coverage.
- Mayor now auto-refreshes at runtime when the estimated AI prompt exceeds `SGT_MAYOR_AUTO_REFRESH_TOKENS` (default `150000`), using the same handoff/archive path as `sgt mayor refresh` plus a cooldown guard.
- `sgt status` and `sgt status --json` now expose the latest Mayor prompt-budget estimate and last automatic refresh metadata.
- `sgt context index` now writes through unique fsynced temp files before `os.replace`, avoiding concurrent rebuild corruption of `~/.sgt/context/<rig>/index.json`.
Expand Down
56 changes: 56 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ The repo includes a minimal Web UI for realtime monitoring and dispatch:

- Docs / quick start: [`web/README.md`](web/README.md)
- Default URL: `http://localhost:4747`
- First-class deploy path: `sgt web deploy` from the repo checkout, then `sgt web status` / `sgt web verify` to confirm the live served tree really matches the repo source
- Latest-main cockpit proof: `./test_web_cockpit_latest_main_proof.sh`

## Why SGT exists (short)
Expand Down Expand Up @@ -86,6 +87,7 @@ cat verification.md | sgt create blocker <rig> -
What happens:
- the blocker evidence is appended to the rig’s shared `SGT_CONTEXT.md`
- a durable blocker record is created under `~/sgt/.sgt/acceptance-blockers/`
- blocker records now carry a stable `SEVERITY_CLASS` plus `DEDUPE_KEY` so operator surfaces can separate control-plane incidents from normal still-red candidate churn and collapse repeated same-key pulses into one summary
- the Mayor is woken immediately to re-create actionable work if the rig is otherwise idle
- periodic mayor cycles will no longer treat an empty issue/PR board as success while the blocker remains open

Expand Down Expand Up @@ -206,6 +208,60 @@ sgt plan tick scrapegoat
sgt wake-mayor "plan-update:scrapegoat"
```

## Ralph Mode

Ralph mode pins a rig into ongoing work until an explicit operator-owned Ralph condition is satisfied or the operator disables Ralph mode.

Configure it per rig with:

```bash
sgt config ralph pmkb \
--enable \
--condition "1K PNL for 5m btc pipeline" \
--target 5
```

Optional knobs:

```bash
sgt config ralph pmkb --condition-status met
sgt config ralph pmkb --count-support yes
sgt config ralph pmkb --disable
```

Current model:
- Ralph config lives in `~/.sgt/rig-config/<rig>.json` under `ralph_mode`.
- Ralph runtime state is computed from rig config plus live rig work and is also persisted into `~/.sgt/plan-state/<rig>.json` under `ralph`.
- While Ralph is enabled and `condition_status` is not `met` or `waived`, plan completion is forced back to a non-terminal pending rollup (`ralph-condition-unmet` or `ralph-underfilled`) even if stale acceptance metadata says `verified` or `waived`.
- `sgt status`, `sgt status --json`, and the Web cockpit expose Ralph state, condition, target concurrency, active lane count, admissible lane count, underfill state, and the latest President action for that rig.
- President treats Ralph underfill with existing admissible backlog as a bounded refill wake, but upgrades idle, fake-complete, or no-refillable-backlog Ralph states into a stronger refresh/contradiction intervention so the rig does not silently drift.

Concurrency accounting policy:
- A Ralph lane is a distinct open `sgt-authorized` issue number on that rig.
- Issues labeled `duplicate` or `redundant` never count toward Ralph concurrency.
- Issues labeled `support-only` or `cleanup-only` do not count by default; opt in with `sgt config ralph <rig> --count-support yes`.
- `active_lane_count` counts admissible lanes that currently have a live polecat on that issue.
- `backlog_lane_count` counts admissible open lanes that exist but are not currently active.

Example:
- Issue `#101` with a live polecat counts as one active Ralph lane.
- Issue `#102` labeled `support-only` does not count unless support lanes are enabled.
- Issue `#103` labeled `duplicate` never counts.

### Ralph latest-main proof path

Run this on a fresh checkout of the latest `master`/mainline commit when you want repo-owned proof that Ralph mode configuration, state exposure, concurrency accounting, and bounded refill behavior still work end to end:

```bash
./test_ralph_mode_latest_main_proof.sh
```

That proof path bundles the checks that matter for Ralph mode:
- `test_ralph_mode_config_and_state.sh` proves per-rig Ralph config, normalized state output, anti-false-completion semantics, and admissible/support/duplicate lane accounting.
- `test_president_runtime_supervision.sh` proves President distinguishes Ralph underfill, idle, and contradiction states and picks the expected bounded intervention.
- `test_mayor_stranded_zero_worker_recovery.sh` proves controller-side refill logic can top an actionable rig back up toward target live concurrency instead of leaving it quietly idle.
- `web/test/cockpit.test.js` proves the Web cockpit snapshot keeps Ralph state attached to each rig for operator visibility.

## CI self-healing (Mayor watchdog)

For rigs with `SGT_PLAN.json`, Mayor also watches the latest **master** GitHub Actions run.
Expand Down
Loading
Loading