@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
|
@@ -1038,7 +1038,7 @@ function withDefaults(oldDefaults, newDefaults) {
|
|
|
1038
1038
|
var endpoint = withDefaults(null, DEFAULTS);
|
|
1039
1039
|
|
|
1040
1040
|
// ../../node_modules/fast-content-type-parse/index.js
|
|
1041
|
-
var NullObject = function
|
|
1041
|
+
var NullObject = function NullObject() {};
|
|
1042
1042
|
NullObject.prototype = Object.create(null);
|
|
1043
1043
|
var paramRE = /; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu;
|
|
1044
1044
|
var quotedPairRE = /\\([\v\u0020-\u00ff])/gu;
|
|
@@ -1782,27 +1782,27 @@ function splitTableRow(row) {
|
|
|
1782
1782
|
return parts.map((p) => p.split(PLACEHOLDER).join("|"));
|
|
1783
1783
|
}
|
|
1784
1784
|
// ../../packages/aeg-core/src/blast-radius-domains.ts
|
|
1785
|
-
function resolveWorkspaceEntry(
|
|
1786
|
-
if (
|
|
1787
|
-
const baseDir =
|
|
1785
|
+
function resolveWorkspaceEntry(entry, listDirs) {
|
|
1786
|
+
if (entry.endsWith("/*")) {
|
|
1787
|
+
const baseDir = entry.slice(0, -2);
|
|
1788
1788
|
return listDirs(baseDir).map((name) => `${baseDir}/${name}`);
|
|
1789
1789
|
}
|
|
1790
|
-
if (
|
|
1790
|
+
if (entry.includes("*"))
|
|
1791
1791
|
return [];
|
|
1792
|
-
return [
|
|
1792
|
+
return [entry];
|
|
1793
1793
|
}
|
|
1794
1794
|
// ../../packages/aeg-core/src/consumer-enumeration.ts
|
|
1795
1795
|
function deriveWorkspaceMemberDirs(workspaces, listDirs) {
|
|
1796
|
-
const positive = workspaces.filter((
|
|
1797
|
-
const negative = workspaces.filter((
|
|
1796
|
+
const positive = workspaces.filter((entry) => !entry.startsWith("!"));
|
|
1797
|
+
const negative = workspaces.filter((entry) => entry.startsWith("!")).map((entry) => entry.slice(1));
|
|
1798
1798
|
const excluded = new Set;
|
|
1799
|
-
for (const
|
|
1800
|
-
for (const member of resolveWorkspaceEntry(
|
|
1799
|
+
for (const entry of negative) {
|
|
1800
|
+
for (const member of resolveWorkspaceEntry(entry, listDirs))
|
|
1801
1801
|
excluded.add(member);
|
|
1802
1802
|
}
|
|
1803
1803
|
const members = new Set;
|
|
1804
|
-
for (const
|
|
1805
|
-
for (const member of resolveWorkspaceEntry(
|
|
1804
|
+
for (const entry of positive) {
|
|
1805
|
+
for (const member of resolveWorkspaceEntry(entry, listDirs)) {
|
|
1806
1806
|
if (!excluded.has(member))
|
|
1807
1807
|
members.add(member);
|
|
1808
1808
|
}
|
|
@@ -2048,12 +2048,24 @@ function extractBaseSha(comment) {
|
|
|
2048
2048
|
const m = firstThirteenLines(comment).match(BASE_SHA_PATTERN);
|
|
2049
2049
|
return m ? m[1].toLowerCase() : null;
|
|
2050
2050
|
}
|
|
2051
|
-
var
|
|
2051
|
+
var FINDING_DESCRIPTION_STATE = /^F(\d+)(?:\s+\S+)?(?:\s+(open|fix-claimed|reproduced|resolved))?:/;
|
|
2052
|
+
function parseFindingState(description) {
|
|
2053
|
+
const m = FINDING_DESCRIPTION_STATE.exec(description.trim());
|
|
2054
|
+
if (!m)
|
|
2055
|
+
return { id: null, state: null };
|
|
2056
|
+
return { id: `F${m[1]}`, state: m[2] ?? null };
|
|
2057
|
+
}
|
|
2058
|
+
var FINDING_SEVERITY_LINE = /^\d+\.\s+\[([A-Z][A-Z]*)\]\s+(.+?)\s+—(?:\s+(.*))?$/gm;
|
|
2052
2059
|
function extractFindingSeverities(comment) {
|
|
2053
|
-
return [...comment.matchAll(FINDING_SEVERITY_LINE)].map((m) =>
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2060
|
+
return [...comment.matchAll(FINDING_SEVERITY_LINE)].map((m) => {
|
|
2061
|
+
const { id, state } = parseFindingState(m[3] ?? "");
|
|
2062
|
+
return {
|
|
2063
|
+
severity: m[1],
|
|
2064
|
+
location: m[2],
|
|
2065
|
+
id,
|
|
2066
|
+
state
|
|
2067
|
+
};
|
|
2068
|
+
});
|
|
2057
2069
|
}
|
|
2058
2070
|
function extractVerdict(comments, valuePattern, missingLabel) {
|
|
2059
2071
|
const candidates = comments.filter((c) => valuePattern.test(c));
|
|
@@ -2126,15 +2138,15 @@ function summarizeTranscript(jsonl) {
|
|
|
2126
2138
|
const line = rawLine.trim();
|
|
2127
2139
|
if (!line)
|
|
2128
2140
|
continue;
|
|
2129
|
-
let
|
|
2141
|
+
let entry;
|
|
2130
2142
|
try {
|
|
2131
|
-
|
|
2143
|
+
entry = JSON.parse(line);
|
|
2132
2144
|
} catch {
|
|
2133
2145
|
continue;
|
|
2134
2146
|
}
|
|
2135
|
-
if (!
|
|
2147
|
+
if (!entry || typeof entry !== "object")
|
|
2136
2148
|
continue;
|
|
2137
|
-
const obj =
|
|
2149
|
+
const obj = entry;
|
|
2138
2150
|
if (obj.type !== "assistant")
|
|
2139
2151
|
continue;
|
|
2140
2152
|
const message = obj.message;
|
|
@@ -2467,6 +2479,12 @@ function evaluateReviewFindings(findings, scale, threshold) {
|
|
|
2467
2479
|
});
|
|
2468
2480
|
return { outcome: blockingFindings.length > 0 ? "blocked" : "clean", blockingFindings };
|
|
2469
2481
|
}
|
|
2482
|
+
function isConsequentialFinding(finding) {
|
|
2483
|
+
return finding.state !== "resolved";
|
|
2484
|
+
}
|
|
2485
|
+
function consequentialFindings(findings) {
|
|
2486
|
+
return findings.filter((f) => isConsequentialFinding(f));
|
|
2487
|
+
}
|
|
2470
2488
|
function evaluateCodeReview(findings, policy) {
|
|
2471
2489
|
return evaluateReviewFindings(findings, CODE_REVIEW_SEVERITY_ORDER, policy.codeReviewThreshold);
|
|
2472
2490
|
}
|
|
@@ -2982,7 +3000,7 @@ function isStep0Block(content) {
|
|
|
2982
3000
|
}
|
|
2983
3001
|
function checkCommandsCarryOutput(prBody) {
|
|
2984
3002
|
const errors = [];
|
|
2985
|
-
for (const [
|
|
3003
|
+
for (const [label, num] of [
|
|
2986
3004
|
["5", 5],
|
|
2987
3005
|
["6", 6]
|
|
2988
3006
|
]) {
|
|
@@ -2996,7 +3014,7 @@ function checkCommandsCarryOutput(prBody) {
|
|
|
2996
3014
|
continue;
|
|
2997
3015
|
const next = blocks[i + 1];
|
|
2998
3016
|
if (!next || isCommandBlock(next.content)) {
|
|
2999
|
-
errors.push(`brief-validation commands carry output: §${
|
|
3017
|
+
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
3018
|
}
|
|
3001
3019
|
}
|
|
3002
3020
|
}
|
|
@@ -3433,8 +3451,8 @@ function stripPartBackticks(text) {
|
|
|
3433
3451
|
function partWordCount(text) {
|
|
3434
3452
|
return text.split(/\s+/).filter((w) => /[a-z]/i.test(w)).length;
|
|
3435
3453
|
}
|
|
3436
|
-
function looksLikeFilePath(
|
|
3437
|
-
const stripped =
|
|
3454
|
+
function looksLikeFilePath(entry) {
|
|
3455
|
+
const stripped = entry.replace(/\/\*\*?$/, "");
|
|
3438
3456
|
const lastSegment = stripped.split("/").pop() ?? stripped;
|
|
3439
3457
|
const extMatch = /\.[A-Za-z0-9]{1,6}$/.exec(lastSegment);
|
|
3440
3458
|
return extMatch !== null && extMatch.index > 0;
|
|
@@ -3920,14 +3938,14 @@ function checkClosesNTopology(branch, prBody, trancheFiles, taskIssueRefs) {
|
|
|
3920
3938
|
const referenced = extractClosesReferences(prBody);
|
|
3921
3939
|
if (taskIssueRefs) {
|
|
3922
3940
|
for (const n of referenced) {
|
|
3923
|
-
const
|
|
3924
|
-
if (!
|
|
3941
|
+
const ref = taskIssueRefs.get(n);
|
|
3942
|
+
if (!ref)
|
|
3925
3943
|
continue;
|
|
3926
|
-
const expectedBranch = `task/${
|
|
3944
|
+
const expectedBranch = `task/${ref.trancheSlug}/${ref.taskId}`;
|
|
3927
3945
|
if (branch !== expectedBranch) {
|
|
3928
3946
|
return {
|
|
3929
3947
|
ok: false,
|
|
3930
|
-
message: `closes-n-reverse: branch "${branch}" closes #${n} (task ${
|
|
3948
|
+
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
3949
|
};
|
|
3932
3950
|
}
|
|
3933
3951
|
}
|
|
@@ -3936,15 +3954,15 @@ function checkClosesNTopology(branch, prBody, trancheFiles, taskIssueRefs) {
|
|
|
3936
3954
|
if (!ref)
|
|
3937
3955
|
return { ok: true };
|
|
3938
3956
|
if (ref.kind === "issue") {
|
|
3939
|
-
const
|
|
3940
|
-
if (!referenced.has(
|
|
3957
|
+
const expectedIssue = ref.issueNumber;
|
|
3958
|
+
if (!referenced.has(expectedIssue)) {
|
|
3941
3959
|
return {
|
|
3942
3960
|
ok: false,
|
|
3943
|
-
expectedIssue
|
|
3944
|
-
message: `closes-n: PR body does not contain \`Closes #${
|
|
3961
|
+
expectedIssue,
|
|
3962
|
+
message: `closes-n: PR body does not contain \`Closes #${expectedIssue}\` (required for branch "${branch}"). Add it to the PR body Summary section.`
|
|
3945
3963
|
};
|
|
3946
3964
|
}
|
|
3947
|
-
return { ok: true, expectedIssue
|
|
3965
|
+
return { ok: true, expectedIssue };
|
|
3948
3966
|
}
|
|
3949
3967
|
const trancheSlug = ref.tranche;
|
|
3950
3968
|
const taskId = ref.taskId;
|
|
@@ -3990,8 +4008,8 @@ function extractIssue(body) {
|
|
|
3990
4008
|
const anchorNums = closesRefs(anchored);
|
|
3991
4009
|
if (anchorNums.length === 0)
|
|
3992
4010
|
return { issue: null, extraIssues: bodyNums, outsideHeader: false };
|
|
3993
|
-
const
|
|
3994
|
-
return { issue
|
|
4011
|
+
const issue = anchorNums[0];
|
|
4012
|
+
return { issue, extraIssues: bodyNums.filter((n) => n !== issue), outsideHeader: false };
|
|
3995
4013
|
}
|
|
3996
4014
|
const headerNums = closesRefs(headerRegion(stripped));
|
|
3997
4015
|
if (bodyNums.length === 0)
|
|
@@ -4060,15 +4078,15 @@ function compareManifest(echoed, current, patchIdOf) {
|
|
|
4060
4078
|
const bothFullShas = echoedShaLen >= 40 && currentShaLen >= 40;
|
|
4061
4079
|
const base = patchHead || exactHead && bothFullShas ? true : isBoundToBase(echoed, current.baseSha);
|
|
4062
4080
|
const briefHashBound = isBoundToBriefHash(echoed, current.briefHash);
|
|
4063
|
-
const
|
|
4081
|
+
const objectivesVersion = isBoundToObjectives(echoed, current.objectivesVersion);
|
|
4064
4082
|
const rulingOrdinal = isBoundToRulings(echoed, current.rulingOrdinal);
|
|
4065
4083
|
const policyDigestBound = isBoundToPolicy(echoed, current.policyDigest);
|
|
4066
4084
|
return {
|
|
4067
|
-
bound: head && base && briefHashBound &&
|
|
4085
|
+
bound: head && base && briefHashBound && objectivesVersion && rulingOrdinal && policyDigestBound,
|
|
4068
4086
|
head,
|
|
4069
4087
|
base,
|
|
4070
4088
|
briefHash: briefHashBound,
|
|
4071
|
-
objectivesVersion
|
|
4089
|
+
objectivesVersion,
|
|
4072
4090
|
rulingOrdinal,
|
|
4073
4091
|
policyDigest: policyDigestBound
|
|
4074
4092
|
};
|
|
@@ -4099,8 +4117,8 @@ function checkReviewGate(input) {
|
|
|
4099
4117
|
let codeReviewPolicyEvaluation;
|
|
4100
4118
|
let securityPolicyEvaluation;
|
|
4101
4119
|
try {
|
|
4102
|
-
codeReviewPolicyEvaluation = evaluateCodeReview(codeReview.findingSeverities, policy);
|
|
4103
|
-
securityPolicyEvaluation = evaluateSecurityReview(security.findingSeverities, policy);
|
|
4120
|
+
codeReviewPolicyEvaluation = evaluateCodeReview(consequentialFindings(codeReview.findingSeverities), policy);
|
|
4121
|
+
securityPolicyEvaluation = evaluateSecurityReview(consequentialFindings(security.findingSeverities), policy);
|
|
4104
4122
|
} catch (err) {
|
|
4105
4123
|
return {
|
|
4106
4124
|
verdict: "fail",
|
|
@@ -5181,11 +5199,27 @@ var ObservedSchema = z.object({
|
|
|
5181
5199
|
var TaskStatusInputSchema = z.object({
|
|
5182
5200
|
task: TaskToolRefSchema.optional()
|
|
5183
5201
|
}).merge(PageRequestSchema).strict();
|
|
5202
|
+
var TaskConfidenceSchema = z.object({
|
|
5203
|
+
round: z.number().int().positive(),
|
|
5204
|
+
percent: z.number().int().min(0).max(100).nullable(),
|
|
5205
|
+
source: z.enum(["stated", "published-summary"])
|
|
5206
|
+
}).strict();
|
|
5207
|
+
var TaskPhaseHistorySchema = z.object({
|
|
5208
|
+
typicalPhaseMinutes: z.number().nonnegative(),
|
|
5209
|
+
typicalPhaseSamples: z.number().int().positive()
|
|
5210
|
+
}).strict();
|
|
5184
5211
|
var TaskStatusItemSchema = z.object({
|
|
5185
5212
|
task: TaskToolRefSchema,
|
|
5186
5213
|
issue: z.number().int().positive(),
|
|
5187
5214
|
pr: z.number().int().positive().nullable(),
|
|
5188
|
-
state: z.string()
|
|
5215
|
+
state: z.string(),
|
|
5216
|
+
round: z.number().int().positive().nullable().optional(),
|
|
5217
|
+
phase: z.string().min(1).nullable().optional(),
|
|
5218
|
+
minutesInPhase: z.number().nonnegative().nullable().optional(),
|
|
5219
|
+
phaseIsCurrent: z.boolean().nullable().optional(),
|
|
5220
|
+
lastConfidence: TaskConfidenceSchema.nullable().optional(),
|
|
5221
|
+
lastConfidenceUnread: z.boolean().optional(),
|
|
5222
|
+
phaseHistory: TaskPhaseHistorySchema.nullable().optional()
|
|
5189
5223
|
}).merge(ObservedSchema);
|
|
5190
5224
|
var TaskStatusResultSchema = z.object({
|
|
5191
5225
|
items: z.array(TaskStatusItemSchema),
|
|
@@ -5197,7 +5231,7 @@ var EscalationInputsSchema = z.object({
|
|
|
5197
5231
|
round: z.number().int().nonnegative(),
|
|
5198
5232
|
head: z.string(),
|
|
5199
5233
|
branch: z.string(),
|
|
5200
|
-
prNumber: z.number().int().positive()
|
|
5234
|
+
prNumber: z.number().int().positive().nullable()
|
|
5201
5235
|
});
|
|
5202
5236
|
var EscalationEvidenceSchema = z.object({
|
|
5203
5237
|
round: z.number().int().nonnegative(),
|
|
@@ -5233,13 +5267,45 @@ var TaskEscalationReadResultSchema = z.object({
|
|
|
5233
5267
|
items: z.array(TaskEscalationPacketSchema),
|
|
5234
5268
|
nextCursor: z.string().nullable()
|
|
5235
5269
|
}).merge(ObservedSchema);
|
|
5236
|
-
var
|
|
5237
|
-
|
|
5238
|
-
|
|
5270
|
+
var TaskPrCheckSchema = z.object({
|
|
5271
|
+
name: z.string(),
|
|
5272
|
+
required: z.boolean(),
|
|
5273
|
+
status: z.string(),
|
|
5274
|
+
conclusion: z.string().nullable(),
|
|
5275
|
+
detailsUrl: z.string().nullable(),
|
|
5276
|
+
failureSummary: z.string().nullable()
|
|
5277
|
+
});
|
|
5278
|
+
var TaskPrVerdictSchema = z.object({
|
|
5279
|
+
role: z.enum(["code-review", "security"]),
|
|
5280
|
+
value: z.string(),
|
|
5281
|
+
judgedHead: z.string().nullable(),
|
|
5282
|
+
objectivesVersion: z.string().nullable()
|
|
5283
|
+
});
|
|
5284
|
+
var TaskPrPauseSchema = z.object({
|
|
5285
|
+
reason: z.string(),
|
|
5286
|
+
body: z.string()
|
|
5287
|
+
});
|
|
5288
|
+
var TaskPrReviewRecordSchema = z.object({
|
|
5289
|
+
verdicts: z.array(TaskPrVerdictSchema),
|
|
5290
|
+
roundMarkers: z.array(z.number().int().nonnegative()),
|
|
5291
|
+
summaryTable: z.string().nullable(),
|
|
5292
|
+
pause: TaskPrPauseSchema.nullable()
|
|
5293
|
+
});
|
|
5294
|
+
var TaskPrReadInputSchema = z.object({
|
|
5295
|
+
task: TaskToolRefSchema,
|
|
5296
|
+
pr: z.number().int().positive().optional()
|
|
5239
5297
|
}).strict();
|
|
5298
|
+
var TaskPrReadResultSchema = z.object({
|
|
5299
|
+
task: TaskToolRefSchema,
|
|
5300
|
+
issue: z.number().int().positive(),
|
|
5301
|
+
pr: z.number().int().positive(),
|
|
5302
|
+
head: z.string().nullable(),
|
|
5303
|
+
checks: z.array(TaskPrCheckSchema),
|
|
5304
|
+
review: TaskPrReviewRecordSchema
|
|
5305
|
+
}).merge(ObservedSchema);
|
|
5240
5306
|
var TaskStartResultSchema = z.object({
|
|
5241
5307
|
requestId: z.string().min(1),
|
|
5242
|
-
run:
|
|
5308
|
+
run: TaskToolRefSchema,
|
|
5243
5309
|
started: z.boolean(),
|
|
5244
5310
|
startedAt: z.string(),
|
|
5245
5311
|
mode: z.literal("attended")
|
|
@@ -5253,7 +5319,7 @@ var TaskCancelInputSchema = z.object({
|
|
|
5253
5319
|
}).strict();
|
|
5254
5320
|
var TaskResumeResultSchema = z.object({
|
|
5255
5321
|
task: z.number().int().positive(),
|
|
5256
|
-
pr: z.number().int().positive(),
|
|
5322
|
+
pr: z.number().int().positive().nullable(),
|
|
5257
5323
|
escalationId: z.string().min(1),
|
|
5258
5324
|
outcome: z.enum(["started", "already_resumed"]),
|
|
5259
5325
|
authenticatedBy: z.string().min(1),
|
|
@@ -5262,7 +5328,7 @@ var TaskResumeResultSchema = z.object({
|
|
|
5262
5328
|
var TaskCancelOutcomeSchema = z.enum(["confirmed", "pending", "uncertain"]);
|
|
5263
5329
|
var TaskCancelResultSchema = z.object({
|
|
5264
5330
|
task: z.number().int().positive(),
|
|
5265
|
-
pr: z.number().int().positive(),
|
|
5331
|
+
pr: z.number().int().positive().nullable(),
|
|
5266
5332
|
escalationId: z.string().min(1),
|
|
5267
5333
|
outcome: TaskCancelOutcomeSchema,
|
|
5268
5334
|
authenticatedBy: z.string().min(1),
|
|
@@ -5273,6 +5339,7 @@ var TASK_TOOL_NAMES = [
|
|
|
5273
5339
|
"task_start",
|
|
5274
5340
|
"task_status",
|
|
5275
5341
|
"task_escalation_read",
|
|
5342
|
+
"task_pr_read",
|
|
5276
5343
|
"task_resume",
|
|
5277
5344
|
"task_cancel"
|
|
5278
5345
|
];
|
|
@@ -5500,6 +5567,10 @@ function findWorkspaceEscapes(files, knownPaths, workspaceDirs = DEFAULT_WORKSPA
|
|
|
5500
5567
|
}
|
|
5501
5568
|
return findings;
|
|
5502
5569
|
}
|
|
5570
|
+
// ../../packages/aeg-core/src/dev-review-loop/types.ts
|
|
5571
|
+
var SEVERITY_COLUMNS = ["blocker", "major", "minor", "critical", "high", "medium", "low"];
|
|
5572
|
+
// ../../packages/aeg-core/src/dev-review-loop/journal-reconstruction.ts
|
|
5573
|
+
var SUMMARY_TABLE_HEADER = `| round | ${SEVERITY_COLUMNS.join(" | ")} | confidence | outcome |`;
|
|
5503
5574
|
// ../../packages/aeg-core/src/log/envelope.ts
|
|
5504
5575
|
import { createHash as createHash5 } from "node:crypto";
|
|
5505
5576
|
|
|
@@ -6038,6 +6109,7 @@ function redact(value, home) {
|
|
|
6038
6109
|
return value;
|
|
6039
6110
|
}
|
|
6040
6111
|
// ../../packages/aeg-core/src/log/store.ts
|
|
6112
|
+
var KNOWN_SCHEMA_VERSIONS = [1, 2];
|
|
6041
6113
|
function metaOf(obj) {
|
|
6042
6114
|
if (obj === null || typeof obj !== "object")
|
|
6043
6115
|
return null;
|
|
@@ -6060,11 +6132,61 @@ function recordIdentity(obj) {
|
|
|
6060
6132
|
}
|
|
6061
6133
|
return null;
|
|
6062
6134
|
}
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
|
|
6066
|
-
|
|
6067
|
-
|
|
6135
|
+
function schemaVersionOf(obj) {
|
|
6136
|
+
const meta = metaOf(obj);
|
|
6137
|
+
const schema = meta?.schema;
|
|
6138
|
+
return typeof schema === "number" ? schema : null;
|
|
6139
|
+
}
|
|
6140
|
+
function isKnownSchema(version) {
|
|
6141
|
+
return version !== null && KNOWN_SCHEMA_VERSIONS.includes(version);
|
|
6142
|
+
}
|
|
6143
|
+
function classifyStoredLine(raw, home) {
|
|
6144
|
+
let obj;
|
|
6145
|
+
try {
|
|
6146
|
+
obj = JSON.parse(raw);
|
|
6147
|
+
} catch {
|
|
6148
|
+
return { status: "invalid", identity: null, raw, reason: "not valid JSON" };
|
|
6149
|
+
}
|
|
6150
|
+
const version = schemaVersionOf(obj);
|
|
6151
|
+
if (version === null) {
|
|
6152
|
+
return { status: "invalid", identity: recordIdentity(obj), raw, reason: "no readable meta.schema" };
|
|
6153
|
+
}
|
|
6154
|
+
if (!isKnownSchema(version)) {
|
|
6155
|
+
return {
|
|
6156
|
+
status: "unknown_version",
|
|
6157
|
+
identity: recordIdentity(obj),
|
|
6158
|
+
schema: version,
|
|
6159
|
+
raw,
|
|
6160
|
+
reason: `schema version ${version} is not one this build validates (${KNOWN_SCHEMA_VERSIONS.join(", ")}) — kept for diagnosis`
|
|
6161
|
+
};
|
|
6162
|
+
}
|
|
6163
|
+
const result = LogEventSchema.safeParse(obj);
|
|
6164
|
+
if (!result.success) {
|
|
6165
|
+
return {
|
|
6166
|
+
status: "invalid",
|
|
6167
|
+
identity: recordIdentity(obj),
|
|
6168
|
+
raw,
|
|
6169
|
+
reason: result.error.issues[0]?.message ?? "schema violation"
|
|
6170
|
+
};
|
|
6171
|
+
}
|
|
6172
|
+
const event = result.data;
|
|
6173
|
+
const identity = recordIdentity(event);
|
|
6174
|
+
if (identity === null) {
|
|
6175
|
+
return { status: "invalid", identity: null, raw, reason: "valid event with no derivable identity" };
|
|
6176
|
+
}
|
|
6177
|
+
const redacted = redact(event, home);
|
|
6178
|
+
const provenance = version === 2 ? event.meta.provenance ?? null : null;
|
|
6179
|
+
return {
|
|
6180
|
+
status: "ok",
|
|
6181
|
+
identity,
|
|
6182
|
+
runId: event.meta.run_id,
|
|
6183
|
+
seq: event.meta.seq,
|
|
6184
|
+
schema: version,
|
|
6185
|
+
provenance,
|
|
6186
|
+
event,
|
|
6187
|
+
postLine: JSON.stringify(redacted)
|
|
6188
|
+
};
|
|
6189
|
+
}
|
|
6068
6190
|
// ../../packages/aeg-core/src/control-store/records.ts
|
|
6069
6191
|
import { z as z3 } from "zod";
|
|
6070
6192
|
var isoTimestamp = z3.string().min(1);
|
|
@@ -6205,7 +6327,8 @@ function emitCheckError(error) {
|
|
|
6205
6327
|
import { dirname as dirname2, isAbsolute as isAbsolute2, join as join2, resolve as resolve2, sep } from "node:path";
|
|
6206
6328
|
|
|
6207
6329
|
// src/lib/config.ts
|
|
6208
|
-
import { execFileSync as execFileSync2 } from "node:child_process";
|
|
6330
|
+
import { execFile as execFile4, execFileSync as execFileSync2 } from "node:child_process";
|
|
6331
|
+
import { promisify as promisify4 } from "node:util";
|
|
6209
6332
|
import { existsSync, mkdirSync, readFileSync as readFileSync2, realpathSync, writeFileSync } from "node:fs";
|
|
6210
6333
|
import { homedir } from "node:os";
|
|
6211
6334
|
import { dirname, isAbsolute, join, resolve } from "node:path";
|
|
@@ -6232,10 +6355,10 @@ var CheckEntrySchema = z4.object({
|
|
|
6232
6355
|
ownWorkflow: z4.boolean().optional(),
|
|
6233
6356
|
principalOwed: z4.literal(true).optional(),
|
|
6234
6357
|
validates: z4.enum(["body", "issue"]).optional()
|
|
6235
|
-
}).superRefine((
|
|
6236
|
-
if (!
|
|
6358
|
+
}).superRefine((entry, ctx) => {
|
|
6359
|
+
if (!entry.env)
|
|
6237
6360
|
return;
|
|
6238
|
-
for (const [key, value] of Object.entries(
|
|
6361
|
+
for (const [key, value] of Object.entries(entry.env)) {
|
|
6239
6362
|
if (typeof value !== "object" || value === null || !("anyOf" in value))
|
|
6240
6363
|
continue;
|
|
6241
6364
|
const members = value.anyOf;
|
|
@@ -6392,18 +6515,19 @@ var VinayaConfigSchema = z4.object({
|
|
|
6392
6515
|
});
|
|
6393
6516
|
}
|
|
6394
6517
|
}).optional(),
|
|
6395
|
-
logPublish: z4.
|
|
6396
|
-
|
|
6397
|
-
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
|
-
|
|
6401
|
-
|
|
6402
|
-
|
|
6403
|
-
}).refine((v) => v.
|
|
6404
|
-
message: "
|
|
6405
|
-
}).
|
|
6406
|
-
|
|
6518
|
+
logPublish: z4.unknown().refine((v) => v === undefined, {
|
|
6519
|
+
message: "logPublish is removed — telemetry is never posted to a tracker or a code host; configure `logs` instead (a folder or a server destination)"
|
|
6520
|
+
}),
|
|
6521
|
+
runtimeDir: z4.string().min(1).refine((v) => isAbsolute(v), { message: "runtimeDir: must be an absolute path" }).optional(),
|
|
6522
|
+
logs: z4.object({
|
|
6523
|
+
folder: z4.string().min(1).refine((v) => isAbsolute(v), { message: "logs.folder: must be an absolute path" }).optional(),
|
|
6524
|
+
url: z4.string().url().optional(),
|
|
6525
|
+
headers: z4.record(z4.string()).optional()
|
|
6526
|
+
}).refine((v) => [v.folder, v.url].filter((x) => x !== undefined).length <= 1, {
|
|
6527
|
+
message: "logs: set at most one of folder/url"
|
|
6528
|
+
}).refine((v) => v.headers === undefined || v.url !== undefined, {
|
|
6529
|
+
message: "logs: headers requires url"
|
|
6530
|
+
}).optional()
|
|
6407
6531
|
});
|
|
6408
6532
|
var GLOBAL_VINAYA_HOME = join(homedir(), ".vinaya");
|
|
6409
6533
|
var GLOBAL_CONFIG_PATH = join(GLOBAL_VINAYA_HOME, "config.json");
|
|
@@ -6448,32 +6572,39 @@ function globalTokensCollectIgnoredWarning(path) {
|
|
|
6448
6572
|
function globalRuntimeDirIgnoredWarning(path) {
|
|
6449
6573
|
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.`;
|
|
6450
6574
|
}
|
|
6575
|
+
var emittedGlobalKeyWarnings = new Set;
|
|
6576
|
+
function warnGlobalKeyIgnoredOnce(message) {
|
|
6577
|
+
if (emittedGlobalKeyWarnings.has(message))
|
|
6578
|
+
return;
|
|
6579
|
+
emittedGlobalKeyWarnings.add(message);
|
|
6580
|
+
console.error(`⚠ ${message}`);
|
|
6581
|
+
}
|
|
6451
6582
|
function stripGlobalOnlyKeys(config, path) {
|
|
6452
6583
|
if (path !== GLOBAL_CONFIG_PATH)
|
|
6453
6584
|
return config;
|
|
6454
6585
|
let result = config;
|
|
6455
6586
|
if (result.checks && Object.keys(result.checks).length > 0) {
|
|
6456
|
-
|
|
6587
|
+
warnGlobalKeyIgnoredOnce(globalChecksIgnoredWarning(path));
|
|
6457
6588
|
result = { ...result, checks: undefined };
|
|
6458
6589
|
}
|
|
6459
6590
|
if (result.roles && Object.keys(result.roles).length > 0) {
|
|
6460
|
-
|
|
6591
|
+
warnGlobalKeyIgnoredOnce(globalRolesIgnoredWarning(path));
|
|
6461
6592
|
result = { ...result, roles: undefined };
|
|
6462
6593
|
}
|
|
6463
6594
|
if (result.principals && result.principals.length > 0) {
|
|
6464
|
-
|
|
6595
|
+
warnGlobalKeyIgnoredOnce(globalPrincipalsIgnoredWarning(path));
|
|
6465
6596
|
result = { ...result, principals: undefined };
|
|
6466
6597
|
}
|
|
6467
6598
|
if (result.releaseActor) {
|
|
6468
|
-
|
|
6599
|
+
warnGlobalKeyIgnoredOnce(globalReleaseActorIgnoredWarning(path));
|
|
6469
6600
|
result = { ...result, releaseActor: undefined };
|
|
6470
6601
|
}
|
|
6471
6602
|
if (result.tokens) {
|
|
6472
|
-
|
|
6603
|
+
warnGlobalKeyIgnoredOnce(globalTokensCollectIgnoredWarning(path));
|
|
6473
6604
|
result = { ...result, tokens: undefined };
|
|
6474
6605
|
}
|
|
6475
6606
|
if (result.runtimeDir) {
|
|
6476
|
-
|
|
6607
|
+
warnGlobalKeyIgnoredOnce(globalRuntimeDirIgnoredWarning(path));
|
|
6477
6608
|
result = { ...result, runtimeDir: undefined };
|
|
6478
6609
|
}
|
|
6479
6610
|
return result;
|
|
@@ -6506,26 +6637,102 @@ function resolveReviewPolicy(config) {
|
|
|
6506
6637
|
maxRounds
|
|
6507
6638
|
};
|
|
6508
6639
|
}
|
|
6509
|
-
function
|
|
6510
|
-
|
|
6511
|
-
|
|
6512
|
-
|
|
6513
|
-
|
|
6514
|
-
|
|
6515
|
-
|
|
6640
|
+
function resolveRuntimeDirSetting(config) {
|
|
6641
|
+
return config?.runtimeDir ?? null;
|
|
6642
|
+
}
|
|
6643
|
+
function resolveTrustAnchorRuntimeDir(localRuntimeDir, trustAnchorConfig) {
|
|
6644
|
+
const anchored = resolveRuntimeDirSetting(trustAnchorConfig);
|
|
6645
|
+
return anchored !== null && anchored === localRuntimeDir ? anchored : null;
|
|
6646
|
+
}
|
|
6647
|
+
function resolveLogsSetting(config) {
|
|
6648
|
+
const raw = config?.logs;
|
|
6649
|
+
if (!raw)
|
|
6650
|
+
return null;
|
|
6651
|
+
if (raw.url !== undefined)
|
|
6652
|
+
return { url: raw.url, headers: raw.headers };
|
|
6653
|
+
if (raw.folder !== undefined)
|
|
6654
|
+
return { folder: raw.folder };
|
|
6655
|
+
return null;
|
|
6656
|
+
}
|
|
6657
|
+
function resolveTrustAnchorLogsDestination(local, trustAnchorConfig) {
|
|
6658
|
+
const anchored = resolveLogsSetting(trustAnchorConfig);
|
|
6659
|
+
if (!anchored)
|
|
6660
|
+
return null;
|
|
6661
|
+
if ("url" in local)
|
|
6662
|
+
return "url" in anchored && anchored.url === local.url ? anchored : null;
|
|
6663
|
+
return "folder" in anchored && anchored.folder === local.folder ? anchored : null;
|
|
6664
|
+
}
|
|
6665
|
+
function resolveLogsHeaderValues(headers, env) {
|
|
6666
|
+
if (!headers)
|
|
6667
|
+
return;
|
|
6668
|
+
const resolved = {};
|
|
6669
|
+
for (const [key, value] of Object.entries(headers)) {
|
|
6670
|
+
resolved[key] = value.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g, (_match, name) => env[name] ?? "");
|
|
6516
6671
|
}
|
|
6672
|
+
return resolved;
|
|
6673
|
+
}
|
|
6674
|
+
function trustAnchorRepo() {
|
|
6675
|
+
const fromRunner = trustAnchorRepoFromRunner();
|
|
6676
|
+
if (fromRunner)
|
|
6677
|
+
return fromRunner;
|
|
6517
6678
|
try {
|
|
6518
6679
|
const url = execFileSync2("git", ["remote", "get-url", "origin"], {
|
|
6519
6680
|
encoding: "utf-8",
|
|
6520
6681
|
stdio: ["ignore", "pipe", "pipe"]
|
|
6521
|
-
})
|
|
6522
|
-
|
|
6523
|
-
return m?.[1] && m[2] ? wellFormed(`${m[1]}/${m[2]}`) : null;
|
|
6682
|
+
});
|
|
6683
|
+
return trustAnchorRepoFromRemoteUrl(url);
|
|
6524
6684
|
} catch {
|
|
6525
6685
|
return null;
|
|
6526
6686
|
}
|
|
6527
6687
|
}
|
|
6688
|
+
async function trustAnchorRepoAsync() {
|
|
6689
|
+
const fromRunner = trustAnchorRepoFromRunner();
|
|
6690
|
+
if (fromRunner)
|
|
6691
|
+
return fromRunner;
|
|
6692
|
+
try {
|
|
6693
|
+
const { stdout } = await execFileAsync4("git", ["remote", "get-url", "origin"], {
|
|
6694
|
+
encoding: "utf-8",
|
|
6695
|
+
timeout: 1e4
|
|
6696
|
+
});
|
|
6697
|
+
return trustAnchorRepoFromRemoteUrl(stdout);
|
|
6698
|
+
} catch {
|
|
6699
|
+
return null;
|
|
6700
|
+
}
|
|
6701
|
+
}
|
|
6702
|
+
function wellFormedRepoSlug(slug) {
|
|
6703
|
+
return /^[^/\s]+\/[^/\s]+$/.test(slug) ? slug : null;
|
|
6704
|
+
}
|
|
6705
|
+
function trustAnchorRepoFromRunner() {
|
|
6706
|
+
const fromRunner = process.env.GITHUB_REPOSITORY?.trim();
|
|
6707
|
+
return fromRunner ? wellFormedRepoSlug(fromRunner) : null;
|
|
6708
|
+
}
|
|
6709
|
+
function trustAnchorRepoFromRemoteUrl(url) {
|
|
6710
|
+
const m = url.trim().match(/github\.com[:/]([^/]+)\/(.+?)(?:\.git)?\/?$/);
|
|
6711
|
+
return m?.[1] && m[2] ? wellFormedRepoSlug(`${m[1]}/${m[2]}`) : null;
|
|
6712
|
+
}
|
|
6713
|
+
var execFileAsync4 = promisify4(execFile4);
|
|
6714
|
+
function resolveCiTrustAnchorProbeRef(env = process.env) {
|
|
6715
|
+
const ref = env.VINAYA_CI_CONFIG_PROBE_REF?.trim();
|
|
6716
|
+
if (!ref)
|
|
6717
|
+
return null;
|
|
6718
|
+
if (env.GITHUB_ACTIONS !== "true")
|
|
6719
|
+
return null;
|
|
6720
|
+
if ((env.GH_TOKEN ?? "").length > 0 || (env.GITHUB_TOKEN ?? "").length > 0)
|
|
6721
|
+
return null;
|
|
6722
|
+
return ref;
|
|
6723
|
+
}
|
|
6724
|
+
function readTrustAnchorConfigAtRef(ref) {
|
|
6725
|
+
const raw = execFileSync2("git", ["show", `${ref}:${LOCAL_CONFIG_FILENAME}`], {
|
|
6726
|
+
encoding: "utf-8",
|
|
6727
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
6728
|
+
timeout: 1e4
|
|
6729
|
+
});
|
|
6730
|
+
return Buffer.from(raw, "utf-8").toString("base64");
|
|
6731
|
+
}
|
|
6528
6732
|
function ghFetchTrustAnchorConfig() {
|
|
6733
|
+
const probeRef = resolveCiTrustAnchorProbeRef();
|
|
6734
|
+
if (probeRef)
|
|
6735
|
+
return readTrustAnchorConfigAtRef(probeRef);
|
|
6529
6736
|
const repo = trustAnchorRepo();
|
|
6530
6737
|
if (!repo)
|
|
6531
6738
|
throw new Error("could not resolve repo identity for the trust-anchor read");
|
|
@@ -6534,6 +6741,21 @@ function ghFetchTrustAnchorConfig() {
|
|
|
6534
6741
|
stdio: ["ignore", "pipe", "pipe"]
|
|
6535
6742
|
});
|
|
6536
6743
|
}
|
|
6744
|
+
async function ghFetchTrustAnchorConfigAsync() {
|
|
6745
|
+
const probeRef = resolveCiTrustAnchorProbeRef();
|
|
6746
|
+
if (probeRef) {
|
|
6747
|
+
const { stdout } = await execFileAsync4("git", ["show", `${probeRef}:${LOCAL_CONFIG_FILENAME}`], {
|
|
6748
|
+
encoding: "utf-8",
|
|
6749
|
+
timeout: 1e4
|
|
6750
|
+
});
|
|
6751
|
+
return Buffer.from(stdout, "utf-8").toString("base64");
|
|
6752
|
+
}
|
|
6753
|
+
const repo = await trustAnchorRepoAsync();
|
|
6754
|
+
if (!repo)
|
|
6755
|
+
throw new Error("could not resolve repo identity for the trust-anchor read");
|
|
6756
|
+
const { stdout } = await execFileAsync4("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], { encoding: "utf-8", timeout: 1e4 });
|
|
6757
|
+
return stdout;
|
|
6758
|
+
}
|
|
6537
6759
|
function firstLine(err) {
|
|
6538
6760
|
return err?.message?.split(`
|
|
6539
6761
|
`)[0] ?? "unknown error";
|
|
@@ -6548,16 +6770,35 @@ function isMissingFileError(err) {
|
|
|
6548
6770
|
return /\b404\b|not found/i.test(haystack);
|
|
6549
6771
|
}
|
|
6550
6772
|
function loadTrustAnchorConfig(fetcher = ghFetchTrustAnchorConfig) {
|
|
6551
|
-
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.
|
|
6552
|
-
`);
|
|
6553
6773
|
let base64;
|
|
6554
6774
|
try {
|
|
6555
|
-
base64 = fetcher()
|
|
6775
|
+
base64 = fetcher();
|
|
6556
6776
|
} catch (err) {
|
|
6557
|
-
|
|
6558
|
-
|
|
6559
|
-
|
|
6777
|
+
return trustAnchorFetchFailed(err);
|
|
6778
|
+
}
|
|
6779
|
+
return parseTrustAnchorContent(base64);
|
|
6780
|
+
}
|
|
6781
|
+
async function loadTrustAnchorConfigAsync(fetcher = ghFetchTrustAnchorConfigAsync, options = {}) {
|
|
6782
|
+
const warn = options.quiet ? () => {} : warnTrustAnchorFallback;
|
|
6783
|
+
let base64;
|
|
6784
|
+
try {
|
|
6785
|
+
base64 = await fetcher();
|
|
6786
|
+
} catch (err) {
|
|
6787
|
+
return trustAnchorFetchFailed(err, warn);
|
|
6560
6788
|
}
|
|
6789
|
+
return parseTrustAnchorContent(base64, warn);
|
|
6790
|
+
}
|
|
6791
|
+
function warnTrustAnchorFallback(why) {
|
|
6792
|
+
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.
|
|
6793
|
+
`);
|
|
6794
|
+
}
|
|
6795
|
+
function trustAnchorFetchFailed(err, warn = warnTrustAnchorFallback) {
|
|
6796
|
+
if (!isMissingFileError(err))
|
|
6797
|
+
warn(firstLine(err));
|
|
6798
|
+
return null;
|
|
6799
|
+
}
|
|
6800
|
+
function parseTrustAnchorContent(content, warn = warnTrustAnchorFallback) {
|
|
6801
|
+
const base64 = content.trim();
|
|
6561
6802
|
if (!base64)
|
|
6562
6803
|
return null;
|
|
6563
6804
|
try {
|