agentskeptic 4.2.0 → 6.0.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 (134) hide show
  1. package/dist/actionableFailure.remediationExhaustive.test.js +1 -1
  2. package/dist/bootstrap/runBootstrapSubcommand.js +1 -1
  3. package/dist/ciLock.js +1 -1
  4. package/dist/ciLock.js.map +1 -1
  5. package/dist/cli.js +2 -2
  6. package/dist/commercial/trustDecisionRecord.d.ts.map +1 -1
  7. package/dist/commercial/trustDecisionRecord.js +7 -3
  8. package/dist/commercial/trustDecisionRecord.js.map +1 -1
  9. package/dist/commercial/trustDecisionRecord.schema.test.js +24 -2
  10. package/dist/commercial/trustDecisionRecord.schema.test.js.map +1 -1
  11. package/dist/commercial/verifyOutcomeBeaconBody.d.ts.map +1 -1
  12. package/dist/commercial/verifyOutcomeBeaconBody.js +2 -1
  13. package/dist/commercial/verifyOutcomeBeaconBody.js.map +1 -1
  14. package/dist/compare.acceptance.test.js +1 -1
  15. package/dist/decisionBlocker.d.ts +1 -11
  16. package/dist/decisionBlocker.d.ts.map +1 -1
  17. package/dist/decisionBlocker.js +1 -41
  18. package/dist/decisionBlocker.js.map +1 -1
  19. package/dist/decisionEvidenceBundle/validateDecisionEvidenceBundle.js +1 -1
  20. package/dist/decisionEvidenceBundle/writeDecisionEvidenceBundle.js +2 -2
  21. package/dist/decisionEvidenceBundle.test.js +50 -3
  22. package/dist/decisionEvidenceBundle.test.js.map +1 -1
  23. package/dist/decisionGate.assertSafe.test.js +1 -1
  24. package/dist/decisionGate.assertSafe.test.js.map +1 -1
  25. package/dist/decisionGate.js +1 -1
  26. package/dist/enforceStateful.js +2 -2
  27. package/dist/enforceStateful.js.map +1 -1
  28. package/dist/evidenceCompleteness.d.ts +54 -0
  29. package/dist/evidenceCompleteness.d.ts.map +1 -0
  30. package/dist/evidenceCompleteness.js +263 -0
  31. package/dist/evidenceCompleteness.js.map +1 -0
  32. package/dist/execution-identity.v1.json +1 -1
  33. package/dist/failureSpine.d.ts +37 -0
  34. package/dist/failureSpine.d.ts.map +1 -0
  35. package/dist/failureSpine.js +218 -0
  36. package/dist/failureSpine.js.map +1 -0
  37. package/dist/failureSpine.test.d.ts +2 -0
  38. package/dist/failureSpine.test.d.ts.map +1 -0
  39. package/dist/failureSpine.test.js +28 -0
  40. package/dist/failureSpine.test.js.map +1 -0
  41. package/dist/formatEvidenceCompletenessHuman.d.ts +12 -0
  42. package/dist/formatEvidenceCompletenessHuman.d.ts.map +1 -0
  43. package/dist/formatEvidenceCompletenessHuman.js +47 -0
  44. package/dist/formatEvidenceCompletenessHuman.js.map +1 -0
  45. package/dist/formatFailureSpineHuman.d.ts +4 -0
  46. package/dist/formatFailureSpineHuman.d.ts.map +1 -0
  47. package/dist/formatFailureSpineHuman.js +18 -0
  48. package/dist/formatFailureSpineHuman.js.map +1 -0
  49. package/dist/governanceEvidence.d.ts +9 -3
  50. package/dist/governanceEvidence.d.ts.map +1 -1
  51. package/dist/governanceEvidence.js +10 -5
  52. package/dist/governanceEvidence.js.map +1 -1
  53. package/dist/governanceEvidence.test.js +31 -4
  54. package/dist/governanceEvidence.test.js.map +1 -1
  55. package/dist/index.d.ts +7 -3
  56. package/dist/index.d.ts.map +1 -1
  57. package/dist/index.js +5 -2
  58. package/dist/index.js.map +1 -1
  59. package/dist/langGraphCheckpointTrustGate.js +1 -1
  60. package/dist/langGraphCheckpointTrustIneligibleCertificate.js +1 -1
  61. package/dist/loop/loopOutput.d.ts +0 -4
  62. package/dist/loop/loopOutput.d.ts.map +1 -1
  63. package/dist/loop/loopOutput.js +3 -6
  64. package/dist/loop/loopOutput.js.map +1 -1
  65. package/dist/loop/runLoopSubcommand.d.ts.map +1 -1
  66. package/dist/loop/runLoopSubcommand.js +0 -2
  67. package/dist/loop/runLoopSubcommand.js.map +1 -1
  68. package/dist/outcomeCertificate.d.ts +20 -10
  69. package/dist/outcomeCertificate.d.ts.map +1 -1
  70. package/dist/outcomeCertificate.js +85 -8
  71. package/dist/outcomeCertificate.js.map +1 -1
  72. package/dist/outcomeCertificate.test.js +1 -1
  73. package/dist/publicDistribution.generated.d.ts +1 -1
  74. package/dist/publicDistribution.generated.js +1 -1
  75. package/dist/quickVerify/formatQuickVerifyHumanReport.test.js +8 -3
  76. package/dist/quickVerify/formatQuickVerifyHumanReport.test.js.map +1 -1
  77. package/dist/quickVerify/quickParamPointerNegatives.test.js +5 -2
  78. package/dist/quickVerify/quickParamPointerNegatives.test.js.map +1 -1
  79. package/dist/quickVerify/quickParamPointerPromotionGoldens.test.js +7 -4
  80. package/dist/quickVerify/quickParamPointerPromotionGoldens.test.js.map +1 -1
  81. package/dist/quickVerify/runQuickVerify.d.ts +3 -1
  82. package/dist/quickVerify/runQuickVerify.d.ts.map +1 -1
  83. package/dist/quickVerify/runQuickVerify.js +24 -3
  84. package/dist/quickVerify/runQuickVerify.js.map +1 -1
  85. package/dist/redactEvidenceString.d.ts +5 -0
  86. package/dist/redactEvidenceString.d.ts.map +1 -0
  87. package/dist/redactEvidenceString.js +17 -0
  88. package/dist/redactEvidenceString.js.map +1 -0
  89. package/dist/remediationConsumptionGuard.test.js +3 -0
  90. package/dist/remediationConsumptionGuard.test.js.map +1 -1
  91. package/dist/remediationMessage.d.ts +6 -0
  92. package/dist/remediationMessage.d.ts.map +1 -0
  93. package/dist/remediationMessage.js +30 -0
  94. package/dist/remediationMessage.js.map +1 -0
  95. package/dist/remediationWireSurfaceGuard.test.js +3 -0
  96. package/dist/remediationWireSurfaceGuard.test.js.map +1 -1
  97. package/dist/schemaLoad.d.ts +1 -1
  98. package/dist/schemaLoad.d.ts.map +1 -1
  99. package/dist/schemaLoad.js +25 -1
  100. package/dist/schemaLoad.js.map +1 -1
  101. package/dist/sdk/_generated/openapi-types.d.ts +25 -15
  102. package/dist/sdk/_generated/openapi-types.d.ts.map +1 -1
  103. package/dist/shareReport/postPublicVerificationReport.d.ts +3 -3
  104. package/dist/shareReport/postPublicVerificationReport.js +1 -1
  105. package/dist/shareReport/postPublicVerificationReport.js.map +1 -1
  106. package/dist/standardVerifyWorkflowCli.d.ts +7 -7
  107. package/dist/standardVerifyWorkflowCli.js +3 -3
  108. package/dist/trustDecision.d.ts +7 -2
  109. package/dist/trustDecision.d.ts.map +1 -1
  110. package/dist/trustDecision.js +14 -7
  111. package/dist/trustDecision.js.map +1 -1
  112. package/dist/verify/batchVerifyTelemetrySubcommand.js +2 -2
  113. package/package.json +4 -3
  114. package/schemas/decision-evidence-exit-v1.schema.json +1 -1
  115. package/schemas/evidence-completeness-v1.schema.json +87 -0
  116. package/schemas/failure-spine-v1.schema.json +38 -0
  117. package/schemas/material-truth-v2.schema.json +83 -0
  118. package/schemas/openapi-commercial-v1.in.yaml +46 -21
  119. package/schemas/openapi-commercial-v1.yaml +47 -22
  120. package/schemas/outcome-certificate-v2.schema.json +93 -0
  121. package/schemas/outcome-certificate-v3.schema.json +97 -0
  122. package/schemas/public-verification-report-v3.schema.json +15 -0
  123. package/schemas/quick-verify-report.schema.json +6 -2
  124. package/schemas/regression-artifact-v1.schema.json +1 -1
  125. package/schemas/trust-decision-record-v1.schema.json +3 -3
  126. package/scripts/discovery-payload.lib.cjs +140 -18
  127. package/dist/decisionBlocker.contract.test.d.ts +0 -2
  128. package/dist/decisionBlocker.contract.test.d.ts.map +0 -1
  129. package/dist/decisionBlocker.contract.test.js +0 -51
  130. package/dist/decisionBlocker.contract.test.js.map +0 -1
  131. package/dist/loop/failureHints.d.ts +0 -6
  132. package/dist/loop/failureHints.d.ts.map +0 -1
  133. package/dist/loop/failureHints.js +0 -36
  134. package/dist/loop/failureHints.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  openapi: "3.0.3"
2
2
  info:
3
3
  title: AgentSkeptic commercial license API
4
- version: "4.2.0"
4
+ version: "6.0.0"
5
5
  contact:
6
6
  url: https://agentskeptic.com
7
7
  x-agentskeptic-distribution:
@@ -12,7 +12,7 @@ info:
12
12
  url: https://agentskeptic.com/contract/v1.json
13
13
  version: "1.0.1"
14
14
  manifestSha256: "c5f23ec43576716c4b9a13e752cd2962a78bb4b4da1f9e521f911e15dfd80268"
15
- description: "Read-only checks at verify time—not color.\n\nMachine-readable contract for license preflight used by the published npm CLI.\nBase URL is your deployed app origin (same as NEXT_PUBLIC_APP_URL).\n\nEvery path in this document returns an `x-request-id` response header on all status codes (echo a valid client `x-request-id` when supplied; otherwise server-generated). Non-2xx JSON bodies follow RFC 7807-style Problem Details (`type`, `title`, `status`, `detail`, optional `code`, `instance`) unless noted; `POST /api/v1/usage/reserve` denials additionally include legacy `allowed`, `code`, `message`, and optional `upgrade_url` for backward compatibility.\n"
15
+ description: "Read-only checks at verify time—not color.\n\nMachine-readable contract for license preflight used by the published npm CLI.\nBase URL is your deployed app origin (same as NEXT_PUBLIC_APP_URL).\n\nEvery path in this document returns an `x-request-id` response header on all status codes (echo a valid client `x-request-id` when supplied; otherwise server-generated). Non-2xx JSON bodies follow RFC 7807-style Problem Details (`type`, `title`, `status`, `detail`, optional `code`, `instance`) unless noted; `POST /api/v1/usage/reserve` denials additionally include legacy `allowed`, `code`, `message`, and optional `upgrade_url` for backward compatibility.\n\n**Breaking (agentskeptic 5.x):** Hosted enforcement ingestion uses `schema_version` 3 with `outcome_certificate` (Outcome Certificate v3 inner JSON, including `failureSpine`). Legacy `schema_version` 2 payloads with `outcome_certificate_v1` are rejected. `POST /api/v1/funnel/verify-outcome` requires `schema_version` 3 and `evidence_gap_primary`. `POST /api/public/verification-reports` accepts envelope `schemaVersion` 3 only. **HTTP 4xx/5xx** responses are **not** `failure-spine-v1` and are **not** Outcome Certificate-shaped; operational CLI errors use `cli-error-envelope` on stderr only.\n"
16
16
  externalDocs:
17
17
  description: "First-run integration guide"
18
18
  url: https://agentskeptic.com/integrate
@@ -125,7 +125,7 @@ paths:
125
125
  content:
126
126
  application/json:
127
127
  schema:
128
- $ref: "#/components/schemas/EnforcementEvidenceRequestV2"
128
+ $ref: "#/components/schemas/EnforcementEvidenceRequestV3"
129
129
  responses:
130
130
  "200":
131
131
  description: Lifecycle transition completed
@@ -162,7 +162,7 @@ paths:
162
162
  content:
163
163
  application/json:
164
164
  schema:
165
- $ref: "#/components/schemas/EnforcementEvidenceRequestV2"
165
+ $ref: "#/components/schemas/EnforcementEvidenceRequestV3"
166
166
  responses:
167
167
  "200":
168
168
  description: Check completed (match, open drift, rerun pass/fail, etc.)
@@ -187,7 +187,7 @@ paths:
187
187
  content:
188
188
  application/json:
189
189
  schema:
190
- $ref: "#/components/schemas/EnforcementAcceptEvidenceRequestV2"
190
+ $ref: "#/components/schemas/EnforcementAcceptEvidenceRequestV3"
191
191
  responses:
192
192
  "200":
193
193
  description: Baseline updated; rerun POST /check required before returning to trusted-only posture
@@ -315,7 +315,7 @@ paths:
315
315
  summary: Licensed verify-outcome beacon (idempotent per API key + run_id)
316
316
  description: >
317
317
  POST after a successful `POST /api/v1/usage/reserve` for the same `run_id`. Success is HTTP 204 with an empty body.
318
- Requires Bearer API key. Body schemaVersion must be 2.
318
+ Requires Bearer API key. Body `schema_version` must be 3 (`VerifyOutcomeRequestV3`). `evidence_gap_primary` duplicates `certificate.evidenceCompleteness.blockerCategory` at CLI emission time.
319
319
  security:
320
320
  - bearerAuth: []
321
321
  requestBody:
@@ -323,7 +323,7 @@ paths:
323
323
  content:
324
324
  application/json:
325
325
  schema:
326
- $ref: "#/components/schemas/VerifyOutcomeRequestV2"
326
+ $ref: "#/components/schemas/VerifyOutcomeRequestV3"
327
327
  responses:
328
328
  "204":
329
329
  description: Beacon accepted (or duplicate ignored)
@@ -556,27 +556,28 @@ components:
556
556
  scheme: bearer
557
557
  bearerFormat: API key
558
558
  schemas:
559
- EnforcementEvidenceRequestV2:
559
+ EnforcementEvidenceRequestV3:
560
560
  type: object
561
- required: [schema_version, run_id, workflow_id, outcome_certificate_v1, material_truth_sha256, certificate_sha256]
561
+ required: [schema_version, run_id, workflow_id, outcome_certificate, material_truth_sha256, certificate_sha256]
562
562
  properties:
563
563
  schema_version:
564
564
  type: integer
565
- const: 2
565
+ const: 3
566
566
  run_id:
567
567
  type: string
568
568
  workflow_id:
569
569
  type: string
570
- outcome_certificate_v1:
570
+ outcome_certificate:
571
571
  type: object
572
572
  additionalProperties: true
573
+ description: Outcome Certificate v2 JSON (schemaVersion 2) including evidenceCompleteness
573
574
  material_truth_sha256:
574
575
  type: string
575
576
  certificate_sha256:
576
577
  type: string
577
578
  EnforcementFsmEnvelopeV2:
578
579
  type: object
579
- description: Hosted enforcement lifecycle + verification attempt payload (schema_version 2).
580
+ description: Hosted enforcement lifecycle response envelope for POST /check | /baselines | /accept (schema_version 2 on responses; distinct from evidence ingestion schema_version 3).
580
581
  required: [schema_version, code]
581
582
  properties:
582
583
  schema_version:
@@ -587,9 +588,9 @@ components:
587
588
  quota_enforced_via_reserve:
588
589
  type: boolean
589
590
  additionalProperties: true
590
- EnforcementAcceptEvidenceRequestV2:
591
+ EnforcementAcceptEvidenceRequestV3:
591
592
  allOf:
592
- - $ref: "#/components/schemas/EnforcementEvidenceRequestV2"
593
+ - $ref: "#/components/schemas/EnforcementEvidenceRequestV3"
593
594
  - type: object
594
595
  required: [expected_projection_hash, lifecycle_state_version]
595
596
  properties:
@@ -715,13 +716,14 @@ components:
715
716
  type: string
716
717
  code:
717
718
  type: string
718
- VerifyOutcomeRequestV2:
719
+ VerifyOutcomeRequestV3:
719
720
  type: object
720
721
  required:
721
722
  - schema_version
722
723
  - run_id
723
724
  - workflow_id
724
725
  - trust_decision
726
+ - evidence_gap_primary
725
727
  - reason_codes
726
728
  - terminal_status
727
729
  - workload_class
@@ -729,7 +731,7 @@ components:
729
731
  properties:
730
732
  schema_version:
731
733
  type: integer
732
- const: 2
734
+ const: 3
733
735
  run_id:
734
736
  type: string
735
737
  maxLength: 256
@@ -739,6 +741,24 @@ components:
739
741
  trust_decision:
740
742
  type: string
741
743
  enum: [safe, unsafe, unknown]
744
+ evidence_gap_primary:
745
+ type: string
746
+ enum:
747
+ - "none"
748
+ - "preview_lane"
749
+ - "ingest_empty"
750
+ - "ingest_unstructured"
751
+ - "registry_unknown_tool"
752
+ - "registry_resolution"
753
+ - "database_access"
754
+ - "timing_or_window"
755
+ - "witness_unavailable"
756
+ - "state_mismatch"
757
+ - "verification_incomplete"
758
+ - "event_sequence"
759
+ - "control_flow_context"
760
+ - "unclassified"
761
+ description: Mirrors Outcome Certificate evidenceCompleteness.blockerCategory at CLI emission time
742
762
  reason_codes:
743
763
  type: array
744
764
  maxItems: 8
@@ -752,7 +772,12 @@ components:
752
772
  enum: [bundled_examples, non_bundled]
753
773
  subcommand:
754
774
  type: string
755
- enum: [batch_verify, quick_verify, verify_integrator_owned]
775
+ enum: [batch_verify, quick_verify, verify_integrator_owned, activate]
776
+ activation:
777
+ description: Present only when subcommand is activate (mirrors ActivationManifest-derived wire)
778
+ type: object
779
+ nullable: true
780
+ additionalProperties: true
756
781
  TrustDecisionRecordRequestV1:
757
782
  type: object
758
783
  additionalProperties: false
@@ -792,8 +817,8 @@ components:
792
817
  $ref: "#/components/schemas/TrustCertificateSnapshotRequestV1"
793
818
  human_blocker_lines:
794
819
  type: array
795
- minItems: 6
796
- maxItems: 6
820
+ minItems: 1
821
+ maxItems: 48
797
822
  items:
798
823
  type: string
799
824
  TrustCertificateSnapshotRequestV1:
@@ -907,8 +932,8 @@ components:
907
932
  additionalProperties: false
908
933
  PublicVerificationReportCreate:
909
934
  description: >
910
- POST accepts schemaVersion 2 only: { "schemaVersion": 2, "certificate": <OutcomeCertificateV1> } per
911
- schemas/public-verification-report-v2.schema.json. Legacy v1 envelopes are rejected with HTTP 400.
935
+ POST accepts schemaVersion 3 only: { "schemaVersion": 3, "certificate": <OutcomeCertificateV2> } per
936
+ schemas/public-verification-report-v3.schema.json. Legacy envelope POST bodies return HTTP 400.
912
937
  type: object
913
938
  additionalProperties: true
914
939
  PublicVerificationReportCreated:
@@ -921,7 +946,7 @@ components:
921
946
  properties:
922
947
  schemaVersion:
923
948
  type: integer
924
- const: 2
949
+ const: 3
925
950
  id:
926
951
  type: string
927
952
  format: uuid
@@ -0,0 +1,93 @@
1
+ {
2
+ "$id": "https://agentskeptic.com/schemas/outcome-certificate-v2.schema.json",
3
+ "title": "OutcomeCertificateV2",
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "required": [
7
+ "schemaVersion",
8
+ "workflowId",
9
+ "runKind",
10
+ "stateRelation",
11
+ "highStakesReliance",
12
+ "relianceRationale",
13
+ "intentSummary",
14
+ "explanation",
15
+ "steps",
16
+ "humanReport",
17
+ "evidenceCompleteness"
18
+ ],
19
+ "properties": {
20
+ "schemaVersion": { "type": "integer", "const": 2 },
21
+ "workflowId": { "type": "string", "minLength": 1, "maxLength": 512 },
22
+ "runKind": {
23
+ "type": "string",
24
+ "enum": ["contract_sql", "contract_sql_langgraph_checkpoint_trust", "quick_preview"]
25
+ },
26
+ "stateRelation": {
27
+ "type": "string",
28
+ "enum": ["matches_expectations", "does_not_match", "not_established"]
29
+ },
30
+ "highStakesReliance": { "type": "string", "enum": ["permitted", "prohibited"] },
31
+ "relianceRationale": { "type": "string", "minLength": 1, "maxLength": 8192 },
32
+ "intentSummary": { "type": "string", "minLength": 1, "maxLength": 8192 },
33
+ "explanation": {
34
+ "type": "object",
35
+ "additionalProperties": false,
36
+ "required": ["headline", "details"],
37
+ "properties": {
38
+ "headline": { "type": "string", "minLength": 1, "maxLength": 2048 },
39
+ "details": {
40
+ "type": "array",
41
+ "items": {
42
+ "type": "object",
43
+ "additionalProperties": false,
44
+ "required": ["code", "message"],
45
+ "properties": {
46
+ "code": { "type": "string", "minLength": 1, "maxLength": 256 },
47
+ "message": { "type": "string", "minLength": 1, "maxLength": 4096 }
48
+ }
49
+ }
50
+ }
51
+ }
52
+ },
53
+ "steps": {
54
+ "type": "array",
55
+ "items": {
56
+ "type": "object",
57
+ "additionalProperties": false,
58
+ "required": ["seq", "declaredAction", "expectedOutcome", "observedOutcome"],
59
+ "properties": {
60
+ "seq": { "type": "integer", "minimum": 0 },
61
+ "toolId": { "type": "string", "maxLength": 512 },
62
+ "declaredAction": { "type": "string", "minLength": 1, "maxLength": 4096 },
63
+ "expectedOutcome": { "type": "string", "minLength": 1, "maxLength": 4096 },
64
+ "observedOutcome": { "type": "string", "minLength": 1, "maxLength": 8192 }
65
+ }
66
+ }
67
+ },
68
+ "humanReport": { "type": "string", "minLength": 1, "maxLength": 1048576 },
69
+ "checkpointVerdicts": {
70
+ "type": "array",
71
+ "items": {
72
+ "type": "object",
73
+ "additionalProperties": false,
74
+ "required": ["checkpointKey", "verdict", "seqs", "productionMeaning"],
75
+ "properties": {
76
+ "checkpointKey": { "type": "string", "minLength": 1, "maxLength": 2048 },
77
+ "verdict": {
78
+ "type": "string",
79
+ "enum": ["verified", "inconsistent", "incomplete"]
80
+ },
81
+ "seqs": {
82
+ "type": "array",
83
+ "items": { "type": "integer", "minimum": 0 }
84
+ },
85
+ "productionMeaning": { "type": "string", "minLength": 1, "maxLength": 8192 }
86
+ }
87
+ }
88
+ },
89
+ "evidenceCompleteness": {
90
+ "$ref": "https://agentskeptic.com/schemas/evidence-completeness-v1.schema.json"
91
+ }
92
+ }
93
+ }
@@ -0,0 +1,97 @@
1
+ {
2
+ "$id": "https://agentskeptic.com/schemas/outcome-certificate-v3.schema.json",
3
+ "title": "OutcomeCertificateV3",
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "required": [
7
+ "schemaVersion",
8
+ "workflowId",
9
+ "runKind",
10
+ "stateRelation",
11
+ "highStakesReliance",
12
+ "relianceRationale",
13
+ "intentSummary",
14
+ "explanation",
15
+ "steps",
16
+ "humanReport",
17
+ "evidenceCompleteness",
18
+ "failureSpine"
19
+ ],
20
+ "properties": {
21
+ "schemaVersion": { "type": "integer", "const": 3 },
22
+ "workflowId": { "type": "string", "minLength": 1, "maxLength": 512 },
23
+ "runKind": {
24
+ "type": "string",
25
+ "enum": ["contract_sql", "contract_sql_langgraph_checkpoint_trust", "quick_preview"]
26
+ },
27
+ "stateRelation": {
28
+ "type": "string",
29
+ "enum": ["matches_expectations", "does_not_match", "not_established"]
30
+ },
31
+ "highStakesReliance": { "type": "string", "enum": ["permitted", "prohibited"] },
32
+ "relianceRationale": { "type": "string", "minLength": 1, "maxLength": 8192 },
33
+ "intentSummary": { "type": "string", "minLength": 1, "maxLength": 8192 },
34
+ "explanation": {
35
+ "type": "object",
36
+ "additionalProperties": false,
37
+ "required": ["headline", "details"],
38
+ "properties": {
39
+ "headline": { "type": "string", "minLength": 1, "maxLength": 2048 },
40
+ "details": {
41
+ "type": "array",
42
+ "items": {
43
+ "type": "object",
44
+ "additionalProperties": false,
45
+ "required": ["code", "message"],
46
+ "properties": {
47
+ "code": { "type": "string", "minLength": 1, "maxLength": 256 },
48
+ "message": { "type": "string", "minLength": 1, "maxLength": 4096 }
49
+ }
50
+ }
51
+ }
52
+ }
53
+ },
54
+ "steps": {
55
+ "type": "array",
56
+ "items": {
57
+ "type": "object",
58
+ "additionalProperties": false,
59
+ "required": ["seq", "declaredAction", "expectedOutcome", "observedOutcome"],
60
+ "properties": {
61
+ "seq": { "type": "integer", "minimum": 0 },
62
+ "toolId": { "type": "string", "maxLength": 512 },
63
+ "declaredAction": { "type": "string", "minLength": 1, "maxLength": 4096 },
64
+ "expectedOutcome": { "type": "string", "minLength": 1, "maxLength": 4096 },
65
+ "observedOutcome": { "type": "string", "minLength": 1, "maxLength": 8192 }
66
+ }
67
+ }
68
+ },
69
+ "humanReport": { "type": "string", "minLength": 1, "maxLength": 1048576 },
70
+ "checkpointVerdicts": {
71
+ "type": "array",
72
+ "items": {
73
+ "type": "object",
74
+ "additionalProperties": false,
75
+ "required": ["checkpointKey", "verdict", "seqs", "productionMeaning"],
76
+ "properties": {
77
+ "checkpointKey": { "type": "string", "minLength": 1, "maxLength": 2048 },
78
+ "verdict": {
79
+ "type": "string",
80
+ "enum": ["verified", "inconsistent", "incomplete"]
81
+ },
82
+ "seqs": {
83
+ "type": "array",
84
+ "items": { "type": "integer", "minimum": 0 }
85
+ },
86
+ "productionMeaning": { "type": "string", "minLength": 1, "maxLength": 8192 }
87
+ }
88
+ }
89
+ },
90
+ "evidenceCompleteness": {
91
+ "$ref": "https://agentskeptic.com/schemas/evidence-completeness-v1.schema.json"
92
+ },
93
+ "failureSpine": {
94
+ "$ref": "https://agentskeptic.com/schemas/failure-spine-v1.schema.json"
95
+ }
96
+ }
97
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "$id": "https://agentskeptic.com/schemas/public-verification-report-v3.schema.json",
3
+ "title": "PublicVerificationReportEnvelopeV3",
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "required": ["schemaVersion", "certificate"],
7
+ "properties": {
8
+ "schemaVersion": { "type": "integer", "const": 3 },
9
+ "certificate": {
10
+ "$ref": "https://agentskeptic.com/schemas/outcome-certificate-v3.schema.json"
11
+ },
12
+ "cliVersion": { "type": "string", "maxLength": 128 },
13
+ "createdFrom": { "type": "string", "maxLength": 256 }
14
+ }
15
+ }
@@ -12,10 +12,11 @@
12
12
  "ingest",
13
13
  "units",
14
14
  "exportableRegistry",
15
- "productTruth"
15
+ "productTruth",
16
+ "evidenceCompleteness"
16
17
  ],
17
18
  "properties": {
18
- "schemaVersion": { "type": "integer", "const": 4 },
19
+ "schemaVersion": { "type": "integer", "const": 5 },
19
20
  "verdict": { "type": "string", "enum": ["pass", "fail", "uncertain"] },
20
21
  "summary": { "type": "string", "minLength": 1 },
21
22
  "verificationMode": { "type": "string", "const": "inferred" },
@@ -246,6 +247,9 @@
246
247
  "quickVerifyProvisional": { "type": "boolean", "const": true },
247
248
  "contractReplayPartialCoverage": { "type": "boolean" }
248
249
  }
250
+ },
251
+ "evidenceCompleteness": {
252
+ "$ref": "https://agentskeptic.com/schemas/evidence-completeness-v1.schema.json"
249
253
  }
250
254
  }
251
255
  }
@@ -82,7 +82,7 @@
82
82
  "enum": ["contract_sql", "contract_sql_langgraph_checkpoint_trust"]
83
83
  },
84
84
  "certificateCanonicalDigest": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
85
- "certificate": { "$ref": "https://agentskeptic.com/schemas/outcome-certificate-v1.schema.json" }
85
+ "certificate": { "$ref": "https://agentskeptic.com/schemas/outcome-certificate-v3.schema.json" }
86
86
  }
87
87
  }
88
88
  },
@@ -64,9 +64,9 @@
64
64
  },
65
65
  "human_blocker_lines": {
66
66
  "type": "array",
67
- "minItems": 6,
68
- "maxItems": 6,
69
- "items": { "type": "string", "maxLength": 4096 }
67
+ "minItems": 1,
68
+ "maxItems": 48,
69
+ "items": { "type": "string", "maxLength": 8192 }
70
70
  }
71
71
  }
72
72
  }
@@ -27,6 +27,9 @@ const MAX_SUMMARY_UTF8_BYTES = 65536;
27
27
  const MAX_PR_BODY_UTF8_BYTES = 10240;
28
28
  const STDERR_TAIL_LINES = 20;
29
29
 
30
+ /** Max UTF-8 bytes of stdout parsed for Outcome Certificate JSON (`failureSpine` extraction). */
31
+ const MAX_STDOUT_PARSE_BYTES = 262144;
32
+
30
33
  const REPO_ROOT = join(__dirname, "..");
31
34
  const README_ADOPTION_START = "<!-- adoption-canonical:start -->";
32
35
  const README_ADOPTION_END = "<!-- adoption-canonical:end -->";
@@ -311,8 +314,109 @@ function formatStderrBlock(stderrText) {
311
314
  }
312
315
 
313
316
  /**
314
- * Assemble PR body: header optional verdict stderr footer → marker.
315
- * Truncates stderr block from the start only until UTF-8 length ≤ max.
317
+ * Parse workflow stdout for a single-line/single-object Outcome Certificate JSON and extract `failureSpine`.
318
+ * @param {string} stdoutText
319
+ * @returns {{ ok: true; spine: Record<string, unknown> } | { malformed: true } | { oversized: true }}
320
+ */
321
+ function extractFailureSummaryFromStdout(stdoutText) {
322
+ const t = String(stdoutText ?? "").trim();
323
+ if (t.length === 0) return { malformed: true };
324
+ if (utf8ByteLength(t) > MAX_STDOUT_PARSE_BYTES) return { oversized: true };
325
+ let obj;
326
+ try {
327
+ obj = JSON.parse(t);
328
+ } catch {
329
+ return { malformed: true };
330
+ }
331
+ if (!obj || typeof obj !== "object") return { malformed: true };
332
+ const spine = obj.failureSpine;
333
+ if (!spine || typeof spine !== "object") return { malformed: true };
334
+ return { ok: true, spine };
335
+ }
336
+
337
+ /**
338
+ * @param {Record<string, unknown>} spine
339
+ */
340
+ function renderFailureSummaryMarkdownFromSpine(spine) {
341
+ const af = /** @type {{ category: string; severity: string; recommendedAction: string; automationSafe: boolean }} */ (
342
+ spine.actionableFailure
343
+ );
344
+ const codes = Array.isArray(spine.primaryCodes) ? spine.primaryCodes.join(",") : "";
345
+ return [
346
+ "## Failure summary (agentskeptic)",
347
+ "",
348
+ `- trust_decision: ${spine.trustDecision}`,
349
+ `- summary: ${spine.summary}`,
350
+ `- actionable_failure: category=${af.category} severity=${af.severity} recommended_action=${af.recommendedAction} automation_safe=${af.automationSafe}`,
351
+ `- primary_codes: ${codes}`,
352
+ `- rerun_guidance: ${spine.rerunGuidance}`,
353
+ `- source: ${spine.source}`,
354
+ "",
355
+ ].join("\n");
356
+ }
357
+
358
+ /**
359
+ * @param {Record<string, unknown>} envelope — cli-error-envelope JSON
360
+ */
361
+ function projectCliEnvelopeToCiMarkdown(envelope) {
362
+ const fd = /** @type {{ summary: string; actionableFailure: { category: string; severity: string; recommendedAction: string; automationSafe: boolean } }} */ (
363
+ envelope.failureDiagnosis
364
+ );
365
+ const af = fd.actionableFailure;
366
+ return [
367
+ "## Failure summary (agentskeptic)",
368
+ "",
369
+ "- trust_decision: unknown",
370
+ `- summary: ${fd.summary}`,
371
+ `- actionable_failure: category=${af.category} severity=${af.severity} recommended_action=${af.recommendedAction} automation_safe=${af.automationSafe}`,
372
+ "- primary_codes: _(operational)_",
373
+ `- rerun_guidance: ${String(envelope.message)}`,
374
+ "- source: operational",
375
+ "",
376
+ ].join("\n");
377
+ }
378
+
379
+ /**
380
+ * @param {string} line
381
+ */
382
+ function tryParseCliErrorEnvelopeLine(line) {
383
+ const s = String(line).trim();
384
+ if (!s.startsWith("{")) return null;
385
+ try {
386
+ const o = JSON.parse(s);
387
+ if (
388
+ o &&
389
+ typeof o === "object" &&
390
+ o.schemaVersion === 2 &&
391
+ o.kind === "execution_truth_layer_error" &&
392
+ o.failureDiagnosis &&
393
+ typeof o.failureDiagnosis === "object" &&
394
+ o.failureDiagnosis.actionableFailure
395
+ ) {
396
+ return o;
397
+ }
398
+ } catch {
399
+ /* ignore */
400
+ }
401
+ return null;
402
+ }
403
+
404
+ /**
405
+ * @param {string} stderrText
406
+ * @returns {string[]}
407
+ */
408
+ function extractOperationalFailureMarkdownFromStderr(stderrText) {
409
+ const out = [];
410
+ for (const line of String(stderrText).split(/\r?\n/)) {
411
+ const env = tryParseCliErrorEnvelopeLine(line);
412
+ if (env) out.push(projectCliEnvelopeToCiMarkdown(env));
413
+ }
414
+ return out;
415
+ }
416
+
417
+ /**
418
+ * Assemble PR body: header → optional stdout oversize note → failure summary (certificate spine and/or operational stderr) → stderr → footer → marker.
419
+ * Truncates stderr tail lines from the front until UTF-8 length ≤ max (failure summary retained).
316
420
  *
317
421
  * @param {Record<string, unknown>} payload
318
422
  * @param {{ stderrText: string; workflowStdoutText: string }} capture
@@ -329,12 +433,27 @@ ${String(payload.identityOneLiner)}
329
433
 
330
434
  `;
331
435
 
332
- const verdictTrim = String(workflowStdoutText).trim();
333
- const oneLine =
334
- verdictTrim.length > 0 ? verdictTrim.split("\n")[0].slice(0, 500) : "";
335
- const verdictSection = oneLine
336
- ? ["## Verification stdout (first line)", "", "```", oneLine, "```", ""].join("\n")
337
- : "";
436
+ const ext = extractFailureSummaryFromStdout(workflowStdoutText);
437
+ const operationalBlocks = extractOperationalFailureMarkdownFromStderr(stderrText);
438
+
439
+ let oversizedNote = "";
440
+ if (ext.oversized) {
441
+ oversizedNote = `_(stdout exceeded 262144 UTF-8 bytes; failure summary skipped)_\n\n`;
442
+ }
443
+
444
+ const failureParts = [];
445
+ if ("ok" in ext && ext.ok) failureParts.push(renderFailureSummaryMarkdownFromSpine(ext.spine));
446
+ failureParts.push(...operationalBlocks);
447
+
448
+ const failureSummaryBlock = failureParts.length > 0 ? failureParts.join("\n") : "";
449
+
450
+ let unparsedStdoutBlock = "";
451
+ if (ext.malformed) {
452
+ const rawOut = String(workflowStdoutText).trim();
453
+ if (rawOut.length > 0) {
454
+ unparsedStdoutBlock = `## Verification stdout (unparsed)\n\n\`\`\`text\n${rawOut}\n\`\`\`\n\n`;
455
+ }
456
+ }
338
457
 
339
458
  let stderrBlock = formatStderrBlock(stderrText);
340
459
 
@@ -350,12 +469,16 @@ ${String(payload.identityOneLiner)}
350
469
  "",
351
470
  ].join("\n");
352
471
 
353
- function assemble(verdict, sb) {
354
- const raw = header + verdict + sb + footer;
472
+ function assemble(middle) {
473
+ const raw = header + middle + footer;
355
474
  return normalizeDiscoveryText(raw);
356
475
  }
357
476
 
358
- let body = assemble(verdictSection, stderrBlock);
477
+ function middleFrom(stderrBlk) {
478
+ return oversizedNote + failureSummaryBlock + unparsedStdoutBlock + stderrBlk;
479
+ }
480
+
481
+ let body = assemble(middleFrom(stderrBlock));
359
482
  if (utf8ByteLength(body) <= MAX_PR_BODY_UTF8_BYTES) {
360
483
  return body;
361
484
  }
@@ -367,19 +490,14 @@ ${String(payload.identityOneLiner)}
367
490
  stderrBlock = inner
368
491
  ? `## CLI stderr (last ${STDERR_TAIL_LINES} lines)\n\n\`\`\`text\n${inner}\n\`\`\`\n`
369
492
  : "## CLI stderr (last 20 lines)\n\n_(no stderr)_\n";
370
- body = assemble(verdictSection, stderrBlock);
493
+ body = assemble(middleFrom(stderrBlock));
371
494
  if (utf8ByteLength(body) <= MAX_PR_BODY_UTF8_BYTES) return body;
372
495
  }
373
496
 
374
497
  stderrBlock = "## CLI stderr (last 20 lines)\n\n_(no stderr)_\n";
375
- body = assemble(verdictSection, stderrBlock);
498
+ body = assemble(middleFrom(stderrBlock));
376
499
  if (utf8ByteLength(body) <= MAX_PR_BODY_UTF8_BYTES) return body;
377
500
 
378
- if (verdictSection) {
379
- body = assemble("", stderrBlock);
380
- if (utf8ByteLength(body) <= MAX_PR_BODY_UTF8_BYTES) return body;
381
- }
382
-
383
501
  throw new Error(
384
502
  `discovery-payload: PR body still exceeds ${MAX_PR_BODY_UTF8_BYTES} bytes after truncation`,
385
503
  );
@@ -408,6 +526,7 @@ module.exports = {
408
526
  PR_MARKER_LINE_LEGACY,
409
527
  MAX_SUMMARY_UTF8_BYTES,
410
528
  MAX_PR_BODY_UTF8_BYTES,
529
+ MAX_STDOUT_PARSE_BYTES,
411
530
  STDERR_TAIL_LINES,
412
531
  buildDiscoveryPayload,
413
532
  normalizeDiscoveryText,
@@ -417,6 +536,9 @@ module.exports = {
417
536
  renderLlmsTextFromPayload,
418
537
  renderCiSummaryMarkdownFromPayload,
419
538
  renderCiPrBodyFromPayload,
539
+ extractFailureSummaryFromStdout,
540
+ renderFailureSummaryMarkdownFromSpine,
541
+ projectCliEnvelopeToCiMarkdown,
420
542
  parseGithubRepoFromUrl,
421
543
  selectPrCommentUpsert,
422
544
  };
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=decisionBlocker.contract.test.d.ts.map