@coalex-ai/sdk 1.17.1 → 1.18.0-beta.478
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/evaluate.d.ts.map +1 -1
- package/dist/evaluate.js +6 -0
- package/dist/evaluate.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/ungoverned.d.ts +67 -0
- package/dist/ungoverned.d.ts.map +1 -0
- package/dist/ungoverned.js +330 -0
- package/dist/ungoverned.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/evaluate.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluate.d.ts","sourceRoot":"","sources":["../src/evaluate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"evaluate.d.ts","sourceRoot":"","sources":["../src/evaluate.ts"],"names":[],"mappings":"AAGA,OAAO,EAAuB,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAK7E,eAAO,MAAM,aAAa,aASxB,CAAC;AAEH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,MAAM,EAAE,eAAe,GAAG,WAAW,GAAG,UAAU,CAAC;IAC5D;;;OAGG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wCAAwC;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AA2BD,wBAAsB,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA4EpF"}
|
package/dist/evaluate.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getConfig, getApiKey } from "./index.js";
|
|
2
|
+
import { flushUngoverned } from "./ungoverned.js";
|
|
2
3
|
import { currentAgentId } from "./context.js";
|
|
3
4
|
import { serializeResumeHook } from "./decision-request.js";
|
|
4
5
|
import { VERSION } from "./version.js";
|
|
@@ -84,6 +85,11 @@ export async function evaluate(options) {
|
|
|
84
85
|
if (!resp.ok) {
|
|
85
86
|
throw await httpError("evaluate()", resp);
|
|
86
87
|
}
|
|
88
|
+
// The platform answered, so it is up: take any backlog of ungoverned records with it (COA-2394).
|
|
89
|
+
// Not awaited — `evaluate()` is on the caller's hot path and must not get slower to drain a queue
|
|
90
|
+
// — and it never rejects. Without this the spool would only drain on the NEXT outage, keeping the
|
|
91
|
+
// backlog exactly as long as the outage lasted, and then some.
|
|
92
|
+
void flushUngoverned();
|
|
87
93
|
// COA-261: surface server-side deprecation notices to the caller.
|
|
88
94
|
const deprecation = resp.headers?.get?.("X-Deprecation");
|
|
89
95
|
if (deprecation) {
|
package/dist/evaluate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluate.js","sourceRoot":"","sources":["../src/evaluate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC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I,CAAC,SAAS,CAAC,OAAO,CAAC;KAC9B,CAAC,CAAC;IAEH,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;QACb,MAAM,MAAM,SAAS,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IAC5C,CAAC;IAED,iGAAiG;IACjG,kGAAkG;IAClG,kGAAkG;IAClG,+DAA+D;IAC/D,KAAK,eAAe,EAAE,CAAC;IAEvB,kEAAkE;IAClE,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,CAAC;IACzD,IAAI,WAAW,EAAE,CAAC;QAChB,GAAG,CAAC,IAAI,CAAC,oBAAoB,WAAW,EAAE,CAAC,CAAC;IAC9C,CAAC;IAED,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;IAC/B,OAAO;QACL,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,SAAS,EAAE,IAAI,CAAC,UAAU;QAC1B,SAAS,EAAE,IAAI,CAAC,UAAU;QAC1B,YAAY,EAAE,IAAI,CAAC,aAAa,IAAI,SAAS;KAC9C,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export type { CoalexContextOptions } from "./context.js";
|
|
|
7
7
|
export { evaluate, KNOWN_METRICS } from "./evaluate.js";
|
|
8
8
|
export type { EvaluateOptions, EvaluationDecision } from "./evaluate.js";
|
|
9
9
|
export { resolve, VALID_DECISIONS } from "./resolve.js";
|
|
10
|
+
export { recordUngoverned, flushUngoverned } from "./ungoverned.js";
|
|
11
|
+
export type { UngovernedRecord } from "./ungoverned.js";
|
|
10
12
|
export type { ResolveOptions, ResolutionResult, MetricResult } from "./resolve.js";
|
|
11
13
|
export { fromEscalation, serializeDecisionRequest, parseResolver, resolverToSpec, resumeHookFromDict, serializeResumeHook, taskStateForStatus, TASK_STATES, TASK_STATE_BY_STATUS, DEFAULT_QUESTION, } from "./decision-request.js";
|
|
12
14
|
export type { DecisionRequest, TaskState, ElicitationAction, ElicitationResult, ContextPayload, QuestionSchema, QuestionField, ResolverPolicy, ResumeHook, EscalationLike, FromEscalationOptions, } from "./decision-request.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAKhD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAa,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3D,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAChF,YAAY,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACxD,YAAY,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACxD,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACnF,OAAO,EACL,cAAc,EACd,wBAAwB,EACxB,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACX,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EACV,eAAe,EACf,SAAS,EACT,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,aAAa,EACb,cAAc,EACd,UAAU,EACV,cAAc,EACd,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC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AAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AACvI,YAAY,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AACzF,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAKhD,wBAAgB,SAAS,IAAI,YAAY,CAKxC;AAED,wBAAgB,SAAS,IAAI,MAAM,CAKlC;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;IAC7B;;;;OAIG;IACH,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AAED,wBAAgB,QAAQ,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,IAAI,CAmCxD;AAED,0CAA0C;AAC1C,wBAAgB,gBAAgB,IAAI,IAAI,CAGvC"}
|
package/dist/index.js
CHANGED
|
@@ -11,6 +11,10 @@ import { setLogger } from "./logger.js";
|
|
|
11
11
|
export { coalexContext, coalexContextSync, currentAgentId } from "./context.js";
|
|
12
12
|
export { evaluate, KNOWN_METRICS } from "./evaluate.js";
|
|
13
13
|
export { resolve, VALID_DECISIONS } from "./resolve.js";
|
|
14
|
+
// What ran while the platform was unreachable (COA-2394). Python has had this since COA-2197 and
|
|
15
|
+
// this SDK had no equivalent at all, so a TypeScript agent's outage left nothing in the record —
|
|
16
|
+
// and an omission in a compliance report cannot be investigated the way a wrong label can.
|
|
17
|
+
export { recordUngoverned, flushUngoverned } from "./ungoverned.js";
|
|
14
18
|
export { fromEscalation, serializeDecisionRequest, parseResolver, resolverToSpec, resumeHookFromDict, serializeResumeHook, taskStateForStatus, TASK_STATES, TASK_STATE_BY_STATUS, DEFAULT_QUESTION, } from "./decision-request.js";
|
|
15
19
|
export { getPrompt } from "./prompts.js";
|
|
16
20
|
export { declareAgent } from "./agents.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAGxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EAAE,SAAS,EAAqB,MAAM,aAAa,CAAC;AAG3D,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEhF,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAExD,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,kBAAkB,E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CAAC,CAAC,YAAY,CAAC;IAEjB,MAAM,QAAQ,GAAG,IAAI,kBAAkB,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;IACtD,QAAQ,CAAC,gBAAgB,CAAC,IAAI,yBAAyB,EAAE,CAAC,CAAC;IAC3D,QAAQ,CAAC,gBAAgB,CAAC,IAAI,kBAAkB,CAAC,aAAa,CAAC,CAAC,CAAC;IACjE,QAAQ,CAAC,QAAQ,EAAE,CAAC;IAEpB,IAAI,OAAO,EAAE,OAAO,EAAE,CAAC;QACrB,2FAA2F;QAC3F,2FAA2F;QAC3F,4DAA4D;QAC5D,KAAK,gBAAgB,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC,CAAC;IAChG,CAAC;AACH,CAAC;AAED,0CAA0C;AAC1C,MAAM,UAAU,gBAAgB;IAC9B,OAAO,GAAG,IAAI,CAAC;IACf,OAAO,GAAG,IAAI,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recording that an action ran WITHOUT governance (COA-2394; Python's COA-2197, ported).
|
|
3
|
+
*
|
|
4
|
+
* An agent that cannot reach Coalex has two honest options: stop, or proceed and say so. Stopping
|
|
5
|
+
* is often wrong — failing closed blocks the customer's business when the fault is ours, and an
|
|
6
|
+
* agent that halts because our platform had a bad minute is an agent the customer turns off. So
|
|
7
|
+
* agents proceed.
|
|
8
|
+
*
|
|
9
|
+
* The problem was never that choice. It was that proceeding left **no trace at all**. `evaluate()`
|
|
10
|
+
* is a single POST with no retry and no buffer: when it throws, there is no escalation, no audit
|
|
11
|
+
* row, nothing. The action ran unreviewed and the platform never learned it happened — so the
|
|
12
|
+
* compliance report does not mislabel it, it OMITS it. For a document handed to a regulator that is
|
|
13
|
+
* the worse failure, because a wrong label can be investigated and an absence cannot.
|
|
14
|
+
*
|
|
15
|
+
* Python has had this since COA-2197 and TypeScript had nothing — and the parity page did not say
|
|
16
|
+
* so either, so a TS customer's outage was invisible twice over.
|
|
17
|
+
*
|
|
18
|
+
* **Why this cannot be a plain API call.** The failure is, by definition, "we could not reach the
|
|
19
|
+
* platform". You cannot report to an unavailable service that it was unavailable. So the record is
|
|
20
|
+
* written to disk and delivered when the platform comes back.
|
|
21
|
+
*
|
|
22
|
+
* **This is not a transcription of the Python module.** COA-2364 names three defects in it, and all
|
|
23
|
+
* three are closed here rather than inherited:
|
|
24
|
+
*
|
|
25
|
+
* 1. its `flush` reads the file, makes a network call, then rewrites the remainder — so a record
|
|
26
|
+
* appended during that call is erased. Here a flush ROTATES the file first and works on a copy
|
|
27
|
+
* nobody is still writing to.
|
|
28
|
+
* 2. its spool is one file per machine, so two agents with different API keys drain each other's
|
|
29
|
+
* records and post them under the wrong key — one customer's actions in another's audit trail.
|
|
30
|
+
* Here the filename carries the identity the records will be sent under.
|
|
31
|
+
* 3. it treats every 4xx as "the platform is down", so one payload the server refuses blocks the
|
|
32
|
+
* whole queue for ever. Here a permanent refusal discards that one record and the queue moves.
|
|
33
|
+
*
|
|
34
|
+
* Nothing here ever throws. It is called from the caller's `catch`, and a governance recorder that
|
|
35
|
+
* can break the thing it is recording is worse than none.
|
|
36
|
+
*/
|
|
37
|
+
/** What ran while nobody was watching. */
|
|
38
|
+
export interface UngovernedRecord {
|
|
39
|
+
/** The conversation it happened in, so the row lands on the right session's trail. */
|
|
40
|
+
requestId: string;
|
|
41
|
+
/** What ran. The tool name, as the rail will show it. */
|
|
42
|
+
action: string;
|
|
43
|
+
/** Why governance was not consulted — the error `evaluate()` threw. */
|
|
44
|
+
error: string;
|
|
45
|
+
}
|
|
46
|
+
/** The live spool path for the current registration. Exported for tests only. */
|
|
47
|
+
export declare function _spoolPathForTesting(): string;
|
|
48
|
+
/**
|
|
49
|
+
* Deliver what the spool is holding. Returns how many landed. Never throws.
|
|
50
|
+
*
|
|
51
|
+
* Called after a SUCCESSFUL platform call as well as from `recordUngoverned`, because success is
|
|
52
|
+
* the only honest signal that the platform is back. A spool that drained only on the next failure
|
|
53
|
+
* would keep the backlog exactly as long as the outage lasts, and then some.
|
|
54
|
+
*/
|
|
55
|
+
export declare function flushUngoverned(): Promise<number>;
|
|
56
|
+
/**
|
|
57
|
+
* Record that `action` ran without governance, because the platform could not be reached.
|
|
58
|
+
*
|
|
59
|
+
* Call it from the `catch` around `evaluate()`, beside the decision to proceed. It does not change
|
|
60
|
+
* that decision and cannot fail it: the returned promise never rejects. Awaiting it is optional,
|
|
61
|
+
* though awaiting is what guarantees the record is on disk before the process may exit.
|
|
62
|
+
*
|
|
63
|
+
* Delivery is attempted immediately and spooled if it does not land, which is the usual case: the
|
|
64
|
+
* reason this is being called is that the platform was unreachable a moment ago.
|
|
65
|
+
*/
|
|
66
|
+
export declare function recordUngoverned(record: UngovernedRecord): Promise<void>;
|
|
67
|
+
//# sourceMappingURL=ungoverned.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ungoverned.d.ts","sourceRoot":"","sources":["../src/ungoverned.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AA0CH,0CAA0C;AAC1C,MAAM,WAAW,gBAAgB;IAC/B,sFAAsF;IACtF,SAAS,EAAE,MAAM,CAAC;IAClB,yDAAyD;IACzD,MAAM,EAAE,MAAM,CAAC;IACf,uEAAuE;IACvE,KAAK,EAAE,MAAM,CAAC;CACf;AAyCD,iFAAiF;AACjF,wBAAgB,oBAAoB,IAAI,MAAM,CAK7C;AA4ID;;;;;;GAMG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,MAAM,CAAC,CA8CvD;AAED;;;;;;;;;GASG;AACH,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgC9E"}
|
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recording that an action ran WITHOUT governance (COA-2394; Python's COA-2197, ported).
|
|
3
|
+
*
|
|
4
|
+
* An agent that cannot reach Coalex has two honest options: stop, or proceed and say so. Stopping
|
|
5
|
+
* is often wrong — failing closed blocks the customer's business when the fault is ours, and an
|
|
6
|
+
* agent that halts because our platform had a bad minute is an agent the customer turns off. So
|
|
7
|
+
* agents proceed.
|
|
8
|
+
*
|
|
9
|
+
* The problem was never that choice. It was that proceeding left **no trace at all**. `evaluate()`
|
|
10
|
+
* is a single POST with no retry and no buffer: when it throws, there is no escalation, no audit
|
|
11
|
+
* row, nothing. The action ran unreviewed and the platform never learned it happened — so the
|
|
12
|
+
* compliance report does not mislabel it, it OMITS it. For a document handed to a regulator that is
|
|
13
|
+
* the worse failure, because a wrong label can be investigated and an absence cannot.
|
|
14
|
+
*
|
|
15
|
+
* Python has had this since COA-2197 and TypeScript had nothing — and the parity page did not say
|
|
16
|
+
* so either, so a TS customer's outage was invisible twice over.
|
|
17
|
+
*
|
|
18
|
+
* **Why this cannot be a plain API call.** The failure is, by definition, "we could not reach the
|
|
19
|
+
* platform". You cannot report to an unavailable service that it was unavailable. So the record is
|
|
20
|
+
* written to disk and delivered when the platform comes back.
|
|
21
|
+
*
|
|
22
|
+
* **This is not a transcription of the Python module.** COA-2364 names three defects in it, and all
|
|
23
|
+
* three are closed here rather than inherited:
|
|
24
|
+
*
|
|
25
|
+
* 1. its `flush` reads the file, makes a network call, then rewrites the remainder — so a record
|
|
26
|
+
* appended during that call is erased. Here a flush ROTATES the file first and works on a copy
|
|
27
|
+
* nobody is still writing to.
|
|
28
|
+
* 2. its spool is one file per machine, so two agents with different API keys drain each other's
|
|
29
|
+
* records and post them under the wrong key — one customer's actions in another's audit trail.
|
|
30
|
+
* Here the filename carries the identity the records will be sent under.
|
|
31
|
+
* 3. it treats every 4xx as "the platform is down", so one payload the server refuses blocks the
|
|
32
|
+
* whole queue for ever. Here a permanent refusal discards that one record and the queue moves.
|
|
33
|
+
*
|
|
34
|
+
* Nothing here ever throws. It is called from the caller's `catch`, and a governance recorder that
|
|
35
|
+
* can break the thing it is recording is worse than none.
|
|
36
|
+
*/
|
|
37
|
+
import { createHash } from "node:crypto";
|
|
38
|
+
import { appendFileSync, mkdirSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync, } from "node:fs";
|
|
39
|
+
import { tmpdir } from "node:os";
|
|
40
|
+
import { basename, dirname, join } from "node:path";
|
|
41
|
+
import { coalexFetch } from "./http.js";
|
|
42
|
+
import { getApiKey, getConfig } from "./index.js";
|
|
43
|
+
import { log } from "./logger.js";
|
|
44
|
+
import { VERSION } from "./version.js";
|
|
45
|
+
/**
|
|
46
|
+
* Bounded, and shorter than every other call this SDK makes: this runs on a path where something
|
|
47
|
+
* has already gone wrong, and a slow platform must not turn one failed call into a stalled agent.
|
|
48
|
+
*/
|
|
49
|
+
const TIMEOUT_MS = 5_000;
|
|
50
|
+
/**
|
|
51
|
+
* How many spooled records one flush will try. A backlog from a long outage drains over a few calls
|
|
52
|
+
* rather than blocking one of them for a minute.
|
|
53
|
+
*/
|
|
54
|
+
const FLUSH_BATCH = 50;
|
|
55
|
+
/**
|
|
56
|
+
* A spool that grew without limit on a long outage would fill the disk of the machine running the
|
|
57
|
+
* customer's agent. Oldest go first, and dropping is logged — losing the oldest is bad, taking the
|
|
58
|
+
* agent down with a full disk is worse.
|
|
59
|
+
*/
|
|
60
|
+
const MAX_SPOOLED = 1000;
|
|
61
|
+
/** The error text is the platform's, not ours, and can be a whole HTML page. */
|
|
62
|
+
const MAX_ERROR_CHARS = 500;
|
|
63
|
+
/** The registration this record belongs to, or nulls when there has not been one.
|
|
64
|
+
*
|
|
65
|
+
* `getConfig()` throws before `register()` has run, and that is a normal state here rather than an
|
|
66
|
+
* error: a recorder reached from a failure path may not add a second failure of its own.
|
|
67
|
+
*/
|
|
68
|
+
function identity() {
|
|
69
|
+
try {
|
|
70
|
+
return { endpoint: getConfig().endpoint, apiKey: getApiKey() };
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
return { endpoint: null, apiKey: null };
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Where undelivered records wait, scoped to the identity they will be sent under.
|
|
78
|
+
*
|
|
79
|
+
* The directory is overridable so a deployment can put it on a volume that survives a container
|
|
80
|
+
* restart — the default does not, and that limit is real.
|
|
81
|
+
*
|
|
82
|
+
* The filename carries a hash of endpoint + API key, and deliberately NOT the process id. Two
|
|
83
|
+
* processes sharing one key SHOULD share a spool: whichever is alive drains it, and that is what
|
|
84
|
+
* makes a record outlive the process that wrote it. What must never be shared is two different
|
|
85
|
+
* keys — the mix-up COA-2364 describes, where one customer's actions are posted into another's
|
|
86
|
+
* audit trail. The key is hashed and never written: no key has reached a file or a log line from
|
|
87
|
+
* this SDK, and a spool filename is something a customer will read.
|
|
88
|
+
*/
|
|
89
|
+
function spoolPath(endpoint, apiKey) {
|
|
90
|
+
const base = process.env.COALEX_SPOOL_DIR || join(tmpdir(), "coalex");
|
|
91
|
+
const who = createHash("sha256").update(`${endpoint} ${apiKey}`).digest("hex").slice(0, 16);
|
|
92
|
+
return join(base, `ungoverned-${who}.jsonl`);
|
|
93
|
+
}
|
|
94
|
+
/** The live spool path for the current registration. Exported for tests only. */
|
|
95
|
+
export function _spoolPathForTesting() {
|
|
96
|
+
const { endpoint, apiKey } = identity();
|
|
97
|
+
const base = process.env.COALEX_SPOOL_DIR || join(tmpdir(), "coalex");
|
|
98
|
+
if (!endpoint || !apiKey)
|
|
99
|
+
return join(base, "unregistered.jsonl");
|
|
100
|
+
return spoolPath(endpoint, apiKey);
|
|
101
|
+
}
|
|
102
|
+
async function post(endpoint, apiKey, entry, late) {
|
|
103
|
+
let resp;
|
|
104
|
+
try {
|
|
105
|
+
resp = await coalexFetch("ungoverned record", `${endpoint}/api/v1/gateway-audit`, {
|
|
106
|
+
method: "POST",
|
|
107
|
+
headers: {
|
|
108
|
+
"Content-Type": "application/json",
|
|
109
|
+
Authorization: `Bearer ${apiKey}`,
|
|
110
|
+
"X-SDK-Version": `coalex-ts/${VERSION}`,
|
|
111
|
+
},
|
|
112
|
+
body: JSON.stringify({
|
|
113
|
+
tool_name: entry.action,
|
|
114
|
+
arguments: null,
|
|
115
|
+
// A vocabulary of its own, and that is the whole point: `allow` would say the platform
|
|
116
|
+
// permitted this call. Nobody permitted it — nobody was asked. The transformer reads
|
|
117
|
+
// exactly this field to tell the rail row apart from a freely-running tool (COA-2316),
|
|
118
|
+
// and the compliance exporter maps it to `ungoverned` rather than `allowed`.
|
|
119
|
+
policy_decision: "ungoverned",
|
|
120
|
+
outcome: "ran",
|
|
121
|
+
request_id: entry.request_id,
|
|
122
|
+
policy_inputs: {
|
|
123
|
+
governed: null,
|
|
124
|
+
governance_error: entry.error,
|
|
125
|
+
recorded_late: late,
|
|
126
|
+
},
|
|
127
|
+
}),
|
|
128
|
+
}, TIMEOUT_MS);
|
|
129
|
+
}
|
|
130
|
+
catch {
|
|
131
|
+
// Unreachable is the expected case here, not an exception. Keep the record and try later.
|
|
132
|
+
return "stop";
|
|
133
|
+
}
|
|
134
|
+
if (resp.ok)
|
|
135
|
+
return "delivered";
|
|
136
|
+
// A record the server will never accept. Keeping it would block every record behind it for ever,
|
|
137
|
+
// which is how a queue that exists to preserve evidence ends up preserving none of it (COA-2364).
|
|
138
|
+
if (resp.status === 400 || resp.status === 404 || resp.status === 422) {
|
|
139
|
+
log.warn(`dropping an ungoverned record the platform rejected permanently (${resp.status}); ` +
|
|
140
|
+
`action=${entry.action} request_id=${entry.request_id}`);
|
|
141
|
+
return "discard";
|
|
142
|
+
}
|
|
143
|
+
// 401/403 is a credentials problem somebody can fix; 429 and 5xx are a platform that is busy or
|
|
144
|
+
// broken. None of them says the record is bad, so none of them may throw evidence away.
|
|
145
|
+
if (resp.status === 401 || resp.status === 403) {
|
|
146
|
+
log.warn(`the platform refused this SDK key (${resp.status}); ungoverned records stay queued`);
|
|
147
|
+
}
|
|
148
|
+
return "stop";
|
|
149
|
+
}
|
|
150
|
+
function readEntries(path) {
|
|
151
|
+
let raw;
|
|
152
|
+
try {
|
|
153
|
+
raw = readFileSync(path, "utf8");
|
|
154
|
+
}
|
|
155
|
+
catch {
|
|
156
|
+
return [];
|
|
157
|
+
}
|
|
158
|
+
const out = [];
|
|
159
|
+
for (const line of raw.split("\n")) {
|
|
160
|
+
if (!line.trim())
|
|
161
|
+
continue;
|
|
162
|
+
try {
|
|
163
|
+
const parsed = JSON.parse(line);
|
|
164
|
+
// A torn line from a killed process is dropped, not fatal.
|
|
165
|
+
if (parsed && typeof parsed === "object")
|
|
166
|
+
out.push(parsed);
|
|
167
|
+
}
|
|
168
|
+
catch {
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return out;
|
|
173
|
+
}
|
|
174
|
+
function appendEntries(path, entries) {
|
|
175
|
+
if (entries.length === 0)
|
|
176
|
+
return;
|
|
177
|
+
try {
|
|
178
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
179
|
+
// One append of whole lines. For a payload this small that interleaves cleanly with a
|
|
180
|
+
// concurrent append instead of overwriting it — which is the property that makes
|
|
181
|
+
// read-modify-write unnecessary, and read-modify-write is what loses records.
|
|
182
|
+
appendFileSync(path, entries.map((e) => JSON.stringify(e)).join("\n") + "\n", "utf8");
|
|
183
|
+
}
|
|
184
|
+
catch {
|
|
185
|
+
log.warn("could not write the ungoverned spool");
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
/** Keep the spool under the cap, oldest first. Only called after an append. */
|
|
189
|
+
function trim(path) {
|
|
190
|
+
try {
|
|
191
|
+
const entries = readEntries(path);
|
|
192
|
+
if (entries.length <= MAX_SPOOLED)
|
|
193
|
+
return;
|
|
194
|
+
log.warn(`dropping ${entries.length - MAX_SPOOLED} oldest ungoverned records; the spool is full`);
|
|
195
|
+
const kept = entries.slice(-MAX_SPOOLED);
|
|
196
|
+
const tmp = `${path}.${process.pid}.trim`;
|
|
197
|
+
writeFileSync(tmp, kept.map((e) => JSON.stringify(e)).join("\n") + "\n", "utf8");
|
|
198
|
+
// Renamed into place rather than written over: a process killed mid-write would otherwise leave
|
|
199
|
+
// a truncated file and take the whole backlog with it.
|
|
200
|
+
renameSync(tmp, path);
|
|
201
|
+
}
|
|
202
|
+
catch {
|
|
203
|
+
log.warn("could not trim the ungoverned spool");
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Batches left behind by a process that died mid-drain, returned to the live spool.
|
|
208
|
+
*
|
|
209
|
+
* Rotation means a crash between "renamed" and "delivered" strands a batch in a working file.
|
|
210
|
+
* At-least-once is the right side to err on for an audit record — a duplicate is visible in the
|
|
211
|
+
* trail and a gap is not — so these come back rather than staying on disk for ever.
|
|
212
|
+
*/
|
|
213
|
+
function reclaimStranded(path) {
|
|
214
|
+
let names;
|
|
215
|
+
try {
|
|
216
|
+
names = readdirSync(dirname(path));
|
|
217
|
+
}
|
|
218
|
+
catch {
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
const prefix = `${basename(path)}.`;
|
|
222
|
+
for (const name of names) {
|
|
223
|
+
if (!name.startsWith(prefix) || !name.endsWith(".sending"))
|
|
224
|
+
continue;
|
|
225
|
+
const stranded = join(dirname(path), name);
|
|
226
|
+
appendEntries(path, readEntries(stranded));
|
|
227
|
+
try {
|
|
228
|
+
rmSync(stranded, { force: true });
|
|
229
|
+
}
|
|
230
|
+
catch {
|
|
231
|
+
/* it will be picked up on the next flush */
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Deliver what the spool is holding. Returns how many landed. Never throws.
|
|
237
|
+
*
|
|
238
|
+
* Called after a SUCCESSFUL platform call as well as from `recordUngoverned`, because success is
|
|
239
|
+
* the only honest signal that the platform is back. A spool that drained only on the next failure
|
|
240
|
+
* would keep the backlog exactly as long as the outage lasts, and then some.
|
|
241
|
+
*/
|
|
242
|
+
export async function flushUngoverned() {
|
|
243
|
+
const { endpoint, apiKey } = identity();
|
|
244
|
+
if (!endpoint || !apiKey)
|
|
245
|
+
return 0;
|
|
246
|
+
const path = spoolPath(endpoint, apiKey);
|
|
247
|
+
reclaimStranded(path);
|
|
248
|
+
// Rotate, then work on the copy. Anything appended from here on goes to a fresh live file and
|
|
249
|
+
// cannot be erased by this drain — the defect COA-2364 describes on the Python side.
|
|
250
|
+
const working = `${path}.${process.pid}.${Date.now()}.sending`;
|
|
251
|
+
try {
|
|
252
|
+
renameSync(path, working);
|
|
253
|
+
}
|
|
254
|
+
catch {
|
|
255
|
+
return 0; // nothing to drain, or another process took it first
|
|
256
|
+
}
|
|
257
|
+
const pending = readEntries(working);
|
|
258
|
+
const keep = [];
|
|
259
|
+
let delivered = 0;
|
|
260
|
+
let stopped = false;
|
|
261
|
+
for (let i = 0; i < pending.length; i += 1) {
|
|
262
|
+
const entry = pending[i];
|
|
263
|
+
// Stop at the first refusal: the platform is still down, and sending the rest of a backlog at a
|
|
264
|
+
// service that just refused one helps nobody. The batch cap does the same for a long outage.
|
|
265
|
+
if (stopped || i >= FLUSH_BATCH) {
|
|
266
|
+
keep.push(entry);
|
|
267
|
+
continue;
|
|
268
|
+
}
|
|
269
|
+
const attempt = await post(endpoint, apiKey, entry, true);
|
|
270
|
+
if (attempt === "delivered") {
|
|
271
|
+
delivered += 1;
|
|
272
|
+
}
|
|
273
|
+
else if (attempt === "stop") {
|
|
274
|
+
stopped = true;
|
|
275
|
+
keep.push(entry);
|
|
276
|
+
}
|
|
277
|
+
// "discard" is counted as neither: the line is gone on purpose, and the log says so.
|
|
278
|
+
}
|
|
279
|
+
appendEntries(path, keep);
|
|
280
|
+
try {
|
|
281
|
+
rmSync(working, { force: true });
|
|
282
|
+
}
|
|
283
|
+
catch {
|
|
284
|
+
/* reclaimed on the next flush */
|
|
285
|
+
}
|
|
286
|
+
return delivered;
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Record that `action` ran without governance, because the platform could not be reached.
|
|
290
|
+
*
|
|
291
|
+
* Call it from the `catch` around `evaluate()`, beside the decision to proceed. It does not change
|
|
292
|
+
* that decision and cannot fail it: the returned promise never rejects. Awaiting it is optional,
|
|
293
|
+
* though awaiting is what guarantees the record is on disk before the process may exit.
|
|
294
|
+
*
|
|
295
|
+
* Delivery is attempted immediately and spooled if it does not land, which is the usual case: the
|
|
296
|
+
* reason this is being called is that the platform was unreachable a moment ago.
|
|
297
|
+
*/
|
|
298
|
+
export async function recordUngoverned(record) {
|
|
299
|
+
try {
|
|
300
|
+
const { endpoint, apiKey } = identity();
|
|
301
|
+
if (!endpoint || !apiKey) {
|
|
302
|
+
// No endpoint to send it to and no account to attribute it to. Spooling it would be spooling
|
|
303
|
+
// something undeliverable for ever.
|
|
304
|
+
log.warn("an ungoverned action was not recorded — register() has not been called");
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
const entry = {
|
|
308
|
+
request_id: record.requestId,
|
|
309
|
+
action: record.action,
|
|
310
|
+
error: String(record.error).slice(0, MAX_ERROR_CHARS),
|
|
311
|
+
at: Date.now(),
|
|
312
|
+
};
|
|
313
|
+
const attempt = await post(endpoint, apiKey, entry, false);
|
|
314
|
+
if (attempt === "delivered") {
|
|
315
|
+
// It landed, so the platform is up: take the backlog with it.
|
|
316
|
+
await flushUngoverned();
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
if (attempt === "discard")
|
|
320
|
+
return;
|
|
321
|
+
const path = spoolPath(endpoint, apiKey);
|
|
322
|
+
appendEntries(path, [entry]);
|
|
323
|
+
trim(path);
|
|
324
|
+
}
|
|
325
|
+
catch {
|
|
326
|
+
// Never break the caller's catch block.
|
|
327
|
+
log.warn("could not record an ungoverned action");
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
//# sourceMappingURL=ungoverned.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ungoverned.js","sourceRoot":"","sources":["../src/ungoverned.ts"],"names":[],"mappings":"A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AC,IAAI,CAAC,CAAC;IACb,CAAC;IAAC,MAAM,CAAC;QACP,wCAAwC;QACxC,GAAG,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC;IACpD,CAAC;AACH,CAAC"}
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.
|
|
1
|
+
export declare const VERSION = "1.18.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SDK version, sent in the X-SDK-Version header so the platform can see which
|
|
2
2
|
// SDK releases customers run before removing a deprecated field (COA-261).
|
|
3
3
|
// Keep in sync with package.json "version".
|
|
4
|
-
export const VERSION = "1.
|
|
4
|
+
export const VERSION = "1.18.0";
|
|
5
5
|
//# sourceMappingURL=version.js.map
|