agentskeptic 2.4.0 → 3.1.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.
Files changed (91) hide show
  1. package/dist/cli/lockOrchestration.d.ts +0 -4
  2. package/dist/cli/lockOrchestration.d.ts.map +1 -1
  3. package/dist/cli/lockOrchestration.js +2 -2
  4. package/dist/cli/lockOrchestration.js.map +1 -1
  5. package/dist/commercial/postTrustDecisionBlocked.d.ts +11 -0
  6. package/dist/commercial/postTrustDecisionBlocked.d.ts.map +1 -0
  7. package/dist/commercial/postTrustDecisionBlocked.js +33 -0
  8. package/dist/commercial/postTrustDecisionBlocked.js.map +1 -0
  9. package/dist/commercial/trustDecisionRecord.d.ts +45 -0
  10. package/dist/commercial/trustDecisionRecord.d.ts.map +1 -0
  11. package/dist/commercial/trustDecisionRecord.js +65 -0
  12. package/dist/commercial/trustDecisionRecord.js.map +1 -0
  13. package/dist/commercial/trustDecisionRecord.schema.test.d.ts +2 -0
  14. package/dist/commercial/trustDecisionRecord.schema.test.d.ts.map +1 -0
  15. package/dist/commercial/trustDecisionRecord.schema.test.js +35 -0
  16. package/dist/commercial/trustDecisionRecord.schema.test.js.map +1 -0
  17. package/dist/decisionBlocker.d.ts +4 -0
  18. package/dist/decisionBlocker.d.ts.map +1 -1
  19. package/dist/decisionBlocker.js +5 -2
  20. package/dist/decisionBlocker.js.map +1 -1
  21. package/dist/decisionGate.assertSafe.test.js +3 -3
  22. package/dist/decisionGate.assertSafe.test.js.map +1 -1
  23. package/dist/decisionGate.d.ts +4 -0
  24. package/dist/decisionGate.d.ts.map +1 -1
  25. package/dist/decisionGate.js +13 -5
  26. package/dist/decisionGate.js.map +1 -1
  27. package/dist/enforceStateful.d.ts.map +1 -1
  28. package/dist/enforceStateful.js +67 -22
  29. package/dist/enforceStateful.js.map +1 -1
  30. package/dist/finalizeIrreversibleTrustBlock.d.ts +12 -0
  31. package/dist/finalizeIrreversibleTrustBlock.d.ts.map +1 -0
  32. package/dist/finalizeIrreversibleTrustBlock.js +13 -0
  33. package/dist/finalizeIrreversibleTrustBlock.js.map +1 -0
  34. package/dist/governanceEvidence.d.ts +27 -0
  35. package/dist/governanceEvidence.d.ts.map +1 -0
  36. package/dist/governanceEvidence.js +54 -0
  37. package/dist/governanceEvidence.js.map +1 -0
  38. package/dist/governanceEvidence.test.d.ts +2 -0
  39. package/dist/governanceEvidence.test.d.ts.map +1 -0
  40. package/dist/governanceEvidence.test.js +78 -0
  41. package/dist/governanceEvidence.test.js.map +1 -0
  42. package/dist/index.d.ts +3 -3
  43. package/dist/index.d.ts.map +1 -1
  44. package/dist/index.js +2 -3
  45. package/dist/index.js.map +1 -1
  46. package/dist/langGraphCheckpointTrustGate.d.ts +8 -1
  47. package/dist/langGraphCheckpointTrustGate.d.ts.map +1 -1
  48. package/dist/langGraphCheckpointTrustGate.js +27 -14
  49. package/dist/langGraphCheckpointTrustGate.js.map +1 -1
  50. package/dist/loop/loopOutput.d.ts +1 -1
  51. package/dist/loop/loopOutput.d.ts.map +1 -1
  52. package/dist/loop/loopOutput.js +4 -4
  53. package/dist/loop/loopOutput.js.map +1 -1
  54. package/dist/loop/runLoopSubcommand.d.ts.map +1 -1
  55. package/dist/loop/runLoopSubcommand.js +4 -2
  56. package/dist/loop/runLoopSubcommand.js.map +1 -1
  57. package/dist/publicDistribution.generated.d.ts +1 -1
  58. package/dist/publicDistribution.generated.js +1 -1
  59. package/dist/schemaLoad.d.ts +1 -1
  60. package/dist/schemaLoad.d.ts.map +1 -1
  61. package/dist/schemaLoad.js +7 -0
  62. package/dist/schemaLoad.js.map +1 -1
  63. package/dist/sdk/_generated/openapi-types.d.ts +199 -6
  64. package/dist/sdk/_generated/openapi-types.d.ts.map +1 -1
  65. package/dist/sdk/deprecatedPublicApi.d.ts +1 -1
  66. package/dist/sdk/deprecatedPublicApi.d.ts.map +1 -1
  67. package/dist/sdk/deprecatedPublicApi.js +2 -2
  68. package/dist/sdk/deprecatedPublicApi.js.map +1 -1
  69. package/dist/trustDecisionBlockedError.d.ts +16 -0
  70. package/dist/trustDecisionBlockedError.d.ts.map +1 -0
  71. package/dist/trustDecisionBlockedError.js +21 -0
  72. package/dist/trustDecisionBlockedError.js.map +1 -0
  73. package/package.json +1 -1
  74. package/schemas/governance-audit-bundle-v1.schema.json +33 -0
  75. package/schemas/material-truth-v1.schema.json +62 -0
  76. package/schemas/openapi-commercial-v1.in.yaml +225 -8
  77. package/schemas/openapi-commercial-v1.yaml +226 -9
  78. package/schemas/trust-certificate-snapshot-v1.schema.json +36 -0
  79. package/schemas/trust-decision-record-v1.schema.json +72 -0
  80. package/dist/decisionUnsafeError.d.ts +0 -8
  81. package/dist/decisionUnsafeError.d.ts.map +0 -1
  82. package/dist/decisionUnsafeError.js +0 -12
  83. package/dist/decisionUnsafeError.js.map +0 -1
  84. package/dist/enforcementProjection.d.ts +0 -17
  85. package/dist/enforcementProjection.d.ts.map +0 -1
  86. package/dist/enforcementProjection.js +0 -20
  87. package/dist/enforcementProjection.js.map +0 -1
  88. package/dist/langGraphCheckpointTrustUnsafeError.d.ts +0 -8
  89. package/dist/langGraphCheckpointTrustUnsafeError.d.ts.map +0 -1
  90. package/dist/langGraphCheckpointTrustUnsafeError.js +0 -12
  91. package/dist/langGraphCheckpointTrustUnsafeError.js.map +0 -1
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Raised when **`assertSafeForIrreversibleAction`** / LangGraph checkpoint production gate denies trust.
3
+ * Carries deterministic **`record`** suitable for ingestion and UI (**`human_blocker_lines`** parallel **`message`** joined by newlines).
4
+ */
5
+ export class TrustDecisionBlockedError extends Error {
6
+ record;
7
+ /** Mirrors **`record.trust_decision`** (non-**`safe`** when thrown). */
8
+ trustDecision;
9
+ /** Original certificate when available (**host-only consumers**). */
10
+ outcomeCertificate;
11
+ constructor(record, outcomeCertificate) {
12
+ super(record.human_blocker_lines.join("\n"));
13
+ this.name = "TrustDecisionBlockedError";
14
+ this.record = record;
15
+ this.trustDecision = record.trust_decision;
16
+ if (outcomeCertificate !== undefined) {
17
+ this.outcomeCertificate = outcomeCertificate;
18
+ }
19
+ }
20
+ }
21
+ //# sourceMappingURL=trustDecisionBlockedError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trustDecisionBlockedError.js","sourceRoot":"","sources":["../src/trustDecisionBlockedError.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,MAAM,OAAO,yBAA0B,SAAQ,KAAK;IACzC,MAAM,CAAwB;IACvC,wEAAwE;IAC/D,aAAa,CAAgB;IACtC,qEAAqE;IAC5D,kBAAkB,CAAwB;IAEnD,YAAY,MAA6B,EAAE,kBAAyC;QAClF,KAAK,CAAC,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC7C,IAAI,CAAC,IAAI,GAAG,2BAA2B,CAAC;QACxC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,cAAc,CAAC;QAC3C,IAAI,kBAAkB,KAAK,SAAS,EAAE,CAAC;YACrC,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;QAC/C,CAAC;IACH,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentskeptic",
3
- "version": "2.4.0",
3
+ "version": "3.1.0",
4
4
  "description": "AgentSkeptic compares agent claims with real downstream state — databases, APIs, object stores, and vector stores — and returns a clear verdict.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -0,0 +1,33 @@
1
+ {
2
+ "$id": "https://agentskeptic.com/schemas/governance-audit-bundle-v1.schema.json",
3
+ "title": "GovernanceAuditBundleV1",
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "required": ["schemaVersion", "generatedAt", "userId", "workflowId", "baseline", "events"],
7
+ "properties": {
8
+ "schemaVersion": { "type": "integer", "const": 1 },
9
+ "generatedAt": { "type": "string", "format": "date-time" },
10
+ "userId": { "type": "string", "minLength": 1 },
11
+ "workflowId": { "type": "string", "minLength": 1 },
12
+ "window": {
13
+ "type": "object",
14
+ "additionalProperties": false,
15
+ "required": ["from", "to"],
16
+ "properties": {
17
+ "from": { "type": "string", "format": "date-time" },
18
+ "to": { "type": "string", "format": "date-time" }
19
+ }
20
+ },
21
+ "baseline": {
22
+ "type": ["object", "null"],
23
+ "additionalProperties": true
24
+ },
25
+ "events": {
26
+ "type": "array",
27
+ "items": {
28
+ "type": "object",
29
+ "additionalProperties": true
30
+ }
31
+ }
32
+ }
33
+ }
@@ -0,0 +1,62 @@
1
+ {
2
+ "$id": "https://agentskeptic.com/schemas/material-truth-v1.schema.json",
3
+ "title": "MaterialTruthV1",
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "required": [
7
+ "schemaVersion",
8
+ "workflowId",
9
+ "runKind",
10
+ "stateRelation",
11
+ "reasonCodes",
12
+ "steps",
13
+ "checkpointVerdicts"
14
+ ],
15
+ "properties": {
16
+ "schemaVersion": { "type": "integer", "const": 1 },
17
+ "workflowId": { "type": "string", "minLength": 1, "maxLength": 512 },
18
+ "runKind": {
19
+ "type": "string",
20
+ "enum": ["contract_sql", "contract_sql_langgraph_checkpoint_trust", "quick_preview"]
21
+ },
22
+ "stateRelation": {
23
+ "type": "string",
24
+ "enum": ["matches_expectations", "does_not_match", "not_established"]
25
+ },
26
+ "reasonCodes": {
27
+ "type": "array",
28
+ "items": { "type": "string", "minLength": 1, "maxLength": 256 }
29
+ },
30
+ "steps": {
31
+ "type": "array",
32
+ "items": {
33
+ "type": "object",
34
+ "additionalProperties": false,
35
+ "required": ["seq", "toolId", "declaredAction", "expectedOutcome", "observedOutcome"],
36
+ "properties": {
37
+ "seq": { "type": "integer", "minimum": 0 },
38
+ "toolId": { "type": "string", "maxLength": 512 },
39
+ "declaredAction": { "type": "string", "minLength": 1, "maxLength": 4096 },
40
+ "expectedOutcome": { "type": "string", "minLength": 1, "maxLength": 4096 },
41
+ "observedOutcome": { "type": "string", "minLength": 1, "maxLength": 8192 }
42
+ }
43
+ }
44
+ },
45
+ "checkpointVerdicts": {
46
+ "type": "array",
47
+ "items": {
48
+ "type": "object",
49
+ "additionalProperties": false,
50
+ "required": ["checkpointKey", "verdict", "seqs"],
51
+ "properties": {
52
+ "checkpointKey": { "type": "string", "minLength": 1, "maxLength": 2048 },
53
+ "verdict": { "type": "string", "enum": ["verified", "inconsistent", "incomplete"] },
54
+ "seqs": {
55
+ "type": "array",
56
+ "items": { "type": "integer", "minimum": 0 }
57
+ }
58
+ }
59
+ }
60
+ }
61
+ }
62
+ }
@@ -125,7 +125,7 @@ paths:
125
125
  content:
126
126
  application/json:
127
127
  schema:
128
- $ref: "#/components/schemas/EnforcementProjectionRequest"
128
+ $ref: "#/components/schemas/EnforcementEvidenceRequestV2"
129
129
  responses:
130
130
  "200":
131
131
  description: Baseline created or replaced
@@ -156,7 +156,7 @@ paths:
156
156
  content:
157
157
  application/json:
158
158
  schema:
159
- $ref: "#/components/schemas/EnforcementProjectionRequest"
159
+ $ref: "#/components/schemas/EnforcementEvidenceRequestV2"
160
160
  responses:
161
161
  "200":
162
162
  description: Comparison result (ok or drift)
@@ -181,7 +181,7 @@ paths:
181
181
  content:
182
182
  application/json:
183
183
  schema:
184
- $ref: "#/components/schemas/EnforcementProjectionRequest"
184
+ $ref: "#/components/schemas/EnforcementEvidenceRequestV2"
185
185
  responses:
186
186
  "200":
187
187
  description: Drift accepted
@@ -213,6 +213,47 @@ paths:
213
213
  application/json:
214
214
  schema:
215
215
  $ref: "#/components/schemas/EnforcementHistoryResponse"
216
+ /api/v1/governance/export:
217
+ get:
218
+ operationId: exportGovernanceAuditBundle
219
+ summary: Export governance audit bundle for one workflow (session auth)
220
+ parameters:
221
+ - name: workflow_id
222
+ in: query
223
+ required: true
224
+ schema:
225
+ type: string
226
+ - name: from
227
+ in: query
228
+ required: false
229
+ schema:
230
+ type: string
231
+ format: date-time
232
+ - name: to
233
+ in: query
234
+ required: false
235
+ schema:
236
+ type: string
237
+ format: date-time
238
+ responses:
239
+ "200":
240
+ description: Governance audit bundle
241
+ content:
242
+ application/json:
243
+ schema:
244
+ $ref: "#/components/schemas/GovernanceAuditBundleV1"
245
+ "400":
246
+ description: Invalid request
247
+ content:
248
+ application/json:
249
+ schema:
250
+ $ref: "#/components/schemas/ProblemDetails"
251
+ "401":
252
+ description: Not authenticated
253
+ content:
254
+ application/json:
255
+ schema:
256
+ $ref: "#/components/schemas/ProblemDetails"
216
257
  /api/public/verification-reports:
217
258
  post:
218
259
  operationId: createPublicVerificationReport
@@ -304,6 +345,48 @@ paths:
304
345
  application/json:
305
346
  schema:
306
347
  $ref: "#/components/schemas/ProblemDetails"
348
+ /api/v1/funnel/trust-decision-blocked:
349
+ post:
350
+ operationId: postTrustDecisionBlocked
351
+ summary: Record a blocked irreversible trust decision (idempotent per API key + fingerprint)
352
+ description: >
353
+ POST when an in-process gate blocks an irreversible action. Success is HTTP 204.
354
+ Requires Bearer API key with report scope. Duplicate fingerprint returns 204 without a second funnel insert.
355
+ security:
356
+ - bearerAuth: []
357
+ requestBody:
358
+ required: true
359
+ content:
360
+ application/json:
361
+ schema:
362
+ $ref: "#/components/schemas/TrustDecisionRecordRequestV1"
363
+ responses:
364
+ "204":
365
+ description: Record accepted or duplicate ignored
366
+ "400":
367
+ description: Invalid JSON or validation failure
368
+ content:
369
+ application/json:
370
+ schema:
371
+ $ref: "#/components/schemas/ProblemDetails"
372
+ "401":
373
+ description: Invalid API key
374
+ content:
375
+ application/json:
376
+ schema:
377
+ $ref: "#/components/schemas/ProblemDetails"
378
+ "413":
379
+ description: Payload too large
380
+ content:
381
+ application/json:
382
+ schema:
383
+ $ref: "#/components/schemas/ProblemDetails"
384
+ "503":
385
+ description: Server error
386
+ content:
387
+ application/json:
388
+ schema:
389
+ $ref: "#/components/schemas/ProblemDetails"
307
390
  /api/oss/claim-ticket:
308
391
  post:
309
392
  operationId: postOssClaimTicket
@@ -461,19 +544,24 @@ components:
461
544
  scheme: bearer
462
545
  bearerFormat: API key
463
546
  schemas:
464
- EnforcementProjectionRequest:
547
+ EnforcementEvidenceRequestV2:
465
548
  type: object
466
- required: [run_id, workflow_id, projection_hash, projection]
549
+ required: [schema_version, run_id, workflow_id, outcome_certificate_v1, material_truth_sha256, certificate_sha256]
467
550
  properties:
551
+ schema_version:
552
+ type: integer
553
+ const: 2
468
554
  run_id:
469
555
  type: string
470
556
  workflow_id:
471
557
  type: string
472
- projection_hash:
473
- type: string
474
- projection:
558
+ outcome_certificate_v1:
475
559
  type: object
476
560
  additionalProperties: true
561
+ material_truth_sha256:
562
+ type: string
563
+ certificate_sha256:
564
+ type: string
477
565
  EnforcementStateResponse:
478
566
  type: object
479
567
  required: [schema_version, status, workflow_id]
@@ -509,6 +597,39 @@ components:
509
597
  items:
510
598
  type: object
511
599
  additionalProperties: true
600
+ GovernanceAuditBundleV1:
601
+ type: object
602
+ required: [schemaVersion, generatedAt, userId, workflowId, baseline, events]
603
+ properties:
604
+ schemaVersion:
605
+ type: integer
606
+ const: 1
607
+ generatedAt:
608
+ type: string
609
+ format: date-time
610
+ userId:
611
+ type: string
612
+ workflowId:
613
+ type: string
614
+ window:
615
+ type: object
616
+ required: [from, to]
617
+ properties:
618
+ from:
619
+ type: string
620
+ format: date-time
621
+ to:
622
+ type: string
623
+ format: date-time
624
+ baseline:
625
+ type: object
626
+ nullable: true
627
+ additionalProperties: true
628
+ events:
629
+ type: array
630
+ items:
631
+ type: object
632
+ additionalProperties: true
512
633
  ProblemDetails:
513
634
  type: object
514
635
  required: [type, title, status, detail]
@@ -564,6 +685,102 @@ components:
564
685
  subcommand:
565
686
  type: string
566
687
  enum: [batch_verify, quick_verify, verify_integrator_owned]
688
+ TrustDecisionRecordRequestV1:
689
+ type: object
690
+ additionalProperties: false
691
+ required:
692
+ - schema_version
693
+ - trust_decision
694
+ - gate_kind
695
+ - routing
696
+ - certificate_snapshot
697
+ - human_blocker_lines
698
+ properties:
699
+ schema_version:
700
+ type: integer
701
+ const: 1
702
+ trust_decision:
703
+ type: string
704
+ enum: [safe, unsafe, unknown]
705
+ gate_kind:
706
+ type: string
707
+ enum: [contract_sql_irreversible, langgraph_checkpoint_terminal]
708
+ routing:
709
+ type: object
710
+ additionalProperties: false
711
+ required:
712
+ - routing_key
713
+ properties:
714
+ routing_key:
715
+ type: string
716
+ maxLength: 512
717
+ team:
718
+ type: string
719
+ maxLength: 256
720
+ owner_slug:
721
+ type: string
722
+ maxLength: 256
723
+ certificate_snapshot:
724
+ $ref: "#/components/schemas/TrustCertificateSnapshotRequestV1"
725
+ human_blocker_lines:
726
+ type: array
727
+ minItems: 6
728
+ maxItems: 6
729
+ items:
730
+ type: string
731
+ TrustCertificateSnapshotRequestV1:
732
+ type: object
733
+ additionalProperties: false
734
+ required:
735
+ - schema_version
736
+ - workflow_id
737
+ - run_kind
738
+ - state_relation
739
+ - high_stakes_reliance
740
+ - reason_codes
741
+ - first_problem
742
+ properties:
743
+ schema_version:
744
+ type: integer
745
+ const: 1
746
+ workflow_id:
747
+ type: string
748
+ maxLength: 512
749
+ run_kind:
750
+ type: string
751
+ enum: [contract_sql, contract_sql_langgraph_checkpoint_trust, quick_preview]
752
+ state_relation:
753
+ type: string
754
+ enum: [matches_expectations, does_not_match, not_established]
755
+ high_stakes_reliance:
756
+ type: string
757
+ enum: [permitted, prohibited]
758
+ reason_codes:
759
+ type: array
760
+ maxItems: 24
761
+ items:
762
+ type: string
763
+ first_problem:
764
+ nullable: true
765
+ type: object
766
+ additionalProperties: false
767
+ required:
768
+ - seq
769
+ - tool_id
770
+ - observed_trunc
771
+ - expected_trunc
772
+ properties:
773
+ seq:
774
+ type: integer
775
+ minimum: 0
776
+ tool_id:
777
+ type: string
778
+ observed_trunc:
779
+ type: string
780
+ maxLength: 512
781
+ expected_trunc:
782
+ type: string
783
+ maxLength: 512
567
784
  OssClaimTicketRequest:
568
785
  type: object
569
786
  description: v1 or v2 OSS claim ticket wire shape (see website/src/lib/ossClaimTicketPayload.ts).