@runfile-ai/schemas 0.4.0 → 0.5.0
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/canonical.d.ts +29 -3
- package/dist/canonical.d.ts.map +1 -1
- package/dist/canonical.js +43 -5
- package/dist/canonical.js.map +1 -1
- package/dist/event.d.ts +50 -50
- package/dist/evidence.d.ts +76 -76
- package/dist/ingest.d.ts +160 -160
- package/dist/manifest.d.ts +2 -2
- package/package.json +1 -1
package/dist/canonical.d.ts
CHANGED
|
@@ -21,10 +21,36 @@ export { stringify as canonicalStringify };
|
|
|
21
21
|
*/
|
|
22
22
|
export declare function canonicalSha256(value: unknown): string;
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* Fields NOT covered by `event_hash`.
|
|
25
25
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
26
|
+
* The hash commits to the SDK-authored capture fields only — never the
|
|
27
|
+
* server-set ones. This is what makes the chain work end to end:
|
|
28
|
+
* - the SDK can reproduce the hash, so `prev_event_hash_intent` (the previous
|
|
29
|
+
* event's `event_hash` as the SDK computed it) is a real integrity claim,
|
|
30
|
+
* not noise — a mismatch is a genuine `chain_break`;
|
|
31
|
+
* - fields written AFTER the hash is computed (`merkle_inclusion` by the
|
|
32
|
+
* Merkle Builder, server-appended `anomaly_flags`) don't retroactively
|
|
33
|
+
* invalidate it, so the Verifier re-checks the same bytes the server hashed.
|
|
34
|
+
*
|
|
35
|
+
* Exclusion-based (not a whitelist) so additive minor-version fields are
|
|
36
|
+
* hash-protected automatically. This set is the cross-language chain contract —
|
|
37
|
+
* the TS reference here, `canonical.go`, and `canonical.py` MUST agree, and the
|
|
38
|
+
* Verifier CLI must use the same projection. Changing it is chain-breaking:
|
|
39
|
+
* bump the schema major and re-anchor.
|
|
40
|
+
*/
|
|
41
|
+
export declare const NON_HASHED_EVENT_FIELDS: readonly ["event_hash", "tenant_id", "received_at", "anomaly_flags", "merkle_inclusion", "prev_event_hash_intent"];
|
|
42
|
+
/**
|
|
43
|
+
* Projects an event onto the fields covered by `event_hash` — i.e. drops the
|
|
44
|
+
* server-set / transport-only fields in {@link NON_HASHED_EVENT_FIELDS}. Every
|
|
45
|
+
* consumer hashes `canonicalEventForHash(event)`, so they agree regardless of
|
|
46
|
+
* which server-set fields happen to be present on the object.
|
|
47
|
+
*/
|
|
48
|
+
export declare function canonicalEventForHash<T extends {
|
|
49
|
+
event_hash?: unknown;
|
|
50
|
+
}>(event: T): Record<string, unknown>;
|
|
51
|
+
/**
|
|
52
|
+
* Computes the `event_hash` for a RunfileEvent: SHA-256 over the canonical JSON
|
|
53
|
+
* of {@link canonicalEventForHash}(event).
|
|
28
54
|
*/
|
|
29
55
|
export declare function computeEventHash<T extends {
|
|
30
56
|
event_hash?: unknown;
|
package/dist/canonical.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canonical.d.ts","sourceRoot":"","sources":["../src/canonical.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAMhD;AAED,+EAA+E;AAC/E,OAAO,EAAE,SAAS,IAAI,kBAAkB,EAAE,CAAC;AAE3C;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAEtD;AAMD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,EAAE,KAAK,EAAE,CAAC,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"canonical.d.ts","sourceRoot":"","sources":["../src/canonical.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAMhD;AAED,+EAA+E;AAC/E,OAAO,EAAE,SAAS,IAAI,kBAAkB,EAAE,CAAC;AAE3C;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAEtD;AAMD;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,uBAAuB,oHAO1B,CAAC;AAIX;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,EACtE,KAAK,EAAE,CAAC,GACP,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAMzB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,EAAE,KAAK,EAAE,CAAC,GAAG,MAAM,CAErF"}
|
package/dist/canonical.js
CHANGED
|
@@ -34,13 +34,51 @@ function sha256Hex(input) {
|
|
|
34
34
|
return createHash('sha256').update(input).digest('hex');
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
|
-
*
|
|
37
|
+
* Fields NOT covered by `event_hash`.
|
|
38
38
|
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
39
|
+
* The hash commits to the SDK-authored capture fields only — never the
|
|
40
|
+
* server-set ones. This is what makes the chain work end to end:
|
|
41
|
+
* - the SDK can reproduce the hash, so `prev_event_hash_intent` (the previous
|
|
42
|
+
* event's `event_hash` as the SDK computed it) is a real integrity claim,
|
|
43
|
+
* not noise — a mismatch is a genuine `chain_break`;
|
|
44
|
+
* - fields written AFTER the hash is computed (`merkle_inclusion` by the
|
|
45
|
+
* Merkle Builder, server-appended `anomaly_flags`) don't retroactively
|
|
46
|
+
* invalidate it, so the Verifier re-checks the same bytes the server hashed.
|
|
47
|
+
*
|
|
48
|
+
* Exclusion-based (not a whitelist) so additive minor-version fields are
|
|
49
|
+
* hash-protected automatically. This set is the cross-language chain contract —
|
|
50
|
+
* the TS reference here, `canonical.go`, and `canonical.py` MUST agree, and the
|
|
51
|
+
* Verifier CLI must use the same projection. Changing it is chain-breaking:
|
|
52
|
+
* bump the schema major and re-anchor.
|
|
53
|
+
*/
|
|
54
|
+
export const NON_HASHED_EVENT_FIELDS = [
|
|
55
|
+
'event_hash', // the hash field itself
|
|
56
|
+
'tenant_id', // server-resolved from the API key, never SDK-sent
|
|
57
|
+
'received_at', // server receive stamp
|
|
58
|
+
'anomaly_flags', // server may append flags after the hash is computed
|
|
59
|
+
'merkle_inclusion', // populated later by the Merkle Builder
|
|
60
|
+
'prev_event_hash_intent', // wire-only advisory; the hash commits to prev_event_hash
|
|
61
|
+
];
|
|
62
|
+
const NON_HASHED = new Set(NON_HASHED_EVENT_FIELDS);
|
|
63
|
+
/**
|
|
64
|
+
* Projects an event onto the fields covered by `event_hash` — i.e. drops the
|
|
65
|
+
* server-set / transport-only fields in {@link NON_HASHED_EVENT_FIELDS}. Every
|
|
66
|
+
* consumer hashes `canonicalEventForHash(event)`, so they agree regardless of
|
|
67
|
+
* which server-set fields happen to be present on the object.
|
|
68
|
+
*/
|
|
69
|
+
export function canonicalEventForHash(event) {
|
|
70
|
+
const out = {};
|
|
71
|
+
for (const [key, value] of Object.entries(event)) {
|
|
72
|
+
if (!NON_HASHED.has(key))
|
|
73
|
+
out[key] = value;
|
|
74
|
+
}
|
|
75
|
+
return out;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Computes the `event_hash` for a RunfileEvent: SHA-256 over the canonical JSON
|
|
79
|
+
* of {@link canonicalEventForHash}(event).
|
|
41
80
|
*/
|
|
42
81
|
export function computeEventHash(event) {
|
|
43
|
-
|
|
44
|
-
return canonicalSha256(rest);
|
|
82
|
+
return canonicalSha256(canonicalEventForHash(event));
|
|
45
83
|
}
|
|
46
84
|
//# sourceMappingURL=canonical.js.map
|
package/dist/canonical.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canonical.js","sourceRoot":"","sources":["../src/canonical.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,UAAU,EAAmB,MAAM,aAAa,CAAC;AAE1D;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,SAAS,CAAC,KAAc;IACtC,MAAM,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IACnC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,MAAM,IAAI,SAAS,CAAC,iEAAiE,CAAC,CAAC;IACzF,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,+EAA+E;AAC/E,OAAO,EAAE,SAAS,IAAI,kBAAkB,EAAE,CAAC;AAE3C;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,OAAO,UAAU,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;AACjD,CAAC;AAED,SAAS,SAAS,CAAC,KAAiB;IAClC,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC1D,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"canonical.js","sourceRoot":"","sources":["../src/canonical.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,UAAU,EAAmB,MAAM,aAAa,CAAC;AAE1D;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,SAAS,CAAC,KAAc;IACtC,MAAM,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IACnC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,MAAM,IAAI,SAAS,CAAC,iEAAiE,CAAC,CAAC;IACzF,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,+EAA+E;AAC/E,OAAO,EAAE,SAAS,IAAI,kBAAkB,EAAE,CAAC;AAE3C;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,OAAO,UAAU,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;AACjD,CAAC;AAED,SAAS,SAAS,CAAC,KAAiB;IAClC,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC1D,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,YAAY,EAAE,qCAAqC;IACnD,WAAW,EAAE,iEAAiE;IAC9E,aAAa,EAAE,mCAAmC;IAClD,eAAe,EAAE,+DAA+D;IAChF,kBAAkB,EAAE,+CAA+C;IACnE,wBAAwB,EAAE,2DAA2D;CAC7E,CAAC;AAEX,MAAM,UAAU,GAAG,IAAI,GAAG,CAAS,uBAAuB,CAAC,CAAC;AAE5D;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CACnC,KAAQ;IAER,MAAM,GAAG,GAA4B,EAAE,CAAC;IACxC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAgC,CAAC,EAAE,CAAC;QAC5E,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IAC7C,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAqC,KAAQ;IAC3E,OAAO,eAAe,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,CAAC;AACvD,CAAC"}
|
package/dist/event.d.ts
CHANGED
|
@@ -623,10 +623,10 @@ export declare const RunfileRunSchema: z.ZodObject<{
|
|
|
623
623
|
merkle_root: string;
|
|
624
624
|
}>, "many">>;
|
|
625
625
|
}, "strict", z.ZodTypeAny, {
|
|
626
|
+
tenant_id: string;
|
|
626
627
|
agent_identity: string;
|
|
627
628
|
run_id: string;
|
|
628
629
|
schema_version: string;
|
|
629
|
-
tenant_id: string;
|
|
630
630
|
lifecycle_state: "awaiting_webhook" | "awaiting_schedule" | "active" | "awaiting_human" | "ended";
|
|
631
631
|
started_at: string;
|
|
632
632
|
redaction_policy_version: string;
|
|
@@ -678,10 +678,10 @@ export declare const RunfileRunSchema: z.ZodObject<{
|
|
|
678
678
|
merkle_root: string;
|
|
679
679
|
}[] | undefined;
|
|
680
680
|
}, {
|
|
681
|
+
tenant_id: string;
|
|
681
682
|
agent_identity: string;
|
|
682
683
|
run_id: string;
|
|
683
684
|
schema_version: string;
|
|
684
|
-
tenant_id: string;
|
|
685
685
|
lifecycle_state: "awaiting_webhook" | "awaiting_schedule" | "active" | "awaiting_human" | "ended";
|
|
686
686
|
started_at: string;
|
|
687
687
|
redaction_policy_version: string;
|
|
@@ -1154,16 +1154,16 @@ export declare const RunfileEventSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1154
1154
|
}>>;
|
|
1155
1155
|
}, "strict", z.ZodTypeAny, {
|
|
1156
1156
|
event_hash: string;
|
|
1157
|
+
tenant_id: string;
|
|
1158
|
+
received_at: string;
|
|
1157
1159
|
run_id: string;
|
|
1158
1160
|
event_id: string;
|
|
1159
1161
|
schema_version: string;
|
|
1160
|
-
tenant_id: string;
|
|
1161
1162
|
redaction_policy_version: string;
|
|
1162
1163
|
parent_event_id: string | null;
|
|
1163
1164
|
segment_index: number;
|
|
1164
1165
|
local_seq: number;
|
|
1165
1166
|
captured_at: string;
|
|
1166
|
-
received_at: string;
|
|
1167
1167
|
wall_clock_source: "unknown" | "aws_time_sync" | "ntp" | "host_system";
|
|
1168
1168
|
sdk: {
|
|
1169
1169
|
framework: "langgraph" | "openai_agents" | "claude_agent_sdk" | "vercel_ai_sdk" | "manual" | "langgraph_js" | "openai_agents_js" | "anthropic_claude" | "anthropic_claude_js" | "mastra" | "pydantic_ai" | "crewai" | "mcp_client" | "otel_generic";
|
|
@@ -1188,6 +1188,16 @@ export declare const RunfileEventSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1188
1188
|
duration_ms?: number | undefined;
|
|
1189
1189
|
};
|
|
1190
1190
|
prev_event_hash: string;
|
|
1191
|
+
anomaly_flags?: {
|
|
1192
|
+
code: "missing_ambient_context" | "chain_break" | "sequence_gap" | "causality_violation" | "out_of_order_arrival" | "model_version_drift" | "unknown_agent_identity" | "data_classification_mismatch" | "policy_threshold_without_hitl" | "unauthorized_tool_invocation" | "redaction_policy_mismatch" | "schema_version_warning" | "agent_identity_mismatch_with_run" | "suspension_sla_exceeded" | "apparent_crash_detected" | "active_duration_exceeds_threshold" | "framework_signal_unrecognised" | "otel_attribute_missing" | "delegation_loop_detected";
|
|
1193
|
+
severity: "info" | "warning" | "error" | "critical";
|
|
1194
|
+
detail?: string | undefined;
|
|
1195
|
+
}[] | undefined;
|
|
1196
|
+
merkle_inclusion?: {
|
|
1197
|
+
manifest_uri: string;
|
|
1198
|
+
leaf_index: number;
|
|
1199
|
+
merkle_root: string;
|
|
1200
|
+
} | undefined;
|
|
1191
1201
|
decision?: {
|
|
1192
1202
|
outcome: "custom" | "approved" | "denied" | "escalated" | "deferred" | "no_action";
|
|
1193
1203
|
outcome_label?: string | undefined;
|
|
@@ -1283,28 +1293,18 @@ export declare const RunfileEventSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1283
1293
|
gen_ai_conversation_id?: string | undefined;
|
|
1284
1294
|
extra?: Record<string, string | number | boolean> | undefined;
|
|
1285
1295
|
} | undefined;
|
|
1286
|
-
anomaly_flags?: {
|
|
1287
|
-
code: "missing_ambient_context" | "chain_break" | "sequence_gap" | "causality_violation" | "out_of_order_arrival" | "model_version_drift" | "unknown_agent_identity" | "data_classification_mismatch" | "policy_threshold_without_hitl" | "unauthorized_tool_invocation" | "redaction_policy_mismatch" | "schema_version_warning" | "agent_identity_mismatch_with_run" | "suspension_sla_exceeded" | "apparent_crash_detected" | "active_duration_exceeds_threshold" | "framework_signal_unrecognised" | "otel_attribute_missing" | "delegation_loop_detected";
|
|
1288
|
-
severity: "info" | "warning" | "error" | "critical";
|
|
1289
|
-
detail?: string | undefined;
|
|
1290
|
-
}[] | undefined;
|
|
1291
|
-
merkle_inclusion?: {
|
|
1292
|
-
manifest_uri: string;
|
|
1293
|
-
leaf_index: number;
|
|
1294
|
-
merkle_root: string;
|
|
1295
|
-
} | undefined;
|
|
1296
1296
|
}, {
|
|
1297
1297
|
event_hash: string;
|
|
1298
|
+
tenant_id: string;
|
|
1299
|
+
received_at: string;
|
|
1298
1300
|
run_id: string;
|
|
1299
1301
|
event_id: string;
|
|
1300
1302
|
schema_version: string;
|
|
1301
|
-
tenant_id: string;
|
|
1302
1303
|
redaction_policy_version: string;
|
|
1303
1304
|
parent_event_id: string | null;
|
|
1304
1305
|
segment_index: number;
|
|
1305
1306
|
local_seq: number;
|
|
1306
1307
|
captured_at: string;
|
|
1307
|
-
received_at: string;
|
|
1308
1308
|
wall_clock_source: "unknown" | "aws_time_sync" | "ntp" | "host_system";
|
|
1309
1309
|
sdk: {
|
|
1310
1310
|
framework: "langgraph" | "openai_agents" | "claude_agent_sdk" | "vercel_ai_sdk" | "manual" | "langgraph_js" | "openai_agents_js" | "anthropic_claude" | "anthropic_claude_js" | "mastra" | "pydantic_ai" | "crewai" | "mcp_client" | "otel_generic";
|
|
@@ -1329,6 +1329,16 @@ export declare const RunfileEventSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1329
1329
|
duration_ms?: number | undefined;
|
|
1330
1330
|
};
|
|
1331
1331
|
prev_event_hash: string;
|
|
1332
|
+
anomaly_flags?: {
|
|
1333
|
+
code: "missing_ambient_context" | "chain_break" | "sequence_gap" | "causality_violation" | "out_of_order_arrival" | "model_version_drift" | "unknown_agent_identity" | "data_classification_mismatch" | "policy_threshold_without_hitl" | "unauthorized_tool_invocation" | "redaction_policy_mismatch" | "schema_version_warning" | "agent_identity_mismatch_with_run" | "suspension_sla_exceeded" | "apparent_crash_detected" | "active_duration_exceeds_threshold" | "framework_signal_unrecognised" | "otel_attribute_missing" | "delegation_loop_detected";
|
|
1334
|
+
severity: "info" | "warning" | "error" | "critical";
|
|
1335
|
+
detail?: string | undefined;
|
|
1336
|
+
}[] | undefined;
|
|
1337
|
+
merkle_inclusion?: {
|
|
1338
|
+
manifest_uri: string;
|
|
1339
|
+
leaf_index: number;
|
|
1340
|
+
merkle_root: string;
|
|
1341
|
+
} | undefined;
|
|
1332
1342
|
decision?: {
|
|
1333
1343
|
outcome: "custom" | "approved" | "denied" | "escalated" | "deferred" | "no_action";
|
|
1334
1344
|
outcome_label?: string | undefined;
|
|
@@ -1424,28 +1434,18 @@ export declare const RunfileEventSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1424
1434
|
gen_ai_conversation_id?: string | undefined;
|
|
1425
1435
|
extra?: Record<string, string | number | boolean> | undefined;
|
|
1426
1436
|
} | undefined;
|
|
1427
|
-
anomaly_flags?: {
|
|
1428
|
-
code: "missing_ambient_context" | "chain_break" | "sequence_gap" | "causality_violation" | "out_of_order_arrival" | "model_version_drift" | "unknown_agent_identity" | "data_classification_mismatch" | "policy_threshold_without_hitl" | "unauthorized_tool_invocation" | "redaction_policy_mismatch" | "schema_version_warning" | "agent_identity_mismatch_with_run" | "suspension_sla_exceeded" | "apparent_crash_detected" | "active_duration_exceeds_threshold" | "framework_signal_unrecognised" | "otel_attribute_missing" | "delegation_loop_detected";
|
|
1429
|
-
severity: "info" | "warning" | "error" | "critical";
|
|
1430
|
-
detail?: string | undefined;
|
|
1431
|
-
}[] | undefined;
|
|
1432
|
-
merkle_inclusion?: {
|
|
1433
|
-
manifest_uri: string;
|
|
1434
|
-
leaf_index: number;
|
|
1435
|
-
merkle_root: string;
|
|
1436
|
-
} | undefined;
|
|
1437
1437
|
}>, {
|
|
1438
1438
|
event_hash: string;
|
|
1439
|
+
tenant_id: string;
|
|
1440
|
+
received_at: string;
|
|
1439
1441
|
run_id: string;
|
|
1440
1442
|
event_id: string;
|
|
1441
1443
|
schema_version: string;
|
|
1442
|
-
tenant_id: string;
|
|
1443
1444
|
redaction_policy_version: string;
|
|
1444
1445
|
parent_event_id: string | null;
|
|
1445
1446
|
segment_index: number;
|
|
1446
1447
|
local_seq: number;
|
|
1447
1448
|
captured_at: string;
|
|
1448
|
-
received_at: string;
|
|
1449
1449
|
wall_clock_source: "unknown" | "aws_time_sync" | "ntp" | "host_system";
|
|
1450
1450
|
sdk: {
|
|
1451
1451
|
framework: "langgraph" | "openai_agents" | "claude_agent_sdk" | "vercel_ai_sdk" | "manual" | "langgraph_js" | "openai_agents_js" | "anthropic_claude" | "anthropic_claude_js" | "mastra" | "pydantic_ai" | "crewai" | "mcp_client" | "otel_generic";
|
|
@@ -1470,6 +1470,16 @@ export declare const RunfileEventSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1470
1470
|
duration_ms?: number | undefined;
|
|
1471
1471
|
};
|
|
1472
1472
|
prev_event_hash: string;
|
|
1473
|
+
anomaly_flags?: {
|
|
1474
|
+
code: "missing_ambient_context" | "chain_break" | "sequence_gap" | "causality_violation" | "out_of_order_arrival" | "model_version_drift" | "unknown_agent_identity" | "data_classification_mismatch" | "policy_threshold_without_hitl" | "unauthorized_tool_invocation" | "redaction_policy_mismatch" | "schema_version_warning" | "agent_identity_mismatch_with_run" | "suspension_sla_exceeded" | "apparent_crash_detected" | "active_duration_exceeds_threshold" | "framework_signal_unrecognised" | "otel_attribute_missing" | "delegation_loop_detected";
|
|
1475
|
+
severity: "info" | "warning" | "error" | "critical";
|
|
1476
|
+
detail?: string | undefined;
|
|
1477
|
+
}[] | undefined;
|
|
1478
|
+
merkle_inclusion?: {
|
|
1479
|
+
manifest_uri: string;
|
|
1480
|
+
leaf_index: number;
|
|
1481
|
+
merkle_root: string;
|
|
1482
|
+
} | undefined;
|
|
1473
1483
|
decision?: {
|
|
1474
1484
|
outcome: "custom" | "approved" | "denied" | "escalated" | "deferred" | "no_action";
|
|
1475
1485
|
outcome_label?: string | undefined;
|
|
@@ -1565,28 +1575,18 @@ export declare const RunfileEventSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1565
1575
|
gen_ai_conversation_id?: string | undefined;
|
|
1566
1576
|
extra?: Record<string, string | number | boolean> | undefined;
|
|
1567
1577
|
} | undefined;
|
|
1568
|
-
anomaly_flags?: {
|
|
1569
|
-
code: "missing_ambient_context" | "chain_break" | "sequence_gap" | "causality_violation" | "out_of_order_arrival" | "model_version_drift" | "unknown_agent_identity" | "data_classification_mismatch" | "policy_threshold_without_hitl" | "unauthorized_tool_invocation" | "redaction_policy_mismatch" | "schema_version_warning" | "agent_identity_mismatch_with_run" | "suspension_sla_exceeded" | "apparent_crash_detected" | "active_duration_exceeds_threshold" | "framework_signal_unrecognised" | "otel_attribute_missing" | "delegation_loop_detected";
|
|
1570
|
-
severity: "info" | "warning" | "error" | "critical";
|
|
1571
|
-
detail?: string | undefined;
|
|
1572
|
-
}[] | undefined;
|
|
1573
|
-
merkle_inclusion?: {
|
|
1574
|
-
manifest_uri: string;
|
|
1575
|
-
leaf_index: number;
|
|
1576
|
-
merkle_root: string;
|
|
1577
|
-
} | undefined;
|
|
1578
1578
|
}, {
|
|
1579
1579
|
event_hash: string;
|
|
1580
|
+
tenant_id: string;
|
|
1581
|
+
received_at: string;
|
|
1580
1582
|
run_id: string;
|
|
1581
1583
|
event_id: string;
|
|
1582
1584
|
schema_version: string;
|
|
1583
|
-
tenant_id: string;
|
|
1584
1585
|
redaction_policy_version: string;
|
|
1585
1586
|
parent_event_id: string | null;
|
|
1586
1587
|
segment_index: number;
|
|
1587
1588
|
local_seq: number;
|
|
1588
1589
|
captured_at: string;
|
|
1589
|
-
received_at: string;
|
|
1590
1590
|
wall_clock_source: "unknown" | "aws_time_sync" | "ntp" | "host_system";
|
|
1591
1591
|
sdk: {
|
|
1592
1592
|
framework: "langgraph" | "openai_agents" | "claude_agent_sdk" | "vercel_ai_sdk" | "manual" | "langgraph_js" | "openai_agents_js" | "anthropic_claude" | "anthropic_claude_js" | "mastra" | "pydantic_ai" | "crewai" | "mcp_client" | "otel_generic";
|
|
@@ -1611,6 +1611,16 @@ export declare const RunfileEventSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1611
1611
|
duration_ms?: number | undefined;
|
|
1612
1612
|
};
|
|
1613
1613
|
prev_event_hash: string;
|
|
1614
|
+
anomaly_flags?: {
|
|
1615
|
+
code: "missing_ambient_context" | "chain_break" | "sequence_gap" | "causality_violation" | "out_of_order_arrival" | "model_version_drift" | "unknown_agent_identity" | "data_classification_mismatch" | "policy_threshold_without_hitl" | "unauthorized_tool_invocation" | "redaction_policy_mismatch" | "schema_version_warning" | "agent_identity_mismatch_with_run" | "suspension_sla_exceeded" | "apparent_crash_detected" | "active_duration_exceeds_threshold" | "framework_signal_unrecognised" | "otel_attribute_missing" | "delegation_loop_detected";
|
|
1616
|
+
severity: "info" | "warning" | "error" | "critical";
|
|
1617
|
+
detail?: string | undefined;
|
|
1618
|
+
}[] | undefined;
|
|
1619
|
+
merkle_inclusion?: {
|
|
1620
|
+
manifest_uri: string;
|
|
1621
|
+
leaf_index: number;
|
|
1622
|
+
merkle_root: string;
|
|
1623
|
+
} | undefined;
|
|
1614
1624
|
decision?: {
|
|
1615
1625
|
outcome: "custom" | "approved" | "denied" | "escalated" | "deferred" | "no_action";
|
|
1616
1626
|
outcome_label?: string | undefined;
|
|
@@ -1706,16 +1716,6 @@ export declare const RunfileEventSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1706
1716
|
gen_ai_conversation_id?: string | undefined;
|
|
1707
1717
|
extra?: Record<string, string | number | boolean> | undefined;
|
|
1708
1718
|
} | undefined;
|
|
1709
|
-
anomaly_flags?: {
|
|
1710
|
-
code: "missing_ambient_context" | "chain_break" | "sequence_gap" | "causality_violation" | "out_of_order_arrival" | "model_version_drift" | "unknown_agent_identity" | "data_classification_mismatch" | "policy_threshold_without_hitl" | "unauthorized_tool_invocation" | "redaction_policy_mismatch" | "schema_version_warning" | "agent_identity_mismatch_with_run" | "suspension_sla_exceeded" | "apparent_crash_detected" | "active_duration_exceeds_threshold" | "framework_signal_unrecognised" | "otel_attribute_missing" | "delegation_loop_detected";
|
|
1711
|
-
severity: "info" | "warning" | "error" | "critical";
|
|
1712
|
-
detail?: string | undefined;
|
|
1713
|
-
}[] | undefined;
|
|
1714
|
-
merkle_inclusion?: {
|
|
1715
|
-
manifest_uri: string;
|
|
1716
|
-
leaf_index: number;
|
|
1717
|
-
merkle_root: string;
|
|
1718
|
-
} | undefined;
|
|
1719
1719
|
}>;
|
|
1720
1720
|
export type RunfileEvent = z.infer<typeof RunfileEventSchema>;
|
|
1721
1721
|
export declare const ZERO_PREV_HASH: `sha256:${string}`;
|