devcontour-harness 0.1.0-alpha.30 → 0.1.0-alpha.34
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 +43 -16
- package/docs/architecture.md +12 -0
- package/docs/compatibility.md +21 -18
- package/docs/contracts.md +270 -12
- package/docs/release-notes/0.1.0-alpha.31.md +44 -0
- package/docs/release-notes/0.1.0-alpha.32.md +33 -0
- package/docs/release-notes/0.1.0-alpha.33.md +29 -0
- package/docs/release-notes/0.1.0-alpha.34.md +32 -0
- package/docs/upgrade.md +181 -0
- package/lib/agents/cli-adapter.js +1 -0
- package/lib/cli.js +25 -3
- package/lib/contracts/cli.d.ts +1381 -18
- package/lib/contracts/cli.js +43 -1
- package/lib/contracts/diagnosis.d.ts +2 -1
- package/lib/contracts/diagnosis.js +1 -0
- package/lib/contracts/events.d.ts +760 -5
- package/lib/contracts/events.js +109 -3
- package/lib/contracts/execution.d.ts +112 -1
- package/lib/contracts/execution.js +38 -0
- package/lib/contracts/failure.d.ts +6 -1
- package/lib/contracts/failure.js +5 -1
- package/lib/contracts/handoff.d.ts +702 -0
- package/lib/contracts/handoff.js +305 -0
- package/lib/contracts/index.d.ts +1 -0
- package/lib/contracts/index.js +1 -0
- package/lib/contracts/policy.d.ts +27 -1
- package/lib/contracts/policy.js +38 -2
- package/lib/contracts/published.d.ts +1016 -3
- package/lib/contracts/published.js +2 -0
- package/lib/contracts/repair-policy.js +5 -0
- package/lib/contracts/report.d.ts +118 -2
- package/lib/contracts/report.js +61 -3
- package/lib/control/base-move.d.ts +7 -2
- package/lib/control/base-move.js +14 -1
- package/lib/control/harness.d.ts +81 -19
- package/lib/control/harness.js +8 -93
- package/lib/control/recovery.d.ts +1 -1
- package/lib/control/status.d.ts +235 -0
- package/lib/control/status.js +101 -0
- package/lib/engine/budget.d.ts +78 -0
- package/lib/engine/budget.js +13 -2
- package/lib/engine/classify.d.ts +14 -1
- package/lib/engine/classify.js +34 -0
- package/lib/engine/engine.d.ts +31 -11
- package/lib/engine/engine.js +99 -5
- package/lib/engine/joint-runner.d.ts +6 -0
- package/lib/engine/joint-runner.js +20 -4
- package/lib/engine/property-recovery.js +1 -0
- package/lib/engine/reuse.js +1 -0
- package/lib/engine/runner.d.ts +8 -0
- package/lib/engine/runner.js +120 -16
- package/lib/engine/stall-sweep.d.ts +137 -0
- package/lib/engine/stall-sweep.js +393 -0
- package/lib/environment/activity.d.ts +34 -0
- package/lib/environment/activity.js +55 -0
- package/lib/environment/isolation.d.ts +67 -3
- package/lib/environment/isolation.js +148 -5
- package/lib/environment/lifecycle.js +2 -1
- package/lib/environment/process.d.ts +7 -1
- package/lib/environment/process.js +14 -0
- package/lib/environment/redaction.d.ts +2 -0
- package/lib/environment/redaction.js +19 -0
- package/lib/explain/state.d.ts +26 -5
- package/lib/explain/state.js +41 -0
- package/lib/handoff/index.d.ts +2 -0
- package/lib/handoff/index.js +3 -0
- package/lib/handoff/markdown.d.ts +6 -0
- package/lib/handoff/markdown.js +155 -0
- package/lib/handoff/pack.d.ts +79 -0
- package/lib/handoff/pack.js +531 -0
- package/lib/index.d.ts +19 -3
- package/lib/index.js +18 -1
- package/lib/integrations/connector/redact.d.ts +2 -13
- package/lib/integrations/connector/redact.js +2 -21
- package/lib/integrations/connector/testing.js +1 -1
- package/lib/projections/attempt.d.ts +28 -0
- package/lib/projections/attempt.js +14 -0
- package/lib/projections/next.d.ts +3 -1
- package/lib/projections/next.js +4 -1
- package/lib/projections/stop.d.ts +22 -1
- package/lib/projections/stop.js +73 -15
- package/lib/report/compute.js +229 -21
- package/lib/report/document.js +31 -7
- package/lib/storage/document.d.ts +28 -6
- package/lib/storage/sqlite.d.ts +2 -0
- package/lib/storage/sqlite.js +9 -1
- package/lib/verification/gates-at.d.ts +11 -1
- package/lib/verification/gates-at.js +28 -2
- package/lib/verification/gates.d.ts +3 -1
- package/lib/verification/gates.js +25 -4
- package/package.json +1 -1
- package/schemas/execution-document.schema.json +68 -0
- package/schemas/execution-policy.schema.json +32 -0
- package/schemas/handoff-pack.schema.json +1430 -0
- package/schemas/run-event.schema.json +679 -0
- package/schemas/stop-diagnosis.schema.json +1 -0
- package/schemas/value-report.schema.json +236 -3
package/lib/contracts/cli.js
CHANGED
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { API_VERSION, STATE_VERSION } from "./version.js";
|
|
3
3
|
import { digestSchema, gitShaSchema, idSchema, isoTimeSchema, runtimeNameSchema, targetRefSchema, } from "./primitives.js";
|
|
4
4
|
import { HarnessError, errorCodes } from "./errors.js";
|
|
5
|
-
import { controlStateSchema, controllerLeaseSchema, failureKindSchema, pauseReasons, workStatusSchema, } from "./execution.js";
|
|
5
|
+
import { controlStateSchema, controllerLeaseSchema, failureKindSchema, pauseReasons, workStatusSchema, activitySchema, livenessStateSchema, stallActionSchema, } from "./execution.js";
|
|
6
6
|
import { readRunEventSchema } from "./events.js";
|
|
7
7
|
import { deliveryStateSchema, resultEnvelopeSchema } from "./result.js";
|
|
8
8
|
import { reviewRecordSchema } from "./review.js";
|
|
@@ -14,6 +14,7 @@ import { planCheckDataSchema, planRequestDataSchema } from "./planning.js";
|
|
|
14
14
|
import { toolchainReportSchema } from "./toolchain.js";
|
|
15
15
|
import { operationCatalogSchema } from "./catalog.js";
|
|
16
16
|
import { reportDataSchema } from "./report.js";
|
|
17
|
+
import { handoffPackSchema } from "./handoff.js";
|
|
17
18
|
const state = {
|
|
18
19
|
name: '--state',
|
|
19
20
|
value: 'dir',
|
|
@@ -417,6 +418,29 @@ export const cliCommands = {
|
|
|
417
418
|
],
|
|
418
419
|
refusals: ['NOT_FOUND', 'PATH_CONFLICT'],
|
|
419
420
|
},
|
|
421
|
+
handoff: {
|
|
422
|
+
description: 'Пакет передачи контекста для новой сессии ведущего агента из хранилища: активная работа и стадия, решения и остановки, незавершённые попытки, последние провалы, бюджеты, следующий шаг; только чтение',
|
|
423
|
+
writes: false,
|
|
424
|
+
idempotency: 'Только чтение; агент добавляет только намерения (--intent)',
|
|
425
|
+
args: [
|
|
426
|
+
state,
|
|
427
|
+
{ name: '--graph', value: 'id', required: false, description: 'Только этот граф' },
|
|
428
|
+
{
|
|
429
|
+
name: '--intent',
|
|
430
|
+
value: 'text',
|
|
431
|
+
required: false,
|
|
432
|
+
multiple: true,
|
|
433
|
+
description: 'Намерение агента (до 20, каждое до 1000 знаков); единственный текст не из хранилища',
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
name: '--format',
|
|
437
|
+
value: 'text',
|
|
438
|
+
required: false,
|
|
439
|
+
description: 'json (по умолчанию, конверт HandoffPack) или md (Markdown без конверта)',
|
|
440
|
+
},
|
|
441
|
+
],
|
|
442
|
+
refusals: ['NOT_FOUND'],
|
|
443
|
+
},
|
|
420
444
|
'plan-request': {
|
|
421
445
|
description: 'Собрать read-only запрос планирования из постановки и фактов проекта (роли, gates, репозитории, контекст, ресурсы, контракты, требования) для ведущего агента; модель не вызывается, ничего не пишется',
|
|
422
446
|
writes: false,
|
|
@@ -619,6 +643,17 @@ export const attemptViewSchema = z.strictObject({
|
|
|
619
643
|
failed: z.number().int().min(0),
|
|
620
644
|
remaining: z.number().int().min(0),
|
|
621
645
|
}),
|
|
646
|
+
/** Живость по обходу controller; `idleMs` — только у `quiet` и `stalled`. */
|
|
647
|
+
liveness: z
|
|
648
|
+
.strictObject({
|
|
649
|
+
state: livenessStateSchema,
|
|
650
|
+
since: isoTimeSchema,
|
|
651
|
+
lastMovementAt: isoTimeSchema,
|
|
652
|
+
idleMs: z.number().int().min(0).optional(),
|
|
653
|
+
activity: activitySchema.optional(),
|
|
654
|
+
action: stallActionSchema.optional(),
|
|
655
|
+
})
|
|
656
|
+
.optional(),
|
|
622
657
|
});
|
|
623
658
|
/**
|
|
624
659
|
* Почему выдача стоит (`status --detail`): причина паузы (`queueStop`), кто и
|
|
@@ -658,6 +693,12 @@ export const statusDataSchema = z.strictObject({
|
|
|
658
693
|
status: workStatusSchema,
|
|
659
694
|
attempt: z.number().int().min(0),
|
|
660
695
|
activeRunId: z.string().optional(),
|
|
696
|
+
/**
|
|
697
|
+
* Активная попытка без движения по обходу controller: `quiet` или
|
|
698
|
+
* `stalled` (с `status --detail` — подробности в `detail.attempts`).
|
|
699
|
+
* Нет поля — движется или не оценивалась.
|
|
700
|
+
*/
|
|
701
|
+
liveness: z.enum(['quiet', 'stalled']).optional(),
|
|
661
702
|
resultSha: gitShaSchema.optional(),
|
|
662
703
|
/** Почему поручение сейчас не выдаётся; пусто — может быть выдано. */
|
|
663
704
|
blockers: z.array(blocker),
|
|
@@ -1046,6 +1087,7 @@ export const cliDataSchemas = {
|
|
|
1046
1087
|
init: initDataSchema,
|
|
1047
1088
|
explain: explainDataSchema,
|
|
1048
1089
|
report: reportDataSchema,
|
|
1090
|
+
handoff: handoffPackSchema,
|
|
1049
1091
|
'plan-request': planRequestDataSchema,
|
|
1050
1092
|
'plan-check': planCheckDataSchema,
|
|
1051
1093
|
capabilities: operationCatalogSchema,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const diagnosisActors: readonly ["controller", "lead", "user"];
|
|
3
3
|
export declare const diagnosisActions: readonly ["none", "wait", "review-plan", "retry", "diagnose-failure", "reset-attempts", "raise-budget", "replan-dependents", "recovery-decision", "user-decision", "resume-queue", "fix-environment", "fix-access"];
|
|
4
|
-
export declare const diagnosisCauses: readonly ["provider-auth", "environment", "timeout", "stale-base", "empty-result", "unfinished", "scope-violation", "gate", "review", "review-protocol", "merge", "cancelled", "budget", "needs-lead", "unknown", "runtime-missing", "controller-busy", "operator-pause", "approval-required", "not-ready"];
|
|
4
|
+
export declare const diagnosisCauses: readonly ["provider-auth", "environment", "timeout", "stalled", "stale-base", "empty-result", "unfinished", "scope-violation", "gate", "review", "review-protocol", "merge", "cancelled", "budget", "needs-lead", "unknown", "runtime-missing", "controller-busy", "operator-pause", "approval-required", "not-ready"];
|
|
5
5
|
export declare const diagnosisPhases: readonly ["preflight", "claim", "implementation", "gates", "review", "integration", "delivery"];
|
|
6
6
|
/** Объяснение остановки: код, причина, фаза, кто действует и что допустимо. */
|
|
7
7
|
export declare const stopDiagnosisSchema: z.ZodObject<{
|
|
@@ -50,6 +50,7 @@ export declare const stopDiagnosisSchema: z.ZodObject<{
|
|
|
50
50
|
environment: "environment";
|
|
51
51
|
timeout: "timeout";
|
|
52
52
|
"provider-auth": "provider-auth";
|
|
53
|
+
stalled: "stalled";
|
|
53
54
|
"stale-base": "stale-base";
|
|
54
55
|
"empty-result": "empty-result";
|
|
55
56
|
unfinished: "unfinished";
|