feat(bg): B-0442.4 — bus publish WIRING (slice-3 detector is STUB; substrate-honest per Riven's P0 caution)#3023
Merged
Conversation
…not real cascade detection) Slice 4 of B-0442. Wires the bus-publish path for the missed-substrate cascade detector. Slice 3 (branch-HEAD vs squash-content compare) is NOT yet implemented; the detectCascade adapter is a stub that always returns null. SUBSTRATE-HONEST FRAMING (per Riven's P0 catch on the analogous B-0440 cascade — envelope 6c689634-...): This PR ships: - Bus-publish path (try/catch wrapped, structured publish-error surfacing, missed-substrate-cascade topic from B-0400) - Adapter abstraction (detectCascade injectable for tests; real slice-3 comparator plugs in later) - CascadeFinding payload schema (prNumber, branchName, missingCommits, urgency) - CLI flags (--no-publish, --agent, --to, --fetch-limit) This PR does NOT ship: - Real branch-vs-squash comparator (slice 3) - Auto-recovery-PR opening (slice 5) - Cron registration (slice 6) In production right now, this service WILL fetch merged PRs but WILL NOT detect any cascades (stub returns null). The reactive loop is wired but inert until slice 3 lands. Riven's P0 warning preserved: do NOT frame this as "missed- substrate cascade detection is operational." The framing is "bus- publish wiring complete; slice-3 detector stub awaiting real compare logic." Key design choices: - Adapter pattern (now / fetchRecentMergedPRs / detectCascade / publishCascade) for full test injectability - spawnSync (execFile-style) for gh CLI invocation - Canonical SENDER_IDS / AGENT_IDS reuse (Riven/Vera/Copilot cross-PR finding) - try/catch on publishCascade (daemon survives bus IO failures) Tests: 11 pass / 0 fail / 42 expect() calls. Composes with: - B-0442.2 (PR #3014 — merged-PR fetch this extends) - B-0440.4 (PR #3017 — same bus-publish pattern; first reactive loop closed) - B-0441.4 (PR #3020 — proactive companion; same try/catch pattern) - B-0400 schema extension (PR #3016 — missed-substrate-cascade topic) - Riven adversarial review (envelopes 6c689634 + e8174b34) Co-Authored-By: Claude <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Pull request overview
Wires the B-0442 missed-substrate detector’s slice-4 “reactive loop” by adding an injectable cascade-detection adapter (still stubbed) and publishing missed-substrate-cascade envelopes to the local bus when cascades are detected.
Changes:
- Adds bus publish plumbing (
--no-publish,--agent,--to) and per-finding envelope publishing topollOnce. - Introduces
CascadeFindingschema + injectabledetectCascade/publishCascadeadapters (with real detector intentionally stubbed tonulluntil slice 3). - Updates tests to cover cascade publish wiring, publish skipping, and publish failure behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tools/bg/missed-substrate-detector.ts | Adds slice-4 bus publish wiring, new config flags, cascade finding type, and injectable adapters. |
| tools/bg/missed-substrate-detector.test.ts | Expands unit tests for cascade detection injection + publish behavior and new CLI flags. |
Comment on lines
+164
to
+168
| const findings: CascadeFinding[] = []; | ||
| for (const pr of fetch.prs) { | ||
| const finding = adapters.detectCascade(pr); | ||
| if (finding !== null) findings.push(finding); | ||
| } |
AceHack
added a commit
that referenced
this pull request
May 13, 2026
…d optional' claim (#3024) * docs(bg): substrate-honest README per Riven's P2 — qualify 'foreground optional' claim with delivered surface Resolves Riven's P2 finding (bus envelope 6c689634-...). README now: - Explicit 'Architectural claim (substrate-honest)' section names the gap between 'nudges via bus' and 'foreground optional' per Riven's framing-correction - Per-service slice status table (1+2+3+4 for B-0440; 1+2+4 for B-0441; 1+2+4 with slice-3 STUB for B-0442) - Failure-mode handling section documents lastPublishError, gh-error explicit surfacing, daemon no-result-accumulation - What's-still-pending section names B-0442.3 + slice 5 + slice 6 as the gap-to-aspirational-claim - Updated run examples (--no-publish dry-run, --to agent-routing) Composes with Riven adversarial review (envelope 6c689634) + Otto reply (envelope e8174b34) + the slice cascade (PRs #3006-#3023). Co-Authored-By: Claude <noreply@anthropic.com> * fix(bg-readme): role-refs + slice-ID disambiguation + remove ephemeral envelope ID Addresses Copilot + Vera review on PR #3024: - Replace persona name (Riven) with role-ref + durable PR pointers (#3017, #3022, #3024) - Remove ephemeral bus envelope ID 6c689634-... — references PR threads instead - Disambiguate 'B-0442.3' as 'B-0442 slice 3' (not a per-row file) - Remove 'subscriber agents can react autonomously' overclaim — services nudge, subscribers slice 5+ not shipped Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Slice 4 of B-0442. Wires the bus-publish path for the missed-substrate cascade detector. Slice 3 (real branch-HEAD vs squash compare) is NOT implemented; `detectCascade` adapter is a stub that returns null.
Substrate-honest framing (Riven's P0 lesson)
This PR is the same shape as B-0440.4 (PR #3017) — but learns from Riven's adversarial catch on that PR (envelope `6c689634-...`): the framing is "bus-publish wiring complete; detector stub awaiting real compare logic" — NOT "missed-substrate cascade detection is operational."
In production, this service WILL fetch merged PRs but WILL NOT detect cascades until slice 3 lands.
What ships
Tests
```
bun test
11 pass
0 fail
42 expect() calls
```
Three-service reactive-loop status
Composes with
🤖 Generated with Claude Code