instar 1.3.576 → 1.3.577
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.
- package/dist/commands/server.d.ts.map +1 -1
- package/dist/commands/server.js +13 -0
- package/dist/commands/server.js.map +1 -1
- package/dist/config/ConfigDefaults.d.ts.map +1 -1
- package/dist/config/ConfigDefaults.js +14 -0
- package/dist/config/ConfigDefaults.js.map +1 -1
- package/dist/core/CommitmentMutation.d.ts +1 -1
- package/dist/core/CommitmentMutation.d.ts.map +1 -1
- package/dist/core/CommitmentMutation.js +32 -0
- package/dist/core/CommitmentMutation.js.map +1 -1
- package/dist/core/CommitmentsSync.d.ts.map +1 -1
- package/dist/core/CommitmentsSync.js +20 -1
- package/dist/core/CommitmentsSync.js.map +1 -1
- package/dist/core/MeshRpc.d.ts +1 -1
- package/dist/core/MeshRpc.d.ts.map +1 -1
- package/dist/core/MessagingToneGate.d.ts +22 -0
- package/dist/core/MessagingToneGate.d.ts.map +1 -1
- package/dist/core/MessagingToneGate.js +27 -1
- package/dist/core/MessagingToneGate.js.map +1 -1
- package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
- package/dist/core/PostUpdateMigrator.js +8 -0
- package/dist/core/PostUpdateMigrator.js.map +1 -1
- package/dist/core/devGatedFeatures.d.ts.map +1 -1
- package/dist/core/devGatedFeatures.js +6 -0
- package/dist/core/devGatedFeatures.js.map +1 -1
- package/dist/core/internal-id-leak.d.ts +23 -0
- package/dist/core/internal-id-leak.d.ts.map +1 -0
- package/dist/core/internal-id-leak.js +38 -0
- package/dist/core/internal-id-leak.js.map +1 -0
- package/dist/core/parked-on-user.d.ts +25 -0
- package/dist/core/parked-on-user.d.ts.map +1 -0
- package/dist/core/parked-on-user.js +49 -0
- package/dist/core/parked-on-user.js.map +1 -0
- package/dist/monitoring/CommitmentTracker.d.ts +107 -0
- package/dist/monitoring/CommitmentTracker.d.ts.map +1 -1
- package/dist/monitoring/CommitmentTracker.js +156 -0
- package/dist/monitoring/CommitmentTracker.js.map +1 -1
- package/dist/monitoring/PromiseBeacon.d.ts +60 -0
- package/dist/monitoring/PromiseBeacon.d.ts.map +1 -1
- package/dist/monitoring/PromiseBeacon.js +165 -19
- package/dist/monitoring/PromiseBeacon.js.map +1 -1
- package/dist/scaffold/templates.d.ts.map +1 -1
- package/dist/scaffold/templates.js +10 -0
- package/dist/scaffold/templates.js.map +1 -1
- package/dist/server/routes.d.ts.map +1 -1
- package/dist/server/routes.js +99 -2
- package/dist/server/routes.js.map +1 -1
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +63 -63
- package/src/scaffold/templates.ts +10 -0
- package/upgrades/1.3.577.md +29 -0
- package/upgrades/side-effects/agent-owned-followthrough.md +73 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devGatedFeatures.d.ts","sourceRoot":"","sources":["../../src/core/devGatedFeatures.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,oEAAoE;AACpE,MAAM,WAAW,eAAe;IAC9B,mEAAmE;IACnE,IAAI,EAAE,MAAM,CAAC;IACb,uEAAuE;IACvE,UAAU,EAAE,MAAM,CAAC;IACnB,6DAA6D;IAC7D,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;;OAMG;IACH,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,kBAAkB,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"devGatedFeatures.d.ts","sourceRoot":"","sources":["../../src/core/devGatedFeatures.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,oEAAoE;AACpE,MAAM,WAAW,eAAe;IAC9B,mEAAmE;IACnE,IAAI,EAAE,MAAM,CAAC;IACb,uEAAuE;IACvE,UAAU,EAAE,MAAM,CAAC;IACnB,6DAA6D;IAC7D,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;;OAMG;IACH,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,kBAAkB,EAAE,eAAe,EA6R/C,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,MAAM,gBAAgB,GACxB,aAAa,GACb,cAAc,GACd,gBAAgB,GAChB,sBAAsB,GACtB,iBAAiB,CAAC;AAEtB,MAAM,WAAW,iBAAiB;IAChC,uEAAuE;IACvE,UAAU,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,mFAAmF;IACnF,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,oBAAoB,EAAE,iBAAiB,EAuHnD,CAAC;AAEF;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAO5E"}
|
|
@@ -24,6 +24,12 @@
|
|
|
24
24
|
* it is not cleanly a dark-on-fleet feature.
|
|
25
25
|
*/
|
|
26
26
|
export const DEV_GATED_FEATURES = [
|
|
27
|
+
{
|
|
28
|
+
name: 'agentOwnedFollowthrough',
|
|
29
|
+
configPath: 'commitments.agentOwnedFollowthrough.enabled',
|
|
30
|
+
description: 'The Agent Carries the Loop (C1+C2) — owner-gated beacon suppression + external-block staleness governor + evidence-gated graveyard reconciler; the user is never status-pinged for an agent-owned commitment.',
|
|
31
|
+
justification: 'Ships dryRun:true (the dry-run canary): on a dev agent the owner-gate + governor + reconciler run the full decision loop and AUDIT/log every suppression/dead-letter/close they WOULD make, but PromiseBeacon.emitUserSend STILL sends and the governor/reconciler mutate nothing while dryRun holds (verified at emitUserSend §4.2 + reconcileGraveyard/maybeReconcileGraveyard dryRun branches). No spend, no destructive action, no egress while the canary holds; real suppression/closes need a deliberate dryRun:false. Same dogfooding posture as topicProfiles / credential-repointing.',
|
|
32
|
+
},
|
|
27
33
|
{
|
|
28
34
|
name: 'growthAnalyst',
|
|
29
35
|
configPath: 'monitoring.growthAnalyst.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,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;QAChE,aAAa,EAAE,8FAA8F;KAC9G;IACD;QACE,IAAI,EAAE,6BAA6B;QACnC,UAAU,EAAE,sCAAsC;QAClD,WAAW,EAAE,gDAAgD;QAC7D,aAAa,EAAE,yGAAyG;KACzH;IACD;QACE,IAAI,EAAE,cAAc;QACpB,UAAU,EAAE,sBAAsB;QAClC,WAAW,EAAE,iEAAiE;QAC9E,aAAa,EAAE,sDAAsD;KACtE;IACD;QACE,IAAI,EAAE,8BAA8B;QACpC,UAAU,EAAE,uCAAuC;QACnD,WAAW,EAAE,oEAAoE;QACjF,aAAa,EAAE,yDAAyD;KACz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V;KAChW;IACD,sDAAsD;IACtD;QACE,UAAU,EAAE,uCAAuC;QACnD,QAAQ,EAAE,cAAc;QACxB,MAAM,EAAE,wXAAwX;KACjY;IACD,gFAAgF;IAChF,uFAAuF;IACvF;QACE,UAAU,EAAE,gBAAgB;QAC5B,QAAQ,EAAE,sBAAsB;QAChC,MAAM,EAAE,8NAA8N;KACvO;IACD;QACE,UAAU,EAAE,gBAAgB;QAC5B,QAAQ,EAAE,sBAAsB;QAChC,MAAM,EAAE,gQAAgQ;KACzQ;CACF,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,MAAe,EAAE,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,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal-ID leak detector (C1+C2 "The Agent Carries the Loop" §4.3, B-IDLEAK).
|
|
3
|
+
*
|
|
4
|
+
* SIGNAL ONLY, and a MITIGATION — not a complete fix (the regex is evadable).
|
|
5
|
+
* It flags raw instar-internal plumbing tokens in *unsolicited, agent-initiated*
|
|
6
|
+
* outbound text — the "I'm not even sure what CMT is" leak the operator hit. It
|
|
7
|
+
* is a JARGON-class signal: it does NOT replace the authority-level
|
|
8
|
+
* guardProxyOutput / redactSecrets passes (those handle real secret/path
|
|
9
|
+
* disclosure). The full-context MessagingToneGate LLM decides whether to reframe;
|
|
10
|
+
* a direct answer to a user who explicitly asked for an identifier should pass.
|
|
11
|
+
*/
|
|
12
|
+
export interface InternalIdLeakSignal {
|
|
13
|
+
/** True when an internal-plumbing token is present (a SIGNAL, not a verdict). */
|
|
14
|
+
leaked: boolean;
|
|
15
|
+
/** Distinct pattern names that matched, bounded — for the gate's context. */
|
|
16
|
+
terms: string[];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Detect internal-ID / plumbing leaks. Returns `{ leaked: false, terms: [] }`
|
|
20
|
+
* when none is found. Never scrubs or blocks — it only signals.
|
|
21
|
+
*/
|
|
22
|
+
export declare function detectInternalIdLeak(text: string): InternalIdLeakSignal;
|
|
23
|
+
//# sourceMappingURL=internal-id-leak.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal-id-leak.d.ts","sourceRoot":"","sources":["../../src/core/internal-id-leak.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAeH,MAAM,WAAW,oBAAoB;IACnC,iFAAiF;IACjF,MAAM,EAAE,OAAO,CAAC;IAChB,6EAA6E;IAC7E,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,oBAAoB,CAOvE"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal-ID leak detector (C1+C2 "The Agent Carries the Loop" §4.3, B-IDLEAK).
|
|
3
|
+
*
|
|
4
|
+
* SIGNAL ONLY, and a MITIGATION — not a complete fix (the regex is evadable).
|
|
5
|
+
* It flags raw instar-internal plumbing tokens in *unsolicited, agent-initiated*
|
|
6
|
+
* outbound text — the "I'm not even sure what CMT is" leak the operator hit. It
|
|
7
|
+
* is a JARGON-class signal: it does NOT replace the authority-level
|
|
8
|
+
* guardProxyOutput / redactSecrets passes (those handle real secret/path
|
|
9
|
+
* disclosure). The full-context MessagingToneGate LLM decides whether to reframe;
|
|
10
|
+
* a direct answer to a user who explicitly asked for an identifier should pass.
|
|
11
|
+
*/
|
|
12
|
+
/** Internal-plumbing token patterns the user has no path to act on. */
|
|
13
|
+
const LEAK_PATTERNS = [
|
|
14
|
+
{ name: 'commitment-id', re: /\bCMT-\d+\b/i },
|
|
15
|
+
{ name: 'action-id', re: /\bACT-\d+\b/i },
|
|
16
|
+
{ name: 'learning-id', re: /\bLRN-\d+\b/i },
|
|
17
|
+
{ name: 'dry-run-flag', re: /\bdryRun\b/ },
|
|
18
|
+
{ name: 'rung-internal', re: /\brung-?[0-9]\b/i },
|
|
19
|
+
{ name: 'beacon-internal', re: /\bpromise-beacon\b/i },
|
|
20
|
+
{ name: 'gate-endpoint', re: /\/(commitments|credentials|operations|coherence|attention)\/[A-Za-z0-9:_-]/ },
|
|
21
|
+
{ name: 'sentinel-name', re: /\b\w+Sentinel\b/ },
|
|
22
|
+
{ name: 'gate-name', re: /\b\w+(Gate|Watchdog|Reaper)\b/ },
|
|
23
|
+
];
|
|
24
|
+
/**
|
|
25
|
+
* Detect internal-ID / plumbing leaks. Returns `{ leaked: false, terms: [] }`
|
|
26
|
+
* when none is found. Never scrubs or blocks — it only signals.
|
|
27
|
+
*/
|
|
28
|
+
export function detectInternalIdLeak(text) {
|
|
29
|
+
if (typeof text !== 'string' || !text)
|
|
30
|
+
return { leaked: false, terms: [] };
|
|
31
|
+
const terms = [];
|
|
32
|
+
for (const { name, re } of LEAK_PATTERNS) {
|
|
33
|
+
if (re.test(text) && !terms.includes(name))
|
|
34
|
+
terms.push(name);
|
|
35
|
+
}
|
|
36
|
+
return { leaked: terms.length > 0, terms };
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=internal-id-leak.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal-id-leak.js","sourceRoot":"","sources":["../../src/core/internal-id-leak.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,uEAAuE;AACvE,MAAM,aAAa,GAAgD;IACjE,EAAE,IAAI,EAAE,eAAe,EAAE,EAAE,EAAE,cAAc,EAAE;IAC7C,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,cAAc,EAAE;IACzC,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,EAAE,cAAc,EAAE;IAC3C,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE,EAAE,YAAY,EAAE;IAC1C,EAAE,IAAI,EAAE,eAAe,EAAE,EAAE,EAAE,kBAAkB,EAAE;IACjD,EAAE,IAAI,EAAE,iBAAiB,EAAE,EAAE,EAAE,qBAAqB,EAAE;IACtD,EAAE,IAAI,EAAE,eAAe,EAAE,EAAE,EAAE,4EAA4E,EAAE;IAC3G,EAAE,IAAI,EAAE,eAAe,EAAE,EAAE,EAAE,iBAAiB,EAAE;IAChD,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,+BAA+B,EAAE;CAC3D,CAAC;AASF;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAY;IAC/C,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;IAC3E,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,aAAa,EAAE,CAAC;QACzC,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC;YAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/D,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC;AAC7C,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parked-on-user detector (C1+C2 "The Agent Carries the Loop" §4.3, B-PARK).
|
|
3
|
+
*
|
|
4
|
+
* SIGNAL ONLY. This is a cheap, brittle regex pre-filter that flags outbound
|
|
5
|
+
* conversational text which DEFERS a future action onto the user — the
|
|
6
|
+
* anti-pattern of the agent quietly handing its own follow-through back to the
|
|
7
|
+
* human ("I'll leave that to you", "let me know when you want me to…"). It holds
|
|
8
|
+
* NO blocking authority: the full-context MessagingToneGate LLM is the authority
|
|
9
|
+
* that decides whether the deferral is illegitimate (an action the agent could
|
|
10
|
+
* own) vs. legitimate (a genuine value/taste/spend decision that is the user's —
|
|
11
|
+
* the human-only set, where the agent SHOULD defer). Per Signal-vs-Authority,
|
|
12
|
+
* the regex flags; the gate decides; the fail direction is toward sending.
|
|
13
|
+
*/
|
|
14
|
+
export interface ParkedOnUserSignal {
|
|
15
|
+
/** True when a parked-on-user phrase is present (a SIGNAL, not a verdict). */
|
|
16
|
+
parked: boolean;
|
|
17
|
+
/** The first offending phrase, bounded — for the gate's context. */
|
|
18
|
+
phrase?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Detect a parked-on-user phrase. Returns `{ parked: false }` when none is found.
|
|
22
|
+
* This never decides whether the deferral is legitimate — that is the gate's job.
|
|
23
|
+
*/
|
|
24
|
+
export declare function detectParkedOnUser(text: string): ParkedOnUserSignal;
|
|
25
|
+
//# sourceMappingURL=parked-on-user.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parked-on-user.d.ts","sourceRoot":"","sources":["../../src/core/parked-on-user.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAuBH,MAAM,WAAW,kBAAkB;IACjC,8EAA8E;IAC9E,MAAM,EAAE,OAAO,CAAC;IAChB,oEAAoE;IACpE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB,CASnE"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parked-on-user detector (C1+C2 "The Agent Carries the Loop" §4.3, B-PARK).
|
|
3
|
+
*
|
|
4
|
+
* SIGNAL ONLY. This is a cheap, brittle regex pre-filter that flags outbound
|
|
5
|
+
* conversational text which DEFERS a future action onto the user — the
|
|
6
|
+
* anti-pattern of the agent quietly handing its own follow-through back to the
|
|
7
|
+
* human ("I'll leave that to you", "let me know when you want me to…"). It holds
|
|
8
|
+
* NO blocking authority: the full-context MessagingToneGate LLM is the authority
|
|
9
|
+
* that decides whether the deferral is illegitimate (an action the agent could
|
|
10
|
+
* own) vs. legitimate (a genuine value/taste/spend decision that is the user's —
|
|
11
|
+
* the human-only set, where the agent SHOULD defer). Per Signal-vs-Authority,
|
|
12
|
+
* the regex flags; the gate decides; the fail direction is toward sending.
|
|
13
|
+
*/
|
|
14
|
+
/** Phrases that defer an action onto the user. Case-insensitive, whole-ish. */
|
|
15
|
+
const PARK_PHRASES = [
|
|
16
|
+
'your call',
|
|
17
|
+
"whenever you're ready",
|
|
18
|
+
'whenever you’re ready',
|
|
19
|
+
'when you get a chance',
|
|
20
|
+
'let me know when you want',
|
|
21
|
+
'let me know when you',
|
|
22
|
+
'feel free to ping me when',
|
|
23
|
+
'ping me when you',
|
|
24
|
+
"you'll need to",
|
|
25
|
+
'you’ll need to',
|
|
26
|
+
'you will need to',
|
|
27
|
+
'remember to',
|
|
28
|
+
"don't forget to",
|
|
29
|
+
'don’t forget to',
|
|
30
|
+
'up to you',
|
|
31
|
+
'whenever you get to it',
|
|
32
|
+
'when you have a moment',
|
|
33
|
+
];
|
|
34
|
+
/**
|
|
35
|
+
* Detect a parked-on-user phrase. Returns `{ parked: false }` when none is found.
|
|
36
|
+
* This never decides whether the deferral is legitimate — that is the gate's job.
|
|
37
|
+
*/
|
|
38
|
+
export function detectParkedOnUser(text) {
|
|
39
|
+
if (typeof text !== 'string' || !text)
|
|
40
|
+
return { parked: false };
|
|
41
|
+
const lc = text.toLowerCase();
|
|
42
|
+
for (const phrase of PARK_PHRASES) {
|
|
43
|
+
if (lc.includes(phrase)) {
|
|
44
|
+
return { parked: true, phrase: phrase.slice(0, 60) };
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return { parked: false };
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=parked-on-user.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parked-on-user.js","sourceRoot":"","sources":["../../src/core/parked-on-user.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,+EAA+E;AAC/E,MAAM,YAAY,GAAsB;IACtC,WAAW;IACX,uBAAuB;IACvB,uBAAuB;IACvB,uBAAuB;IACvB,2BAA2B;IAC3B,sBAAsB;IACtB,2BAA2B;IAC3B,kBAAkB;IAClB,gBAAgB;IAChB,gBAAgB;IAChB,kBAAkB;IAClB,aAAa;IACb,iBAAiB;IACjB,iBAAiB;IACjB,WAAW;IACX,wBAAwB;IACxB,wBAAwB;CACzB,CAAC;AASF;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC7C,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAChE,MAAM,EAAE,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IAC9B,KAAK,MAAM,MAAM,IAAI,YAAY,EAAE,CAAC;QAClC,IAAI,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YACxB,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;QACvD,CAAC;IACH,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;AAC3B,CAAC"}
|
|
@@ -48,6 +48,45 @@ export interface Commitment {
|
|
|
48
48
|
topicId?: number;
|
|
49
49
|
/** Source: 'agent' (self-registered) or 'sentinel' (detected by LLM scanner) */
|
|
50
50
|
source?: 'agent' | 'sentinel' | 'manual';
|
|
51
|
+
/** Who drives the next action. Default 'agent' (the agent owns follow-through). */
|
|
52
|
+
owner?: 'agent' | 'user';
|
|
53
|
+
/** What the next action waits on. Default 'none'. */
|
|
54
|
+
blockedOn?: 'none' | 'external' | 'user-input' | 'user-authorization';
|
|
55
|
+
/**
|
|
56
|
+
* For an owner:'agent' commitment whose work is side-effecting: the agent's
|
|
57
|
+
* self-declared action class. INERT in C1+C2 (well-formedness-validated only,
|
|
58
|
+
* no runtime consumer); forward-compatible plumbing for the C3 ratchet
|
|
59
|
+
* follow-on (agent-autonomy-ratchet). Side-effect authority remains the
|
|
60
|
+
* existing tool-call-time external-operation-gate, unchanged by this feature.
|
|
61
|
+
*/
|
|
62
|
+
actionClass?: string;
|
|
63
|
+
/**
|
|
64
|
+
* For owner:'agent', blockedOn:'external': the last observable dependency-probe
|
|
65
|
+
* recorded by the agent's own session (via POST /commitments/:id/probe). A
|
|
66
|
+
* fresh probe resets the external-block staleness window (§4.4); it never
|
|
67
|
+
* resets the absolute lifetime ceiling. Observation Needs Structure — the
|
|
68
|
+
* refused-without-it artifact that makes "monitoring" falsifiable.
|
|
69
|
+
*/
|
|
70
|
+
lastProbe?: {
|
|
71
|
+
at: string;
|
|
72
|
+
checked: string;
|
|
73
|
+
readinessSignal: string;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Set when the external-block staleness governor (§4.4) has dead-lettered this
|
|
77
|
+
* commitment (raised the ONE operator Attention item). Dedupes the dead-letter
|
|
78
|
+
* so it fires once per stale episode. Cleared by a fresh recordProbe (a renewed
|
|
79
|
+
* genuine wait re-arms the governor).
|
|
80
|
+
*/
|
|
81
|
+
externalBlockDeadLetteredAt?: string;
|
|
82
|
+
/**
|
|
83
|
+
* Names a newer commitment that supersedes this one. Objective close-evidence
|
|
84
|
+
* for the §4.5 graveyard reconciler: when the named superseder reaches a
|
|
85
|
+
* terminal-success status, this commitment is auto-closed as superseded (a
|
|
86
|
+
* disposition with evidence — NOT an "abandoned" auto-close). Settable at
|
|
87
|
+
* record() or via the guarded transition route.
|
|
88
|
+
*/
|
|
89
|
+
supersededBy?: string;
|
|
51
90
|
/** For config-change: the config path and expected value */
|
|
52
91
|
configPath?: string;
|
|
53
92
|
configExpectedValue?: unknown;
|
|
@@ -317,6 +356,10 @@ export declare class CommitmentTracker extends EventEmitter {
|
|
|
317
356
|
ownerMachineId?: string;
|
|
318
357
|
externalKey?: string;
|
|
319
358
|
beaconCreatedBySource?: 'skill' | 'api-loopback' | 'sentinel' | 'manual';
|
|
359
|
+
owner?: 'agent' | 'user';
|
|
360
|
+
blockedOn?: 'none' | 'external' | 'user-input' | 'user-authorization';
|
|
361
|
+
actionClass?: string;
|
|
362
|
+
supersededBy?: string;
|
|
320
363
|
}): Commitment;
|
|
321
364
|
/**
|
|
322
365
|
* Withdraw a commitment (user changed their mind).
|
|
@@ -348,6 +391,70 @@ export declare class CommitmentTracker extends EventEmitter {
|
|
|
348
391
|
* concurrent writes serialize cleanly.
|
|
349
392
|
*/
|
|
350
393
|
markReplyArrived(id: string, replyAt?: string): Commitment | null;
|
|
394
|
+
/**
|
|
395
|
+
* C1+C2 (spec agent-owned-followthrough §4.4) — record an observable
|
|
396
|
+
* dependency-probe on an owner:'agent', blockedOn:'external' commitment. The
|
|
397
|
+
* agent's own session calls this (via POST /commitments/:id/probe) when it
|
|
398
|
+
* checks the external dependency; a fresh probe RESETS the staleness window
|
|
399
|
+
* (but never the absolute lifetime ceiling). This is the "Observation Needs
|
|
400
|
+
* Structure" artifact that makes "monitoring" falsifiable. No-op (returns
|
|
401
|
+
* null) on a missing commitment, a terminal status, or a commitment that is
|
|
402
|
+
* not currently an external-block — a probe only means something for the
|
|
403
|
+
* state it governs.
|
|
404
|
+
*/
|
|
405
|
+
recordProbe(id: string, probe: {
|
|
406
|
+
checked: string;
|
|
407
|
+
readinessSignal: string;
|
|
408
|
+
}): Commitment | null;
|
|
409
|
+
/**
|
|
410
|
+
* C1+C2 §4.5 — evidence-gated graveyard reconciler. Auto-closes a pending
|
|
411
|
+
* commitment ONLY on objective evidence: its `supersededBy` names a commitment
|
|
412
|
+
* that has reached a terminal-SUCCESS status (verified | delivered). It NEVER
|
|
413
|
+
* closes a row that merely looks stale — "abandoned" is never an auto-close
|
|
414
|
+
* (CMT-1101 scar); evidence-less stale rows route to agent-drive / surface via
|
|
415
|
+
* the give-up + the external-block governor. Bounded by maxClosesPerPass;
|
|
416
|
+
* dryRun computes the close set without mutating. Each close writes a
|
|
417
|
+
* disposition-evidence resolution. (Verification-method passes are handled by
|
|
418
|
+
* the continuous verify() sweep, not here — this adds the supersession
|
|
419
|
+
* evidence type + the bounded, dry-run-able, feature/lease-gated drain.)
|
|
420
|
+
*/
|
|
421
|
+
reconcileGraveyard(opts?: {
|
|
422
|
+
maxClosesPerPass?: number;
|
|
423
|
+
dryRun?: boolean;
|
|
424
|
+
}): {
|
|
425
|
+
closed: string[];
|
|
426
|
+
wouldClose: string[];
|
|
427
|
+
scanned: number;
|
|
428
|
+
};
|
|
429
|
+
/**
|
|
430
|
+
* C1+C2 §4.1 — STRUCTURAL well-formedness validator for the owner⟂blockedOn
|
|
431
|
+
* state. Shared by record() and transitionState() so a guarded transition
|
|
432
|
+
* re-runs the SAME gate. Throws on an invalid enum or a blank
|
|
433
|
+
* user-authorization. Never classifies prose; holds no side-effect authority.
|
|
434
|
+
*/
|
|
435
|
+
static normalizeState(input: {
|
|
436
|
+
owner?: string;
|
|
437
|
+
blockedOn?: string;
|
|
438
|
+
actionClass?: string;
|
|
439
|
+
}): {
|
|
440
|
+
owner: 'agent' | 'user';
|
|
441
|
+
blockedOn: 'none' | 'external' | 'user-input' | 'user-authorization';
|
|
442
|
+
actionClass?: string;
|
|
443
|
+
};
|
|
444
|
+
/**
|
|
445
|
+
* C1+C2 §4.1 — guarded in-place state transition (round-4 codex #4: blanket
|
|
446
|
+
* immutability is too rigid; real commitments change as a dependency resolves /
|
|
447
|
+
* auth is granted / the agent takes ownership back). Re-runs the well-formedness
|
|
448
|
+
* gate on the NEW combined (current+patch) state and applies it IN PLACE — no
|
|
449
|
+
* close-and-reopen, so the commitment id + its existing history are preserved.
|
|
450
|
+
* Rejects a terminal commitment. Throws on an invalid new state (route → 400).
|
|
451
|
+
*/
|
|
452
|
+
transitionState(id: string, patch: {
|
|
453
|
+
owner?: string;
|
|
454
|
+
blockedOn?: string;
|
|
455
|
+
actionClass?: string;
|
|
456
|
+
supersededBy?: string;
|
|
457
|
+
}): Commitment;
|
|
351
458
|
/**
|
|
352
459
|
* Find the active threadline-reply commitment for a given threadId.
|
|
353
460
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommitmentTracker.d.ts","sourceRoot":"","sources":["../../src/monitoring/CommitmentTracker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAK3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAMxD,MAAM,MAAM,cAAc,GAAG,eAAe,GAAG,YAAY,GAAG,iBAAiB,CAAC;AAChF,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,WAAW,GAAG,WAAW,CAAC;AAE3G,MAAM,WAAW,UAAU;IACzB,kCAAkC;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,8CAA8C;IAC9C,WAAW,EAAE,MAAM,CAAC;IACpB,kCAAkC;IAClC,aAAa,EAAE,MAAM,CAAC;IACtB,uDAAuD;IACvD,IAAI,EAAE,cAAc,CAAC;IACrB,qBAAqB;IACrB,MAAM,EAAE,gBAAgB,CAAC;IACzB,mCAAmC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,4CAA4C;IAC5C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oDAAoD;IACpD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yBAAyB;IACzB,UAAU,CAAC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G;IACH,OAAO,CAAC,oBAAoB;IAuB5B,OAAO,CAAC,iBAAiB;IA6BzB;;;;;;;;;;;;;OAaG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;YAmB7C,gBAAgB;YAqBhB,oBAAoB;IAsClC;;;;;;;OAOG;IACH,OAAO,CAAC,UAAU;IAiBlB;;;;OAIG;IACH,OAAO,CAAC,SAAS;IAYjB,OAAO,CAAC,SAAS;IAuEjB,OAAO,CAAC,SAAS;IAuBjB;;;;;;;;OAQG;IACH,OAAO,CAAC,4BAA4B;IAqBpC,wEAAwE;IACxE,oBAAoB,IAAI;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAO9E,OAAO,CAAC,aAAa;IAWrB,OAAO,CAAC,SAAS;CAgBlB"}
|
|
@@ -130,6 +130,11 @@ export class CommitmentTracker extends EventEmitter {
|
|
|
130
130
|
* Record a new commitment. Returns the created commitment.
|
|
131
131
|
*/
|
|
132
132
|
record(input) {
|
|
133
|
+
// ── C1+C2 well-formedness gates (spec §4.1) — STRUCTURAL only (Signal-vs-
|
|
134
|
+
// Authority): validate the agent's own declaration; do NOT classify prose;
|
|
135
|
+
// hold NO side-effect authority (that stays with the tool-call gate).
|
|
136
|
+
// Shared with transitionState() so a guarded transition re-runs the SAME gate.
|
|
137
|
+
const { owner, blockedOn, actionClass } = CommitmentTracker.normalizeState(input);
|
|
133
138
|
const id = `CMT-${String(this.nextId++).padStart(3, '0')}`;
|
|
134
139
|
// Auto-enable PromiseBeacon on time-promise commitments. If the
|
|
135
140
|
// caller didn't explicitly set beaconEnabled, sniff the agent's
|
|
@@ -162,6 +167,11 @@ export class CommitmentTracker extends EventEmitter {
|
|
|
162
167
|
violationCount: 0,
|
|
163
168
|
topicId: input.topicId,
|
|
164
169
|
source: input.source ?? 'agent',
|
|
170
|
+
// C1+C2 "The Agent Carries the Loop" state model (spec §4.1).
|
|
171
|
+
owner,
|
|
172
|
+
blockedOn,
|
|
173
|
+
...(actionClass ? { actionClass } : {}),
|
|
174
|
+
...(input.supersededBy ? { supersededBy: input.supersededBy } : {}),
|
|
165
175
|
configPath: input.configPath,
|
|
166
176
|
configExpectedValue: input.configExpectedValue,
|
|
167
177
|
behavioralRule: input.behavioralRule,
|
|
@@ -316,6 +326,142 @@ export class CommitmentTracker extends EventEmitter {
|
|
|
316
326
|
lastReplyAt: replyAt ?? new Date().toISOString(),
|
|
317
327
|
}));
|
|
318
328
|
}
|
|
329
|
+
/**
|
|
330
|
+
* C1+C2 (spec agent-owned-followthrough §4.4) — record an observable
|
|
331
|
+
* dependency-probe on an owner:'agent', blockedOn:'external' commitment. The
|
|
332
|
+
* agent's own session calls this (via POST /commitments/:id/probe) when it
|
|
333
|
+
* checks the external dependency; a fresh probe RESETS the staleness window
|
|
334
|
+
* (but never the absolute lifetime ceiling). This is the "Observation Needs
|
|
335
|
+
* Structure" artifact that makes "monitoring" falsifiable. No-op (returns
|
|
336
|
+
* null) on a missing commitment, a terminal status, or a commitment that is
|
|
337
|
+
* not currently an external-block — a probe only means something for the
|
|
338
|
+
* state it governs.
|
|
339
|
+
*/
|
|
340
|
+
recordProbe(id, probe) {
|
|
341
|
+
const existing = this.store.commitments.find(c => c.id === id);
|
|
342
|
+
if (!existing)
|
|
343
|
+
return null;
|
|
344
|
+
if (['verified', 'violated', 'expired', 'withdrawn', 'delivered'].includes(existing.status)) {
|
|
345
|
+
return null;
|
|
346
|
+
}
|
|
347
|
+
if (existing.blockedOn !== 'external')
|
|
348
|
+
return null;
|
|
349
|
+
const checked = String(probe.checked ?? '').trim().slice(0, 500);
|
|
350
|
+
const readinessSignal = String(probe.readinessSignal ?? '').trim().slice(0, 500);
|
|
351
|
+
if (!checked || !readinessSignal)
|
|
352
|
+
return null;
|
|
353
|
+
const updated = this.mutateSync(id, c => ({
|
|
354
|
+
...c,
|
|
355
|
+
lastProbe: { at: new Date().toISOString(), checked, readinessSignal },
|
|
356
|
+
// A fresh probe re-arms the governor: clear any prior dead-letter mark so a
|
|
357
|
+
// future re-stale fires again (a renewed genuine wait, not a stuck one).
|
|
358
|
+
externalBlockDeadLetteredAt: undefined,
|
|
359
|
+
}));
|
|
360
|
+
this.emit('probe-recorded', updated);
|
|
361
|
+
return updated;
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* C1+C2 §4.5 — evidence-gated graveyard reconciler. Auto-closes a pending
|
|
365
|
+
* commitment ONLY on objective evidence: its `supersededBy` names a commitment
|
|
366
|
+
* that has reached a terminal-SUCCESS status (verified | delivered). It NEVER
|
|
367
|
+
* closes a row that merely looks stale — "abandoned" is never an auto-close
|
|
368
|
+
* (CMT-1101 scar); evidence-less stale rows route to agent-drive / surface via
|
|
369
|
+
* the give-up + the external-block governor. Bounded by maxClosesPerPass;
|
|
370
|
+
* dryRun computes the close set without mutating. Each close writes a
|
|
371
|
+
* disposition-evidence resolution. (Verification-method passes are handled by
|
|
372
|
+
* the continuous verify() sweep, not here — this adds the supersession
|
|
373
|
+
* evidence type + the bounded, dry-run-able, feature/lease-gated drain.)
|
|
374
|
+
*/
|
|
375
|
+
reconcileGraveyard(opts = {}) {
|
|
376
|
+
const max = opts.maxClosesPerPass ?? 25;
|
|
377
|
+
const dryRun = opts.dryRun ?? false;
|
|
378
|
+
const TERMINAL_SUCCESS = new Set(['verified', 'delivered']);
|
|
379
|
+
const closed = [];
|
|
380
|
+
const wouldClose = [];
|
|
381
|
+
let scanned = 0;
|
|
382
|
+
for (const c of this.getActive()) {
|
|
383
|
+
if (closed.length >= max || wouldClose.length >= max)
|
|
384
|
+
break;
|
|
385
|
+
if (c.status !== 'pending')
|
|
386
|
+
continue;
|
|
387
|
+
if (!c.supersededBy)
|
|
388
|
+
continue; // no objective evidence → NEVER auto-close
|
|
389
|
+
scanned++;
|
|
390
|
+
const superseder = this.store.commitments.find(s => s.id === c.supersededBy);
|
|
391
|
+
if (!superseder || !TERMINAL_SUCCESS.has(superseder.status))
|
|
392
|
+
continue; // evidence not present yet
|
|
393
|
+
if (dryRun) {
|
|
394
|
+
wouldClose.push(c.id);
|
|
395
|
+
continue;
|
|
396
|
+
}
|
|
397
|
+
this.mutateSync(c.id, prev => ({
|
|
398
|
+
...prev,
|
|
399
|
+
status: 'withdrawn',
|
|
400
|
+
resolvedAt: new Date().toISOString(),
|
|
401
|
+
resolution: `superseded-by-${c.supersededBy} (auto-reconciled: superseder is ${superseder.status})`,
|
|
402
|
+
}));
|
|
403
|
+
closed.push(c.id);
|
|
404
|
+
this.emit('graveyard-reconciled', { id: c.id, supersededBy: c.supersededBy, superseder: superseder.id });
|
|
405
|
+
}
|
|
406
|
+
return { closed, wouldClose, scanned };
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* C1+C2 §4.1 — STRUCTURAL well-formedness validator for the owner⟂blockedOn
|
|
410
|
+
* state. Shared by record() and transitionState() so a guarded transition
|
|
411
|
+
* re-runs the SAME gate. Throws on an invalid enum or a blank
|
|
412
|
+
* user-authorization. Never classifies prose; holds no side-effect authority.
|
|
413
|
+
*/
|
|
414
|
+
static normalizeState(input) {
|
|
415
|
+
const OWNERS = ['agent', 'user'];
|
|
416
|
+
const BLOCKED_ON = ['none', 'external', 'user-input', 'user-authorization'];
|
|
417
|
+
const owner = (input.owner ?? 'agent');
|
|
418
|
+
const blockedOn = (input.blockedOn ?? 'none');
|
|
419
|
+
if (!OWNERS.includes(owner)) {
|
|
420
|
+
throw new Error(`invalid owner '${owner}' (expected agent|user)`);
|
|
421
|
+
}
|
|
422
|
+
if (!BLOCKED_ON.includes(blockedOn)) {
|
|
423
|
+
throw new Error(`invalid blockedOn '${blockedOn}' (expected none|external|user-input|user-authorization)`);
|
|
424
|
+
}
|
|
425
|
+
const actionClass = typeof input.actionClass === 'string' && input.actionClass.trim().length > 0
|
|
426
|
+
? input.actionClass.trim()
|
|
427
|
+
: undefined;
|
|
428
|
+
if (blockedOn === 'user-authorization' && !actionClass) {
|
|
429
|
+
throw new Error("blockedOn:'user-authorization' requires a non-empty actionClass naming the privileged action being authorized");
|
|
430
|
+
}
|
|
431
|
+
return { owner, blockedOn, actionClass };
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* C1+C2 §4.1 — guarded in-place state transition (round-4 codex #4: blanket
|
|
435
|
+
* immutability is too rigid; real commitments change as a dependency resolves /
|
|
436
|
+
* auth is granted / the agent takes ownership back). Re-runs the well-formedness
|
|
437
|
+
* gate on the NEW combined (current+patch) state and applies it IN PLACE — no
|
|
438
|
+
* close-and-reopen, so the commitment id + its existing history are preserved.
|
|
439
|
+
* Rejects a terminal commitment. Throws on an invalid new state (route → 400).
|
|
440
|
+
*/
|
|
441
|
+
transitionState(id, patch) {
|
|
442
|
+
const existing = this.store.commitments.find(c => c.id === id);
|
|
443
|
+
if (!existing)
|
|
444
|
+
throw new Error(`Commitment ${id} not found`);
|
|
445
|
+
if (['verified', 'violated', 'expired', 'withdrawn', 'delivered'].includes(existing.status)) {
|
|
446
|
+
throw new Error(`Commitment ${id} is terminal (${existing.status}) — cannot transition state`);
|
|
447
|
+
}
|
|
448
|
+
const { owner, blockedOn, actionClass } = CommitmentTracker.normalizeState({
|
|
449
|
+
owner: patch.owner ?? existing.owner,
|
|
450
|
+
blockedOn: patch.blockedOn ?? existing.blockedOn,
|
|
451
|
+
actionClass: patch.actionClass ?? existing.actionClass,
|
|
452
|
+
});
|
|
453
|
+
const updated = this.mutateSync(id, c => ({
|
|
454
|
+
...c,
|
|
455
|
+
owner,
|
|
456
|
+
blockedOn,
|
|
457
|
+
actionClass,
|
|
458
|
+
...(patch.supersededBy !== undefined
|
|
459
|
+
? { supersededBy: patch.supersededBy.trim() || undefined }
|
|
460
|
+
: {}),
|
|
461
|
+
}));
|
|
462
|
+
this.emit('state-transitioned', { id, owner, blockedOn });
|
|
463
|
+
return updated;
|
|
464
|
+
}
|
|
319
465
|
/**
|
|
320
466
|
* Find the active threadline-reply commitment for a given threadId.
|
|
321
467
|
*
|
|
@@ -987,6 +1133,16 @@ export class CommitmentTracker extends EventEmitter {
|
|
|
987
1133
|
// consistent with what the engine expects.
|
|
988
1134
|
if (c.redriveCount === undefined)
|
|
989
1135
|
c.redriveCount = 0;
|
|
1136
|
+
// C1+C2 "The Agent Carries the Loop" back-fill (spec §4.7).
|
|
1137
|
+
// Default owner→'agent' (the agent carries the loop) and
|
|
1138
|
+
// blockedOn→'none'. NEVER silently classify a legacy row as
|
|
1139
|
+
// 'user-authorization' (that would invent an operator-approval
|
|
1140
|
+
// obligation that was never made). actionClass/lastProbe stay
|
|
1141
|
+
// absent for legacy rows (optional, read as undefined).
|
|
1142
|
+
if (c.owner === undefined)
|
|
1143
|
+
c.owner = 'agent';
|
|
1144
|
+
if (c.blockedOn === undefined)
|
|
1145
|
+
c.blockedOn = 'none';
|
|
990
1146
|
}
|
|
991
1147
|
// Bump on-disk version tag; persisted on next saveStore().
|
|
992
1148
|
data.version = 2;
|