devcontour-harness 0.1.0-alpha.13 → 0.1.0-alpha.18
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 +48 -2
- package/docs/architecture.md +77 -3
- package/docs/contracts.md +100 -0
- package/docs/quickstart.md +1 -1
- package/docs/release-notes/0.1.0-alpha.14.md +69 -0
- package/docs/release-notes/0.1.0-alpha.15.md +62 -0
- package/docs/release-notes/0.1.0-alpha.16.md +36 -0
- package/docs/release-notes/0.1.0-alpha.17.md +86 -0
- package/docs/release-notes/0.1.0-alpha.18.md +48 -0
- package/docs/review-probes.md +9 -3
- package/docs/review-protocol.md +9 -0
- package/docs/upgrade.md +16 -14
- package/lib/agents/cli-adapter.js +14 -10
- package/lib/agents/review-probe.d.ts +9 -0
- package/lib/agents/review-probe.js +23 -1
- package/lib/agents/schemas.d.ts +206 -0
- package/lib/agents/schemas.js +37 -1
- package/lib/agents/usage.d.ts +22 -0
- package/lib/agents/usage.js +112 -6
- package/lib/contracts/checks.d.ts +119 -0
- package/lib/contracts/checks.js +64 -1
- package/lib/contracts/cli.d.ts +30 -0
- package/lib/contracts/diagnosis.d.ts +3 -1
- package/lib/contracts/diagnosis.js +2 -0
- package/lib/contracts/events.d.ts +12 -0
- package/lib/contracts/execution.d.ts +109 -5
- package/lib/contracts/execution.js +58 -0
- package/lib/contracts/failure.d.ts +17 -3
- package/lib/contracts/failure.js +4 -2
- package/lib/contracts/published.d.ts +67 -1
- package/lib/contracts/repair-policy.d.ts +7 -0
- package/lib/contracts/repair-policy.js +17 -0
- package/lib/contracts/review.d.ts +12 -0
- package/lib/contracts/review.js +19 -0
- package/lib/control/harness.d.ts +2 -2
- package/lib/control/harness.js +2 -1
- package/lib/control/recovery.d.ts +26 -1
- package/lib/engine/engine.d.ts +41 -14
- package/lib/engine/engine.js +92 -8
- package/lib/engine/failure.d.ts +1 -1
- package/lib/engine/failure.js +1 -1
- package/lib/engine/property-recovery.d.ts +1 -0
- package/lib/engine/property-recovery.js +4 -1
- package/lib/engine/repair.d.ts +26 -0
- package/lib/engine/repair.js +83 -1
- package/lib/engine/runner.d.ts +7 -0
- package/lib/engine/runner.js +207 -34
- package/lib/explain/state.js +4 -2
- package/lib/index.d.ts +6 -4
- package/lib/index.js +6 -4
- package/lib/projections/stop.d.ts +1 -1
- package/lib/projections/stop.js +16 -0
- package/lib/storage/document.d.ts +48 -8
- package/lib/verification/acceptance.js +2 -1
- package/lib/verification/already-satisfied.d.ts +44 -0
- package/lib/verification/already-satisfied.js +49 -0
- package/lib/verification/checks.d.ts +28 -0
- package/lib/verification/checks.js +270 -22
- package/lib/verification/corpus.d.ts +50 -0
- package/lib/verification/gate-scope.d.ts +36 -0
- package/lib/verification/gate-scope.js +97 -0
- package/lib/verification/gates-at.d.ts +67 -0
- package/lib/verification/gates-at.js +173 -0
- package/lib/verification/gates.d.ts +5 -0
- package/lib/verification/gates.js +20 -5
- package/lib/verification/property.d.ts +9 -0
- package/lib/verification/property.js +11 -2
- package/lib/verification/self-check.js +12 -12
- package/package.json +1 -1
- package/schemas/contract-document.schema.json +161 -0
- package/schemas/execution-document.schema.json +134 -0
- package/schemas/run-event.schema.json +4 -0
- package/schemas/stop-diagnosis.schema.json +2 -0
|
@@ -760,6 +760,34 @@ export declare const publishedSchemas: {
|
|
|
760
760
|
environment: z.ZodString;
|
|
761
761
|
}, z.core.$strict>>;
|
|
762
762
|
}, z.core.$strict>;
|
|
763
|
+
gates: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
764
|
+
verification: z.ZodOptional<z.ZodEnum<{
|
|
765
|
+
property: "property";
|
|
766
|
+
reference: "reference";
|
|
767
|
+
}>>;
|
|
768
|
+
reference: z.ZodOptional<z.ZodObject<{
|
|
769
|
+
oracle: z.ZodObject<{
|
|
770
|
+
description: z.ZodString;
|
|
771
|
+
limits: z.ZodString;
|
|
772
|
+
}, z.core.$strict>;
|
|
773
|
+
crossChecks: z.ZodArray<z.ZodObject<{
|
|
774
|
+
family: z.ZodString;
|
|
775
|
+
against: z.ZodString;
|
|
776
|
+
matches: z.ZodNumber;
|
|
777
|
+
total: z.ZodNumber;
|
|
778
|
+
artifacts: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
779
|
+
}, z.core.$strict>>;
|
|
780
|
+
sets: z.ZodArray<z.ZodObject<{
|
|
781
|
+
gate: z.ZodString;
|
|
782
|
+
artifacts: z.ZodArray<z.ZodString>;
|
|
783
|
+
minCases: z.ZodNumber;
|
|
784
|
+
families: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
785
|
+
id: z.ZodString;
|
|
786
|
+
minCases: z.ZodNumber;
|
|
787
|
+
}, z.core.$strict>>>;
|
|
788
|
+
}, z.core.$strict>>;
|
|
789
|
+
gaps: z.ZodString;
|
|
790
|
+
}, z.core.$strict>>;
|
|
763
791
|
hard: z.ZodDefault<z.ZodBoolean>;
|
|
764
792
|
feasibility: z.ZodOptional<z.ZodObject<{
|
|
765
793
|
spike: z.ZodString;
|
|
@@ -1698,10 +1726,12 @@ export declare const publishedSchemas: {
|
|
|
1698
1726
|
"provider-auth": "provider-auth";
|
|
1699
1727
|
"stale-base": "stale-base";
|
|
1700
1728
|
"empty-result": "empty-result";
|
|
1729
|
+
unfinished: "unfinished";
|
|
1701
1730
|
"scope-violation": "scope-violation";
|
|
1702
1731
|
"review-protocol": "review-protocol";
|
|
1703
1732
|
merge: "merge";
|
|
1704
1733
|
budget: "budget";
|
|
1734
|
+
"needs-lead": "needs-lead";
|
|
1705
1735
|
}>;
|
|
1706
1736
|
message: z.ZodString;
|
|
1707
1737
|
blocked: z.ZodBoolean;
|
|
@@ -1737,10 +1767,12 @@ export declare const publishedSchemas: {
|
|
|
1737
1767
|
"provider-auth": "provider-auth";
|
|
1738
1768
|
"stale-base": "stale-base";
|
|
1739
1769
|
"empty-result": "empty-result";
|
|
1770
|
+
unfinished: "unfinished";
|
|
1740
1771
|
"scope-violation": "scope-violation";
|
|
1741
1772
|
"review-protocol": "review-protocol";
|
|
1742
1773
|
merge: "merge";
|
|
1743
1774
|
budget: "budget";
|
|
1775
|
+
"needs-lead": "needs-lead";
|
|
1744
1776
|
}>>>;
|
|
1745
1777
|
}, z.core.$strict> | z.ZodObject<{
|
|
1746
1778
|
reason: z.ZodEnum<{
|
|
@@ -1949,10 +1981,12 @@ export declare const publishedSchemas: {
|
|
|
1949
1981
|
"provider-auth": "provider-auth";
|
|
1950
1982
|
"stale-base": "stale-base";
|
|
1951
1983
|
"empty-result": "empty-result";
|
|
1984
|
+
unfinished: "unfinished";
|
|
1952
1985
|
"scope-violation": "scope-violation";
|
|
1953
1986
|
"review-protocol": "review-protocol";
|
|
1954
1987
|
merge: "merge";
|
|
1955
1988
|
budget: "budget";
|
|
1989
|
+
"needs-lead": "needs-lead";
|
|
1956
1990
|
}>;
|
|
1957
1991
|
message: z.ZodString;
|
|
1958
1992
|
blocked: z.ZodBoolean;
|
|
@@ -1988,10 +2022,12 @@ export declare const publishedSchemas: {
|
|
|
1988
2022
|
"provider-auth": "provider-auth";
|
|
1989
2023
|
"stale-base": "stale-base";
|
|
1990
2024
|
"empty-result": "empty-result";
|
|
2025
|
+
unfinished: "unfinished";
|
|
1991
2026
|
"scope-violation": "scope-violation";
|
|
1992
2027
|
"review-protocol": "review-protocol";
|
|
1993
2028
|
merge: "merge";
|
|
1994
2029
|
budget: "budget";
|
|
2030
|
+
"needs-lead": "needs-lead";
|
|
1995
2031
|
}>>>;
|
|
1996
2032
|
}, z.core.$strict> | z.ZodObject<{
|
|
1997
2033
|
reason: z.ZodEnum<{
|
|
@@ -2421,10 +2457,12 @@ export declare const publishedSchemas: {
|
|
|
2421
2457
|
"provider-auth": "provider-auth";
|
|
2422
2458
|
"stale-base": "stale-base";
|
|
2423
2459
|
"empty-result": "empty-result";
|
|
2460
|
+
unfinished: "unfinished";
|
|
2424
2461
|
"scope-violation": "scope-violation";
|
|
2425
2462
|
"review-protocol": "review-protocol";
|
|
2426
2463
|
merge: "merge";
|
|
2427
2464
|
budget: "budget";
|
|
2465
|
+
"needs-lead": "needs-lead";
|
|
2428
2466
|
}>>;
|
|
2429
2467
|
failureFingerprint: z.ZodOptional<z.ZodString>;
|
|
2430
2468
|
approvedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
@@ -2574,6 +2612,7 @@ export declare const publishedSchemas: {
|
|
|
2574
2612
|
}, z.core.$strict>>;
|
|
2575
2613
|
version: z.ZodNumber;
|
|
2576
2614
|
}, z.core.$strict>>>;
|
|
2615
|
+
neutralFailures: z.ZodOptional<z.ZodNumber>;
|
|
2577
2616
|
}, z.core.$strict>>;
|
|
2578
2617
|
attempts: z.ZodArray<z.ZodObject<{
|
|
2579
2618
|
id: z.ZodString;
|
|
@@ -2634,10 +2673,12 @@ export declare const publishedSchemas: {
|
|
|
2634
2673
|
"provider-auth": "provider-auth";
|
|
2635
2674
|
"stale-base": "stale-base";
|
|
2636
2675
|
"empty-result": "empty-result";
|
|
2676
|
+
unfinished: "unfinished";
|
|
2637
2677
|
"scope-violation": "scope-violation";
|
|
2638
2678
|
"review-protocol": "review-protocol";
|
|
2639
2679
|
merge: "merge";
|
|
2640
2680
|
budget: "budget";
|
|
2681
|
+
"needs-lead": "needs-lead";
|
|
2641
2682
|
}>>;
|
|
2642
2683
|
failureFingerprint: z.ZodOptional<z.ZodString>;
|
|
2643
2684
|
requiredGates: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -2709,6 +2750,12 @@ export declare const publishedSchemas: {
|
|
|
2709
2750
|
}, z.core.$strict>>>;
|
|
2710
2751
|
properties: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2711
2752
|
unboundProperties: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2753
|
+
interrupted: z.ZodOptional<z.ZodLiteral<"shutdown">>;
|
|
2754
|
+
inputClasses: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2755
|
+
classified: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2756
|
+
property: z.ZodString;
|
|
2757
|
+
inputClass: z.ZodString;
|
|
2758
|
+
}, z.core.$strict>>>;
|
|
2712
2759
|
episodeBasis: z.ZodOptional<z.ZodString>;
|
|
2713
2760
|
implementationBasis: z.ZodOptional<z.ZodString>;
|
|
2714
2761
|
reusedFrom: z.ZodOptional<z.ZodObject<{
|
|
@@ -2738,10 +2785,12 @@ export declare const publishedSchemas: {
|
|
|
2738
2785
|
"provider-auth": "provider-auth";
|
|
2739
2786
|
"stale-base": "stale-base";
|
|
2740
2787
|
"empty-result": "empty-result";
|
|
2788
|
+
unfinished: "unfinished";
|
|
2741
2789
|
"scope-violation": "scope-violation";
|
|
2742
2790
|
"review-protocol": "review-protocol";
|
|
2743
2791
|
merge: "merge";
|
|
2744
2792
|
budget: "budget";
|
|
2793
|
+
"needs-lead": "needs-lead";
|
|
2745
2794
|
}>>;
|
|
2746
2795
|
respecified: z.ZodOptional<z.ZodBoolean>;
|
|
2747
2796
|
applied: z.ZodBoolean;
|
|
@@ -2861,11 +2910,11 @@ export declare const publishedSchemas: {
|
|
|
2861
2910
|
runId: z.ZodString;
|
|
2862
2911
|
status: z.ZodNullable<z.ZodString>;
|
|
2863
2912
|
reason: z.ZodEnum<{
|
|
2913
|
+
unfinished: "unfinished";
|
|
2864
2914
|
"not-started": "not-started";
|
|
2865
2915
|
"legacy-unconfirmed": "legacy-unconfirmed";
|
|
2866
2916
|
"foreign-scope": "foreign-scope";
|
|
2867
2917
|
"unknown-status": "unknown-status";
|
|
2868
|
-
unfinished: "unfinished";
|
|
2869
2918
|
abandoned: "abandoned";
|
|
2870
2919
|
}>;
|
|
2871
2920
|
}, z.core.$strict>>>;
|
|
@@ -2998,6 +3047,19 @@ export declare const publishedSchemas: {
|
|
|
2998
3047
|
coverage: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2999
3048
|
}, z.core.$strict>>;
|
|
3000
3049
|
checks: z.ZodOptional<z.ZodString>;
|
|
3050
|
+
alreadySatisfied: z.ZodOptional<z.ZodObject<{
|
|
3051
|
+
gates: z.ZodArray<z.ZodString>;
|
|
3052
|
+
evidence: z.ZodString;
|
|
3053
|
+
basis: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3054
|
+
kind: z.ZodLiteral<"contract">;
|
|
3055
|
+
gates: z.ZodArray<z.ZodString>;
|
|
3056
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
3057
|
+
kind: z.ZodLiteral<"dependency">;
|
|
3058
|
+
workId: z.ZodString;
|
|
3059
|
+
sha: z.ZodString;
|
|
3060
|
+
paths: z.ZodArray<z.ZodString>;
|
|
3061
|
+
}, z.core.$strict>], "kind">>;
|
|
3062
|
+
}, z.core.$strict>>;
|
|
3001
3063
|
}, z.core.$strict>>;
|
|
3002
3064
|
}, z.core.$strict>>;
|
|
3003
3065
|
verifications: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -3148,10 +3210,12 @@ export declare const publishedSchemas: {
|
|
|
3148
3210
|
"provider-auth": "provider-auth";
|
|
3149
3211
|
"stale-base": "stale-base";
|
|
3150
3212
|
"empty-result": "empty-result";
|
|
3213
|
+
unfinished: "unfinished";
|
|
3151
3214
|
"scope-violation": "scope-violation";
|
|
3152
3215
|
"review-protocol": "review-protocol";
|
|
3153
3216
|
merge: "merge";
|
|
3154
3217
|
budget: "budget";
|
|
3218
|
+
"needs-lead": "needs-lead";
|
|
3155
3219
|
}>>>;
|
|
3156
3220
|
waits: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
3157
3221
|
kind: z.ZodEnum<{
|
|
@@ -3373,10 +3437,12 @@ export declare const publishedSchemas: {
|
|
|
3373
3437
|
"provider-auth": "provider-auth";
|
|
3374
3438
|
"stale-base": "stale-base";
|
|
3375
3439
|
"empty-result": "empty-result";
|
|
3440
|
+
unfinished: "unfinished";
|
|
3376
3441
|
"scope-violation": "scope-violation";
|
|
3377
3442
|
"review-protocol": "review-protocol";
|
|
3378
3443
|
merge: "merge";
|
|
3379
3444
|
budget: "budget";
|
|
3445
|
+
"needs-lead": "needs-lead";
|
|
3380
3446
|
"runtime-missing": "runtime-missing";
|
|
3381
3447
|
"controller-busy": "controller-busy";
|
|
3382
3448
|
"operator-pause": "operator-pause";
|
|
@@ -28,4 +28,11 @@ export interface RepairRule {
|
|
|
28
28
|
* попадают в подсказку следующей попытки, а бюджет попыток задачи не растёт —
|
|
29
29
|
* сброс бюджета остаётся действием человека.
|
|
30
30
|
*/
|
|
31
|
+
/**
|
|
32
|
+
* Предел отказов, не засчитывающих попытку (окружение, провайдер, истёкшее
|
|
33
|
+
* владение после начала работы), на поручение до сброса человеком. Без него
|
|
34
|
+
* поручение с кандидатом, на котором раз за разом рвётся окружение, выдавалось
|
|
35
|
+
* бы бесконечно: бюджет попыток такие отказы не тратят.
|
|
36
|
+
*/
|
|
37
|
+
export declare const MAX_NEUTRAL_FAILURES = 3;
|
|
31
38
|
export declare const repairPolicy: Record<FailureKind, RepairRule>;
|
|
@@ -6,6 +6,13 @@
|
|
|
6
6
|
* попадают в подсказку следующей попытки, а бюджет попыток задачи не растёт —
|
|
7
7
|
* сброс бюджета остаётся действием человека.
|
|
8
8
|
*/
|
|
9
|
+
/**
|
|
10
|
+
* Предел отказов, не засчитывающих попытку (окружение, провайдер, истёкшее
|
|
11
|
+
* владение после начала работы), на поручение до сброса человеком. Без него
|
|
12
|
+
* поручение с кандидатом, на котором раз за разом рвётся окружение, выдавалось
|
|
13
|
+
* бы бесконечно: бюджет попыток такие отказы не тратят.
|
|
14
|
+
*/
|
|
15
|
+
export const MAX_NEUTRAL_FAILURES = 3;
|
|
9
16
|
export const repairPolicy = {
|
|
10
17
|
'provider-auth': {
|
|
11
18
|
action: 'stop',
|
|
@@ -34,6 +41,11 @@ export const repairPolicy = {
|
|
|
34
41
|
repeats: 1,
|
|
35
42
|
explain: 'Исполнитель отчитался о выполнении, не изменив ни файла. Повтор получает этот отказ в подсказке; второй такой же означает, что задача поставлена неверно или невыполнима в своей области.',
|
|
36
43
|
},
|
|
44
|
+
unfinished: {
|
|
45
|
+
action: 'retry',
|
|
46
|
+
repeats: 2,
|
|
47
|
+
explain: 'Исполнитель сообщил, что не доделал работу. Повтор продолжает с сохранённого черновика в пределах бюджета попыток; одна и та же незавершённость сверх предела означает, что задача не помещается в попытку: её нужно разделить.',
|
|
48
|
+
},
|
|
37
49
|
'scope-violation': {
|
|
38
50
|
action: 'retry',
|
|
39
51
|
repeats: 1,
|
|
@@ -64,6 +76,11 @@ export const repairPolicy = {
|
|
|
64
76
|
repeats: 0,
|
|
65
77
|
explain: 'Бюджет расходов или времени исчерпан либо не определён (есть вызовы с неизвестной стоимостью). Повтор потратил бы ещё; продолжить можно, только осознанно подняв предел в конфигурации или задав политику для неизвестной цены.',
|
|
66
78
|
},
|
|
79
|
+
'needs-lead': {
|
|
80
|
+
action: 'stop',
|
|
81
|
+
repeats: 0,
|
|
82
|
+
explain: 'Исполнитель не изменил ни файла и ревью сочло приёмку уже выполненной, но механического основания нет: у поручения нет договора проверки, и ни одна его зависимость не меняла его область записи. Зелёный общий gate на базе этого не доказывает. Принять задачу без изменений или поставить её заново решает ведущий.',
|
|
83
|
+
},
|
|
67
84
|
cancelled: {
|
|
68
85
|
action: 'stop',
|
|
69
86
|
repeats: 0,
|
|
@@ -37,6 +37,7 @@ export type ImplementationResult = z.infer<typeof implementationResultSchema>;
|
|
|
37
37
|
export declare const reproductionSchema: z.ZodObject<{
|
|
38
38
|
property: z.ZodNullable<z.ZodString>;
|
|
39
39
|
input: z.ZodString;
|
|
40
|
+
inputClass: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
40
41
|
expected: z.ZodNullable<z.ZodString>;
|
|
41
42
|
actual: z.ZodNullable<z.ZodString>;
|
|
42
43
|
command: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
@@ -76,6 +77,12 @@ export declare const findingTransitionSchema: z.ZodObject<{
|
|
|
76
77
|
* — отказ; `previous` обязан назвать состояние каждой прежней открытой
|
|
77
78
|
* находки этого предмета (см. `reviewIssues`).
|
|
78
79
|
*/
|
|
80
|
+
/** Основание «приёмка уже выполнена»: названные gates и что их evidence показывает. */
|
|
81
|
+
export declare const alreadySatisfiedSchema: z.ZodObject<{
|
|
82
|
+
gates: z.ZodArray<z.ZodString>;
|
|
83
|
+
evidence: z.ZodString;
|
|
84
|
+
}, z.core.$strict>;
|
|
85
|
+
export type AlreadySatisfied = z.infer<typeof alreadySatisfiedSchema>;
|
|
79
86
|
export declare const reviewResultSchema: z.ZodObject<{
|
|
80
87
|
execution: z.ZodOptional<z.ZodObject<{
|
|
81
88
|
commands: z.ZodArray<z.ZodObject<{
|
|
@@ -113,6 +120,7 @@ export declare const reviewResultSchema: z.ZodObject<{
|
|
|
113
120
|
reproduction: z.ZodCatch<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
114
121
|
property: z.ZodNullable<z.ZodString>;
|
|
115
122
|
input: z.ZodString;
|
|
123
|
+
inputClass: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
116
124
|
expected: z.ZodNullable<z.ZodString>;
|
|
117
125
|
actual: z.ZodNullable<z.ZodString>;
|
|
118
126
|
command: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
@@ -129,6 +137,10 @@ export declare const reviewResultSchema: z.ZodObject<{
|
|
|
129
137
|
}>;
|
|
130
138
|
basis: z.ZodString;
|
|
131
139
|
}, z.core.$strict>>>;
|
|
140
|
+
alreadySatisfied: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
141
|
+
gates: z.ZodArray<z.ZodString>;
|
|
142
|
+
evidence: z.ZodString;
|
|
143
|
+
}, z.core.$strict>>>;
|
|
132
144
|
}, z.core.$strip>;
|
|
133
145
|
export type ReviewResult = z.infer<typeof reviewResultSchema>;
|
|
134
146
|
/** Идентичность находки: предмет, класс и текст. Новый текст — новая находка. */
|
package/lib/contracts/review.js
CHANGED
|
@@ -24,6 +24,13 @@ export const implementationResultSchema = z.object({
|
|
|
24
24
|
export const reproductionSchema = z.object({
|
|
25
25
|
property: z.string().max(200).nullable(),
|
|
26
26
|
input: z.string().min(1).max(8000),
|
|
27
|
+
/**
|
|
28
|
+
* Класс входов, к которому относится пример: генератор или семейство, а не
|
|
29
|
+
* экземпляр. Следующая попытка чинит класс; два отказа подряд по одному
|
|
30
|
+
* классу — пробел приёмки (`repairDecision`). Длина не ограничивается
|
|
31
|
+
* схемой: длинный ответ обрезается при записи, а не отбрасывает пример.
|
|
32
|
+
*/
|
|
33
|
+
inputClass: z.string().nullable().optional(),
|
|
27
34
|
expected: z.string().max(2000).nullable(),
|
|
28
35
|
actual: z.string().max(2000).nullable(),
|
|
29
36
|
command: z.array(z.string()).max(64).nullable(),
|
|
@@ -62,6 +69,11 @@ export const findingTransitionSchema = z.strictObject({
|
|
|
62
69
|
* — отказ; `previous` обязан назвать состояние каждой прежней открытой
|
|
63
70
|
* находки этого предмета (см. `reviewIssues`).
|
|
64
71
|
*/
|
|
72
|
+
/** Основание «приёмка уже выполнена»: названные gates и что их evidence показывает. */
|
|
73
|
+
export const alreadySatisfiedSchema = z.strictObject({
|
|
74
|
+
gates: z.array(z.string().min(1).max(200)).min(1).max(20),
|
|
75
|
+
evidence: z.string().min(1).max(4000),
|
|
76
|
+
});
|
|
65
77
|
export const reviewResultSchema = z.object({
|
|
66
78
|
execution: reviewExecutionSchema.optional(),
|
|
67
79
|
approved: z.boolean(),
|
|
@@ -79,6 +91,13 @@ export const reviewResultSchema = z.object({
|
|
|
79
91
|
reproduction: reproductionSchema.nullable().optional().catch(null),
|
|
80
92
|
})),
|
|
81
93
|
previous: z.array(findingTransitionSchema).default([]),
|
|
94
|
+
/**
|
|
95
|
+
* Подтверждение reviewer, что приёмка поручения уже выполнена на базе без
|
|
96
|
+
* изменений (исполнитель сдал пустой результат): gates, чьё прошедшее
|
|
97
|
+
* evidence это показывает, и основание. Учитывается только для попытки без
|
|
98
|
+
* изменений; там без него принятие не засчитывается (`empty-result`).
|
|
99
|
+
*/
|
|
100
|
+
alreadySatisfied: alreadySatisfiedSchema.nullable().optional(),
|
|
82
101
|
});
|
|
83
102
|
/** Идентичность находки: предмет, класс и текст. Новый текст — новая находка. */
|
|
84
103
|
export const findingId = (subject, finding) => digestOf({ subject, rule: finding.rule ?? null, message: finding.message });
|
package/lib/control/harness.d.ts
CHANGED
|
@@ -735,7 +735,7 @@ export declare class Harness {
|
|
|
735
735
|
pauseReason?: "runtime" | "operator" | "shutdown" | "base-check" | "reconfigure" | undefined;
|
|
736
736
|
pausedAt?: string | undefined;
|
|
737
737
|
pauseOperation?: string | undefined;
|
|
738
|
-
pauseFailures?: ("gate" | "unknown" | "review" | "environment" | "cancelled" | "timeout" | "provider-auth" | "stale-base" | "empty-result" | "scope-violation" | "review-protocol" | "merge" | "budget")[] | undefined;
|
|
738
|
+
pauseFailures?: ("gate" | "unknown" | "review" | "environment" | "cancelled" | "timeout" | "provider-auth" | "stale-base" | "empty-result" | "unfinished" | "scope-violation" | "review-protocol" | "merge" | "budget" | "needs-lead")[] | undefined;
|
|
739
739
|
waits?: {
|
|
740
740
|
kind: "base-check" | "context-lock";
|
|
741
741
|
detail: string;
|
|
@@ -792,7 +792,7 @@ export declare class Harness {
|
|
|
792
792
|
pauseReason?: "runtime" | "operator" | "shutdown" | "base-check" | "reconfigure" | undefined;
|
|
793
793
|
pausedAt?: string | undefined;
|
|
794
794
|
pauseOperation?: string | undefined;
|
|
795
|
-
pauseFailures?: ("gate" | "unknown" | "review" | "environment" | "cancelled" | "timeout" | "provider-auth" | "stale-base" | "empty-result" | "scope-violation" | "review-protocol" | "merge" | "budget")[] | undefined;
|
|
795
|
+
pauseFailures?: ("gate" | "unknown" | "review" | "environment" | "cancelled" | "timeout" | "provider-auth" | "stale-base" | "empty-result" | "unfinished" | "scope-violation" | "review-protocol" | "merge" | "budget" | "needs-lead")[] | undefined;
|
|
796
796
|
waits?: {
|
|
797
797
|
kind: "base-check" | "context-lock";
|
|
798
798
|
detail: string;
|
package/lib/control/harness.js
CHANGED
|
@@ -18,7 +18,7 @@ import { policySourceChanged } from "./provenance.js";
|
|
|
18
18
|
import { JointRunner } from "../engine/joint-runner.js";
|
|
19
19
|
import { git } from "../environment/process.js";
|
|
20
20
|
import { analyzeRecovery, applyCases } from "./recovery.js";
|
|
21
|
-
import { declarationProblems } from "../verification/checks.js";
|
|
21
|
+
import { declarationProblems, referenceNote } from "../verification/checks.js";
|
|
22
22
|
import { spikeOf, spikesOf } from "../verification/spike.js";
|
|
23
23
|
import { staleArtifacts } from "../verification/confirm.js";
|
|
24
24
|
const stateFile = (dir) => join(dir, 'state.sqlite');
|
|
@@ -193,6 +193,7 @@ export class Harness {
|
|
|
193
193
|
: 'You independently review a contract document. Check that every obligation is feasible and measurable. Do not edit files.',
|
|
194
194
|
JSON.stringify(input.kind === 'plan' ? input.graph : input.contract, null, 2),
|
|
195
195
|
input.kind === 'contract' ? this.spikeNote(input.contract) : '',
|
|
196
|
+
input.kind === 'contract' ? referenceNote(input.contract.checks) : '',
|
|
196
197
|
],
|
|
197
198
|
...(context ? { context } : {}),
|
|
198
199
|
...(input.kind === 'contract' ? { contract: input.contract } : {}),
|
|
@@ -139,6 +139,31 @@ export declare function recoveryBrief(view: ExecutionView, work: WorkState, poli
|
|
|
139
139
|
};
|
|
140
140
|
hard: boolean;
|
|
141
141
|
explanation?: string | undefined;
|
|
142
|
+
gates?: string[] | undefined;
|
|
143
|
+
verification?: "property" | "reference" | undefined;
|
|
144
|
+
reference?: {
|
|
145
|
+
oracle: {
|
|
146
|
+
description: string;
|
|
147
|
+
limits: string;
|
|
148
|
+
};
|
|
149
|
+
crossChecks: {
|
|
150
|
+
family: string;
|
|
151
|
+
against: string;
|
|
152
|
+
matches: number;
|
|
153
|
+
total: number;
|
|
154
|
+
artifacts?: string[] | undefined;
|
|
155
|
+
}[];
|
|
156
|
+
sets: {
|
|
157
|
+
gate: string;
|
|
158
|
+
artifacts: string[];
|
|
159
|
+
minCases: number;
|
|
160
|
+
families: {
|
|
161
|
+
id: string;
|
|
162
|
+
minCases: number;
|
|
163
|
+
}[];
|
|
164
|
+
}[];
|
|
165
|
+
gaps: string;
|
|
166
|
+
} | undefined;
|
|
142
167
|
feasibility?: {
|
|
143
168
|
spike: string;
|
|
144
169
|
digest: string;
|
|
@@ -180,7 +205,7 @@ export declare function recoveryBrief(view: ExecutionView, work: WorkState, poli
|
|
|
180
205
|
attempts: {
|
|
181
206
|
run: string;
|
|
182
207
|
attempt: number;
|
|
183
|
-
failureKind: "gate" | "unknown" | "review" | "environment" | "cancelled" | "timeout" | "provider-auth" | "stale-base" | "empty-result" | "scope-violation" | "review-protocol" | "merge" | "budget" | undefined;
|
|
208
|
+
failureKind: "gate" | "unknown" | "review" | "environment" | "cancelled" | "timeout" | "provider-auth" | "stale-base" | "empty-result" | "unfinished" | "scope-violation" | "review-protocol" | "merge" | "budget" | "needs-lead" | undefined;
|
|
184
209
|
error: string | undefined;
|
|
185
210
|
findings: {
|
|
186
211
|
severity: string;
|
package/lib/engine/engine.d.ts
CHANGED
|
@@ -32,12 +32,8 @@ export interface EngineOptions {
|
|
|
32
32
|
recordPolicyOnLead?: boolean;
|
|
33
33
|
}
|
|
34
34
|
export type Phase = 'running' | 'verifying' | 'reviewing' | 'integrating';
|
|
35
|
-
/**
|
|
36
|
-
|
|
37
|
-
* транзакции хранилища: состояние, на котором решение принято, и запись
|
|
38
|
-
* решения неразделимы. Хост может только добавить запрет (`HostGuards`) и
|
|
39
|
-
* дать основания (`BasisProvider`); снять отказ движка он не может.
|
|
40
|
-
*/
|
|
35
|
+
/** Поручение исчерпало предел незасчитанных отказов: повтор — только со сбросом. */
|
|
36
|
+
export declare const neutralExhausted: (w: Pick<WorkState, "neutralFailures">) => boolean;
|
|
41
37
|
export declare class Engine {
|
|
42
38
|
readonly host: ExecutionHost;
|
|
43
39
|
readonly policy: ExecutionPolicy;
|
|
@@ -251,7 +247,7 @@ export declare class Engine {
|
|
|
251
247
|
pauseReason?: "runtime" | "operator" | "shutdown" | "base-check" | "reconfigure" | undefined;
|
|
252
248
|
pausedAt?: string | undefined;
|
|
253
249
|
pauseOperation?: string | undefined;
|
|
254
|
-
pauseFailures?: ("gate" | "unknown" | "review" | "environment" | "cancelled" | "timeout" | "provider-auth" | "stale-base" | "empty-result" | "scope-violation" | "review-protocol" | "merge" | "budget")[] | undefined;
|
|
250
|
+
pauseFailures?: ("gate" | "unknown" | "review" | "environment" | "cancelled" | "timeout" | "provider-auth" | "stale-base" | "empty-result" | "unfinished" | "scope-violation" | "review-protocol" | "merge" | "budget" | "needs-lead")[] | undefined;
|
|
255
251
|
waits?: {
|
|
256
252
|
kind: "base-check" | "context-lock";
|
|
257
253
|
detail: string;
|
|
@@ -287,7 +283,7 @@ export declare class Engine {
|
|
|
287
283
|
pauseReason?: "runtime" | "operator" | "shutdown" | "base-check" | "reconfigure" | undefined;
|
|
288
284
|
pausedAt?: string | undefined;
|
|
289
285
|
pauseOperation?: string | undefined;
|
|
290
|
-
pauseFailures?: ("gate" | "unknown" | "review" | "environment" | "cancelled" | "timeout" | "provider-auth" | "stale-base" | "empty-result" | "scope-violation" | "review-protocol" | "merge" | "budget")[] | undefined;
|
|
286
|
+
pauseFailures?: ("gate" | "unknown" | "review" | "environment" | "cancelled" | "timeout" | "provider-auth" | "stale-base" | "empty-result" | "unfinished" | "scope-violation" | "review-protocol" | "merge" | "budget" | "needs-lead")[] | undefined;
|
|
291
287
|
waits?: {
|
|
292
288
|
kind: "base-check" | "context-lock";
|
|
293
289
|
detail: string;
|
|
@@ -317,7 +313,7 @@ export declare class Engine {
|
|
|
317
313
|
pauseReason?: "runtime" | "operator" | "shutdown" | "base-check" | "reconfigure" | undefined;
|
|
318
314
|
pausedAt?: string | undefined;
|
|
319
315
|
pauseOperation?: string | undefined;
|
|
320
|
-
pauseFailures?: ("gate" | "unknown" | "review" | "environment" | "cancelled" | "timeout" | "provider-auth" | "stale-base" | "empty-result" | "scope-violation" | "review-protocol" | "merge" | "budget")[] | undefined;
|
|
316
|
+
pauseFailures?: ("gate" | "unknown" | "review" | "environment" | "cancelled" | "timeout" | "provider-auth" | "stale-base" | "empty-result" | "unfinished" | "scope-violation" | "review-protocol" | "merge" | "budget" | "needs-lead")[] | undefined;
|
|
321
317
|
waits?: {
|
|
322
318
|
kind: "base-check" | "context-lock";
|
|
323
319
|
detail: string;
|
|
@@ -527,7 +523,7 @@ export declare class Engine {
|
|
|
527
523
|
excluded?: {
|
|
528
524
|
runId: string;
|
|
529
525
|
status: string | null;
|
|
530
|
-
reason: "not-started" | "legacy-unconfirmed" | "foreign-scope" | "unknown-status" | "
|
|
526
|
+
reason: "unfinished" | "not-started" | "legacy-unconfirmed" | "foreign-scope" | "unknown-status" | "abandoned";
|
|
531
527
|
}[] | undefined;
|
|
532
528
|
excludedTotal?: number | undefined;
|
|
533
529
|
invalid?: number | undefined;
|
|
@@ -621,6 +617,19 @@ export declare class Engine {
|
|
|
621
617
|
coverage?: string[] | undefined;
|
|
622
618
|
} | undefined;
|
|
623
619
|
checks?: string | undefined;
|
|
620
|
+
alreadySatisfied?: {
|
|
621
|
+
gates: string[];
|
|
622
|
+
evidence: string;
|
|
623
|
+
basis?: {
|
|
624
|
+
kind: "contract";
|
|
625
|
+
gates: string[];
|
|
626
|
+
} | {
|
|
627
|
+
kind: "dependency";
|
|
628
|
+
workId: string;
|
|
629
|
+
sha: string;
|
|
630
|
+
paths: string[];
|
|
631
|
+
} | undefined;
|
|
632
|
+
} | undefined;
|
|
624
633
|
};
|
|
625
634
|
/**
|
|
626
635
|
* Техническая приёмка. Требует фазу интеграции и integration SHA, PASS
|
|
@@ -644,11 +653,25 @@ export declare class Engine {
|
|
|
644
653
|
kind?: FailureKind;
|
|
645
654
|
blocked?: boolean;
|
|
646
655
|
heartbeatCause?: string;
|
|
647
|
-
/**
|
|
656
|
+
/**
|
|
657
|
+
* Свойства отказа: `bound` — объявленные поручением, `unbound` — прочие
|
|
658
|
+
* названные; `classes` — классы входов, названные ревьюером.
|
|
659
|
+
*/
|
|
648
660
|
properties?: {
|
|
649
661
|
bound: string[];
|
|
650
662
|
unbound: string[];
|
|
663
|
+
classes?: string[];
|
|
664
|
+
pairs?: {
|
|
665
|
+
property: string;
|
|
666
|
+
inputClass: string;
|
|
667
|
+
}[];
|
|
651
668
|
};
|
|
669
|
+
/**
|
|
670
|
+
* Попытку прервала штатная остановка controller: отказ окружения без
|
|
671
|
+
* паузы по классу; поручение возвращается в очередь (`ready`), а не
|
|
672
|
+
* ждёт восстановления. Интегрированная попытка так не возвращается.
|
|
673
|
+
*/
|
|
674
|
+
interrupted?: boolean;
|
|
652
675
|
}): {
|
|
653
676
|
recovery?: {
|
|
654
677
|
id: string;
|
|
@@ -657,8 +680,10 @@ export declare class Engine {
|
|
|
657
680
|
properties?: string[] | undefined;
|
|
658
681
|
workId: string;
|
|
659
682
|
runId: string;
|
|
660
|
-
kind: "gate" | "unknown" | "review" | "environment" | "cancelled" | "timeout" | "provider-auth" | "stale-base" | "empty-result" | "scope-violation" | "review-protocol" | "merge" | "budget";
|
|
683
|
+
kind: "gate" | "unknown" | "review" | "environment" | "cancelled" | "timeout" | "provider-auth" | "stale-base" | "empty-result" | "unfinished" | "scope-violation" | "review-protocol" | "merge" | "budget" | "needs-lead";
|
|
661
684
|
blocked: boolean;
|
|
685
|
+
/** Работа возвращена в очередь (штатная остановка); иначе — обычный отказ. */
|
|
686
|
+
interrupted: boolean;
|
|
662
687
|
};
|
|
663
688
|
private recoveryEvent;
|
|
664
689
|
/** Принятие корпуса, ждущее оператора, удерживает выдачу поручения. */
|
|
@@ -1301,7 +1326,7 @@ export declare class Engine {
|
|
|
1301
1326
|
activeRunId?: string | undefined;
|
|
1302
1327
|
resultSha?: string | undefined;
|
|
1303
1328
|
failure?: string | undefined;
|
|
1304
|
-
failureKind?: "gate" | "unknown" | "review" | "environment" | "cancelled" | "timeout" | "provider-auth" | "stale-base" | "empty-result" | "scope-violation" | "review-protocol" | "merge" | "budget" | undefined;
|
|
1329
|
+
failureKind?: "gate" | "unknown" | "review" | "environment" | "cancelled" | "timeout" | "provider-auth" | "stale-base" | "empty-result" | "unfinished" | "scope-violation" | "review-protocol" | "merge" | "budget" | "needs-lead" | undefined;
|
|
1305
1330
|
failureFingerprint?: string | undefined;
|
|
1306
1331
|
approvedAt?: string | undefined;
|
|
1307
1332
|
approvedDigest?: string | undefined;
|
|
@@ -1401,6 +1426,7 @@ export declare class Engine {
|
|
|
1401
1426
|
retryRun?: string | undefined;
|
|
1402
1427
|
reason?: string | undefined;
|
|
1403
1428
|
}[] | undefined;
|
|
1429
|
+
neutralFailures?: number | undefined;
|
|
1404
1430
|
};
|
|
1405
1431
|
changed: boolean;
|
|
1406
1432
|
};
|
|
@@ -1458,7 +1484,7 @@ export declare class Engine {
|
|
|
1458
1484
|
activeRunId?: string | undefined;
|
|
1459
1485
|
resultSha?: string | undefined;
|
|
1460
1486
|
failure?: string | undefined;
|
|
1461
|
-
failureKind?: "gate" | "unknown" | "review" | "environment" | "cancelled" | "timeout" | "provider-auth" | "stale-base" | "empty-result" | "scope-violation" | "review-protocol" | "merge" | "budget" | undefined;
|
|
1487
|
+
failureKind?: "gate" | "unknown" | "review" | "environment" | "cancelled" | "timeout" | "provider-auth" | "stale-base" | "empty-result" | "unfinished" | "scope-violation" | "review-protocol" | "merge" | "budget" | "needs-lead" | undefined;
|
|
1462
1488
|
failureFingerprint?: string | undefined;
|
|
1463
1489
|
approvedAt?: string | undefined;
|
|
1464
1490
|
approvedDigest?: string | undefined;
|
|
@@ -1558,6 +1584,7 @@ export declare class Engine {
|
|
|
1558
1584
|
retryRun?: string | undefined;
|
|
1559
1585
|
reason?: string | undefined;
|
|
1560
1586
|
}[] | undefined;
|
|
1587
|
+
neutralFailures?: number | undefined;
|
|
1561
1588
|
};
|
|
1562
1589
|
changed: boolean;
|
|
1563
1590
|
};
|