Skip to content

fix(tsc): tighten Riven heartbeat status type to bus union — clear lint (tsc tools)#3684

Merged
AceHack merged 1 commit into
mainfrom
fix/tsc-riven-cursor-terminal-heartbeat-status-otto-cli-2026-05-16
May 16, 2026
Merged

fix(tsc): tighten Riven heartbeat status type to bus union — clear lint (tsc tools)#3684
AceHack merged 1 commit into
mainfrom
fix/tsc-riven-cursor-terminal-heartbeat-status-otto-cli-2026-05-16

Conversation

@AceHack
Copy link
Copy Markdown
Member

@AceHack AceHack commented May 16, 2026

What

publishHeartbeat in tools/riven/riven-cursor-terminal-loop.ts accepted "alive" | "shutdown", but the bus's HeartbeatPayload.status is "alive" | "idle" | "working". The bus's status consumer (tools/bus/bus.ts:331) explicitly filters to that union — "shutdown" would silently drop.

Fix

  • Import HeartbeatPayload from tools/bus/types
  • Bind local status param to HeartbeatPayload["status"] — single source of truth
  • SIGINT call site: publishHeartbeat("alive", "shutdown:terminal-closed") — shutdown semantic preserved in the note field (which actually reaches consumers)

Verification

bun --bun tsc --noEmit -p tsconfig.json → exit 0 locally.

Drift queue (0111Z → now)

Item PR State
22 §33 xrefs #3666 merged
BACKLOG.md generated-index #3678 merged
tsc tools (this PR) this open
backlog ID uniqueness B-0545 renumber-sweep pending coordination

Co-Authored-By: Claude noreply@anthropic.com

…nt (tsc tools)

`publishHeartbeat` accepted `"alive" | "shutdown"`, but the bus's
`HeartbeatPayload.status` is `"alive" | "idle" | "working"` and consumers
(`tools/bus/bus.ts` line 331) filter to that union. `"shutdown"` would
silently drop at the bus consumer even if the type allowed it.

Surgical fix:
- Import `HeartbeatPayload` type from `tools/bus/types.ts`
- Bind the local `status` param to `HeartbeatPayload["status"]` (single
  source of truth; future-proof if the bus union widens)
- Change the SIGINT-graceful-shutdown call site to publish
  `("alive", "shutdown:terminal-closed")` — the shutdown semantic is
  preserved in the `note` field where it actually reaches consumers

Local verify: `bun --bun tsc --noEmit -p tsconfig.json` → exit 0.

Third of three drift cleanups from the 0111Z queue (after 22 §33 xrefs via
PR #3666 and BACKLOG.md regen via PR #3678). One drift remains:
`lint (backlog ID uniqueness)` — B-0498 collision per B-0545.

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 16, 2026 02:30
@AceHack AceHack enabled auto-merge (squash) May 16, 2026 02:30
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Tightens the publishHeartbeat status parameter type in the Riven cursor terminal loop to match the bus's HeartbeatPayload["status"] union ("alive" | "idle" | "working"), fixing a tsc lint failure where "shutdown" was being passed but would have been silently dropped by the bus consumer. The SIGINT path now publishes "alive" with the shutdown semantic preserved in the note field.

Changes:

  • Import HeartbeatPayload type from ../bus/types and bind status parameter to HeartbeatPayload["status"].
  • Update SIGINT handler call site to publishHeartbeat("alive", "shutdown:terminal-closed") so the shutdown signal lands in the note field that actually reaches consumers.

@AceHack AceHack merged commit b5ff3d6 into main May 16, 2026
31 of 32 checks passed
@AceHack AceHack deleted the fix/tsc-riven-cursor-terminal-heartbeat-status-otto-cli-2026-05-16 branch May 16, 2026 02:33
AceHack added a commit that referenced this pull request May 16, 2026
…of 3 drift items) (#3685)

Riven cursor-terminal heartbeat status type tightened to bus union. Single
tsc error since PR #3603 cleared via surgical 3-line fix (preserve shutdown
semantic in note field; no widening of HeartbeatPayload union).

Drift queue from 0111Z: 22 §33 xrefs (#3666 merged), BACKLOG.md regen
(#3678 merged), tsc tools (#3684 armed this tick). Remaining: backlog ID
uniqueness (B-0498 collision, needs B-0545 renumber coordination).

Co-authored-by: Claude <noreply@anthropic.com>
AceHack added a commit that referenced this pull request May 16, 2026
…0545 scope re-assessment (#3688)

Substrate-honest pivot tick. Two empirical catches landed:

1. peer-Otto landed byte-identical MD032 fix to PR #3681 seconds before my
   push (commit 6def403); fetch-before-push at git layer caught duplicate
   cleanly. My local commit dropped. Good failure mode firing as designed.
2. B-0545 (B-0498 collision renumber sweep) re-assessed as larger scope
   than the 0226Z next-tick framing suggested: B-0546+ already taken,
   cross-substrate search needed, tick-shard immutability discipline.
   Defer as focused PR with claim acquire first.

All 3 prior-tick PRs (#3681 #3684 #3685) now unblocked + awaiting CI.

Co-authored-by: Claude <noreply@anthropic.com>
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.

2 participants