@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/kernel/adapters/code-host/github/gh.ts
|
|
52
55
|
import { execFile, execFileSync } from "node:child_process";
|
|
@@ -82,6 +85,23 @@ async function ghApiGetAllPagesAsync(pathWithoutPage, opts) {
|
|
|
82
85
|
}
|
|
83
86
|
throw new Error(`ghApiGetAllPagesAsync: "${pathWithoutPage}" did not terminate within ${MAX_PAGES} pages (${MAX_PAGES * MAX_PER_PAGE} items) — refusing to keep walking.`);
|
|
84
87
|
}
|
|
88
|
+
async function ghLabelIssueCountsAsync(owner, repo, labelQuery) {
|
|
89
|
+
const stdout = await runAsync([
|
|
90
|
+
"api",
|
|
91
|
+
"graphql",
|
|
92
|
+
"--paginate",
|
|
93
|
+
"-f",
|
|
94
|
+
`query=${LABEL_ISSUE_COUNTS_QUERY.replace("$labelQuery", JSON.stringify(labelQuery))}`,
|
|
95
|
+
"-f",
|
|
96
|
+
`owner=${owner}`,
|
|
97
|
+
"-f",
|
|
98
|
+
`name=${repo}`,
|
|
99
|
+
"--jq",
|
|
100
|
+
".data.repository.labels.nodes[] | {name, open: .open.totalCount, total: .all.totalCount}"
|
|
101
|
+
]);
|
|
102
|
+
return stdout.split(`
|
|
103
|
+
`).filter((line) => line.trim() !== "").map((line) => JSON.parse(line));
|
|
104
|
+
}
|
|
85
105
|
function issueListByLabelArgs(owner, repo, label) {
|
|
86
106
|
return [
|
|
87
107
|
"issue",
|
|
@@ -115,7 +135,14 @@ async function ghIssueListByAnyLabelAsync(owner, repo, labels) {
|
|
|
115
135
|
const perLabel = await Promise.all(labels.map((l) => ghIssueListByLabelAsync(owner, repo, l)));
|
|
116
136
|
return dedupeByNumber(perLabel.flat());
|
|
117
137
|
}
|
|
118
|
-
var execFileAsync, systemEnv, MAX_PER_PAGE = 100, MAX_PAGES = 100
|
|
138
|
+
var execFileAsync, systemEnv, MAX_PER_PAGE = 100, MAX_PAGES = 100, LABEL_ISSUE_COUNTS_QUERY = `query($owner: String!, $name: String!, $endCursor: String) {
|
|
139
|
+
repository(owner: $owner, name: $name) {
|
|
140
|
+
labels(first: 100, after: $endCursor, query: $labelQuery) {
|
|
141
|
+
pageInfo { hasNextPage endCursor }
|
|
142
|
+
nodes { name open: issues(states: OPEN) { totalCount } all: issues { totalCount } }
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}`;
|
|
119
146
|
var init_gh = __esm(() => {
|
|
120
147
|
execFileAsync = promisify(execFile);
|
|
121
148
|
systemEnv = {
|
|
@@ -815,6 +842,19 @@ function lifecycleFromIssues(issues) {
|
|
|
815
842
|
return "planned";
|
|
816
843
|
return issues.some((i) => i.state === "OPEN") ? "active" : "complete";
|
|
817
844
|
}
|
|
845
|
+
function lifecycleFromCounts(open, total) {
|
|
846
|
+
if (total === 0)
|
|
847
|
+
return "planned";
|
|
848
|
+
return open > 0 ? "active" : "complete";
|
|
849
|
+
}
|
|
850
|
+
function resolveLegacyFactsFromCounts(milestone, open, total) {
|
|
851
|
+
if (milestone.state === "closed" && total > 0) {
|
|
852
|
+
return { goal: milestone.description ?? "", lifecycle: lifecycleFromCounts(open, total) };
|
|
853
|
+
}
|
|
854
|
+
return factsFromLegacyMilestone(milestone);
|
|
855
|
+
}
|
|
856
|
+
var TRANCHE_LABEL_QUERY = "vinaya/tranche:";
|
|
857
|
+
var ACTIVE_ISSUE_READ_CONCURRENCY = 4;
|
|
818
858
|
function goalFromMilestones(milestones, slug) {
|
|
819
859
|
for (const m of milestones) {
|
|
820
860
|
const goal = intentGoalForSlug(m.description ?? "", slug);
|
|
@@ -842,10 +882,20 @@ function trancheSlugsFromLabels(labels) {
|
|
|
842
882
|
}
|
|
843
883
|
async function indexTrancheMilestonesAsync(owner, repo, options = {}) {
|
|
844
884
|
const read = (fetch) => options.retryFailedReads ? retryOnce(fetch) : fetch();
|
|
845
|
-
const [milestones, labels] = await Promise.all([
|
|
885
|
+
const [milestones, labels, counts] = await Promise.all([
|
|
846
886
|
read(() => ghApiGetAllPagesAsync(`repos/${owner}/${repo}/milestones?state=all&per_page=100`)),
|
|
847
|
-
read(() => ghApiGetAllPagesAsync(`repos/${owner}/${repo}/labels?per_page=100`))
|
|
887
|
+
read(() => ghApiGetAllPagesAsync(`repos/${owner}/${repo}/labels?per_page=100`)),
|
|
888
|
+
read(() => ghLabelIssueCountsAsync(owner, repo, TRANCHE_LABEL_QUERY))
|
|
848
889
|
]);
|
|
890
|
+
const countsByLabel = new Map(counts.map((c) => [c.name, c]));
|
|
891
|
+
const uncounted = trancheSlugsFromLabels(labels).map((slug) => trancheLabel(slug)).filter((label) => !countsByLabel.has(label));
|
|
892
|
+
if (uncounted.length > 0) {
|
|
893
|
+
throw new Error(`the label Issue-count query returned no count for ${uncounted.join(", ")}`);
|
|
894
|
+
}
|
|
895
|
+
const lifecycleOf = (slug) => {
|
|
896
|
+
const c = countsByLabel.get(trancheLabel(slug));
|
|
897
|
+
return lifecycleFromCounts(c?.open ?? 0, c?.total ?? 0);
|
|
898
|
+
};
|
|
849
899
|
const active = [];
|
|
850
900
|
const archived = [];
|
|
851
901
|
const facts = new Map;
|
|
@@ -853,33 +903,21 @@ async function indexTrancheMilestonesAsync(owner, repo, options = {}) {
|
|
|
853
903
|
const legacyMilestoneBySlug = new Map(milestones.filter((m) => legacySlugs.has(m.title)).map((m) => [m.title, m]));
|
|
854
904
|
const newPathSlugs = trancheSlugsFromLabels(labels).filter((slug) => !legacySlugs.has(slug));
|
|
855
905
|
const uniqueNewPathSlugs = [...new Set(newPathSlugs)];
|
|
856
|
-
const
|
|
857
|
-
const [legacyIssuesBySlug, newPathIssuesBySlug] = await Promise.all([
|
|
858
|
-
Promise.all(uniqueLegacySlugs.map((slug) => read(() => ghIssueListByLabelAsync(owner, repo, trancheLabel(slug))))),
|
|
859
|
-
Promise.all(uniqueNewPathSlugs.map((slug) => read(() => ghIssueListByLabelAsync(owner, repo, trancheLabel(slug)))))
|
|
860
|
-
]);
|
|
861
|
-
const issuesBySlug = new Map;
|
|
862
|
-
uniqueLegacySlugs.forEach((slug, i) => {
|
|
863
|
-
issuesBySlug.set(slug, legacyIssuesBySlug[i] ?? []);
|
|
864
|
-
});
|
|
865
|
-
uniqueNewPathSlugs.forEach((slug, i) => {
|
|
866
|
-
issuesBySlug.set(slug, newPathIssuesBySlug[i] ?? []);
|
|
867
|
-
});
|
|
868
|
-
uniqueLegacySlugs.forEach((slug, i) => {
|
|
906
|
+
for (const slug of legacySlugs) {
|
|
869
907
|
const m = legacyMilestoneBySlug.get(slug);
|
|
870
908
|
if (!m)
|
|
871
|
-
|
|
909
|
+
continue;
|
|
872
910
|
const ref = { slug, goal: m.description ?? "" };
|
|
873
|
-
const
|
|
911
|
+
const c = countsByLabel.get(trancheLabel(slug));
|
|
912
|
+
const f = resolveLegacyFactsFromCounts(m, c?.open ?? 0, c?.total ?? 0);
|
|
874
913
|
if (f.lifecycle === "complete")
|
|
875
914
|
archived.push(ref);
|
|
876
915
|
else if (f.lifecycle === "active")
|
|
877
916
|
active.push(ref);
|
|
878
917
|
facts.set(slug, f);
|
|
879
|
-
}
|
|
880
|
-
|
|
881
|
-
const
|
|
882
|
-
const lifecycle = lifecycleFromIssues(issues);
|
|
918
|
+
}
|
|
919
|
+
for (const slug of uniqueNewPathSlugs) {
|
|
920
|
+
const lifecycle = lifecycleOf(slug);
|
|
883
921
|
const goal = goalFromMilestones(milestones, slug);
|
|
884
922
|
const f = { goal, lifecycle };
|
|
885
923
|
facts.set(slug, f);
|
|
@@ -887,7 +925,16 @@ async function indexTrancheMilestonesAsync(owner, repo, options = {}) {
|
|
|
887
925
|
active.push({ slug, goal });
|
|
888
926
|
else if (lifecycle === "complete")
|
|
889
927
|
archived.push({ slug, goal });
|
|
890
|
-
}
|
|
928
|
+
}
|
|
929
|
+
const issuesBySlug = new Map;
|
|
930
|
+
const activeSlugs = active.map((r) => r.slug);
|
|
931
|
+
for (let i = 0;i < activeSlugs.length; i += ACTIVE_ISSUE_READ_CONCURRENCY) {
|
|
932
|
+
const batch = activeSlugs.slice(i, i + ACTIVE_ISSUE_READ_CONCURRENCY);
|
|
933
|
+
const lists = await Promise.all(batch.map((slug) => read(() => ghIssueListByLabelAsync(owner, repo, trancheLabel(slug)))));
|
|
934
|
+
batch.forEach((slug, j) => {
|
|
935
|
+
issuesBySlug.set(slug, lists[j] ?? []);
|
|
936
|
+
});
|
|
937
|
+
}
|
|
891
938
|
return { active, archived, facts, legacySlugs, issuesBySlug };
|
|
892
939
|
}
|
|
893
940
|
async function retryOnce(fetch) {
|