instar 1.3.587 → 1.3.589

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 (70) hide show
  1. package/dist/commands/server.d.ts.map +1 -1
  2. package/dist/commands/server.js +237 -9
  3. package/dist/commands/server.js.map +1 -1
  4. package/dist/core/LiveTestArtifactStore.d.ts +129 -0
  5. package/dist/core/LiveTestArtifactStore.d.ts.map +1 -0
  6. package/dist/core/LiveTestArtifactStore.js +184 -0
  7. package/dist/core/LiveTestArtifactStore.js.map +1 -0
  8. package/dist/core/LiveTestGate.d.ts +54 -0
  9. package/dist/core/LiveTestGate.d.ts.map +1 -0
  10. package/dist/core/LiveTestGate.js +124 -0
  11. package/dist/core/LiveTestGate.js.map +1 -0
  12. package/dist/core/LiveTestHarness.d.ts +99 -0
  13. package/dist/core/LiveTestHarness.d.ts.map +1 -0
  14. package/dist/core/LiveTestHarness.js +102 -0
  15. package/dist/core/LiveTestHarness.js.map +1 -0
  16. package/dist/core/LocalSessionOwnershipStore.d.ts +56 -0
  17. package/dist/core/LocalSessionOwnershipStore.d.ts.map +1 -0
  18. package/dist/core/LocalSessionOwnershipStore.js +130 -0
  19. package/dist/core/LocalSessionOwnershipStore.js.map +1 -0
  20. package/dist/core/OwnershipApplier.d.ts +78 -0
  21. package/dist/core/OwnershipApplier.d.ts.map +1 -0
  22. package/dist/core/OwnershipApplier.js +101 -0
  23. package/dist/core/OwnershipApplier.js.map +1 -0
  24. package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
  25. package/dist/core/PostUpdateMigrator.js +9 -0
  26. package/dist/core/PostUpdateMigrator.js.map +1 -1
  27. package/dist/core/WorkEvidence.d.ts +17 -0
  28. package/dist/core/WorkEvidence.d.ts.map +1 -1
  29. package/dist/core/WorkEvidence.js +17 -0
  30. package/dist/core/WorkEvidence.js.map +1 -1
  31. package/dist/core/devGatedFeatures.d.ts.map +1 -1
  32. package/dist/core/devGatedFeatures.js +12 -0
  33. package/dist/core/devGatedFeatures.js.map +1 -1
  34. package/dist/core/gapBCommitmentEvidence.d.ts +143 -0
  35. package/dist/core/gapBCommitmentEvidence.d.ts.map +1 -0
  36. package/dist/core/gapBCommitmentEvidence.js +138 -0
  37. package/dist/core/gapBCommitmentEvidence.js.map +1 -0
  38. package/dist/core/types.d.ts +21 -0
  39. package/dist/core/types.d.ts.map +1 -1
  40. package/dist/core/types.js.map +1 -1
  41. package/dist/monitoring/CommitmentTracker.d.ts +12 -0
  42. package/dist/monitoring/CommitmentTracker.d.ts.map +1 -1
  43. package/dist/monitoring/CommitmentTracker.js +14 -0
  44. package/dist/monitoring/CommitmentTracker.js.map +1 -1
  45. package/dist/monitoring/ReapLog.d.ts +11 -0
  46. package/dist/monitoring/ReapLog.d.ts.map +1 -1
  47. package/dist/monitoring/ReapLog.js +1 -0
  48. package/dist/monitoring/ReapLog.js.map +1 -1
  49. package/dist/monitoring/ResumeQueueDrainer.d.ts +15 -0
  50. package/dist/monitoring/ResumeQueueDrainer.d.ts.map +1 -1
  51. package/dist/monitoring/ResumeQueueDrainer.js +12 -1
  52. package/dist/monitoring/ResumeQueueDrainer.js.map +1 -1
  53. package/dist/scaffold/templates.d.ts.map +1 -1
  54. package/dist/scaffold/templates.js +2 -0
  55. package/dist/scaffold/templates.js.map +1 -1
  56. package/dist/server/AgentServer.d.ts +3 -0
  57. package/dist/server/AgentServer.d.ts.map +1 -1
  58. package/dist/server/AgentServer.js +2 -0
  59. package/dist/server/AgentServer.js.map +1 -1
  60. package/dist/server/routes.d.ts +4 -0
  61. package/dist/server/routes.d.ts.map +1 -1
  62. package/dist/server/routes.js +58 -0
  63. package/dist/server/routes.js.map +1 -1
  64. package/package.json +1 -1
  65. package/src/data/builtin-manifest.json +64 -64
  66. package/src/scaffold/templates.ts +2 -0
  67. package/upgrades/1.3.588.md +27 -0
  68. package/upgrades/1.3.589.md +68 -0
  69. package/upgrades/side-effects/autonomous-registration-guarantee.md +51 -0
  70. package/upgrades/side-effects/live-user-channel-proof-standard.md +54 -0
@@ -35,6 +35,23 @@ export declare const MARKER_WORK_EVIDENCE: readonly ["unverified-under-pressure"
35
35
  * evidence-vocabulary string is here (imported by server.ts + ResumeQueueDrainer.ts).
36
36
  */
37
37
  export declare const AGE_LIMIT_ACTIVE_RUN_REASON = "age-limit (active autonomous run)";
38
+ /**
39
+ * The reap-reason tag for an age-limit recycle whose topic has no per-topic
40
+ * autonomous-run state file (the run was never registered) BUT carries a fresh,
41
+ * qualifying open agent-commitment corroborated by a recent user message
42
+ * (spec: docs/specs/autonomous-registration-guarantee.md, GAP-B Part B). This is
43
+ * the BACKSTOP for an unregistered-but-actively-working autonomous run: the
44
+ * commitment is the independent live-work signal the state-file source cannot see.
45
+ *
46
+ * Parallel to AGE_LIMIT_ACTIVE_RUN_REASON (registered runs) so the drainer can
47
+ * route this candidate to its OWN drain-time liveness re-check
48
+ * (`commitmentStillActiveForTopic`) instead of the state-file read (which is
49
+ * absent here by construction). The reason is the provenance carrier — there is
50
+ * NO new WorkEvidence enum value (the strong `build-or-autonomous-active` signal
51
+ * is reused; the clamped WorkEvidenceName union is untouched). Imported by
52
+ * server.ts (injection) + ResumeQueueDrainer.ts (drain-time routing).
53
+ */
54
+ export declare const COMMITMENT_ACTIVE_RUN_REASON = "age-limit (committed unregistered run)";
38
55
  /**
39
56
  * Closed-world predicate: is this resume-queue PAUSE reason a blunt
40
57
  * emergency/sentinel stop that the drainer may auto-resume once it has gone
@@ -1 +1 @@
1
- {"version":3,"file":"WorkEvidence.d.ts","sourceRoot":"","sources":["../../src/core/WorkEvidence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,eAAO,MAAM,oBAAoB,yJAavB,CAAC;AAEX,eAAO,MAAM,kBAAkB,0FAKrB,CAAC;AAEX,eAAO,MAAM,oBAAoB,wCAAyC,CAAC;AAE3E;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,2BAA2B,sCAAsC,CAAC;AAE/E;;;;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GAeG;AACH,eAAO,MAAM,4BAA4B,2CAA2C,CAAC;AAErF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mCAAmC,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,OAAO,CAG9F;AAED,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AACvE,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AACnE,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AACvE,MAAM,MAAM,gBAAgB,GAAG,kBAAkB,GAAG,gBAAgB,GAAG,kBAAkB,CAAC;AAY1F;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,gBAAgB,EAAE,CAYpE;AAED,gDAAgD;AAChD,wBAAgB,SAAS,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAE9D;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,gBAAgB,EAAE,CAE9E;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,gBAAgB,EAAE,CAE5E;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,EAAE,UAAU,EAAE,OAAO,GAAG,OAAO,CAI1F"}
@@ -53,6 +53,23 @@ export const MARKER_WORK_EVIDENCE = ['unverified-under-pressure'];
53
53
  * evidence-vocabulary string is here (imported by server.ts + ResumeQueueDrainer.ts).
54
54
  */
55
55
  export const AGE_LIMIT_ACTIVE_RUN_REASON = 'age-limit (active autonomous run)';
56
+ /**
57
+ * The reap-reason tag for an age-limit recycle whose topic has no per-topic
58
+ * autonomous-run state file (the run was never registered) BUT carries a fresh,
59
+ * qualifying open agent-commitment corroborated by a recent user message
60
+ * (spec: docs/specs/autonomous-registration-guarantee.md, GAP-B Part B). This is
61
+ * the BACKSTOP for an unregistered-but-actively-working autonomous run: the
62
+ * commitment is the independent live-work signal the state-file source cannot see.
63
+ *
64
+ * Parallel to AGE_LIMIT_ACTIVE_RUN_REASON (registered runs) so the drainer can
65
+ * route this candidate to its OWN drain-time liveness re-check
66
+ * (`commitmentStillActiveForTopic`) instead of the state-file read (which is
67
+ * absent here by construction). The reason is the provenance carrier — there is
68
+ * NO new WorkEvidence enum value (the strong `build-or-autonomous-active` signal
69
+ * is reused; the clamped WorkEvidenceName union is untouched). Imported by
70
+ * server.ts (injection) + ResumeQueueDrainer.ts (drain-time routing).
71
+ */
72
+ export const COMMITMENT_ACTIVE_RUN_REASON = 'age-limit (committed unregistered run)';
56
73
  /**
57
74
  * Closed-world predicate: is this resume-queue PAUSE reason a blunt
58
75
  * emergency/sentinel stop that the drainer may auto-resume once it has gone
@@ -1 +1 @@
1
- {"version":3,"file":"WorkEvidence.js","sourceRoot":"","sources":["../../src/core/WorkEvidence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,4BAA4B;IAC5B,iBAAiB;IACjB,mBAAmB;IACnB,iBAAiB;IACjB,sBAAsB;IACtB,8EAA8E;IAC9E,oEAAoE;IACpE,0EAA0E;IAC1E,6EAA6E;IAC7E,8EAA8E;IAC9E,iFAAiF;IACjF,2BAA2B;CACnB,CAAC;AAEX,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,gBAAgB;IAChB,qBAAqB;IACrB,qBAAqB;IACrB,aAAa;CACL,CAAC;AAEX,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,2BAA2B,CAAU,CAAC;AAE3E;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,mCAAmC,CAAC;AAE/E;;;;;;;;;;;;;;;;GAgB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M,oBAAoB,EAAE,iBAAiB,EAuHnD,CAAC;AAEF;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAO5E"}
@@ -180,6 +180,18 @@ export const DEV_GATED_FEATURES = [
180
180
  description: 'WS4.4(f) global pool-cache unification — every pool-scope surface (sessions/jobs/attention/guards/…) routes its per-peer fan-out through ONE shared PoolPollCache so each peer is hit once per interval, not once per surface per client; over the load-shed threshold the cache serves last-cached (stale-tagged) instead of re-fanning.',
181
181
  justification: 'Pure read-side observability/efficiency: caches only peer route bodies the surfaces ALREADY fetch over the mesh, introduces NO new authority, NEVER mutates, never caches private end-user content; a failed fetch is never cached; single-machine = no-op (no peers). No destructive action, no third-party spend.',
182
182
  },
183
+ {
184
+ name: 'liveTestGate',
185
+ configPath: 'monitoring.liveTestGate.enabled',
186
+ description: 'Live-User-Channel Proof completion gate (spec §4, CMT-1568) — refuses an autonomous "done" verdict for a user-facing feature without a verified, signed live-test artifact (right surfaces + risk categories).',
187
+ justification: 'Ships mode:dry-run by default (the canary): on a dev agent the gate runs the FULL decision over POST /autonomous/evaluate-completion and LOGS the veto it WOULD apply, but dry-run/warn NEVER override the verdict — only an explicit mode:veto can flip met:true→met:false, and even then the only effect is keeping the run WORKING (the safe direction, never a destructive action, never a false "done"). Pure local read of signed artifacts on disk (no egress, no spend, no LLM of its own); a gate error falls through to the original verdict (the completion judge stays primary authority). Same dogfooding posture as topicProfiles / threadline.singleNegotiator.',
188
+ },
189
+ {
190
+ name: 'durableOwnership',
191
+ configPath: 'multiMachine.durableOwnership.enabled',
192
+ description: 'Transfer fix (live-user-channel-proof spec §7.2) — swaps the in-memory session-ownership store for a DURABLE per-session store + the OwnershipApplier that materializes ownership on the target from the REPLICATED placement journal, so a topic seat genuinely moves between machines.',
193
+ justification: 'Coordinates between the operator\'s OWN machines only — no external egress. The durable store is a per-session atomic JSON write (a cache of journal-decided ownership, not a new authority); the applier only ADOPTS a placement strictly newer than local via fast-forward CAS (it can never clobber a fresher local decision) and runs OFF the routing hot path on an interval; fully reversible (flip back to InMemory — the journal remains the source of truth); single-machine = no-op (no peer placements to apply). No destructive action, no third-party spend. Runs live (dryRun N/A — no destructive write to gate) on dev / dark on fleet.',
194
+ },
183
195
  {
184
196
  name: 'canonicalHistoryConversationDiscipline',
185
197
  configPath: 'threadline.canonicalHistory.conversationDiscipline.enabled',
@@ -1 +1 @@
1
- {"version":3,"file":"devGatedFeatures.js","sourceRoot":"","sources":["../../src/core/devGatedFeatures.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAoBH,MAAM,CAAC,MAAM,kBAAkB,GAAsB;IACnD;QACE,IAAI,EAAE,yBAAyB;QAC/B,UAAU,EAAE,6CAA6C;QACzD,WAAW,EAAE,+MAA+M;QAC5N,aAAa,EAAE,ikBAAikB;KACjlB;IACD;QACE,IAAI,EAAE,eAAe;QACrB,UAAU,EAAE,kCAAkC;QAC9C,WAAW,EAAE,mDAAmD;QAChE,aAAa,EAAE,uGAAuG;KACvH;IACD;QACE,IAAI,EAAE,kBAAkB;QACxB,UAAU,EAAE,uCAAuC;QACnD,WAAW,EAAE,kCAAkC;QAC/C,aAAa,EAAE,yGAAyG;KACzH;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,UAAU,EAAE,mCAAmC;QAC/C,WAAW,EAAE,gDAAgD;QAC7D,aAAa,EAAE,sGAAsG;KACtH;IACD;QACE,IAAI,EAAE,YAAY;QAClB,UAAU,EAAE,iCAAiC;QAC7C,WAAW,EAAE,2CAA2C;QACxD,aAAa,EAAE,wGAAwG;KACxH;IACD;QACE,IAAI,EAAE,kBAAkB;QACxB,UAAU,EAAE,6CAA6C;QACzD,WAAW,EAAE,gCAAgC;QAC7C,aAAa,EAAE,sGAAsG;KACtH;IACD;QACE,IAAI,EAAE,qBAAqB;QAC3B,UAAU,EAAE,sCAAsC;QAClD,WAAW,EAAE,mDAAmD;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UAAkB;IACjE,IAAI,GAAG,GAAY,MAAM,CAAC;IAC1B,KAAK,MAAM,GAAG,IAAI,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;QACxC,IAAI,GAAG,IAAI,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ;YAAE,OAAO,SAAS,CAAC;QAC7D,GAAG,GAAI,GAA+B,CAAC,GAAG,CAAC,CAAC;IAC9C,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,143 @@
1
+ /**
2
+ * GAP-B commitment-evidence backstop — the pure qualifying + agreement predicate.
3
+ *
4
+ * Spec: docs/specs/autonomous-registration-guarantee.md (Part B + Frontloaded
5
+ * Decisions D1/D2/D7/D8).
6
+ *
7
+ * The reaper revives a REGISTERED autonomous run from its per-topic state file.
8
+ * An UNregistered-but-actively-working run (operator said "go autonomous" but the
9
+ * skill never wrote the state file) has no state file → today it dies at the
10
+ * age-limit reap. This module is the BACKSTOP: it recognizes an independent
11
+ * live-work signal — a FRESH open agent-commitment for the topic, CORROBORATED by
12
+ * a recent user message — and (when armed, dark by default) lets the existing
13
+ * revival machinery keep the run alive.
14
+ *
15
+ * This file holds ONLY the deterministic predicates (D1 freshness, D2 qualifying
16
+ * set, D8 agreement). The wiring (the dark-gate, the injection, the Part A
17
+ * surface, the drain-time re-check) lives at the server callsite. Extracting the
18
+ * predicate here makes D1/D2/D7/D8 unit-testable against a REAL CommitmentTracker
19
+ * with no server boot — and guarantees the enqueue-time check and the drain-time
20
+ * re-check (D9) compute the IDENTICAL verdict (they call this same function), so
21
+ * they can never disagree.
22
+ *
23
+ * Signal vs Authority: this returns a boolean SIGNAL. The authority that decides
24
+ * revival remains the unchanged `evidenceEligible`/drainer. No new WorkEvidence
25
+ * enum value; provenance rides the reason tag + the reap-log `evidenceSource`.
26
+ */
27
+ import type { Commitment } from '../monitoring/CommitmentTracker.js';
28
+ /**
29
+ * Part D (spec: autonomous-registration-guarantee.md) — the pure inbound-user-
30
+ * message recency predicate over a topic's message-history tail. Extracted here
31
+ * so it is unit-testable against real TelegramAdapter.getTopicHistory output
32
+ * WITHOUT a server boot, and shared by every `recentUserMessage` consumer (the
33
+ * ReapGuard/SessionReaper deps AND the GAP-B D8 agreement check) so KEEP and
34
+ * eligibility compute the identical truth.
35
+ *
36
+ * An inbound USER message = `fromUser === true` (NOT an agent/system echo).
37
+ * Freshness = its `timestamp` within `withinMs`. History is oldest→newest, so the
38
+ * newest user entry (the first hit scanning backwards) is the verdict. A
39
+ * non-parseable timestamp is skipped (never a false positive). Returns false on
40
+ * an empty / user-message-free history. Pure — the server callsite wraps the
41
+ * getTopicHistory call in its own try/catch (D7 fail-open).
42
+ */
43
+ export interface RecencyLogEntry {
44
+ fromUser: boolean;
45
+ timestamp: string;
46
+ }
47
+ export declare function recentUserMessageFromHistory(history: readonly RecencyLogEntry[], withinMs: number, now?: number): boolean;
48
+ /** The minimal slice of CommitmentTracker this predicate reads. */
49
+ export interface GapBCommitmentSource {
50
+ /** Active commitments bound to a topic (pending/verified/violated, not expired). */
51
+ getActiveByTopicId(topicId: number): Commitment[];
52
+ }
53
+ export interface GapBQualifyDeps {
54
+ /** This machine's mesh identity, for the D2 local-origin filter. May be absent
55
+ * (single-machine / pre-mesh) — then no commitment is excluded on origin. */
56
+ ownMachineId?: string;
57
+ /** D1 freshness horizon on `createdAt` (ms). */
58
+ freshCommitmentWindowMs: number;
59
+ /** D8 agreement window — the SAME `recentUserMessage(topic, window)` predicate
60
+ * ReapGuard's commitment KEEP uses (the staleCommitmentWindowMs / 8h horizon). */
61
+ staleCommitmentWindowMs: number;
62
+ /** D8 corroboration: a recent INBOUND USER message on the topic within window.
63
+ * Shared with ReapGuard's dep so KEEP and eligibility cannot disagree. */
64
+ recentUserMessage: (topicId: number, withinMs: number) => boolean;
65
+ /** Wall clock (injected for testability). Default Date.now. */
66
+ now?: () => number;
67
+ }
68
+ /**
69
+ * D2 qualifying-commitment predicate (the per-commitment half).
70
+ *
71
+ * A commitment counts as live-work evidence only if ALL hold:
72
+ * - `status === 'pending'` (NOT verified/violated — a violated commitment is a
73
+ * FAILING session, not a working one);
74
+ * - agent-driven: `owner === 'agent'` (default), OR `owner === 'user'` with
75
+ * `blockedOn` ∈ {none, undefined} — a commitment WAITING on the user
76
+ * (`blockedOn` ∈ {user-input, user-authorization}) is the opposite of an
77
+ * active autonomous run and is excluded;
78
+ * - not beacon-paused and not beacon-suppressed;
79
+ * - local-origin: `originMachineId` is this machine or absent (a replicated peer
80
+ * commitment is advisory data, never revival authority);
81
+ * - D1 freshness: `createdAt` within `freshCommitmentWindowMs` — `createdAt` ONLY
82
+ * (no `updatedAt` exists; bookkeeping/beacon timestamps must NOT refresh
83
+ * freshness — a 3-day promise a beacon pinged 5min ago is not a live session).
84
+ */
85
+ export declare function commitmentQualifies(c: Commitment, deps: Pick<GapBQualifyDeps, 'ownMachineId' | 'freshCommitmentWindowMs' | 'now'>): boolean;
86
+ /**
87
+ * The full GAP-B eligibility verdict for a topic (D1/D2 + D8 agreement).
88
+ *
89
+ * True iff (a) at least one qualifying commitment exists for the topic (D1/D2),
90
+ * AND (b) there is a recent user message within the stale-commitment window (D8 —
91
+ * the SAME corroboration ReapGuard's commitment KEEP uses, so KEEP and
92
+ * eligibility AGREE; without this the 2026-06-13 13-session reap/revive loop
93
+ * returns). Fail-open (D7): any read throwing ⇒ false (no injection), never a
94
+ * spurious eligibility.
95
+ */
96
+ export declare function gapBEligibleForTopic(topicId: number, source: GapBCommitmentSource, deps: GapBQualifyDeps): boolean;
97
+ /** Dark-gate posture for the Part B injection (D5), resolved from config. */
98
+ export interface GapBInjectionGate {
99
+ /** True only when `monitoring.resumeQueue.commitmentEvidence.enabled === true`.
100
+ * Omitted ⇒ OFF on BOTH fleet AND dev (the containment). */
101
+ armed: boolean;
102
+ /** dryRun defaults TRUE when armed: logs "would inject" without tagging the
103
+ * candidate (the dark soak proving KEEP/eligibility agree before evidence
104
+ * flows). Only `armed && !dryRun` actually injects. */
105
+ dryRun: boolean;
106
+ }
107
+ /**
108
+ * Resolve the Part B dark-gate from the resumeQueue config block (D5).
109
+ * `enabled` MUST be an explicit `true` — absence/false ⇒ disarmed (no injection
110
+ * on fleet OR dev). `dryRun` defaults true when armed.
111
+ */
112
+ export declare function resolveGapBInjectionGate(cfg?: {
113
+ enabled?: boolean;
114
+ dryRun?: boolean;
115
+ }): GapBInjectionGate;
116
+ /** The full reaped-session decision: did GAP-B evidence fire, and does it INJECT? */
117
+ export interface GapBInjectionDecision {
118
+ /** The qualifying-commitment + D8 verdict fired (drives the Part A surface,
119
+ * even in dryRun — the surface exists to make the unregistered run visible). */
120
+ fired: boolean;
121
+ /** The LIVE injection switch: `fired && armed && !dryRun`. Only this tags the
122
+ * candidate + the reap-log. dryRun logs the verdict but injects nothing. */
123
+ inject: boolean;
124
+ }
125
+ /**
126
+ * Compute the reaped-session GAP-B decision. Pinned to the SAME branch the
127
+ * state-file source uses: an `age-limit` reap whose per-topic state file is
128
+ * ABSENT (`stateFilePresent === false` — a registered run is handled upstream by
129
+ * AGE_LIMIT_ACTIVE_RUN_REASON). When disarmed, returns a strict no-op
130
+ * `{fired:false, inject:false}` (the dark-default containment: no injection ⇒ no
131
+ * revival ⇒ the 2026-06-13 loop is structurally impossible while dark).
132
+ *
133
+ * `eligible` is the precomputed `gapBEligibleForTopic` verdict (kept a parameter
134
+ * so the caller can short-circuit the cost when disarmed, and so this stays a
135
+ * pure decision function over booleans).
136
+ */
137
+ export declare function decideGapBInjection(input: {
138
+ gate: GapBInjectionGate;
139
+ reason: string;
140
+ stateFilePresent: boolean;
141
+ eligible: boolean;
142
+ }): GapBInjectionDecision;
143
+ //# sourceMappingURL=gapBCommitmentEvidence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gapBCommitmentEvidence.d.ts","sourceRoot":"","sources":["../../src/core/gapBCommitmentEvidence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH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BAAwB,CAAC,GAAG,CAAC,EAAE;IAC7C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,GAAG,iBAAiB,CAGpB;AAED,qFAAqF;AACrF,MAAM,WAAW,qBAAqB;IACpC;qFACiF;IACjF,KAAK,EAAE,OAAO,CAAC;IACf;iFAC6E;IAC7E,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE;IACzC,IAAI,EAAE,iBAAiB,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,EAAE,OAAO,CAAC;IAC1B,QAAQ,EAAE,OAAO,CAAC;CACnB,GAAG,qBAAqB,CAMxB"}
@@ -0,0 +1,138 @@
1
+ /**
2
+ * GAP-B commitment-evidence backstop — the pure qualifying + agreement predicate.
3
+ *
4
+ * Spec: docs/specs/autonomous-registration-guarantee.md (Part B + Frontloaded
5
+ * Decisions D1/D2/D7/D8).
6
+ *
7
+ * The reaper revives a REGISTERED autonomous run from its per-topic state file.
8
+ * An UNregistered-but-actively-working run (operator said "go autonomous" but the
9
+ * skill never wrote the state file) has no state file → today it dies at the
10
+ * age-limit reap. This module is the BACKSTOP: it recognizes an independent
11
+ * live-work signal — a FRESH open agent-commitment for the topic, CORROBORATED by
12
+ * a recent user message — and (when armed, dark by default) lets the existing
13
+ * revival machinery keep the run alive.
14
+ *
15
+ * This file holds ONLY the deterministic predicates (D1 freshness, D2 qualifying
16
+ * set, D8 agreement). The wiring (the dark-gate, the injection, the Part A
17
+ * surface, the drain-time re-check) lives at the server callsite. Extracting the
18
+ * predicate here makes D1/D2/D7/D8 unit-testable against a REAL CommitmentTracker
19
+ * with no server boot — and guarantees the enqueue-time check and the drain-time
20
+ * re-check (D9) compute the IDENTICAL verdict (they call this same function), so
21
+ * they can never disagree.
22
+ *
23
+ * Signal vs Authority: this returns a boolean SIGNAL. The authority that decides
24
+ * revival remains the unchanged `evidenceEligible`/drainer. No new WorkEvidence
25
+ * enum value; provenance rides the reason tag + the reap-log `evidenceSource`.
26
+ */
27
+ export function recentUserMessageFromHistory(history, withinMs, now = Date.now()) {
28
+ const cutoff = now - withinMs;
29
+ for (let i = history.length - 1; i >= 0; i--) {
30
+ const entry = history[i];
31
+ if (!entry.fromUser)
32
+ continue; // skip agent/system echoes
33
+ const ts = Date.parse(entry.timestamp);
34
+ if (!Number.isFinite(ts))
35
+ continue;
36
+ // The first USER entry scanning backwards is the NEWEST user message — its
37
+ // recency is the verdict (every earlier user entry is older).
38
+ return ts >= cutoff;
39
+ }
40
+ return false;
41
+ }
42
+ /**
43
+ * D2 qualifying-commitment predicate (the per-commitment half).
44
+ *
45
+ * A commitment counts as live-work evidence only if ALL hold:
46
+ * - `status === 'pending'` (NOT verified/violated — a violated commitment is a
47
+ * FAILING session, not a working one);
48
+ * - agent-driven: `owner === 'agent'` (default), OR `owner === 'user'` with
49
+ * `blockedOn` ∈ {none, undefined} — a commitment WAITING on the user
50
+ * (`blockedOn` ∈ {user-input, user-authorization}) is the opposite of an
51
+ * active autonomous run and is excluded;
52
+ * - not beacon-paused and not beacon-suppressed;
53
+ * - local-origin: `originMachineId` is this machine or absent (a replicated peer
54
+ * commitment is advisory data, never revival authority);
55
+ * - D1 freshness: `createdAt` within `freshCommitmentWindowMs` — `createdAt` ONLY
56
+ * (no `updatedAt` exists; bookkeeping/beacon timestamps must NOT refresh
57
+ * freshness — a 3-day promise a beacon pinged 5min ago is not a live session).
58
+ */
59
+ export function commitmentQualifies(c, deps) {
60
+ if (c.status !== 'pending')
61
+ return false;
62
+ const owner = c.owner ?? 'agent';
63
+ const blockedOn = c.blockedOn ?? 'none';
64
+ const agentDriven = owner === 'agent' || (owner === 'user' && blockedOn === 'none');
65
+ if (!agentDriven)
66
+ return false;
67
+ if (c.beaconPaused || c.beaconSuppressed)
68
+ return false;
69
+ if (c.originMachineId && deps.ownMachineId && c.originMachineId !== deps.ownMachineId) {
70
+ return false;
71
+ }
72
+ const nowMs = (deps.now ?? Date.now)();
73
+ const createdMs = Date.parse(c.createdAt);
74
+ if (!Number.isFinite(createdMs) || createdMs < nowMs - deps.freshCommitmentWindowMs) {
75
+ return false;
76
+ }
77
+ return true;
78
+ }
79
+ /**
80
+ * The full GAP-B eligibility verdict for a topic (D1/D2 + D8 agreement).
81
+ *
82
+ * True iff (a) at least one qualifying commitment exists for the topic (D1/D2),
83
+ * AND (b) there is a recent user message within the stale-commitment window (D8 —
84
+ * the SAME corroboration ReapGuard's commitment KEEP uses, so KEEP and
85
+ * eligibility AGREE; without this the 2026-06-13 13-session reap/revive loop
86
+ * returns). Fail-open (D7): any read throwing ⇒ false (no injection), never a
87
+ * spurious eligibility.
88
+ */
89
+ export function gapBEligibleForTopic(topicId, source, deps) {
90
+ try {
91
+ const qualifies = source
92
+ .getActiveByTopicId(topicId)
93
+ .some((c) => commitmentQualifies(c, deps));
94
+ if (!qualifies)
95
+ return false;
96
+ // D8 AGREEMENT — non-negotiable. A commitment that would NOT keep the session
97
+ // alive (no recent user message) cannot revive it either.
98
+ return deps.recentUserMessage(topicId, deps.staleCommitmentWindowMs);
99
+ }
100
+ catch {
101
+ // @silent-fallback-ok — D7: a throwing tracker/predicate contributes NOTHING;
102
+ // the reap proceeds exactly as today (no injection, no revive).
103
+ return false;
104
+ }
105
+ }
106
+ /**
107
+ * Resolve the Part B dark-gate from the resumeQueue config block (D5).
108
+ * `enabled` MUST be an explicit `true` — absence/false ⇒ disarmed (no injection
109
+ * on fleet OR dev). `dryRun` defaults true when armed.
110
+ */
111
+ export function resolveGapBInjectionGate(cfg) {
112
+ const armed = cfg?.enabled === true;
113
+ return { armed, dryRun: cfg?.dryRun !== false };
114
+ }
115
+ /**
116
+ * Compute the reaped-session GAP-B decision. Pinned to the SAME branch the
117
+ * state-file source uses: an `age-limit` reap whose per-topic state file is
118
+ * ABSENT (`stateFilePresent === false` — a registered run is handled upstream by
119
+ * AGE_LIMIT_ACTIVE_RUN_REASON). When disarmed, returns a strict no-op
120
+ * `{fired:false, inject:false}` (the dark-default containment: no injection ⇒ no
121
+ * revival ⇒ the 2026-06-13 loop is structurally impossible while dark).
122
+ *
123
+ * `eligible` is the precomputed `gapBEligibleForTopic` verdict (kept a parameter
124
+ * so the caller can short-circuit the cost when disarmed, and so this stays a
125
+ * pure decision function over booleans).
126
+ */
127
+ export function decideGapBInjection(input) {
128
+ if (!input.gate.armed)
129
+ return { fired: false, inject: false };
130
+ if (input.reason !== 'age-limit')
131
+ return { fired: false, inject: false };
132
+ if (input.stateFilePresent)
133
+ return { fired: false, inject: false };
134
+ if (!input.eligible)
135
+ return { fired: false, inject: false };
136
+ return { fired: true, inject: !input.gate.dryRun };
137
+ }
138
+ //# sourceMappingURL=gapBCommitmentEvidence.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gapBCommitmentEvidence.js","sourceRoot":"","sources":["../../src/core/gapBCommitmentEvidence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAwBH,MAAM,UAAU,4BAA4B,CAC1C,OAAmC,EACnC,QAAgB,EAChB,MAAc,IAAI,CAAC,GAAG,EAAE;IAExB,MAAM,MAAM,GAAG,GAAG,GAAG,QAAQ,CAAC;IAC9B,KAAK,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC7C,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QACzB,IAAI,CAAC,KAAK,CAAC,QAAQ;YAAE,SAAS,CAAC,2BAA2B;QAC1D,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QACvC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;YAAE,SAAS;QACnC,2EAA2E;QAC3E,8DAA8D;QAC9D,OAAO,EAAE,IAAI,MA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onitoringConfig {
4164
4164
  * ConfigDefaults — preserves the fleet flip).
4165
4165
  */
4166
4166
  autoHealStaleHostLock?: boolean;
4167
+ /**
4168
+ * GAP-B commitment-evidence backstop (spec:
4169
+ * autonomous-registration-guarantee.md, Part B). When an age-limit reap hits
4170
+ * a topic with NO per-topic autonomous-run state file but a FRESH qualifying
4171
+ * open agent-commitment corroborated by a recent user message (D8), inject
4172
+ * `build-or-autonomous-active` so an UNregistered-but-working run survives.
4173
+ *
4174
+ * Ships DARK (the containment): `enabled` is OMITTED so the injection is OFF
4175
+ * on BOTH fleet AND dev by default — no injection ⇒ no revival ⇒ the
4176
+ * 2026-06-13 loop is structurally impossible while dark. Set `enabled:true`
4177
+ * to arm; `dryRun:true` (the default when armed) logs "would inject" without
4178
+ * tagging the candidate, so a dark-soak can confirm KEEP/eligibility agree on
4179
+ * real data BEFORE evidence actually flows. CODE-defaulted (absent from
4180
+ * ConfigDefaults — the resumeQueue.* dark-default discipline, no migration).
4181
+ */
4182
+ commitmentEvidence?: {
4183
+ enabled?: boolean;
4184
+ dryRun?: boolean;
4185
+ /** Freshness horizon on `createdAt` (D1). Default 6h. */
4186
+ freshCommitmentWindowMs?: number;
4187
+ };
4167
4188
  };
4168
4189
  /**
4169
4190
  * AgentWorktreeReaper (Responsible Resource Usage — OS resource hygiene).