@attalabs/vinaya 0.34.0 → 0.35.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/LICENSE +104 -201
- package/README.md +1 -1
- package/aeg-root/roles/planner/reference.md +1 -1
- package/dist/checks/bin/check-body-bare-digits.js +5 -2
- package/dist/checks/bin/check-branch-topology.js +13 -0
- package/dist/checks/bin/check-brief-shape.js +5 -2
- package/dist/checks/bin/check-changeset-coverage.js +38 -5
- package/dist/checks/bin/check-closes-n.js +13 -0
- package/dist/checks/bin/check-coherence.js +16 -2
- package/dist/checks/bin/check-dead-branch-push.js +2 -0
- package/dist/checks/bin/check-dispatch-readiness.js +16 -2
- package/dist/checks/bin/check-doc-coverage-push.js +38 -5
- package/dist/checks/bin/check-doc-coverage.js +38 -5
- package/dist/checks/bin/check-doctrine-no-procedures.js +5 -2
- package/dist/checks/bin/check-doctrine-portability.js +38 -5
- package/dist/checks/bin/check-evidence-fresh.js +38 -5
- package/dist/checks/bin/check-exec-bits.js +38 -5
- package/dist/checks/bin/check-first-push-dispatch.js +16 -2
- package/dist/checks/bin/check-issue-assignment.js +13 -0
- package/dist/checks/bin/check-issue-milestone-attach.js +2 -0
- package/dist/checks/bin/check-issue-objectives-numbering.js +5 -2
- package/dist/checks/bin/check-issue-parts-coverage.js +2 -0
- package/dist/checks/bin/check-issue-surface-globs.js +16 -2
- package/dist/checks/bin/check-issue-title-grammar.js +2 -0
- package/dist/checks/bin/check-issue-tranche-label.js +2 -0
- package/dist/checks/bin/check-main-branch-refusal.js +2 -0
- package/dist/checks/bin/check-no-disk-state.js +2 -0
- package/dist/checks/bin/check-pr-premise-reassert.js +5 -2
- package/dist/checks/bin/check-pr-report-density.js +2 -0
- package/dist/checks/bin/check-principal-test-plan-wait.js +2 -0
- package/dist/checks/bin/check-quoted-command.js +38 -5
- package/dist/checks/bin/check-reader-resolvable-prose.js +38 -5
- package/dist/checks/bin/check-registry-gates.js +2 -0
- package/dist/checks/bin/check-retired-vocabulary.js +38 -5
- package/dist/checks/bin/check-review-gate.js +5 -2
- package/dist/checks/bin/check-single-plan-pr.js +2 -0
- package/dist/checks/bin/check-surface-scope.js +13 -0
- package/dist/checks/bin/check-test-plan.js +2 -0
- package/dist/checks/bin/check-token-collection-wired.js +2 -0
- package/dist/checks/bin/check-token-report.js +2 -0
- package/dist/checks/bin/check-workspace-escape.js +38 -5
- package/dist/index.js +308 -113
- package/dist/lib/pre-push-cache-test-run.js +36 -5
- package/dist/lib/pre-push-select-tests.js +3 -2
- package/package.json +2 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-render.ts +153 -37
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-validation.ts +87 -24
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/coherence-checks.ts +9 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/assess-round.ts +7 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/render-summary.ts +28 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/gate-cutovers.ts +49 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/index.ts +12 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/issue-validation.ts +138 -54
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/envelope.ts +26 -3
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/objectives-cutover-config.ts +31 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/objectives.ts +15 -6
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/reader-resolvable-prose.ts +122 -23
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/task-tools.ts +38 -3
- 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/api/coherence/route.js.nft.json +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/[root-of-the-server]__02a-3g8._.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]__074w9nf._.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]__07uhu5z._.js → [root-of-the-server]__0zc_0gx._.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]__1wc4-ip._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_08onyya._.js +1 -1
- 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 +1 -1
- 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/_15gdg48._.js +2 -2
- 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/{2174nz5he_oc4.js → 3goaig_rysc6p.js} +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{0q9p7c6vn-x2w.js → 3ip5z3cf43bgo.js} +4 -4
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{3xnma0-359j17.js → 3u9emqjwpd0t9.js} +1 -1
- package/studio-standalone/apps/vinaya-studio/web/package.json +2 -2
- /package/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/{aeg-core → vinaya/studio-standalone/_node_modules/@attalabs/aeg-core}/bin/verify-coherence.ts +0 -0
- /package/studio-standalone/apps/vinaya-studio/web/.next/static/{HmoeqXdX1E4drt7GReFOO → ca66rAHI_w9D7S7ceXDvR}/_buildManifest.js +0 -0
- /package/studio-standalone/apps/vinaya-studio/web/.next/static/{HmoeqXdX1E4drt7GReFOO → ca66rAHI_w9D7S7ceXDvR}/_clientMiddlewareManifest.js +0 -0
- /package/studio-standalone/apps/vinaya-studio/web/.next/static/{HmoeqXdX1E4drt7GReFOO → ca66rAHI_w9D7S7ceXDvR}/_ssgManifest.js +0 -0
|
@@ -3507,6 +3507,8 @@ function parseIssueSurface(body) {
|
|
|
3507
3507
|
function globCoversPath(glob, path) {
|
|
3508
3508
|
const g = glob.replace(/\/\*\*?$/, "").replace(/\/+$/, "");
|
|
3509
3509
|
const p = path.replace(/\/+$/, "");
|
|
3510
|
+
if (g === "*")
|
|
3511
|
+
return !p.includes("/");
|
|
3510
3512
|
return g === p || g.startsWith(`${p}/`) || p.startsWith(`${g}/`);
|
|
3511
3513
|
}
|
|
3512
3514
|
function checkSurfaceGlobsResolve(body, resolvesToFile) {
|
|
@@ -7057,6 +7059,17 @@ var COMMANDS = [
|
|
|
7057
7059
|
"issue-711 O4: this command — `--task <n>`, `--resume <pr>`, `--cancel <pr>` alike — stays `task run`'s own one-shot debug/direct entry; the watching driver that survives a pause and continues on its own is `task run`'s (see that command's own entry)."
|
|
7058
7060
|
],
|
|
7059
7061
|
status: "shipped"
|
|
7062
|
+
},
|
|
7063
|
+
{
|
|
7064
|
+
name: "log send",
|
|
7065
|
+
description: "Deliver this repository's locally-held log events to the configured `logs.url` server, once",
|
|
7066
|
+
flags: [{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }],
|
|
7067
|
+
details: [
|
|
7068
|
+
"For a run whose events ended up on local disk instead of the configured server — an unattended run that fell back to the local folder because the trust-anchor read could not confirm its `logs.url` (a developer machine slower than the read deadline, or genuinely offline), or a retry queue holding a backlog or a `.draining.ndjson` a dead drain left behind. It moves the local folder's events into the retry queue and drains every queue for this repository through the SAME webhook delivery a live event uses.",
|
|
7069
|
+
"It resolves the destination exactly the way a normal event does — the sink's own decision over `vinaya.config.json`'s `logs` setting, trust-anchor-gated for an unattended caller — never a URL passed on the command line. A repository whose destination is a folder (or none) has nothing to send to a server and the command says so.",
|
|
7070
|
+
"Safe to run more than once: the server stores events by `event_id` and ignores one it already holds, so a re-sent chunk creates no duplicate, and a second run finds the folder emptied and the queue drained."
|
|
7071
|
+
],
|
|
7072
|
+
status: "shipped"
|
|
7060
7073
|
}
|
|
7061
7074
|
];
|
|
7062
7075
|
// ../../packages/sources/src/forge-adapter.ts
|
|
@@ -7470,7 +7483,8 @@ async function trustAnchorRepoAsync() {
|
|
|
7470
7483
|
try {
|
|
7471
7484
|
const { stdout } = await execFileAsync4("git", ["remote", "get-url", "origin"], {
|
|
7472
7485
|
encoding: "utf-8",
|
|
7473
|
-
timeout: 1e4
|
|
7486
|
+
timeout: 1e4,
|
|
7487
|
+
killSignal: "SIGKILL"
|
|
7474
7488
|
});
|
|
7475
7489
|
return trustAnchorRepoFromRemoteUrl(stdout);
|
|
7476
7490
|
} catch {
|
|
@@ -7531,7 +7545,7 @@ async function ghFetchTrustAnchorConfigAsync() {
|
|
|
7531
7545
|
const repo = await trustAnchorRepoAsync();
|
|
7532
7546
|
if (!repo)
|
|
7533
7547
|
throw new Error("could not resolve repo identity for the trust-anchor read");
|
|
7534
|
-
const { stdout } = await execFileAsync4("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], { encoding: "utf-8", timeout: 1e4 });
|
|
7548
|
+
const { stdout } = await execFileAsync4("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], { encoding: "utf-8", timeout: 1e4, killSignal: "SIGKILL" });
|
|
7535
7549
|
return stdout;
|
|
7536
7550
|
}
|
|
7537
7551
|
function firstLine(err) {
|
|
@@ -3507,6 +3507,8 @@ function parseIssueSurface(body) {
|
|
|
3507
3507
|
function globCoversPath(glob, path) {
|
|
3508
3508
|
const g = glob.replace(/\/\*\*?$/, "").replace(/\/+$/, "");
|
|
3509
3509
|
const p = path.replace(/\/+$/, "");
|
|
3510
|
+
if (g === "*")
|
|
3511
|
+
return !p.includes("/");
|
|
3510
3512
|
return g === p || g.startsWith(`${p}/`) || p.startsWith(`${g}/`);
|
|
3511
3513
|
}
|
|
3512
3514
|
function checkSurfaceGlobsResolve(body, resolvesToFile) {
|
|
@@ -7057,6 +7059,17 @@ var COMMANDS = [
|
|
|
7057
7059
|
"issue-711 O4: this command — `--task <n>`, `--resume <pr>`, `--cancel <pr>` alike — stays `task run`'s own one-shot debug/direct entry; the watching driver that survives a pause and continues on its own is `task run`'s (see that command's own entry)."
|
|
7058
7060
|
],
|
|
7059
7061
|
status: "shipped"
|
|
7062
|
+
},
|
|
7063
|
+
{
|
|
7064
|
+
name: "log send",
|
|
7065
|
+
description: "Deliver this repository's locally-held log events to the configured `logs.url` server, once",
|
|
7066
|
+
flags: [{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }],
|
|
7067
|
+
details: [
|
|
7068
|
+
"For a run whose events ended up on local disk instead of the configured server — an unattended run that fell back to the local folder because the trust-anchor read could not confirm its `logs.url` (a developer machine slower than the read deadline, or genuinely offline), or a retry queue holding a backlog or a `.draining.ndjson` a dead drain left behind. It moves the local folder's events into the retry queue and drains every queue for this repository through the SAME webhook delivery a live event uses.",
|
|
7069
|
+
"It resolves the destination exactly the way a normal event does — the sink's own decision over `vinaya.config.json`'s `logs` setting, trust-anchor-gated for an unattended caller — never a URL passed on the command line. A repository whose destination is a folder (or none) has nothing to send to a server and the command says so.",
|
|
7070
|
+
"Safe to run more than once: the server stores events by `event_id` and ignores one it already holds, so a re-sent chunk creates no duplicate, and a second run finds the folder emptied and the queue drained."
|
|
7071
|
+
],
|
|
7072
|
+
status: "shipped"
|
|
7060
7073
|
}
|
|
7061
7074
|
];
|
|
7062
7075
|
// ../../packages/sources/src/forge-adapter.ts
|
|
@@ -3504,6 +3504,8 @@ function parseIssueSurface(body) {
|
|
|
3504
3504
|
function globCoversPath(glob, path) {
|
|
3505
3505
|
const g = glob.replace(/\/\*\*?$/, "").replace(/\/+$/, "");
|
|
3506
3506
|
const p = path.replace(/\/+$/, "");
|
|
3507
|
+
if (g === "*")
|
|
3508
|
+
return !p.includes("/");
|
|
3507
3509
|
return g === p || g.startsWith(`${p}/`) || p.startsWith(`${g}/`);
|
|
3508
3510
|
}
|
|
3509
3511
|
function checkSurfaceGlobsResolve(body, resolvesToFile) {
|
|
@@ -3504,6 +3504,8 @@ function parseIssueSurface(body) {
|
|
|
3504
3504
|
function globCoversPath(glob, path) {
|
|
3505
3505
|
const g = glob.replace(/\/\*\*?$/, "").replace(/\/+$/, "");
|
|
3506
3506
|
const p = path.replace(/\/+$/, "");
|
|
3507
|
+
if (g === "*")
|
|
3508
|
+
return !p.includes("/");
|
|
3507
3509
|
return g === p || g.startsWith(`${p}/`) || p.startsWith(`${g}/`);
|
|
3508
3510
|
}
|
|
3509
3511
|
function checkSurfaceGlobsResolve(body, resolvesToFile) {
|
|
@@ -6759,7 +6761,8 @@ async function trustAnchorRepoAsync() {
|
|
|
6759
6761
|
try {
|
|
6760
6762
|
const { stdout } = await execFileAsync4("git", ["remote", "get-url", "origin"], {
|
|
6761
6763
|
encoding: "utf-8",
|
|
6762
|
-
timeout: 1e4
|
|
6764
|
+
timeout: 1e4,
|
|
6765
|
+
killSignal: "SIGKILL"
|
|
6763
6766
|
});
|
|
6764
6767
|
return trustAnchorRepoFromRemoteUrl(stdout);
|
|
6765
6768
|
} catch {
|
|
@@ -6820,7 +6823,7 @@ async function ghFetchTrustAnchorConfigAsync() {
|
|
|
6820
6823
|
const repo = await trustAnchorRepoAsync();
|
|
6821
6824
|
if (!repo)
|
|
6822
6825
|
throw new Error("could not resolve repo identity for the trust-anchor read");
|
|
6823
|
-
const { stdout } = await execFileAsync4("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], { encoding: "utf-8", timeout: 1e4 });
|
|
6826
|
+
const { stdout } = await execFileAsync4("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], { encoding: "utf-8", timeout: 1e4, killSignal: "SIGKILL" });
|
|
6824
6827
|
return stdout;
|
|
6825
6828
|
}
|
|
6826
6829
|
function firstLine(err) {
|
|
@@ -3504,6 +3504,8 @@ function parseIssueSurface(body) {
|
|
|
3504
3504
|
function globCoversPath(glob, path) {
|
|
3505
3505
|
const g = glob.replace(/\/\*\*?$/, "").replace(/\/+$/, "");
|
|
3506
3506
|
const p = path.replace(/\/+$/, "");
|
|
3507
|
+
if (g === "*")
|
|
3508
|
+
return !p.includes("/");
|
|
3507
3509
|
return g === p || g.startsWith(`${p}/`) || p.startsWith(`${g}/`);
|
|
3508
3510
|
}
|
|
3509
3511
|
function checkSurfaceGlobsResolve(body, resolvesToFile) {
|
|
@@ -3504,6 +3504,8 @@ function parseIssueSurface(body) {
|
|
|
3504
3504
|
function globCoversPath(glob, path) {
|
|
3505
3505
|
const g = glob.replace(/\/\*\*?$/, "").replace(/\/+$/, "");
|
|
3506
3506
|
const p = path.replace(/\/+$/, "");
|
|
3507
|
+
if (g === "*")
|
|
3508
|
+
return !p.includes("/");
|
|
3507
3509
|
return g === p || g.startsWith(`${p}/`) || p.startsWith(`${g}/`);
|
|
3508
3510
|
}
|
|
3509
3511
|
function checkSurfaceGlobsResolve(body, resolvesToFile) {
|
|
@@ -7084,6 +7086,17 @@ var COMMANDS = [
|
|
|
7084
7086
|
"issue-711 O4: this command — `--task <n>`, `--resume <pr>`, `--cancel <pr>` alike — stays `task run`'s own one-shot debug/direct entry; the watching driver that survives a pause and continues on its own is `task run`'s (see that command's own entry)."
|
|
7085
7087
|
],
|
|
7086
7088
|
status: "shipped"
|
|
7089
|
+
},
|
|
7090
|
+
{
|
|
7091
|
+
name: "log send",
|
|
7092
|
+
description: "Deliver this repository's locally-held log events to the configured `logs.url` server, once",
|
|
7093
|
+
flags: [{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }],
|
|
7094
|
+
details: [
|
|
7095
|
+
"For a run whose events ended up on local disk instead of the configured server — an unattended run that fell back to the local folder because the trust-anchor read could not confirm its `logs.url` (a developer machine slower than the read deadline, or genuinely offline), or a retry queue holding a backlog or a `.draining.ndjson` a dead drain left behind. It moves the local folder's events into the retry queue and drains every queue for this repository through the SAME webhook delivery a live event uses.",
|
|
7096
|
+
"It resolves the destination exactly the way a normal event does — the sink's own decision over `vinaya.config.json`'s `logs` setting, trust-anchor-gated for an unattended caller — never a URL passed on the command line. A repository whose destination is a folder (or none) has nothing to send to a server and the command says so.",
|
|
7097
|
+
"Safe to run more than once: the server stores events by `event_id` and ignores one it already holds, so a re-sent chunk creates no duplicate, and a second run finds the folder emptied and the queue drained."
|
|
7098
|
+
],
|
|
7099
|
+
status: "shipped"
|
|
7087
7100
|
}
|
|
7088
7101
|
];
|
|
7089
7102
|
// ../../packages/sources/src/forge-adapter.ts
|
|
@@ -7608,7 +7621,8 @@ async function trustAnchorRepoAsync() {
|
|
|
7608
7621
|
try {
|
|
7609
7622
|
const { stdout } = await execFileAsync4("git", ["remote", "get-url", "origin"], {
|
|
7610
7623
|
encoding: "utf-8",
|
|
7611
|
-
timeout: 1e4
|
|
7624
|
+
timeout: 1e4,
|
|
7625
|
+
killSignal: "SIGKILL"
|
|
7612
7626
|
});
|
|
7613
7627
|
return trustAnchorRepoFromRemoteUrl(stdout);
|
|
7614
7628
|
} catch {
|
|
@@ -7669,7 +7683,7 @@ async function ghFetchTrustAnchorConfigAsync() {
|
|
|
7669
7683
|
const repo = await trustAnchorRepoAsync();
|
|
7670
7684
|
if (!repo)
|
|
7671
7685
|
throw new Error("could not resolve repo identity for the trust-anchor read");
|
|
7672
|
-
const { stdout } = await execFileAsync4("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], { encoding: "utf-8", timeout: 1e4 });
|
|
7686
|
+
const { stdout } = await execFileAsync4("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], { encoding: "utf-8", timeout: 1e4, killSignal: "SIGKILL" });
|
|
7673
7687
|
return stdout;
|
|
7674
7688
|
}
|
|
7675
7689
|
function firstLine(err) {
|
|
@@ -3504,6 +3504,8 @@ function parseIssueSurface(body) {
|
|
|
3504
3504
|
function globCoversPath(glob, path) {
|
|
3505
3505
|
const g = glob.replace(/\/\*\*?$/, "").replace(/\/+$/, "");
|
|
3506
3506
|
const p = path.replace(/\/+$/, "");
|
|
3507
|
+
if (g === "*")
|
|
3508
|
+
return !p.includes("/");
|
|
3507
3509
|
return g === p || g.startsWith(`${p}/`) || p.startsWith(`${g}/`);
|
|
3508
3510
|
}
|
|
3509
3511
|
function checkSurfaceGlobsResolve(body, resolvesToFile) {
|
|
@@ -3504,6 +3504,8 @@ function parseIssueSurface(body) {
|
|
|
3504
3504
|
function globCoversPath(glob, path) {
|
|
3505
3505
|
const g = glob.replace(/\/\*\*?$/, "").replace(/\/+$/, "");
|
|
3506
3506
|
const p = path.replace(/\/+$/, "");
|
|
3507
|
+
if (g === "*")
|
|
3508
|
+
return !p.includes("/");
|
|
3507
3509
|
return g === p || g.startsWith(`${p}/`) || p.startsWith(`${g}/`);
|
|
3508
3510
|
}
|
|
3509
3511
|
function checkSurfaceGlobsResolve(body, resolvesToFile) {
|
|
@@ -3507,6 +3507,8 @@ function parseIssueSurface(body) {
|
|
|
3507
3507
|
function globCoversPath(glob, path) {
|
|
3508
3508
|
const g = glob.replace(/\/\*\*?$/, "").replace(/\/+$/, "");
|
|
3509
3509
|
const p = path.replace(/\/+$/, "");
|
|
3510
|
+
if (g === "*")
|
|
3511
|
+
return !p.includes("/");
|
|
3510
3512
|
return g === p || g.startsWith(`${p}/`) || p.startsWith(`${g}/`);
|
|
3511
3513
|
}
|
|
3512
3514
|
function checkSurfaceGlobsResolve(body, resolvesToFile) {
|
|
@@ -3507,6 +3507,8 @@ function parseIssueSurface(body) {
|
|
|
3507
3507
|
function globCoversPath(glob, path) {
|
|
3508
3508
|
const g = glob.replace(/\/\*\*?$/, "").replace(/\/+$/, "");
|
|
3509
3509
|
const p = path.replace(/\/+$/, "");
|
|
3510
|
+
if (g === "*")
|
|
3511
|
+
return !p.includes("/");
|
|
3510
3512
|
return g === p || g.startsWith(`${p}/`) || p.startsWith(`${g}/`);
|
|
3511
3513
|
}
|
|
3512
3514
|
function checkSurfaceGlobsResolve(body, resolvesToFile) {
|
|
@@ -3510,6 +3510,8 @@ function parseIssueSurface(body) {
|
|
|
3510
3510
|
function globCoversPath(glob, path) {
|
|
3511
3511
|
const g = glob.replace(/\/\*\*?$/, "").replace(/\/+$/, "");
|
|
3512
3512
|
const p = path.replace(/\/+$/, "");
|
|
3513
|
+
if (g === "*")
|
|
3514
|
+
return !p.includes("/");
|
|
3513
3515
|
return g === p || g.startsWith(`${p}/`) || p.startsWith(`${g}/`);
|
|
3514
3516
|
}
|
|
3515
3517
|
function checkSurfaceGlobsResolve(body, resolvesToFile) {
|
|
@@ -6768,7 +6770,8 @@ async function trustAnchorRepoAsync() {
|
|
|
6768
6770
|
try {
|
|
6769
6771
|
const { stdout } = await execFileAsync4("git", ["remote", "get-url", "origin"], {
|
|
6770
6772
|
encoding: "utf-8",
|
|
6771
|
-
timeout: 1e4
|
|
6773
|
+
timeout: 1e4,
|
|
6774
|
+
killSignal: "SIGKILL"
|
|
6772
6775
|
});
|
|
6773
6776
|
return trustAnchorRepoFromRemoteUrl(stdout);
|
|
6774
6777
|
} catch {
|
|
@@ -6829,7 +6832,7 @@ async function ghFetchTrustAnchorConfigAsync() {
|
|
|
6829
6832
|
const repo = await trustAnchorRepoAsync();
|
|
6830
6833
|
if (!repo)
|
|
6831
6834
|
throw new Error("could not resolve repo identity for the trust-anchor read");
|
|
6832
|
-
const { stdout } = await execFileAsync4("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], { encoding: "utf-8", timeout: 1e4 });
|
|
6835
|
+
const { stdout } = await execFileAsync4("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], { encoding: "utf-8", timeout: 1e4, killSignal: "SIGKILL" });
|
|
6833
6836
|
return stdout;
|
|
6834
6837
|
}
|
|
6835
6838
|
function firstLine(err) {
|
|
@@ -3504,6 +3504,8 @@ function parseIssueSurface(body) {
|
|
|
3504
3504
|
function globCoversPath(glob, path) {
|
|
3505
3505
|
const g = glob.replace(/\/\*\*?$/, "").replace(/\/+$/, "");
|
|
3506
3506
|
const p = path.replace(/\/+$/, "");
|
|
3507
|
+
if (g === "*")
|
|
3508
|
+
return !p.includes("/");
|
|
3507
3509
|
return g === p || g.startsWith(`${p}/`) || p.startsWith(`${g}/`);
|
|
3508
3510
|
}
|
|
3509
3511
|
function checkSurfaceGlobsResolve(body, resolvesToFile) {
|
|
@@ -3506,6 +3506,8 @@ function parseIssueSurface(body) {
|
|
|
3506
3506
|
function globCoversPath(glob, path) {
|
|
3507
3507
|
const g = glob.replace(/\/\*\*?$/, "").replace(/\/+$/, "");
|
|
3508
3508
|
const p = path.replace(/\/+$/, "");
|
|
3509
|
+
if (g === "*")
|
|
3510
|
+
return !p.includes("/");
|
|
3509
3511
|
return g === p || g.startsWith(`${p}/`) || p.startsWith(`${g}/`);
|
|
3510
3512
|
}
|
|
3511
3513
|
function checkSurfaceGlobsResolve(body, resolvesToFile) {
|
|
@@ -3508,6 +3508,8 @@ function parseIssueSurface(body) {
|
|
|
3508
3508
|
function globCoversPath(glob, path) {
|
|
3509
3509
|
const g = glob.replace(/\/\*\*?$/, "").replace(/\/+$/, "");
|
|
3510
3510
|
const p = path.replace(/\/+$/, "");
|
|
3511
|
+
if (g === "*")
|
|
3512
|
+
return !p.includes("/");
|
|
3511
3513
|
return g === p || g.startsWith(`${p}/`) || p.startsWith(`${g}/`);
|
|
3512
3514
|
}
|
|
3513
3515
|
function checkSurfaceGlobsResolve(body, resolvesToFile) {
|
|
@@ -6809,7 +6811,8 @@ async function trustAnchorRepoAsync() {
|
|
|
6809
6811
|
try {
|
|
6810
6812
|
const { stdout } = await execFileAsync4("git", ["remote", "get-url", "origin"], {
|
|
6811
6813
|
encoding: "utf-8",
|
|
6812
|
-
timeout: 1e4
|
|
6814
|
+
timeout: 1e4,
|
|
6815
|
+
killSignal: "SIGKILL"
|
|
6813
6816
|
});
|
|
6814
6817
|
return trustAnchorRepoFromRemoteUrl(stdout);
|
|
6815
6818
|
} catch {
|
|
@@ -6870,7 +6873,7 @@ async function ghFetchTrustAnchorConfigAsync() {
|
|
|
6870
6873
|
const repo = await trustAnchorRepoAsync();
|
|
6871
6874
|
if (!repo)
|
|
6872
6875
|
throw new Error("could not resolve repo identity for the trust-anchor read");
|
|
6873
|
-
const { stdout } = await execFileAsync4("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], { encoding: "utf-8", timeout: 1e4 });
|
|
6876
|
+
const { stdout } = await execFileAsync4("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], { encoding: "utf-8", timeout: 1e4, killSignal: "SIGKILL" });
|
|
6874
6877
|
return stdout;
|
|
6875
6878
|
}
|
|
6876
6879
|
function firstLine(err) {
|
|
@@ -7651,6 +7654,17 @@ var COMMANDS = [
|
|
|
7651
7654
|
"issue-711 O4: this command — `--task <n>`, `--resume <pr>`, `--cancel <pr>` alike — stays `task run`'s own one-shot debug/direct entry; the watching driver that survives a pause and continues on its own is `task run`'s (see that command's own entry)."
|
|
7652
7655
|
],
|
|
7653
7656
|
status: "shipped"
|
|
7657
|
+
},
|
|
7658
|
+
{
|
|
7659
|
+
name: "log send",
|
|
7660
|
+
description: "Deliver this repository's locally-held log events to the configured `logs.url` server, once",
|
|
7661
|
+
flags: [{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }],
|
|
7662
|
+
details: [
|
|
7663
|
+
"For a run whose events ended up on local disk instead of the configured server — an unattended run that fell back to the local folder because the trust-anchor read could not confirm its `logs.url` (a developer machine slower than the read deadline, or genuinely offline), or a retry queue holding a backlog or a `.draining.ndjson` a dead drain left behind. It moves the local folder's events into the retry queue and drains every queue for this repository through the SAME webhook delivery a live event uses.",
|
|
7664
|
+
"It resolves the destination exactly the way a normal event does — the sink's own decision over `vinaya.config.json`'s `logs` setting, trust-anchor-gated for an unattended caller — never a URL passed on the command line. A repository whose destination is a folder (or none) has nothing to send to a server and the command says so.",
|
|
7665
|
+
"Safe to run more than once: the server stores events by `event_id` and ignores one it already holds, so a re-sent chunk creates no duplicate, and a second run finds the folder emptied and the queue drained."
|
|
7666
|
+
],
|
|
7667
|
+
status: "shipped"
|
|
7654
7668
|
}
|
|
7655
7669
|
];
|
|
7656
7670
|
// ../../packages/sources/src/forge-adapter.ts
|
|
@@ -8811,7 +8825,14 @@ async function drainOutboxToWebhook(outboxTask, webhookUrl, headers, fetchTimeou
|
|
|
8811
8825
|
|
|
8812
8826
|
// src/lib/log-sink.ts
|
|
8813
8827
|
var OUTBOX_MAX_BYTES = 8 * 1024 * 1024;
|
|
8828
|
+
function describeFolderFallback(reason) {
|
|
8829
|
+
if (reason.kind === "anchor-unreadable") {
|
|
8830
|
+
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`";
|
|
8831
|
+
}
|
|
8832
|
+
return `not delivering to the working-tree log server ${reason.intendedUrl} — the default branch's ` + "vinaya.config.json does not declare it, so an unattended run does not honour it (a pull request cannot " + "redirect telemetry); events are written to the local folder";
|
|
8833
|
+
}
|
|
8814
8834
|
var LOG_CONTEXT_LOOKUP_DEADLINE_MS = 3000;
|
|
8835
|
+
var LOG_DESTINATION_ANCHOR_DEADLINE_MS = 8000;
|
|
8815
8836
|
function withDeadline(work, ms, fallback) {
|
|
8816
8837
|
return new Promise((resolve) => {
|
|
8817
8838
|
const timer = setTimeout(() => resolve(fallback), ms);
|
|
@@ -8826,7 +8847,7 @@ function withDeadline(work, ms, fallback) {
|
|
|
8826
8847
|
});
|
|
8827
8848
|
}
|
|
8828
8849
|
async function safeLoadTrustAnchorConfig() {
|
|
8829
|
-
return withDeadline(loadTrustAnchorConfigAsync(undefined, { quiet: true }),
|
|
8850
|
+
return withDeadline(loadTrustAnchorConfigAsync(undefined, { quiet: true }), LOG_DESTINATION_ANCHOR_DEADLINE_MS, null);
|
|
8830
8851
|
}
|
|
8831
8852
|
function logsCredentialMissing(headers, env) {
|
|
8832
8853
|
if (!headers)
|
|
@@ -8843,8 +8864,16 @@ function logsCredentialMissing(headers, env) {
|
|
|
8843
8864
|
function resolveLogDestinationFrom(input) {
|
|
8844
8865
|
const local = resolveLogsSetting(input.localConfig);
|
|
8845
8866
|
let effective = null;
|
|
8867
|
+
let fallbackReason;
|
|
8846
8868
|
if (input.unattended) {
|
|
8847
|
-
|
|
8869
|
+
if (local) {
|
|
8870
|
+
effective = resolveTrustAnchorLogsDestination(local, input.trustAnchorConfig);
|
|
8871
|
+
if (effective === null && "url" in local) {
|
|
8872
|
+
fallbackReason = input.trustAnchorConfig === null ? { kind: "anchor-unreadable", intendedUrl: local.url } : { kind: "anchor-mismatch", intendedUrl: local.url };
|
|
8873
|
+
}
|
|
8874
|
+
} else {
|
|
8875
|
+
effective = resolveLogsSetting(input.trustAnchorConfig);
|
|
8876
|
+
}
|
|
8848
8877
|
} else {
|
|
8849
8878
|
effective = local;
|
|
8850
8879
|
}
|
|
@@ -8870,7 +8899,7 @@ function resolveLogDestinationFrom(input) {
|
|
|
8870
8899
|
effective = null;
|
|
8871
8900
|
}
|
|
8872
8901
|
const folder = effective && "folder" in effective ? effective.folder : input.defaultFolder;
|
|
8873
|
-
return { kind: "folder", folder };
|
|
8902
|
+
return fallbackReason ? { kind: "folder", folder, fallbackReason } : { kind: "folder", folder };
|
|
8874
8903
|
}
|
|
8875
8904
|
var processTrustAnchorOnce;
|
|
8876
8905
|
function processTrustAnchor() {
|
|
@@ -9249,6 +9278,10 @@ function createLogSink(overrides = {}) {
|
|
|
9249
9278
|
`);
|
|
9250
9279
|
return;
|
|
9251
9280
|
}
|
|
9281
|
+
if (resolvedDestination.kind === "folder" && resolvedDestination.fallbackReason) {
|
|
9282
|
+
warnOnce(`vinaya: ${describeFolderFallback(resolvedDestination.fallbackReason)}
|
|
9283
|
+
`);
|
|
9284
|
+
}
|
|
9252
9285
|
const branchIssue = envFields.task ? null : await branchIssueOnce(repo);
|
|
9253
9286
|
const header = buildHeader({
|
|
9254
9287
|
now,
|
|
@@ -3508,6 +3508,8 @@ function parseIssueSurface(body) {
|
|
|
3508
3508
|
function globCoversPath(glob, path) {
|
|
3509
3509
|
const g = glob.replace(/\/\*\*?$/, "").replace(/\/+$/, "");
|
|
3510
3510
|
const p = path.replace(/\/+$/, "");
|
|
3511
|
+
if (g === "*")
|
|
3512
|
+
return !p.includes("/");
|
|
3511
3513
|
return g === p || g.startsWith(`${p}/`) || p.startsWith(`${g}/`);
|
|
3512
3514
|
}
|
|
3513
3515
|
function checkSurfaceGlobsResolve(body, resolvesToFile) {
|
|
@@ -6809,7 +6811,8 @@ async function trustAnchorRepoAsync() {
|
|
|
6809
6811
|
try {
|
|
6810
6812
|
const { stdout } = await execFileAsync4("git", ["remote", "get-url", "origin"], {
|
|
6811
6813
|
encoding: "utf-8",
|
|
6812
|
-
timeout: 1e4
|
|
6814
|
+
timeout: 1e4,
|
|
6815
|
+
killSignal: "SIGKILL"
|
|
6813
6816
|
});
|
|
6814
6817
|
return trustAnchorRepoFromRemoteUrl(stdout);
|
|
6815
6818
|
} catch {
|
|
@@ -6870,7 +6873,7 @@ async function ghFetchTrustAnchorConfigAsync() {
|
|
|
6870
6873
|
const repo = await trustAnchorRepoAsync();
|
|
6871
6874
|
if (!repo)
|
|
6872
6875
|
throw new Error("could not resolve repo identity for the trust-anchor read");
|
|
6873
|
-
const { stdout } = await execFileAsync4("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], { encoding: "utf-8", timeout: 1e4 });
|
|
6876
|
+
const { stdout } = await execFileAsync4("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], { encoding: "utf-8", timeout: 1e4, killSignal: "SIGKILL" });
|
|
6874
6877
|
return stdout;
|
|
6875
6878
|
}
|
|
6876
6879
|
function firstLine(err) {
|
|
@@ -7651,6 +7654,17 @@ var COMMANDS = [
|
|
|
7651
7654
|
"issue-711 O4: this command — `--task <n>`, `--resume <pr>`, `--cancel <pr>` alike — stays `task run`'s own one-shot debug/direct entry; the watching driver that survives a pause and continues on its own is `task run`'s (see that command's own entry)."
|
|
7652
7655
|
],
|
|
7653
7656
|
status: "shipped"
|
|
7657
|
+
},
|
|
7658
|
+
{
|
|
7659
|
+
name: "log send",
|
|
7660
|
+
description: "Deliver this repository's locally-held log events to the configured `logs.url` server, once",
|
|
7661
|
+
flags: [{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }],
|
|
7662
|
+
details: [
|
|
7663
|
+
"For a run whose events ended up on local disk instead of the configured server — an unattended run that fell back to the local folder because the trust-anchor read could not confirm its `logs.url` (a developer machine slower than the read deadline, or genuinely offline), or a retry queue holding a backlog or a `.draining.ndjson` a dead drain left behind. It moves the local folder's events into the retry queue and drains every queue for this repository through the SAME webhook delivery a live event uses.",
|
|
7664
|
+
"It resolves the destination exactly the way a normal event does — the sink's own decision over `vinaya.config.json`'s `logs` setting, trust-anchor-gated for an unattended caller — never a URL passed on the command line. A repository whose destination is a folder (or none) has nothing to send to a server and the command says so.",
|
|
7665
|
+
"Safe to run more than once: the server stores events by `event_id` and ignores one it already holds, so a re-sent chunk creates no duplicate, and a second run finds the folder emptied and the queue drained."
|
|
7666
|
+
],
|
|
7667
|
+
status: "shipped"
|
|
7654
7668
|
}
|
|
7655
7669
|
];
|
|
7656
7670
|
// ../../packages/sources/src/forge-adapter.ts
|
|
@@ -8811,7 +8825,14 @@ async function drainOutboxToWebhook(outboxTask, webhookUrl, headers, fetchTimeou
|
|
|
8811
8825
|
|
|
8812
8826
|
// src/lib/log-sink.ts
|
|
8813
8827
|
var OUTBOX_MAX_BYTES = 8 * 1024 * 1024;
|
|
8828
|
+
function describeFolderFallback(reason) {
|
|
8829
|
+
if (reason.kind === "anchor-unreadable") {
|
|
8830
|
+
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`";
|
|
8831
|
+
}
|
|
8832
|
+
return `not delivering to the working-tree log server ${reason.intendedUrl} — the default branch's ` + "vinaya.config.json does not declare it, so an unattended run does not honour it (a pull request cannot " + "redirect telemetry); events are written to the local folder";
|
|
8833
|
+
}
|
|
8814
8834
|
var LOG_CONTEXT_LOOKUP_DEADLINE_MS = 3000;
|
|
8835
|
+
var LOG_DESTINATION_ANCHOR_DEADLINE_MS = 8000;
|
|
8815
8836
|
function withDeadline(work, ms, fallback) {
|
|
8816
8837
|
return new Promise((resolve) => {
|
|
8817
8838
|
const timer = setTimeout(() => resolve(fallback), ms);
|
|
@@ -8826,7 +8847,7 @@ function withDeadline(work, ms, fallback) {
|
|
|
8826
8847
|
});
|
|
8827
8848
|
}
|
|
8828
8849
|
async function safeLoadTrustAnchorConfig() {
|
|
8829
|
-
return withDeadline(loadTrustAnchorConfigAsync(undefined, { quiet: true }),
|
|
8850
|
+
return withDeadline(loadTrustAnchorConfigAsync(undefined, { quiet: true }), LOG_DESTINATION_ANCHOR_DEADLINE_MS, null);
|
|
8830
8851
|
}
|
|
8831
8852
|
function logsCredentialMissing(headers, env) {
|
|
8832
8853
|
if (!headers)
|
|
@@ -8843,8 +8864,16 @@ function logsCredentialMissing(headers, env) {
|
|
|
8843
8864
|
function resolveLogDestinationFrom(input) {
|
|
8844
8865
|
const local = resolveLogsSetting(input.localConfig);
|
|
8845
8866
|
let effective = null;
|
|
8867
|
+
let fallbackReason;
|
|
8846
8868
|
if (input.unattended) {
|
|
8847
|
-
|
|
8869
|
+
if (local) {
|
|
8870
|
+
effective = resolveTrustAnchorLogsDestination(local, input.trustAnchorConfig);
|
|
8871
|
+
if (effective === null && "url" in local) {
|
|
8872
|
+
fallbackReason = input.trustAnchorConfig === null ? { kind: "anchor-unreadable", intendedUrl: local.url } : { kind: "anchor-mismatch", intendedUrl: local.url };
|
|
8873
|
+
}
|
|
8874
|
+
} else {
|
|
8875
|
+
effective = resolveLogsSetting(input.trustAnchorConfig);
|
|
8876
|
+
}
|
|
8848
8877
|
} else {
|
|
8849
8878
|
effective = local;
|
|
8850
8879
|
}
|
|
@@ -8870,7 +8899,7 @@ function resolveLogDestinationFrom(input) {
|
|
|
8870
8899
|
effective = null;
|
|
8871
8900
|
}
|
|
8872
8901
|
const folder = effective && "folder" in effective ? effective.folder : input.defaultFolder;
|
|
8873
|
-
return { kind: "folder", folder };
|
|
8902
|
+
return fallbackReason ? { kind: "folder", folder, fallbackReason } : { kind: "folder", folder };
|
|
8874
8903
|
}
|
|
8875
8904
|
var processTrustAnchorOnce;
|
|
8876
8905
|
function processTrustAnchor() {
|
|
@@ -9249,6 +9278,10 @@ function createLogSink(overrides = {}) {
|
|
|
9249
9278
|
`);
|
|
9250
9279
|
return;
|
|
9251
9280
|
}
|
|
9281
|
+
if (resolvedDestination.kind === "folder" && resolvedDestination.fallbackReason) {
|
|
9282
|
+
warnOnce(`vinaya: ${describeFolderFallback(resolvedDestination.fallbackReason)}
|
|
9283
|
+
`);
|
|
9284
|
+
}
|
|
9252
9285
|
const branchIssue = envFields.task ? null : await branchIssueOnce(repo);
|
|
9253
9286
|
const header = buildHeader({
|
|
9254
9287
|
now,
|
|
@@ -3509,6 +3509,8 @@ function parseIssueSurface(body) {
|
|
|
3509
3509
|
function globCoversPath(glob, path) {
|
|
3510
3510
|
const g = glob.replace(/\/\*\*?$/, "").replace(/\/+$/, "");
|
|
3511
3511
|
const p = path.replace(/\/+$/, "");
|
|
3512
|
+
if (g === "*")
|
|
3513
|
+
return !p.includes("/");
|
|
3512
3514
|
return g === p || g.startsWith(`${p}/`) || p.startsWith(`${g}/`);
|
|
3513
3515
|
}
|
|
3514
3516
|
function checkSurfaceGlobsResolve(body, resolvesToFile) {
|
|
@@ -3508,6 +3508,8 @@ function parseIssueSurface(body) {
|
|
|
3508
3508
|
function globCoversPath(glob, path) {
|
|
3509
3509
|
const g = glob.replace(/\/\*\*?$/, "").replace(/\/+$/, "");
|
|
3510
3510
|
const p = path.replace(/\/+$/, "");
|
|
3511
|
+
if (g === "*")
|
|
3512
|
+
return !p.includes("/");
|
|
3511
3513
|
return g === p || g.startsWith(`${p}/`) || p.startsWith(`${g}/`);
|
|
3512
3514
|
}
|
|
3513
3515
|
function checkSurfaceGlobsResolve(body, resolvesToFile) {
|
|
@@ -6809,7 +6811,8 @@ async function trustAnchorRepoAsync() {
|
|
|
6809
6811
|
try {
|
|
6810
6812
|
const { stdout } = await execFileAsync4("git", ["remote", "get-url", "origin"], {
|
|
6811
6813
|
encoding: "utf-8",
|
|
6812
|
-
timeout: 1e4
|
|
6814
|
+
timeout: 1e4,
|
|
6815
|
+
killSignal: "SIGKILL"
|
|
6813
6816
|
});
|
|
6814
6817
|
return trustAnchorRepoFromRemoteUrl(stdout);
|
|
6815
6818
|
} catch {
|
|
@@ -6870,7 +6873,7 @@ async function ghFetchTrustAnchorConfigAsync() {
|
|
|
6870
6873
|
const repo = await trustAnchorRepoAsync();
|
|
6871
6874
|
if (!repo)
|
|
6872
6875
|
throw new Error("could not resolve repo identity for the trust-anchor read");
|
|
6873
|
-
const { stdout } = await execFileAsync4("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], { encoding: "utf-8", timeout: 1e4 });
|
|
6876
|
+
const { stdout } = await execFileAsync4("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], { encoding: "utf-8", timeout: 1e4, killSignal: "SIGKILL" });
|
|
6874
6877
|
return stdout;
|
|
6875
6878
|
}
|
|
6876
6879
|
function firstLine(err) {
|
|
@@ -7651,6 +7654,17 @@ var COMMANDS = [
|
|
|
7651
7654
|
"issue-711 O4: this command — `--task <n>`, `--resume <pr>`, `--cancel <pr>` alike — stays `task run`'s own one-shot debug/direct entry; the watching driver that survives a pause and continues on its own is `task run`'s (see that command's own entry)."
|
|
7652
7655
|
],
|
|
7653
7656
|
status: "shipped"
|
|
7657
|
+
},
|
|
7658
|
+
{
|
|
7659
|
+
name: "log send",
|
|
7660
|
+
description: "Deliver this repository's locally-held log events to the configured `logs.url` server, once",
|
|
7661
|
+
flags: [{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }],
|
|
7662
|
+
details: [
|
|
7663
|
+
"For a run whose events ended up on local disk instead of the configured server — an unattended run that fell back to the local folder because the trust-anchor read could not confirm its `logs.url` (a developer machine slower than the read deadline, or genuinely offline), or a retry queue holding a backlog or a `.draining.ndjson` a dead drain left behind. It moves the local folder's events into the retry queue and drains every queue for this repository through the SAME webhook delivery a live event uses.",
|
|
7664
|
+
"It resolves the destination exactly the way a normal event does — the sink's own decision over `vinaya.config.json`'s `logs` setting, trust-anchor-gated for an unattended caller — never a URL passed on the command line. A repository whose destination is a folder (or none) has nothing to send to a server and the command says so.",
|
|
7665
|
+
"Safe to run more than once: the server stores events by `event_id` and ignores one it already holds, so a re-sent chunk creates no duplicate, and a second run finds the folder emptied and the queue drained."
|
|
7666
|
+
],
|
|
7667
|
+
status: "shipped"
|
|
7654
7668
|
}
|
|
7655
7669
|
];
|
|
7656
7670
|
// ../../packages/sources/src/forge-adapter.ts
|
|
@@ -8811,7 +8825,14 @@ async function drainOutboxToWebhook(outboxTask, webhookUrl, headers, fetchTimeou
|
|
|
8811
8825
|
|
|
8812
8826
|
// src/lib/log-sink.ts
|
|
8813
8827
|
var OUTBOX_MAX_BYTES = 8 * 1024 * 1024;
|
|
8828
|
+
function describeFolderFallback(reason) {
|
|
8829
|
+
if (reason.kind === "anchor-unreadable") {
|
|
8830
|
+
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`";
|
|
8831
|
+
}
|
|
8832
|
+
return `not delivering to the working-tree log server ${reason.intendedUrl} — the default branch's ` + "vinaya.config.json does not declare it, so an unattended run does not honour it (a pull request cannot " + "redirect telemetry); events are written to the local folder";
|
|
8833
|
+
}
|
|
8814
8834
|
var LOG_CONTEXT_LOOKUP_DEADLINE_MS = 3000;
|
|
8835
|
+
var LOG_DESTINATION_ANCHOR_DEADLINE_MS = 8000;
|
|
8815
8836
|
function withDeadline(work, ms, fallback) {
|
|
8816
8837
|
return new Promise((resolve) => {
|
|
8817
8838
|
const timer = setTimeout(() => resolve(fallback), ms);
|
|
@@ -8826,7 +8847,7 @@ function withDeadline(work, ms, fallback) {
|
|
|
8826
8847
|
});
|
|
8827
8848
|
}
|
|
8828
8849
|
async function safeLoadTrustAnchorConfig() {
|
|
8829
|
-
return withDeadline(loadTrustAnchorConfigAsync(undefined, { quiet: true }),
|
|
8850
|
+
return withDeadline(loadTrustAnchorConfigAsync(undefined, { quiet: true }), LOG_DESTINATION_ANCHOR_DEADLINE_MS, null);
|
|
8830
8851
|
}
|
|
8831
8852
|
function logsCredentialMissing(headers, env) {
|
|
8832
8853
|
if (!headers)
|
|
@@ -8843,8 +8864,16 @@ function logsCredentialMissing(headers, env) {
|
|
|
8843
8864
|
function resolveLogDestinationFrom(input) {
|
|
8844
8865
|
const local = resolveLogsSetting(input.localConfig);
|
|
8845
8866
|
let effective = null;
|
|
8867
|
+
let fallbackReason;
|
|
8846
8868
|
if (input.unattended) {
|
|
8847
|
-
|
|
8869
|
+
if (local) {
|
|
8870
|
+
effective = resolveTrustAnchorLogsDestination(local, input.trustAnchorConfig);
|
|
8871
|
+
if (effective === null && "url" in local) {
|
|
8872
|
+
fallbackReason = input.trustAnchorConfig === null ? { kind: "anchor-unreadable", intendedUrl: local.url } : { kind: "anchor-mismatch", intendedUrl: local.url };
|
|
8873
|
+
}
|
|
8874
|
+
} else {
|
|
8875
|
+
effective = resolveLogsSetting(input.trustAnchorConfig);
|
|
8876
|
+
}
|
|
8848
8877
|
} else {
|
|
8849
8878
|
effective = local;
|
|
8850
8879
|
}
|
|
@@ -8870,7 +8899,7 @@ function resolveLogDestinationFrom(input) {
|
|
|
8870
8899
|
effective = null;
|
|
8871
8900
|
}
|
|
8872
8901
|
const folder = effective && "folder" in effective ? effective.folder : input.defaultFolder;
|
|
8873
|
-
return { kind: "folder", folder };
|
|
8902
|
+
return fallbackReason ? { kind: "folder", folder, fallbackReason } : { kind: "folder", folder };
|
|
8874
8903
|
}
|
|
8875
8904
|
var processTrustAnchorOnce;
|
|
8876
8905
|
function processTrustAnchor() {
|
|
@@ -9249,6 +9278,10 @@ function createLogSink(overrides = {}) {
|
|
|
9249
9278
|
`);
|
|
9250
9279
|
return;
|
|
9251
9280
|
}
|
|
9281
|
+
if (resolvedDestination.kind === "folder" && resolvedDestination.fallbackReason) {
|
|
9282
|
+
warnOnce(`vinaya: ${describeFolderFallback(resolvedDestination.fallbackReason)}
|
|
9283
|
+
`);
|
|
9284
|
+
}
|
|
9252
9285
|
const branchIssue = envFields.task ? null : await branchIssueOnce(repo);
|
|
9253
9286
|
const header = buildHeader({
|
|
9254
9287
|
now,
|
|
@@ -3506,6 +3506,8 @@ function parseIssueSurface(body) {
|
|
|
3506
3506
|
function globCoversPath(glob, path) {
|
|
3507
3507
|
const g = glob.replace(/\/\*\*?$/, "").replace(/\/+$/, "");
|
|
3508
3508
|
const p = path.replace(/\/+$/, "");
|
|
3509
|
+
if (g === "*")
|
|
3510
|
+
return !p.includes("/");
|
|
3509
3511
|
return g === p || g.startsWith(`${p}/`) || p.startsWith(`${g}/`);
|
|
3510
3512
|
}
|
|
3511
3513
|
function checkSurfaceGlobsResolve(body, resolvesToFile) {
|
|
@@ -6764,7 +6766,8 @@ async function trustAnchorRepoAsync() {
|
|
|
6764
6766
|
try {
|
|
6765
6767
|
const { stdout } = await execFileAsync4("git", ["remote", "get-url", "origin"], {
|
|
6766
6768
|
encoding: "utf-8",
|
|
6767
|
-
timeout: 1e4
|
|
6769
|
+
timeout: 1e4,
|
|
6770
|
+
killSignal: "SIGKILL"
|
|
6768
6771
|
});
|
|
6769
6772
|
return trustAnchorRepoFromRemoteUrl(stdout);
|
|
6770
6773
|
} catch {
|
|
@@ -6825,7 +6828,7 @@ async function ghFetchTrustAnchorConfigAsync() {
|
|
|
6825
6828
|
const repo = await trustAnchorRepoAsync();
|
|
6826
6829
|
if (!repo)
|
|
6827
6830
|
throw new Error("could not resolve repo identity for the trust-anchor read");
|
|
6828
|
-
const { stdout } = await execFileAsync4("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], { encoding: "utf-8", timeout: 1e4 });
|
|
6831
|
+
const { stdout } = await execFileAsync4("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], { encoding: "utf-8", timeout: 1e4, killSignal: "SIGKILL" });
|
|
6829
6832
|
return stdout;
|
|
6830
6833
|
}
|
|
6831
6834
|
function firstLine(err) {
|
|
@@ -3507,6 +3507,8 @@ function parseIssueSurface(body) {
|
|
|
3507
3507
|
function globCoversPath(glob, path) {
|
|
3508
3508
|
const g = glob.replace(/\/\*\*?$/, "").replace(/\/+$/, "");
|
|
3509
3509
|
const p = path.replace(/\/+$/, "");
|
|
3510
|
+
if (g === "*")
|
|
3511
|
+
return !p.includes("/");
|
|
3510
3512
|
return g === p || g.startsWith(`${p}/`) || p.startsWith(`${g}/`);
|
|
3511
3513
|
}
|
|
3512
3514
|
function checkSurfaceGlobsResolve(body, resolvesToFile) {
|