@kitman-sh/sdk 0.10.70 → 0.10.72

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.
@@ -33,7 +33,7 @@ import {
33
33
  executeLoop2,
34
34
  LoopCheckError2,
35
35
  checkLoop2
36
- } from "./chunk-kjkn6d60.js";
36
+ } from "./chunk-stw541tr.js";
37
37
  // packages/core/src/agent-environment.ts
38
38
  import * as Schema from "effect/Schema";
39
39
  var AgentEnvironmentPolicy = Schema.Union([Schema.Literal("recommended"), Schema.Literal("required")]);
@@ -11,6 +11,7 @@ import {
11
11
  VerifyResult2,
12
12
  OutcomeTable2,
13
13
  failsOn2,
14
+ testsNotRunReasons2,
14
15
  evidenceGate2,
15
16
  StepFailed2,
16
17
  OutputInvalid2,
@@ -173,7 +174,7 @@ import {
173
174
  syncBase2,
174
175
  Continuing2,
175
176
  continuingBrief2
176
- } from "../chunk-kjkn6d60.js";
177
+ } from "../chunk-stw541tr.js";
177
178
  export {
178
179
  AlertTaskActivity2 as AlertTaskActivity,
179
180
  AlertTaskRequest2 as AlertTaskRequest,
@@ -343,6 +344,7 @@ export {
343
344
  syncDeferred2 as syncDeferred,
344
345
  takeStep2 as takeStep,
345
346
  testLoop2 as testLoop,
347
+ testsNotRunReasons2 as testsNotRunReasons,
346
348
  transcripts2 as transcripts,
347
349
  verify2 as verify,
348
350
  verifyDeferred2 as verifyDeferred,
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import"../chunk-kjkn6d60.js";
2
+ import"../chunk-stw541tr.js";
3
3
  import {
4
4
  JournalWriteFailed2,
5
5
  refusedStep2,
@@ -17,7 +17,7 @@ import {
17
17
  networkGuard2,
18
18
  carriedKits2,
19
19
  runKit2
20
- } from "../chunk-5qeam2w1.js";
20
+ } from "../chunk-w2f4s9v2.js";
21
21
  export {
22
22
  Described2 as Described,
23
23
  JournalWriteFailed2 as JournalWriteFailed,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitman-sh/sdk",
3
- "version": "0.10.70",
3
+ "version": "0.10.72",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "exports": {
@@ -30,6 +30,7 @@ export * from './runner-eligibility';
30
30
  export * from './runner-trust';
31
31
  export * from './platform-release';
32
32
  export * from './work-unit';
33
+ export * from './test-report';
33
34
  export * from './external-effect';
34
35
  export * from './global-search';
35
36
  export * from './change-delivery';
@@ -1185,6 +1185,10 @@ export declare const RunEvidence: Schema.Struct<{
1185
1185
  readonly outputTail: Schema.String;
1186
1186
  /** The Run Files the check kept in this Run: its log and what it recorded. */
1187
1187
  readonly fileIds: Schema.optionalKey<Schema.$Array<Schema.String>>;
1188
+ /** The check's tests that ran on the baseline and were skipped on this tree. */
1189
+ readonly skippedSinceBaseline: Schema.optionalKey<Schema.$Array<Schema.String>>;
1190
+ /** The check's tests new on this tree that were skipped, so they never ran. */
1191
+ readonly newNotRun: Schema.optionalKey<Schema.$Array<Schema.String>>;
1188
1192
  readonly recordedAt: Schema.String;
1189
1193
  }>;
1190
1194
  export type RunEvidence = (typeof RunEvidence)['Type'];
@@ -2771,6 +2775,10 @@ export declare const RunShow: Schema.Struct<{
2771
2775
  readonly outputTail: Schema.String;
2772
2776
  /** The Run Files the check kept in this Run: its log and what it recorded. */
2773
2777
  readonly fileIds: Schema.optionalKey<Schema.$Array<Schema.String>>;
2778
+ /** The check's tests that ran on the baseline and were skipped on this tree. */
2779
+ readonly skippedSinceBaseline: Schema.optionalKey<Schema.$Array<Schema.String>>;
2780
+ /** The check's tests new on this tree that were skipped, so they never ran. */
2781
+ readonly newNotRun: Schema.optionalKey<Schema.$Array<Schema.String>>;
2774
2782
  readonly recordedAt: Schema.String;
2775
2783
  }>>;
2776
2784
  readonly steers: Schema.$Array<Schema.Struct<{
@@ -0,0 +1,38 @@
1
+ import * as Schema from 'effect/Schema';
2
+ /** A check's file in `KITMAN_RUN_FILES_DIR` that Kitman reads as a JUnit XML test report. */
3
+ export declare const isTestReportName: (name: string) => boolean;
4
+ /** What a check's JUnit reports say about its tests at one tree. */
5
+ export declare const CheckTests: Schema.Struct<{
6
+ /** How many reports were read; none means the check left no report, so nothing is known of its tests. */
7
+ readonly reports: Schema.Int;
8
+ readonly passed: Schema.Int;
9
+ readonly failed: Schema.Int;
10
+ readonly skipped: Schema.Int;
11
+ /** The ids of the skipped tests, as `file > suite > name`; the first `maxSkippedTests` when there are more. */
12
+ readonly skippedTests: Schema.$Array<Schema.String>;
13
+ /** `testDigest` of each test that ran, so another tree's skips can be told new from dropped. */
14
+ readonly ranDigests: Schema.$Array<Schema.String>;
15
+ }>;
16
+ export type CheckTests = typeof CheckTests.Type;
17
+ type TestCase = {
18
+ readonly id: string;
19
+ readonly status: 'passed' | 'failed' | 'skipped';
20
+ };
21
+ /** Each `<testcase>` of a JUnit XML report, as vitest's and `bun test`'s junit reporters write them. */
22
+ export declare const junitTestCases: (xml: string) => readonly TestCase[];
23
+ export declare const testDigest: (id: string) => string;
24
+ /** A check's tests from the JUnit reports it left; a test reported twice counts once, failed over skipped over passed. */
25
+ export declare const checkTests: (reports: readonly string[]) => CheckTests;
26
+ /** The head's tests verify never ran: skipped there, while the baseline ran them or did not have them. */
27
+ export type TestsNotRun = {
28
+ /** Skipped on the head, and ran on the baseline. */
29
+ readonly skippedSinceBaseline: readonly string[];
30
+ /** New on the head, and skipped there, so they never ran. */
31
+ readonly newNotRun: readonly string[];
32
+ };
33
+ /**
34
+ * Compares a check's tests at the head with the baseline's. Without a baseline to compare, as when the head's tree is
35
+ * the baseline's, every skip is the baseline's; without a report on either side, nothing is known.
36
+ */
37
+ export declare const testsNotRun: (head: CheckTests | undefined, baseline: CheckTests | undefined) => TestsNotRun | undefined;
38
+ export {};
@@ -757,6 +757,15 @@ export declare const CheckEvidence: Schema.Struct<{
757
757
  readonly outputTail: Schema.String;
758
758
  /** The Run Files the check kept: its log and what it left in `KITMAN_RUN_FILES_DIR`. */
759
759
  readonly fileIds: Schema.optionalKey<Schema.$Array<Schema.String>>;
760
+ /** What the JUnit reports the check left in `KITMAN_RUN_FILES_DIR` say; absent from older Runners. */
761
+ readonly tests: Schema.optionalKey<Schema.Struct<{
762
+ readonly reports: Schema.Int;
763
+ readonly passed: Schema.Int;
764
+ readonly failed: Schema.Int;
765
+ readonly skipped: Schema.Int;
766
+ readonly skippedTests: Schema.$Array<Schema.String>;
767
+ readonly ranDigests: Schema.$Array<Schema.String>;
768
+ }>>;
760
769
  }>;
761
770
  /** Checks run at one revision; `tree` is the revision's git tree id. Checks the tree already had are left out. */
762
771
  export declare const TreeEvidence: Schema.Struct<{
@@ -772,6 +781,15 @@ export declare const TreeEvidence: Schema.Struct<{
772
781
  readonly outputTail: Schema.String;
773
782
  /** The Run Files the check kept: its log and what it left in `KITMAN_RUN_FILES_DIR`. */
774
783
  readonly fileIds: Schema.optionalKey<Schema.$Array<Schema.String>>;
784
+ /** What the JUnit reports the check left in `KITMAN_RUN_FILES_DIR` say; absent from older Runners. */
785
+ readonly tests: Schema.optionalKey<Schema.Struct<{
786
+ readonly reports: Schema.Int;
787
+ readonly passed: Schema.Int;
788
+ readonly failed: Schema.Int;
789
+ readonly skipped: Schema.Int;
790
+ readonly skippedTests: Schema.$Array<Schema.String>;
791
+ readonly ranDigests: Schema.$Array<Schema.String>;
792
+ }>>;
775
793
  }>>;
776
794
  }>;
777
795
  export declare const VerificationEvidence: Schema.Struct<{
@@ -788,6 +806,15 @@ export declare const VerificationEvidence: Schema.Struct<{
788
806
  readonly outputTail: Schema.String;
789
807
  /** The Run Files the check kept: its log and what it left in `KITMAN_RUN_FILES_DIR`. */
790
808
  readonly fileIds: Schema.optionalKey<Schema.$Array<Schema.String>>;
809
+ /** What the JUnit reports the check left in `KITMAN_RUN_FILES_DIR` say; absent from older Runners. */
810
+ readonly tests: Schema.optionalKey<Schema.Struct<{
811
+ readonly reports: Schema.Int;
812
+ readonly passed: Schema.Int;
813
+ readonly failed: Schema.Int;
814
+ readonly skipped: Schema.Int;
815
+ readonly skippedTests: Schema.$Array<Schema.String>;
816
+ readonly ranDigests: Schema.$Array<Schema.String>;
817
+ }>>;
791
818
  }>>;
792
819
  }>;
793
820
  readonly baseline: Schema.optionalKey<Schema.Struct<{
@@ -803,6 +830,15 @@ export declare const VerificationEvidence: Schema.Struct<{
803
830
  readonly outputTail: Schema.String;
804
831
  /** The Run Files the check kept: its log and what it left in `KITMAN_RUN_FILES_DIR`. */
805
832
  readonly fileIds: Schema.optionalKey<Schema.$Array<Schema.String>>;
833
+ /** What the JUnit reports the check left in `KITMAN_RUN_FILES_DIR` say; absent from older Runners. */
834
+ readonly tests: Schema.optionalKey<Schema.Struct<{
835
+ readonly reports: Schema.Int;
836
+ readonly passed: Schema.Int;
837
+ readonly failed: Schema.Int;
838
+ readonly skipped: Schema.Int;
839
+ readonly skippedTests: Schema.$Array<Schema.String>;
840
+ readonly ranDigests: Schema.$Array<Schema.String>;
841
+ }>>;
806
842
  }>>;
807
843
  }>>;
808
844
  readonly measurement: Schema.optionalKey<Schema.Struct<{
@@ -898,6 +934,15 @@ export declare const WorkUnitOutcome: Schema.Struct<{
898
934
  readonly outputTail: Schema.String;
899
935
  /** The Run Files the check kept: its log and what it left in `KITMAN_RUN_FILES_DIR`. */
900
936
  readonly fileIds: Schema.optionalKey<Schema.$Array<Schema.String>>;
937
+ /** What the JUnit reports the check left in `KITMAN_RUN_FILES_DIR` say; absent from older Runners. */
938
+ readonly tests: Schema.optionalKey<Schema.Struct<{
939
+ readonly reports: Schema.Int;
940
+ readonly passed: Schema.Int;
941
+ readonly failed: Schema.Int;
942
+ readonly skipped: Schema.Int;
943
+ readonly skippedTests: Schema.$Array<Schema.String>;
944
+ readonly ranDigests: Schema.$Array<Schema.String>;
945
+ }>>;
901
946
  }>>;
902
947
  }>;
903
948
  readonly baseline: Schema.optionalKey<Schema.Struct<{
@@ -913,6 +958,15 @@ export declare const WorkUnitOutcome: Schema.Struct<{
913
958
  readonly outputTail: Schema.String;
914
959
  /** The Run Files the check kept: its log and what it left in `KITMAN_RUN_FILES_DIR`. */
915
960
  readonly fileIds: Schema.optionalKey<Schema.$Array<Schema.String>>;
961
+ /** What the JUnit reports the check left in `KITMAN_RUN_FILES_DIR` say; absent from older Runners. */
962
+ readonly tests: Schema.optionalKey<Schema.Struct<{
963
+ readonly reports: Schema.Int;
964
+ readonly passed: Schema.Int;
965
+ readonly failed: Schema.Int;
966
+ readonly skipped: Schema.Int;
967
+ readonly skippedTests: Schema.$Array<Schema.String>;
968
+ readonly ranDigests: Schema.$Array<Schema.String>;
969
+ }>>;
916
970
  }>>;
917
971
  }>>;
918
972
  readonly measurement: Schema.optionalKey<Schema.Struct<{
@@ -1009,6 +1063,15 @@ export declare const WorkUnitCompletion: Schema.Struct<{
1009
1063
  readonly outputTail: Schema.String;
1010
1064
  /** The Run Files the check kept: its log and what it left in `KITMAN_RUN_FILES_DIR`. */
1011
1065
  readonly fileIds: Schema.optionalKey<Schema.$Array<Schema.String>>;
1066
+ /** What the JUnit reports the check left in `KITMAN_RUN_FILES_DIR` say; absent from older Runners. */
1067
+ readonly tests: Schema.optionalKey<Schema.Struct<{
1068
+ readonly reports: Schema.Int;
1069
+ readonly passed: Schema.Int;
1070
+ readonly failed: Schema.Int;
1071
+ readonly skipped: Schema.Int;
1072
+ readonly skippedTests: Schema.$Array<Schema.String>;
1073
+ readonly ranDigests: Schema.$Array<Schema.String>;
1074
+ }>>;
1012
1075
  }>>;
1013
1076
  }>;
1014
1077
  readonly baseline: Schema.optionalKey<Schema.Struct<{
@@ -1024,6 +1087,15 @@ export declare const WorkUnitCompletion: Schema.Struct<{
1024
1087
  readonly outputTail: Schema.String;
1025
1088
  /** The Run Files the check kept: its log and what it left in `KITMAN_RUN_FILES_DIR`. */
1026
1089
  readonly fileIds: Schema.optionalKey<Schema.$Array<Schema.String>>;
1090
+ /** What the JUnit reports the check left in `KITMAN_RUN_FILES_DIR` say; absent from older Runners. */
1091
+ readonly tests: Schema.optionalKey<Schema.Struct<{
1092
+ readonly reports: Schema.Int;
1093
+ readonly passed: Schema.Int;
1094
+ readonly failed: Schema.Int;
1095
+ readonly skipped: Schema.Int;
1096
+ readonly skippedTests: Schema.$Array<Schema.String>;
1097
+ readonly ranDigests: Schema.$Array<Schema.String>;
1098
+ }>>;
1027
1099
  }>>;
1028
1100
  }>>;
1029
1101
  readonly measurement: Schema.optionalKey<Schema.Struct<{
@@ -447,6 +447,14 @@ export declare const makeRunnerRpcClient: (options: ConnectionOptions) => Effect
447
447
  readonly durationMs: number;
448
448
  readonly outputTail: string;
449
449
  readonly fileIds?: readonly string[];
450
+ readonly tests?: {
451
+ readonly reports: number;
452
+ readonly passed: number;
453
+ readonly failed: number;
454
+ readonly skipped: number;
455
+ readonly skippedTests: readonly string[];
456
+ readonly ranDigests: readonly string[];
457
+ };
450
458
  }[];
451
459
  };
452
460
  readonly baseline?: {
@@ -460,6 +468,14 @@ export declare const makeRunnerRpcClient: (options: ConnectionOptions) => Effect
460
468
  readonly durationMs: number;
461
469
  readonly outputTail: string;
462
470
  readonly fileIds?: readonly string[];
471
+ readonly tests?: {
472
+ readonly reports: number;
473
+ readonly passed: number;
474
+ readonly failed: number;
475
+ readonly skipped: number;
476
+ readonly skippedTests: readonly string[];
477
+ readonly ranDigests: readonly string[];
478
+ };
463
479
  }[];
464
480
  };
465
481
  readonly measurement?: {
@@ -400,6 +400,14 @@ declare const RunnerReplicaRpcs_base: RpcGroup.RpcGroup<Rpc.Rpc<"AppendTranscrip
400
400
  readonly durationMs: Schema.Int;
401
401
  readonly outputTail: Schema.String;
402
402
  readonly fileIds: Schema.optionalKey<Schema.$Array<Schema.String>>;
403
+ readonly tests: Schema.optionalKey<Schema.Struct<{
404
+ readonly reports: Schema.Int;
405
+ readonly passed: Schema.Int;
406
+ readonly failed: Schema.Int;
407
+ readonly skipped: Schema.Int;
408
+ readonly skippedTests: Schema.$Array<Schema.String>;
409
+ readonly ranDigests: Schema.$Array<Schema.String>;
410
+ }>>;
403
411
  }>>;
404
412
  }>;
405
413
  readonly baseline: Schema.optionalKey<Schema.Struct<{
@@ -413,6 +421,14 @@ declare const RunnerReplicaRpcs_base: RpcGroup.RpcGroup<Rpc.Rpc<"AppendTranscrip
413
421
  readonly durationMs: Schema.Int;
414
422
  readonly outputTail: Schema.String;
415
423
  readonly fileIds: Schema.optionalKey<Schema.$Array<Schema.String>>;
424
+ readonly tests: Schema.optionalKey<Schema.Struct<{
425
+ readonly reports: Schema.Int;
426
+ readonly passed: Schema.Int;
427
+ readonly failed: Schema.Int;
428
+ readonly skipped: Schema.Int;
429
+ readonly skippedTests: Schema.$Array<Schema.String>;
430
+ readonly ranDigests: Schema.$Array<Schema.String>;
431
+ }>>;
416
432
  }>>;
417
433
  }>>;
418
434
  readonly measurement: Schema.optionalKey<Schema.Struct<{
@@ -2627,6 +2643,14 @@ export declare const RunnerRpcs: RpcGroup.RpcGroup<Rpc.Rpc<"AdmitChild", Schema.
2627
2643
  readonly durationMs: Schema.Int;
2628
2644
  readonly outputTail: Schema.String;
2629
2645
  readonly fileIds: Schema.optionalKey<Schema.$Array<Schema.String>>;
2646
+ readonly tests: Schema.optionalKey<Schema.Struct<{
2647
+ readonly reports: Schema.Int;
2648
+ readonly passed: Schema.Int;
2649
+ readonly failed: Schema.Int;
2650
+ readonly skipped: Schema.Int;
2651
+ readonly skippedTests: Schema.$Array<Schema.String>;
2652
+ readonly ranDigests: Schema.$Array<Schema.String>;
2653
+ }>>;
2630
2654
  }>>;
2631
2655
  }>;
2632
2656
  readonly baseline: Schema.optionalKey<Schema.Struct<{
@@ -2640,6 +2664,14 @@ export declare const RunnerRpcs: RpcGroup.RpcGroup<Rpc.Rpc<"AdmitChild", Schema.
2640
2664
  readonly durationMs: Schema.Int;
2641
2665
  readonly outputTail: Schema.String;
2642
2666
  readonly fileIds: Schema.optionalKey<Schema.$Array<Schema.String>>;
2667
+ readonly tests: Schema.optionalKey<Schema.Struct<{
2668
+ readonly reports: Schema.Int;
2669
+ readonly passed: Schema.Int;
2670
+ readonly failed: Schema.Int;
2671
+ readonly skipped: Schema.Int;
2672
+ readonly skippedTests: Schema.$Array<Schema.String>;
2673
+ readonly ranDigests: Schema.$Array<Schema.String>;
2674
+ }>>;
2643
2675
  }>>;
2644
2676
  }>>;
2645
2677
  readonly measurement: Schema.optionalKey<Schema.Struct<{
@@ -15,6 +15,10 @@ export declare const EvidenceCheck: Schema.Struct<{
15
15
  readonly outputTail: Schema.optionalKey<Schema.String>;
16
16
  /** An agent suggested it because the repository has none approved; a person should check it. */
17
17
  readonly suggested: Schema.optionalKey<Schema.Boolean>;
18
+ /** Tests its JUnit reports show ran on the baseline and were skipped on this tree. */
19
+ readonly skippedSinceBaseline: Schema.optionalKey<Schema.$Array<Schema.String>>;
20
+ /** Tests new on this tree that its JUnit reports show skipped, so they never ran. */
21
+ readonly newNotRun: Schema.optionalKey<Schema.$Array<Schema.String>>;
18
22
  }>;
19
23
  export type EvidenceCheck = typeof EvidenceCheck.Type;
20
24
  /** Evidence for a revision; `tree` is its git tree id, and the evidence holds for any revision with that tree. */
@@ -37,6 +41,10 @@ export declare const VerifyResult: Schema.Struct<{
37
41
  readonly outputTail: Schema.optionalKey<Schema.String>;
38
42
  /** An agent suggested it because the repository has none approved; a person should check it. */
39
43
  readonly suggested: Schema.optionalKey<Schema.Boolean>;
44
+ /** Tests its JUnit reports show ran on the baseline and were skipped on this tree. */
45
+ readonly skippedSinceBaseline: Schema.optionalKey<Schema.$Array<Schema.String>>;
46
+ /** Tests new on this tree that its JUnit reports show skipped, so they never ran. */
47
+ readonly newNotRun: Schema.optionalKey<Schema.$Array<Schema.String>>;
40
48
  }>>;
41
49
  }>;
42
50
  export type VerifyResult = typeof VerifyResult.Type;
@@ -77,5 +85,13 @@ export type EvidenceVerdict = {
77
85
  readonly reasons: readonly string[];
78
86
  };
79
87
  export declare const failsOn: (side: 'base' | 'head', name: string, tree: string | undefined) => string;
80
- /** Whether the Run's evidence closes its Outcome, per `OutcomeTable`; claims in Outputs never count. */
88
+ /**
89
+ * Each check's tests that verify never ran on the tree, which a passing check does not vouch for: new tests it skipped,
90
+ * and tests the baseline ran that it skipped.
91
+ */
92
+ export declare const testsNotRunReasons: (result: VerifyResult) => string[];
93
+ /**
94
+ * Whether the Run's evidence closes its Outcome, per `OutcomeTable`; claims in Outputs never count, and neither do tests
95
+ * the head's checks skipped where the baseline ran them or did not have them.
96
+ */
81
97
  export declare const evidenceGate: (input: EvidenceGateInput) => EvidenceVerdict;
@@ -216,6 +216,8 @@ export declare const verifyDeferred: (step: string) => DurableDeferred.DurableDe
216
216
  readonly evidenceId: Schema.String;
217
217
  readonly outputTail: Schema.optionalKey<Schema.String>;
218
218
  readonly suggested: Schema.optionalKey<Schema.Boolean>;
219
+ readonly skippedSinceBaseline: Schema.optionalKey<Schema.$Array<Schema.String>>;
220
+ readonly newNotRun: Schema.optionalKey<Schema.$Array<Schema.String>>;
219
221
  }>>;
220
222
  }>, typeof StepFailed>;
221
223
  /** Claims the Step name for this Run and checks its capability before running it. */
@@ -338,6 +340,8 @@ export declare const verify: (name: string, request: {
338
340
  readonly evidenceId: string;
339
341
  readonly outputTail?: string;
340
342
  readonly suggested?: boolean;
343
+ readonly skippedSinceBaseline?: readonly string[];
344
+ readonly newNotRun?: readonly string[];
341
345
  }[];
342
346
  }, CapabilityDenied | DuplicateStep | StepFailed, LoopHost | LoopRun | import("effect/workflow/WorkflowEngine").WorkflowEngine | import("effect/workflow/WorkflowEngine").WorkflowInstance>;
343
347
  /** Asks a human to approve a verification, for example one an agent's Output suggested. */