@attalabs/vinaya 0.36.0 → 0.37.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 +9 -10
- package/aeg-root/process.md +3 -1
- package/aeg-root/roles/archivist.md +2 -2
- package/aeg-root/roles/developer/reference.md +13 -16
- package/aeg-root/roles/developer.md +7 -3
- package/aeg-root/roles/operator.md +18 -18
- package/aeg-root/roles/planner/reference.md +4 -4
- package/aeg-root/roles/principal.md +6 -1
- package/aeg-root/roles/reviewer.md +9 -3
- package/aeg-root/roles/security.md +19 -9
- package/aeg-root/roles/tranche-archivist.md +14 -2
- package/aeg-root/state-machine.md +11 -10
- package/aeg-root/templates/brief-template.md +6 -4
- package/aeg-root/templates/pr-report-template.md +1 -9
- package/aeg-root/tranche-model.md +4 -4
- package/dist/checks/bin/check-body-bare-digits.js +685 -584
- package/dist/checks/bin/check-branch-topology.js +626 -466
- package/dist/checks/bin/check-brief-shape.js +686 -585
- package/dist/checks/bin/check-changeset-coverage.js +1161 -731
- package/dist/checks/bin/check-closes-n.js +626 -466
- package/dist/checks/bin/check-coherence.js +744 -599
- package/dist/checks/bin/check-dead-branch-push.js +567 -451
- package/dist/checks/bin/check-dispatch-readiness.js +747 -602
- package/dist/checks/bin/check-doc-coverage-push.js +1160 -730
- package/dist/checks/bin/check-doc-coverage.js +1160 -730
- package/dist/checks/bin/check-doctrine-no-procedures.js +683 -582
- package/dist/checks/bin/check-doctrine-portability.js +1160 -730
- package/dist/checks/bin/check-evidence-fresh.js +1167 -906
- package/dist/checks/bin/check-exec-bits.js +1159 -729
- package/dist/checks/bin/check-first-push-dispatch.js +747 -602
- package/dist/checks/bin/check-issue-assignment.js +626 -466
- package/dist/checks/bin/check-issue-milestone-attach.js +567 -451
- package/dist/checks/bin/check-issue-objectives-numbering.js +683 -582
- package/dist/checks/bin/check-issue-parts-coverage.js +567 -451
- package/dist/checks/bin/check-issue-surface-globs.js +755 -601
- package/dist/checks/bin/check-issue-title-grammar.js +567 -451
- package/dist/checks/bin/check-issue-tranche-label.js +567 -451
- package/dist/checks/bin/check-main-branch-refusal.js +567 -451
- package/dist/checks/bin/check-no-disk-state.js +567 -451
- package/dist/checks/bin/check-pr-premise-reassert.js +683 -582
- package/dist/checks/bin/check-pr-report-density.js +567 -451
- package/dist/checks/bin/check-principal-test-plan-wait.js +567 -451
- package/dist/checks/bin/check-quoted-command.js +1644 -1216
- package/dist/checks/bin/check-reader-resolvable-prose.js +1663 -1223
- package/dist/checks/bin/check-registry-gates.js +610 -481
- package/dist/checks/bin/check-retired-vocabulary.js +1638 -1210
- package/dist/checks/bin/check-review-gate.js +694 -593
- package/dist/checks/bin/check-single-plan-pr.js +567 -451
- package/dist/checks/bin/check-surface-scope.js +626 -466
- package/dist/checks/bin/check-test-plan.js +567 -451
- package/dist/checks/bin/check-token-collection-wired.js +567 -451
- package/dist/checks/bin/check-workspace-escape.js +1160 -730
- package/dist/index.js +13507 -7975
- package/dist/lib/pre-push-cache-test-run.js +1004 -681
- package/dist/lib/pre-push-select-tests.js +609 -480
- package/package.json +2 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-render.ts +38 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/records.ts +19 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/assess-round.ts +233 -8
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/fakes.ts +7 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/index.ts +1 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/render-summary.ts +38 -3
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/types.ts +113 -4
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/doc-claim.ts +32 -6
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/index.ts +26 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/issue-validation.ts +747 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/schema.ts +8 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-gate.ts +52 -4
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-policy.ts +163 -21
- 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.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]__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]__1wy7w66._.js → [root-of-the-server]__14ui9sz._.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/{00z3-ljjd1gj9.js → 0vtfb0g813gki.js} +1 -1
- 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/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/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/{3lqjwjrcvq481.js → 3l56x8wjdzvaw.js} +5 -5
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3m310lbjj4p5u.js +1 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{2o9l0b7eqbr57.js → 3qtt1v3ya-ofe.js} +1 -1
- package/studio-standalone/apps/vinaya-studio/web/package.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/server.js +1 -1
- package/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/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/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 → yR5RsCxb1OGnYggiaO09S}/_buildManifest.js +0 -0
- /package/studio-standalone/apps/vinaya-studio/web/.next/static/{z1fTSBP6ZlUjObzFIp-qq → yR5RsCxb1OGnYggiaO09S}/_clientMiddlewareManifest.js +0 -0
- /package/studio-standalone/apps/vinaya-studio/web/.next/static/{z1fTSBP6ZlUjObzFIp-qq → yR5RsCxb1OGnYggiaO09S}/_ssgManifest.js +0 -0
|
@@ -1882,45 +1882,6 @@ var DERIVED_STATUSES = [
|
|
|
1882
1882
|
"incoherent"
|
|
1883
1883
|
];
|
|
1884
1884
|
var DERIVABLE_STATUSES = DERIVED_STATUSES.filter((s) => s !== "backlog");
|
|
1885
|
-
// ../../packages/aeg-core/src/parse-ledger.ts
|
|
1886
|
-
function rowFromCells(cells) {
|
|
1887
|
-
if (cells.length < 7)
|
|
1888
|
-
return null;
|
|
1889
|
-
const phase = (cells[0] ?? "").trim();
|
|
1890
|
-
if (!phase)
|
|
1891
|
-
return null;
|
|
1892
|
-
return {
|
|
1893
|
-
phase,
|
|
1894
|
-
role: (cells[1] ?? "").trim(),
|
|
1895
|
-
agentModel: (cells[2] ?? "").trim(),
|
|
1896
|
-
tokensIn: parseIntCell(cells[3] ?? ""),
|
|
1897
|
-
tokensOut: parseIntCell(cells[4] ?? ""),
|
|
1898
|
-
cost: parseCostCell(cells[5] ?? ""),
|
|
1899
|
-
date: (cells[6] ?? "").trim()
|
|
1900
|
-
};
|
|
1901
|
-
}
|
|
1902
|
-
function parseIntCell(cell) {
|
|
1903
|
-
const trimmed = cell.replace(/`/g, "").trim();
|
|
1904
|
-
if (!trimmed || isEmDashOrDash(trimmed))
|
|
1905
|
-
return null;
|
|
1906
|
-
const normalized = trimmed.replace(/[,_\s]/g, "");
|
|
1907
|
-
if (!/^-?\d+$/.test(normalized))
|
|
1908
|
-
return null;
|
|
1909
|
-
return Number(normalized);
|
|
1910
|
-
}
|
|
1911
|
-
function parseCostCell(cell) {
|
|
1912
|
-
const trimmed = cell.replace(/`/g, "").trim();
|
|
1913
|
-
if (!trimmed || isEmDashOrDash(trimmed))
|
|
1914
|
-
return null;
|
|
1915
|
-
const normalized = trimmed.replace(/^\$/, "").replace(/[,_\s]/g, "");
|
|
1916
|
-
if (!/^-?\d+(\.\d+)?$/.test(normalized))
|
|
1917
|
-
return null;
|
|
1918
|
-
return Number(normalized);
|
|
1919
|
-
}
|
|
1920
|
-
function isEmDashOrDash(s) {
|
|
1921
|
-
const t = s.trim();
|
|
1922
|
-
return t === "—" || t === "-" || t === "–";
|
|
1923
|
-
}
|
|
1924
1885
|
// ../../packages/aeg-core/src/waiver-label.ts
|
|
1925
1886
|
var WAIVER_LABEL = label("waiver-docs");
|
|
1926
1887
|
var WAIVER_LABEL_REVIEW = label("waiver-review");
|
|
@@ -1936,61 +1897,6 @@ function isWaiverLabelActorVerified(opts) {
|
|
|
1936
1897
|
return false;
|
|
1937
1898
|
return isPrincipal(opts.labelActor, opts.principalAllowlist);
|
|
1938
1899
|
}
|
|
1939
|
-
|
|
1940
|
-
// ../../packages/aeg-core/src/parse-token-report.ts
|
|
1941
|
-
var TOKEN_REPORT_HEADING = /^\s*(?:#{1,6}\s*Token report\s*|\*\*Token report\*\*)\s*$/i;
|
|
1942
|
-
var INLINE_FIELD_LIST = /Phase:\s*([^|]+?)\s*\|\s*Role:\s*([^|]+?)\s*\|\s*Agent\/Model:\s*([^|]+?)\s*\|\s*Tokens in:\s*([^|]+?)\s*\|\s*Tokens out:\s*([^|]+?)\s*\|\s*Cost:\s*([^|]+?)\s*\|\s*Date:\s*(.+?)\s*$/im;
|
|
1943
|
-
function parseTokenReportEntries(body) {
|
|
1944
|
-
const lines = body.split(/\r?\n/);
|
|
1945
|
-
const headingIdxs = [];
|
|
1946
|
-
lines.forEach((line, i) => {
|
|
1947
|
-
if (TOKEN_REPORT_HEADING.test(line))
|
|
1948
|
-
headingIdxs.push(i);
|
|
1949
|
-
});
|
|
1950
|
-
const out = [];
|
|
1951
|
-
for (let h = 0;h < headingIdxs.length; h++) {
|
|
1952
|
-
const start = headingIdxs[h] + 1;
|
|
1953
|
-
const end = h + 1 < headingIdxs.length ? headingIdxs[h + 1] : lines.length;
|
|
1954
|
-
const section = lines.slice(start, end).join(`
|
|
1955
|
-
`);
|
|
1956
|
-
const tableRows = parseTableSection(section);
|
|
1957
|
-
if (tableRows.length > 0) {
|
|
1958
|
-
out.push(...tableRows);
|
|
1959
|
-
continue;
|
|
1960
|
-
}
|
|
1961
|
-
const inlineRow = parseInlineFieldList(section);
|
|
1962
|
-
if (inlineRow)
|
|
1963
|
-
out.push(inlineRow);
|
|
1964
|
-
}
|
|
1965
|
-
return out;
|
|
1966
|
-
}
|
|
1967
|
-
function parseTableSection(section) {
|
|
1968
|
-
const lines = section.split(/\r?\n/);
|
|
1969
|
-
let i = 0;
|
|
1970
|
-
for (;i < lines.length; i++) {
|
|
1971
|
-
if ((lines[i] ?? "").trim().startsWith("|"))
|
|
1972
|
-
break;
|
|
1973
|
-
}
|
|
1974
|
-
if (i + 1 >= lines.length)
|
|
1975
|
-
return [];
|
|
1976
|
-
i += 2;
|
|
1977
|
-
const out = [];
|
|
1978
|
-
for (;i < lines.length; i++) {
|
|
1979
|
-
const trimmed = (lines[i] ?? "").trim();
|
|
1980
|
-
if (!trimmed.startsWith("|"))
|
|
1981
|
-
break;
|
|
1982
|
-
const row = rowFromCells(splitTableRow(trimmed));
|
|
1983
|
-
if (row)
|
|
1984
|
-
out.push(row);
|
|
1985
|
-
}
|
|
1986
|
-
return out;
|
|
1987
|
-
}
|
|
1988
|
-
function parseInlineFieldList(section) {
|
|
1989
|
-
const m = section.match(INLINE_FIELD_LIST);
|
|
1990
|
-
if (!m)
|
|
1991
|
-
return null;
|
|
1992
|
-
return rowFromCells([m[1], m[2], m[3], m[4], m[5], m[6], m[7]]);
|
|
1993
|
-
}
|
|
1994
1900
|
// ../../packages/aeg-core/src/verdict-extraction.ts
|
|
1995
1901
|
var HEAD_SHA_PATTERN = /^[ \t]*(?:\*{1,3}|_{1,3})?Judged head:\s*([0-9a-f]{7,40})(?![A-Za-z0-9])/im;
|
|
1996
1902
|
var OBJECTIVES_VERSION_PATTERN = /^[ \t]*(?:\*{1,3}|_{1,3})?Objectives version:\s*([0-9a-f]{64})(?![A-Za-z0-9])/im;
|
|
@@ -2439,10 +2345,12 @@ function evaluateC5(changed, docOwnersContent, prBody, fileExists, waiverActive,
|
|
|
2439
2345
|
var CODE_REVIEW_SEVERITY_ORDER = ["BLOCKER", "MAJOR", "MINOR"];
|
|
2440
2346
|
var SECURITY_SEVERITY_ORDER = ["CRITICAL", "HIGH", "MEDIUM", "LOW"];
|
|
2441
2347
|
var DEFAULT_MAX_ROUNDS = 3;
|
|
2348
|
+
var DEFAULT_MAX_TASK_MINUTES = 180;
|
|
2442
2349
|
var DEFAULT_REVIEW_POLICY = {
|
|
2443
2350
|
codeReviewThreshold: "BLOCKER",
|
|
2444
2351
|
securityThreshold: "HIGH",
|
|
2445
|
-
maxRounds: DEFAULT_MAX_ROUNDS
|
|
2352
|
+
maxRounds: DEFAULT_MAX_ROUNDS,
|
|
2353
|
+
maxTaskMinutes: DEFAULT_MAX_TASK_MINUTES
|
|
2446
2354
|
};
|
|
2447
2355
|
var FILE_SHAPED_LOCATION = /\.[a-zA-Z0-9]{1,10}(:\d+)?\s*$/;
|
|
2448
2356
|
var PROSE_LOCATION_PATTERNS = [/\bpr\s*body\b/i, /\bcomment\b/i];
|
|
@@ -2843,11 +2751,13 @@ function checkDocUpdateList(prBody) {
|
|
|
2843
2751
|
return headingCheck(prBody, "(?:documentation|doc)[- ]update(?:\\s+list)?", "Documentation-update list");
|
|
2844
2752
|
}
|
|
2845
2753
|
function checkWorktreeStep0(prBody) {
|
|
2846
|
-
if (/git worktree add/.test(prBody))
|
|
2754
|
+
if (/git worktree add/.test(prBody) || /cd \.worktrees\//.test(prBody) || /bun install --frozen-lockfile/.test(prBody))
|
|
2847
2755
|
return { status: "pass", errors: [] };
|
|
2848
2756
|
return {
|
|
2849
2757
|
status: "fail",
|
|
2850
|
-
errors: [
|
|
2758
|
+
errors: [
|
|
2759
|
+
"brief-validation worktree Step 0: no `git worktree add`, `cd .worktrees/`, or `bun install --frozen-lockfile` command found in the PR body."
|
|
2760
|
+
]
|
|
2851
2761
|
};
|
|
2852
2762
|
}
|
|
2853
2763
|
function checkStopConditions(prBody) {
|
|
@@ -3037,7 +2947,8 @@ function isCommandBlock(content) {
|
|
|
3037
2947
|
return COMMAND_WORDS.includes(commandWordOf(firstNonBlankLine(content)));
|
|
3038
2948
|
}
|
|
3039
2949
|
function isStep0Block(content) {
|
|
3040
|
-
|
|
2950
|
+
const first = firstNonBlankLine(content);
|
|
2951
|
+
return first.startsWith("git worktree add") || first.startsWith("cd .worktrees/") || first.startsWith("bun install --frozen-lockfile");
|
|
3041
2952
|
}
|
|
3042
2953
|
function checkCommandsCarryOutput(prBody) {
|
|
3043
2954
|
const errors = [];
|
|
@@ -3506,10 +3417,14 @@ function legacySlugPattern(legacySlugs) {
|
|
|
3506
3417
|
const alternation = legacySlugs.map((s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|");
|
|
3507
3418
|
return new RegExp(`(^|[^a-zA-Z0-9\\n-])(${alternation})([^a-zA-Z0-9\\n-]|$)`, "g");
|
|
3508
3419
|
}
|
|
3420
|
+
function specGrandfatherPaths(specGrandfather) {
|
|
3421
|
+
return Array.isArray(specGrandfather) ? [...specGrandfather] : Object.keys(specGrandfather);
|
|
3422
|
+
}
|
|
3509
3423
|
function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuffix, legacySlugs = [], shipsPrefix = SHIPS_PREFIX, specGrandfather = [], specPaths = DEFAULT_SPEC_PATHS) {
|
|
3510
3424
|
const findings = [];
|
|
3511
3425
|
const legacyPattern = legacySlugPattern(legacySlugs);
|
|
3512
|
-
const
|
|
3426
|
+
const grandfatheredWhole = new Set(Array.isArray(specGrandfather) ? specGrandfather : []);
|
|
3427
|
+
const limits = new Map(Array.isArray(specGrandfather) ? [] : Object.entries(specGrandfather));
|
|
3513
3428
|
const patterns = [
|
|
3514
3429
|
{ pattern: FORGE_NUMBER_PATTERN, what: "a forge number" },
|
|
3515
3430
|
{ pattern: TRANCHE_SLUG_VN_PATTERN, what: "an internal tranche slug" },
|
|
@@ -3528,18 +3443,19 @@ function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuff
|
|
|
3528
3443
|
continue;
|
|
3529
3444
|
if (cls !== "product" && cls !== "spec" && !SWEPT_CLASSES.has(cls))
|
|
3530
3445
|
continue;
|
|
3531
|
-
if (cls === "spec" &&
|
|
3446
|
+
if (cls === "spec" && grandfatheredWhole.has(file.path))
|
|
3532
3447
|
continue;
|
|
3533
3448
|
const blocking = cls === "product" || cls === "spec";
|
|
3534
3449
|
const scrubbed = cls === "product" ? stripNonProseForProduct(file.path, file.content) : stripNonProse(file.path, file.content);
|
|
3535
3450
|
const patternsToRun = cls === "product" ? productPatterns : cls === "spec" ? specPatterns : patterns;
|
|
3451
|
+
const fileFindings = [];
|
|
3536
3452
|
for (const { pattern, what, group } of patternsToRun) {
|
|
3537
3453
|
pattern.lastIndex = 0;
|
|
3538
3454
|
let match = pattern.exec(scrubbed);
|
|
3539
3455
|
while (match !== null) {
|
|
3540
3456
|
const cited = group !== undefined ? match[group] ?? match[0] : match[0];
|
|
3541
3457
|
const citedIndex = match.index + match[0].indexOf(cited);
|
|
3542
|
-
|
|
3458
|
+
fileFindings.push({
|
|
3543
3459
|
file: file.path,
|
|
3544
3460
|
line: lineAt(scrubbed, citedIndex),
|
|
3545
3461
|
message: `references ${what} ("${cited}") a reader outside this repo's tracker cannot resolve`,
|
|
@@ -3548,6 +3464,15 @@ function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuff
|
|
|
3548
3464
|
match = pattern.exec(scrubbed);
|
|
3549
3465
|
}
|
|
3550
3466
|
}
|
|
3467
|
+
const limit = cls === "spec" ? limits.get(file.path) : undefined;
|
|
3468
|
+
if (limit !== undefined) {
|
|
3469
|
+
if (fileFindings.length <= limit)
|
|
3470
|
+
continue;
|
|
3471
|
+
for (const f of fileFindings) {
|
|
3472
|
+
f.message += `; ${file.path} carries ${fileFindings.length} such findings, over its proseGates.specGrandfather limit of ${limit}`;
|
|
3473
|
+
}
|
|
3474
|
+
}
|
|
3475
|
+
findings.push(...fileFindings);
|
|
3551
3476
|
}
|
|
3552
3477
|
return findings;
|
|
3553
3478
|
}
|
|
@@ -4507,8 +4432,7 @@ function briefHash(brief) {
|
|
|
4507
4432
|
function policyDigest(policy) {
|
|
4508
4433
|
return createHash4("sha256").update(JSON.stringify({
|
|
4509
4434
|
codeReviewThreshold: policy.codeReviewThreshold,
|
|
4510
|
-
securityThreshold: policy.securityThreshold
|
|
4511
|
-
maxRounds: policy.maxRounds
|
|
4435
|
+
securityThreshold: policy.securityThreshold
|
|
4512
4436
|
})).digest("hex");
|
|
4513
4437
|
}
|
|
4514
4438
|
function isBoundToHead(echoed, headSha) {
|
|
@@ -4821,7 +4745,46 @@ function parseEnforcementRegistry(content) {
|
|
|
4821
4745
|
return result;
|
|
4822
4746
|
}
|
|
4823
4747
|
// ../../packages/aeg-core/src/registry-checks.ts
|
|
4824
|
-
|
|
4748
|
+
var HOOK_DIR_PREFIXES = [".claude/hooks/", ".vinaya/hooks/", ".husky/", ".git/hooks/"];
|
|
4749
|
+
var BARE_HOOK_NAME = /^check-[A-Za-z0-9_.-]*\.sh$/;
|
|
4750
|
+
function basename(path) {
|
|
4751
|
+
return path.slice(path.lastIndexOf("/") + 1);
|
|
4752
|
+
}
|
|
4753
|
+
function lineOf(content, index) {
|
|
4754
|
+
let line = 1;
|
|
4755
|
+
for (let i = 0;i < index; i++)
|
|
4756
|
+
if (content.charCodeAt(i) === 10)
|
|
4757
|
+
line++;
|
|
4758
|
+
return line;
|
|
4759
|
+
}
|
|
4760
|
+
function findUnshippedHookRefs(docs, shipped) {
|
|
4761
|
+
const shippedNames = new Set([...shipped].map(basename));
|
|
4762
|
+
const findings = [];
|
|
4763
|
+
const flag = (doc, token, index) => {
|
|
4764
|
+
findings.push({
|
|
4765
|
+
path: doc.path,
|
|
4766
|
+
reason: `${doc.path}:${lineOf(doc.content, index)} names hook "${token}", which is neither tracked in git nor emitted by \`vinaya init\``
|
|
4767
|
+
});
|
|
4768
|
+
};
|
|
4769
|
+
for (const doc of docs) {
|
|
4770
|
+
for (const { cited, index } of extractCitedPaths(doc.content)) {
|
|
4771
|
+
if (cited.endsWith("/") || !HOOK_DIR_PREFIXES.some((p) => cited.startsWith(p)))
|
|
4772
|
+
continue;
|
|
4773
|
+
if (!shipped.has(cited))
|
|
4774
|
+
flag(doc, cited, index);
|
|
4775
|
+
}
|
|
4776
|
+
const spanPattern = /`([^`\n]+)`/g;
|
|
4777
|
+
let match = spanPattern.exec(doc.content);
|
|
4778
|
+
while (match !== null) {
|
|
4779
|
+
const token = match[1] ?? "";
|
|
4780
|
+
if (BARE_HOOK_NAME.test(token) && !shippedNames.has(token))
|
|
4781
|
+
flag(doc, token, match.index);
|
|
4782
|
+
match = spanPattern.exec(doc.content);
|
|
4783
|
+
}
|
|
4784
|
+
}
|
|
4785
|
+
return findings;
|
|
4786
|
+
}
|
|
4787
|
+
function checkG1(rows, existsFn, hookRefs) {
|
|
4825
4788
|
const findings = [];
|
|
4826
4789
|
for (const row of rows) {
|
|
4827
4790
|
if (row.implementation === "")
|
|
@@ -4834,6 +4797,8 @@ function checkG1(rows, existsFn) {
|
|
|
4834
4797
|
});
|
|
4835
4798
|
}
|
|
4836
4799
|
}
|
|
4800
|
+
if (hookRefs)
|
|
4801
|
+
findings.push(...findUnshippedHookRefs(hookRefs.docs, hookRefs.shipped));
|
|
4837
4802
|
return { check: "G1", status: findings.length > 0 ? "fail" : "pass", findings };
|
|
4838
4803
|
}
|
|
4839
4804
|
var SCAFFOLD_PLACEHOLDER = "[undocumented — fill in why]";
|
|
@@ -5387,7 +5352,6 @@ var TaskPrPauseSchema = z.object({
|
|
|
5387
5352
|
var TaskPrReviewRecordSchema = z.object({
|
|
5388
5353
|
verdicts: z.array(TaskPrVerdictSchema),
|
|
5389
5354
|
roundMarkers: z.array(z.number().int().nonnegative()),
|
|
5390
|
-
summaryTable: z.string().nullable(),
|
|
5391
5355
|
pause: TaskPrPauseSchema.nullable()
|
|
5392
5356
|
});
|
|
5393
5357
|
var TaskPrReadInputSchema = z.object({
|
|
@@ -5434,16 +5398,6 @@ var TaskCancelResultSchema = z.object({
|
|
|
5434
5398
|
authenticatedFrom: z.string().min(1),
|
|
5435
5399
|
fencedEffectKeys: z.array(z.string())
|
|
5436
5400
|
});
|
|
5437
|
-
var TASK_TOOL_NAMES = [
|
|
5438
|
-
"task_start",
|
|
5439
|
-
"task_status",
|
|
5440
|
-
"task_escalation_read",
|
|
5441
|
-
"task_pr_read",
|
|
5442
|
-
"task_resume",
|
|
5443
|
-
"task_cancel"
|
|
5444
|
-
];
|
|
5445
|
-
var OPERATOR_STATUS_FOLLOW = "task_status_follow";
|
|
5446
|
-
var OPERATOR_TOOL_GRANT = [...TASK_TOOL_NAMES, OPERATOR_STATUS_FOLLOW];
|
|
5447
5401
|
// ../../packages/aeg-core/src/first-push-dispatch-gate.ts
|
|
5448
5402
|
function parseTaskBranch(branch) {
|
|
5449
5403
|
const m = /^task\/([^/]+)\/([^/]+)$/.exec(branch);
|
|
@@ -5674,15 +5628,69 @@ var NO_GATE_CUTOVERS = {
|
|
|
5674
5628
|
briefRulesSincePr: null,
|
|
5675
5629
|
agentBoxesRefusedSincePr: null
|
|
5676
5630
|
};
|
|
5677
|
-
// ../../packages/aeg-core/src/dev-review-loop/types.ts
|
|
5678
|
-
var SEVERITY_COLUMNS = ["blocker", "major", "minor", "critical", "high", "medium", "low"];
|
|
5679
|
-
// ../../packages/aeg-core/src/dev-review-loop/journal-reconstruction.ts
|
|
5680
|
-
var SUMMARY_TABLE_HEADER = `| round | ${SEVERITY_COLUMNS.join(" | ")} | confidence | outcome |`;
|
|
5681
|
-
// ../../packages/aeg-core/src/log/envelope.ts
|
|
5682
|
-
import { createHash as createHash5 } from "node:crypto";
|
|
5683
|
-
|
|
5684
5631
|
// ../../packages/aeg-core/src/log/schema.ts
|
|
5632
|
+
import { z as z3 } from "zod";
|
|
5633
|
+
|
|
5634
|
+
// ../../packages/aeg-core/src/log/custom.ts
|
|
5685
5635
|
import { z as z2 } from "zod";
|
|
5636
|
+
var CUSTOM_EVENT_NAME_PATTERN = /^[a-z][a-z0-9_]*\.[a-z][a-z0-9_.]*$/;
|
|
5637
|
+
var CUSTOM_EVENT_NAME_MAX_LENGTH = 64;
|
|
5638
|
+
var CUSTOM_EVENT_RESERVED_NAMESPACE = "vinaya";
|
|
5639
|
+
var CUSTOM_EVENT_MAX_FIELDS = 20;
|
|
5640
|
+
var CUSTOM_FIELD_NAME_PATTERN = /^[a-z][a-z0-9_]*$/;
|
|
5641
|
+
var CUSTOM_FIELD_NAME_MAX_LENGTH = 64;
|
|
5642
|
+
var CUSTOM_TEXT_MAX_LENGTH = 500;
|
|
5643
|
+
var CUSTOM_WORD_PATTERN = /^[a-z0-9][a-z0-9_-]*$/;
|
|
5644
|
+
var CUSTOM_WORD_MAX_LENGTH = 64;
|
|
5645
|
+
var CUSTOM_FIELD_MAX_WORDS = 50;
|
|
5646
|
+
var CustomFieldTypeSchema = z2.union([z2.enum(["text", "number", "boolean"]), z2.array(z2.string())]);
|
|
5647
|
+
var CustomEventDeclarationsSchema = z2.record(z2.string(), z2.object({
|
|
5648
|
+
fields: z2.record(z2.string(), CustomFieldTypeSchema)
|
|
5649
|
+
}).strict()).superRefine((events, ctx) => {
|
|
5650
|
+
for (const [name, declaration] of Object.entries(events)) {
|
|
5651
|
+
const refuse = (message, path = []) => {
|
|
5652
|
+
ctx.addIssue({
|
|
5653
|
+
code: z2.ZodIssueCode.custom,
|
|
5654
|
+
path: [name, ...path],
|
|
5655
|
+
message: `logs.events "${name}": ${message}`
|
|
5656
|
+
});
|
|
5657
|
+
};
|
|
5658
|
+
if (name.length > CUSTOM_EVENT_NAME_MAX_LENGTH) {
|
|
5659
|
+
refuse(`the name must be at most ${CUSTOM_EVENT_NAME_MAX_LENGTH} characters`);
|
|
5660
|
+
}
|
|
5661
|
+
if (!CUSTOM_EVENT_NAME_PATTERN.test(name)) {
|
|
5662
|
+
refuse("the name must be `<namespace>.<event>` — lowercase letters, digits and `_`, a dot between them");
|
|
5663
|
+
} else if (name.split(".")[0] === CUSTOM_EVENT_RESERVED_NAMESPACE) {
|
|
5664
|
+
refuse(`the \`${CUSTOM_EVENT_RESERVED_NAMESPACE}.\` namespace is reserved for Vinaya's own events`);
|
|
5665
|
+
}
|
|
5666
|
+
const fieldEntries = Object.entries(declaration.fields);
|
|
5667
|
+
if (fieldEntries.length > CUSTOM_EVENT_MAX_FIELDS) {
|
|
5668
|
+
refuse(`at most ${CUSTOM_EVENT_MAX_FIELDS} fields may be declared (found ${fieldEntries.length})`, ["fields"]);
|
|
5669
|
+
}
|
|
5670
|
+
for (const [field, type] of fieldEntries) {
|
|
5671
|
+
if (field.length > CUSTOM_FIELD_NAME_MAX_LENGTH || !CUSTOM_FIELD_NAME_PATTERN.test(field)) {
|
|
5672
|
+
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]);
|
|
5673
|
+
}
|
|
5674
|
+
if (typeof type === "string")
|
|
5675
|
+
continue;
|
|
5676
|
+
if (type.length === 0) {
|
|
5677
|
+
refuse(`field "${field}": a list of words must name at least one word`, ["fields", field]);
|
|
5678
|
+
}
|
|
5679
|
+
if (type.length > CUSTOM_FIELD_MAX_WORDS) {
|
|
5680
|
+
refuse(`field "${field}": a list of words may name at most ${CUSTOM_FIELD_MAX_WORDS}`, ["fields", field]);
|
|
5681
|
+
}
|
|
5682
|
+
const bad = type.filter((w) => w.length > CUSTOM_WORD_MAX_LENGTH || !CUSTOM_WORD_PATTERN.test(w));
|
|
5683
|
+
if (bad.length > 0) {
|
|
5684
|
+
refuse(`field "${field}": a listed word is lowercase letters, digits, \`_\` and \`-\`, at most ${CUSTOM_WORD_MAX_LENGTH} characters`, ["fields", field]);
|
|
5685
|
+
}
|
|
5686
|
+
if (new Set(type).size !== type.length) {
|
|
5687
|
+
refuse(`field "${field}": a list of words names a word twice`, ["fields", field]);
|
|
5688
|
+
}
|
|
5689
|
+
}
|
|
5690
|
+
}
|
|
5691
|
+
});
|
|
5692
|
+
|
|
5693
|
+
// ../../packages/aeg-core/src/log/schema.ts
|
|
5686
5694
|
var CONFIDENCE_REASON_MAX_LENGTH = 280;
|
|
5687
5695
|
var ROLE_VALUES = [
|
|
5688
5696
|
"planner",
|
|
@@ -5693,178 +5701,210 @@ var ROLE_VALUES = [
|
|
|
5693
5701
|
"archivist",
|
|
5694
5702
|
"architect"
|
|
5695
5703
|
];
|
|
5696
|
-
var RoleSchema =
|
|
5704
|
+
var RoleSchema = z3.enum(ROLE_VALUES);
|
|
5697
5705
|
var HOST_VALUES = ["hook", "ci", "cli", "loop"];
|
|
5698
|
-
var HostSchema =
|
|
5706
|
+
var HostSchema = z3.enum(HOST_VALUES);
|
|
5699
5707
|
var RUN_ID_PATTERN = /^[A-Za-z0-9_.-]{1,128}$/;
|
|
5700
5708
|
var headerMetaCore = {
|
|
5701
|
-
ts:
|
|
5702
|
-
run_id:
|
|
5703
|
-
seq:
|
|
5704
|
-
repo:
|
|
5705
|
-
vinaya:
|
|
5706
|
-
doctrine:
|
|
5709
|
+
ts: z3.string(),
|
|
5710
|
+
run_id: z3.string().regex(RUN_ID_PATTERN),
|
|
5711
|
+
seq: z3.number().int().nonnegative(),
|
|
5712
|
+
repo: z3.string().nullable(),
|
|
5713
|
+
vinaya: z3.string(),
|
|
5714
|
+
doctrine: z3.string(),
|
|
5707
5715
|
host: HostSchema,
|
|
5708
|
-
machine:
|
|
5716
|
+
machine: z3.string()
|
|
5709
5717
|
};
|
|
5710
|
-
var HeaderMetaV1Schema =
|
|
5711
|
-
schema:
|
|
5718
|
+
var HeaderMetaV1Schema = z3.object({
|
|
5719
|
+
schema: z3.literal(1),
|
|
5712
5720
|
...headerMetaCore
|
|
5713
5721
|
}).strict();
|
|
5714
|
-
var LineageSchema =
|
|
5715
|
-
run:
|
|
5716
|
-
attempt:
|
|
5717
|
-
parent:
|
|
5722
|
+
var LineageSchema = z3.object({
|
|
5723
|
+
run: z3.string().nullable(),
|
|
5724
|
+
attempt: z3.number().int().nullable(),
|
|
5725
|
+
parent: z3.string().nullable()
|
|
5718
5726
|
}).strict();
|
|
5719
|
-
var InputVersionsSchema =
|
|
5720
|
-
objectives_version:
|
|
5721
|
-
brief_hash:
|
|
5722
|
-
ruling_ordinal:
|
|
5723
|
-
policy_digest:
|
|
5727
|
+
var InputVersionsSchema = z3.object({
|
|
5728
|
+
objectives_version: z3.string().nullable(),
|
|
5729
|
+
brief_hash: z3.string().nullable(),
|
|
5730
|
+
ruling_ordinal: z3.number().int().nullable(),
|
|
5731
|
+
policy_digest: z3.string().nullable()
|
|
5724
5732
|
}).strict();
|
|
5725
|
-
var ProvenanceSchema =
|
|
5726
|
-
var HeaderMetaV2Schema =
|
|
5727
|
-
schema:
|
|
5733
|
+
var ProvenanceSchema = z3.enum(["parent_attributed", "env_correlated", "self_reported", "unavailable"]);
|
|
5734
|
+
var HeaderMetaV2Schema = z3.object({
|
|
5735
|
+
schema: z3.literal(2),
|
|
5728
5736
|
...headerMetaCore,
|
|
5729
|
-
event_id:
|
|
5730
|
-
process_id:
|
|
5731
|
-
actor_id:
|
|
5737
|
+
event_id: z3.string().min(1),
|
|
5738
|
+
process_id: z3.string().min(1),
|
|
5739
|
+
actor_id: z3.string().nullable(),
|
|
5732
5740
|
lineage: LineageSchema,
|
|
5733
5741
|
input_versions: InputVersionsSchema,
|
|
5734
5742
|
provenance: ProvenanceSchema
|
|
5735
5743
|
}).strict();
|
|
5736
|
-
var
|
|
5737
|
-
|
|
5738
|
-
|
|
5739
|
-
|
|
5740
|
-
|
|
5741
|
-
|
|
5742
|
-
|
|
5743
|
-
|
|
5744
|
+
var WorkSchema = z3.object({
|
|
5745
|
+
ref: z3.string().nullable(),
|
|
5746
|
+
repo: z3.string().nullable(),
|
|
5747
|
+
change: z3.string().nullable(),
|
|
5748
|
+
revision: z3.string().nullable()
|
|
5749
|
+
}).strict();
|
|
5750
|
+
var FlowSchema = z3.object({
|
|
5751
|
+
id: z3.string().nullable(),
|
|
5752
|
+
version: z3.string().nullable()
|
|
5753
|
+
}).strict();
|
|
5754
|
+
var HeaderMetaV3Schema = z3.object({
|
|
5755
|
+
schema: z3.literal(3),
|
|
5756
|
+
...headerMetaCore,
|
|
5757
|
+
event_id: z3.string().min(1),
|
|
5758
|
+
process_id: z3.string().min(1),
|
|
5759
|
+
actor_id: z3.string().nullable(),
|
|
5760
|
+
lineage: LineageSchema,
|
|
5761
|
+
input_versions: InputVersionsSchema,
|
|
5762
|
+
provenance: ProvenanceSchema,
|
|
5763
|
+
work: WorkSchema,
|
|
5764
|
+
flow: FlowSchema,
|
|
5765
|
+
runtime: z3.string().nullable(),
|
|
5766
|
+
source: z3.string().nullable()
|
|
5767
|
+
}).strict();
|
|
5768
|
+
var HeaderMetaSchema = z3.discriminatedUnion("schema", [HeaderMetaV1Schema, HeaderMetaV2Schema, HeaderMetaV3Schema]);
|
|
5769
|
+
var SubjectSchema = z3.object({
|
|
5770
|
+
issue: z3.number().int().nullable(),
|
|
5771
|
+
pr: z3.number().int().optional(),
|
|
5772
|
+
sha: z3.string().optional(),
|
|
5773
|
+
role: z3.union([RoleSchema, z3.literal("unattributed")]),
|
|
5774
|
+
round: z3.number().int().optional(),
|
|
5775
|
+
objectives_version: z3.string().optional()
|
|
5744
5776
|
}).strict();
|
|
5745
|
-
var HeaderSchema =
|
|
5777
|
+
var HeaderSchema = z3.object({
|
|
5746
5778
|
meta: HeaderMetaSchema,
|
|
5747
5779
|
subject: SubjectSchema
|
|
5748
5780
|
}).strict();
|
|
5749
5781
|
var envelopeTail = {
|
|
5750
|
-
duration_ms:
|
|
5751
|
-
payload:
|
|
5782
|
+
duration_ms: z3.number().nonnegative().optional(),
|
|
5783
|
+
payload: z3.object({}).strict()
|
|
5752
5784
|
};
|
|
5753
|
-
var ReviewFindingSchema =
|
|
5754
|
-
id:
|
|
5755
|
-
severity:
|
|
5756
|
-
state:
|
|
5757
|
-
severity_scale:
|
|
5758
|
-
policy_treatment:
|
|
5759
|
-
confidence:
|
|
5760
|
-
confidence_scale:
|
|
5761
|
-
confidence_source:
|
|
5785
|
+
var ReviewFindingSchema = z3.object({
|
|
5786
|
+
id: z3.string(),
|
|
5787
|
+
severity: z3.string(),
|
|
5788
|
+
state: z3.string().optional(),
|
|
5789
|
+
severity_scale: z3.string().optional(),
|
|
5790
|
+
policy_treatment: z3.enum(["blocking", "non_blocking", "unavailable"]).optional(),
|
|
5791
|
+
confidence: z3.number().min(0).max(1).optional(),
|
|
5792
|
+
confidence_scale: z3.string().optional(),
|
|
5793
|
+
confidence_source: z3.string().optional()
|
|
5762
5794
|
}).strict();
|
|
5763
|
-
var DispatchOutcomeSchema =
|
|
5764
|
-
|
|
5765
|
-
|
|
5766
|
-
type:
|
|
5767
|
-
pr:
|
|
5768
|
-
head:
|
|
5769
|
-
comment_id:
|
|
5795
|
+
var DispatchOutcomeSchema = z3.discriminatedUnion("type", [
|
|
5796
|
+
z3.object({ type: z3.literal("pr_opened"), pr: z3.number().int(), head: z3.string() }).strict(),
|
|
5797
|
+
z3.object({
|
|
5798
|
+
type: z3.literal("round_pushed"),
|
|
5799
|
+
pr: z3.number().int(),
|
|
5800
|
+
head: z3.string(),
|
|
5801
|
+
comment_id: z3.number().int()
|
|
5770
5802
|
}).strict(),
|
|
5771
|
-
|
|
5772
|
-
type:
|
|
5773
|
-
verdict:
|
|
5774
|
-
head:
|
|
5775
|
-
comment_id:
|
|
5776
|
-
objectives:
|
|
5777
|
-
findings:
|
|
5803
|
+
z3.object({
|
|
5804
|
+
type: z3.literal("verdict"),
|
|
5805
|
+
verdict: z3.enum(["APPROVE", "REQUEST CHANGES", "PASS", "FAIL"]),
|
|
5806
|
+
head: z3.string(),
|
|
5807
|
+
comment_id: z3.number().int(),
|
|
5808
|
+
objectives: z3.array(z3.object({ id: z3.string(), met: z3.boolean() }).strict()),
|
|
5809
|
+
findings: z3.array(ReviewFindingSchema)
|
|
5778
5810
|
}).strict(),
|
|
5779
|
-
|
|
5780
|
-
type:
|
|
5781
|
-
class:
|
|
5782
|
-
comment_id:
|
|
5811
|
+
z3.object({
|
|
5812
|
+
type: z3.literal("escalation"),
|
|
5813
|
+
class: z3.enum(["authority", "strategy", "product"]),
|
|
5814
|
+
comment_id: z3.number().int()
|
|
5783
5815
|
}).strict(),
|
|
5784
|
-
|
|
5785
|
-
|
|
5786
|
-
|
|
5787
|
-
|
|
5816
|
+
z3.object({ type: z3.literal("brief"), comment_id: z3.number().int(), hash: z3.string() }).strict(),
|
|
5817
|
+
z3.object({ type: z3.literal("plan"), issues: z3.array(z3.number().int()) }).strict(),
|
|
5818
|
+
z3.object({ type: z3.literal("archive"), provenance_comment_id: z3.number().int() }).strict(),
|
|
5819
|
+
z3.object({ type: z3.literal("completed") }).strict()
|
|
5788
5820
|
]);
|
|
5789
5821
|
var dispatchShared = {
|
|
5790
5822
|
meta: HeaderMetaSchema,
|
|
5791
5823
|
subject: SubjectSchema,
|
|
5792
|
-
kind:
|
|
5824
|
+
kind: z3.literal("dispatch"),
|
|
5793
5825
|
...envelopeTail,
|
|
5794
5826
|
target_role: RoleSchema,
|
|
5795
|
-
model:
|
|
5796
|
-
round:
|
|
5797
|
-
effect_id:
|
|
5827
|
+
model: z3.string(),
|
|
5828
|
+
round: z3.number().int().optional(),
|
|
5829
|
+
effect_id: z3.string()
|
|
5798
5830
|
};
|
|
5799
|
-
var dispatchUsageField =
|
|
5800
|
-
var DispatchEventSchema =
|
|
5801
|
-
|
|
5802
|
-
|
|
5831
|
+
var dispatchUsageField = z3.object({ input: z3.number().nonnegative(), output: z3.number().nonnegative() }).strict().nullable();
|
|
5832
|
+
var DispatchEventSchema = z3.discriminatedUnion("event", [
|
|
5833
|
+
z3.object({ ...dispatchShared, event: z3.literal("dispatched"), prompt_hash: z3.string() }).strict(),
|
|
5834
|
+
z3.object({
|
|
5803
5835
|
...dispatchShared,
|
|
5804
|
-
event:
|
|
5836
|
+
event: z3.literal("outcome_received"),
|
|
5805
5837
|
outcome: DispatchOutcomeSchema,
|
|
5806
5838
|
usage: dispatchUsageField
|
|
5807
5839
|
}).strict(),
|
|
5808
|
-
|
|
5840
|
+
z3.object({
|
|
5809
5841
|
...dispatchShared,
|
|
5810
|
-
event:
|
|
5811
|
-
reason:
|
|
5842
|
+
event: z3.literal("dispatch_failed"),
|
|
5843
|
+
reason: z3.enum(["timeout", "crash", "refused", "unattributed_write"]),
|
|
5812
5844
|
usage: dispatchUsageField
|
|
5813
5845
|
}).strict()
|
|
5814
5846
|
]);
|
|
5847
|
+
var CODE_TOKEN_PATTERN = /^[A-Za-z0-9._-]{1,64}$/;
|
|
5848
|
+
var CodeTokenSchema = z3.string().regex(CODE_TOKEN_PATTERN);
|
|
5849
|
+
var ReviewerVerdictSchema = z3.object({
|
|
5850
|
+
role: RoleSchema,
|
|
5851
|
+
outcome: z3.enum(["approve", "changes_requested", "not_reviewed"]),
|
|
5852
|
+
blockers: z3.number().int().nonnegative()
|
|
5853
|
+
}).strict();
|
|
5815
5854
|
var loopShared = {
|
|
5816
5855
|
meta: HeaderMetaSchema,
|
|
5817
5856
|
subject: SubjectSchema,
|
|
5818
|
-
kind:
|
|
5857
|
+
kind: z3.literal("dev_review_loop"),
|
|
5819
5858
|
...envelopeTail,
|
|
5820
|
-
loop_id:
|
|
5859
|
+
loop_id: z3.string()
|
|
5821
5860
|
};
|
|
5822
|
-
var DevReviewLoopEventSchema =
|
|
5823
|
-
|
|
5861
|
+
var DevReviewLoopEventSchema = z3.discriminatedUnion("event", [
|
|
5862
|
+
z3.object({
|
|
5824
5863
|
...loopShared,
|
|
5825
|
-
event:
|
|
5826
|
-
task:
|
|
5827
|
-
policy:
|
|
5828
|
-
max_rounds:
|
|
5829
|
-
reviewers:
|
|
5830
|
-
models:
|
|
5864
|
+
event: z3.literal("loop_started"),
|
|
5865
|
+
task: z3.number().int(),
|
|
5866
|
+
policy: z3.object({
|
|
5867
|
+
max_rounds: z3.number().int().nonnegative(),
|
|
5868
|
+
reviewers: z3.array(RoleSchema),
|
|
5869
|
+
models: z3.record(RoleSchema, z3.string())
|
|
5831
5870
|
}).strict()
|
|
5832
5871
|
}).strict(),
|
|
5833
|
-
|
|
5834
|
-
|
|
5872
|
+
z3.object({ ...loopShared, event: z3.literal("round_started"), round: z3.number().int(), base_head: z3.string() }).strict(),
|
|
5873
|
+
z3.object({
|
|
5835
5874
|
...loopShared,
|
|
5836
|
-
event:
|
|
5837
|
-
round:
|
|
5838
|
-
head:
|
|
5839
|
-
green:
|
|
5840
|
-
confidence_value:
|
|
5841
|
-
confidence_reason:
|
|
5842
|
-
confidence_unavailable:
|
|
5843
|
-
extra_turn_spent:
|
|
5875
|
+
event: z3.literal("gate_result_read"),
|
|
5876
|
+
round: z3.number().int(),
|
|
5877
|
+
head: z3.string(),
|
|
5878
|
+
green: z3.boolean(),
|
|
5879
|
+
confidence_value: z3.number().int().min(0).max(100).optional(),
|
|
5880
|
+
confidence_reason: z3.string().max(CONFIDENCE_REASON_MAX_LENGTH).optional(),
|
|
5881
|
+
confidence_unavailable: z3.boolean().optional(),
|
|
5882
|
+
extra_turn_spent: z3.boolean().optional()
|
|
5844
5883
|
}).strict(),
|
|
5845
|
-
|
|
5884
|
+
z3.object({
|
|
5846
5885
|
...loopShared,
|
|
5847
|
-
event:
|
|
5848
|
-
round:
|
|
5849
|
-
head:
|
|
5850
|
-
all_approve:
|
|
5851
|
-
blockers:
|
|
5852
|
-
findings:
|
|
5886
|
+
event: z3.literal("verdicts_read"),
|
|
5887
|
+
round: z3.number().int(),
|
|
5888
|
+
head: z3.string(),
|
|
5889
|
+
all_approve: z3.boolean(),
|
|
5890
|
+
blockers: z3.number().int().nonnegative(),
|
|
5891
|
+
findings: z3.array(ReviewFindingSchema).optional(),
|
|
5892
|
+
reviewers: z3.array(ReviewerVerdictSchema).optional()
|
|
5853
5893
|
}).strict(),
|
|
5854
|
-
|
|
5894
|
+
z3.object({
|
|
5855
5895
|
...loopShared,
|
|
5856
|
-
event:
|
|
5857
|
-
round:
|
|
5858
|
-
open:
|
|
5859
|
-
resolved:
|
|
5860
|
-
new:
|
|
5861
|
-
recurring:
|
|
5896
|
+
event: z3.literal("findings_compared"),
|
|
5897
|
+
round: z3.number().int(),
|
|
5898
|
+
open: z3.array(z3.string()),
|
|
5899
|
+
resolved: z3.array(z3.string()),
|
|
5900
|
+
new: z3.array(z3.string()),
|
|
5901
|
+
recurring: z3.array(z3.string())
|
|
5862
5902
|
}).strict(),
|
|
5863
|
-
|
|
5903
|
+
z3.object({
|
|
5864
5904
|
...loopShared,
|
|
5865
|
-
event:
|
|
5866
|
-
round:
|
|
5867
|
-
condition:
|
|
5905
|
+
event: z3.literal("stop_condition_met"),
|
|
5906
|
+
round: z3.number().int(),
|
|
5907
|
+
condition: z3.enum([
|
|
5868
5908
|
"green",
|
|
5869
5909
|
"max_rounds",
|
|
5870
5910
|
"no_progress",
|
|
@@ -5873,66 +5913,85 @@ var DevReviewLoopEventSchema = z2.discriminatedUnion("event", [
|
|
|
5873
5913
|
"confidence",
|
|
5874
5914
|
"reappearance",
|
|
5875
5915
|
"repeat_finding",
|
|
5876
|
-
"repeat_failure"
|
|
5916
|
+
"repeat_failure",
|
|
5917
|
+
"time_budget"
|
|
5877
5918
|
])
|
|
5878
5919
|
}).strict(),
|
|
5879
|
-
|
|
5920
|
+
z3.object({
|
|
5921
|
+
...loopShared,
|
|
5922
|
+
event: z3.literal("paused"),
|
|
5923
|
+
round: z3.number().int(),
|
|
5924
|
+
reason: z3.enum(["escalation", "principal_item", "refreeze_needed"]),
|
|
5925
|
+
reason_code: CodeTokenSchema.optional()
|
|
5926
|
+
}).strict(),
|
|
5927
|
+
z3.object({
|
|
5928
|
+
...loopShared,
|
|
5929
|
+
event: z3.literal("resumed"),
|
|
5930
|
+
round: z3.number().int(),
|
|
5931
|
+
by: z3.enum(["principal", "driver"])
|
|
5932
|
+
}).strict(),
|
|
5933
|
+
z3.object({
|
|
5880
5934
|
...loopShared,
|
|
5881
|
-
event:
|
|
5882
|
-
round:
|
|
5883
|
-
|
|
5935
|
+
event: z3.literal("cancelled"),
|
|
5936
|
+
round: z3.number().int(),
|
|
5937
|
+
by: z3.literal("principal")
|
|
5884
5938
|
}).strict(),
|
|
5885
|
-
|
|
5939
|
+
z3.object({
|
|
5886
5940
|
...loopShared,
|
|
5887
|
-
event:
|
|
5888
|
-
round:
|
|
5889
|
-
|
|
5941
|
+
event: z3.literal("unpushed_work_resume"),
|
|
5942
|
+
round: z3.number().int(),
|
|
5943
|
+
branch: z3.string(),
|
|
5944
|
+
detail: z3.string()
|
|
5890
5945
|
}).strict(),
|
|
5891
|
-
|
|
5946
|
+
z3.object({
|
|
5892
5947
|
...loopShared,
|
|
5893
|
-
event:
|
|
5894
|
-
round:
|
|
5895
|
-
|
|
5948
|
+
event: z3.literal("round_ended"),
|
|
5949
|
+
round: z3.number().int(),
|
|
5950
|
+
base_head: z3.string(),
|
|
5951
|
+
head: z3.string(),
|
|
5952
|
+
files_changed: z3.number().int().nonnegative(),
|
|
5953
|
+
insertions: z3.number().int().nonnegative(),
|
|
5954
|
+
deletions: z3.number().int().nonnegative(),
|
|
5955
|
+
wall_ms: z3.number().nonnegative(),
|
|
5956
|
+
outcome: z3.enum(["green", "changes_requested", "escalated"])
|
|
5896
5957
|
}).strict(),
|
|
5897
|
-
|
|
5958
|
+
z3.object({
|
|
5898
5959
|
...loopShared,
|
|
5899
|
-
event:
|
|
5900
|
-
|
|
5901
|
-
|
|
5902
|
-
|
|
5960
|
+
event: z3.literal("journal_finalized"),
|
|
5961
|
+
rounds: z3.number().int().nonnegative(),
|
|
5962
|
+
total_wall_ms: z3.number().nonnegative(),
|
|
5963
|
+
time_to_green_ms: z3.number().nonnegative().nullable(),
|
|
5964
|
+
files_changed_total: z3.number().int().nonnegative(),
|
|
5965
|
+
final_head: z3.string(),
|
|
5966
|
+
result: z3.enum(["merged_ready", "stopped"])
|
|
5903
5967
|
}).strict(),
|
|
5904
|
-
|
|
5968
|
+
z3.object({
|
|
5905
5969
|
...loopShared,
|
|
5906
|
-
event:
|
|
5907
|
-
round:
|
|
5908
|
-
|
|
5909
|
-
|
|
5910
|
-
|
|
5911
|
-
insertions: z2.number().int().nonnegative(),
|
|
5912
|
-
deletions: z2.number().int().nonnegative(),
|
|
5913
|
-
wall_ms: z2.number().nonnegative(),
|
|
5914
|
-
outcome: z2.enum(["green", "changes_requested", "escalated"])
|
|
5970
|
+
event: z3.literal("infrastructure_retry"),
|
|
5971
|
+
round: z3.number().int(),
|
|
5972
|
+
failure_kind: z3.enum(["pause_comment_post", "developer_connection"]),
|
|
5973
|
+
attempts: z3.number().int().positive(),
|
|
5974
|
+
outcome: z3.enum(["recovered", "exhausted"])
|
|
5915
5975
|
}).strict(),
|
|
5916
|
-
|
|
5976
|
+
z3.object({
|
|
5917
5977
|
...loopShared,
|
|
5918
|
-
event:
|
|
5919
|
-
|
|
5920
|
-
|
|
5921
|
-
|
|
5922
|
-
|
|
5923
|
-
final_head: z2.string(),
|
|
5924
|
-
result: z2.enum(["merged_ready", "stopped"])
|
|
5978
|
+
event: z3.literal("driver_heartbeat"),
|
|
5979
|
+
task: z3.number().int(),
|
|
5980
|
+
pr: z3.number().int().positive().optional(),
|
|
5981
|
+
round: z3.number().int(),
|
|
5982
|
+
phase: z3.string()
|
|
5925
5983
|
}).strict(),
|
|
5926
|
-
|
|
5984
|
+
z3.object({
|
|
5927
5985
|
...loopShared,
|
|
5928
|
-
event:
|
|
5929
|
-
|
|
5930
|
-
|
|
5931
|
-
|
|
5932
|
-
|
|
5986
|
+
event: z3.literal("driver_exited"),
|
|
5987
|
+
task: z3.number().int(),
|
|
5988
|
+
reason: z3.enum(["finished", "paused", "reexec", "error", "signal"]),
|
|
5989
|
+
last_decision: z3.string(),
|
|
5990
|
+
exit_code: z3.number().int().optional(),
|
|
5991
|
+
error_class: CodeTokenSchema.optional()
|
|
5933
5992
|
}).strict()
|
|
5934
5993
|
]);
|
|
5935
|
-
var ForgeOpSchema =
|
|
5994
|
+
var ForgeOpSchema = z3.enum([
|
|
5936
5995
|
"pr.create",
|
|
5937
5996
|
"pr.comment",
|
|
5938
5997
|
"pr.body.replace",
|
|
@@ -5946,24 +6005,24 @@ var ForgeOpSchema = z2.enum([
|
|
|
5946
6005
|
"label.add",
|
|
5947
6006
|
"label.remove"
|
|
5948
6007
|
]);
|
|
5949
|
-
var ForgeWriteTargetSchema =
|
|
5950
|
-
issue:
|
|
5951
|
-
pr:
|
|
6008
|
+
var ForgeWriteTargetSchema = z3.object({
|
|
6009
|
+
issue: z3.number().int().optional(),
|
|
6010
|
+
pr: z3.number().int().optional()
|
|
5952
6011
|
}).strict();
|
|
5953
6012
|
var forgeWriteShared = {
|
|
5954
6013
|
meta: HeaderMetaSchema,
|
|
5955
6014
|
subject: SubjectSchema,
|
|
5956
|
-
kind:
|
|
6015
|
+
kind: z3.literal("forge_write"),
|
|
5957
6016
|
...envelopeTail,
|
|
5958
6017
|
op: ForgeOpSchema,
|
|
5959
6018
|
target: ForgeWriteTargetSchema
|
|
5960
6019
|
};
|
|
5961
|
-
var ForgeWriteEventSchema =
|
|
5962
|
-
|
|
5963
|
-
|
|
5964
|
-
|
|
6020
|
+
var ForgeWriteEventSchema = z3.discriminatedUnion("event", [
|
|
6021
|
+
z3.object({ ...forgeWriteShared, event: z3.literal("validated") }).strict(),
|
|
6022
|
+
z3.object({ ...forgeWriteShared, event: z3.literal("refused"), reason: z3.string() }).strict(),
|
|
6023
|
+
z3.object({ ...forgeWriteShared, event: z3.literal("written"), comment_ids: z3.array(z3.string()) }).strict()
|
|
5965
6024
|
]);
|
|
5966
|
-
var GateOutcomeSchema =
|
|
6025
|
+
var GateOutcomeSchema = z3.enum([
|
|
5967
6026
|
"pass",
|
|
5968
6027
|
"fail",
|
|
5969
6028
|
"wait",
|
|
@@ -5976,61 +6035,74 @@ var GateOutcomeSchema = z2.enum([
|
|
|
5976
6035
|
var gateShared = {
|
|
5977
6036
|
meta: HeaderMetaSchema,
|
|
5978
6037
|
subject: SubjectSchema,
|
|
5979
|
-
kind:
|
|
6038
|
+
kind: z3.literal("gate"),
|
|
5980
6039
|
...envelopeTail,
|
|
5981
|
-
check:
|
|
5982
|
-
check_version:
|
|
5983
|
-
policy_version:
|
|
5984
|
-
input_fingerprint:
|
|
6040
|
+
check: z3.string(),
|
|
6041
|
+
check_version: z3.string().nullable(),
|
|
6042
|
+
policy_version: z3.string().nullable(),
|
|
6043
|
+
input_fingerprint: z3.string().nullable()
|
|
5985
6044
|
};
|
|
5986
|
-
var GateEventSchema =
|
|
5987
|
-
|
|
6045
|
+
var GateEventSchema = z3.discriminatedUnion("event", [
|
|
6046
|
+
z3.object({
|
|
5988
6047
|
...gateShared,
|
|
5989
|
-
event:
|
|
6048
|
+
event: z3.literal("checked"),
|
|
5990
6049
|
outcome: GateOutcomeSchema,
|
|
5991
|
-
reason:
|
|
6050
|
+
reason: z3.string().optional()
|
|
6051
|
+
}).strict(),
|
|
6052
|
+
z3.object({
|
|
6053
|
+
meta: HeaderMetaSchema,
|
|
6054
|
+
subject: SubjectSchema,
|
|
6055
|
+
kind: z3.literal("gate"),
|
|
6056
|
+
...envelopeTail,
|
|
6057
|
+
event: z3.literal("summary"),
|
|
6058
|
+
ran: z3.number().int().nonnegative(),
|
|
6059
|
+
passed: z3.number().int().nonnegative(),
|
|
6060
|
+
failed: z3.number().int().nonnegative(),
|
|
6061
|
+
skipped: z3.number().int().nonnegative(),
|
|
6062
|
+
failed_checks: z3.array(z3.string())
|
|
5992
6063
|
}).strict()
|
|
5993
6064
|
]);
|
|
5994
|
-
var OperationResultSchema =
|
|
6065
|
+
var OperationResultSchema = z3.enum(["ok", "error", "refused", "timeout", "cancelled", "unavailable"]);
|
|
5995
6066
|
var operationShared = {
|
|
5996
6067
|
meta: HeaderMetaSchema,
|
|
5997
6068
|
subject: SubjectSchema,
|
|
5998
|
-
kind:
|
|
6069
|
+
kind: z3.literal("operation"),
|
|
5999
6070
|
...envelopeTail,
|
|
6000
|
-
operation:
|
|
6001
|
-
target:
|
|
6071
|
+
operation: z3.string(),
|
|
6072
|
+
target: z3.string().nullable()
|
|
6002
6073
|
};
|
|
6003
|
-
var OperationEventSchema =
|
|
6004
|
-
|
|
6074
|
+
var OperationEventSchema = z3.discriminatedUnion("event", [
|
|
6075
|
+
z3.object({
|
|
6005
6076
|
...operationShared,
|
|
6006
|
-
event:
|
|
6077
|
+
event: z3.literal("completed"),
|
|
6007
6078
|
result: OperationResultSchema,
|
|
6008
|
-
error_class:
|
|
6079
|
+
error_class: z3.string().nullable(),
|
|
6080
|
+
field_names: z3.array(z3.string().max(CUSTOM_FIELD_NAME_MAX_LENGTH)).max(CUSTOM_EVENT_MAX_FIELDS).optional()
|
|
6009
6081
|
}).strict()
|
|
6010
6082
|
]);
|
|
6011
|
-
var UsageUnitsSchema =
|
|
6012
|
-
input:
|
|
6013
|
-
output:
|
|
6014
|
-
cache:
|
|
6083
|
+
var UsageUnitsSchema = z3.object({
|
|
6084
|
+
input: z3.number().nonnegative().nullable(),
|
|
6085
|
+
output: z3.number().nonnegative().nullable(),
|
|
6086
|
+
cache: z3.number().nonnegative().nullable()
|
|
6015
6087
|
}).strict();
|
|
6016
6088
|
var usageShared = {
|
|
6017
6089
|
meta: HeaderMetaSchema,
|
|
6018
6090
|
subject: SubjectSchema,
|
|
6019
|
-
kind:
|
|
6091
|
+
kind: z3.literal("usage"),
|
|
6020
6092
|
...envelopeTail,
|
|
6021
|
-
model:
|
|
6022
|
-
source:
|
|
6023
|
-
semantics:
|
|
6093
|
+
model: z3.string().nullable(),
|
|
6094
|
+
source: z3.string(),
|
|
6095
|
+
semantics: z3.enum(["cumulative", "delta"])
|
|
6024
6096
|
};
|
|
6025
|
-
var UsageEventSchema =
|
|
6026
|
-
|
|
6097
|
+
var UsageEventSchema = z3.discriminatedUnion("event", [
|
|
6098
|
+
z3.object({
|
|
6027
6099
|
...usageShared,
|
|
6028
|
-
event:
|
|
6100
|
+
event: z3.literal("observed"),
|
|
6029
6101
|
units: UsageUnitsSchema,
|
|
6030
|
-
unknown_reason:
|
|
6102
|
+
unknown_reason: z3.string().nullable()
|
|
6031
6103
|
}).strict()
|
|
6032
6104
|
]);
|
|
6033
|
-
var RoleAttemptOutcomeSchema =
|
|
6105
|
+
var RoleAttemptOutcomeSchema = z3.enum([
|
|
6034
6106
|
"completed",
|
|
6035
6107
|
"incomplete",
|
|
6036
6108
|
"infrastructure_failed",
|
|
@@ -6041,17 +6113,17 @@ var RoleAttemptOutcomeSchema = z2.enum([
|
|
|
6041
6113
|
var roleAttemptShared = {
|
|
6042
6114
|
meta: HeaderMetaSchema,
|
|
6043
6115
|
subject: SubjectSchema,
|
|
6044
|
-
kind:
|
|
6116
|
+
kind: z3.literal("role_attempt"),
|
|
6045
6117
|
...envelopeTail,
|
|
6046
|
-
actor:
|
|
6047
|
-
attempt:
|
|
6048
|
-
effect_id:
|
|
6049
|
-
model:
|
|
6118
|
+
actor: z3.string().nullable(),
|
|
6119
|
+
attempt: z3.number().int().nullable(),
|
|
6120
|
+
effect_id: z3.string(),
|
|
6121
|
+
model: z3.string().nullable()
|
|
6050
6122
|
};
|
|
6051
|
-
var RoleAttemptEventSchema =
|
|
6052
|
-
|
|
6123
|
+
var RoleAttemptEventSchema = z3.discriminatedUnion("event", [
|
|
6124
|
+
z3.object({
|
|
6053
6125
|
...roleAttemptShared,
|
|
6054
|
-
event:
|
|
6126
|
+
event: z3.literal("attempted"),
|
|
6055
6127
|
outcome: RoleAttemptOutcomeSchema,
|
|
6056
6128
|
usage: dispatchUsageField
|
|
6057
6129
|
}).strict()
|
|
@@ -6059,42 +6131,59 @@ var RoleAttemptEventSchema = z2.discriminatedUnion("event", [
|
|
|
6059
6131
|
var handoffShared = {
|
|
6060
6132
|
meta: HeaderMetaSchema,
|
|
6061
6133
|
subject: SubjectSchema,
|
|
6062
|
-
kind:
|
|
6134
|
+
kind: z3.literal("handoff"),
|
|
6063
6135
|
...envelopeTail,
|
|
6064
|
-
class:
|
|
6065
|
-
reason:
|
|
6136
|
+
class: z3.enum(["authority", "strategy", "product"]),
|
|
6137
|
+
reason: z3.string()
|
|
6066
6138
|
};
|
|
6067
|
-
var HandoffEventSchema =
|
|
6068
|
-
|
|
6139
|
+
var HandoffEventSchema = z3.discriminatedUnion("event", [
|
|
6140
|
+
z3.object({
|
|
6069
6141
|
...handoffShared,
|
|
6070
|
-
event:
|
|
6071
|
-
requested_decision:
|
|
6142
|
+
event: z3.literal("raised"),
|
|
6143
|
+
requested_decision: z3.string().nullable()
|
|
6072
6144
|
}).strict(),
|
|
6073
|
-
|
|
6145
|
+
z3.object({
|
|
6074
6146
|
...handoffShared,
|
|
6075
|
-
event:
|
|
6076
|
-
resolution:
|
|
6077
|
-
resolved_by:
|
|
6147
|
+
event: z3.literal("resolved"),
|
|
6148
|
+
resolution: z3.string().nullable(),
|
|
6149
|
+
resolved_by: z3.string().nullable()
|
|
6078
6150
|
}).strict()
|
|
6079
6151
|
]);
|
|
6080
|
-
var EffectTargetSchema =
|
|
6081
|
-
kind:
|
|
6082
|
-
ref:
|
|
6152
|
+
var EffectTargetSchema = z3.object({
|
|
6153
|
+
kind: z3.string(),
|
|
6154
|
+
ref: z3.string()
|
|
6083
6155
|
}).strict();
|
|
6084
6156
|
var effectShared = {
|
|
6085
6157
|
meta: HeaderMetaSchema,
|
|
6086
6158
|
subject: SubjectSchema,
|
|
6087
|
-
kind:
|
|
6159
|
+
kind: z3.literal("effect"),
|
|
6088
6160
|
...envelopeTail,
|
|
6089
|
-
effect_id:
|
|
6161
|
+
effect_id: z3.string(),
|
|
6090
6162
|
target: EffectTargetSchema
|
|
6091
6163
|
};
|
|
6092
|
-
var EffectEventSchema =
|
|
6093
|
-
|
|
6094
|
-
|
|
6095
|
-
|
|
6164
|
+
var EffectEventSchema = z3.discriminatedUnion("event", [
|
|
6165
|
+
z3.object({ ...effectShared, event: z3.literal("attempted") }).strict(),
|
|
6166
|
+
z3.object({ ...effectShared, event: z3.literal("observed"), outcome: z3.enum(["success", "failure", "uncertain"]) }).strict(),
|
|
6167
|
+
z3.object({ ...effectShared, event: z3.literal("verified"), outcome: z3.enum(["success", "failure", "uncertain"]) }).strict()
|
|
6168
|
+
]);
|
|
6169
|
+
var CustomFieldValueSchema = z3.union([z3.string().max(CUSTOM_TEXT_MAX_LENGTH), z3.number().finite(), z3.boolean()]);
|
|
6170
|
+
var customShared = {
|
|
6171
|
+
meta: HeaderMetaV3Schema,
|
|
6172
|
+
subject: SubjectSchema,
|
|
6173
|
+
kind: z3.literal("custom"),
|
|
6174
|
+
...envelopeTail
|
|
6175
|
+
};
|
|
6176
|
+
var CustomEventSchema = z3.discriminatedUnion("event", [
|
|
6177
|
+
z3.object({
|
|
6178
|
+
...customShared,
|
|
6179
|
+
event: z3.literal("recorded"),
|
|
6180
|
+
name: z3.string().max(CUSTOM_EVENT_NAME_MAX_LENGTH).regex(CUSTOM_EVENT_NAME_PATTERN),
|
|
6181
|
+
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, {
|
|
6182
|
+
message: `custom: at most ${CUSTOM_EVENT_MAX_FIELDS} fields`
|
|
6183
|
+
})
|
|
6184
|
+
}).strict()
|
|
6096
6185
|
]);
|
|
6097
|
-
var LogEventSchema =
|
|
6186
|
+
var LogEventSchema = z3.union([
|
|
6098
6187
|
DispatchEventSchema,
|
|
6099
6188
|
DevReviewLoopEventSchema,
|
|
6100
6189
|
ForgeWriteEventSchema,
|
|
@@ -6103,10 +6192,11 @@ var LogEventSchema = z2.union([
|
|
|
6103
6192
|
UsageEventSchema,
|
|
6104
6193
|
RoleAttemptEventSchema,
|
|
6105
6194
|
HandoffEventSchema,
|
|
6106
|
-
EffectEventSchema
|
|
6195
|
+
EffectEventSchema,
|
|
6196
|
+
CustomEventSchema
|
|
6107
6197
|
]);
|
|
6108
|
-
|
|
6109
6198
|
// ../../packages/aeg-core/src/log/envelope.ts
|
|
6199
|
+
import { createHash as createHash5 } from "node:crypto";
|
|
6110
6200
|
function isRole(value) {
|
|
6111
6201
|
return value !== undefined && ROLE_VALUES.includes(value);
|
|
6112
6202
|
}
|
|
@@ -6143,18 +6233,27 @@ function roundFromEnv(round) {
|
|
|
6143
6233
|
const n = Number(round);
|
|
6144
6234
|
return Number.isInteger(n) ? n : undefined;
|
|
6145
6235
|
}
|
|
6236
|
+
function prFromEnv(pr) {
|
|
6237
|
+
if (pr === undefined || pr === "")
|
|
6238
|
+
return;
|
|
6239
|
+
const n = Number(pr);
|
|
6240
|
+
return Number.isInteger(n) && n > 0 ? n : undefined;
|
|
6241
|
+
}
|
|
6146
6242
|
function buildHeader(input) {
|
|
6147
6243
|
const role = isRole(input.env.role) ? input.env.role : "unattributed";
|
|
6148
6244
|
const round = roundFromEnv(input.env.round);
|
|
6245
|
+
const pr = prFromEnv(input.env.pr);
|
|
6149
6246
|
const subject = {
|
|
6150
6247
|
issue: issueFromTask(input.env.task) ?? input.branchIssue ?? null,
|
|
6151
6248
|
role,
|
|
6152
6249
|
...round !== undefined ? { round } : {},
|
|
6250
|
+
...pr !== undefined ? { pr } : {},
|
|
6153
6251
|
...input.subject ?? {}
|
|
6154
6252
|
};
|
|
6253
|
+
const issue = subject.issue;
|
|
6155
6254
|
return {
|
|
6156
6255
|
meta: {
|
|
6157
|
-
schema:
|
|
6256
|
+
schema: 3,
|
|
6158
6257
|
ts: input.now.toISOString(),
|
|
6159
6258
|
run_id: input.runId,
|
|
6160
6259
|
seq: input.seq,
|
|
@@ -6177,7 +6276,19 @@ function buildHeader(input) {
|
|
|
6177
6276
|
ruling_ordinal: input.inputVersions?.rulingOrdinal ?? null,
|
|
6178
6277
|
policy_digest: input.inputVersions?.policyDigest ?? null
|
|
6179
6278
|
},
|
|
6180
|
-
provenance: provenanceFor(input)
|
|
6279
|
+
provenance: provenanceFor(input),
|
|
6280
|
+
work: {
|
|
6281
|
+
ref: lineageFieldFromEnv(input.env.workRef) ?? (issue === null ? null : String(issue)),
|
|
6282
|
+
repo: input.repo,
|
|
6283
|
+
change: null,
|
|
6284
|
+
revision: null
|
|
6285
|
+
},
|
|
6286
|
+
flow: {
|
|
6287
|
+
id: lineageFieldFromEnv(input.env.flow) ?? "vinaya",
|
|
6288
|
+
version: lineageFieldFromEnv(input.env.flowVersion)
|
|
6289
|
+
},
|
|
6290
|
+
runtime: lineageFieldFromEnv(input.env.runtime),
|
|
6291
|
+
source: lineageFieldFromEnv(input.env.source)
|
|
6181
6292
|
},
|
|
6182
6293
|
subject
|
|
6183
6294
|
};
|
|
@@ -6220,7 +6331,7 @@ function redact(value, home) {
|
|
|
6220
6331
|
return value;
|
|
6221
6332
|
}
|
|
6222
6333
|
// ../../packages/aeg-core/src/log/store.ts
|
|
6223
|
-
var KNOWN_SCHEMA_VERSIONS = [1, 2];
|
|
6334
|
+
var KNOWN_SCHEMA_VERSIONS = [1, 2, 3];
|
|
6224
6335
|
function metaOf(obj) {
|
|
6225
6336
|
if (obj === null || typeof obj !== "object")
|
|
6226
6337
|
return null;
|
|
@@ -6286,7 +6397,7 @@ function classifyStoredLine(raw, home) {
|
|
|
6286
6397
|
return { status: "invalid", identity: null, raw, reason: "valid event with no derivable identity" };
|
|
6287
6398
|
}
|
|
6288
6399
|
const redacted = redact(event, home);
|
|
6289
|
-
const provenance = version
|
|
6400
|
+
const provenance = version >= 2 ? event.meta.provenance ?? null : null;
|
|
6290
6401
|
return {
|
|
6291
6402
|
status: "ok",
|
|
6292
6403
|
identity,
|
|
@@ -6299,138 +6410,143 @@ function classifyStoredLine(raw, home) {
|
|
|
6299
6410
|
};
|
|
6300
6411
|
}
|
|
6301
6412
|
// ../../packages/aeg-core/src/control-store/records.ts
|
|
6302
|
-
import { z as
|
|
6303
|
-
var isoTimestamp =
|
|
6304
|
-
var taskId =
|
|
6305
|
-
var epochNumber =
|
|
6306
|
-
var RunRecordSchema =
|
|
6307
|
-
version:
|
|
6308
|
-
kind:
|
|
6413
|
+
import { z as z4 } from "zod";
|
|
6414
|
+
var isoTimestamp = z4.string().min(1);
|
|
6415
|
+
var taskId = z4.number().int().positive();
|
|
6416
|
+
var epochNumber = z4.number().int().nonnegative();
|
|
6417
|
+
var RunRecordSchema = z4.object({
|
|
6418
|
+
version: z4.literal(1),
|
|
6419
|
+
kind: z4.literal("run"),
|
|
6309
6420
|
task: taskId,
|
|
6310
|
-
runId:
|
|
6311
|
-
pid:
|
|
6312
|
-
host:
|
|
6421
|
+
runId: z4.string().min(1),
|
|
6422
|
+
pid: z4.number().int().positive(),
|
|
6423
|
+
host: z4.string().min(1),
|
|
6313
6424
|
startedAt: isoTimestamp,
|
|
6314
|
-
childStartedAt:
|
|
6315
|
-
childCommand:
|
|
6425
|
+
childStartedAt: z4.string().min(1).nullable().optional(),
|
|
6426
|
+
childCommand: z4.string().min(1).nullable().optional()
|
|
6316
6427
|
}).strict();
|
|
6317
|
-
var InputRecordSchema =
|
|
6318
|
-
version:
|
|
6319
|
-
kind:
|
|
6428
|
+
var InputRecordSchema = z4.object({
|
|
6429
|
+
version: z4.literal(1),
|
|
6430
|
+
kind: z4.literal("input"),
|
|
6320
6431
|
task: taskId,
|
|
6321
|
-
runId:
|
|
6322
|
-
source:
|
|
6323
|
-
pr:
|
|
6324
|
-
round:
|
|
6432
|
+
runId: z4.string().min(1),
|
|
6433
|
+
source: z4.union([z4.literal("fresh"), z4.literal("resume")]),
|
|
6434
|
+
pr: z4.number().int().positive().nullable(),
|
|
6435
|
+
round: z4.number().int().nonnegative(),
|
|
6325
6436
|
recordedAt: isoTimestamp
|
|
6326
6437
|
}).strict();
|
|
6327
|
-
var OwnershipRecordSchema =
|
|
6328
|
-
version:
|
|
6329
|
-
kind:
|
|
6438
|
+
var OwnershipRecordSchema = z4.object({
|
|
6439
|
+
version: z4.literal(1),
|
|
6440
|
+
kind: z4.literal("ownership"),
|
|
6330
6441
|
task: taskId,
|
|
6331
6442
|
epoch: epochNumber,
|
|
6332
|
-
ownerId:
|
|
6333
|
-
pid:
|
|
6334
|
-
host:
|
|
6443
|
+
ownerId: z4.string().min(1),
|
|
6444
|
+
pid: z4.number().int().positive(),
|
|
6445
|
+
host: z4.string().min(1),
|
|
6335
6446
|
acquiredAt: isoTimestamp
|
|
6336
6447
|
}).strict();
|
|
6337
|
-
var TransitionRecordSchema =
|
|
6338
|
-
version:
|
|
6339
|
-
kind:
|
|
6448
|
+
var TransitionRecordSchema = z4.object({
|
|
6449
|
+
version: z4.literal(1),
|
|
6450
|
+
kind: z4.literal("transition"),
|
|
6340
6451
|
task: taskId,
|
|
6341
6452
|
epoch: epochNumber,
|
|
6342
|
-
seq:
|
|
6343
|
-
from:
|
|
6344
|
-
to:
|
|
6345
|
-
detail:
|
|
6453
|
+
seq: z4.number().int().nonnegative(),
|
|
6454
|
+
from: z4.string().min(1),
|
|
6455
|
+
to: z4.string().min(1),
|
|
6456
|
+
detail: z4.string().optional(),
|
|
6346
6457
|
at: isoTimestamp
|
|
6347
6458
|
}).strict();
|
|
6348
|
-
var ManifestRecordSchema =
|
|
6349
|
-
version:
|
|
6350
|
-
kind:
|
|
6459
|
+
var ManifestRecordSchema = z4.object({
|
|
6460
|
+
version: z4.literal(1),
|
|
6461
|
+
kind: z4.literal("manifest"),
|
|
6351
6462
|
task: taskId,
|
|
6352
6463
|
round: epochNumber,
|
|
6353
|
-
repository:
|
|
6354
|
-
pr:
|
|
6355
|
-
branch:
|
|
6356
|
-
baseSha:
|
|
6357
|
-
headSha:
|
|
6358
|
-
briefHash:
|
|
6359
|
-
objectivesVersion:
|
|
6464
|
+
repository: z4.string().min(1),
|
|
6465
|
+
pr: z4.number().int().positive(),
|
|
6466
|
+
branch: z4.string().min(1),
|
|
6467
|
+
baseSha: z4.string().min(1).nullable(),
|
|
6468
|
+
headSha: z4.string().min(1),
|
|
6469
|
+
briefHash: z4.string().min(1).nullable(),
|
|
6470
|
+
objectivesVersion: z4.string().min(1).nullable(),
|
|
6360
6471
|
rulingOrdinal: epochNumber,
|
|
6361
|
-
policyDigest:
|
|
6472
|
+
policyDigest: z4.string().min(1),
|
|
6362
6473
|
recordedAt: isoTimestamp
|
|
6363
6474
|
}).strict();
|
|
6364
|
-
var roundHeadIdentity =
|
|
6365
|
-
var LoopBudgetsSchema =
|
|
6366
|
-
mechanicalRetries:
|
|
6367
|
-
reviewRounds:
|
|
6368
|
-
infrastructureRetries:
|
|
6475
|
+
var roundHeadIdentity = z4.object({ round: z4.number().int().positive(), head: z4.string().min(1) }).strict();
|
|
6476
|
+
var LoopBudgetsSchema = z4.object({
|
|
6477
|
+
mechanicalRetries: z4.number().int().nonnegative(),
|
|
6478
|
+
reviewRounds: z4.number().int().nonnegative(),
|
|
6479
|
+
infrastructureRetries: z4.number().int().nonnegative()
|
|
6369
6480
|
}).strict();
|
|
6370
|
-
var LoopStateRecordSchema =
|
|
6371
|
-
version:
|
|
6372
|
-
kind:
|
|
6481
|
+
var LoopStateRecordSchema = z4.object({
|
|
6482
|
+
version: z4.literal(1),
|
|
6483
|
+
kind: z4.literal("loop_state"),
|
|
6373
6484
|
task: taskId,
|
|
6374
|
-
round:
|
|
6375
|
-
phase:
|
|
6376
|
-
pauseReason:
|
|
6485
|
+
round: z4.number().int().positive(),
|
|
6486
|
+
phase: z4.string().min(1),
|
|
6487
|
+
pauseReason: z4.string().min(1).nullable(),
|
|
6377
6488
|
budgets: LoopBudgetsSchema,
|
|
6378
6489
|
heldResult: roundHeadIdentity.nullable(),
|
|
6379
6490
|
deliveredFindings: roundHeadIdentity.nullable(),
|
|
6380
|
-
repeatMemory:
|
|
6381
|
-
blockingFindings:
|
|
6382
|
-
lastFailure:
|
|
6491
|
+
repeatMemory: z4.object({
|
|
6492
|
+
blockingFindings: z4.array(z4.string()),
|
|
6493
|
+
lastFailure: z4.object({ signature: z4.string(), message: z4.string() }).nullable()
|
|
6383
6494
|
}).strict().optional(),
|
|
6495
|
+
publicationExpectedBase: z4.string().regex(/^[0-9a-f]{40}$/).nullable().optional(),
|
|
6496
|
+
taskStartedAt: isoTimestamp.optional(),
|
|
6497
|
+
phaseMs: z4.record(z4.string(), z4.number().nonnegative()).optional(),
|
|
6384
6498
|
recordedAt: isoTimestamp
|
|
6385
6499
|
}).strict();
|
|
6386
|
-
var EffectRecordSchema =
|
|
6387
|
-
version:
|
|
6388
|
-
kind:
|
|
6500
|
+
var EffectRecordSchema = z4.object({
|
|
6501
|
+
version: z4.literal(1),
|
|
6502
|
+
kind: z4.literal("effect"),
|
|
6389
6503
|
task: taskId,
|
|
6390
|
-
key:
|
|
6391
|
-
operation:
|
|
6392
|
-
target:
|
|
6393
|
-
inputVersion:
|
|
6394
|
-
payloadDigest:
|
|
6395
|
-
status:
|
|
6396
|
-
url:
|
|
6504
|
+
key: z4.string().min(1),
|
|
6505
|
+
operation: z4.string().min(1),
|
|
6506
|
+
target: z4.string().min(1),
|
|
6507
|
+
inputVersion: z4.number().int().nonnegative(),
|
|
6508
|
+
payloadDigest: z4.string().min(1),
|
|
6509
|
+
status: z4.union([z4.literal("started"), z4.literal("verified"), z4.literal("uncertain")]),
|
|
6510
|
+
url: z4.string().optional(),
|
|
6397
6511
|
recordedAt: isoTimestamp
|
|
6398
6512
|
}).strict();
|
|
6399
|
-
var EscalationRecordSchema =
|
|
6400
|
-
version:
|
|
6401
|
-
kind:
|
|
6513
|
+
var EscalationRecordSchema = z4.object({
|
|
6514
|
+
version: z4.literal(1),
|
|
6515
|
+
kind: z4.literal("escalation"),
|
|
6402
6516
|
task: taskId,
|
|
6403
|
-
escalationId:
|
|
6517
|
+
escalationId: z4.string().min(1),
|
|
6404
6518
|
round: epochNumber,
|
|
6405
|
-
head:
|
|
6406
|
-
branch:
|
|
6407
|
-
pr:
|
|
6408
|
-
runId:
|
|
6409
|
-
pid:
|
|
6410
|
-
host:
|
|
6411
|
-
agent:
|
|
6412
|
-
reason:
|
|
6413
|
-
detail:
|
|
6414
|
-
evidence:
|
|
6415
|
-
attemptedRecovery:
|
|
6416
|
-
requestedDecision:
|
|
6417
|
-
recipient:
|
|
6418
|
-
briefHash:
|
|
6419
|
-
objectivesVersion:
|
|
6519
|
+
head: z4.string().min(1),
|
|
6520
|
+
branch: z4.string().min(1),
|
|
6521
|
+
pr: z4.number().int().positive().nullable(),
|
|
6522
|
+
runId: z4.string().min(1),
|
|
6523
|
+
pid: z4.number().int().positive(),
|
|
6524
|
+
host: z4.string().min(1),
|
|
6525
|
+
agent: z4.string().min(1).optional(),
|
|
6526
|
+
reason: z4.string().min(1),
|
|
6527
|
+
detail: z4.string().optional(),
|
|
6528
|
+
evidence: z4.string().optional(),
|
|
6529
|
+
attemptedRecovery: z4.string().min(1),
|
|
6530
|
+
requestedDecision: z4.string().min(1),
|
|
6531
|
+
recipient: z4.string().min(1),
|
|
6532
|
+
briefHash: z4.string().min(1).nullable(),
|
|
6533
|
+
objectivesVersion: z4.string().min(1).nullable(),
|
|
6420
6534
|
rulingOrdinal: epochNumber,
|
|
6421
|
-
policyDigest:
|
|
6535
|
+
policyDigest: z4.string().min(1),
|
|
6422
6536
|
recordedAt: isoTimestamp
|
|
6423
6537
|
}).strict();
|
|
6424
|
-
var ResolutionRecordSchema =
|
|
6425
|
-
version:
|
|
6426
|
-
kind:
|
|
6538
|
+
var ResolutionRecordSchema = z4.object({
|
|
6539
|
+
version: z4.literal(1),
|
|
6540
|
+
kind: z4.literal("resolution"),
|
|
6427
6541
|
task: taskId,
|
|
6428
|
-
escalationId:
|
|
6429
|
-
decision:
|
|
6430
|
-
authenticatedBy:
|
|
6431
|
-
authenticatedFrom:
|
|
6542
|
+
escalationId: z4.string().min(1),
|
|
6543
|
+
decision: z4.union([z4.literal("resume"), z4.literal("cancel")]),
|
|
6544
|
+
authenticatedBy: z4.string().min(1),
|
|
6545
|
+
authenticatedFrom: z4.string().min(1),
|
|
6432
6546
|
consumedAt: isoTimestamp
|
|
6433
6547
|
}).strict();
|
|
6548
|
+
// ../../packages/aeg-core/src/control-store/local.ts
|
|
6549
|
+
var CONTROL_AREA_DIRNAME = "control";
|
|
6434
6550
|
// src/checks/contract.ts
|
|
6435
6551
|
var CHECK_SCHEMA_VERSION = 1;
|
|
6436
6552
|
function emitCheckError(error) {
|
|
@@ -6439,56 +6555,34 @@ function emitCheckError(error) {
|
|
|
6439
6555
|
}
|
|
6440
6556
|
|
|
6441
6557
|
// src/lib/config.ts
|
|
6442
|
-
import { execFile as execFile4, execFileSync as
|
|
6558
|
+
import { execFile as execFile4, execFileSync as execFileSync2 } from "node:child_process";
|
|
6443
6559
|
import { promisify as promisify4 } from "node:util";
|
|
6444
6560
|
import { existsSync, mkdirSync, readFileSync as readFileSync2, realpathSync, writeFileSync } from "node:fs";
|
|
6445
6561
|
import { homedir } from "node:os";
|
|
6446
6562
|
import { dirname, isAbsolute, join, resolve } from "node:path";
|
|
6447
|
-
import { z as
|
|
6563
|
+
import { z as z5 } from "zod";
|
|
6448
6564
|
|
|
6449
6565
|
// src/lib/agent-vendors.ts
|
|
6450
6566
|
var AGENT_VENDORS = ["skills", "claude", "gemini"];
|
|
6451
6567
|
|
|
6452
|
-
// src/lib/worker-boundary.ts
|
|
6453
|
-
import { execFileSync as execFileSync2 } from "node:child_process";
|
|
6454
|
-
var LOG_HEADER_KEYCHAIN_SERVICE = "Vinaya Log";
|
|
6455
|
-
var logHeaderKeychainCache = new Map;
|
|
6456
|
-
function readRealLogHeaderKeychainCredential(variable) {
|
|
6457
|
-
if (process.platform !== "darwin")
|
|
6458
|
-
return null;
|
|
6459
|
-
try {
|
|
6460
|
-
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$/, "");
|
|
6461
|
-
} catch {
|
|
6462
|
-
return null;
|
|
6463
|
-
}
|
|
6464
|
-
}
|
|
6465
|
-
function readLogHeaderKeychainCredential(variable) {
|
|
6466
|
-
const cached = logHeaderKeychainCache.get(variable);
|
|
6467
|
-
if (cached !== undefined)
|
|
6468
|
-
return cached;
|
|
6469
|
-
const value = readRealLogHeaderKeychainCredential(variable);
|
|
6470
|
-
logHeaderKeychainCache.set(variable, value);
|
|
6471
|
-
return value;
|
|
6472
|
-
}
|
|
6473
|
-
|
|
6474
6568
|
// src/lib/config.ts
|
|
6475
|
-
var EnvEntrySchema =
|
|
6476
|
-
|
|
6477
|
-
|
|
6478
|
-
|
|
6479
|
-
|
|
6569
|
+
var EnvEntrySchema = z5.union([
|
|
6570
|
+
z5.literal(true),
|
|
6571
|
+
z5.object({ optional: z5.literal(true) }),
|
|
6572
|
+
z5.object({ anyOf: z5.array(z5.string()).min(2) }),
|
|
6573
|
+
z5.string()
|
|
6480
6574
|
]);
|
|
6481
|
-
var CheckEntrySchema =
|
|
6482
|
-
run:
|
|
6483
|
-
scope:
|
|
6484
|
-
include:
|
|
6485
|
-
args:
|
|
6486
|
-
timeoutMs:
|
|
6487
|
-
env:
|
|
6488
|
-
requiresOpenPr:
|
|
6489
|
-
ownWorkflow:
|
|
6490
|
-
principalOwed:
|
|
6491
|
-
validates:
|
|
6575
|
+
var CheckEntrySchema = z5.object({
|
|
6576
|
+
run: z5.string(),
|
|
6577
|
+
scope: z5.enum(["diff", "full"]),
|
|
6578
|
+
include: z5.array(z5.string()).optional(),
|
|
6579
|
+
args: z5.array(z5.string()).optional(),
|
|
6580
|
+
timeoutMs: z5.number().optional(),
|
|
6581
|
+
env: z5.record(z5.string(), EnvEntrySchema).optional(),
|
|
6582
|
+
requiresOpenPr: z5.boolean().optional(),
|
|
6583
|
+
ownWorkflow: z5.boolean().optional(),
|
|
6584
|
+
principalOwed: z5.literal(true).optional(),
|
|
6585
|
+
validates: z5.enum(["body", "issue"]).optional()
|
|
6492
6586
|
}).superRefine((entry, ctx) => {
|
|
6493
6587
|
if (!entry.env)
|
|
6494
6588
|
return;
|
|
@@ -6498,22 +6592,22 @@ var CheckEntrySchema = z4.object({
|
|
|
6498
6592
|
const members = value.anyOf;
|
|
6499
6593
|
if (new Set(members).size !== members.length) {
|
|
6500
6594
|
ctx.addIssue({
|
|
6501
|
-
code:
|
|
6595
|
+
code: z5.ZodIssueCode.custom,
|
|
6502
6596
|
message: `env.${key}.anyOf has duplicate members`,
|
|
6503
6597
|
path: ["env", key, "anyOf"]
|
|
6504
6598
|
});
|
|
6505
6599
|
}
|
|
6506
6600
|
if (!members.includes(key)) {
|
|
6507
6601
|
ctx.addIssue({
|
|
6508
|
-
code:
|
|
6602
|
+
code: z5.ZodIssueCode.custom,
|
|
6509
6603
|
message: `env.${key}.anyOf must include "${key}" itself as a member`,
|
|
6510
6604
|
path: ["env", key, "anyOf"]
|
|
6511
6605
|
});
|
|
6512
6606
|
}
|
|
6513
6607
|
}
|
|
6514
6608
|
});
|
|
6515
|
-
var RoleEntrySchema =
|
|
6516
|
-
contract:
|
|
6609
|
+
var RoleEntrySchema = z5.object({
|
|
6610
|
+
contract: z5.string().refine((p) => p.includes("/"), {
|
|
6517
6611
|
message: 'must be a path (contain at least one "/"), not a bare filename'
|
|
6518
6612
|
})
|
|
6519
6613
|
});
|
|
@@ -6537,17 +6631,17 @@ var BRIEF_BUILTINS = [
|
|
|
6537
6631
|
"briefSections",
|
|
6538
6632
|
"milestoneShape"
|
|
6539
6633
|
];
|
|
6540
|
-
var BriefSectionSchema =
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
|
|
6544
|
-
|
|
6634
|
+
var BriefSectionSchema = z5.union([
|
|
6635
|
+
z5.object({ builtin: z5.enum(BRIEF_BUILTINS) }),
|
|
6636
|
+
z5.object({ heading: z5.string().min(1), name: z5.string().optional() }),
|
|
6637
|
+
z5.object({ field: z5.string().min(1), name: z5.string().optional() }),
|
|
6638
|
+
z5.object({ phrase: z5.string().min(1), name: z5.string().optional() })
|
|
6545
6639
|
]);
|
|
6546
|
-
var BriefSchemaSchema =
|
|
6547
|
-
pr:
|
|
6548
|
-
issue:
|
|
6549
|
-
milestone:
|
|
6550
|
-
ack:
|
|
6640
|
+
var BriefSchemaSchema = z5.object({
|
|
6641
|
+
pr: z5.object({ sections: z5.array(BriefSectionSchema) }).optional(),
|
|
6642
|
+
issue: z5.object({ sections: z5.array(BriefSectionSchema) }).optional(),
|
|
6643
|
+
milestone: z5.object({ sections: z5.array(BriefSectionSchema) }).optional(),
|
|
6644
|
+
ack: z5.array(z5.enum(BRIEF_BUILTINS)).optional()
|
|
6551
6645
|
});
|
|
6552
6646
|
function isSafeRepoRelPath(p) {
|
|
6553
6647
|
if (p.length === 0)
|
|
@@ -6556,7 +6650,7 @@ function isSafeRepoRelPath(p) {
|
|
|
6556
6650
|
return false;
|
|
6557
6651
|
return p.split(/[\\/]/).every((seg) => seg !== ".." && seg !== "");
|
|
6558
6652
|
}
|
|
6559
|
-
var SafeRepoRelPath =
|
|
6653
|
+
var SafeRepoRelPath = z5.string().refine(isSafeRepoRelPath, {
|
|
6560
6654
|
message: "must be a repo-root-relative path with no `..` segment or absolute root"
|
|
6561
6655
|
});
|
|
6562
6656
|
var CANONICAL_HOOK_BLOCK_PREFIXES = [".git/", ".husky/", ".vinaya/hooks/", ".claude/hooks/"];
|
|
@@ -6566,22 +6660,22 @@ function isCanonicalHookBlockPath(p) {
|
|
|
6566
6660
|
var ManagedHookBlockPath = SafeRepoRelPath.refine(isCanonicalHookBlockPath, {
|
|
6567
6661
|
message: `must start with one of ${CANONICAL_HOOK_BLOCK_PREFIXES.join(", ")} (byte-exact, case-sensitive)`
|
|
6568
6662
|
});
|
|
6569
|
-
var ManagedBlockRecordSchema =
|
|
6663
|
+
var ManagedBlockRecordSchema = z5.object({
|
|
6570
6664
|
path: ManagedHookBlockPath,
|
|
6571
|
-
marker:
|
|
6572
|
-
comment:
|
|
6665
|
+
marker: z5.string(),
|
|
6666
|
+
comment: z5.enum(["hash", "html"])
|
|
6573
6667
|
});
|
|
6574
|
-
var ManagedManifestSchema =
|
|
6575
|
-
version:
|
|
6576
|
-
files:
|
|
6577
|
-
blocks:
|
|
6578
|
-
labels:
|
|
6579
|
-
agents:
|
|
6668
|
+
var ManagedManifestSchema = z5.object({
|
|
6669
|
+
version: z5.number().int().positive(),
|
|
6670
|
+
files: z5.array(SafeRepoRelPath),
|
|
6671
|
+
blocks: z5.array(ManagedBlockRecordSchema),
|
|
6672
|
+
labels: z5.array(z5.string()),
|
|
6673
|
+
agents: z5.array(z5.enum(AGENT_VENDORS)).optional()
|
|
6580
6674
|
});
|
|
6581
|
-
var ProjectEntrySchema =
|
|
6582
|
-
name:
|
|
6583
|
-
description:
|
|
6584
|
-
path:
|
|
6675
|
+
var ProjectEntrySchema = z5.object({
|
|
6676
|
+
name: z5.string().min(1),
|
|
6677
|
+
description: z5.string().min(1).optional(),
|
|
6678
|
+
path: z5.string().min(1).optional()
|
|
6585
6679
|
});
|
|
6586
6680
|
function parseTokensCollectDeclaration(value) {
|
|
6587
6681
|
const m = value.trim().match(/^(\S+)\s+(\S+)$/);
|
|
@@ -6592,90 +6686,97 @@ function parseTokensCollectDeclaration(value) {
|
|
|
6592
6686
|
return null;
|
|
6593
6687
|
return { interpreter, script };
|
|
6594
6688
|
}
|
|
6595
|
-
var VinayaConfigSchema =
|
|
6596
|
-
rings:
|
|
6597
|
-
ring1_forgeWriteInterception:
|
|
6598
|
-
ring2_asyncAudits:
|
|
6689
|
+
var VinayaConfigSchema = z5.object({
|
|
6690
|
+
rings: z5.object({
|
|
6691
|
+
ring1_forgeWriteInterception: z5.boolean(),
|
|
6692
|
+
ring2_asyncAudits: z5.boolean()
|
|
6599
6693
|
}).optional(),
|
|
6600
|
-
checks:
|
|
6601
|
-
roles:
|
|
6694
|
+
checks: z5.record(z5.string(), CheckEntrySchema).optional(),
|
|
6695
|
+
roles: z5.record(z5.string(), RoleEntrySchema).optional(),
|
|
6602
6696
|
briefSchema: BriefSchemaSchema.optional(),
|
|
6603
6697
|
managed: ManagedManifestSchema.optional(),
|
|
6604
|
-
principals:
|
|
6605
|
-
releaseActor:
|
|
6606
|
-
ci:
|
|
6607
|
-
tokens:
|
|
6608
|
-
collect:
|
|
6698
|
+
principals: z5.array(z5.string()).min(1).optional(),
|
|
6699
|
+
releaseActor: z5.string().min(1).optional(),
|
|
6700
|
+
ci: z5.object({ setup: z5.string().min(1) }).optional(),
|
|
6701
|
+
tokens: z5.object({
|
|
6702
|
+
collect: z5.string().min(1).refine((v) => parseTokensCollectDeclaration(v) !== null, {
|
|
6609
6703
|
message: 'tokens.collect must be exactly "<interpreter> <repo-relative-script-path>" — two whitespace-separated tokens, no flags, no shell syntax, no quoting'
|
|
6610
6704
|
})
|
|
6611
6705
|
}).optional(),
|
|
6612
|
-
blastRadius:
|
|
6613
|
-
proseGates:
|
|
6614
|
-
doctrineRoot:
|
|
6615
|
-
readerFacingPrefix:
|
|
6616
|
-
readerFacingSuffix:
|
|
6617
|
-
legacySlugDir:
|
|
6618
|
-
sourceComments:
|
|
6619
|
-
globs:
|
|
6620
|
-
allowlist:
|
|
6621
|
-
severity:
|
|
6706
|
+
blastRadius: z5.object({ extraDomains: z5.array(z5.string()).optional() }).optional(),
|
|
6707
|
+
proseGates: z5.object({
|
|
6708
|
+
doctrineRoot: z5.string().min(1).optional(),
|
|
6709
|
+
readerFacingPrefix: z5.string().min(1).optional(),
|
|
6710
|
+
readerFacingSuffix: z5.string().min(1).optional(),
|
|
6711
|
+
legacySlugDir: z5.string().min(1).optional(),
|
|
6712
|
+
sourceComments: z5.object({
|
|
6713
|
+
globs: z5.array(z5.string().min(1)).optional(),
|
|
6714
|
+
allowlist: z5.array(z5.string().min(1)).optional(),
|
|
6715
|
+
severity: z5.enum(["warning", "error"]).optional()
|
|
6622
6716
|
}).optional(),
|
|
6623
|
-
specGrandfather:
|
|
6624
|
-
specPaths:
|
|
6717
|
+
specGrandfather: z5.union([z5.array(z5.string().min(1)), z5.record(z5.string().min(1), z5.number().int().min(0))]).optional(),
|
|
6718
|
+
specPaths: z5.array(z5.string().min(1).refine((entry) => !entry.startsWith("/") && !/^[A-Za-z]:/.test(entry), {
|
|
6625
6719
|
message: "must be a repository-relative path, not an absolute one"
|
|
6626
6720
|
}).refine((entry) => !entry.split(/[\\/]/).includes(".."), {
|
|
6627
6721
|
message: "must stay inside the repository — no `..` segment"
|
|
6628
6722
|
})).optional()
|
|
6629
6723
|
}).optional(),
|
|
6630
|
-
projects:
|
|
6631
|
-
dispatch:
|
|
6632
|
-
timeoutMs:
|
|
6633
|
-
killGraceMs:
|
|
6634
|
-
agent:
|
|
6635
|
-
|
|
6724
|
+
projects: z5.array(ProjectEntrySchema).optional(),
|
|
6725
|
+
dispatch: z5.object({
|
|
6726
|
+
timeoutMs: z5.number().int().positive().optional(),
|
|
6727
|
+
killGraceMs: z5.number().int().positive().optional(),
|
|
6728
|
+
agent: z5.enum(["claude", "codex", "gemini"]).optional()
|
|
6729
|
+
}).optional(),
|
|
6730
|
+
reviewPolicy: z5.object({
|
|
6731
|
+
codeReviewThreshold: z5.string().min(1).optional(),
|
|
6732
|
+
securityThreshold: z5.string().min(1).optional(),
|
|
6733
|
+
maxRounds: z5.number().optional(),
|
|
6734
|
+
maxTaskMinutes: z5.number().optional()
|
|
6636
6735
|
}).optional(),
|
|
6637
|
-
|
|
6638
|
-
|
|
6639
|
-
securityThreshold: z4.string().min(1).optional(),
|
|
6640
|
-
maxRounds: z4.number().optional()
|
|
6736
|
+
securityScan: z5.object({
|
|
6737
|
+
command: z5.array(z5.string().min(1)).min(1)
|
|
6641
6738
|
}).optional(),
|
|
6642
|
-
gateCutovers:
|
|
6643
|
-
objectivesSinceIssue:
|
|
6644
|
-
briefSectionsSinceIssue:
|
|
6645
|
-
documentationSinceIssue:
|
|
6646
|
-
briefRulesSincePr:
|
|
6647
|
-
agentBoxesRefusedSincePr:
|
|
6739
|
+
gateCutovers: z5.object({
|
|
6740
|
+
objectivesSinceIssue: z5.number().int().nonnegative().optional(),
|
|
6741
|
+
briefSectionsSinceIssue: z5.number().int().nonnegative().optional(),
|
|
6742
|
+
documentationSinceIssue: z5.number().int().nonnegative().optional(),
|
|
6743
|
+
briefRulesSincePr: z5.number().int().nonnegative().optional(),
|
|
6744
|
+
agentBoxesRefusedSincePr: z5.number().int().nonnegative().optional()
|
|
6648
6745
|
}).optional(),
|
|
6649
|
-
planning:
|
|
6650
|
-
collisionThreshold:
|
|
6746
|
+
planning: z5.object({
|
|
6747
|
+
collisionThreshold: z5.number().int().nonnegative().optional()
|
|
6651
6748
|
}).optional(),
|
|
6652
|
-
prePush:
|
|
6653
|
-
alwaysRun:
|
|
6749
|
+
prePush: z5.object({
|
|
6750
|
+
alwaysRun: z5.array(z5.string()).optional()
|
|
6654
6751
|
}).optional(),
|
|
6655
|
-
report:
|
|
6656
|
-
commandTimeoutMs:
|
|
6752
|
+
report: z5.object({
|
|
6753
|
+
commandTimeoutMs: z5.number().int().positive().optional()
|
|
6657
6754
|
}).superRefine((report, ctx) => {
|
|
6658
6755
|
const commandTimeoutMs = report.commandTimeoutMs;
|
|
6659
6756
|
if (commandTimeoutMs !== undefined && commandTimeoutMs > MAX_REPORT_COMMAND_TIMEOUT_MS) {
|
|
6660
6757
|
ctx.addIssue({
|
|
6661
|
-
code:
|
|
6758
|
+
code: z5.ZodIssueCode.custom,
|
|
6662
6759
|
path: ["commandTimeoutMs"],
|
|
6663
6760
|
message: "must be at most 3600000 (1 hour)"
|
|
6664
6761
|
});
|
|
6665
6762
|
}
|
|
6666
6763
|
}).optional(),
|
|
6667
|
-
logPublish:
|
|
6764
|
+
logPublish: z5.unknown().refine((v) => v === undefined, {
|
|
6668
6765
|
message: "logPublish is removed — telemetry is never posted to a tracker or a code host; configure `logs` instead (a folder or a server destination)"
|
|
6669
6766
|
}),
|
|
6670
|
-
runtimeDir:
|
|
6671
|
-
logs:
|
|
6672
|
-
folder:
|
|
6673
|
-
url:
|
|
6674
|
-
headers:
|
|
6767
|
+
runtimeDir: z5.string().min(1).refine((v) => isAbsolute(v), { message: "runtimeDir: must be an absolute path" }).optional(),
|
|
6768
|
+
logs: z5.object({
|
|
6769
|
+
folder: z5.string().min(1).refine((v) => isAbsolute(v), { message: "logs.folder: must be an absolute path" }).optional(),
|
|
6770
|
+
url: z5.string().url().optional(),
|
|
6771
|
+
headers: z5.record(z5.string()).optional(),
|
|
6772
|
+
readHeaders: z5.record(z5.string()).optional(),
|
|
6773
|
+
events: CustomEventDeclarationsSchema.optional()
|
|
6675
6774
|
}).refine((v) => [v.folder, v.url].filter((x) => x !== undefined).length <= 1, {
|
|
6676
6775
|
message: "logs: set at most one of folder/url"
|
|
6677
6776
|
}).refine((v) => v.headers === undefined || v.url !== undefined, {
|
|
6678
6777
|
message: "logs: headers requires url"
|
|
6778
|
+
}).refine((v) => v.readHeaders === undefined || v.url !== undefined, {
|
|
6779
|
+
message: "logs: readHeaders requires url"
|
|
6679
6780
|
}).optional()
|
|
6680
6781
|
});
|
|
6681
6782
|
var GLOBAL_VINAYA_HOME = join(homedir(), ".vinaya");
|
|
@@ -6780,10 +6881,15 @@ function resolveReviewPolicy(config) {
|
|
|
6780
6881
|
if (!Number.isInteger(maxRounds) || maxRounds < 1) {
|
|
6781
6882
|
throw new Error(`vinaya.config.json: reviewPolicy.maxRounds "${maxRounds}" is not a positive integer — fix the config, this never falls back to a default.`);
|
|
6782
6883
|
}
|
|
6884
|
+
const maxTaskMinutes = raw.maxTaskMinutes ?? DEFAULT_REVIEW_POLICY.maxTaskMinutes;
|
|
6885
|
+
if (!Number.isInteger(maxTaskMinutes) || maxTaskMinutes < 0) {
|
|
6886
|
+
throw new Error(`vinaya.config.json: reviewPolicy.maxTaskMinutes "${maxTaskMinutes}" is not a non-negative integer (0 turns the budget off) — fix the config, this never falls back to a default.`);
|
|
6887
|
+
}
|
|
6783
6888
|
return {
|
|
6784
6889
|
codeReviewThreshold,
|
|
6785
6890
|
securityThreshold,
|
|
6786
|
-
maxRounds
|
|
6891
|
+
maxRounds,
|
|
6892
|
+
maxTaskMinutes
|
|
6787
6893
|
};
|
|
6788
6894
|
}
|
|
6789
6895
|
function resolveGateCutovers(config) {
|
|
@@ -6823,17 +6929,12 @@ function resolveTrustAnchorLogsDestination(local, trustAnchorConfig) {
|
|
|
6823
6929
|
return "url" in anchored && anchored.url === local.url ? anchored : null;
|
|
6824
6930
|
return "folder" in anchored && anchored.folder === local.folder ? anchored : null;
|
|
6825
6931
|
}
|
|
6826
|
-
function resolveLogsHeaderValues(headers, env
|
|
6932
|
+
function resolveLogsHeaderValues(headers, env) {
|
|
6827
6933
|
if (!headers)
|
|
6828
6934
|
return;
|
|
6829
6935
|
const resolved = {};
|
|
6830
6936
|
for (const [key, value] of Object.entries(headers)) {
|
|
6831
|
-
resolved[key] = value.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g, (_match, name) =>
|
|
6832
|
-
const fromEnv = env[name];
|
|
6833
|
-
if (fromEnv !== undefined)
|
|
6834
|
-
return fromEnv;
|
|
6835
|
-
return readKeychain(name) ?? "";
|
|
6836
|
-
});
|
|
6937
|
+
resolved[key] = value.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g, (_match, name) => env[name] ?? "");
|
|
6837
6938
|
}
|
|
6838
6939
|
return resolved;
|
|
6839
6940
|
}
|
|
@@ -6842,7 +6943,7 @@ function trustAnchorRepo() {
|
|
|
6842
6943
|
if (fromRunner)
|
|
6843
6944
|
return fromRunner;
|
|
6844
6945
|
try {
|
|
6845
|
-
const url =
|
|
6946
|
+
const url = execFileSync2("git", ["remote", "get-url", "origin"], {
|
|
6846
6947
|
encoding: "utf-8",
|
|
6847
6948
|
stdio: ["ignore", "pipe", "pipe"]
|
|
6848
6949
|
});
|
|
@@ -6889,7 +6990,7 @@ function resolveCiTrustAnchorProbeRef(env = process.env) {
|
|
|
6889
6990
|
return ref;
|
|
6890
6991
|
}
|
|
6891
6992
|
function readTrustAnchorConfigAtRef(ref) {
|
|
6892
|
-
const raw =
|
|
6993
|
+
const raw = execFileSync2("git", ["show", `${ref}:${LOCAL_CONFIG_FILENAME}`], {
|
|
6893
6994
|
encoding: "utf-8",
|
|
6894
6995
|
stdio: ["ignore", "pipe", "pipe"],
|
|
6895
6996
|
timeout: 1e4
|
|
@@ -6903,7 +7004,7 @@ function ghFetchTrustAnchorConfig() {
|
|
|
6903
7004
|
const repo = trustAnchorRepo();
|
|
6904
7005
|
if (!repo)
|
|
6905
7006
|
throw new Error("could not resolve repo identity for the trust-anchor read");
|
|
6906
|
-
return
|
|
7007
|
+
return execFileSync2("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], {
|
|
6907
7008
|
encoding: "utf-8",
|
|
6908
7009
|
stdio: ["ignore", "pipe", "pipe"]
|
|
6909
7010
|
});
|