devcontour-harness 0.1.0-alpha.37 → 0.1.0-alpha.44
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/README.md +56 -2
- package/docs/architecture.md +64 -5
- package/docs/contracts.md +45 -22
- package/docs/release-notes/0.1.0-alpha.38.md +31 -0
- package/docs/release-notes/0.1.0-alpha.39.md +38 -0
- package/docs/release-notes/0.1.0-alpha.40.md +27 -0
- package/docs/release-notes/0.1.0-alpha.41.md +49 -0
- package/docs/release-notes/0.1.0-alpha.42.md +44 -0
- package/docs/release-notes/0.1.0-alpha.43.md +40 -0
- package/docs/release-notes/0.1.0-alpha.44.md +44 -0
- package/docs/upgrade.md +197 -17
- package/lib/agents/review-probe.d.ts +3 -1
- package/lib/agents/review-probe.js +8 -4
- package/lib/contracts/cli.d.ts +48 -4
- package/lib/contracts/events.d.ts +60 -5
- package/lib/contracts/events.js +16 -1
- package/lib/contracts/execution.d.ts +37 -0
- package/lib/contracts/execution.js +24 -3
- package/lib/contracts/policy.d.ts +19 -0
- package/lib/contracts/policy.js +30 -0
- package/lib/contracts/published.d.ts +29 -2
- package/lib/contracts/report.d.ts +8 -0
- package/lib/contracts/report.js +7 -1
- package/lib/contracts/result.d.ts +2 -0
- package/lib/contracts/result.js +6 -0
- package/lib/control/harness.d.ts +5 -0
- package/lib/engine/engine.d.ts +36 -3
- package/lib/engine/engine.js +140 -21
- package/lib/engine/joint-runner.d.ts +2 -0
- package/lib/engine/joint-runner.js +14 -4
- package/lib/engine/runner.d.ts +11 -0
- package/lib/engine/runner.js +82 -13
- package/lib/environment/isolation.d.ts +41 -1
- package/lib/environment/isolation.js +203 -7
- package/lib/environment/lifecycle.d.ts +46 -2
- package/lib/environment/lifecycle.js +81 -2
- package/lib/report/compute.js +19 -6
- package/lib/report/document.js +3 -3
- package/lib/storage/document.d.ts +2 -0
- package/lib/testing/store-contract.d.ts +8 -2
- package/lib/testing/store-contract.js +56 -1
- package/lib/verification/confirm.js +6 -4
- package/lib/verification/gates-at.js +3 -1
- package/lib/verification/gates.d.ts +36 -2
- package/lib/verification/gates.js +71 -11
- package/lib/verification/joint.d.ts +179 -1
- package/lib/verification/joint.js +23 -3
- package/package.json +1 -1
- package/schemas/execution-document.schema.json +4 -0
- package/schemas/execution-policy.schema.json +5 -0
- package/schemas/joint-verification.schema.json +4 -0
- package/schemas/run-event.schema.json +96 -0
- package/schemas/value-report.schema.json +20 -0
|
@@ -474,6 +474,21 @@ export declare const eventPayloads: {
|
|
|
474
474
|
}>;
|
|
475
475
|
manifestDigest: z.ZodOptional<z.ZodString>;
|
|
476
476
|
error: z.ZodOptional<z.ZodString>;
|
|
477
|
+
interrupted: z.ZodOptional<z.ZodLiteral<true>>;
|
|
478
|
+
}, z.core.$strict>;
|
|
479
|
+
/**
|
|
480
|
+
* Явный сброс бюджета совместных проверок набора: `settled` завершённых
|
|
481
|
+
* проверок больше не тратят его предел. Текст причины — в записи сброса.
|
|
482
|
+
*/
|
|
483
|
+
readonly 'joint.budget-reset': z.ZodObject<{
|
|
484
|
+
resetId: z.ZodString;
|
|
485
|
+
workIds: z.ZodArray<z.ZodString>;
|
|
486
|
+
by: z.ZodEnum<{
|
|
487
|
+
operator: "operator";
|
|
488
|
+
host: "host";
|
|
489
|
+
}>;
|
|
490
|
+
settled: z.ZodNumber;
|
|
491
|
+
reasonLength: z.ZodNumber;
|
|
477
492
|
}, z.core.$strict>;
|
|
478
493
|
/** Политика стала применённой: запуском процесса или операцией reconfigure. */
|
|
479
494
|
readonly 'policy.applied': z.ZodObject<{
|
|
@@ -654,7 +669,7 @@ export declare const runEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
654
669
|
workId: z.ZodOptional<z.ZodString>;
|
|
655
670
|
runId: z.ZodOptional<z.ZodString>;
|
|
656
671
|
attempt: z.ZodOptional<z.ZodNumber>;
|
|
657
|
-
type: z.ZodLiteral<"graph.registered" | "graph.reviewed" | "graph.approved" | "work.ready" | "work.held" | "attempt.claimed" | "attempt.phase" | "attempt.gate" | "attempt.review" | "attempt.stage" | "attempt.liveness" | "attempt.failed" | "attempt.diagnosed" | "attempt.expired" | "attempt.cancelled" | "attempt.recovered" | "work.accepted" | "work.retried" | "work.cancelled" | "work.blocked" | "control.paused" | "control.resumed" | "controller.acquired" | "base.moved" | "controller.released" | "budget.blocked" | "corpus.adopted" | "work.recovery" | "joint.started" | "joint.liveness" | "joint.finished" | "policy.applied" | "policy.reconfigure" | "input.requested" | "input.answered" | "input.applied" | "input.closed" | "input.stale" | "input.delivered" | "attempt.assumptions" | "delivery.pending" | "delivery.delivered" | "delivery.failed" | "delivery.conflict" | "delivery.uncertain">;
|
|
672
|
+
type: z.ZodLiteral<"graph.registered" | "graph.reviewed" | "graph.approved" | "work.ready" | "work.held" | "attempt.claimed" | "attempt.phase" | "attempt.gate" | "attempt.review" | "attempt.stage" | "attempt.liveness" | "attempt.failed" | "attempt.diagnosed" | "attempt.expired" | "attempt.cancelled" | "attempt.recovered" | "work.accepted" | "work.retried" | "work.cancelled" | "work.blocked" | "control.paused" | "control.resumed" | "controller.acquired" | "base.moved" | "controller.released" | "budget.blocked" | "corpus.adopted" | "work.recovery" | "joint.started" | "joint.liveness" | "joint.finished" | "joint.budget-reset" | "policy.applied" | "policy.reconfigure" | "input.requested" | "input.answered" | "input.applied" | "input.closed" | "input.stale" | "input.delivered" | "attempt.assumptions" | "delivery.pending" | "delivery.delivered" | "delivery.failed" | "delivery.conflict" | "delivery.uncertain">;
|
|
658
673
|
payload: z.ZodObject<{
|
|
659
674
|
digest: z.ZodString;
|
|
660
675
|
orders: z.ZodNumber;
|
|
@@ -1019,6 +1034,16 @@ export declare const runEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1019
1034
|
}>;
|
|
1020
1035
|
manifestDigest: z.ZodOptional<z.ZodString>;
|
|
1021
1036
|
error: z.ZodOptional<z.ZodString>;
|
|
1037
|
+
interrupted: z.ZodOptional<z.ZodLiteral<true>>;
|
|
1038
|
+
}, z.core.$strict> | z.ZodObject<{
|
|
1039
|
+
resetId: z.ZodString;
|
|
1040
|
+
workIds: z.ZodArray<z.ZodString>;
|
|
1041
|
+
by: z.ZodEnum<{
|
|
1042
|
+
operator: "operator";
|
|
1043
|
+
host: "host";
|
|
1044
|
+
}>;
|
|
1045
|
+
settled: z.ZodNumber;
|
|
1046
|
+
reasonLength: z.ZodNumber;
|
|
1022
1047
|
}, z.core.$strict> | z.ZodObject<{
|
|
1023
1048
|
digest: z.ZodString;
|
|
1024
1049
|
generation: z.ZodNumber;
|
|
@@ -1142,7 +1167,7 @@ export declare const runEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1142
1167
|
workId: z.ZodOptional<z.ZodString>;
|
|
1143
1168
|
runId: z.ZodOptional<z.ZodString>;
|
|
1144
1169
|
attempt: z.ZodOptional<z.ZodNumber>;
|
|
1145
|
-
type: z.ZodLiteral<"graph.registered" | "graph.reviewed" | "graph.approved" | "work.ready" | "work.held" | "attempt.claimed" | "attempt.phase" | "attempt.gate" | "attempt.review" | "attempt.stage" | "attempt.liveness" | "attempt.failed" | "attempt.diagnosed" | "attempt.expired" | "attempt.cancelled" | "attempt.recovered" | "work.accepted" | "work.retried" | "work.cancelled" | "work.blocked" | "control.paused" | "control.resumed" | "controller.acquired" | "base.moved" | "controller.released" | "budget.blocked" | "corpus.adopted" | "work.recovery" | "joint.started" | "joint.liveness" | "joint.finished" | "policy.applied" | "policy.reconfigure" | "input.requested" | "input.answered" | "input.applied" | "input.closed" | "input.stale" | "input.delivered" | "attempt.assumptions" | "delivery.pending" | "delivery.delivered" | "delivery.failed" | "delivery.conflict" | "delivery.uncertain">;
|
|
1170
|
+
type: z.ZodLiteral<"graph.registered" | "graph.reviewed" | "graph.approved" | "work.ready" | "work.held" | "attempt.claimed" | "attempt.phase" | "attempt.gate" | "attempt.review" | "attempt.stage" | "attempt.liveness" | "attempt.failed" | "attempt.diagnosed" | "attempt.expired" | "attempt.cancelled" | "attempt.recovered" | "work.accepted" | "work.retried" | "work.cancelled" | "work.blocked" | "control.paused" | "control.resumed" | "controller.acquired" | "base.moved" | "controller.released" | "budget.blocked" | "corpus.adopted" | "work.recovery" | "joint.started" | "joint.liveness" | "joint.finished" | "joint.budget-reset" | "policy.applied" | "policy.reconfigure" | "input.requested" | "input.answered" | "input.applied" | "input.closed" | "input.stale" | "input.delivered" | "attempt.assumptions" | "delivery.pending" | "delivery.delivered" | "delivery.failed" | "delivery.conflict" | "delivery.uncertain">;
|
|
1146
1171
|
payload: z.ZodObject<{
|
|
1147
1172
|
digest: z.ZodString;
|
|
1148
1173
|
orders: z.ZodNumber;
|
|
@@ -1507,6 +1532,16 @@ export declare const runEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1507
1532
|
}>;
|
|
1508
1533
|
manifestDigest: z.ZodOptional<z.ZodString>;
|
|
1509
1534
|
error: z.ZodOptional<z.ZodString>;
|
|
1535
|
+
interrupted: z.ZodOptional<z.ZodLiteral<true>>;
|
|
1536
|
+
}, z.core.$strict> | z.ZodObject<{
|
|
1537
|
+
resetId: z.ZodString;
|
|
1538
|
+
workIds: z.ZodArray<z.ZodString>;
|
|
1539
|
+
by: z.ZodEnum<{
|
|
1540
|
+
operator: "operator";
|
|
1541
|
+
host: "host";
|
|
1542
|
+
}>;
|
|
1543
|
+
settled: z.ZodNumber;
|
|
1544
|
+
reasonLength: z.ZodNumber;
|
|
1510
1545
|
}, z.core.$strict> | z.ZodObject<{
|
|
1511
1546
|
digest: z.ZodString;
|
|
1512
1547
|
generation: z.ZodNumber;
|
|
@@ -1660,7 +1695,7 @@ export declare const readRunEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1660
1695
|
workId: z.ZodOptional<z.ZodString>;
|
|
1661
1696
|
runId: z.ZodOptional<z.ZodString>;
|
|
1662
1697
|
attempt: z.ZodOptional<z.ZodNumber>;
|
|
1663
|
-
type: z.ZodLiteral<"graph.registered" | "graph.reviewed" | "graph.approved" | "work.ready" | "work.held" | "attempt.claimed" | "attempt.phase" | "attempt.gate" | "attempt.review" | "attempt.stage" | "attempt.liveness" | "attempt.failed" | "attempt.diagnosed" | "attempt.expired" | "attempt.cancelled" | "attempt.recovered" | "work.accepted" | "work.retried" | "work.cancelled" | "work.blocked" | "control.paused" | "control.resumed" | "controller.acquired" | "base.moved" | "controller.released" | "budget.blocked" | "corpus.adopted" | "work.recovery" | "joint.started" | "joint.liveness" | "joint.finished" | "policy.applied" | "policy.reconfigure" | "input.requested" | "input.answered" | "input.applied" | "input.closed" | "input.stale" | "input.delivered" | "attempt.assumptions" | "delivery.pending" | "delivery.delivered" | "delivery.failed" | "delivery.conflict" | "delivery.uncertain">;
|
|
1698
|
+
type: z.ZodLiteral<"graph.registered" | "graph.reviewed" | "graph.approved" | "work.ready" | "work.held" | "attempt.claimed" | "attempt.phase" | "attempt.gate" | "attempt.review" | "attempt.stage" | "attempt.liveness" | "attempt.failed" | "attempt.diagnosed" | "attempt.expired" | "attempt.cancelled" | "attempt.recovered" | "work.accepted" | "work.retried" | "work.cancelled" | "work.blocked" | "control.paused" | "control.resumed" | "controller.acquired" | "base.moved" | "controller.released" | "budget.blocked" | "corpus.adopted" | "work.recovery" | "joint.started" | "joint.liveness" | "joint.finished" | "joint.budget-reset" | "policy.applied" | "policy.reconfigure" | "input.requested" | "input.answered" | "input.applied" | "input.closed" | "input.stale" | "input.delivered" | "attempt.assumptions" | "delivery.pending" | "delivery.delivered" | "delivery.failed" | "delivery.conflict" | "delivery.uncertain">;
|
|
1664
1699
|
payload: z.ZodObject<{
|
|
1665
1700
|
digest: z.ZodString;
|
|
1666
1701
|
orders: z.ZodNumber;
|
|
@@ -2025,6 +2060,16 @@ export declare const readRunEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
2025
2060
|
}>;
|
|
2026
2061
|
manifestDigest: z.ZodOptional<z.ZodString>;
|
|
2027
2062
|
error: z.ZodOptional<z.ZodString>;
|
|
2063
|
+
interrupted: z.ZodOptional<z.ZodLiteral<true>>;
|
|
2064
|
+
}, z.core.$strict> | z.ZodObject<{
|
|
2065
|
+
resetId: z.ZodString;
|
|
2066
|
+
workIds: z.ZodArray<z.ZodString>;
|
|
2067
|
+
by: z.ZodEnum<{
|
|
2068
|
+
operator: "operator";
|
|
2069
|
+
host: "host";
|
|
2070
|
+
}>;
|
|
2071
|
+
settled: z.ZodNumber;
|
|
2072
|
+
reasonLength: z.ZodNumber;
|
|
2028
2073
|
}, z.core.$strict> | z.ZodObject<{
|
|
2029
2074
|
digest: z.ZodString;
|
|
2030
2075
|
generation: z.ZodNumber;
|
|
@@ -2148,7 +2193,7 @@ export declare const readRunEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
2148
2193
|
workId: z.ZodOptional<z.ZodString>;
|
|
2149
2194
|
runId: z.ZodOptional<z.ZodString>;
|
|
2150
2195
|
attempt: z.ZodOptional<z.ZodNumber>;
|
|
2151
|
-
type: z.ZodLiteral<"graph.registered" | "graph.reviewed" | "graph.approved" | "work.ready" | "work.held" | "attempt.claimed" | "attempt.phase" | "attempt.gate" | "attempt.review" | "attempt.stage" | "attempt.liveness" | "attempt.failed" | "attempt.diagnosed" | "attempt.expired" | "attempt.cancelled" | "attempt.recovered" | "work.accepted" | "work.retried" | "work.cancelled" | "work.blocked" | "control.paused" | "control.resumed" | "controller.acquired" | "base.moved" | "controller.released" | "budget.blocked" | "corpus.adopted" | "work.recovery" | "joint.started" | "joint.liveness" | "joint.finished" | "policy.applied" | "policy.reconfigure" | "input.requested" | "input.answered" | "input.applied" | "input.closed" | "input.stale" | "input.delivered" | "attempt.assumptions" | "delivery.pending" | "delivery.delivered" | "delivery.failed" | "delivery.conflict" | "delivery.uncertain">;
|
|
2196
|
+
type: z.ZodLiteral<"graph.registered" | "graph.reviewed" | "graph.approved" | "work.ready" | "work.held" | "attempt.claimed" | "attempt.phase" | "attempt.gate" | "attempt.review" | "attempt.stage" | "attempt.liveness" | "attempt.failed" | "attempt.diagnosed" | "attempt.expired" | "attempt.cancelled" | "attempt.recovered" | "work.accepted" | "work.retried" | "work.cancelled" | "work.blocked" | "control.paused" | "control.resumed" | "controller.acquired" | "base.moved" | "controller.released" | "budget.blocked" | "corpus.adopted" | "work.recovery" | "joint.started" | "joint.liveness" | "joint.finished" | "joint.budget-reset" | "policy.applied" | "policy.reconfigure" | "input.requested" | "input.answered" | "input.applied" | "input.closed" | "input.stale" | "input.delivered" | "attempt.assumptions" | "delivery.pending" | "delivery.delivered" | "delivery.failed" | "delivery.conflict" | "delivery.uncertain">;
|
|
2152
2197
|
payload: z.ZodObject<{
|
|
2153
2198
|
digest: z.ZodString;
|
|
2154
2199
|
orders: z.ZodNumber;
|
|
@@ -2513,6 +2558,16 @@ export declare const readRunEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
2513
2558
|
}>;
|
|
2514
2559
|
manifestDigest: z.ZodOptional<z.ZodString>;
|
|
2515
2560
|
error: z.ZodOptional<z.ZodString>;
|
|
2561
|
+
interrupted: z.ZodOptional<z.ZodLiteral<true>>;
|
|
2562
|
+
}, z.core.$strict> | z.ZodObject<{
|
|
2563
|
+
resetId: z.ZodString;
|
|
2564
|
+
workIds: z.ZodArray<z.ZodString>;
|
|
2565
|
+
by: z.ZodEnum<{
|
|
2566
|
+
operator: "operator";
|
|
2567
|
+
host: "host";
|
|
2568
|
+
}>;
|
|
2569
|
+
settled: z.ZodNumber;
|
|
2570
|
+
reasonLength: z.ZodNumber;
|
|
2516
2571
|
}, z.core.$strict> | z.ZodObject<{
|
|
2517
2572
|
digest: z.ZodString;
|
|
2518
2573
|
generation: z.ZodNumber;
|
|
@@ -2657,6 +2712,6 @@ export type RunEventDraft = {
|
|
|
2657
2712
|
* остановки очереди), поэтому harness использует те же имена, а не новые.
|
|
2658
2713
|
* `heartbeat` продлевает сроки и события не создаёт.
|
|
2659
2714
|
*/
|
|
2660
|
-
export declare const transactionKinds: readonly ["run.claimed", "heartbeat", "run.heartbeat-failed", "run.phase", "run.context", "run.dependencies", "run.dependency-freshness", "run.consumer-checked", "run.implementation-basis", "run.partial", "run.continuation", "run.model", "run.timing.started", "run.timing.finished", "run.liveness", "evidence.recorded", "reproduction.recorded", "findings.recorded", "task.done", "run.failed", "run.recovered", "recovery.rejected", "runs.expired", "task.retry", "task.cancelled", "task.held", "task.released", "task.hold-transferred", "wait.started", "wait.cleared", "recovery.reserved", "recovery.decided", "recovery.applied", "recovery.interrupted", "scheduler.started", "scheduler.paused", "scheduler.released", "scheduler.error", "scheduler.blockers", "config.started", "config.reconfigured", "config.reconfigure-requested", "config.reconfigure-cleared", "graph.registered", "graph.reviewed", "graph.approved", "delivery.recorded", "workspace.verification.started", "workspace.manifest", "workspace.evidence", "workspace.verified", "workspace.failed", "workspace.liveness", "base.moved", "workflow.updated", "usage.recorded", "checks.recorded", "checks.adopted", "checks.awaiting-operator", "checks.adoption-abandoned", "checks.spike", "input.answered", "input.applied", "input.closed", "input.delivered"];
|
|
2715
|
+
export declare const transactionKinds: readonly ["run.claimed", "heartbeat", "run.heartbeat-failed", "run.phase", "run.context", "run.dependencies", "run.dependency-freshness", "run.consumer-checked", "run.implementation-basis", "run.partial", "run.continuation", "run.model", "run.timing.started", "run.timing.finished", "run.liveness", "evidence.recorded", "reproduction.recorded", "findings.recorded", "task.done", "run.failed", "run.recovered", "recovery.rejected", "runs.expired", "task.retry", "task.cancelled", "task.held", "task.released", "task.hold-transferred", "wait.started", "wait.cleared", "recovery.reserved", "recovery.decided", "recovery.applied", "recovery.interrupted", "scheduler.started", "scheduler.paused", "scheduler.released", "scheduler.error", "scheduler.blockers", "config.started", "config.reconfigured", "config.reconfigure-requested", "config.reconfigure-cleared", "graph.registered", "graph.reviewed", "graph.approved", "delivery.recorded", "workspace.verification.started", "workspace.manifest", "workspace.evidence", "workspace.verified", "workspace.failed", "workspace.liveness", "workspace.budget-reset", "base.moved", "workflow.updated", "usage.recorded", "checks.recorded", "checks.adopted", "checks.awaiting-operator", "checks.adoption-abandoned", "checks.spike", "input.answered", "input.applied", "input.closed", "input.delivered"];
|
|
2661
2716
|
export type TransactionKind = (typeof transactionKinds)[number];
|
|
2662
2717
|
export {};
|
package/lib/contracts/events.js
CHANGED
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { API_VERSION } from "./version.js";
|
|
3
3
|
import { digestSchema, gitShaSchema, idSchema, isoTimeSchema, runtimeNameSchema, } from "./primitives.js";
|
|
4
4
|
import { sourceRefSchema } from "./work.js";
|
|
5
|
-
import { activitySchema, failureKindSchema, livenessStateSchema, stallActionSchema, workStatusSchema, } from "./execution.js";
|
|
5
|
+
import { activitySchema, failureKindSchema, jointResetActors, livenessStateSchema, stallActionSchema, workStatusSchema, } from "./execution.js";
|
|
6
6
|
import { inputFloorSchema, inputRequestSchema } from "./input.js";
|
|
7
7
|
const inputRequestId = inputRequestSchema.shape.id;
|
|
8
8
|
const sha = gitShaSchema;
|
|
@@ -262,6 +262,19 @@ export const eventPayloads = {
|
|
|
262
262
|
status: z.enum(['passed', 'failed']),
|
|
263
263
|
manifestDigest: digestSchema.optional(),
|
|
264
264
|
error: text.optional(),
|
|
265
|
+
/** Прервана до результата gates (остановка, потеря владения): предел не тратит. */
|
|
266
|
+
interrupted: z.literal(true).optional(),
|
|
267
|
+
}),
|
|
268
|
+
/**
|
|
269
|
+
* Явный сброс бюджета совместных проверок набора: `settled` завершённых
|
|
270
|
+
* проверок больше не тратят его предел. Текст причины — в записи сброса.
|
|
271
|
+
*/
|
|
272
|
+
'joint.budget-reset': z.strictObject({
|
|
273
|
+
resetId: z.string().min(1).max(200),
|
|
274
|
+
workIds: z.array(idSchema).max(500),
|
|
275
|
+
by: z.enum(jointResetActors),
|
|
276
|
+
settled: z.number().int().min(0),
|
|
277
|
+
reasonLength: z.number().int().min(0),
|
|
265
278
|
}),
|
|
266
279
|
/** Политика стала применённой: запуском процесса или операцией reconfigure. */
|
|
267
280
|
'policy.applied': z.strictObject({
|
|
@@ -464,6 +477,8 @@ export const transactionKinds = [
|
|
|
464
477
|
'workspace.verified',
|
|
465
478
|
'workspace.failed',
|
|
466
479
|
'workspace.liveness',
|
|
480
|
+
/** Явный сброс бюджета совместных проверок набора (`joint.budget-reset`). */
|
|
481
|
+
'workspace.budget-reset',
|
|
467
482
|
/**
|
|
468
483
|
* Сдвиг ref базы внутри транзакции проверки владения: проверка, синхронный
|
|
469
484
|
* `git update-ref` и событие `base.moved`; записей нет.
|
|
@@ -2094,6 +2094,26 @@ export declare const reproductionRegistrySchema: z.ZodObject<{
|
|
|
2094
2094
|
}, z.core.$strict>>;
|
|
2095
2095
|
}, z.core.$strict>;
|
|
2096
2096
|
export declare const MAX_REPRODUCTIONS = 500;
|
|
2097
|
+
/** Кто сбросил бюджет совместных проверок (`joint.budget-reset`). */
|
|
2098
|
+
export declare const jointResetActors: readonly ["operator", "host"];
|
|
2099
|
+
export type JointResetActor = (typeof jointResetActors)[number];
|
|
2100
|
+
/**
|
|
2101
|
+
* Явный сброс бюджета совместных проверок набора (`engine.jointBudgetReset`):
|
|
2102
|
+
* завершённые к этому моменту проверки набора больше не тратят его предел.
|
|
2103
|
+
* Граница — снимок ID этих проверок, а не время: откат часов её не сдвигает.
|
|
2104
|
+
*/
|
|
2105
|
+
export declare const jointBudgetResetSchema: z.ZodObject<{
|
|
2106
|
+
id: z.ZodString;
|
|
2107
|
+
at: z.ZodISODateTime;
|
|
2108
|
+
workIds: z.ZodArray<z.ZodString>;
|
|
2109
|
+
reason: z.ZodString;
|
|
2110
|
+
actor: z.ZodEnum<{
|
|
2111
|
+
operator: "operator";
|
|
2112
|
+
host: "host";
|
|
2113
|
+
}>;
|
|
2114
|
+
settledVerificationIds: z.ZodArray<z.ZodString>;
|
|
2115
|
+
}, z.core.$strict>;
|
|
2116
|
+
export type JointBudgetReset = z.infer<typeof jointBudgetResetSchema>;
|
|
2097
2117
|
export declare const localSchemas: {
|
|
2098
2118
|
/** Учёт вызовов моделей. */
|
|
2099
2119
|
readonly usage: z.ZodObject<{
|
|
@@ -2808,6 +2828,21 @@ export declare const localSchemas: {
|
|
|
2808
2828
|
normalized: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2809
2829
|
version: z.ZodNumber;
|
|
2810
2830
|
}, z.core.$strict>;
|
|
2831
|
+
/**
|
|
2832
|
+
* Явные сбросы бюджета совместных проверок (`JointBudgetReset`) по ID сброса,
|
|
2833
|
+
* у `@workspace`. Пишет только `engine.jointBudgetReset`.
|
|
2834
|
+
*/
|
|
2835
|
+
readonly 'joint-budget-resets': z.ZodObject<{
|
|
2836
|
+
id: z.ZodString;
|
|
2837
|
+
at: z.ZodISODateTime;
|
|
2838
|
+
workIds: z.ZodArray<z.ZodString>;
|
|
2839
|
+
reason: z.ZodString;
|
|
2840
|
+
actor: z.ZodEnum<{
|
|
2841
|
+
operator: "operator";
|
|
2842
|
+
host: "host";
|
|
2843
|
+
}>;
|
|
2844
|
+
settledVerificationIds: z.ZodArray<z.ZodString>;
|
|
2845
|
+
}, z.core.$strict>;
|
|
2811
2846
|
};
|
|
2812
2847
|
export type LocalNamespace = keyof typeof localSchemas;
|
|
2813
2848
|
export type LocalValue<N extends LocalNamespace> = z.infer<(typeof localSchemas)[N]>;
|
|
@@ -2889,6 +2924,7 @@ export declare const jointVerificationStateSchema: z.ZodDiscriminatedUnion<[z.Zo
|
|
|
2889
2924
|
}, z.core.$strict>>>;
|
|
2890
2925
|
manifestDigest: z.ZodOptional<z.ZodString>;
|
|
2891
2926
|
error: z.ZodString;
|
|
2927
|
+
interrupted: z.ZodOptional<z.ZodLiteral<true>>;
|
|
2892
2928
|
apiVersion: z.ZodLiteral<"devcontour-harness/v1alpha1">;
|
|
2893
2929
|
id: z.ZodString;
|
|
2894
2930
|
startedAt: z.ZodISODateTime;
|
|
@@ -3962,6 +3998,7 @@ export declare const executionDocumentSchema: z.ZodObject<{
|
|
|
3962
3998
|
}, z.core.$strict>>>;
|
|
3963
3999
|
manifestDigest: z.ZodOptional<z.ZodString>;
|
|
3964
4000
|
error: z.ZodString;
|
|
4001
|
+
interrupted: z.ZodOptional<z.ZodLiteral<true>>;
|
|
3965
4002
|
apiVersion: z.ZodLiteral<"devcontour-harness/v1alpha1">;
|
|
3966
4003
|
id: z.ZodString;
|
|
3967
4004
|
startedAt: z.ZodISODateTime;
|
|
@@ -303,9 +303,10 @@ export const evidenceRecordSchema = z.strictObject({
|
|
|
303
303
|
/** Проверка потребителя: компонент, в дереве которого она выполнена. */
|
|
304
304
|
consumer: idSchema.optional(),
|
|
305
305
|
/**
|
|
306
|
-
* Повтор провала gate
|
|
307
|
-
*
|
|
308
|
-
* —
|
|
306
|
+
* Повтор провала gate на том же SHA — интеграции (провал при зелёном
|
|
307
|
+
* кандидате) или кандидата (таймаут под высокой нагрузкой хоста), не больше
|
|
308
|
+
* одного на фазу попытки: `of` — ID повторённой записи; `flaky` — повтор
|
|
309
|
+
* прошёл (первый провал вызван средой), `confirmed` — провал подтвердился.
|
|
309
310
|
*/
|
|
310
311
|
recheck: z
|
|
311
312
|
.strictObject({
|
|
@@ -1032,6 +1033,21 @@ export const reproductionRegistrySchema = z.strictObject({
|
|
|
1032
1033
|
items: z.array(reproductionRecordSchema).max(500),
|
|
1033
1034
|
});
|
|
1034
1035
|
export const MAX_REPRODUCTIONS = 500;
|
|
1036
|
+
/** Кто сбросил бюджет совместных проверок (`joint.budget-reset`). */
|
|
1037
|
+
export const jointResetActors = ['operator', 'host'];
|
|
1038
|
+
/**
|
|
1039
|
+
* Явный сброс бюджета совместных проверок набора (`engine.jointBudgetReset`):
|
|
1040
|
+
* завершённые к этому моменту проверки набора больше не тратят его предел.
|
|
1041
|
+
* Граница — снимок ID этих проверок, а не время: откат часов её не сдвигает.
|
|
1042
|
+
*/
|
|
1043
|
+
export const jointBudgetResetSchema = z.strictObject({
|
|
1044
|
+
id: z.string().min(1).max(200),
|
|
1045
|
+
at: isoTimeSchema,
|
|
1046
|
+
workIds: z.array(idSchema).min(1).max(500),
|
|
1047
|
+
reason: z.string().trim().min(1).max(2000),
|
|
1048
|
+
actor: z.enum(jointResetActors),
|
|
1049
|
+
settledVerificationIds: z.array(z.string().min(1).max(200)).min(1).max(10_000),
|
|
1050
|
+
});
|
|
1035
1051
|
export const localSchemas = {
|
|
1036
1052
|
/** Учёт вызовов моделей. */
|
|
1037
1053
|
usage: callRecordSchema,
|
|
@@ -1072,6 +1088,11 @@ export const localSchemas = {
|
|
|
1072
1088
|
* отдаёт её в списке без владельца с `owner` и `key` (`executionStoreContract`).
|
|
1073
1089
|
*/
|
|
1074
1090
|
'input-requests': inputRequestSchema,
|
|
1091
|
+
/**
|
|
1092
|
+
* Явные сбросы бюджета совместных проверок (`JointBudgetReset`) по ID сброса,
|
|
1093
|
+
* у `@workspace`. Пишет только `engine.jointBudgetReset`.
|
|
1094
|
+
*/
|
|
1095
|
+
'joint-budget-resets': jointBudgetResetSchema,
|
|
1075
1096
|
};
|
|
1076
1097
|
/* ------------------------------------------------------------------ */
|
|
1077
1098
|
/* Документ standalone */
|
|
@@ -995,6 +995,7 @@ export declare const executionPolicySchema: z.ZodObject<{
|
|
|
995
995
|
reserveMs: z.ZodDefault<z.ZodNumber>;
|
|
996
996
|
}, z.core.$strict>>;
|
|
997
997
|
reviewProtocolRetries: z.ZodOptional<z.ZodNumber>;
|
|
998
|
+
gateTimeoutFloorMs: z.ZodOptional<z.ZodNumber>;
|
|
998
999
|
stallSweep: z.ZodOptional<z.ZodObject<{
|
|
999
1000
|
intervalMs: z.ZodDefault<z.ZodNumber>;
|
|
1000
1001
|
quietMs: z.ZodDefault<z.ZodNumber>;
|
|
@@ -1145,4 +1146,22 @@ export declare const mcpEnvironment: (profile?: {
|
|
|
1145
1146
|
values: {};
|
|
1146
1147
|
secrets: {};
|
|
1147
1148
|
};
|
|
1149
|
+
/**
|
|
1150
|
+
* Действующий предел времени исполнения gate: объявленный `timeoutMs`, не
|
|
1151
|
+
* меньше `gateTimeoutFloorMs` политики, если он задан.
|
|
1152
|
+
*/
|
|
1153
|
+
export declare function gateTimeoutMs(gate: {
|
|
1154
|
+
timeoutMs: number;
|
|
1155
|
+
}, policy: {
|
|
1156
|
+
gateTimeoutFloorMs?: number | undefined;
|
|
1157
|
+
}): number;
|
|
1158
|
+
/**
|
|
1159
|
+
* Предел времени gate для текста отказа: действующий в секундах и, если его
|
|
1160
|
+
* поднял `gateTimeoutFloorMs`, объявленный.
|
|
1161
|
+
*/
|
|
1162
|
+
export declare function gateTimeoutText(gate: {
|
|
1163
|
+
timeoutMs: number;
|
|
1164
|
+
}, policy: {
|
|
1165
|
+
gateTimeoutFloorMs?: number | undefined;
|
|
1166
|
+
}): string;
|
|
1148
1167
|
export {};
|
package/lib/contracts/policy.js
CHANGED
|
@@ -282,6 +282,14 @@ export const executionPolicySchema = z.strictObject({
|
|
|
282
282
|
* digest и pins прежней политики не меняются. См. docs/review-protocol.md.
|
|
283
283
|
*/
|
|
284
284
|
reviewProtocolRetries: z.number().int().min(0).max(2).optional(),
|
|
285
|
+
/**
|
|
286
|
+
* Нижняя граница предела времени каждого исполнения gate (мс, 1000–600000):
|
|
287
|
+
* действующий предел — max(gate.timeoutMs, gateTimeoutFloorMs). Объявленный
|
|
288
|
+
* предел gate не меняется; поле защищает короткие пределы от нагрузки хоста.
|
|
289
|
+
* Нет поля — действует объявленный предел; умолчание не подставляется, и
|
|
290
|
+
* digest прежних политик не меняется.
|
|
291
|
+
*/
|
|
292
|
+
gateTimeoutFloorMs: z.number().int().min(1000).max(600_000).optional(),
|
|
285
293
|
/**
|
|
286
294
|
* Обход зависших попыток controller: каждые `intervalMs` он оценивает
|
|
287
295
|
* движение исполняющегося (вывод, команды, стадии, процессор дерева):
|
|
@@ -447,6 +455,10 @@ export function policyIssues(policy) {
|
|
|
447
455
|
const issues = [];
|
|
448
456
|
const add = (code, path, message) => issues.push({ code, path, message });
|
|
449
457
|
const repos = new Map();
|
|
458
|
+
// Нижняя граница предела gate не длиннее предела вызова: иначе одна
|
|
459
|
+
// проверка законно переживала бы весь срок вызова, который её запустил.
|
|
460
|
+
if (policy.gateTimeoutFloorMs !== undefined && policy.gateTimeoutFloorMs > policy.runTimeoutMs)
|
|
461
|
+
add('INVALID_INPUT', ['gateTimeoutFloorMs'], `gateTimeoutFloorMs (${policy.gateTimeoutFloorMs} мс) больше runTimeoutMs (${policy.runTimeoutMs} мс)`);
|
|
450
462
|
// Тариф однозначен: у модели не бывает двух тарифов на один момент.
|
|
451
463
|
const tariffs = new Set();
|
|
452
464
|
policy.prices.forEach((p, i) => {
|
|
@@ -647,3 +659,21 @@ export const mcpEnvironment = (profile) => ({
|
|
|
647
659
|
values: {},
|
|
648
660
|
secrets: {},
|
|
649
661
|
});
|
|
662
|
+
/**
|
|
663
|
+
* Действующий предел времени исполнения gate: объявленный `timeoutMs`, не
|
|
664
|
+
* меньше `gateTimeoutFloorMs` политики, если он задан.
|
|
665
|
+
*/
|
|
666
|
+
export function gateTimeoutMs(gate, policy) {
|
|
667
|
+
return Math.max(gate.timeoutMs, policy.gateTimeoutFloorMs ?? 0);
|
|
668
|
+
}
|
|
669
|
+
/**
|
|
670
|
+
* Предел времени gate для текста отказа: действующий в секундах и, если его
|
|
671
|
+
* поднял `gateTimeoutFloorMs`, объявленный.
|
|
672
|
+
*/
|
|
673
|
+
export function gateTimeoutText(gate, policy) {
|
|
674
|
+
const seconds = (ms) => `${Math.round(ms / 100) / 10} с`;
|
|
675
|
+
const effective = gateTimeoutMs(gate, policy);
|
|
676
|
+
return effective > gate.timeoutMs
|
|
677
|
+
? `предел ${seconds(effective)} (объявлен ${seconds(gate.timeoutMs)}, поднят gateTimeoutFloorMs)`
|
|
678
|
+
: `предел ${seconds(effective)}`;
|
|
679
|
+
}
|
|
@@ -613,6 +613,7 @@ export declare const publishedSchemas: {
|
|
|
613
613
|
reserveMs: z.ZodDefault<z.ZodNumber>;
|
|
614
614
|
}, z.core.$strict>>;
|
|
615
615
|
reviewProtocolRetries: z.ZodOptional<z.ZodNumber>;
|
|
616
|
+
gateTimeoutFloorMs: z.ZodOptional<z.ZodNumber>;
|
|
616
617
|
stallSweep: z.ZodOptional<z.ZodObject<{
|
|
617
618
|
intervalMs: z.ZodDefault<z.ZodNumber>;
|
|
618
619
|
quietMs: z.ZodDefault<z.ZodNumber>;
|
|
@@ -1660,7 +1661,7 @@ export declare const publishedSchemas: {
|
|
|
1660
1661
|
workId: z.ZodOptional<z.ZodString>;
|
|
1661
1662
|
runId: z.ZodOptional<z.ZodString>;
|
|
1662
1663
|
attempt: z.ZodOptional<z.ZodNumber>;
|
|
1663
|
-
type: z.ZodLiteral<"graph.registered" | "graph.reviewed" | "graph.approved" | "work.ready" | "work.held" | "attempt.claimed" | "attempt.phase" | "attempt.gate" | "attempt.review" | "attempt.stage" | "attempt.liveness" | "attempt.failed" | "attempt.diagnosed" | "attempt.expired" | "attempt.cancelled" | "attempt.recovered" | "work.accepted" | "work.retried" | "work.cancelled" | "work.blocked" | "control.paused" | "control.resumed" | "controller.acquired" | "base.moved" | "controller.released" | "budget.blocked" | "corpus.adopted" | "work.recovery" | "joint.started" | "joint.liveness" | "joint.finished" | "policy.applied" | "policy.reconfigure" | "input.requested" | "input.answered" | "input.applied" | "input.closed" | "input.stale" | "input.delivered" | "attempt.assumptions" | "delivery.pending" | "delivery.delivered" | "delivery.failed" | "delivery.conflict" | "delivery.uncertain">;
|
|
1664
|
+
type: z.ZodLiteral<"graph.registered" | "graph.reviewed" | "graph.approved" | "work.ready" | "work.held" | "attempt.claimed" | "attempt.phase" | "attempt.gate" | "attempt.review" | "attempt.stage" | "attempt.liveness" | "attempt.failed" | "attempt.diagnosed" | "attempt.expired" | "attempt.cancelled" | "attempt.recovered" | "work.accepted" | "work.retried" | "work.cancelled" | "work.blocked" | "control.paused" | "control.resumed" | "controller.acquired" | "base.moved" | "controller.released" | "budget.blocked" | "corpus.adopted" | "work.recovery" | "joint.started" | "joint.liveness" | "joint.finished" | "joint.budget-reset" | "policy.applied" | "policy.reconfigure" | "input.requested" | "input.answered" | "input.applied" | "input.closed" | "input.stale" | "input.delivered" | "attempt.assumptions" | "delivery.pending" | "delivery.delivered" | "delivery.failed" | "delivery.conflict" | "delivery.uncertain">;
|
|
1664
1665
|
payload: z.ZodObject<{
|
|
1665
1666
|
digest: z.ZodString;
|
|
1666
1667
|
orders: z.ZodNumber;
|
|
@@ -2025,6 +2026,16 @@ export declare const publishedSchemas: {
|
|
|
2025
2026
|
}>;
|
|
2026
2027
|
manifestDigest: z.ZodOptional<z.ZodString>;
|
|
2027
2028
|
error: z.ZodOptional<z.ZodString>;
|
|
2029
|
+
interrupted: z.ZodOptional<z.ZodLiteral<true>>;
|
|
2030
|
+
}, z.core.$strict> | z.ZodObject<{
|
|
2031
|
+
resetId: z.ZodString;
|
|
2032
|
+
workIds: z.ZodArray<z.ZodString>;
|
|
2033
|
+
by: z.ZodEnum<{
|
|
2034
|
+
operator: "operator";
|
|
2035
|
+
host: "host";
|
|
2036
|
+
}>;
|
|
2037
|
+
settled: z.ZodNumber;
|
|
2038
|
+
reasonLength: z.ZodNumber;
|
|
2028
2039
|
}, z.core.$strict> | z.ZodObject<{
|
|
2029
2040
|
digest: z.ZodString;
|
|
2030
2041
|
generation: z.ZodNumber;
|
|
@@ -2148,7 +2159,7 @@ export declare const publishedSchemas: {
|
|
|
2148
2159
|
workId: z.ZodOptional<z.ZodString>;
|
|
2149
2160
|
runId: z.ZodOptional<z.ZodString>;
|
|
2150
2161
|
attempt: z.ZodOptional<z.ZodNumber>;
|
|
2151
|
-
type: z.ZodLiteral<"graph.registered" | "graph.reviewed" | "graph.approved" | "work.ready" | "work.held" | "attempt.claimed" | "attempt.phase" | "attempt.gate" | "attempt.review" | "attempt.stage" | "attempt.liveness" | "attempt.failed" | "attempt.diagnosed" | "attempt.expired" | "attempt.cancelled" | "attempt.recovered" | "work.accepted" | "work.retried" | "work.cancelled" | "work.blocked" | "control.paused" | "control.resumed" | "controller.acquired" | "base.moved" | "controller.released" | "budget.blocked" | "corpus.adopted" | "work.recovery" | "joint.started" | "joint.liveness" | "joint.finished" | "policy.applied" | "policy.reconfigure" | "input.requested" | "input.answered" | "input.applied" | "input.closed" | "input.stale" | "input.delivered" | "attempt.assumptions" | "delivery.pending" | "delivery.delivered" | "delivery.failed" | "delivery.conflict" | "delivery.uncertain">;
|
|
2162
|
+
type: z.ZodLiteral<"graph.registered" | "graph.reviewed" | "graph.approved" | "work.ready" | "work.held" | "attempt.claimed" | "attempt.phase" | "attempt.gate" | "attempt.review" | "attempt.stage" | "attempt.liveness" | "attempt.failed" | "attempt.diagnosed" | "attempt.expired" | "attempt.cancelled" | "attempt.recovered" | "work.accepted" | "work.retried" | "work.cancelled" | "work.blocked" | "control.paused" | "control.resumed" | "controller.acquired" | "base.moved" | "controller.released" | "budget.blocked" | "corpus.adopted" | "work.recovery" | "joint.started" | "joint.liveness" | "joint.finished" | "joint.budget-reset" | "policy.applied" | "policy.reconfigure" | "input.requested" | "input.answered" | "input.applied" | "input.closed" | "input.stale" | "input.delivered" | "attempt.assumptions" | "delivery.pending" | "delivery.delivered" | "delivery.failed" | "delivery.conflict" | "delivery.uncertain">;
|
|
2152
2163
|
payload: z.ZodObject<{
|
|
2153
2164
|
digest: z.ZodString;
|
|
2154
2165
|
orders: z.ZodNumber;
|
|
@@ -2513,6 +2524,16 @@ export declare const publishedSchemas: {
|
|
|
2513
2524
|
}>;
|
|
2514
2525
|
manifestDigest: z.ZodOptional<z.ZodString>;
|
|
2515
2526
|
error: z.ZodOptional<z.ZodString>;
|
|
2527
|
+
interrupted: z.ZodOptional<z.ZodLiteral<true>>;
|
|
2528
|
+
}, z.core.$strict> | z.ZodObject<{
|
|
2529
|
+
resetId: z.ZodString;
|
|
2530
|
+
workIds: z.ZodArray<z.ZodString>;
|
|
2531
|
+
by: z.ZodEnum<{
|
|
2532
|
+
operator: "operator";
|
|
2533
|
+
host: "host";
|
|
2534
|
+
}>;
|
|
2535
|
+
settled: z.ZodNumber;
|
|
2536
|
+
reasonLength: z.ZodNumber;
|
|
2516
2537
|
}, z.core.$strict> | z.ZodObject<{
|
|
2517
2538
|
digest: z.ZodString;
|
|
2518
2539
|
generation: z.ZodNumber;
|
|
@@ -2752,6 +2773,7 @@ export declare const publishedSchemas: {
|
|
|
2752
2773
|
}, z.core.$strict>>>;
|
|
2753
2774
|
manifestDigest: z.ZodOptional<z.ZodString>;
|
|
2754
2775
|
error: z.ZodString;
|
|
2776
|
+
interrupted: z.ZodOptional<z.ZodLiteral<true>>;
|
|
2755
2777
|
apiVersion: z.ZodLiteral<"devcontour-harness/v1alpha1">;
|
|
2756
2778
|
id: z.ZodString;
|
|
2757
2779
|
startedAt: z.ZodISODateTime;
|
|
@@ -3817,6 +3839,7 @@ export declare const publishedSchemas: {
|
|
|
3817
3839
|
}, z.core.$strict>>>;
|
|
3818
3840
|
manifestDigest: z.ZodOptional<z.ZodString>;
|
|
3819
3841
|
error: z.ZodString;
|
|
3842
|
+
interrupted: z.ZodOptional<z.ZodLiteral<true>>;
|
|
3820
3843
|
apiVersion: z.ZodLiteral<"devcontour-harness/v1alpha1">;
|
|
3821
3844
|
id: z.ZodString;
|
|
3822
3845
|
startedAt: z.ZodISODateTime;
|
|
@@ -4636,6 +4659,10 @@ export declare const publishedSchemas: {
|
|
|
4636
4659
|
host: z.ZodNumber;
|
|
4637
4660
|
controller: z.ZodNumber;
|
|
4638
4661
|
}, z.core.$strict>;
|
|
4662
|
+
jointResets: z.ZodOptional<z.ZodObject<{
|
|
4663
|
+
operator: z.ZodNumber;
|
|
4664
|
+
host: z.ZodNumber;
|
|
4665
|
+
}, z.core.$strict>>;
|
|
4639
4666
|
baseMovesBound: z.ZodLiteral<"lower">;
|
|
4640
4667
|
gaps: z.ZodNumber;
|
|
4641
4668
|
}, z.core.$strict>>;
|
|
@@ -285,6 +285,10 @@ export declare const valueReportSchema: z.ZodObject<{
|
|
|
285
285
|
host: z.ZodNumber;
|
|
286
286
|
controller: z.ZodNumber;
|
|
287
287
|
}, z.core.$strict>;
|
|
288
|
+
jointResets: z.ZodOptional<z.ZodObject<{
|
|
289
|
+
operator: z.ZodNumber;
|
|
290
|
+
host: z.ZodNumber;
|
|
291
|
+
}, z.core.$strict>>;
|
|
288
292
|
baseMovesBound: z.ZodLiteral<"lower">;
|
|
289
293
|
gaps: z.ZodNumber;
|
|
290
294
|
}, z.core.$strict>>;
|
|
@@ -904,6 +908,10 @@ export declare const reportDataSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
904
908
|
host: z.ZodNumber;
|
|
905
909
|
controller: z.ZodNumber;
|
|
906
910
|
}, z.core.$strict>;
|
|
911
|
+
jointResets: z.ZodOptional<z.ZodObject<{
|
|
912
|
+
operator: z.ZodNumber;
|
|
913
|
+
host: z.ZodNumber;
|
|
914
|
+
}, z.core.$strict>>;
|
|
907
915
|
baseMovesBound: z.ZodLiteral<"lower">;
|
|
908
916
|
gaps: z.ZodNumber;
|
|
909
917
|
}, z.core.$strict>>;
|
package/lib/contracts/report.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { baseMoveActors, cancelActors, environmentCauses, retryActors } from "./events.js";
|
|
3
|
-
import { failureKindSchema, pauseReasons } from "./execution.js";
|
|
3
|
+
import { failureKindSchema, jointResetActors, pauseReasons } from "./execution.js";
|
|
4
4
|
import { isoTimeSchema } from "./primitives.js";
|
|
5
5
|
/**
|
|
6
6
|
* Отчёт об эффекте harness (`harness report`, `valueReport`): что дали
|
|
@@ -288,6 +288,12 @@ export const valueReportSchema = z.strictObject({
|
|
|
288
288
|
/** Отмены поручений без активной попытки (их `attempt.cancelled` нет). */
|
|
289
289
|
cancelledWithoutAttempt: count,
|
|
290
290
|
baseMoves: actorCounts(baseMoveActors),
|
|
291
|
+
/**
|
|
292
|
+
* Явные сбросы бюджета совместных проверок (`joint.budget-reset`)
|
|
293
|
+
* по актёру. Событие пишется с версии, где появился сброс: до неё
|
|
294
|
+
* сбросов не было, число точное (нет у отчётов прежних версий).
|
|
295
|
+
*/
|
|
296
|
+
jointResets: actorCounts(jointResetActors).optional(),
|
|
291
297
|
/** Сдвиги базы — всегда нижняя граница: перенос вне `fencedRefMove` не пишется. */
|
|
292
298
|
baseMovesBound: z.literal('lower'),
|
|
293
299
|
/**
|
|
@@ -1211,6 +1211,7 @@ export declare const jointFailedSchema: z.ZodObject<{
|
|
|
1211
1211
|
}, z.core.$strict>>>;
|
|
1212
1212
|
manifestDigest: z.ZodOptional<z.ZodString>;
|
|
1213
1213
|
error: z.ZodString;
|
|
1214
|
+
interrupted: z.ZodOptional<z.ZodLiteral<true>>;
|
|
1214
1215
|
apiVersion: z.ZodLiteral<"devcontour-harness/v1alpha1">;
|
|
1215
1216
|
id: z.ZodString;
|
|
1216
1217
|
startedAt: z.ZodISODateTime;
|
|
@@ -1414,6 +1415,7 @@ export declare const jointVerificationSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
1414
1415
|
}, z.core.$strict>>>;
|
|
1415
1416
|
manifestDigest: z.ZodOptional<z.ZodString>;
|
|
1416
1417
|
error: z.ZodString;
|
|
1418
|
+
interrupted: z.ZodOptional<z.ZodLiteral<true>>;
|
|
1417
1419
|
apiVersion: z.ZodLiteral<"devcontour-harness/v1alpha1">;
|
|
1418
1420
|
id: z.ZodString;
|
|
1419
1421
|
startedAt: z.ZodISODateTime;
|
package/lib/contracts/result.js
CHANGED
|
@@ -362,6 +362,12 @@ export const jointFailedSchema = z.strictObject({
|
|
|
362
362
|
manifest: jointManifestSchema.optional(),
|
|
363
363
|
manifestDigest: digestSchema.optional(),
|
|
364
364
|
error: z.string().min(1),
|
|
365
|
+
/**
|
|
366
|
+
* Проверку прервали до результата gates: остановка хоста или потеря
|
|
367
|
+
* владения. Ставится только без evidence; такая проверка не тратит предел
|
|
368
|
+
* совместных проверок набора (у прежних записей поля нет).
|
|
369
|
+
*/
|
|
370
|
+
interrupted: z.literal(true).optional(),
|
|
365
371
|
});
|
|
366
372
|
export const jointPassedSchema = z.strictObject({
|
|
367
373
|
...jointCommon,
|
package/lib/control/harness.d.ts
CHANGED
|
@@ -164,6 +164,7 @@ export declare class Harness {
|
|
|
164
164
|
tree: string;
|
|
165
165
|
}> | undefined;
|
|
166
166
|
manifestDigest?: string | undefined;
|
|
167
|
+
interrupted?: true | undefined;
|
|
167
168
|
impact?: {
|
|
168
169
|
changed: string[];
|
|
169
170
|
affected: string[];
|
|
@@ -3638,6 +3639,10 @@ export declare class Harness {
|
|
|
3638
3639
|
};
|
|
3639
3640
|
baseMovesBound: "lower";
|
|
3640
3641
|
gaps: number;
|
|
3642
|
+
jointResets?: {
|
|
3643
|
+
operator: number;
|
|
3644
|
+
host: number;
|
|
3645
|
+
} | undefined;
|
|
3641
3646
|
} | null;
|
|
3642
3647
|
};
|
|
3643
3648
|
approvals: {
|
package/lib/engine/engine.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ReproductionRecord, type AttemptState, type RunEventPayload, type CancelActor, type ContextLimit, type EnvironmentCause, type RetryActor, type Author, type CallRecord, type ContractDocument, type EvidenceRecord, type ExecutionHost, type ExecutionPolicy, type ExecutionTransaction, type ExecutionView, type FailureKind, type GraphState, type InputActor, type InputAnswer, type InputOutcome, type InputRequest, type ContextSnapshot, type JointVerification, type JointVerificationState, type NotPromise, type Prerequisite, type PropertyRecovery, type ReviewRecord, type TechnicalApproval, type TransactionKind, type WorkGraph, type WorkState } from '../contracts/index.ts';
|
|
1
|
+
import { type ReproductionRecord, type AttemptState, type RunEventPayload, type CancelActor, type ContextLimit, type EnvironmentCause, type RetryActor, type JointBudgetReset, type JointResetActor, type Author, type CallRecord, type ContractDocument, type EvidenceRecord, type ExecutionHost, type ExecutionPolicy, type ExecutionTransaction, type ExecutionView, type FailureKind, type GraphState, type InputActor, type InputAnswer, type InputOutcome, type InputRequest, type ContextSnapshot, type JointVerification, type JointVerificationState, type NotPromise, type Prerequisite, type PropertyRecovery, type ReviewRecord, type TechnicalApproval, type TransactionKind, type WorkGraph, type WorkState } from '../contracts/index.ts';
|
|
2
2
|
import { type BudgetContext, type CallMeta } from './budget.ts';
|
|
3
3
|
/** Префикс причины неудавшегося продления: первая причина не затирается следствиями. */
|
|
4
4
|
export declare const HEARTBEAT_FAILED = "\u041F\u0440\u043E\u0434\u043B\u0435\u043D\u0438\u0435 \u0432\u043B\u0430\u0434\u0435\u043D\u0438\u044F \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C";
|
|
@@ -4024,6 +4024,7 @@ export declare class Engine {
|
|
|
4024
4024
|
}[];
|
|
4025
4025
|
token: string;
|
|
4026
4026
|
leaseUntil: number;
|
|
4027
|
+
interrupted?: true | undefined;
|
|
4027
4028
|
engineVersion?: string | undefined;
|
|
4028
4029
|
} | {
|
|
4029
4030
|
manifest: Record<string, {
|
|
@@ -4178,6 +4179,7 @@ export declare class Engine {
|
|
|
4178
4179
|
tree: string;
|
|
4179
4180
|
}> | undefined;
|
|
4180
4181
|
manifestDigest?: string | undefined;
|
|
4182
|
+
interrupted?: true | undefined;
|
|
4181
4183
|
impact?: {
|
|
4182
4184
|
changed: string[];
|
|
4183
4185
|
affected: string[];
|
|
@@ -4238,8 +4240,39 @@ export declare class Engine {
|
|
|
4238
4240
|
baseline?: string | undefined;
|
|
4239
4241
|
} | undefined;
|
|
4240
4242
|
};
|
|
4241
|
-
/**
|
|
4242
|
-
|
|
4243
|
+
/**
|
|
4244
|
+
* Отказ проверки её владельцем; истёкший срок допустим, чужой токен — нет.
|
|
4245
|
+
* `interrupted` — проверку прервали остановка или потеря владения; движок
|
|
4246
|
+
* отмечает её прерванной только без evidence: результат gate тратит предел.
|
|
4247
|
+
*/
|
|
4248
|
+
jointFail(id: string, token: string, error: string, options?: {
|
|
4249
|
+
interrupted?: boolean;
|
|
4250
|
+
}): boolean;
|
|
4251
|
+
/**
|
|
4252
|
+
* Закрыть истёкшую активную проверку отказом. Владение потеряно: без
|
|
4253
|
+
* evidence проверка прервана до результата gates, с evidence — обычный отказ.
|
|
4254
|
+
*/
|
|
4255
|
+
private closeExpiredJoint;
|
|
4256
|
+
/**
|
|
4257
|
+
* Почему набор не может начать совместную проверку по бюджету, или
|
|
4258
|
+
* `undefined`. Предел тратят проверки с результатом gates и отказы до них;
|
|
4259
|
+
* прерванные до результата gates (`interrupted`) — только свой предел.
|
|
4260
|
+
*/
|
|
4261
|
+
private jointExhausted;
|
|
4262
|
+
/**
|
|
4263
|
+
* Явный сброс бюджета совместных проверок набора оператором или хостом:
|
|
4264
|
+
* только при исчерпанном пределе и без живой проверки этого набора, с
|
|
4265
|
+
* причиной. Сброс снимает только проверки набора без результата gates
|
|
4266
|
+
* (прерванные и отказы до gates, в том числе записанные прежними версиями);
|
|
4267
|
+
* проверки с evidence тратят предел и после сброса, поэтому предел,
|
|
4268
|
+
* исчерпанный ими одними, сброс не снимает. Истёкшая незакрытая проверка
|
|
4269
|
+
* набора закрывается здесь же (как в `jointStart`). Запись — в
|
|
4270
|
+
* `joint-budget-resets`, событие — `joint.budget-reset`.
|
|
4271
|
+
*/
|
|
4272
|
+
jointBudgetReset(workIds: string[], options: {
|
|
4273
|
+
reason: string;
|
|
4274
|
+
actor?: JointResetActor;
|
|
4275
|
+
}): JointBudgetReset;
|
|
4243
4276
|
/**
|
|
4244
4277
|
* Актуальный результат совместной проверки набора: последняя проверка этого
|
|
4245
4278
|
* набора, успешная, с целым manifest, под текущей политикой, на неизменном
|