LearnNewsExamplesServices
Frontmatter
id10673
titlecheckSunsetted detector contract: emit sunset vs idle_out_candidate signals
stateClosed
labels
enhancementaiarchitecture
assigneesneo-opus-4-7
createdAtMay 4, 2026, 10:49 AM
updatedAtMay 4, 2026, 3:07 PM
githubUrlhttps://github.com/neomjs/neo/issues/10673
authorneo-opus-4-7
commentsCount0
parentIssue10671
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMay 4, 2026, 3:07 PM

checkSunsetted detector contract: emit sunset vs idle_out_candidate signals

Closedenhancementaiarchitecture
neo-opus-4-7
neo-opus-4-7 commented on May 4, 2026, 10:49 AM

Context

Sub-issue of #10671. Today checkSunsetted.mjs:124-127 emits sunsetted: boolean only on missing WAKE_SUBSCRIPTION (per #10641 fix). The two-mode recovery design needs a richer detector that distinguishes:

  • sunset = no active subscription (terminal — needs full harness restart)
  • idle_out_candidate = active subscription + stale memory (recoverable via in-place A2A nudge)

The Problem

Current binary signal forces resumeHarness into one path (Cmd+N spawn). Two-mode design needs the detector to disambiguate so the right recovery primitive fires.

The Architectural Reality

checkSunsetted.mjs:36-44 queries WAKE_SUBSCRIPTION; lines 90-99 query last AGENT_MEMORY for staleness. Both signals are available; today only the WAKE_SUBSCRIPTION presence is consumed downstream.

Critical discipline preserved from #10641: staleness is NOT an authoritative sunset signal. Reintroduction here is as a separate, lower-authority idle_out_candidate signal. MUST NOT regress to staleness=sunset.

The Fix

Detector emits structured payload:

{
  "identity": "@neo-opus-4-7",
  "sunset": true|false,
  "idle_out_candidate": true|false,
  "evidence": {
    "subscription_active": true|false,
    "subscription_status": "active|degraded|disabled|missing",
    "last_memory_age_min": N,
    "last_sessionId": "..."
  },
  "recommended_action": "sunset_restart" | "idle_out_nudge" | "no_action"
}

resumeHarness.mjs consumes recommended_action to fork into the right path.

Acceptance Criteria

  • Detector returns structured JSON with explicit evidence fields, not implicit boolean
  • sunset signal preserves #10641's discipline: only fires on missing/disabled WAKE_SUBSCRIPTION, never on staleness alone
  • idle_out_candidate signal fires only when subscription_active: true AND last_memory_age_min > threshold
  • Unit test coverage for all 4 quadrants of (sunset, idle_out_candidate)
  • Backward-compatible legacy field (sunsetted: boolean) emitted alongside new structured payload until callers migrate

Out of Scope

  • resumeHarness consumption logic — covered by sibling sub-issue (sunset-mode restart substrate)
  • In-flight lock state in detector output — covered by separate lock-primitive sub-issue

Related

  • Parent: #10671
  • Builds on: #10641 (staleness false-positive lesson preserved)

Origin Session ID: cce1fea5-32ff-410c-b820-2e9a27b3cd51

tobiu referenced in commit 23b2d79 - "feat(ai): two-mode detector contract for checkSunsetted (#10673) (#10689) on May 4, 2026, 3:07 PM
tobiu closed this issue on May 4, 2026, 3:07 PM