peaks-loop 4.0.8 → 4.0.9
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/CHANGELOG.md +12 -0
- package/dist/cli/commands/_register.js +2 -0
- package/dist/cli/commands/baseline-commands.d.ts +3 -0
- package/dist/cli/commands/baseline-commands.js +146 -0
- package/dist/cli/commands/statusline-commands.js +1 -1
- package/dist/services/capability-audit-service/cross-check.d.ts +8 -0
- package/dist/services/capability-audit-service/cross-check.js +11 -0
- package/dist/services/capability-audit-service/index.d.ts +3 -0
- package/dist/services/capability-audit-service/index.js +2 -0
- package/dist/services/capability-audit-service/runner.d.ts +27 -0
- package/dist/services/capability-audit-service/runner.js +40 -0
- package/dist/services/capability-audit-service/staleness.d.ts +1 -0
- package/dist/services/capability-audit-service/staleness.js +7 -0
- package/dist/services/capability-audit-service/types.d.ts +24 -0
- package/dist/services/capability-audit-service/types.js +1 -0
- package/dist/services/capability-baseline/store.d.ts +33 -0
- package/dist/services/capability-baseline/store.js +80 -0
- package/dist/services/capability-baseline/types.d.ts +45 -0
- package/dist/services/capability-baseline/types.js +5 -0
- package/dist/services/capability-baseline/validator.d.ts +19 -0
- package/dist/services/capability-baseline/validator.js +38 -0
- package/dist/services/capability-guard-runner/contracts/J01.d.ts +2 -0
- package/dist/services/capability-guard-runner/contracts/J01.js +48 -0
- package/dist/services/capability-guard-runner/contracts/J02.d.ts +2 -0
- package/dist/services/capability-guard-runner/contracts/J02.js +34 -0
- package/dist/services/capability-guard-runner/contracts/J03.d.ts +2 -0
- package/dist/services/capability-guard-runner/contracts/J03.js +24 -0
- package/dist/services/capability-guard-runner/contracts/J04.d.ts +2 -0
- package/dist/services/capability-guard-runner/contracts/J04.js +40 -0
- package/dist/services/capability-guard-runner/contracts/J05.d.ts +2 -0
- package/dist/services/capability-guard-runner/contracts/J05.js +21 -0
- package/dist/services/capability-guard-runner/contracts/J06.d.ts +2 -0
- package/dist/services/capability-guard-runner/contracts/J06.js +43 -0
- package/dist/services/capability-guard-runner/contracts/J07.d.ts +2 -0
- package/dist/services/capability-guard-runner/contracts/J07.js +53 -0
- package/dist/services/capability-guard-runner/contracts/J08.d.ts +2 -0
- package/dist/services/capability-guard-runner/contracts/J08.js +43 -0
- package/dist/services/capability-guard-runner/contracts/J09.d.ts +2 -0
- package/dist/services/capability-guard-runner/contracts/J09.js +44 -0
- package/dist/services/capability-guard-runner/contracts/J10.d.ts +2 -0
- package/dist/services/capability-guard-runner/contracts/J10.js +40 -0
- package/dist/services/capability-guard-runner/contracts/J11.d.ts +2 -0
- package/dist/services/capability-guard-runner/contracts/J11.js +39 -0
- package/dist/services/capability-guard-runner/contracts/J12.d.ts +2 -0
- package/dist/services/capability-guard-runner/contracts/J12.js +34 -0
- package/dist/services/capability-guard-runner/contracts/J13.d.ts +2 -0
- package/dist/services/capability-guard-runner/contracts/J13.js +45 -0
- package/dist/services/capability-guard-runner/contracts/J14.d.ts +2 -0
- package/dist/services/capability-guard-runner/contracts/J14.js +36 -0
- package/dist/services/capability-guard-runner/contracts/J15.d.ts +2 -0
- package/dist/services/capability-guard-runner/contracts/J15.js +40 -0
- package/dist/services/capability-guard-runner/diff.d.ts +2 -0
- package/dist/services/capability-guard-runner/diff.js +7 -0
- package/dist/services/capability-guard-runner/runner.d.ts +9 -0
- package/dist/services/capability-guard-runner/runner.js +22 -0
- package/dist/services/capability-guard-runner/types.d.ts +39 -0
- package/dist/services/capability-guard-runner/types.js +1 -0
- package/dist/services/evolution/evolution-types.d.ts +16 -16
- package/dist/services/final-review/final-review-service.d.ts +8 -0
- package/dist/services/final-review/final-review-service.js +14 -0
- package/dist/services/final-review/final-review-types.d.ts +1 -1
- package/dist/services/job/job-progress-store.d.ts +2 -2
- package/dist/services/job/job-types.d.ts +26 -26
- package/dist/services/observability/observability-service.d.ts +2 -2
- package/dist/services/sediment/json-schema.d.ts +4 -4
- package/dist/services/session/session-resume-service.d.ts +4 -0
- package/dist/services/session/session-resume-service.js +4 -0
- package/dist/services/skills/skill-statusline-renderer.d.ts +46 -56
- package/dist/services/skills/skill-statusline-renderer.js +312 -100
- package/package.json +5 -4
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
function assertBaselineRef(contract) {
|
|
2
|
+
if (!contract.source.baselineRow || !contract.source.invariant) {
|
|
3
|
+
throw new Error('GUARD_CONTRACT_MISSING_BASELINE_REF: contract must reference a baseline row and invariant');
|
|
4
|
+
}
|
|
5
|
+
}
|
|
6
|
+
export async function runGuard(contract, ctx) {
|
|
7
|
+
assertBaselineRef(contract);
|
|
8
|
+
return contract.execute(ctx);
|
|
9
|
+
}
|
|
10
|
+
export async function runAllGuards(contracts, ctx) {
|
|
11
|
+
const results = [];
|
|
12
|
+
for (const c of contracts) {
|
|
13
|
+
results.push(await runGuard(c, ctx));
|
|
14
|
+
}
|
|
15
|
+
return {
|
|
16
|
+
pass: results.filter((r) => r.status === 'pass').length,
|
|
17
|
+
fail: results.filter((r) => r.status === 'fail').length,
|
|
18
|
+
skipped: results.filter((r) => r.status === 'skipped').length,
|
|
19
|
+
total: results.length,
|
|
20
|
+
results
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { JourneyId } from '../capability-baseline/types.js';
|
|
2
|
+
export type ContractKind = 'cli-envelope' | 'workflow-trace' | 'hook-assertion' | 'cli-output-golden' | 'asset-roundtrip' | 'concurrency-lease' | 'sop-register' | 'spec-coverage' | 'envelope-arg-shapes';
|
|
3
|
+
export interface GuardContract {
|
|
4
|
+
readonly journeyId: JourneyId;
|
|
5
|
+
readonly kind: ContractKind;
|
|
6
|
+
readonly source: {
|
|
7
|
+
readonly baselineRow: JourneyId;
|
|
8
|
+
readonly invariant: string;
|
|
9
|
+
};
|
|
10
|
+
readonly execute: (ctx: GuardContext) => Promise<GuardRunResult>;
|
|
11
|
+
readonly evidence: {
|
|
12
|
+
readonly kind: ContractKind;
|
|
13
|
+
readonly artifact: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export interface GuardContext {
|
|
17
|
+
readonly projectRoot: string;
|
|
18
|
+
readonly sessionId: string;
|
|
19
|
+
readonly contract: GuardContract;
|
|
20
|
+
readonly baselineInvariant: string;
|
|
21
|
+
}
|
|
22
|
+
export type GuardStatus = 'pass' | 'fail' | 'skipped';
|
|
23
|
+
export interface GuardDiff {
|
|
24
|
+
readonly before: string;
|
|
25
|
+
readonly after: string;
|
|
26
|
+
readonly reason: string;
|
|
27
|
+
}
|
|
28
|
+
export interface GuardRunResult {
|
|
29
|
+
readonly journeyId: JourneyId;
|
|
30
|
+
readonly contract: ContractKind;
|
|
31
|
+
readonly status: GuardStatus;
|
|
32
|
+
readonly diff?: GuardDiff;
|
|
33
|
+
readonly artifactPath: string;
|
|
34
|
+
}
|
|
35
|
+
export type GuardErrorCode = 'GUARD_CONTRACT_MISSING_BASELINE_REF' | 'GUARD_DIFF_DETECTED' | 'GUARD_TEST_FLAKY';
|
|
36
|
+
export interface GuardError {
|
|
37
|
+
readonly code: GuardErrorCode;
|
|
38
|
+
readonly message: string;
|
|
39
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -73,12 +73,12 @@ export declare const EvolutionProposalInputSchema: z.ZodObject<{
|
|
|
73
73
|
red_lines: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
74
74
|
source_traces: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
75
75
|
}, "strip", z.ZodTypeAny, {
|
|
76
|
+
diff: Record<string, unknown>;
|
|
76
77
|
target_kind: "loop" | "bee" | "gate" | "policy" | "evaluator";
|
|
77
78
|
target_release_id: string;
|
|
78
79
|
optimization_dimension: string;
|
|
79
80
|
before_snapshot: Record<string, unknown>;
|
|
80
81
|
after_snapshot: Record<string, unknown>;
|
|
81
|
-
diff: Record<string, unknown>;
|
|
82
82
|
before_score: number;
|
|
83
83
|
after_score: number;
|
|
84
84
|
score_delta_min: number;
|
|
@@ -97,9 +97,9 @@ export declare const EvolutionProposalInputSchema: z.ZodObject<{
|
|
|
97
97
|
author_id: string;
|
|
98
98
|
single_object: true;
|
|
99
99
|
single_optimization_dimension: true;
|
|
100
|
+
diff?: Record<string, unknown> | undefined;
|
|
100
101
|
before_snapshot?: Record<string, unknown> | undefined;
|
|
101
102
|
after_snapshot?: Record<string, unknown> | undefined;
|
|
102
|
-
diff?: Record<string, unknown> | undefined;
|
|
103
103
|
score_delta_min?: number | undefined;
|
|
104
104
|
rubric?: Record<string, unknown> | undefined;
|
|
105
105
|
red_lines?: string[] | undefined;
|
|
@@ -154,12 +154,12 @@ export declare const EvolutionProposalSchema: z.ZodObject<{
|
|
|
154
154
|
schema_version: "peaks.evolution/1";
|
|
155
155
|
id: string;
|
|
156
156
|
created_at: string;
|
|
157
|
+
diff: Record<string, unknown>;
|
|
157
158
|
target_kind: "loop" | "bee" | "gate" | "policy" | "evaluator";
|
|
158
159
|
target_release_id: string;
|
|
159
160
|
optimization_dimension: string;
|
|
160
161
|
before_snapshot: Record<string, unknown>;
|
|
161
162
|
after_snapshot: Record<string, unknown>;
|
|
162
|
-
diff: Record<string, unknown>;
|
|
163
163
|
before_score: number;
|
|
164
164
|
after_score: number;
|
|
165
165
|
score_delta_min: number;
|
|
@@ -187,9 +187,9 @@ export declare const EvolutionProposalSchema: z.ZodObject<{
|
|
|
187
187
|
target_count: 1;
|
|
188
188
|
score_delta: number;
|
|
189
189
|
schema_version?: "peaks.evolution/1" | undefined;
|
|
190
|
+
diff?: Record<string, unknown> | undefined;
|
|
190
191
|
before_snapshot?: Record<string, unknown> | undefined;
|
|
191
192
|
after_snapshot?: Record<string, unknown> | undefined;
|
|
192
|
-
diff?: Record<string, unknown> | undefined;
|
|
193
193
|
score_delta_min?: number | undefined;
|
|
194
194
|
rubric?: Record<string, unknown> | undefined;
|
|
195
195
|
red_lines?: string[] | undefined;
|
|
@@ -293,12 +293,12 @@ export declare const EvolutionEvaluationInputSchema: z.ZodObject<{
|
|
|
293
293
|
schema_version: "peaks.evolution/1";
|
|
294
294
|
id: string;
|
|
295
295
|
created_at: string;
|
|
296
|
+
diff: Record<string, unknown>;
|
|
296
297
|
target_kind: "loop" | "bee" | "gate" | "policy" | "evaluator";
|
|
297
298
|
target_release_id: string;
|
|
298
299
|
optimization_dimension: string;
|
|
299
300
|
before_snapshot: Record<string, unknown>;
|
|
300
301
|
after_snapshot: Record<string, unknown>;
|
|
301
|
-
diff: Record<string, unknown>;
|
|
302
302
|
before_score: number;
|
|
303
303
|
after_score: number;
|
|
304
304
|
score_delta_min: number;
|
|
@@ -326,9 +326,9 @@ export declare const EvolutionEvaluationInputSchema: z.ZodObject<{
|
|
|
326
326
|
target_count: 1;
|
|
327
327
|
score_delta: number;
|
|
328
328
|
schema_version?: "peaks.evolution/1" | undefined;
|
|
329
|
+
diff?: Record<string, unknown> | undefined;
|
|
329
330
|
before_snapshot?: Record<string, unknown> | undefined;
|
|
330
331
|
after_snapshot?: Record<string, unknown> | undefined;
|
|
331
|
-
diff?: Record<string, unknown> | undefined;
|
|
332
332
|
score_delta_min?: number | undefined;
|
|
333
333
|
rubric?: Record<string, unknown> | undefined;
|
|
334
334
|
red_lines?: string[] | undefined;
|
|
@@ -374,16 +374,17 @@ export declare const EvolutionEvaluationInputSchema: z.ZodObject<{
|
|
|
374
374
|
schema_version: "peaks.evolution/1";
|
|
375
375
|
id: string;
|
|
376
376
|
created_at: string;
|
|
377
|
+
verdict: "keep" | "revert" | "needs-user-decision";
|
|
377
378
|
proposal: {
|
|
378
379
|
schema_version: "peaks.evolution/1";
|
|
379
380
|
id: string;
|
|
380
381
|
created_at: string;
|
|
382
|
+
diff: Record<string, unknown>;
|
|
381
383
|
target_kind: "loop" | "bee" | "gate" | "policy" | "evaluator";
|
|
382
384
|
target_release_id: string;
|
|
383
385
|
optimization_dimension: string;
|
|
384
386
|
before_snapshot: Record<string, unknown>;
|
|
385
387
|
after_snapshot: Record<string, unknown>;
|
|
386
|
-
diff: Record<string, unknown>;
|
|
387
388
|
before_score: number;
|
|
388
389
|
after_score: number;
|
|
389
390
|
score_delta_min: number;
|
|
@@ -410,12 +411,12 @@ export declare const EvolutionEvaluationInputSchema: z.ZodObject<{
|
|
|
410
411
|
safetyRegressionRisks: string[];
|
|
411
412
|
blocker?: string | undefined;
|
|
412
413
|
};
|
|
413
|
-
verdict: "keep" | "revert" | "needs-user-decision";
|
|
414
414
|
user_confirmation_pointer?: string | undefined;
|
|
415
415
|
brief_pointer?: string | undefined;
|
|
416
416
|
}, {
|
|
417
417
|
id: string;
|
|
418
418
|
created_at: string;
|
|
419
|
+
verdict: "keep" | "revert" | "needs-user-decision";
|
|
419
420
|
proposal: {
|
|
420
421
|
id: string;
|
|
421
422
|
created_at: string;
|
|
@@ -431,9 +432,9 @@ export declare const EvolutionEvaluationInputSchema: z.ZodObject<{
|
|
|
431
432
|
target_count: 1;
|
|
432
433
|
score_delta: number;
|
|
433
434
|
schema_version?: "peaks.evolution/1" | undefined;
|
|
435
|
+
diff?: Record<string, unknown> | undefined;
|
|
434
436
|
before_snapshot?: Record<string, unknown> | undefined;
|
|
435
437
|
after_snapshot?: Record<string, unknown> | undefined;
|
|
436
|
-
diff?: Record<string, unknown> | undefined;
|
|
437
438
|
score_delta_min?: number | undefined;
|
|
438
439
|
rubric?: Record<string, unknown> | undefined;
|
|
439
440
|
red_lines?: string[] | undefined;
|
|
@@ -452,7 +453,6 @@ export declare const EvolutionEvaluationInputSchema: z.ZodObject<{
|
|
|
452
453
|
safetyRegressionRisks?: string[] | undefined;
|
|
453
454
|
blocker?: string | undefined;
|
|
454
455
|
};
|
|
455
|
-
verdict: "keep" | "revert" | "needs-user-decision";
|
|
456
456
|
schema_version?: "peaks.evolution/1" | undefined;
|
|
457
457
|
user_confirmation_pointer?: string | undefined;
|
|
458
458
|
brief_pointer?: string | undefined;
|
|
@@ -506,12 +506,12 @@ export declare const EvolutionEvaluationSchema: z.ZodObject<{
|
|
|
506
506
|
schema_version: "peaks.evolution/1";
|
|
507
507
|
id: string;
|
|
508
508
|
created_at: string;
|
|
509
|
+
diff: Record<string, unknown>;
|
|
509
510
|
target_kind: "loop" | "bee" | "gate" | "policy" | "evaluator";
|
|
510
511
|
target_release_id: string;
|
|
511
512
|
optimization_dimension: string;
|
|
512
513
|
before_snapshot: Record<string, unknown>;
|
|
513
514
|
after_snapshot: Record<string, unknown>;
|
|
514
|
-
diff: Record<string, unknown>;
|
|
515
515
|
before_score: number;
|
|
516
516
|
after_score: number;
|
|
517
517
|
score_delta_min: number;
|
|
@@ -539,9 +539,9 @@ export declare const EvolutionEvaluationSchema: z.ZodObject<{
|
|
|
539
539
|
target_count: 1;
|
|
540
540
|
score_delta: number;
|
|
541
541
|
schema_version?: "peaks.evolution/1" | undefined;
|
|
542
|
+
diff?: Record<string, unknown> | undefined;
|
|
542
543
|
before_snapshot?: Record<string, unknown> | undefined;
|
|
543
544
|
after_snapshot?: Record<string, unknown> | undefined;
|
|
544
|
-
diff?: Record<string, unknown> | undefined;
|
|
545
545
|
score_delta_min?: number | undefined;
|
|
546
546
|
rubric?: Record<string, unknown> | undefined;
|
|
547
547
|
red_lines?: string[] | undefined;
|
|
@@ -589,17 +589,18 @@ export declare const EvolutionEvaluationSchema: z.ZodObject<{
|
|
|
589
589
|
schema_version: "peaks.evolution/1";
|
|
590
590
|
id: string;
|
|
591
591
|
created_at: string;
|
|
592
|
+
verdict: "keep" | "revert" | "needs-user-decision";
|
|
592
593
|
score_delta: number;
|
|
593
594
|
proposal: {
|
|
594
595
|
schema_version: "peaks.evolution/1";
|
|
595
596
|
id: string;
|
|
596
597
|
created_at: string;
|
|
598
|
+
diff: Record<string, unknown>;
|
|
597
599
|
target_kind: "loop" | "bee" | "gate" | "policy" | "evaluator";
|
|
598
600
|
target_release_id: string;
|
|
599
601
|
optimization_dimension: string;
|
|
600
602
|
before_snapshot: Record<string, unknown>;
|
|
601
603
|
after_snapshot: Record<string, unknown>;
|
|
602
|
-
diff: Record<string, unknown>;
|
|
603
604
|
before_score: number;
|
|
604
605
|
after_score: number;
|
|
605
606
|
score_delta_min: number;
|
|
@@ -626,12 +627,12 @@ export declare const EvolutionEvaluationSchema: z.ZodObject<{
|
|
|
626
627
|
safetyRegressionRisks: string[];
|
|
627
628
|
blocker?: string | undefined;
|
|
628
629
|
};
|
|
629
|
-
verdict: "keep" | "revert" | "needs-user-decision";
|
|
630
630
|
user_confirmation_pointer?: string | undefined;
|
|
631
631
|
brief_pointer?: string | undefined;
|
|
632
632
|
}, {
|
|
633
633
|
id: string;
|
|
634
634
|
created_at: string;
|
|
635
|
+
verdict: "keep" | "revert" | "needs-user-decision";
|
|
635
636
|
score_delta: number;
|
|
636
637
|
proposal: {
|
|
637
638
|
id: string;
|
|
@@ -648,9 +649,9 @@ export declare const EvolutionEvaluationSchema: z.ZodObject<{
|
|
|
648
649
|
target_count: 1;
|
|
649
650
|
score_delta: number;
|
|
650
651
|
schema_version?: "peaks.evolution/1" | undefined;
|
|
652
|
+
diff?: Record<string, unknown> | undefined;
|
|
651
653
|
before_snapshot?: Record<string, unknown> | undefined;
|
|
652
654
|
after_snapshot?: Record<string, unknown> | undefined;
|
|
653
|
-
diff?: Record<string, unknown> | undefined;
|
|
654
655
|
score_delta_min?: number | undefined;
|
|
655
656
|
rubric?: Record<string, unknown> | undefined;
|
|
656
657
|
red_lines?: string[] | undefined;
|
|
@@ -669,7 +670,6 @@ export declare const EvolutionEvaluationSchema: z.ZodObject<{
|
|
|
669
670
|
safetyRegressionRisks?: string[] | undefined;
|
|
670
671
|
blocker?: string | undefined;
|
|
671
672
|
};
|
|
672
|
-
verdict: "keep" | "revert" | "needs-user-decision";
|
|
673
673
|
schema_version?: "peaks.evolution/1" | undefined;
|
|
674
674
|
user_confirmation_pointer?: string | undefined;
|
|
675
675
|
brief_pointer?: string | undefined;
|
|
@@ -10,6 +10,7 @@ export interface LlmRunner {
|
|
|
10
10
|
}>;
|
|
11
11
|
}
|
|
12
12
|
import type { FinalReviewOutput } from './final-review-types.js';
|
|
13
|
+
import type { CapabilityAuditResult } from '../capability-audit-service/types.js';
|
|
13
14
|
export interface PrepareFinalReviewOptions {
|
|
14
15
|
readonly projectRoot: string;
|
|
15
16
|
readonly sessionId: string;
|
|
@@ -20,3 +21,10 @@ export declare class IncompleteFinalReviewError extends Error {
|
|
|
20
21
|
constructor(message: string);
|
|
21
22
|
}
|
|
22
23
|
export declare function prepareFinalReview(rid: string, opts: PrepareFinalReviewOptions): Promise<FinalReviewOutput>;
|
|
24
|
+
export declare function decideFifthDimension(input: {
|
|
25
|
+
readonly audit: CapabilityAuditResult | null;
|
|
26
|
+
readonly nowMs: number;
|
|
27
|
+
}): {
|
|
28
|
+
readonly verdict: 'pass' | 'fail' | 'inconclusive';
|
|
29
|
+
readonly reason: string;
|
|
30
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { readFileSync } from 'node:fs';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
|
+
import { isStale } from '../capability-audit-service/staleness.js';
|
|
3
4
|
const REQUIRED_DIMENSIONS = [
|
|
4
5
|
'functional-completeness',
|
|
5
6
|
'problem-resolution',
|
|
@@ -50,3 +51,16 @@ export async function prepareFinalReview(rid, opts) {
|
|
|
50
51
|
}
|
|
51
52
|
return output;
|
|
52
53
|
}
|
|
54
|
+
export function decideFifthDimension(input) {
|
|
55
|
+
if (input.audit === null)
|
|
56
|
+
return { verdict: 'inconclusive', reason: 'AUDIT_GUARD_NOT_RUN' };
|
|
57
|
+
if (isStale(input.audit.auditedAt, input.nowMs))
|
|
58
|
+
return { verdict: 'inconclusive', reason: 'AUDIT_STALE' };
|
|
59
|
+
if (input.audit.crossCheck.guardVsAudit === 'diverge')
|
|
60
|
+
return { verdict: 'inconclusive', reason: 'AUDIT_CROSS_CHECK_DIVERGE' };
|
|
61
|
+
if (input.audit.verdict === 'consistent')
|
|
62
|
+
return { verdict: 'pass', reason: 'audit consistent' };
|
|
63
|
+
if (input.audit.verdict === 'drifted')
|
|
64
|
+
return { verdict: 'fail', reason: 'audit drifted' };
|
|
65
|
+
return { verdict: 'inconclusive', reason: 'audit inconclusive' };
|
|
66
|
+
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* failure (return to human for re-prompting) — autonomous work must
|
|
16
16
|
* never proceed on a partial review.
|
|
17
17
|
*/
|
|
18
|
-
export type DimensionKind = 'functional-completeness' | 'problem-resolution' | 'no-new-bugs' | 'existing-functionality-intact';
|
|
18
|
+
export type DimensionKind = 'functional-completeness' | 'problem-resolution' | 'no-new-bugs' | 'existing-functionality-intact' | 'capability-consistency';
|
|
19
19
|
export type DimensionVerdict = 'pass' | 'fail' | 'inconclusive';
|
|
20
20
|
export type EvidenceKind = 'test-result' | 'test-coverage' | 'manual-spot-check' | 'pre-post-diff' | 'regression-suite' | 'ac-mapping';
|
|
21
21
|
export type DimensionConfidence = 'high' | 'medium' | 'low';
|
|
@@ -31,16 +31,16 @@ export declare const JobProgressSchema: z.ZodObject<{
|
|
|
31
31
|
updatedAt: z.ZodString;
|
|
32
32
|
}, "strip", z.ZodTypeAny, {
|
|
33
33
|
updatedAt: string;
|
|
34
|
-
done: number;
|
|
35
34
|
schemaVersion: 1;
|
|
35
|
+
done: number;
|
|
36
36
|
jobId: string;
|
|
37
37
|
total: number;
|
|
38
38
|
currentSlice: string;
|
|
39
39
|
lastCommitSha: string | null;
|
|
40
40
|
}, {
|
|
41
41
|
updatedAt: string;
|
|
42
|
-
done: number;
|
|
43
42
|
schemaVersion: 1;
|
|
43
|
+
done: number;
|
|
44
44
|
jobId: string;
|
|
45
45
|
total: number;
|
|
46
46
|
currentSlice: string;
|
|
@@ -9,7 +9,7 @@ export declare const SliceStateSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.
|
|
|
9
9
|
repairCycles: z.ZodDefault<z.ZodNumber>;
|
|
10
10
|
blockedReason: z.ZodOptional<z.ZodString>;
|
|
11
11
|
}, "strip", z.ZodTypeAny, {
|
|
12
|
-
status: "pending" | "blocked" | "failed" | "
|
|
12
|
+
status: "pending" | "blocked" | "failed" | "skipped" | "done" | "in-progress";
|
|
13
13
|
label: string;
|
|
14
14
|
sliceId: string;
|
|
15
15
|
repairCycles: number;
|
|
@@ -18,7 +18,7 @@ export declare const SliceStateSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.
|
|
|
18
18
|
failureReason?: string | undefined;
|
|
19
19
|
blockedReason?: string | undefined;
|
|
20
20
|
}, {
|
|
21
|
-
status: "pending" | "blocked" | "failed" | "
|
|
21
|
+
status: "pending" | "blocked" | "failed" | "skipped" | "done" | "in-progress";
|
|
22
22
|
label: string;
|
|
23
23
|
sliceId: string;
|
|
24
24
|
commitSha?: string | undefined;
|
|
@@ -27,7 +27,7 @@ export declare const SliceStateSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.
|
|
|
27
27
|
repairCycles?: number | undefined;
|
|
28
28
|
blockedReason?: string | undefined;
|
|
29
29
|
}>, {
|
|
30
|
-
status: "pending" | "blocked" | "failed" | "
|
|
30
|
+
status: "pending" | "blocked" | "failed" | "skipped" | "done" | "in-progress";
|
|
31
31
|
label: string;
|
|
32
32
|
sliceId: string;
|
|
33
33
|
repairCycles: number;
|
|
@@ -36,7 +36,7 @@ export declare const SliceStateSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.
|
|
|
36
36
|
failureReason?: string | undefined;
|
|
37
37
|
blockedReason?: string | undefined;
|
|
38
38
|
}, {
|
|
39
|
-
status: "pending" | "blocked" | "failed" | "
|
|
39
|
+
status: "pending" | "blocked" | "failed" | "skipped" | "done" | "in-progress";
|
|
40
40
|
label: string;
|
|
41
41
|
sliceId: string;
|
|
42
42
|
commitSha?: string | undefined;
|
|
@@ -45,7 +45,7 @@ export declare const SliceStateSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.
|
|
|
45
45
|
repairCycles?: number | undefined;
|
|
46
46
|
blockedReason?: string | undefined;
|
|
47
47
|
}>, {
|
|
48
|
-
status: "pending" | "blocked" | "failed" | "
|
|
48
|
+
status: "pending" | "blocked" | "failed" | "skipped" | "done" | "in-progress";
|
|
49
49
|
label: string;
|
|
50
50
|
sliceId: string;
|
|
51
51
|
repairCycles: number;
|
|
@@ -54,7 +54,7 @@ export declare const SliceStateSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.
|
|
|
54
54
|
failureReason?: string | undefined;
|
|
55
55
|
blockedReason?: string | undefined;
|
|
56
56
|
}, {
|
|
57
|
-
status: "pending" | "blocked" | "failed" | "
|
|
57
|
+
status: "pending" | "blocked" | "failed" | "skipped" | "done" | "in-progress";
|
|
58
58
|
label: string;
|
|
59
59
|
sliceId: string;
|
|
60
60
|
commitSha?: string | undefined;
|
|
@@ -63,7 +63,7 @@ export declare const SliceStateSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.
|
|
|
63
63
|
repairCycles?: number | undefined;
|
|
64
64
|
blockedReason?: string | undefined;
|
|
65
65
|
}>, {
|
|
66
|
-
status: "pending" | "blocked" | "failed" | "
|
|
66
|
+
status: "pending" | "blocked" | "failed" | "skipped" | "done" | "in-progress";
|
|
67
67
|
label: string;
|
|
68
68
|
sliceId: string;
|
|
69
69
|
repairCycles: number;
|
|
@@ -72,7 +72,7 @@ export declare const SliceStateSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.
|
|
|
72
72
|
failureReason?: string | undefined;
|
|
73
73
|
blockedReason?: string | undefined;
|
|
74
74
|
}, {
|
|
75
|
-
status: "pending" | "blocked" | "failed" | "
|
|
75
|
+
status: "pending" | "blocked" | "failed" | "skipped" | "done" | "in-progress";
|
|
76
76
|
label: string;
|
|
77
77
|
sliceId: string;
|
|
78
78
|
commitSha?: string | undefined;
|
|
@@ -117,7 +117,7 @@ export declare const JobStateSchema: z.ZodObject<{
|
|
|
117
117
|
repairCycles: z.ZodDefault<z.ZodNumber>;
|
|
118
118
|
blockedReason: z.ZodOptional<z.ZodString>;
|
|
119
119
|
}, "strip", z.ZodTypeAny, {
|
|
120
|
-
status: "pending" | "blocked" | "failed" | "
|
|
120
|
+
status: "pending" | "blocked" | "failed" | "skipped" | "done" | "in-progress";
|
|
121
121
|
label: string;
|
|
122
122
|
sliceId: string;
|
|
123
123
|
repairCycles: number;
|
|
@@ -126,7 +126,7 @@ export declare const JobStateSchema: z.ZodObject<{
|
|
|
126
126
|
failureReason?: string | undefined;
|
|
127
127
|
blockedReason?: string | undefined;
|
|
128
128
|
}, {
|
|
129
|
-
status: "pending" | "blocked" | "failed" | "
|
|
129
|
+
status: "pending" | "blocked" | "failed" | "skipped" | "done" | "in-progress";
|
|
130
130
|
label: string;
|
|
131
131
|
sliceId: string;
|
|
132
132
|
commitSha?: string | undefined;
|
|
@@ -135,7 +135,7 @@ export declare const JobStateSchema: z.ZodObject<{
|
|
|
135
135
|
repairCycles?: number | undefined;
|
|
136
136
|
blockedReason?: string | undefined;
|
|
137
137
|
}>, {
|
|
138
|
-
status: "pending" | "blocked" | "failed" | "
|
|
138
|
+
status: "pending" | "blocked" | "failed" | "skipped" | "done" | "in-progress";
|
|
139
139
|
label: string;
|
|
140
140
|
sliceId: string;
|
|
141
141
|
repairCycles: number;
|
|
@@ -144,7 +144,7 @@ export declare const JobStateSchema: z.ZodObject<{
|
|
|
144
144
|
failureReason?: string | undefined;
|
|
145
145
|
blockedReason?: string | undefined;
|
|
146
146
|
}, {
|
|
147
|
-
status: "pending" | "blocked" | "failed" | "
|
|
147
|
+
status: "pending" | "blocked" | "failed" | "skipped" | "done" | "in-progress";
|
|
148
148
|
label: string;
|
|
149
149
|
sliceId: string;
|
|
150
150
|
commitSha?: string | undefined;
|
|
@@ -153,7 +153,7 @@ export declare const JobStateSchema: z.ZodObject<{
|
|
|
153
153
|
repairCycles?: number | undefined;
|
|
154
154
|
blockedReason?: string | undefined;
|
|
155
155
|
}>, {
|
|
156
|
-
status: "pending" | "blocked" | "failed" | "
|
|
156
|
+
status: "pending" | "blocked" | "failed" | "skipped" | "done" | "in-progress";
|
|
157
157
|
label: string;
|
|
158
158
|
sliceId: string;
|
|
159
159
|
repairCycles: number;
|
|
@@ -162,7 +162,7 @@ export declare const JobStateSchema: z.ZodObject<{
|
|
|
162
162
|
failureReason?: string | undefined;
|
|
163
163
|
blockedReason?: string | undefined;
|
|
164
164
|
}, {
|
|
165
|
-
status: "pending" | "blocked" | "failed" | "
|
|
165
|
+
status: "pending" | "blocked" | "failed" | "skipped" | "done" | "in-progress";
|
|
166
166
|
label: string;
|
|
167
167
|
sliceId: string;
|
|
168
168
|
commitSha?: string | undefined;
|
|
@@ -171,7 +171,7 @@ export declare const JobStateSchema: z.ZodObject<{
|
|
|
171
171
|
repairCycles?: number | undefined;
|
|
172
172
|
blockedReason?: string | undefined;
|
|
173
173
|
}>, {
|
|
174
|
-
status: "pending" | "blocked" | "failed" | "
|
|
174
|
+
status: "pending" | "blocked" | "failed" | "skipped" | "done" | "in-progress";
|
|
175
175
|
label: string;
|
|
176
176
|
sliceId: string;
|
|
177
177
|
repairCycles: number;
|
|
@@ -180,7 +180,7 @@ export declare const JobStateSchema: z.ZodObject<{
|
|
|
180
180
|
failureReason?: string | undefined;
|
|
181
181
|
blockedReason?: string | undefined;
|
|
182
182
|
}, {
|
|
183
|
-
status: "pending" | "blocked" | "failed" | "
|
|
183
|
+
status: "pending" | "blocked" | "failed" | "skipped" | "done" | "in-progress";
|
|
184
184
|
label: string;
|
|
185
185
|
sliceId: string;
|
|
186
186
|
commitSha?: string | undefined;
|
|
@@ -200,7 +200,7 @@ export declare const JobStateSchema: z.ZodObject<{
|
|
|
200
200
|
rotateEvery: number;
|
|
201
201
|
mainSessionCycle: number;
|
|
202
202
|
slices: {
|
|
203
|
-
status: "pending" | "blocked" | "failed" | "
|
|
203
|
+
status: "pending" | "blocked" | "failed" | "skipped" | "done" | "in-progress";
|
|
204
204
|
label: string;
|
|
205
205
|
sliceId: string;
|
|
206
206
|
repairCycles: number;
|
|
@@ -221,7 +221,7 @@ export declare const JobStateSchema: z.ZodObject<{
|
|
|
221
221
|
jobId: string;
|
|
222
222
|
startedAt: string;
|
|
223
223
|
slices: {
|
|
224
|
-
status: "pending" | "blocked" | "failed" | "
|
|
224
|
+
status: "pending" | "blocked" | "failed" | "skipped" | "done" | "in-progress";
|
|
225
225
|
label: string;
|
|
226
226
|
sliceId: string;
|
|
227
227
|
commitSha?: string | undefined;
|
|
@@ -294,8 +294,8 @@ export declare const JobStatusSummarySchema: z.ZodObject<{
|
|
|
294
294
|
}, "strip", z.ZodTypeAny, {
|
|
295
295
|
blocked: number;
|
|
296
296
|
failed: number;
|
|
297
|
-
done: number;
|
|
298
297
|
skipped: number;
|
|
298
|
+
done: number;
|
|
299
299
|
total: number;
|
|
300
300
|
mainLoopStrategy: "single" | "rotating";
|
|
301
301
|
mainSessionCycle: number;
|
|
@@ -312,8 +312,8 @@ export declare const JobStatusSummarySchema: z.ZodObject<{
|
|
|
312
312
|
}, {
|
|
313
313
|
blocked: number;
|
|
314
314
|
failed: number;
|
|
315
|
-
done: number;
|
|
316
315
|
skipped: number;
|
|
316
|
+
done: number;
|
|
317
317
|
total: number;
|
|
318
318
|
mainLoopStrategy: "single" | "rotating";
|
|
319
319
|
mainSessionCycle: number;
|
|
@@ -374,7 +374,7 @@ export declare const JobCheckpointInputSchema: z.ZodEffects<z.ZodEffects<z.ZodOb
|
|
|
374
374
|
json: z.ZodDefault<z.ZodBoolean>;
|
|
375
375
|
}, "strip", z.ZodTypeAny, {
|
|
376
376
|
project: string;
|
|
377
|
-
state: "failed" | "
|
|
377
|
+
state: "failed" | "skipped" | "done";
|
|
378
378
|
json: boolean;
|
|
379
379
|
jobId: string;
|
|
380
380
|
sliceId: string;
|
|
@@ -382,7 +382,7 @@ export declare const JobCheckpointInputSchema: z.ZodEffects<z.ZodEffects<z.ZodOb
|
|
|
382
382
|
commitSha?: string | undefined;
|
|
383
383
|
}, {
|
|
384
384
|
project: string;
|
|
385
|
-
state: "failed" | "
|
|
385
|
+
state: "failed" | "skipped" | "done";
|
|
386
386
|
jobId: string;
|
|
387
387
|
sliceId: string;
|
|
388
388
|
reason?: string | undefined;
|
|
@@ -390,7 +390,7 @@ export declare const JobCheckpointInputSchema: z.ZodEffects<z.ZodEffects<z.ZodOb
|
|
|
390
390
|
commitSha?: string | undefined;
|
|
391
391
|
}>, {
|
|
392
392
|
project: string;
|
|
393
|
-
state: "failed" | "
|
|
393
|
+
state: "failed" | "skipped" | "done";
|
|
394
394
|
json: boolean;
|
|
395
395
|
jobId: string;
|
|
396
396
|
sliceId: string;
|
|
@@ -398,7 +398,7 @@ export declare const JobCheckpointInputSchema: z.ZodEffects<z.ZodEffects<z.ZodOb
|
|
|
398
398
|
commitSha?: string | undefined;
|
|
399
399
|
}, {
|
|
400
400
|
project: string;
|
|
401
|
-
state: "failed" | "
|
|
401
|
+
state: "failed" | "skipped" | "done";
|
|
402
402
|
jobId: string;
|
|
403
403
|
sliceId: string;
|
|
404
404
|
reason?: string | undefined;
|
|
@@ -406,7 +406,7 @@ export declare const JobCheckpointInputSchema: z.ZodEffects<z.ZodEffects<z.ZodOb
|
|
|
406
406
|
commitSha?: string | undefined;
|
|
407
407
|
}>, {
|
|
408
408
|
project: string;
|
|
409
|
-
state: "failed" | "
|
|
409
|
+
state: "failed" | "skipped" | "done";
|
|
410
410
|
json: boolean;
|
|
411
411
|
jobId: string;
|
|
412
412
|
sliceId: string;
|
|
@@ -414,7 +414,7 @@ export declare const JobCheckpointInputSchema: z.ZodEffects<z.ZodEffects<z.ZodOb
|
|
|
414
414
|
commitSha?: string | undefined;
|
|
415
415
|
}, {
|
|
416
416
|
project: string;
|
|
417
|
-
state: "failed" | "
|
|
417
|
+
state: "failed" | "skipped" | "done";
|
|
418
418
|
jobId: string;
|
|
419
419
|
sliceId: string;
|
|
420
420
|
reason?: string | undefined;
|
|
@@ -33,17 +33,17 @@ export declare const ObservabilityEventSchema: z.ZodObject<{
|
|
|
33
33
|
role: z.ZodOptional<z.ZodEnum<["rd", "qa", "code-reviewer", "karpathy-reviewer", "peaks-security-audit", "peaks-perf-audit"]>>;
|
|
34
34
|
detail: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
35
35
|
}, "strip", z.ZodTypeAny, {
|
|
36
|
+
schemaVersion: 1;
|
|
36
37
|
sessionId: string;
|
|
37
38
|
detail: Record<string, unknown>;
|
|
38
|
-
schemaVersion: 1;
|
|
39
39
|
ts: string;
|
|
40
40
|
category: "dispatch" | "slice-transition" | "checkpoint" | "mode-gate" | "context-trigger" | "post-compact" | "cycle" | "token-usage" | "monotonic-trigger" | "lease";
|
|
41
41
|
role?: "qa" | "rd" | "code-reviewer" | "karpathy-reviewer" | "peaks-security-audit" | "peaks-perf-audit" | undefined;
|
|
42
42
|
sliceRid?: string | undefined;
|
|
43
43
|
}, {
|
|
44
|
+
schemaVersion: 1;
|
|
44
45
|
sessionId: string;
|
|
45
46
|
detail: Record<string, unknown>;
|
|
46
|
-
schemaVersion: 1;
|
|
47
47
|
ts: string;
|
|
48
48
|
category: "dispatch" | "slice-transition" | "checkpoint" | "mode-gate" | "context-trigger" | "post-compact" | "cycle" | "token-usage" | "monotonic-trigger" | "lease";
|
|
49
49
|
role?: "qa" | "rd" | "code-reviewer" | "karpathy-reviewer" | "peaks-security-audit" | "peaks-perf-audit" | undefined;
|
|
@@ -107,6 +107,7 @@ export declare const BeeManifestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
107
107
|
}, "strip", z.ZodTypeAny, {
|
|
108
108
|
name: string;
|
|
109
109
|
description: string;
|
|
110
|
+
schemaVersion: "peaks.bee/1";
|
|
110
111
|
segments: {
|
|
111
112
|
name: string;
|
|
112
113
|
outputs: {
|
|
@@ -128,7 +129,6 @@ export declare const BeeManifestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
128
129
|
retireOnMissesInRow?: number | undefined;
|
|
129
130
|
};
|
|
130
131
|
source: "user" | "system";
|
|
131
|
-
schemaVersion: "peaks.bee/1";
|
|
132
132
|
promotion_status: "candidate" | "stable" | "retired" | "system-stable";
|
|
133
133
|
entrypoint: {
|
|
134
134
|
preamble: string;
|
|
@@ -142,6 +142,7 @@ export declare const BeeManifestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
142
142
|
}, {
|
|
143
143
|
name: string;
|
|
144
144
|
description: string;
|
|
145
|
+
schemaVersion: "peaks.bee/1";
|
|
145
146
|
segments: {
|
|
146
147
|
name: string;
|
|
147
148
|
outputs: {
|
|
@@ -163,7 +164,6 @@ export declare const BeeManifestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
163
164
|
retireOnMissesInRow?: number | undefined;
|
|
164
165
|
};
|
|
165
166
|
source: "user" | "system";
|
|
166
|
-
schemaVersion: "peaks.bee/1";
|
|
167
167
|
promotion_status: "candidate" | "stable" | "retired" | "system-stable";
|
|
168
168
|
entrypoint: {
|
|
169
169
|
preamble: string;
|
|
@@ -177,6 +177,7 @@ export declare const BeeManifestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
177
177
|
}>, {
|
|
178
178
|
name: string;
|
|
179
179
|
description: string;
|
|
180
|
+
schemaVersion: "peaks.bee/1";
|
|
180
181
|
segments: {
|
|
181
182
|
name: string;
|
|
182
183
|
outputs: {
|
|
@@ -198,7 +199,6 @@ export declare const BeeManifestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
198
199
|
retireOnMissesInRow?: number | undefined;
|
|
199
200
|
};
|
|
200
201
|
source: "user" | "system";
|
|
201
|
-
schemaVersion: "peaks.bee/1";
|
|
202
202
|
promotion_status: "candidate" | "stable" | "retired" | "system-stable";
|
|
203
203
|
entrypoint: {
|
|
204
204
|
preamble: string;
|
|
@@ -212,6 +212,7 @@ export declare const BeeManifestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
212
212
|
}, {
|
|
213
213
|
name: string;
|
|
214
214
|
description: string;
|
|
215
|
+
schemaVersion: "peaks.bee/1";
|
|
215
216
|
segments: {
|
|
216
217
|
name: string;
|
|
217
218
|
outputs: {
|
|
@@ -233,7 +234,6 @@ export declare const BeeManifestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
233
234
|
retireOnMissesInRow?: number | undefined;
|
|
234
235
|
};
|
|
235
236
|
source: "user" | "system";
|
|
236
|
-
schemaVersion: "peaks.bee/1";
|
|
237
237
|
promotion_status: "candidate" | "stable" | "retired" | "system-stable";
|
|
238
238
|
entrypoint: {
|
|
239
239
|
preamble: string;
|
|
@@ -6,6 +6,10 @@
|
|
|
6
6
|
* prepend to its own prompt. The output is LLM-friendly: stable
|
|
7
7
|
* headings, monospace paths, and bullet lists — easy for the model to
|
|
8
8
|
* scan and reason about.
|
|
9
|
+
*
|
|
10
|
+
* Resume locates the deepestGate (the latest completed gate in the
|
|
11
|
+
* workflow) so the skill can pick up the next step without re-asking
|
|
12
|
+
* the user for state already captured at that gate.
|
|
9
13
|
*/
|
|
10
14
|
import { type CheckpointSnapshot } from './session-checkpoint-service.js';
|
|
11
15
|
export interface ResumeOptions {
|