harnery 0.19.0 → 0.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/supervisor/planning.d.ts.map +1 -1
- package/dist/core/supervisor/planning.js +98 -51
- package/dist/core/workflow/types.d.ts +3 -0
- package/dist/core/workflow/types.d.ts.map +1 -1
- package/dist/core/workflow/validate.d.ts +3 -2
- package/dist/core/workflow/validate.d.ts.map +1 -1
- package/dist/core/workflow/validate.js +23 -2
- package/package.json +1 -1
- package/src/core/supervisor/planning.ts +102 -52
- package/src/core/workflow/types.ts +3 -0
- package/src/core/workflow/validate.ts +26 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"planning.d.ts","sourceRoot":"","sources":["../../../src/core/supervisor/planning.ts"],"names":[],"mappings":"AAcA,OAAO,EAEL,KAAK,UAAU,
|
|
1
|
+
{"version":3,"file":"planning.d.ts","sourceRoot":"","sources":["../../../src/core/supervisor/planning.ts"],"names":[],"mappings":"AAcA,OAAO,EAEL,KAAK,UAAU,EAQhB,MAAM,sBAAsB,CAAC;AAM9B,OAAO,EAIL,KAAK,qBAAqB,EAU3B,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAUnD,MAAM,WAAW,yBAAyB;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,gBAAgB,CAAC;IACzB,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,WAAW,GAAG,OAAO,GAAG,aAAa,GAAG,aAAa,CAAC,CAAC;IAChF,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC;AAED,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,yBAAyB,GAC/B,OAAO,CAAC,qBAAqB,CAAC,CA+LhC;AAuLD,wBAAgB,2BAA2B,CAAC,KAAK,EAAE;IACjD,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,gBAAgB,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,qBAAqB,CAsHxB;AAED,wBAAgB,4BAA4B,CAAC,KAAK,EAAE;IAClD,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,qBAAqB,CAYxB"}
|
|
@@ -10,6 +10,7 @@ const TEMPLATE_ID = /^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/;
|
|
|
10
10
|
const MAX_RECORD_BYTES = 256 * 1024;
|
|
11
11
|
const MAX_EVENTS_BYTES = 512 * 1024;
|
|
12
12
|
const MAX_REASON = 2_000;
|
|
13
|
+
const PROPOSAL_ROOT_RULE = "proposal.root names one newly proposed work key using a root-capable template; it does not preserve or repeat active_root, which is context only";
|
|
13
14
|
export async function runSupervisorPlanner(input) {
|
|
14
15
|
const coordRoot = resolve(input.coordRoot);
|
|
15
16
|
const policy = input.record.intent.replanning;
|
|
@@ -439,7 +440,7 @@ function plannerScript(coordRoot, record, planId, trigger) {
|
|
|
439
440
|
: "Return decision=apply with a replacement immutable root graph, or decision=attention when human judgment is required.",
|
|
440
441
|
"Never claim mission completion unless the frozen mission acceptance is met. Never request a workflow outside the frozen template catalog.",
|
|
441
442
|
"Dependencies may name an active work ID or an earlier key in your proposed work array.",
|
|
442
|
-
|
|
443
|
+
`Every proposed item must be reachable from root. ${PROPOSAL_ROOT_RULE}.`,
|
|
443
444
|
"Work keys are lowercase identifiers no longer than 32 characters. Keep titles within 200 characters, objectives within 4000 characters, and each acceptance criterion within 500 characters.",
|
|
444
445
|
`Plan id: ${planId}`,
|
|
445
446
|
`Planning trigger: ${trigger}`,
|
|
@@ -484,7 +485,7 @@ function plannerScript(coordRoot, record, planId, trigger) {
|
|
|
484
485
|
: null,
|
|
485
486
|
})))}`,
|
|
486
487
|
].join("\n\n");
|
|
487
|
-
const schema = planProposalSchema(record);
|
|
488
|
+
const schema = planProposalSchema(record, trigger);
|
|
488
489
|
return [
|
|
489
490
|
`export const meta = ${JSON.stringify({ name: `replan-${planId}` })};`,
|
|
490
491
|
"export default async ({ agent, stage }) => {",
|
|
@@ -507,27 +508,35 @@ function plannerReviewScript(record, planId, initialCandidate, trigger) {
|
|
|
507
508
|
const review = policy?.review;
|
|
508
509
|
if (!policy || !review)
|
|
509
510
|
throw new Error(`supervisor ${record.intent.id} does not review plans`);
|
|
510
|
-
const proposalSchema = planProposalSchema(record);
|
|
511
|
+
const proposalSchema = planProposalSchema(record, trigger);
|
|
511
512
|
const reviewerSchema = {
|
|
512
513
|
type: "object",
|
|
513
514
|
properties: {
|
|
514
515
|
verdict: { type: "string", enum: ["approve", "revise", "attention"] },
|
|
515
|
-
rationale: { type: "string" },
|
|
516
|
+
rationale: { type: "string", minLength: 1, maxLength: MAX_REASON },
|
|
516
517
|
findings: {
|
|
517
518
|
type: "array",
|
|
519
|
+
maxItems: 50,
|
|
518
520
|
items: {
|
|
519
521
|
type: "object",
|
|
520
522
|
properties: {
|
|
521
|
-
code: {
|
|
523
|
+
code: {
|
|
524
|
+
type: "string",
|
|
525
|
+
minLength: 1,
|
|
526
|
+
maxLength: 100,
|
|
527
|
+
pattern: "^[a-z][a-z0-9._-]*$",
|
|
528
|
+
},
|
|
522
529
|
severity: { type: "string", enum: ["blocking", "advisory"] },
|
|
523
|
-
summary: { type: "string" },
|
|
524
|
-
recommendation: { type: "string" },
|
|
530
|
+
summary: { type: "string", minLength: 1, maxLength: 1_000 },
|
|
531
|
+
recommendation: { type: "string", minLength: 1, maxLength: 1_000 },
|
|
525
532
|
},
|
|
526
533
|
required: ["code", "severity", "summary", "recommendation"],
|
|
534
|
+
additionalProperties: false,
|
|
527
535
|
},
|
|
528
536
|
},
|
|
529
537
|
},
|
|
530
538
|
required: ["verdict", "rationale", "findings"],
|
|
539
|
+
additionalProperties: false,
|
|
531
540
|
};
|
|
532
541
|
return [
|
|
533
542
|
`export const meta = ${JSON.stringify({ name: `review-${planId}` })};`,
|
|
@@ -544,6 +553,7 @@ function plannerReviewScript(record, planId, initialCandidate, trigger) {
|
|
|
544
553
|
mission: record.intent.mission ?? null,
|
|
545
554
|
original_root: record.intent.root_work_id,
|
|
546
555
|
active_root: record.projection.root_work_id,
|
|
556
|
+
proposal_root_rule: PROPOSAL_ROOT_RULE,
|
|
547
557
|
templates: policy.templates,
|
|
548
558
|
})};`,
|
|
549
559
|
` let candidate = ${JSON.stringify(initialCandidate)};`,
|
|
@@ -561,6 +571,7 @@ function plannerReviewScript(record, planId, initialCandidate, trigger) {
|
|
|
561
571
|
" 'Review this bounded supervisor plan candidate independently.',",
|
|
562
572
|
" 'Return approve only when the candidate is complete, scoped, and satisfies the goal context.',",
|
|
563
573
|
" 'Return revise for blocking defects. Return attention when human judgment is required.',",
|
|
574
|
+
" 'Apply proposal_root_rule exactly; never require proposal.root to equal active_root.',",
|
|
564
575
|
" 'Goal context: ' + JSON.stringify(goalContext),",
|
|
565
576
|
" 'Candidate: ' + JSON.stringify(candidate)",
|
|
566
577
|
" ].join('\\n\\n');",
|
|
@@ -579,6 +590,7 @@ function plannerReviewScript(record, planId, initialCandidate, trigger) {
|
|
|
579
590
|
" const revisionPrompt = [",
|
|
580
591
|
" 'Revise this supervisor plan candidate. Return a complete replacement candidate, not a patch.',",
|
|
581
592
|
" 'Do not merge reviewer text mechanically; satisfy the blocking findings within the frozen goal and template constraints.',",
|
|
593
|
+
" 'Apply proposal_root_rule exactly; never require proposal.root to equal active_root.',",
|
|
582
594
|
" 'Goal context: ' + JSON.stringify(goalContext),",
|
|
583
595
|
" 'Current candidate: ' + JSON.stringify(candidate),",
|
|
584
596
|
" 'Reviewer findings: ' + JSON.stringify(reviewersOut)",
|
|
@@ -893,61 +905,96 @@ function hasReviewRecoveryEvidence(coordRoot, goalId, planId) {
|
|
|
893
905
|
return (existsSync(reviewReceiptPath(coordRoot, goalId, planId)) ||
|
|
894
906
|
existsSync(join(coordRoot, ".harnery", "workflows", reviewWorkflowRunId(planId), "proof.json")));
|
|
895
907
|
}
|
|
896
|
-
function planProposalSchema(record) {
|
|
908
|
+
function planProposalSchema(record, trigger) {
|
|
897
909
|
const policy = record.intent.replanning;
|
|
898
910
|
if (!policy)
|
|
899
911
|
throw new Error(`supervisor ${record.intent.id} does not allow replanning`);
|
|
900
|
-
|
|
912
|
+
const rationale = { type: "string", minLength: 1, maxLength: MAX_REASON };
|
|
913
|
+
const workItem = {
|
|
901
914
|
type: "object",
|
|
902
915
|
properties: {
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
916
|
+
key: { type: "string", pattern: "^[a-z][a-z0-9-]{0,31}$", maxLength: 32 },
|
|
917
|
+
title: { type: "string", minLength: 1, maxLength: 200 },
|
|
918
|
+
objective: { type: "string", minLength: 1, maxLength: 4_000 },
|
|
919
|
+
acceptance: {
|
|
920
|
+
type: "array",
|
|
921
|
+
maxItems: 50,
|
|
922
|
+
items: { type: "string", minLength: 1, maxLength: 500 },
|
|
906
923
|
},
|
|
907
|
-
|
|
908
|
-
root: { type: "string", maxLength: 32 },
|
|
909
|
-
work: {
|
|
924
|
+
dependencies: {
|
|
910
925
|
type: "array",
|
|
911
|
-
maxItems:
|
|
912
|
-
items: {
|
|
913
|
-
type: "object",
|
|
914
|
-
properties: {
|
|
915
|
-
key: { type: "string", pattern: "^[a-z][a-z0-9-]{0,31}$", maxLength: 32 },
|
|
916
|
-
title: { type: "string", minLength: 1, maxLength: 200 },
|
|
917
|
-
objective: { type: "string", minLength: 1, maxLength: 4_000 },
|
|
918
|
-
acceptance: {
|
|
919
|
-
type: "array",
|
|
920
|
-
maxItems: 50,
|
|
921
|
-
items: { type: "string", minLength: 1, maxLength: 500 },
|
|
922
|
-
},
|
|
923
|
-
dependencies: {
|
|
924
|
-
type: "array",
|
|
925
|
-
maxItems: 50,
|
|
926
|
-
items: { type: "string", minLength: 1, maxLength: 100 },
|
|
927
|
-
},
|
|
928
|
-
template: { type: "string", enum: Object.keys(policy.templates), maxLength: 64 },
|
|
929
|
-
},
|
|
930
|
-
required: ["key", "title", "objective", "acceptance", "dependencies", "template"],
|
|
931
|
-
},
|
|
926
|
+
maxItems: 50,
|
|
927
|
+
items: { type: "string", minLength: 1, maxLength: 100 },
|
|
932
928
|
},
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
929
|
+
template: { type: "string", enum: Object.keys(policy.templates), maxLength: 64 },
|
|
930
|
+
},
|
|
931
|
+
required: ["key", "title", "objective", "acceptance", "dependencies", "template"],
|
|
932
|
+
additionalProperties: false,
|
|
933
|
+
};
|
|
934
|
+
const milestone = {
|
|
935
|
+
type: "object",
|
|
936
|
+
properties: {
|
|
937
|
+
sequence: {
|
|
938
|
+
type: "number",
|
|
939
|
+
enum: [record.projection.milestones_completed + 1],
|
|
940
|
+
},
|
|
941
|
+
title: { type: "string", minLength: 1, maxLength: 200 },
|
|
942
|
+
objective: { type: "string", minLength: 1, maxLength: 4_000 },
|
|
943
|
+
acceptance: {
|
|
944
|
+
type: "array",
|
|
945
|
+
minItems: 1,
|
|
946
|
+
maxItems: 50,
|
|
947
|
+
items: { type: "string", minLength: 1, maxLength: 500 },
|
|
947
948
|
},
|
|
948
949
|
},
|
|
949
|
-
required: ["
|
|
950
|
+
required: ["sequence", "title", "objective", "acceptance"],
|
|
951
|
+
additionalProperties: false,
|
|
950
952
|
};
|
|
953
|
+
const applyProperties = {
|
|
954
|
+
decision: { type: "string", enum: ["apply"] },
|
|
955
|
+
rationale,
|
|
956
|
+
root: {
|
|
957
|
+
type: "string",
|
|
958
|
+
minLength: 1,
|
|
959
|
+
maxLength: 32,
|
|
960
|
+
pattern: "^[a-z][a-z0-9-]{0,31}$",
|
|
961
|
+
},
|
|
962
|
+
work: {
|
|
963
|
+
type: "array",
|
|
964
|
+
minItems: 1,
|
|
965
|
+
maxItems: policy.max_work_items_per_plan,
|
|
966
|
+
items: workItem,
|
|
967
|
+
},
|
|
968
|
+
};
|
|
969
|
+
const applyRequired = ["decision", "rationale", "root", "work"];
|
|
970
|
+
if (record.intent.mission) {
|
|
971
|
+
applyProperties.milestone = milestone;
|
|
972
|
+
applyRequired.push("milestone");
|
|
973
|
+
}
|
|
974
|
+
const apply = {
|
|
975
|
+
type: "object",
|
|
976
|
+
properties: applyProperties,
|
|
977
|
+
required: applyRequired,
|
|
978
|
+
additionalProperties: false,
|
|
979
|
+
};
|
|
980
|
+
const terminal = (decision) => ({
|
|
981
|
+
type: "object",
|
|
982
|
+
properties: {
|
|
983
|
+
decision: { type: "string", enum: [decision] },
|
|
984
|
+
rationale,
|
|
985
|
+
root: { type: "string", enum: [""] },
|
|
986
|
+
work: { type: "array", maxItems: 0 },
|
|
987
|
+
},
|
|
988
|
+
required: ["decision", "rationale", "root", "work"],
|
|
989
|
+
additionalProperties: false,
|
|
990
|
+
});
|
|
991
|
+
const branches = [];
|
|
992
|
+
if (!record.intent.mission || record.projection.milestones_remaining > 0)
|
|
993
|
+
branches.push(apply);
|
|
994
|
+
if (record.intent.mission && trigger === "milestone")
|
|
995
|
+
branches.push(terminal("complete"));
|
|
996
|
+
branches.push(terminal("attention"));
|
|
997
|
+
return { type: "object", oneOf: branches };
|
|
951
998
|
}
|
|
952
999
|
function normalizeProposal(planId, raw, record, previouslyApplied, trigger, preservedProposedAt) {
|
|
953
1000
|
const policy = record.intent.replanning;
|
|
@@ -169,9 +169,12 @@ export interface HarnessEvidenceCapability {
|
|
|
169
169
|
/** JSON-schema *subset* accepted by stage gates (see validate.ts). */
|
|
170
170
|
export interface StageSchema {
|
|
171
171
|
type: "object" | "array" | "string" | "number" | "boolean";
|
|
172
|
+
/** Exact-one branch selection, evaluated before the base schema. */
|
|
173
|
+
oneOf?: StageSchema[];
|
|
172
174
|
/** type=object */
|
|
173
175
|
properties?: Record<string, StageSchema>;
|
|
174
176
|
required?: string[];
|
|
177
|
+
additionalProperties?: boolean;
|
|
175
178
|
/** type=array */
|
|
176
179
|
items?: StageSchema;
|
|
177
180
|
minItems?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/workflow/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,qBAAqB,EACrB,uBAAuB,EACvB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,UAAU,EACX,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE/D,eAAO,MAAM,6BAA6B,EAAG,CAAU,CAAC;AAExD,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,aAAa,CAAC;AACjG,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAC;AAC1E,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,QAAQ,CAAC;AACnD,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,aAAa,GAAG,SAAS,CAAC;AACvE,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG,QAAQ,CAAC;AACvD,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,MAAM,CAAC;AAEnD,MAAM,WAAW,mBAAmB;IAClC,0EAA0E;IAC1E,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAA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OAAO,EAAE,WAAW,CAAC;QAAC,IAAI,EAAE,WAAW,CAAA;KAAE,CAAC,CAAC;IAC5D,6DAA6D;IAC7D,MAAM,CAAC,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;CACzC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Minimal validator for the StageSchema JSON-schema subset. Deliberately tiny:
|
|
3
3
|
* a full JSON Schema implementation would pull a dependency (ajv) for
|
|
4
|
-
* validation depth workflow gates don't need. Supported: type,
|
|
5
|
-
* required, items, minItems/maxItems,
|
|
4
|
+
* validation depth workflow gates don't need. Supported: type, oneOf,
|
|
5
|
+
* properties, required, additionalProperties, items, minItems/maxItems,
|
|
6
|
+
* minLength/maxLength, pattern, and enum.
|
|
6
7
|
* Returns a list of human-readable problems (empty = valid) so the engine can
|
|
7
8
|
* feed failures back into the retry prompt verbatim.
|
|
8
9
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../src/core/workflow/validate.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../src/core/workflow/validate.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,SAAM,GAAG,MAAM,EAAE,CAmG/F;AAED,qEAAqE;AACrE,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAUlF"}
|
|
@@ -1,13 +1,27 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Minimal validator for the StageSchema JSON-schema subset. Deliberately tiny:
|
|
3
3
|
* a full JSON Schema implementation would pull a dependency (ajv) for
|
|
4
|
-
* validation depth workflow gates don't need. Supported: type,
|
|
5
|
-
* required, items, minItems/maxItems,
|
|
4
|
+
* validation depth workflow gates don't need. Supported: type, oneOf,
|
|
5
|
+
* properties, required, additionalProperties, items, minItems/maxItems,
|
|
6
|
+
* minLength/maxLength, pattern, and enum.
|
|
6
7
|
* Returns a list of human-readable problems (empty = valid) so the engine can
|
|
7
8
|
* feed failures back into the retry prompt verbatim.
|
|
8
9
|
*/
|
|
9
10
|
export function validateAgainstSchema(value, schema, path = "$") {
|
|
10
11
|
const problems = [];
|
|
12
|
+
if (schema.oneOf) {
|
|
13
|
+
const branches = schema.oneOf.map((branch) => validateAgainstSchema(value, branch, path));
|
|
14
|
+
const matches = branches.filter((branch) => branch.length === 0).length;
|
|
15
|
+
if (matches !== 1) {
|
|
16
|
+
if (matches > 1) {
|
|
17
|
+
return [`${path}: expected exactly one schema option to match, got ${matches}`];
|
|
18
|
+
}
|
|
19
|
+
return [
|
|
20
|
+
`${path}: expected exactly one schema option to match`,
|
|
21
|
+
...branches.map((branch, index) => `${path}: option ${index + 1}: ${branch.slice(0, 4).join("; ") || "did not match"}`),
|
|
22
|
+
];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
11
25
|
if (schema.enum) {
|
|
12
26
|
if (!schema.enum.some((v) => v === value)) {
|
|
13
27
|
problems.push(`${path}: expected one of ${JSON.stringify(schema.enum)}, got ${short(value)}`);
|
|
@@ -28,6 +42,13 @@ export function validateAgainstSchema(value, schema, path = "$") {
|
|
|
28
42
|
if (key in obj)
|
|
29
43
|
problems.push(...validateAgainstSchema(obj[key], sub, `${path}.${key}`));
|
|
30
44
|
}
|
|
45
|
+
if (schema.additionalProperties === false) {
|
|
46
|
+
const allowed = new Set(Object.keys(schema.properties ?? {}));
|
|
47
|
+
for (const key of Object.keys(obj)) {
|
|
48
|
+
if (!allowed.has(key))
|
|
49
|
+
problems.push(`${path}.${key}: unexpected property`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
31
52
|
return problems;
|
|
32
53
|
}
|
|
33
54
|
case "array": {
|
package/package.json
CHANGED
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
type ResultDigest,
|
|
19
19
|
readWorkflowProof,
|
|
20
20
|
runWorkflow,
|
|
21
|
+
type StageSchema,
|
|
21
22
|
WorkflowParkedError,
|
|
22
23
|
type WorkflowProof,
|
|
23
24
|
workflowScriptDigest,
|
|
@@ -49,6 +50,8 @@ const TEMPLATE_ID = /^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/;
|
|
|
49
50
|
const MAX_RECORD_BYTES = 256 * 1024;
|
|
50
51
|
const MAX_EVENTS_BYTES = 512 * 1024;
|
|
51
52
|
const MAX_REASON = 2_000;
|
|
53
|
+
const PROPOSAL_ROOT_RULE =
|
|
54
|
+
"proposal.root names one newly proposed work key using a root-capable template; it does not preserve or repeat active_root, which is context only";
|
|
52
55
|
|
|
53
56
|
export interface RunSupervisorPlannerInput {
|
|
54
57
|
coordRoot: string;
|
|
@@ -628,7 +631,7 @@ function plannerScript(
|
|
|
628
631
|
: "Return decision=apply with a replacement immutable root graph, or decision=attention when human judgment is required.",
|
|
629
632
|
"Never claim mission completion unless the frozen mission acceptance is met. Never request a workflow outside the frozen template catalog.",
|
|
630
633
|
"Dependencies may name an active work ID or an earlier key in your proposed work array.",
|
|
631
|
-
|
|
634
|
+
`Every proposed item must be reachable from root. ${PROPOSAL_ROOT_RULE}.`,
|
|
632
635
|
"Work keys are lowercase identifiers no longer than 32 characters. Keep titles within 200 characters, objectives within 4000 characters, and each acceptance criterion within 500 characters.",
|
|
633
636
|
`Plan id: ${planId}`,
|
|
634
637
|
`Planning trigger: ${trigger}`,
|
|
@@ -677,7 +680,7 @@ function plannerScript(
|
|
|
677
680
|
})),
|
|
678
681
|
)}`,
|
|
679
682
|
].join("\n\n");
|
|
680
|
-
const schema = planProposalSchema(record);
|
|
683
|
+
const schema = planProposalSchema(record, trigger);
|
|
681
684
|
return [
|
|
682
685
|
`export const meta = ${JSON.stringify({ name: `replan-${planId}` })};`,
|
|
683
686
|
"export default async ({ agent, stage }) => {",
|
|
@@ -707,27 +710,35 @@ function plannerReviewScript(
|
|
|
707
710
|
const policy = record.intent.replanning;
|
|
708
711
|
const review = policy?.review;
|
|
709
712
|
if (!policy || !review) throw new Error(`supervisor ${record.intent.id} does not review plans`);
|
|
710
|
-
const proposalSchema = planProposalSchema(record);
|
|
711
|
-
const reviewerSchema = {
|
|
713
|
+
const proposalSchema = planProposalSchema(record, trigger);
|
|
714
|
+
const reviewerSchema: StageSchema = {
|
|
712
715
|
type: "object",
|
|
713
716
|
properties: {
|
|
714
717
|
verdict: { type: "string", enum: ["approve", "revise", "attention"] },
|
|
715
|
-
rationale: { type: "string" },
|
|
718
|
+
rationale: { type: "string", minLength: 1, maxLength: MAX_REASON },
|
|
716
719
|
findings: {
|
|
717
720
|
type: "array",
|
|
721
|
+
maxItems: 50,
|
|
718
722
|
items: {
|
|
719
723
|
type: "object",
|
|
720
724
|
properties: {
|
|
721
|
-
code: {
|
|
725
|
+
code: {
|
|
726
|
+
type: "string",
|
|
727
|
+
minLength: 1,
|
|
728
|
+
maxLength: 100,
|
|
729
|
+
pattern: "^[a-z][a-z0-9._-]*$",
|
|
730
|
+
},
|
|
722
731
|
severity: { type: "string", enum: ["blocking", "advisory"] },
|
|
723
|
-
summary: { type: "string" },
|
|
724
|
-
recommendation: { type: "string" },
|
|
732
|
+
summary: { type: "string", minLength: 1, maxLength: 1_000 },
|
|
733
|
+
recommendation: { type: "string", minLength: 1, maxLength: 1_000 },
|
|
725
734
|
},
|
|
726
735
|
required: ["code", "severity", "summary", "recommendation"],
|
|
736
|
+
additionalProperties: false,
|
|
727
737
|
},
|
|
728
738
|
},
|
|
729
739
|
},
|
|
730
740
|
required: ["verdict", "rationale", "findings"],
|
|
741
|
+
additionalProperties: false,
|
|
731
742
|
};
|
|
732
743
|
return [
|
|
733
744
|
`export const meta = ${JSON.stringify({ name: `review-${planId}` })};`,
|
|
@@ -744,6 +755,7 @@ function plannerReviewScript(
|
|
|
744
755
|
mission: record.intent.mission ?? null,
|
|
745
756
|
original_root: record.intent.root_work_id,
|
|
746
757
|
active_root: record.projection.root_work_id,
|
|
758
|
+
proposal_root_rule: PROPOSAL_ROOT_RULE,
|
|
747
759
|
templates: policy.templates,
|
|
748
760
|
})};`,
|
|
749
761
|
` let candidate = ${JSON.stringify(initialCandidate)};`,
|
|
@@ -761,6 +773,7 @@ function plannerReviewScript(
|
|
|
761
773
|
" 'Review this bounded supervisor plan candidate independently.',",
|
|
762
774
|
" 'Return approve only when the candidate is complete, scoped, and satisfies the goal context.',",
|
|
763
775
|
" 'Return revise for blocking defects. Return attention when human judgment is required.',",
|
|
776
|
+
" 'Apply proposal_root_rule exactly; never require proposal.root to equal active_root.',",
|
|
764
777
|
" 'Goal context: ' + JSON.stringify(goalContext),",
|
|
765
778
|
" 'Candidate: ' + JSON.stringify(candidate)",
|
|
766
779
|
" ].join('\\n\\n');",
|
|
@@ -779,6 +792,7 @@ function plannerReviewScript(
|
|
|
779
792
|
" const revisionPrompt = [",
|
|
780
793
|
" 'Revise this supervisor plan candidate. Return a complete replacement candidate, not a patch.',",
|
|
781
794
|
" 'Do not merge reviewer text mechanically; satisfy the blocking findings within the frozen goal and template constraints.',",
|
|
795
|
+
" 'Apply proposal_root_rule exactly; never require proposal.root to equal active_root.',",
|
|
782
796
|
" 'Goal context: ' + JSON.stringify(goalContext),",
|
|
783
797
|
" 'Current candidate: ' + JSON.stringify(candidate),",
|
|
784
798
|
" 'Reviewer findings: ' + JSON.stringify(reviewersOut)",
|
|
@@ -1163,60 +1177,96 @@ function hasReviewRecoveryEvidence(coordRoot: string, goalId: string, planId: st
|
|
|
1163
1177
|
);
|
|
1164
1178
|
}
|
|
1165
1179
|
|
|
1166
|
-
function planProposalSchema(
|
|
1180
|
+
function planProposalSchema(
|
|
1181
|
+
record: SupervisorRecord,
|
|
1182
|
+
trigger: NonNullable<SupervisorPlanRequest["trigger"]>,
|
|
1183
|
+
): StageSchema {
|
|
1167
1184
|
const policy = record.intent.replanning;
|
|
1168
1185
|
if (!policy) throw new Error(`supervisor ${record.intent.id} does not allow replanning`);
|
|
1169
|
-
|
|
1186
|
+
const rationale: StageSchema = { type: "string", minLength: 1, maxLength: MAX_REASON };
|
|
1187
|
+
const workItem: StageSchema = {
|
|
1170
1188
|
type: "object",
|
|
1171
1189
|
properties: {
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1190
|
+
key: { type: "string", pattern: "^[a-z][a-z0-9-]{0,31}$", maxLength: 32 },
|
|
1191
|
+
title: { type: "string", minLength: 1, maxLength: 200 },
|
|
1192
|
+
objective: { type: "string", minLength: 1, maxLength: 4_000 },
|
|
1193
|
+
acceptance: {
|
|
1194
|
+
type: "array",
|
|
1195
|
+
maxItems: 50,
|
|
1196
|
+
items: { type: "string", minLength: 1, maxLength: 500 },
|
|
1175
1197
|
},
|
|
1176
|
-
|
|
1177
|
-
root: { type: "string", maxLength: 32 },
|
|
1178
|
-
work: {
|
|
1198
|
+
dependencies: {
|
|
1179
1199
|
type: "array",
|
|
1180
|
-
maxItems:
|
|
1181
|
-
items: {
|
|
1182
|
-
type: "object",
|
|
1183
|
-
properties: {
|
|
1184
|
-
key: { type: "string", pattern: "^[a-z][a-z0-9-]{0,31}$", maxLength: 32 },
|
|
1185
|
-
title: { type: "string", minLength: 1, maxLength: 200 },
|
|
1186
|
-
objective: { type: "string", minLength: 1, maxLength: 4_000 },
|
|
1187
|
-
acceptance: {
|
|
1188
|
-
type: "array",
|
|
1189
|
-
maxItems: 50,
|
|
1190
|
-
items: { type: "string", minLength: 1, maxLength: 500 },
|
|
1191
|
-
},
|
|
1192
|
-
dependencies: {
|
|
1193
|
-
type: "array",
|
|
1194
|
-
maxItems: 50,
|
|
1195
|
-
items: { type: "string", minLength: 1, maxLength: 100 },
|
|
1196
|
-
},
|
|
1197
|
-
template: { type: "string", enum: Object.keys(policy.templates), maxLength: 64 },
|
|
1198
|
-
},
|
|
1199
|
-
required: ["key", "title", "objective", "acceptance", "dependencies", "template"],
|
|
1200
|
-
},
|
|
1200
|
+
maxItems: 50,
|
|
1201
|
+
items: { type: "string", minLength: 1, maxLength: 100 },
|
|
1201
1202
|
},
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1203
|
+
template: { type: "string", enum: Object.keys(policy.templates), maxLength: 64 },
|
|
1204
|
+
},
|
|
1205
|
+
required: ["key", "title", "objective", "acceptance", "dependencies", "template"],
|
|
1206
|
+
additionalProperties: false,
|
|
1207
|
+
};
|
|
1208
|
+
const milestone: StageSchema = {
|
|
1209
|
+
type: "object",
|
|
1210
|
+
properties: {
|
|
1211
|
+
sequence: {
|
|
1212
|
+
type: "number",
|
|
1213
|
+
enum: [record.projection.milestones_completed + 1],
|
|
1214
|
+
},
|
|
1215
|
+
title: { type: "string", minLength: 1, maxLength: 200 },
|
|
1216
|
+
objective: { type: "string", minLength: 1, maxLength: 4_000 },
|
|
1217
|
+
acceptance: {
|
|
1218
|
+
type: "array",
|
|
1219
|
+
minItems: 1,
|
|
1220
|
+
maxItems: 50,
|
|
1221
|
+
items: { type: "string", minLength: 1, maxLength: 500 },
|
|
1216
1222
|
},
|
|
1217
1223
|
},
|
|
1218
|
-
required: ["
|
|
1224
|
+
required: ["sequence", "title", "objective", "acceptance"],
|
|
1225
|
+
additionalProperties: false,
|
|
1226
|
+
};
|
|
1227
|
+
const applyProperties: Record<string, StageSchema> = {
|
|
1228
|
+
decision: { type: "string", enum: ["apply"] },
|
|
1229
|
+
rationale,
|
|
1230
|
+
root: {
|
|
1231
|
+
type: "string",
|
|
1232
|
+
minLength: 1,
|
|
1233
|
+
maxLength: 32,
|
|
1234
|
+
pattern: "^[a-z][a-z0-9-]{0,31}$",
|
|
1235
|
+
},
|
|
1236
|
+
work: {
|
|
1237
|
+
type: "array",
|
|
1238
|
+
minItems: 1,
|
|
1239
|
+
maxItems: policy.max_work_items_per_plan,
|
|
1240
|
+
items: workItem,
|
|
1241
|
+
},
|
|
1219
1242
|
};
|
|
1243
|
+
const applyRequired = ["decision", "rationale", "root", "work"];
|
|
1244
|
+
if (record.intent.mission) {
|
|
1245
|
+
applyProperties.milestone = milestone;
|
|
1246
|
+
applyRequired.push("milestone");
|
|
1247
|
+
}
|
|
1248
|
+
const apply: StageSchema = {
|
|
1249
|
+
type: "object",
|
|
1250
|
+
properties: applyProperties,
|
|
1251
|
+
required: applyRequired,
|
|
1252
|
+
additionalProperties: false,
|
|
1253
|
+
};
|
|
1254
|
+
const terminal = (decision: "complete" | "attention"): StageSchema => ({
|
|
1255
|
+
type: "object",
|
|
1256
|
+
properties: {
|
|
1257
|
+
decision: { type: "string", enum: [decision] },
|
|
1258
|
+
rationale,
|
|
1259
|
+
root: { type: "string", enum: [""] },
|
|
1260
|
+
work: { type: "array", maxItems: 0 },
|
|
1261
|
+
},
|
|
1262
|
+
required: ["decision", "rationale", "root", "work"],
|
|
1263
|
+
additionalProperties: false,
|
|
1264
|
+
});
|
|
1265
|
+
const branches: StageSchema[] = [];
|
|
1266
|
+
if (!record.intent.mission || record.projection.milestones_remaining > 0) branches.push(apply);
|
|
1267
|
+
if (record.intent.mission && trigger === "milestone") branches.push(terminal("complete"));
|
|
1268
|
+
branches.push(terminal("attention"));
|
|
1269
|
+
return { type: "object", oneOf: branches };
|
|
1220
1270
|
}
|
|
1221
1271
|
|
|
1222
1272
|
function normalizeProposal(
|
|
@@ -201,9 +201,12 @@ export interface HarnessEvidenceCapability {
|
|
|
201
201
|
/** JSON-schema *subset* accepted by stage gates (see validate.ts). */
|
|
202
202
|
export interface StageSchema {
|
|
203
203
|
type: "object" | "array" | "string" | "number" | "boolean";
|
|
204
|
+
/** Exact-one branch selection, evaluated before the base schema. */
|
|
205
|
+
oneOf?: StageSchema[];
|
|
204
206
|
/** type=object */
|
|
205
207
|
properties?: Record<string, StageSchema>;
|
|
206
208
|
required?: string[];
|
|
209
|
+
additionalProperties?: boolean;
|
|
207
210
|
/** type=array */
|
|
208
211
|
items?: StageSchema;
|
|
209
212
|
minItems?: number;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Minimal validator for the StageSchema JSON-schema subset. Deliberately tiny:
|
|
3
3
|
* a full JSON Schema implementation would pull a dependency (ajv) for
|
|
4
|
-
* validation depth workflow gates don't need. Supported: type,
|
|
5
|
-
* required, items, minItems/maxItems,
|
|
4
|
+
* validation depth workflow gates don't need. Supported: type, oneOf,
|
|
5
|
+
* properties, required, additionalProperties, items, minItems/maxItems,
|
|
6
|
+
* minLength/maxLength, pattern, and enum.
|
|
6
7
|
* Returns a list of human-readable problems (empty = valid) so the engine can
|
|
7
8
|
* feed failures back into the retry prompt verbatim.
|
|
8
9
|
*/
|
|
@@ -12,6 +13,23 @@ import type { StageSchema } from "./types.ts";
|
|
|
12
13
|
export function validateAgainstSchema(value: unknown, schema: StageSchema, path = "$"): string[] {
|
|
13
14
|
const problems: string[] = [];
|
|
14
15
|
|
|
16
|
+
if (schema.oneOf) {
|
|
17
|
+
const branches = schema.oneOf.map((branch) => validateAgainstSchema(value, branch, path));
|
|
18
|
+
const matches = branches.filter((branch) => branch.length === 0).length;
|
|
19
|
+
if (matches !== 1) {
|
|
20
|
+
if (matches > 1) {
|
|
21
|
+
return [`${path}: expected exactly one schema option to match, got ${matches}`];
|
|
22
|
+
}
|
|
23
|
+
return [
|
|
24
|
+
`${path}: expected exactly one schema option to match`,
|
|
25
|
+
...branches.map(
|
|
26
|
+
(branch, index) =>
|
|
27
|
+
`${path}: option ${index + 1}: ${branch.slice(0, 4).join("; ") || "did not match"}`,
|
|
28
|
+
),
|
|
29
|
+
];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
15
33
|
if (schema.enum) {
|
|
16
34
|
if (!schema.enum.some((v) => v === value)) {
|
|
17
35
|
problems.push(`${path}: expected one of ${JSON.stringify(schema.enum)}, got ${short(value)}`);
|
|
@@ -31,6 +49,12 @@ export function validateAgainstSchema(value: unknown, schema: StageSchema, path
|
|
|
31
49
|
for (const [key, sub] of Object.entries(schema.properties ?? {})) {
|
|
32
50
|
if (key in obj) problems.push(...validateAgainstSchema(obj[key], sub, `${path}.${key}`));
|
|
33
51
|
}
|
|
52
|
+
if (schema.additionalProperties === false) {
|
|
53
|
+
const allowed = new Set(Object.keys(schema.properties ?? {}));
|
|
54
|
+
for (const key of Object.keys(obj)) {
|
|
55
|
+
if (!allowed.has(key)) problems.push(`${path}.${key}: unexpected property`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
34
58
|
return problems;
|
|
35
59
|
}
|
|
36
60
|
case "array": {
|