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