@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
|
@@ -3512,6 +3512,8 @@ function parseIssueSurface(body) {
|
|
|
3512
3512
|
function globCoversPath(glob, path) {
|
|
3513
3513
|
const g = glob.replace(/\/\*\*?$/, "").replace(/\/+$/, "");
|
|
3514
3514
|
const p = path.replace(/\/+$/, "");
|
|
3515
|
+
if (g === "*")
|
|
3516
|
+
return !p.includes("/");
|
|
3515
3517
|
return g === p || g.startsWith(`${p}/`) || p.startsWith(`${g}/`);
|
|
3516
3518
|
}
|
|
3517
3519
|
function checkSurfaceGlobsResolve(body, resolvesToFile) {
|
|
@@ -7062,6 +7064,17 @@ var COMMANDS = [
|
|
|
7062
7064
|
"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)."
|
|
7063
7065
|
],
|
|
7064
7066
|
status: "shipped"
|
|
7067
|
+
},
|
|
7068
|
+
{
|
|
7069
|
+
name: "log send",
|
|
7070
|
+
description: "Deliver this repository's locally-held log events to the configured `logs.url` server, once",
|
|
7071
|
+
flags: [{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }],
|
|
7072
|
+
details: [
|
|
7073
|
+
"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.",
|
|
7074
|
+
"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.",
|
|
7075
|
+
"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."
|
|
7076
|
+
],
|
|
7077
|
+
status: "shipped"
|
|
7065
7078
|
}
|
|
7066
7079
|
];
|
|
7067
7080
|
// ../../packages/sources/src/forge-adapter.ts
|
|
@@ -7475,7 +7488,8 @@ async function trustAnchorRepoAsync() {
|
|
|
7475
7488
|
try {
|
|
7476
7489
|
const { stdout } = await execFileAsync4("git", ["remote", "get-url", "origin"], {
|
|
7477
7490
|
encoding: "utf-8",
|
|
7478
|
-
timeout: 1e4
|
|
7491
|
+
timeout: 1e4,
|
|
7492
|
+
killSignal: "SIGKILL"
|
|
7479
7493
|
});
|
|
7480
7494
|
return trustAnchorRepoFromRemoteUrl(stdout);
|
|
7481
7495
|
} catch {
|
|
@@ -7536,7 +7550,7 @@ async function ghFetchTrustAnchorConfigAsync() {
|
|
|
7536
7550
|
const repo = await trustAnchorRepoAsync();
|
|
7537
7551
|
if (!repo)
|
|
7538
7552
|
throw new Error("could not resolve repo identity for the trust-anchor read");
|
|
7539
|
-
const { stdout } = await execFileAsync4("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], { encoding: "utf-8", timeout: 1e4 });
|
|
7553
|
+
const { stdout } = await execFileAsync4("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], { encoding: "utf-8", timeout: 1e4, killSignal: "SIGKILL" });
|
|
7540
7554
|
return stdout;
|
|
7541
7555
|
}
|
|
7542
7556
|
function firstLine(err) {
|
|
@@ -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) {
|
|
@@ -6760,7 +6762,8 @@ async function trustAnchorRepoAsync() {
|
|
|
6760
6762
|
try {
|
|
6761
6763
|
const { stdout } = await execFileAsync4("git", ["remote", "get-url", "origin"], {
|
|
6762
6764
|
encoding: "utf-8",
|
|
6763
|
-
timeout: 1e4
|
|
6765
|
+
timeout: 1e4,
|
|
6766
|
+
killSignal: "SIGKILL"
|
|
6764
6767
|
});
|
|
6765
6768
|
return trustAnchorRepoFromRemoteUrl(stdout);
|
|
6766
6769
|
} catch {
|
|
@@ -6821,7 +6824,7 @@ async function ghFetchTrustAnchorConfigAsync() {
|
|
|
6821
6824
|
const repo = await trustAnchorRepoAsync();
|
|
6822
6825
|
if (!repo)
|
|
6823
6826
|
throw new Error("could not resolve repo identity for the trust-anchor read");
|
|
6824
|
-
const { stdout } = await execFileAsync4("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], { encoding: "utf-8", timeout: 1e4 });
|
|
6827
|
+
const { stdout } = await execFileAsync4("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], { encoding: "utf-8", timeout: 1e4, killSignal: "SIGKILL" });
|
|
6825
6828
|
return stdout;
|
|
6826
6829
|
}
|
|
6827
6830
|
function firstLine(err) {
|
|
@@ -7591,6 +7594,17 @@ var COMMANDS = [
|
|
|
7591
7594
|
"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)."
|
|
7592
7595
|
],
|
|
7593
7596
|
status: "shipped"
|
|
7597
|
+
},
|
|
7598
|
+
{
|
|
7599
|
+
name: "log send",
|
|
7600
|
+
description: "Deliver this repository's locally-held log events to the configured `logs.url` server, once",
|
|
7601
|
+
flags: [{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }],
|
|
7602
|
+
details: [
|
|
7603
|
+
"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.",
|
|
7604
|
+
"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.",
|
|
7605
|
+
"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."
|
|
7606
|
+
],
|
|
7607
|
+
status: "shipped"
|
|
7594
7608
|
}
|
|
7595
7609
|
];
|
|
7596
7610
|
// ../../packages/sources/src/forge-adapter.ts
|
|
@@ -8802,7 +8816,14 @@ async function drainOutboxToWebhook(outboxTask, webhookUrl, headers, fetchTimeou
|
|
|
8802
8816
|
|
|
8803
8817
|
// src/lib/log-sink.ts
|
|
8804
8818
|
var OUTBOX_MAX_BYTES = 8 * 1024 * 1024;
|
|
8819
|
+
function describeFolderFallback(reason) {
|
|
8820
|
+
if (reason.kind === "anchor-unreadable") {
|
|
8821
|
+
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`";
|
|
8822
|
+
}
|
|
8823
|
+
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";
|
|
8824
|
+
}
|
|
8805
8825
|
var LOG_CONTEXT_LOOKUP_DEADLINE_MS = 3000;
|
|
8826
|
+
var LOG_DESTINATION_ANCHOR_DEADLINE_MS = 8000;
|
|
8806
8827
|
function withDeadline(work, ms, fallback) {
|
|
8807
8828
|
return new Promise((resolve) => {
|
|
8808
8829
|
const timer = setTimeout(() => resolve(fallback), ms);
|
|
@@ -8817,7 +8838,7 @@ function withDeadline(work, ms, fallback) {
|
|
|
8817
8838
|
});
|
|
8818
8839
|
}
|
|
8819
8840
|
async function safeLoadTrustAnchorConfig() {
|
|
8820
|
-
return withDeadline(loadTrustAnchorConfigAsync(undefined, { quiet: true }),
|
|
8841
|
+
return withDeadline(loadTrustAnchorConfigAsync(undefined, { quiet: true }), LOG_DESTINATION_ANCHOR_DEADLINE_MS, null);
|
|
8821
8842
|
}
|
|
8822
8843
|
function logsCredentialMissing(headers, env) {
|
|
8823
8844
|
if (!headers)
|
|
@@ -8834,8 +8855,16 @@ function logsCredentialMissing(headers, env) {
|
|
|
8834
8855
|
function resolveLogDestinationFrom(input) {
|
|
8835
8856
|
const local = resolveLogsSetting(input.localConfig);
|
|
8836
8857
|
let effective = null;
|
|
8858
|
+
let fallbackReason;
|
|
8837
8859
|
if (input.unattended) {
|
|
8838
|
-
|
|
8860
|
+
if (local) {
|
|
8861
|
+
effective = resolveTrustAnchorLogsDestination(local, input.trustAnchorConfig);
|
|
8862
|
+
if (effective === null && "url" in local) {
|
|
8863
|
+
fallbackReason = input.trustAnchorConfig === null ? { kind: "anchor-unreadable", intendedUrl: local.url } : { kind: "anchor-mismatch", intendedUrl: local.url };
|
|
8864
|
+
}
|
|
8865
|
+
} else {
|
|
8866
|
+
effective = resolveLogsSetting(input.trustAnchorConfig);
|
|
8867
|
+
}
|
|
8839
8868
|
} else {
|
|
8840
8869
|
effective = local;
|
|
8841
8870
|
}
|
|
@@ -8861,7 +8890,7 @@ function resolveLogDestinationFrom(input) {
|
|
|
8861
8890
|
effective = null;
|
|
8862
8891
|
}
|
|
8863
8892
|
const folder = effective && "folder" in effective ? effective.folder : input.defaultFolder;
|
|
8864
|
-
return { kind: "folder", folder };
|
|
8893
|
+
return fallbackReason ? { kind: "folder", folder, fallbackReason } : { kind: "folder", folder };
|
|
8865
8894
|
}
|
|
8866
8895
|
var processTrustAnchorOnce;
|
|
8867
8896
|
function processTrustAnchor() {
|
|
@@ -9240,6 +9269,10 @@ function createLogSink(overrides = {}) {
|
|
|
9240
9269
|
`);
|
|
9241
9270
|
return;
|
|
9242
9271
|
}
|
|
9272
|
+
if (resolvedDestination.kind === "folder" && resolvedDestination.fallbackReason) {
|
|
9273
|
+
warnOnce(`vinaya: ${describeFolderFallback(resolvedDestination.fallbackReason)}
|
|
9274
|
+
`);
|
|
9275
|
+
}
|
|
9243
9276
|
const branchIssue = envFields.task ? null : await branchIssueOnce(repo);
|
|
9244
9277
|
const header = buildHeader({
|
|
9245
9278
|
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) {
|
|
@@ -6760,7 +6762,8 @@ async function trustAnchorRepoAsync() {
|
|
|
6760
6762
|
try {
|
|
6761
6763
|
const { stdout } = await execFileAsync4("git", ["remote", "get-url", "origin"], {
|
|
6762
6764
|
encoding: "utf-8",
|
|
6763
|
-
timeout: 1e4
|
|
6765
|
+
timeout: 1e4,
|
|
6766
|
+
killSignal: "SIGKILL"
|
|
6764
6767
|
});
|
|
6765
6768
|
return trustAnchorRepoFromRemoteUrl(stdout);
|
|
6766
6769
|
} catch {
|
|
@@ -6821,7 +6824,7 @@ async function ghFetchTrustAnchorConfigAsync() {
|
|
|
6821
6824
|
const repo = await trustAnchorRepoAsync();
|
|
6822
6825
|
if (!repo)
|
|
6823
6826
|
throw new Error("could not resolve repo identity for the trust-anchor read");
|
|
6824
|
-
const { stdout } = await execFileAsync4("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], { encoding: "utf-8", timeout: 1e4 });
|
|
6827
|
+
const { stdout } = await execFileAsync4("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], { encoding: "utf-8", timeout: 1e4, killSignal: "SIGKILL" });
|
|
6825
6828
|
return stdout;
|
|
6826
6829
|
}
|
|
6827
6830
|
function firstLine(err) {
|
|
@@ -7591,6 +7594,17 @@ var COMMANDS = [
|
|
|
7591
7594
|
"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)."
|
|
7592
7595
|
],
|
|
7593
7596
|
status: "shipped"
|
|
7597
|
+
},
|
|
7598
|
+
{
|
|
7599
|
+
name: "log send",
|
|
7600
|
+
description: "Deliver this repository's locally-held log events to the configured `logs.url` server, once",
|
|
7601
|
+
flags: [{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }],
|
|
7602
|
+
details: [
|
|
7603
|
+
"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.",
|
|
7604
|
+
"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.",
|
|
7605
|
+
"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."
|
|
7606
|
+
],
|
|
7607
|
+
status: "shipped"
|
|
7594
7608
|
}
|
|
7595
7609
|
];
|
|
7596
7610
|
// ../../packages/sources/src/forge-adapter.ts
|
|
@@ -8802,7 +8816,14 @@ async function drainOutboxToWebhook(outboxTask, webhookUrl, headers, fetchTimeou
|
|
|
8802
8816
|
|
|
8803
8817
|
// src/lib/log-sink.ts
|
|
8804
8818
|
var OUTBOX_MAX_BYTES = 8 * 1024 * 1024;
|
|
8819
|
+
function describeFolderFallback(reason) {
|
|
8820
|
+
if (reason.kind === "anchor-unreadable") {
|
|
8821
|
+
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`";
|
|
8822
|
+
}
|
|
8823
|
+
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";
|
|
8824
|
+
}
|
|
8805
8825
|
var LOG_CONTEXT_LOOKUP_DEADLINE_MS = 3000;
|
|
8826
|
+
var LOG_DESTINATION_ANCHOR_DEADLINE_MS = 8000;
|
|
8806
8827
|
function withDeadline(work, ms, fallback) {
|
|
8807
8828
|
return new Promise((resolve) => {
|
|
8808
8829
|
const timer = setTimeout(() => resolve(fallback), ms);
|
|
@@ -8817,7 +8838,7 @@ function withDeadline(work, ms, fallback) {
|
|
|
8817
8838
|
});
|
|
8818
8839
|
}
|
|
8819
8840
|
async function safeLoadTrustAnchorConfig() {
|
|
8820
|
-
return withDeadline(loadTrustAnchorConfigAsync(undefined, { quiet: true }),
|
|
8841
|
+
return withDeadline(loadTrustAnchorConfigAsync(undefined, { quiet: true }), LOG_DESTINATION_ANCHOR_DEADLINE_MS, null);
|
|
8821
8842
|
}
|
|
8822
8843
|
function logsCredentialMissing(headers, env) {
|
|
8823
8844
|
if (!headers)
|
|
@@ -8834,8 +8855,16 @@ function logsCredentialMissing(headers, env) {
|
|
|
8834
8855
|
function resolveLogDestinationFrom(input) {
|
|
8835
8856
|
const local = resolveLogsSetting(input.localConfig);
|
|
8836
8857
|
let effective = null;
|
|
8858
|
+
let fallbackReason;
|
|
8837
8859
|
if (input.unattended) {
|
|
8838
|
-
|
|
8860
|
+
if (local) {
|
|
8861
|
+
effective = resolveTrustAnchorLogsDestination(local, input.trustAnchorConfig);
|
|
8862
|
+
if (effective === null && "url" in local) {
|
|
8863
|
+
fallbackReason = input.trustAnchorConfig === null ? { kind: "anchor-unreadable", intendedUrl: local.url } : { kind: "anchor-mismatch", intendedUrl: local.url };
|
|
8864
|
+
}
|
|
8865
|
+
} else {
|
|
8866
|
+
effective = resolveLogsSetting(input.trustAnchorConfig);
|
|
8867
|
+
}
|
|
8839
8868
|
} else {
|
|
8840
8869
|
effective = local;
|
|
8841
8870
|
}
|
|
@@ -8861,7 +8890,7 @@ function resolveLogDestinationFrom(input) {
|
|
|
8861
8890
|
effective = null;
|
|
8862
8891
|
}
|
|
8863
8892
|
const folder = effective && "folder" in effective ? effective.folder : input.defaultFolder;
|
|
8864
|
-
return { kind: "folder", folder };
|
|
8893
|
+
return fallbackReason ? { kind: "folder", folder, fallbackReason } : { kind: "folder", folder };
|
|
8865
8894
|
}
|
|
8866
8895
|
var processTrustAnchorOnce;
|
|
8867
8896
|
function processTrustAnchor() {
|
|
@@ -9240,6 +9269,10 @@ function createLogSink(overrides = {}) {
|
|
|
9240
9269
|
`);
|
|
9241
9270
|
return;
|
|
9242
9271
|
}
|
|
9272
|
+
if (resolvedDestination.kind === "folder" && resolvedDestination.fallbackReason) {
|
|
9273
|
+
warnOnce(`vinaya: ${describeFolderFallback(resolvedDestination.fallbackReason)}
|
|
9274
|
+
`);
|
|
9275
|
+
}
|
|
9243
9276
|
const branchIssue = envFields.task ? null : await branchIssueOnce(repo);
|
|
9244
9277
|
const header = buildHeader({
|
|
9245
9278
|
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) {
|
|
@@ -6756,7 +6758,8 @@ async function trustAnchorRepoAsync() {
|
|
|
6756
6758
|
try {
|
|
6757
6759
|
const { stdout } = await execFileAsync4("git", ["remote", "get-url", "origin"], {
|
|
6758
6760
|
encoding: "utf-8",
|
|
6759
|
-
timeout: 1e4
|
|
6761
|
+
timeout: 1e4,
|
|
6762
|
+
killSignal: "SIGKILL"
|
|
6760
6763
|
});
|
|
6761
6764
|
return trustAnchorRepoFromRemoteUrl(stdout);
|
|
6762
6765
|
} catch {
|
|
@@ -6817,7 +6820,7 @@ async function ghFetchTrustAnchorConfigAsync() {
|
|
|
6817
6820
|
const repo = await trustAnchorRepoAsync();
|
|
6818
6821
|
if (!repo)
|
|
6819
6822
|
throw new Error("could not resolve repo identity for the trust-anchor read");
|
|
6820
|
-
const { stdout } = await execFileAsync4("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], { encoding: "utf-8", timeout: 1e4 });
|
|
6823
|
+
const { stdout } = await execFileAsync4("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], { encoding: "utf-8", timeout: 1e4, killSignal: "SIGKILL" });
|
|
6821
6824
|
return stdout;
|
|
6822
6825
|
}
|
|
6823
6826
|
function firstLine(err) {
|
|
@@ -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) {
|
|
@@ -6757,7 +6759,8 @@ async function trustAnchorRepoAsync() {
|
|
|
6757
6759
|
try {
|
|
6758
6760
|
const { stdout } = await execFileAsync4("git", ["remote", "get-url", "origin"], {
|
|
6759
6761
|
encoding: "utf-8",
|
|
6760
|
-
timeout: 1e4
|
|
6762
|
+
timeout: 1e4,
|
|
6763
|
+
killSignal: "SIGKILL"
|
|
6761
6764
|
});
|
|
6762
6765
|
return trustAnchorRepoFromRemoteUrl(stdout);
|
|
6763
6766
|
} catch {
|
|
@@ -6818,7 +6821,7 @@ async function ghFetchTrustAnchorConfigAsync() {
|
|
|
6818
6821
|
const repo = await trustAnchorRepoAsync();
|
|
6819
6822
|
if (!repo)
|
|
6820
6823
|
throw new Error("could not resolve repo identity for the trust-anchor read");
|
|
6821
|
-
const { stdout } = await execFileAsync4("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], { encoding: "utf-8", timeout: 1e4 });
|
|
6824
|
+
const { stdout } = await execFileAsync4("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], { encoding: "utf-8", timeout: 1e4, killSignal: "SIGKILL" });
|
|
6822
6825
|
return stdout;
|
|
6823
6826
|
}
|
|
6824
6827
|
function firstLine(err) {
|
|
@@ -7592,6 +7595,17 @@ var COMMANDS = [
|
|
|
7592
7595
|
"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)."
|
|
7593
7596
|
],
|
|
7594
7597
|
status: "shipped"
|
|
7598
|
+
},
|
|
7599
|
+
{
|
|
7600
|
+
name: "log send",
|
|
7601
|
+
description: "Deliver this repository's locally-held log events to the configured `logs.url` server, once",
|
|
7602
|
+
flags: [{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }],
|
|
7603
|
+
details: [
|
|
7604
|
+
"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.",
|
|
7605
|
+
"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.",
|
|
7606
|
+
"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."
|
|
7607
|
+
],
|
|
7608
|
+
status: "shipped"
|
|
7595
7609
|
}
|
|
7596
7610
|
];
|
|
7597
7611
|
// ../../packages/sources/src/forge-adapter.ts
|
|
@@ -8803,7 +8817,14 @@ async function drainOutboxToWebhook(outboxTask, webhookUrl, headers, fetchTimeou
|
|
|
8803
8817
|
|
|
8804
8818
|
// src/lib/log-sink.ts
|
|
8805
8819
|
var OUTBOX_MAX_BYTES = 8 * 1024 * 1024;
|
|
8820
|
+
function describeFolderFallback(reason) {
|
|
8821
|
+
if (reason.kind === "anchor-unreadable") {
|
|
8822
|
+
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`";
|
|
8823
|
+
}
|
|
8824
|
+
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";
|
|
8825
|
+
}
|
|
8806
8826
|
var LOG_CONTEXT_LOOKUP_DEADLINE_MS = 3000;
|
|
8827
|
+
var LOG_DESTINATION_ANCHOR_DEADLINE_MS = 8000;
|
|
8807
8828
|
function withDeadline(work, ms, fallback) {
|
|
8808
8829
|
return new Promise((resolve) => {
|
|
8809
8830
|
const timer = setTimeout(() => resolve(fallback), ms);
|
|
@@ -8818,7 +8839,7 @@ function withDeadline(work, ms, fallback) {
|
|
|
8818
8839
|
});
|
|
8819
8840
|
}
|
|
8820
8841
|
async function safeLoadTrustAnchorConfig() {
|
|
8821
|
-
return withDeadline(loadTrustAnchorConfigAsync(undefined, { quiet: true }),
|
|
8842
|
+
return withDeadline(loadTrustAnchorConfigAsync(undefined, { quiet: true }), LOG_DESTINATION_ANCHOR_DEADLINE_MS, null);
|
|
8822
8843
|
}
|
|
8823
8844
|
function logsCredentialMissing(headers, env) {
|
|
8824
8845
|
if (!headers)
|
|
@@ -8835,8 +8856,16 @@ function logsCredentialMissing(headers, env) {
|
|
|
8835
8856
|
function resolveLogDestinationFrom(input) {
|
|
8836
8857
|
const local = resolveLogsSetting(input.localConfig);
|
|
8837
8858
|
let effective = null;
|
|
8859
|
+
let fallbackReason;
|
|
8838
8860
|
if (input.unattended) {
|
|
8839
|
-
|
|
8861
|
+
if (local) {
|
|
8862
|
+
effective = resolveTrustAnchorLogsDestination(local, input.trustAnchorConfig);
|
|
8863
|
+
if (effective === null && "url" in local) {
|
|
8864
|
+
fallbackReason = input.trustAnchorConfig === null ? { kind: "anchor-unreadable", intendedUrl: local.url } : { kind: "anchor-mismatch", intendedUrl: local.url };
|
|
8865
|
+
}
|
|
8866
|
+
} else {
|
|
8867
|
+
effective = resolveLogsSetting(input.trustAnchorConfig);
|
|
8868
|
+
}
|
|
8840
8869
|
} else {
|
|
8841
8870
|
effective = local;
|
|
8842
8871
|
}
|
|
@@ -8862,7 +8891,7 @@ function resolveLogDestinationFrom(input) {
|
|
|
8862
8891
|
effective = null;
|
|
8863
8892
|
}
|
|
8864
8893
|
const folder = effective && "folder" in effective ? effective.folder : input.defaultFolder;
|
|
8865
|
-
return { kind: "folder", folder };
|
|
8894
|
+
return fallbackReason ? { kind: "folder", folder, fallbackReason } : { kind: "folder", folder };
|
|
8866
8895
|
}
|
|
8867
8896
|
var processTrustAnchorOnce;
|
|
8868
8897
|
function processTrustAnchor() {
|
|
@@ -9241,6 +9270,10 @@ function createLogSink(overrides = {}) {
|
|
|
9241
9270
|
`);
|
|
9242
9271
|
return;
|
|
9243
9272
|
}
|
|
9273
|
+
if (resolvedDestination.kind === "folder" && resolvedDestination.fallbackReason) {
|
|
9274
|
+
warnOnce(`vinaya: ${describeFolderFallback(resolvedDestination.fallbackReason)}
|
|
9275
|
+
`);
|
|
9276
|
+
}
|
|
9244
9277
|
const branchIssue = envFields.task ? null : await branchIssueOnce(repo);
|
|
9245
9278
|
const header = buildHeader({
|
|
9246
9279
|
now,
|
|
@@ -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) {
|
|
@@ -7362,7 +7364,8 @@ async function trustAnchorRepoAsync() {
|
|
|
7362
7364
|
try {
|
|
7363
7365
|
const { stdout } = await execFileAsync4("git", ["remote", "get-url", "origin"], {
|
|
7364
7366
|
encoding: "utf-8",
|
|
7365
|
-
timeout: 1e4
|
|
7367
|
+
timeout: 1e4,
|
|
7368
|
+
killSignal: "SIGKILL"
|
|
7366
7369
|
});
|
|
7367
7370
|
return trustAnchorRepoFromRemoteUrl(stdout);
|
|
7368
7371
|
} catch {
|
|
@@ -7423,7 +7426,7 @@ async function ghFetchTrustAnchorConfigAsync() {
|
|
|
7423
7426
|
const repo = await trustAnchorRepoAsync();
|
|
7424
7427
|
if (!repo)
|
|
7425
7428
|
throw new Error("could not resolve repo identity for the trust-anchor read");
|
|
7426
|
-
const { stdout } = await execFileAsync4("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], { encoding: "utf-8", timeout: 1e4 });
|
|
7429
|
+
const { stdout } = await execFileAsync4("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], { encoding: "utf-8", timeout: 1e4, killSignal: "SIGKILL" });
|
|
7427
7430
|
return stdout;
|
|
7428
7431
|
}
|
|
7429
7432
|
function firstLine(err) {
|
|
@@ -7920,7 +7923,14 @@ async function drainOutboxToWebhook(outboxTask, webhookUrl, headers, fetchTimeou
|
|
|
7920
7923
|
|
|
7921
7924
|
// src/lib/log-sink.ts
|
|
7922
7925
|
var OUTBOX_MAX_BYTES = 8 * 1024 * 1024;
|
|
7926
|
+
function describeFolderFallback(reason) {
|
|
7927
|
+
if (reason.kind === "anchor-unreadable") {
|
|
7928
|
+
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`";
|
|
7929
|
+
}
|
|
7930
|
+
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";
|
|
7931
|
+
}
|
|
7923
7932
|
var LOG_CONTEXT_LOOKUP_DEADLINE_MS = 3000;
|
|
7933
|
+
var LOG_DESTINATION_ANCHOR_DEADLINE_MS = 8000;
|
|
7924
7934
|
function withDeadline(work, ms, fallback) {
|
|
7925
7935
|
return new Promise((resolve) => {
|
|
7926
7936
|
const timer = setTimeout(() => resolve(fallback), ms);
|
|
@@ -7935,7 +7945,7 @@ function withDeadline(work, ms, fallback) {
|
|
|
7935
7945
|
});
|
|
7936
7946
|
}
|
|
7937
7947
|
async function safeLoadTrustAnchorConfig() {
|
|
7938
|
-
return withDeadline(loadTrustAnchorConfigAsync(undefined, { quiet: true }),
|
|
7948
|
+
return withDeadline(loadTrustAnchorConfigAsync(undefined, { quiet: true }), LOG_DESTINATION_ANCHOR_DEADLINE_MS, null);
|
|
7939
7949
|
}
|
|
7940
7950
|
function logsCredentialMissing(headers, env) {
|
|
7941
7951
|
if (!headers)
|
|
@@ -7952,8 +7962,16 @@ function logsCredentialMissing(headers, env) {
|
|
|
7952
7962
|
function resolveLogDestinationFrom(input) {
|
|
7953
7963
|
const local = resolveLogsSetting(input.localConfig);
|
|
7954
7964
|
let effective = null;
|
|
7965
|
+
let fallbackReason;
|
|
7955
7966
|
if (input.unattended) {
|
|
7956
|
-
|
|
7967
|
+
if (local) {
|
|
7968
|
+
effective = resolveTrustAnchorLogsDestination(local, input.trustAnchorConfig);
|
|
7969
|
+
if (effective === null && "url" in local) {
|
|
7970
|
+
fallbackReason = input.trustAnchorConfig === null ? { kind: "anchor-unreadable", intendedUrl: local.url } : { kind: "anchor-mismatch", intendedUrl: local.url };
|
|
7971
|
+
}
|
|
7972
|
+
} else {
|
|
7973
|
+
effective = resolveLogsSetting(input.trustAnchorConfig);
|
|
7974
|
+
}
|
|
7957
7975
|
} else {
|
|
7958
7976
|
effective = local;
|
|
7959
7977
|
}
|
|
@@ -7979,7 +7997,7 @@ function resolveLogDestinationFrom(input) {
|
|
|
7979
7997
|
effective = null;
|
|
7980
7998
|
}
|
|
7981
7999
|
const folder = effective && "folder" in effective ? effective.folder : input.defaultFolder;
|
|
7982
|
-
return { kind: "folder", folder };
|
|
8000
|
+
return fallbackReason ? { kind: "folder", folder, fallbackReason } : { kind: "folder", folder };
|
|
7983
8001
|
}
|
|
7984
8002
|
var processTrustAnchorOnce;
|
|
7985
8003
|
function processTrustAnchor() {
|
|
@@ -8358,6 +8376,10 @@ function createLogSink(overrides = {}) {
|
|
|
8358
8376
|
`);
|
|
8359
8377
|
return;
|
|
8360
8378
|
}
|
|
8379
|
+
if (resolvedDestination.kind === "folder" && resolvedDestination.fallbackReason) {
|
|
8380
|
+
warnOnce(`vinaya: ${describeFolderFallback(resolvedDestination.fallbackReason)}
|
|
8381
|
+
`);
|
|
8382
|
+
}
|
|
8361
8383
|
const branchIssue = envFields.task ? null : await branchIssueOnce(repo);
|
|
8362
8384
|
const header = buildHeader({
|
|
8363
8385
|
now,
|
|
@@ -9213,6 +9235,17 @@ var COMMANDS = [
|
|
|
9213
9235
|
"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)."
|
|
9214
9236
|
],
|
|
9215
9237
|
status: "shipped"
|
|
9238
|
+
},
|
|
9239
|
+
{
|
|
9240
|
+
name: "log send",
|
|
9241
|
+
description: "Deliver this repository's locally-held log events to the configured `logs.url` server, once",
|
|
9242
|
+
flags: [{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }],
|
|
9243
|
+
details: [
|
|
9244
|
+
"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.",
|
|
9245
|
+
"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.",
|
|
9246
|
+
"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."
|
|
9247
|
+
],
|
|
9248
|
+
status: "shipped"
|
|
9216
9249
|
}
|
|
9217
9250
|
];
|
|
9218
9251
|
// ../../packages/sources/src/forge-adapter.ts
|
|
@@ -3519,6 +3519,8 @@ function parseIssueSurface(body) {
|
|
|
3519
3519
|
function globCoversPath(glob, path) {
|
|
3520
3520
|
const g = glob.replace(/\/\*\*?$/, "").replace(/\/+$/, "");
|
|
3521
3521
|
const p = path.replace(/\/+$/, "");
|
|
3522
|
+
if (g === "*")
|
|
3523
|
+
return !p.includes("/");
|
|
3522
3524
|
return g === p || g.startsWith(`${p}/`) || p.startsWith(`${g}/`);
|
|
3523
3525
|
}
|
|
3524
3526
|
function checkSurfaceGlobsResolve(body, resolvesToFile) {
|
|
@@ -6767,7 +6769,8 @@ async function trustAnchorRepoAsync() {
|
|
|
6767
6769
|
try {
|
|
6768
6770
|
const { stdout } = await execFileAsync4("git", ["remote", "get-url", "origin"], {
|
|
6769
6771
|
encoding: "utf-8",
|
|
6770
|
-
timeout: 1e4
|
|
6772
|
+
timeout: 1e4,
|
|
6773
|
+
killSignal: "SIGKILL"
|
|
6771
6774
|
});
|
|
6772
6775
|
return trustAnchorRepoFromRemoteUrl(stdout);
|
|
6773
6776
|
} catch {
|
|
@@ -6828,7 +6831,7 @@ async function ghFetchTrustAnchorConfigAsync() {
|
|
|
6828
6831
|
const repo = await trustAnchorRepoAsync();
|
|
6829
6832
|
if (!repo)
|
|
6830
6833
|
throw new Error("could not resolve repo identity for the trust-anchor read");
|
|
6831
|
-
const { stdout } = await execFileAsync4("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], { encoding: "utf-8", timeout: 1e4 });
|
|
6834
|
+
const { stdout } = await execFileAsync4("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], { encoding: "utf-8", timeout: 1e4, killSignal: "SIGKILL" });
|
|
6832
6835
|
return stdout;
|
|
6833
6836
|
}
|
|
6834
6837
|
function firstLine(err) {
|
|
@@ -7598,6 +7601,17 @@ var COMMANDS = [
|
|
|
7598
7601
|
"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)."
|
|
7599
7602
|
],
|
|
7600
7603
|
status: "shipped"
|
|
7604
|
+
},
|
|
7605
|
+
{
|
|
7606
|
+
name: "log send",
|
|
7607
|
+
description: "Deliver this repository's locally-held log events to the configured `logs.url` server, once",
|
|
7608
|
+
flags: [{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }],
|
|
7609
|
+
details: [
|
|
7610
|
+
"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.",
|
|
7611
|
+
"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.",
|
|
7612
|
+
"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."
|
|
7613
|
+
],
|
|
7614
|
+
status: "shipped"
|
|
7601
7615
|
}
|
|
7602
7616
|
];
|
|
7603
7617
|
// ../../packages/sources/src/forge-adapter.ts
|
|
@@ -8809,7 +8823,14 @@ async function drainOutboxToWebhook(outboxTask, webhookUrl, headers, fetchTimeou
|
|
|
8809
8823
|
|
|
8810
8824
|
// src/lib/log-sink.ts
|
|
8811
8825
|
var OUTBOX_MAX_BYTES = 8 * 1024 * 1024;
|
|
8826
|
+
function describeFolderFallback(reason) {
|
|
8827
|
+
if (reason.kind === "anchor-unreadable") {
|
|
8828
|
+
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`";
|
|
8829
|
+
}
|
|
8830
|
+
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";
|
|
8831
|
+
}
|
|
8812
8832
|
var LOG_CONTEXT_LOOKUP_DEADLINE_MS = 3000;
|
|
8833
|
+
var LOG_DESTINATION_ANCHOR_DEADLINE_MS = 8000;
|
|
8813
8834
|
function withDeadline(work, ms, fallback) {
|
|
8814
8835
|
return new Promise((resolve) => {
|
|
8815
8836
|
const timer = setTimeout(() => resolve(fallback), ms);
|
|
@@ -8824,7 +8845,7 @@ function withDeadline(work, ms, fallback) {
|
|
|
8824
8845
|
});
|
|
8825
8846
|
}
|
|
8826
8847
|
async function safeLoadTrustAnchorConfig() {
|
|
8827
|
-
return withDeadline(loadTrustAnchorConfigAsync(undefined, { quiet: true }),
|
|
8848
|
+
return withDeadline(loadTrustAnchorConfigAsync(undefined, { quiet: true }), LOG_DESTINATION_ANCHOR_DEADLINE_MS, null);
|
|
8828
8849
|
}
|
|
8829
8850
|
function logsCredentialMissing(headers, env) {
|
|
8830
8851
|
if (!headers)
|
|
@@ -8841,8 +8862,16 @@ function logsCredentialMissing(headers, env) {
|
|
|
8841
8862
|
function resolveLogDestinationFrom(input) {
|
|
8842
8863
|
const local = resolveLogsSetting(input.localConfig);
|
|
8843
8864
|
let effective = null;
|
|
8865
|
+
let fallbackReason;
|
|
8844
8866
|
if (input.unattended) {
|
|
8845
|
-
|
|
8867
|
+
if (local) {
|
|
8868
|
+
effective = resolveTrustAnchorLogsDestination(local, input.trustAnchorConfig);
|
|
8869
|
+
if (effective === null && "url" in local) {
|
|
8870
|
+
fallbackReason = input.trustAnchorConfig === null ? { kind: "anchor-unreadable", intendedUrl: local.url } : { kind: "anchor-mismatch", intendedUrl: local.url };
|
|
8871
|
+
}
|
|
8872
|
+
} else {
|
|
8873
|
+
effective = resolveLogsSetting(input.trustAnchorConfig);
|
|
8874
|
+
}
|
|
8846
8875
|
} else {
|
|
8847
8876
|
effective = local;
|
|
8848
8877
|
}
|
|
@@ -8868,7 +8897,7 @@ function resolveLogDestinationFrom(input) {
|
|
|
8868
8897
|
effective = null;
|
|
8869
8898
|
}
|
|
8870
8899
|
const folder = effective && "folder" in effective ? effective.folder : input.defaultFolder;
|
|
8871
|
-
return { kind: "folder", folder };
|
|
8900
|
+
return fallbackReason ? { kind: "folder", folder, fallbackReason } : { kind: "folder", folder };
|
|
8872
8901
|
}
|
|
8873
8902
|
var processTrustAnchorOnce;
|
|
8874
8903
|
function processTrustAnchor() {
|
|
@@ -9247,6 +9276,10 @@ function createLogSink(overrides = {}) {
|
|
|
9247
9276
|
`);
|
|
9248
9277
|
return;
|
|
9249
9278
|
}
|
|
9279
|
+
if (resolvedDestination.kind === "folder" && resolvedDestination.fallbackReason) {
|
|
9280
|
+
warnOnce(`vinaya: ${describeFolderFallback(resolvedDestination.fallbackReason)}
|
|
9281
|
+
`);
|
|
9282
|
+
}
|
|
9250
9283
|
const branchIssue = envFields.task ? null : await branchIssueOnce(repo);
|
|
9251
9284
|
const header = buildHeader({
|
|
9252
9285
|
now,
|