Skip to content

feat(0.22.0): wire RCS control loop on bootstrap + doctor §23 closure verdict#65

Merged
broomva merged 3 commits into
mainfrom
feat/wire-control-loop-on-bootstrap
May 29, 2026
Merged

feat(0.22.0): wire RCS control loop on bootstrap + doctor §23 closure verdict#65
broomva merged 3 commits into
mainfrom
feat/wire-control-loop-on-bootstrap

Conversation

@broomva
Copy link
Copy Markdown
Owner

@broomva broomva commented May 29, 2026

Problem

bstack doctor reported a workspace's L1 layer "unstable" — and the investigation found the deeper cause: when bstack is instantiated, the control loop is declared but not closed.

  • Split-brain: onboard.sh (the wizard) wired the loop via install-rcs-stability.sh; bootstrap.sh (the /bstack bootstrap command — what the SKILL.md tells agents to run) never did. Freshly-bootstrapped workspaces had governance files but an open loop: no L0/L1 audit hooks, no .control/audit/, no closure-arc definitions.
  • Doctor under-reported closure: §16–18 (audit logs) and §21 (arcs) reported a missing/idle loop as soft [info]. There was no single verdict answering "is the loop wired, connected, and running?"

Note: the original "L1 unstable" reading came from doctor defaulting WORKSPACE="${BROOMVA_WORKSPACE:-$HOME/broomva}" — run from a sub-repo without BROOMVA_WORKSPACE, it measured the parent workspace. Flagged in CHANGELOG as a possible future UX fix; out of scope here.

Change

Makes /bstack bootstrap wire the loop, scaffold the loop definitions, and report loop liveness as a first-class verdict.

  • bootstrap.sh Phase 3.5 — calls install-rcs-stability.sh (L0 PostToolUse + L1 Stop audit hooks + .control/audit/ + L3 gates), reusing the same idempotent installer the wizard uses. BSTACK_SKIP_RCS=1 escape for governance-only bootstrap.
  • bootstrap.sh Phase 2 — scaffolds .control/arcs.yaml from template (the workspace's own editable loop definitions).
  • doctor.sh §23 — control-loop closure verdict: substrate-absent / wired-but-idle / wired+running+closing, from W (hooks+dir) / R (audit logs fresh <7d) / C (workspace arcs + composite-ω resolvable). Soft by default; BSTACK_LOOP_STRICT=1 + --strict together fail CI on an idle loop. §19 already hard-gates a wired loop that is genuinely diverging, so §23 does not double-count.
  • canary/01 asserts PostToolUse + .control/audit/ + .control/arcs.yaml + L0/L1 markers (14/14); docs + VERSION 0.21.10 → 0.22.0.

Dependency-chain (P14)

  • upstream: install-rcs-stability.sh (reused, unchanged) → install-l3-stability.sh (writes to $WORKSPACE — verified no PWD bug); arcs.yaml.template; compute-budget-status.sh / compute-arc-status.sh.
  • downstream: onboard.sh (already wired — now converges); repair.sh (already offers install-rcs); tests/canary/01; every workspace running bstack bootstrap / bstack doctor.

Verification (P11)

  • canary 01–05 green; arcs-validation / repair-merge-hooks / onboard suites green.
  • §23 verified across all three states + the wired+running+closing path (synthetic L0 event).
  • Strict-flag interaction verified: BSTACK_LOOP_STRICT=1 alone → exit 0; with --strict → exit 1.
  • Idempotency: bootstrap×2 and onboard↔bootstrap (both orderings) → zero duplicate hooks (disjoint _bstack_primitive markers).

Cross-Review (P20)

Strata B fresh-context adversarial review: 8.5/10, passes (≥7). No blocking findings. Four nits addressed in the same commit: BSTACK_LOOP_STRICT two-flag clarity (docs + Usage block + inline hint), tightened the C ("closing") signal to require the workspace's own arcs.yaml (not template fallback), corrected the || true comment (set -e without pipefail), fixed stale "28 skills" header → 31.

🤖 Generated with Claude Code

… verdict

Close the split-brain: onboard.sh wired the control loop via
install-rcs-stability.sh; bootstrap.sh (the /bstack bootstrap command) never
did, leaving freshly-bootstrapped workspaces with governance files but an OPEN
loop (no L0/L1 audit hooks, no .control/audit/, no closure-arc definitions).
doctor reported all of that as soft [info], so the open loop was invisible.

Dep-Chain (P14):
- upstream: scripts/install-rcs-stability.sh (reused, unchanged) →
  install-l3-stability.sh (writes to $WORKSPACE, verified no PWD bug);
  assets/templates/arcs.yaml.template; compute-budget-status.sh / compute-arc-status.sh.
- downstream: scripts/onboard.sh (already wired — now converges with bootstrap);
  scripts/repair.sh (already offers install-rcs); tests/canary/01; every workspace
  that runs `bstack bootstrap` or `bstack doctor`.

Changes:
- bootstrap.sh Phase 3.5: call install-rcs-stability.sh (BSTACK_SKIP_RCS=1 escape;
  `|| true` preserves non-blocking contract under set -e). Phase 2: scaffold
  .control/arcs.yaml from template.
- doctor.sh §23: control-loop closure verdict (substrate-absent / wired-but-idle /
  wired+running+closing) from W/R/C signals. Soft by default; BSTACK_LOOP_STRICT=1
  promotes wired-but-idle to a hard --strict gap. §19 already hard-gates a wired
  loop that is genuinely diverging, so §23 does not double-count.
- canary/01: assert PostToolUse hook + .control/audit/ + .control/arcs.yaml + L0/L1
  markers (14/14). references/new-workspace-flow.md + CHANGELOG + VERSION 0.21.10→0.22.0.

Verified: canary 01-05 green; arcs-validation/repair-merge-hooks/onboard suites green;
§23 renders correctly across all three states + strict path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

Warning

Review limit reached

@broomva, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 20 minutes and 23 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 00439342-628b-4650-8138-0851dcdfad29

📥 Commits

Reviewing files that changed from the base of the PR and between e731305 and c6eb5c7.

📒 Files selected for processing (7)
  • CHANGELOG.md
  • VERSION
  • references/new-workspace-flow.md
  • scripts/bootstrap.sh
  • scripts/doctor.sh
  • scripts/skill-graduate.sh
  • tests/canary/01-fresh-bootstrap.test.sh
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/wire-control-loop-on-bootstrap

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Carlos D. Escobar-Valbuena and others added 2 commits May 28, 2026 20:12
…clude check

Pre-existing on main (from #64) — the "Lint shell + JSON templates" gate
inherited red on this PR. $ex is a glob pattern from EXTRA_EXCLUDES; quoting the
RHS would break the pattern match the exclude check depends on, so the correct
fix is a disable directive, not a quote.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Dogfooding 0.22.0 on the stimulus repo surfaced a false-negative: stimulus's
tracked .claude/settings.json uses repo-relative vendored hooks, so the L0/L1
audit hooks (which carry an absolute bstack path) belong in the gitignored
settings.local.json — which Claude Code merges at runtime. §23's W-check only
grepped settings.json, so it reported "NOT wired" while the loop was actually
running. Now checks both files. Verified: §23 on stimulus flips to
"wired + running + closing" with hooks in settings.local.json; canary 14/14.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@broomva broomva merged commit ccbf530 into main May 29, 2026
6 checks passed
@broomva broomva deleted the feat/wire-control-loop-on-bootstrap branch May 29, 2026 13:33
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