@attalabs/vinaya 0.36.0 → 0.38.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 +6 -6
- package/aeg-root/contracts/developer-reviewer.md +1 -1
- package/aeg-root/contracts/planner-operator.md +1 -1
- package/aeg-root/contracts/principal-operator.md +6 -6
- package/aeg-root/contracts/security-archivist.md +1 -1
- package/aeg-root/enforcement.md +14 -14
- package/aeg-root/process.md +3 -1
- package/aeg-root/roles/archivist.md +2 -2
- package/aeg-root/roles/developer/reference.md +36 -37
- package/aeg-root/roles/developer.md +9 -5
- package/aeg-root/roles/operator.md +18 -18
- package/aeg-root/roles/planner/reference.md +15 -4
- package/aeg-root/roles/principal.md +6 -1
- package/aeg-root/roles/reviewer.md +14 -6
- package/aeg-root/roles/security.md +22 -11
- package/aeg-root/roles/tranche-archivist.md +14 -2
- package/aeg-root/state-machine.md +12 -11
- package/aeg-root/templates/brief-template.md +8 -6
- package/aeg-root/templates/pr-report-template.md +1 -9
- package/aeg-root/tranche-model.md +10 -4
- package/dist/checks/bin/check-body-bare-digits.js +823 -595
- package/dist/checks/bin/check-branch-topology.js +796 -478
- package/dist/checks/bin/check-brief-shape.js +824 -596
- package/dist/checks/bin/check-changeset-coverage.js +1337 -747
- package/dist/checks/bin/check-closes-n.js +796 -478
- package/dist/checks/bin/check-coherence.js +914 -611
- package/dist/checks/bin/check-dead-branch-push.js +705 -462
- package/dist/checks/bin/check-dispatch-readiness.js +941 -624
- package/dist/checks/bin/check-doc-coverage-push.js +1332 -742
- package/dist/checks/bin/check-doc-coverage.js +1339 -742
- package/dist/checks/bin/check-doctrine-no-procedures.js +821 -593
- package/dist/checks/bin/check-doctrine-portability.js +1332 -742
- package/dist/checks/bin/check-evidence-fresh.js +1339 -918
- package/dist/checks/bin/check-exec-bits.js +1331 -741
- package/dist/checks/bin/check-first-push-dispatch.js +917 -614
- package/dist/checks/bin/check-issue-assignment.js +796 -478
- package/dist/checks/bin/check-issue-milestone-attach.js +705 -462
- package/dist/checks/bin/check-issue-objectives-numbering.js +821 -593
- package/dist/checks/bin/check-issue-parts-coverage.js +705 -462
- package/dist/checks/bin/check-issue-surface-globs.js +925 -613
- package/dist/checks/bin/check-issue-title-grammar.js +705 -462
- package/dist/checks/bin/check-issue-tranche-label.js +705 -462
- package/dist/checks/bin/check-main-branch-refusal.js +705 -462
- package/dist/checks/bin/check-no-disk-state.js +705 -462
- package/dist/checks/bin/check-pr-premise-reassert.js +821 -593
- package/dist/checks/bin/check-pr-report-density.js +705 -462
- package/dist/checks/bin/check-principal-test-plan-wait.js +705 -462
- package/dist/checks/bin/check-quoted-command.js +1816 -1228
- package/dist/checks/bin/check-reader-resolvable-prose.js +1835 -1235
- package/dist/checks/bin/check-registry-gates.js +993 -526
- package/dist/checks/bin/check-retired-vocabulary.js +1810 -1222
- package/dist/checks/bin/check-review-gate.js +832 -604
- package/dist/checks/bin/check-single-plan-pr.js +705 -462
- package/dist/checks/bin/check-surface-scope.js +796 -478
- package/dist/checks/bin/check-test-plan.js +705 -462
- package/dist/checks/bin/check-token-collection-wired.js +705 -462
- package/dist/checks/bin/check-workspace-escape.js +1332 -742
- package/dist/checks/bin/verify-dispatch.js +3849 -0
- package/dist/index.js +20876 -10091
- package/dist/lib/pre-push-cache-test-run.js +1045 -682
- package/dist/lib/pre-push-changed-files.js +16 -11
- package/dist/lib/pre-push-select-tests.js +785 -500
- package/package.json +2 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/anchored-region.ts +7 -6
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-render.ts +71 -15
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-validation.ts +51 -12
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/index.ts +1 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/local.ts +31 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/records.ts +50 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/assess-round.ts +443 -28
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/fakes.ts +18 -5
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/index.ts +6 -4
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/journal-reconstruction.ts +13 -13
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/render-summary.ts +46 -110
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/types.ts +169 -11
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/doc-claim.ts +32 -6
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/index.ts +3 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/published-prose.ts +30 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/doctrine-portability.ts +6 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/gate-audience.ts +0 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/index.ts +82 -8
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/issue-validation.ts +754 -7
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/leftover-detection.ts +24 -6
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/custom.ts +157 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/envelope.ts +44 -6
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/fixtures/executions.ts +493 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/fixtures/fact-sheets.ts +111 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/fixtures/generator.ts +155 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/fixtures/index.ts +12 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/index.ts +128 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/catches.ts +63 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/checks.ts +146 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/common.ts +137 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/completion.ts +137 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/convergence.ts +420 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/determinism.ts +65 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/index.ts +69 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/judgment.ts +132 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/labels.ts +21 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/time.ts +167 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/usage.ts +139 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/schema.ts +226 -15
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/store.ts +7 -7
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/cache-contract.ts +207 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/contracts.ts +105 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/engine.ts +308 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/index.ts +34 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/measured.ts +20 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/memory-cache.ts +78 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/normalize.ts +156 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/row.ts +103 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/reader-resolvable-prose.ts +34 -6
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/registry-checks.ts +70 -6
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-gate.ts +52 -4
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-input-manifest.ts +19 -14
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-policy.ts +201 -24
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-status.ts +5 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/task-phase-history.ts +46 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/task-tools.ts +15 -28
- package/studio-standalone/apps/vinaya-studio/web/.next/BUILD_ID +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/app-path-routes-manifest.json +0 -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/required-server-files.json +0 -5
- package/studio-standalone/apps/vinaya-studio/web/.next/routes-manifest.json +0 -6
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error/page.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- 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 +1 -1
- 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/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page.js +1 -1
- 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 +3 -3
- 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 +3 -3
- 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 +3 -3
- 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 +5 -5
- 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 +3 -3
- 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 +3 -3
- 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 +3 -3
- 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/app-paths-manifest.json +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/044u_vinaya-studio_web_src_app_studio_backlog__components_BacklogTable_tsx_0oha0bt._.js +3 -0
- 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]__1bh2awk._.js → [root-of-the-server]__038scsm._.js} +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__1widio3._.js → [root-of-the-server]__03__s45._.js} +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{_15gdg48._.js → [root-of-the-server]__04adkz-._.js} +3 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__05zwn98._.js +14 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__08e39jo._.js +3 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0h9yhwx._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__1wy7w66._.js → [root-of-the-server]__0jdjsxe._.js} +2 -2
- 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]__10riywf._.js +3 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__13znegp._.js → [root-of-the-server]__134x-65._.js} +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__13eeix2._.js → [root-of-the-server]__1_l_l1u._.js} +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1f4bb3_._.js +3 -0
- 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]__1dky4g0._.js → [root-of-the-server]__1my83lt._.js} +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1ng2x88._.js +3 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__040smoa._.js → [root-of-the-server]__1qpc6at._.js} +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1snpgaw._.js +56 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1wc4-ip._.js +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_06h3wbl._.js +3 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_08onyya._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_096f46i._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0af2one._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0e5tkdd._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0gs4gvl._.js +3 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0kf2g72._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0zf4d27._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1-wo68i._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_121lrn5._.js +3 -0
- 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/_1o4v6lb._.js +3 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1q7h5mz._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1ztd4i3._.js +3 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_209-ugd._.js +3 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_214d71c._.js +3 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/apps_vinaya-studio_web_src_app_studio_projects_[name]_tranches_[slug]_17dho0f._.js +3 -0
- 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/chunks/ssr/node_modules_next_dist_1lzmr5o._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/packages_ui_libraries_animate_components_index_ts_186fje1._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/packages_ui_libraries_basic_components_index_ts_0xk1vda._.js +1 -1
- 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/09fcolor69bun.js +1 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0lcwmwzxacdie.js +1 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0ojry7lrbzkfd.css +1 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1-acpmtfmrc35.js +1 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1giu47hrbhroj.js +1 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1shz6lwruld25.js +1 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1ytvuy1mmnc6j.js +1 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{3oxhhhm_psozq.js → 21a6_5cr956wj.js} +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{2o9l0b7eqbr57.js → 2f2y8xxok8zph.js} +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2g8mwnydod96u.js +1 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{3li0ueedy-ozv.js → 2nrnuawd5fwpv.js} +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2nw47832_uvfe.js +1 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2qdxnj8wk2h0s.js +1 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{3lqjwjrcvq481.js → 2xevgia1h8g0y.js} +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3b9q75p-z5ma5.js +1 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3cv-oe7153242.js +1 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3m310lbjj4p5u.js +1 -0
- package/studio-standalone/apps/vinaya-studio/web/package.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/server.js +1 -1
- package/dist/checks/bin/check-token-report.js +0 -6526
- package/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/aeg-core/bin/verify-coherence.ts +0 -1089
- package/studio-standalone/_node_modules/next/dist/compiled/next-server/app-route-turbo.runtime.prod.js +0 -6
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route/app-paths-manifest.json +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route/build-manifest.json +0 -9
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route/server-reference-manifest.json +0 -4
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route.js +0 -6
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route.js.map +0 -5
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route.js.nft.json +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route_client-reference-manifest.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/044u_vinaya-studio_web__next-internal_server_app_api_coherence_route_actions_1rnzea1.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/[externals]__0cki-x_._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/[root-of-the-server]__02a-3g8._.js +0 -15
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/[turbopack]_runtime.js +0 -903
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__074w9nf._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0ln09ua._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0oegopp._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__13yxbjd._.js +0 -51
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1duqmtm._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1z7dml9._.js +0 -9
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0bfs_u4._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0g8_eot._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0hrh_v-._.js +0 -181
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0i4-dea._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0o54suy._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0rxd7s0._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0y1jv16._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_151m4rz._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1a9dieq._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1sxsf5q._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1sy_yfr._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_219v2an._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/apps_vinaya-studio_web_src_app_studio_projects_[name]_tranches_[slug]_05ufo8i._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/packages_ui_libraries_basic_components_form_input_tsx_0es8d8b._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/packages_ui_libraries_brutal_components_index_ts_0n_lcc4._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/packages_ui_libraries_retro_components_index_ts_0wvpm_z._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/00z3-ljjd1gj9.js +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0bjnj-5fy4e7l.js +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0c8uwz_-m8s99.js +0 -165
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0ct0c-xj0baf6.js +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0ko698wh8xx2g.css +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0t5n_r4xm__t-.js +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0vc2u252q5q6o.js +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/16r_o07lw0vm0.js +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1cah7_e5a1zvu.js +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1gjo9-6dz7nup.js +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/24tz8aro1uto4.js +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2ef2g5fozszw7.js +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2ka8dg687auhj.js +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2pf3f50gbrkyv.js +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2qq49pct3q51-.js +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3et66z7glk65w.js +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3y6u3prmrkea-.js +0 -1
- /package/studio-standalone/apps/vinaya-studio/web/.next/static/{z1fTSBP6ZlUjObzFIp-qq → yNZEFRSjP9BLUfdf96Eol}/_buildManifest.js +0 -0
- /package/studio-standalone/apps/vinaya-studio/web/.next/static/{z1fTSBP6ZlUjObzFIp-qq → yNZEFRSjP9BLUfdf96Eol}/_clientMiddlewareManifest.js +0 -0
- /package/studio-standalone/apps/vinaya-studio/web/.next/static/{z1fTSBP6ZlUjObzFIp-qq → yNZEFRSjP9BLUfdf96Eol}/_ssgManifest.js +0 -0
|
@@ -121,12 +121,12 @@ function parseHunkRanges(patch) {
|
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
// src/lib/config.ts
|
|
124
|
-
import { execFile as execFile4, execFileSync as
|
|
124
|
+
import { execFile as execFile4, execFileSync as execFileSync2 } from "node:child_process";
|
|
125
125
|
import { promisify as promisify4 } from "node:util";
|
|
126
126
|
import { existsSync as existsSync2, mkdirSync as mkdirSync2, readFileSync as readFileSync3, realpathSync, writeFileSync } from "node:fs";
|
|
127
127
|
import { homedir } from "node:os";
|
|
128
128
|
import { dirname as dirname2, isAbsolute, join as join2, resolve as resolve2 } from "node:path";
|
|
129
|
-
import { z as
|
|
129
|
+
import { z as z5 } from "zod";
|
|
130
130
|
// ../../packages/aeg-forge-state/src/gh.ts
|
|
131
131
|
import { execFile, execFileSync } from "node:child_process";
|
|
132
132
|
import { promisify } from "node:util";
|
|
@@ -602,6 +602,8 @@ var FILE_EXTENSIONS = new Set([
|
|
|
602
602
|
"html",
|
|
603
603
|
"css"
|
|
604
604
|
]);
|
|
605
|
+
var CI_SHARD_DIR = "apps/cli/tests/ci-shards";
|
|
606
|
+
var CI_SHARD_PROBE = `${CI_SHARD_DIR}/shard-1.txt`;
|
|
605
607
|
|
|
606
608
|
// ../../packages/aeg-core/src/coherence-checks.ts
|
|
607
609
|
var R1_GRANDFATHERED_ISSUES = new Set([279, 280, 281, 282]);
|
|
@@ -781,7 +783,6 @@ var TaskPrPauseSchema = z.object({
|
|
|
781
783
|
var TaskPrReviewRecordSchema = z.object({
|
|
782
784
|
verdicts: z.array(TaskPrVerdictSchema),
|
|
783
785
|
roundMarkers: z.array(z.number().int().nonnegative()),
|
|
784
|
-
summaryTable: z.string().nullable(),
|
|
785
786
|
pause: TaskPrPauseSchema.nullable()
|
|
786
787
|
});
|
|
787
788
|
var TaskPrReadInputSchema = z.object({
|
|
@@ -828,26 +829,71 @@ var TaskCancelResultSchema = z.object({
|
|
|
828
829
|
authenticatedFrom: z.string().min(1),
|
|
829
830
|
fencedEffectKeys: z.array(z.string())
|
|
830
831
|
});
|
|
831
|
-
var TASK_TOOL_NAMES = [
|
|
832
|
-
"task_start",
|
|
833
|
-
"task_status",
|
|
834
|
-
"task_escalation_read",
|
|
835
|
-
"task_pr_read",
|
|
836
|
-
"task_resume",
|
|
837
|
-
"task_cancel"
|
|
838
|
-
];
|
|
839
|
-
var OPERATOR_STATUS_FOLLOW = "task_status_follow";
|
|
840
|
-
var OPERATOR_TOOL_GRANT = [...TASK_TOOL_NAMES, OPERATOR_STATUS_FOLLOW];
|
|
841
|
-
// ../../packages/aeg-core/src/dev-review-loop/types.ts
|
|
842
|
-
var SEVERITY_COLUMNS = ["blocker", "major", "minor", "critical", "high", "medium", "low"];
|
|
843
|
-
// ../../packages/aeg-core/src/dev-review-loop/journal-reconstruction.ts
|
|
844
|
-
var SUMMARY_TABLE_HEADER = `| round | ${SEVERITY_COLUMNS.join(" | ")} | confidence | outcome |`;
|
|
845
|
-
// ../../packages/aeg-core/src/log/envelope.ts
|
|
846
|
-
import { createHash } from "node:crypto";
|
|
847
|
-
|
|
848
832
|
// ../../packages/aeg-core/src/log/schema.ts
|
|
833
|
+
import { z as z3 } from "zod";
|
|
834
|
+
|
|
835
|
+
// ../../packages/aeg-core/src/log/custom.ts
|
|
849
836
|
import { z as z2 } from "zod";
|
|
837
|
+
var CUSTOM_EVENT_NAME_PATTERN = /^[a-z][a-z0-9_]*\.[a-z][a-z0-9_.]*$/;
|
|
838
|
+
var CUSTOM_EVENT_NAME_MAX_LENGTH = 64;
|
|
839
|
+
var CUSTOM_EVENT_RESERVED_NAMESPACE = "vinaya";
|
|
840
|
+
var CUSTOM_EVENT_MAX_FIELDS = 20;
|
|
841
|
+
var CUSTOM_FIELD_NAME_PATTERN = /^[a-z][a-z0-9_]*$/;
|
|
842
|
+
var CUSTOM_FIELD_NAME_MAX_LENGTH = 64;
|
|
843
|
+
var CUSTOM_TEXT_MAX_LENGTH = 500;
|
|
844
|
+
var CUSTOM_WORD_PATTERN = /^[a-z0-9][a-z0-9_-]*$/;
|
|
845
|
+
var CUSTOM_WORD_MAX_LENGTH = 64;
|
|
846
|
+
var CUSTOM_FIELD_MAX_WORDS = 50;
|
|
847
|
+
var CustomFieldTypeSchema = z2.union([z2.enum(["text", "number", "boolean"]), z2.array(z2.string())]);
|
|
848
|
+
var CustomEventDeclarationsSchema = z2.record(z2.string(), z2.object({
|
|
849
|
+
fields: z2.record(z2.string(), CustomFieldTypeSchema)
|
|
850
|
+
}).strict()).superRefine((events, ctx) => {
|
|
851
|
+
for (const [name, declaration] of Object.entries(events)) {
|
|
852
|
+
const refuse = (message, path = []) => {
|
|
853
|
+
ctx.addIssue({
|
|
854
|
+
code: z2.ZodIssueCode.custom,
|
|
855
|
+
path: [name, ...path],
|
|
856
|
+
message: `logs.events "${name}": ${message}`
|
|
857
|
+
});
|
|
858
|
+
};
|
|
859
|
+
if (name.length > CUSTOM_EVENT_NAME_MAX_LENGTH) {
|
|
860
|
+
refuse(`the name must be at most ${CUSTOM_EVENT_NAME_MAX_LENGTH} characters`);
|
|
861
|
+
}
|
|
862
|
+
if (!CUSTOM_EVENT_NAME_PATTERN.test(name)) {
|
|
863
|
+
refuse("the name must be `<namespace>.<event>` — lowercase letters, digits and `_`, a dot between them");
|
|
864
|
+
} else if (name.split(".")[0] === CUSTOM_EVENT_RESERVED_NAMESPACE) {
|
|
865
|
+
refuse(`the \`${CUSTOM_EVENT_RESERVED_NAMESPACE}.\` namespace is reserved for Vinaya's own events`);
|
|
866
|
+
}
|
|
867
|
+
const fieldEntries = Object.entries(declaration.fields);
|
|
868
|
+
if (fieldEntries.length > CUSTOM_EVENT_MAX_FIELDS) {
|
|
869
|
+
refuse(`at most ${CUSTOM_EVENT_MAX_FIELDS} fields may be declared (found ${fieldEntries.length})`, ["fields"]);
|
|
870
|
+
}
|
|
871
|
+
for (const [field, type] of fieldEntries) {
|
|
872
|
+
if (field.length > CUSTOM_FIELD_NAME_MAX_LENGTH || !CUSTOM_FIELD_NAME_PATTERN.test(field)) {
|
|
873
|
+
refuse(`field "${field}": a field name is lowercase letters, digits and \`_\`, starting with a letter, at most ${CUSTOM_FIELD_NAME_MAX_LENGTH} characters`, ["fields", field]);
|
|
874
|
+
}
|
|
875
|
+
if (typeof type === "string")
|
|
876
|
+
continue;
|
|
877
|
+
if (type.length === 0) {
|
|
878
|
+
refuse(`field "${field}": a list of words must name at least one word`, ["fields", field]);
|
|
879
|
+
}
|
|
880
|
+
if (type.length > CUSTOM_FIELD_MAX_WORDS) {
|
|
881
|
+
refuse(`field "${field}": a list of words may name at most ${CUSTOM_FIELD_MAX_WORDS}`, ["fields", field]);
|
|
882
|
+
}
|
|
883
|
+
const bad = type.filter((w) => w.length > CUSTOM_WORD_MAX_LENGTH || !CUSTOM_WORD_PATTERN.test(w));
|
|
884
|
+
if (bad.length > 0) {
|
|
885
|
+
refuse(`field "${field}": a listed word is lowercase letters, digits, \`_\` and \`-\`, at most ${CUSTOM_WORD_MAX_LENGTH} characters`, ["fields", field]);
|
|
886
|
+
}
|
|
887
|
+
if (new Set(type).size !== type.length) {
|
|
888
|
+
refuse(`field "${field}": a list of words names a word twice`, ["fields", field]);
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
});
|
|
893
|
+
|
|
894
|
+
// ../../packages/aeg-core/src/log/schema.ts
|
|
850
895
|
var CONFIDENCE_REASON_MAX_LENGTH = 280;
|
|
896
|
+
var REVIEW_FINDING_DESCRIPTION_MAX_LENGTH = 1000;
|
|
851
897
|
var ROLE_VALUES = [
|
|
852
898
|
"planner",
|
|
853
899
|
"developer",
|
|
@@ -857,178 +903,214 @@ var ROLE_VALUES = [
|
|
|
857
903
|
"archivist",
|
|
858
904
|
"architect"
|
|
859
905
|
];
|
|
860
|
-
var RoleSchema =
|
|
906
|
+
var RoleSchema = z3.enum(ROLE_VALUES);
|
|
861
907
|
var HOST_VALUES = ["hook", "ci", "cli", "loop"];
|
|
862
|
-
var HostSchema =
|
|
908
|
+
var HostSchema = z3.enum(HOST_VALUES);
|
|
863
909
|
var RUN_ID_PATTERN = /^[A-Za-z0-9_.-]{1,128}$/;
|
|
864
910
|
var headerMetaCore = {
|
|
865
|
-
ts:
|
|
866
|
-
run_id:
|
|
867
|
-
seq:
|
|
868
|
-
repo:
|
|
869
|
-
vinaya:
|
|
870
|
-
doctrine:
|
|
911
|
+
ts: z3.string(),
|
|
912
|
+
run_id: z3.string().regex(RUN_ID_PATTERN),
|
|
913
|
+
seq: z3.number().int().nonnegative(),
|
|
914
|
+
repo: z3.string().nullable(),
|
|
915
|
+
vinaya: z3.string(),
|
|
916
|
+
doctrine: z3.string(),
|
|
871
917
|
host: HostSchema,
|
|
872
|
-
machine:
|
|
918
|
+
machine: z3.string()
|
|
873
919
|
};
|
|
874
|
-
var HeaderMetaV1Schema =
|
|
875
|
-
schema:
|
|
920
|
+
var HeaderMetaV1Schema = z3.object({
|
|
921
|
+
schema: z3.literal(1),
|
|
876
922
|
...headerMetaCore
|
|
877
923
|
}).strict();
|
|
878
|
-
var LineageSchema =
|
|
879
|
-
run:
|
|
880
|
-
attempt:
|
|
881
|
-
parent:
|
|
924
|
+
var LineageSchema = z3.object({
|
|
925
|
+
run: z3.string().nullable(),
|
|
926
|
+
attempt: z3.number().int().nullable(),
|
|
927
|
+
parent: z3.string().nullable()
|
|
882
928
|
}).strict();
|
|
883
|
-
var InputVersionsSchema =
|
|
884
|
-
objectives_version:
|
|
885
|
-
brief_hash:
|
|
886
|
-
ruling_ordinal:
|
|
887
|
-
policy_digest:
|
|
929
|
+
var InputVersionsSchema = z3.object({
|
|
930
|
+
objectives_version: z3.string().nullable(),
|
|
931
|
+
brief_hash: z3.string().nullable(),
|
|
932
|
+
ruling_ordinal: z3.number().int().nullable(),
|
|
933
|
+
policy_digest: z3.string().nullable()
|
|
888
934
|
}).strict();
|
|
889
|
-
var ProvenanceSchema =
|
|
890
|
-
var HeaderMetaV2Schema =
|
|
891
|
-
schema:
|
|
935
|
+
var ProvenanceSchema = z3.enum(["parent_attributed", "env_correlated", "self_reported", "unavailable"]);
|
|
936
|
+
var HeaderMetaV2Schema = z3.object({
|
|
937
|
+
schema: z3.literal(2),
|
|
892
938
|
...headerMetaCore,
|
|
893
|
-
event_id:
|
|
894
|
-
process_id:
|
|
895
|
-
actor_id:
|
|
939
|
+
event_id: z3.string().min(1),
|
|
940
|
+
process_id: z3.string().min(1),
|
|
941
|
+
actor_id: z3.string().nullable(),
|
|
896
942
|
lineage: LineageSchema,
|
|
897
943
|
input_versions: InputVersionsSchema,
|
|
898
944
|
provenance: ProvenanceSchema
|
|
899
945
|
}).strict();
|
|
900
|
-
var
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
946
|
+
var WorkSchema = z3.object({
|
|
947
|
+
ref: z3.string().nullable(),
|
|
948
|
+
repo: z3.string().nullable(),
|
|
949
|
+
change: z3.string().nullable(),
|
|
950
|
+
revision: z3.string().nullable()
|
|
951
|
+
}).strict();
|
|
952
|
+
var FlowSchema = z3.object({
|
|
953
|
+
id: z3.string().nullable(),
|
|
954
|
+
version: z3.string().nullable()
|
|
955
|
+
}).strict();
|
|
956
|
+
var HeaderMetaV3Schema = z3.object({
|
|
957
|
+
schema: z3.literal(3),
|
|
958
|
+
...headerMetaCore,
|
|
959
|
+
event_id: z3.string().min(1),
|
|
960
|
+
process_id: z3.string().min(1),
|
|
961
|
+
actor_id: z3.string().nullable(),
|
|
962
|
+
lineage: LineageSchema,
|
|
963
|
+
input_versions: InputVersionsSchema,
|
|
964
|
+
provenance: ProvenanceSchema,
|
|
965
|
+
work: WorkSchema,
|
|
966
|
+
flow: FlowSchema,
|
|
967
|
+
runtime: z3.string().nullable(),
|
|
968
|
+
source: z3.string().nullable()
|
|
908
969
|
}).strict();
|
|
909
|
-
var
|
|
970
|
+
var HeaderMetaSchema = z3.discriminatedUnion("schema", [HeaderMetaV1Schema, HeaderMetaV2Schema, HeaderMetaV3Schema]);
|
|
971
|
+
var SubjectSchema = z3.object({
|
|
972
|
+
issue: z3.number().int().nullable(),
|
|
973
|
+
pr: z3.number().int().optional(),
|
|
974
|
+
sha: z3.string().optional(),
|
|
975
|
+
role: z3.union([RoleSchema, z3.literal("unattributed")]),
|
|
976
|
+
round: z3.number().int().optional(),
|
|
977
|
+
objectives_version: z3.string().optional()
|
|
978
|
+
}).strict();
|
|
979
|
+
var HeaderSchema = z3.object({
|
|
910
980
|
meta: HeaderMetaSchema,
|
|
911
981
|
subject: SubjectSchema
|
|
912
982
|
}).strict();
|
|
913
983
|
var envelopeTail = {
|
|
914
|
-
duration_ms:
|
|
915
|
-
payload:
|
|
984
|
+
duration_ms: z3.number().nonnegative().optional(),
|
|
985
|
+
payload: z3.object({}).strict()
|
|
916
986
|
};
|
|
917
|
-
var ReviewFindingSchema =
|
|
918
|
-
id:
|
|
919
|
-
severity:
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
987
|
+
var ReviewFindingSchema = z3.object({
|
|
988
|
+
id: z3.string(),
|
|
989
|
+
severity: z3.string(),
|
|
990
|
+
location: z3.string().optional(),
|
|
991
|
+
deferral_reason: z3.enum(["outside-surface", "unchanged-line"]).optional(),
|
|
992
|
+
description: z3.string().max(REVIEW_FINDING_DESCRIPTION_MAX_LENGTH).optional(),
|
|
993
|
+
state: z3.string().optional(),
|
|
994
|
+
severity_scale: z3.string().optional(),
|
|
995
|
+
policy_treatment: z3.enum(["blocking", "non_blocking", "unavailable"]).optional(),
|
|
996
|
+
confidence: z3.number().min(0).max(1).optional(),
|
|
997
|
+
confidence_scale: z3.string().optional(),
|
|
998
|
+
confidence_source: z3.string().optional()
|
|
926
999
|
}).strict();
|
|
927
|
-
var DispatchOutcomeSchema =
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
type:
|
|
931
|
-
pr:
|
|
932
|
-
head:
|
|
933
|
-
comment_id:
|
|
1000
|
+
var DispatchOutcomeSchema = z3.discriminatedUnion("type", [
|
|
1001
|
+
z3.object({ type: z3.literal("pr_opened"), pr: z3.number().int(), head: z3.string() }).strict(),
|
|
1002
|
+
z3.object({
|
|
1003
|
+
type: z3.literal("round_pushed"),
|
|
1004
|
+
pr: z3.number().int(),
|
|
1005
|
+
head: z3.string(),
|
|
1006
|
+
comment_id: z3.number().int()
|
|
934
1007
|
}).strict(),
|
|
935
|
-
|
|
936
|
-
type:
|
|
937
|
-
verdict:
|
|
938
|
-
head:
|
|
939
|
-
comment_id:
|
|
940
|
-
objectives:
|
|
941
|
-
findings:
|
|
1008
|
+
z3.object({
|
|
1009
|
+
type: z3.literal("verdict"),
|
|
1010
|
+
verdict: z3.enum(["APPROVE", "REQUEST CHANGES", "PASS", "FAIL"]),
|
|
1011
|
+
head: z3.string(),
|
|
1012
|
+
comment_id: z3.number().int(),
|
|
1013
|
+
objectives: z3.array(z3.object({ id: z3.string(), met: z3.boolean() }).strict()),
|
|
1014
|
+
findings: z3.array(ReviewFindingSchema)
|
|
942
1015
|
}).strict(),
|
|
943
|
-
|
|
944
|
-
type:
|
|
945
|
-
class:
|
|
946
|
-
comment_id:
|
|
1016
|
+
z3.object({
|
|
1017
|
+
type: z3.literal("escalation"),
|
|
1018
|
+
class: z3.enum(["authority", "strategy", "product"]),
|
|
1019
|
+
comment_id: z3.number().int()
|
|
947
1020
|
}).strict(),
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
1021
|
+
z3.object({ type: z3.literal("brief"), comment_id: z3.number().int(), hash: z3.string() }).strict(),
|
|
1022
|
+
z3.object({ type: z3.literal("plan"), issues: z3.array(z3.number().int()) }).strict(),
|
|
1023
|
+
z3.object({ type: z3.literal("archive"), provenance_comment_id: z3.number().int() }).strict(),
|
|
1024
|
+
z3.object({ type: z3.literal("completed") }).strict()
|
|
952
1025
|
]);
|
|
953
1026
|
var dispatchShared = {
|
|
954
1027
|
meta: HeaderMetaSchema,
|
|
955
1028
|
subject: SubjectSchema,
|
|
956
|
-
kind:
|
|
1029
|
+
kind: z3.literal("dispatch"),
|
|
957
1030
|
...envelopeTail,
|
|
958
1031
|
target_role: RoleSchema,
|
|
959
|
-
model:
|
|
960
|
-
round:
|
|
961
|
-
effect_id:
|
|
1032
|
+
model: z3.string(),
|
|
1033
|
+
round: z3.number().int().optional(),
|
|
1034
|
+
effect_id: z3.string()
|
|
962
1035
|
};
|
|
963
|
-
var dispatchUsageField =
|
|
964
|
-
var DispatchEventSchema =
|
|
965
|
-
|
|
966
|
-
|
|
1036
|
+
var dispatchUsageField = z3.object({ input: z3.number().nonnegative(), output: z3.number().nonnegative() }).strict().nullable();
|
|
1037
|
+
var DispatchEventSchema = z3.discriminatedUnion("event", [
|
|
1038
|
+
z3.object({ ...dispatchShared, event: z3.literal("dispatched"), prompt_hash: z3.string() }).strict(),
|
|
1039
|
+
z3.object({
|
|
967
1040
|
...dispatchShared,
|
|
968
|
-
event:
|
|
1041
|
+
event: z3.literal("outcome_received"),
|
|
969
1042
|
outcome: DispatchOutcomeSchema,
|
|
970
1043
|
usage: dispatchUsageField
|
|
971
1044
|
}).strict(),
|
|
972
|
-
|
|
1045
|
+
z3.object({
|
|
973
1046
|
...dispatchShared,
|
|
974
|
-
event:
|
|
975
|
-
reason:
|
|
1047
|
+
event: z3.literal("dispatch_failed"),
|
|
1048
|
+
reason: z3.enum(["timeout", "crash", "refused", "unattributed_write", "usage_limit"]),
|
|
1049
|
+
usage_limit: z3.object({ agent: z3.string().min(1), reset_at: z3.string().nullable() }).strict().optional(),
|
|
976
1050
|
usage: dispatchUsageField
|
|
977
1051
|
}).strict()
|
|
978
1052
|
]);
|
|
1053
|
+
var CODE_TOKEN_PATTERN = /^[A-Za-z0-9._-]{1,64}$/;
|
|
1054
|
+
var CodeTokenSchema = z3.string().regex(CODE_TOKEN_PATTERN);
|
|
1055
|
+
var ReviewerVerdictSchema = z3.object({
|
|
1056
|
+
role: RoleSchema,
|
|
1057
|
+
outcome: z3.enum(["approve", "changes_requested", "not_reviewed"]),
|
|
1058
|
+
blockers: z3.number().int().nonnegative()
|
|
1059
|
+
}).strict();
|
|
979
1060
|
var loopShared = {
|
|
980
1061
|
meta: HeaderMetaSchema,
|
|
981
1062
|
subject: SubjectSchema,
|
|
982
|
-
kind:
|
|
1063
|
+
kind: z3.literal("dev_review_loop"),
|
|
983
1064
|
...envelopeTail,
|
|
984
|
-
loop_id:
|
|
1065
|
+
loop_id: z3.string()
|
|
985
1066
|
};
|
|
986
|
-
var DevReviewLoopEventSchema =
|
|
987
|
-
|
|
1067
|
+
var DevReviewLoopEventSchema = z3.discriminatedUnion("event", [
|
|
1068
|
+
z3.object({
|
|
988
1069
|
...loopShared,
|
|
989
|
-
event:
|
|
990
|
-
task:
|
|
991
|
-
policy:
|
|
992
|
-
max_rounds:
|
|
993
|
-
reviewers:
|
|
994
|
-
models:
|
|
1070
|
+
event: z3.literal("loop_started"),
|
|
1071
|
+
task: z3.number().int(),
|
|
1072
|
+
policy: z3.object({
|
|
1073
|
+
max_rounds: z3.number().int().nonnegative(),
|
|
1074
|
+
reviewers: z3.array(RoleSchema),
|
|
1075
|
+
models: z3.record(RoleSchema, z3.string())
|
|
995
1076
|
}).strict()
|
|
996
1077
|
}).strict(),
|
|
997
|
-
|
|
998
|
-
|
|
1078
|
+
z3.object({ ...loopShared, event: z3.literal("round_started"), round: z3.number().int(), base_head: z3.string() }).strict(),
|
|
1079
|
+
z3.object({
|
|
999
1080
|
...loopShared,
|
|
1000
|
-
event:
|
|
1001
|
-
round:
|
|
1002
|
-
head:
|
|
1003
|
-
green:
|
|
1004
|
-
confidence_value:
|
|
1005
|
-
confidence_reason:
|
|
1006
|
-
confidence_unavailable:
|
|
1007
|
-
extra_turn_spent:
|
|
1081
|
+
event: z3.literal("gate_result_read"),
|
|
1082
|
+
round: z3.number().int(),
|
|
1083
|
+
head: z3.string(),
|
|
1084
|
+
green: z3.boolean(),
|
|
1085
|
+
confidence_value: z3.number().int().min(0).max(100).optional(),
|
|
1086
|
+
confidence_reason: z3.string().max(CONFIDENCE_REASON_MAX_LENGTH).optional(),
|
|
1087
|
+
confidence_unavailable: z3.boolean().optional(),
|
|
1088
|
+
extra_turn_spent: z3.boolean().optional()
|
|
1008
1089
|
}).strict(),
|
|
1009
|
-
|
|
1090
|
+
z3.object({
|
|
1010
1091
|
...loopShared,
|
|
1011
|
-
event:
|
|
1012
|
-
round:
|
|
1013
|
-
head:
|
|
1014
|
-
all_approve:
|
|
1015
|
-
blockers:
|
|
1016
|
-
findings:
|
|
1092
|
+
event: z3.literal("verdicts_read"),
|
|
1093
|
+
round: z3.number().int(),
|
|
1094
|
+
head: z3.string(),
|
|
1095
|
+
all_approve: z3.boolean(),
|
|
1096
|
+
blockers: z3.number().int().nonnegative(),
|
|
1097
|
+
findings: z3.array(ReviewFindingSchema).optional(),
|
|
1098
|
+
reviewers: z3.array(ReviewerVerdictSchema).optional()
|
|
1017
1099
|
}).strict(),
|
|
1018
|
-
|
|
1100
|
+
z3.object({
|
|
1019
1101
|
...loopShared,
|
|
1020
|
-
event:
|
|
1021
|
-
round:
|
|
1022
|
-
open:
|
|
1023
|
-
resolved:
|
|
1024
|
-
new:
|
|
1025
|
-
recurring:
|
|
1102
|
+
event: z3.literal("findings_compared"),
|
|
1103
|
+
round: z3.number().int(),
|
|
1104
|
+
open: z3.array(z3.string()),
|
|
1105
|
+
resolved: z3.array(z3.string()),
|
|
1106
|
+
new: z3.array(z3.string()),
|
|
1107
|
+
recurring: z3.array(z3.string())
|
|
1026
1108
|
}).strict(),
|
|
1027
|
-
|
|
1109
|
+
z3.object({
|
|
1028
1110
|
...loopShared,
|
|
1029
|
-
event:
|
|
1030
|
-
round:
|
|
1031
|
-
condition:
|
|
1111
|
+
event: z3.literal("stop_condition_met"),
|
|
1112
|
+
round: z3.number().int(),
|
|
1113
|
+
condition: z3.enum([
|
|
1032
1114
|
"green",
|
|
1033
1115
|
"max_rounds",
|
|
1034
1116
|
"no_progress",
|
|
@@ -1037,66 +1119,85 @@ var DevReviewLoopEventSchema = z2.discriminatedUnion("event", [
|
|
|
1037
1119
|
"confidence",
|
|
1038
1120
|
"reappearance",
|
|
1039
1121
|
"repeat_finding",
|
|
1040
|
-
"repeat_failure"
|
|
1122
|
+
"repeat_failure",
|
|
1123
|
+
"time_budget"
|
|
1041
1124
|
])
|
|
1042
1125
|
}).strict(),
|
|
1043
|
-
|
|
1126
|
+
z3.object({
|
|
1127
|
+
...loopShared,
|
|
1128
|
+
event: z3.literal("paused"),
|
|
1129
|
+
round: z3.number().int(),
|
|
1130
|
+
reason: z3.enum(["escalation", "principal_item", "refreeze_needed"]),
|
|
1131
|
+
reason_code: CodeTokenSchema.optional()
|
|
1132
|
+
}).strict(),
|
|
1133
|
+
z3.object({
|
|
1044
1134
|
...loopShared,
|
|
1045
|
-
event:
|
|
1046
|
-
round:
|
|
1047
|
-
|
|
1135
|
+
event: z3.literal("resumed"),
|
|
1136
|
+
round: z3.number().int(),
|
|
1137
|
+
by: z3.enum(["principal", "driver"])
|
|
1048
1138
|
}).strict(),
|
|
1049
|
-
|
|
1139
|
+
z3.object({
|
|
1050
1140
|
...loopShared,
|
|
1051
|
-
event:
|
|
1052
|
-
round:
|
|
1053
|
-
by:
|
|
1141
|
+
event: z3.literal("cancelled"),
|
|
1142
|
+
round: z3.number().int(),
|
|
1143
|
+
by: z3.literal("principal")
|
|
1054
1144
|
}).strict(),
|
|
1055
|
-
|
|
1145
|
+
z3.object({
|
|
1056
1146
|
...loopShared,
|
|
1057
|
-
event:
|
|
1058
|
-
round:
|
|
1059
|
-
|
|
1147
|
+
event: z3.literal("unpushed_work_resume"),
|
|
1148
|
+
round: z3.number().int(),
|
|
1149
|
+
branch: z3.string(),
|
|
1150
|
+
detail: z3.string()
|
|
1060
1151
|
}).strict(),
|
|
1061
|
-
|
|
1152
|
+
z3.object({
|
|
1062
1153
|
...loopShared,
|
|
1063
|
-
event:
|
|
1064
|
-
round:
|
|
1065
|
-
|
|
1066
|
-
|
|
1154
|
+
event: z3.literal("round_ended"),
|
|
1155
|
+
round: z3.number().int(),
|
|
1156
|
+
base_head: z3.string(),
|
|
1157
|
+
head: z3.string(),
|
|
1158
|
+
files_changed: z3.number().int().nonnegative(),
|
|
1159
|
+
insertions: z3.number().int().nonnegative(),
|
|
1160
|
+
deletions: z3.number().int().nonnegative(),
|
|
1161
|
+
wall_ms: z3.number().nonnegative(),
|
|
1162
|
+
outcome: z3.enum(["green", "changes_requested", "escalated"])
|
|
1067
1163
|
}).strict(),
|
|
1068
|
-
|
|
1164
|
+
z3.object({
|
|
1069
1165
|
...loopShared,
|
|
1070
|
-
event:
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
wall_ms: z2.number().nonnegative(),
|
|
1078
|
-
outcome: z2.enum(["green", "changes_requested", "escalated"])
|
|
1166
|
+
event: z3.literal("journal_finalized"),
|
|
1167
|
+
rounds: z3.number().int().nonnegative(),
|
|
1168
|
+
total_wall_ms: z3.number().nonnegative(),
|
|
1169
|
+
time_to_green_ms: z3.number().nonnegative().nullable(),
|
|
1170
|
+
files_changed_total: z3.number().int().nonnegative(),
|
|
1171
|
+
final_head: z3.string(),
|
|
1172
|
+
result: z3.enum(["merged_ready", "stopped"])
|
|
1079
1173
|
}).strict(),
|
|
1080
|
-
|
|
1174
|
+
z3.object({
|
|
1081
1175
|
...loopShared,
|
|
1082
|
-
event:
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
final_head: z2.string(),
|
|
1088
|
-
result: z2.enum(["merged_ready", "stopped"])
|
|
1176
|
+
event: z3.literal("infrastructure_retry"),
|
|
1177
|
+
round: z3.number().int(),
|
|
1178
|
+
failure_kind: z3.enum(["pause_comment_post", "developer_connection"]),
|
|
1179
|
+
attempts: z3.number().int().positive(),
|
|
1180
|
+
outcome: z3.enum(["recovered", "exhausted"])
|
|
1089
1181
|
}).strict(),
|
|
1090
|
-
|
|
1182
|
+
z3.object({
|
|
1091
1183
|
...loopShared,
|
|
1092
|
-
event:
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1184
|
+
event: z3.literal("driver_heartbeat"),
|
|
1185
|
+
task: z3.number().int(),
|
|
1186
|
+
pr: z3.number().int().positive().optional(),
|
|
1187
|
+
round: z3.number().int(),
|
|
1188
|
+
phase: z3.string()
|
|
1189
|
+
}).strict(),
|
|
1190
|
+
z3.object({
|
|
1191
|
+
...loopShared,
|
|
1192
|
+
event: z3.literal("driver_exited"),
|
|
1193
|
+
task: z3.number().int(),
|
|
1194
|
+
reason: z3.enum(["finished", "paused", "reexec", "error", "signal"]),
|
|
1195
|
+
last_decision: z3.string(),
|
|
1196
|
+
exit_code: z3.number().int().optional(),
|
|
1197
|
+
error_class: CodeTokenSchema.optional()
|
|
1097
1198
|
}).strict()
|
|
1098
1199
|
]);
|
|
1099
|
-
var ForgeOpSchema =
|
|
1200
|
+
var ForgeOpSchema = z3.enum([
|
|
1100
1201
|
"pr.create",
|
|
1101
1202
|
"pr.comment",
|
|
1102
1203
|
"pr.body.replace",
|
|
@@ -1110,24 +1211,24 @@ var ForgeOpSchema = z2.enum([
|
|
|
1110
1211
|
"label.add",
|
|
1111
1212
|
"label.remove"
|
|
1112
1213
|
]);
|
|
1113
|
-
var ForgeWriteTargetSchema =
|
|
1114
|
-
issue:
|
|
1115
|
-
pr:
|
|
1214
|
+
var ForgeWriteTargetSchema = z3.object({
|
|
1215
|
+
issue: z3.number().int().optional(),
|
|
1216
|
+
pr: z3.number().int().optional()
|
|
1116
1217
|
}).strict();
|
|
1117
1218
|
var forgeWriteShared = {
|
|
1118
1219
|
meta: HeaderMetaSchema,
|
|
1119
1220
|
subject: SubjectSchema,
|
|
1120
|
-
kind:
|
|
1221
|
+
kind: z3.literal("forge_write"),
|
|
1121
1222
|
...envelopeTail,
|
|
1122
1223
|
op: ForgeOpSchema,
|
|
1123
1224
|
target: ForgeWriteTargetSchema
|
|
1124
1225
|
};
|
|
1125
|
-
var ForgeWriteEventSchema =
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1226
|
+
var ForgeWriteEventSchema = z3.discriminatedUnion("event", [
|
|
1227
|
+
z3.object({ ...forgeWriteShared, event: z3.literal("validated") }).strict(),
|
|
1228
|
+
z3.object({ ...forgeWriteShared, event: z3.literal("refused"), reason: z3.string() }).strict(),
|
|
1229
|
+
z3.object({ ...forgeWriteShared, event: z3.literal("written"), comment_ids: z3.array(z3.string()) }).strict()
|
|
1129
1230
|
]);
|
|
1130
|
-
var GateOutcomeSchema =
|
|
1231
|
+
var GateOutcomeSchema = z3.enum([
|
|
1131
1232
|
"pass",
|
|
1132
1233
|
"fail",
|
|
1133
1234
|
"wait",
|
|
@@ -1140,61 +1241,74 @@ var GateOutcomeSchema = z2.enum([
|
|
|
1140
1241
|
var gateShared = {
|
|
1141
1242
|
meta: HeaderMetaSchema,
|
|
1142
1243
|
subject: SubjectSchema,
|
|
1143
|
-
kind:
|
|
1244
|
+
kind: z3.literal("gate"),
|
|
1144
1245
|
...envelopeTail,
|
|
1145
|
-
check:
|
|
1146
|
-
check_version:
|
|
1147
|
-
policy_version:
|
|
1148
|
-
input_fingerprint:
|
|
1246
|
+
check: z3.string(),
|
|
1247
|
+
check_version: z3.string().nullable(),
|
|
1248
|
+
policy_version: z3.string().nullable(),
|
|
1249
|
+
input_fingerprint: z3.string().nullable()
|
|
1149
1250
|
};
|
|
1150
|
-
var GateEventSchema =
|
|
1151
|
-
|
|
1251
|
+
var GateEventSchema = z3.discriminatedUnion("event", [
|
|
1252
|
+
z3.object({
|
|
1152
1253
|
...gateShared,
|
|
1153
|
-
event:
|
|
1254
|
+
event: z3.literal("checked"),
|
|
1154
1255
|
outcome: GateOutcomeSchema,
|
|
1155
|
-
reason:
|
|
1256
|
+
reason: z3.string().optional()
|
|
1257
|
+
}).strict(),
|
|
1258
|
+
z3.object({
|
|
1259
|
+
meta: HeaderMetaSchema,
|
|
1260
|
+
subject: SubjectSchema,
|
|
1261
|
+
kind: z3.literal("gate"),
|
|
1262
|
+
...envelopeTail,
|
|
1263
|
+
event: z3.literal("summary"),
|
|
1264
|
+
ran: z3.number().int().nonnegative(),
|
|
1265
|
+
passed: z3.number().int().nonnegative(),
|
|
1266
|
+
failed: z3.number().int().nonnegative(),
|
|
1267
|
+
skipped: z3.number().int().nonnegative(),
|
|
1268
|
+
failed_checks: z3.array(z3.string())
|
|
1156
1269
|
}).strict()
|
|
1157
1270
|
]);
|
|
1158
|
-
var OperationResultSchema =
|
|
1271
|
+
var OperationResultSchema = z3.enum(["ok", "error", "refused", "timeout", "cancelled", "unavailable"]);
|
|
1159
1272
|
var operationShared = {
|
|
1160
1273
|
meta: HeaderMetaSchema,
|
|
1161
1274
|
subject: SubjectSchema,
|
|
1162
|
-
kind:
|
|
1275
|
+
kind: z3.literal("operation"),
|
|
1163
1276
|
...envelopeTail,
|
|
1164
|
-
operation:
|
|
1165
|
-
target:
|
|
1277
|
+
operation: z3.string(),
|
|
1278
|
+
target: z3.string().nullable()
|
|
1166
1279
|
};
|
|
1167
|
-
var OperationEventSchema =
|
|
1168
|
-
|
|
1280
|
+
var OperationEventSchema = z3.discriminatedUnion("event", [
|
|
1281
|
+
z3.object({
|
|
1169
1282
|
...operationShared,
|
|
1170
|
-
event:
|
|
1283
|
+
event: z3.literal("completed"),
|
|
1171
1284
|
result: OperationResultSchema,
|
|
1172
|
-
error_class:
|
|
1285
|
+
error_class: z3.string().nullable(),
|
|
1286
|
+
field_names: z3.array(z3.string().max(CUSTOM_FIELD_NAME_MAX_LENGTH)).max(CUSTOM_EVENT_MAX_FIELDS).optional()
|
|
1173
1287
|
}).strict()
|
|
1174
1288
|
]);
|
|
1175
|
-
var UsageUnitsSchema =
|
|
1176
|
-
input:
|
|
1177
|
-
output:
|
|
1178
|
-
cache:
|
|
1289
|
+
var UsageUnitsSchema = z3.object({
|
|
1290
|
+
input: z3.number().nonnegative().nullable(),
|
|
1291
|
+
output: z3.number().nonnegative().nullable(),
|
|
1292
|
+
cache: z3.number().nonnegative().nullable()
|
|
1179
1293
|
}).strict();
|
|
1180
1294
|
var usageShared = {
|
|
1181
1295
|
meta: HeaderMetaSchema,
|
|
1182
1296
|
subject: SubjectSchema,
|
|
1183
|
-
kind:
|
|
1297
|
+
kind: z3.literal("usage"),
|
|
1184
1298
|
...envelopeTail,
|
|
1185
|
-
model:
|
|
1186
|
-
source:
|
|
1187
|
-
semantics:
|
|
1299
|
+
model: z3.string().nullable(),
|
|
1300
|
+
source: z3.string(),
|
|
1301
|
+
semantics: z3.enum(["cumulative", "delta"])
|
|
1188
1302
|
};
|
|
1189
|
-
var UsageEventSchema =
|
|
1190
|
-
|
|
1303
|
+
var UsageEventSchema = z3.discriminatedUnion("event", [
|
|
1304
|
+
z3.object({
|
|
1191
1305
|
...usageShared,
|
|
1192
|
-
event:
|
|
1306
|
+
event: z3.literal("observed"),
|
|
1193
1307
|
units: UsageUnitsSchema,
|
|
1194
|
-
unknown_reason:
|
|
1308
|
+
unknown_reason: z3.string().nullable()
|
|
1195
1309
|
}).strict()
|
|
1196
1310
|
]);
|
|
1197
|
-
var RoleAttemptOutcomeSchema =
|
|
1311
|
+
var RoleAttemptOutcomeSchema = z3.enum([
|
|
1198
1312
|
"completed",
|
|
1199
1313
|
"incomplete",
|
|
1200
1314
|
"infrastructure_failed",
|
|
@@ -1205,17 +1319,17 @@ var RoleAttemptOutcomeSchema = z2.enum([
|
|
|
1205
1319
|
var roleAttemptShared = {
|
|
1206
1320
|
meta: HeaderMetaSchema,
|
|
1207
1321
|
subject: SubjectSchema,
|
|
1208
|
-
kind:
|
|
1322
|
+
kind: z3.literal("role_attempt"),
|
|
1209
1323
|
...envelopeTail,
|
|
1210
|
-
actor:
|
|
1211
|
-
attempt:
|
|
1212
|
-
effect_id:
|
|
1213
|
-
model:
|
|
1324
|
+
actor: z3.string().nullable(),
|
|
1325
|
+
attempt: z3.number().int().nullable(),
|
|
1326
|
+
effect_id: z3.string(),
|
|
1327
|
+
model: z3.string().nullable()
|
|
1214
1328
|
};
|
|
1215
|
-
var RoleAttemptEventSchema =
|
|
1216
|
-
|
|
1329
|
+
var RoleAttemptEventSchema = z3.discriminatedUnion("event", [
|
|
1330
|
+
z3.object({
|
|
1217
1331
|
...roleAttemptShared,
|
|
1218
|
-
event:
|
|
1332
|
+
event: z3.literal("attempted"),
|
|
1219
1333
|
outcome: RoleAttemptOutcomeSchema,
|
|
1220
1334
|
usage: dispatchUsageField
|
|
1221
1335
|
}).strict()
|
|
@@ -1223,42 +1337,59 @@ var RoleAttemptEventSchema = z2.discriminatedUnion("event", [
|
|
|
1223
1337
|
var handoffShared = {
|
|
1224
1338
|
meta: HeaderMetaSchema,
|
|
1225
1339
|
subject: SubjectSchema,
|
|
1226
|
-
kind:
|
|
1340
|
+
kind: z3.literal("handoff"),
|
|
1227
1341
|
...envelopeTail,
|
|
1228
|
-
class:
|
|
1229
|
-
reason:
|
|
1342
|
+
class: z3.enum(["authority", "strategy", "product"]),
|
|
1343
|
+
reason: z3.string()
|
|
1230
1344
|
};
|
|
1231
|
-
var HandoffEventSchema =
|
|
1232
|
-
|
|
1345
|
+
var HandoffEventSchema = z3.discriminatedUnion("event", [
|
|
1346
|
+
z3.object({
|
|
1233
1347
|
...handoffShared,
|
|
1234
|
-
event:
|
|
1235
|
-
requested_decision:
|
|
1348
|
+
event: z3.literal("raised"),
|
|
1349
|
+
requested_decision: z3.string().nullable()
|
|
1236
1350
|
}).strict(),
|
|
1237
|
-
|
|
1351
|
+
z3.object({
|
|
1238
1352
|
...handoffShared,
|
|
1239
|
-
event:
|
|
1240
|
-
resolution:
|
|
1241
|
-
resolved_by:
|
|
1353
|
+
event: z3.literal("resolved"),
|
|
1354
|
+
resolution: z3.string().nullable(),
|
|
1355
|
+
resolved_by: z3.string().nullable()
|
|
1242
1356
|
}).strict()
|
|
1243
1357
|
]);
|
|
1244
|
-
var EffectTargetSchema =
|
|
1245
|
-
kind:
|
|
1246
|
-
ref:
|
|
1358
|
+
var EffectTargetSchema = z3.object({
|
|
1359
|
+
kind: z3.string(),
|
|
1360
|
+
ref: z3.string()
|
|
1247
1361
|
}).strict();
|
|
1248
1362
|
var effectShared = {
|
|
1249
1363
|
meta: HeaderMetaSchema,
|
|
1250
1364
|
subject: SubjectSchema,
|
|
1251
|
-
kind:
|
|
1365
|
+
kind: z3.literal("effect"),
|
|
1252
1366
|
...envelopeTail,
|
|
1253
|
-
effect_id:
|
|
1367
|
+
effect_id: z3.string(),
|
|
1254
1368
|
target: EffectTargetSchema
|
|
1255
1369
|
};
|
|
1256
|
-
var EffectEventSchema =
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1370
|
+
var EffectEventSchema = z3.discriminatedUnion("event", [
|
|
1371
|
+
z3.object({ ...effectShared, event: z3.literal("attempted") }).strict(),
|
|
1372
|
+
z3.object({ ...effectShared, event: z3.literal("observed"), outcome: z3.enum(["success", "failure", "uncertain"]) }).strict(),
|
|
1373
|
+
z3.object({ ...effectShared, event: z3.literal("verified"), outcome: z3.enum(["success", "failure", "uncertain"]) }).strict()
|
|
1260
1374
|
]);
|
|
1261
|
-
var
|
|
1375
|
+
var CustomFieldValueSchema = z3.union([z3.string().max(CUSTOM_TEXT_MAX_LENGTH), z3.number().finite(), z3.boolean()]);
|
|
1376
|
+
var customShared = {
|
|
1377
|
+
meta: HeaderMetaV3Schema,
|
|
1378
|
+
subject: SubjectSchema,
|
|
1379
|
+
kind: z3.literal("custom"),
|
|
1380
|
+
...envelopeTail
|
|
1381
|
+
};
|
|
1382
|
+
var CustomEventSchema = z3.discriminatedUnion("event", [
|
|
1383
|
+
z3.object({
|
|
1384
|
+
...customShared,
|
|
1385
|
+
event: z3.literal("recorded"),
|
|
1386
|
+
name: z3.string().max(CUSTOM_EVENT_NAME_MAX_LENGTH).regex(CUSTOM_EVENT_NAME_PATTERN),
|
|
1387
|
+
fields: z3.record(z3.string().max(CUSTOM_FIELD_NAME_MAX_LENGTH).regex(CUSTOM_FIELD_NAME_PATTERN), CustomFieldValueSchema).refine((f) => Object.keys(f).length <= CUSTOM_EVENT_MAX_FIELDS, {
|
|
1388
|
+
message: `custom: at most ${CUSTOM_EVENT_MAX_FIELDS} fields`
|
|
1389
|
+
})
|
|
1390
|
+
}).strict()
|
|
1391
|
+
]);
|
|
1392
|
+
var LogEventSchema = z3.union([
|
|
1262
1393
|
DispatchEventSchema,
|
|
1263
1394
|
DevReviewLoopEventSchema,
|
|
1264
1395
|
ForgeWriteEventSchema,
|
|
@@ -1267,10 +1398,11 @@ var LogEventSchema = z2.union([
|
|
|
1267
1398
|
UsageEventSchema,
|
|
1268
1399
|
RoleAttemptEventSchema,
|
|
1269
1400
|
HandoffEventSchema,
|
|
1270
|
-
EffectEventSchema
|
|
1401
|
+
EffectEventSchema,
|
|
1402
|
+
CustomEventSchema
|
|
1271
1403
|
]);
|
|
1272
|
-
|
|
1273
1404
|
// ../../packages/aeg-core/src/log/envelope.ts
|
|
1405
|
+
import { createHash } from "node:crypto";
|
|
1274
1406
|
function isRole(value) {
|
|
1275
1407
|
return value !== undefined && ROLE_VALUES.includes(value);
|
|
1276
1408
|
}
|
|
@@ -1307,18 +1439,27 @@ function roundFromEnv(round) {
|
|
|
1307
1439
|
const n = Number(round);
|
|
1308
1440
|
return Number.isInteger(n) ? n : undefined;
|
|
1309
1441
|
}
|
|
1442
|
+
function prFromEnv(pr) {
|
|
1443
|
+
if (pr === undefined || pr === "")
|
|
1444
|
+
return;
|
|
1445
|
+
const n = Number(pr);
|
|
1446
|
+
return Number.isInteger(n) && n > 0 ? n : undefined;
|
|
1447
|
+
}
|
|
1310
1448
|
function buildHeader(input) {
|
|
1311
1449
|
const role = isRole(input.env.role) ? input.env.role : "unattributed";
|
|
1312
1450
|
const round = roundFromEnv(input.env.round);
|
|
1451
|
+
const pr = prFromEnv(input.env.pr);
|
|
1313
1452
|
const subject = {
|
|
1314
1453
|
issue: issueFromTask(input.env.task) ?? input.branchIssue ?? null,
|
|
1315
1454
|
role,
|
|
1316
1455
|
...round !== undefined ? { round } : {},
|
|
1456
|
+
...pr !== undefined ? { pr } : {},
|
|
1317
1457
|
...input.subject ?? {}
|
|
1318
1458
|
};
|
|
1459
|
+
const issue = subject.issue;
|
|
1319
1460
|
return {
|
|
1320
1461
|
meta: {
|
|
1321
|
-
schema:
|
|
1462
|
+
schema: 3,
|
|
1322
1463
|
ts: input.now.toISOString(),
|
|
1323
1464
|
run_id: input.runId,
|
|
1324
1465
|
seq: input.seq,
|
|
@@ -1341,7 +1482,19 @@ function buildHeader(input) {
|
|
|
1341
1482
|
ruling_ordinal: input.inputVersions?.rulingOrdinal ?? null,
|
|
1342
1483
|
policy_digest: input.inputVersions?.policyDigest ?? null
|
|
1343
1484
|
},
|
|
1344
|
-
provenance: provenanceFor(input)
|
|
1485
|
+
provenance: provenanceFor(input),
|
|
1486
|
+
work: {
|
|
1487
|
+
ref: lineageFieldFromEnv(input.env.workRef) ?? (issue === null ? null : String(issue)),
|
|
1488
|
+
repo: input.repo,
|
|
1489
|
+
change: null,
|
|
1490
|
+
revision: null
|
|
1491
|
+
},
|
|
1492
|
+
flow: {
|
|
1493
|
+
id: lineageFieldFromEnv(input.env.flow) ?? "vinaya",
|
|
1494
|
+
version: lineageFieldFromEnv(input.env.flowVersion)
|
|
1495
|
+
},
|
|
1496
|
+
runtime: lineageFieldFromEnv(input.env.runtime),
|
|
1497
|
+
source: lineageFieldFromEnv(input.env.source)
|
|
1345
1498
|
},
|
|
1346
1499
|
subject
|
|
1347
1500
|
};
|
|
@@ -1384,7 +1537,7 @@ function redact(value, home) {
|
|
|
1384
1537
|
return value;
|
|
1385
1538
|
}
|
|
1386
1539
|
// ../../packages/aeg-core/src/log/store.ts
|
|
1387
|
-
var KNOWN_SCHEMA_VERSIONS = [1, 2];
|
|
1540
|
+
var KNOWN_SCHEMA_VERSIONS = [1, 2, 3];
|
|
1388
1541
|
function metaOf(obj) {
|
|
1389
1542
|
if (obj === null || typeof obj !== "object")
|
|
1390
1543
|
return null;
|
|
@@ -1450,7 +1603,7 @@ function classifyStoredLine(raw, home) {
|
|
|
1450
1603
|
return { status: "invalid", identity: null, raw, reason: "valid event with no derivable identity" };
|
|
1451
1604
|
}
|
|
1452
1605
|
const redacted = redact(event, home);
|
|
1453
|
-
const provenance = version
|
|
1606
|
+
const provenance = version >= 2 ? event.meta.provenance ?? null : null;
|
|
1454
1607
|
return {
|
|
1455
1608
|
status: "ok",
|
|
1456
1609
|
identity,
|
|
@@ -1463,136 +1616,139 @@ function classifyStoredLine(raw, home) {
|
|
|
1463
1616
|
};
|
|
1464
1617
|
}
|
|
1465
1618
|
// ../../packages/aeg-core/src/control-store/records.ts
|
|
1466
|
-
import { z as
|
|
1467
|
-
var isoTimestamp =
|
|
1468
|
-
var taskId =
|
|
1469
|
-
var epochNumber =
|
|
1470
|
-
var RunRecordSchema =
|
|
1471
|
-
version:
|
|
1472
|
-
kind:
|
|
1619
|
+
import { z as z4 } from "zod";
|
|
1620
|
+
var isoTimestamp = z4.string().min(1);
|
|
1621
|
+
var taskId = z4.number().int().positive();
|
|
1622
|
+
var epochNumber = z4.number().int().nonnegative();
|
|
1623
|
+
var RunRecordSchema = z4.object({
|
|
1624
|
+
version: z4.literal(1),
|
|
1625
|
+
kind: z4.literal("run"),
|
|
1473
1626
|
task: taskId,
|
|
1474
|
-
runId:
|
|
1475
|
-
pid:
|
|
1476
|
-
host:
|
|
1627
|
+
runId: z4.string().min(1),
|
|
1628
|
+
pid: z4.number().int().positive(),
|
|
1629
|
+
host: z4.string().min(1),
|
|
1477
1630
|
startedAt: isoTimestamp,
|
|
1478
|
-
childStartedAt:
|
|
1479
|
-
childCommand:
|
|
1631
|
+
childStartedAt: z4.string().min(1).nullable().optional(),
|
|
1632
|
+
childCommand: z4.string().min(1).nullable().optional()
|
|
1480
1633
|
}).strict();
|
|
1481
|
-
var InputRecordSchema =
|
|
1482
|
-
version:
|
|
1483
|
-
kind:
|
|
1634
|
+
var InputRecordSchema = z4.object({
|
|
1635
|
+
version: z4.literal(1),
|
|
1636
|
+
kind: z4.literal("input"),
|
|
1484
1637
|
task: taskId,
|
|
1485
|
-
runId:
|
|
1486
|
-
source:
|
|
1487
|
-
pr:
|
|
1488
|
-
round:
|
|
1638
|
+
runId: z4.string().min(1),
|
|
1639
|
+
source: z4.union([z4.literal("fresh"), z4.literal("resume")]),
|
|
1640
|
+
pr: z4.number().int().positive().nullable(),
|
|
1641
|
+
round: z4.number().int().nonnegative(),
|
|
1489
1642
|
recordedAt: isoTimestamp
|
|
1490
1643
|
}).strict();
|
|
1491
|
-
var OwnershipRecordSchema =
|
|
1492
|
-
version:
|
|
1493
|
-
kind:
|
|
1644
|
+
var OwnershipRecordSchema = z4.object({
|
|
1645
|
+
version: z4.literal(1),
|
|
1646
|
+
kind: z4.literal("ownership"),
|
|
1494
1647
|
task: taskId,
|
|
1495
1648
|
epoch: epochNumber,
|
|
1496
|
-
ownerId:
|
|
1497
|
-
pid:
|
|
1498
|
-
host:
|
|
1649
|
+
ownerId: z4.string().min(1),
|
|
1650
|
+
pid: z4.number().int().positive(),
|
|
1651
|
+
host: z4.string().min(1),
|
|
1499
1652
|
acquiredAt: isoTimestamp
|
|
1500
1653
|
}).strict();
|
|
1501
|
-
var TransitionRecordSchema =
|
|
1502
|
-
version:
|
|
1503
|
-
kind:
|
|
1654
|
+
var TransitionRecordSchema = z4.object({
|
|
1655
|
+
version: z4.literal(1),
|
|
1656
|
+
kind: z4.literal("transition"),
|
|
1504
1657
|
task: taskId,
|
|
1505
1658
|
epoch: epochNumber,
|
|
1506
|
-
seq:
|
|
1507
|
-
from:
|
|
1508
|
-
to:
|
|
1509
|
-
detail:
|
|
1659
|
+
seq: z4.number().int().nonnegative(),
|
|
1660
|
+
from: z4.string().min(1),
|
|
1661
|
+
to: z4.string().min(1),
|
|
1662
|
+
detail: z4.string().optional(),
|
|
1510
1663
|
at: isoTimestamp
|
|
1511
1664
|
}).strict();
|
|
1512
|
-
var ManifestRecordSchema =
|
|
1513
|
-
version:
|
|
1514
|
-
kind:
|
|
1665
|
+
var ManifestRecordSchema = z4.object({
|
|
1666
|
+
version: z4.literal(1),
|
|
1667
|
+
kind: z4.literal("manifest"),
|
|
1515
1668
|
task: taskId,
|
|
1516
1669
|
round: epochNumber,
|
|
1517
|
-
repository:
|
|
1518
|
-
pr:
|
|
1519
|
-
branch:
|
|
1520
|
-
baseSha:
|
|
1521
|
-
headSha:
|
|
1522
|
-
briefHash:
|
|
1523
|
-
objectivesVersion:
|
|
1670
|
+
repository: z4.string().min(1),
|
|
1671
|
+
pr: z4.number().int().positive(),
|
|
1672
|
+
branch: z4.string().min(1),
|
|
1673
|
+
baseSha: z4.string().min(1).nullable(),
|
|
1674
|
+
headSha: z4.string().min(1),
|
|
1675
|
+
briefHash: z4.string().min(1).nullable(),
|
|
1676
|
+
objectivesVersion: z4.string().min(1).nullable(),
|
|
1524
1677
|
rulingOrdinal: epochNumber,
|
|
1525
|
-
policyDigest:
|
|
1678
|
+
policyDigest: z4.string().min(1),
|
|
1526
1679
|
recordedAt: isoTimestamp
|
|
1527
1680
|
}).strict();
|
|
1528
|
-
var roundHeadIdentity =
|
|
1529
|
-
var LoopBudgetsSchema =
|
|
1530
|
-
mechanicalRetries:
|
|
1531
|
-
reviewRounds:
|
|
1532
|
-
infrastructureRetries:
|
|
1681
|
+
var roundHeadIdentity = z4.object({ round: z4.number().int().positive(), head: z4.string().min(1) }).strict();
|
|
1682
|
+
var LoopBudgetsSchema = z4.object({
|
|
1683
|
+
mechanicalRetries: z4.number().int().nonnegative(),
|
|
1684
|
+
reviewRounds: z4.number().int().nonnegative(),
|
|
1685
|
+
infrastructureRetries: z4.number().int().nonnegative()
|
|
1533
1686
|
}).strict();
|
|
1534
|
-
var LoopStateRecordSchema =
|
|
1535
|
-
version:
|
|
1536
|
-
kind:
|
|
1687
|
+
var LoopStateRecordSchema = z4.object({
|
|
1688
|
+
version: z4.literal(1),
|
|
1689
|
+
kind: z4.literal("loop_state"),
|
|
1537
1690
|
task: taskId,
|
|
1538
|
-
round:
|
|
1539
|
-
phase:
|
|
1540
|
-
pauseReason:
|
|
1691
|
+
round: z4.number().int().positive(),
|
|
1692
|
+
phase: z4.string().min(1),
|
|
1693
|
+
pauseReason: z4.string().min(1).nullable(),
|
|
1541
1694
|
budgets: LoopBudgetsSchema,
|
|
1542
1695
|
heldResult: roundHeadIdentity.nullable(),
|
|
1543
1696
|
deliveredFindings: roundHeadIdentity.nullable(),
|
|
1544
|
-
repeatMemory:
|
|
1545
|
-
blockingFindings:
|
|
1546
|
-
lastFailure:
|
|
1697
|
+
repeatMemory: z4.object({
|
|
1698
|
+
blockingFindings: z4.array(z4.string()),
|
|
1699
|
+
lastFailure: z4.object({ signature: z4.string(), message: z4.string() }).nullable()
|
|
1547
1700
|
}).strict().optional(),
|
|
1701
|
+
publicationExpectedBase: z4.string().regex(/^[0-9a-f]{40}$/).nullable().optional(),
|
|
1702
|
+
taskStartedAt: isoTimestamp.optional(),
|
|
1703
|
+
phaseMs: z4.record(z4.string(), z4.number().nonnegative()).optional(),
|
|
1548
1704
|
recordedAt: isoTimestamp
|
|
1549
1705
|
}).strict();
|
|
1550
|
-
var EffectRecordSchema =
|
|
1551
|
-
version:
|
|
1552
|
-
kind:
|
|
1706
|
+
var EffectRecordSchema = z4.object({
|
|
1707
|
+
version: z4.literal(1),
|
|
1708
|
+
kind: z4.literal("effect"),
|
|
1553
1709
|
task: taskId,
|
|
1554
|
-
key:
|
|
1555
|
-
operation:
|
|
1556
|
-
target:
|
|
1557
|
-
inputVersion:
|
|
1558
|
-
payloadDigest:
|
|
1559
|
-
status:
|
|
1560
|
-
url:
|
|
1710
|
+
key: z4.string().min(1),
|
|
1711
|
+
operation: z4.string().min(1),
|
|
1712
|
+
target: z4.string().min(1),
|
|
1713
|
+
inputVersion: z4.number().int().nonnegative(),
|
|
1714
|
+
payloadDigest: z4.string().min(1),
|
|
1715
|
+
status: z4.union([z4.literal("started"), z4.literal("verified"), z4.literal("uncertain")]),
|
|
1716
|
+
url: z4.string().optional(),
|
|
1561
1717
|
recordedAt: isoTimestamp
|
|
1562
1718
|
}).strict();
|
|
1563
|
-
var EscalationRecordSchema =
|
|
1564
|
-
version:
|
|
1565
|
-
kind:
|
|
1719
|
+
var EscalationRecordSchema = z4.object({
|
|
1720
|
+
version: z4.literal(1),
|
|
1721
|
+
kind: z4.literal("escalation"),
|
|
1566
1722
|
task: taskId,
|
|
1567
|
-
escalationId:
|
|
1723
|
+
escalationId: z4.string().min(1),
|
|
1568
1724
|
round: epochNumber,
|
|
1569
|
-
head:
|
|
1570
|
-
branch:
|
|
1571
|
-
pr:
|
|
1572
|
-
runId:
|
|
1573
|
-
pid:
|
|
1574
|
-
host:
|
|
1575
|
-
agent:
|
|
1576
|
-
reason:
|
|
1577
|
-
detail:
|
|
1578
|
-
evidence:
|
|
1579
|
-
attemptedRecovery:
|
|
1580
|
-
requestedDecision:
|
|
1581
|
-
recipient:
|
|
1582
|
-
briefHash:
|
|
1583
|
-
objectivesVersion:
|
|
1725
|
+
head: z4.string().min(1),
|
|
1726
|
+
branch: z4.string().min(1),
|
|
1727
|
+
pr: z4.number().int().positive().nullable(),
|
|
1728
|
+
runId: z4.string().min(1),
|
|
1729
|
+
pid: z4.number().int().positive(),
|
|
1730
|
+
host: z4.string().min(1),
|
|
1731
|
+
agent: z4.string().min(1).optional(),
|
|
1732
|
+
reason: z4.string().min(1),
|
|
1733
|
+
detail: z4.string().optional(),
|
|
1734
|
+
evidence: z4.string().optional(),
|
|
1735
|
+
attemptedRecovery: z4.string().min(1),
|
|
1736
|
+
requestedDecision: z4.string().min(1),
|
|
1737
|
+
recipient: z4.string().min(1),
|
|
1738
|
+
briefHash: z4.string().min(1).nullable(),
|
|
1739
|
+
objectivesVersion: z4.string().min(1).nullable(),
|
|
1584
1740
|
rulingOrdinal: epochNumber,
|
|
1585
|
-
policyDigest:
|
|
1741
|
+
policyDigest: z4.string().min(1),
|
|
1586
1742
|
recordedAt: isoTimestamp
|
|
1587
1743
|
}).strict();
|
|
1588
|
-
var ResolutionRecordSchema =
|
|
1589
|
-
version:
|
|
1590
|
-
kind:
|
|
1744
|
+
var ResolutionRecordSchema = z4.object({
|
|
1745
|
+
version: z4.literal(1),
|
|
1746
|
+
kind: z4.literal("resolution"),
|
|
1591
1747
|
task: taskId,
|
|
1592
|
-
escalationId:
|
|
1593
|
-
decision:
|
|
1594
|
-
authenticatedBy:
|
|
1595
|
-
authenticatedFrom:
|
|
1748
|
+
escalationId: z4.string().min(1),
|
|
1749
|
+
decision: z4.union([z4.literal("resume"), z4.literal("cancel")]),
|
|
1750
|
+
authenticatedBy: z4.string().min(1),
|
|
1751
|
+
authenticatedFrom: z4.string().min(1),
|
|
1596
1752
|
consumedAt: isoTimestamp
|
|
1597
1753
|
}).strict();
|
|
1598
1754
|
// ../../packages/aeg-core/src/control-store/local.ts
|
|
@@ -1674,46 +1830,24 @@ var CONTROL_AREA_DIRNAME = "control";
|
|
|
1674
1830
|
// src/lib/agent-vendors.ts
|
|
1675
1831
|
var AGENT_VENDORS = ["skills", "claude", "gemini"];
|
|
1676
1832
|
|
|
1677
|
-
// src/lib/worker-boundary.ts
|
|
1678
|
-
import { execFileSync as execFileSync2 } from "node:child_process";
|
|
1679
|
-
var LOG_HEADER_KEYCHAIN_SERVICE = "Vinaya Log";
|
|
1680
|
-
var logHeaderKeychainCache = new Map;
|
|
1681
|
-
function readRealLogHeaderKeychainCredential(variable) {
|
|
1682
|
-
if (process.platform !== "darwin")
|
|
1683
|
-
return null;
|
|
1684
|
-
try {
|
|
1685
|
-
return execFileSync2("/usr/bin/security", ["find-generic-password", "-s", LOG_HEADER_KEYCHAIN_SERVICE, "-a", variable, "-w"], { encoding: "utf8", stdio: ["ignore", "pipe", "ignore"], timeout: 5000, maxBuffer: 1024 * 1024 }).replace(/\n$/, "");
|
|
1686
|
-
} catch {
|
|
1687
|
-
return null;
|
|
1688
|
-
}
|
|
1689
|
-
}
|
|
1690
|
-
function readLogHeaderKeychainCredential(variable) {
|
|
1691
|
-
const cached = logHeaderKeychainCache.get(variable);
|
|
1692
|
-
if (cached !== undefined)
|
|
1693
|
-
return cached;
|
|
1694
|
-
const value = readRealLogHeaderKeychainCredential(variable);
|
|
1695
|
-
logHeaderKeychainCache.set(variable, value);
|
|
1696
|
-
return value;
|
|
1697
|
-
}
|
|
1698
|
-
|
|
1699
1833
|
// src/lib/config.ts
|
|
1700
|
-
var EnvEntrySchema =
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1834
|
+
var EnvEntrySchema = z5.union([
|
|
1835
|
+
z5.literal(true),
|
|
1836
|
+
z5.object({ optional: z5.literal(true) }),
|
|
1837
|
+
z5.object({ anyOf: z5.array(z5.string()).min(2) }),
|
|
1838
|
+
z5.string()
|
|
1705
1839
|
]);
|
|
1706
|
-
var CheckEntrySchema =
|
|
1707
|
-
run:
|
|
1708
|
-
scope:
|
|
1709
|
-
include:
|
|
1710
|
-
args:
|
|
1711
|
-
timeoutMs:
|
|
1712
|
-
env:
|
|
1713
|
-
requiresOpenPr:
|
|
1714
|
-
ownWorkflow:
|
|
1715
|
-
principalOwed:
|
|
1716
|
-
validates:
|
|
1840
|
+
var CheckEntrySchema = z5.object({
|
|
1841
|
+
run: z5.string(),
|
|
1842
|
+
scope: z5.enum(["diff", "full"]),
|
|
1843
|
+
include: z5.array(z5.string()).optional(),
|
|
1844
|
+
args: z5.array(z5.string()).optional(),
|
|
1845
|
+
timeoutMs: z5.number().optional(),
|
|
1846
|
+
env: z5.record(z5.string(), EnvEntrySchema).optional(),
|
|
1847
|
+
requiresOpenPr: z5.boolean().optional(),
|
|
1848
|
+
ownWorkflow: z5.boolean().optional(),
|
|
1849
|
+
principalOwed: z5.literal(true).optional(),
|
|
1850
|
+
validates: z5.enum(["body", "issue"]).optional()
|
|
1717
1851
|
}).superRefine((entry, ctx) => {
|
|
1718
1852
|
if (!entry.env)
|
|
1719
1853
|
return;
|
|
@@ -1723,22 +1857,22 @@ var CheckEntrySchema = z4.object({
|
|
|
1723
1857
|
const members = value.anyOf;
|
|
1724
1858
|
if (new Set(members).size !== members.length) {
|
|
1725
1859
|
ctx.addIssue({
|
|
1726
|
-
code:
|
|
1860
|
+
code: z5.ZodIssueCode.custom,
|
|
1727
1861
|
message: `env.${key}.anyOf has duplicate members`,
|
|
1728
1862
|
path: ["env", key, "anyOf"]
|
|
1729
1863
|
});
|
|
1730
1864
|
}
|
|
1731
1865
|
if (!members.includes(key)) {
|
|
1732
1866
|
ctx.addIssue({
|
|
1733
|
-
code:
|
|
1867
|
+
code: z5.ZodIssueCode.custom,
|
|
1734
1868
|
message: `env.${key}.anyOf must include "${key}" itself as a member`,
|
|
1735
1869
|
path: ["env", key, "anyOf"]
|
|
1736
1870
|
});
|
|
1737
1871
|
}
|
|
1738
1872
|
}
|
|
1739
1873
|
});
|
|
1740
|
-
var RoleEntrySchema =
|
|
1741
|
-
contract:
|
|
1874
|
+
var RoleEntrySchema = z5.object({
|
|
1875
|
+
contract: z5.string().refine((p) => p.includes("/"), {
|
|
1742
1876
|
message: 'must be a path (contain at least one "/"), not a bare filename'
|
|
1743
1877
|
})
|
|
1744
1878
|
});
|
|
@@ -1762,17 +1896,17 @@ var BRIEF_BUILTINS = [
|
|
|
1762
1896
|
"briefSections",
|
|
1763
1897
|
"milestoneShape"
|
|
1764
1898
|
];
|
|
1765
|
-
var BriefSectionSchema =
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1899
|
+
var BriefSectionSchema = z5.union([
|
|
1900
|
+
z5.object({ builtin: z5.enum(BRIEF_BUILTINS) }),
|
|
1901
|
+
z5.object({ heading: z5.string().min(1), name: z5.string().optional() }),
|
|
1902
|
+
z5.object({ field: z5.string().min(1), name: z5.string().optional() }),
|
|
1903
|
+
z5.object({ phrase: z5.string().min(1), name: z5.string().optional() })
|
|
1770
1904
|
]);
|
|
1771
|
-
var BriefSchemaSchema =
|
|
1772
|
-
pr:
|
|
1773
|
-
issue:
|
|
1774
|
-
milestone:
|
|
1775
|
-
ack:
|
|
1905
|
+
var BriefSchemaSchema = z5.object({
|
|
1906
|
+
pr: z5.object({ sections: z5.array(BriefSectionSchema) }).optional(),
|
|
1907
|
+
issue: z5.object({ sections: z5.array(BriefSectionSchema) }).optional(),
|
|
1908
|
+
milestone: z5.object({ sections: z5.array(BriefSectionSchema) }).optional(),
|
|
1909
|
+
ack: z5.array(z5.enum(BRIEF_BUILTINS)).optional()
|
|
1776
1910
|
});
|
|
1777
1911
|
function isSafeRepoRelPath(p) {
|
|
1778
1912
|
if (p.length === 0)
|
|
@@ -1781,7 +1915,7 @@ function isSafeRepoRelPath(p) {
|
|
|
1781
1915
|
return false;
|
|
1782
1916
|
return p.split(/[\\/]/).every((seg) => seg !== ".." && seg !== "");
|
|
1783
1917
|
}
|
|
1784
|
-
var SafeRepoRelPath =
|
|
1918
|
+
var SafeRepoRelPath = z5.string().refine(isSafeRepoRelPath, {
|
|
1785
1919
|
message: "must be a repo-root-relative path with no `..` segment or absolute root"
|
|
1786
1920
|
});
|
|
1787
1921
|
var CANONICAL_HOOK_BLOCK_PREFIXES = [".git/", ".husky/", ".vinaya/hooks/", ".claude/hooks/"];
|
|
@@ -1791,22 +1925,22 @@ function isCanonicalHookBlockPath(p) {
|
|
|
1791
1925
|
var ManagedHookBlockPath = SafeRepoRelPath.refine(isCanonicalHookBlockPath, {
|
|
1792
1926
|
message: `must start with one of ${CANONICAL_HOOK_BLOCK_PREFIXES.join(", ")} (byte-exact, case-sensitive)`
|
|
1793
1927
|
});
|
|
1794
|
-
var ManagedBlockRecordSchema =
|
|
1928
|
+
var ManagedBlockRecordSchema = z5.object({
|
|
1795
1929
|
path: ManagedHookBlockPath,
|
|
1796
|
-
marker:
|
|
1797
|
-
comment:
|
|
1930
|
+
marker: z5.string(),
|
|
1931
|
+
comment: z5.enum(["hash", "html"])
|
|
1798
1932
|
});
|
|
1799
|
-
var ManagedManifestSchema =
|
|
1800
|
-
version:
|
|
1801
|
-
files:
|
|
1802
|
-
blocks:
|
|
1803
|
-
labels:
|
|
1804
|
-
agents:
|
|
1933
|
+
var ManagedManifestSchema = z5.object({
|
|
1934
|
+
version: z5.number().int().positive(),
|
|
1935
|
+
files: z5.array(SafeRepoRelPath),
|
|
1936
|
+
blocks: z5.array(ManagedBlockRecordSchema),
|
|
1937
|
+
labels: z5.array(z5.string()),
|
|
1938
|
+
agents: z5.array(z5.enum(AGENT_VENDORS)).optional()
|
|
1805
1939
|
});
|
|
1806
|
-
var ProjectEntrySchema =
|
|
1807
|
-
name:
|
|
1808
|
-
description:
|
|
1809
|
-
path:
|
|
1940
|
+
var ProjectEntrySchema = z5.object({
|
|
1941
|
+
name: z5.string().min(1),
|
|
1942
|
+
description: z5.string().min(1).optional(),
|
|
1943
|
+
path: z5.string().min(1).optional()
|
|
1810
1944
|
});
|
|
1811
1945
|
function parseTokensCollectDeclaration(value) {
|
|
1812
1946
|
const m = value.trim().match(/^(\S+)\s+(\S+)$/);
|
|
@@ -1817,90 +1951,97 @@ function parseTokensCollectDeclaration(value) {
|
|
|
1817
1951
|
return null;
|
|
1818
1952
|
return { interpreter, script };
|
|
1819
1953
|
}
|
|
1820
|
-
var VinayaConfigSchema =
|
|
1821
|
-
rings:
|
|
1822
|
-
ring1_forgeWriteInterception:
|
|
1823
|
-
ring2_asyncAudits:
|
|
1954
|
+
var VinayaConfigSchema = z5.object({
|
|
1955
|
+
rings: z5.object({
|
|
1956
|
+
ring1_forgeWriteInterception: z5.boolean(),
|
|
1957
|
+
ring2_asyncAudits: z5.boolean()
|
|
1824
1958
|
}).optional(),
|
|
1825
|
-
checks:
|
|
1826
|
-
roles:
|
|
1959
|
+
checks: z5.record(z5.string(), CheckEntrySchema).optional(),
|
|
1960
|
+
roles: z5.record(z5.string(), RoleEntrySchema).optional(),
|
|
1827
1961
|
briefSchema: BriefSchemaSchema.optional(),
|
|
1828
1962
|
managed: ManagedManifestSchema.optional(),
|
|
1829
|
-
principals:
|
|
1830
|
-
releaseActor:
|
|
1831
|
-
ci:
|
|
1832
|
-
tokens:
|
|
1833
|
-
collect:
|
|
1963
|
+
principals: z5.array(z5.string()).min(1).optional(),
|
|
1964
|
+
releaseActor: z5.string().min(1).optional(),
|
|
1965
|
+
ci: z5.object({ setup: z5.string().min(1) }).optional(),
|
|
1966
|
+
tokens: z5.object({
|
|
1967
|
+
collect: z5.string().min(1).refine((v) => parseTokensCollectDeclaration(v) !== null, {
|
|
1834
1968
|
message: 'tokens.collect must be exactly "<interpreter> <repo-relative-script-path>" — two whitespace-separated tokens, no flags, no shell syntax, no quoting'
|
|
1835
1969
|
})
|
|
1836
1970
|
}).optional(),
|
|
1837
|
-
blastRadius:
|
|
1838
|
-
proseGates:
|
|
1839
|
-
doctrineRoot:
|
|
1840
|
-
readerFacingPrefix:
|
|
1841
|
-
readerFacingSuffix:
|
|
1842
|
-
legacySlugDir:
|
|
1843
|
-
sourceComments:
|
|
1844
|
-
globs:
|
|
1845
|
-
allowlist:
|
|
1846
|
-
severity:
|
|
1971
|
+
blastRadius: z5.object({ extraDomains: z5.array(z5.string()).optional() }).optional(),
|
|
1972
|
+
proseGates: z5.object({
|
|
1973
|
+
doctrineRoot: z5.string().min(1).optional(),
|
|
1974
|
+
readerFacingPrefix: z5.string().min(1).optional(),
|
|
1975
|
+
readerFacingSuffix: z5.string().min(1).optional(),
|
|
1976
|
+
legacySlugDir: z5.string().min(1).optional(),
|
|
1977
|
+
sourceComments: z5.object({
|
|
1978
|
+
globs: z5.array(z5.string().min(1)).optional(),
|
|
1979
|
+
allowlist: z5.array(z5.string().min(1)).optional(),
|
|
1980
|
+
severity: z5.enum(["warning", "error"]).optional()
|
|
1847
1981
|
}).optional(),
|
|
1848
|
-
specGrandfather:
|
|
1849
|
-
specPaths:
|
|
1982
|
+
specGrandfather: z5.union([z5.array(z5.string().min(1)), z5.record(z5.string().min(1), z5.number().int().min(0))]).optional(),
|
|
1983
|
+
specPaths: z5.array(z5.string().min(1).refine((entry) => !entry.startsWith("/") && !/^[A-Za-z]:/.test(entry), {
|
|
1850
1984
|
message: "must be a repository-relative path, not an absolute one"
|
|
1851
1985
|
}).refine((entry) => !entry.split(/[\\/]/).includes(".."), {
|
|
1852
1986
|
message: "must stay inside the repository — no `..` segment"
|
|
1853
1987
|
})).optional()
|
|
1854
1988
|
}).optional(),
|
|
1855
|
-
projects:
|
|
1856
|
-
dispatch:
|
|
1857
|
-
timeoutMs:
|
|
1858
|
-
killGraceMs:
|
|
1859
|
-
agent:
|
|
1860
|
-
|
|
1989
|
+
projects: z5.array(ProjectEntrySchema).optional(),
|
|
1990
|
+
dispatch: z5.object({
|
|
1991
|
+
timeoutMs: z5.number().int().positive().optional(),
|
|
1992
|
+
killGraceMs: z5.number().int().positive().optional(),
|
|
1993
|
+
agent: z5.enum(["claude", "codex", "gemini"]).optional()
|
|
1994
|
+
}).optional(),
|
|
1995
|
+
reviewPolicy: z5.object({
|
|
1996
|
+
codeReviewThreshold: z5.string().min(1).optional(),
|
|
1997
|
+
securityThreshold: z5.string().min(1).optional(),
|
|
1998
|
+
maxRounds: z5.number().optional(),
|
|
1999
|
+
maxTaskMinutes: z5.number().optional()
|
|
1861
2000
|
}).optional(),
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
securityThreshold: z4.string().min(1).optional(),
|
|
1865
|
-
maxRounds: z4.number().optional()
|
|
2001
|
+
securityScan: z5.object({
|
|
2002
|
+
command: z5.array(z5.string().min(1)).min(1)
|
|
1866
2003
|
}).optional(),
|
|
1867
|
-
gateCutovers:
|
|
1868
|
-
objectivesSinceIssue:
|
|
1869
|
-
briefSectionsSinceIssue:
|
|
1870
|
-
documentationSinceIssue:
|
|
1871
|
-
briefRulesSincePr:
|
|
1872
|
-
agentBoxesRefusedSincePr:
|
|
2004
|
+
gateCutovers: z5.object({
|
|
2005
|
+
objectivesSinceIssue: z5.number().int().nonnegative().optional(),
|
|
2006
|
+
briefSectionsSinceIssue: z5.number().int().nonnegative().optional(),
|
|
2007
|
+
documentationSinceIssue: z5.number().int().nonnegative().optional(),
|
|
2008
|
+
briefRulesSincePr: z5.number().int().nonnegative().optional(),
|
|
2009
|
+
agentBoxesRefusedSincePr: z5.number().int().nonnegative().optional()
|
|
1873
2010
|
}).optional(),
|
|
1874
|
-
planning:
|
|
1875
|
-
collisionThreshold:
|
|
2011
|
+
planning: z5.object({
|
|
2012
|
+
collisionThreshold: z5.number().int().nonnegative().optional()
|
|
1876
2013
|
}).optional(),
|
|
1877
|
-
prePush:
|
|
1878
|
-
alwaysRun:
|
|
2014
|
+
prePush: z5.object({
|
|
2015
|
+
alwaysRun: z5.array(z5.string()).optional()
|
|
1879
2016
|
}).optional(),
|
|
1880
|
-
report:
|
|
1881
|
-
commandTimeoutMs:
|
|
2017
|
+
report: z5.object({
|
|
2018
|
+
commandTimeoutMs: z5.number().int().positive().optional()
|
|
1882
2019
|
}).superRefine((report, ctx) => {
|
|
1883
2020
|
const commandTimeoutMs = report.commandTimeoutMs;
|
|
1884
2021
|
if (commandTimeoutMs !== undefined && commandTimeoutMs > MAX_REPORT_COMMAND_TIMEOUT_MS) {
|
|
1885
2022
|
ctx.addIssue({
|
|
1886
|
-
code:
|
|
2023
|
+
code: z5.ZodIssueCode.custom,
|
|
1887
2024
|
path: ["commandTimeoutMs"],
|
|
1888
2025
|
message: "must be at most 3600000 (1 hour)"
|
|
1889
2026
|
});
|
|
1890
2027
|
}
|
|
1891
2028
|
}).optional(),
|
|
1892
|
-
logPublish:
|
|
2029
|
+
logPublish: z5.unknown().refine((v) => v === undefined, {
|
|
1893
2030
|
message: "logPublish is removed — telemetry is never posted to a tracker or a code host; configure `logs` instead (a folder or a server destination)"
|
|
1894
2031
|
}),
|
|
1895
|
-
runtimeDir:
|
|
1896
|
-
logs:
|
|
1897
|
-
folder:
|
|
1898
|
-
url:
|
|
1899
|
-
headers:
|
|
2032
|
+
runtimeDir: z5.string().min(1).refine((v) => isAbsolute(v), { message: "runtimeDir: must be an absolute path" }).optional(),
|
|
2033
|
+
logs: z5.object({
|
|
2034
|
+
folder: z5.string().min(1).refine((v) => isAbsolute(v), { message: "logs.folder: must be an absolute path" }).optional(),
|
|
2035
|
+
url: z5.string().url().optional(),
|
|
2036
|
+
headers: z5.record(z5.string()).optional(),
|
|
2037
|
+
readHeaders: z5.record(z5.string()).optional(),
|
|
2038
|
+
events: CustomEventDeclarationsSchema.optional()
|
|
1900
2039
|
}).refine((v) => [v.folder, v.url].filter((x) => x !== undefined).length <= 1, {
|
|
1901
2040
|
message: "logs: set at most one of folder/url"
|
|
1902
2041
|
}).refine((v) => v.headers === undefined || v.url !== undefined, {
|
|
1903
2042
|
message: "logs: headers requires url"
|
|
2043
|
+
}).refine((v) => v.readHeaders === undefined || v.url !== undefined, {
|
|
2044
|
+
message: "logs: readHeaders requires url"
|
|
1904
2045
|
}).optional()
|
|
1905
2046
|
});
|
|
1906
2047
|
var GLOBAL_VINAYA_HOME = join2(homedir(), ".vinaya");
|
|
@@ -2008,17 +2149,12 @@ function resolveTrustAnchorLogsDestination(local, trustAnchorConfig) {
|
|
|
2008
2149
|
return "url" in anchored && anchored.url === local.url ? anchored : null;
|
|
2009
2150
|
return "folder" in anchored && anchored.folder === local.folder ? anchored : null;
|
|
2010
2151
|
}
|
|
2011
|
-
function resolveLogsHeaderValues(headers, env
|
|
2152
|
+
function resolveLogsHeaderValues(headers, env) {
|
|
2012
2153
|
if (!headers)
|
|
2013
2154
|
return;
|
|
2014
2155
|
const resolved = {};
|
|
2015
2156
|
for (const [key, value] of Object.entries(headers)) {
|
|
2016
|
-
resolved[key] = value.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g, (_match, name) =>
|
|
2017
|
-
const fromEnv = env[name];
|
|
2018
|
-
if (fromEnv !== undefined)
|
|
2019
|
-
return fromEnv;
|
|
2020
|
-
return readKeychain(name) ?? "";
|
|
2021
|
-
});
|
|
2157
|
+
resolved[key] = value.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g, (_match, name) => env[name] ?? "");
|
|
2022
2158
|
}
|
|
2023
2159
|
return resolved;
|
|
2024
2160
|
}
|
|
@@ -2027,7 +2163,7 @@ function trustAnchorRepo() {
|
|
|
2027
2163
|
if (fromRunner)
|
|
2028
2164
|
return fromRunner;
|
|
2029
2165
|
try {
|
|
2030
|
-
const url =
|
|
2166
|
+
const url = execFileSync2("git", ["remote", "get-url", "origin"], {
|
|
2031
2167
|
encoding: "utf-8",
|
|
2032
2168
|
stdio: ["ignore", "pipe", "pipe"]
|
|
2033
2169
|
});
|
|
@@ -2074,7 +2210,7 @@ function resolveCiTrustAnchorProbeRef(env = process.env) {
|
|
|
2074
2210
|
return ref;
|
|
2075
2211
|
}
|
|
2076
2212
|
function readTrustAnchorConfigAtRef(ref) {
|
|
2077
|
-
const raw =
|
|
2213
|
+
const raw = execFileSync2("git", ["show", `${ref}:${LOCAL_CONFIG_FILENAME}`], {
|
|
2078
2214
|
encoding: "utf-8",
|
|
2079
2215
|
stdio: ["ignore", "pipe", "pipe"],
|
|
2080
2216
|
timeout: 1e4
|
|
@@ -2088,7 +2224,7 @@ function ghFetchTrustAnchorConfig() {
|
|
|
2088
2224
|
const repo = trustAnchorRepo();
|
|
2089
2225
|
if (!repo)
|
|
2090
2226
|
throw new Error("could not resolve repo identity for the trust-anchor read");
|
|
2091
|
-
return
|
|
2227
|
+
return execFileSync2("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], {
|
|
2092
2228
|
encoding: "utf-8",
|
|
2093
2229
|
stdio: ["ignore", "pipe", "pipe"]
|
|
2094
2230
|
});
|
|
@@ -2179,7 +2315,7 @@ function loadConfig() {
|
|
|
2179
2315
|
var TOKENS_COLLECT_TRUST_PATH = join2(GLOBAL_VINAYA_HOME, "tokens-collect-trust.json");
|
|
2180
2316
|
|
|
2181
2317
|
// src/lib/remote-base.ts
|
|
2182
|
-
import { execFileSync as
|
|
2318
|
+
import { execFileSync as execFileSync3 } from "node:child_process";
|
|
2183
2319
|
import { join as join3 } from "node:path";
|
|
2184
2320
|
function cleanGitEnv() {
|
|
2185
2321
|
const env = { ...process.env };
|
|
@@ -2191,7 +2327,7 @@ function cleanGitEnv() {
|
|
|
2191
2327
|
}
|
|
2192
2328
|
function git(repoRoot, args) {
|
|
2193
2329
|
try {
|
|
2194
|
-
return
|
|
2330
|
+
return execFileSync3("git", args, {
|
|
2195
2331
|
cwd: repoRoot,
|
|
2196
2332
|
encoding: "utf8",
|
|
2197
2333
|
stdio: ["ignore", "pipe", "ignore"],
|
|
@@ -2210,29 +2346,34 @@ function resolveRemoteBase(repoRoot) {
|
|
|
2210
2346
|
return "origin/main";
|
|
2211
2347
|
return "HEAD~1";
|
|
2212
2348
|
}
|
|
2213
|
-
function changedFilesSinceRemoteBase(repoRoot) {
|
|
2214
|
-
const base = resolveRemoteBase(repoRoot);
|
|
2349
|
+
function changedFilesSinceRemoteBase(repoRoot, base = resolveRemoteBase(repoRoot)) {
|
|
2215
2350
|
const out = git(repoRoot, ["diff", "--name-only", "--diff-filter=ACMR", `${base}...HEAD`]);
|
|
2216
2351
|
return out.split(`
|
|
2217
2352
|
`).map((s) => s.trim()).filter(Boolean);
|
|
2218
2353
|
}
|
|
2219
|
-
function changedFilesSinceRemoteBaseAbsolute(repoRoot) {
|
|
2220
|
-
return changedFilesSinceRemoteBase(repoRoot).map((f) => join3(repoRoot, f));
|
|
2354
|
+
function changedFilesSinceRemoteBaseAbsolute(repoRoot, base = resolveRemoteBase(repoRoot)) {
|
|
2355
|
+
return changedFilesSinceRemoteBase(repoRoot, base).map((f) => join3(repoRoot, f));
|
|
2221
2356
|
}
|
|
2222
|
-
function addedOrRenamedFilesSinceRemoteBase(repoRoot) {
|
|
2223
|
-
const base = resolveRemoteBase(repoRoot);
|
|
2357
|
+
function addedOrRenamedFilesSinceRemoteBase(repoRoot, base = resolveRemoteBase(repoRoot)) {
|
|
2224
2358
|
const out = git(repoRoot, ["diff", "--name-only", "--diff-filter=AR", `${base}...HEAD`]);
|
|
2225
2359
|
return out.split(`
|
|
2226
2360
|
`).map((s) => s.trim()).filter(Boolean);
|
|
2227
2361
|
}
|
|
2228
|
-
function addedOrRenamedFilesSinceRemoteBaseAbsolute(repoRoot) {
|
|
2229
|
-
return addedOrRenamedFilesSinceRemoteBase(repoRoot).map((f) => join3(repoRoot, f));
|
|
2362
|
+
function addedOrRenamedFilesSinceRemoteBaseAbsolute(repoRoot, base = resolveRemoteBase(repoRoot)) {
|
|
2363
|
+
return addedOrRenamedFilesSinceRemoteBase(repoRoot, base).map((f) => join3(repoRoot, f));
|
|
2230
2364
|
}
|
|
2231
|
-
function
|
|
2232
|
-
const
|
|
2365
|
+
function removedFilesSinceRemoteBase(repoRoot, base = resolveRemoteBase(repoRoot)) {
|
|
2366
|
+
const out = git(repoRoot, ["diff", "--name-status", "--diff-filter=DR", `${base}...HEAD`]);
|
|
2367
|
+
return out.split(`
|
|
2368
|
+
`).map((line) => line.split("\t")).filter((fields) => fields.length >= 2).map((fields) => fields[1].trim()).filter(Boolean);
|
|
2369
|
+
}
|
|
2370
|
+
function removedFilesSinceRemoteBaseAbsolute(repoRoot, base = resolveRemoteBase(repoRoot)) {
|
|
2371
|
+
return removedFilesSinceRemoteBase(repoRoot, base).map((f) => join3(repoRoot, f));
|
|
2372
|
+
}
|
|
2373
|
+
function changedFileDiffsSinceRemoteBase(repoRoot, base = resolveRemoteBase(repoRoot)) {
|
|
2233
2374
|
const mergeBase = git(repoRoot, ["merge-base", base, "HEAD"]) || base;
|
|
2234
2375
|
const out = [];
|
|
2235
|
-
for (const relative of changedFilesSinceRemoteBase(repoRoot)) {
|
|
2376
|
+
for (const relative of changedFilesSinceRemoteBase(repoRoot, base)) {
|
|
2236
2377
|
const patch = git(repoRoot, ["diff", "-U0", `${mergeBase}..HEAD`, "--", relative]);
|
|
2237
2378
|
const { beforeRanges, afterRanges } = parseHunkRanges(patch);
|
|
2238
2379
|
out.push({
|
|
@@ -2247,7 +2388,7 @@ function changedFileDiffsSinceRemoteBase(repoRoot) {
|
|
|
2247
2388
|
}
|
|
2248
2389
|
function showBlob(repoRoot, ref, relative) {
|
|
2249
2390
|
try {
|
|
2250
|
-
return
|
|
2391
|
+
return execFileSync3("git", ["show", `${ref}:${relative}`], {
|
|
2251
2392
|
cwd: repoRoot,
|
|
2252
2393
|
encoding: "utf8",
|
|
2253
2394
|
maxBuffer: 64 * 1024 * 1024,
|
|
@@ -2483,6 +2624,123 @@ function scannedRootsOf(ts, file, source, repoRoot) {
|
|
|
2483
2624
|
return [];
|
|
2484
2625
|
return roots.filter((r) => !roots.some((other) => other !== r && r.startsWith(`${other}/`))).sort();
|
|
2485
2626
|
}
|
|
2627
|
+
var SCANNER_DECLARATIONS = [
|
|
2628
|
+
{
|
|
2629
|
+
test: "apps/cli/tests/conformance/dev-review-engine-architecture-exit.test.ts",
|
|
2630
|
+
roots: [
|
|
2631
|
+
"apps/cli/tests/fixtures/dev-review-engine-scenarios.json",
|
|
2632
|
+
"apps/cli/tests/fixtures/dev-review-architecture-invariants.json",
|
|
2633
|
+
"apps/cli/tests/fixtures/dev-review-engine-capability-matrix.json",
|
|
2634
|
+
"apps/cli/src/commands/dev-review-loop.ts",
|
|
2635
|
+
"apps/cli/src/lib/dev-review-loop.ts",
|
|
2636
|
+
"apps/cli/src/lib/dev-review-loop/",
|
|
2637
|
+
"packages/aeg-core/src/dev-review-loop/"
|
|
2638
|
+
],
|
|
2639
|
+
trigger: "listed-files"
|
|
2640
|
+
},
|
|
2641
|
+
{ test: "apps/cli/tests/ci-shards.test.ts", roots: ["apps/cli/"], trigger: "tree-shape" },
|
|
2642
|
+
{
|
|
2643
|
+
test: "apps/cli/tests/conformance/dev-review-invariant-coverage.test.ts",
|
|
2644
|
+
roots: [
|
|
2645
|
+
"apps/cli/src/commands/dev-review-loop.ts",
|
|
2646
|
+
"apps/cli/src/lib/dev-review-loop.ts",
|
|
2647
|
+
"apps/cli/src/lib/dev-review-loop/",
|
|
2648
|
+
"packages/aeg-core/src/dev-review-loop/",
|
|
2649
|
+
"apps/cli/tests/commands/dev-review-loop.test.ts",
|
|
2650
|
+
"apps/cli/tests/lib/dev-review-loop"
|
|
2651
|
+
],
|
|
2652
|
+
trigger: "tree-shape"
|
|
2653
|
+
},
|
|
2654
|
+
{ test: "apps/cli/tests/platform-independence.test.ts", roots: ["apps/cli/tests/"], trigger: "content" },
|
|
2655
|
+
{ test: "apps/cli/tests/process-fixture-coverage.test.ts", roots: ["apps/cli/tests/"], trigger: "process-start" },
|
|
2656
|
+
{ test: "apps/cli/scripts/bundle-doctrine.test.ts", roots: ["."], trigger: "content" },
|
|
2657
|
+
{ test: "apps/cli/tests/checks/bin-permissions.test.ts", roots: ["."], trigger: "content" },
|
|
2658
|
+
{
|
|
2659
|
+
test: "apps/cli/tests/checks/registry-gates.test.ts",
|
|
2660
|
+
roots: [
|
|
2661
|
+
"apps/cli/src/",
|
|
2662
|
+
"packages/aeg-core/bin/",
|
|
2663
|
+
"packages/aeg-core/src/brief-validation.ts",
|
|
2664
|
+
"aeg-root/enforcement.md",
|
|
2665
|
+
".claude/hooks/"
|
|
2666
|
+
],
|
|
2667
|
+
trigger: "content"
|
|
2668
|
+
},
|
|
2669
|
+
{
|
|
2670
|
+
test: "apps/cli/tests/checks/shipped-bin-audience.test.ts",
|
|
2671
|
+
roots: ["apps/cli/src/checks/bin/"],
|
|
2672
|
+
trigger: "content"
|
|
2673
|
+
},
|
|
2674
|
+
{ test: "apps/cli/tests/commands/sync.test.ts", roots: ["apps/cli/src/commands/sync.ts"], trigger: "content" },
|
|
2675
|
+
{ test: "apps/cli/tests/doctrine.test.ts", roots: ["apps/cli/src/index.ts"], trigger: "content" },
|
|
2676
|
+
{ test: "apps/cli/tests/import-boundary.test.ts", roots: ["apps/cli/"], trigger: "content" },
|
|
2677
|
+
{
|
|
2678
|
+
test: "apps/cli/tests/lib/log-entry-paths.test.ts",
|
|
2679
|
+
roots: [".github/workflows/", ".vinaya/hooks/", ".claude/settings.json", "vinaya.config.json"],
|
|
2680
|
+
trigger: "content"
|
|
2681
|
+
},
|
|
2682
|
+
{ test: "apps/cli/tests/lib/log-callers.test.ts", roots: ["."], trigger: "content" },
|
|
2683
|
+
{
|
|
2684
|
+
test: "apps/cli/tests/lib/log-sink-no-sync-spawn.test.ts",
|
|
2685
|
+
roots: ["apps/cli/src/lib/log-sink.ts"],
|
|
2686
|
+
trigger: "content"
|
|
2687
|
+
},
|
|
2688
|
+
{ test: "apps/cli/tests/lib/no-log-forge-writes.test.ts", roots: ["."], trigger: "content" },
|
|
2689
|
+
{
|
|
2690
|
+
test: "apps/cli/tests/log-destination-isolation.test.ts",
|
|
2691
|
+
roots: ["apps/cli/src/", "apps/cli/tests/"],
|
|
2692
|
+
trigger: "content"
|
|
2693
|
+
},
|
|
2694
|
+
{ test: `apps/cli/tests/no-brief-${"author"}.test.ts`, roots: ["."], trigger: "content" },
|
|
2695
|
+
{ test: "apps/cli/tests/run-paths-only.test.ts", roots: ["."], trigger: "content" },
|
|
2696
|
+
{ test: "apps/cli/tests/surface-index.test.ts", roots: ["apps/cli/src/commands/"], trigger: "content" },
|
|
2697
|
+
{ test: "apps/cli/tests/surface-spec-exports.test.ts", roots: ["apps/cli/src/commands/"], trigger: "content" },
|
|
2698
|
+
{ test: "packages/aeg-core/src/actions.test.ts", roots: ["aeg-root/roles/"], trigger: "content" },
|
|
2699
|
+
{ test: "packages/aeg-core/src/diagram-model.test.ts", roots: ["."], trigger: "content" },
|
|
2700
|
+
{
|
|
2701
|
+
test: "packages/aeg-core/src/docs/docs-coherence.test.ts",
|
|
2702
|
+
roots: ["packages/aeg-core/tests/fixtures/docs-coherence/"],
|
|
2703
|
+
trigger: "content"
|
|
2704
|
+
},
|
|
2705
|
+
{ test: "packages/aeg-core/src/docs/node-route.test.ts", roots: ["."], trigger: "content" },
|
|
2706
|
+
{ test: "packages/aeg-core/src/gate-audience.test.ts", roots: ["packages/aeg-core/bin/"], trigger: "content" },
|
|
2707
|
+
{ test: "packages/aeg-core/src/no-binary-sources.test.ts", roots: ["."], trigger: "content" },
|
|
2708
|
+
{ test: "packages/aeg-core/src/retired-vocabulary.test.ts", roots: ["."], trigger: "content" }
|
|
2709
|
+
];
|
|
2710
|
+
function underDeclaredRoot(path, root) {
|
|
2711
|
+
return root === "." || path.startsWith(root);
|
|
2712
|
+
}
|
|
2713
|
+
var PROCESS_CALLS = new Set([...SPAWN_CALLS, "fork"]);
|
|
2714
|
+
function startsProcessIn(ts, file, source, ranges) {
|
|
2715
|
+
let sourceFile;
|
|
2716
|
+
try {
|
|
2717
|
+
sourceFile = ts.createSourceFile(file, source, ts.ScriptTarget.ES2022, true);
|
|
2718
|
+
} catch {
|
|
2719
|
+
return false;
|
|
2720
|
+
}
|
|
2721
|
+
const touched = (node) => {
|
|
2722
|
+
if (!ranges)
|
|
2723
|
+
return true;
|
|
2724
|
+
const first = sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile)).line + 1;
|
|
2725
|
+
const last = sourceFile.getLineAndCharacterOfPosition(node.getEnd()).line + 1;
|
|
2726
|
+
return ranges.some((r) => r.start <= last && r.end >= first);
|
|
2727
|
+
};
|
|
2728
|
+
let found = false;
|
|
2729
|
+
const visit = (node) => {
|
|
2730
|
+
if (found)
|
|
2731
|
+
return;
|
|
2732
|
+
if (ts.isCallExpression(node)) {
|
|
2733
|
+
const callee = ts.isIdentifier(node.expression) ? node.expression.text : ts.isPropertyAccessExpression(node.expression) && node.expression.name.text !== "exec" ? node.expression.name.text : "";
|
|
2734
|
+
if (PROCESS_CALLS.has(callee) && touched(node)) {
|
|
2735
|
+
found = true;
|
|
2736
|
+
return;
|
|
2737
|
+
}
|
|
2738
|
+
}
|
|
2739
|
+
ts.forEachChild(node, visit);
|
|
2740
|
+
};
|
|
2741
|
+
ts.forEachChild(sourceFile, visit);
|
|
2742
|
+
return found;
|
|
2743
|
+
}
|
|
2486
2744
|
|
|
2487
2745
|
// src/lib/ts-module-graph.ts
|
|
2488
2746
|
import { createRequire } from "node:module";
|
|
@@ -3381,6 +3639,23 @@ function selectAffectedTestFiles(repoRoot, changedFiles, options = {}) {
|
|
|
3381
3639
|
edges.set(key, [...edges.get(key) ?? [], edge]);
|
|
3382
3640
|
}
|
|
3383
3641
|
}
|
|
3642
|
+
const triggeredScanners = new Set;
|
|
3643
|
+
const relative = (f) => isAbsolute4(f) ? f.slice(repoRoot.length + 1) : f;
|
|
3644
|
+
const reshaped = [...addedOrRenamed, ...options.removed ?? []].map(relative);
|
|
3645
|
+
const changedRanges = new Map([...options.changedRanges ?? new Map].map(([f, ranges]) => [isAbsolute4(f) ? f : join7(repoRoot, f), ranges]));
|
|
3646
|
+
for (const declaration of options.scannerDeclarations ?? SCANNER_DECLARATIONS) {
|
|
3647
|
+
const under = (f) => declaration.roots.some((root) => underDeclaredRoot(f, root));
|
|
3648
|
+
const triggered = declaration.trigger === "tree-shape" ? reshaped.some(under) : declaration.trigger === "process-start" ? [...absChanged].some((abs) => {
|
|
3649
|
+
if (!/\.tsx?$/.test(abs) || !under(relative(abs)))
|
|
3650
|
+
return false;
|
|
3651
|
+
if (!typescript)
|
|
3652
|
+
return true;
|
|
3653
|
+
const ranges = addedOrRenamed.has(abs) ? undefined : changedRanges.get(abs);
|
|
3654
|
+
return startsProcessIn(typescript, abs, readSource(abs), ranges);
|
|
3655
|
+
}) : declaration.trigger === "listed-files" ? [...absChanged, ...addedOrRenamed, ...options.removed ?? []].map(relative).some(under) : false;
|
|
3656
|
+
if (triggered)
|
|
3657
|
+
triggeredScanners.add(join7(repoRoot, declaration.test));
|
|
3658
|
+
}
|
|
3384
3659
|
const anythingChanged = absChanged.size > 0 || changedPackageNames.size > 0;
|
|
3385
3660
|
const selected = [];
|
|
3386
3661
|
let totalTestFiles = 0;
|
|
@@ -3391,7 +3666,7 @@ function selectAffectedTestFiles(repoRoot, changedFiles, options = {}) {
|
|
|
3391
3666
|
continue;
|
|
3392
3667
|
const maxDepth = options.depth === "one" ? 1 : Number.POSITIVE_INFINITY;
|
|
3393
3668
|
for (const test of testFiles) {
|
|
3394
|
-
const forced = alwaysRunRegexes.some((re) => re.test(test.slice(repoRoot.length + 1))) || addedOrRenamed.has(test) || rootConfigChanged && pkg === cliPackage;
|
|
3669
|
+
const forced = alwaysRunRegexes.some((re) => re.test(test.slice(repoRoot.length + 1))) || addedOrRenamed.has(test) || triggeredScanners.has(test) || rootConfigChanged && pkg === cliPackage;
|
|
3395
3670
|
if (forced || anythingChanged && reaches(`${ALL_PREFIX}${test}`, edges, changeFacts, maxDepth)) {
|
|
3396
3671
|
selected.push(test);
|
|
3397
3672
|
}
|
|
@@ -3453,21 +3728,31 @@ function reaches(start, edges, changed, maxDepth = Number.POSITIVE_INFINITY) {
|
|
|
3453
3728
|
return false;
|
|
3454
3729
|
}
|
|
3455
3730
|
|
|
3456
|
-
// src/lib/pre-push-
|
|
3457
|
-
function
|
|
3458
|
-
const
|
|
3459
|
-
const
|
|
3460
|
-
const
|
|
3461
|
-
const addedOrRenamed = addedOrRenamedFilesSinceRemoteBaseAbsolute(repoRoot);
|
|
3731
|
+
// src/lib/pre-push-selection.ts
|
|
3732
|
+
function prePushSelection(repoRoot, base = resolveRemoteBase(repoRoot)) {
|
|
3733
|
+
const changed = changedFilesSinceRemoteBaseAbsolute(repoRoot, base);
|
|
3734
|
+
const addedOrRenamed = addedOrRenamedFilesSinceRemoteBaseAbsolute(repoRoot, base);
|
|
3735
|
+
const removed = removedFilesSinceRemoteBaseAbsolute(repoRoot, base);
|
|
3462
3736
|
const alwaysRun = loadConfig()?.prePush?.alwaysRun ?? [];
|
|
3463
3737
|
const typescript = loadTypeScript(repoRoot);
|
|
3464
|
-
const
|
|
3465
|
-
const
|
|
3738
|
+
const diffs = typescript ? changedFileDiffsSinceRemoteBase(repoRoot, base) : undefined;
|
|
3739
|
+
const names = typescript && diffs ? affectedNames(typescript, diffs) : undefined;
|
|
3740
|
+
const changedRanges = diffs ? new Map(diffs.map((d) => [d.file, d.afterRanges])) : undefined;
|
|
3741
|
+
return selectAffectedTestFiles(repoRoot, changed, {
|
|
3466
3742
|
alwaysRun,
|
|
3467
3743
|
addedOrRenamed,
|
|
3744
|
+
removed,
|
|
3745
|
+
changedRanges,
|
|
3468
3746
|
affectedNames: names,
|
|
3469
3747
|
depth: "one"
|
|
3470
3748
|
});
|
|
3749
|
+
}
|
|
3750
|
+
|
|
3751
|
+
// src/lib/pre-push-select-tests.ts
|
|
3752
|
+
function main() {
|
|
3753
|
+
const repoRoot = process.cwd();
|
|
3754
|
+
const started = performance.now();
|
|
3755
|
+
const { selected, totalTestFiles, resolver, programMs } = prePushSelection(repoRoot);
|
|
3471
3756
|
const elapsed = performance.now() - started;
|
|
3472
3757
|
for (const file of selected)
|
|
3473
3758
|
process.stdout.write(`${file}
|