@attalabs/vinaya 0.44.1 → 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 +233 -195
- package/dist/checks/bin/check-branch-topology.js +70 -23
- package/dist/checks/bin/check-brief-shape.js +233 -195
- 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 +128 -34
- package/dist/checks/bin/check-coherence.js +336 -245
- package/dist/checks/bin/check-dispatch-readiness.js +3623 -463
- package/dist/checks/bin/check-doc-claims.js +233 -195
- package/dist/checks/bin/check-doc-coverage-push.js +243 -196
- package/dist/checks/bin/check-doc-coverage.js +243 -196
- package/dist/checks/bin/check-doctrine-no-procedures.js +233 -195
- package/dist/checks/bin/check-doctrine-portability.js +233 -195
- package/dist/checks/bin/check-evidence-fresh.js +9983 -1995
- package/dist/checks/bin/check-exec-bits.js +3 -0
- package/dist/checks/bin/check-first-push-dispatch.js +301 -224
- package/dist/checks/bin/check-issue-milestone-attach.js +65 -10
- package/dist/checks/bin/check-issue-objectives-numbering.js +233 -195
- package/dist/checks/bin/check-issue-parts-coverage.js +65 -10
- package/dist/checks/bin/check-issue-surface-globs.js +1032 -236
- package/dist/checks/bin/check-issue-title-grammar.js +5 -1
- package/dist/checks/bin/check-no-disk-state.js +5 -1
- package/dist/checks/bin/check-pr-premise-reassert.js +10 -1
- package/dist/checks/bin/check-pr-report-density.js +5 -1
- package/dist/checks/bin/check-principal-test-plan-wait.js +253 -201
- package/dist/checks/bin/check-quoted-command.js +233 -195
- package/dist/checks/bin/check-reader-resolvable-prose.js +233 -195
- package/dist/checks/bin/check-registry-gates.js +131 -34
- package/dist/checks/bin/check-retired-vocabulary.js +233 -195
- package/dist/checks/bin/check-review-gate.js +233 -195
- package/dist/checks/bin/check-single-plan-pr.js +5 -1
- package/dist/checks/bin/check-surface-scope.js +107 -32
- package/dist/checks/bin/check-test-plan.js +253 -201
- 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 +16617 -7187
- package/dist/lib/pre-push-cache-test-run.js +4487 -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 +15612 -7634
- 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 +9476 -1820
- package/dist/programs/pr-snapshot.js +8916 -1515
- package/dist/programs/pr-verify-evidence.js +9481 -1825
- package/dist/programs/pr.js +11709 -4033
- package/dist/programs/review-post.js +11140 -3496
- package/dist/programs/review-status.js +8996 -1533
- package/dist/programs/run-engine.js +22031 -18759
- package/dist/programs/sync.js +9030 -1629
- package/dist/programs/task-brief.js +10185 -1821
- package/dist/programs/task-sweep.js +9266 -1621
- package/dist/programs/task-tools-serve.js +77118 -16678
- 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 +3 -3
- package/dist/types/harness/processes/vinaya-strict/tools/task-contract/objectives.d.ts +5 -6
- 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 +4 -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 +2 -1
- 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 +29 -8
- 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/{3URbt6IPajL5OOhijN1-x → bJrgAp9Kl4JsCUYkeAYez}/_buildManifest.js +0 -0
- /package/studio-standalone/apps/vinaya-studio/.next/static/{3URbt6IPajL5OOhijN1-x → 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) {
|
|
@@ -503,7 +506,7 @@ function commentMarkerFamily(name) {
|
|
|
503
506
|
function anchorAlternation(spellings) {
|
|
504
507
|
return `(?:${spellings.map((spelling) => spelling.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|")})`;
|
|
505
508
|
}
|
|
506
|
-
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;
|
|
509
|
+
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;
|
|
507
510
|
var init_legacy_markers = __esm(() => {
|
|
508
511
|
REGION_PREFIX = { old: "AEG", current: "VINAYA" };
|
|
509
512
|
PROVENANCE_HEADING = {
|
|
@@ -525,6 +528,7 @@ var init_legacy_markers = __esm(() => {
|
|
|
525
528
|
LOOP_UNPUSHED_WORK_RESUME_MARKER = commentMarkerFamily("loop:unpushed-work-resume");
|
|
526
529
|
PRINCIPAL_RULING_MARKER = commentMarkerFamily("principal:ruling");
|
|
527
530
|
OBJECTIVES_VERSION_MARKER = commentMarkerFamily("objectives");
|
|
531
|
+
DOCUMENTATION_EDIT_MARKER = commentMarkerFamily("documentation");
|
|
528
532
|
DEFERRED_FINDINGS_MARKER = commentMarkerFamily("deferred-findings");
|
|
529
533
|
COMMENT_MARKER_PREFIX_CURRENT = COMMENT_MARKER_PREFIX.current;
|
|
530
534
|
COMMENT_MARKER_PREFIXES = [COMMENT_MARKER_PREFIX.current, COMMENT_MARKER_PREFIX.old];
|
|
@@ -595,6 +599,7 @@ var init_doctrine_map = __esm(() => {
|
|
|
595
599
|
{ key: "roles/developer.md", source: "executing/developer/doctrine.md", role: "developer", ships: true },
|
|
596
600
|
{ key: "roles/developer/reference.md", source: "executing/developer/reference.md", ships: true },
|
|
597
601
|
{ key: "roles/operator.md", source: "executing/operator/doctrine.md", role: "operator", ships: true },
|
|
602
|
+
{ key: "roles/plan-reviewer.md", source: "thinking/plan-reviewer/doctrine.md", role: "plan-reviewer", ships: true },
|
|
598
603
|
{ key: "roles/planner.md", source: "thinking/planner/doctrine.md", role: "planner", ships: true },
|
|
599
604
|
{ key: "roles/planner/reference.md", source: "thinking/planner/reference.md", ships: true },
|
|
600
605
|
{ key: "roles/principal.md", source: "doctrine/roles/principal.md", role: "principal", ships: true },
|
|
@@ -779,7 +784,13 @@ function isMechanicallyNeutralDiff(diffText, path) {
|
|
|
779
784
|
}
|
|
780
785
|
return sawChange;
|
|
781
786
|
}
|
|
782
|
-
function
|
|
787
|
+
function prBodyGiven(env = process.env) {
|
|
788
|
+
return env.PR_BODY !== undefined || env.PR_BODY_FILE !== undefined;
|
|
789
|
+
}
|
|
790
|
+
function owedNeutralNotes(result) {
|
|
791
|
+
return result.notes.filter((n) => n.startsWith(DOC_NEUTRAL_OWED_PREFIX));
|
|
792
|
+
}
|
|
793
|
+
function evaluateC5(changed, docOwnersContent, prBody, fileExists, waiverActive, getDiff, bodyGiven = true) {
|
|
783
794
|
const out = { errors: [], notes: [] };
|
|
784
795
|
if (docOwnersContent === null)
|
|
785
796
|
return out;
|
|
@@ -819,24 +830,28 @@ function evaluateC5(changed, docOwnersContent, prBody, fileExists, waiverActive,
|
|
|
819
830
|
}
|
|
820
831
|
if (changed.includes(pointerPath))
|
|
821
832
|
continue;
|
|
833
|
+
const evidenced = () => getDiff !== undefined && matchedFiles.every((f) => {
|
|
834
|
+
const diff = getDiff(f);
|
|
835
|
+
return diff !== null && isMechanicallyNeutralDiff(diff, f);
|
|
836
|
+
});
|
|
822
837
|
const declared = neutrals.find((n) => n.surface === b.pointer);
|
|
823
838
|
if (declared) {
|
|
824
|
-
|
|
825
|
-
const diff = getDiff(f);
|
|
826
|
-
return diff !== null && isMechanicallyNeutralDiff(diff, f);
|
|
827
|
-
});
|
|
828
|
-
if (evidenced) {
|
|
839
|
+
if (evidenced()) {
|
|
829
840
|
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.`);
|
|
830
841
|
continue;
|
|
831
842
|
}
|
|
832
843
|
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.`);
|
|
833
844
|
continue;
|
|
834
845
|
}
|
|
846
|
+
if (!bodyGiven && evidenced()) {
|
|
847
|
+
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>\`.`);
|
|
848
|
+
continue;
|
|
849
|
+
}
|
|
835
850
|
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.`);
|
|
836
851
|
}
|
|
837
852
|
return out;
|
|
838
853
|
}
|
|
839
|
-
var DOC_OWNERS_PATH = ".vinaya/doc-owners", SEPARATOR, LANGUAGE_COMMENT_PREFIXES;
|
|
854
|
+
var DOC_OWNERS_PATH = ".vinaya/doc-owners", SEPARATOR, LANGUAGE_COMMENT_PREFIXES, DOC_NEUTRAL_OWED_PREFIX = "C5 doc-neutral-owed:";
|
|
840
855
|
var init_doc_owners = __esm(() => {
|
|
841
856
|
init_file_classify();
|
|
842
857
|
init_waiver_label();
|
|
@@ -1030,59 +1045,22 @@ function emitCheckError(error) {
|
|
|
1030
1045
|
var CHECK_SCHEMA_VERSION = 1;
|
|
1031
1046
|
|
|
1032
1047
|
// ../../harness/kernel/log/custom.ts
|
|
1033
|
-
import {
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
CUSTOM_EVENT_NAME_PATTERN
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
});
|
|
1050
|
-
};
|
|
1051
|
-
if (name.length > CUSTOM_EVENT_NAME_MAX_LENGTH) {
|
|
1052
|
-
refuse(`the name must be at most ${CUSTOM_EVENT_NAME_MAX_LENGTH} characters`);
|
|
1053
|
-
}
|
|
1054
|
-
if (!CUSTOM_EVENT_NAME_PATTERN.test(name)) {
|
|
1055
|
-
refuse("the name must be `<namespace>.<event>` — lowercase letters, digits and `_`, a dot between them");
|
|
1056
|
-
} else if (name.split(".")[0] === CUSTOM_EVENT_RESERVED_NAMESPACE) {
|
|
1057
|
-
refuse(`the \`${CUSTOM_EVENT_RESERVED_NAMESPACE}.\` namespace is reserved for Vinaya's own events`);
|
|
1058
|
-
}
|
|
1059
|
-
const fieldEntries = Object.entries(declaration.fields);
|
|
1060
|
-
if (fieldEntries.length > CUSTOM_EVENT_MAX_FIELDS) {
|
|
1061
|
-
refuse(`at most ${CUSTOM_EVENT_MAX_FIELDS} fields may be declared (found ${fieldEntries.length})`, ["fields"]);
|
|
1062
|
-
}
|
|
1063
|
-
for (const [field, type] of fieldEntries) {
|
|
1064
|
-
if (field.length > CUSTOM_FIELD_NAME_MAX_LENGTH || !CUSTOM_FIELD_NAME_PATTERN.test(field)) {
|
|
1065
|
-
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]);
|
|
1066
|
-
}
|
|
1067
|
-
if (typeof type === "string")
|
|
1068
|
-
continue;
|
|
1069
|
-
if (type.length === 0) {
|
|
1070
|
-
refuse(`field "${field}": a list of words must name at least one word`, ["fields", field]);
|
|
1071
|
-
}
|
|
1072
|
-
if (type.length > CUSTOM_FIELD_MAX_WORDS) {
|
|
1073
|
-
refuse(`field "${field}": a list of words may name at most ${CUSTOM_FIELD_MAX_WORDS}`, ["fields", field]);
|
|
1074
|
-
}
|
|
1075
|
-
const bad = type.filter((w) => w.length > CUSTOM_WORD_MAX_LENGTH || !CUSTOM_WORD_PATTERN.test(w));
|
|
1076
|
-
if (bad.length > 0) {
|
|
1077
|
-
refuse(`field "${field}": a listed word is lowercase letters, digits, \`_\` and \`-\`, at most ${CUSTOM_WORD_MAX_LENGTH} characters`, ["fields", field]);
|
|
1078
|
-
}
|
|
1079
|
-
if (new Set(type).size !== type.length) {
|
|
1080
|
-
refuse(`field "${field}": a list of words names a word twice`, ["fields", field]);
|
|
1081
|
-
}
|
|
1082
|
-
}
|
|
1083
|
-
}
|
|
1084
|
-
});
|
|
1085
|
-
});
|
|
1048
|
+
import {
|
|
1049
|
+
CUSTOM_EVENT_MAX_FIELDS,
|
|
1050
|
+
CUSTOM_EVENT_NAME_MAX_LENGTH,
|
|
1051
|
+
CUSTOM_EVENT_NAME_PATTERN,
|
|
1052
|
+
CUSTOM_EVENT_RESERVED_NAMESPACE,
|
|
1053
|
+
CUSTOM_FIELD_MAX_WORDS,
|
|
1054
|
+
CUSTOM_FIELD_NAME_MAX_LENGTH,
|
|
1055
|
+
CUSTOM_FIELD_NAME_PATTERN,
|
|
1056
|
+
CUSTOM_TEXT_MAX_LENGTH,
|
|
1057
|
+
CUSTOM_WORD_MAX_LENGTH,
|
|
1058
|
+
CUSTOM_WORD_PATTERN,
|
|
1059
|
+
CustomEventDeclarationsSchema,
|
|
1060
|
+
checkCustomEvent,
|
|
1061
|
+
UNRECORDABLE_FIELD_NAME
|
|
1062
|
+
} from "@attalabs/vinaya-log-sdk";
|
|
1063
|
+
var init_custom = () => {};
|
|
1086
1064
|
|
|
1087
1065
|
// ../../harness/kernel/adapters/agents/agent-vendors.ts
|
|
1088
1066
|
var AGENT_VENDORS;
|
|
@@ -1422,14 +1400,15 @@ ${detail}`;
|
|
|
1422
1400
|
return null;
|
|
1423
1401
|
}
|
|
1424
1402
|
}
|
|
1425
|
-
function loadTrustAnchorConfig(fetcher = fetchTrustAnchorConfig) {
|
|
1403
|
+
function loadTrustAnchorConfig(fetcher = fetchTrustAnchorConfig, loadOptions = {}) {
|
|
1404
|
+
const warn = loadOptions.quiet ? () => {} : warnTrustAnchorFallback;
|
|
1426
1405
|
let base64;
|
|
1427
1406
|
try {
|
|
1428
1407
|
base64 = fetcher();
|
|
1429
1408
|
} catch (err) {
|
|
1430
|
-
return trustAnchorFetchFailed(err);
|
|
1409
|
+
return trustAnchorFetchFailed(err, warn);
|
|
1431
1410
|
}
|
|
1432
|
-
return parseTrustAnchorContent(base64);
|
|
1411
|
+
return parseTrustAnchorContent(base64, warn);
|
|
1433
1412
|
}
|
|
1434
1413
|
function loadTrustAnchorConfigOrThrow(fetcher = fetchTrustAnchorConfig) {
|
|
1435
1414
|
let base64;
|
|
@@ -1488,9 +1467,9 @@ var installed = null, NO_CONFIG_PROVIDER_MESSAGE = "no configuration provider is
|
|
|
1488
1467
|
|
|
1489
1468
|
// ../../harness/kernel/config/schema/config-schema.ts
|
|
1490
1469
|
import { isAbsolute } from "node:path";
|
|
1491
|
-
import { z
|
|
1470
|
+
import { z } from "zod";
|
|
1492
1471
|
function checkEntrySchema(fields) {
|
|
1493
|
-
return
|
|
1472
|
+
return z.object(fields).superRefine((entry, ctx) => {
|
|
1494
1473
|
const env = entry.env;
|
|
1495
1474
|
if (!env)
|
|
1496
1475
|
return;
|
|
@@ -1500,14 +1479,14 @@ function checkEntrySchema(fields) {
|
|
|
1500
1479
|
const members = value.anyOf;
|
|
1501
1480
|
if (new Set(members).size !== members.length) {
|
|
1502
1481
|
ctx.addIssue({
|
|
1503
|
-
code:
|
|
1482
|
+
code: z.ZodIssueCode.custom,
|
|
1504
1483
|
message: `env.${key}.anyOf has duplicate members`,
|
|
1505
1484
|
path: ["env", key, "anyOf"]
|
|
1506
1485
|
});
|
|
1507
1486
|
}
|
|
1508
1487
|
if (!members.includes(key)) {
|
|
1509
1488
|
ctx.addIssue({
|
|
1510
|
-
code:
|
|
1489
|
+
code: z.ZodIssueCode.custom,
|
|
1511
1490
|
message: `env.${key}.anyOf must include "${key}" itself as a member`,
|
|
1512
1491
|
path: ["env", key, "anyOf"]
|
|
1513
1492
|
});
|
|
@@ -1530,26 +1509,31 @@ function hookBlockPathRule(prefixes) {
|
|
|
1530
1509
|
return { isCanonical, schema };
|
|
1531
1510
|
}
|
|
1532
1511
|
function managedManifestSchemas(agentVendors, hookBlockPrefixes) {
|
|
1533
|
-
const block =
|
|
1512
|
+
const block = z.object({
|
|
1534
1513
|
path: hookBlockPathRule(hookBlockPrefixes).schema,
|
|
1535
|
-
marker:
|
|
1536
|
-
comment:
|
|
1514
|
+
marker: z.string(),
|
|
1515
|
+
comment: z.enum(["hash", "html"])
|
|
1537
1516
|
});
|
|
1538
|
-
const manifest =
|
|
1539
|
-
version:
|
|
1540
|
-
files:
|
|
1541
|
-
blocks:
|
|
1542
|
-
labels:
|
|
1543
|
-
agents:
|
|
1517
|
+
const manifest = z.object({
|
|
1518
|
+
version: z.number().int().positive(),
|
|
1519
|
+
files: z.array(SafeRepoRelPath),
|
|
1520
|
+
blocks: z.array(block),
|
|
1521
|
+
labels: z.array(z.string()),
|
|
1522
|
+
agents: z.array(z.enum(agentVendors)).optional()
|
|
1544
1523
|
});
|
|
1545
1524
|
return { block, manifest };
|
|
1546
1525
|
}
|
|
1547
1526
|
function logsSchema(events) {
|
|
1548
|
-
return
|
|
1549
|
-
folder:
|
|
1550
|
-
url:
|
|
1551
|
-
|
|
1552
|
-
|
|
1527
|
+
return z.object({
|
|
1528
|
+
folder: z.string().min(1).refine((v) => isAbsolute(v), { message: "logs.folder: must be an absolute path" }).optional(),
|
|
1529
|
+
url: z.string().url().optional(),
|
|
1530
|
+
otlp: z.object({
|
|
1531
|
+
url: z.string().url().regex(/^https?:\/\//i),
|
|
1532
|
+
headers: z.record(z.string()).optional()
|
|
1533
|
+
}).strict().optional(),
|
|
1534
|
+
headers: z.record(z.string()).optional(),
|
|
1535
|
+
readHeaders: z.record(z.string()).optional(),
|
|
1536
|
+
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(),
|
|
1553
1537
|
events: events.optional()
|
|
1554
1538
|
}).refine((v) => [v.folder, v.url].filter((x) => x !== undefined).length <= 1, {
|
|
1555
1539
|
message: "logs: set at most one of folder/url"
|
|
@@ -1557,22 +1541,22 @@ function logsSchema(events) {
|
|
|
1557
1541
|
message: "logs: headers requires url"
|
|
1558
1542
|
}).refine((v) => v.readHeaders === undefined || v.url !== undefined, {
|
|
1559
1543
|
message: "logs: readHeaders requires url"
|
|
1560
|
-
}).or(
|
|
1544
|
+
}).or(z.literal(false)).optional();
|
|
1561
1545
|
}
|
|
1562
1546
|
function kernelConfigFragment(leaves) {
|
|
1563
1547
|
return {
|
|
1564
|
-
rings:
|
|
1565
|
-
ring1_forgeWriteInterception:
|
|
1566
|
-
ring2_asyncAudits:
|
|
1548
|
+
rings: z.object({
|
|
1549
|
+
ring1_forgeWriteInterception: z.boolean(),
|
|
1550
|
+
ring2_asyncAudits: z.boolean()
|
|
1567
1551
|
}).optional(),
|
|
1568
|
-
checks:
|
|
1552
|
+
checks: z.record(z.string(), checkEntrySchema(leaves.checkEntryFields)).optional(),
|
|
1569
1553
|
managed: managedManifestSchemas(leaves.agentVendors, leaves.hookBlockPrefixes).manifest.optional(),
|
|
1570
|
-
ci:
|
|
1571
|
-
logPublish:
|
|
1554
|
+
ci: z.object({ setup: z.string().min(1) }).optional(),
|
|
1555
|
+
logPublish: z.unknown().refine((v) => v === undefined, {
|
|
1572
1556
|
message: "logPublish is removed — telemetry is never posted to a tracker or a code host; configure `logs` instead (a folder or a server destination)"
|
|
1573
1557
|
}),
|
|
1574
|
-
runtimeDir:
|
|
1575
|
-
runner:
|
|
1558
|
+
runtimeDir: z.string().min(1).refine((v) => isAbsolute(v), { message: "runtimeDir: must be an absolute path" }).optional(),
|
|
1559
|
+
runner: z.enum(["standalone", "atta-engine"]).optional(),
|
|
1576
1560
|
logs: logsSchema(leaves.logEvents)
|
|
1577
1561
|
};
|
|
1578
1562
|
}
|
|
@@ -1612,25 +1596,25 @@ function resolveLogsHeaderValues(headers, env) {
|
|
|
1612
1596
|
}
|
|
1613
1597
|
var EnvEntrySchema, KERNEL_CHECK_ENTRY_FIELDS, SafeRepoRelPath, KERNEL_CONFIG_REFINEMENTS;
|
|
1614
1598
|
var init_config_schema = __esm(() => {
|
|
1615
|
-
EnvEntrySchema =
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1599
|
+
EnvEntrySchema = z.union([
|
|
1600
|
+
z.literal(true),
|
|
1601
|
+
z.object({ optional: z.literal(true) }),
|
|
1602
|
+
z.object({ anyOf: z.array(z.string()).min(2) }),
|
|
1603
|
+
z.string()
|
|
1620
1604
|
]);
|
|
1621
1605
|
KERNEL_CHECK_ENTRY_FIELDS = {
|
|
1622
|
-
run:
|
|
1623
|
-
scope:
|
|
1624
|
-
include:
|
|
1625
|
-
args:
|
|
1626
|
-
timeoutMs:
|
|
1627
|
-
env:
|
|
1628
|
-
requiresOpenPr:
|
|
1629
|
-
ownWorkflow:
|
|
1630
|
-
validates:
|
|
1631
|
-
advisory:
|
|
1606
|
+
run: z.string(),
|
|
1607
|
+
scope: z.enum(["diff", "full"]),
|
|
1608
|
+
include: z.array(z.string()).optional(),
|
|
1609
|
+
args: z.array(z.string()).optional(),
|
|
1610
|
+
timeoutMs: z.number().optional(),
|
|
1611
|
+
env: z.record(z.string(), EnvEntrySchema).optional(),
|
|
1612
|
+
requiresOpenPr: z.boolean().optional(),
|
|
1613
|
+
ownWorkflow: z.boolean().optional(),
|
|
1614
|
+
validates: z.enum(["body", "issue"]).optional(),
|
|
1615
|
+
advisory: z.literal(true).optional()
|
|
1632
1616
|
};
|
|
1633
|
-
SafeRepoRelPath =
|
|
1617
|
+
SafeRepoRelPath = z.string().refine(isSafeRepoRelPath, {
|
|
1634
1618
|
message: "must be a repo-root-relative path with no `..` segment or absolute root"
|
|
1635
1619
|
});
|
|
1636
1620
|
KERNEL_CONFIG_REFINEMENTS = [];
|
|
@@ -1863,6 +1847,23 @@ async function ghApiGetAllPagesAsync(pathWithoutPage, opts) {
|
|
|
1863
1847
|
}
|
|
1864
1848
|
throw new Error(`ghApiGetAllPagesAsync: "${pathWithoutPage}" did not terminate within ${MAX_PAGES} pages (${MAX_PAGES * MAX_PER_PAGE} items) — refusing to keep walking.`);
|
|
1865
1849
|
}
|
|
1850
|
+
async function ghLabelIssueCountsAsync(owner, repo, labelQuery) {
|
|
1851
|
+
const stdout = await runAsync([
|
|
1852
|
+
"api",
|
|
1853
|
+
"graphql",
|
|
1854
|
+
"--paginate",
|
|
1855
|
+
"-f",
|
|
1856
|
+
`query=${LABEL_ISSUE_COUNTS_QUERY.replace("$labelQuery", JSON.stringify(labelQuery))}`,
|
|
1857
|
+
"-f",
|
|
1858
|
+
`owner=${owner}`,
|
|
1859
|
+
"-f",
|
|
1860
|
+
`name=${repo}`,
|
|
1861
|
+
"--jq",
|
|
1862
|
+
".data.repository.labels.nodes[] | {name, open: .open.totalCount, total: .all.totalCount}"
|
|
1863
|
+
]);
|
|
1864
|
+
return stdout.split(`
|
|
1865
|
+
`).filter((line) => line.trim() !== "").map((line) => JSON.parse(line));
|
|
1866
|
+
}
|
|
1866
1867
|
function issueListByLabelArgs(owner, repo, label) {
|
|
1867
1868
|
return [
|
|
1868
1869
|
"issue",
|
|
@@ -1896,7 +1897,14 @@ async function ghIssueListByAnyLabelAsync(owner, repo, labels) {
|
|
|
1896
1897
|
const perLabel = await Promise.all(labels.map((l) => ghIssueListByLabelAsync(owner, repo, l)));
|
|
1897
1898
|
return dedupeByNumber(perLabel.flat());
|
|
1898
1899
|
}
|
|
1899
|
-
var execFileAsync2, systemEnv, MAX_PER_PAGE = 100, MAX_PAGES = 100
|
|
1900
|
+
var execFileAsync2, systemEnv, MAX_PER_PAGE = 100, MAX_PAGES = 100, LABEL_ISSUE_COUNTS_QUERY = `query($owner: String!, $name: String!, $endCursor: String) {
|
|
1901
|
+
repository(owner: $owner, name: $name) {
|
|
1902
|
+
labels(first: 100, after: $endCursor, query: $labelQuery) {
|
|
1903
|
+
pageInfo { hasNextPage endCursor }
|
|
1904
|
+
nodes { name open: issues(states: OPEN) { totalCount } all: issues { totalCount } }
|
|
1905
|
+
}
|
|
1906
|
+
}
|
|
1907
|
+
}`;
|
|
1900
1908
|
var init_gh = __esm(() => {
|
|
1901
1909
|
execFileAsync2 = promisify2(execFile2);
|
|
1902
1910
|
systemEnv = {
|
|
@@ -3731,6 +3739,20 @@ var init_protected_paths = __esm(() => {
|
|
|
3731
3739
|
];
|
|
3732
3740
|
});
|
|
3733
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
|
+
|
|
3734
3756
|
// ../../harness/processes/vinaya-strict/tools/task-contract/issue-validation.ts
|
|
3735
3757
|
function hasRationaleField(body, labelPattern) {
|
|
3736
3758
|
const re = new RegExp(`(?:\\*\\*|^#{1,4}\\s+)\\s*(?:${labelPattern})`, "im");
|
|
@@ -3929,7 +3951,7 @@ function checkPartsCiteDefinedObjectives(body) {
|
|
|
3929
3951
|
return { status: errors.length > 0 ? "fail" : "pass", errors };
|
|
3930
3952
|
}
|
|
3931
3953
|
function liveCommand(text) {
|
|
3932
|
-
const trimmed = text
|
|
3954
|
+
const trimmed = stripObjectiveIdSpans(text);
|
|
3933
3955
|
const span = /^(`+)(.+)\1$/.exec(trimmed);
|
|
3934
3956
|
return span ? span[2].trim() : trimmed;
|
|
3935
3957
|
}
|
|
@@ -4064,11 +4086,13 @@ var init_issue_validation = __esm(() => {
|
|
|
4064
4086
|
init_derive_section7();
|
|
4065
4087
|
init_doctrine_map();
|
|
4066
4088
|
init_objectives();
|
|
4089
|
+
init_waiver_label();
|
|
4067
4090
|
init_issue_documentation();
|
|
4068
4091
|
init_touched_path();
|
|
4069
4092
|
init_protected_paths();
|
|
4070
4093
|
init_quoted_command();
|
|
4071
4094
|
init_test_plan_section();
|
|
4095
|
+
init_test_plan_proof();
|
|
4072
4096
|
RATIONALE_FIELDS = [
|
|
4073
4097
|
{ name: "Boundary", pattern: "Boundary" },
|
|
4074
4098
|
{ name: "Sizing", pattern: "Sizing" },
|
|
@@ -4565,7 +4589,7 @@ var init_review_gate = __esm(() => {
|
|
|
4565
4589
|
|
|
4566
4590
|
// ../../harness/processes/vinaya-strict/tools/prose-rules-config.ts
|
|
4567
4591
|
import safeRegex from "safe-regex2";
|
|
4568
|
-
import { z as
|
|
4592
|
+
import { z as z2 } from "zod";
|
|
4569
4593
|
function isPlainObject(value) {
|
|
4570
4594
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
4571
4595
|
}
|
|
@@ -4835,18 +4859,18 @@ var init_prose_rules_config = __esm(() => {
|
|
|
4835
4859
|
FIXED_DEFAULT_KEYS = ["pattern", "patterns", "flags", "means", "message", "id"];
|
|
4836
4860
|
CUSTOM_KEYS = ["id", "pattern", "patterns", "flags", "means", "scopes", "severity", "exempt"];
|
|
4837
4861
|
DEFAULT_IDS = new Set([...DEFAULT_PROSE_RULES.map((rule) => rule.id), DECISION_RECORD_CITATION_ID]);
|
|
4838
|
-
RepoRelativePathSchema =
|
|
4862
|
+
RepoRelativePathSchema = z2.string().min(1).superRefine((entry, ctx) => {
|
|
4839
4863
|
const reason = outsideRepositoryReason(entry);
|
|
4840
4864
|
if (reason)
|
|
4841
|
-
ctx.addIssue({ code:
|
|
4865
|
+
ctx.addIssue({ code: z2.ZodIssueCode.custom, message: reason });
|
|
4842
4866
|
});
|
|
4843
|
-
ProseRulesSchema =
|
|
4867
|
+
ProseRulesSchema = z2.unknown().superRefine((value, ctx) => {
|
|
4844
4868
|
for (const issue of proseRulesIssues(value)) {
|
|
4845
|
-
ctx.addIssue({ code:
|
|
4869
|
+
ctx.addIssue({ code: z2.ZodIssueCode.custom, path: issue.path, message: issue.message });
|
|
4846
4870
|
}
|
|
4847
4871
|
}).transform((value) => value);
|
|
4848
|
-
PublishedProseSchema =
|
|
4849
|
-
allow:
|
|
4872
|
+
PublishedProseSchema = z2.object({
|
|
4873
|
+
allow: z2.array(z2.string().min(1)).optional()
|
|
4850
4874
|
}).strict();
|
|
4851
4875
|
});
|
|
4852
4876
|
|
|
@@ -4861,10 +4885,13 @@ var exports_vinaya_config_section = {};
|
|
|
4861
4885
|
__export(exports_vinaya_config_section, {
|
|
4862
4886
|
BRIEF_BUILTINS: () => BRIEF_BUILTINS,
|
|
4863
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,
|
|
4864
4890
|
LOCAL_OVERRIDABLE_KEYS: () => LOCAL_OVERRIDABLE_KEYS,
|
|
4865
4891
|
LOCAL_OVERRIDE_FILENAME: () => LOCAL_OVERRIDE_FILENAME,
|
|
4866
4892
|
PRINCIPALS_FIX: () => PRINCIPALS_FIX,
|
|
4867
4893
|
PrincipalsUnresolvedError: () => PrincipalsUnresolvedError,
|
|
4894
|
+
REVIEW_AGENT_SETTINGS: () => REVIEW_AGENT_SETTINGS,
|
|
4868
4895
|
VINAYA_CHECK_ENTRY_FIELDS: () => VINAYA_CHECK_ENTRY_FIELDS,
|
|
4869
4896
|
VINAYA_CONFIG_FILENAME: () => VINAYA_CONFIG_FILENAME,
|
|
4870
4897
|
VINAYA_CONFIG_FRAGMENT: () => VINAYA_CONFIG_FRAGMENT,
|
|
@@ -4886,7 +4913,9 @@ __export(exports_vinaya_config_section, {
|
|
|
4886
4913
|
resolveGateCutovers: () => resolveGateCutovers,
|
|
4887
4914
|
resolveLocalPacingOverride: () => resolveLocalPacingOverride,
|
|
4888
4915
|
resolveReleaseActor: () => resolveReleaseActor,
|
|
4916
|
+
resolveReviewAgent: () => resolveReviewAgent,
|
|
4889
4917
|
resolveReviewPolicy: () => resolveReviewPolicy,
|
|
4918
|
+
resolveReviewRoundLimit: () => resolveReviewRoundLimit,
|
|
4890
4919
|
resolveSecurityScanCommand: () => resolveSecurityScanCommand,
|
|
4891
4920
|
tokensCollectTrustKey: () => tokensCollectTrustKey,
|
|
4892
4921
|
trustAnchorFallbackWarning: () => trustAnchorFallbackWarning,
|
|
@@ -4897,7 +4926,7 @@ import { execFileSync as execFileSync4 } from "node:child_process";
|
|
|
4897
4926
|
import { existsSync as existsSync2, mkdirSync as mkdirSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
4898
4927
|
import { homedir } from "node:os";
|
|
4899
4928
|
import { dirname as dirname2, join as join3 } from "node:path";
|
|
4900
|
-
import { z as
|
|
4929
|
+
import { z as z3 } from "zod";
|
|
4901
4930
|
function isDefaultedAgentVendorPath(path, manifest) {
|
|
4902
4931
|
if (manifest.agents !== undefined)
|
|
4903
4932
|
return false;
|
|
@@ -4931,7 +4960,7 @@ function decisionRecordsOutsideDoctrine(config, ctx) {
|
|
|
4931
4960
|
return;
|
|
4932
4961
|
const issue = decisionRecordsPathIssue(path, config.proseGates?.doctrineRoot);
|
|
4933
4962
|
if (issue)
|
|
4934
|
-
ctx.addIssue({ code:
|
|
4963
|
+
ctx.addIssue({ code: z3.ZodIssueCode.custom, path: ["decisionRecords", "path"], message: issue });
|
|
4935
4964
|
}
|
|
4936
4965
|
function globalPrincipalsIgnoredWarning(path) {
|
|
4937
4966
|
return `${path}: "principals" in the global config is ignored — principals may only be declared from a repo-local vinaya.config.json.`;
|
|
@@ -5035,6 +5064,12 @@ function resolveGateCutovers(config) {
|
|
|
5035
5064
|
function resolveCollisionThreshold(config) {
|
|
5036
5065
|
return config?.planning?.collisionThreshold ?? DEFAULT_COLLISION_THRESHOLD;
|
|
5037
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
|
+
}
|
|
5038
5073
|
function principalsNotConfigured(why) {
|
|
5039
5074
|
return new PrincipalsUnresolvedError("not-configured", `no Principal is configured (${why}) — ${PRINCIPALS_FIX}.`);
|
|
5040
5075
|
}
|
|
@@ -5049,7 +5084,7 @@ function createTrustedPrincipalsResolver(reads) {
|
|
|
5049
5084
|
}
|
|
5050
5085
|
if (isMissingFileError(err))
|
|
5051
5086
|
throw principalsNotConfigured("the default branch has no vinaya.config.json");
|
|
5052
|
-
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 });
|
|
5053
5088
|
}
|
|
5054
5089
|
const unusable = { why: "" };
|
|
5055
5090
|
const config = reads.parse(content, (why) => {
|
|
@@ -5109,7 +5144,7 @@ function trustTokensCollectCommand(repoGitCommonDir, interpreter, script, script
|
|
|
5109
5144
|
store[key] = { interpreter, script, scriptBlobHash, trustedAt: new Date().toISOString() };
|
|
5110
5145
|
writeTokensCollectTrustStore(storePath, store);
|
|
5111
5146
|
}
|
|
5112
|
-
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;
|
|
5113
5148
|
var init_vinaya_config_section = __esm(() => {
|
|
5114
5149
|
init_review_policy();
|
|
5115
5150
|
init_issue_validation();
|
|
@@ -5123,10 +5158,10 @@ var init_vinaya_config_section = __esm(() => {
|
|
|
5123
5158
|
VINAYA_HOME = join3(homedir(), ".vinaya");
|
|
5124
5159
|
CANONICAL_HOOK_BLOCK_PREFIXES = [".git/", ".husky/", ".vinaya/hooks/", ".claude/hooks/"];
|
|
5125
5160
|
VINAYA_CHECK_ENTRY_FIELDS = {
|
|
5126
|
-
principalOwed:
|
|
5161
|
+
principalOwed: z3.literal(true).optional()
|
|
5127
5162
|
};
|
|
5128
|
-
RoleEntrySchema =
|
|
5129
|
-
contract:
|
|
5163
|
+
RoleEntrySchema = z3.object({
|
|
5164
|
+
contract: z3.string().refine((p) => p.includes("/"), {
|
|
5130
5165
|
message: 'must be a path (contain at least one "/"), not a bare filename'
|
|
5131
5166
|
})
|
|
5132
5167
|
});
|
|
@@ -5149,102 +5184,104 @@ var init_vinaya_config_section = __esm(() => {
|
|
|
5149
5184
|
"briefSections",
|
|
5150
5185
|
"milestoneShape"
|
|
5151
5186
|
];
|
|
5152
|
-
BriefSectionSchema =
|
|
5153
|
-
|
|
5154
|
-
|
|
5155
|
-
|
|
5156
|
-
|
|
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() })
|
|
5157
5192
|
]);
|
|
5158
|
-
BriefSchemaSchema =
|
|
5159
|
-
pr:
|
|
5160
|
-
issue:
|
|
5161
|
-
milestone:
|
|
5162
|
-
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()
|
|
5163
5198
|
});
|
|
5164
|
-
ProjectEntrySchema =
|
|
5165
|
-
name:
|
|
5166
|
-
description:
|
|
5167
|
-
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()
|
|
5168
5203
|
});
|
|
5169
5204
|
VINAYA_CONFIG_FRAGMENT = {
|
|
5170
|
-
roles:
|
|
5205
|
+
roles: z3.record(z3.string(), RoleEntrySchema).optional(),
|
|
5171
5206
|
briefSchema: BriefSchemaSchema.optional(),
|
|
5172
|
-
principals:
|
|
5173
|
-
releaseActor:
|
|
5174
|
-
tokens:
|
|
5175
|
-
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, {
|
|
5176
5211
|
message: 'tokens.collect must be exactly "<interpreter> <repo-relative-script-path>" — two whitespace-separated tokens, no flags, no shell syntax, no quoting'
|
|
5177
5212
|
})
|
|
5178
5213
|
}).optional(),
|
|
5179
|
-
blastRadius:
|
|
5180
|
-
proseGates:
|
|
5181
|
-
doctrineRoot:
|
|
5182
|
-
readerFacingPrefix:
|
|
5183
|
-
readerFacingSuffix:
|
|
5184
|
-
legacySlugDir:
|
|
5185
|
-
sourceComments:
|
|
5186
|
-
globs:
|
|
5187
|
-
allowlist:
|
|
5188
|
-
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()
|
|
5189
5224
|
}).optional(),
|
|
5190
|
-
specGrandfather:
|
|
5191
|
-
specPaths:
|
|
5192
|
-
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(),
|
|
5193
5228
|
published: PublishedProseSchema.optional(),
|
|
5194
5229
|
rules: ProseRulesSchema.optional()
|
|
5195
5230
|
}).optional(),
|
|
5196
|
-
projects:
|
|
5197
|
-
dispatch:
|
|
5198
|
-
timeoutMs:
|
|
5199
|
-
reviewerTimeoutMs:
|
|
5200
|
-
killGraceMs:
|
|
5201
|
-
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()
|
|
5202
5237
|
}).optional(),
|
|
5203
|
-
reviewPolicy:
|
|
5204
|
-
codeReviewThreshold:
|
|
5205
|
-
securityThreshold:
|
|
5206
|
-
maxRounds:
|
|
5207
|
-
maxTaskMinutes:
|
|
5208
|
-
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()
|
|
5209
5244
|
}).optional(),
|
|
5210
|
-
securityScan:
|
|
5211
|
-
command:
|
|
5245
|
+
securityScan: z3.object({
|
|
5246
|
+
command: z3.array(z3.string().min(1)).min(1)
|
|
5212
5247
|
}).optional(),
|
|
5213
|
-
gateCutovers:
|
|
5214
|
-
objectivesSinceIssue:
|
|
5215
|
-
briefSectionsSinceIssue:
|
|
5216
|
-
documentationSinceIssue:
|
|
5217
|
-
briefRulesSincePr:
|
|
5218
|
-
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()
|
|
5219
5254
|
}).optional(),
|
|
5220
|
-
planning:
|
|
5221
|
-
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()
|
|
5222
5259
|
}).optional(),
|
|
5223
|
-
prePush:
|
|
5224
|
-
alwaysRun:
|
|
5225
|
-
readyTests:
|
|
5226
|
-
mode:
|
|
5227
|
-
workflow:
|
|
5228
|
-
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")
|
|
5229
5266
|
}).strict().optional(),
|
|
5230
|
-
requiredCi:
|
|
5231
|
-
workflow:
|
|
5232
|
-
check:
|
|
5267
|
+
requiredCi: z3.object({
|
|
5268
|
+
workflow: z3.literal(".github/workflows/ci.yml"),
|
|
5269
|
+
check: z3.literal("Vinaya CI")
|
|
5233
5270
|
}).strict().optional()
|
|
5234
5271
|
}).optional(),
|
|
5235
|
-
report:
|
|
5236
|
-
commandTimeoutMs:
|
|
5272
|
+
report: z3.object({
|
|
5273
|
+
commandTimeoutMs: z3.number().int().positive().optional()
|
|
5237
5274
|
}).superRefine((report, ctx) => {
|
|
5238
5275
|
const commandTimeoutMs = report.commandTimeoutMs;
|
|
5239
5276
|
if (commandTimeoutMs !== undefined && commandTimeoutMs > MAX_REPORT_COMMAND_TIMEOUT_MS) {
|
|
5240
5277
|
ctx.addIssue({
|
|
5241
|
-
code:
|
|
5278
|
+
code: z3.ZodIssueCode.custom,
|
|
5242
5279
|
path: ["commandTimeoutMs"],
|
|
5243
5280
|
message: "must be at most 3600000 (1 hour)"
|
|
5244
5281
|
});
|
|
5245
5282
|
}
|
|
5246
5283
|
}).optional(),
|
|
5247
|
-
decisionRecords:
|
|
5284
|
+
decisionRecords: z3.object({
|
|
5248
5285
|
path: RepoRelativePathSchema
|
|
5249
5286
|
}).strict().optional()
|
|
5250
5287
|
};
|
|
@@ -5253,10 +5290,11 @@ var init_vinaya_config_section = __esm(() => {
|
|
|
5253
5290
|
"reviewPolicy.maxTaskMinutes",
|
|
5254
5291
|
"reviewPolicy.readyPushTimeoutMinutes"
|
|
5255
5292
|
];
|
|
5293
|
+
REVIEW_AGENT_SETTINGS = ["same", "different"];
|
|
5256
5294
|
PrincipalsUnresolvedError = class PrincipalsUnresolvedError extends Error {
|
|
5257
5295
|
kind;
|
|
5258
|
-
constructor(kind, message) {
|
|
5259
|
-
super(message);
|
|
5296
|
+
constructor(kind, message, options) {
|
|
5297
|
+
super(message, options);
|
|
5260
5298
|
this.name = "PrincipalsUnresolvedError";
|
|
5261
5299
|
this.kind = kind;
|
|
5262
5300
|
}
|
|
@@ -5300,7 +5338,7 @@ var init_vinaya_config_section = __esm(() => {
|
|
|
5300
5338
|
});
|
|
5301
5339
|
|
|
5302
5340
|
// ../../harness/processes/vinaya-strict/integration/config/compose.ts
|
|
5303
|
-
import { z as
|
|
5341
|
+
import { z as z4 } from "zod";
|
|
5304
5342
|
function globalChecksIgnoredWarning(path) {
|
|
5305
5343
|
return `${path}: "checks" registration in the global config is ignored — checks may only be registered from a repo-local vinaya.config.json.`;
|
|
5306
5344
|
}
|
|
@@ -5372,7 +5410,7 @@ var init_compose = __esm(() => {
|
|
|
5372
5410
|
"logs",
|
|
5373
5411
|
"decisionRecords"
|
|
5374
5412
|
];
|
|
5375
|
-
VinayaConfigObjectSchema =
|
|
5413
|
+
VinayaConfigObjectSchema = z4.object(orderedShape(CONFIG_KEY_ORDER, KERNEL_FRAGMENT, VINAYA_CONFIG_SECTION.fragment));
|
|
5376
5414
|
VinayaConfigSchema = VinayaConfigObjectSchema.superRefine((config, ctx) => {
|
|
5377
5415
|
for (const refine of KERNEL_CONFIG_REFINEMENTS)
|
|
5378
5416
|
refine(config, ctx);
|
|
@@ -5423,7 +5461,7 @@ var init_compose = __esm(() => {
|
|
|
5423
5461
|
vinayaConfigProvider = {
|
|
5424
5462
|
homeDir: VINAYA_HOME,
|
|
5425
5463
|
loadConfig: () => loadConfig(),
|
|
5426
|
-
loadTrustAnchorConfig: () => loadTrustAnchorConfig(),
|
|
5464
|
+
loadTrustAnchorConfig: (options) => loadTrustAnchorConfig(undefined, options),
|
|
5427
5465
|
loadTrustAnchorConfigAsync: (fetcher, options) => loadTrustAnchorConfigAsync(fetcher, options)
|
|
5428
5466
|
};
|
|
5429
5467
|
installVinayaConfigProvider();
|
|
@@ -5559,7 +5597,7 @@ function main() {
|
|
|
5559
5597
|
if (changed.length === 0)
|
|
5560
5598
|
process.exit(0);
|
|
5561
5599
|
const content = existsSync3(DOC_OWNERS_PATH) ? readFileSync3(DOC_OWNERS_PATH, "utf8") : null;
|
|
5562
|
-
const result = evaluateC5(changed, content, resolvePrBody(), existsSync3, waiverActiveFromEnv(), (p) => fileDiffAgainst(ref, p));
|
|
5600
|
+
const result = evaluateC5(changed, content, resolvePrBody(), existsSync3, waiverActiveFromEnv(), (p) => fileDiffAgainst(ref, p), prBodyGiven());
|
|
5563
5601
|
for (const message of result.errors) {
|
|
5564
5602
|
emitCheckError({
|
|
5565
5603
|
schema: CHECK_SCHEMA_VERSION,
|
|
@@ -5569,6 +5607,15 @@ function main() {
|
|
|
5569
5607
|
agent_recovery_prompt: "This owned-doc binding is unsatisfied — the push proceeds anyway, but the PR stays red until you update the bound doc, add a `Doc-ack:` line, or a principal applies the `vinaya/waiver:docs` label."
|
|
5570
5608
|
});
|
|
5571
5609
|
}
|
|
5610
|
+
for (const message of owedNeutralNotes(result)) {
|
|
5611
|
+
emitCheckError({
|
|
5612
|
+
schema: CHECK_SCHEMA_VERSION,
|
|
5613
|
+
check: CHECK_NAME,
|
|
5614
|
+
severity: "warning",
|
|
5615
|
+
message,
|
|
5616
|
+
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."
|
|
5617
|
+
});
|
|
5618
|
+
}
|
|
5572
5619
|
process.exit(0);
|
|
5573
5620
|
}
|
|
5574
5621
|
main();
|