@attalabs/vinaya 0.31.0 → 0.33.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/README.md +2 -3
- package/aeg-root/contracts/principal-operator.md +18 -5
- package/aeg-root/roles/developer/reference.md +3 -3
- package/aeg-root/roles/operator.md +69 -16
- package/aeg-root/roles/planner/reference.md +1 -1
- package/aeg-root/roles/tranche-archivist.md +1 -0
- package/aeg-root/skills/aeg-context-packets/SKILL.md +1 -1
- package/aeg-root/skills/aeg-context-packets/examples/operator-start.md +1 -1
- package/aeg-root/templates/pr-report-template.md +7 -2
- package/dist/checks/bin/check-body-bare-digits.js +340 -101
- package/dist/checks/bin/check-branch-topology.js +184 -105
- package/dist/checks/bin/check-brief-shape.js +333 -94
- package/dist/checks/bin/check-changeset-coverage.js +1028 -248
- package/dist/checks/bin/check-ci-shard-coverage.js +82 -0
- package/dist/checks/bin/check-closes-n.js +184 -105
- package/dist/checks/bin/check-coherence.js +345 -145
- package/dist/checks/bin/check-dead-branch-push.js +179 -59
- package/dist/checks/bin/check-dispatch-readiness.js +350 -150
- package/dist/checks/bin/check-doc-coverage-push.js +1011 -231
- package/dist/checks/bin/check-doc-coverage.js +1015 -235
- package/dist/checks/bin/check-doctrine-no-procedures.js +333 -94
- package/dist/checks/bin/check-doctrine-portability.js +1013 -233
- package/dist/checks/bin/check-evidence-fresh.js +1010 -222
- package/dist/checks/bin/check-exec-bits.js +1009 -229
- package/dist/checks/bin/check-first-push-dispatch.js +343 -145
- package/dist/checks/bin/check-issue-assignment.js +186 -107
- package/dist/checks/bin/check-issue-milestone-attach.js +176 -56
- package/dist/checks/bin/check-issue-objectives-numbering.js +176 -56
- package/dist/checks/bin/check-issue-parts-coverage.js +176 -56
- package/dist/checks/bin/check-issue-surface-globs.js +363 -143
- package/dist/checks/bin/check-issue-title-grammar.js +176 -56
- package/dist/checks/bin/check-issue-tranche-label.js +176 -56
- package/dist/checks/bin/check-main-branch-refusal.js +176 -56
- package/dist/checks/bin/check-no-disk-state.js +176 -56
- package/dist/checks/bin/check-pr-premise-reassert.js +333 -92
- package/dist/checks/bin/check-pr-report-density.js +176 -56
- package/dist/checks/bin/check-principal-test-plan-wait.js +176 -54
- package/dist/checks/bin/check-quoted-command.js +999 -217
- package/dist/checks/bin/check-reader-resolvable-prose.js +1011 -229
- package/dist/checks/bin/check-registry-gates.js +186 -56
- package/dist/checks/bin/check-retired-vocabulary.js +997 -215
- package/dist/checks/bin/check-review-gate.js +403 -203
- package/dist/checks/bin/check-single-plan-pr.js +176 -56
- package/dist/checks/bin/check-surface-scope.js +184 -105
- package/dist/checks/bin/check-test-plan.js +176 -54
- package/dist/checks/bin/check-token-collection-wired.js +182 -57
- package/dist/checks/bin/check-token-report.js +178 -58
- package/dist/checks/bin/check-workspace-escape.js +1011 -229
- package/dist/index.js +5971 -3489
- package/dist/lib/pre-push-cache-test-run.js +4431 -0
- package/dist/lib/pre-push-select-tests.js +799 -110
- package/package.json +3 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/actions.ts +10 -12
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/anchored-region.ts +5 -5
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/archive-task.ts +42 -17
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/baseline-capture.ts +1 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/branch-topology-gate.ts +3 -3
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-render.ts +554 -95
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-validation.ts +264 -44
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/claude-code-transcript.ts +9 -9
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/coherence-checks.ts +211 -30
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/consumer-enumeration.ts +2 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/index.ts +75 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/local.ts +961 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/migration.ts +212 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/outcomes.ts +135 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/records.ts +394 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dead-branch-push-audit.ts +1 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dead-branch-push-guard.ts +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/derive-section7.ts +2 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/assess-round.ts +514 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/fakes.ts +110 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/index.ts +27 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/journal-reconstruction.ts +123 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/render-summary.ts +27 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/types.ts +240 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/diagram-model.ts +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/direct-main-push.ts +1 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dispatch-gate.ts +65 -22
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/doc-claim.ts +238 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/doc-owners.ts +14 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/docs-coherence.ts +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/legacy-anchors.ts +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/node-route.ts +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/surfaced-manifest.ts +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/doctrine-no-procedures.ts +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/doctrine-portability.ts +5 -5
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/ensure-label.ts +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/first-push-dispatch-gate.ts +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/gate-audience.ts +14 -3
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/index.ts +379 -11
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/issue-assignment.ts +3 -4
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/issue-validation.ts +1450 -33
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/leftover-detection.ts +1 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/local-anchor-coverage.ts +2 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/envelope.ts +119 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/index.ts +75 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/redact.ts +87 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/schema.ts +801 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/store.ts +373 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/main-branch-refusal.ts +2 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/metering-io-guard.ts +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/milestone-validation.ts +2 -3
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/no-disk-state.ts +2 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/objectives.ts +288 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/parse-token-report.ts +3 -3
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/parse-tranche.ts +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/pr-report-density.ts +30 -16
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/pr-tier.ts +17 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/premise-check.ts +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/quoted-command.ts +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/reader-resolvable-prose.ts +267 -19
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/registry-checks.ts +91 -24
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/registry-scaffold.ts +6 -6
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/report-tokens.ts +4 -4
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-gate.ts +239 -110
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-input-manifest.ts +384 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-policy.ts +184 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-status.ts +65 -18
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/ruling-ordinal.ts +76 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/single-plan-pr.ts +4 -4
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/state-machine-model.ts +40 -27
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/symbol-collisions.ts +2 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/task-branch-identity.ts +38 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/task-tools.ts +488 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/test-plan-gate.ts +7 -9
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/test-plan-section.ts +5 -5
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/types.ts +4 -4
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/verdict-extraction.ts +314 -56
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/waiver-label.ts +2 -3
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/workspace-escape.ts +3 -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 +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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +2 -2
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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/{[externals]__1agj1ww._.js → [externals]__0cki-x_._.js} +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/[root-of-the-server]__02a-3g8._.js +6 -6
- 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 +3 -0
- 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]__0r7e54g._.js → [root-of-the-server]__18paley._.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/{[root-of-the-server]__1r47dr7._.js → _08onyya._.js} +3 -3
- 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/_0y1jv16._.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 +5 -5
- 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/0bjnj-5fy4e7l.js +1 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{1dc2_-c_gavj1.js → 1ce2dj27_cgbj.js} +4 -4
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{3xg6-flovrcx-.js → 22s44f5k3ecmj.js} +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/34hhdtbp20krb.js +1 -0
- package/studio-standalone/apps/vinaya-studio/web/package.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0hstap0._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2t_rfsztmwu6y.js +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3ua4rm5f-a9k6.js +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/{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/{e8XbZ2vlVz40KzHmlqhwP → vl7QVqELe1AQ-9kaOd9mR}/_buildManifest.js +0 -0
- /package/studio-standalone/apps/vinaya-studio/web/.next/static/{e8XbZ2vlVz40KzHmlqhwP → vl7QVqELe1AQ-9kaOd9mR}/_clientMiddlewareManifest.js +0 -0
- /package/studio-standalone/apps/vinaya-studio/web/.next/static/{e8XbZ2vlVz40KzHmlqhwP → vl7QVqELe1AQ-9kaOd9mR}/_ssgManifest.js +0 -0
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { createRequire } from "node:module";
|
|
3
|
-
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
4
2
|
|
|
5
3
|
// src/checks/bin/check-doctrine-no-procedures.ts
|
|
6
4
|
import { readdirSync, readFileSync as readFileSync3, statSync } from "node:fs";
|
|
@@ -1038,7 +1036,7 @@ function withDefaults(oldDefaults, newDefaults) {
|
|
|
1038
1036
|
var endpoint = withDefaults(null, DEFAULTS);
|
|
1039
1037
|
|
|
1040
1038
|
// ../../node_modules/fast-content-type-parse/index.js
|
|
1041
|
-
var NullObject = function
|
|
1039
|
+
var NullObject = function NullObject() {};
|
|
1042
1040
|
NullObject.prototype = Object.create(null);
|
|
1043
1041
|
var paramRE = /; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu;
|
|
1044
1042
|
var quotedPairRE = /\\([\v\u0020-\u00ff])/gu;
|
|
@@ -1782,27 +1780,27 @@ function splitTableRow(row) {
|
|
|
1782
1780
|
return parts.map((p) => p.split(PLACEHOLDER).join("|"));
|
|
1783
1781
|
}
|
|
1784
1782
|
// ../../packages/aeg-core/src/blast-radius-domains.ts
|
|
1785
|
-
function resolveWorkspaceEntry(
|
|
1786
|
-
if (
|
|
1787
|
-
const baseDir =
|
|
1783
|
+
function resolveWorkspaceEntry(entry, listDirs) {
|
|
1784
|
+
if (entry.endsWith("/*")) {
|
|
1785
|
+
const baseDir = entry.slice(0, -2);
|
|
1788
1786
|
return listDirs(baseDir).map((name) => `${baseDir}/${name}`);
|
|
1789
1787
|
}
|
|
1790
|
-
if (
|
|
1788
|
+
if (entry.includes("*"))
|
|
1791
1789
|
return [];
|
|
1792
|
-
return [
|
|
1790
|
+
return [entry];
|
|
1793
1791
|
}
|
|
1794
1792
|
// ../../packages/aeg-core/src/consumer-enumeration.ts
|
|
1795
1793
|
function deriveWorkspaceMemberDirs(workspaces, listDirs) {
|
|
1796
|
-
const positive = workspaces.filter((
|
|
1797
|
-
const negative = workspaces.filter((
|
|
1794
|
+
const positive = workspaces.filter((entry) => !entry.startsWith("!"));
|
|
1795
|
+
const negative = workspaces.filter((entry) => entry.startsWith("!")).map((entry) => entry.slice(1));
|
|
1798
1796
|
const excluded = new Set;
|
|
1799
|
-
for (const
|
|
1800
|
-
for (const member of resolveWorkspaceEntry(
|
|
1797
|
+
for (const entry of negative) {
|
|
1798
|
+
for (const member of resolveWorkspaceEntry(entry, listDirs))
|
|
1801
1799
|
excluded.add(member);
|
|
1802
1800
|
}
|
|
1803
1801
|
const members = new Set;
|
|
1804
|
-
for (const
|
|
1805
|
-
for (const member of resolveWorkspaceEntry(
|
|
1802
|
+
for (const entry of positive) {
|
|
1803
|
+
for (const member of resolveWorkspaceEntry(entry, listDirs)) {
|
|
1806
1804
|
if (!excluded.has(member))
|
|
1807
1805
|
members.add(member);
|
|
1808
1806
|
}
|
|
@@ -2048,12 +2046,24 @@ function extractBaseSha(comment) {
|
|
|
2048
2046
|
const m = firstThirteenLines(comment).match(BASE_SHA_PATTERN);
|
|
2049
2047
|
return m ? m[1].toLowerCase() : null;
|
|
2050
2048
|
}
|
|
2051
|
-
var
|
|
2049
|
+
var FINDING_DESCRIPTION_STATE = /^F(\d+)(?:\s+\S+)?(?:\s+(open|fix-claimed|reproduced|resolved))?:/;
|
|
2050
|
+
function parseFindingState(description) {
|
|
2051
|
+
const m = FINDING_DESCRIPTION_STATE.exec(description.trim());
|
|
2052
|
+
if (!m)
|
|
2053
|
+
return { id: null, state: null };
|
|
2054
|
+
return { id: `F${m[1]}`, state: m[2] ?? null };
|
|
2055
|
+
}
|
|
2056
|
+
var FINDING_SEVERITY_LINE = /^\d+\.\s+\[([A-Z][A-Z]*)\]\s+(.+?)\s+—(?:\s+(.*))?$/gm;
|
|
2052
2057
|
function extractFindingSeverities(comment) {
|
|
2053
|
-
return [...comment.matchAll(FINDING_SEVERITY_LINE)].map((m) =>
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2058
|
+
return [...comment.matchAll(FINDING_SEVERITY_LINE)].map((m) => {
|
|
2059
|
+
const { id, state } = parseFindingState(m[3] ?? "");
|
|
2060
|
+
return {
|
|
2061
|
+
severity: m[1],
|
|
2062
|
+
location: m[2],
|
|
2063
|
+
id,
|
|
2064
|
+
state
|
|
2065
|
+
};
|
|
2066
|
+
});
|
|
2057
2067
|
}
|
|
2058
2068
|
function extractVerdict(comments, valuePattern, missingLabel) {
|
|
2059
2069
|
const candidates = comments.filter((c) => valuePattern.test(c));
|
|
@@ -2126,15 +2136,15 @@ function summarizeTranscript(jsonl) {
|
|
|
2126
2136
|
const line = rawLine.trim();
|
|
2127
2137
|
if (!line)
|
|
2128
2138
|
continue;
|
|
2129
|
-
let
|
|
2139
|
+
let entry;
|
|
2130
2140
|
try {
|
|
2131
|
-
|
|
2141
|
+
entry = JSON.parse(line);
|
|
2132
2142
|
} catch {
|
|
2133
2143
|
continue;
|
|
2134
2144
|
}
|
|
2135
|
-
if (!
|
|
2145
|
+
if (!entry || typeof entry !== "object")
|
|
2136
2146
|
continue;
|
|
2137
|
-
const obj =
|
|
2147
|
+
const obj = entry;
|
|
2138
2148
|
if (obj.type !== "assistant")
|
|
2139
2149
|
continue;
|
|
2140
2150
|
const message = obj.message;
|
|
@@ -2467,6 +2477,12 @@ function evaluateReviewFindings(findings, scale, threshold) {
|
|
|
2467
2477
|
});
|
|
2468
2478
|
return { outcome: blockingFindings.length > 0 ? "blocked" : "clean", blockingFindings };
|
|
2469
2479
|
}
|
|
2480
|
+
function isConsequentialFinding(finding) {
|
|
2481
|
+
return finding.state !== "resolved";
|
|
2482
|
+
}
|
|
2483
|
+
function consequentialFindings(findings) {
|
|
2484
|
+
return findings.filter((f) => isConsequentialFinding(f));
|
|
2485
|
+
}
|
|
2470
2486
|
function evaluateCodeReview(findings, policy) {
|
|
2471
2487
|
return evaluateReviewFindings(findings, CODE_REVIEW_SEVERITY_ORDER, policy.codeReviewThreshold);
|
|
2472
2488
|
}
|
|
@@ -2982,7 +2998,7 @@ function isStep0Block(content) {
|
|
|
2982
2998
|
}
|
|
2983
2999
|
function checkCommandsCarryOutput(prBody) {
|
|
2984
3000
|
const errors = [];
|
|
2985
|
-
for (const [
|
|
3001
|
+
for (const [label, num] of [
|
|
2986
3002
|
["5", 5],
|
|
2987
3003
|
["6", 6]
|
|
2988
3004
|
]) {
|
|
@@ -2996,7 +3012,7 @@ function checkCommandsCarryOutput(prBody) {
|
|
|
2996
3012
|
continue;
|
|
2997
3013
|
const next = blocks[i + 1];
|
|
2998
3014
|
if (!next || isCommandBlock(next.content)) {
|
|
2999
|
-
errors.push(`brief-validation commands carry output: §${
|
|
3015
|
+
errors.push(`brief-validation commands carry output: §${label} has a command block ("${firstNonBlankLine(block.content)}") not immediately followed by a non-command output block — the very next fenced block must hold that command's actual output, not another command.`);
|
|
3000
3016
|
}
|
|
3001
3017
|
}
|
|
3002
3018
|
}
|
|
@@ -3433,8 +3449,8 @@ function stripPartBackticks(text) {
|
|
|
3433
3449
|
function partWordCount(text) {
|
|
3434
3450
|
return text.split(/\s+/).filter((w) => /[a-z]/i.test(w)).length;
|
|
3435
3451
|
}
|
|
3436
|
-
function looksLikeFilePath(
|
|
3437
|
-
const stripped =
|
|
3452
|
+
function looksLikeFilePath(entry) {
|
|
3453
|
+
const stripped = entry.replace(/\/\*\*?$/, "");
|
|
3438
3454
|
const lastSegment = stripped.split("/").pop() ?? stripped;
|
|
3439
3455
|
const extMatch = /\.[A-Za-z0-9]{1,6}$/.exec(lastSegment);
|
|
3440
3456
|
return extMatch !== null && extMatch.index > 0;
|
|
@@ -3920,14 +3936,14 @@ function checkClosesNTopology(branch, prBody, trancheFiles, taskIssueRefs) {
|
|
|
3920
3936
|
const referenced = extractClosesReferences(prBody);
|
|
3921
3937
|
if (taskIssueRefs) {
|
|
3922
3938
|
for (const n of referenced) {
|
|
3923
|
-
const
|
|
3924
|
-
if (!
|
|
3939
|
+
const ref = taskIssueRefs.get(n);
|
|
3940
|
+
if (!ref)
|
|
3925
3941
|
continue;
|
|
3926
|
-
const expectedBranch = `task/${
|
|
3942
|
+
const expectedBranch = `task/${ref.trancheSlug}/${ref.taskId}`;
|
|
3927
3943
|
if (branch !== expectedBranch) {
|
|
3928
3944
|
return {
|
|
3929
3945
|
ok: false,
|
|
3930
|
-
message: `closes-n-reverse: branch "${branch}" closes #${n} (task ${
|
|
3946
|
+
message: `closes-n-reverse: branch "${branch}" closes #${n} (task ${ref.taskId} of tranche "${ref.trancheSlug}") but is not named "${expectedBranch}" — rename the branch and re-push, or if this work is intentionally outside AEG's dispatch flow, remove the Closes reference.`
|
|
3931
3947
|
};
|
|
3932
3948
|
}
|
|
3933
3949
|
}
|
|
@@ -3936,15 +3952,15 @@ function checkClosesNTopology(branch, prBody, trancheFiles, taskIssueRefs) {
|
|
|
3936
3952
|
if (!ref)
|
|
3937
3953
|
return { ok: true };
|
|
3938
3954
|
if (ref.kind === "issue") {
|
|
3939
|
-
const
|
|
3940
|
-
if (!referenced.has(
|
|
3955
|
+
const expectedIssue = ref.issueNumber;
|
|
3956
|
+
if (!referenced.has(expectedIssue)) {
|
|
3941
3957
|
return {
|
|
3942
3958
|
ok: false,
|
|
3943
|
-
expectedIssue
|
|
3944
|
-
message: `closes-n: PR body does not contain \`Closes #${
|
|
3959
|
+
expectedIssue,
|
|
3960
|
+
message: `closes-n: PR body does not contain \`Closes #${expectedIssue}\` (required for branch "${branch}"). Add it to the PR body Summary section.`
|
|
3945
3961
|
};
|
|
3946
3962
|
}
|
|
3947
|
-
return { ok: true, expectedIssue
|
|
3963
|
+
return { ok: true, expectedIssue };
|
|
3948
3964
|
}
|
|
3949
3965
|
const trancheSlug = ref.tranche;
|
|
3950
3966
|
const taskId = ref.taskId;
|
|
@@ -3990,8 +4006,8 @@ function extractIssue(body) {
|
|
|
3990
4006
|
const anchorNums = closesRefs(anchored);
|
|
3991
4007
|
if (anchorNums.length === 0)
|
|
3992
4008
|
return { issue: null, extraIssues: bodyNums, outsideHeader: false };
|
|
3993
|
-
const
|
|
3994
|
-
return { issue
|
|
4009
|
+
const issue = anchorNums[0];
|
|
4010
|
+
return { issue, extraIssues: bodyNums.filter((n) => n !== issue), outsideHeader: false };
|
|
3995
4011
|
}
|
|
3996
4012
|
const headerNums = closesRefs(headerRegion(stripped));
|
|
3997
4013
|
if (bodyNums.length === 0)
|
|
@@ -4060,15 +4076,15 @@ function compareManifest(echoed, current, patchIdOf) {
|
|
|
4060
4076
|
const bothFullShas = echoedShaLen >= 40 && currentShaLen >= 40;
|
|
4061
4077
|
const base = patchHead || exactHead && bothFullShas ? true : isBoundToBase(echoed, current.baseSha);
|
|
4062
4078
|
const briefHashBound = isBoundToBriefHash(echoed, current.briefHash);
|
|
4063
|
-
const
|
|
4079
|
+
const objectivesVersion = isBoundToObjectives(echoed, current.objectivesVersion);
|
|
4064
4080
|
const rulingOrdinal = isBoundToRulings(echoed, current.rulingOrdinal);
|
|
4065
4081
|
const policyDigestBound = isBoundToPolicy(echoed, current.policyDigest);
|
|
4066
4082
|
return {
|
|
4067
|
-
bound: head && base && briefHashBound &&
|
|
4083
|
+
bound: head && base && briefHashBound && objectivesVersion && rulingOrdinal && policyDigestBound,
|
|
4068
4084
|
head,
|
|
4069
4085
|
base,
|
|
4070
4086
|
briefHash: briefHashBound,
|
|
4071
|
-
objectivesVersion
|
|
4087
|
+
objectivesVersion,
|
|
4072
4088
|
rulingOrdinal,
|
|
4073
4089
|
policyDigest: policyDigestBound
|
|
4074
4090
|
};
|
|
@@ -4099,8 +4115,8 @@ function checkReviewGate(input) {
|
|
|
4099
4115
|
let codeReviewPolicyEvaluation;
|
|
4100
4116
|
let securityPolicyEvaluation;
|
|
4101
4117
|
try {
|
|
4102
|
-
codeReviewPolicyEvaluation = evaluateCodeReview(codeReview.findingSeverities, policy);
|
|
4103
|
-
securityPolicyEvaluation = evaluateSecurityReview(security.findingSeverities, policy);
|
|
4118
|
+
codeReviewPolicyEvaluation = evaluateCodeReview(consequentialFindings(codeReview.findingSeverities), policy);
|
|
4119
|
+
securityPolicyEvaluation = evaluateSecurityReview(consequentialFindings(security.findingSeverities), policy);
|
|
4104
4120
|
} catch (err) {
|
|
4105
4121
|
return {
|
|
4106
4122
|
verdict: "fail",
|
|
@@ -5181,11 +5197,27 @@ var ObservedSchema = z.object({
|
|
|
5181
5197
|
var TaskStatusInputSchema = z.object({
|
|
5182
5198
|
task: TaskToolRefSchema.optional()
|
|
5183
5199
|
}).merge(PageRequestSchema).strict();
|
|
5200
|
+
var TaskConfidenceSchema = z.object({
|
|
5201
|
+
round: z.number().int().positive(),
|
|
5202
|
+
percent: z.number().int().min(0).max(100).nullable(),
|
|
5203
|
+
source: z.enum(["stated", "published-summary"])
|
|
5204
|
+
}).strict();
|
|
5205
|
+
var TaskPhaseHistorySchema = z.object({
|
|
5206
|
+
typicalPhaseMinutes: z.number().nonnegative(),
|
|
5207
|
+
typicalPhaseSamples: z.number().int().positive()
|
|
5208
|
+
}).strict();
|
|
5184
5209
|
var TaskStatusItemSchema = z.object({
|
|
5185
5210
|
task: TaskToolRefSchema,
|
|
5186
5211
|
issue: z.number().int().positive(),
|
|
5187
5212
|
pr: z.number().int().positive().nullable(),
|
|
5188
|
-
state: z.string()
|
|
5213
|
+
state: z.string(),
|
|
5214
|
+
round: z.number().int().positive().nullable().optional(),
|
|
5215
|
+
phase: z.string().min(1).nullable().optional(),
|
|
5216
|
+
minutesInPhase: z.number().nonnegative().nullable().optional(),
|
|
5217
|
+
phaseIsCurrent: z.boolean().nullable().optional(),
|
|
5218
|
+
lastConfidence: TaskConfidenceSchema.nullable().optional(),
|
|
5219
|
+
lastConfidenceUnread: z.boolean().optional(),
|
|
5220
|
+
phaseHistory: TaskPhaseHistorySchema.nullable().optional()
|
|
5189
5221
|
}).merge(ObservedSchema);
|
|
5190
5222
|
var TaskStatusResultSchema = z.object({
|
|
5191
5223
|
items: z.array(TaskStatusItemSchema),
|
|
@@ -5197,7 +5229,7 @@ var EscalationInputsSchema = z.object({
|
|
|
5197
5229
|
round: z.number().int().nonnegative(),
|
|
5198
5230
|
head: z.string(),
|
|
5199
5231
|
branch: z.string(),
|
|
5200
|
-
prNumber: z.number().int().positive()
|
|
5232
|
+
prNumber: z.number().int().positive().nullable()
|
|
5201
5233
|
});
|
|
5202
5234
|
var EscalationEvidenceSchema = z.object({
|
|
5203
5235
|
round: z.number().int().nonnegative(),
|
|
@@ -5233,13 +5265,45 @@ var TaskEscalationReadResultSchema = z.object({
|
|
|
5233
5265
|
items: z.array(TaskEscalationPacketSchema),
|
|
5234
5266
|
nextCursor: z.string().nullable()
|
|
5235
5267
|
}).merge(ObservedSchema);
|
|
5236
|
-
var
|
|
5237
|
-
|
|
5238
|
-
|
|
5268
|
+
var TaskPrCheckSchema = z.object({
|
|
5269
|
+
name: z.string(),
|
|
5270
|
+
required: z.boolean(),
|
|
5271
|
+
status: z.string(),
|
|
5272
|
+
conclusion: z.string().nullable(),
|
|
5273
|
+
detailsUrl: z.string().nullable(),
|
|
5274
|
+
failureSummary: z.string().nullable()
|
|
5275
|
+
});
|
|
5276
|
+
var TaskPrVerdictSchema = z.object({
|
|
5277
|
+
role: z.enum(["code-review", "security"]),
|
|
5278
|
+
value: z.string(),
|
|
5279
|
+
judgedHead: z.string().nullable(),
|
|
5280
|
+
objectivesVersion: z.string().nullable()
|
|
5281
|
+
});
|
|
5282
|
+
var TaskPrPauseSchema = z.object({
|
|
5283
|
+
reason: z.string(),
|
|
5284
|
+
body: z.string()
|
|
5285
|
+
});
|
|
5286
|
+
var TaskPrReviewRecordSchema = z.object({
|
|
5287
|
+
verdicts: z.array(TaskPrVerdictSchema),
|
|
5288
|
+
roundMarkers: z.array(z.number().int().nonnegative()),
|
|
5289
|
+
summaryTable: z.string().nullable(),
|
|
5290
|
+
pause: TaskPrPauseSchema.nullable()
|
|
5291
|
+
});
|
|
5292
|
+
var TaskPrReadInputSchema = z.object({
|
|
5293
|
+
task: TaskToolRefSchema,
|
|
5294
|
+
pr: z.number().int().positive().optional()
|
|
5239
5295
|
}).strict();
|
|
5296
|
+
var TaskPrReadResultSchema = z.object({
|
|
5297
|
+
task: TaskToolRefSchema,
|
|
5298
|
+
issue: z.number().int().positive(),
|
|
5299
|
+
pr: z.number().int().positive(),
|
|
5300
|
+
head: z.string().nullable(),
|
|
5301
|
+
checks: z.array(TaskPrCheckSchema),
|
|
5302
|
+
review: TaskPrReviewRecordSchema
|
|
5303
|
+
}).merge(ObservedSchema);
|
|
5240
5304
|
var TaskStartResultSchema = z.object({
|
|
5241
5305
|
requestId: z.string().min(1),
|
|
5242
|
-
run:
|
|
5306
|
+
run: TaskToolRefSchema,
|
|
5243
5307
|
started: z.boolean(),
|
|
5244
5308
|
startedAt: z.string(),
|
|
5245
5309
|
mode: z.literal("attended")
|
|
@@ -5253,7 +5317,7 @@ var TaskCancelInputSchema = z.object({
|
|
|
5253
5317
|
}).strict();
|
|
5254
5318
|
var TaskResumeResultSchema = z.object({
|
|
5255
5319
|
task: z.number().int().positive(),
|
|
5256
|
-
pr: z.number().int().positive(),
|
|
5320
|
+
pr: z.number().int().positive().nullable(),
|
|
5257
5321
|
escalationId: z.string().min(1),
|
|
5258
5322
|
outcome: z.enum(["started", "already_resumed"]),
|
|
5259
5323
|
authenticatedBy: z.string().min(1),
|
|
@@ -5262,7 +5326,7 @@ var TaskResumeResultSchema = z.object({
|
|
|
5262
5326
|
var TaskCancelOutcomeSchema = z.enum(["confirmed", "pending", "uncertain"]);
|
|
5263
5327
|
var TaskCancelResultSchema = z.object({
|
|
5264
5328
|
task: z.number().int().positive(),
|
|
5265
|
-
pr: z.number().int().positive(),
|
|
5329
|
+
pr: z.number().int().positive().nullable(),
|
|
5266
5330
|
escalationId: z.string().min(1),
|
|
5267
5331
|
outcome: TaskCancelOutcomeSchema,
|
|
5268
5332
|
authenticatedBy: z.string().min(1),
|
|
@@ -5273,6 +5337,7 @@ var TASK_TOOL_NAMES = [
|
|
|
5273
5337
|
"task_start",
|
|
5274
5338
|
"task_status",
|
|
5275
5339
|
"task_escalation_read",
|
|
5340
|
+
"task_pr_read",
|
|
5276
5341
|
"task_resume",
|
|
5277
5342
|
"task_cancel"
|
|
5278
5343
|
];
|
|
@@ -5500,6 +5565,10 @@ function findWorkspaceEscapes(files, knownPaths, workspaceDirs = DEFAULT_WORKSPA
|
|
|
5500
5565
|
}
|
|
5501
5566
|
return findings;
|
|
5502
5567
|
}
|
|
5568
|
+
// ../../packages/aeg-core/src/dev-review-loop/types.ts
|
|
5569
|
+
var SEVERITY_COLUMNS = ["blocker", "major", "minor", "critical", "high", "medium", "low"];
|
|
5570
|
+
// ../../packages/aeg-core/src/dev-review-loop/journal-reconstruction.ts
|
|
5571
|
+
var SUMMARY_TABLE_HEADER = `| round | ${SEVERITY_COLUMNS.join(" | ")} | confidence | outcome |`;
|
|
5503
5572
|
// ../../packages/aeg-core/src/log/envelope.ts
|
|
5504
5573
|
import { createHash as createHash5 } from "node:crypto";
|
|
5505
5574
|
|
|
@@ -6038,6 +6107,7 @@ function redact(value, home) {
|
|
|
6038
6107
|
return value;
|
|
6039
6108
|
}
|
|
6040
6109
|
// ../../packages/aeg-core/src/log/store.ts
|
|
6110
|
+
var KNOWN_SCHEMA_VERSIONS = [1, 2];
|
|
6041
6111
|
function metaOf(obj) {
|
|
6042
6112
|
if (obj === null || typeof obj !== "object")
|
|
6043
6113
|
return null;
|
|
@@ -6060,11 +6130,61 @@ function recordIdentity(obj) {
|
|
|
6060
6130
|
}
|
|
6061
6131
|
return null;
|
|
6062
6132
|
}
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
|
|
6066
|
-
|
|
6067
|
-
|
|
6133
|
+
function schemaVersionOf(obj) {
|
|
6134
|
+
const meta = metaOf(obj);
|
|
6135
|
+
const schema = meta?.schema;
|
|
6136
|
+
return typeof schema === "number" ? schema : null;
|
|
6137
|
+
}
|
|
6138
|
+
function isKnownSchema(version) {
|
|
6139
|
+
return version !== null && KNOWN_SCHEMA_VERSIONS.includes(version);
|
|
6140
|
+
}
|
|
6141
|
+
function classifyStoredLine(raw, home) {
|
|
6142
|
+
let obj;
|
|
6143
|
+
try {
|
|
6144
|
+
obj = JSON.parse(raw);
|
|
6145
|
+
} catch {
|
|
6146
|
+
return { status: "invalid", identity: null, raw, reason: "not valid JSON" };
|
|
6147
|
+
}
|
|
6148
|
+
const version = schemaVersionOf(obj);
|
|
6149
|
+
if (version === null) {
|
|
6150
|
+
return { status: "invalid", identity: recordIdentity(obj), raw, reason: "no readable meta.schema" };
|
|
6151
|
+
}
|
|
6152
|
+
if (!isKnownSchema(version)) {
|
|
6153
|
+
return {
|
|
6154
|
+
status: "unknown_version",
|
|
6155
|
+
identity: recordIdentity(obj),
|
|
6156
|
+
schema: version,
|
|
6157
|
+
raw,
|
|
6158
|
+
reason: `schema version ${version} is not one this build validates (${KNOWN_SCHEMA_VERSIONS.join(", ")}) — kept for diagnosis`
|
|
6159
|
+
};
|
|
6160
|
+
}
|
|
6161
|
+
const result = LogEventSchema.safeParse(obj);
|
|
6162
|
+
if (!result.success) {
|
|
6163
|
+
return {
|
|
6164
|
+
status: "invalid",
|
|
6165
|
+
identity: recordIdentity(obj),
|
|
6166
|
+
raw,
|
|
6167
|
+
reason: result.error.issues[0]?.message ?? "schema violation"
|
|
6168
|
+
};
|
|
6169
|
+
}
|
|
6170
|
+
const event = result.data;
|
|
6171
|
+
const identity = recordIdentity(event);
|
|
6172
|
+
if (identity === null) {
|
|
6173
|
+
return { status: "invalid", identity: null, raw, reason: "valid event with no derivable identity" };
|
|
6174
|
+
}
|
|
6175
|
+
const redacted = redact(event, home);
|
|
6176
|
+
const provenance = version === 2 ? event.meta.provenance ?? null : null;
|
|
6177
|
+
return {
|
|
6178
|
+
status: "ok",
|
|
6179
|
+
identity,
|
|
6180
|
+
runId: event.meta.run_id,
|
|
6181
|
+
seq: event.meta.seq,
|
|
6182
|
+
schema: version,
|
|
6183
|
+
provenance,
|
|
6184
|
+
event,
|
|
6185
|
+
postLine: JSON.stringify(redacted)
|
|
6186
|
+
};
|
|
6187
|
+
}
|
|
6068
6188
|
// ../../packages/aeg-core/src/control-store/records.ts
|
|
6069
6189
|
import { z as z3 } from "zod";
|
|
6070
6190
|
var isoTimestamp = z3.string().min(1);
|
|
@@ -6195,7 +6315,8 @@ var ResolutionRecordSchema = z3.object({
|
|
|
6195
6315
|
consumedAt: isoTimestamp
|
|
6196
6316
|
}).strict();
|
|
6197
6317
|
// src/lib/config.ts
|
|
6198
|
-
import { execFileSync as execFileSync2 } from "node:child_process";
|
|
6318
|
+
import { execFile as execFile4, execFileSync as execFileSync2 } from "node:child_process";
|
|
6319
|
+
import { promisify as promisify4 } from "node:util";
|
|
6199
6320
|
import { existsSync, mkdirSync, readFileSync as readFileSync2, realpathSync, writeFileSync } from "node:fs";
|
|
6200
6321
|
import { homedir } from "node:os";
|
|
6201
6322
|
import { dirname, isAbsolute, join, resolve } from "node:path";
|
|
@@ -6222,10 +6343,10 @@ var CheckEntrySchema = z4.object({
|
|
|
6222
6343
|
ownWorkflow: z4.boolean().optional(),
|
|
6223
6344
|
principalOwed: z4.literal(true).optional(),
|
|
6224
6345
|
validates: z4.enum(["body", "issue"]).optional()
|
|
6225
|
-
}).superRefine((
|
|
6226
|
-
if (!
|
|
6346
|
+
}).superRefine((entry, ctx) => {
|
|
6347
|
+
if (!entry.env)
|
|
6227
6348
|
return;
|
|
6228
|
-
for (const [key, value] of Object.entries(
|
|
6349
|
+
for (const [key, value] of Object.entries(entry.env)) {
|
|
6229
6350
|
if (typeof value !== "object" || value === null || !("anyOf" in value))
|
|
6230
6351
|
continue;
|
|
6231
6352
|
const members = value.anyOf;
|
|
@@ -6382,18 +6503,19 @@ var VinayaConfigSchema = z4.object({
|
|
|
6382
6503
|
});
|
|
6383
6504
|
}
|
|
6384
6505
|
}).optional(),
|
|
6385
|
-
logPublish: z4.
|
|
6386
|
-
|
|
6387
|
-
|
|
6388
|
-
|
|
6389
|
-
|
|
6390
|
-
|
|
6391
|
-
|
|
6392
|
-
|
|
6393
|
-
}).refine((v) => v.
|
|
6394
|
-
message: "
|
|
6395
|
-
}).
|
|
6396
|
-
|
|
6506
|
+
logPublish: z4.unknown().refine((v) => v === undefined, {
|
|
6507
|
+
message: "logPublish is removed — telemetry is never posted to a tracker or a code host; configure `logs` instead (a folder or a server destination)"
|
|
6508
|
+
}),
|
|
6509
|
+
runtimeDir: z4.string().min(1).refine((v) => isAbsolute(v), { message: "runtimeDir: must be an absolute path" }).optional(),
|
|
6510
|
+
logs: z4.object({
|
|
6511
|
+
folder: z4.string().min(1).refine((v) => isAbsolute(v), { message: "logs.folder: must be an absolute path" }).optional(),
|
|
6512
|
+
url: z4.string().url().optional(),
|
|
6513
|
+
headers: z4.record(z4.string()).optional()
|
|
6514
|
+
}).refine((v) => [v.folder, v.url].filter((x) => x !== undefined).length <= 1, {
|
|
6515
|
+
message: "logs: set at most one of folder/url"
|
|
6516
|
+
}).refine((v) => v.headers === undefined || v.url !== undefined, {
|
|
6517
|
+
message: "logs: headers requires url"
|
|
6518
|
+
}).optional()
|
|
6397
6519
|
});
|
|
6398
6520
|
var GLOBAL_VINAYA_HOME = join(homedir(), ".vinaya");
|
|
6399
6521
|
var GLOBAL_CONFIG_PATH = join(GLOBAL_VINAYA_HOME, "config.json");
|
|
@@ -6438,32 +6560,39 @@ function globalTokensCollectIgnoredWarning(path) {
|
|
|
6438
6560
|
function globalRuntimeDirIgnoredWarning(path) {
|
|
6439
6561
|
return `${path}: "runtimeDir" in the global config is ignored — it carries no repository segment, so a machine-wide value would collapse every repository's task folders into one tree. Declare it from a repo-local vinaya.config.json.`;
|
|
6440
6562
|
}
|
|
6563
|
+
var emittedGlobalKeyWarnings = new Set;
|
|
6564
|
+
function warnGlobalKeyIgnoredOnce(message) {
|
|
6565
|
+
if (emittedGlobalKeyWarnings.has(message))
|
|
6566
|
+
return;
|
|
6567
|
+
emittedGlobalKeyWarnings.add(message);
|
|
6568
|
+
console.error(`⚠ ${message}`);
|
|
6569
|
+
}
|
|
6441
6570
|
function stripGlobalOnlyKeys(config, path) {
|
|
6442
6571
|
if (path !== GLOBAL_CONFIG_PATH)
|
|
6443
6572
|
return config;
|
|
6444
6573
|
let result = config;
|
|
6445
6574
|
if (result.checks && Object.keys(result.checks).length > 0) {
|
|
6446
|
-
|
|
6575
|
+
warnGlobalKeyIgnoredOnce(globalChecksIgnoredWarning(path));
|
|
6447
6576
|
result = { ...result, checks: undefined };
|
|
6448
6577
|
}
|
|
6449
6578
|
if (result.roles && Object.keys(result.roles).length > 0) {
|
|
6450
|
-
|
|
6579
|
+
warnGlobalKeyIgnoredOnce(globalRolesIgnoredWarning(path));
|
|
6451
6580
|
result = { ...result, roles: undefined };
|
|
6452
6581
|
}
|
|
6453
6582
|
if (result.principals && result.principals.length > 0) {
|
|
6454
|
-
|
|
6583
|
+
warnGlobalKeyIgnoredOnce(globalPrincipalsIgnoredWarning(path));
|
|
6455
6584
|
result = { ...result, principals: undefined };
|
|
6456
6585
|
}
|
|
6457
6586
|
if (result.releaseActor) {
|
|
6458
|
-
|
|
6587
|
+
warnGlobalKeyIgnoredOnce(globalReleaseActorIgnoredWarning(path));
|
|
6459
6588
|
result = { ...result, releaseActor: undefined };
|
|
6460
6589
|
}
|
|
6461
6590
|
if (result.tokens) {
|
|
6462
|
-
|
|
6591
|
+
warnGlobalKeyIgnoredOnce(globalTokensCollectIgnoredWarning(path));
|
|
6463
6592
|
result = { ...result, tokens: undefined };
|
|
6464
6593
|
}
|
|
6465
6594
|
if (result.runtimeDir) {
|
|
6466
|
-
|
|
6595
|
+
warnGlobalKeyIgnoredOnce(globalRuntimeDirIgnoredWarning(path));
|
|
6467
6596
|
result = { ...result, runtimeDir: undefined };
|
|
6468
6597
|
}
|
|
6469
6598
|
return result;
|
|
@@ -6496,26 +6625,102 @@ function resolveReviewPolicy(config) {
|
|
|
6496
6625
|
maxRounds
|
|
6497
6626
|
};
|
|
6498
6627
|
}
|
|
6499
|
-
function
|
|
6500
|
-
|
|
6501
|
-
|
|
6502
|
-
|
|
6503
|
-
|
|
6504
|
-
|
|
6505
|
-
|
|
6628
|
+
function resolveRuntimeDirSetting(config) {
|
|
6629
|
+
return config?.runtimeDir ?? null;
|
|
6630
|
+
}
|
|
6631
|
+
function resolveTrustAnchorRuntimeDir(localRuntimeDir, trustAnchorConfig) {
|
|
6632
|
+
const anchored = resolveRuntimeDirSetting(trustAnchorConfig);
|
|
6633
|
+
return anchored !== null && anchored === localRuntimeDir ? anchored : null;
|
|
6634
|
+
}
|
|
6635
|
+
function resolveLogsSetting(config) {
|
|
6636
|
+
const raw = config?.logs;
|
|
6637
|
+
if (!raw)
|
|
6638
|
+
return null;
|
|
6639
|
+
if (raw.url !== undefined)
|
|
6640
|
+
return { url: raw.url, headers: raw.headers };
|
|
6641
|
+
if (raw.folder !== undefined)
|
|
6642
|
+
return { folder: raw.folder };
|
|
6643
|
+
return null;
|
|
6644
|
+
}
|
|
6645
|
+
function resolveTrustAnchorLogsDestination(local, trustAnchorConfig) {
|
|
6646
|
+
const anchored = resolveLogsSetting(trustAnchorConfig);
|
|
6647
|
+
if (!anchored)
|
|
6648
|
+
return null;
|
|
6649
|
+
if ("url" in local)
|
|
6650
|
+
return "url" in anchored && anchored.url === local.url ? anchored : null;
|
|
6651
|
+
return "folder" in anchored && anchored.folder === local.folder ? anchored : null;
|
|
6652
|
+
}
|
|
6653
|
+
function resolveLogsHeaderValues(headers, env) {
|
|
6654
|
+
if (!headers)
|
|
6655
|
+
return;
|
|
6656
|
+
const resolved = {};
|
|
6657
|
+
for (const [key, value] of Object.entries(headers)) {
|
|
6658
|
+
resolved[key] = value.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g, (_match, name) => env[name] ?? "");
|
|
6506
6659
|
}
|
|
6660
|
+
return resolved;
|
|
6661
|
+
}
|
|
6662
|
+
function trustAnchorRepo() {
|
|
6663
|
+
const fromRunner = trustAnchorRepoFromRunner();
|
|
6664
|
+
if (fromRunner)
|
|
6665
|
+
return fromRunner;
|
|
6507
6666
|
try {
|
|
6508
6667
|
const url = execFileSync2("git", ["remote", "get-url", "origin"], {
|
|
6509
6668
|
encoding: "utf-8",
|
|
6510
6669
|
stdio: ["ignore", "pipe", "pipe"]
|
|
6511
|
-
})
|
|
6512
|
-
|
|
6513
|
-
return m?.[1] && m[2] ? wellFormed(`${m[1]}/${m[2]}`) : null;
|
|
6670
|
+
});
|
|
6671
|
+
return trustAnchorRepoFromRemoteUrl(url);
|
|
6514
6672
|
} catch {
|
|
6515
6673
|
return null;
|
|
6516
6674
|
}
|
|
6517
6675
|
}
|
|
6676
|
+
async function trustAnchorRepoAsync() {
|
|
6677
|
+
const fromRunner = trustAnchorRepoFromRunner();
|
|
6678
|
+
if (fromRunner)
|
|
6679
|
+
return fromRunner;
|
|
6680
|
+
try {
|
|
6681
|
+
const { stdout } = await execFileAsync4("git", ["remote", "get-url", "origin"], {
|
|
6682
|
+
encoding: "utf-8",
|
|
6683
|
+
timeout: 1e4
|
|
6684
|
+
});
|
|
6685
|
+
return trustAnchorRepoFromRemoteUrl(stdout);
|
|
6686
|
+
} catch {
|
|
6687
|
+
return null;
|
|
6688
|
+
}
|
|
6689
|
+
}
|
|
6690
|
+
function wellFormedRepoSlug(slug) {
|
|
6691
|
+
return /^[^/\s]+\/[^/\s]+$/.test(slug) ? slug : null;
|
|
6692
|
+
}
|
|
6693
|
+
function trustAnchorRepoFromRunner() {
|
|
6694
|
+
const fromRunner = process.env.GITHUB_REPOSITORY?.trim();
|
|
6695
|
+
return fromRunner ? wellFormedRepoSlug(fromRunner) : null;
|
|
6696
|
+
}
|
|
6697
|
+
function trustAnchorRepoFromRemoteUrl(url) {
|
|
6698
|
+
const m = url.trim().match(/github\.com[:/]([^/]+)\/(.+?)(?:\.git)?\/?$/);
|
|
6699
|
+
return m?.[1] && m[2] ? wellFormedRepoSlug(`${m[1]}/${m[2]}`) : null;
|
|
6700
|
+
}
|
|
6701
|
+
var execFileAsync4 = promisify4(execFile4);
|
|
6702
|
+
function resolveCiTrustAnchorProbeRef(env = process.env) {
|
|
6703
|
+
const ref = env.VINAYA_CI_CONFIG_PROBE_REF?.trim();
|
|
6704
|
+
if (!ref)
|
|
6705
|
+
return null;
|
|
6706
|
+
if (env.GITHUB_ACTIONS !== "true")
|
|
6707
|
+
return null;
|
|
6708
|
+
if ((env.GH_TOKEN ?? "").length > 0 || (env.GITHUB_TOKEN ?? "").length > 0)
|
|
6709
|
+
return null;
|
|
6710
|
+
return ref;
|
|
6711
|
+
}
|
|
6712
|
+
function readTrustAnchorConfigAtRef(ref) {
|
|
6713
|
+
const raw = execFileSync2("git", ["show", `${ref}:${LOCAL_CONFIG_FILENAME}`], {
|
|
6714
|
+
encoding: "utf-8",
|
|
6715
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
6716
|
+
timeout: 1e4
|
|
6717
|
+
});
|
|
6718
|
+
return Buffer.from(raw, "utf-8").toString("base64");
|
|
6719
|
+
}
|
|
6518
6720
|
function ghFetchTrustAnchorConfig() {
|
|
6721
|
+
const probeRef = resolveCiTrustAnchorProbeRef();
|
|
6722
|
+
if (probeRef)
|
|
6723
|
+
return readTrustAnchorConfigAtRef(probeRef);
|
|
6519
6724
|
const repo = trustAnchorRepo();
|
|
6520
6725
|
if (!repo)
|
|
6521
6726
|
throw new Error("could not resolve repo identity for the trust-anchor read");
|
|
@@ -6524,6 +6729,21 @@ function ghFetchTrustAnchorConfig() {
|
|
|
6524
6729
|
stdio: ["ignore", "pipe", "pipe"]
|
|
6525
6730
|
});
|
|
6526
6731
|
}
|
|
6732
|
+
async function ghFetchTrustAnchorConfigAsync() {
|
|
6733
|
+
const probeRef = resolveCiTrustAnchorProbeRef();
|
|
6734
|
+
if (probeRef) {
|
|
6735
|
+
const { stdout } = await execFileAsync4("git", ["show", `${probeRef}:${LOCAL_CONFIG_FILENAME}`], {
|
|
6736
|
+
encoding: "utf-8",
|
|
6737
|
+
timeout: 1e4
|
|
6738
|
+
});
|
|
6739
|
+
return Buffer.from(stdout, "utf-8").toString("base64");
|
|
6740
|
+
}
|
|
6741
|
+
const repo = await trustAnchorRepoAsync();
|
|
6742
|
+
if (!repo)
|
|
6743
|
+
throw new Error("could not resolve repo identity for the trust-anchor read");
|
|
6744
|
+
const { stdout } = await execFileAsync4("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], { encoding: "utf-8", timeout: 1e4 });
|
|
6745
|
+
return stdout;
|
|
6746
|
+
}
|
|
6527
6747
|
function firstLine(err) {
|
|
6528
6748
|
return err?.message?.split(`
|
|
6529
6749
|
`)[0] ?? "unknown error";
|
|
@@ -6538,16 +6758,35 @@ function isMissingFileError(err) {
|
|
|
6538
6758
|
return /\b404\b|not found/i.test(haystack);
|
|
6539
6759
|
}
|
|
6540
6760
|
function loadTrustAnchorConfig(fetcher = ghFetchTrustAnchorConfig) {
|
|
6541
|
-
const warn = (why) => process.stdout.write(`⚠ could not read the trust-anchor config (\`principals\`/\`releaseActor\`) from the default branch (${why}) — falling back to vinaya's built-in defaults.
|
|
6542
|
-
`);
|
|
6543
6761
|
let base64;
|
|
6544
6762
|
try {
|
|
6545
|
-
base64 = fetcher()
|
|
6763
|
+
base64 = fetcher();
|
|
6546
6764
|
} catch (err) {
|
|
6547
|
-
|
|
6548
|
-
|
|
6549
|
-
|
|
6765
|
+
return trustAnchorFetchFailed(err);
|
|
6766
|
+
}
|
|
6767
|
+
return parseTrustAnchorContent(base64);
|
|
6768
|
+
}
|
|
6769
|
+
async function loadTrustAnchorConfigAsync(fetcher = ghFetchTrustAnchorConfigAsync, options = {}) {
|
|
6770
|
+
const warn = options.quiet ? () => {} : warnTrustAnchorFallback;
|
|
6771
|
+
let base64;
|
|
6772
|
+
try {
|
|
6773
|
+
base64 = await fetcher();
|
|
6774
|
+
} catch (err) {
|
|
6775
|
+
return trustAnchorFetchFailed(err, warn);
|
|
6550
6776
|
}
|
|
6777
|
+
return parseTrustAnchorContent(base64, warn);
|
|
6778
|
+
}
|
|
6779
|
+
function warnTrustAnchorFallback(why) {
|
|
6780
|
+
process.stdout.write(`⚠ could not read the trust-anchor config (\`principals\`/\`releaseActor\`) from the default branch (${why}) — falling back to vinaya's built-in defaults.
|
|
6781
|
+
`);
|
|
6782
|
+
}
|
|
6783
|
+
function trustAnchorFetchFailed(err, warn = warnTrustAnchorFallback) {
|
|
6784
|
+
if (!isMissingFileError(err))
|
|
6785
|
+
warn(firstLine(err));
|
|
6786
|
+
return null;
|
|
6787
|
+
}
|
|
6788
|
+
function parseTrustAnchorContent(content, warn = warnTrustAnchorFallback) {
|
|
6789
|
+
const base64 = content.trim();
|
|
6551
6790
|
if (!base64)
|
|
6552
6791
|
return null;
|
|
6553
6792
|
try {
|