@attalabs/vinaya 0.40.0 → 0.41.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/aeg-root/contracts/developer-reviewer.md +2 -2
- package/aeg-root/contracts/planner-developer.md +4 -4
- package/aeg-root/process.md +3 -3
- package/aeg-root/roles/developer/reference.md +3 -0
- package/aeg-root/state-machine.md +2 -2
- package/aeg-root/templates/brief-template.md +1 -1
- package/dist/checks/bin/check-body-bare-digits.js +165 -65
- package/dist/checks/bin/check-branch-topology.js +169 -60
- package/dist/checks/bin/check-brief-shape.js +165 -65
- package/dist/checks/bin/check-changeset-coverage.js +342 -122
- package/dist/checks/bin/check-ci-shard-coverage.js +384 -130
- package/dist/checks/bin/check-closes-n.js +169 -60
- package/dist/checks/bin/check-coherence.js +165 -65
- package/dist/checks/bin/check-dead-branch-push.js +142 -59
- package/dist/checks/bin/check-dispatch-readiness.js +211 -81
- package/dist/checks/bin/check-doc-claims.js +165 -65
- package/dist/checks/bin/check-doc-coverage-push.js +342 -122
- package/dist/checks/bin/check-doc-coverage.js +344 -124
- package/dist/checks/bin/check-doctrine-no-procedures.js +165 -65
- package/dist/checks/bin/check-doctrine-portability.js +342 -122
- package/dist/checks/bin/check-evidence-fresh.js +376 -129
- package/dist/checks/bin/check-exec-bits.js +342 -122
- package/dist/checks/bin/check-first-push-dispatch.js +208 -78
- package/dist/checks/bin/check-issue-milestone-attach.js +142 -59
- package/dist/checks/bin/check-issue-objectives-numbering.js +165 -65
- package/dist/checks/bin/check-issue-parts-coverage.js +142 -59
- package/dist/checks/bin/check-issue-surface-globs.js +218 -88
- package/dist/checks/bin/check-issue-title-grammar.js +142 -59
- package/dist/checks/bin/check-main-branch-refusal.js +142 -59
- package/dist/checks/bin/check-no-disk-state.js +142 -59
- package/dist/checks/bin/check-pr-premise-reassert.js +165 -65
- package/dist/checks/bin/check-pr-report-density.js +142 -59
- package/dist/checks/bin/check-principal-test-plan-wait.js +165 -65
- package/dist/checks/bin/check-quoted-command.js +338 -118
- package/dist/checks/bin/check-reader-resolvable-prose.js +338 -118
- package/dist/checks/bin/check-registry-gates.js +206 -78
- package/dist/checks/bin/check-retired-vocabulary.js +338 -118
- package/dist/checks/bin/check-review-gate.js +203 -83
- package/dist/checks/bin/check-single-plan-pr.js +142 -59
- package/dist/checks/bin/check-surface-scope.js +169 -60
- package/dist/checks/bin/check-test-plan.js +165 -65
- package/dist/checks/bin/check-token-collection-wired.js +142 -59
- package/dist/checks/bin/check-workspace-escape.js +340 -120
- package/dist/checks/bin/verify-coherence.js +153 -60
- package/dist/checks/bin/verify-dispatch.js +169 -69
- package/dist/checks/bin/verify-docs.js +142 -57
- package/dist/index.js +16280 -11764
- package/dist/lib/pre-push-cache-test-run.js +791 -68
- package/dist/lib/pre-push-changed-files.js +65 -19
- package/dist/lib/pre-push-mode.js +466 -0
- package/dist/lib/pre-push-progress-dir.js +4205 -0
- package/dist/lib/pre-push-record-tests.js +446 -0
- package/dist/lib/pre-push-select-tests.js +1426 -454
- package/dist/lib/push-progress-observer.js +4213 -0
- package/package.json +11 -5
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/anchored-region.ts +5 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-render.ts +18 -4
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-validation.ts +3 -3
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/coherence-checks.ts +2 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/local.ts +88 -5
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/records.ts +34 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/assess-round.ts +26 -4
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/fakes.ts +7 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/index.ts +7 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/types.ts +17 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dispatch-gate.ts +13 -17
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/index.ts +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/published-prose.ts +70 -45
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/gate-audience.ts +1 -4
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/index.ts +77 -7
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/issue-assignment.ts +24 -54
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/issue-validation.ts +221 -56
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/live-record.ts +179 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/envelope.ts +8 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/index.ts +1 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/narration.ts +1 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/schema-digest.ts +225 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/schema.ts +7 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/main-branch-refusal.ts +23 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/principals-config.ts +44 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/prose-rules.ts +532 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/protected-paths.ts +31 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/reader-resolvable-prose.ts +157 -80
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/registry-checks.ts +8 -12
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/retired-vocabulary.ts +52 -109
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-gate.ts +46 -17
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-input-manifest.ts +85 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/ruling-ordinal.ts +46 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/task-branch-identity.ts +2 -4
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/test-plan-gate.ts +63 -8
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/verdict-extraction.ts +24 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/waiver-label.ts +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/BUILD_ID +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/build-manifest.json +3 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/prerender-manifest.json +3 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.html +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page/server-reference-manifest.json +3 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/1q96_modules_@clerk_nextjs_dist_esm_app-router_client_keyless-creator-reader_0lom2js.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__08e39jo._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0ls23oh._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1a3j3n1._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__1wzfiav._.js → [root-of-the-server]__1d4eth3._.js} +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1gjqmhq._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1snpgaw._.js +3 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1wc4-ip._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_08onyya._.js +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_096f46i._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0af2one._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0e5tkdd._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0kf2g72._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0zf4d27._.js +3 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1-wo68i._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1achbh9._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/node_modules_@clerk_nextjs_dist_esm_app-router_server-actions_1x7vfhn.js +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/middleware-build-manifest.js +3 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/pages/500.html +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/server-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/server-reference-manifest.json +4 -4
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{38kom-9c-oi65.js → 0x7u6si-ai179.js} +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{1p3vr9qts86_b.js → 2fu7mfsj4oima.js} +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{21tunzmxjvm2a.js → 34b4ruddunn3q.js} +1 -1
- package/studio-standalone/apps/vinaya-studio/web/package.json +2 -2
- /package/studio-standalone/apps/vinaya-studio/web/.next/static/{Y3oaZSTSP9PivUuJvxK1W → 2ZARxTwpuRew8-SvYsRdU}/_buildManifest.js +0 -0
- /package/studio-standalone/apps/vinaya-studio/web/.next/static/{Y3oaZSTSP9PivUuJvxK1W → 2ZARxTwpuRew8-SvYsRdU}/_clientMiddlewareManifest.js +0 -0
- /package/studio-standalone/apps/vinaya-studio/web/.next/static/{Y3oaZSTSP9PivUuJvxK1W → 2ZARxTwpuRew8-SvYsRdU}/_ssgManifest.js +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// src/checks/bin/check-evidence-fresh.ts
|
|
4
|
-
import { execFileSync as
|
|
4
|
+
import { execFileSync as execFileSync9 } from "node:child_process";
|
|
5
5
|
|
|
6
6
|
// ../../packages/aeg-core/src/entry-point.ts
|
|
7
7
|
import { realpathSync } from "node:fs";
|
|
@@ -780,10 +780,11 @@ function trancheSlugsFromLabels(labels) {
|
|
|
780
780
|
}
|
|
781
781
|
return slugs;
|
|
782
782
|
}
|
|
783
|
-
async function indexTrancheMilestonesAsync(owner, repo) {
|
|
783
|
+
async function indexTrancheMilestonesAsync(owner, repo, options = {}) {
|
|
784
|
+
const read = (fetch2) => options.retryFailedReads ? retryOnce(fetch2) : fetch2();
|
|
784
785
|
const [milestones, labels] = await Promise.all([
|
|
785
|
-
ghApiGetAllPagesAsync(`repos/${owner}/${repo}/milestones?state=all&per_page=100`),
|
|
786
|
-
ghApiGetAllPagesAsync(`repos/${owner}/${repo}/labels?per_page=100`)
|
|
786
|
+
read(() => ghApiGetAllPagesAsync(`repos/${owner}/${repo}/milestones?state=all&per_page=100`)),
|
|
787
|
+
read(() => ghApiGetAllPagesAsync(`repos/${owner}/${repo}/labels?per_page=100`))
|
|
787
788
|
]);
|
|
788
789
|
const active = [];
|
|
789
790
|
const archived = [];
|
|
@@ -794,9 +795,16 @@ async function indexTrancheMilestonesAsync(owner, repo) {
|
|
|
794
795
|
const uniqueNewPathSlugs = [...new Set(newPathSlugs)];
|
|
795
796
|
const uniqueLegacySlugs = [...legacySlugs];
|
|
796
797
|
const [legacyIssuesBySlug, newPathIssuesBySlug] = await Promise.all([
|
|
797
|
-
Promise.all(uniqueLegacySlugs.map((slug) => ghIssueListByLabelAsync(owner, repo, trancheLabel(slug)))),
|
|
798
|
-
Promise.all(uniqueNewPathSlugs.map((slug) => ghIssueListByLabelAsync(owner, repo, trancheLabel(slug))))
|
|
798
|
+
Promise.all(uniqueLegacySlugs.map((slug) => read(() => ghIssueListByLabelAsync(owner, repo, trancheLabel(slug))))),
|
|
799
|
+
Promise.all(uniqueNewPathSlugs.map((slug) => read(() => ghIssueListByLabelAsync(owner, repo, trancheLabel(slug)))))
|
|
799
800
|
]);
|
|
801
|
+
const issuesBySlug = new Map;
|
|
802
|
+
uniqueLegacySlugs.forEach((slug, i) => {
|
|
803
|
+
issuesBySlug.set(slug, legacyIssuesBySlug[i] ?? []);
|
|
804
|
+
});
|
|
805
|
+
uniqueNewPathSlugs.forEach((slug, i) => {
|
|
806
|
+
issuesBySlug.set(slug, newPathIssuesBySlug[i] ?? []);
|
|
807
|
+
});
|
|
800
808
|
uniqueLegacySlugs.forEach((slug, i) => {
|
|
801
809
|
const m = legacyMilestoneBySlug.get(slug);
|
|
802
810
|
if (!m)
|
|
@@ -820,7 +828,14 @@ async function indexTrancheMilestonesAsync(owner, repo) {
|
|
|
820
828
|
else if (lifecycle === "complete")
|
|
821
829
|
archived.push({ slug, goal });
|
|
822
830
|
});
|
|
823
|
-
return { active, archived, facts, legacySlugs };
|
|
831
|
+
return { active, archived, facts, legacySlugs, issuesBySlug };
|
|
832
|
+
}
|
|
833
|
+
async function retryOnce(fetch2) {
|
|
834
|
+
try {
|
|
835
|
+
return await fetch2();
|
|
836
|
+
} catch {
|
|
837
|
+
return fetch2();
|
|
838
|
+
}
|
|
824
839
|
}
|
|
825
840
|
async function indexTrancheMilestonesForSlugAsync(owner, repo, slug) {
|
|
826
841
|
const [milestones, labels, issues] = await Promise.all([
|
|
@@ -1865,15 +1880,16 @@ function describeError(err) {
|
|
|
1865
1880
|
}
|
|
1866
1881
|
// ../../packages/aeg-forge-state/src/prior-tranche-archival.ts
|
|
1867
1882
|
function defaultPriorTrancheArchivalDeps() {
|
|
1868
|
-
let facts = new Map;
|
|
1869
1883
|
return {
|
|
1870
|
-
|
|
1871
|
-
const index = await indexTrancheMilestonesAsync(repo.owner, repo.repo);
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1884
|
+
activeTranches: async (excludeSlug, repo) => {
|
|
1885
|
+
const index = await indexTrancheMilestonesAsync(repo.owner, repo.repo, { retryFailedReads: true });
|
|
1886
|
+
return index.active.filter((m) => m.slug !== excludeSlug).map((m) => {
|
|
1887
|
+
const issues = index.issuesBySlug?.get(m.slug);
|
|
1888
|
+
if (!issues)
|
|
1889
|
+
throw new Error(`the Milestone index holds no Issue list for tranche \`${m.slug}\``);
|
|
1890
|
+
return { slug: m.slug, issues };
|
|
1891
|
+
});
|
|
1892
|
+
}
|
|
1877
1893
|
};
|
|
1878
1894
|
}
|
|
1879
1895
|
function reason(err) {
|
|
@@ -1885,61 +1901,28 @@ async function resolvePriorTrancheArchival(projects, excludeSlug, repo, deps = d
|
|
|
1885
1901
|
return { facts: [], infraFailure: null };
|
|
1886
1902
|
let candidates;
|
|
1887
1903
|
try {
|
|
1888
|
-
candidates = await deps.
|
|
1904
|
+
candidates = await deps.activeTranches(excludeSlug, repo);
|
|
1889
1905
|
} catch (err) {
|
|
1890
1906
|
return {
|
|
1891
1907
|
facts: [],
|
|
1892
1908
|
infraFailure: `severity:infra — could not read the active tranches (${reason(err)}); whether a prior tranche is archived is unknown.`
|
|
1893
1909
|
};
|
|
1894
1910
|
}
|
|
1911
|
+
const tasksBySlug = new Map(candidates.map((c) => [c.slug, tasksFromIssues(c.issues)]));
|
|
1895
1912
|
const facts = [];
|
|
1896
|
-
const unreadable = [];
|
|
1897
|
-
const derived = new Map;
|
|
1898
|
-
const derive = (slug) => {
|
|
1899
|
-
let p = derived.get(slug);
|
|
1900
|
-
if (!p) {
|
|
1901
|
-
p = deps.deriveTranche(slug, repo);
|
|
1902
|
-
derived.set(slug, p);
|
|
1903
|
-
}
|
|
1904
|
-
return p;
|
|
1905
|
-
};
|
|
1906
1913
|
for (const project of projects) {
|
|
1907
1914
|
let found = null;
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
let candidateTranche;
|
|
1911
|
-
try {
|
|
1912
|
-
candidateTranche = await derive(slug);
|
|
1913
|
-
} catch {
|
|
1914
|
-
unknown = true;
|
|
1915
|
-
unreadable.push(`the tasks of tranche \`${slug}\` (project \`${project}\`)`);
|
|
1916
|
-
break;
|
|
1917
|
-
}
|
|
1918
|
-
if (!candidateTranche.tasks.some((t) => t.projects.includes(project)))
|
|
1915
|
+
for (const { slug, issues } of candidates) {
|
|
1916
|
+
if (!(tasksBySlug.get(slug) ?? []).some((t) => t.projects.includes(project)))
|
|
1919
1917
|
continue;
|
|
1920
|
-
|
|
1921
|
-
try {
|
|
1922
|
-
openIssues = await deps.openIssues(slug, repo);
|
|
1923
|
-
} catch {
|
|
1924
|
-
openIssues = null;
|
|
1925
|
-
}
|
|
1926
|
-
if (openIssues === null) {
|
|
1927
|
-
unknown = true;
|
|
1928
|
-
unreadable.push(`the open Issues of tranche \`${slug}\` (project \`${project}\`)`);
|
|
1929
|
-
break;
|
|
1930
|
-
}
|
|
1931
|
-
if (openIssues.length === 0) {
|
|
1918
|
+
if (!issues.some((issue) => issue.state === "OPEN")) {
|
|
1932
1919
|
found = { project, priorTrancheSlug: slug, archived: false };
|
|
1933
1920
|
break;
|
|
1934
1921
|
}
|
|
1935
1922
|
}
|
|
1936
|
-
|
|
1937
|
-
facts.push(found ?? { project, priorTrancheSlug: null, archived: false });
|
|
1923
|
+
facts.push(found ?? { project, priorTrancheSlug: null, archived: false });
|
|
1938
1924
|
}
|
|
1939
|
-
return {
|
|
1940
|
-
facts,
|
|
1941
|
-
infraFailure: unreadable.length === 0 ? null : `severity:infra — could not read ${unreadable.join(", ")}; whether a prior tranche is archived is unknown.`
|
|
1942
|
-
};
|
|
1925
|
+
return { facts, infraFailure: null };
|
|
1943
1926
|
}
|
|
1944
1927
|
// ../../packages/aeg-forge-state/src/fetch-open-issues.ts
|
|
1945
1928
|
async function fetchOpenIssuesByLabel(slugs, owner, repo, token) {
|
|
@@ -2765,11 +2748,13 @@ var CODE_REVIEW_SEVERITY_ORDER = ["BLOCKER", "MAJOR", "MINOR"];
|
|
|
2765
2748
|
var SECURITY_SEVERITY_ORDER = ["CRITICAL", "HIGH", "MEDIUM", "LOW"];
|
|
2766
2749
|
var DEFAULT_MAX_ROUNDS = 3;
|
|
2767
2750
|
var DEFAULT_MAX_TASK_MINUTES = 180;
|
|
2751
|
+
var DEFAULT_READY_PUSH_TIMEOUT_MINUTES = 20;
|
|
2768
2752
|
var DEFAULT_REVIEW_POLICY = {
|
|
2769
2753
|
codeReviewThreshold: "BLOCKER",
|
|
2770
2754
|
securityThreshold: "HIGH",
|
|
2771
2755
|
maxRounds: DEFAULT_MAX_ROUNDS,
|
|
2772
|
-
maxTaskMinutes: DEFAULT_MAX_TASK_MINUTES
|
|
2756
|
+
maxTaskMinutes: DEFAULT_MAX_TASK_MINUTES,
|
|
2757
|
+
readyPushTimeoutMinutes: DEFAULT_READY_PUSH_TIMEOUT_MINUTES
|
|
2773
2758
|
};
|
|
2774
2759
|
var FILE_SHAPED_LOCATION = /\.[a-zA-Z0-9]{1,10}(:\d+)?\s*$/;
|
|
2775
2760
|
var PROSE_LOCATION_PATTERNS = [/\bpr\s*body\b/i, /\bcomment\b/i];
|
|
@@ -6958,7 +6943,17 @@ var HeaderMetaV3Schema = z3.object({
|
|
|
6958
6943
|
runtime: z3.string().nullable(),
|
|
6959
6944
|
source: z3.string().nullable()
|
|
6960
6945
|
}).strict();
|
|
6961
|
-
var
|
|
6946
|
+
var HeaderMetaV4Schema = HeaderMetaV3Schema.extend({
|
|
6947
|
+
schema: z3.literal(4),
|
|
6948
|
+
process: z3.object({ id: z3.string(), version: z3.string().nullable(), digest: z3.string().nullable() }).strict(),
|
|
6949
|
+
runner: z3.object({ id: z3.string(), version: z3.string().nullable() }).strict()
|
|
6950
|
+
}).strict();
|
|
6951
|
+
var HeaderMetaSchema = z3.discriminatedUnion("schema", [
|
|
6952
|
+
HeaderMetaV1Schema,
|
|
6953
|
+
HeaderMetaV2Schema,
|
|
6954
|
+
HeaderMetaV3Schema,
|
|
6955
|
+
HeaderMetaV4Schema
|
|
6956
|
+
]);
|
|
6962
6957
|
var SubjectSchema = z3.object({
|
|
6963
6958
|
issue: z3.number().int().nullable(),
|
|
6964
6959
|
pr: z3.number().int().optional(),
|
|
@@ -7178,6 +7173,75 @@ var DevReviewLoopEventSchema = z3.discriminatedUnion("event", [
|
|
|
7178
7173
|
round: z3.number().int(),
|
|
7179
7174
|
phase: z3.string()
|
|
7180
7175
|
}).strict(),
|
|
7176
|
+
z3.object({
|
|
7177
|
+
...loopShared,
|
|
7178
|
+
event: z3.literal("conflict_reentry"),
|
|
7179
|
+
task: z3.number().int(),
|
|
7180
|
+
pr: z3.number().int().positive(),
|
|
7181
|
+
attempt: z3.number().int().positive(),
|
|
7182
|
+
bound: z3.number().int().positive()
|
|
7183
|
+
}).strict(),
|
|
7184
|
+
z3.object({
|
|
7185
|
+
...loopShared,
|
|
7186
|
+
event: z3.literal("storage_push"),
|
|
7187
|
+
round: z3.number().int(),
|
|
7188
|
+
branch: z3.string(),
|
|
7189
|
+
head: z3.string()
|
|
7190
|
+
}).strict(),
|
|
7191
|
+
z3.object({
|
|
7192
|
+
...loopShared,
|
|
7193
|
+
event: z3.literal("local_checks_run"),
|
|
7194
|
+
round: z3.number().int(),
|
|
7195
|
+
head: z3.string().nullable(),
|
|
7196
|
+
passed: z3.boolean(),
|
|
7197
|
+
wall_ms: z3.number().nonnegative()
|
|
7198
|
+
}).strict(),
|
|
7199
|
+
z3.object({
|
|
7200
|
+
...loopShared,
|
|
7201
|
+
event: z3.literal("ready_push"),
|
|
7202
|
+
round: z3.number().int(),
|
|
7203
|
+
head: z3.string(),
|
|
7204
|
+
outcome: z3.enum(["passed", "refused"]),
|
|
7205
|
+
selected: z3.number().int().nonnegative(),
|
|
7206
|
+
failed: z3.number().int().nonnegative(),
|
|
7207
|
+
rerun: z3.boolean(),
|
|
7208
|
+
wall_ms: z3.number().nonnegative()
|
|
7209
|
+
}).strict(),
|
|
7210
|
+
z3.object({
|
|
7211
|
+
...loopShared,
|
|
7212
|
+
event: z3.literal("failed_tests_rerun"),
|
|
7213
|
+
round: z3.number().int(),
|
|
7214
|
+
head: z3.string(),
|
|
7215
|
+
rerun_of: z3.string(),
|
|
7216
|
+
failed_files: z3.number().int().nonnegative(),
|
|
7217
|
+
affected_files: z3.number().int().nonnegative(),
|
|
7218
|
+
full_count: z3.number().int().nonnegative()
|
|
7219
|
+
}).strict(),
|
|
7220
|
+
z3.object({
|
|
7221
|
+
...loopShared,
|
|
7222
|
+
event: z3.literal("pr_opened"),
|
|
7223
|
+
round: z3.number().int(),
|
|
7224
|
+
pr: z3.number().int().positive(),
|
|
7225
|
+
head: z3.string()
|
|
7226
|
+
}).strict(),
|
|
7227
|
+
z3.object({
|
|
7228
|
+
...loopShared,
|
|
7229
|
+
event: z3.literal("ci_result_read"),
|
|
7230
|
+
round: z3.number().int(),
|
|
7231
|
+
pr: z3.number().int().positive(),
|
|
7232
|
+
head: z3.string(),
|
|
7233
|
+
conclusion: z3.enum(["green", "red", "pending", "skipped"]),
|
|
7234
|
+
failing_checks: z3.array(z3.string()),
|
|
7235
|
+
wait_ms: z3.number().nonnegative()
|
|
7236
|
+
}).strict(),
|
|
7237
|
+
z3.object({
|
|
7238
|
+
...loopShared,
|
|
7239
|
+
event: z3.literal("phase_time"),
|
|
7240
|
+
round: z3.number().int(),
|
|
7241
|
+
phase: z3.enum(["developer", "local_checks", "review", "push", "ci", "other"]),
|
|
7242
|
+
step: z3.string(),
|
|
7243
|
+
wall_ms: z3.number().nonnegative()
|
|
7244
|
+
}).strict(),
|
|
7181
7245
|
z3.object({
|
|
7182
7246
|
...loopShared,
|
|
7183
7247
|
event: z3.literal("driver_exited"),
|
|
@@ -7365,7 +7429,7 @@ var EffectEventSchema = z3.discriminatedUnion("event", [
|
|
|
7365
7429
|
]);
|
|
7366
7430
|
var CustomFieldValueSchema = z3.union([z3.string().max(CUSTOM_TEXT_MAX_LENGTH), z3.number().finite(), z3.boolean()]);
|
|
7367
7431
|
var customShared = {
|
|
7368
|
-
meta:
|
|
7432
|
+
meta: HeaderMetaSchema,
|
|
7369
7433
|
subject: SubjectSchema,
|
|
7370
7434
|
kind: z3.literal("custom"),
|
|
7371
7435
|
...envelopeTail
|
|
@@ -7450,7 +7514,7 @@ function buildHeader(input) {
|
|
|
7450
7514
|
const issue = subject.issue;
|
|
7451
7515
|
return {
|
|
7452
7516
|
meta: {
|
|
7453
|
-
schema:
|
|
7517
|
+
schema: 4,
|
|
7454
7518
|
ts: input.now.toISOString(),
|
|
7455
7519
|
run_id: input.runId,
|
|
7456
7520
|
seq: input.seq,
|
|
@@ -7487,6 +7551,15 @@ function buildHeader(input) {
|
|
|
7487
7551
|
version: lineageFieldFromEnv(input.env.flowVersion)
|
|
7488
7552
|
},
|
|
7489
7553
|
runtime: lineageFieldFromEnv(input.env.runtime),
|
|
7554
|
+
process: {
|
|
7555
|
+
id: lineageFieldFromEnv(input.env.processId) ?? "vinaya",
|
|
7556
|
+
version: lineageFieldFromEnv(input.env.processVersion),
|
|
7557
|
+
digest: lineageFieldFromEnv(input.env.processDigest)
|
|
7558
|
+
},
|
|
7559
|
+
runner: {
|
|
7560
|
+
id: lineageFieldFromEnv(input.env.runnerId) ?? "standalone",
|
|
7561
|
+
version: lineageFieldFromEnv(input.env.runnerVersion)
|
|
7562
|
+
},
|
|
7490
7563
|
source: lineageFieldFromEnv(input.env.source)
|
|
7491
7564
|
},
|
|
7492
7565
|
subject
|
|
@@ -7530,7 +7603,7 @@ function redact(value, home) {
|
|
|
7530
7603
|
return value;
|
|
7531
7604
|
}
|
|
7532
7605
|
// ../../packages/aeg-core/src/log/store.ts
|
|
7533
|
-
var KNOWN_SCHEMA_VERSIONS = [1, 2, 3];
|
|
7606
|
+
var KNOWN_SCHEMA_VERSIONS = [1, 2, 3, 4];
|
|
7534
7607
|
function metaOf(obj) {
|
|
7535
7608
|
if (obj === null || typeof obj !== "object")
|
|
7536
7609
|
return null;
|
|
@@ -7754,11 +7827,21 @@ var ResolutionRecordSchema = z4.object({
|
|
|
7754
7827
|
authenticatedFrom: z4.string().min(1),
|
|
7755
7828
|
consumedAt: isoTimestamp
|
|
7756
7829
|
}).strict();
|
|
7830
|
+
var ExecutionRoundMirrorRecordSchema = z4.object({
|
|
7831
|
+
version: z4.literal(1),
|
|
7832
|
+
kind: z4.literal("execution_round"),
|
|
7833
|
+
task: taskId,
|
|
7834
|
+
repository: z4.string().min(1),
|
|
7835
|
+
threadId: z4.string().min(1),
|
|
7836
|
+
checkpointId: z4.string().min(1),
|
|
7837
|
+
round: z4.number().int().positive(),
|
|
7838
|
+
recordedAt: isoTimestamp
|
|
7839
|
+
}).strict();
|
|
7757
7840
|
// ../../packages/aeg-core/src/control-store/local.ts
|
|
7758
7841
|
var CONTROL_AREA_DIRNAME = "control";
|
|
7759
7842
|
// src/lib/pr-report-engine.ts
|
|
7760
|
-
import { execFile as
|
|
7761
|
-
import { promisify as
|
|
7843
|
+
import { execFile as execFile7 } from "node:child_process";
|
|
7844
|
+
import { promisify as promisify7 } from "node:util";
|
|
7762
7845
|
|
|
7763
7846
|
// src/checks/registry.ts
|
|
7764
7847
|
import { join as join2, relative, sep } from "node:path";
|
|
@@ -8395,7 +8478,7 @@ import {
|
|
|
8395
8478
|
existsSync as existsSync5,
|
|
8396
8479
|
fstatSync as fstatSync3,
|
|
8397
8480
|
mkdirSync as mkdirSync4,
|
|
8398
|
-
lstatSync as
|
|
8481
|
+
lstatSync as lstatSync3,
|
|
8399
8482
|
openSync as openSync4,
|
|
8400
8483
|
readFileSync as readFileSync5,
|
|
8401
8484
|
renameSync as renameSync2,
|
|
@@ -8409,9 +8492,9 @@ import { promisify as promisify5 } from "node:util";
|
|
|
8409
8492
|
// src/lib/config.ts
|
|
8410
8493
|
import { execFile as execFile4, execFileSync as execFileSync2 } from "node:child_process";
|
|
8411
8494
|
import { promisify as promisify4 } from "node:util";
|
|
8412
|
-
import { existsSync as existsSync2, mkdirSync, readFileSync as readFileSync2, realpathSync as realpathSync2, writeFileSync } from "node:fs";
|
|
8495
|
+
import { existsSync as existsSync2, lstatSync, mkdirSync, readFileSync as readFileSync2, realpathSync as realpathSync2, writeFileSync } from "node:fs";
|
|
8413
8496
|
import { homedir } from "node:os";
|
|
8414
|
-
import { dirname as dirname2, isAbsolute, join as join3, resolve } from "node:path";
|
|
8497
|
+
import { basename as basename3, dirname as dirname2, isAbsolute, join as join3, resolve } from "node:path";
|
|
8415
8498
|
import { z as z6 } from "zod";
|
|
8416
8499
|
|
|
8417
8500
|
// src/checks/contract.ts
|
|
@@ -8874,7 +8957,8 @@ var VinayaConfigObjectSchema = z6.object({
|
|
|
8874
8957
|
codeReviewThreshold: z6.string().min(1).optional(),
|
|
8875
8958
|
securityThreshold: z6.string().min(1).optional(),
|
|
8876
8959
|
maxRounds: z6.number().optional(),
|
|
8877
|
-
maxTaskMinutes: z6.number().optional()
|
|
8960
|
+
maxTaskMinutes: z6.number().optional(),
|
|
8961
|
+
readyPushTimeoutMinutes: z6.number().optional()
|
|
8878
8962
|
}).optional(),
|
|
8879
8963
|
securityScan: z6.object({
|
|
8880
8964
|
command: z6.array(z6.string().min(1)).min(1)
|
|
@@ -8890,7 +8974,16 @@ var VinayaConfigObjectSchema = z6.object({
|
|
|
8890
8974
|
collisionThreshold: z6.number().int().nonnegative().optional()
|
|
8891
8975
|
}).optional(),
|
|
8892
8976
|
prePush: z6.object({
|
|
8893
|
-
alwaysRun: z6.array(z6.string()).optional()
|
|
8977
|
+
alwaysRun: z6.array(z6.string()).optional(),
|
|
8978
|
+
readyTests: z6.object({
|
|
8979
|
+
mode: z6.literal("ci"),
|
|
8980
|
+
workflow: z6.literal(".github/workflows/ci.yml"),
|
|
8981
|
+
check: z6.literal("Vinaya CI")
|
|
8982
|
+
}).strict().optional(),
|
|
8983
|
+
requiredCi: z6.object({
|
|
8984
|
+
workflow: z6.literal(".github/workflows/ci.yml"),
|
|
8985
|
+
check: z6.literal("Vinaya CI")
|
|
8986
|
+
}).strict().optional()
|
|
8894
8987
|
}).optional(),
|
|
8895
8988
|
report: z6.object({
|
|
8896
8989
|
commandTimeoutMs: z6.number().int().positive().optional()
|
|
@@ -8908,6 +9001,7 @@ var VinayaConfigObjectSchema = z6.object({
|
|
|
8908
9001
|
message: "logPublish is removed — telemetry is never posted to a tracker or a code host; configure `logs` instead (a folder or a server destination)"
|
|
8909
9002
|
}),
|
|
8910
9003
|
runtimeDir: z6.string().min(1).refine((v) => isAbsolute(v), { message: "runtimeDir: must be an absolute path" }).optional(),
|
|
9004
|
+
runner: z6.enum(["standalone", "atta-engine"]).optional(),
|
|
8911
9005
|
logs: z6.object({
|
|
8912
9006
|
folder: z6.string().min(1).refine((v) => isAbsolute(v), { message: "logs.folder: must be an absolute path" }).optional(),
|
|
8913
9007
|
url: z6.string().url().optional(),
|
|
@@ -8920,7 +9014,7 @@ var VinayaConfigObjectSchema = z6.object({
|
|
|
8920
9014
|
message: "logs: headers requires url"
|
|
8921
9015
|
}).refine((v) => v.readHeaders === undefined || v.url !== undefined, {
|
|
8922
9016
|
message: "logs: readHeaders requires url"
|
|
8923
|
-
}).optional(),
|
|
9017
|
+
}).or(z6.literal(false)).optional(),
|
|
8924
9018
|
decisionRecords: z6.object({
|
|
8925
9019
|
path: RepoRelativePathSchema
|
|
8926
9020
|
}).strict().optional()
|
|
@@ -9050,13 +9144,19 @@ function resolveReviewPolicy(config) {
|
|
|
9050
9144
|
if (!Number.isInteger(maxTaskMinutes) || maxTaskMinutes < 0) {
|
|
9051
9145
|
throw new Error(`vinaya.config.json: reviewPolicy.maxTaskMinutes "${maxTaskMinutes}" is not a non-negative integer (0 turns the budget off) — fix the config, this never falls back to a default.`);
|
|
9052
9146
|
}
|
|
9147
|
+
const readyPushTimeoutMinutes = raw.readyPushTimeoutMinutes ?? DEFAULT_READY_PUSH_TIMEOUT_MINUTES;
|
|
9148
|
+
if (!Number.isInteger(readyPushTimeoutMinutes) || readyPushTimeoutMinutes < 1) {
|
|
9149
|
+
throw new Error(`vinaya.config.json: reviewPolicy.readyPushTimeoutMinutes "${readyPushTimeoutMinutes}" is not a positive integer — fix the config, this never falls back to a default.`);
|
|
9150
|
+
}
|
|
9053
9151
|
return {
|
|
9054
9152
|
codeReviewThreshold,
|
|
9055
9153
|
securityThreshold,
|
|
9056
9154
|
maxRounds,
|
|
9057
|
-
maxTaskMinutes
|
|
9155
|
+
maxTaskMinutes,
|
|
9156
|
+
readyPushTimeoutMinutes
|
|
9058
9157
|
};
|
|
9059
9158
|
}
|
|
9159
|
+
var emittedLocalOverrideWarnings = new Set;
|
|
9060
9160
|
function resolveGateCutovers(config) {
|
|
9061
9161
|
const raw = config?.gateCutovers;
|
|
9062
9162
|
if (!raw)
|
|
@@ -9569,7 +9669,7 @@ function appendLoopLogLine(path, line) {
|
|
|
9569
9669
|
import {
|
|
9570
9670
|
closeSync as closeSync3,
|
|
9571
9671
|
constants as fsConstants3,
|
|
9572
|
-
lstatSync,
|
|
9672
|
+
lstatSync as lstatSync2,
|
|
9573
9673
|
mkdirSync as mkdirSync3,
|
|
9574
9674
|
openSync as openSync3,
|
|
9575
9675
|
linkSync,
|
|
@@ -9740,7 +9840,7 @@ function removeQueueHead(path, cut) {
|
|
|
9740
9840
|
function queueBucketSize(path) {
|
|
9741
9841
|
let lstat;
|
|
9742
9842
|
try {
|
|
9743
|
-
lstat =
|
|
9843
|
+
lstat = lstatSync2(path);
|
|
9744
9844
|
} catch (err) {
|
|
9745
9845
|
if (!isEnoent(err))
|
|
9746
9846
|
throw err;
|
|
@@ -9907,6 +10007,7 @@ async function drainOutboxToWebhook(outboxTask, webhookUrl, headers, fetchTimeou
|
|
|
9907
10007
|
|
|
9908
10008
|
// src/lib/log-sink.ts
|
|
9909
10009
|
var OUTBOX_MAX_BYTES = 8 * 1024 * 1024;
|
|
10010
|
+
var LOG_FOLDER_ONLY_ENV = "VINAYA_LOG_FOLDER_ONLY";
|
|
9910
10011
|
function describeFolderFallback(reason) {
|
|
9911
10012
|
if (reason.kind === "anchor-unreadable") {
|
|
9912
10013
|
return `not delivering to the configured log server ${reason.intendedUrl} — the default branch's ` + "vinaya.config.json could not be read to confirm it (the trust-anchor read via `gh` was offline, " + "unauthenticated, or slower than its deadline); events are written to the local folder and can be " + "delivered later with `vinaya log send`";
|
|
@@ -9946,6 +10047,9 @@ function logsCredentialMissing(headers, env) {
|
|
|
9946
10047
|
return false;
|
|
9947
10048
|
}
|
|
9948
10049
|
function resolveLogDestinationFrom(input) {
|
|
10050
|
+
if (input.localConfig?.logs === false || input.unattended && input.trustAnchorConfig?.logs === false) {
|
|
10051
|
+
return { kind: "none", reason: "logs: false disables Log recording" };
|
|
10052
|
+
}
|
|
9949
10053
|
const spoolDir = input.env.VINAYA_LOG_SPOOL_DIR;
|
|
9950
10054
|
if (spoolDir !== undefined && spoolDir.trim() !== "") {
|
|
9951
10055
|
return { kind: "folder", folder: spoolDir };
|
|
@@ -9965,6 +10069,10 @@ function resolveLogDestinationFrom(input) {
|
|
|
9965
10069
|
} else {
|
|
9966
10070
|
effective = local;
|
|
9967
10071
|
}
|
|
10072
|
+
if (input.folderOnly || input.env[LOG_FOLDER_ONLY_ENV] === "1") {
|
|
10073
|
+
const folder = effective && "folder" in effective && !isInsideRepo(effective.folder, input.repoRoot) ? effective.folder : input.defaultFolder;
|
|
10074
|
+
return { kind: "folder", folder };
|
|
10075
|
+
}
|
|
9968
10076
|
if (hostFromEnv(input.env) === "ci") {
|
|
9969
10077
|
if (effective && "url" in effective) {
|
|
9970
10078
|
if (logsCredentialMissing(effective.headers, input.env)) {
|
|
@@ -9989,21 +10097,51 @@ function resolveLogDestinationFrom(input) {
|
|
|
9989
10097
|
const folder = effective && "folder" in effective ? effective.folder : input.defaultFolder;
|
|
9990
10098
|
return fallbackReason ? { kind: "folder", folder, fallbackReason } : { kind: "folder", folder };
|
|
9991
10099
|
}
|
|
9992
|
-
var
|
|
10100
|
+
var LOG_DESTINATION_ANCHOR_RETRY_INTERVAL_MS = 30000;
|
|
10101
|
+
var LOG_DESTINATION_ANCHOR_MAX_RETRIES = 5;
|
|
10102
|
+
function createTrustAnchorCache(read, now = Date.now, bounds = {
|
|
10103
|
+
retryIntervalMs: LOG_DESTINATION_ANCHOR_RETRY_INTERVAL_MS,
|
|
10104
|
+
maxRetries: LOG_DESTINATION_ANCHOR_MAX_RETRIES
|
|
10105
|
+
}) {
|
|
10106
|
+
const slots = new Map;
|
|
10107
|
+
const start = (repoRoot, retries) => {
|
|
10108
|
+
const slot = {
|
|
10109
|
+
reading: Promise.resolve().then(read).catch(() => null),
|
|
10110
|
+
retries,
|
|
10111
|
+
missedAt: null
|
|
10112
|
+
};
|
|
10113
|
+
slots.set(repoRoot, slot);
|
|
10114
|
+
slot.reading.then((config) => {
|
|
10115
|
+
if (config === null)
|
|
10116
|
+
slot.missedAt = now();
|
|
10117
|
+
});
|
|
10118
|
+
return slot.reading;
|
|
10119
|
+
};
|
|
10120
|
+
return {
|
|
10121
|
+
get: (repoRoot) => {
|
|
10122
|
+
const slot = slots.get(repoRoot);
|
|
10123
|
+
if (slot === undefined)
|
|
10124
|
+
return start(repoRoot, 0);
|
|
10125
|
+
if (slot.missedAt === null)
|
|
10126
|
+
return slot.reading;
|
|
10127
|
+
if (slot.retries >= bounds.maxRetries || now() - slot.missedAt < bounds.retryIntervalMs)
|
|
10128
|
+
return slot.reading;
|
|
10129
|
+
return start(repoRoot, slot.retries + 1);
|
|
10130
|
+
},
|
|
10131
|
+
clear: () => slots.clear()
|
|
10132
|
+
};
|
|
10133
|
+
}
|
|
10134
|
+
var processTrustAnchorByRepo = createTrustAnchorCache(safeLoadTrustAnchorConfig);
|
|
9993
10135
|
function processTrustAnchor(repoRoot) {
|
|
9994
|
-
|
|
9995
|
-
if (cached !== undefined)
|
|
9996
|
-
return cached;
|
|
9997
|
-
const reading = safeLoadTrustAnchorConfig();
|
|
9998
|
-
processTrustAnchorByRepo.set(repoRoot, reading);
|
|
9999
|
-
return reading;
|
|
10136
|
+
return processTrustAnchorByRepo.get(repoRoot);
|
|
10000
10137
|
}
|
|
10001
|
-
async function defaultResolveLogDestination(repo, env) {
|
|
10138
|
+
async function defaultResolveLogDestination(repo, env, folderOnly = false) {
|
|
10002
10139
|
const localConfig = loadConfig();
|
|
10003
10140
|
const unattended = isUnattendedProcess(process.env);
|
|
10004
10141
|
const repoRoot = repoRootSync();
|
|
10005
10142
|
return resolveLogDestinationFrom({
|
|
10006
10143
|
localConfig,
|
|
10144
|
+
folderOnly,
|
|
10007
10145
|
trustAnchorConfig: unattended ? await processTrustAnchor(repoRoot) : null,
|
|
10008
10146
|
unattended,
|
|
10009
10147
|
env,
|
|
@@ -10012,14 +10150,16 @@ async function defaultResolveLogDestination(repo, env) {
|
|
|
10012
10150
|
});
|
|
10013
10151
|
}
|
|
10014
10152
|
function unresolvedLogDestination(env) {
|
|
10153
|
+
const loaded = loadConfig();
|
|
10154
|
+
if (loaded?.logs === false)
|
|
10155
|
+
return { kind: "none", reason: "logs: false disables Log recording" };
|
|
10015
10156
|
if (hostFromEnv(env) === "ci") {
|
|
10016
10157
|
return {
|
|
10017
10158
|
kind: "none",
|
|
10018
10159
|
reason: "the process ended before its log destination was resolved, and a CI job never records to a folder"
|
|
10019
10160
|
};
|
|
10020
10161
|
}
|
|
10021
|
-
const
|
|
10022
|
-
const localConfig = loaded?.logs?.url !== undefined ? { ...loaded, logs: undefined } : loaded;
|
|
10162
|
+
const localConfig = loaded?.logs && loaded.logs.url !== undefined ? { ...loaded, logs: undefined } : loaded;
|
|
10023
10163
|
const unattended = isUnattendedProcess(process.env);
|
|
10024
10164
|
const repoRoot = repoRootSync();
|
|
10025
10165
|
const runtimeDir = process.env[RUNTIME_DIR_ENV_KEY] || resolveRuntimeDir({ repo: null, localConfig, trustAnchorConfig: null, unattended, repoRoot });
|
|
@@ -10241,6 +10381,7 @@ async function resolveHeadSha(cwd) {
|
|
|
10241
10381
|
}
|
|
10242
10382
|
function defaultDeps() {
|
|
10243
10383
|
return {
|
|
10384
|
+
readConfig: loadConfig,
|
|
10244
10385
|
outboxRoot: () => join6(GLOBAL_VINAYA_HOME, "outbox"),
|
|
10245
10386
|
home: () => homedir3(),
|
|
10246
10387
|
hostname: () => osHostname(),
|
|
@@ -10424,23 +10565,59 @@ function createLogSink(overrides = {}) {
|
|
|
10424
10565
|
};
|
|
10425
10566
|
let contextCache;
|
|
10426
10567
|
let settledContext;
|
|
10568
|
+
let contextEnv = {};
|
|
10569
|
+
const resolveDestination = async (repo, env) => deps.readConfig()?.logs === false ? { kind: "none", reason: "logs: false disables Log recording" } : await deps.resolveLogDestination(repo, env, deps.folderOnly);
|
|
10427
10570
|
const context = () => {
|
|
10428
10571
|
if (contextCache === undefined) {
|
|
10429
10572
|
const env = deps.env();
|
|
10573
|
+
contextEnv = env;
|
|
10430
10574
|
contextCache = Promise.all([
|
|
10431
10575
|
withDeadline(resolveRepoOnce(), LOG_CONTEXT_LOOKUP_DEADLINE_MS, null),
|
|
10432
10576
|
doctrine()
|
|
10433
10577
|
]).then(async ([resolved, doctrineValue]) => {
|
|
10434
10578
|
const repo = resolved && isSafeRepoSegment3(resolved.owner) && isSafeRepoSegment3(resolved.repo) ? resolved : null;
|
|
10435
|
-
settledContext = { repo, doctrine: doctrineValue, destination: await
|
|
10579
|
+
settledContext = { repo, doctrine: doctrineValue, destination: await resolveDestination(repo, env) };
|
|
10580
|
+
destinationRetryDueAt = deps.now().getTime() + LOG_DESTINATION_ANCHOR_RETRY_INTERVAL_MS;
|
|
10436
10581
|
return settledContext;
|
|
10437
10582
|
});
|
|
10438
10583
|
}
|
|
10439
10584
|
return contextCache;
|
|
10440
10585
|
};
|
|
10586
|
+
let destinationRetries = 0;
|
|
10587
|
+
let destinationRetryDueAt = 0;
|
|
10588
|
+
let destinationRetryInFlight = false;
|
|
10589
|
+
const retryDestinationIfDue = (ctx) => {
|
|
10590
|
+
if (ctx.destination.kind !== "folder" || ctx.destination.fallbackReason?.kind !== "anchor-unreadable")
|
|
10591
|
+
return;
|
|
10592
|
+
if (destinationRetryInFlight || destinationRetries >= LOG_DESTINATION_ANCHOR_MAX_RETRIES)
|
|
10593
|
+
return;
|
|
10594
|
+
if (deps.now().getTime() < destinationRetryDueAt)
|
|
10595
|
+
return;
|
|
10596
|
+
destinationRetryInFlight = true;
|
|
10597
|
+
destinationRetries++;
|
|
10598
|
+
const generation = contextCache;
|
|
10599
|
+
Promise.resolve().then(() => resolveDestination(ctx.repo, contextEnv)).then((destination) => {
|
|
10600
|
+
if (contextCache !== generation)
|
|
10601
|
+
return;
|
|
10602
|
+
if (destination.kind === "server") {
|
|
10603
|
+
settledContext = { ...ctx, destination };
|
|
10604
|
+
contextCache = Promise.resolve(settledContext);
|
|
10605
|
+
return;
|
|
10606
|
+
}
|
|
10607
|
+
if (destination.kind !== "folder" || destination.fallbackReason?.kind !== "anchor-unreadable") {
|
|
10608
|
+
destinationRetries = LOG_DESTINATION_ANCHOR_MAX_RETRIES;
|
|
10609
|
+
}
|
|
10610
|
+
}, () => {
|
|
10611
|
+
return;
|
|
10612
|
+
}).finally(() => {
|
|
10613
|
+
destinationRetryInFlight = false;
|
|
10614
|
+
destinationRetryDueAt = deps.now().getTime() + LOG_DESTINATION_ANCHOR_RETRY_INTERVAL_MS;
|
|
10615
|
+
});
|
|
10616
|
+
};
|
|
10441
10617
|
const resetContext = () => {
|
|
10442
10618
|
contextCache = undefined;
|
|
10443
10619
|
settledContext = undefined;
|
|
10620
|
+
destinationRetries = 0;
|
|
10444
10621
|
};
|
|
10445
10622
|
let drainChain = Promise.resolve();
|
|
10446
10623
|
const pendingWrites = new Set;
|
|
@@ -10453,24 +10630,30 @@ function createLogSink(overrides = {}) {
|
|
|
10453
10630
|
`);
|
|
10454
10631
|
});
|
|
10455
10632
|
};
|
|
10456
|
-
const snapshot = () => {
|
|
10633
|
+
const snapshot = (attribution) => {
|
|
10457
10634
|
const env = deps.env();
|
|
10458
10635
|
return {
|
|
10636
|
+
attributed: attribution !== undefined,
|
|
10459
10637
|
host: hostFromEnv(env),
|
|
10460
10638
|
now: deps.now(),
|
|
10461
10639
|
seq: seq++,
|
|
10462
10640
|
envFields: {
|
|
10463
|
-
role: env.VINAYA_ROLE,
|
|
10641
|
+
role: attribution?.role ?? env.VINAYA_ROLE,
|
|
10464
10642
|
task: env.VINAYA_TASK,
|
|
10465
|
-
round: env.VINAYA_ROUND,
|
|
10643
|
+
round: attribution ? String(attribution.round) : env.VINAYA_ROUND,
|
|
10466
10644
|
pr: env.VINAYA_PR,
|
|
10467
10645
|
run: env.VINAYA_RUN || runId,
|
|
10468
|
-
attempt: env.VINAYA_ATTEMPT,
|
|
10646
|
+
attempt: attribution ? String(attribution.attempt) : env.VINAYA_ATTEMPT,
|
|
10469
10647
|
parent: env.VINAYA_PARENT_EVENT,
|
|
10470
10648
|
workRef: env.VINAYA_WORK_REF,
|
|
10471
10649
|
flow: env.VINAYA_FLOW,
|
|
10472
10650
|
flowVersion: env.VINAYA_FLOW_VERSION,
|
|
10473
10651
|
runtime: env.VINAYA_RUNTIME,
|
|
10652
|
+
processId: env.VINAYA_PROCESS_ID,
|
|
10653
|
+
processVersion: env.VINAYA_PROCESS_VERSION,
|
|
10654
|
+
processDigest: env.VINAYA_PROCESS_DIGEST,
|
|
10655
|
+
runnerId: env.VINAYA_RUNNER_ID,
|
|
10656
|
+
runnerVersion: env.VINAYA_RUNNER_VERSION,
|
|
10474
10657
|
source: env.VINAYA_SOURCE
|
|
10475
10658
|
}
|
|
10476
10659
|
};
|
|
@@ -10500,7 +10683,7 @@ function createLogSink(overrides = {}) {
|
|
|
10500
10683
|
eventId: randomUUID2(),
|
|
10501
10684
|
processId,
|
|
10502
10685
|
revision: headSha,
|
|
10503
|
-
provenance: deps.provenance,
|
|
10686
|
+
provenance: call.attributed ? "parent_attributed" : deps.provenance,
|
|
10504
10687
|
inputVersions: deps.inputVersions()
|
|
10505
10688
|
});
|
|
10506
10689
|
const header = headSha === null ? built : { ...built, subject: { ...built.subject, sha: headSha } };
|
|
@@ -10525,11 +10708,14 @@ function createLogSink(overrides = {}) {
|
|
|
10525
10708
|
appendLine(outboxPathFor({ outboxRoot: () => destination.folder }, repo, header.subject.issue), line, warnOnce);
|
|
10526
10709
|
}
|
|
10527
10710
|
};
|
|
10528
|
-
function log(e) {
|
|
10711
|
+
function log(e, attribution) {
|
|
10529
10712
|
try {
|
|
10530
|
-
const call = snapshot();
|
|
10713
|
+
const call = snapshot(attribution);
|
|
10531
10714
|
const write = async () => {
|
|
10532
10715
|
const ctx = await context();
|
|
10716
|
+
try {
|
|
10717
|
+
retryDestinationIfDue(ctx);
|
|
10718
|
+
} catch {}
|
|
10533
10719
|
if (ctx.destination.kind === "none") {
|
|
10534
10720
|
writeEvent(e, call, ctx, null, null, true);
|
|
10535
10721
|
return;
|
|
@@ -10553,9 +10739,13 @@ function createLogSink(overrides = {}) {
|
|
|
10553
10739
|
function logSync(e, opts = {}) {
|
|
10554
10740
|
try {
|
|
10555
10741
|
const call = snapshot();
|
|
10556
|
-
let ctx =
|
|
10742
|
+
let ctx = deps.readConfig()?.logs === false ? {
|
|
10743
|
+
repo: null,
|
|
10744
|
+
doctrine: "unknown",
|
|
10745
|
+
destination: { kind: "none", reason: "logs: false disables Log recording" }
|
|
10746
|
+
} : settledContext;
|
|
10557
10747
|
if (ctx === undefined) {
|
|
10558
|
-
const destination = deps.unresolvedLogDestination(deps.env());
|
|
10748
|
+
const destination = deps.readConfig()?.logs === false ? { kind: "none", reason: "logs: false disables Log recording" } : deps.unresolvedLogDestination(deps.env());
|
|
10559
10749
|
if (destination.kind === "folder" && !opts.quiet) {
|
|
10560
10750
|
warnOnce(`vinaya: the process ended before its log destination was resolved — the event is written to ${destination.folder}; \`vinaya log send\` delivers it to a configured server later
|
|
10561
10751
|
`);
|
|
@@ -10863,7 +11053,7 @@ function resolveNumber(issue, subjectLabel, runner) {
|
|
|
10863
11053
|
}
|
|
10864
11054
|
|
|
10865
11055
|
// src/lib/brief-assembly.ts
|
|
10866
|
-
import { execFileSync as
|
|
11056
|
+
import { execFileSync as execFileSync7 } from "node:child_process";
|
|
10867
11057
|
import { existsSync as existsSync8, readFileSync as readFileSync8, readdirSync as readdirSync2 } from "node:fs";
|
|
10868
11058
|
import { join as join9 } from "node:path";
|
|
10869
11059
|
|
|
@@ -11033,6 +11223,10 @@ var COMMANDS = [
|
|
|
11033
11223
|
needs: ["forge", "operator-seat"],
|
|
11034
11224
|
description: "One command from a planned Issue to a reviewed pull request — exactly one developer started",
|
|
11035
11225
|
flags: [
|
|
11226
|
+
{
|
|
11227
|
+
flag: "--runner <standalone|atta-engine>",
|
|
11228
|
+
description: "Override runner config for this invocation; absent uses config, whose default is standalone"
|
|
11229
|
+
},
|
|
11036
11230
|
{
|
|
11037
11231
|
flag: "--agent <claude|codex>",
|
|
11038
11232
|
description: "Vendor for the developer and both reviewers this run dispatches"
|
|
@@ -11044,17 +11238,39 @@ var COMMANDS = [
|
|
|
11044
11238
|
{
|
|
11045
11239
|
flag: "--widen-surface <glob,...> --reason <text>",
|
|
11046
11240
|
description: "Continue a pre-pull-request escalation whose Developer asked for `widen_surface`: supersede the frozen brief with the globs added to `## Surface`, record that as the escalation's resolution, grade the widened Issue through the write gate, then start the run"
|
|
11241
|
+
},
|
|
11242
|
+
{
|
|
11243
|
+
flag: "--rollback",
|
|
11244
|
+
description: "Run the terminate-and-restart procedure for this task: cancel its in-flight Engine run, reconcile every prepared and uncertain effect by its identity, then start a fresh standalone run from the same frozen brief. Refuses a task whose recorded runner is not `atta-engine`"
|
|
11047
11245
|
}
|
|
11048
11246
|
],
|
|
11049
11247
|
details: [
|
|
11248
|
+
"The atta-engine runner starts the workspace Engine script with Bun, streams its output and returns its exit code. A published install without the script prints one notice and falls back to standalone. Engine Log events use the local folder only; logs: false disables all Log destinations for both runners.",
|
|
11249
|
+
"A run's runner is recorded when it starts and never changes: switching `runner` in config changes only the runner of new runs, and a run recorded on `atta-engine` keeps routing to the Engine for `task status`, `task_resume` and `task_cancel`. A start on a pause another runner holds is refused with a typed reason naming the recorded runner and the requested one, and so is a start on another runner's Engine run that is still in flight with no pause held — halted or stopped short of completed or cancelled.",
|
|
11250
|
+
"`--rollback` ends the Engine run first: a held pause through the shared cancel `task_cancel` uses, which needs a Principal ruling newer than the pause as any cancel does; a run halted with no pause held has its started effects fenced; a run that already completed or was cancelled is refused, as is a driver still running with no pause held, which is never signalled; and the standalone run never starts while the Engine driver lives, a cancelled run's driver given a bounded wait to release its lock. Every started and uncertain effect is then reconciled by its identity: one the forge carries is recorded verified, one it does not carry is left for the restarted run to complete, and one the forge read cannot settle refuses the restart. Each rehearsal appends a record — task, recorded runner, action, reconciled effect identities, the restarted run's runner and terminal state — to `backend-rollback-rehearsals.jsonl` in the task's runtime directory, whether it completed, was refused or failed at a later step, and nothing removes it.",
|
|
11050
11251
|
"`--widen-surface` is the Planner's one command for a widen-surface escalation, and refuses before any write when the held pause is not one (no pause, a pause with a pull request — whose continuation is the ruling on that pull request — or a round whose Developer asked for no `widen_surface`), when a driver is still alive for the task, when the escalation's resolution is already consumed (a replay — the Surface is never widened twice), or when the widened body fails the write gate, whose findings name the field to edit first. The escalation packet's permitted next actions name this command with the globs the Developer asked for, and `task_resume` refuses such an escalation naming it.",
|
|
11051
|
-
"
|
|
11252
|
+
"Prepares the frozen brief and resolves the task, branch and model once. The standalone runner then starts the watching driver (`runDriverLoop`, `dev-review-loop.ts`). Preparation starts no agent; the loop's own round 1 reads the frozen brief off the Issue and is the only place a developer is ever dispatched from a fresh task, so exactly one developer is started by construction.",
|
|
11052
11253
|
"A brief already frozen on the Issue is reused, never re-posted — the second `task dispatch`/`task brief` call this composes around does not fail the whole run, it just skips straight to running the loop. A task whose Issue refuses preparation (a missing brief section, an unmet dispatch gate) is refused before any agent starts, with nothing posted.",
|
|
11053
11254
|
"Refuses when the frozen brief's developer branch already has an open pull request AND a driver is still live for it — a driver that crashed or was killed leaves its PR behind, and this command is the one that revives it, in any state, pause held or not.",
|
|
11054
11255
|
"issue-711 O4: a pause never ends this process — it keeps running and watches the pull request, continuing on its own once a newer Principal ruling appears (or, for an `'infrastructure'`/`'stale_driver'` pause, after a bounded backoff), with no `--resume` command needed for the ordinary case. Exit and printed summary distinguish a published pull request OR a watched pause's own genuine end — merged, closed, or an operator's own `--cancel` (exit `0` either way, the PR URL) — from the one pause this process can never watch (no pull request exists yet — exit `1`, with the working `vinaya task run` command for this task's own branch to continue by hand — `<tranche> <n>` for a tranche task, `--issue <n>` for a backlog one — never a `dev-review-loop --resume` line naming a pull-request number this pause does not have), a usage/argv error (exit `2`), and any other failure (exit `3`)."
|
|
11055
11256
|
],
|
|
11056
11257
|
status: "shipped"
|
|
11057
11258
|
},
|
|
11259
|
+
{
|
|
11260
|
+
name: "task switch",
|
|
11261
|
+
needs: ["forge"],
|
|
11262
|
+
description: "Change a task's agent or model by setting its Engine checkpoint aside, so the next `task run` is accepted",
|
|
11263
|
+
flags: [
|
|
11264
|
+
{ flag: "--issue <n>", description: "Address the task by its Issue number instead of `<tranche> <n>`" },
|
|
11265
|
+
{ flag: "--agent <claude|codex>", description: "Vendor the next `task run` of the task continues on" },
|
|
11266
|
+
{ flag: "--model <model>", description: "Model the next `task run` is meant to use; absent, the vendor default" }
|
|
11267
|
+
],
|
|
11268
|
+
details: [
|
|
11269
|
+
"Refuses, changing nothing, while a driver for the task is alive, naming its pid. Otherwise moves the task's Engine checkpoint (`checkpoints.sqlite` with its `-wal` and `-shm` files) into a timestamped `switched-*` folder of the task's run directory and never deletes it; the branch, its commits and its pull request are untouched, so the next `task run` with the new agent continues the same branch on a fresh checkpoint.",
|
|
11270
|
+
"Writes one driver-log line naming the from and to agent, the from and to model and the folder the checkpoint went to. On the standalone runner it changes nothing on disk and says that runner already continues a task on a new `--agent` by itself. `task run` and `run-engine --resume` still refuse an agent other than the checkpoint's, and their refusal names this command."
|
|
11271
|
+
],
|
|
11272
|
+
status: "shipped"
|
|
11273
|
+
},
|
|
11058
11274
|
{
|
|
11059
11275
|
name: "task status",
|
|
11060
11276
|
needs: ["forge"],
|
|
@@ -11769,7 +11985,8 @@ var StateSourceConfigSchema = z7.discriminatedUnion("kind", [
|
|
|
11769
11985
|
z7.object({ kind: z7.literal("file"), root: z7.string().optional() })
|
|
11770
11986
|
]);
|
|
11771
11987
|
// src/checks/edge-resolve.ts
|
|
11772
|
-
import {
|
|
11988
|
+
import { execFile as execFile6 } from "node:child_process";
|
|
11989
|
+
import { promisify as promisify6 } from "node:util";
|
|
11773
11990
|
|
|
11774
11991
|
// src/lib/github-rate-limit.ts
|
|
11775
11992
|
import { execFileSync as execFileSync5 } from "node:child_process";
|
|
@@ -11820,15 +12037,20 @@ ${message}` : message;
|
|
|
11820
12037
|
// src/checks/edge-resolve.ts
|
|
11821
12038
|
var DIRECT_ISSUE_REF = /#(\d+)/;
|
|
11822
12039
|
var issueCache = new Map;
|
|
12040
|
+
var execFileAsync6 = promisify6(execFile6);
|
|
11823
12041
|
var ISSUE_NOT_FOUND = /could not resolve to an issue/i;
|
|
11824
12042
|
function fetchIssueState(num, repo) {
|
|
11825
12043
|
const key = `${repo.owner}/${repo.repo}#${num}`;
|
|
11826
12044
|
const cached = issueCache.get(key);
|
|
11827
12045
|
if (cached)
|
|
11828
12046
|
return cached;
|
|
11829
|
-
|
|
12047
|
+
const out = readIssueOnce(num, repo).then((first) => first.readFailed ? readIssueOnce(num, repo) : first);
|
|
12048
|
+
issueCache.set(key, out);
|
|
12049
|
+
return out;
|
|
12050
|
+
}
|
|
12051
|
+
async function readIssueOnce(num, repo) {
|
|
11830
12052
|
try {
|
|
11831
|
-
const
|
|
12053
|
+
const { stdout } = await execFileAsync6("gh", [
|
|
11832
12054
|
"issue",
|
|
11833
12055
|
"view",
|
|
11834
12056
|
String(num),
|
|
@@ -11836,13 +12058,11 @@ function fetchIssueState(num, repo) {
|
|
|
11836
12058
|
`${repo.owner}/${repo.repo}`,
|
|
11837
12059
|
"--json",
|
|
11838
12060
|
"state,stateReason,closedByPullRequestsReferences"
|
|
11839
|
-
], { encoding: "utf8"
|
|
11840
|
-
|
|
12061
|
+
], { encoding: "utf8" });
|
|
12062
|
+
return { json: JSON.parse(stdout), readFailed: false };
|
|
11841
12063
|
} catch (err) {
|
|
11842
|
-
|
|
12064
|
+
return { json: null, readFailed: !ISSUE_NOT_FOUND.test(execErrorText(err)) };
|
|
11843
12065
|
}
|
|
11844
|
-
issueCache.set(key, out);
|
|
11845
|
-
return out;
|
|
11846
12066
|
}
|
|
11847
12067
|
var defaultResolveSiblingTranche = async (slug, repo) => {
|
|
11848
12068
|
let tranche;
|
|
@@ -11902,7 +12122,7 @@ async function resolveEdge(id, taskById, factsByTaskId, repo, resolveSibling = d
|
|
|
11902
12122
|
const direct = id.match(DIRECT_ISSUE_REF);
|
|
11903
12123
|
if (direct) {
|
|
11904
12124
|
const num = Number(direct[1]);
|
|
11905
|
-
const read = fetchIssueState(num, repo);
|
|
12125
|
+
const read = await fetchIssueState(num, repo);
|
|
11906
12126
|
return edgeFromIssueJson(num, read.json, read.readFailed);
|
|
11907
12127
|
}
|
|
11908
12128
|
const qualified = splitSlugQualifiedEdge(id);
|
|
@@ -11951,7 +12171,7 @@ function dependsOnFactFromEdge(id, r) {
|
|
|
11951
12171
|
}
|
|
11952
12172
|
|
|
11953
12173
|
// src/commands/doctrine.ts
|
|
11954
|
-
import { execFileSync as
|
|
12174
|
+
import { execFileSync as execFileSync6 } from "node:child_process";
|
|
11955
12175
|
import { existsSync as existsSync7, readdirSync, readFileSync as readFileSync7 } from "node:fs";
|
|
11956
12176
|
import { dirname as dirname7, join as join8, sep as sep2 } from "node:path";
|
|
11957
12177
|
import matter4 from "gray-matter";
|
|
@@ -11977,7 +12197,7 @@ function resolveDoctrineRoot(pkg = packageRoot(import.meta.url), cwd = process.c
|
|
|
11977
12197
|
}
|
|
11978
12198
|
function gitToplevel(cwd) {
|
|
11979
12199
|
try {
|
|
11980
|
-
return
|
|
12200
|
+
return execFileSync6("git", ["-C", cwd, "rev-parse", "--show-toplevel"], {
|
|
11981
12201
|
encoding: "utf8",
|
|
11982
12202
|
stdio: ["ignore", "pipe", "pipe"]
|
|
11983
12203
|
}).trim();
|
|
@@ -12006,7 +12226,7 @@ var PACKAGED_TEMPLATE_PATH = join9(PACKAGE_ROOT, "aeg-root", "templates", "brief
|
|
|
12006
12226
|
var TEMPLATE_PATH = existsSync8(PACKAGED_TEMPLATE_PATH) ? PACKAGED_TEMPLATE_PATH : join9(PACKAGE_ROOT, "..", "..", "aeg-root", "templates", "brief-template.md");
|
|
12007
12227
|
function git(args) {
|
|
12008
12228
|
try {
|
|
12009
|
-
return
|
|
12229
|
+
return execFileSync7("git", args, { encoding: "utf8", stdio: ["ignore", "pipe", "ignore"] }).trim();
|
|
12010
12230
|
} catch {
|
|
12011
12231
|
return "";
|
|
12012
12232
|
}
|
|
@@ -12026,13 +12246,23 @@ var INFORMATIONAL_DISPATCH_BLOCKER_CLASSES = new Set([
|
|
|
12026
12246
|
"conflicts-with"
|
|
12027
12247
|
]);
|
|
12028
12248
|
|
|
12249
|
+
// src/lib/pre-push-failed-tests.ts
|
|
12250
|
+
var VERIFICATION_LOCKFILES = ["bun.lock", "bun.lockb", "package-lock.json", "yarn.lock", "pnpm-lock.yaml"];
|
|
12251
|
+
var VERIFICATION_INPUT_FILES = ["vinaya.config.json", "package.json", "bunfig.toml", ...VERIFICATION_LOCKFILES];
|
|
12252
|
+
|
|
12253
|
+
// src/lib/pre-push-ready-policy.ts
|
|
12254
|
+
var DEFERRAL_MARKER_TTL_MS = 30 * 60 * 1000;
|
|
12255
|
+
if (false)
|
|
12256
|
+
;
|
|
12257
|
+
|
|
12029
12258
|
// src/lib/pr-report-engine.ts
|
|
12030
|
-
var
|
|
12259
|
+
var execFileAsync7 = promisify7(execFile7);
|
|
12031
12260
|
var BODY_READING_CHECK_NAMES = new Set(coreCheckRegistry().filter((spec) => {
|
|
12032
12261
|
const decl = spec.env?.PR_BODY;
|
|
12033
12262
|
return decl === true || typeof decl === "object" && decl !== null && "optional" in decl;
|
|
12034
12263
|
}).map((spec) => spec.name));
|
|
12035
12264
|
var FAILING_STATUSES = new Set(["fail", "error", "timeout"]);
|
|
12265
|
+
var GIT_MAX_BUFFER = 16 * 1024 * 1024;
|
|
12036
12266
|
var NUL = String.fromCharCode(0);
|
|
12037
12267
|
function extractAgentCommandLines(prBody) {
|
|
12038
12268
|
const located = locateTestPlanSection(prBody);
|
|
@@ -12053,30 +12283,47 @@ function agentCommandText(line) {
|
|
|
12053
12283
|
}
|
|
12054
12284
|
var AGENT_COMMAND_MAX_BUFFER_BYTES = 32 * 1024 * 1024;
|
|
12055
12285
|
// src/lib/patch-id.ts
|
|
12056
|
-
import { execFileSync as
|
|
12057
|
-
|
|
12058
|
-
|
|
12059
|
-
|
|
12060
|
-
}
|
|
12286
|
+
import { execFileSync as execFileSync8 } from "node:child_process";
|
|
12287
|
+
var git2 = (args, options, input) => execFileSync8("git", [...args], {
|
|
12288
|
+
encoding: "utf8",
|
|
12289
|
+
maxBuffer: 64 * 1024 * 1024,
|
|
12290
|
+
...options.cwd === undefined ? {} : { cwd: options.cwd },
|
|
12291
|
+
...input === undefined ? { stdio: ["ignore", "pipe", "pipe"] } : { input, stdio: ["pipe", "pipe", "pipe"] }
|
|
12292
|
+
});
|
|
12293
|
+
function ownPatchAt(base, sha, options = {}) {
|
|
12294
|
+
for (const rev of [base, sha]) {
|
|
12295
|
+
try {
|
|
12296
|
+
options.fetch?.(rev);
|
|
12297
|
+
} catch {}
|
|
12298
|
+
}
|
|
12061
12299
|
try {
|
|
12062
|
-
const
|
|
12063
|
-
|
|
12064
|
-
|
|
12065
|
-
stdio: ["ignore", "pipe", "pipe"]
|
|
12066
|
-
});
|
|
12067
|
-
if (diff === "")
|
|
12300
|
+
const bases = git2(["merge-base", "--all", base, sha], options).split(`
|
|
12301
|
+
`).map((line) => line.trim()).filter(Boolean);
|
|
12302
|
+
if (bases.length !== 1)
|
|
12068
12303
|
return null;
|
|
12069
|
-
const
|
|
12070
|
-
|
|
12071
|
-
|
|
12072
|
-
|
|
12073
|
-
|
|
12074
|
-
|
|
12304
|
+
const diff = git2(["diff", "-U0", "--no-color", "--no-ext-diff", "--no-textconv", bases[0], sha], options);
|
|
12305
|
+
return diff === "" ? null : diff;
|
|
12306
|
+
} catch {
|
|
12307
|
+
return null;
|
|
12308
|
+
}
|
|
12309
|
+
}
|
|
12310
|
+
function ownPatchIdAt(base, sha, options = {}) {
|
|
12311
|
+
const diff = ownPatchAt(base, sha, options);
|
|
12312
|
+
if (diff === null)
|
|
12313
|
+
return null;
|
|
12314
|
+
try {
|
|
12315
|
+
const id = git2(["patch-id", "--stable"], options, diff).trim().split(/\s+/)[0] ?? "";
|
|
12075
12316
|
return id === "" ? null : id;
|
|
12076
12317
|
} catch {
|
|
12077
12318
|
return null;
|
|
12078
12319
|
}
|
|
12079
12320
|
}
|
|
12321
|
+
function fetchFromOrigin(rev) {
|
|
12322
|
+
execFileSync8("git", ["fetch", "--quiet", "origin", rev], { stdio: ["ignore", "ignore", "ignore"] });
|
|
12323
|
+
}
|
|
12324
|
+
function patchIdAt(base, sha) {
|
|
12325
|
+
return ownPatchIdAt(`origin/${base}`, sha, { fetch: (rev) => rev === sha ? fetchFromOrigin(sha) : undefined });
|
|
12326
|
+
}
|
|
12080
12327
|
|
|
12081
12328
|
// src/checks/evidence-fresh-logic.ts
|
|
12082
12329
|
var HEAD_LINE = /^Head:\s*([0-9a-f]{7,40})\s*$/m;
|
|
@@ -12216,16 +12463,16 @@ function fetchHasPriorDeveloperRound(prNumber) {
|
|
|
12216
12463
|
}
|
|
12217
12464
|
}
|
|
12218
12465
|
function fetchPrComments(prNumber) {
|
|
12219
|
-
const out =
|
|
12466
|
+
const out = execFileSync9("gh", ["pr", "view", String(prNumber), "--json", "comments"], {
|
|
12220
12467
|
encoding: "utf8",
|
|
12221
12468
|
stdio: ["ignore", "pipe", "pipe"]
|
|
12222
12469
|
});
|
|
12223
12470
|
return JSON.parse(out).comments ?? [];
|
|
12224
12471
|
}
|
|
12225
12472
|
var CHECK_NAME = "evidence-fresh";
|
|
12226
|
-
function
|
|
12473
|
+
function git3(args) {
|
|
12227
12474
|
try {
|
|
12228
|
-
return
|
|
12475
|
+
return execFileSync9("git", args, { encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] }).trim();
|
|
12229
12476
|
} catch {
|
|
12230
12477
|
return "";
|
|
12231
12478
|
}
|
|
@@ -12244,7 +12491,7 @@ class GitCommandError2 extends Error {
|
|
|
12244
12491
|
}
|
|
12245
12492
|
function gitStrict(args) {
|
|
12246
12493
|
try {
|
|
12247
|
-
return
|
|
12494
|
+
return execFileSync9("git", args, { encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] }).trim();
|
|
12248
12495
|
} catch (err) {
|
|
12249
12496
|
const stderr = err.stderr;
|
|
12250
12497
|
throw new GitCommandError2(args, String(stderr ?? err.message).trim() || "non-zero exit");
|
|
@@ -12254,7 +12501,7 @@ function resolveMergeBase(head) {
|
|
|
12254
12501
|
const primary = process.env.BASE_SHA || "origin/main";
|
|
12255
12502
|
const tried = primary === "main" ? [primary] : [primary, "main"];
|
|
12256
12503
|
for (const ref of tried) {
|
|
12257
|
-
const base =
|
|
12504
|
+
const base = git3(["merge-base", ref, head]);
|
|
12258
12505
|
if (base)
|
|
12259
12506
|
return base;
|
|
12260
12507
|
}
|
|
@@ -12266,7 +12513,7 @@ function fetchPrRefs(prNumber) {
|
|
|
12266
12513
|
return fromSnapshot.headRefOid && fromSnapshot.baseRefName ? { head: fromSnapshot.headRefOid, base: fromSnapshot.baseRefName } : null;
|
|
12267
12514
|
}
|
|
12268
12515
|
try {
|
|
12269
|
-
const out =
|
|
12516
|
+
const out = execFileSync9("gh", ["pr", "view", String(prNumber), "--json", "headRefOid,baseRefName"], {
|
|
12270
12517
|
encoding: "utf8",
|
|
12271
12518
|
stdio: ["ignore", "pipe", "pipe"]
|
|
12272
12519
|
});
|