@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-body-bare-digits.ts
|
|
6
4
|
import { execFileSync as execFileSync3 } from "node:child_process";
|
|
@@ -1037,7 +1035,7 @@ function withDefaults(oldDefaults, newDefaults) {
|
|
|
1037
1035
|
var endpoint = withDefaults(null, DEFAULTS);
|
|
1038
1036
|
|
|
1039
1037
|
// ../../node_modules/fast-content-type-parse/index.js
|
|
1040
|
-
var NullObject = function
|
|
1038
|
+
var NullObject = function NullObject() {};
|
|
1041
1039
|
NullObject.prototype = Object.create(null);
|
|
1042
1040
|
var paramRE = /; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu;
|
|
1043
1041
|
var quotedPairRE = /\\([\v\u0020-\u00ff])/gu;
|
|
@@ -1781,27 +1779,27 @@ function splitTableRow(row) {
|
|
|
1781
1779
|
return parts.map((p) => p.split(PLACEHOLDER).join("|"));
|
|
1782
1780
|
}
|
|
1783
1781
|
// ../../packages/aeg-core/src/blast-radius-domains.ts
|
|
1784
|
-
function resolveWorkspaceEntry(
|
|
1785
|
-
if (
|
|
1786
|
-
const baseDir =
|
|
1782
|
+
function resolveWorkspaceEntry(entry, listDirs) {
|
|
1783
|
+
if (entry.endsWith("/*")) {
|
|
1784
|
+
const baseDir = entry.slice(0, -2);
|
|
1787
1785
|
return listDirs(baseDir).map((name) => `${baseDir}/${name}`);
|
|
1788
1786
|
}
|
|
1789
|
-
if (
|
|
1787
|
+
if (entry.includes("*"))
|
|
1790
1788
|
return [];
|
|
1791
|
-
return [
|
|
1789
|
+
return [entry];
|
|
1792
1790
|
}
|
|
1793
1791
|
// ../../packages/aeg-core/src/consumer-enumeration.ts
|
|
1794
1792
|
function deriveWorkspaceMemberDirs(workspaces, listDirs) {
|
|
1795
|
-
const positive = workspaces.filter((
|
|
1796
|
-
const negative = workspaces.filter((
|
|
1793
|
+
const positive = workspaces.filter((entry) => !entry.startsWith("!"));
|
|
1794
|
+
const negative = workspaces.filter((entry) => entry.startsWith("!")).map((entry) => entry.slice(1));
|
|
1797
1795
|
const excluded = new Set;
|
|
1798
|
-
for (const
|
|
1799
|
-
for (const member of resolveWorkspaceEntry(
|
|
1796
|
+
for (const entry of negative) {
|
|
1797
|
+
for (const member of resolveWorkspaceEntry(entry, listDirs))
|
|
1800
1798
|
excluded.add(member);
|
|
1801
1799
|
}
|
|
1802
1800
|
const members = new Set;
|
|
1803
|
-
for (const
|
|
1804
|
-
for (const member of resolveWorkspaceEntry(
|
|
1801
|
+
for (const entry of positive) {
|
|
1802
|
+
for (const member of resolveWorkspaceEntry(entry, listDirs)) {
|
|
1805
1803
|
if (!excluded.has(member))
|
|
1806
1804
|
members.add(member);
|
|
1807
1805
|
}
|
|
@@ -2047,12 +2045,24 @@ function extractBaseSha(comment) {
|
|
|
2047
2045
|
const m = firstThirteenLines(comment).match(BASE_SHA_PATTERN);
|
|
2048
2046
|
return m ? m[1].toLowerCase() : null;
|
|
2049
2047
|
}
|
|
2050
|
-
var
|
|
2048
|
+
var FINDING_DESCRIPTION_STATE = /^F(\d+)(?:\s+\S+)?(?:\s+(open|fix-claimed|reproduced|resolved))?:/;
|
|
2049
|
+
function parseFindingState(description) {
|
|
2050
|
+
const m = FINDING_DESCRIPTION_STATE.exec(description.trim());
|
|
2051
|
+
if (!m)
|
|
2052
|
+
return { id: null, state: null };
|
|
2053
|
+
return { id: `F${m[1]}`, state: m[2] ?? null };
|
|
2054
|
+
}
|
|
2055
|
+
var FINDING_SEVERITY_LINE = /^\d+\.\s+\[([A-Z][A-Z]*)\]\s+(.+?)\s+—(?:\s+(.*))?$/gm;
|
|
2051
2056
|
function extractFindingSeverities(comment) {
|
|
2052
|
-
return [...comment.matchAll(FINDING_SEVERITY_LINE)].map((m) =>
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2057
|
+
return [...comment.matchAll(FINDING_SEVERITY_LINE)].map((m) => {
|
|
2058
|
+
const { id, state } = parseFindingState(m[3] ?? "");
|
|
2059
|
+
return {
|
|
2060
|
+
severity: m[1],
|
|
2061
|
+
location: m[2],
|
|
2062
|
+
id,
|
|
2063
|
+
state
|
|
2064
|
+
};
|
|
2065
|
+
});
|
|
2056
2066
|
}
|
|
2057
2067
|
function extractVerdict(comments, valuePattern, missingLabel) {
|
|
2058
2068
|
const candidates = comments.filter((c) => valuePattern.test(c));
|
|
@@ -2125,15 +2135,15 @@ function summarizeTranscript(jsonl) {
|
|
|
2125
2135
|
const line = rawLine.trim();
|
|
2126
2136
|
if (!line)
|
|
2127
2137
|
continue;
|
|
2128
|
-
let
|
|
2138
|
+
let entry;
|
|
2129
2139
|
try {
|
|
2130
|
-
|
|
2140
|
+
entry = JSON.parse(line);
|
|
2131
2141
|
} catch {
|
|
2132
2142
|
continue;
|
|
2133
2143
|
}
|
|
2134
|
-
if (!
|
|
2144
|
+
if (!entry || typeof entry !== "object")
|
|
2135
2145
|
continue;
|
|
2136
|
-
const obj =
|
|
2146
|
+
const obj = entry;
|
|
2137
2147
|
if (obj.type !== "assistant")
|
|
2138
2148
|
continue;
|
|
2139
2149
|
const message = obj.message;
|
|
@@ -2466,6 +2476,12 @@ function evaluateReviewFindings(findings, scale, threshold) {
|
|
|
2466
2476
|
});
|
|
2467
2477
|
return { outcome: blockingFindings.length > 0 ? "blocked" : "clean", blockingFindings };
|
|
2468
2478
|
}
|
|
2479
|
+
function isConsequentialFinding(finding) {
|
|
2480
|
+
return finding.state !== "resolved";
|
|
2481
|
+
}
|
|
2482
|
+
function consequentialFindings(findings) {
|
|
2483
|
+
return findings.filter((f) => isConsequentialFinding(f));
|
|
2484
|
+
}
|
|
2469
2485
|
function evaluateCodeReview(findings, policy) {
|
|
2470
2486
|
return evaluateReviewFindings(findings, CODE_REVIEW_SEVERITY_ORDER, policy.codeReviewThreshold);
|
|
2471
2487
|
}
|
|
@@ -2981,7 +2997,7 @@ function isStep0Block(content) {
|
|
|
2981
2997
|
}
|
|
2982
2998
|
function checkCommandsCarryOutput(prBody) {
|
|
2983
2999
|
const errors = [];
|
|
2984
|
-
for (const [
|
|
3000
|
+
for (const [label, num] of [
|
|
2985
3001
|
["5", 5],
|
|
2986
3002
|
["6", 6]
|
|
2987
3003
|
]) {
|
|
@@ -2995,7 +3011,7 @@ function checkCommandsCarryOutput(prBody) {
|
|
|
2995
3011
|
continue;
|
|
2996
3012
|
const next = blocks[i + 1];
|
|
2997
3013
|
if (!next || isCommandBlock(next.content)) {
|
|
2998
|
-
errors.push(`brief-validation commands carry output: §${
|
|
3014
|
+
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.`);
|
|
2999
3015
|
}
|
|
3000
3016
|
}
|
|
3001
3017
|
}
|
|
@@ -3432,8 +3448,8 @@ function stripPartBackticks(text) {
|
|
|
3432
3448
|
function partWordCount(text) {
|
|
3433
3449
|
return text.split(/\s+/).filter((w) => /[a-z]/i.test(w)).length;
|
|
3434
3450
|
}
|
|
3435
|
-
function looksLikeFilePath(
|
|
3436
|
-
const stripped =
|
|
3451
|
+
function looksLikeFilePath(entry) {
|
|
3452
|
+
const stripped = entry.replace(/\/\*\*?$/, "");
|
|
3437
3453
|
const lastSegment = stripped.split("/").pop() ?? stripped;
|
|
3438
3454
|
const extMatch = /\.[A-Za-z0-9]{1,6}$/.exec(lastSegment);
|
|
3439
3455
|
return extMatch !== null && extMatch.index > 0;
|
|
@@ -3919,14 +3935,14 @@ function checkClosesNTopology(branch, prBody, trancheFiles, taskIssueRefs) {
|
|
|
3919
3935
|
const referenced = extractClosesReferences(prBody);
|
|
3920
3936
|
if (taskIssueRefs) {
|
|
3921
3937
|
for (const n of referenced) {
|
|
3922
|
-
const
|
|
3923
|
-
if (!
|
|
3938
|
+
const ref = taskIssueRefs.get(n);
|
|
3939
|
+
if (!ref)
|
|
3924
3940
|
continue;
|
|
3925
|
-
const expectedBranch = `task/${
|
|
3941
|
+
const expectedBranch = `task/${ref.trancheSlug}/${ref.taskId}`;
|
|
3926
3942
|
if (branch !== expectedBranch) {
|
|
3927
3943
|
return {
|
|
3928
3944
|
ok: false,
|
|
3929
|
-
message: `closes-n-reverse: branch "${branch}" closes #${n} (task ${
|
|
3945
|
+
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.`
|
|
3930
3946
|
};
|
|
3931
3947
|
}
|
|
3932
3948
|
}
|
|
@@ -3935,15 +3951,15 @@ function checkClosesNTopology(branch, prBody, trancheFiles, taskIssueRefs) {
|
|
|
3935
3951
|
if (!ref)
|
|
3936
3952
|
return { ok: true };
|
|
3937
3953
|
if (ref.kind === "issue") {
|
|
3938
|
-
const
|
|
3939
|
-
if (!referenced.has(
|
|
3954
|
+
const expectedIssue = ref.issueNumber;
|
|
3955
|
+
if (!referenced.has(expectedIssue)) {
|
|
3940
3956
|
return {
|
|
3941
3957
|
ok: false,
|
|
3942
|
-
expectedIssue
|
|
3943
|
-
message: `closes-n: PR body does not contain \`Closes #${
|
|
3958
|
+
expectedIssue,
|
|
3959
|
+
message: `closes-n: PR body does not contain \`Closes #${expectedIssue}\` (required for branch "${branch}"). Add it to the PR body Summary section.`
|
|
3944
3960
|
};
|
|
3945
3961
|
}
|
|
3946
|
-
return { ok: true, expectedIssue
|
|
3962
|
+
return { ok: true, expectedIssue };
|
|
3947
3963
|
}
|
|
3948
3964
|
const trancheSlug = ref.tranche;
|
|
3949
3965
|
const taskId = ref.taskId;
|
|
@@ -3989,8 +4005,8 @@ function extractIssue(body) {
|
|
|
3989
4005
|
const anchorNums = closesRefs(anchored);
|
|
3990
4006
|
if (anchorNums.length === 0)
|
|
3991
4007
|
return { issue: null, extraIssues: bodyNums, outsideHeader: false };
|
|
3992
|
-
const
|
|
3993
|
-
return { issue
|
|
4008
|
+
const issue = anchorNums[0];
|
|
4009
|
+
return { issue, extraIssues: bodyNums.filter((n) => n !== issue), outsideHeader: false };
|
|
3994
4010
|
}
|
|
3995
4011
|
const headerNums = closesRefs(headerRegion(stripped));
|
|
3996
4012
|
if (bodyNums.length === 0)
|
|
@@ -4059,15 +4075,15 @@ function compareManifest(echoed, current, patchIdOf) {
|
|
|
4059
4075
|
const bothFullShas = echoedShaLen >= 40 && currentShaLen >= 40;
|
|
4060
4076
|
const base = patchHead || exactHead && bothFullShas ? true : isBoundToBase(echoed, current.baseSha);
|
|
4061
4077
|
const briefHashBound = isBoundToBriefHash(echoed, current.briefHash);
|
|
4062
|
-
const
|
|
4078
|
+
const objectivesVersion = isBoundToObjectives(echoed, current.objectivesVersion);
|
|
4063
4079
|
const rulingOrdinal = isBoundToRulings(echoed, current.rulingOrdinal);
|
|
4064
4080
|
const policyDigestBound = isBoundToPolicy(echoed, current.policyDigest);
|
|
4065
4081
|
return {
|
|
4066
|
-
bound: head && base && briefHashBound &&
|
|
4082
|
+
bound: head && base && briefHashBound && objectivesVersion && rulingOrdinal && policyDigestBound,
|
|
4067
4083
|
head,
|
|
4068
4084
|
base,
|
|
4069
4085
|
briefHash: briefHashBound,
|
|
4070
|
-
objectivesVersion
|
|
4086
|
+
objectivesVersion,
|
|
4071
4087
|
rulingOrdinal,
|
|
4072
4088
|
policyDigest: policyDigestBound
|
|
4073
4089
|
};
|
|
@@ -4098,8 +4114,8 @@ function checkReviewGate(input) {
|
|
|
4098
4114
|
let codeReviewPolicyEvaluation;
|
|
4099
4115
|
let securityPolicyEvaluation;
|
|
4100
4116
|
try {
|
|
4101
|
-
codeReviewPolicyEvaluation = evaluateCodeReview(codeReview.findingSeverities, policy);
|
|
4102
|
-
securityPolicyEvaluation = evaluateSecurityReview(security.findingSeverities, policy);
|
|
4117
|
+
codeReviewPolicyEvaluation = evaluateCodeReview(consequentialFindings(codeReview.findingSeverities), policy);
|
|
4118
|
+
securityPolicyEvaluation = evaluateSecurityReview(consequentialFindings(security.findingSeverities), policy);
|
|
4103
4119
|
} catch (err) {
|
|
4104
4120
|
return {
|
|
4105
4121
|
verdict: "fail",
|
|
@@ -5180,11 +5196,27 @@ var ObservedSchema = z.object({
|
|
|
5180
5196
|
var TaskStatusInputSchema = z.object({
|
|
5181
5197
|
task: TaskToolRefSchema.optional()
|
|
5182
5198
|
}).merge(PageRequestSchema).strict();
|
|
5199
|
+
var TaskConfidenceSchema = z.object({
|
|
5200
|
+
round: z.number().int().positive(),
|
|
5201
|
+
percent: z.number().int().min(0).max(100).nullable(),
|
|
5202
|
+
source: z.enum(["stated", "published-summary"])
|
|
5203
|
+
}).strict();
|
|
5204
|
+
var TaskPhaseHistorySchema = z.object({
|
|
5205
|
+
typicalPhaseMinutes: z.number().nonnegative(),
|
|
5206
|
+
typicalPhaseSamples: z.number().int().positive()
|
|
5207
|
+
}).strict();
|
|
5183
5208
|
var TaskStatusItemSchema = z.object({
|
|
5184
5209
|
task: TaskToolRefSchema,
|
|
5185
5210
|
issue: z.number().int().positive(),
|
|
5186
5211
|
pr: z.number().int().positive().nullable(),
|
|
5187
|
-
state: z.string()
|
|
5212
|
+
state: z.string(),
|
|
5213
|
+
round: z.number().int().positive().nullable().optional(),
|
|
5214
|
+
phase: z.string().min(1).nullable().optional(),
|
|
5215
|
+
minutesInPhase: z.number().nonnegative().nullable().optional(),
|
|
5216
|
+
phaseIsCurrent: z.boolean().nullable().optional(),
|
|
5217
|
+
lastConfidence: TaskConfidenceSchema.nullable().optional(),
|
|
5218
|
+
lastConfidenceUnread: z.boolean().optional(),
|
|
5219
|
+
phaseHistory: TaskPhaseHistorySchema.nullable().optional()
|
|
5188
5220
|
}).merge(ObservedSchema);
|
|
5189
5221
|
var TaskStatusResultSchema = z.object({
|
|
5190
5222
|
items: z.array(TaskStatusItemSchema),
|
|
@@ -5196,7 +5228,7 @@ var EscalationInputsSchema = z.object({
|
|
|
5196
5228
|
round: z.number().int().nonnegative(),
|
|
5197
5229
|
head: z.string(),
|
|
5198
5230
|
branch: z.string(),
|
|
5199
|
-
prNumber: z.number().int().positive()
|
|
5231
|
+
prNumber: z.number().int().positive().nullable()
|
|
5200
5232
|
});
|
|
5201
5233
|
var EscalationEvidenceSchema = z.object({
|
|
5202
5234
|
round: z.number().int().nonnegative(),
|
|
@@ -5232,13 +5264,45 @@ var TaskEscalationReadResultSchema = z.object({
|
|
|
5232
5264
|
items: z.array(TaskEscalationPacketSchema),
|
|
5233
5265
|
nextCursor: z.string().nullable()
|
|
5234
5266
|
}).merge(ObservedSchema);
|
|
5235
|
-
var
|
|
5236
|
-
|
|
5237
|
-
|
|
5267
|
+
var TaskPrCheckSchema = z.object({
|
|
5268
|
+
name: z.string(),
|
|
5269
|
+
required: z.boolean(),
|
|
5270
|
+
status: z.string(),
|
|
5271
|
+
conclusion: z.string().nullable(),
|
|
5272
|
+
detailsUrl: z.string().nullable(),
|
|
5273
|
+
failureSummary: z.string().nullable()
|
|
5274
|
+
});
|
|
5275
|
+
var TaskPrVerdictSchema = z.object({
|
|
5276
|
+
role: z.enum(["code-review", "security"]),
|
|
5277
|
+
value: z.string(),
|
|
5278
|
+
judgedHead: z.string().nullable(),
|
|
5279
|
+
objectivesVersion: z.string().nullable()
|
|
5280
|
+
});
|
|
5281
|
+
var TaskPrPauseSchema = z.object({
|
|
5282
|
+
reason: z.string(),
|
|
5283
|
+
body: z.string()
|
|
5284
|
+
});
|
|
5285
|
+
var TaskPrReviewRecordSchema = z.object({
|
|
5286
|
+
verdicts: z.array(TaskPrVerdictSchema),
|
|
5287
|
+
roundMarkers: z.array(z.number().int().nonnegative()),
|
|
5288
|
+
summaryTable: z.string().nullable(),
|
|
5289
|
+
pause: TaskPrPauseSchema.nullable()
|
|
5290
|
+
});
|
|
5291
|
+
var TaskPrReadInputSchema = z.object({
|
|
5292
|
+
task: TaskToolRefSchema,
|
|
5293
|
+
pr: z.number().int().positive().optional()
|
|
5238
5294
|
}).strict();
|
|
5295
|
+
var TaskPrReadResultSchema = z.object({
|
|
5296
|
+
task: TaskToolRefSchema,
|
|
5297
|
+
issue: z.number().int().positive(),
|
|
5298
|
+
pr: z.number().int().positive(),
|
|
5299
|
+
head: z.string().nullable(),
|
|
5300
|
+
checks: z.array(TaskPrCheckSchema),
|
|
5301
|
+
review: TaskPrReviewRecordSchema
|
|
5302
|
+
}).merge(ObservedSchema);
|
|
5239
5303
|
var TaskStartResultSchema = z.object({
|
|
5240
5304
|
requestId: z.string().min(1),
|
|
5241
|
-
run:
|
|
5305
|
+
run: TaskToolRefSchema,
|
|
5242
5306
|
started: z.boolean(),
|
|
5243
5307
|
startedAt: z.string(),
|
|
5244
5308
|
mode: z.literal("attended")
|
|
@@ -5252,7 +5316,7 @@ var TaskCancelInputSchema = z.object({
|
|
|
5252
5316
|
}).strict();
|
|
5253
5317
|
var TaskResumeResultSchema = z.object({
|
|
5254
5318
|
task: z.number().int().positive(),
|
|
5255
|
-
pr: z.number().int().positive(),
|
|
5319
|
+
pr: z.number().int().positive().nullable(),
|
|
5256
5320
|
escalationId: z.string().min(1),
|
|
5257
5321
|
outcome: z.enum(["started", "already_resumed"]),
|
|
5258
5322
|
authenticatedBy: z.string().min(1),
|
|
@@ -5261,7 +5325,7 @@ var TaskResumeResultSchema = z.object({
|
|
|
5261
5325
|
var TaskCancelOutcomeSchema = z.enum(["confirmed", "pending", "uncertain"]);
|
|
5262
5326
|
var TaskCancelResultSchema = z.object({
|
|
5263
5327
|
task: z.number().int().positive(),
|
|
5264
|
-
pr: z.number().int().positive(),
|
|
5328
|
+
pr: z.number().int().positive().nullable(),
|
|
5265
5329
|
escalationId: z.string().min(1),
|
|
5266
5330
|
outcome: TaskCancelOutcomeSchema,
|
|
5267
5331
|
authenticatedBy: z.string().min(1),
|
|
@@ -5272,6 +5336,7 @@ var TASK_TOOL_NAMES = [
|
|
|
5272
5336
|
"task_start",
|
|
5273
5337
|
"task_status",
|
|
5274
5338
|
"task_escalation_read",
|
|
5339
|
+
"task_pr_read",
|
|
5275
5340
|
"task_resume",
|
|
5276
5341
|
"task_cancel"
|
|
5277
5342
|
];
|
|
@@ -5499,6 +5564,10 @@ function findWorkspaceEscapes(files, knownPaths, workspaceDirs = DEFAULT_WORKSPA
|
|
|
5499
5564
|
}
|
|
5500
5565
|
return findings;
|
|
5501
5566
|
}
|
|
5567
|
+
// ../../packages/aeg-core/src/dev-review-loop/types.ts
|
|
5568
|
+
var SEVERITY_COLUMNS = ["blocker", "major", "minor", "critical", "high", "medium", "low"];
|
|
5569
|
+
// ../../packages/aeg-core/src/dev-review-loop/journal-reconstruction.ts
|
|
5570
|
+
var SUMMARY_TABLE_HEADER = `| round | ${SEVERITY_COLUMNS.join(" | ")} | confidence | outcome |`;
|
|
5502
5571
|
// ../../packages/aeg-core/src/log/envelope.ts
|
|
5503
5572
|
import { createHash as createHash5 } from "node:crypto";
|
|
5504
5573
|
|
|
@@ -6037,6 +6106,7 @@ function redact(value, home) {
|
|
|
6037
6106
|
return value;
|
|
6038
6107
|
}
|
|
6039
6108
|
// ../../packages/aeg-core/src/log/store.ts
|
|
6109
|
+
var KNOWN_SCHEMA_VERSIONS = [1, 2];
|
|
6040
6110
|
function metaOf(obj) {
|
|
6041
6111
|
if (obj === null || typeof obj !== "object")
|
|
6042
6112
|
return null;
|
|
@@ -6059,11 +6129,61 @@ function recordIdentity(obj) {
|
|
|
6059
6129
|
}
|
|
6060
6130
|
return null;
|
|
6061
6131
|
}
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
|
|
6066
|
-
|
|
6132
|
+
function schemaVersionOf(obj) {
|
|
6133
|
+
const meta = metaOf(obj);
|
|
6134
|
+
const schema = meta?.schema;
|
|
6135
|
+
return typeof schema === "number" ? schema : null;
|
|
6136
|
+
}
|
|
6137
|
+
function isKnownSchema(version) {
|
|
6138
|
+
return version !== null && KNOWN_SCHEMA_VERSIONS.includes(version);
|
|
6139
|
+
}
|
|
6140
|
+
function classifyStoredLine(raw, home) {
|
|
6141
|
+
let obj;
|
|
6142
|
+
try {
|
|
6143
|
+
obj = JSON.parse(raw);
|
|
6144
|
+
} catch {
|
|
6145
|
+
return { status: "invalid", identity: null, raw, reason: "not valid JSON" };
|
|
6146
|
+
}
|
|
6147
|
+
const version = schemaVersionOf(obj);
|
|
6148
|
+
if (version === null) {
|
|
6149
|
+
return { status: "invalid", identity: recordIdentity(obj), raw, reason: "no readable meta.schema" };
|
|
6150
|
+
}
|
|
6151
|
+
if (!isKnownSchema(version)) {
|
|
6152
|
+
return {
|
|
6153
|
+
status: "unknown_version",
|
|
6154
|
+
identity: recordIdentity(obj),
|
|
6155
|
+
schema: version,
|
|
6156
|
+
raw,
|
|
6157
|
+
reason: `schema version ${version} is not one this build validates (${KNOWN_SCHEMA_VERSIONS.join(", ")}) — kept for diagnosis`
|
|
6158
|
+
};
|
|
6159
|
+
}
|
|
6160
|
+
const result = LogEventSchema.safeParse(obj);
|
|
6161
|
+
if (!result.success) {
|
|
6162
|
+
return {
|
|
6163
|
+
status: "invalid",
|
|
6164
|
+
identity: recordIdentity(obj),
|
|
6165
|
+
raw,
|
|
6166
|
+
reason: result.error.issues[0]?.message ?? "schema violation"
|
|
6167
|
+
};
|
|
6168
|
+
}
|
|
6169
|
+
const event = result.data;
|
|
6170
|
+
const identity = recordIdentity(event);
|
|
6171
|
+
if (identity === null) {
|
|
6172
|
+
return { status: "invalid", identity: null, raw, reason: "valid event with no derivable identity" };
|
|
6173
|
+
}
|
|
6174
|
+
const redacted = redact(event, home);
|
|
6175
|
+
const provenance = version === 2 ? event.meta.provenance ?? null : null;
|
|
6176
|
+
return {
|
|
6177
|
+
status: "ok",
|
|
6178
|
+
identity,
|
|
6179
|
+
runId: event.meta.run_id,
|
|
6180
|
+
seq: event.meta.seq,
|
|
6181
|
+
schema: version,
|
|
6182
|
+
provenance,
|
|
6183
|
+
event,
|
|
6184
|
+
postLine: JSON.stringify(redacted)
|
|
6185
|
+
};
|
|
6186
|
+
}
|
|
6067
6187
|
// ../../packages/aeg-core/src/control-store/records.ts
|
|
6068
6188
|
import { z as z3 } from "zod";
|
|
6069
6189
|
var isoTimestamp = z3.string().min(1);
|
|
@@ -6194,7 +6314,8 @@ var ResolutionRecordSchema = z3.object({
|
|
|
6194
6314
|
consumedAt: isoTimestamp
|
|
6195
6315
|
}).strict();
|
|
6196
6316
|
// src/lib/config.ts
|
|
6197
|
-
import { execFileSync as execFileSync2 } from "node:child_process";
|
|
6317
|
+
import { execFile as execFile4, execFileSync as execFileSync2 } from "node:child_process";
|
|
6318
|
+
import { promisify as promisify4 } from "node:util";
|
|
6198
6319
|
import { existsSync, mkdirSync, readFileSync as readFileSync2, realpathSync, writeFileSync } from "node:fs";
|
|
6199
6320
|
import { homedir } from "node:os";
|
|
6200
6321
|
import { dirname, isAbsolute, join, resolve } from "node:path";
|
|
@@ -6221,10 +6342,10 @@ var CheckEntrySchema = z4.object({
|
|
|
6221
6342
|
ownWorkflow: z4.boolean().optional(),
|
|
6222
6343
|
principalOwed: z4.literal(true).optional(),
|
|
6223
6344
|
validates: z4.enum(["body", "issue"]).optional()
|
|
6224
|
-
}).superRefine((
|
|
6225
|
-
if (!
|
|
6345
|
+
}).superRefine((entry, ctx) => {
|
|
6346
|
+
if (!entry.env)
|
|
6226
6347
|
return;
|
|
6227
|
-
for (const [key, value] of Object.entries(
|
|
6348
|
+
for (const [key, value] of Object.entries(entry.env)) {
|
|
6228
6349
|
if (typeof value !== "object" || value === null || !("anyOf" in value))
|
|
6229
6350
|
continue;
|
|
6230
6351
|
const members = value.anyOf;
|
|
@@ -6381,18 +6502,19 @@ var VinayaConfigSchema = z4.object({
|
|
|
6381
6502
|
});
|
|
6382
6503
|
}
|
|
6383
6504
|
}).optional(),
|
|
6384
|
-
logPublish: z4.
|
|
6385
|
-
|
|
6386
|
-
|
|
6387
|
-
|
|
6388
|
-
|
|
6389
|
-
|
|
6390
|
-
|
|
6391
|
-
|
|
6392
|
-
}).refine((v) => v.
|
|
6393
|
-
message: "
|
|
6394
|
-
}).
|
|
6395
|
-
|
|
6505
|
+
logPublish: z4.unknown().refine((v) => v === undefined, {
|
|
6506
|
+
message: "logPublish is removed — telemetry is never posted to a tracker or a code host; configure `logs` instead (a folder or a server destination)"
|
|
6507
|
+
}),
|
|
6508
|
+
runtimeDir: z4.string().min(1).refine((v) => isAbsolute(v), { message: "runtimeDir: must be an absolute path" }).optional(),
|
|
6509
|
+
logs: z4.object({
|
|
6510
|
+
folder: z4.string().min(1).refine((v) => isAbsolute(v), { message: "logs.folder: must be an absolute path" }).optional(),
|
|
6511
|
+
url: z4.string().url().optional(),
|
|
6512
|
+
headers: z4.record(z4.string()).optional()
|
|
6513
|
+
}).refine((v) => [v.folder, v.url].filter((x) => x !== undefined).length <= 1, {
|
|
6514
|
+
message: "logs: set at most one of folder/url"
|
|
6515
|
+
}).refine((v) => v.headers === undefined || v.url !== undefined, {
|
|
6516
|
+
message: "logs: headers requires url"
|
|
6517
|
+
}).optional()
|
|
6396
6518
|
});
|
|
6397
6519
|
var GLOBAL_VINAYA_HOME = join(homedir(), ".vinaya");
|
|
6398
6520
|
var GLOBAL_CONFIG_PATH = join(GLOBAL_VINAYA_HOME, "config.json");
|
|
@@ -6437,32 +6559,39 @@ function globalTokensCollectIgnoredWarning(path) {
|
|
|
6437
6559
|
function globalRuntimeDirIgnoredWarning(path) {
|
|
6438
6560
|
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.`;
|
|
6439
6561
|
}
|
|
6562
|
+
var emittedGlobalKeyWarnings = new Set;
|
|
6563
|
+
function warnGlobalKeyIgnoredOnce(message) {
|
|
6564
|
+
if (emittedGlobalKeyWarnings.has(message))
|
|
6565
|
+
return;
|
|
6566
|
+
emittedGlobalKeyWarnings.add(message);
|
|
6567
|
+
console.error(`⚠ ${message}`);
|
|
6568
|
+
}
|
|
6440
6569
|
function stripGlobalOnlyKeys(config, path) {
|
|
6441
6570
|
if (path !== GLOBAL_CONFIG_PATH)
|
|
6442
6571
|
return config;
|
|
6443
6572
|
let result = config;
|
|
6444
6573
|
if (result.checks && Object.keys(result.checks).length > 0) {
|
|
6445
|
-
|
|
6574
|
+
warnGlobalKeyIgnoredOnce(globalChecksIgnoredWarning(path));
|
|
6446
6575
|
result = { ...result, checks: undefined };
|
|
6447
6576
|
}
|
|
6448
6577
|
if (result.roles && Object.keys(result.roles).length > 0) {
|
|
6449
|
-
|
|
6578
|
+
warnGlobalKeyIgnoredOnce(globalRolesIgnoredWarning(path));
|
|
6450
6579
|
result = { ...result, roles: undefined };
|
|
6451
6580
|
}
|
|
6452
6581
|
if (result.principals && result.principals.length > 0) {
|
|
6453
|
-
|
|
6582
|
+
warnGlobalKeyIgnoredOnce(globalPrincipalsIgnoredWarning(path));
|
|
6454
6583
|
result = { ...result, principals: undefined };
|
|
6455
6584
|
}
|
|
6456
6585
|
if (result.releaseActor) {
|
|
6457
|
-
|
|
6586
|
+
warnGlobalKeyIgnoredOnce(globalReleaseActorIgnoredWarning(path));
|
|
6458
6587
|
result = { ...result, releaseActor: undefined };
|
|
6459
6588
|
}
|
|
6460
6589
|
if (result.tokens) {
|
|
6461
|
-
|
|
6590
|
+
warnGlobalKeyIgnoredOnce(globalTokensCollectIgnoredWarning(path));
|
|
6462
6591
|
result = { ...result, tokens: undefined };
|
|
6463
6592
|
}
|
|
6464
6593
|
if (result.runtimeDir) {
|
|
6465
|
-
|
|
6594
|
+
warnGlobalKeyIgnoredOnce(globalRuntimeDirIgnoredWarning(path));
|
|
6466
6595
|
result = { ...result, runtimeDir: undefined };
|
|
6467
6596
|
}
|
|
6468
6597
|
return result;
|
|
@@ -6495,26 +6624,102 @@ function resolveReviewPolicy(config) {
|
|
|
6495
6624
|
maxRounds
|
|
6496
6625
|
};
|
|
6497
6626
|
}
|
|
6498
|
-
function
|
|
6499
|
-
|
|
6500
|
-
|
|
6501
|
-
|
|
6502
|
-
|
|
6503
|
-
|
|
6504
|
-
|
|
6627
|
+
function resolveRuntimeDirSetting(config) {
|
|
6628
|
+
return config?.runtimeDir ?? null;
|
|
6629
|
+
}
|
|
6630
|
+
function resolveTrustAnchorRuntimeDir(localRuntimeDir, trustAnchorConfig) {
|
|
6631
|
+
const anchored = resolveRuntimeDirSetting(trustAnchorConfig);
|
|
6632
|
+
return anchored !== null && anchored === localRuntimeDir ? anchored : null;
|
|
6633
|
+
}
|
|
6634
|
+
function resolveLogsSetting(config) {
|
|
6635
|
+
const raw = config?.logs;
|
|
6636
|
+
if (!raw)
|
|
6637
|
+
return null;
|
|
6638
|
+
if (raw.url !== undefined)
|
|
6639
|
+
return { url: raw.url, headers: raw.headers };
|
|
6640
|
+
if (raw.folder !== undefined)
|
|
6641
|
+
return { folder: raw.folder };
|
|
6642
|
+
return null;
|
|
6643
|
+
}
|
|
6644
|
+
function resolveTrustAnchorLogsDestination(local, trustAnchorConfig) {
|
|
6645
|
+
const anchored = resolveLogsSetting(trustAnchorConfig);
|
|
6646
|
+
if (!anchored)
|
|
6647
|
+
return null;
|
|
6648
|
+
if ("url" in local)
|
|
6649
|
+
return "url" in anchored && anchored.url === local.url ? anchored : null;
|
|
6650
|
+
return "folder" in anchored && anchored.folder === local.folder ? anchored : null;
|
|
6651
|
+
}
|
|
6652
|
+
function resolveLogsHeaderValues(headers, env) {
|
|
6653
|
+
if (!headers)
|
|
6654
|
+
return;
|
|
6655
|
+
const resolved = {};
|
|
6656
|
+
for (const [key, value] of Object.entries(headers)) {
|
|
6657
|
+
resolved[key] = value.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g, (_match, name) => env[name] ?? "");
|
|
6505
6658
|
}
|
|
6659
|
+
return resolved;
|
|
6660
|
+
}
|
|
6661
|
+
function trustAnchorRepo() {
|
|
6662
|
+
const fromRunner = trustAnchorRepoFromRunner();
|
|
6663
|
+
if (fromRunner)
|
|
6664
|
+
return fromRunner;
|
|
6506
6665
|
try {
|
|
6507
6666
|
const url = execFileSync2("git", ["remote", "get-url", "origin"], {
|
|
6508
6667
|
encoding: "utf-8",
|
|
6509
6668
|
stdio: ["ignore", "pipe", "pipe"]
|
|
6510
|
-
})
|
|
6511
|
-
|
|
6512
|
-
return m?.[1] && m[2] ? wellFormed(`${m[1]}/${m[2]}`) : null;
|
|
6669
|
+
});
|
|
6670
|
+
return trustAnchorRepoFromRemoteUrl(url);
|
|
6513
6671
|
} catch {
|
|
6514
6672
|
return null;
|
|
6515
6673
|
}
|
|
6516
6674
|
}
|
|
6675
|
+
async function trustAnchorRepoAsync() {
|
|
6676
|
+
const fromRunner = trustAnchorRepoFromRunner();
|
|
6677
|
+
if (fromRunner)
|
|
6678
|
+
return fromRunner;
|
|
6679
|
+
try {
|
|
6680
|
+
const { stdout } = await execFileAsync4("git", ["remote", "get-url", "origin"], {
|
|
6681
|
+
encoding: "utf-8",
|
|
6682
|
+
timeout: 1e4
|
|
6683
|
+
});
|
|
6684
|
+
return trustAnchorRepoFromRemoteUrl(stdout);
|
|
6685
|
+
} catch {
|
|
6686
|
+
return null;
|
|
6687
|
+
}
|
|
6688
|
+
}
|
|
6689
|
+
function wellFormedRepoSlug(slug) {
|
|
6690
|
+
return /^[^/\s]+\/[^/\s]+$/.test(slug) ? slug : null;
|
|
6691
|
+
}
|
|
6692
|
+
function trustAnchorRepoFromRunner() {
|
|
6693
|
+
const fromRunner = process.env.GITHUB_REPOSITORY?.trim();
|
|
6694
|
+
return fromRunner ? wellFormedRepoSlug(fromRunner) : null;
|
|
6695
|
+
}
|
|
6696
|
+
function trustAnchorRepoFromRemoteUrl(url) {
|
|
6697
|
+
const m = url.trim().match(/github\.com[:/]([^/]+)\/(.+?)(?:\.git)?\/?$/);
|
|
6698
|
+
return m?.[1] && m[2] ? wellFormedRepoSlug(`${m[1]}/${m[2]}`) : null;
|
|
6699
|
+
}
|
|
6700
|
+
var execFileAsync4 = promisify4(execFile4);
|
|
6701
|
+
function resolveCiTrustAnchorProbeRef(env = process.env) {
|
|
6702
|
+
const ref = env.VINAYA_CI_CONFIG_PROBE_REF?.trim();
|
|
6703
|
+
if (!ref)
|
|
6704
|
+
return null;
|
|
6705
|
+
if (env.GITHUB_ACTIONS !== "true")
|
|
6706
|
+
return null;
|
|
6707
|
+
if ((env.GH_TOKEN ?? "").length > 0 || (env.GITHUB_TOKEN ?? "").length > 0)
|
|
6708
|
+
return null;
|
|
6709
|
+
return ref;
|
|
6710
|
+
}
|
|
6711
|
+
function readTrustAnchorConfigAtRef(ref) {
|
|
6712
|
+
const raw = execFileSync2("git", ["show", `${ref}:${LOCAL_CONFIG_FILENAME}`], {
|
|
6713
|
+
encoding: "utf-8",
|
|
6714
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
6715
|
+
timeout: 1e4
|
|
6716
|
+
});
|
|
6717
|
+
return Buffer.from(raw, "utf-8").toString("base64");
|
|
6718
|
+
}
|
|
6517
6719
|
function ghFetchTrustAnchorConfig() {
|
|
6720
|
+
const probeRef = resolveCiTrustAnchorProbeRef();
|
|
6721
|
+
if (probeRef)
|
|
6722
|
+
return readTrustAnchorConfigAtRef(probeRef);
|
|
6518
6723
|
const repo = trustAnchorRepo();
|
|
6519
6724
|
if (!repo)
|
|
6520
6725
|
throw new Error("could not resolve repo identity for the trust-anchor read");
|
|
@@ -6523,6 +6728,21 @@ function ghFetchTrustAnchorConfig() {
|
|
|
6523
6728
|
stdio: ["ignore", "pipe", "pipe"]
|
|
6524
6729
|
});
|
|
6525
6730
|
}
|
|
6731
|
+
async function ghFetchTrustAnchorConfigAsync() {
|
|
6732
|
+
const probeRef = resolveCiTrustAnchorProbeRef();
|
|
6733
|
+
if (probeRef) {
|
|
6734
|
+
const { stdout } = await execFileAsync4("git", ["show", `${probeRef}:${LOCAL_CONFIG_FILENAME}`], {
|
|
6735
|
+
encoding: "utf-8",
|
|
6736
|
+
timeout: 1e4
|
|
6737
|
+
});
|
|
6738
|
+
return Buffer.from(stdout, "utf-8").toString("base64");
|
|
6739
|
+
}
|
|
6740
|
+
const repo = await trustAnchorRepoAsync();
|
|
6741
|
+
if (!repo)
|
|
6742
|
+
throw new Error("could not resolve repo identity for the trust-anchor read");
|
|
6743
|
+
const { stdout } = await execFileAsync4("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], { encoding: "utf-8", timeout: 1e4 });
|
|
6744
|
+
return stdout;
|
|
6745
|
+
}
|
|
6526
6746
|
function firstLine(err) {
|
|
6527
6747
|
return err?.message?.split(`
|
|
6528
6748
|
`)[0] ?? "unknown error";
|
|
@@ -6537,16 +6757,35 @@ function isMissingFileError(err) {
|
|
|
6537
6757
|
return /\b404\b|not found/i.test(haystack);
|
|
6538
6758
|
}
|
|
6539
6759
|
function loadTrustAnchorConfig(fetcher = ghFetchTrustAnchorConfig) {
|
|
6540
|
-
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.
|
|
6541
|
-
`);
|
|
6542
6760
|
let base64;
|
|
6543
6761
|
try {
|
|
6544
|
-
base64 = fetcher()
|
|
6762
|
+
base64 = fetcher();
|
|
6545
6763
|
} catch (err) {
|
|
6546
|
-
|
|
6547
|
-
|
|
6548
|
-
|
|
6764
|
+
return trustAnchorFetchFailed(err);
|
|
6765
|
+
}
|
|
6766
|
+
return parseTrustAnchorContent(base64);
|
|
6767
|
+
}
|
|
6768
|
+
async function loadTrustAnchorConfigAsync(fetcher = ghFetchTrustAnchorConfigAsync, options = {}) {
|
|
6769
|
+
const warn = options.quiet ? () => {} : warnTrustAnchorFallback;
|
|
6770
|
+
let base64;
|
|
6771
|
+
try {
|
|
6772
|
+
base64 = await fetcher();
|
|
6773
|
+
} catch (err) {
|
|
6774
|
+
return trustAnchorFetchFailed(err, warn);
|
|
6549
6775
|
}
|
|
6776
|
+
return parseTrustAnchorContent(base64, warn);
|
|
6777
|
+
}
|
|
6778
|
+
function warnTrustAnchorFallback(why) {
|
|
6779
|
+
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.
|
|
6780
|
+
`);
|
|
6781
|
+
}
|
|
6782
|
+
function trustAnchorFetchFailed(err, warn = warnTrustAnchorFallback) {
|
|
6783
|
+
if (!isMissingFileError(err))
|
|
6784
|
+
warn(firstLine(err));
|
|
6785
|
+
return null;
|
|
6786
|
+
}
|
|
6787
|
+
function parseTrustAnchorContent(content, warn = warnTrustAnchorFallback) {
|
|
6788
|
+
const base64 = content.trim();
|
|
6550
6789
|
if (!base64)
|
|
6551
6790
|
return null;
|
|
6552
6791
|
try {
|
|
@@ -6767,14 +7006,14 @@ function blankAnchoredRegions(body) {
|
|
|
6767
7006
|
function blankTokenReportSection(body) {
|
|
6768
7007
|
const lines = body.split(`
|
|
6769
7008
|
`);
|
|
6770
|
-
const
|
|
6771
|
-
const
|
|
6772
|
-
const startIdx = lines.findIndex((l) =>
|
|
7009
|
+
const HEADING = /^#{1,6}\s/;
|
|
7010
|
+
const TOKEN_REPORT_HEADING = /^#{1,6}\s*token report\s*$/i;
|
|
7011
|
+
const startIdx = lines.findIndex((l) => TOKEN_REPORT_HEADING.test(l));
|
|
6773
7012
|
if (startIdx === -1)
|
|
6774
7013
|
return body;
|
|
6775
7014
|
let endIdx = lines.length;
|
|
6776
7015
|
for (let i = startIdx + 1;i < lines.length; i++) {
|
|
6777
|
-
if (
|
|
7016
|
+
if (HEADING.test(lines[i])) {
|
|
6778
7017
|
endIdx = i;
|
|
6779
7018
|
break;
|
|
6780
7019
|
}
|
|
@@ -6793,10 +7032,10 @@ function blankTierField(line) {
|
|
|
6793
7032
|
}
|
|
6794
7033
|
var SEGMENT_HAS_DIGIT = /\p{Nd}/u;
|
|
6795
7034
|
function blankProjectField(line) {
|
|
6796
|
-
const
|
|
6797
|
-
if (!
|
|
7035
|
+
const label = PROJECT_LABEL.exec(line);
|
|
7036
|
+
if (!label)
|
|
6798
7037
|
return line;
|
|
6799
|
-
const valueStart =
|
|
7038
|
+
const valueStart = label.index + label[0].length;
|
|
6800
7039
|
const segments = line.slice(valueStart).split(",");
|
|
6801
7040
|
const blanked = segments.map((seg) => {
|
|
6802
7041
|
const name = unwrapValue(seg);
|