@attalabs/vinaya 0.33.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/enforcement.md +1 -1
- package/aeg-root/glossary.md +4 -0
- package/aeg-root/roles/developer.md +3 -0
- package/aeg-root/roles/operator.md +30 -10
- package/aeg-root/roles/planner/reference.md +3 -2
- package/aeg-root/roles/planner.md +3 -1
- package/aeg-root/templates/brief-template.md +9 -7
- package/aeg-root/templates/pr-report-template.md +3 -1
- package/dist/checks/bin/check-body-bare-digits.js +107 -28
- package/dist/checks/bin/check-branch-topology.js +94 -25
- package/dist/checks/bin/check-brief-shape.js +113 -33
- package/dist/checks/bin/check-changeset-coverage.js +369 -92
- package/dist/checks/bin/check-closes-n.js +94 -25
- package/dist/checks/bin/check-coherence.js +124 -29
- package/dist/checks/bin/check-dead-branch-push.js +79 -25
- package/dist/checks/bin/check-dispatch-readiness.js +122 -28
- package/dist/checks/bin/check-doc-coverage-push.js +365 -88
- package/dist/checks/bin/check-doc-coverage.js +367 -90
- package/dist/checks/bin/check-doctrine-no-procedures.js +107 -28
- package/dist/checks/bin/check-doctrine-portability.js +366 -89
- package/dist/checks/bin/check-evidence-fresh.js +338 -61
- package/dist/checks/bin/check-exec-bits.js +363 -86
- package/dist/checks/bin/check-first-push-dispatch.js +122 -28
- package/dist/checks/bin/check-issue-assignment.js +94 -25
- package/dist/checks/bin/check-issue-milestone-attach.js +79 -25
- package/dist/checks/bin/check-issue-objectives-numbering.js +606 -26
- package/dist/checks/bin/check-issue-parts-coverage.js +79 -25
- package/dist/checks/bin/check-issue-surface-globs.js +162 -34
- package/dist/checks/bin/check-issue-title-grammar.js +79 -25
- package/dist/checks/bin/check-issue-tranche-label.js +79 -25
- package/dist/checks/bin/check-main-branch-refusal.js +79 -25
- package/dist/checks/bin/check-no-disk-state.js +79 -25
- package/dist/checks/bin/check-pr-premise-reassert.js +107 -28
- package/dist/checks/bin/check-pr-report-density.js +79 -25
- package/dist/checks/bin/check-principal-test-plan-wait.js +79 -25
- package/dist/checks/bin/check-quoted-command.js +282 -39
- package/dist/checks/bin/check-reader-resolvable-prose.js +333 -47
- package/dist/checks/bin/check-registry-gates.js +79 -25
- package/dist/checks/bin/check-retired-vocabulary.js +282 -39
- package/dist/checks/bin/check-review-gate.js +111 -31
- package/dist/checks/bin/check-single-plan-pr.js +79 -25
- package/dist/checks/bin/check-surface-scope.js +94 -25
- package/dist/checks/bin/check-test-plan.js +79 -25
- package/dist/checks/bin/check-token-collection-wired.js +79 -25
- package/dist/checks/bin/check-token-report.js +79 -25
- package/dist/checks/bin/check-workspace-escape.js +364 -87
- package/dist/index.js +2713 -1609
- package/dist/lib/pre-push-cache-test-run.js +226 -16
- package/dist/lib/pre-push-select-tests.js +48 -5
- 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/control-store/migration.ts +13 -3
- 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/index.ts +5 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/journal-reconstruction.ts +116 -20
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/render-summary.ts +100 -4
- 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 +60 -4
- 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/review-gate.ts +18 -3
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-policy.ts +24 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-status.ts +15 -10
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/ruling-ordinal.ts +16 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/task-phase-history.ts +194 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/task-tools.ts +312 -53
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/verdict-extraction.ts +62 -8
- 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 +4 -4
- 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]__18paley._.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/0ko698wh8xx2g.css +1 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{22s44f5k3ecmj.js → 3goaig_rysc6p.js} +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{1ce2dj27_cgbj.js → 3ip5z3cf43bgo.js} +4 -4
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{34hhdtbp20krb.js → 3u9emqjwpd0t9.js} +1 -1
- package/studio-standalone/apps/vinaya-studio/web/package.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0bm4nrrzwc7zi.css +0 -1
- /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/{aeg-core → vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/aeg-core}/bin/verify-coherence.ts +0 -0
- /package/studio-standalone/apps/vinaya-studio/web/.next/static/{vl7QVqELe1AQ-9kaOd9mR → ca66rAHI_w9D7S7ceXDvR}/_buildManifest.js +0 -0
- /package/studio-standalone/apps/vinaya-studio/web/.next/static/{vl7QVqELe1AQ-9kaOd9mR → ca66rAHI_w9D7S7ceXDvR}/_clientMiddlewareManifest.js +0 -0
- /package/studio-standalone/apps/vinaya-studio/web/.next/static/{vl7QVqELe1AQ-9kaOd9mR → ca66rAHI_w9D7S7ceXDvR}/_ssgManifest.js +0 -0
|
@@ -234,6 +234,33 @@ function entry(key) {
|
|
|
234
234
|
function label(key) {
|
|
235
235
|
return entry(key).id;
|
|
236
236
|
}
|
|
237
|
+
function trancheSlugOf(name) {
|
|
238
|
+
const prefix = entry("tranche").id;
|
|
239
|
+
return name.startsWith(prefix) ? name.slice(prefix.length) : null;
|
|
240
|
+
}
|
|
241
|
+
function findTrancheSlug(names) {
|
|
242
|
+
for (const n of names) {
|
|
243
|
+
const slug = trancheSlugOf(n);
|
|
244
|
+
if (slug !== null)
|
|
245
|
+
return slug;
|
|
246
|
+
}
|
|
247
|
+
return null;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// ../../packages/aeg-forge-state/src/list-tasks.ts
|
|
251
|
+
var TITLE_PATTERN = /^\[([^\]]+)]\s*(\S+)\s*—\s*(.+)$/;
|
|
252
|
+
function resolveTaskIssueRef(title, labels) {
|
|
253
|
+
const m = title.match(TITLE_PATTERN);
|
|
254
|
+
if (!m)
|
|
255
|
+
return null;
|
|
256
|
+
const taskId = (m[2] ?? "").trim();
|
|
257
|
+
if (!taskId)
|
|
258
|
+
return null;
|
|
259
|
+
const trancheSlug = findTrancheSlug(labels);
|
|
260
|
+
if (!trancheSlug)
|
|
261
|
+
return null;
|
|
262
|
+
return { trancheSlug, taskId };
|
|
263
|
+
}
|
|
237
264
|
// ../../packages/aeg-forge-state/src/github-token.ts
|
|
238
265
|
import { execFile as execFile2 } from "node:child_process";
|
|
239
266
|
import { promisify as promisify2 } from "node:util";
|
|
@@ -552,7 +579,8 @@ var TaskStatusItemSchema = z.object({
|
|
|
552
579
|
}).merge(ObservedSchema);
|
|
553
580
|
var TaskStatusResultSchema = z.object({
|
|
554
581
|
items: z.array(TaskStatusItemSchema),
|
|
555
|
-
nextCursor: z.string().nullable()
|
|
582
|
+
nextCursor: z.string().nullable(),
|
|
583
|
+
table: z.string()
|
|
556
584
|
});
|
|
557
585
|
var RequestedAuthoritySchema = z.enum(["planner", "principal", "operator", "self"]);
|
|
558
586
|
var EscalationInputsSchema = z.object({
|
|
@@ -1123,6 +1151,8 @@ function attemptFromEnv(value) {
|
|
|
1123
1151
|
function provenanceFor(input) {
|
|
1124
1152
|
if (input.provenance)
|
|
1125
1153
|
return input.provenance;
|
|
1154
|
+
if (issueFromTask(input.env.task) === null && (input.branchIssue ?? null) !== null)
|
|
1155
|
+
return "unavailable";
|
|
1126
1156
|
if (input.env.role || input.env.task)
|
|
1127
1157
|
return "env_correlated";
|
|
1128
1158
|
return "unavailable";
|
|
@@ -1143,7 +1173,7 @@ function buildHeader(input) {
|
|
|
1143
1173
|
const role = isRole(input.env.role) ? input.env.role : "unattributed";
|
|
1144
1174
|
const round = roundFromEnv(input.env.round);
|
|
1145
1175
|
const subject = {
|
|
1146
|
-
issue: issueFromTask(input.env.task),
|
|
1176
|
+
issue: issueFromTask(input.env.task) ?? input.branchIssue ?? null,
|
|
1147
1177
|
role,
|
|
1148
1178
|
...round !== undefined ? { round } : {},
|
|
1149
1179
|
...input.subject ?? {}
|
|
@@ -2262,7 +2292,12 @@ var VinayaConfigSchema = z4.object({
|
|
|
2262
2292
|
allowlist: z4.array(z4.string().min(1)).optional(),
|
|
2263
2293
|
severity: z4.enum(["warning", "error"]).optional()
|
|
2264
2294
|
}).optional(),
|
|
2265
|
-
specGrandfather: z4.array(z4.string().min(1)).optional()
|
|
2295
|
+
specGrandfather: z4.array(z4.string().min(1)).optional(),
|
|
2296
|
+
specPaths: z4.array(z4.string().min(1).refine((entry) => !entry.startsWith("/") && !/^[A-Za-z]:/.test(entry), {
|
|
2297
|
+
message: "must be a repository-relative path, not an absolute one"
|
|
2298
|
+
}).refine((entry) => !entry.split(/[\\/]/).includes(".."), {
|
|
2299
|
+
message: "must stay inside the repository — no `..` segment"
|
|
2300
|
+
})).optional()
|
|
2266
2301
|
}).optional(),
|
|
2267
2302
|
projects: z4.array(ProjectEntrySchema).optional(),
|
|
2268
2303
|
dispatch: z4.object({
|
|
@@ -2276,6 +2311,13 @@ var VinayaConfigSchema = z4.object({
|
|
|
2276
2311
|
securityThreshold: z4.string().min(1).optional(),
|
|
2277
2312
|
maxRounds: z4.number().optional()
|
|
2278
2313
|
}).optional(),
|
|
2314
|
+
gateCutovers: z4.object({
|
|
2315
|
+
objectivesSinceIssue: z4.number().int().nonnegative().optional(),
|
|
2316
|
+
briefSectionsSinceIssue: z4.number().int().nonnegative().optional(),
|
|
2317
|
+
documentationSinceIssue: z4.number().int().nonnegative().optional(),
|
|
2318
|
+
briefRulesSincePr: z4.number().int().nonnegative().optional(),
|
|
2319
|
+
agentBoxesRefusedSincePr: z4.number().int().nonnegative().optional()
|
|
2320
|
+
}).optional(),
|
|
2279
2321
|
prePush: z4.object({
|
|
2280
2322
|
alwaysRun: z4.array(z4.string()).optional()
|
|
2281
2323
|
}).optional(),
|
|
@@ -2440,7 +2482,8 @@ async function trustAnchorRepoAsync() {
|
|
|
2440
2482
|
try {
|
|
2441
2483
|
const { stdout } = await execFileAsync4("git", ["remote", "get-url", "origin"], {
|
|
2442
2484
|
encoding: "utf-8",
|
|
2443
|
-
timeout: 1e4
|
|
2485
|
+
timeout: 1e4,
|
|
2486
|
+
killSignal: "SIGKILL"
|
|
2444
2487
|
});
|
|
2445
2488
|
return trustAnchorRepoFromRemoteUrl(stdout);
|
|
2446
2489
|
} catch {
|
|
@@ -2501,7 +2544,7 @@ async function ghFetchTrustAnchorConfigAsync() {
|
|
|
2501
2544
|
const repo = await trustAnchorRepoAsync();
|
|
2502
2545
|
if (!repo)
|
|
2503
2546
|
throw new Error("could not resolve repo identity for the trust-anchor read");
|
|
2504
|
-
const { stdout } = await execFileAsync4("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], { encoding: "utf-8", timeout: 1e4 });
|
|
2547
|
+
const { stdout } = await execFileAsync4("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], { encoding: "utf-8", timeout: 1e4, killSignal: "SIGKILL" });
|
|
2505
2548
|
return stdout;
|
|
2506
2549
|
}
|
|
2507
2550
|
function firstLine(err) {
|
|
@@ -3092,7 +3135,14 @@ async function drainOutboxToWebhook(outboxTask, webhookUrl, headers, fetchTimeou
|
|
|
3092
3135
|
|
|
3093
3136
|
// src/lib/log-sink.ts
|
|
3094
3137
|
var OUTBOX_MAX_BYTES = 8 * 1024 * 1024;
|
|
3138
|
+
function describeFolderFallback(reason) {
|
|
3139
|
+
if (reason.kind === "anchor-unreadable") {
|
|
3140
|
+
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`";
|
|
3141
|
+
}
|
|
3142
|
+
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";
|
|
3143
|
+
}
|
|
3095
3144
|
var LOG_CONTEXT_LOOKUP_DEADLINE_MS = 3000;
|
|
3145
|
+
var LOG_DESTINATION_ANCHOR_DEADLINE_MS = 8000;
|
|
3096
3146
|
function withDeadline(work, ms, fallback) {
|
|
3097
3147
|
return new Promise((resolve) => {
|
|
3098
3148
|
const timer = setTimeout(() => resolve(fallback), ms);
|
|
@@ -3107,7 +3157,7 @@ function withDeadline(work, ms, fallback) {
|
|
|
3107
3157
|
});
|
|
3108
3158
|
}
|
|
3109
3159
|
async function safeLoadTrustAnchorConfig() {
|
|
3110
|
-
return withDeadline(loadTrustAnchorConfigAsync(undefined, { quiet: true }),
|
|
3160
|
+
return withDeadline(loadTrustAnchorConfigAsync(undefined, { quiet: true }), LOG_DESTINATION_ANCHOR_DEADLINE_MS, null);
|
|
3111
3161
|
}
|
|
3112
3162
|
function logsCredentialMissing(headers, env) {
|
|
3113
3163
|
if (!headers)
|
|
@@ -3124,8 +3174,16 @@ function logsCredentialMissing(headers, env) {
|
|
|
3124
3174
|
function resolveLogDestinationFrom(input) {
|
|
3125
3175
|
const local = resolveLogsSetting(input.localConfig);
|
|
3126
3176
|
let effective = null;
|
|
3177
|
+
let fallbackReason;
|
|
3127
3178
|
if (input.unattended) {
|
|
3128
|
-
|
|
3179
|
+
if (local) {
|
|
3180
|
+
effective = resolveTrustAnchorLogsDestination(local, input.trustAnchorConfig);
|
|
3181
|
+
if (effective === null && "url" in local) {
|
|
3182
|
+
fallbackReason = input.trustAnchorConfig === null ? { kind: "anchor-unreadable", intendedUrl: local.url } : { kind: "anchor-mismatch", intendedUrl: local.url };
|
|
3183
|
+
}
|
|
3184
|
+
} else {
|
|
3185
|
+
effective = resolveLogsSetting(input.trustAnchorConfig);
|
|
3186
|
+
}
|
|
3129
3187
|
} else {
|
|
3130
3188
|
effective = local;
|
|
3131
3189
|
}
|
|
@@ -3151,7 +3209,7 @@ function resolveLogDestinationFrom(input) {
|
|
|
3151
3209
|
effective = null;
|
|
3152
3210
|
}
|
|
3153
3211
|
const folder = effective && "folder" in effective ? effective.folder : input.defaultFolder;
|
|
3154
|
-
return { kind: "folder", folder };
|
|
3212
|
+
return fallbackReason ? { kind: "folder", folder, fallbackReason } : { kind: "folder", folder };
|
|
3155
3213
|
}
|
|
3156
3214
|
var processTrustAnchorOnce;
|
|
3157
3215
|
function processTrustAnchor() {
|
|
@@ -3191,6 +3249,96 @@ async function resolveDoctrine(cwd, vinayaVersion) {
|
|
|
3191
3249
|
return vinayaVersion;
|
|
3192
3250
|
}
|
|
3193
3251
|
}
|
|
3252
|
+
var TRANCHE_SLUG_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
|
|
3253
|
+
function taskRefFromBranch2(branch) {
|
|
3254
|
+
const backlog = /^task\/issue-(\d+)$/.exec(branch);
|
|
3255
|
+
if (backlog) {
|
|
3256
|
+
const issue = Number(backlog[1]);
|
|
3257
|
+
return Number.isSafeInteger(issue) && issue > 0 ? { kind: "issue", issue } : null;
|
|
3258
|
+
}
|
|
3259
|
+
const tranche = /^task\/([^/]+)\/([^/]+)$/.exec(branch);
|
|
3260
|
+
if (tranche && TRANCHE_SLUG_PATTERN.test(tranche[1] ?? "")) {
|
|
3261
|
+
return { kind: "tranche", tranche: tranche[1], taskId: tranche[2] };
|
|
3262
|
+
}
|
|
3263
|
+
return null;
|
|
3264
|
+
}
|
|
3265
|
+
var TRANCHE_ISSUE_LIST_LIMIT = 200;
|
|
3266
|
+
async function issueForTrancheTask(tranche, taskId, cwd, repo) {
|
|
3267
|
+
let stdout;
|
|
3268
|
+
try {
|
|
3269
|
+
({ stdout } = await execFileAsync5("gh", [
|
|
3270
|
+
"issue",
|
|
3271
|
+
"list",
|
|
3272
|
+
"--state",
|
|
3273
|
+
"all",
|
|
3274
|
+
"--label",
|
|
3275
|
+
`vinaya/tranche:${tranche}`,
|
|
3276
|
+
"--json",
|
|
3277
|
+
"number,title,labels",
|
|
3278
|
+
"--limit",
|
|
3279
|
+
String(TRANCHE_ISSUE_LIST_LIMIT),
|
|
3280
|
+
...repo === null ? [] : ["--repo", repo]
|
|
3281
|
+
], {
|
|
3282
|
+
cwd,
|
|
3283
|
+
encoding: "utf8",
|
|
3284
|
+
maxBuffer: 8 * 1024 * 1024,
|
|
3285
|
+
timeout: LOG_CONTEXT_LOOKUP_DEADLINE_MS,
|
|
3286
|
+
killSignal: "SIGKILL"
|
|
3287
|
+
}));
|
|
3288
|
+
} catch {
|
|
3289
|
+
return null;
|
|
3290
|
+
}
|
|
3291
|
+
let issues;
|
|
3292
|
+
try {
|
|
3293
|
+
issues = JSON.parse(stdout);
|
|
3294
|
+
} catch {
|
|
3295
|
+
return null;
|
|
3296
|
+
}
|
|
3297
|
+
for (const issue of issues) {
|
|
3298
|
+
const ref = resolveTaskIssueRef(issue.title, issue.labels.map((l) => l.name));
|
|
3299
|
+
if (ref && ref.trancheSlug === tranche && ref.taskId === taskId)
|
|
3300
|
+
return issue.number;
|
|
3301
|
+
}
|
|
3302
|
+
return null;
|
|
3303
|
+
}
|
|
3304
|
+
async function confirmBacklogIssue(issue, cwd, repo) {
|
|
3305
|
+
let stdout;
|
|
3306
|
+
try {
|
|
3307
|
+
({ stdout } = await execFileAsync5("gh", ["issue", "view", String(issue), "--json", "number", ...repo === null ? [] : ["--repo", repo]], {
|
|
3308
|
+
cwd,
|
|
3309
|
+
encoding: "utf8",
|
|
3310
|
+
timeout: LOG_CONTEXT_LOOKUP_DEADLINE_MS,
|
|
3311
|
+
killSignal: "SIGKILL"
|
|
3312
|
+
}));
|
|
3313
|
+
} catch (err) {
|
|
3314
|
+
const stderr = typeof err.stderr === "string" ? err.stderr : "";
|
|
3315
|
+
return /could not resolve|not found|no such|does not exist/i.test(stderr) ? "denied" : "unknown";
|
|
3316
|
+
}
|
|
3317
|
+
try {
|
|
3318
|
+
return JSON.parse(stdout).number === issue ? "confirmed" : "denied";
|
|
3319
|
+
} catch {
|
|
3320
|
+
return "unknown";
|
|
3321
|
+
}
|
|
3322
|
+
}
|
|
3323
|
+
async function resolveBranchIssue(cwd, env = process.env, repo = null) {
|
|
3324
|
+
let branch;
|
|
3325
|
+
try {
|
|
3326
|
+
branch = (await execFileAsync5("git", ["-C", cwd, "rev-parse", "--abbrev-ref", "HEAD"], {
|
|
3327
|
+
encoding: "utf8",
|
|
3328
|
+
timeout: LOG_CONTEXT_LOOKUP_DEADLINE_MS,
|
|
3329
|
+
killSignal: "SIGKILL"
|
|
3330
|
+
})).stdout.trim();
|
|
3331
|
+
} catch {
|
|
3332
|
+
return null;
|
|
3333
|
+
}
|
|
3334
|
+
const named = branch === "HEAD" ? env.GITHUB_HEAD_REF ?? "" : branch;
|
|
3335
|
+
const ref = taskRefFromBranch2(named);
|
|
3336
|
+
if (ref === null)
|
|
3337
|
+
return null;
|
|
3338
|
+
if (ref.kind === "tranche")
|
|
3339
|
+
return await issueForTrancheTask(ref.tranche, ref.taskId, cwd, repo);
|
|
3340
|
+
return await confirmBacklogIssue(ref.issue, cwd, repo) === "denied" ? null : ref.issue;
|
|
3341
|
+
}
|
|
3194
3342
|
function readVinayaVersion() {
|
|
3195
3343
|
try {
|
|
3196
3344
|
const pkg = JSON.parse(readFileSync5(join7(packageRoot(import.meta.url), "package.json"), "utf8"));
|
|
@@ -3203,6 +3351,11 @@ var SAFE_PATH_SEGMENT3 = /^[A-Za-z0-9](?:[A-Za-z0-9._-]*[A-Za-z0-9])?$/;
|
|
|
3203
3351
|
function isSafeRepoSegment3(segment) {
|
|
3204
3352
|
return SAFE_PATH_SEGMENT3.test(segment) && !segment.includes("..");
|
|
3205
3353
|
}
|
|
3354
|
+
function safeRepoSlug(repo) {
|
|
3355
|
+
if (repo === null)
|
|
3356
|
+
return null;
|
|
3357
|
+
return isSafeRepoSegment3(repo.owner) && isSafeRepoSegment3(repo.repo) ? `${repo.owner}/${repo.repo}` : null;
|
|
3358
|
+
}
|
|
3206
3359
|
function outboxPathFor(deps, repo, issue) {
|
|
3207
3360
|
const dirName = repo ? `${repo.owner}-${repo.repo}` : "unresolved";
|
|
3208
3361
|
const fileName = `${issue ?? "none"}.ndjson`;
|
|
@@ -3224,6 +3377,18 @@ function defaultStderr(message) {
|
|
|
3224
3377
|
warnedThisProcess = true;
|
|
3225
3378
|
process.stderr.write(message);
|
|
3226
3379
|
}
|
|
3380
|
+
var branchIssueFallbackEnabled = true;
|
|
3381
|
+
var branchIssueByCwd = new Map;
|
|
3382
|
+
function branchIssueRead(key, read, shared) {
|
|
3383
|
+
if (!shared)
|
|
3384
|
+
return withDeadline(Promise.resolve().then(read), LOG_CONTEXT_LOOKUP_DEADLINE_MS, null);
|
|
3385
|
+
const cached = branchIssueByCwd.get(key);
|
|
3386
|
+
if (cached !== undefined)
|
|
3387
|
+
return cached;
|
|
3388
|
+
const reading = withDeadline(Promise.resolve().then(read), LOG_CONTEXT_LOOKUP_DEADLINE_MS, null);
|
|
3389
|
+
branchIssueByCwd.set(key, reading);
|
|
3390
|
+
return reading;
|
|
3391
|
+
}
|
|
3227
3392
|
function defaultDeps() {
|
|
3228
3393
|
return {
|
|
3229
3394
|
outboxRoot: () => join7(GLOBAL_VINAYA_HOME, "outbox"),
|
|
@@ -3334,7 +3499,11 @@ function appendLine(path, line, warn) {
|
|
|
3334
3499
|
}
|
|
3335
3500
|
}
|
|
3336
3501
|
function createLogSink(overrides = {}) {
|
|
3337
|
-
const deps = {
|
|
3502
|
+
const deps = {
|
|
3503
|
+
...defaultDeps(),
|
|
3504
|
+
resolveBranchIssue: (repo) => resolveBranchIssue(deps.cwd(), deps.env(), repo),
|
|
3505
|
+
...overrides
|
|
3506
|
+
};
|
|
3338
3507
|
const runId = deps.env().VINAYA_RUN_ID || randomUUID2();
|
|
3339
3508
|
const processId = randomUUID2();
|
|
3340
3509
|
let seq = 0;
|
|
@@ -3354,6 +3523,19 @@ function createLogSink(overrides = {}) {
|
|
|
3354
3523
|
}
|
|
3355
3524
|
return doctrineCache;
|
|
3356
3525
|
};
|
|
3526
|
+
const readerIsReal = overrides.resolveBranchIssue === undefined;
|
|
3527
|
+
let ownBranchIssue;
|
|
3528
|
+
const branchIssueOnce = (repo) => {
|
|
3529
|
+
if (!branchIssueFallbackEnabled)
|
|
3530
|
+
return Promise.resolve(null);
|
|
3531
|
+
const slug = safeRepoSlug(repo);
|
|
3532
|
+
const read = () => deps.resolveBranchIssue(slug);
|
|
3533
|
+
if (readerIsReal)
|
|
3534
|
+
return branchIssueRead(`${deps.cwd()}\x00${slug ?? ""}`, read, true);
|
|
3535
|
+
if (ownBranchIssue === undefined)
|
|
3536
|
+
ownBranchIssue = branchIssueRead(deps.cwd(), read, false);
|
|
3537
|
+
return ownBranchIssue;
|
|
3538
|
+
};
|
|
3357
3539
|
let resolveRepoCache;
|
|
3358
3540
|
const resolveRepoOnce = () => {
|
|
3359
3541
|
if (resolveRepoCache === undefined)
|
|
@@ -3376,6 +3558,7 @@ function createLogSink(overrides = {}) {
|
|
|
3376
3558
|
};
|
|
3377
3559
|
let drainChain = Promise.resolve();
|
|
3378
3560
|
const pendingWrites = new Set;
|
|
3561
|
+
let writeChain = Promise.resolve();
|
|
3379
3562
|
const scheduleWebhookDrain = (issue, url, headers) => {
|
|
3380
3563
|
drainChain = drainChain.then(() => drainOutboxToWebhook(issue, url, headers)).then(() => {
|
|
3381
3564
|
return;
|
|
@@ -3398,7 +3581,18 @@ function createLogSink(overrides = {}) {
|
|
|
3398
3581
|
attempt: env.VINAYA_ATTEMPT,
|
|
3399
3582
|
parent: env.VINAYA_PARENT_EVENT
|
|
3400
3583
|
};
|
|
3401
|
-
const
|
|
3584
|
+
const write = async () => {
|
|
3585
|
+
const { repo, doctrine: doctrineValue, destination: resolvedDestination } = await context();
|
|
3586
|
+
if (resolvedDestination.kind === "none") {
|
|
3587
|
+
warnOnce(`vinaya: not recording — ${resolvedDestination.reason}
|
|
3588
|
+
`);
|
|
3589
|
+
return;
|
|
3590
|
+
}
|
|
3591
|
+
if (resolvedDestination.kind === "folder" && resolvedDestination.fallbackReason) {
|
|
3592
|
+
warnOnce(`vinaya: ${describeFolderFallback(resolvedDestination.fallbackReason)}
|
|
3593
|
+
`);
|
|
3594
|
+
}
|
|
3595
|
+
const branchIssue = envFields.task ? null : await branchIssueOnce(repo);
|
|
3402
3596
|
const header = buildHeader({
|
|
3403
3597
|
now,
|
|
3404
3598
|
runId,
|
|
@@ -3409,15 +3603,11 @@ function createLogSink(overrides = {}) {
|
|
|
3409
3603
|
host,
|
|
3410
3604
|
hostname: deps.hostname(),
|
|
3411
3605
|
env: envFields,
|
|
3606
|
+
branchIssue,
|
|
3412
3607
|
eventId: randomUUID2(),
|
|
3413
3608
|
processId,
|
|
3414
3609
|
inputVersions: deps.inputVersions()
|
|
3415
3610
|
});
|
|
3416
|
-
if (resolvedDestination.kind === "none") {
|
|
3417
|
-
warnOnce(`vinaya: not recording — ${resolvedDestination.reason}
|
|
3418
|
-
`);
|
|
3419
|
-
return;
|
|
3420
|
-
}
|
|
3421
3611
|
const full = { ...e, ...header };
|
|
3422
3612
|
const parsed = LogEventSchema.safeParse(full);
|
|
3423
3613
|
if (!parsed.success) {
|
|
@@ -3434,10 +3624,12 @@ function createLogSink(overrides = {}) {
|
|
|
3434
3624
|
} else {
|
|
3435
3625
|
appendLine(outboxPathFor({ outboxRoot: () => destination.folder }, repo, header.subject.issue), line, warnOnce);
|
|
3436
3626
|
}
|
|
3437
|
-
}
|
|
3627
|
+
};
|
|
3628
|
+
const written = writeChain.then(write).catch((err) => {
|
|
3438
3629
|
warnOnce(`vinaya: log() failed — ${err instanceof Error ? err.message : String(err)}
|
|
3439
3630
|
`);
|
|
3440
3631
|
});
|
|
3632
|
+
writeChain = written;
|
|
3441
3633
|
pendingWrites.add(written);
|
|
3442
3634
|
written.finally(() => pendingWrites.delete(written));
|
|
3443
3635
|
} catch (err) {
|
|
@@ -3980,6 +4172,10 @@ var COMMANDS = [
|
|
|
3980
4172
|
flag: "--role <name>",
|
|
3981
4173
|
description: "Resolve to a specific role file (roles/<name>.md) instead of the front door"
|
|
3982
4174
|
},
|
|
4175
|
+
{
|
|
4176
|
+
flag: "--template <name>",
|
|
4177
|
+
description: "Print a template the package ships (templates/<name>-template.md) instead of the front door"
|
|
4178
|
+
},
|
|
3983
4179
|
{
|
|
3984
4180
|
flag: "--print",
|
|
3985
4181
|
description: "Emit the resolved file's body (frontmatter stripped) instead of its path — the one-hop mode every generated skill and slash command invokes. A role file whose frontmatter carries an `ack-token` emits that token as the output's own first line."
|
|
@@ -4164,6 +4360,17 @@ var COMMANDS = [
|
|
|
4164
4360
|
"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)."
|
|
4165
4361
|
],
|
|
4166
4362
|
status: "shipped"
|
|
4363
|
+
},
|
|
4364
|
+
{
|
|
4365
|
+
name: "log send",
|
|
4366
|
+
description: "Deliver this repository's locally-held log events to the configured `logs.url` server, once",
|
|
4367
|
+
flags: [{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }],
|
|
4368
|
+
details: [
|
|
4369
|
+
"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.",
|
|
4370
|
+
"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.",
|
|
4371
|
+
"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."
|
|
4372
|
+
],
|
|
4373
|
+
status: "shipped"
|
|
4167
4374
|
}
|
|
4168
4375
|
];
|
|
4169
4376
|
// ../../packages/sources/src/select-source.ts
|
|
@@ -4176,6 +4383,9 @@ var StateSourceConfigSchema = z5.discriminatedUnion("kind", [
|
|
|
4176
4383
|
var issueCache = new Map;
|
|
4177
4384
|
var siblingTrancheCache = new Map;
|
|
4178
4385
|
|
|
4386
|
+
// src/commands/doctrine.ts
|
|
4387
|
+
import matter2 from "gray-matter";
|
|
4388
|
+
|
|
4179
4389
|
// src/lib/brief-assembly.ts
|
|
4180
4390
|
var PACKAGE_ROOT = packageRoot(import.meta.url);
|
|
4181
4391
|
var PACKAGED_TEMPLATE_PATH = join8(PACKAGE_ROOT, "aeg-root", "templates", "brief-template.md");
|
|
@@ -338,6 +338,33 @@ function entry(key) {
|
|
|
338
338
|
function label(key) {
|
|
339
339
|
return entry(key).id;
|
|
340
340
|
}
|
|
341
|
+
function trancheSlugOf(name) {
|
|
342
|
+
const prefix = entry("tranche").id;
|
|
343
|
+
return name.startsWith(prefix) ? name.slice(prefix.length) : null;
|
|
344
|
+
}
|
|
345
|
+
function findTrancheSlug(names) {
|
|
346
|
+
for (const n of names) {
|
|
347
|
+
const slug = trancheSlugOf(n);
|
|
348
|
+
if (slug !== null)
|
|
349
|
+
return slug;
|
|
350
|
+
}
|
|
351
|
+
return null;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
// ../../packages/aeg-forge-state/src/list-tasks.ts
|
|
355
|
+
var TITLE_PATTERN = /^\[([^\]]+)]\s*(\S+)\s*—\s*(.+)$/;
|
|
356
|
+
function resolveTaskIssueRef(title, labels) {
|
|
357
|
+
const m = title.match(TITLE_PATTERN);
|
|
358
|
+
if (!m)
|
|
359
|
+
return null;
|
|
360
|
+
const taskId = (m[2] ?? "").trim();
|
|
361
|
+
if (!taskId)
|
|
362
|
+
return null;
|
|
363
|
+
const trancheSlug = findTrancheSlug(labels);
|
|
364
|
+
if (!trancheSlug)
|
|
365
|
+
return null;
|
|
366
|
+
return { trancheSlug, taskId };
|
|
367
|
+
}
|
|
341
368
|
// ../../packages/aeg-forge-state/src/github-token.ts
|
|
342
369
|
import { execFile as execFile2 } from "node:child_process";
|
|
343
370
|
import { promisify as promisify2 } from "node:util";
|
|
@@ -656,7 +683,8 @@ var TaskStatusItemSchema = z.object({
|
|
|
656
683
|
}).merge(ObservedSchema);
|
|
657
684
|
var TaskStatusResultSchema = z.object({
|
|
658
685
|
items: z.array(TaskStatusItemSchema),
|
|
659
|
-
nextCursor: z.string().nullable()
|
|
686
|
+
nextCursor: z.string().nullable(),
|
|
687
|
+
table: z.string()
|
|
660
688
|
});
|
|
661
689
|
var RequestedAuthoritySchema = z.enum(["planner", "principal", "operator", "self"]);
|
|
662
690
|
var EscalationInputsSchema = z.object({
|
|
@@ -1227,6 +1255,8 @@ function attemptFromEnv(value) {
|
|
|
1227
1255
|
function provenanceFor(input) {
|
|
1228
1256
|
if (input.provenance)
|
|
1229
1257
|
return input.provenance;
|
|
1258
|
+
if (issueFromTask(input.env.task) === null && (input.branchIssue ?? null) !== null)
|
|
1259
|
+
return "unavailable";
|
|
1230
1260
|
if (input.env.role || input.env.task)
|
|
1231
1261
|
return "env_correlated";
|
|
1232
1262
|
return "unavailable";
|
|
@@ -1247,7 +1277,7 @@ function buildHeader(input) {
|
|
|
1247
1277
|
const role = isRole(input.env.role) ? input.env.role : "unattributed";
|
|
1248
1278
|
const round = roundFromEnv(input.env.round);
|
|
1249
1279
|
const subject = {
|
|
1250
|
-
issue: issueFromTask(input.env.task),
|
|
1280
|
+
issue: issueFromTask(input.env.task) ?? input.branchIssue ?? null,
|
|
1251
1281
|
role,
|
|
1252
1282
|
...round !== undefined ? { round } : {},
|
|
1253
1283
|
...input.subject ?? {}
|
|
@@ -1755,7 +1785,12 @@ var VinayaConfigSchema = z4.object({
|
|
|
1755
1785
|
allowlist: z4.array(z4.string().min(1)).optional(),
|
|
1756
1786
|
severity: z4.enum(["warning", "error"]).optional()
|
|
1757
1787
|
}).optional(),
|
|
1758
|
-
specGrandfather: z4.array(z4.string().min(1)).optional()
|
|
1788
|
+
specGrandfather: z4.array(z4.string().min(1)).optional(),
|
|
1789
|
+
specPaths: z4.array(z4.string().min(1).refine((entry) => !entry.startsWith("/") && !/^[A-Za-z]:/.test(entry), {
|
|
1790
|
+
message: "must be a repository-relative path, not an absolute one"
|
|
1791
|
+
}).refine((entry) => !entry.split(/[\\/]/).includes(".."), {
|
|
1792
|
+
message: "must stay inside the repository — no `..` segment"
|
|
1793
|
+
})).optional()
|
|
1759
1794
|
}).optional(),
|
|
1760
1795
|
projects: z4.array(ProjectEntrySchema).optional(),
|
|
1761
1796
|
dispatch: z4.object({
|
|
@@ -1769,6 +1804,13 @@ var VinayaConfigSchema = z4.object({
|
|
|
1769
1804
|
securityThreshold: z4.string().min(1).optional(),
|
|
1770
1805
|
maxRounds: z4.number().optional()
|
|
1771
1806
|
}).optional(),
|
|
1807
|
+
gateCutovers: z4.object({
|
|
1808
|
+
objectivesSinceIssue: z4.number().int().nonnegative().optional(),
|
|
1809
|
+
briefSectionsSinceIssue: z4.number().int().nonnegative().optional(),
|
|
1810
|
+
documentationSinceIssue: z4.number().int().nonnegative().optional(),
|
|
1811
|
+
briefRulesSincePr: z4.number().int().nonnegative().optional(),
|
|
1812
|
+
agentBoxesRefusedSincePr: z4.number().int().nonnegative().optional()
|
|
1813
|
+
}).optional(),
|
|
1772
1814
|
prePush: z4.object({
|
|
1773
1815
|
alwaysRun: z4.array(z4.string()).optional()
|
|
1774
1816
|
}).optional(),
|
|
@@ -1933,7 +1975,8 @@ async function trustAnchorRepoAsync() {
|
|
|
1933
1975
|
try {
|
|
1934
1976
|
const { stdout } = await execFileAsync4("git", ["remote", "get-url", "origin"], {
|
|
1935
1977
|
encoding: "utf-8",
|
|
1936
|
-
timeout: 1e4
|
|
1978
|
+
timeout: 1e4,
|
|
1979
|
+
killSignal: "SIGKILL"
|
|
1937
1980
|
});
|
|
1938
1981
|
return trustAnchorRepoFromRemoteUrl(stdout);
|
|
1939
1982
|
} catch {
|
|
@@ -1994,7 +2037,7 @@ async function ghFetchTrustAnchorConfigAsync() {
|
|
|
1994
2037
|
const repo = await trustAnchorRepoAsync();
|
|
1995
2038
|
if (!repo)
|
|
1996
2039
|
throw new Error("could not resolve repo identity for the trust-anchor read");
|
|
1997
|
-
const { stdout } = await execFileAsync4("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], { encoding: "utf-8", timeout: 1e4 });
|
|
2040
|
+
const { stdout } = await execFileAsync4("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], { encoding: "utf-8", timeout: 1e4, killSignal: "SIGKILL" });
|
|
1998
2041
|
return stdout;
|
|
1999
2042
|
}
|
|
2000
2043
|
function firstLine(err) {
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@attalabs/vinaya",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.35.0",
|
|
4
4
|
"description": "Vinaya — Agentic Engineering Harness. Deterministic checks every AI coding agent must satisfy before merge.",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"license": "
|
|
6
|
+
"license": "FSL-1.1-ALv2",
|
|
7
7
|
"author": "Daniel Estevez",
|
|
8
8
|
"bin": {
|
|
9
9
|
"vinaya": "./dist/index.js",
|