@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.
- package/dist/build/index.js +2 -2
- package/dist/{chunk-kjkn6d60.js → chunk-stw541tr.js} +319 -278
- package/dist/{chunk-5qeam2w1.js → chunk-w2f4s9v2.js} +1 -1
- package/dist/loop/index.js +3 -1
- package/dist/program/index.js +2 -2
- package/package.json +1 -1
- package/types/packages/core/src/index.d.ts +1 -0
- package/types/packages/core/src/loop.d.ts +8 -0
- package/types/packages/core/src/test-report.d.ts +38 -0
- package/types/packages/core/src/work-unit.d.ts +72 -0
- package/types/packages/live/src/rpc/runner-client.d.ts +16 -0
- package/types/packages/live/src/rpc/runner-group.d.ts +32 -0
- package/types/packages/sdk/src/loop/evidence.d.ts +17 -1
- package/types/packages/sdk/src/loop/steps.d.ts +4 -0
|
@@ -1888,6 +1888,8 @@ var RunEvidence = Schema12.Struct({
|
|
|
1888
1888
|
durationMs: Schema12.Int.check(Schema12.isGreaterThanOrEqualTo(0)),
|
|
1889
1889
|
outputTail: Schema12.String,
|
|
1890
1890
|
fileIds: Schema12.optionalKey(Schema12.Array(Schema12.String)),
|
|
1891
|
+
skippedSinceBaseline: Schema12.optionalKey(Schema12.Array(Schema12.String)),
|
|
1892
|
+
newNotRun: Schema12.optionalKey(Schema12.Array(Schema12.String)),
|
|
1891
1893
|
recordedAt: Timestamp
|
|
1892
1894
|
});
|
|
1893
1895
|
var ApprovedVerification = Schema12.Struct({
|
|
@@ -2740,7 +2742,9 @@ var EvidenceCheck2 = Schema16.Struct({
|
|
|
2740
2742
|
durationMs: Schema16.Finite,
|
|
2741
2743
|
evidenceId: Schema16.String,
|
|
2742
2744
|
outputTail: Schema16.optionalKey(Schema16.String),
|
|
2743
|
-
suggested: Schema16.optionalKey(Schema16.Boolean)
|
|
2745
|
+
suggested: Schema16.optionalKey(Schema16.Boolean),
|
|
2746
|
+
skippedSinceBaseline: Schema16.optionalKey(Schema16.Array(Schema16.String)),
|
|
2747
|
+
newNotRun: Schema16.optionalKey(Schema16.Array(Schema16.String))
|
|
2744
2748
|
});
|
|
2745
2749
|
var VerifyResult2 = Schema16.Struct({
|
|
2746
2750
|
revision: Schema16.String,
|
|
@@ -2762,6 +2766,16 @@ var OutcomeTable2 = {
|
|
|
2762
2766
|
var verdict = (reasons) => reasons.length === 0 ? { settled: true } : { settled: false, reasons };
|
|
2763
2767
|
var missing = (side) => `No verification evidence for the ${side}`;
|
|
2764
2768
|
var failsOn2 = (side, name, tree) => `${name} fails on the ${side} tree ${tree}`;
|
|
2769
|
+
var shownTests = 10;
|
|
2770
|
+
var testList = (tests) => [...tests.slice(0, shownTests), ...tests.length > shownTests ? [`and ${tests.length - shownTests} more`] : []].join("; ");
|
|
2771
|
+
var testsNotRunReasons2 = (result) => result.checks.flatMap((check) => [
|
|
2772
|
+
...check.newNotRun === undefined || check.newNotRun.length === 0 ? [] : [
|
|
2773
|
+
`${check.name} skipped ${check.newNotRun.length} new test${check.newNotRun.length === 1 ? "" : "s"} on the tree ${result.tree}, so verify never ran them: ${testList(check.newNotRun)}`
|
|
2774
|
+
],
|
|
2775
|
+
...check.skippedSinceBaseline === undefined || check.skippedSinceBaseline.length === 0 ? [] : [
|
|
2776
|
+
`${check.name} skipped ${check.skippedSinceBaseline.length} test${check.skippedSinceBaseline.length === 1 ? "" : "s"} on the tree ${result.tree} that ran on the baseline: ${testList(check.skippedSinceBaseline)}`
|
|
2777
|
+
]
|
|
2778
|
+
]);
|
|
2765
2779
|
var allPass = (side, result) => {
|
|
2766
2780
|
if (result === undefined)
|
|
2767
2781
|
return [missing(side)];
|
|
@@ -2804,6 +2818,11 @@ var scopeReasons = (scope) => {
|
|
|
2804
2818
|
return scope.unmet.length === 0 ? ["Review found the scope unmet"] : scope.unmet.map((item) => `Review found the scope unmet: ${item}`);
|
|
2805
2819
|
};
|
|
2806
2820
|
var evidenceGate2 = (input) => {
|
|
2821
|
+
const gated = outcomeGate(input);
|
|
2822
|
+
const notRun = input.outcome === "investigation" || input.head === undefined ? [] : testsNotRunReasons2(input.head);
|
|
2823
|
+
return verdict([...gated.settled ? [] : gated.reasons, ...notRun]);
|
|
2824
|
+
};
|
|
2825
|
+
var outcomeGate = (input) => {
|
|
2807
2826
|
switch (input.outcome) {
|
|
2808
2827
|
case "feature":
|
|
2809
2828
|
return verdict([...allPass("head", input.head), ...scopeReasons(input.review)]);
|
|
@@ -3484,7 +3503,7 @@ import * as Exit3 from "effect/Exit";
|
|
|
3484
3503
|
import * as Layer from "effect/Layer";
|
|
3485
3504
|
import * as Option2 from "effect/Option";
|
|
3486
3505
|
import * as Record12 from "effect/Record";
|
|
3487
|
-
import * as
|
|
3506
|
+
import * as Schema28 from "effect/Schema";
|
|
3488
3507
|
import { DurableDeferred as DurableDeferred4, Workflow, WorkflowEngine } from "effect/workflow";
|
|
3489
3508
|
|
|
3490
3509
|
// packages/core/src/resource-claim.ts
|
|
@@ -3561,8 +3580,8 @@ var letGo2 = (name, held) => takeStep2(name, "let_go", "claim", Effect6.gen(func
|
|
|
3561
3580
|
}));
|
|
3562
3581
|
|
|
3563
3582
|
// packages/core/src/work-unit.ts
|
|
3564
|
-
import * as
|
|
3565
|
-
import * as
|
|
3583
|
+
import * as Schema26 from "effect/Schema";
|
|
3584
|
+
import * as Struct24 from "effect/Struct";
|
|
3566
3585
|
|
|
3567
3586
|
// packages/core/src/repo-binding.ts
|
|
3568
3587
|
import * as Schema22 from "effect/Schema";
|
|
@@ -3661,303 +3680,325 @@ var NetworkHostQuery = Schema23.Struct({
|
|
|
3661
3680
|
repoBindingId: Schema23.optionalKey(Id)
|
|
3662
3681
|
});
|
|
3663
3682
|
|
|
3664
|
-
// packages/core/src/
|
|
3683
|
+
// packages/core/src/test-report.ts
|
|
3665
3684
|
import * as Schema24 from "effect/Schema";
|
|
3666
|
-
var
|
|
3667
|
-
var
|
|
3668
|
-
var
|
|
3669
|
-
var
|
|
3670
|
-
|
|
3685
|
+
var maxSkippedTests = 1e4;
|
|
3686
|
+
var maxRanDigests = 1e5;
|
|
3687
|
+
var TestId = Schema24.String.check(Schema24.isMinLength(1), Schema24.isMaxLength(1000));
|
|
3688
|
+
var CheckTests = Schema24.Struct({
|
|
3689
|
+
reports: Schema24.Int.check(Schema24.isGreaterThanOrEqualTo(0)),
|
|
3690
|
+
passed: Schema24.Int.check(Schema24.isGreaterThanOrEqualTo(0)),
|
|
3691
|
+
failed: Schema24.Int.check(Schema24.isGreaterThanOrEqualTo(0)),
|
|
3692
|
+
skipped: Schema24.Int.check(Schema24.isGreaterThanOrEqualTo(0)),
|
|
3693
|
+
skippedTests: Schema24.Array(TestId).check(Schema24.isMaxLength(maxSkippedTests)),
|
|
3694
|
+
ranDigests: Schema24.Array(Schema24.String.check(Schema24.isMaxLength(16))).check(Schema24.isMaxLength(maxRanDigests))
|
|
3695
|
+
});
|
|
3696
|
+
var entities = new Map([
|
|
3697
|
+
["amp", "&"],
|
|
3698
|
+
["lt", "<"],
|
|
3699
|
+
["gt", ">"],
|
|
3700
|
+
["quot", '"'],
|
|
3701
|
+
["apos", "'"]
|
|
3702
|
+
]);
|
|
3703
|
+
|
|
3704
|
+
// packages/core/src/secret.ts
|
|
3705
|
+
import * as Schema25 from "effect/Schema";
|
|
3706
|
+
var SecretName2 = Schema25.String.check(Schema25.isPattern(new RegExp("^[A-Za-z_][A-Za-z0-9_]*$", "u")), Schema25.isMinLength(1), Schema25.isMaxLength(128));
|
|
3707
|
+
var SecretScope = Schema25.Union([Schema25.Literal("workspace"), Schema25.Literal("team")]);
|
|
3708
|
+
var SecretHost = Schema25.String.check(Schema25.isPattern(new RegExp("^(\\*\\.)?[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*(?::[0-9]{1,5})?$", "u")), Schema25.isMaxLength(260));
|
|
3709
|
+
var SecretHosts = Schema25.Array(SecretHost).check(Schema25.isMaxLength(32));
|
|
3710
|
+
var SecretSummary = Schema25.Struct({
|
|
3671
3711
|
name: SecretName2,
|
|
3672
3712
|
scope: SecretScope,
|
|
3673
|
-
teamId:
|
|
3713
|
+
teamId: Schema25.optionalKey(Id),
|
|
3674
3714
|
hosts: SecretHosts,
|
|
3675
3715
|
setByActorType: ActorType,
|
|
3676
|
-
setByActorId:
|
|
3716
|
+
setByActorId: Schema25.String,
|
|
3677
3717
|
setAt: Timestamp
|
|
3678
3718
|
});
|
|
3679
|
-
var SecretList =
|
|
3680
|
-
var SecretSet =
|
|
3681
|
-
value:
|
|
3682
|
-
teamId:
|
|
3683
|
-
hosts:
|
|
3719
|
+
var SecretList = Schema25.Struct({ items: Schema25.Array(SecretSummary) });
|
|
3720
|
+
var SecretSet = Schema25.Struct({
|
|
3721
|
+
value: Schema25.String.check(Schema25.isMinLength(1), Schema25.isMaxLength(65536)),
|
|
3722
|
+
teamId: Schema25.optionalKey(Schema25.String.check(Schema25.isMinLength(1))),
|
|
3723
|
+
hosts: Schema25.optionalKey(SecretHosts)
|
|
3684
3724
|
});
|
|
3685
|
-
var SecretScopeQuery =
|
|
3725
|
+
var SecretScopeQuery = Schema25.Struct({ teamId: Schema25.optionalKey(Id) });
|
|
3686
3726
|
|
|
3687
3727
|
// packages/core/src/work-unit.ts
|
|
3688
|
-
var WorkUnitLease =
|
|
3728
|
+
var WorkUnitLease = Schema26.Struct({
|
|
3689
3729
|
leaseOwnerId: Id,
|
|
3690
3730
|
runnerReplicaId: Id,
|
|
3691
3731
|
leaseId: Id,
|
|
3692
|
-
attempt:
|
|
3693
|
-
fencingToken:
|
|
3694
|
-
capacitySlot:
|
|
3732
|
+
attempt: Schema26.Int.check(Schema26.isGreaterThanOrEqualTo(1)),
|
|
3733
|
+
fencingToken: Schema26.String.check(Schema26.isMinLength(1), Schema26.isMaxLength(240), Schema26.isPattern(new RegExp("^[A-Za-z0-9._:-]+$", "u"))),
|
|
3734
|
+
capacitySlot: Schema26.String.check(Schema26.isMinLength(1), Schema26.isMaxLength(240)),
|
|
3695
3735
|
leaseExpiresAt: Timestamp,
|
|
3696
3736
|
lastHeartbeatAt: Timestamp
|
|
3697
3737
|
});
|
|
3698
|
-
var WorkUnitLeaseProjection =
|
|
3699
|
-
var WorkUnitRepoBinding =
|
|
3738
|
+
var WorkUnitLeaseProjection = Schema26.Struct(Struct24.map(WorkUnitLease.fields, Schema26.optionalKey));
|
|
3739
|
+
var WorkUnitRepoBinding = Schema26.Struct({
|
|
3700
3740
|
id: Id,
|
|
3701
3741
|
provider: RepoBindingProvider,
|
|
3702
|
-
host:
|
|
3703
|
-
owner:
|
|
3704
|
-
name:
|
|
3705
|
-
repositoryUrl:
|
|
3706
|
-
pathPrefix:
|
|
3707
|
-
defaultTargetBranch:
|
|
3708
|
-
expectedBranch:
|
|
3709
|
-
expectedCommitSha:
|
|
3710
|
-
});
|
|
3711
|
-
var WorkUnitLeaseInput =
|
|
3742
|
+
host: Schema26.String.check(Schema26.isMinLength(1)),
|
|
3743
|
+
owner: Schema26.String.check(Schema26.isMinLength(1)),
|
|
3744
|
+
name: Schema26.String.check(Schema26.isMinLength(1)),
|
|
3745
|
+
repositoryUrl: Schema26.optionalKey(Schema26.String.check(Schema26.isMinLength(1))),
|
|
3746
|
+
pathPrefix: Schema26.optionalKey(Schema26.String.check(Schema26.isMinLength(1))),
|
|
3747
|
+
defaultTargetBranch: Schema26.String.check(Schema26.isMinLength(1)),
|
|
3748
|
+
expectedBranch: Schema26.optionalKey(Schema26.String.check(Schema26.isMinLength(1))),
|
|
3749
|
+
expectedCommitSha: Schema26.optionalKey(Schema26.String.check(Schema26.isMinLength(1)))
|
|
3750
|
+
});
|
|
3751
|
+
var WorkUnitLeaseInput = Schema26.Struct({
|
|
3712
3752
|
leaseOwnerId: Id,
|
|
3713
3753
|
runnerReplicaId: Id,
|
|
3714
3754
|
leaseId: Id,
|
|
3715
|
-
attempt:
|
|
3716
|
-
fencingToken:
|
|
3717
|
-
capacitySlot:
|
|
3718
|
-
});
|
|
3719
|
-
var WorkUnitStatus =
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3755
|
+
attempt: Schema26.Int.check(Schema26.isGreaterThanOrEqualTo(1)),
|
|
3756
|
+
fencingToken: Schema26.String.check(Schema26.isMinLength(1), Schema26.isMaxLength(240), Schema26.isPattern(new RegExp("^[A-Za-z0-9._:-]+$", "u"))),
|
|
3757
|
+
capacitySlot: Schema26.String.check(Schema26.isMinLength(1), Schema26.isMaxLength(240))
|
|
3758
|
+
});
|
|
3759
|
+
var WorkUnitStatus = Schema26.Union([
|
|
3760
|
+
Schema26.Literal("pending"),
|
|
3761
|
+
Schema26.Literal("claimed"),
|
|
3762
|
+
Schema26.Literal("running"),
|
|
3763
|
+
Schema26.Literal("waiting"),
|
|
3764
|
+
Schema26.Literal("blocked"),
|
|
3765
|
+
Schema26.Literal("completed"),
|
|
3766
|
+
Schema26.Literal("failed"),
|
|
3767
|
+
Schema26.Literal("canceled"),
|
|
3768
|
+
Schema26.Literal("expired")
|
|
3729
3769
|
]);
|
|
3730
|
-
var LoopCheckout =
|
|
3731
|
-
var StorageOrigin =
|
|
3732
|
-
var SecretDestination =
|
|
3770
|
+
var LoopCheckout = Schema26.Union([Schema26.Literal("none"), Schema26.Literal("read"), Schema26.Literal("write")]);
|
|
3771
|
+
var StorageOrigin = Schema26.optionalKey(Schema26.String.check(Schema26.isMinLength(1), Schema26.isMaxLength(2048)));
|
|
3772
|
+
var SecretDestination = Schema26.Struct({
|
|
3733
3773
|
scope: SecretScope,
|
|
3734
3774
|
hosts: SecretHosts,
|
|
3735
|
-
version:
|
|
3775
|
+
version: Schema26.String.check(Schema26.isMinLength(1), Schema26.isMaxLength(128))
|
|
3736
3776
|
});
|
|
3737
|
-
var AgentStepWorkUnit =
|
|
3738
|
-
kind:
|
|
3777
|
+
var AgentStepWorkUnit = Schema26.Struct({
|
|
3778
|
+
kind: Schema26.Literal("agent_step"),
|
|
3739
3779
|
id: Id,
|
|
3740
|
-
teamId:
|
|
3780
|
+
teamId: Schema26.optionalKey(Id),
|
|
3741
3781
|
runId: Id,
|
|
3742
|
-
stepKey:
|
|
3743
|
-
attempt:
|
|
3782
|
+
stepKey: Schema26.String.check(Schema26.isMinLength(1), Schema26.isMaxLength(240)),
|
|
3783
|
+
attempt: Schema26.Int.check(Schema26.isGreaterThanOrEqualTo(1)),
|
|
3744
3784
|
lease: WorkUnitLease,
|
|
3745
|
-
deadlineAt:
|
|
3785
|
+
deadlineAt: Schema26.optionalKey(Timestamp),
|
|
3746
3786
|
brief: StepBrief,
|
|
3747
|
-
stepCredential:
|
|
3787
|
+
stepCredential: Schema26.String.check(Schema26.isMinLength(1), Schema26.isMaxLength(512)),
|
|
3748
3788
|
checkout: LoopCheckout,
|
|
3749
|
-
repoBinding:
|
|
3750
|
-
branch:
|
|
3751
|
-
baseRevision:
|
|
3752
|
-
network:
|
|
3753
|
-
hosts:
|
|
3754
|
-
sandbox:
|
|
3755
|
-
secrets:
|
|
3756
|
-
secretDestinations:
|
|
3757
|
-
runBaseRevision:
|
|
3758
|
-
mergeTarget:
|
|
3759
|
-
resumeNotes:
|
|
3760
|
-
transcriptSequence:
|
|
3789
|
+
repoBinding: Schema26.optionalKey(WorkUnitRepoBinding),
|
|
3790
|
+
branch: Schema26.optionalKey(Schema26.String.check(Schema26.isMinLength(1))),
|
|
3791
|
+
baseRevision: Schema26.optionalKey(Schema26.String.check(Schema26.isMinLength(1))),
|
|
3792
|
+
network: Schema26.optionalKey(AgentSandboxNetwork),
|
|
3793
|
+
hosts: Schema26.optionalKey(Schema26.Array(NetworkHost)),
|
|
3794
|
+
sandbox: Schema26.optionalKey(Schema26.Literal("docker")),
|
|
3795
|
+
secrets: Schema26.optionalKey(Schema26.Record(Schema26.String, Schema26.String)),
|
|
3796
|
+
secretDestinations: Schema26.optionalKey(Schema26.Record(Schema26.String, SecretDestination)),
|
|
3797
|
+
runBaseRevision: Schema26.optionalKey(Schema26.String.check(Schema26.isMinLength(1))),
|
|
3798
|
+
mergeTarget: Schema26.optionalKey(Schema26.String.check(Schema26.isMinLength(1))),
|
|
3799
|
+
resumeNotes: Schema26.optionalKey(Schema26.Array(Schema26.String)),
|
|
3800
|
+
transcriptSequence: Schema26.optionalKey(Schema26.Int.check(Schema26.isGreaterThanOrEqualTo(1))),
|
|
3761
3801
|
storageOrigin: StorageOrigin
|
|
3762
3802
|
});
|
|
3763
|
-
var RunJournal =
|
|
3764
|
-
activities:
|
|
3765
|
-
deferreds:
|
|
3803
|
+
var RunJournal = Schema26.Struct({
|
|
3804
|
+
activities: Schema26.Record(Schema26.String, Schema26.Unknown),
|
|
3805
|
+
deferreds: Schema26.Record(Schema26.String, Schema26.Unknown)
|
|
3766
3806
|
});
|
|
3767
|
-
var OrchestrationWorkUnit =
|
|
3768
|
-
kind:
|
|
3807
|
+
var OrchestrationWorkUnit = Schema26.Struct({
|
|
3808
|
+
kind: Schema26.Literal("orchestration"),
|
|
3769
3809
|
id: Id,
|
|
3770
|
-
teamId:
|
|
3810
|
+
teamId: Schema26.optionalKey(Id),
|
|
3771
3811
|
runId: Id,
|
|
3772
|
-
loopDigest:
|
|
3773
|
-
input:
|
|
3774
|
-
granted:
|
|
3812
|
+
loopDigest: Schema26.String.check(Schema26.isMinLength(64), Schema26.isMaxLength(64), Schema26.isPattern(new RegExp("^[a-f0-9]{64}$", "u"))),
|
|
3813
|
+
input: Schema26.Unknown,
|
|
3814
|
+
granted: Schema26.Array(Schema26.String),
|
|
3775
3815
|
lease: WorkUnitLease,
|
|
3776
3816
|
journal: RunJournal,
|
|
3777
|
-
network:
|
|
3817
|
+
network: Schema26.optionalKey(AgentSandboxNetwork),
|
|
3778
3818
|
storageOrigin: StorageOrigin,
|
|
3779
|
-
program:
|
|
3780
|
-
loopId:
|
|
3781
|
-
credential:
|
|
3819
|
+
program: Schema26.Struct({
|
|
3820
|
+
loopId: Schema26.String.check(Schema26.isMinLength(1)),
|
|
3821
|
+
credential: Schema26.String.check(Schema26.isMinLength(1))
|
|
3782
3822
|
})
|
|
3783
3823
|
});
|
|
3784
|
-
var ProgramWorkUnit = OrchestrationWorkUnit.mapFields(
|
|
3785
|
-
var CheckName2 =
|
|
3786
|
-
var ApprovedCheck =
|
|
3824
|
+
var ProgramWorkUnit = OrchestrationWorkUnit.mapFields(Struct24.omit(["program"]));
|
|
3825
|
+
var CheckName2 = Schema26.String.check(Schema26.isMinLength(1), Schema26.isMaxLength(120), Schema26.isPattern(new RegExp("^[A-Za-z0-9][A-Za-z0-9._:-]*$", "u")));
|
|
3826
|
+
var ApprovedCheck = Schema26.Struct({
|
|
3787
3827
|
name: CheckName2,
|
|
3788
|
-
command:
|
|
3789
|
-
workingDirectory:
|
|
3790
|
-
suggested:
|
|
3828
|
+
command: Schema26.String.check(Schema26.isMinLength(1), Schema26.isMaxLength(2000)),
|
|
3829
|
+
workingDirectory: Schema26.optionalKey(Schema26.String.check(Schema26.isMinLength(1), Schema26.isMaxLength(500))),
|
|
3830
|
+
suggested: Schema26.optionalKey(Schema26.Boolean)
|
|
3791
3831
|
});
|
|
3792
|
-
var RepositoryCheck =
|
|
3832
|
+
var RepositoryCheck = Schema26.Struct({
|
|
3793
3833
|
...ApprovedCheck.fields,
|
|
3794
|
-
pipeline:
|
|
3795
|
-
});
|
|
3796
|
-
var MetricName =
|
|
3797
|
-
var MeasurePlan2 =
|
|
3798
|
-
command:
|
|
3799
|
-
prepare:
|
|
3800
|
-
workingDirectory:
|
|
3801
|
-
warmup:
|
|
3802
|
-
metrics:
|
|
3834
|
+
pipeline: Schema26.optionalKey(Schema26.Boolean)
|
|
3835
|
+
});
|
|
3836
|
+
var MetricName = Schema26.String.check(Schema26.isMinLength(1), Schema26.isMaxLength(80), Schema26.isPattern(new RegExp("^[A-Za-z0-9][A-Za-z0-9._:-]*$", "u")));
|
|
3837
|
+
var MeasurePlan2 = Schema26.Struct({
|
|
3838
|
+
command: Schema26.String.check(Schema26.isMinLength(1), Schema26.isMaxLength(2000)),
|
|
3839
|
+
prepare: Schema26.optionalKey(Schema26.String.check(Schema26.isMinLength(1), Schema26.isMaxLength(2000))),
|
|
3840
|
+
workingDirectory: Schema26.optionalKey(Schema26.String.check(Schema26.isMinLength(1), Schema26.isMaxLength(500))),
|
|
3841
|
+
warmup: Schema26.optionalKey(Schema26.Int.check(Schema26.isGreaterThanOrEqualTo(0), Schema26.isLessThanOrEqualTo(10))),
|
|
3842
|
+
metrics: Schema26.Array(Schema26.Struct({
|
|
3803
3843
|
name: MetricName,
|
|
3804
|
-
direction:
|
|
3805
|
-
role:
|
|
3806
|
-
lowVariance:
|
|
3807
|
-
})).check(
|
|
3844
|
+
direction: Schema26.Literals(["lower", "higher"]),
|
|
3845
|
+
role: Schema26.Literals(["primary", "guardrail"]),
|
|
3846
|
+
lowVariance: Schema26.optionalKey(Schema26.Boolean)
|
|
3847
|
+
})).check(Schema26.isMinLength(1), Schema26.isMaxLength(20))
|
|
3808
3848
|
});
|
|
3809
|
-
var MeasureSpec =
|
|
3810
|
-
base:
|
|
3849
|
+
var MeasureSpec = Schema26.Struct({
|
|
3850
|
+
base: Schema26.String.check(Schema26.isMinLength(1), Schema26.isMaxLength(240)),
|
|
3811
3851
|
plan: MeasurePlan2,
|
|
3812
|
-
samples:
|
|
3813
|
-
calibrate:
|
|
3852
|
+
samples: Schema26.Int.check(Schema26.isGreaterThanOrEqualTo(1), Schema26.isLessThanOrEqualTo(50)),
|
|
3853
|
+
calibrate: Schema26.Boolean
|
|
3814
3854
|
});
|
|
3815
|
-
var MeasureSample =
|
|
3816
|
-
var MeasureSamples =
|
|
3817
|
-
var MeasureEvidence =
|
|
3855
|
+
var MeasureSample = Schema26.Record(MetricName, Schema26.Finite);
|
|
3856
|
+
var MeasureSamples = Schema26.Array(MeasureSample).check(Schema26.isMaxLength(50));
|
|
3857
|
+
var MeasureEvidence = Schema26.Struct({
|
|
3818
3858
|
base: MeasureSamples,
|
|
3819
3859
|
head: MeasureSamples,
|
|
3820
|
-
baseAgain:
|
|
3860
|
+
baseAgain: Schema26.optionalKey(MeasureSamples)
|
|
3821
3861
|
});
|
|
3822
|
-
var VerificationWorkUnit =
|
|
3823
|
-
kind:
|
|
3862
|
+
var VerificationWorkUnit = Schema26.Struct({
|
|
3863
|
+
kind: Schema26.Literal("verification"),
|
|
3824
3864
|
id: Id,
|
|
3825
|
-
teamId:
|
|
3865
|
+
teamId: Schema26.optionalKey(Id),
|
|
3826
3866
|
runId: Id,
|
|
3827
|
-
stepKey:
|
|
3867
|
+
stepKey: Schema26.String.check(Schema26.isMinLength(1), Schema26.isMaxLength(240)),
|
|
3828
3868
|
lease: WorkUnitLease,
|
|
3829
3869
|
repoBinding: WorkUnitRepoBinding,
|
|
3830
|
-
revision:
|
|
3831
|
-
baseline:
|
|
3832
|
-
checks:
|
|
3833
|
-
measure:
|
|
3834
|
-
hosts:
|
|
3870
|
+
revision: Schema26.String.check(Schema26.isMinLength(1), Schema26.isMaxLength(240)),
|
|
3871
|
+
baseline: Schema26.optionalKey(Schema26.String.check(Schema26.isMinLength(1), Schema26.isMaxLength(300))),
|
|
3872
|
+
checks: Schema26.Array(RepositoryCheck).check(Schema26.isMaxLength(50)),
|
|
3873
|
+
measure: Schema26.optionalKey(MeasureSpec),
|
|
3874
|
+
hosts: Schema26.optionalKey(Schema26.Array(NetworkHost)),
|
|
3835
3875
|
storageOrigin: StorageOrigin
|
|
3836
3876
|
});
|
|
3837
|
-
var WorkUnit =
|
|
3838
|
-
var WorkUnitClaimResult =
|
|
3839
|
-
var WorkUnitClaimInput =
|
|
3840
|
-
teamId:
|
|
3877
|
+
var WorkUnit = Schema26.Union([OrchestrationWorkUnit, AgentStepWorkUnit, VerificationWorkUnit]);
|
|
3878
|
+
var WorkUnitClaimResult = Schema26.Struct({ workUnit: Schema26.optionalKey(WorkUnit) });
|
|
3879
|
+
var WorkUnitClaimInput = Schema26.Struct({
|
|
3880
|
+
teamId: Schema26.optionalKey(Id),
|
|
3841
3881
|
runnerReplicaId: Id,
|
|
3842
|
-
capacitySlot:
|
|
3843
|
-
idempotencyKey:
|
|
3844
|
-
leaseDurationSeconds:
|
|
3882
|
+
capacitySlot: Schema26.String.check(Schema26.isMinLength(1), Schema26.isMaxLength(240)),
|
|
3883
|
+
idempotencyKey: Schema26.String.check(Schema26.isMinLength(1), Schema26.isMaxLength(240)),
|
|
3884
|
+
leaseDurationSeconds: Schema26.optionalKey(Schema26.Int.check(Schema26.isGreaterThanOrEqualTo(1), Schema26.isLessThanOrEqualTo(3600)))
|
|
3845
3885
|
});
|
|
3846
|
-
var WorkUnitHeartbeatInput =
|
|
3886
|
+
var WorkUnitHeartbeatInput = Schema26.Struct({
|
|
3847
3887
|
workUnitId: Id,
|
|
3848
3888
|
lease: WorkUnitLeaseInput,
|
|
3849
|
-
leaseDurationSeconds:
|
|
3850
|
-
secrets:
|
|
3889
|
+
leaseDurationSeconds: Schema26.optionalKey(Schema26.Int.check(Schema26.isGreaterThanOrEqualTo(1), Schema26.isLessThanOrEqualTo(3600))),
|
|
3890
|
+
secrets: Schema26.optionalKey(Schema26.Array(Schema26.Struct({ name: SecretName2, version: Schema26.String.check(Schema26.isMinLength(1), Schema26.isMaxLength(128)) })).check(Schema26.isMaxLength(256)))
|
|
3851
3891
|
});
|
|
3852
|
-
var WorkUnitHeartbeatResult =
|
|
3853
|
-
settled:
|
|
3854
|
-
outputSubmitted:
|
|
3855
|
-
outputMerged:
|
|
3856
|
-
questionOpen:
|
|
3857
|
-
revokedSecrets:
|
|
3892
|
+
var WorkUnitHeartbeatResult = Schema26.Struct({
|
|
3893
|
+
settled: Schema26.Boolean,
|
|
3894
|
+
outputSubmitted: Schema26.optionalKey(Schema26.Boolean),
|
|
3895
|
+
outputMerged: Schema26.optionalKey(Schema26.Boolean),
|
|
3896
|
+
questionOpen: Schema26.optionalKey(Schema26.Boolean),
|
|
3897
|
+
revokedSecrets: Schema26.optionalKey(Schema26.Array(SecretName2))
|
|
3858
3898
|
});
|
|
3859
|
-
var WorkUnitReleaseInput =
|
|
3899
|
+
var WorkUnitReleaseInput = Schema26.Struct({
|
|
3860
3900
|
workUnitId: Id,
|
|
3861
3901
|
lease: WorkUnitLeaseInput,
|
|
3862
|
-
crashed:
|
|
3863
|
-
});
|
|
3864
|
-
var CheckEvidence =
|
|
3865
|
-
name:
|
|
3866
|
-
command:
|
|
3867
|
-
status:
|
|
3868
|
-
exitCode:
|
|
3869
|
-
durationMs:
|
|
3870
|
-
outputTail:
|
|
3871
|
-
fileIds:
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3902
|
+
crashed: Schema26.optionalKey(Schema26.Struct({ reason: Schema26.String.check(Schema26.isMinLength(1), Schema26.isMaxLength(500)) }))
|
|
3903
|
+
});
|
|
3904
|
+
var CheckEvidence = Schema26.Struct({
|
|
3905
|
+
name: Schema26.String.check(Schema26.isMinLength(1), Schema26.isMaxLength(120)),
|
|
3906
|
+
command: Schema26.String.check(Schema26.isMinLength(1), Schema26.isMaxLength(2000)),
|
|
3907
|
+
status: Schema26.Union([Schema26.Literal("passed"), Schema26.Literal("failed")]),
|
|
3908
|
+
exitCode: Schema26.optionalKey(Schema26.Int),
|
|
3909
|
+
durationMs: Schema26.Int.check(Schema26.isGreaterThanOrEqualTo(0)),
|
|
3910
|
+
outputTail: Schema26.String.check(Schema26.isMaxLength(8000)),
|
|
3911
|
+
fileIds: Schema26.optionalKey(Schema26.Array(Schema26.String).check(Schema26.isMaxLength(51))),
|
|
3912
|
+
tests: Schema26.optionalKey(CheckTests)
|
|
3913
|
+
});
|
|
3914
|
+
var TreeEvidence = Schema26.Struct({
|
|
3915
|
+
revision: Schema26.String.check(Schema26.isMinLength(1), Schema26.isMaxLength(240)),
|
|
3916
|
+
tree: Schema26.String.check(Schema26.isMinLength(1), Schema26.isMaxLength(120)),
|
|
3917
|
+
checks: Schema26.Array(CheckEvidence).check(Schema26.isMaxLength(50))
|
|
3918
|
+
});
|
|
3919
|
+
var VerificationEvidence = Schema26.Struct({
|
|
3879
3920
|
head: TreeEvidence,
|
|
3880
|
-
baseline:
|
|
3881
|
-
measurement:
|
|
3882
|
-
});
|
|
3883
|
-
var BoundaryChange =
|
|
3884
|
-
kind:
|
|
3885
|
-
changedPaths:
|
|
3886
|
-
omittedPaths:
|
|
3887
|
-
files:
|
|
3888
|
-
path:
|
|
3889
|
-
excerpt:
|
|
3890
|
-
redacted:
|
|
3891
|
-
truncated:
|
|
3892
|
-
})).check(
|
|
3893
|
-
truncated:
|
|
3921
|
+
baseline: Schema26.optionalKey(TreeEvidence),
|
|
3922
|
+
measurement: Schema26.optionalKey(MeasureEvidence)
|
|
3923
|
+
});
|
|
3924
|
+
var BoundaryChange = Schema26.Struct({
|
|
3925
|
+
kind: Schema26.Literal("change"),
|
|
3926
|
+
changedPaths: Schema26.Array(Schema26.String.check(Schema26.isMinLength(1), Schema26.isMaxLength(4096))).check(Schema26.isMaxLength(1000)),
|
|
3927
|
+
omittedPaths: Schema26.Int.check(Schema26.isGreaterThanOrEqualTo(0)),
|
|
3928
|
+
files: Schema26.Array(Schema26.Struct({
|
|
3929
|
+
path: Schema26.String.check(Schema26.isMinLength(1), Schema26.isMaxLength(4096)),
|
|
3930
|
+
excerpt: Schema26.String.check(Schema26.isMaxLength(250000)),
|
|
3931
|
+
redacted: Schema26.Boolean,
|
|
3932
|
+
truncated: Schema26.Boolean
|
|
3933
|
+
})).check(Schema26.isMaxLength(20)),
|
|
3934
|
+
truncated: Schema26.Boolean
|
|
3894
3935
|
});
|
|
3895
3936
|
var catchUpPathLimit = 200;
|
|
3896
|
-
var CatchUpPaths =
|
|
3897
|
-
var Revision =
|
|
3898
|
-
var CatchUp =
|
|
3937
|
+
var CatchUpPaths = Schema26.Array(Schema26.String.check(Schema26.isMinLength(1), Schema26.isMaxLength(1000))).check(Schema26.isMaxLength(catchUpPathLimit));
|
|
3938
|
+
var Revision = Schema26.String.check(Schema26.isPattern(/^[0-9a-f]{40,64}$/));
|
|
3939
|
+
var CatchUp = Schema26.Struct({
|
|
3899
3940
|
from: Revision,
|
|
3900
3941
|
head: Revision,
|
|
3901
3942
|
conflicted: CatchUpPaths,
|
|
3902
3943
|
rewritten: CatchUpPaths,
|
|
3903
3944
|
changed: CatchUpPaths,
|
|
3904
|
-
truncated:
|
|
3905
|
-
});
|
|
3906
|
-
var HarnessHold =
|
|
3907
|
-
reason:
|
|
3908
|
-
until:
|
|
3909
|
-
scope:
|
|
3910
|
-
});
|
|
3911
|
-
var StepRestart =
|
|
3912
|
-
var WorkUnitOutcome =
|
|
3913
|
-
status:
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3945
|
+
truncated: Schema26.Boolean
|
|
3946
|
+
});
|
|
3947
|
+
var HarnessHold = Schema26.Struct({
|
|
3948
|
+
reason: Schema26.Literals(HarnessHoldReasons),
|
|
3949
|
+
until: Schema26.optionalKey(Timestamp),
|
|
3950
|
+
scope: Schema26.optionalKey(Schema26.Literal("step"))
|
|
3951
|
+
});
|
|
3952
|
+
var StepRestart = Schema26.Struct({ reason: Schema26.Literal("login_revoked") });
|
|
3953
|
+
var WorkUnitOutcome = Schema26.Struct({
|
|
3954
|
+
status: Schema26.Union([
|
|
3955
|
+
Schema26.Literal("completed"),
|
|
3956
|
+
Schema26.Literal("failed"),
|
|
3957
|
+
Schema26.Literal("blocked"),
|
|
3958
|
+
Schema26.Literal("canceled")
|
|
3918
3959
|
]),
|
|
3919
|
-
result:
|
|
3920
|
-
revision:
|
|
3921
|
-
evidence:
|
|
3922
|
-
boundary:
|
|
3923
|
-
catchUp:
|
|
3924
|
-
harnessHold:
|
|
3925
|
-
restart:
|
|
3926
|
-
failureSummary:
|
|
3927
|
-
});
|
|
3928
|
-
var WorkUnitCompletion =
|
|
3960
|
+
result: Schema26.optionalKey(LoopStepOutput),
|
|
3961
|
+
revision: Schema26.optionalKey(Schema26.String.check(Schema26.isMinLength(1), Schema26.isMaxLength(120))),
|
|
3962
|
+
evidence: Schema26.optionalKey(VerificationEvidence),
|
|
3963
|
+
boundary: Schema26.optionalKey(BoundaryChange),
|
|
3964
|
+
catchUp: Schema26.optionalKey(CatchUp),
|
|
3965
|
+
harnessHold: Schema26.optionalKey(HarnessHold),
|
|
3966
|
+
restart: Schema26.optionalKey(StepRestart),
|
|
3967
|
+
failureSummary: Schema26.optionalKey(Schema26.String.check(Schema26.isMinLength(1), Schema26.isMaxLength(4000)))
|
|
3968
|
+
});
|
|
3969
|
+
var WorkUnitCompletion = Schema26.Struct({
|
|
3929
3970
|
workUnitId: Id,
|
|
3930
3971
|
lease: WorkUnitLeaseInput,
|
|
3931
|
-
idempotencyKey:
|
|
3972
|
+
idempotencyKey: Schema26.String.check(Schema26.isMinLength(1), Schema26.isMaxLength(240)),
|
|
3932
3973
|
outcome: WorkUnitOutcome
|
|
3933
3974
|
});
|
|
3934
3975
|
|
|
3935
3976
|
// packages/sdk/src/loop/measure.ts
|
|
3936
3977
|
import * as Effect7 from "effect/Effect";
|
|
3937
|
-
import * as
|
|
3978
|
+
import * as Schema27 from "effect/Schema";
|
|
3938
3979
|
import { DurableDeferred as DurableDeferred3 } from "effect/workflow";
|
|
3939
|
-
var MetricStats2 =
|
|
3940
|
-
samples:
|
|
3941
|
-
median:
|
|
3942
|
-
mean:
|
|
3943
|
-
min:
|
|
3944
|
-
max:
|
|
3945
|
-
stdev:
|
|
3946
|
-
});
|
|
3947
|
-
var MeasureVerdict2 =
|
|
3948
|
-
var Measurement2 =
|
|
3980
|
+
var MetricStats2 = Schema27.Struct({
|
|
3981
|
+
samples: Schema27.Finite,
|
|
3982
|
+
median: Schema27.Finite,
|
|
3983
|
+
mean: Schema27.Finite,
|
|
3984
|
+
min: Schema27.Finite,
|
|
3985
|
+
max: Schema27.Finite,
|
|
3986
|
+
stdev: Schema27.Finite
|
|
3987
|
+
});
|
|
3988
|
+
var MeasureVerdict2 = Schema27.Literals(["gain", "no_gain", "guardrail_regressed", "too_noisy"]);
|
|
3989
|
+
var Measurement2 = Schema27.Struct({
|
|
3949
3990
|
verdict: MeasureVerdict2,
|
|
3950
|
-
reason:
|
|
3951
|
-
metrics:
|
|
3952
|
-
name:
|
|
3953
|
-
role:
|
|
3954
|
-
direction:
|
|
3991
|
+
reason: Schema27.String,
|
|
3992
|
+
metrics: Schema27.Array(Schema27.Struct({
|
|
3993
|
+
name: Schema27.String,
|
|
3994
|
+
role: Schema27.Literals(["primary", "guardrail"]),
|
|
3995
|
+
direction: Schema27.Literals(["lower", "higher"]),
|
|
3955
3996
|
base: MetricStats2,
|
|
3956
3997
|
head: MetricStats2,
|
|
3957
|
-
change:
|
|
3958
|
-
noise:
|
|
3998
|
+
change: Schema27.Finite,
|
|
3999
|
+
noise: Schema27.Finite
|
|
3959
4000
|
})),
|
|
3960
|
-
suggestion:
|
|
4001
|
+
suggestion: Schema27.optional(Schema27.String),
|
|
3961
4002
|
evidence: MeasureEvidence
|
|
3962
4003
|
});
|
|
3963
4004
|
var measureDeferred2 = (step) => DurableDeferred3.make(`measure/${step}`, { success: MeasureEvidence, error: StepFailed2 });
|
|
@@ -4055,9 +4096,9 @@ var measure2 = (name, request) => takeStep2(name, "measure", "measure", Effect7.
|
|
|
4055
4096
|
}));
|
|
4056
4097
|
|
|
4057
4098
|
// packages/sdk/src/loop/test-loop.ts
|
|
4058
|
-
var LoopJournal2 =
|
|
4059
|
-
activities:
|
|
4060
|
-
deferreds:
|
|
4099
|
+
var LoopJournal2 = Schema28.Struct({
|
|
4100
|
+
activities: Schema28.Record(Schema28.String, Schema28.Json),
|
|
4101
|
+
deferreds: Schema28.Record(Schema28.String, Schema28.Json)
|
|
4061
4102
|
});
|
|
4062
4103
|
|
|
4063
4104
|
class ScriptedFailure2 extends Data2.TaggedClass("ScriptedFailure") {
|
|
@@ -4111,7 +4152,7 @@ var defaultActivities = {
|
|
|
4111
4152
|
draftUpdate: { run: (_, step) => Effect8.succeed({ id: `draft-${step}` }) }
|
|
4112
4153
|
};
|
|
4113
4154
|
var withoutServices = (effect) => Effect8.orDie(Effect8.provide(effect, Context3.empty()));
|
|
4114
|
-
var deferredExit = (deferred) =>
|
|
4155
|
+
var deferredExit = (deferred) => Schema28.Exit(Schema28.toCodecJson(deferred.successSchema), Schema28.toCodecJson(deferred.errorSchema), Schema28.toCodecJson(Schema28.Defect()));
|
|
4115
4156
|
var journaled = (engine, journal, ran) => ({
|
|
4116
4157
|
...engine,
|
|
4117
4158
|
activityExecute: (activity, attempt) => Effect8.gen(function* () {
|
|
@@ -4119,22 +4160,22 @@ var journaled = (engine, journal, ran) => ({
|
|
|
4119
4160
|
const recorded = journal.activities[key];
|
|
4120
4161
|
if (recorded !== undefined)
|
|
4121
4162
|
return new Workflow.Complete({
|
|
4122
|
-
exit: yield* withoutServices(
|
|
4163
|
+
exit: yield* withoutServices(Schema28.decodeEffect(Schema28.toCodecJson(activity.exitSchema))(recorded))
|
|
4123
4164
|
});
|
|
4124
4165
|
const result = yield* engine.activityExecute(activity, attempt);
|
|
4125
4166
|
if (result instanceof Workflow.Complete) {
|
|
4126
4167
|
ran.push(activity.name);
|
|
4127
|
-
journal.activities[key] = yield* withoutServices(
|
|
4168
|
+
journal.activities[key] = yield* withoutServices(Schema28.encodeEffect(Schema28.toCodecJson(activity.exitSchema))(result.exit));
|
|
4128
4169
|
}
|
|
4129
4170
|
return result;
|
|
4130
4171
|
}),
|
|
4131
4172
|
deferredResult: (deferred) => Effect8.gen(function* () {
|
|
4132
4173
|
const recorded = journal.deferreds[deferred.name];
|
|
4133
4174
|
if (recorded !== undefined)
|
|
4134
|
-
return Option2.some(yield* withoutServices(
|
|
4175
|
+
return Option2.some(yield* withoutServices(Schema28.decodeEffect(Schema28.toCodecJson(deferredExit(deferred)))(recorded)));
|
|
4135
4176
|
const result = yield* engine.deferredResult(deferred);
|
|
4136
4177
|
if (Option2.isSome(result))
|
|
4137
|
-
journal.deferreds[deferred.name] = yield* withoutServices(
|
|
4178
|
+
journal.deferreds[deferred.name] = yield* withoutServices(Schema28.encodeEffect(Schema28.toCodecJson(deferredExit(deferred)))(result.value));
|
|
4138
4179
|
return result;
|
|
4139
4180
|
})
|
|
4140
4181
|
});
|
|
@@ -4199,13 +4240,13 @@ var scriptedHost = (script, engine, agentLaunches, childLaunches, waits, verifyL
|
|
|
4199
4240
|
};
|
|
4200
4241
|
};
|
|
4201
4242
|
var loopWorkflow2 = (loop) => Workflow.make(`kitman-loop/${loop.id}`, {
|
|
4202
|
-
payload: { input:
|
|
4243
|
+
payload: { input: Schema28.Json },
|
|
4203
4244
|
idempotencyKey: () => loop.id,
|
|
4204
4245
|
success: loop.output,
|
|
4205
|
-
error:
|
|
4246
|
+
error: Schema28.declare((_error) => true)
|
|
4206
4247
|
});
|
|
4207
4248
|
var executeLoop2 = (loop, runtime) => ({ input }) => Effect8.gen(function* () {
|
|
4208
|
-
const decoded = yield*
|
|
4249
|
+
const decoded = yield* Schema28.decodeEffect(Schema28.toCodecJson(loop.input))(input).pipe(Effect8.mapError((error) => new InputInvalid2({ loop: loop.id, message: error.message })));
|
|
4209
4250
|
const run = LoopRun2.of({
|
|
4210
4251
|
loop: loop.id,
|
|
4211
4252
|
agents: loop.agents,
|
|
@@ -4253,22 +4294,22 @@ var testLoop2 = (loop, script) => {
|
|
|
4253
4294
|
}).pipe(Effect8.provide(workflow.toLayer(execute).pipe(Layer.provideMerge(WorkflowEngine.layerMemory))));
|
|
4254
4295
|
};
|
|
4255
4296
|
// packages/sdk/src/loop/review.ts
|
|
4256
|
-
import * as
|
|
4257
|
-
var Severity2 =
|
|
4258
|
-
var Finding2 =
|
|
4297
|
+
import * as Schema29 from "effect/Schema";
|
|
4298
|
+
var Severity2 = Schema29.Literals(["blocker", "major", "minor"]);
|
|
4299
|
+
var Finding2 = Schema29.Struct({
|
|
4259
4300
|
severity: Severity2,
|
|
4260
|
-
file:
|
|
4261
|
-
line:
|
|
4262
|
-
detail:
|
|
4301
|
+
file: Schema29.String,
|
|
4302
|
+
line: Schema29.Int,
|
|
4303
|
+
detail: Schema29.String
|
|
4263
4304
|
});
|
|
4264
|
-
var MergedFinding2 =
|
|
4265
|
-
id:
|
|
4305
|
+
var MergedFinding2 = Schema29.Struct({
|
|
4306
|
+
id: Schema29.String,
|
|
4266
4307
|
...Finding2.fields,
|
|
4267
|
-
seats:
|
|
4308
|
+
seats: Schema29.Array(Schema29.String)
|
|
4268
4309
|
});
|
|
4269
|
-
var Rebuttal2 =
|
|
4270
|
-
var RebuttalVerdict2 =
|
|
4271
|
-
var ScopeJudgement2 =
|
|
4310
|
+
var Rebuttal2 = Schema29.Struct({ findingId: Schema29.String, reason: Schema29.String });
|
|
4311
|
+
var RebuttalVerdict2 = Schema29.Struct({ findingId: Schema29.String, accepted: Schema29.Boolean });
|
|
4312
|
+
var ScopeJudgement2 = Schema29.Struct({ met: Schema29.Boolean, unmet: Schema29.Array(Schema29.String) });
|
|
4272
4313
|
var rank = { blocker: 0, major: 1, minor: 2 };
|
|
4273
4314
|
var isBlocking2 = (finding) => finding.severity !== "minor";
|
|
4274
4315
|
var mergeFindings2 = (bySeat) => {
|
|
@@ -4326,11 +4367,11 @@ import * as Cause2 from "effect/Cause";
|
|
|
4326
4367
|
import * as Effect9 from "effect/Effect";
|
|
4327
4368
|
import * as Exit5 from "effect/Exit";
|
|
4328
4369
|
import * as Predicate3 from "effect/Predicate";
|
|
4329
|
-
import * as
|
|
4330
|
-
class CheckFailed2 extends
|
|
4331
|
-
loop:
|
|
4332
|
-
check:
|
|
4333
|
-
reason:
|
|
4370
|
+
import * as Schema30 from "effect/Schema";
|
|
4371
|
+
class CheckFailed2 extends Schema30.TaggedError()("CheckFailed", {
|
|
4372
|
+
loop: Schema30.String,
|
|
4373
|
+
check: Schema30.String,
|
|
4374
|
+
reason: Schema30.String
|
|
4334
4375
|
}) {
|
|
4335
4376
|
get detail() {
|
|
4336
4377
|
return `Check "${this.check}": ${this.reason}`;
|
|
@@ -4340,10 +4381,10 @@ class CheckFailed2 extends Schema29.TaggedError()("CheckFailed", {
|
|
|
4340
4381
|
}
|
|
4341
4382
|
}
|
|
4342
4383
|
|
|
4343
|
-
class StepNamedTwice2 extends
|
|
4344
|
-
loop:
|
|
4345
|
-
check:
|
|
4346
|
-
step:
|
|
4384
|
+
class StepNamedTwice2 extends Schema30.TaggedError()("StepNamedTwice", {
|
|
4385
|
+
loop: Schema30.String,
|
|
4386
|
+
check: Schema30.String,
|
|
4387
|
+
step: Schema30.String
|
|
4347
4388
|
}) {
|
|
4348
4389
|
get detail() {
|
|
4349
4390
|
return `Check "${this.check}": Step "${this.step}" is named twice`;
|
|
@@ -4353,12 +4394,12 @@ class StepNamedTwice2 extends Schema29.TaggedError()("StepNamedTwice", {
|
|
|
4353
4394
|
}
|
|
4354
4395
|
}
|
|
4355
4396
|
|
|
4356
|
-
class ReplayDiverged2 extends
|
|
4357
|
-
loop:
|
|
4358
|
-
check:
|
|
4359
|
-
first:
|
|
4360
|
-
replay:
|
|
4361
|
-
rerun:
|
|
4397
|
+
class ReplayDiverged2 extends Schema30.TaggedError()("ReplayDiverged", {
|
|
4398
|
+
loop: Schema30.String,
|
|
4399
|
+
check: Schema30.String,
|
|
4400
|
+
first: Schema30.Array(Schema30.String),
|
|
4401
|
+
replay: Schema30.Array(Schema30.String),
|
|
4402
|
+
rerun: Schema30.Array(Schema30.String)
|
|
4362
4403
|
}) {
|
|
4363
4404
|
get detail() {
|
|
4364
4405
|
const steps = (names) => names.join(", ") || "no Steps";
|
|
@@ -4368,7 +4409,7 @@ class ReplayDiverged2 extends Schema29.TaggedError()("ReplayDiverged", {
|
|
|
4368
4409
|
return `Loop "${this.loop}": ${this.detail}`;
|
|
4369
4410
|
}
|
|
4370
4411
|
}
|
|
4371
|
-
var LoopCheckError2 =
|
|
4412
|
+
var LoopCheckError2 = Schema30.Union([CheckFailed2, StepNamedTwice2, ReplayDiverged2]);
|
|
4372
4413
|
var checkLoop2 = (loop, check) => Effect9.gen(function* () {
|
|
4373
4414
|
const first = yield* testLoop2(loop, check.script);
|
|
4374
4415
|
if (Exit5.isFailure(first.result)) {
|
|
@@ -4395,21 +4436,21 @@ var checkLoop2 = (loop, check) => Effect9.gen(function* () {
|
|
|
4395
4436
|
// packages/sdk/src/loop/config.ts
|
|
4396
4437
|
var defineKit2 = (config) => ({ ...config, loops: config.loops ?? [] });
|
|
4397
4438
|
// packages/sdk/src/loop/sync.ts
|
|
4398
|
-
import * as
|
|
4399
|
-
var UpToDate =
|
|
4400
|
-
var Conflict =
|
|
4401
|
-
status:
|
|
4402
|
-
files:
|
|
4403
|
-
reason:
|
|
4439
|
+
import * as Schema31 from "effect/Schema";
|
|
4440
|
+
var UpToDate = Schema31.Struct({ status: Schema31.Literal("up_to_date") });
|
|
4441
|
+
var Conflict = Schema31.Struct({
|
|
4442
|
+
status: Schema31.Literal("conflict"),
|
|
4443
|
+
files: Schema31.NonEmptyArray(Schema31.String),
|
|
4444
|
+
reason: Schema31.String
|
|
4404
4445
|
});
|
|
4405
4446
|
var merged = {
|
|
4406
|
-
status:
|
|
4407
|
-
settled:
|
|
4447
|
+
status: Schema31.Literal("merged"),
|
|
4448
|
+
settled: Schema31.Array(Schema31.String)
|
|
4408
4449
|
};
|
|
4409
|
-
var SyncAnswer =
|
|
4410
|
-
var BaseSync2 =
|
|
4450
|
+
var SyncAnswer = Schema31.Union([UpToDate, Schema31.Struct(merged), Conflict]);
|
|
4451
|
+
var BaseSync2 = Schema31.Union([
|
|
4411
4452
|
UpToDate,
|
|
4412
|
-
|
|
4453
|
+
Schema31.Struct({ ...merged, catchUp: Schema31.optionalKey(CatchUp) }),
|
|
4413
4454
|
Conflict
|
|
4414
4455
|
]);
|
|
4415
4456
|
var afterMerge = "One thing comes before any answer of merged, a clean merge included, and stopping above means stopping after it: before you answer merged, do what the repository's agent instructions say to do once the target branch is merged in, such as regenerating this branch's database migrations on top of the target's. Leave what that changes in the workspace: Kitman commits it.";
|
|
@@ -4430,17 +4471,17 @@ var syncBase2 = (name, options) => agentWorkAs2(syncDeferred2, name, {
|
|
|
4430
4471
|
mergeTarget: options.target ?? "HEAD"
|
|
4431
4472
|
});
|
|
4432
4473
|
// packages/sdk/src/loop/continuing.ts
|
|
4433
|
-
import * as
|
|
4434
|
-
var Continuing2 =
|
|
4435
|
-
changeRequestId:
|
|
4436
|
-
number:
|
|
4437
|
-
url:
|
|
4438
|
-
branch:
|
|
4439
|
-
targetBranch:
|
|
4440
|
-
revision:
|
|
4441
|
-
lastRunId:
|
|
4442
|
-
lastRunStatus:
|
|
4443
|
-
lastRunSummary:
|
|
4474
|
+
import * as Schema32 from "effect/Schema";
|
|
4475
|
+
var Continuing2 = Schema32.Struct({
|
|
4476
|
+
changeRequestId: Schema32.String,
|
|
4477
|
+
number: Schema32.String,
|
|
4478
|
+
url: Schema32.String,
|
|
4479
|
+
branch: Schema32.String,
|
|
4480
|
+
targetBranch: Schema32.String,
|
|
4481
|
+
revision: Schema32.optional(Schema32.String),
|
|
4482
|
+
lastRunId: Schema32.optional(Schema32.String),
|
|
4483
|
+
lastRunStatus: Schema32.optional(Schema32.String),
|
|
4484
|
+
lastRunSummary: Schema32.optional(Schema32.String)
|
|
4444
4485
|
});
|
|
4445
4486
|
var continuingBrief2 = (continuing) => [
|
|
4446
4487
|
`This continues the work on ${continuing.branch}, whose ChangeRequest is ${continuing.url}. Build on what is there; do not start over.`,
|
|
@@ -4453,4 +4494,4 @@ var continuingBrief2 = (continuing) => [
|
|
|
4453
4494
|
"The ChangeRequest's description lists what was left unsettled; settle those first."
|
|
4454
4495
|
].join(`
|
|
4455
4496
|
`);
|
|
4456
|
-
export { Numeric, isWholeNumber, guard, Id, Timestamp, canonicalJson, KitDigest, LoopCapabilities2, LoopManifest, AgentDeclaration, KitDeclarations, LoopOutcome2, capabilitiesOf2, defineLoop2, ManifestInvalid2, jsonSchemaOf2, loopManifest2, questionAdvice, EvidenceCheck2, VerifyResult2, OutcomeTable2, failsOn2, evidenceGate2, StepFailed2, OutputInvalid2, QuestionRefused2, WaitTimedOut2, ChangeRequestClosed2, ChildFailed2, CapabilityDenied2, DuplicateStep2, InputInvalid2, LoopEvent2, LoopRun2, LoopHost2, agentDeferredNamed2, agentWorkDeferred2, syncDeferred2, answerDeferred2, childDeferred2, eventDeferred2, verifyDeferred2, takeStep2, launch2, agentWork2, agentWorkAs2, agentWorkOnce2, ask2, call2, waitFor2, verify2, suggestVerification2, PlanTicket2, PlanTickets2, BlockingCycle2, planWaves2, ChangeRequestRequest2, ChangeRequestResult2, WriteBackMilestones2, WriteBackRequest2, RunFile2, FileRequest2, ArtifactRequest2, ArtifactResult2, NoteRequest2, CreateTasksRequest2, CreateTasksResult2, AlertTaskRequest2, AlertTaskResult2, IntegrationBranchRequest2, IntegrationBranch2, MergeChangeRequestRequest2, MergeResult2, ApproveChangeRequestRequest2, ApproveChangeRequestResult2, CloseChangeRequestRequest2, CloseChangeRequestResult2, RerunPipelineRequest2, RerunPipelineResult2, ReportPipelineRequest2, ReportPipelineResult2, CommentRequest2, ReleaseRequest2, ReleaseResult2, ChangeRequestReadRequest2, PipelineJob2, PipelineStatus2, ReviewThread2, ReviewThreads2, OpenChangeRequestsRequest2, OpenChangeRequest2, OpenChangeRequests2, OwnChangeRequest2, OwnChangeRequests2, TranscriptPoint2, TranscriptsRequest2, TranscriptsResult2, ProposeRequest2, ProposeResult2, ProjectActivityRequest2, ProjectActivityResult2, DraftUpdateRequest2, DraftUpdateResult2, ChangeRequestActivity2, WriteBackActivity2, ArtifactActivity2, FileActivity2, NoteActivity2, CommentActivity2, CreateTasksActivity2, AlertTaskActivity2, IntegrationBranchActivity2, MergeChangeRequestActivity2, ReleaseActivity2, TranscriptsActivity2, ProposeActivity2, ProjectActivityActivity2, DraftUpdateActivity2, ChangeRequestReadActivity2, changeRequest2, writeBack2, artifact2, file2, note2, comment2, createTasks2, alertTask2, integrationBranch2, mergeChangeRequest2, approveChangeRequest2, closeChangeRequest2, pipelineMoved2, rerunPipeline2, reportPipeline2, release2, transcripts2, propose2, projectActivity2, pipelineStatus2, reviewThreads2, openChangeRequests2, ownChangeRequests2, draftUpdate2, ResourceName, ClaimResult2, claimDeferred2, letGoDeferred2, claim2, letGo2, WorkUnitRepoBinding, ProgramWorkUnit, CheckName2, ApprovedCheck, MeasurePlan2, WorkUnitClaimResult, WorkUnitClaimInput, WorkUnitHeartbeatInput, WorkUnitHeartbeatResult, WorkUnitReleaseInput, WorkUnitCompletion, MetricStats2, MeasureVerdict2, Measurement2, measureDeferred2, noiseFloor2, judgeMeasurement2, measure2, LoopJournal2, ScriptedFailure2, scriptedFailure2, loopWorkflow2, executeLoop2, testLoop2, Severity2, Finding2, MergedFinding2, Rebuttal2, RebuttalVerdict2, ScopeJudgement2, isBlocking2, mergeFindings2, splitDisputed2, settleRound2, rallyStop2, CheckFailed2, StepNamedTwice2, ReplayDiverged2, LoopCheckError2, checkLoop2, defineKit2, BaseSync2, syncBase2, Continuing2, continuingBrief2 };
|
|
4497
|
+
export { Numeric, isWholeNumber, guard, Id, Timestamp, canonicalJson, KitDigest, LoopCapabilities2, LoopManifest, AgentDeclaration, KitDeclarations, LoopOutcome2, capabilitiesOf2, defineLoop2, ManifestInvalid2, jsonSchemaOf2, loopManifest2, questionAdvice, EvidenceCheck2, VerifyResult2, OutcomeTable2, failsOn2, testsNotRunReasons2, evidenceGate2, StepFailed2, OutputInvalid2, QuestionRefused2, WaitTimedOut2, ChangeRequestClosed2, ChildFailed2, CapabilityDenied2, DuplicateStep2, InputInvalid2, LoopEvent2, LoopRun2, LoopHost2, agentDeferredNamed2, agentWorkDeferred2, syncDeferred2, answerDeferred2, childDeferred2, eventDeferred2, verifyDeferred2, takeStep2, launch2, agentWork2, agentWorkAs2, agentWorkOnce2, ask2, call2, waitFor2, verify2, suggestVerification2, PlanTicket2, PlanTickets2, BlockingCycle2, planWaves2, ChangeRequestRequest2, ChangeRequestResult2, WriteBackMilestones2, WriteBackRequest2, RunFile2, FileRequest2, ArtifactRequest2, ArtifactResult2, NoteRequest2, CreateTasksRequest2, CreateTasksResult2, AlertTaskRequest2, AlertTaskResult2, IntegrationBranchRequest2, IntegrationBranch2, MergeChangeRequestRequest2, MergeResult2, ApproveChangeRequestRequest2, ApproveChangeRequestResult2, CloseChangeRequestRequest2, CloseChangeRequestResult2, RerunPipelineRequest2, RerunPipelineResult2, ReportPipelineRequest2, ReportPipelineResult2, CommentRequest2, ReleaseRequest2, ReleaseResult2, ChangeRequestReadRequest2, PipelineJob2, PipelineStatus2, ReviewThread2, ReviewThreads2, OpenChangeRequestsRequest2, OpenChangeRequest2, OpenChangeRequests2, OwnChangeRequest2, OwnChangeRequests2, TranscriptPoint2, TranscriptsRequest2, TranscriptsResult2, ProposeRequest2, ProposeResult2, ProjectActivityRequest2, ProjectActivityResult2, DraftUpdateRequest2, DraftUpdateResult2, ChangeRequestActivity2, WriteBackActivity2, ArtifactActivity2, FileActivity2, NoteActivity2, CommentActivity2, CreateTasksActivity2, AlertTaskActivity2, IntegrationBranchActivity2, MergeChangeRequestActivity2, ReleaseActivity2, TranscriptsActivity2, ProposeActivity2, ProjectActivityActivity2, DraftUpdateActivity2, ChangeRequestReadActivity2, changeRequest2, writeBack2, artifact2, file2, note2, comment2, createTasks2, alertTask2, integrationBranch2, mergeChangeRequest2, approveChangeRequest2, closeChangeRequest2, pipelineMoved2, rerunPipeline2, reportPipeline2, release2, transcripts2, propose2, projectActivity2, pipelineStatus2, reviewThreads2, openChangeRequests2, ownChangeRequests2, draftUpdate2, ResourceName, ClaimResult2, claimDeferred2, letGoDeferred2, claim2, letGo2, WorkUnitRepoBinding, ProgramWorkUnit, CheckName2, ApprovedCheck, MeasurePlan2, WorkUnitClaimResult, WorkUnitClaimInput, WorkUnitHeartbeatInput, WorkUnitHeartbeatResult, WorkUnitReleaseInput, WorkUnitCompletion, MetricStats2, MeasureVerdict2, Measurement2, measureDeferred2, noiseFloor2, judgeMeasurement2, measure2, LoopJournal2, ScriptedFailure2, scriptedFailure2, loopWorkflow2, executeLoop2, testLoop2, Severity2, Finding2, MergedFinding2, Rebuttal2, RebuttalVerdict2, ScopeJudgement2, isBlocking2, mergeFindings2, splitDisputed2, settleRound2, rallyStop2, CheckFailed2, StepNamedTwice2, ReplayDiverged2, LoopCheckError2, checkLoop2, defineKit2, BaseSync2, syncBase2, Continuing2, continuingBrief2 };
|