@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-doctrine-portability.ts
|
|
4
|
-
import { execFileSync as
|
|
4
|
+
import { execFileSync as execFileSync9 } from "node:child_process";
|
|
5
5
|
import { readdirSync as readdirSync3, readFileSync as readFileSync9, statSync as statSync3 } from "node:fs";
|
|
6
6
|
import { join as join11 } from "node:path";
|
|
7
7
|
|
|
@@ -782,10 +782,11 @@ function trancheSlugsFromLabels(labels) {
|
|
|
782
782
|
}
|
|
783
783
|
return slugs;
|
|
784
784
|
}
|
|
785
|
-
async function indexTrancheMilestonesAsync(owner, repo) {
|
|
785
|
+
async function indexTrancheMilestonesAsync(owner, repo, options = {}) {
|
|
786
|
+
const read = (fetch2) => options.retryFailedReads ? retryOnce(fetch2) : fetch2();
|
|
786
787
|
const [milestones, labels] = await Promise.all([
|
|
787
|
-
ghApiGetAllPagesAsync(`repos/${owner}/${repo}/milestones?state=all&per_page=100`),
|
|
788
|
-
ghApiGetAllPagesAsync(`repos/${owner}/${repo}/labels?per_page=100`)
|
|
788
|
+
read(() => ghApiGetAllPagesAsync(`repos/${owner}/${repo}/milestones?state=all&per_page=100`)),
|
|
789
|
+
read(() => ghApiGetAllPagesAsync(`repos/${owner}/${repo}/labels?per_page=100`))
|
|
789
790
|
]);
|
|
790
791
|
const active = [];
|
|
791
792
|
const archived = [];
|
|
@@ -796,9 +797,16 @@ async function indexTrancheMilestonesAsync(owner, repo) {
|
|
|
796
797
|
const uniqueNewPathSlugs = [...new Set(newPathSlugs)];
|
|
797
798
|
const uniqueLegacySlugs = [...legacySlugs];
|
|
798
799
|
const [legacyIssuesBySlug, newPathIssuesBySlug] = await Promise.all([
|
|
799
|
-
Promise.all(uniqueLegacySlugs.map((slug) => ghIssueListByLabelAsync(owner, repo, trancheLabel(slug)))),
|
|
800
|
-
Promise.all(uniqueNewPathSlugs.map((slug) => ghIssueListByLabelAsync(owner, repo, trancheLabel(slug))))
|
|
800
|
+
Promise.all(uniqueLegacySlugs.map((slug) => read(() => ghIssueListByLabelAsync(owner, repo, trancheLabel(slug))))),
|
|
801
|
+
Promise.all(uniqueNewPathSlugs.map((slug) => read(() => ghIssueListByLabelAsync(owner, repo, trancheLabel(slug)))))
|
|
801
802
|
]);
|
|
803
|
+
const issuesBySlug = new Map;
|
|
804
|
+
uniqueLegacySlugs.forEach((slug, i) => {
|
|
805
|
+
issuesBySlug.set(slug, legacyIssuesBySlug[i] ?? []);
|
|
806
|
+
});
|
|
807
|
+
uniqueNewPathSlugs.forEach((slug, i) => {
|
|
808
|
+
issuesBySlug.set(slug, newPathIssuesBySlug[i] ?? []);
|
|
809
|
+
});
|
|
802
810
|
uniqueLegacySlugs.forEach((slug, i) => {
|
|
803
811
|
const m = legacyMilestoneBySlug.get(slug);
|
|
804
812
|
if (!m)
|
|
@@ -822,7 +830,14 @@ async function indexTrancheMilestonesAsync(owner, repo) {
|
|
|
822
830
|
else if (lifecycle === "complete")
|
|
823
831
|
archived.push({ slug, goal });
|
|
824
832
|
});
|
|
825
|
-
return { active, archived, facts, legacySlugs };
|
|
833
|
+
return { active, archived, facts, legacySlugs, issuesBySlug };
|
|
834
|
+
}
|
|
835
|
+
async function retryOnce(fetch2) {
|
|
836
|
+
try {
|
|
837
|
+
return await fetch2();
|
|
838
|
+
} catch {
|
|
839
|
+
return fetch2();
|
|
840
|
+
}
|
|
826
841
|
}
|
|
827
842
|
async function indexTrancheMilestonesForSlugAsync(owner, repo, slug) {
|
|
828
843
|
const [milestones, labels, issues] = await Promise.all([
|
|
@@ -1867,15 +1882,16 @@ function describeError(err) {
|
|
|
1867
1882
|
}
|
|
1868
1883
|
// ../../packages/aeg-forge-state/src/prior-tranche-archival.ts
|
|
1869
1884
|
function defaultPriorTrancheArchivalDeps() {
|
|
1870
|
-
let facts = new Map;
|
|
1871
1885
|
return {
|
|
1872
|
-
|
|
1873
|
-
const index = await indexTrancheMilestonesAsync(repo.owner, repo.repo);
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1886
|
+
activeTranches: async (excludeSlug, repo) => {
|
|
1887
|
+
const index = await indexTrancheMilestonesAsync(repo.owner, repo.repo, { retryFailedReads: true });
|
|
1888
|
+
return index.active.filter((m) => m.slug !== excludeSlug).map((m) => {
|
|
1889
|
+
const issues = index.issuesBySlug?.get(m.slug);
|
|
1890
|
+
if (!issues)
|
|
1891
|
+
throw new Error(`the Milestone index holds no Issue list for tranche \`${m.slug}\``);
|
|
1892
|
+
return { slug: m.slug, issues };
|
|
1893
|
+
});
|
|
1894
|
+
}
|
|
1879
1895
|
};
|
|
1880
1896
|
}
|
|
1881
1897
|
function reason(err) {
|
|
@@ -1887,61 +1903,28 @@ async function resolvePriorTrancheArchival(projects, excludeSlug, repo, deps = d
|
|
|
1887
1903
|
return { facts: [], infraFailure: null };
|
|
1888
1904
|
let candidates;
|
|
1889
1905
|
try {
|
|
1890
|
-
candidates = await deps.
|
|
1906
|
+
candidates = await deps.activeTranches(excludeSlug, repo);
|
|
1891
1907
|
} catch (err) {
|
|
1892
1908
|
return {
|
|
1893
1909
|
facts: [],
|
|
1894
1910
|
infraFailure: `severity:infra — could not read the active tranches (${reason(err)}); whether a prior tranche is archived is unknown.`
|
|
1895
1911
|
};
|
|
1896
1912
|
}
|
|
1913
|
+
const tasksBySlug = new Map(candidates.map((c) => [c.slug, tasksFromIssues(c.issues)]));
|
|
1897
1914
|
const facts = [];
|
|
1898
|
-
const unreadable = [];
|
|
1899
|
-
const derived = new Map;
|
|
1900
|
-
const derive = (slug) => {
|
|
1901
|
-
let p = derived.get(slug);
|
|
1902
|
-
if (!p) {
|
|
1903
|
-
p = deps.deriveTranche(slug, repo);
|
|
1904
|
-
derived.set(slug, p);
|
|
1905
|
-
}
|
|
1906
|
-
return p;
|
|
1907
|
-
};
|
|
1908
1915
|
for (const project of projects) {
|
|
1909
1916
|
let found = null;
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
let candidateTranche;
|
|
1913
|
-
try {
|
|
1914
|
-
candidateTranche = await derive(slug);
|
|
1915
|
-
} catch {
|
|
1916
|
-
unknown = true;
|
|
1917
|
-
unreadable.push(`the tasks of tranche \`${slug}\` (project \`${project}\`)`);
|
|
1918
|
-
break;
|
|
1919
|
-
}
|
|
1920
|
-
if (!candidateTranche.tasks.some((t) => t.projects.includes(project)))
|
|
1917
|
+
for (const { slug, issues } of candidates) {
|
|
1918
|
+
if (!(tasksBySlug.get(slug) ?? []).some((t) => t.projects.includes(project)))
|
|
1921
1919
|
continue;
|
|
1922
|
-
|
|
1923
|
-
try {
|
|
1924
|
-
openIssues = await deps.openIssues(slug, repo);
|
|
1925
|
-
} catch {
|
|
1926
|
-
openIssues = null;
|
|
1927
|
-
}
|
|
1928
|
-
if (openIssues === null) {
|
|
1929
|
-
unknown = true;
|
|
1930
|
-
unreadable.push(`the open Issues of tranche \`${slug}\` (project \`${project}\`)`);
|
|
1931
|
-
break;
|
|
1932
|
-
}
|
|
1933
|
-
if (openIssues.length === 0) {
|
|
1920
|
+
if (!issues.some((issue) => issue.state === "OPEN")) {
|
|
1934
1921
|
found = { project, priorTrancheSlug: slug, archived: false };
|
|
1935
1922
|
break;
|
|
1936
1923
|
}
|
|
1937
1924
|
}
|
|
1938
|
-
|
|
1939
|
-
facts.push(found ?? { project, priorTrancheSlug: null, archived: false });
|
|
1925
|
+
facts.push(found ?? { project, priorTrancheSlug: null, archived: false });
|
|
1940
1926
|
}
|
|
1941
|
-
return {
|
|
1942
|
-
facts,
|
|
1943
|
-
infraFailure: unreadable.length === 0 ? null : `severity:infra — could not read ${unreadable.join(", ")}; whether a prior tranche is archived is unknown.`
|
|
1944
|
-
};
|
|
1927
|
+
return { facts, infraFailure: null };
|
|
1945
1928
|
}
|
|
1946
1929
|
// ../../packages/aeg-forge-state/src/fetch-open-issues.ts
|
|
1947
1930
|
async function fetchOpenIssuesByLabel(slugs, owner, repo, token) {
|
|
@@ -2767,11 +2750,13 @@ var CODE_REVIEW_SEVERITY_ORDER = ["BLOCKER", "MAJOR", "MINOR"];
|
|
|
2767
2750
|
var SECURITY_SEVERITY_ORDER = ["CRITICAL", "HIGH", "MEDIUM", "LOW"];
|
|
2768
2751
|
var DEFAULT_MAX_ROUNDS = 3;
|
|
2769
2752
|
var DEFAULT_MAX_TASK_MINUTES = 180;
|
|
2753
|
+
var DEFAULT_READY_PUSH_TIMEOUT_MINUTES = 20;
|
|
2770
2754
|
var DEFAULT_REVIEW_POLICY = {
|
|
2771
2755
|
codeReviewThreshold: "BLOCKER",
|
|
2772
2756
|
securityThreshold: "HIGH",
|
|
2773
2757
|
maxRounds: DEFAULT_MAX_ROUNDS,
|
|
2774
|
-
maxTaskMinutes: DEFAULT_MAX_TASK_MINUTES
|
|
2758
|
+
maxTaskMinutes: DEFAULT_MAX_TASK_MINUTES,
|
|
2759
|
+
readyPushTimeoutMinutes: DEFAULT_READY_PUSH_TIMEOUT_MINUTES
|
|
2775
2760
|
};
|
|
2776
2761
|
var FILE_SHAPED_LOCATION = /\.[a-zA-Z0-9]{1,10}(:\d+)?\s*$/;
|
|
2777
2762
|
var PROSE_LOCATION_PATTERNS = [/\bpr\s*body\b/i, /\bcomment\b/i];
|
|
@@ -6960,7 +6945,17 @@ var HeaderMetaV3Schema = z3.object({
|
|
|
6960
6945
|
runtime: z3.string().nullable(),
|
|
6961
6946
|
source: z3.string().nullable()
|
|
6962
6947
|
}).strict();
|
|
6963
|
-
var
|
|
6948
|
+
var HeaderMetaV4Schema = HeaderMetaV3Schema.extend({
|
|
6949
|
+
schema: z3.literal(4),
|
|
6950
|
+
process: z3.object({ id: z3.string(), version: z3.string().nullable(), digest: z3.string().nullable() }).strict(),
|
|
6951
|
+
runner: z3.object({ id: z3.string(), version: z3.string().nullable() }).strict()
|
|
6952
|
+
}).strict();
|
|
6953
|
+
var HeaderMetaSchema = z3.discriminatedUnion("schema", [
|
|
6954
|
+
HeaderMetaV1Schema,
|
|
6955
|
+
HeaderMetaV2Schema,
|
|
6956
|
+
HeaderMetaV3Schema,
|
|
6957
|
+
HeaderMetaV4Schema
|
|
6958
|
+
]);
|
|
6964
6959
|
var SubjectSchema = z3.object({
|
|
6965
6960
|
issue: z3.number().int().nullable(),
|
|
6966
6961
|
pr: z3.number().int().optional(),
|
|
@@ -7180,6 +7175,75 @@ var DevReviewLoopEventSchema = z3.discriminatedUnion("event", [
|
|
|
7180
7175
|
round: z3.number().int(),
|
|
7181
7176
|
phase: z3.string()
|
|
7182
7177
|
}).strict(),
|
|
7178
|
+
z3.object({
|
|
7179
|
+
...loopShared,
|
|
7180
|
+
event: z3.literal("conflict_reentry"),
|
|
7181
|
+
task: z3.number().int(),
|
|
7182
|
+
pr: z3.number().int().positive(),
|
|
7183
|
+
attempt: z3.number().int().positive(),
|
|
7184
|
+
bound: z3.number().int().positive()
|
|
7185
|
+
}).strict(),
|
|
7186
|
+
z3.object({
|
|
7187
|
+
...loopShared,
|
|
7188
|
+
event: z3.literal("storage_push"),
|
|
7189
|
+
round: z3.number().int(),
|
|
7190
|
+
branch: z3.string(),
|
|
7191
|
+
head: z3.string()
|
|
7192
|
+
}).strict(),
|
|
7193
|
+
z3.object({
|
|
7194
|
+
...loopShared,
|
|
7195
|
+
event: z3.literal("local_checks_run"),
|
|
7196
|
+
round: z3.number().int(),
|
|
7197
|
+
head: z3.string().nullable(),
|
|
7198
|
+
passed: z3.boolean(),
|
|
7199
|
+
wall_ms: z3.number().nonnegative()
|
|
7200
|
+
}).strict(),
|
|
7201
|
+
z3.object({
|
|
7202
|
+
...loopShared,
|
|
7203
|
+
event: z3.literal("ready_push"),
|
|
7204
|
+
round: z3.number().int(),
|
|
7205
|
+
head: z3.string(),
|
|
7206
|
+
outcome: z3.enum(["passed", "refused"]),
|
|
7207
|
+
selected: z3.number().int().nonnegative(),
|
|
7208
|
+
failed: z3.number().int().nonnegative(),
|
|
7209
|
+
rerun: z3.boolean(),
|
|
7210
|
+
wall_ms: z3.number().nonnegative()
|
|
7211
|
+
}).strict(),
|
|
7212
|
+
z3.object({
|
|
7213
|
+
...loopShared,
|
|
7214
|
+
event: z3.literal("failed_tests_rerun"),
|
|
7215
|
+
round: z3.number().int(),
|
|
7216
|
+
head: z3.string(),
|
|
7217
|
+
rerun_of: z3.string(),
|
|
7218
|
+
failed_files: z3.number().int().nonnegative(),
|
|
7219
|
+
affected_files: z3.number().int().nonnegative(),
|
|
7220
|
+
full_count: z3.number().int().nonnegative()
|
|
7221
|
+
}).strict(),
|
|
7222
|
+
z3.object({
|
|
7223
|
+
...loopShared,
|
|
7224
|
+
event: z3.literal("pr_opened"),
|
|
7225
|
+
round: z3.number().int(),
|
|
7226
|
+
pr: z3.number().int().positive(),
|
|
7227
|
+
head: z3.string()
|
|
7228
|
+
}).strict(),
|
|
7229
|
+
z3.object({
|
|
7230
|
+
...loopShared,
|
|
7231
|
+
event: z3.literal("ci_result_read"),
|
|
7232
|
+
round: z3.number().int(),
|
|
7233
|
+
pr: z3.number().int().positive(),
|
|
7234
|
+
head: z3.string(),
|
|
7235
|
+
conclusion: z3.enum(["green", "red", "pending", "skipped"]),
|
|
7236
|
+
failing_checks: z3.array(z3.string()),
|
|
7237
|
+
wait_ms: z3.number().nonnegative()
|
|
7238
|
+
}).strict(),
|
|
7239
|
+
z3.object({
|
|
7240
|
+
...loopShared,
|
|
7241
|
+
event: z3.literal("phase_time"),
|
|
7242
|
+
round: z3.number().int(),
|
|
7243
|
+
phase: z3.enum(["developer", "local_checks", "review", "push", "ci", "other"]),
|
|
7244
|
+
step: z3.string(),
|
|
7245
|
+
wall_ms: z3.number().nonnegative()
|
|
7246
|
+
}).strict(),
|
|
7183
7247
|
z3.object({
|
|
7184
7248
|
...loopShared,
|
|
7185
7249
|
event: z3.literal("driver_exited"),
|
|
@@ -7367,7 +7431,7 @@ var EffectEventSchema = z3.discriminatedUnion("event", [
|
|
|
7367
7431
|
]);
|
|
7368
7432
|
var CustomFieldValueSchema = z3.union([z3.string().max(CUSTOM_TEXT_MAX_LENGTH), z3.number().finite(), z3.boolean()]);
|
|
7369
7433
|
var customShared = {
|
|
7370
|
-
meta:
|
|
7434
|
+
meta: HeaderMetaSchema,
|
|
7371
7435
|
subject: SubjectSchema,
|
|
7372
7436
|
kind: z3.literal("custom"),
|
|
7373
7437
|
...envelopeTail
|
|
@@ -7452,7 +7516,7 @@ function buildHeader(input) {
|
|
|
7452
7516
|
const issue = subject.issue;
|
|
7453
7517
|
return {
|
|
7454
7518
|
meta: {
|
|
7455
|
-
schema:
|
|
7519
|
+
schema: 4,
|
|
7456
7520
|
ts: input.now.toISOString(),
|
|
7457
7521
|
run_id: input.runId,
|
|
7458
7522
|
seq: input.seq,
|
|
@@ -7489,6 +7553,15 @@ function buildHeader(input) {
|
|
|
7489
7553
|
version: lineageFieldFromEnv(input.env.flowVersion)
|
|
7490
7554
|
},
|
|
7491
7555
|
runtime: lineageFieldFromEnv(input.env.runtime),
|
|
7556
|
+
process: {
|
|
7557
|
+
id: lineageFieldFromEnv(input.env.processId) ?? "vinaya",
|
|
7558
|
+
version: lineageFieldFromEnv(input.env.processVersion),
|
|
7559
|
+
digest: lineageFieldFromEnv(input.env.processDigest)
|
|
7560
|
+
},
|
|
7561
|
+
runner: {
|
|
7562
|
+
id: lineageFieldFromEnv(input.env.runnerId) ?? "standalone",
|
|
7563
|
+
version: lineageFieldFromEnv(input.env.runnerVersion)
|
|
7564
|
+
},
|
|
7492
7565
|
source: lineageFieldFromEnv(input.env.source)
|
|
7493
7566
|
},
|
|
7494
7567
|
subject
|
|
@@ -7532,7 +7605,7 @@ function redact(value, home) {
|
|
|
7532
7605
|
return value;
|
|
7533
7606
|
}
|
|
7534
7607
|
// ../../packages/aeg-core/src/log/store.ts
|
|
7535
|
-
var KNOWN_SCHEMA_VERSIONS = [1, 2, 3];
|
|
7608
|
+
var KNOWN_SCHEMA_VERSIONS = [1, 2, 3, 4];
|
|
7536
7609
|
function metaOf(obj) {
|
|
7537
7610
|
if (obj === null || typeof obj !== "object")
|
|
7538
7611
|
return null;
|
|
@@ -7756,14 +7829,24 @@ var ResolutionRecordSchema = z4.object({
|
|
|
7756
7829
|
authenticatedFrom: z4.string().min(1),
|
|
7757
7830
|
consumedAt: isoTimestamp
|
|
7758
7831
|
}).strict();
|
|
7832
|
+
var ExecutionRoundMirrorRecordSchema = z4.object({
|
|
7833
|
+
version: z4.literal(1),
|
|
7834
|
+
kind: z4.literal("execution_round"),
|
|
7835
|
+
task: taskId,
|
|
7836
|
+
repository: z4.string().min(1),
|
|
7837
|
+
threadId: z4.string().min(1),
|
|
7838
|
+
checkpointId: z4.string().min(1),
|
|
7839
|
+
round: z4.number().int().positive(),
|
|
7840
|
+
recordedAt: isoTimestamp
|
|
7841
|
+
}).strict();
|
|
7759
7842
|
// ../../packages/aeg-core/src/control-store/local.ts
|
|
7760
7843
|
var CONTROL_AREA_DIRNAME = "control";
|
|
7761
7844
|
// src/lib/config.ts
|
|
7762
7845
|
import { execFile as execFile4, execFileSync as execFileSync2 } from "node:child_process";
|
|
7763
7846
|
import { promisify as promisify4 } from "node:util";
|
|
7764
|
-
import { existsSync, mkdirSync, readFileSync as readFileSync2, realpathSync as realpathSync2, writeFileSync } from "node:fs";
|
|
7847
|
+
import { existsSync, lstatSync, mkdirSync, readFileSync as readFileSync2, realpathSync as realpathSync2, writeFileSync } from "node:fs";
|
|
7765
7848
|
import { homedir } from "node:os";
|
|
7766
|
-
import { dirname, isAbsolute, join, resolve } from "node:path";
|
|
7849
|
+
import { basename as basename3, dirname, isAbsolute, join, resolve } from "node:path";
|
|
7767
7850
|
import { z as z6 } from "zod";
|
|
7768
7851
|
|
|
7769
7852
|
// src/checks/contract.ts
|
|
@@ -8226,7 +8309,8 @@ var VinayaConfigObjectSchema = z6.object({
|
|
|
8226
8309
|
codeReviewThreshold: z6.string().min(1).optional(),
|
|
8227
8310
|
securityThreshold: z6.string().min(1).optional(),
|
|
8228
8311
|
maxRounds: z6.number().optional(),
|
|
8229
|
-
maxTaskMinutes: z6.number().optional()
|
|
8312
|
+
maxTaskMinutes: z6.number().optional(),
|
|
8313
|
+
readyPushTimeoutMinutes: z6.number().optional()
|
|
8230
8314
|
}).optional(),
|
|
8231
8315
|
securityScan: z6.object({
|
|
8232
8316
|
command: z6.array(z6.string().min(1)).min(1)
|
|
@@ -8242,7 +8326,16 @@ var VinayaConfigObjectSchema = z6.object({
|
|
|
8242
8326
|
collisionThreshold: z6.number().int().nonnegative().optional()
|
|
8243
8327
|
}).optional(),
|
|
8244
8328
|
prePush: z6.object({
|
|
8245
|
-
alwaysRun: z6.array(z6.string()).optional()
|
|
8329
|
+
alwaysRun: z6.array(z6.string()).optional(),
|
|
8330
|
+
readyTests: z6.object({
|
|
8331
|
+
mode: z6.literal("ci"),
|
|
8332
|
+
workflow: z6.literal(".github/workflows/ci.yml"),
|
|
8333
|
+
check: z6.literal("Vinaya CI")
|
|
8334
|
+
}).strict().optional(),
|
|
8335
|
+
requiredCi: z6.object({
|
|
8336
|
+
workflow: z6.literal(".github/workflows/ci.yml"),
|
|
8337
|
+
check: z6.literal("Vinaya CI")
|
|
8338
|
+
}).strict().optional()
|
|
8246
8339
|
}).optional(),
|
|
8247
8340
|
report: z6.object({
|
|
8248
8341
|
commandTimeoutMs: z6.number().int().positive().optional()
|
|
@@ -8260,6 +8353,7 @@ var VinayaConfigObjectSchema = z6.object({
|
|
|
8260
8353
|
message: "logPublish is removed — telemetry is never posted to a tracker or a code host; configure `logs` instead (a folder or a server destination)"
|
|
8261
8354
|
}),
|
|
8262
8355
|
runtimeDir: z6.string().min(1).refine((v) => isAbsolute(v), { message: "runtimeDir: must be an absolute path" }).optional(),
|
|
8356
|
+
runner: z6.enum(["standalone", "atta-engine"]).optional(),
|
|
8263
8357
|
logs: z6.object({
|
|
8264
8358
|
folder: z6.string().min(1).refine((v) => isAbsolute(v), { message: "logs.folder: must be an absolute path" }).optional(),
|
|
8265
8359
|
url: z6.string().url().optional(),
|
|
@@ -8272,7 +8366,7 @@ var VinayaConfigObjectSchema = z6.object({
|
|
|
8272
8366
|
message: "logs: headers requires url"
|
|
8273
8367
|
}).refine((v) => v.readHeaders === undefined || v.url !== undefined, {
|
|
8274
8368
|
message: "logs: readHeaders requires url"
|
|
8275
|
-
}).optional(),
|
|
8369
|
+
}).or(z6.literal(false)).optional(),
|
|
8276
8370
|
decisionRecords: z6.object({
|
|
8277
8371
|
path: RepoRelativePathSchema
|
|
8278
8372
|
}).strict().optional()
|
|
@@ -8402,13 +8496,19 @@ function resolveReviewPolicy(config) {
|
|
|
8402
8496
|
if (!Number.isInteger(maxTaskMinutes) || maxTaskMinutes < 0) {
|
|
8403
8497
|
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.`);
|
|
8404
8498
|
}
|
|
8499
|
+
const readyPushTimeoutMinutes = raw.readyPushTimeoutMinutes ?? DEFAULT_READY_PUSH_TIMEOUT_MINUTES;
|
|
8500
|
+
if (!Number.isInteger(readyPushTimeoutMinutes) || readyPushTimeoutMinutes < 1) {
|
|
8501
|
+
throw new Error(`vinaya.config.json: reviewPolicy.readyPushTimeoutMinutes "${readyPushTimeoutMinutes}" is not a positive integer — fix the config, this never falls back to a default.`);
|
|
8502
|
+
}
|
|
8405
8503
|
return {
|
|
8406
8504
|
codeReviewThreshold,
|
|
8407
8505
|
securityThreshold,
|
|
8408
8506
|
maxRounds,
|
|
8409
|
-
maxTaskMinutes
|
|
8507
|
+
maxTaskMinutes,
|
|
8508
|
+
readyPushTimeoutMinutes
|
|
8410
8509
|
};
|
|
8411
8510
|
}
|
|
8511
|
+
var emittedLocalOverrideWarnings = new Set;
|
|
8412
8512
|
function resolveGateCutovers(config) {
|
|
8413
8513
|
const raw = config?.gateCutovers;
|
|
8414
8514
|
if (!raw)
|
|
@@ -8709,7 +8809,7 @@ function loadConfigChecked() {
|
|
|
8709
8809
|
var TOKENS_COLLECT_TRUST_PATH = join(GLOBAL_VINAYA_HOME, "tokens-collect-trust.json");
|
|
8710
8810
|
|
|
8711
8811
|
// src/lib/diff-evidence.ts
|
|
8712
|
-
import { execFileSync as
|
|
8812
|
+
import { execFileSync as execFileSync8 } from "node:child_process";
|
|
8713
8813
|
import { join as join10, relative as relative2, resolve as resolve2 } from "node:path";
|
|
8714
8814
|
|
|
8715
8815
|
// src/lib/forge-read.ts
|
|
@@ -8906,7 +9006,7 @@ function resolveNumber(issue, subjectLabel, runner) {
|
|
|
8906
9006
|
}
|
|
8907
9007
|
|
|
8908
9008
|
// src/lib/brief-assembly.ts
|
|
8909
|
-
import { execFileSync as
|
|
9009
|
+
import { execFileSync as execFileSync6 } from "node:child_process";
|
|
8910
9010
|
import { existsSync as existsSync5, readFileSync as readFileSync5, readdirSync as readdirSync2 } from "node:fs";
|
|
8911
9011
|
import { join as join5 } from "node:path";
|
|
8912
9012
|
|
|
@@ -9076,6 +9176,10 @@ var COMMANDS = [
|
|
|
9076
9176
|
needs: ["forge", "operator-seat"],
|
|
9077
9177
|
description: "One command from a planned Issue to a reviewed pull request — exactly one developer started",
|
|
9078
9178
|
flags: [
|
|
9179
|
+
{
|
|
9180
|
+
flag: "--runner <standalone|atta-engine>",
|
|
9181
|
+
description: "Override runner config for this invocation; absent uses config, whose default is standalone"
|
|
9182
|
+
},
|
|
9079
9183
|
{
|
|
9080
9184
|
flag: "--agent <claude|codex>",
|
|
9081
9185
|
description: "Vendor for the developer and both reviewers this run dispatches"
|
|
@@ -9087,17 +9191,39 @@ var COMMANDS = [
|
|
|
9087
9191
|
{
|
|
9088
9192
|
flag: "--widen-surface <glob,...> --reason <text>",
|
|
9089
9193
|
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"
|
|
9194
|
+
},
|
|
9195
|
+
{
|
|
9196
|
+
flag: "--rollback",
|
|
9197
|
+
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`"
|
|
9090
9198
|
}
|
|
9091
9199
|
],
|
|
9092
9200
|
details: [
|
|
9201
|
+
"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.",
|
|
9202
|
+
"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.",
|
|
9203
|
+
"`--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.",
|
|
9093
9204
|
"`--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.",
|
|
9094
|
-
"
|
|
9205
|
+
"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.",
|
|
9095
9206
|
"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.",
|
|
9096
9207
|
"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.",
|
|
9097
9208
|
"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`)."
|
|
9098
9209
|
],
|
|
9099
9210
|
status: "shipped"
|
|
9100
9211
|
},
|
|
9212
|
+
{
|
|
9213
|
+
name: "task switch",
|
|
9214
|
+
needs: ["forge"],
|
|
9215
|
+
description: "Change a task's agent or model by setting its Engine checkpoint aside, so the next `task run` is accepted",
|
|
9216
|
+
flags: [
|
|
9217
|
+
{ flag: "--issue <n>", description: "Address the task by its Issue number instead of `<tranche> <n>`" },
|
|
9218
|
+
{ flag: "--agent <claude|codex>", description: "Vendor the next `task run` of the task continues on" },
|
|
9219
|
+
{ flag: "--model <model>", description: "Model the next `task run` is meant to use; absent, the vendor default" }
|
|
9220
|
+
],
|
|
9221
|
+
details: [
|
|
9222
|
+
"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.",
|
|
9223
|
+
"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."
|
|
9224
|
+
],
|
|
9225
|
+
status: "shipped"
|
|
9226
|
+
},
|
|
9101
9227
|
{
|
|
9102
9228
|
name: "task status",
|
|
9103
9229
|
needs: ["forge"],
|
|
@@ -9812,7 +9938,8 @@ var StateSourceConfigSchema = z7.discriminatedUnion("kind", [
|
|
|
9812
9938
|
z7.object({ kind: z7.literal("file"), root: z7.string().optional() })
|
|
9813
9939
|
]);
|
|
9814
9940
|
// src/checks/edge-resolve.ts
|
|
9815
|
-
import {
|
|
9941
|
+
import { execFile as execFile5 } from "node:child_process";
|
|
9942
|
+
import { promisify as promisify5 } from "node:util";
|
|
9816
9943
|
|
|
9817
9944
|
// src/lib/github-rate-limit.ts
|
|
9818
9945
|
import { execFileSync as execFileSync4 } from "node:child_process";
|
|
@@ -9863,15 +9990,20 @@ ${message}` : message;
|
|
|
9863
9990
|
// src/checks/edge-resolve.ts
|
|
9864
9991
|
var DIRECT_ISSUE_REF = /#(\d+)/;
|
|
9865
9992
|
var issueCache = new Map;
|
|
9993
|
+
var execFileAsync5 = promisify5(execFile5);
|
|
9866
9994
|
var ISSUE_NOT_FOUND = /could not resolve to an issue/i;
|
|
9867
9995
|
function fetchIssueState(num, repo) {
|
|
9868
9996
|
const key = `${repo.owner}/${repo.repo}#${num}`;
|
|
9869
9997
|
const cached = issueCache.get(key);
|
|
9870
9998
|
if (cached)
|
|
9871
9999
|
return cached;
|
|
9872
|
-
|
|
10000
|
+
const out = readIssueOnce(num, repo).then((first) => first.readFailed ? readIssueOnce(num, repo) : first);
|
|
10001
|
+
issueCache.set(key, out);
|
|
10002
|
+
return out;
|
|
10003
|
+
}
|
|
10004
|
+
async function readIssueOnce(num, repo) {
|
|
9873
10005
|
try {
|
|
9874
|
-
const
|
|
10006
|
+
const { stdout } = await execFileAsync5("gh", [
|
|
9875
10007
|
"issue",
|
|
9876
10008
|
"view",
|
|
9877
10009
|
String(num),
|
|
@@ -9879,13 +10011,11 @@ function fetchIssueState(num, repo) {
|
|
|
9879
10011
|
`${repo.owner}/${repo.repo}`,
|
|
9880
10012
|
"--json",
|
|
9881
10013
|
"state,stateReason,closedByPullRequestsReferences"
|
|
9882
|
-
], { encoding: "utf8"
|
|
9883
|
-
|
|
10014
|
+
], { encoding: "utf8" });
|
|
10015
|
+
return { json: JSON.parse(stdout), readFailed: false };
|
|
9884
10016
|
} catch (err) {
|
|
9885
|
-
|
|
10017
|
+
return { json: null, readFailed: !ISSUE_NOT_FOUND.test(execErrorText(err)) };
|
|
9886
10018
|
}
|
|
9887
|
-
issueCache.set(key, out);
|
|
9888
|
-
return out;
|
|
9889
10019
|
}
|
|
9890
10020
|
var defaultResolveSiblingTranche = async (slug, repo) => {
|
|
9891
10021
|
let tranche;
|
|
@@ -9945,7 +10075,7 @@ async function resolveEdge(id, taskById, factsByTaskId, repo, resolveSibling = d
|
|
|
9945
10075
|
const direct = id.match(DIRECT_ISSUE_REF);
|
|
9946
10076
|
if (direct) {
|
|
9947
10077
|
const num = Number(direct[1]);
|
|
9948
|
-
const read = fetchIssueState(num, repo);
|
|
10078
|
+
const read = await fetchIssueState(num, repo);
|
|
9949
10079
|
return edgeFromIssueJson(num, read.json, read.readFailed);
|
|
9950
10080
|
}
|
|
9951
10081
|
const qualified = splitSlugQualifiedEdge(id);
|
|
@@ -10011,7 +10141,7 @@ function packageRoot(moduleUrl) {
|
|
|
10011
10141
|
}
|
|
10012
10142
|
|
|
10013
10143
|
// src/commands/doctrine.ts
|
|
10014
|
-
import { execFileSync as
|
|
10144
|
+
import { execFileSync as execFileSync5 } from "node:child_process";
|
|
10015
10145
|
import { existsSync as existsSync4, readdirSync, readFileSync as readFileSync4 } from "node:fs";
|
|
10016
10146
|
import { dirname as dirname3, join as join4, sep } from "node:path";
|
|
10017
10147
|
import matter4 from "gray-matter";
|
|
@@ -10037,7 +10167,7 @@ function resolveDoctrineRoot(pkg = packageRoot(import.meta.url), cwd = process.c
|
|
|
10037
10167
|
}
|
|
10038
10168
|
function gitToplevel(cwd) {
|
|
10039
10169
|
try {
|
|
10040
|
-
return
|
|
10170
|
+
return execFileSync5("git", ["-C", cwd, "rev-parse", "--show-toplevel"], {
|
|
10041
10171
|
encoding: "utf8",
|
|
10042
10172
|
stdio: ["ignore", "pipe", "pipe"]
|
|
10043
10173
|
}).trim();
|
|
@@ -10066,7 +10196,7 @@ var PACKAGED_TEMPLATE_PATH = join5(PACKAGE_ROOT, "aeg-root", "templates", "brief
|
|
|
10066
10196
|
var TEMPLATE_PATH = existsSync5(PACKAGED_TEMPLATE_PATH) ? PACKAGED_TEMPLATE_PATH : join5(PACKAGE_ROOT, "..", "..", "aeg-root", "templates", "brief-template.md");
|
|
10067
10197
|
function git(args) {
|
|
10068
10198
|
try {
|
|
10069
|
-
return
|
|
10199
|
+
return execFileSync6("git", args, { encoding: "utf8", stdio: ["ignore", "pipe", "ignore"] }).trim();
|
|
10070
10200
|
} catch {
|
|
10071
10201
|
return "";
|
|
10072
10202
|
}
|
|
@@ -10685,7 +10815,7 @@ function coreCheckRegistry() {
|
|
|
10685
10815
|
var CORE_CHECK_RING = Object.fromEntries(REGISTRY.map(([spec, ring]) => [spec.name, ring]));
|
|
10686
10816
|
|
|
10687
10817
|
// src/lib/log-sink.ts
|
|
10688
|
-
import { execFile as
|
|
10818
|
+
import { execFile as execFile6 } from "node:child_process";
|
|
10689
10819
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
10690
10820
|
import {
|
|
10691
10821
|
appendFileSync,
|
|
@@ -10694,7 +10824,7 @@ import {
|
|
|
10694
10824
|
existsSync as existsSync8,
|
|
10695
10825
|
fstatSync as fstatSync3,
|
|
10696
10826
|
mkdirSync as mkdirSync4,
|
|
10697
|
-
lstatSync as
|
|
10827
|
+
lstatSync as lstatSync3,
|
|
10698
10828
|
openSync as openSync4,
|
|
10699
10829
|
readFileSync as readFileSync8,
|
|
10700
10830
|
renameSync as renameSync2,
|
|
@@ -10703,10 +10833,10 @@ import {
|
|
|
10703
10833
|
} from "node:fs";
|
|
10704
10834
|
import { hostname as osHostname, homedir as homedir3 } from "node:os";
|
|
10705
10835
|
import { dirname as dirname7, join as join9 } from "node:path";
|
|
10706
|
-
import { promisify as
|
|
10836
|
+
import { promisify as promisify6 } from "node:util";
|
|
10707
10837
|
|
|
10708
10838
|
// src/lib/run-paths.ts
|
|
10709
|
-
import { execFileSync as
|
|
10839
|
+
import { execFileSync as execFileSync7 } from "node:child_process";
|
|
10710
10840
|
import { chmodSync, existsSync as existsSync6, realpathSync as realpathSync3 } from "node:fs";
|
|
10711
10841
|
import { dirname as dirname4, join as join7, resolve as resolvePath } from "node:path";
|
|
10712
10842
|
var TASKS_EXECUTION_DIRNAME = "tasks-execution";
|
|
@@ -10854,7 +10984,7 @@ function resolveRepoSync() {
|
|
|
10854
10984
|
}
|
|
10855
10985
|
let url;
|
|
10856
10986
|
try {
|
|
10857
|
-
url =
|
|
10987
|
+
url = execFileSync7("git", ["remote", "get-url", "origin"], {
|
|
10858
10988
|
encoding: "utf-8",
|
|
10859
10989
|
stdio: ["ignore", "pipe", "pipe"]
|
|
10860
10990
|
}).trim();
|
|
@@ -10918,7 +11048,7 @@ function appendLoopLogLine(path, line) {
|
|
|
10918
11048
|
import {
|
|
10919
11049
|
closeSync as closeSync3,
|
|
10920
11050
|
constants as fsConstants3,
|
|
10921
|
-
lstatSync,
|
|
11051
|
+
lstatSync as lstatSync2,
|
|
10922
11052
|
mkdirSync as mkdirSync3,
|
|
10923
11053
|
openSync as openSync3,
|
|
10924
11054
|
linkSync,
|
|
@@ -11089,7 +11219,7 @@ function removeQueueHead(path, cut) {
|
|
|
11089
11219
|
function queueBucketSize(path) {
|
|
11090
11220
|
let lstat;
|
|
11091
11221
|
try {
|
|
11092
|
-
lstat =
|
|
11222
|
+
lstat = lstatSync2(path);
|
|
11093
11223
|
} catch (err) {
|
|
11094
11224
|
if (!isEnoent(err))
|
|
11095
11225
|
throw err;
|
|
@@ -11256,6 +11386,7 @@ async function drainOutboxToWebhook(outboxTask, webhookUrl, headers, fetchTimeou
|
|
|
11256
11386
|
|
|
11257
11387
|
// src/lib/log-sink.ts
|
|
11258
11388
|
var OUTBOX_MAX_BYTES = 8 * 1024 * 1024;
|
|
11389
|
+
var LOG_FOLDER_ONLY_ENV = "VINAYA_LOG_FOLDER_ONLY";
|
|
11259
11390
|
function describeFolderFallback(reason) {
|
|
11260
11391
|
if (reason.kind === "anchor-unreadable") {
|
|
11261
11392
|
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`";
|
|
@@ -11295,6 +11426,9 @@ function logsCredentialMissing(headers, env) {
|
|
|
11295
11426
|
return false;
|
|
11296
11427
|
}
|
|
11297
11428
|
function resolveLogDestinationFrom(input) {
|
|
11429
|
+
if (input.localConfig?.logs === false || input.unattended && input.trustAnchorConfig?.logs === false) {
|
|
11430
|
+
return { kind: "none", reason: "logs: false disables Log recording" };
|
|
11431
|
+
}
|
|
11298
11432
|
const spoolDir = input.env.VINAYA_LOG_SPOOL_DIR;
|
|
11299
11433
|
if (spoolDir !== undefined && spoolDir.trim() !== "") {
|
|
11300
11434
|
return { kind: "folder", folder: spoolDir };
|
|
@@ -11314,6 +11448,10 @@ function resolveLogDestinationFrom(input) {
|
|
|
11314
11448
|
} else {
|
|
11315
11449
|
effective = local;
|
|
11316
11450
|
}
|
|
11451
|
+
if (input.folderOnly || input.env[LOG_FOLDER_ONLY_ENV] === "1") {
|
|
11452
|
+
const folder = effective && "folder" in effective && !isInsideRepo(effective.folder, input.repoRoot) ? effective.folder : input.defaultFolder;
|
|
11453
|
+
return { kind: "folder", folder };
|
|
11454
|
+
}
|
|
11317
11455
|
if (hostFromEnv(input.env) === "ci") {
|
|
11318
11456
|
if (effective && "url" in effective) {
|
|
11319
11457
|
if (logsCredentialMissing(effective.headers, input.env)) {
|
|
@@ -11338,21 +11476,51 @@ function resolveLogDestinationFrom(input) {
|
|
|
11338
11476
|
const folder = effective && "folder" in effective ? effective.folder : input.defaultFolder;
|
|
11339
11477
|
return fallbackReason ? { kind: "folder", folder, fallbackReason } : { kind: "folder", folder };
|
|
11340
11478
|
}
|
|
11341
|
-
var
|
|
11479
|
+
var LOG_DESTINATION_ANCHOR_RETRY_INTERVAL_MS = 30000;
|
|
11480
|
+
var LOG_DESTINATION_ANCHOR_MAX_RETRIES = 5;
|
|
11481
|
+
function createTrustAnchorCache(read, now = Date.now, bounds = {
|
|
11482
|
+
retryIntervalMs: LOG_DESTINATION_ANCHOR_RETRY_INTERVAL_MS,
|
|
11483
|
+
maxRetries: LOG_DESTINATION_ANCHOR_MAX_RETRIES
|
|
11484
|
+
}) {
|
|
11485
|
+
const slots = new Map;
|
|
11486
|
+
const start = (repoRoot, retries) => {
|
|
11487
|
+
const slot = {
|
|
11488
|
+
reading: Promise.resolve().then(read).catch(() => null),
|
|
11489
|
+
retries,
|
|
11490
|
+
missedAt: null
|
|
11491
|
+
};
|
|
11492
|
+
slots.set(repoRoot, slot);
|
|
11493
|
+
slot.reading.then((config) => {
|
|
11494
|
+
if (config === null)
|
|
11495
|
+
slot.missedAt = now();
|
|
11496
|
+
});
|
|
11497
|
+
return slot.reading;
|
|
11498
|
+
};
|
|
11499
|
+
return {
|
|
11500
|
+
get: (repoRoot) => {
|
|
11501
|
+
const slot = slots.get(repoRoot);
|
|
11502
|
+
if (slot === undefined)
|
|
11503
|
+
return start(repoRoot, 0);
|
|
11504
|
+
if (slot.missedAt === null)
|
|
11505
|
+
return slot.reading;
|
|
11506
|
+
if (slot.retries >= bounds.maxRetries || now() - slot.missedAt < bounds.retryIntervalMs)
|
|
11507
|
+
return slot.reading;
|
|
11508
|
+
return start(repoRoot, slot.retries + 1);
|
|
11509
|
+
},
|
|
11510
|
+
clear: () => slots.clear()
|
|
11511
|
+
};
|
|
11512
|
+
}
|
|
11513
|
+
var processTrustAnchorByRepo = createTrustAnchorCache(safeLoadTrustAnchorConfig);
|
|
11342
11514
|
function processTrustAnchor(repoRoot) {
|
|
11343
|
-
|
|
11344
|
-
if (cached !== undefined)
|
|
11345
|
-
return cached;
|
|
11346
|
-
const reading = safeLoadTrustAnchorConfig();
|
|
11347
|
-
processTrustAnchorByRepo.set(repoRoot, reading);
|
|
11348
|
-
return reading;
|
|
11515
|
+
return processTrustAnchorByRepo.get(repoRoot);
|
|
11349
11516
|
}
|
|
11350
|
-
async function defaultResolveLogDestination(repo, env) {
|
|
11517
|
+
async function defaultResolveLogDestination(repo, env, folderOnly = false) {
|
|
11351
11518
|
const localConfig = loadConfig();
|
|
11352
11519
|
const unattended = isUnattendedProcess(process.env);
|
|
11353
11520
|
const repoRoot = repoRootSync();
|
|
11354
11521
|
return resolveLogDestinationFrom({
|
|
11355
11522
|
localConfig,
|
|
11523
|
+
folderOnly,
|
|
11356
11524
|
trustAnchorConfig: unattended ? await processTrustAnchor(repoRoot) : null,
|
|
11357
11525
|
unattended,
|
|
11358
11526
|
env,
|
|
@@ -11361,14 +11529,16 @@ async function defaultResolveLogDestination(repo, env) {
|
|
|
11361
11529
|
});
|
|
11362
11530
|
}
|
|
11363
11531
|
function unresolvedLogDestination(env) {
|
|
11532
|
+
const loaded = loadConfig();
|
|
11533
|
+
if (loaded?.logs === false)
|
|
11534
|
+
return { kind: "none", reason: "logs: false disables Log recording" };
|
|
11364
11535
|
if (hostFromEnv(env) === "ci") {
|
|
11365
11536
|
return {
|
|
11366
11537
|
kind: "none",
|
|
11367
11538
|
reason: "the process ended before its log destination was resolved, and a CI job never records to a folder"
|
|
11368
11539
|
};
|
|
11369
11540
|
}
|
|
11370
|
-
const
|
|
11371
|
-
const localConfig = loaded?.logs?.url !== undefined ? { ...loaded, logs: undefined } : loaded;
|
|
11541
|
+
const localConfig = loaded?.logs && loaded.logs.url !== undefined ? { ...loaded, logs: undefined } : loaded;
|
|
11372
11542
|
const unattended = isUnattendedProcess(process.env);
|
|
11373
11543
|
const repoRoot = repoRootSync();
|
|
11374
11544
|
const runtimeDir = process.env[RUNTIME_DIR_ENV_KEY] || resolveRuntimeDir({ repo: null, localConfig, trustAnchorConfig: null, unattended, repoRoot });
|
|
@@ -11408,18 +11578,18 @@ function recordFolderFallback(repo, issue, reason, now, runtimeDir, stateRoot =
|
|
|
11408
11578
|
function isEnoent2(err) {
|
|
11409
11579
|
return typeof err === "object" && err !== null && err.code === "ENOENT";
|
|
11410
11580
|
}
|
|
11411
|
-
var
|
|
11581
|
+
var execFileAsync6 = promisify6(execFile6);
|
|
11412
11582
|
async function resolveDoctrine(cwd, vinayaVersion) {
|
|
11413
11583
|
let toplevel;
|
|
11414
11584
|
try {
|
|
11415
|
-
toplevel = (await
|
|
11585
|
+
toplevel = (await execFileAsync6("git", ["-C", cwd, "rev-parse", "--show-toplevel"], { encoding: "utf8" })).stdout.trim();
|
|
11416
11586
|
} catch (err) {
|
|
11417
11587
|
return isEnoent2(err) ? "unknown" : vinayaVersion;
|
|
11418
11588
|
}
|
|
11419
11589
|
if (!existsSync8(join9(toplevel, "aeg-root", "roles")))
|
|
11420
11590
|
return vinayaVersion;
|
|
11421
11591
|
try {
|
|
11422
|
-
const sha = (await
|
|
11592
|
+
const sha = (await execFileAsync6("git", ["-C", toplevel, "rev-parse", "HEAD:aeg-root"], { encoding: "utf8" })).stdout.trim();
|
|
11423
11593
|
return `aeg-root@${sha}`;
|
|
11424
11594
|
} catch {
|
|
11425
11595
|
return vinayaVersion;
|
|
@@ -11442,7 +11612,7 @@ var TRANCHE_ISSUE_LIST_LIMIT = 200;
|
|
|
11442
11612
|
async function issueForTrancheTask(tranche, taskId, cwd, repo) {
|
|
11443
11613
|
let stdout;
|
|
11444
11614
|
try {
|
|
11445
|
-
({ stdout } = await
|
|
11615
|
+
({ stdout } = await execFileAsync6("gh", [
|
|
11446
11616
|
"issue",
|
|
11447
11617
|
"list",
|
|
11448
11618
|
"--state",
|
|
@@ -11480,7 +11650,7 @@ async function issueForTrancheTask(tranche, taskId, cwd, repo) {
|
|
|
11480
11650
|
async function confirmBacklogIssue(issue, cwd, repo) {
|
|
11481
11651
|
let stdout;
|
|
11482
11652
|
try {
|
|
11483
|
-
({ stdout } = await
|
|
11653
|
+
({ stdout } = await execFileAsync6("gh", ["issue", "view", String(issue), "--json", "number", ...repo === null ? [] : ["--repo", repo]], {
|
|
11484
11654
|
cwd,
|
|
11485
11655
|
encoding: "utf8",
|
|
11486
11656
|
timeout: LOG_CONTEXT_LOOKUP_DEADLINE_MS,
|
|
@@ -11499,7 +11669,7 @@ async function confirmBacklogIssue(issue, cwd, repo) {
|
|
|
11499
11669
|
async function resolveBranchIssue(cwd, env = process.env, repo = null) {
|
|
11500
11670
|
let branch;
|
|
11501
11671
|
try {
|
|
11502
|
-
branch = (await
|
|
11672
|
+
branch = (await execFileAsync6("git", ["-C", cwd, "rev-parse", "--abbrev-ref", "HEAD"], {
|
|
11503
11673
|
encoding: "utf8",
|
|
11504
11674
|
timeout: LOG_CONTEXT_LOOKUP_DEADLINE_MS,
|
|
11505
11675
|
killSignal: "SIGKILL"
|
|
@@ -11582,7 +11752,7 @@ function headShaRead(key, read, shared) {
|
|
|
11582
11752
|
}
|
|
11583
11753
|
async function resolveHeadSha(cwd) {
|
|
11584
11754
|
try {
|
|
11585
|
-
const out = (await
|
|
11755
|
+
const out = (await execFileAsync6("git", ["-C", cwd, "rev-parse", "HEAD"], { encoding: "utf8" })).stdout.trim();
|
|
11586
11756
|
return /^[0-9a-f]{40}$/.test(out) ? out : null;
|
|
11587
11757
|
} catch {
|
|
11588
11758
|
return null;
|
|
@@ -11590,6 +11760,7 @@ async function resolveHeadSha(cwd) {
|
|
|
11590
11760
|
}
|
|
11591
11761
|
function defaultDeps() {
|
|
11592
11762
|
return {
|
|
11763
|
+
readConfig: loadConfig,
|
|
11593
11764
|
outboxRoot: () => join9(GLOBAL_VINAYA_HOME, "outbox"),
|
|
11594
11765
|
home: () => homedir3(),
|
|
11595
11766
|
hostname: () => osHostname(),
|
|
@@ -11773,23 +11944,59 @@ function createLogSink(overrides = {}) {
|
|
|
11773
11944
|
};
|
|
11774
11945
|
let contextCache;
|
|
11775
11946
|
let settledContext;
|
|
11947
|
+
let contextEnv = {};
|
|
11948
|
+
const resolveDestination = async (repo, env) => deps.readConfig()?.logs === false ? { kind: "none", reason: "logs: false disables Log recording" } : await deps.resolveLogDestination(repo, env, deps.folderOnly);
|
|
11776
11949
|
const context = () => {
|
|
11777
11950
|
if (contextCache === undefined) {
|
|
11778
11951
|
const env = deps.env();
|
|
11952
|
+
contextEnv = env;
|
|
11779
11953
|
contextCache = Promise.all([
|
|
11780
11954
|
withDeadline(resolveRepoOnce(), LOG_CONTEXT_LOOKUP_DEADLINE_MS, null),
|
|
11781
11955
|
doctrine()
|
|
11782
11956
|
]).then(async ([resolved, doctrineValue]) => {
|
|
11783
11957
|
const repo = resolved && isSafeRepoSegment3(resolved.owner) && isSafeRepoSegment3(resolved.repo) ? resolved : null;
|
|
11784
|
-
settledContext = { repo, doctrine: doctrineValue, destination: await
|
|
11958
|
+
settledContext = { repo, doctrine: doctrineValue, destination: await resolveDestination(repo, env) };
|
|
11959
|
+
destinationRetryDueAt = deps.now().getTime() + LOG_DESTINATION_ANCHOR_RETRY_INTERVAL_MS;
|
|
11785
11960
|
return settledContext;
|
|
11786
11961
|
});
|
|
11787
11962
|
}
|
|
11788
11963
|
return contextCache;
|
|
11789
11964
|
};
|
|
11965
|
+
let destinationRetries = 0;
|
|
11966
|
+
let destinationRetryDueAt = 0;
|
|
11967
|
+
let destinationRetryInFlight = false;
|
|
11968
|
+
const retryDestinationIfDue = (ctx) => {
|
|
11969
|
+
if (ctx.destination.kind !== "folder" || ctx.destination.fallbackReason?.kind !== "anchor-unreadable")
|
|
11970
|
+
return;
|
|
11971
|
+
if (destinationRetryInFlight || destinationRetries >= LOG_DESTINATION_ANCHOR_MAX_RETRIES)
|
|
11972
|
+
return;
|
|
11973
|
+
if (deps.now().getTime() < destinationRetryDueAt)
|
|
11974
|
+
return;
|
|
11975
|
+
destinationRetryInFlight = true;
|
|
11976
|
+
destinationRetries++;
|
|
11977
|
+
const generation = contextCache;
|
|
11978
|
+
Promise.resolve().then(() => resolveDestination(ctx.repo, contextEnv)).then((destination) => {
|
|
11979
|
+
if (contextCache !== generation)
|
|
11980
|
+
return;
|
|
11981
|
+
if (destination.kind === "server") {
|
|
11982
|
+
settledContext = { ...ctx, destination };
|
|
11983
|
+
contextCache = Promise.resolve(settledContext);
|
|
11984
|
+
return;
|
|
11985
|
+
}
|
|
11986
|
+
if (destination.kind !== "folder" || destination.fallbackReason?.kind !== "anchor-unreadable") {
|
|
11987
|
+
destinationRetries = LOG_DESTINATION_ANCHOR_MAX_RETRIES;
|
|
11988
|
+
}
|
|
11989
|
+
}, () => {
|
|
11990
|
+
return;
|
|
11991
|
+
}).finally(() => {
|
|
11992
|
+
destinationRetryInFlight = false;
|
|
11993
|
+
destinationRetryDueAt = deps.now().getTime() + LOG_DESTINATION_ANCHOR_RETRY_INTERVAL_MS;
|
|
11994
|
+
});
|
|
11995
|
+
};
|
|
11790
11996
|
const resetContext = () => {
|
|
11791
11997
|
contextCache = undefined;
|
|
11792
11998
|
settledContext = undefined;
|
|
11999
|
+
destinationRetries = 0;
|
|
11793
12000
|
};
|
|
11794
12001
|
let drainChain = Promise.resolve();
|
|
11795
12002
|
const pendingWrites = new Set;
|
|
@@ -11802,24 +12009,30 @@ function createLogSink(overrides = {}) {
|
|
|
11802
12009
|
`);
|
|
11803
12010
|
});
|
|
11804
12011
|
};
|
|
11805
|
-
const snapshot = () => {
|
|
12012
|
+
const snapshot = (attribution) => {
|
|
11806
12013
|
const env = deps.env();
|
|
11807
12014
|
return {
|
|
12015
|
+
attributed: attribution !== undefined,
|
|
11808
12016
|
host: hostFromEnv(env),
|
|
11809
12017
|
now: deps.now(),
|
|
11810
12018
|
seq: seq++,
|
|
11811
12019
|
envFields: {
|
|
11812
|
-
role: env.VINAYA_ROLE,
|
|
12020
|
+
role: attribution?.role ?? env.VINAYA_ROLE,
|
|
11813
12021
|
task: env.VINAYA_TASK,
|
|
11814
|
-
round: env.VINAYA_ROUND,
|
|
12022
|
+
round: attribution ? String(attribution.round) : env.VINAYA_ROUND,
|
|
11815
12023
|
pr: env.VINAYA_PR,
|
|
11816
12024
|
run: env.VINAYA_RUN || runId,
|
|
11817
|
-
attempt: env.VINAYA_ATTEMPT,
|
|
12025
|
+
attempt: attribution ? String(attribution.attempt) : env.VINAYA_ATTEMPT,
|
|
11818
12026
|
parent: env.VINAYA_PARENT_EVENT,
|
|
11819
12027
|
workRef: env.VINAYA_WORK_REF,
|
|
11820
12028
|
flow: env.VINAYA_FLOW,
|
|
11821
12029
|
flowVersion: env.VINAYA_FLOW_VERSION,
|
|
11822
12030
|
runtime: env.VINAYA_RUNTIME,
|
|
12031
|
+
processId: env.VINAYA_PROCESS_ID,
|
|
12032
|
+
processVersion: env.VINAYA_PROCESS_VERSION,
|
|
12033
|
+
processDigest: env.VINAYA_PROCESS_DIGEST,
|
|
12034
|
+
runnerId: env.VINAYA_RUNNER_ID,
|
|
12035
|
+
runnerVersion: env.VINAYA_RUNNER_VERSION,
|
|
11823
12036
|
source: env.VINAYA_SOURCE
|
|
11824
12037
|
}
|
|
11825
12038
|
};
|
|
@@ -11849,7 +12062,7 @@ function createLogSink(overrides = {}) {
|
|
|
11849
12062
|
eventId: randomUUID2(),
|
|
11850
12063
|
processId,
|
|
11851
12064
|
revision: headSha,
|
|
11852
|
-
provenance: deps.provenance,
|
|
12065
|
+
provenance: call.attributed ? "parent_attributed" : deps.provenance,
|
|
11853
12066
|
inputVersions: deps.inputVersions()
|
|
11854
12067
|
});
|
|
11855
12068
|
const header = headSha === null ? built : { ...built, subject: { ...built.subject, sha: headSha } };
|
|
@@ -11874,11 +12087,14 @@ function createLogSink(overrides = {}) {
|
|
|
11874
12087
|
appendLine(outboxPathFor({ outboxRoot: () => destination.folder }, repo, header.subject.issue), line, warnOnce);
|
|
11875
12088
|
}
|
|
11876
12089
|
};
|
|
11877
|
-
function log(e) {
|
|
12090
|
+
function log(e, attribution) {
|
|
11878
12091
|
try {
|
|
11879
|
-
const call = snapshot();
|
|
12092
|
+
const call = snapshot(attribution);
|
|
11880
12093
|
const write = async () => {
|
|
11881
12094
|
const ctx = await context();
|
|
12095
|
+
try {
|
|
12096
|
+
retryDestinationIfDue(ctx);
|
|
12097
|
+
} catch {}
|
|
11882
12098
|
if (ctx.destination.kind === "none") {
|
|
11883
12099
|
writeEvent(e, call, ctx, null, null, true);
|
|
11884
12100
|
return;
|
|
@@ -11902,9 +12118,13 @@ function createLogSink(overrides = {}) {
|
|
|
11902
12118
|
function logSync(e, opts = {}) {
|
|
11903
12119
|
try {
|
|
11904
12120
|
const call = snapshot();
|
|
11905
|
-
let ctx =
|
|
12121
|
+
let ctx = deps.readConfig()?.logs === false ? {
|
|
12122
|
+
repo: null,
|
|
12123
|
+
doctrine: "unknown",
|
|
12124
|
+
destination: { kind: "none", reason: "logs: false disables Log recording" }
|
|
12125
|
+
} : settledContext;
|
|
11906
12126
|
if (ctx === undefined) {
|
|
11907
|
-
const destination = deps.unresolvedLogDestination(deps.env());
|
|
12127
|
+
const destination = deps.readConfig()?.logs === false ? { kind: "none", reason: "logs: false disables Log recording" } : deps.unresolvedLogDestination(deps.env());
|
|
11908
12128
|
if (destination.kind === "folder" && !opts.quiet) {
|
|
11909
12129
|
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
|
|
11910
12130
|
`);
|
|
@@ -11982,7 +12202,7 @@ function parseChangedLineRanges(diffOutput) {
|
|
|
11982
12202
|
function fileDiffAgainst(ref, path) {
|
|
11983
12203
|
let committed;
|
|
11984
12204
|
try {
|
|
11985
|
-
committed =
|
|
12205
|
+
committed = execFileSync8("git", ["diff", `${ref}...HEAD`, "--", path], {
|
|
11986
12206
|
encoding: "utf8",
|
|
11987
12207
|
stdio: ["ignore", "pipe", "pipe"]
|
|
11988
12208
|
}).trim();
|
|
@@ -12003,7 +12223,7 @@ function stagedDiff(args) {
|
|
|
12003
12223
|
if (!readsStagedDiff())
|
|
12004
12224
|
return "";
|
|
12005
12225
|
try {
|
|
12006
|
-
return
|
|
12226
|
+
return execFileSync8("git", ["diff", "--cached", ...args], {
|
|
12007
12227
|
encoding: "utf8",
|
|
12008
12228
|
stdio: ["ignore", "pipe", "pipe"]
|
|
12009
12229
|
}).trim();
|
|
@@ -12013,7 +12233,7 @@ function stagedDiff(args) {
|
|
|
12013
12233
|
}
|
|
12014
12234
|
function revParse(ref) {
|
|
12015
12235
|
try {
|
|
12016
|
-
return
|
|
12236
|
+
return execFileSync8("git", ["rev-parse", "--verify", ref], {
|
|
12017
12237
|
encoding: "utf8",
|
|
12018
12238
|
stdio: ["ignore", "pipe", "pipe"]
|
|
12019
12239
|
}).trim();
|
|
@@ -12023,7 +12243,7 @@ function revParse(ref) {
|
|
|
12023
12243
|
}
|
|
12024
12244
|
function repoRoot() {
|
|
12025
12245
|
try {
|
|
12026
|
-
return
|
|
12246
|
+
return execFileSync8("git", ["rev-parse", "--show-toplevel"], {
|
|
12027
12247
|
encoding: "utf8",
|
|
12028
12248
|
stdio: ["ignore", "pipe", "pipe"]
|
|
12029
12249
|
}).trim();
|
|
@@ -12034,7 +12254,7 @@ function repoRoot() {
|
|
|
12034
12254
|
function changedFiles(base) {
|
|
12035
12255
|
let out;
|
|
12036
12256
|
try {
|
|
12037
|
-
out =
|
|
12257
|
+
out = execFileSync8("git", ["diff", "--name-only", `${base}...HEAD`], {
|
|
12038
12258
|
encoding: "utf8",
|
|
12039
12259
|
stdio: ["ignore", "pipe", "pipe"]
|
|
12040
12260
|
}).trim();
|
|
@@ -12083,7 +12303,7 @@ function resolveAddedFiles(base = process.env.BASE_SHA || "origin/main") {
|
|
|
12083
12303
|
if (resolved === null || resolved === head)
|
|
12084
12304
|
continue;
|
|
12085
12305
|
try {
|
|
12086
|
-
const out =
|
|
12306
|
+
const out = execFileSync8("git", ["diff", "--name-only", "--diff-filter=A", `${ref}...HEAD`], {
|
|
12087
12307
|
encoding: "utf8",
|
|
12088
12308
|
stdio: ["ignore", "pipe", "pipe"]
|
|
12089
12309
|
}).trim();
|
|
@@ -12126,7 +12346,7 @@ var DOCTRINE_ROOT = loadConfig()?.proseGates?.doctrineRoot ?? "aeg-root";
|
|
|
12126
12346
|
var SHIPS_PREFIX2 = `${DOCTRINE_ROOT}/`;
|
|
12127
12347
|
function git2(args) {
|
|
12128
12348
|
try {
|
|
12129
|
-
return
|
|
12349
|
+
return execFileSync9("git", args, { encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] });
|
|
12130
12350
|
} catch {
|
|
12131
12351
|
return "";
|
|
12132
12352
|
}
|