@attalabs/vinaya 0.44.0 → 0.47.0
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 +6 -4
- package/dist/checks/bin/check-body-bare-digits.js +262 -201
- package/dist/checks/bin/check-branch-topology.js +70 -23
- package/dist/checks/bin/check-brief-shape.js +262 -201
- package/dist/checks/bin/check-changeset-coverage.js +94 -16
- package/dist/checks/bin/check-ci-shard-coverage.js +3 -0
- package/dist/checks/bin/check-closes-n.js +157 -40
- package/dist/checks/bin/check-coherence.js +365 -251
- package/dist/checks/bin/check-dispatch-readiness.js +3654 -469
- package/dist/checks/bin/check-doc-claims.js +262 -201
- package/dist/checks/bin/check-doc-coverage-push.js +272 -202
- package/dist/checks/bin/check-doc-coverage.js +272 -202
- package/dist/checks/bin/check-doctrine-no-procedures.js +262 -201
- package/dist/checks/bin/check-doctrine-portability.js +262 -201
- package/dist/checks/bin/check-evidence-fresh.js +10138 -2126
- package/dist/checks/bin/check-exec-bits.js +3 -0
- package/dist/checks/bin/check-first-push-dispatch.js +330 -230
- package/dist/checks/bin/check-issue-milestone-attach.js +94 -16
- package/dist/checks/bin/check-issue-objectives-numbering.js +262 -201
- package/dist/checks/bin/check-issue-parts-coverage.js +94 -16
- package/dist/checks/bin/check-issue-surface-globs.js +1062 -242
- package/dist/checks/bin/check-issue-title-grammar.js +21 -5
- package/dist/checks/bin/check-no-disk-state.js +5 -1
- package/dist/checks/bin/check-pr-premise-reassert.js +22 -2
- package/dist/checks/bin/check-pr-report-density.js +5 -1
- package/dist/checks/bin/check-principal-test-plan-wait.js +282 -207
- package/dist/checks/bin/check-quoted-command.js +262 -201
- package/dist/checks/bin/check-reader-resolvable-prose.js +262 -201
- package/dist/checks/bin/check-registry-gates.js +131 -34
- package/dist/checks/bin/check-retired-vocabulary.js +262 -201
- package/dist/checks/bin/check-review-gate.js +262 -201
- package/dist/checks/bin/check-single-plan-pr.js +5 -1
- package/dist/checks/bin/check-surface-scope.js +136 -38
- package/dist/checks/bin/check-test-plan.js +282 -207
- package/dist/checks/bin/check-token-collection-wired.js +3 -0
- package/dist/checks/bin/check-workspace-escape.js +3 -0
- package/dist/checks/bin/verify-coherence.js +237 -148
- package/dist/checks/bin/verify-dispatch.js +870 -66
- package/dist/checks/bin/verify-docs.js +13 -6
- package/dist/harness.js +57 -10
- package/dist/index.js +16670 -7196
- package/dist/lib/pre-push-cache-test-run.js +4488 -2170
- package/dist/lib/pre-push-changed-files.js +251 -12
- package/dist/lib/pre-push-mode.js +69 -19
- package/dist/lib/pre-push-progress-dir.js +10265 -2853
- package/dist/lib/pre-push-record-tests.js +67 -19
- package/dist/lib/pre-push-select-tests.js +520 -222
- package/dist/lib/push-progress-observer.js +9176 -1757
- package/dist/process.js +2 -0
- package/dist/programs/archive.js +8948 -1547
- package/dist/programs/audit.js +9176 -1772
- package/dist/programs/check.js +9248 -1845
- package/dist/programs/commit-msg.js +8984 -1583
- package/dist/programs/dev-review-loop.js +15621 -7626
- package/dist/programs/dispatch.js +9977 -2726
- package/dist/programs/log-emit.js +9011 -1660
- package/dist/programs/log-selftest.js +8908 -1507
- package/dist/programs/log-send.js +9081 -1594
- package/dist/programs/pr-report.js +9477 -1820
- package/dist/programs/pr-snapshot.js +8916 -1515
- package/dist/programs/pr-verify-evidence.js +9482 -1825
- package/dist/programs/pr.js +11773 -4082
- package/dist/programs/review-post.js +11141 -3496
- package/dist/programs/review-status.js +8997 -1533
- package/dist/programs/run-engine.js +22149 -18798
- package/dist/programs/sync.js +9030 -1629
- package/dist/programs/task-brief.js +10234 -1827
- package/dist/programs/task-sweep.js +9267 -1621
- package/dist/programs/task-tools-serve.js +77141 -16659
- package/dist/programs/tokens.js +8966 -1565
- package/dist/programs/waiver.js +8983 -1582
- package/dist/types/harness/kernel/dev-process-socket/loader/load-process.d.ts +1 -1
- package/dist/types/harness/processes/vinaya-strict/tools/legacy-markers.d.ts +8 -0
- package/dist/types/harness/processes/vinaya-strict/tools/task-contract/brief-validation.d.ts +17 -10
- package/dist/types/harness/processes/vinaya-strict/tools/task-contract/objectives.d.ts +5 -6
- package/dist/types/harness/processes/vinaya-strict/tools/task-contract/premise-check.d.ts +14 -0
- package/dist/vinaya-strict/checks/registry.ts +2 -2
- package/dist/vinaya-strict/executing/developer/developer-doctrine-shape.test.ts +8 -0
- package/dist/vinaya-strict/executing/developer/developer-turn-result.ts +1 -1
- package/dist/vinaya-strict/executing/developer/evals/developer-capability-suite.test.ts +2 -2
- package/dist/vinaya-strict/executing/developer/evals/developer-capability-suite.ts +30 -20
- package/dist/vinaya-strict/executing/developer/reference.md +5 -3
- package/dist/vinaya-strict/integration/config/vinaya-config-section.ts +29 -7
- package/dist/vinaya-strict/integration/policies/vinaya-policies.ts +4 -4
- package/dist/vinaya-strict/integration/process/process-integration.ts +5 -1
- package/dist/vinaya-strict/process.yaml +6 -1
- package/dist/vinaya-strict/thinking/plan-reviewer/doctrine.md +68 -0
- package/dist/vinaya-strict/thinking/plan-reviewer/grants.yaml +19 -0
- package/dist/vinaya-strict/thinking/plan-reviewer/output.schema.json +388 -0
- package/dist/vinaya-strict/thinking/planner/doctrine.md +4 -1
- package/dist/vinaya-strict/thinking/planner/tools/amend-rationale-deps.test.ts +10 -2
- package/dist/vinaya-strict/thinking/planner/tools/amend-rationale-deps.ts +5 -1
- package/dist/vinaya-strict/thinking/planner/tools/open-issue.test.ts +198 -34
- package/dist/vinaya-strict/thinking/planner/tools/open-issue.ts +120 -193
- package/dist/vinaya-strict/thinking/planner/tools/planner-operations.test.ts +629 -15
- package/dist/vinaya-strict/thinking/planner/tools/planner-operations.ts +726 -62
- package/dist/vinaya-strict/thinking/planner/tools/planner-tools.test.ts +505 -5
- package/dist/vinaya-strict/thinking/planner/tools/planner-tools.ts +636 -21
- package/package.json +3 -2
- package/studio-standalone/apps/vinaya-studio/.next/BUILD_ID +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/build-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/.next/prerender-manifest.json +3 -3
- package/studio-standalone/apps/vinaya-studio/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/server/app/_global-error.html +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/server/app/_global-error.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/server/app/milestones/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/server/app/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/server/app/tasks/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/server/chunks/209.js +2 -2
- package/studio-standalone/apps/vinaya-studio/.next/server/chunks/951.js +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/server/middleware-build-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/server/pages/500.html +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/server/preview-props.json +3 -3
- package/studio-standalone/apps/vinaya-studio/.next/server/server-reference-manifest.json +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/static/chunks/151-c365f0ef8268ad13.js +1 -0
- package/studio-standalone/apps/vinaya-studio/.next/static/chunks/19-aa314f13784dcc58.js +4 -0
- package/studio-standalone/apps/vinaya-studio/.next/static/chunks/app/{layout-dfa2186095e797bd.js → layout-f038e8deecb2bf5f.js} +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/static/chunks/app/milestones/{page-2fffb49104860a15.js → page-12314f4deb06a414.js} +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/static/chunks/app/{page-6ae258f663623b2a.js → page-7a06aa3cdd046fa8.js} +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/static/chunks/app/tasks/{page-2fffb49104860a15.js → page-12314f4deb06a414.js} +1 -1
- package/studio-standalone/apps/vinaya-studio/.next/static/css/8eb5ed5b65b9692e.css +1 -0
- package/studio-standalone/apps/vinaya-studio/log-follow.mjs +708 -93
- package/studio-standalone/apps/vinaya-studio/log-sync-folder-source.mjs +699 -84
- package/studio-standalone/apps/vinaya-studio/studio-server.mjs +4692 -3116
- package/vinaya-strict/artifacts/templates/brief-template.md +6 -0
- package/vinaya-strict/artifacts/templates/issue-rationale-template.md +7 -3
- package/vinaya-strict/artifacts/templates/pr-report-template.md +1 -1
- package/vinaya-strict/doctrine/contracts/planner-developer.md +4 -3
- package/vinaya-strict/doctrine/enforcement.md +4 -4
- package/vinaya-strict/doctrine/roles/principal.md +1 -1
- package/vinaya-strict/doctrine/state-machine.md +7 -2
- package/vinaya-strict/executing/developer/reference.md +5 -3
- package/vinaya-strict/thinking/plan-reviewer/doctrine.md +68 -0
- package/vinaya-strict/thinking/planner/doctrine.md +4 -1
- package/vinaya-strict/thinking/planner/reference.md +30 -9
- package/studio-standalone/apps/vinaya-studio/.next/static/chunks/151-23bea4cac9687151.js +0 -1
- package/studio-standalone/apps/vinaya-studio/.next/static/chunks/853-1d5548ff3a55a75f.js +0 -4
- package/studio-standalone/apps/vinaya-studio/.next/static/css/fb16828fc3128d4c.css +0 -1
- /package/studio-standalone/apps/vinaya-studio/.next/static/{_r9iZDxlkoek85d_3oaxL → bJrgAp9Kl4JsCUYkeAYez}/_buildManifest.js +0 -0
- /package/studio-standalone/apps/vinaya-studio/.next/static/{_r9iZDxlkoek85d_3oaxL → bJrgAp9Kl4JsCUYkeAYez}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from "node:module";
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -23,6 +24,7 @@ var __toCommonJS = (from) => {
|
|
|
23
24
|
return entry;
|
|
24
25
|
};
|
|
25
26
|
var __moduleCache;
|
|
27
|
+
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
26
28
|
var __returnValue = (v) => v;
|
|
27
29
|
function __exportSetter(name, newValue) {
|
|
28
30
|
this[name] = __returnValue.bind(null, newValue);
|
|
@@ -47,6 +49,7 @@ var __esm = (fn, res, err) => () => {
|
|
|
47
49
|
throw err[0];
|
|
48
50
|
return res;
|
|
49
51
|
};
|
|
52
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
50
53
|
|
|
51
54
|
// ../../harness/processes/vinaya-strict/tools/task-contract/forge/labels.ts
|
|
52
55
|
function entry(key) {
|
|
@@ -381,6 +384,7 @@ var init_doctrine_map = __esm(() => {
|
|
|
381
384
|
{ key: "roles/developer.md", source: "executing/developer/doctrine.md", role: "developer", ships: true },
|
|
382
385
|
{ key: "roles/developer/reference.md", source: "executing/developer/reference.md", ships: true },
|
|
383
386
|
{ key: "roles/operator.md", source: "executing/operator/doctrine.md", role: "operator", ships: true },
|
|
387
|
+
{ key: "roles/plan-reviewer.md", source: "thinking/plan-reviewer/doctrine.md", role: "plan-reviewer", ships: true },
|
|
384
388
|
{ key: "roles/planner.md", source: "thinking/planner/doctrine.md", role: "planner", ships: true },
|
|
385
389
|
{ key: "roles/planner/reference.md", source: "thinking/planner/reference.md", ships: true },
|
|
386
390
|
{ key: "roles/principal.md", source: "doctrine/roles/principal.md", role: "principal", ships: true },
|
|
@@ -449,7 +453,7 @@ function commentMarkerFamily(name) {
|
|
|
449
453
|
function anchorAlternation(spellings) {
|
|
450
454
|
return `(?:${spellings.map((spelling) => spelling.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|")})`;
|
|
451
455
|
}
|
|
452
|
-
var REGION_PREFIX, PROVENANCE_HEADING, CLAIM_ANCHOR, QUOTES_FILE_ANCHOR, VENDOR_EXAMPLE_ANCHOR, COMMENT_MARKER_PREFIX, FROZEN_BRIEF_MARKER, DEVELOPER_ROUND_MARKER, DEVELOPER_STOP_MARKER, LOOP_PUBLISHED_MARKER, LOOP_PAUSED_MARKER, LOOP_UNPUSHED_WORK_RESUME_MARKER, PRINCIPAL_RULING_MARKER, OBJECTIVES_VERSION_MARKER, DEFERRED_FINDINGS_MARKER, COMMENT_MARKER_PREFIX_CURRENT, COMMENT_MARKER_PREFIXES, COMMENT_MARKER_PREFIX_PATTERN, REGION_PREFIX_CURRENT, REGION_PREFIXES, PROVENANCE_HEADINGS, CLAIM_ANCHORS, QUOTES_FILE_ANCHORS, VENDOR_EXAMPLE_ANCHORS;
|
|
456
|
+
var REGION_PREFIX, PROVENANCE_HEADING, CLAIM_ANCHOR, QUOTES_FILE_ANCHOR, VENDOR_EXAMPLE_ANCHOR, COMMENT_MARKER_PREFIX, FROZEN_BRIEF_MARKER, DEVELOPER_ROUND_MARKER, DEVELOPER_STOP_MARKER, LOOP_PUBLISHED_MARKER, LOOP_PAUSED_MARKER, LOOP_UNPUSHED_WORK_RESUME_MARKER, PRINCIPAL_RULING_MARKER, OBJECTIVES_VERSION_MARKER, DOCUMENTATION_EDIT_MARKER, DEFERRED_FINDINGS_MARKER, COMMENT_MARKER_PREFIX_CURRENT, COMMENT_MARKER_PREFIXES, COMMENT_MARKER_PREFIX_PATTERN, REGION_PREFIX_CURRENT, REGION_PREFIXES, PROVENANCE_HEADINGS, CLAIM_ANCHORS, QUOTES_FILE_ANCHORS, VENDOR_EXAMPLE_ANCHORS;
|
|
453
457
|
var init_legacy_markers = __esm(() => {
|
|
454
458
|
REGION_PREFIX = { old: "AEG", current: "VINAYA" };
|
|
455
459
|
PROVENANCE_HEADING = {
|
|
@@ -471,6 +475,7 @@ var init_legacy_markers = __esm(() => {
|
|
|
471
475
|
LOOP_UNPUSHED_WORK_RESUME_MARKER = commentMarkerFamily("loop:unpushed-work-resume");
|
|
472
476
|
PRINCIPAL_RULING_MARKER = commentMarkerFamily("principal:ruling");
|
|
473
477
|
OBJECTIVES_VERSION_MARKER = commentMarkerFamily("objectives");
|
|
478
|
+
DOCUMENTATION_EDIT_MARKER = commentMarkerFamily("documentation");
|
|
474
479
|
DEFERRED_FINDINGS_MARKER = commentMarkerFamily("deferred-findings");
|
|
475
480
|
COMMENT_MARKER_PREFIX_CURRENT = COMMENT_MARKER_PREFIX.current;
|
|
476
481
|
COMMENT_MARKER_PREFIXES = [COMMENT_MARKER_PREFIX.current, COMMENT_MARKER_PREFIX.old];
|
|
@@ -580,7 +585,13 @@ function isMechanicallyNeutralDiff(diffText, path) {
|
|
|
580
585
|
}
|
|
581
586
|
return sawChange;
|
|
582
587
|
}
|
|
583
|
-
function
|
|
588
|
+
function prBodyGiven(env = process.env) {
|
|
589
|
+
return env.PR_BODY !== undefined || env.PR_BODY_FILE !== undefined;
|
|
590
|
+
}
|
|
591
|
+
function owedNeutralNotes(result) {
|
|
592
|
+
return result.notes.filter((n) => n.startsWith(DOC_NEUTRAL_OWED_PREFIX));
|
|
593
|
+
}
|
|
594
|
+
function evaluateC5(changed, docOwnersContent, prBody, fileExists, waiverActive, getDiff, bodyGiven = true) {
|
|
584
595
|
const out = { errors: [], notes: [] };
|
|
585
596
|
if (docOwnersContent === null)
|
|
586
597
|
return out;
|
|
@@ -620,24 +631,28 @@ function evaluateC5(changed, docOwnersContent, prBody, fileExists, waiverActive,
|
|
|
620
631
|
}
|
|
621
632
|
if (changed.includes(pointerPath))
|
|
622
633
|
continue;
|
|
634
|
+
const evidenced = () => getDiff !== undefined && matchedFiles.every((f) => {
|
|
635
|
+
const diff = getDiff(f);
|
|
636
|
+
return diff !== null && isMechanicallyNeutralDiff(diff, f);
|
|
637
|
+
});
|
|
623
638
|
const declared = neutrals.find((n) => n.surface === b.pointer);
|
|
624
639
|
if (declared) {
|
|
625
|
-
|
|
626
|
-
const diff = getDiff(f);
|
|
627
|
-
return diff !== null && isMechanicallyNeutralDiff(diff, f);
|
|
628
|
-
});
|
|
629
|
-
if (evidenced) {
|
|
640
|
+
if (evidenced()) {
|
|
630
641
|
out.notes.push(`C5 doc-neutral: ${b.pointer} not required for ${DOC_OWNERS_PATH}:${b.lineNum} (glob \`${b.glob}\`) — declared neutral ("${declared.note}"), diff of ${matchedFiles.join(", ")} confirmed comment/whitespace-only.`);
|
|
631
642
|
continue;
|
|
632
643
|
}
|
|
633
644
|
out.errors.push(`C5 doc-neutral-unverified: ${DOC_OWNERS_PATH}:${b.lineNum} (glob \`${b.glob}\` → ${b.pointer}) declared \`Doc-neutral: ${b.pointer} — ${declared.note}\`, but the diff of ${matchedFiles.join(", ")} contains changes beyond comments/whitespace. Update ${pointerPath}, or have a principal apply the \`${WAIVER_LABEL}\` label.`);
|
|
634
645
|
continue;
|
|
635
646
|
}
|
|
647
|
+
if (!bodyGiven && evidenced()) {
|
|
648
|
+
out.notes.push(`${DOC_NEUTRAL_OWED_PREFIX} ${b.pointer} not required in this run for ${DOC_OWNERS_PATH}:${b.lineNum} (glob \`${b.glob}\`) — no pull request body was given, and the diff of ${matchedFiles.join(", ")} is comment/whitespace-only. The pull request body owes \`Doc-neutral: ${b.pointer} — <why>\`.`);
|
|
649
|
+
continue;
|
|
650
|
+
}
|
|
636
651
|
out.errors.push(`C5 doc-coverage: code change matched ${DOC_OWNERS_PATH}:${b.lineNum} (glob \`${b.glob}\` → ${b.pointer}), but ${pointerPath} is not in the PR diff. Update it, declare \`Doc-neutral: ${b.pointer} — <why>\` if the change is genuinely mechanically-neutral, or have a principal apply the \`${WAIVER_LABEL}\` label.`);
|
|
637
652
|
}
|
|
638
653
|
return out;
|
|
639
654
|
}
|
|
640
|
-
var DOC_OWNERS_PATH = ".vinaya/doc-owners", SEPARATOR, LANGUAGE_COMMENT_PREFIXES;
|
|
655
|
+
var DOC_OWNERS_PATH = ".vinaya/doc-owners", SEPARATOR, LANGUAGE_COMMENT_PREFIXES, DOC_NEUTRAL_OWED_PREFIX = "C5 doc-neutral-owed:";
|
|
641
656
|
var init_doc_owners = __esm(() => {
|
|
642
657
|
init_file_classify();
|
|
643
658
|
init_waiver_label();
|
|
@@ -831,59 +846,22 @@ function emitCheckError(error) {
|
|
|
831
846
|
var CHECK_SCHEMA_VERSION = 1;
|
|
832
847
|
|
|
833
848
|
// ../../harness/kernel/log/custom.ts
|
|
834
|
-
import {
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
CUSTOM_EVENT_NAME_PATTERN
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
});
|
|
851
|
-
};
|
|
852
|
-
if (name.length > CUSTOM_EVENT_NAME_MAX_LENGTH) {
|
|
853
|
-
refuse(`the name must be at most ${CUSTOM_EVENT_NAME_MAX_LENGTH} characters`);
|
|
854
|
-
}
|
|
855
|
-
if (!CUSTOM_EVENT_NAME_PATTERN.test(name)) {
|
|
856
|
-
refuse("the name must be `<namespace>.<event>` — lowercase letters, digits and `_`, a dot between them");
|
|
857
|
-
} else if (name.split(".")[0] === CUSTOM_EVENT_RESERVED_NAMESPACE) {
|
|
858
|
-
refuse(`the \`${CUSTOM_EVENT_RESERVED_NAMESPACE}.\` namespace is reserved for Vinaya's own events`);
|
|
859
|
-
}
|
|
860
|
-
const fieldEntries = Object.entries(declaration.fields);
|
|
861
|
-
if (fieldEntries.length > CUSTOM_EVENT_MAX_FIELDS) {
|
|
862
|
-
refuse(`at most ${CUSTOM_EVENT_MAX_FIELDS} fields may be declared (found ${fieldEntries.length})`, ["fields"]);
|
|
863
|
-
}
|
|
864
|
-
for (const [field, type] of fieldEntries) {
|
|
865
|
-
if (field.length > CUSTOM_FIELD_NAME_MAX_LENGTH || !CUSTOM_FIELD_NAME_PATTERN.test(field)) {
|
|
866
|
-
refuse(`field "${field}": a field name is lowercase letters, digits and \`_\`, starting with a letter, at most ${CUSTOM_FIELD_NAME_MAX_LENGTH} characters`, ["fields", field]);
|
|
867
|
-
}
|
|
868
|
-
if (typeof type === "string")
|
|
869
|
-
continue;
|
|
870
|
-
if (type.length === 0) {
|
|
871
|
-
refuse(`field "${field}": a list of words must name at least one word`, ["fields", field]);
|
|
872
|
-
}
|
|
873
|
-
if (type.length > CUSTOM_FIELD_MAX_WORDS) {
|
|
874
|
-
refuse(`field "${field}": a list of words may name at most ${CUSTOM_FIELD_MAX_WORDS}`, ["fields", field]);
|
|
875
|
-
}
|
|
876
|
-
const bad = type.filter((w) => w.length > CUSTOM_WORD_MAX_LENGTH || !CUSTOM_WORD_PATTERN.test(w));
|
|
877
|
-
if (bad.length > 0) {
|
|
878
|
-
refuse(`field "${field}": a listed word is lowercase letters, digits, \`_\` and \`-\`, at most ${CUSTOM_WORD_MAX_LENGTH} characters`, ["fields", field]);
|
|
879
|
-
}
|
|
880
|
-
if (new Set(type).size !== type.length) {
|
|
881
|
-
refuse(`field "${field}": a list of words names a word twice`, ["fields", field]);
|
|
882
|
-
}
|
|
883
|
-
}
|
|
884
|
-
}
|
|
885
|
-
});
|
|
886
|
-
});
|
|
849
|
+
import {
|
|
850
|
+
CUSTOM_EVENT_MAX_FIELDS,
|
|
851
|
+
CUSTOM_EVENT_NAME_MAX_LENGTH,
|
|
852
|
+
CUSTOM_EVENT_NAME_PATTERN,
|
|
853
|
+
CUSTOM_EVENT_RESERVED_NAMESPACE,
|
|
854
|
+
CUSTOM_FIELD_MAX_WORDS,
|
|
855
|
+
CUSTOM_FIELD_NAME_MAX_LENGTH,
|
|
856
|
+
CUSTOM_FIELD_NAME_PATTERN,
|
|
857
|
+
CUSTOM_TEXT_MAX_LENGTH,
|
|
858
|
+
CUSTOM_WORD_MAX_LENGTH,
|
|
859
|
+
CUSTOM_WORD_PATTERN,
|
|
860
|
+
CustomEventDeclarationsSchema,
|
|
861
|
+
checkCustomEvent,
|
|
862
|
+
UNRECORDABLE_FIELD_NAME
|
|
863
|
+
} from "@attalabs/vinaya-log-sdk";
|
|
864
|
+
var init_custom = () => {};
|
|
887
865
|
|
|
888
866
|
// ../../harness/kernel/adapters/agents/agent-vendors.ts
|
|
889
867
|
var AGENT_VENDORS;
|
|
@@ -1223,14 +1201,15 @@ ${detail}`;
|
|
|
1223
1201
|
return null;
|
|
1224
1202
|
}
|
|
1225
1203
|
}
|
|
1226
|
-
function loadTrustAnchorConfig(fetcher = fetchTrustAnchorConfig) {
|
|
1204
|
+
function loadTrustAnchorConfig(fetcher = fetchTrustAnchorConfig, loadOptions = {}) {
|
|
1205
|
+
const warn = loadOptions.quiet ? () => {} : warnTrustAnchorFallback;
|
|
1227
1206
|
let base64;
|
|
1228
1207
|
try {
|
|
1229
1208
|
base64 = fetcher();
|
|
1230
1209
|
} catch (err) {
|
|
1231
|
-
return trustAnchorFetchFailed(err);
|
|
1210
|
+
return trustAnchorFetchFailed(err, warn);
|
|
1232
1211
|
}
|
|
1233
|
-
return parseTrustAnchorContent(base64);
|
|
1212
|
+
return parseTrustAnchorContent(base64, warn);
|
|
1234
1213
|
}
|
|
1235
1214
|
function loadTrustAnchorConfigOrThrow(fetcher = fetchTrustAnchorConfig) {
|
|
1236
1215
|
let base64;
|
|
@@ -1289,9 +1268,9 @@ var installed = null, NO_CONFIG_PROVIDER_MESSAGE = "no configuration provider is
|
|
|
1289
1268
|
|
|
1290
1269
|
// ../../harness/kernel/config/schema/config-schema.ts
|
|
1291
1270
|
import { isAbsolute } from "node:path";
|
|
1292
|
-
import { z
|
|
1271
|
+
import { z } from "zod";
|
|
1293
1272
|
function checkEntrySchema(fields) {
|
|
1294
|
-
return
|
|
1273
|
+
return z.object(fields).superRefine((entry, ctx) => {
|
|
1295
1274
|
const env = entry.env;
|
|
1296
1275
|
if (!env)
|
|
1297
1276
|
return;
|
|
@@ -1301,14 +1280,14 @@ function checkEntrySchema(fields) {
|
|
|
1301
1280
|
const members = value.anyOf;
|
|
1302
1281
|
if (new Set(members).size !== members.length) {
|
|
1303
1282
|
ctx.addIssue({
|
|
1304
|
-
code:
|
|
1283
|
+
code: z.ZodIssueCode.custom,
|
|
1305
1284
|
message: `env.${key}.anyOf has duplicate members`,
|
|
1306
1285
|
path: ["env", key, "anyOf"]
|
|
1307
1286
|
});
|
|
1308
1287
|
}
|
|
1309
1288
|
if (!members.includes(key)) {
|
|
1310
1289
|
ctx.addIssue({
|
|
1311
|
-
code:
|
|
1290
|
+
code: z.ZodIssueCode.custom,
|
|
1312
1291
|
message: `env.${key}.anyOf must include "${key}" itself as a member`,
|
|
1313
1292
|
path: ["env", key, "anyOf"]
|
|
1314
1293
|
});
|
|
@@ -1331,26 +1310,31 @@ function hookBlockPathRule(prefixes) {
|
|
|
1331
1310
|
return { isCanonical, schema };
|
|
1332
1311
|
}
|
|
1333
1312
|
function managedManifestSchemas(agentVendors, hookBlockPrefixes) {
|
|
1334
|
-
const block =
|
|
1313
|
+
const block = z.object({
|
|
1335
1314
|
path: hookBlockPathRule(hookBlockPrefixes).schema,
|
|
1336
|
-
marker:
|
|
1337
|
-
comment:
|
|
1315
|
+
marker: z.string(),
|
|
1316
|
+
comment: z.enum(["hash", "html"])
|
|
1338
1317
|
});
|
|
1339
|
-
const manifest =
|
|
1340
|
-
version:
|
|
1341
|
-
files:
|
|
1342
|
-
blocks:
|
|
1343
|
-
labels:
|
|
1344
|
-
agents:
|
|
1318
|
+
const manifest = z.object({
|
|
1319
|
+
version: z.number().int().positive(),
|
|
1320
|
+
files: z.array(SafeRepoRelPath),
|
|
1321
|
+
blocks: z.array(block),
|
|
1322
|
+
labels: z.array(z.string()),
|
|
1323
|
+
agents: z.array(z.enum(agentVendors)).optional()
|
|
1345
1324
|
});
|
|
1346
1325
|
return { block, manifest };
|
|
1347
1326
|
}
|
|
1348
1327
|
function logsSchema(events) {
|
|
1349
|
-
return
|
|
1350
|
-
folder:
|
|
1351
|
-
url:
|
|
1352
|
-
|
|
1353
|
-
|
|
1328
|
+
return z.object({
|
|
1329
|
+
folder: z.string().min(1).refine((v) => isAbsolute(v), { message: "logs.folder: must be an absolute path" }).optional(),
|
|
1330
|
+
url: z.string().url().optional(),
|
|
1331
|
+
otlp: z.object({
|
|
1332
|
+
url: z.string().url().regex(/^https?:\/\//i),
|
|
1333
|
+
headers: z.record(z.string()).optional()
|
|
1334
|
+
}).strict().optional(),
|
|
1335
|
+
headers: z.record(z.string()).optional(),
|
|
1336
|
+
readHeaders: z.record(z.string()).optional(),
|
|
1337
|
+
keepDays: z.number({ invalid_type_error: "must be a whole number of days" }).int({ message: "must be a whole number of days" }).min(1, { message: "must be at least 1" }).optional(),
|
|
1354
1338
|
events: events.optional()
|
|
1355
1339
|
}).refine((v) => [v.folder, v.url].filter((x) => x !== undefined).length <= 1, {
|
|
1356
1340
|
message: "logs: set at most one of folder/url"
|
|
@@ -1358,22 +1342,22 @@ function logsSchema(events) {
|
|
|
1358
1342
|
message: "logs: headers requires url"
|
|
1359
1343
|
}).refine((v) => v.readHeaders === undefined || v.url !== undefined, {
|
|
1360
1344
|
message: "logs: readHeaders requires url"
|
|
1361
|
-
}).or(
|
|
1345
|
+
}).or(z.literal(false)).optional();
|
|
1362
1346
|
}
|
|
1363
1347
|
function kernelConfigFragment(leaves) {
|
|
1364
1348
|
return {
|
|
1365
|
-
rings:
|
|
1366
|
-
ring1_forgeWriteInterception:
|
|
1367
|
-
ring2_asyncAudits:
|
|
1349
|
+
rings: z.object({
|
|
1350
|
+
ring1_forgeWriteInterception: z.boolean(),
|
|
1351
|
+
ring2_asyncAudits: z.boolean()
|
|
1368
1352
|
}).optional(),
|
|
1369
|
-
checks:
|
|
1353
|
+
checks: z.record(z.string(), checkEntrySchema(leaves.checkEntryFields)).optional(),
|
|
1370
1354
|
managed: managedManifestSchemas(leaves.agentVendors, leaves.hookBlockPrefixes).manifest.optional(),
|
|
1371
|
-
ci:
|
|
1372
|
-
logPublish:
|
|
1355
|
+
ci: z.object({ setup: z.string().min(1) }).optional(),
|
|
1356
|
+
logPublish: z.unknown().refine((v) => v === undefined, {
|
|
1373
1357
|
message: "logPublish is removed — telemetry is never posted to a tracker or a code host; configure `logs` instead (a folder or a server destination)"
|
|
1374
1358
|
}),
|
|
1375
|
-
runtimeDir:
|
|
1376
|
-
runner:
|
|
1359
|
+
runtimeDir: z.string().min(1).refine((v) => isAbsolute(v), { message: "runtimeDir: must be an absolute path" }).optional(),
|
|
1360
|
+
runner: z.enum(["standalone", "atta-engine"]).optional(),
|
|
1377
1361
|
logs: logsSchema(leaves.logEvents)
|
|
1378
1362
|
};
|
|
1379
1363
|
}
|
|
@@ -1413,25 +1397,25 @@ function resolveLogsHeaderValues(headers, env) {
|
|
|
1413
1397
|
}
|
|
1414
1398
|
var EnvEntrySchema, KERNEL_CHECK_ENTRY_FIELDS, SafeRepoRelPath, KERNEL_CONFIG_REFINEMENTS;
|
|
1415
1399
|
var init_config_schema = __esm(() => {
|
|
1416
|
-
EnvEntrySchema =
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1400
|
+
EnvEntrySchema = z.union([
|
|
1401
|
+
z.literal(true),
|
|
1402
|
+
z.object({ optional: z.literal(true) }),
|
|
1403
|
+
z.object({ anyOf: z.array(z.string()).min(2) }),
|
|
1404
|
+
z.string()
|
|
1421
1405
|
]);
|
|
1422
1406
|
KERNEL_CHECK_ENTRY_FIELDS = {
|
|
1423
|
-
run:
|
|
1424
|
-
scope:
|
|
1425
|
-
include:
|
|
1426
|
-
args:
|
|
1427
|
-
timeoutMs:
|
|
1428
|
-
env:
|
|
1429
|
-
requiresOpenPr:
|
|
1430
|
-
ownWorkflow:
|
|
1431
|
-
validates:
|
|
1432
|
-
advisory:
|
|
1407
|
+
run: z.string(),
|
|
1408
|
+
scope: z.enum(["diff", "full"]),
|
|
1409
|
+
include: z.array(z.string()).optional(),
|
|
1410
|
+
args: z.array(z.string()).optional(),
|
|
1411
|
+
timeoutMs: z.number().optional(),
|
|
1412
|
+
env: z.record(z.string(), EnvEntrySchema).optional(),
|
|
1413
|
+
requiresOpenPr: z.boolean().optional(),
|
|
1414
|
+
ownWorkflow: z.boolean().optional(),
|
|
1415
|
+
validates: z.enum(["body", "issue"]).optional(),
|
|
1416
|
+
advisory: z.literal(true).optional()
|
|
1433
1417
|
};
|
|
1434
|
-
SafeRepoRelPath =
|
|
1418
|
+
SafeRepoRelPath = z.string().refine(isSafeRepoRelPath, {
|
|
1435
1419
|
message: "must be a repo-root-relative path with no `..` segment or absolute root"
|
|
1436
1420
|
});
|
|
1437
1421
|
KERNEL_CONFIG_REFINEMENTS = [];
|
|
@@ -1664,6 +1648,23 @@ async function ghApiGetAllPagesAsync(pathWithoutPage, opts) {
|
|
|
1664
1648
|
}
|
|
1665
1649
|
throw new Error(`ghApiGetAllPagesAsync: "${pathWithoutPage}" did not terminate within ${MAX_PAGES} pages (${MAX_PAGES * MAX_PER_PAGE} items) — refusing to keep walking.`);
|
|
1666
1650
|
}
|
|
1651
|
+
async function ghLabelIssueCountsAsync(owner, repo, labelQuery) {
|
|
1652
|
+
const stdout = await runAsync([
|
|
1653
|
+
"api",
|
|
1654
|
+
"graphql",
|
|
1655
|
+
"--paginate",
|
|
1656
|
+
"-f",
|
|
1657
|
+
`query=${LABEL_ISSUE_COUNTS_QUERY.replace("$labelQuery", JSON.stringify(labelQuery))}`,
|
|
1658
|
+
"-f",
|
|
1659
|
+
`owner=${owner}`,
|
|
1660
|
+
"-f",
|
|
1661
|
+
`name=${repo}`,
|
|
1662
|
+
"--jq",
|
|
1663
|
+
".data.repository.labels.nodes[] | {name, open: .open.totalCount, total: .all.totalCount}"
|
|
1664
|
+
]);
|
|
1665
|
+
return stdout.split(`
|
|
1666
|
+
`).filter((line) => line.trim() !== "").map((line) => JSON.parse(line));
|
|
1667
|
+
}
|
|
1667
1668
|
function issueListByLabelArgs(owner, repo, label) {
|
|
1668
1669
|
return [
|
|
1669
1670
|
"issue",
|
|
@@ -1697,7 +1698,14 @@ async function ghIssueListByAnyLabelAsync(owner, repo, labels) {
|
|
|
1697
1698
|
const perLabel = await Promise.all(labels.map((l) => ghIssueListByLabelAsync(owner, repo, l)));
|
|
1698
1699
|
return dedupeByNumber(perLabel.flat());
|
|
1699
1700
|
}
|
|
1700
|
-
var execFileAsync2, systemEnv, MAX_PER_PAGE = 100, MAX_PAGES = 100
|
|
1701
|
+
var execFileAsync2, systemEnv, MAX_PER_PAGE = 100, MAX_PAGES = 100, LABEL_ISSUE_COUNTS_QUERY = `query($owner: String!, $name: String!, $endCursor: String) {
|
|
1702
|
+
repository(owner: $owner, name: $name) {
|
|
1703
|
+
labels(first: 100, after: $endCursor, query: $labelQuery) {
|
|
1704
|
+
pageInfo { hasNextPage endCursor }
|
|
1705
|
+
nodes { name open: issues(states: OPEN) { totalCount } all: issues { totalCount } }
|
|
1706
|
+
}
|
|
1707
|
+
}
|
|
1708
|
+
}`;
|
|
1701
1709
|
var init_gh = __esm(() => {
|
|
1702
1710
|
execFileAsync2 = promisify2(execFile2);
|
|
1703
1711
|
systemEnv = {
|
|
@@ -2180,6 +2188,15 @@ function parsePremiseBlock(prBody) {
|
|
|
2180
2188
|
}
|
|
2181
2189
|
return assertions;
|
|
2182
2190
|
}
|
|
2191
|
+
function declaresNewFilesOnly(prBody) {
|
|
2192
|
+
const searchIn = anchoredRegion(prBody, "PREMISE", REGION_PREFIXES) ?? prBody;
|
|
2193
|
+
const lines = searchIn.split(/\r?\n/).map((l) => l.trim());
|
|
2194
|
+
const header = lines.findIndex(isPremiseHeader);
|
|
2195
|
+
if (header === -1)
|
|
2196
|
+
return false;
|
|
2197
|
+
const first = lines.slice(header + 1).find((l) => l !== "");
|
|
2198
|
+
return first === NEW_FILES_ONLY_PREMISE && parsePremiseBlock(prBody).length === 0;
|
|
2199
|
+
}
|
|
2183
2200
|
function premiseBlockText(prBody) {
|
|
2184
2201
|
const searchIn = anchoredRegion(prBody, "PREMISE", REGION_PREFIXES) ?? prBody;
|
|
2185
2202
|
const lines = searchIn.split(/\r?\n/);
|
|
@@ -2227,7 +2244,7 @@ function checkPremises(assertions, fileReader) {
|
|
|
2227
2244
|
}
|
|
2228
2245
|
return { pass: failures.length === 0, failures };
|
|
2229
2246
|
}
|
|
2230
|
-
var ASSERTION_KINDS, PREMISE_LINE;
|
|
2247
|
+
var ASSERTION_KINDS, NEW_FILES_ONLY_PREMISE = "- (no pin — every file this task names is new, so no existing content can be pinned)", PREMISE_LINE;
|
|
2231
2248
|
var init_premise_check = __esm(() => {
|
|
2232
2249
|
init_anchored_region();
|
|
2233
2250
|
init_legacy_markers();
|
|
@@ -2350,13 +2367,16 @@ function checkSurfaceMap(prBody) {
|
|
|
2350
2367
|
function checkDocUpdateList(prBody) {
|
|
2351
2368
|
return headingCheck(prBody, "(?:documentation|doc)[- ]update(?:\\s+list)?", "Documentation-update list");
|
|
2352
2369
|
}
|
|
2353
|
-
function checkWorktreeStep0(
|
|
2354
|
-
|
|
2370
|
+
function checkWorktreeStep0(body) {
|
|
2371
|
+
const prBody = body.replaceAll(`\r
|
|
2372
|
+
`, `
|
|
2373
|
+
`);
|
|
2374
|
+
if (/git worktree add/.test(prBody) || /cd \.worktrees\//.test(prBody) || /bun install --frozen-lockfile/.test(prBody) || /\*\*Step 0 \(mandatory, verbatim\):\*\*\n\n```\n(?:npm ci|pnpm install --frozen-lockfile|yarn install --frozen-lockfile)\n```/.test(prBody))
|
|
2355
2375
|
return { status: "pass", errors: [] };
|
|
2356
2376
|
return {
|
|
2357
2377
|
status: "fail",
|
|
2358
2378
|
errors: [
|
|
2359
|
-
"brief-validation worktree Step 0: no `git worktree add`, `cd .worktrees/`, or `bun install --frozen-lockfile`
|
|
2379
|
+
"brief-validation worktree Step 0: no `git worktree add`, `cd .worktrees/`, or frozen-lockfile install (`bun install --frozen-lockfile`, `npm ci`, `pnpm install --frozen-lockfile`, `yarn install --frozen-lockfile`) found in the PR body."
|
|
2360
2380
|
]
|
|
2361
2381
|
};
|
|
2362
2382
|
}
|
|
@@ -3719,6 +3739,20 @@ var init_protected_paths = __esm(() => {
|
|
|
3719
3739
|
];
|
|
3720
3740
|
});
|
|
3721
3741
|
|
|
3742
|
+
// ../../harness/processes/vinaya-strict/tools/task-contract/test-plan-proof.ts
|
|
3743
|
+
function stripObjectiveIdSpans(text) {
|
|
3744
|
+
return text.replace(ITEM_IDS_SPAN_RE, "").trim();
|
|
3745
|
+
}
|
|
3746
|
+
var ID_LIST, LINE_IDS_RE, ITEM_IDS_SPAN_RE;
|
|
3747
|
+
var init_test_plan_proof = __esm(() => {
|
|
3748
|
+
init_brief_validation();
|
|
3749
|
+
init_objectives();
|
|
3750
|
+
init_test_plan_section();
|
|
3751
|
+
ID_LIST = String.raw`O\d+(?:\s*,\s*O\d+)*`;
|
|
3752
|
+
LINE_IDS_RE = new RegExp(String.raw`\(\s*(${ID_LIST})\s*\)\s*$`);
|
|
3753
|
+
ITEM_IDS_SPAN_RE = new RegExp(String.raw`(?<!\`)(\`+)\s*\(?\s*(${ID_LIST})\s*\)?\s*\1(?!\`)`, "g");
|
|
3754
|
+
});
|
|
3755
|
+
|
|
3722
3756
|
// ../../harness/processes/vinaya-strict/tools/task-contract/issue-validation.ts
|
|
3723
3757
|
function hasRationaleField(body, labelPattern) {
|
|
3724
3758
|
const re = new RegExp(`(?:\\*\\*|^#{1,4}\\s+)\\s*(?:${labelPattern})`, "im");
|
|
@@ -3917,7 +3951,7 @@ function checkPartsCiteDefinedObjectives(body) {
|
|
|
3917
3951
|
return { status: errors.length > 0 ? "fail" : "pass", errors };
|
|
3918
3952
|
}
|
|
3919
3953
|
function liveCommand(text) {
|
|
3920
|
-
const trimmed = text
|
|
3954
|
+
const trimmed = stripObjectiveIdSpans(text);
|
|
3921
3955
|
const span = /^(`+)(.+)\1$/.exec(trimmed);
|
|
3922
3956
|
return span ? span[2].trim() : trimmed;
|
|
3923
3957
|
}
|
|
@@ -4026,9 +4060,19 @@ function namedPathsIn(text) {
|
|
|
4026
4060
|
function boundaryPinnedFiles(body) {
|
|
4027
4061
|
const boundary = rationaleFieldText(PATH_TEXT(body), "Boundary");
|
|
4028
4062
|
const excluded = new Set(namedPathsIn(boundaryOutText(body)));
|
|
4029
|
-
|
|
4063
|
+
const named = [...namedPathsIn(boundary), ...rootFilesPinnedIn(boundary)];
|
|
4064
|
+
return [...new Set(named)].filter((p) => looksLikeFilePath(p) && !excluded.has(p));
|
|
4065
|
+
}
|
|
4066
|
+
function rootFilesPinnedIn(boundary) {
|
|
4067
|
+
const start = boundary.search(/\bPinned files\s*:/i);
|
|
4068
|
+
if (start === -1)
|
|
4069
|
+
return [];
|
|
4070
|
+
const clause = boundary.slice(start);
|
|
4071
|
+
const out = BOUNDARY_OUT_RE.exec(clause);
|
|
4072
|
+
const pinned = out ? clause.slice(0, out.index) : clause;
|
|
4073
|
+
return [...pinned.matchAll(ROOT_FILE_RE_GLOBAL)].map((m) => m[1]);
|
|
4030
4074
|
}
|
|
4031
|
-
var RATIONALE_FIELDS, DEPENDENCY_RATIONALE_FIELD_NAME = "Dependency rationale", SINGLE_FIX_OPTIONAL_FIELDS, OBJECTIVES_SINCE_ISSUE = 404, PART_MIN_WORDS_OUTSIDE_BACKTICKS = 3, ISSUE_PART_LINE_RE, ISSUE_LIVE_LINE_RE, TYPE_LABEL_IDS, PATH_TEXT = (body) => stripCode(body, { inlineSpans: "keep" }), MESSAGE_VALUE_COUNT_MAX = 5, MESSAGE_VALUE_MAX = 64, DOC_PATH_RE, DOC_PATH_RE_GLOBAL, RATIONALE_PATH_RE_GLOBAL, DEFAULT_COLLISION_THRESHOLD = 3, BOUNDARY_OUT_RE, FILE_EXTENSIONS, CI_SHARD_DIR = "apps/cli/tests/ci-shards", CI_SHARD_PROBE;
|
|
4075
|
+
var RATIONALE_FIELDS, DEPENDENCY_RATIONALE_FIELD_NAME = "Dependency rationale", SINGLE_FIX_OPTIONAL_FIELDS, OBJECTIVES_SINCE_ISSUE = 404, PART_MIN_WORDS_OUTSIDE_BACKTICKS = 3, ISSUE_PART_LINE_RE, ISSUE_LIVE_LINE_RE, TYPE_LABEL_IDS, PATH_TEXT = (body) => stripCode(body, { inlineSpans: "keep" }), MESSAGE_VALUE_COUNT_MAX = 5, MESSAGE_VALUE_MAX = 64, DOC_PATH_RE, DOC_PATH_RE_GLOBAL, RATIONALE_PATH_RE_GLOBAL, DEFAULT_COLLISION_THRESHOLD = 3, BOUNDARY_OUT_RE, FILE_EXTENSIONS, ROOT_FILE_RE_GLOBAL, CI_SHARD_DIR = "apps/cli/tests/ci-shards", CI_SHARD_PROBE;
|
|
4032
4076
|
var init_issue_validation = __esm(() => {
|
|
4033
4077
|
init_parse_rationale_deps();
|
|
4034
4078
|
init_labels();
|
|
@@ -4042,11 +4086,13 @@ var init_issue_validation = __esm(() => {
|
|
|
4042
4086
|
init_derive_section7();
|
|
4043
4087
|
init_doctrine_map();
|
|
4044
4088
|
init_objectives();
|
|
4089
|
+
init_waiver_label();
|
|
4045
4090
|
init_issue_documentation();
|
|
4046
4091
|
init_touched_path();
|
|
4047
4092
|
init_protected_paths();
|
|
4048
4093
|
init_quoted_command();
|
|
4049
4094
|
init_test_plan_section();
|
|
4095
|
+
init_test_plan_proof();
|
|
4050
4096
|
RATIONALE_FIELDS = [
|
|
4051
4097
|
{ name: "Boundary", pattern: "Boundary" },
|
|
4052
4098
|
{ name: "Sizing", pattern: "Sizing" },
|
|
@@ -4090,6 +4136,7 @@ var init_issue_validation = __esm(() => {
|
|
|
4090
4136
|
"html",
|
|
4091
4137
|
"css"
|
|
4092
4138
|
]);
|
|
4139
|
+
ROOT_FILE_RE_GLOBAL = /`([\w.@-]+\.(?:md|mdx|txt|json|jsonc|ts|tsx|js|jsx|mjs|cjs|mts|cts|yml|yaml|toml|lock|html|css|scss|sh|py|rb|go|rs|xml|ini|cfg|conf))`/g;
|
|
4093
4140
|
CI_SHARD_PROBE = `${CI_SHARD_DIR}/shard-1.txt`;
|
|
4094
4141
|
});
|
|
4095
4142
|
|
|
@@ -4542,7 +4589,7 @@ var init_review_gate = __esm(() => {
|
|
|
4542
4589
|
|
|
4543
4590
|
// ../../harness/processes/vinaya-strict/tools/prose-rules-config.ts
|
|
4544
4591
|
import safeRegex from "safe-regex2";
|
|
4545
|
-
import { z as
|
|
4592
|
+
import { z as z2 } from "zod";
|
|
4546
4593
|
function isPlainObject(value) {
|
|
4547
4594
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
4548
4595
|
}
|
|
@@ -4812,18 +4859,18 @@ var init_prose_rules_config = __esm(() => {
|
|
|
4812
4859
|
FIXED_DEFAULT_KEYS = ["pattern", "patterns", "flags", "means", "message", "id"];
|
|
4813
4860
|
CUSTOM_KEYS = ["id", "pattern", "patterns", "flags", "means", "scopes", "severity", "exempt"];
|
|
4814
4861
|
DEFAULT_IDS = new Set([...DEFAULT_PROSE_RULES.map((rule) => rule.id), DECISION_RECORD_CITATION_ID]);
|
|
4815
|
-
RepoRelativePathSchema =
|
|
4862
|
+
RepoRelativePathSchema = z2.string().min(1).superRefine((entry, ctx) => {
|
|
4816
4863
|
const reason = outsideRepositoryReason(entry);
|
|
4817
4864
|
if (reason)
|
|
4818
|
-
ctx.addIssue({ code:
|
|
4865
|
+
ctx.addIssue({ code: z2.ZodIssueCode.custom, message: reason });
|
|
4819
4866
|
});
|
|
4820
|
-
ProseRulesSchema =
|
|
4867
|
+
ProseRulesSchema = z2.unknown().superRefine((value, ctx) => {
|
|
4821
4868
|
for (const issue of proseRulesIssues(value)) {
|
|
4822
|
-
ctx.addIssue({ code:
|
|
4869
|
+
ctx.addIssue({ code: z2.ZodIssueCode.custom, path: issue.path, message: issue.message });
|
|
4823
4870
|
}
|
|
4824
4871
|
}).transform((value) => value);
|
|
4825
|
-
PublishedProseSchema =
|
|
4826
|
-
allow:
|
|
4872
|
+
PublishedProseSchema = z2.object({
|
|
4873
|
+
allow: z2.array(z2.string().min(1)).optional()
|
|
4827
4874
|
}).strict();
|
|
4828
4875
|
});
|
|
4829
4876
|
|
|
@@ -4838,10 +4885,13 @@ var exports_vinaya_config_section = {};
|
|
|
4838
4885
|
__export(exports_vinaya_config_section, {
|
|
4839
4886
|
BRIEF_BUILTINS: () => BRIEF_BUILTINS,
|
|
4840
4887
|
CANONICAL_HOOK_BLOCK_PREFIXES: () => CANONICAL_HOOK_BLOCK_PREFIXES,
|
|
4888
|
+
DEFAULT_REVIEW_AGENT: () => DEFAULT_REVIEW_AGENT,
|
|
4889
|
+
DEFAULT_REVIEW_ROUND_LIMIT: () => DEFAULT_REVIEW_ROUND_LIMIT,
|
|
4841
4890
|
LOCAL_OVERRIDABLE_KEYS: () => LOCAL_OVERRIDABLE_KEYS,
|
|
4842
4891
|
LOCAL_OVERRIDE_FILENAME: () => LOCAL_OVERRIDE_FILENAME,
|
|
4843
4892
|
PRINCIPALS_FIX: () => PRINCIPALS_FIX,
|
|
4844
4893
|
PrincipalsUnresolvedError: () => PrincipalsUnresolvedError,
|
|
4894
|
+
REVIEW_AGENT_SETTINGS: () => REVIEW_AGENT_SETTINGS,
|
|
4845
4895
|
VINAYA_CHECK_ENTRY_FIELDS: () => VINAYA_CHECK_ENTRY_FIELDS,
|
|
4846
4896
|
VINAYA_CONFIG_FILENAME: () => VINAYA_CONFIG_FILENAME,
|
|
4847
4897
|
VINAYA_CONFIG_FRAGMENT: () => VINAYA_CONFIG_FRAGMENT,
|
|
@@ -4863,7 +4913,9 @@ __export(exports_vinaya_config_section, {
|
|
|
4863
4913
|
resolveGateCutovers: () => resolveGateCutovers,
|
|
4864
4914
|
resolveLocalPacingOverride: () => resolveLocalPacingOverride,
|
|
4865
4915
|
resolveReleaseActor: () => resolveReleaseActor,
|
|
4916
|
+
resolveReviewAgent: () => resolveReviewAgent,
|
|
4866
4917
|
resolveReviewPolicy: () => resolveReviewPolicy,
|
|
4918
|
+
resolveReviewRoundLimit: () => resolveReviewRoundLimit,
|
|
4867
4919
|
resolveSecurityScanCommand: () => resolveSecurityScanCommand,
|
|
4868
4920
|
tokensCollectTrustKey: () => tokensCollectTrustKey,
|
|
4869
4921
|
trustAnchorFallbackWarning: () => trustAnchorFallbackWarning,
|
|
@@ -4874,7 +4926,7 @@ import { execFileSync as execFileSync4 } from "node:child_process";
|
|
|
4874
4926
|
import { existsSync as existsSync2, mkdirSync as mkdirSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
4875
4927
|
import { homedir } from "node:os";
|
|
4876
4928
|
import { dirname as dirname2, join as join3 } from "node:path";
|
|
4877
|
-
import { z as
|
|
4929
|
+
import { z as z3 } from "zod";
|
|
4878
4930
|
function isDefaultedAgentVendorPath(path, manifest) {
|
|
4879
4931
|
if (manifest.agents !== undefined)
|
|
4880
4932
|
return false;
|
|
@@ -4908,7 +4960,7 @@ function decisionRecordsOutsideDoctrine(config, ctx) {
|
|
|
4908
4960
|
return;
|
|
4909
4961
|
const issue = decisionRecordsPathIssue(path, config.proseGates?.doctrineRoot);
|
|
4910
4962
|
if (issue)
|
|
4911
|
-
ctx.addIssue({ code:
|
|
4963
|
+
ctx.addIssue({ code: z3.ZodIssueCode.custom, path: ["decisionRecords", "path"], message: issue });
|
|
4912
4964
|
}
|
|
4913
4965
|
function globalPrincipalsIgnoredWarning(path) {
|
|
4914
4966
|
return `${path}: "principals" in the global config is ignored — principals may only be declared from a repo-local vinaya.config.json.`;
|
|
@@ -5012,6 +5064,12 @@ function resolveGateCutovers(config) {
|
|
|
5012
5064
|
function resolveCollisionThreshold(config) {
|
|
5013
5065
|
return config?.planning?.collisionThreshold ?? DEFAULT_COLLISION_THRESHOLD;
|
|
5014
5066
|
}
|
|
5067
|
+
function resolveReviewRoundLimit(config) {
|
|
5068
|
+
return config?.planning?.reviewRoundLimit ?? DEFAULT_REVIEW_ROUND_LIMIT;
|
|
5069
|
+
}
|
|
5070
|
+
function resolveReviewAgent(config) {
|
|
5071
|
+
return config?.planning?.reviewAgent ?? DEFAULT_REVIEW_AGENT;
|
|
5072
|
+
}
|
|
5015
5073
|
function principalsNotConfigured(why) {
|
|
5016
5074
|
return new PrincipalsUnresolvedError("not-configured", `no Principal is configured (${why}) — ${PRINCIPALS_FIX}.`);
|
|
5017
5075
|
}
|
|
@@ -5026,7 +5084,7 @@ function createTrustedPrincipalsResolver(reads) {
|
|
|
5026
5084
|
}
|
|
5027
5085
|
if (isMissingFileError(err))
|
|
5028
5086
|
throw principalsNotConfigured("the default branch has no vinaya.config.json");
|
|
5029
|
-
throw new PrincipalsUnresolvedError("read-failed", `could not read "principals" from vinaya.config.json on the default branch: ${fetchFailureReason(err)}
|
|
5087
|
+
throw new PrincipalsUnresolvedError("read-failed", `could not read "principals" from vinaya.config.json on the default branch: ${fetchFailureReason(err)}`, { cause: err });
|
|
5030
5088
|
}
|
|
5031
5089
|
const unusable = { why: "" };
|
|
5032
5090
|
const config = reads.parse(content, (why) => {
|
|
@@ -5086,7 +5144,7 @@ function trustTokensCollectCommand(repoGitCommonDir, interpreter, script, script
|
|
|
5086
5144
|
store[key] = { interpreter, script, scriptBlobHash, trustedAt: new Date().toISOString() };
|
|
5087
5145
|
writeTokensCollectTrustStore(storePath, store);
|
|
5088
5146
|
}
|
|
5089
|
-
var VINAYA_HOME, VINAYA_GLOBAL_CONFIG_FILENAME = "config.json", VINAYA_CONFIG_FILENAME = "vinaya.config.json", CANONICAL_HOOK_BLOCK_PREFIXES, VINAYA_CHECK_ENTRY_FIELDS, AGENTS_SKILLS_PREFIX = ".agents/skills/", CLAUDE_SKILLS_PREFIX = ".claude/skills/vinaya-", RoleEntrySchema, MAX_REPORT_COMMAND_TIMEOUT_MS = 3600000, BRIEF_BUILTINS, BriefSectionSchema, BriefSchemaSchema, ProjectEntrySchema, VINAYA_CONFIG_FRAGMENT, LOCAL_OVERRIDE_FILENAME = "vinaya.config.local.json", LOCAL_OVERRIDABLE_KEYS, PrincipalsUnresolvedError, PRINCIPALS_FIX = 'add "principals": [...] to vinaya.config.json on the default branch', TOKENS_COLLECT_TRUST_PATH, VINAYA_GLOBAL_ONLY_KEYS, VINAYA_CONFIG_SECTION;
|
|
5147
|
+
var VINAYA_HOME, VINAYA_GLOBAL_CONFIG_FILENAME = "config.json", VINAYA_CONFIG_FILENAME = "vinaya.config.json", CANONICAL_HOOK_BLOCK_PREFIXES, VINAYA_CHECK_ENTRY_FIELDS, AGENTS_SKILLS_PREFIX = ".agents/skills/", CLAUDE_SKILLS_PREFIX = ".claude/skills/vinaya-", RoleEntrySchema, MAX_REPORT_COMMAND_TIMEOUT_MS = 3600000, BRIEF_BUILTINS, BriefSectionSchema, BriefSchemaSchema, ProjectEntrySchema, VINAYA_CONFIG_FRAGMENT, LOCAL_OVERRIDE_FILENAME = "vinaya.config.local.json", LOCAL_OVERRIDABLE_KEYS, DEFAULT_REVIEW_ROUND_LIMIT = 2, REVIEW_AGENT_SETTINGS, DEFAULT_REVIEW_AGENT = "same", PrincipalsUnresolvedError, PRINCIPALS_FIX = 'add "principals": [...] to vinaya.config.json on the default branch', TOKENS_COLLECT_TRUST_PATH, VINAYA_GLOBAL_ONLY_KEYS, VINAYA_CONFIG_SECTION;
|
|
5090
5148
|
var init_vinaya_config_section = __esm(() => {
|
|
5091
5149
|
init_review_policy();
|
|
5092
5150
|
init_issue_validation();
|
|
@@ -5100,10 +5158,10 @@ var init_vinaya_config_section = __esm(() => {
|
|
|
5100
5158
|
VINAYA_HOME = join3(homedir(), ".vinaya");
|
|
5101
5159
|
CANONICAL_HOOK_BLOCK_PREFIXES = [".git/", ".husky/", ".vinaya/hooks/", ".claude/hooks/"];
|
|
5102
5160
|
VINAYA_CHECK_ENTRY_FIELDS = {
|
|
5103
|
-
principalOwed:
|
|
5161
|
+
principalOwed: z3.literal(true).optional()
|
|
5104
5162
|
};
|
|
5105
|
-
RoleEntrySchema =
|
|
5106
|
-
contract:
|
|
5163
|
+
RoleEntrySchema = z3.object({
|
|
5164
|
+
contract: z3.string().refine((p) => p.includes("/"), {
|
|
5107
5165
|
message: 'must be a path (contain at least one "/"), not a bare filename'
|
|
5108
5166
|
})
|
|
5109
5167
|
});
|
|
@@ -5126,102 +5184,104 @@ var init_vinaya_config_section = __esm(() => {
|
|
|
5126
5184
|
"briefSections",
|
|
5127
5185
|
"milestoneShape"
|
|
5128
5186
|
];
|
|
5129
|
-
BriefSectionSchema =
|
|
5130
|
-
|
|
5131
|
-
|
|
5132
|
-
|
|
5133
|
-
|
|
5187
|
+
BriefSectionSchema = z3.union([
|
|
5188
|
+
z3.object({ builtin: z3.enum(BRIEF_BUILTINS) }),
|
|
5189
|
+
z3.object({ heading: z3.string().min(1), name: z3.string().optional() }),
|
|
5190
|
+
z3.object({ field: z3.string().min(1), name: z3.string().optional() }),
|
|
5191
|
+
z3.object({ phrase: z3.string().min(1), name: z3.string().optional() })
|
|
5134
5192
|
]);
|
|
5135
|
-
BriefSchemaSchema =
|
|
5136
|
-
pr:
|
|
5137
|
-
issue:
|
|
5138
|
-
milestone:
|
|
5139
|
-
ack:
|
|
5193
|
+
BriefSchemaSchema = z3.object({
|
|
5194
|
+
pr: z3.object({ sections: z3.array(BriefSectionSchema) }).optional(),
|
|
5195
|
+
issue: z3.object({ sections: z3.array(BriefSectionSchema) }).optional(),
|
|
5196
|
+
milestone: z3.object({ sections: z3.array(BriefSectionSchema) }).optional(),
|
|
5197
|
+
ack: z3.array(z3.enum(BRIEF_BUILTINS)).optional()
|
|
5140
5198
|
});
|
|
5141
|
-
ProjectEntrySchema =
|
|
5142
|
-
name:
|
|
5143
|
-
description:
|
|
5144
|
-
path:
|
|
5199
|
+
ProjectEntrySchema = z3.object({
|
|
5200
|
+
name: z3.string().min(1),
|
|
5201
|
+
description: z3.string().min(1).optional(),
|
|
5202
|
+
path: z3.string().min(1).optional()
|
|
5145
5203
|
});
|
|
5146
5204
|
VINAYA_CONFIG_FRAGMENT = {
|
|
5147
|
-
roles:
|
|
5205
|
+
roles: z3.record(z3.string(), RoleEntrySchema).optional(),
|
|
5148
5206
|
briefSchema: BriefSchemaSchema.optional(),
|
|
5149
|
-
principals:
|
|
5150
|
-
releaseActor:
|
|
5151
|
-
tokens:
|
|
5152
|
-
collect:
|
|
5207
|
+
principals: z3.array(z3.string()).min(1).optional(),
|
|
5208
|
+
releaseActor: z3.string().min(1).optional(),
|
|
5209
|
+
tokens: z3.object({
|
|
5210
|
+
collect: z3.string().min(1).refine((v) => parseTokensCollectDeclaration(v) !== null, {
|
|
5153
5211
|
message: 'tokens.collect must be exactly "<interpreter> <repo-relative-script-path>" — two whitespace-separated tokens, no flags, no shell syntax, no quoting'
|
|
5154
5212
|
})
|
|
5155
5213
|
}).optional(),
|
|
5156
|
-
blastRadius:
|
|
5157
|
-
proseGates:
|
|
5158
|
-
doctrineRoot:
|
|
5159
|
-
readerFacingPrefix:
|
|
5160
|
-
readerFacingSuffix:
|
|
5161
|
-
legacySlugDir:
|
|
5162
|
-
sourceComments:
|
|
5163
|
-
globs:
|
|
5164
|
-
allowlist:
|
|
5165
|
-
severity:
|
|
5214
|
+
blastRadius: z3.object({ extraDomains: z3.array(z3.string()).optional() }).optional(),
|
|
5215
|
+
proseGates: z3.object({
|
|
5216
|
+
doctrineRoot: z3.string().min(1).optional(),
|
|
5217
|
+
readerFacingPrefix: z3.string().min(1).optional(),
|
|
5218
|
+
readerFacingSuffix: z3.string().min(1).optional(),
|
|
5219
|
+
legacySlugDir: z3.string().min(1).optional(),
|
|
5220
|
+
sourceComments: z3.object({
|
|
5221
|
+
globs: z3.array(z3.string().min(1)).optional(),
|
|
5222
|
+
allowlist: z3.array(z3.string().min(1)).optional(),
|
|
5223
|
+
severity: z3.enum(["warning", "error"]).optional()
|
|
5166
5224
|
}).optional(),
|
|
5167
|
-
specGrandfather:
|
|
5168
|
-
specPaths:
|
|
5169
|
-
productPaths:
|
|
5225
|
+
specGrandfather: z3.union([z3.array(z3.string().min(1)), z3.record(z3.string().min(1), z3.number().int().min(0))]).optional(),
|
|
5226
|
+
specPaths: z3.array(RepoRelativePathSchema).optional(),
|
|
5227
|
+
productPaths: z3.array(RepoRelativePathSchema).optional(),
|
|
5170
5228
|
published: PublishedProseSchema.optional(),
|
|
5171
5229
|
rules: ProseRulesSchema.optional()
|
|
5172
5230
|
}).optional(),
|
|
5173
|
-
projects:
|
|
5174
|
-
dispatch:
|
|
5175
|
-
timeoutMs:
|
|
5176
|
-
reviewerTimeoutMs:
|
|
5177
|
-
killGraceMs:
|
|
5178
|
-
agent:
|
|
5231
|
+
projects: z3.array(ProjectEntrySchema).optional(),
|
|
5232
|
+
dispatch: z3.object({
|
|
5233
|
+
timeoutMs: z3.number().int().positive().optional(),
|
|
5234
|
+
reviewerTimeoutMs: z3.number().int().positive().optional(),
|
|
5235
|
+
killGraceMs: z3.number().int().positive().optional(),
|
|
5236
|
+
agent: z3.enum(["claude", "codex"]).optional()
|
|
5179
5237
|
}).optional(),
|
|
5180
|
-
reviewPolicy:
|
|
5181
|
-
codeReviewThreshold:
|
|
5182
|
-
securityThreshold:
|
|
5183
|
-
maxRounds:
|
|
5184
|
-
maxTaskMinutes:
|
|
5185
|
-
readyPushTimeoutMinutes:
|
|
5238
|
+
reviewPolicy: z3.object({
|
|
5239
|
+
codeReviewThreshold: z3.string().min(1).optional(),
|
|
5240
|
+
securityThreshold: z3.string().min(1).optional(),
|
|
5241
|
+
maxRounds: z3.number().optional(),
|
|
5242
|
+
maxTaskMinutes: z3.number().optional(),
|
|
5243
|
+
readyPushTimeoutMinutes: z3.number().optional()
|
|
5186
5244
|
}).optional(),
|
|
5187
|
-
securityScan:
|
|
5188
|
-
command:
|
|
5245
|
+
securityScan: z3.object({
|
|
5246
|
+
command: z3.array(z3.string().min(1)).min(1)
|
|
5189
5247
|
}).optional(),
|
|
5190
|
-
gateCutovers:
|
|
5191
|
-
objectivesSinceIssue:
|
|
5192
|
-
briefSectionsSinceIssue:
|
|
5193
|
-
documentationSinceIssue:
|
|
5194
|
-
briefRulesSincePr:
|
|
5195
|
-
agentBoxesRefusedSincePr:
|
|
5248
|
+
gateCutovers: z3.object({
|
|
5249
|
+
objectivesSinceIssue: z3.number().int().nonnegative().optional(),
|
|
5250
|
+
briefSectionsSinceIssue: z3.number().int().nonnegative().optional(),
|
|
5251
|
+
documentationSinceIssue: z3.number().int().nonnegative().optional(),
|
|
5252
|
+
briefRulesSincePr: z3.number().int().nonnegative().optional(),
|
|
5253
|
+
agentBoxesRefusedSincePr: z3.number().int().nonnegative().optional()
|
|
5196
5254
|
}).optional(),
|
|
5197
|
-
planning:
|
|
5198
|
-
collisionThreshold:
|
|
5255
|
+
planning: z3.object({
|
|
5256
|
+
collisionThreshold: z3.number().int().nonnegative().optional(),
|
|
5257
|
+
reviewRoundLimit: z3.number().int().positive().optional(),
|
|
5258
|
+
reviewAgent: z3.enum(["same", "different"]).optional()
|
|
5199
5259
|
}).optional(),
|
|
5200
|
-
prePush:
|
|
5201
|
-
alwaysRun:
|
|
5202
|
-
readyTests:
|
|
5203
|
-
mode:
|
|
5204
|
-
workflow:
|
|
5205
|
-
check:
|
|
5260
|
+
prePush: z3.object({
|
|
5261
|
+
alwaysRun: z3.array(z3.string()).optional(),
|
|
5262
|
+
readyTests: z3.object({
|
|
5263
|
+
mode: z3.literal("ci"),
|
|
5264
|
+
workflow: z3.literal(".github/workflows/ci.yml"),
|
|
5265
|
+
check: z3.literal("Vinaya CI")
|
|
5206
5266
|
}).strict().optional(),
|
|
5207
|
-
requiredCi:
|
|
5208
|
-
workflow:
|
|
5209
|
-
check:
|
|
5267
|
+
requiredCi: z3.object({
|
|
5268
|
+
workflow: z3.literal(".github/workflows/ci.yml"),
|
|
5269
|
+
check: z3.literal("Vinaya CI")
|
|
5210
5270
|
}).strict().optional()
|
|
5211
5271
|
}).optional(),
|
|
5212
|
-
report:
|
|
5213
|
-
commandTimeoutMs:
|
|
5272
|
+
report: z3.object({
|
|
5273
|
+
commandTimeoutMs: z3.number().int().positive().optional()
|
|
5214
5274
|
}).superRefine((report, ctx) => {
|
|
5215
5275
|
const commandTimeoutMs = report.commandTimeoutMs;
|
|
5216
5276
|
if (commandTimeoutMs !== undefined && commandTimeoutMs > MAX_REPORT_COMMAND_TIMEOUT_MS) {
|
|
5217
5277
|
ctx.addIssue({
|
|
5218
|
-
code:
|
|
5278
|
+
code: z3.ZodIssueCode.custom,
|
|
5219
5279
|
path: ["commandTimeoutMs"],
|
|
5220
5280
|
message: "must be at most 3600000 (1 hour)"
|
|
5221
5281
|
});
|
|
5222
5282
|
}
|
|
5223
5283
|
}).optional(),
|
|
5224
|
-
decisionRecords:
|
|
5284
|
+
decisionRecords: z3.object({
|
|
5225
5285
|
path: RepoRelativePathSchema
|
|
5226
5286
|
}).strict().optional()
|
|
5227
5287
|
};
|
|
@@ -5230,10 +5290,11 @@ var init_vinaya_config_section = __esm(() => {
|
|
|
5230
5290
|
"reviewPolicy.maxTaskMinutes",
|
|
5231
5291
|
"reviewPolicy.readyPushTimeoutMinutes"
|
|
5232
5292
|
];
|
|
5293
|
+
REVIEW_AGENT_SETTINGS = ["same", "different"];
|
|
5233
5294
|
PrincipalsUnresolvedError = class PrincipalsUnresolvedError extends Error {
|
|
5234
5295
|
kind;
|
|
5235
|
-
constructor(kind, message) {
|
|
5236
|
-
super(message);
|
|
5296
|
+
constructor(kind, message, options) {
|
|
5297
|
+
super(message, options);
|
|
5237
5298
|
this.name = "PrincipalsUnresolvedError";
|
|
5238
5299
|
this.kind = kind;
|
|
5239
5300
|
}
|
|
@@ -5277,7 +5338,7 @@ var init_vinaya_config_section = __esm(() => {
|
|
|
5277
5338
|
});
|
|
5278
5339
|
|
|
5279
5340
|
// ../../harness/processes/vinaya-strict/integration/config/compose.ts
|
|
5280
|
-
import { z as
|
|
5341
|
+
import { z as z4 } from "zod";
|
|
5281
5342
|
function globalChecksIgnoredWarning(path) {
|
|
5282
5343
|
return `${path}: "checks" registration in the global config is ignored — checks may only be registered from a repo-local vinaya.config.json.`;
|
|
5283
5344
|
}
|
|
@@ -5349,7 +5410,7 @@ var init_compose = __esm(() => {
|
|
|
5349
5410
|
"logs",
|
|
5350
5411
|
"decisionRecords"
|
|
5351
5412
|
];
|
|
5352
|
-
VinayaConfigObjectSchema =
|
|
5413
|
+
VinayaConfigObjectSchema = z4.object(orderedShape(CONFIG_KEY_ORDER, KERNEL_FRAGMENT, VINAYA_CONFIG_SECTION.fragment));
|
|
5353
5414
|
VinayaConfigSchema = VinayaConfigObjectSchema.superRefine((config, ctx) => {
|
|
5354
5415
|
for (const refine of KERNEL_CONFIG_REFINEMENTS)
|
|
5355
5416
|
refine(config, ctx);
|
|
@@ -5400,7 +5461,7 @@ var init_compose = __esm(() => {
|
|
|
5400
5461
|
vinayaConfigProvider = {
|
|
5401
5462
|
homeDir: VINAYA_HOME,
|
|
5402
5463
|
loadConfig: () => loadConfig(),
|
|
5403
|
-
loadTrustAnchorConfig: () => loadTrustAnchorConfig(),
|
|
5464
|
+
loadTrustAnchorConfig: (options) => loadTrustAnchorConfig(undefined, options),
|
|
5404
5465
|
loadTrustAnchorConfigAsync: (fetcher, options) => loadTrustAnchorConfigAsync(fetcher, options)
|
|
5405
5466
|
};
|
|
5406
5467
|
installVinayaConfigProvider();
|
|
@@ -5753,7 +5814,16 @@ function main() {
|
|
|
5753
5814
|
process.exit(0);
|
|
5754
5815
|
}
|
|
5755
5816
|
const content = existsSync4(DOC_OWNERS_PATH) ? readFileSync4(DOC_OWNERS_PATH, "utf8") : null;
|
|
5756
|
-
const result = evaluateC5(changed, content, resolvePrBody(), existsSync4, waiverActive(), (p) => fileDiffAgainst(ref, p));
|
|
5817
|
+
const result = evaluateC5(changed, content, resolvePrBody(), existsSync4, waiverActive(), (p) => fileDiffAgainst(ref, p), prBodyGiven());
|
|
5818
|
+
for (const message of owedNeutralNotes(result)) {
|
|
5819
|
+
emitCheckError({
|
|
5820
|
+
schema: CHECK_SCHEMA_VERSION,
|
|
5821
|
+
check: CHECK_NAME,
|
|
5822
|
+
severity: "warning",
|
|
5823
|
+
message,
|
|
5824
|
+
agent_recovery_prompt: "This change passes here on its comment/whitespace-only diff alone. Add the `Doc-neutral:` line this message " + "names to the pull request body, or the pull request run refuses it."
|
|
5825
|
+
});
|
|
5826
|
+
}
|
|
5757
5827
|
if (result.errors.length > 0) {
|
|
5758
5828
|
for (const message of result.errors) {
|
|
5759
5829
|
emitCheckError({
|