Skip to content

feat(updates): restart-safe blocker classification (Step 1 of restart-safe sessions)#658

Open
JKHeadley wants to merge 1 commit into
mainfrom
echo/restart-safe-classify
Open

feat(updates): restart-safe blocker classification (Step 1 of restart-safe sessions)#658
JKHeadley wants to merge 1 commit into
mainfrom
echo/restart-safe-classify

Conversation

@JKHeadley

Copy link
Copy Markdown
Owner

What

Step 1 of restart-safe sessions — an idea Codey (the codex agent) proposed and scoped during the 2026-06-01 mentorship loop (drive-Codey-as-Justin). Codey independently identified that restart-deferral behind active sessions is the root reason updates lag (a published+installed update sits unapplied while any healthy session blocks the restart), and scoped this exact first slice.

This PR adds observability-only classification of the restart-deferral blocker set into restartSafeSessions (topics that resume cleanly across a restart — resumable autonomous topics with a per-topic state file) vs hardBlockingSessions, surfaced read-only through GET /updates/status.

The restart decision is unchanged

A restart-safe blocker still defers exactly as today — even when every blocker is restart-safe, the gate still defers. This PR only establishes the classification primitive; acting on it (restarting through the safe ones, carrying their state across) is a deliberately deferred later step.

Changes

Tests

  • +5 unit (tests/unit/UpdateGate.test.ts): mixed blockers still defer + split correctly; all-restart-safe still defers (the no-behavior-change invariant); no-resolver back-compat; throwing-resolver fail-safe; reset clears.
  • +2 integration (tests/integration/updates-status-restart-safe-sessions-route.test.ts): route surfaces both fields (populated + empty).
  • tsc + lint clean. Full instar-dev ship-gate (spec + ELI16 + side-effects + fragment + trace).

Review status

⚠️ Opened for review, not auto-merged. This is a forward-looking enhancement (not a regression fix), surfaced by Codey under the standing "fix gaps as proper fleet PRs" directive. The commit was authorized autonomously; the merge decision is reserved for Justin. Deferred later steps (forcing restart through safe sessions, capsule format, notices, post-restart validation, non-dev policy knobs) are explicitly out of scope per Codey's scoping.

Spec: docs/specs/restart-safe-blocker-classification-spec.md · ELI16: …spec.eli16.md

🤖 Generated with Claude Code

…hard (Step 1)

Codey-scoped Step 1 of restart-safe sessions (#60, mentorship loop): split the
sessions blocking a deferred restart into restart-safe (resumable autonomous
topics with a per-topic state file) vs hard blockers, surfaced read-only through
GET /updates/status. Observability-only — the restart DECISION is unchanged: a
restart-safe blocker still defers exactly as today, even when every blocker is
restart-safe. Acting on the classification is a deliberately deferred later step.

- UpdateGate: optional restartSafetyResolver predicate; classifyRunningSessions
  splits + stores restartSafeSessions/hardBlockingSessions; GateResult +
  UpdateGateStatus expose them; reset() clears them. No resolver -> all hard,
  restart-safe empty (identical to prior behavior); throwing resolver fails safe.
- AutoUpdater: wires the resolver to the per-topic autonomous-state-file check;
  maps the two fields into AutoUpdaterStatus.
- routes.ts: GET /updates/status adds both fields to its pick-list.
- Tests: +5 UpdateGate unit (split, all-safe-still-defers invariant, no-resolver
  back-compat, fail-safe, reset) + 2 route integration.

Opened for review (forward-looking enhancement, not a regression fix).
Spec: docs/specs/restart-safe-blocker-classification-spec.md

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
instar Building Building Preview Jun 1, 2026 6:32am

Request Review

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