instar 1.3.499 → 1.3.501

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/dist/commands/server.d.ts.map +1 -1
  2. package/dist/commands/server.js +407 -6
  3. package/dist/commands/server.js.map +1 -1
  4. package/dist/config/ConfigDefaults.d.ts.map +1 -1
  5. package/dist/config/ConfigDefaults.js +10 -0
  6. package/dist/config/ConfigDefaults.js.map +1 -1
  7. package/dist/core/PostUpdateMigrator.d.ts +1 -0
  8. package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
  9. package/dist/core/PostUpdateMigrator.js +69 -0
  10. package/dist/core/PostUpdateMigrator.js.map +1 -1
  11. package/dist/core/ReapGuard.d.ts +24 -0
  12. package/dist/core/ReapGuard.d.ts.map +1 -1
  13. package/dist/core/ReapGuard.js +62 -0
  14. package/dist/core/ReapGuard.js.map +1 -1
  15. package/dist/core/SessionManager.d.ts +32 -0
  16. package/dist/core/SessionManager.d.ts.map +1 -1
  17. package/dist/core/SessionManager.js +74 -2
  18. package/dist/core/SessionManager.js.map +1 -1
  19. package/dist/core/WorkEvidence.d.ts +45 -0
  20. package/dist/core/WorkEvidence.d.ts.map +1 -0
  21. package/dist/core/WorkEvidence.js +88 -0
  22. package/dist/core/WorkEvidence.js.map +1 -0
  23. package/dist/core/componentCategories.d.ts.map +1 -1
  24. package/dist/core/componentCategories.js +3 -0
  25. package/dist/core/componentCategories.js.map +1 -1
  26. package/dist/core/devGatedFeatures.d.ts.map +1 -1
  27. package/dist/core/devGatedFeatures.js +5 -0
  28. package/dist/core/devGatedFeatures.js.map +1 -1
  29. package/dist/core/types.d.ts +50 -0
  30. package/dist/core/types.d.ts.map +1 -1
  31. package/dist/core/types.js.map +1 -1
  32. package/dist/messaging/NotificationBatcher.d.ts +12 -0
  33. package/dist/messaging/NotificationBatcher.d.ts.map +1 -1
  34. package/dist/messaging/NotificationBatcher.js +36 -0
  35. package/dist/messaging/NotificationBatcher.js.map +1 -1
  36. package/dist/messaging/pending-relay-store.d.ts +67 -8
  37. package/dist/messaging/pending-relay-store.d.ts.map +1 -1
  38. package/dist/messaging/pending-relay-store.js +151 -14
  39. package/dist/messaging/pending-relay-store.js.map +1 -1
  40. package/dist/messaging/reap-notice-delivery-id.d.ts +37 -0
  41. package/dist/messaging/reap-notice-delivery-id.d.ts.map +1 -0
  42. package/dist/messaging/reap-notice-delivery-id.js +52 -0
  43. package/dist/messaging/reap-notice-delivery-id.js.map +1 -0
  44. package/dist/monitoring/QuotaManager.d.ts +6 -0
  45. package/dist/monitoring/QuotaManager.d.ts.map +1 -1
  46. package/dist/monitoring/QuotaManager.js +11 -0
  47. package/dist/monitoring/QuotaManager.js.map +1 -1
  48. package/dist/monitoring/ReapLog.d.ts +39 -4
  49. package/dist/monitoring/ReapLog.d.ts.map +1 -1
  50. package/dist/monitoring/ReapLog.js +54 -4
  51. package/dist/monitoring/ReapLog.js.map +1 -1
  52. package/dist/monitoring/ReapNoticeDrain.d.ts +113 -0
  53. package/dist/monitoring/ReapNoticeDrain.d.ts.map +1 -0
  54. package/dist/monitoring/ReapNoticeDrain.js +231 -0
  55. package/dist/monitoring/ReapNoticeDrain.js.map +1 -0
  56. package/dist/monitoring/ReapNotifier.d.ts +89 -18
  57. package/dist/monitoring/ReapNotifier.d.ts.map +1 -1
  58. package/dist/monitoring/ReapNotifier.js +329 -22
  59. package/dist/monitoring/ReapNotifier.js.map +1 -1
  60. package/dist/monitoring/ResumeQueue.d.ts +223 -0
  61. package/dist/monitoring/ResumeQueue.d.ts.map +1 -0
  62. package/dist/monitoring/ResumeQueue.js +600 -0
  63. package/dist/monitoring/ResumeQueue.js.map +1 -0
  64. package/dist/monitoring/ResumeQueueDrainer.d.ts +151 -0
  65. package/dist/monitoring/ResumeQueueDrainer.d.ts.map +1 -0
  66. package/dist/monitoring/ResumeQueueDrainer.js +420 -0
  67. package/dist/monitoring/ResumeQueueDrainer.js.map +1 -0
  68. package/dist/monitoring/SessionMigrator.d.ts +10 -0
  69. package/dist/monitoring/SessionMigrator.d.ts.map +1 -1
  70. package/dist/monitoring/SessionMigrator.js +43 -1
  71. package/dist/monitoring/SessionMigrator.js.map +1 -1
  72. package/dist/monitoring/SessionReaper.d.ts +1 -0
  73. package/dist/monitoring/SessionReaper.d.ts.map +1 -1
  74. package/dist/monitoring/SessionReaper.js +5 -0
  75. package/dist/monitoring/SessionReaper.js.map +1 -1
  76. package/dist/monitoring/delivery-failure-sentinel.d.ts.map +1 -1
  77. package/dist/monitoring/delivery-failure-sentinel.js +7 -3
  78. package/dist/monitoring/delivery-failure-sentinel.js.map +1 -1
  79. package/dist/scaffold/templates.d.ts.map +1 -1
  80. package/dist/scaffold/templates.js +4 -3
  81. package/dist/scaffold/templates.js.map +1 -1
  82. package/dist/server/AgentServer.d.ts +5 -0
  83. package/dist/server/AgentServer.d.ts.map +1 -1
  84. package/dist/server/AgentServer.js +3 -0
  85. package/dist/server/AgentServer.js.map +1 -1
  86. package/dist/server/routes.d.ts +8 -0
  87. package/dist/server/routes.d.ts.map +1 -1
  88. package/dist/server/routes.js +94 -0
  89. package/dist/server/routes.js.map +1 -1
  90. package/package.json +1 -1
  91. package/skills/spec-converge/SKILL.md +23 -0
  92. package/src/data/builtin-manifest.json +65 -65
  93. package/src/data/state-coherence-registry.json +14 -1
  94. package/src/scaffold/templates.ts +4 -3
  95. package/upgrades/1.3.500.md +43 -0
  96. package/upgrades/1.3.501.md +51 -0
  97. package/upgrades/side-effects/conformance-gate-autoinvoke.md +58 -0
  98. package/upgrades/side-effects/reap-notify-resume-queue.md +89 -0
@@ -0,0 +1,43 @@
1
+ # Upgrade Guide — vNEXT
2
+
3
+ <!-- assembled-by: assemble-next-md -->
4
+ <!-- bump: patch -->
5
+
6
+ ## What Changed
7
+
8
+ The Standards-Conformance Gate (shipped 2026-05-24, #373: reads the constitution,
9
+ checks any spec against every standard, signal-only) had ZERO runs in 19 days —
10
+ its spec-review wiring was staged in prose and never tracked (operator finding,
11
+ 2026-06-12 topic 13481). Now: spec-converge Phase 1 carries a MANDATORY
12
+ auto-invocation step (`POST /spec/conformance-check`; flags feed the reviewers; each
13
+ round's report records `ran (N flags)` or an honest `unavailable: <reason>`; an
14
+ unexplained skip fails report validation). The constitution registry prose is updated
15
+ to the true current state, and `migrateConformanceGateAutoInvoke` delivers the
16
+ updated skill content to deployed agents (marker/fingerprint pattern, customized
17
+ files untouched, idempotent). The wider documented-only→enforced program is tracked
18
+ as CMT-1426.
19
+
20
+ ## What to Tell Your User
21
+
22
+ - "The inspector that checks every new plan against my constitution now runs
23
+ automatically on every spec review — it had been built but sat unused for three
24
+ weeks because the follow-up to wire it in was never tracked. That gap is closed,
25
+ and converting the rest of the constitution's written rules into enforced gates is
26
+ now a tracked program."
27
+
28
+ ## Summary of New Capabilities
29
+
30
+ | Capability | How to Use |
31
+ |-----------|-----------|
32
+ | Constitution check on every spec review | Automatic — recorded per round in each convergence report |
33
+
34
+ ## Evidence
35
+
36
+ - `tests/unit/PostUpdateMigrator-conformanceAutoInvoke.test.ts` — 4 tests: bundled
37
+ skill carries the step; stock copies upgraded + idempotent; customized copies
38
+ untouched; registry prose honesty locked (the stale "not yet auto-invoked" claim
39
+ can never silently return).
40
+ - `tsc --noEmit` clean; migration suites green.
41
+ - Side-effects: `upgrades/side-effects/conformance-gate-autoinvoke.md` (answers the
42
+ new §7 multi-machine posture question shipped this morning — the gate dogfooding
43
+ itself twice in one day). ELI16: `docs/eli16/conformance-gate-autoinvoke.md`.
@@ -0,0 +1,51 @@
1
+ # Upgrade Guide — vNEXT
2
+
3
+ <!-- assembled-by: assemble-next-md -->
4
+ <!-- bump: minor -->
5
+
6
+ ## What Changed
7
+
8
+ Implements `docs/specs/reap-notify-per-topic-and-midwork-resume-queue.md` (converged 7 iterations with GPT-5.5 + Gemini 2.5 Pro cross-review, operator-approved 2026-06-12, topic 24662 — "reaped sessions should ALWAYS notify the user in the corresponding topic, and mid-work reaps need a persistent resume mechanism").
9
+
10
+ **Part A — per-topic durable reap notices (default ON):**
11
+ - `ReapNotifier` v2: per-topic coalescing — every topic that lost a session gets ONE notice in THAT topic (plain-English reasons, mid-work tag); the lifeline gets unbound sessions + a cross-topic index. Affected-set tracking is separate from the detail buffer, so storms still produce correct per-topic counts. Rollback: `monitoring.reapNotify.perTopic: false`.
12
+ - Durable delivery: notices are `reap-notify:`-prefixed rows in the shared PendingRelayStore (release holds ride the existing `next_attempt_at` column — zero DDL), drained by a NEW always-on `ReapNoticeDrain` (30s tick, CAS claims, per-pass cap 15, backoff to 8 attempts, terminal escalation into ONE aggregated attention item). Independent of the default-OFF DeliveryFailureSentinel. Rollback: `monitoring.reapNotify.drainEnabled: false`.
13
+ - **Store-level fix for everyone (R1.6):** the pending-relay restore-purge cutoff is now `max(attempted_at, next_attempt_at)` with a 7-day corruption clamp — a message HELD for future release no longer gets eaten at boot (the 2026-06-05 silent-deletion class, fixed for ALL rows, not just reap notices).
14
+ - Outcome records: every notice attempt lands in the reap-log as `type:'notify'` pairs (`enqueued` → `sent`/`send-failed-escalated`/`no-topic`/`enqueue-failed`) — "did the user get told?" is now auditable.
15
+
16
+ **Part B — mid-work tagging + resume queue (ships enabled + dry-run observe-only):**
17
+ - Killers supply work evidence at THEIR decision point (the quota-shed migrator snapshots it BEFORE its Ctrl+C grace round tears the work down); the single kill chokepoint clamps it to an exact enum and stamps `midWork` on the event, the reap-log, and the session record.
18
+ - `ResumeQueue`: durable per-machine queue (fsync persist discipline, single-writer lockfile with same-host stale reclaim + foreign-host loud-disable, corrupt-file sidecar, boot reconciliation from the reap-log). Eligibility is stricter than midWork: ≥1 strong signal (or topic-bound + 2 distinct weak); jobs opt in via `resumeOnReap: true` (default false); operator kills excluded by default.
19
+ - `ResumeQueueDrainer`: revives AT MOST ONE entry per minute, only after 3 consecutive calm pressure ticks + quota headroom + session-cap + no migration in flight. Seven drain-time reality validations re-check the world before any spawn. Failure ladder: 3 attempts with backoff → gave-up; resurrection cap (2 per identity per 24h) kills kill-resume-kill loops; circuit breaker on consecutive failures. ALL give-up classes fold into ONE rolling attention item.
20
+ - Emergency stops reach the queue: stop-all/MessageSentinel stops pause it (TTLs frozen, mutation routes 409); per-topic stops cancel that topic's entries; explicit unpause via `POST /sessions/resume-queue/resume`.
21
+ - New spawn-path capability: sessions can now be spawned with an explicit per-spawn `cwd`, so interrupted worktree work resumes in ITS tree.
22
+ - Tier 1 supervision (observe-only during the soak): each about-to-resume decision gets an audited fast-tier LLM sanity check that never defers.
23
+
24
+ **Foundation fixes pulled in-scope (no deferrals):**
25
+ - `SessionMigrator` no longer records a ReapGuard REFUSAL as "halted" — refused-but-alive sessions are no longer double-respawned after a quota migration.
26
+ - The reap-log normalizer no longer strips `launchLane` on read.
27
+
28
+ **Migration parity:** ConfigDefaults gains `reapNotify.perTopic` + `maxImmediatePerFlush` (resumeQueue keys deliberately code-defaulted for the later fleet flip); new content-sniffed `migrateClaudeMd()` section + framework-shadow marker; `state/resume-queue.json` registered machine-local (excluded from backup/restore).
29
+
30
+ ## What to Tell Your User
31
+
32
+ - "When the system shuts down your sessions (low memory, usage limits), each affected conversation now gets its own clear notice — and the notice can't be silently lost anymore, even across restarts."
33
+ - "Coming online in watch-mode: sessions killed mid-work get queued and automatically restarted one at a time once your machine recovers, picking the work back up."
34
+
35
+ ## Summary of New Capabilities
36
+
37
+ | Capability | How to Use |
38
+ |-----------|-----------|
39
+ | Per-topic shutdown notices | Automatic — each affected topic is told, in plain English |
40
+ | Durable notice delivery | Automatic — `reap-notify` rows in the pending-relay store, always-on drain |
41
+ | Notice audit trail | `GET /sessions/reap-log` — `type:'notify'` outcome pairs |
42
+ | Mid-work tagging | reap-log + session records carry `midWork` + `workEvidence` |
43
+ | Resume queue state | `GET /sessions/resume-queue` (entries, paused, breaker, lastTickAt) |
44
+ | Queue levers | `POST /sessions/resume-queue/:id/cancel` · `/:id/requeue` · `/resume` · `/drain` |
45
+ | Job opt-in | `resumeOnReap: true` on a job definition |
46
+
47
+ ## Evidence
48
+
49
+ - Tier-1: `tests/unit/pending-relay-store.test.ts` (R1.6 + origin scoping + CAS), `reap-log.test.ts`, `work-evidence.test.ts`, `session-migrator.test.ts` (pre-grace evidence + refusal recording), `reap-notifier.test.ts` (v2 matrix + legacy modes), `reap-notice-drain.test.ts`, `resume-queue.test.ts`, `resume-queue-drainer.test.ts`.
50
+ - Tier-2/3: resume-queue route integration + reap→durable-notify lifecycle + feature-alive E2E (same PR).
51
+ - Side-effects artifact: `upgrades/side-effects/reap-notify-resume-queue.md`.
@@ -0,0 +1,58 @@
1
+ # Side-Effects Review — Standards-Conformance Gate auto-invocation
2
+
3
+ **Trigger:** operator finding (2026-06-12 topic 13481): the gate shipped 2026-05-24
4
+ explicitly staged for spec-review wiring; the staging lived only in registry prose →
5
+ zero runs in 19 days. ("What's the point of building something and not using it?")
6
+ **Change:** spec-converge Phase 1 gains a MANDATORY auto-invocation step — call
7
+ `POST /spec/conformance-check`, feed the per-standard flags to the reviewers, record
8
+ `ran (N flags)` / `unavailable: <reason>` per round in the convergence report; a
9
+ skipped-without-reason gate fails report validation. Registry prose updated to the
10
+ honest current state (auto-invoked as of 2026-06-12, CMT-1426 tracks the wider
11
+ enforcement-ratio program). PostUpdateMigrator delivers the updated skill content to
12
+ deployed agents (established marker/fingerprint pattern).
13
+
14
+ ## 1. Over-block
15
+ None: the gate's report is signal-only and an UNAVAILABLE gate (server down, 503)
16
+ never blocks convergence — only an unexplained skip fails validation, which costs one
17
+ honest sentence.
18
+
19
+ ## 2. Under-block
20
+ The mandate lives in skill instructions + report validation, not a programmatic hook
21
+ — a determined skip mislabeled "unavailable" would pass until the conformance
22
+ metrics funnel (GET /spec/conformance-metrics, already shipped) shows zero runs
23
+ against nonzero convergences; CMT-1426's cadence reviews exactly that number. Named
24
+ honestly: this is the signal-first phase per Signal vs. Authority.
25
+
26
+ ## 3. Level-of-abstraction fit
27
+ The wiring belongs in the round that consumes it (Phase 1) — not a cron, not a
28
+ separate job: the gate's value is per-spec flags reaching the reviewers of that spec.
29
+
30
+ ## 4. Signal vs authority compliance
31
+ Fully signal-only by construction; blocking authority remains a later, earned phase
32
+ (unchanged from the gate's own converged spec).
33
+
34
+ ## 5. Interactions
35
+ Composes with the existing 8-reviewer round (a ninth input, not a new reviewer
36
+ spawn); the conformance route's extended timeout budget (middleware) already exists;
37
+ migration ordering with the posture migration converges either way (both copy the
38
+ same bundled file; markers are distinct).
39
+
40
+ ## 6. External surfaces
41
+ None beyond the install base (skill content + registry prose + migration).
42
+
43
+ ## 7. Multi-machine posture (Cross-Machine Coherence)
44
+ **machine-local BY DESIGN, with reason** — per-machine installed skill content kept
45
+ current by each machine's own update cycle (same posture as PR #1088's files). The
46
+ conformance CHECK itself runs against the local server of whichever machine runs the
47
+ spec review — correct, since the spec being reviewed lives in that machine's
48
+ worktree. No user-facing notices, no durable runtime state, no generated URLs.
49
+
50
+ ## 8. Rollback cost
51
+ Revert the skill/registry edits and ship; the migration is marker-gated (a reverted
52
+ bundle stops patching; already-patched agents keep a mandatory step that calls a
53
+ still-existing, signal-only route — benign).
54
+
55
+ ## Second-pass review
56
+ Not required — no block/allow runtime decisions, no session lifecycle, no
57
+ gate/sentinel/watchdog RUNTIME surface (the "gate" here is review-process content;
58
+ the route it calls is unchanged).
@@ -0,0 +1,89 @@
1
+ # Side-Effects Review — Per-Topic Reap Notification + Mid-Work Resume Queue
2
+
3
+ **Version / slug:** `reap-notify-resume-queue`
4
+ **Date:** `2026-06-12`
5
+ **Author:** `echo (instar-dev agent)`
6
+ **Second-pass reviewer:** `[pending — required: session lifecycle + sentinel surface]`
7
+
8
+ > STATUS: IN-FLIGHT — this artifact accompanies the per-step commits of the
9
+ > build and is completed (all seven questions answered, second-pass appended)
10
+ > before the PR opens. Driven by the converged + approved spec
11
+ > `docs/specs/reap-notify-per-topic-and-midwork-resume-queue.md` (r7).
12
+
13
+ ## Summary of the change
14
+
15
+ Implements the reap-notify + resume-queue spec: Part A makes every non-silent
16
+ session reap produce a durable per-topic notice (PendingRelayStore rows with a
17
+ `reap-notify:` PK prefix, drained by a new always-on ReapNoticeDrain; the
18
+ store's restore-purge gains the R1.6 held-row exemption + 7-day corruption
19
+ clamp), and Part B tags mid-work reaps with killer-supplied evidence at the
20
+ terminateSession chokepoint and revives them in order via a durable
21
+ ResumeQueue + gated ResumeQueueDrainer (observe-only Tier 1 LLM check during
22
+ soak). Files: src/messaging/{pending-relay-store,reap-notice-delivery-id}.ts,
23
+ src/monitoring/{delivery-failure-sentinel,ReapNotifier,ReapNoticeDrain,ReapLog,
24
+ ResumeQueue,ResumeQueueDrainer,PressureGauge,SessionMigrator,SessionReaper}.ts,
25
+ src/core/SessionManager.ts, server wiring + routes, ConfigDefaults,
26
+ PostUpdateMigrator, templates, three test tiers.
27
+
28
+ ## Decision-point inventory
29
+
30
+ - `PendingRelayStore.purgeStaleClaimable` — modify — restore-purge staleness predicate (R1.6); brittle by design (transport-layer mechanics, not judgment).
31
+ - `PendingRelayStore claim queries (selectClaimable / selectClaimableReapNotices / claimCas)` — modify/add — origin-scoped single-owner contract between two drains; transport-layer mechanics.
32
+ - `ReapNotifier flush` — modify — per-topic grouping + release-tier selection (IMMEDIATE vs SUMMARY vs quiet-hours); deterministic template authoring, no judgment blocking.
33
+ - `ReapNoticeDrain` — add — tier0 deterministic delivery state machine (claim → send → backoff → terminal escalation).
34
+ - `terminateSession evidence clamp` — modify — enum whitelist on killer-supplied evidence (hard-invariant validation, brittle-blocker exemption).
35
+ - `ResumeQueue eligibility classifier` — add — deterministic eligibility rules (strong/weak evidence, job opt-in).
36
+ - `ResumeQueueDrainer gates` — add — deterministic spawn-eligibility checks delegating to EXISTING authorities (PressureGauge, QuotaManager.canSpawnSession, session cap, migration-in-flight); plus observe-only Tier 1 LLM check.
37
+ - `Dequeue hard invariants` — add — UUID/enum/charset/length clamps protecting `claude --resume` argv (brittle-blocker exemption).
38
+ - `Emergency-stop → queue pause` — add — pass-through consumer of the existing MessageSentinel/stop-all authority.
39
+
40
+ ---
41
+
42
+ ## 1. Over-block
43
+
44
+ [IN-FLIGHT — completed at Phase 4 after build.]
45
+
46
+ ## 2. Under-block
47
+
48
+ [IN-FLIGHT — completed at Phase 4 after build.]
49
+
50
+ ## 3. Level-of-abstraction fit
51
+
52
+ [IN-FLIGHT — completed at Phase 4 after build.]
53
+
54
+ ## 4. Signal vs authority compliance
55
+
56
+ [IN-FLIGHT — completed at Phase 4 after build. Phase 1 written check recorded
57
+ in build plan: no new brittle judgment blockers; drainer gates delegate to
58
+ existing authorities; Tier 1 check observe-only; hard invariants under the
59
+ documented exemption.]
60
+
61
+ ## 5. Interactions
62
+
63
+ [IN-FLIGHT — completed at Phase 4 after build.]
64
+
65
+ ## 6. External surfaces
66
+
67
+ [IN-FLIGHT — completed at Phase 4 after build.]
68
+
69
+ ## 7. Rollback cost
70
+
71
+ [IN-FLIGHT — completed at Phase 4 after build. Levers: reapNotify.perTopic=false,
72
+ reapNotify.drainEnabled=false, resumeQueue.enabled=false / dryRun=true; no DDL.]
73
+
74
+ ## Build progress notes (per-step, folded into the final review)
75
+
76
+ - Step 1 (relay-store foundation): R1.6 purge fix + origin scoping + CAS claim; DFS spec §3h updated.
77
+ - Step 2 (ReapLog): notify record pairs + midWork/workEvidence through the normalizer; fixed pre-existing launchLane drop-on-read (Rule-1 deviation, noted for SUMMARY).
78
+ - Step 3 (evidence chokepoint): WorkEvidence vocabulary module + terminateSession opts.workEvidence with enum clamp + ReapGuard.workEvidence() observe-only fallback (closure-error → nothing; critical-tier marker) + midWork stamped on event/reap-log/session record.
79
+ - Step 4 (killer stamps): SessionMigrator pre-grace evidence snapshot + halt-refusal recording (refusals ≠ halted, no double-respawn); SessionReaper asserts authoritative-empty evidence on proven-idle reaps; chokepoint fallback excludes active-process under bypassActiveProcessKeep.
80
+ - Step 5 (ReapNotifier v2): per-topic grouping with separate affected-set (cap 500 + overflow), plain-English reason map, IMMEDIATE/SUMMARY release tiers with quiet-hours holds + per-flush cap, durable enqueue with outcome records, loud enqueue-failure fallback, legacy modes preserved (perTopic:false byte-compatible; drainEnabled:false direct-send).
81
+ - Step 6 (ReapNoticeDrain): always-on 30s drain over the reap-notify lane (CAS claim, lease + prior-boot reclaim, per-pass cap 15, backoff to maxAttempts 8, terminal escalation into ONE stable-id attention item, bounded terminal-row cleanup [Rule-2 deviation: added because DFS's retention pass is default-OFF, so the always-on lane needed its own growth bound]); boot wiring with lazy telegram refs; NotificationBatcher gains quietHoursEndAt/nextSummaryReleaseAt (one quiet-hours clock).
82
+ - Step 7 (PressureGauge): the spec's "shared PressureGauge extraction" already exists as HostPressureSampler (one shared definition delegating to SessionReaper.computePressure, parity-tested in host-pressure-sampler.test.ts) — plan deviation Rule 4: reused instead of duplicating. Wired sessionManager.setPressureTierProvider to it with the reaper's configured thresholds.
83
+ - Step 8 (ResumeQueue): durable JSON queue (fsync discipline temp→rename→dir), single-writer lockfile (same-host stale reclaim; foreign-host NEVER probed — loud disable with documented recovery), R2.2 eligibility classifier, stable-key dedupe, resurrection ledger with 24h window + requeue-as-the-one-override, incident-age TTL with pause-freeze + pressure-starved marker, overflow drop-to-aggregate, corrupt-file sidecar, boot reconciliation (starting→failed-attempt + reap-log re-enqueue seam). Dry-run interpretation recorded: entries ARE durably enqueued (soak observable); only spawning + user-facing claims are gated.
84
+
85
+ - Step 9 (ResumeQueueDrainer + spawn cwd): gated one-per-tick drainer (calm-ticks on the shared gauge, quota/cap/migration gates never bypassable, manual drain skips calm-ticks ONLY), 7 reality validations + hard invariants (fail-safe on dep errors), failure ladder + breaker + aggregated give-ups, Tier1 observe-only with 5s deadline + off-lever, dry-run inertness (would-resume once per entry, no attention), R2.11 honest notice + literal-data continuation prompt; spawnInteractiveSession + spawnSessionForTopic gain the explicit per-spawn cwd (L13 named extension).
86
+ - Step 10 (boot wiring + emergency stop + routes): queue+drainer constructed at boot (lock-disable logged, lazy telegram refs, 30s-deferred reap-log boot reconciliation — topic-bound candidates only; job entries rely on cron recurrence since opt-in is not reconstructible from the reap-log); enqueue hook at the sessionReaped listener; emergency-stop wiring (stop-all → pause; per-topic stop + MessageSentinel stop → cancelByTopic + operator-stop record); R2.10 routes with clamps; QuotaManager.isMigrationInFlight added (canSpawnSession permits mid-migration spawns absent pressure — the drainer needs the stricter probe); Session.cwd recorded at spawn; JobDefinition.resumeOnReap; Tier1 check wired via shared LlmQueue with attribution.
87
+ - Step 11 (config + migration parity): ConfigDefaults gains reapNotify.perTopic + maxImmediatePerFlush ONLY (drainEnabled + resumeQueue.* deliberately code-defaulted for the fleet flip — registration-discipline test pins this); resumeQueue classified in DARK_GATE_EXCLUSIONS (cost-bearing); resume-queue state files registered machine-local in the state-coherence registry; generateClaudeMd Reap-Log section updated + NEW content-sniffed migrateClaudeMd section + framework-shadow marker; release fragment with maturity-tagged announcements (Part A stable, Part B preview/watch-mode).
88
+ - Step 12 (test tier): integration lifecycle (reap → durable notify pair, quota-shed end-to-end, P17/P19 burst invariants incl. K-entries-vs-rejecting-spawn-target) + R2.10 routes/emergency-stop integration + Tier-3 feature-alive E2E on the production init path (real AgentServer + ReapLog + PendingRelayStore + ReapNotifier + ReapNoticeDrain + ResumeQueue + ResumeQueueDrainer; cwd round-trip through the L13 spawn-path parameter; wiring integrity for pressure gauge / spawn gate / relay store / LlmQueue tier-1).
89
+ - Step 13 (full-suite triage): ratchet/parity updates for the new code (dark-gate golden map +10 shift re-verified by hand; ResumeQueueDrainer registered in componentCategories; migrator CLAUDE.md section tracked in feature-delivery-completeness; session-reaper exact-match assertions gain workEvidence). Behavior-relevant: THREE lenient-side catches REMOVED so a throwing dep resolves to the drainer's strict side per R2.6 — QuotaManager.isMigrationInFlight no longer swallows probe errors (sole caller is the drainer gate, which blocks on throw), and the server's migrationInFlight/topicOwnerElsewhere dep wrappers no longer catch (drainer gate/validateReality resolve to blocked/invalidated). Every remaining new catch carries an in-brace @silent-fallback-ok justification; no-silent-fallbacks baseline untouched (net −1 vs main). localhost-link-guard-route test made hermetic (own tmp stateDir — '/tmp' shared outbound-dedup.db across runs and suppressed sends).