@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
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
// src/checks/bin/check-registry-gates.ts
|
|
4
4
|
import { execSync, execFileSync as execFileSync2 } from "node:child_process";
|
|
5
|
-
import { existsSync as
|
|
5
|
+
import { existsSync as existsSync2, readdirSync, readFileSync as readFileSync2, statSync } from "node:fs";
|
|
6
|
+
import { join as join3 } from "node:path";
|
|
6
7
|
import matter2 from "gray-matter";
|
|
7
8
|
// ../../packages/aeg-core/src/gate-audience.ts
|
|
8
9
|
var GATE_AUDIENCE = {
|
|
@@ -1887,45 +1888,6 @@ var DERIVED_STATUSES = [
|
|
|
1887
1888
|
"incoherent"
|
|
1888
1889
|
];
|
|
1889
1890
|
var DERIVABLE_STATUSES = DERIVED_STATUSES.filter((s) => s !== "backlog");
|
|
1890
|
-
// ../../packages/aeg-core/src/parse-ledger.ts
|
|
1891
|
-
function rowFromCells(cells) {
|
|
1892
|
-
if (cells.length < 7)
|
|
1893
|
-
return null;
|
|
1894
|
-
const phase = (cells[0] ?? "").trim();
|
|
1895
|
-
if (!phase)
|
|
1896
|
-
return null;
|
|
1897
|
-
return {
|
|
1898
|
-
phase,
|
|
1899
|
-
role: (cells[1] ?? "").trim(),
|
|
1900
|
-
agentModel: (cells[2] ?? "").trim(),
|
|
1901
|
-
tokensIn: parseIntCell(cells[3] ?? ""),
|
|
1902
|
-
tokensOut: parseIntCell(cells[4] ?? ""),
|
|
1903
|
-
cost: parseCostCell(cells[5] ?? ""),
|
|
1904
|
-
date: (cells[6] ?? "").trim()
|
|
1905
|
-
};
|
|
1906
|
-
}
|
|
1907
|
-
function parseIntCell(cell) {
|
|
1908
|
-
const trimmed = cell.replace(/`/g, "").trim();
|
|
1909
|
-
if (!trimmed || isEmDashOrDash(trimmed))
|
|
1910
|
-
return null;
|
|
1911
|
-
const normalized = trimmed.replace(/[,_\s]/g, "");
|
|
1912
|
-
if (!/^-?\d+$/.test(normalized))
|
|
1913
|
-
return null;
|
|
1914
|
-
return Number(normalized);
|
|
1915
|
-
}
|
|
1916
|
-
function parseCostCell(cell) {
|
|
1917
|
-
const trimmed = cell.replace(/`/g, "").trim();
|
|
1918
|
-
if (!trimmed || isEmDashOrDash(trimmed))
|
|
1919
|
-
return null;
|
|
1920
|
-
const normalized = trimmed.replace(/^\$/, "").replace(/[,_\s]/g, "");
|
|
1921
|
-
if (!/^-?\d+(\.\d+)?$/.test(normalized))
|
|
1922
|
-
return null;
|
|
1923
|
-
return Number(normalized);
|
|
1924
|
-
}
|
|
1925
|
-
function isEmDashOrDash(s) {
|
|
1926
|
-
const t = s.trim();
|
|
1927
|
-
return t === "—" || t === "-" || t === "–";
|
|
1928
|
-
}
|
|
1929
1891
|
// ../../packages/aeg-core/src/waiver-label.ts
|
|
1930
1892
|
var WAIVER_LABEL = label("waiver-docs");
|
|
1931
1893
|
var WAIVER_LABEL_REVIEW = label("waiver-review");
|
|
@@ -1941,61 +1903,6 @@ function isWaiverLabelActorVerified(opts) {
|
|
|
1941
1903
|
return false;
|
|
1942
1904
|
return isPrincipal(opts.labelActor, opts.principalAllowlist);
|
|
1943
1905
|
}
|
|
1944
|
-
|
|
1945
|
-
// ../../packages/aeg-core/src/parse-token-report.ts
|
|
1946
|
-
var TOKEN_REPORT_HEADING = /^\s*(?:#{1,6}\s*Token report\s*|\*\*Token report\*\*)\s*$/i;
|
|
1947
|
-
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;
|
|
1948
|
-
function parseTokenReportEntries(body) {
|
|
1949
|
-
const lines = body.split(/\r?\n/);
|
|
1950
|
-
const headingIdxs = [];
|
|
1951
|
-
lines.forEach((line, i) => {
|
|
1952
|
-
if (TOKEN_REPORT_HEADING.test(line))
|
|
1953
|
-
headingIdxs.push(i);
|
|
1954
|
-
});
|
|
1955
|
-
const out = [];
|
|
1956
|
-
for (let h = 0;h < headingIdxs.length; h++) {
|
|
1957
|
-
const start = headingIdxs[h] + 1;
|
|
1958
|
-
const end = h + 1 < headingIdxs.length ? headingIdxs[h + 1] : lines.length;
|
|
1959
|
-
const section = lines.slice(start, end).join(`
|
|
1960
|
-
`);
|
|
1961
|
-
const tableRows = parseTableSection(section);
|
|
1962
|
-
if (tableRows.length > 0) {
|
|
1963
|
-
out.push(...tableRows);
|
|
1964
|
-
continue;
|
|
1965
|
-
}
|
|
1966
|
-
const inlineRow = parseInlineFieldList(section);
|
|
1967
|
-
if (inlineRow)
|
|
1968
|
-
out.push(inlineRow);
|
|
1969
|
-
}
|
|
1970
|
-
return out;
|
|
1971
|
-
}
|
|
1972
|
-
function parseTableSection(section) {
|
|
1973
|
-
const lines = section.split(/\r?\n/);
|
|
1974
|
-
let i = 0;
|
|
1975
|
-
for (;i < lines.length; i++) {
|
|
1976
|
-
if ((lines[i] ?? "").trim().startsWith("|"))
|
|
1977
|
-
break;
|
|
1978
|
-
}
|
|
1979
|
-
if (i + 1 >= lines.length)
|
|
1980
|
-
return [];
|
|
1981
|
-
i += 2;
|
|
1982
|
-
const out = [];
|
|
1983
|
-
for (;i < lines.length; i++) {
|
|
1984
|
-
const trimmed = (lines[i] ?? "").trim();
|
|
1985
|
-
if (!trimmed.startsWith("|"))
|
|
1986
|
-
break;
|
|
1987
|
-
const row = rowFromCells(splitTableRow(trimmed));
|
|
1988
|
-
if (row)
|
|
1989
|
-
out.push(row);
|
|
1990
|
-
}
|
|
1991
|
-
return out;
|
|
1992
|
-
}
|
|
1993
|
-
function parseInlineFieldList(section) {
|
|
1994
|
-
const m = section.match(INLINE_FIELD_LIST);
|
|
1995
|
-
if (!m)
|
|
1996
|
-
return null;
|
|
1997
|
-
return rowFromCells([m[1], m[2], m[3], m[4], m[5], m[6], m[7]]);
|
|
1998
|
-
}
|
|
1999
1906
|
// ../../packages/aeg-core/src/verdict-extraction.ts
|
|
2000
1907
|
var HEAD_SHA_PATTERN = /^[ \t]*(?:\*{1,3}|_{1,3})?Judged head:\s*([0-9a-f]{7,40})(?![A-Za-z0-9])/im;
|
|
2001
1908
|
var OBJECTIVES_VERSION_PATTERN = /^[ \t]*(?:\*{1,3}|_{1,3})?Objectives version:\s*([0-9a-f]{64})(?![A-Za-z0-9])/im;
|
|
@@ -2444,10 +2351,12 @@ function evaluateC5(changed, docOwnersContent, prBody, fileExists, waiverActive,
|
|
|
2444
2351
|
var CODE_REVIEW_SEVERITY_ORDER = ["BLOCKER", "MAJOR", "MINOR"];
|
|
2445
2352
|
var SECURITY_SEVERITY_ORDER = ["CRITICAL", "HIGH", "MEDIUM", "LOW"];
|
|
2446
2353
|
var DEFAULT_MAX_ROUNDS = 3;
|
|
2354
|
+
var DEFAULT_MAX_TASK_MINUTES = 180;
|
|
2447
2355
|
var DEFAULT_REVIEW_POLICY = {
|
|
2448
2356
|
codeReviewThreshold: "BLOCKER",
|
|
2449
2357
|
securityThreshold: "HIGH",
|
|
2450
|
-
maxRounds: DEFAULT_MAX_ROUNDS
|
|
2358
|
+
maxRounds: DEFAULT_MAX_ROUNDS,
|
|
2359
|
+
maxTaskMinutes: DEFAULT_MAX_TASK_MINUTES
|
|
2451
2360
|
};
|
|
2452
2361
|
var FILE_SHAPED_LOCATION = /\.[a-zA-Z0-9]{1,10}(:\d+)?\s*$/;
|
|
2453
2362
|
var PROSE_LOCATION_PATTERNS = [/\bpr\s*body\b/i, /\bcomment\b/i];
|
|
@@ -2848,11 +2757,13 @@ function checkDocUpdateList(prBody) {
|
|
|
2848
2757
|
return headingCheck(prBody, "(?:documentation|doc)[- ]update(?:\\s+list)?", "Documentation-update list");
|
|
2849
2758
|
}
|
|
2850
2759
|
function checkWorktreeStep0(prBody) {
|
|
2851
|
-
if (/git worktree add/.test(prBody))
|
|
2760
|
+
if (/git worktree add/.test(prBody) || /cd \.worktrees\//.test(prBody) || /bun install --frozen-lockfile/.test(prBody))
|
|
2852
2761
|
return { status: "pass", errors: [] };
|
|
2853
2762
|
return {
|
|
2854
2763
|
status: "fail",
|
|
2855
|
-
errors: [
|
|
2764
|
+
errors: [
|
|
2765
|
+
"brief-validation worktree Step 0: no `git worktree add`, `cd .worktrees/`, or `bun install --frozen-lockfile` command found in the PR body."
|
|
2766
|
+
]
|
|
2856
2767
|
};
|
|
2857
2768
|
}
|
|
2858
2769
|
function checkStopConditions(prBody) {
|
|
@@ -3042,7 +2953,8 @@ function isCommandBlock(content) {
|
|
|
3042
2953
|
return COMMAND_WORDS.includes(commandWordOf(firstNonBlankLine(content)));
|
|
3043
2954
|
}
|
|
3044
2955
|
function isStep0Block(content) {
|
|
3045
|
-
|
|
2956
|
+
const first = firstNonBlankLine(content);
|
|
2957
|
+
return first.startsWith("git worktree add") || first.startsWith("cd .worktrees/") || first.startsWith("bun install --frozen-lockfile");
|
|
3046
2958
|
}
|
|
3047
2959
|
function checkCommandsCarryOutput(prBody) {
|
|
3048
2960
|
const errors = [];
|
|
@@ -3511,10 +3423,14 @@ function legacySlugPattern(legacySlugs) {
|
|
|
3511
3423
|
const alternation = legacySlugs.map((s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|");
|
|
3512
3424
|
return new RegExp(`(^|[^a-zA-Z0-9\\n-])(${alternation})([^a-zA-Z0-9\\n-]|$)`, "g");
|
|
3513
3425
|
}
|
|
3426
|
+
function specGrandfatherPaths(specGrandfather) {
|
|
3427
|
+
return Array.isArray(specGrandfather) ? [...specGrandfather] : Object.keys(specGrandfather);
|
|
3428
|
+
}
|
|
3514
3429
|
function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuffix, legacySlugs = [], shipsPrefix = SHIPS_PREFIX, specGrandfather = [], specPaths = DEFAULT_SPEC_PATHS) {
|
|
3515
3430
|
const findings = [];
|
|
3516
3431
|
const legacyPattern = legacySlugPattern(legacySlugs);
|
|
3517
|
-
const
|
|
3432
|
+
const grandfatheredWhole = new Set(Array.isArray(specGrandfather) ? specGrandfather : []);
|
|
3433
|
+
const limits = new Map(Array.isArray(specGrandfather) ? [] : Object.entries(specGrandfather));
|
|
3518
3434
|
const patterns = [
|
|
3519
3435
|
{ pattern: FORGE_NUMBER_PATTERN, what: "a forge number" },
|
|
3520
3436
|
{ pattern: TRANCHE_SLUG_VN_PATTERN, what: "an internal tranche slug" },
|
|
@@ -3533,18 +3449,19 @@ function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuff
|
|
|
3533
3449
|
continue;
|
|
3534
3450
|
if (cls !== "product" && cls !== "spec" && !SWEPT_CLASSES.has(cls))
|
|
3535
3451
|
continue;
|
|
3536
|
-
if (cls === "spec" &&
|
|
3452
|
+
if (cls === "spec" && grandfatheredWhole.has(file.path))
|
|
3537
3453
|
continue;
|
|
3538
3454
|
const blocking = cls === "product" || cls === "spec";
|
|
3539
3455
|
const scrubbed = cls === "product" ? stripNonProseForProduct(file.path, file.content) : stripNonProse(file.path, file.content);
|
|
3540
3456
|
const patternsToRun = cls === "product" ? productPatterns : cls === "spec" ? specPatterns : patterns;
|
|
3457
|
+
const fileFindings = [];
|
|
3541
3458
|
for (const { pattern, what, group } of patternsToRun) {
|
|
3542
3459
|
pattern.lastIndex = 0;
|
|
3543
3460
|
let match = pattern.exec(scrubbed);
|
|
3544
3461
|
while (match !== null) {
|
|
3545
3462
|
const cited = group !== undefined ? match[group] ?? match[0] : match[0];
|
|
3546
3463
|
const citedIndex = match.index + match[0].indexOf(cited);
|
|
3547
|
-
|
|
3464
|
+
fileFindings.push({
|
|
3548
3465
|
file: file.path,
|
|
3549
3466
|
line: lineAt(scrubbed, citedIndex),
|
|
3550
3467
|
message: `references ${what} ("${cited}") a reader outside this repo's tracker cannot resolve`,
|
|
@@ -3553,6 +3470,15 @@ function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuff
|
|
|
3553
3470
|
match = pattern.exec(scrubbed);
|
|
3554
3471
|
}
|
|
3555
3472
|
}
|
|
3473
|
+
const limit = cls === "spec" ? limits.get(file.path) : undefined;
|
|
3474
|
+
if (limit !== undefined) {
|
|
3475
|
+
if (fileFindings.length <= limit)
|
|
3476
|
+
continue;
|
|
3477
|
+
for (const f of fileFindings) {
|
|
3478
|
+
f.message += `; ${file.path} carries ${fileFindings.length} such findings, over its proseGates.specGrandfather limit of ${limit}`;
|
|
3479
|
+
}
|
|
3480
|
+
}
|
|
3481
|
+
findings.push(...fileFindings);
|
|
3556
3482
|
}
|
|
3557
3483
|
return findings;
|
|
3558
3484
|
}
|
|
@@ -4512,8 +4438,7 @@ function briefHash(brief) {
|
|
|
4512
4438
|
function policyDigest(policy) {
|
|
4513
4439
|
return createHash4("sha256").update(JSON.stringify({
|
|
4514
4440
|
codeReviewThreshold: policy.codeReviewThreshold,
|
|
4515
|
-
securityThreshold: policy.securityThreshold
|
|
4516
|
-
maxRounds: policy.maxRounds
|
|
4441
|
+
securityThreshold: policy.securityThreshold
|
|
4517
4442
|
})).digest("hex");
|
|
4518
4443
|
}
|
|
4519
4444
|
function isBoundToHead(echoed, headSha) {
|
|
@@ -4826,7 +4751,46 @@ function parseEnforcementRegistry(content) {
|
|
|
4826
4751
|
return result;
|
|
4827
4752
|
}
|
|
4828
4753
|
// ../../packages/aeg-core/src/registry-checks.ts
|
|
4829
|
-
|
|
4754
|
+
var HOOK_DIR_PREFIXES = [".claude/hooks/", ".vinaya/hooks/", ".husky/", ".git/hooks/"];
|
|
4755
|
+
var BARE_HOOK_NAME = /^check-[A-Za-z0-9_.-]*\.sh$/;
|
|
4756
|
+
function basename(path) {
|
|
4757
|
+
return path.slice(path.lastIndexOf("/") + 1);
|
|
4758
|
+
}
|
|
4759
|
+
function lineOf(content, index) {
|
|
4760
|
+
let line = 1;
|
|
4761
|
+
for (let i = 0;i < index; i++)
|
|
4762
|
+
if (content.charCodeAt(i) === 10)
|
|
4763
|
+
line++;
|
|
4764
|
+
return line;
|
|
4765
|
+
}
|
|
4766
|
+
function findUnshippedHookRefs(docs, shipped) {
|
|
4767
|
+
const shippedNames = new Set([...shipped].map(basename));
|
|
4768
|
+
const findings = [];
|
|
4769
|
+
const flag = (doc, token, index) => {
|
|
4770
|
+
findings.push({
|
|
4771
|
+
path: doc.path,
|
|
4772
|
+
reason: `${doc.path}:${lineOf(doc.content, index)} names hook "${token}", which is neither tracked in git nor emitted by \`vinaya init\``
|
|
4773
|
+
});
|
|
4774
|
+
};
|
|
4775
|
+
for (const doc of docs) {
|
|
4776
|
+
for (const { cited, index } of extractCitedPaths(doc.content)) {
|
|
4777
|
+
if (cited.endsWith("/") || !HOOK_DIR_PREFIXES.some((p) => cited.startsWith(p)))
|
|
4778
|
+
continue;
|
|
4779
|
+
if (!shipped.has(cited))
|
|
4780
|
+
flag(doc, cited, index);
|
|
4781
|
+
}
|
|
4782
|
+
const spanPattern = /`([^`\n]+)`/g;
|
|
4783
|
+
let match = spanPattern.exec(doc.content);
|
|
4784
|
+
while (match !== null) {
|
|
4785
|
+
const token = match[1] ?? "";
|
|
4786
|
+
if (BARE_HOOK_NAME.test(token) && !shippedNames.has(token))
|
|
4787
|
+
flag(doc, token, match.index);
|
|
4788
|
+
match = spanPattern.exec(doc.content);
|
|
4789
|
+
}
|
|
4790
|
+
}
|
|
4791
|
+
return findings;
|
|
4792
|
+
}
|
|
4793
|
+
function checkG1(rows, existsFn, hookRefs) {
|
|
4830
4794
|
const findings = [];
|
|
4831
4795
|
for (const row of rows) {
|
|
4832
4796
|
if (row.implementation === "")
|
|
@@ -4839,6 +4803,8 @@ function checkG1(rows, existsFn) {
|
|
|
4839
4803
|
});
|
|
4840
4804
|
}
|
|
4841
4805
|
}
|
|
4806
|
+
if (hookRefs)
|
|
4807
|
+
findings.push(...findUnshippedHookRefs(hookRefs.docs, hookRefs.shipped));
|
|
4842
4808
|
return { check: "G1", status: findings.length > 0 ? "fail" : "pass", findings };
|
|
4843
4809
|
}
|
|
4844
4810
|
var SCAFFOLD_PLACEHOLDER = "[undocumented — fill in why]";
|
|
@@ -5392,7 +5358,6 @@ var TaskPrPauseSchema = z.object({
|
|
|
5392
5358
|
var TaskPrReviewRecordSchema = z.object({
|
|
5393
5359
|
verdicts: z.array(TaskPrVerdictSchema),
|
|
5394
5360
|
roundMarkers: z.array(z.number().int().nonnegative()),
|
|
5395
|
-
summaryTable: z.string().nullable(),
|
|
5396
5361
|
pause: TaskPrPauseSchema.nullable()
|
|
5397
5362
|
});
|
|
5398
5363
|
var TaskPrReadInputSchema = z.object({
|
|
@@ -5439,16 +5404,6 @@ var TaskCancelResultSchema = z.object({
|
|
|
5439
5404
|
authenticatedFrom: z.string().min(1),
|
|
5440
5405
|
fencedEffectKeys: z.array(z.string())
|
|
5441
5406
|
});
|
|
5442
|
-
var TASK_TOOL_NAMES = [
|
|
5443
|
-
"task_start",
|
|
5444
|
-
"task_status",
|
|
5445
|
-
"task_escalation_read",
|
|
5446
|
-
"task_pr_read",
|
|
5447
|
-
"task_resume",
|
|
5448
|
-
"task_cancel"
|
|
5449
|
-
];
|
|
5450
|
-
var OPERATOR_STATUS_FOLLOW = "task_status_follow";
|
|
5451
|
-
var OPERATOR_TOOL_GRANT = [...TASK_TOOL_NAMES, OPERATOR_STATUS_FOLLOW];
|
|
5452
5407
|
// ../../packages/aeg-core/src/first-push-dispatch-gate.ts
|
|
5453
5408
|
function parseTaskBranch(branch) {
|
|
5454
5409
|
const m = /^task\/([^/]+)\/([^/]+)$/.exec(branch);
|
|
@@ -5679,15 +5634,69 @@ var NO_GATE_CUTOVERS = {
|
|
|
5679
5634
|
briefRulesSincePr: null,
|
|
5680
5635
|
agentBoxesRefusedSincePr: null
|
|
5681
5636
|
};
|
|
5682
|
-
// ../../packages/aeg-core/src/dev-review-loop/types.ts
|
|
5683
|
-
var SEVERITY_COLUMNS = ["blocker", "major", "minor", "critical", "high", "medium", "low"];
|
|
5684
|
-
// ../../packages/aeg-core/src/dev-review-loop/journal-reconstruction.ts
|
|
5685
|
-
var SUMMARY_TABLE_HEADER = `| round | ${SEVERITY_COLUMNS.join(" | ")} | confidence | outcome |`;
|
|
5686
|
-
// ../../packages/aeg-core/src/log/envelope.ts
|
|
5687
|
-
import { createHash as createHash5 } from "node:crypto";
|
|
5688
|
-
|
|
5689
5637
|
// ../../packages/aeg-core/src/log/schema.ts
|
|
5638
|
+
import { z as z3 } from "zod";
|
|
5639
|
+
|
|
5640
|
+
// ../../packages/aeg-core/src/log/custom.ts
|
|
5690
5641
|
import { z as z2 } from "zod";
|
|
5642
|
+
var CUSTOM_EVENT_NAME_PATTERN = /^[a-z][a-z0-9_]*\.[a-z][a-z0-9_.]*$/;
|
|
5643
|
+
var CUSTOM_EVENT_NAME_MAX_LENGTH = 64;
|
|
5644
|
+
var CUSTOM_EVENT_RESERVED_NAMESPACE = "vinaya";
|
|
5645
|
+
var CUSTOM_EVENT_MAX_FIELDS = 20;
|
|
5646
|
+
var CUSTOM_FIELD_NAME_PATTERN = /^[a-z][a-z0-9_]*$/;
|
|
5647
|
+
var CUSTOM_FIELD_NAME_MAX_LENGTH = 64;
|
|
5648
|
+
var CUSTOM_TEXT_MAX_LENGTH = 500;
|
|
5649
|
+
var CUSTOM_WORD_PATTERN = /^[a-z0-9][a-z0-9_-]*$/;
|
|
5650
|
+
var CUSTOM_WORD_MAX_LENGTH = 64;
|
|
5651
|
+
var CUSTOM_FIELD_MAX_WORDS = 50;
|
|
5652
|
+
var CustomFieldTypeSchema = z2.union([z2.enum(["text", "number", "boolean"]), z2.array(z2.string())]);
|
|
5653
|
+
var CustomEventDeclarationsSchema = z2.record(z2.string(), z2.object({
|
|
5654
|
+
fields: z2.record(z2.string(), CustomFieldTypeSchema)
|
|
5655
|
+
}).strict()).superRefine((events, ctx) => {
|
|
5656
|
+
for (const [name, declaration] of Object.entries(events)) {
|
|
5657
|
+
const refuse = (message, path = []) => {
|
|
5658
|
+
ctx.addIssue({
|
|
5659
|
+
code: z2.ZodIssueCode.custom,
|
|
5660
|
+
path: [name, ...path],
|
|
5661
|
+
message: `logs.events "${name}": ${message}`
|
|
5662
|
+
});
|
|
5663
|
+
};
|
|
5664
|
+
if (name.length > CUSTOM_EVENT_NAME_MAX_LENGTH) {
|
|
5665
|
+
refuse(`the name must be at most ${CUSTOM_EVENT_NAME_MAX_LENGTH} characters`);
|
|
5666
|
+
}
|
|
5667
|
+
if (!CUSTOM_EVENT_NAME_PATTERN.test(name)) {
|
|
5668
|
+
refuse("the name must be `<namespace>.<event>` — lowercase letters, digits and `_`, a dot between them");
|
|
5669
|
+
} else if (name.split(".")[0] === CUSTOM_EVENT_RESERVED_NAMESPACE) {
|
|
5670
|
+
refuse(`the \`${CUSTOM_EVENT_RESERVED_NAMESPACE}.\` namespace is reserved for Vinaya's own events`);
|
|
5671
|
+
}
|
|
5672
|
+
const fieldEntries = Object.entries(declaration.fields);
|
|
5673
|
+
if (fieldEntries.length > CUSTOM_EVENT_MAX_FIELDS) {
|
|
5674
|
+
refuse(`at most ${CUSTOM_EVENT_MAX_FIELDS} fields may be declared (found ${fieldEntries.length})`, ["fields"]);
|
|
5675
|
+
}
|
|
5676
|
+
for (const [field, type] of fieldEntries) {
|
|
5677
|
+
if (field.length > CUSTOM_FIELD_NAME_MAX_LENGTH || !CUSTOM_FIELD_NAME_PATTERN.test(field)) {
|
|
5678
|
+
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]);
|
|
5679
|
+
}
|
|
5680
|
+
if (typeof type === "string")
|
|
5681
|
+
continue;
|
|
5682
|
+
if (type.length === 0) {
|
|
5683
|
+
refuse(`field "${field}": a list of words must name at least one word`, ["fields", field]);
|
|
5684
|
+
}
|
|
5685
|
+
if (type.length > CUSTOM_FIELD_MAX_WORDS) {
|
|
5686
|
+
refuse(`field "${field}": a list of words may name at most ${CUSTOM_FIELD_MAX_WORDS}`, ["fields", field]);
|
|
5687
|
+
}
|
|
5688
|
+
const bad = type.filter((w) => w.length > CUSTOM_WORD_MAX_LENGTH || !CUSTOM_WORD_PATTERN.test(w));
|
|
5689
|
+
if (bad.length > 0) {
|
|
5690
|
+
refuse(`field "${field}": a listed word is lowercase letters, digits, \`_\` and \`-\`, at most ${CUSTOM_WORD_MAX_LENGTH} characters`, ["fields", field]);
|
|
5691
|
+
}
|
|
5692
|
+
if (new Set(type).size !== type.length) {
|
|
5693
|
+
refuse(`field "${field}": a list of words names a word twice`, ["fields", field]);
|
|
5694
|
+
}
|
|
5695
|
+
}
|
|
5696
|
+
}
|
|
5697
|
+
});
|
|
5698
|
+
|
|
5699
|
+
// ../../packages/aeg-core/src/log/schema.ts
|
|
5691
5700
|
var CONFIDENCE_REASON_MAX_LENGTH = 280;
|
|
5692
5701
|
var ROLE_VALUES = [
|
|
5693
5702
|
"planner",
|
|
@@ -5698,178 +5707,210 @@ var ROLE_VALUES = [
|
|
|
5698
5707
|
"archivist",
|
|
5699
5708
|
"architect"
|
|
5700
5709
|
];
|
|
5701
|
-
var RoleSchema =
|
|
5710
|
+
var RoleSchema = z3.enum(ROLE_VALUES);
|
|
5702
5711
|
var HOST_VALUES = ["hook", "ci", "cli", "loop"];
|
|
5703
|
-
var HostSchema =
|
|
5712
|
+
var HostSchema = z3.enum(HOST_VALUES);
|
|
5704
5713
|
var RUN_ID_PATTERN = /^[A-Za-z0-9_.-]{1,128}$/;
|
|
5705
5714
|
var headerMetaCore = {
|
|
5706
|
-
ts:
|
|
5707
|
-
run_id:
|
|
5708
|
-
seq:
|
|
5709
|
-
repo:
|
|
5710
|
-
vinaya:
|
|
5711
|
-
doctrine:
|
|
5715
|
+
ts: z3.string(),
|
|
5716
|
+
run_id: z3.string().regex(RUN_ID_PATTERN),
|
|
5717
|
+
seq: z3.number().int().nonnegative(),
|
|
5718
|
+
repo: z3.string().nullable(),
|
|
5719
|
+
vinaya: z3.string(),
|
|
5720
|
+
doctrine: z3.string(),
|
|
5712
5721
|
host: HostSchema,
|
|
5713
|
-
machine:
|
|
5722
|
+
machine: z3.string()
|
|
5714
5723
|
};
|
|
5715
|
-
var HeaderMetaV1Schema =
|
|
5716
|
-
schema:
|
|
5724
|
+
var HeaderMetaV1Schema = z3.object({
|
|
5725
|
+
schema: z3.literal(1),
|
|
5717
5726
|
...headerMetaCore
|
|
5718
5727
|
}).strict();
|
|
5719
|
-
var LineageSchema =
|
|
5720
|
-
run:
|
|
5721
|
-
attempt:
|
|
5722
|
-
parent:
|
|
5728
|
+
var LineageSchema = z3.object({
|
|
5729
|
+
run: z3.string().nullable(),
|
|
5730
|
+
attempt: z3.number().int().nullable(),
|
|
5731
|
+
parent: z3.string().nullable()
|
|
5723
5732
|
}).strict();
|
|
5724
|
-
var InputVersionsSchema =
|
|
5725
|
-
objectives_version:
|
|
5726
|
-
brief_hash:
|
|
5727
|
-
ruling_ordinal:
|
|
5728
|
-
policy_digest:
|
|
5733
|
+
var InputVersionsSchema = z3.object({
|
|
5734
|
+
objectives_version: z3.string().nullable(),
|
|
5735
|
+
brief_hash: z3.string().nullable(),
|
|
5736
|
+
ruling_ordinal: z3.number().int().nullable(),
|
|
5737
|
+
policy_digest: z3.string().nullable()
|
|
5729
5738
|
}).strict();
|
|
5730
|
-
var ProvenanceSchema =
|
|
5731
|
-
var HeaderMetaV2Schema =
|
|
5732
|
-
schema:
|
|
5739
|
+
var ProvenanceSchema = z3.enum(["parent_attributed", "env_correlated", "self_reported", "unavailable"]);
|
|
5740
|
+
var HeaderMetaV2Schema = z3.object({
|
|
5741
|
+
schema: z3.literal(2),
|
|
5733
5742
|
...headerMetaCore,
|
|
5734
|
-
event_id:
|
|
5735
|
-
process_id:
|
|
5736
|
-
actor_id:
|
|
5743
|
+
event_id: z3.string().min(1),
|
|
5744
|
+
process_id: z3.string().min(1),
|
|
5745
|
+
actor_id: z3.string().nullable(),
|
|
5737
5746
|
lineage: LineageSchema,
|
|
5738
5747
|
input_versions: InputVersionsSchema,
|
|
5739
5748
|
provenance: ProvenanceSchema
|
|
5740
5749
|
}).strict();
|
|
5741
|
-
var
|
|
5742
|
-
|
|
5743
|
-
|
|
5744
|
-
|
|
5745
|
-
|
|
5746
|
-
|
|
5747
|
-
|
|
5748
|
-
|
|
5750
|
+
var WorkSchema = z3.object({
|
|
5751
|
+
ref: z3.string().nullable(),
|
|
5752
|
+
repo: z3.string().nullable(),
|
|
5753
|
+
change: z3.string().nullable(),
|
|
5754
|
+
revision: z3.string().nullable()
|
|
5755
|
+
}).strict();
|
|
5756
|
+
var FlowSchema = z3.object({
|
|
5757
|
+
id: z3.string().nullable(),
|
|
5758
|
+
version: z3.string().nullable()
|
|
5749
5759
|
}).strict();
|
|
5750
|
-
var
|
|
5760
|
+
var HeaderMetaV3Schema = z3.object({
|
|
5761
|
+
schema: z3.literal(3),
|
|
5762
|
+
...headerMetaCore,
|
|
5763
|
+
event_id: z3.string().min(1),
|
|
5764
|
+
process_id: z3.string().min(1),
|
|
5765
|
+
actor_id: z3.string().nullable(),
|
|
5766
|
+
lineage: LineageSchema,
|
|
5767
|
+
input_versions: InputVersionsSchema,
|
|
5768
|
+
provenance: ProvenanceSchema,
|
|
5769
|
+
work: WorkSchema,
|
|
5770
|
+
flow: FlowSchema,
|
|
5771
|
+
runtime: z3.string().nullable(),
|
|
5772
|
+
source: z3.string().nullable()
|
|
5773
|
+
}).strict();
|
|
5774
|
+
var HeaderMetaSchema = z3.discriminatedUnion("schema", [HeaderMetaV1Schema, HeaderMetaV2Schema, HeaderMetaV3Schema]);
|
|
5775
|
+
var SubjectSchema = z3.object({
|
|
5776
|
+
issue: z3.number().int().nullable(),
|
|
5777
|
+
pr: z3.number().int().optional(),
|
|
5778
|
+
sha: z3.string().optional(),
|
|
5779
|
+
role: z3.union([RoleSchema, z3.literal("unattributed")]),
|
|
5780
|
+
round: z3.number().int().optional(),
|
|
5781
|
+
objectives_version: z3.string().optional()
|
|
5782
|
+
}).strict();
|
|
5783
|
+
var HeaderSchema = z3.object({
|
|
5751
5784
|
meta: HeaderMetaSchema,
|
|
5752
5785
|
subject: SubjectSchema
|
|
5753
5786
|
}).strict();
|
|
5754
5787
|
var envelopeTail = {
|
|
5755
|
-
duration_ms:
|
|
5756
|
-
payload:
|
|
5788
|
+
duration_ms: z3.number().nonnegative().optional(),
|
|
5789
|
+
payload: z3.object({}).strict()
|
|
5757
5790
|
};
|
|
5758
|
-
var ReviewFindingSchema =
|
|
5759
|
-
id:
|
|
5760
|
-
severity:
|
|
5761
|
-
state:
|
|
5762
|
-
severity_scale:
|
|
5763
|
-
policy_treatment:
|
|
5764
|
-
confidence:
|
|
5765
|
-
confidence_scale:
|
|
5766
|
-
confidence_source:
|
|
5791
|
+
var ReviewFindingSchema = z3.object({
|
|
5792
|
+
id: z3.string(),
|
|
5793
|
+
severity: z3.string(),
|
|
5794
|
+
state: z3.string().optional(),
|
|
5795
|
+
severity_scale: z3.string().optional(),
|
|
5796
|
+
policy_treatment: z3.enum(["blocking", "non_blocking", "unavailable"]).optional(),
|
|
5797
|
+
confidence: z3.number().min(0).max(1).optional(),
|
|
5798
|
+
confidence_scale: z3.string().optional(),
|
|
5799
|
+
confidence_source: z3.string().optional()
|
|
5767
5800
|
}).strict();
|
|
5768
|
-
var DispatchOutcomeSchema =
|
|
5769
|
-
|
|
5770
|
-
|
|
5771
|
-
type:
|
|
5772
|
-
pr:
|
|
5773
|
-
head:
|
|
5774
|
-
comment_id:
|
|
5801
|
+
var DispatchOutcomeSchema = z3.discriminatedUnion("type", [
|
|
5802
|
+
z3.object({ type: z3.literal("pr_opened"), pr: z3.number().int(), head: z3.string() }).strict(),
|
|
5803
|
+
z3.object({
|
|
5804
|
+
type: z3.literal("round_pushed"),
|
|
5805
|
+
pr: z3.number().int(),
|
|
5806
|
+
head: z3.string(),
|
|
5807
|
+
comment_id: z3.number().int()
|
|
5775
5808
|
}).strict(),
|
|
5776
|
-
|
|
5777
|
-
type:
|
|
5778
|
-
verdict:
|
|
5779
|
-
head:
|
|
5780
|
-
comment_id:
|
|
5781
|
-
objectives:
|
|
5782
|
-
findings:
|
|
5809
|
+
z3.object({
|
|
5810
|
+
type: z3.literal("verdict"),
|
|
5811
|
+
verdict: z3.enum(["APPROVE", "REQUEST CHANGES", "PASS", "FAIL"]),
|
|
5812
|
+
head: z3.string(),
|
|
5813
|
+
comment_id: z3.number().int(),
|
|
5814
|
+
objectives: z3.array(z3.object({ id: z3.string(), met: z3.boolean() }).strict()),
|
|
5815
|
+
findings: z3.array(ReviewFindingSchema)
|
|
5783
5816
|
}).strict(),
|
|
5784
|
-
|
|
5785
|
-
type:
|
|
5786
|
-
class:
|
|
5787
|
-
comment_id:
|
|
5817
|
+
z3.object({
|
|
5818
|
+
type: z3.literal("escalation"),
|
|
5819
|
+
class: z3.enum(["authority", "strategy", "product"]),
|
|
5820
|
+
comment_id: z3.number().int()
|
|
5788
5821
|
}).strict(),
|
|
5789
|
-
|
|
5790
|
-
|
|
5791
|
-
|
|
5792
|
-
|
|
5822
|
+
z3.object({ type: z3.literal("brief"), comment_id: z3.number().int(), hash: z3.string() }).strict(),
|
|
5823
|
+
z3.object({ type: z3.literal("plan"), issues: z3.array(z3.number().int()) }).strict(),
|
|
5824
|
+
z3.object({ type: z3.literal("archive"), provenance_comment_id: z3.number().int() }).strict(),
|
|
5825
|
+
z3.object({ type: z3.literal("completed") }).strict()
|
|
5793
5826
|
]);
|
|
5794
5827
|
var dispatchShared = {
|
|
5795
5828
|
meta: HeaderMetaSchema,
|
|
5796
5829
|
subject: SubjectSchema,
|
|
5797
|
-
kind:
|
|
5830
|
+
kind: z3.literal("dispatch"),
|
|
5798
5831
|
...envelopeTail,
|
|
5799
5832
|
target_role: RoleSchema,
|
|
5800
|
-
model:
|
|
5801
|
-
round:
|
|
5802
|
-
effect_id:
|
|
5833
|
+
model: z3.string(),
|
|
5834
|
+
round: z3.number().int().optional(),
|
|
5835
|
+
effect_id: z3.string()
|
|
5803
5836
|
};
|
|
5804
|
-
var dispatchUsageField =
|
|
5805
|
-
var DispatchEventSchema =
|
|
5806
|
-
|
|
5807
|
-
|
|
5837
|
+
var dispatchUsageField = z3.object({ input: z3.number().nonnegative(), output: z3.number().nonnegative() }).strict().nullable();
|
|
5838
|
+
var DispatchEventSchema = z3.discriminatedUnion("event", [
|
|
5839
|
+
z3.object({ ...dispatchShared, event: z3.literal("dispatched"), prompt_hash: z3.string() }).strict(),
|
|
5840
|
+
z3.object({
|
|
5808
5841
|
...dispatchShared,
|
|
5809
|
-
event:
|
|
5842
|
+
event: z3.literal("outcome_received"),
|
|
5810
5843
|
outcome: DispatchOutcomeSchema,
|
|
5811
5844
|
usage: dispatchUsageField
|
|
5812
5845
|
}).strict(),
|
|
5813
|
-
|
|
5846
|
+
z3.object({
|
|
5814
5847
|
...dispatchShared,
|
|
5815
|
-
event:
|
|
5816
|
-
reason:
|
|
5848
|
+
event: z3.literal("dispatch_failed"),
|
|
5849
|
+
reason: z3.enum(["timeout", "crash", "refused", "unattributed_write"]),
|
|
5817
5850
|
usage: dispatchUsageField
|
|
5818
5851
|
}).strict()
|
|
5819
5852
|
]);
|
|
5853
|
+
var CODE_TOKEN_PATTERN = /^[A-Za-z0-9._-]{1,64}$/;
|
|
5854
|
+
var CodeTokenSchema = z3.string().regex(CODE_TOKEN_PATTERN);
|
|
5855
|
+
var ReviewerVerdictSchema = z3.object({
|
|
5856
|
+
role: RoleSchema,
|
|
5857
|
+
outcome: z3.enum(["approve", "changes_requested", "not_reviewed"]),
|
|
5858
|
+
blockers: z3.number().int().nonnegative()
|
|
5859
|
+
}).strict();
|
|
5820
5860
|
var loopShared = {
|
|
5821
5861
|
meta: HeaderMetaSchema,
|
|
5822
5862
|
subject: SubjectSchema,
|
|
5823
|
-
kind:
|
|
5863
|
+
kind: z3.literal("dev_review_loop"),
|
|
5824
5864
|
...envelopeTail,
|
|
5825
|
-
loop_id:
|
|
5865
|
+
loop_id: z3.string()
|
|
5826
5866
|
};
|
|
5827
|
-
var DevReviewLoopEventSchema =
|
|
5828
|
-
|
|
5867
|
+
var DevReviewLoopEventSchema = z3.discriminatedUnion("event", [
|
|
5868
|
+
z3.object({
|
|
5829
5869
|
...loopShared,
|
|
5830
|
-
event:
|
|
5831
|
-
task:
|
|
5832
|
-
policy:
|
|
5833
|
-
max_rounds:
|
|
5834
|
-
reviewers:
|
|
5835
|
-
models:
|
|
5870
|
+
event: z3.literal("loop_started"),
|
|
5871
|
+
task: z3.number().int(),
|
|
5872
|
+
policy: z3.object({
|
|
5873
|
+
max_rounds: z3.number().int().nonnegative(),
|
|
5874
|
+
reviewers: z3.array(RoleSchema),
|
|
5875
|
+
models: z3.record(RoleSchema, z3.string())
|
|
5836
5876
|
}).strict()
|
|
5837
5877
|
}).strict(),
|
|
5838
|
-
|
|
5839
|
-
|
|
5878
|
+
z3.object({ ...loopShared, event: z3.literal("round_started"), round: z3.number().int(), base_head: z3.string() }).strict(),
|
|
5879
|
+
z3.object({
|
|
5840
5880
|
...loopShared,
|
|
5841
|
-
event:
|
|
5842
|
-
round:
|
|
5843
|
-
head:
|
|
5844
|
-
green:
|
|
5845
|
-
confidence_value:
|
|
5846
|
-
confidence_reason:
|
|
5847
|
-
confidence_unavailable:
|
|
5848
|
-
extra_turn_spent:
|
|
5881
|
+
event: z3.literal("gate_result_read"),
|
|
5882
|
+
round: z3.number().int(),
|
|
5883
|
+
head: z3.string(),
|
|
5884
|
+
green: z3.boolean(),
|
|
5885
|
+
confidence_value: z3.number().int().min(0).max(100).optional(),
|
|
5886
|
+
confidence_reason: z3.string().max(CONFIDENCE_REASON_MAX_LENGTH).optional(),
|
|
5887
|
+
confidence_unavailable: z3.boolean().optional(),
|
|
5888
|
+
extra_turn_spent: z3.boolean().optional()
|
|
5849
5889
|
}).strict(),
|
|
5850
|
-
|
|
5890
|
+
z3.object({
|
|
5851
5891
|
...loopShared,
|
|
5852
|
-
event:
|
|
5853
|
-
round:
|
|
5854
|
-
head:
|
|
5855
|
-
all_approve:
|
|
5856
|
-
blockers:
|
|
5857
|
-
findings:
|
|
5892
|
+
event: z3.literal("verdicts_read"),
|
|
5893
|
+
round: z3.number().int(),
|
|
5894
|
+
head: z3.string(),
|
|
5895
|
+
all_approve: z3.boolean(),
|
|
5896
|
+
blockers: z3.number().int().nonnegative(),
|
|
5897
|
+
findings: z3.array(ReviewFindingSchema).optional(),
|
|
5898
|
+
reviewers: z3.array(ReviewerVerdictSchema).optional()
|
|
5858
5899
|
}).strict(),
|
|
5859
|
-
|
|
5900
|
+
z3.object({
|
|
5860
5901
|
...loopShared,
|
|
5861
|
-
event:
|
|
5862
|
-
round:
|
|
5863
|
-
open:
|
|
5864
|
-
resolved:
|
|
5865
|
-
new:
|
|
5866
|
-
recurring:
|
|
5902
|
+
event: z3.literal("findings_compared"),
|
|
5903
|
+
round: z3.number().int(),
|
|
5904
|
+
open: z3.array(z3.string()),
|
|
5905
|
+
resolved: z3.array(z3.string()),
|
|
5906
|
+
new: z3.array(z3.string()),
|
|
5907
|
+
recurring: z3.array(z3.string())
|
|
5867
5908
|
}).strict(),
|
|
5868
|
-
|
|
5909
|
+
z3.object({
|
|
5869
5910
|
...loopShared,
|
|
5870
|
-
event:
|
|
5871
|
-
round:
|
|
5872
|
-
condition:
|
|
5911
|
+
event: z3.literal("stop_condition_met"),
|
|
5912
|
+
round: z3.number().int(),
|
|
5913
|
+
condition: z3.enum([
|
|
5873
5914
|
"green",
|
|
5874
5915
|
"max_rounds",
|
|
5875
5916
|
"no_progress",
|
|
@@ -5878,66 +5919,85 @@ var DevReviewLoopEventSchema = z2.discriminatedUnion("event", [
|
|
|
5878
5919
|
"confidence",
|
|
5879
5920
|
"reappearance",
|
|
5880
5921
|
"repeat_finding",
|
|
5881
|
-
"repeat_failure"
|
|
5922
|
+
"repeat_failure",
|
|
5923
|
+
"time_budget"
|
|
5882
5924
|
])
|
|
5883
5925
|
}).strict(),
|
|
5884
|
-
|
|
5926
|
+
z3.object({
|
|
5885
5927
|
...loopShared,
|
|
5886
|
-
event:
|
|
5887
|
-
round:
|
|
5888
|
-
reason:
|
|
5928
|
+
event: z3.literal("paused"),
|
|
5929
|
+
round: z3.number().int(),
|
|
5930
|
+
reason: z3.enum(["escalation", "principal_item", "refreeze_needed"]),
|
|
5931
|
+
reason_code: CodeTokenSchema.optional()
|
|
5889
5932
|
}).strict(),
|
|
5890
|
-
|
|
5933
|
+
z3.object({
|
|
5891
5934
|
...loopShared,
|
|
5892
|
-
event:
|
|
5893
|
-
round:
|
|
5894
|
-
by:
|
|
5935
|
+
event: z3.literal("resumed"),
|
|
5936
|
+
round: z3.number().int(),
|
|
5937
|
+
by: z3.enum(["principal", "driver"])
|
|
5895
5938
|
}).strict(),
|
|
5896
|
-
|
|
5939
|
+
z3.object({
|
|
5897
5940
|
...loopShared,
|
|
5898
|
-
event:
|
|
5899
|
-
round:
|
|
5900
|
-
by:
|
|
5941
|
+
event: z3.literal("cancelled"),
|
|
5942
|
+
round: z3.number().int(),
|
|
5943
|
+
by: z3.literal("principal")
|
|
5901
5944
|
}).strict(),
|
|
5902
|
-
|
|
5945
|
+
z3.object({
|
|
5903
5946
|
...loopShared,
|
|
5904
|
-
event:
|
|
5905
|
-
round:
|
|
5906
|
-
branch:
|
|
5907
|
-
detail:
|
|
5947
|
+
event: z3.literal("unpushed_work_resume"),
|
|
5948
|
+
round: z3.number().int(),
|
|
5949
|
+
branch: z3.string(),
|
|
5950
|
+
detail: z3.string()
|
|
5908
5951
|
}).strict(),
|
|
5909
|
-
|
|
5952
|
+
z3.object({
|
|
5910
5953
|
...loopShared,
|
|
5911
|
-
event:
|
|
5912
|
-
round:
|
|
5913
|
-
base_head:
|
|
5914
|
-
head:
|
|
5915
|
-
files_changed:
|
|
5916
|
-
insertions:
|
|
5917
|
-
deletions:
|
|
5918
|
-
wall_ms:
|
|
5919
|
-
outcome:
|
|
5954
|
+
event: z3.literal("round_ended"),
|
|
5955
|
+
round: z3.number().int(),
|
|
5956
|
+
base_head: z3.string(),
|
|
5957
|
+
head: z3.string(),
|
|
5958
|
+
files_changed: z3.number().int().nonnegative(),
|
|
5959
|
+
insertions: z3.number().int().nonnegative(),
|
|
5960
|
+
deletions: z3.number().int().nonnegative(),
|
|
5961
|
+
wall_ms: z3.number().nonnegative(),
|
|
5962
|
+
outcome: z3.enum(["green", "changes_requested", "escalated"])
|
|
5920
5963
|
}).strict(),
|
|
5921
|
-
|
|
5964
|
+
z3.object({
|
|
5922
5965
|
...loopShared,
|
|
5923
|
-
event:
|
|
5924
|
-
rounds:
|
|
5925
|
-
total_wall_ms:
|
|
5926
|
-
time_to_green_ms:
|
|
5927
|
-
files_changed_total:
|
|
5928
|
-
final_head:
|
|
5929
|
-
result:
|
|
5966
|
+
event: z3.literal("journal_finalized"),
|
|
5967
|
+
rounds: z3.number().int().nonnegative(),
|
|
5968
|
+
total_wall_ms: z3.number().nonnegative(),
|
|
5969
|
+
time_to_green_ms: z3.number().nonnegative().nullable(),
|
|
5970
|
+
files_changed_total: z3.number().int().nonnegative(),
|
|
5971
|
+
final_head: z3.string(),
|
|
5972
|
+
result: z3.enum(["merged_ready", "stopped"])
|
|
5930
5973
|
}).strict(),
|
|
5931
|
-
|
|
5974
|
+
z3.object({
|
|
5932
5975
|
...loopShared,
|
|
5933
|
-
event:
|
|
5934
|
-
round:
|
|
5935
|
-
failure_kind:
|
|
5936
|
-
attempts:
|
|
5937
|
-
outcome:
|
|
5976
|
+
event: z3.literal("infrastructure_retry"),
|
|
5977
|
+
round: z3.number().int(),
|
|
5978
|
+
failure_kind: z3.enum(["pause_comment_post", "developer_connection"]),
|
|
5979
|
+
attempts: z3.number().int().positive(),
|
|
5980
|
+
outcome: z3.enum(["recovered", "exhausted"])
|
|
5981
|
+
}).strict(),
|
|
5982
|
+
z3.object({
|
|
5983
|
+
...loopShared,
|
|
5984
|
+
event: z3.literal("driver_heartbeat"),
|
|
5985
|
+
task: z3.number().int(),
|
|
5986
|
+
pr: z3.number().int().positive().optional(),
|
|
5987
|
+
round: z3.number().int(),
|
|
5988
|
+
phase: z3.string()
|
|
5989
|
+
}).strict(),
|
|
5990
|
+
z3.object({
|
|
5991
|
+
...loopShared,
|
|
5992
|
+
event: z3.literal("driver_exited"),
|
|
5993
|
+
task: z3.number().int(),
|
|
5994
|
+
reason: z3.enum(["finished", "paused", "reexec", "error", "signal"]),
|
|
5995
|
+
last_decision: z3.string(),
|
|
5996
|
+
exit_code: z3.number().int().optional(),
|
|
5997
|
+
error_class: CodeTokenSchema.optional()
|
|
5938
5998
|
}).strict()
|
|
5939
5999
|
]);
|
|
5940
|
-
var ForgeOpSchema =
|
|
6000
|
+
var ForgeOpSchema = z3.enum([
|
|
5941
6001
|
"pr.create",
|
|
5942
6002
|
"pr.comment",
|
|
5943
6003
|
"pr.body.replace",
|
|
@@ -5951,24 +6011,24 @@ var ForgeOpSchema = z2.enum([
|
|
|
5951
6011
|
"label.add",
|
|
5952
6012
|
"label.remove"
|
|
5953
6013
|
]);
|
|
5954
|
-
var ForgeWriteTargetSchema =
|
|
5955
|
-
issue:
|
|
5956
|
-
pr:
|
|
6014
|
+
var ForgeWriteTargetSchema = z3.object({
|
|
6015
|
+
issue: z3.number().int().optional(),
|
|
6016
|
+
pr: z3.number().int().optional()
|
|
5957
6017
|
}).strict();
|
|
5958
6018
|
var forgeWriteShared = {
|
|
5959
6019
|
meta: HeaderMetaSchema,
|
|
5960
6020
|
subject: SubjectSchema,
|
|
5961
|
-
kind:
|
|
6021
|
+
kind: z3.literal("forge_write"),
|
|
5962
6022
|
...envelopeTail,
|
|
5963
6023
|
op: ForgeOpSchema,
|
|
5964
6024
|
target: ForgeWriteTargetSchema
|
|
5965
6025
|
};
|
|
5966
|
-
var ForgeWriteEventSchema =
|
|
5967
|
-
|
|
5968
|
-
|
|
5969
|
-
|
|
6026
|
+
var ForgeWriteEventSchema = z3.discriminatedUnion("event", [
|
|
6027
|
+
z3.object({ ...forgeWriteShared, event: z3.literal("validated") }).strict(),
|
|
6028
|
+
z3.object({ ...forgeWriteShared, event: z3.literal("refused"), reason: z3.string() }).strict(),
|
|
6029
|
+
z3.object({ ...forgeWriteShared, event: z3.literal("written"), comment_ids: z3.array(z3.string()) }).strict()
|
|
5970
6030
|
]);
|
|
5971
|
-
var GateOutcomeSchema =
|
|
6031
|
+
var GateOutcomeSchema = z3.enum([
|
|
5972
6032
|
"pass",
|
|
5973
6033
|
"fail",
|
|
5974
6034
|
"wait",
|
|
@@ -5981,61 +6041,74 @@ var GateOutcomeSchema = z2.enum([
|
|
|
5981
6041
|
var gateShared = {
|
|
5982
6042
|
meta: HeaderMetaSchema,
|
|
5983
6043
|
subject: SubjectSchema,
|
|
5984
|
-
kind:
|
|
6044
|
+
kind: z3.literal("gate"),
|
|
5985
6045
|
...envelopeTail,
|
|
5986
|
-
check:
|
|
5987
|
-
check_version:
|
|
5988
|
-
policy_version:
|
|
5989
|
-
input_fingerprint:
|
|
6046
|
+
check: z3.string(),
|
|
6047
|
+
check_version: z3.string().nullable(),
|
|
6048
|
+
policy_version: z3.string().nullable(),
|
|
6049
|
+
input_fingerprint: z3.string().nullable()
|
|
5990
6050
|
};
|
|
5991
|
-
var GateEventSchema =
|
|
5992
|
-
|
|
6051
|
+
var GateEventSchema = z3.discriminatedUnion("event", [
|
|
6052
|
+
z3.object({
|
|
5993
6053
|
...gateShared,
|
|
5994
|
-
event:
|
|
6054
|
+
event: z3.literal("checked"),
|
|
5995
6055
|
outcome: GateOutcomeSchema,
|
|
5996
|
-
reason:
|
|
6056
|
+
reason: z3.string().optional()
|
|
6057
|
+
}).strict(),
|
|
6058
|
+
z3.object({
|
|
6059
|
+
meta: HeaderMetaSchema,
|
|
6060
|
+
subject: SubjectSchema,
|
|
6061
|
+
kind: z3.literal("gate"),
|
|
6062
|
+
...envelopeTail,
|
|
6063
|
+
event: z3.literal("summary"),
|
|
6064
|
+
ran: z3.number().int().nonnegative(),
|
|
6065
|
+
passed: z3.number().int().nonnegative(),
|
|
6066
|
+
failed: z3.number().int().nonnegative(),
|
|
6067
|
+
skipped: z3.number().int().nonnegative(),
|
|
6068
|
+
failed_checks: z3.array(z3.string())
|
|
5997
6069
|
}).strict()
|
|
5998
6070
|
]);
|
|
5999
|
-
var OperationResultSchema =
|
|
6071
|
+
var OperationResultSchema = z3.enum(["ok", "error", "refused", "timeout", "cancelled", "unavailable"]);
|
|
6000
6072
|
var operationShared = {
|
|
6001
6073
|
meta: HeaderMetaSchema,
|
|
6002
6074
|
subject: SubjectSchema,
|
|
6003
|
-
kind:
|
|
6075
|
+
kind: z3.literal("operation"),
|
|
6004
6076
|
...envelopeTail,
|
|
6005
|
-
operation:
|
|
6006
|
-
target:
|
|
6077
|
+
operation: z3.string(),
|
|
6078
|
+
target: z3.string().nullable()
|
|
6007
6079
|
};
|
|
6008
|
-
var OperationEventSchema =
|
|
6009
|
-
|
|
6080
|
+
var OperationEventSchema = z3.discriminatedUnion("event", [
|
|
6081
|
+
z3.object({
|
|
6010
6082
|
...operationShared,
|
|
6011
|
-
event:
|
|
6083
|
+
event: z3.literal("completed"),
|
|
6012
6084
|
result: OperationResultSchema,
|
|
6013
|
-
error_class:
|
|
6085
|
+
error_class: z3.string().nullable(),
|
|
6086
|
+
field_names: z3.array(z3.string().max(CUSTOM_FIELD_NAME_MAX_LENGTH)).max(CUSTOM_EVENT_MAX_FIELDS).optional()
|
|
6014
6087
|
}).strict()
|
|
6015
6088
|
]);
|
|
6016
|
-
var UsageUnitsSchema =
|
|
6017
|
-
input:
|
|
6018
|
-
output:
|
|
6019
|
-
cache:
|
|
6089
|
+
var UsageUnitsSchema = z3.object({
|
|
6090
|
+
input: z3.number().nonnegative().nullable(),
|
|
6091
|
+
output: z3.number().nonnegative().nullable(),
|
|
6092
|
+
cache: z3.number().nonnegative().nullable()
|
|
6020
6093
|
}).strict();
|
|
6021
6094
|
var usageShared = {
|
|
6022
6095
|
meta: HeaderMetaSchema,
|
|
6023
6096
|
subject: SubjectSchema,
|
|
6024
|
-
kind:
|
|
6097
|
+
kind: z3.literal("usage"),
|
|
6025
6098
|
...envelopeTail,
|
|
6026
|
-
model:
|
|
6027
|
-
source:
|
|
6028
|
-
semantics:
|
|
6099
|
+
model: z3.string().nullable(),
|
|
6100
|
+
source: z3.string(),
|
|
6101
|
+
semantics: z3.enum(["cumulative", "delta"])
|
|
6029
6102
|
};
|
|
6030
|
-
var UsageEventSchema =
|
|
6031
|
-
|
|
6103
|
+
var UsageEventSchema = z3.discriminatedUnion("event", [
|
|
6104
|
+
z3.object({
|
|
6032
6105
|
...usageShared,
|
|
6033
|
-
event:
|
|
6106
|
+
event: z3.literal("observed"),
|
|
6034
6107
|
units: UsageUnitsSchema,
|
|
6035
|
-
unknown_reason:
|
|
6108
|
+
unknown_reason: z3.string().nullable()
|
|
6036
6109
|
}).strict()
|
|
6037
6110
|
]);
|
|
6038
|
-
var RoleAttemptOutcomeSchema =
|
|
6111
|
+
var RoleAttemptOutcomeSchema = z3.enum([
|
|
6039
6112
|
"completed",
|
|
6040
6113
|
"incomplete",
|
|
6041
6114
|
"infrastructure_failed",
|
|
@@ -6046,17 +6119,17 @@ var RoleAttemptOutcomeSchema = z2.enum([
|
|
|
6046
6119
|
var roleAttemptShared = {
|
|
6047
6120
|
meta: HeaderMetaSchema,
|
|
6048
6121
|
subject: SubjectSchema,
|
|
6049
|
-
kind:
|
|
6122
|
+
kind: z3.literal("role_attempt"),
|
|
6050
6123
|
...envelopeTail,
|
|
6051
|
-
actor:
|
|
6052
|
-
attempt:
|
|
6053
|
-
effect_id:
|
|
6054
|
-
model:
|
|
6124
|
+
actor: z3.string().nullable(),
|
|
6125
|
+
attempt: z3.number().int().nullable(),
|
|
6126
|
+
effect_id: z3.string(),
|
|
6127
|
+
model: z3.string().nullable()
|
|
6055
6128
|
};
|
|
6056
|
-
var RoleAttemptEventSchema =
|
|
6057
|
-
|
|
6129
|
+
var RoleAttemptEventSchema = z3.discriminatedUnion("event", [
|
|
6130
|
+
z3.object({
|
|
6058
6131
|
...roleAttemptShared,
|
|
6059
|
-
event:
|
|
6132
|
+
event: z3.literal("attempted"),
|
|
6060
6133
|
outcome: RoleAttemptOutcomeSchema,
|
|
6061
6134
|
usage: dispatchUsageField
|
|
6062
6135
|
}).strict()
|
|
@@ -6064,42 +6137,59 @@ var RoleAttemptEventSchema = z2.discriminatedUnion("event", [
|
|
|
6064
6137
|
var handoffShared = {
|
|
6065
6138
|
meta: HeaderMetaSchema,
|
|
6066
6139
|
subject: SubjectSchema,
|
|
6067
|
-
kind:
|
|
6140
|
+
kind: z3.literal("handoff"),
|
|
6068
6141
|
...envelopeTail,
|
|
6069
|
-
class:
|
|
6070
|
-
reason:
|
|
6142
|
+
class: z3.enum(["authority", "strategy", "product"]),
|
|
6143
|
+
reason: z3.string()
|
|
6071
6144
|
};
|
|
6072
|
-
var HandoffEventSchema =
|
|
6073
|
-
|
|
6145
|
+
var HandoffEventSchema = z3.discriminatedUnion("event", [
|
|
6146
|
+
z3.object({
|
|
6074
6147
|
...handoffShared,
|
|
6075
|
-
event:
|
|
6076
|
-
requested_decision:
|
|
6148
|
+
event: z3.literal("raised"),
|
|
6149
|
+
requested_decision: z3.string().nullable()
|
|
6077
6150
|
}).strict(),
|
|
6078
|
-
|
|
6151
|
+
z3.object({
|
|
6079
6152
|
...handoffShared,
|
|
6080
|
-
event:
|
|
6081
|
-
resolution:
|
|
6082
|
-
resolved_by:
|
|
6153
|
+
event: z3.literal("resolved"),
|
|
6154
|
+
resolution: z3.string().nullable(),
|
|
6155
|
+
resolved_by: z3.string().nullable()
|
|
6083
6156
|
}).strict()
|
|
6084
6157
|
]);
|
|
6085
|
-
var EffectTargetSchema =
|
|
6086
|
-
kind:
|
|
6087
|
-
ref:
|
|
6158
|
+
var EffectTargetSchema = z3.object({
|
|
6159
|
+
kind: z3.string(),
|
|
6160
|
+
ref: z3.string()
|
|
6088
6161
|
}).strict();
|
|
6089
6162
|
var effectShared = {
|
|
6090
6163
|
meta: HeaderMetaSchema,
|
|
6091
6164
|
subject: SubjectSchema,
|
|
6092
|
-
kind:
|
|
6165
|
+
kind: z3.literal("effect"),
|
|
6093
6166
|
...envelopeTail,
|
|
6094
|
-
effect_id:
|
|
6167
|
+
effect_id: z3.string(),
|
|
6095
6168
|
target: EffectTargetSchema
|
|
6096
6169
|
};
|
|
6097
|
-
var EffectEventSchema =
|
|
6098
|
-
|
|
6099
|
-
|
|
6100
|
-
|
|
6170
|
+
var EffectEventSchema = z3.discriminatedUnion("event", [
|
|
6171
|
+
z3.object({ ...effectShared, event: z3.literal("attempted") }).strict(),
|
|
6172
|
+
z3.object({ ...effectShared, event: z3.literal("observed"), outcome: z3.enum(["success", "failure", "uncertain"]) }).strict(),
|
|
6173
|
+
z3.object({ ...effectShared, event: z3.literal("verified"), outcome: z3.enum(["success", "failure", "uncertain"]) }).strict()
|
|
6101
6174
|
]);
|
|
6102
|
-
var
|
|
6175
|
+
var CustomFieldValueSchema = z3.union([z3.string().max(CUSTOM_TEXT_MAX_LENGTH), z3.number().finite(), z3.boolean()]);
|
|
6176
|
+
var customShared = {
|
|
6177
|
+
meta: HeaderMetaV3Schema,
|
|
6178
|
+
subject: SubjectSchema,
|
|
6179
|
+
kind: z3.literal("custom"),
|
|
6180
|
+
...envelopeTail
|
|
6181
|
+
};
|
|
6182
|
+
var CustomEventSchema = z3.discriminatedUnion("event", [
|
|
6183
|
+
z3.object({
|
|
6184
|
+
...customShared,
|
|
6185
|
+
event: z3.literal("recorded"),
|
|
6186
|
+
name: z3.string().max(CUSTOM_EVENT_NAME_MAX_LENGTH).regex(CUSTOM_EVENT_NAME_PATTERN),
|
|
6187
|
+
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, {
|
|
6188
|
+
message: `custom: at most ${CUSTOM_EVENT_MAX_FIELDS} fields`
|
|
6189
|
+
})
|
|
6190
|
+
}).strict()
|
|
6191
|
+
]);
|
|
6192
|
+
var LogEventSchema = z3.union([
|
|
6103
6193
|
DispatchEventSchema,
|
|
6104
6194
|
DevReviewLoopEventSchema,
|
|
6105
6195
|
ForgeWriteEventSchema,
|
|
@@ -6108,10 +6198,11 @@ var LogEventSchema = z2.union([
|
|
|
6108
6198
|
UsageEventSchema,
|
|
6109
6199
|
RoleAttemptEventSchema,
|
|
6110
6200
|
HandoffEventSchema,
|
|
6111
|
-
EffectEventSchema
|
|
6201
|
+
EffectEventSchema,
|
|
6202
|
+
CustomEventSchema
|
|
6112
6203
|
]);
|
|
6113
|
-
|
|
6114
6204
|
// ../../packages/aeg-core/src/log/envelope.ts
|
|
6205
|
+
import { createHash as createHash5 } from "node:crypto";
|
|
6115
6206
|
function isRole(value) {
|
|
6116
6207
|
return value !== undefined && ROLE_VALUES.includes(value);
|
|
6117
6208
|
}
|
|
@@ -6148,18 +6239,27 @@ function roundFromEnv(round) {
|
|
|
6148
6239
|
const n = Number(round);
|
|
6149
6240
|
return Number.isInteger(n) ? n : undefined;
|
|
6150
6241
|
}
|
|
6242
|
+
function prFromEnv(pr) {
|
|
6243
|
+
if (pr === undefined || pr === "")
|
|
6244
|
+
return;
|
|
6245
|
+
const n = Number(pr);
|
|
6246
|
+
return Number.isInteger(n) && n > 0 ? n : undefined;
|
|
6247
|
+
}
|
|
6151
6248
|
function buildHeader(input) {
|
|
6152
6249
|
const role = isRole(input.env.role) ? input.env.role : "unattributed";
|
|
6153
6250
|
const round = roundFromEnv(input.env.round);
|
|
6251
|
+
const pr = prFromEnv(input.env.pr);
|
|
6154
6252
|
const subject = {
|
|
6155
6253
|
issue: issueFromTask(input.env.task) ?? input.branchIssue ?? null,
|
|
6156
6254
|
role,
|
|
6157
6255
|
...round !== undefined ? { round } : {},
|
|
6256
|
+
...pr !== undefined ? { pr } : {},
|
|
6158
6257
|
...input.subject ?? {}
|
|
6159
6258
|
};
|
|
6259
|
+
const issue = subject.issue;
|
|
6160
6260
|
return {
|
|
6161
6261
|
meta: {
|
|
6162
|
-
schema:
|
|
6262
|
+
schema: 3,
|
|
6163
6263
|
ts: input.now.toISOString(),
|
|
6164
6264
|
run_id: input.runId,
|
|
6165
6265
|
seq: input.seq,
|
|
@@ -6182,7 +6282,19 @@ function buildHeader(input) {
|
|
|
6182
6282
|
ruling_ordinal: input.inputVersions?.rulingOrdinal ?? null,
|
|
6183
6283
|
policy_digest: input.inputVersions?.policyDigest ?? null
|
|
6184
6284
|
},
|
|
6185
|
-
provenance: provenanceFor(input)
|
|
6285
|
+
provenance: provenanceFor(input),
|
|
6286
|
+
work: {
|
|
6287
|
+
ref: lineageFieldFromEnv(input.env.workRef) ?? (issue === null ? null : String(issue)),
|
|
6288
|
+
repo: input.repo,
|
|
6289
|
+
change: null,
|
|
6290
|
+
revision: null
|
|
6291
|
+
},
|
|
6292
|
+
flow: {
|
|
6293
|
+
id: lineageFieldFromEnv(input.env.flow) ?? "vinaya",
|
|
6294
|
+
version: lineageFieldFromEnv(input.env.flowVersion)
|
|
6295
|
+
},
|
|
6296
|
+
runtime: lineageFieldFromEnv(input.env.runtime),
|
|
6297
|
+
source: lineageFieldFromEnv(input.env.source)
|
|
6186
6298
|
},
|
|
6187
6299
|
subject
|
|
6188
6300
|
};
|
|
@@ -6225,7 +6337,7 @@ function redact(value, home) {
|
|
|
6225
6337
|
return value;
|
|
6226
6338
|
}
|
|
6227
6339
|
// ../../packages/aeg-core/src/log/store.ts
|
|
6228
|
-
var KNOWN_SCHEMA_VERSIONS = [1, 2];
|
|
6340
|
+
var KNOWN_SCHEMA_VERSIONS = [1, 2, 3];
|
|
6229
6341
|
function metaOf(obj) {
|
|
6230
6342
|
if (obj === null || typeof obj !== "object")
|
|
6231
6343
|
return null;
|
|
@@ -6291,7 +6403,7 @@ function classifyStoredLine(raw, home) {
|
|
|
6291
6403
|
return { status: "invalid", identity: null, raw, reason: "valid event with no derivable identity" };
|
|
6292
6404
|
}
|
|
6293
6405
|
const redacted = redact(event, home);
|
|
6294
|
-
const provenance = version
|
|
6406
|
+
const provenance = version >= 2 ? event.meta.provenance ?? null : null;
|
|
6295
6407
|
return {
|
|
6296
6408
|
status: "ok",
|
|
6297
6409
|
identity,
|
|
@@ -6304,138 +6416,151 @@ function classifyStoredLine(raw, home) {
|
|
|
6304
6416
|
};
|
|
6305
6417
|
}
|
|
6306
6418
|
// ../../packages/aeg-core/src/control-store/records.ts
|
|
6307
|
-
import { z as
|
|
6308
|
-
var isoTimestamp =
|
|
6309
|
-
var taskId =
|
|
6310
|
-
var epochNumber =
|
|
6311
|
-
var RunRecordSchema =
|
|
6312
|
-
version:
|
|
6313
|
-
kind:
|
|
6419
|
+
import { z as z4 } from "zod";
|
|
6420
|
+
var isoTimestamp = z4.string().min(1);
|
|
6421
|
+
var taskId = z4.number().int().positive();
|
|
6422
|
+
var epochNumber = z4.number().int().nonnegative();
|
|
6423
|
+
var RunRecordSchema = z4.object({
|
|
6424
|
+
version: z4.literal(1),
|
|
6425
|
+
kind: z4.literal("run"),
|
|
6314
6426
|
task: taskId,
|
|
6315
|
-
runId:
|
|
6316
|
-
pid:
|
|
6317
|
-
host:
|
|
6427
|
+
runId: z4.string().min(1),
|
|
6428
|
+
pid: z4.number().int().positive(),
|
|
6429
|
+
host: z4.string().min(1),
|
|
6318
6430
|
startedAt: isoTimestamp,
|
|
6319
|
-
childStartedAt:
|
|
6320
|
-
childCommand:
|
|
6431
|
+
childStartedAt: z4.string().min(1).nullable().optional(),
|
|
6432
|
+
childCommand: z4.string().min(1).nullable().optional()
|
|
6321
6433
|
}).strict();
|
|
6322
|
-
var InputRecordSchema =
|
|
6323
|
-
version:
|
|
6324
|
-
kind:
|
|
6434
|
+
var InputRecordSchema = z4.object({
|
|
6435
|
+
version: z4.literal(1),
|
|
6436
|
+
kind: z4.literal("input"),
|
|
6325
6437
|
task: taskId,
|
|
6326
|
-
runId:
|
|
6327
|
-
source:
|
|
6328
|
-
pr:
|
|
6329
|
-
round:
|
|
6438
|
+
runId: z4.string().min(1),
|
|
6439
|
+
source: z4.union([z4.literal("fresh"), z4.literal("resume")]),
|
|
6440
|
+
pr: z4.number().int().positive().nullable(),
|
|
6441
|
+
round: z4.number().int().nonnegative(),
|
|
6330
6442
|
recordedAt: isoTimestamp
|
|
6331
6443
|
}).strict();
|
|
6332
|
-
var OwnershipRecordSchema =
|
|
6333
|
-
version:
|
|
6334
|
-
kind:
|
|
6444
|
+
var OwnershipRecordSchema = z4.object({
|
|
6445
|
+
version: z4.literal(1),
|
|
6446
|
+
kind: z4.literal("ownership"),
|
|
6335
6447
|
task: taskId,
|
|
6336
6448
|
epoch: epochNumber,
|
|
6337
|
-
ownerId:
|
|
6338
|
-
pid:
|
|
6339
|
-
host:
|
|
6449
|
+
ownerId: z4.string().min(1),
|
|
6450
|
+
pid: z4.number().int().positive(),
|
|
6451
|
+
host: z4.string().min(1),
|
|
6340
6452
|
acquiredAt: isoTimestamp
|
|
6341
6453
|
}).strict();
|
|
6342
|
-
var TransitionRecordSchema =
|
|
6343
|
-
version:
|
|
6344
|
-
kind:
|
|
6454
|
+
var TransitionRecordSchema = z4.object({
|
|
6455
|
+
version: z4.literal(1),
|
|
6456
|
+
kind: z4.literal("transition"),
|
|
6345
6457
|
task: taskId,
|
|
6346
6458
|
epoch: epochNumber,
|
|
6347
|
-
seq:
|
|
6348
|
-
from:
|
|
6349
|
-
to:
|
|
6350
|
-
detail:
|
|
6459
|
+
seq: z4.number().int().nonnegative(),
|
|
6460
|
+
from: z4.string().min(1),
|
|
6461
|
+
to: z4.string().min(1),
|
|
6462
|
+
detail: z4.string().optional(),
|
|
6351
6463
|
at: isoTimestamp
|
|
6352
6464
|
}).strict();
|
|
6353
|
-
var ManifestRecordSchema =
|
|
6354
|
-
version:
|
|
6355
|
-
kind:
|
|
6465
|
+
var ManifestRecordSchema = z4.object({
|
|
6466
|
+
version: z4.literal(1),
|
|
6467
|
+
kind: z4.literal("manifest"),
|
|
6356
6468
|
task: taskId,
|
|
6357
6469
|
round: epochNumber,
|
|
6358
|
-
repository:
|
|
6359
|
-
pr:
|
|
6360
|
-
branch:
|
|
6361
|
-
baseSha:
|
|
6362
|
-
headSha:
|
|
6363
|
-
briefHash:
|
|
6364
|
-
objectivesVersion:
|
|
6470
|
+
repository: z4.string().min(1),
|
|
6471
|
+
pr: z4.number().int().positive(),
|
|
6472
|
+
branch: z4.string().min(1),
|
|
6473
|
+
baseSha: z4.string().min(1).nullable(),
|
|
6474
|
+
headSha: z4.string().min(1),
|
|
6475
|
+
briefHash: z4.string().min(1).nullable(),
|
|
6476
|
+
objectivesVersion: z4.string().min(1).nullable(),
|
|
6365
6477
|
rulingOrdinal: epochNumber,
|
|
6366
|
-
policyDigest:
|
|
6478
|
+
policyDigest: z4.string().min(1),
|
|
6367
6479
|
recordedAt: isoTimestamp
|
|
6368
6480
|
}).strict();
|
|
6369
|
-
var roundHeadIdentity =
|
|
6370
|
-
var LoopBudgetsSchema =
|
|
6371
|
-
mechanicalRetries:
|
|
6372
|
-
reviewRounds:
|
|
6373
|
-
infrastructureRetries:
|
|
6481
|
+
var roundHeadIdentity = z4.object({ round: z4.number().int().positive(), head: z4.string().min(1) }).strict();
|
|
6482
|
+
var LoopBudgetsSchema = z4.object({
|
|
6483
|
+
mechanicalRetries: z4.number().int().nonnegative(),
|
|
6484
|
+
reviewRounds: z4.number().int().nonnegative(),
|
|
6485
|
+
infrastructureRetries: z4.number().int().nonnegative()
|
|
6374
6486
|
}).strict();
|
|
6375
|
-
var LoopStateRecordSchema =
|
|
6376
|
-
version:
|
|
6377
|
-
kind:
|
|
6487
|
+
var LoopStateRecordSchema = z4.object({
|
|
6488
|
+
version: z4.literal(1),
|
|
6489
|
+
kind: z4.literal("loop_state"),
|
|
6378
6490
|
task: taskId,
|
|
6379
|
-
round:
|
|
6380
|
-
phase:
|
|
6381
|
-
pauseReason:
|
|
6491
|
+
round: z4.number().int().positive(),
|
|
6492
|
+
phase: z4.string().min(1),
|
|
6493
|
+
pauseReason: z4.string().min(1).nullable(),
|
|
6382
6494
|
budgets: LoopBudgetsSchema,
|
|
6383
6495
|
heldResult: roundHeadIdentity.nullable(),
|
|
6384
6496
|
deliveredFindings: roundHeadIdentity.nullable(),
|
|
6385
|
-
repeatMemory:
|
|
6386
|
-
blockingFindings:
|
|
6387
|
-
lastFailure:
|
|
6497
|
+
repeatMemory: z4.object({
|
|
6498
|
+
blockingFindings: z4.array(z4.string()),
|
|
6499
|
+
lastFailure: z4.object({ signature: z4.string(), message: z4.string() }).nullable()
|
|
6388
6500
|
}).strict().optional(),
|
|
6501
|
+
publicationExpectedBase: z4.string().regex(/^[0-9a-f]{40}$/).nullable().optional(),
|
|
6502
|
+
taskStartedAt: isoTimestamp.optional(),
|
|
6503
|
+
phaseMs: z4.record(z4.string(), z4.number().nonnegative()).optional(),
|
|
6389
6504
|
recordedAt: isoTimestamp
|
|
6390
6505
|
}).strict();
|
|
6391
|
-
var EffectRecordSchema =
|
|
6392
|
-
version:
|
|
6393
|
-
kind:
|
|
6506
|
+
var EffectRecordSchema = z4.object({
|
|
6507
|
+
version: z4.literal(1),
|
|
6508
|
+
kind: z4.literal("effect"),
|
|
6394
6509
|
task: taskId,
|
|
6395
|
-
key:
|
|
6396
|
-
operation:
|
|
6397
|
-
target:
|
|
6398
|
-
inputVersion:
|
|
6399
|
-
payloadDigest:
|
|
6400
|
-
status:
|
|
6401
|
-
url:
|
|
6510
|
+
key: z4.string().min(1),
|
|
6511
|
+
operation: z4.string().min(1),
|
|
6512
|
+
target: z4.string().min(1),
|
|
6513
|
+
inputVersion: z4.number().int().nonnegative(),
|
|
6514
|
+
payloadDigest: z4.string().min(1),
|
|
6515
|
+
status: z4.union([z4.literal("started"), z4.literal("verified"), z4.literal("uncertain")]),
|
|
6516
|
+
url: z4.string().optional(),
|
|
6402
6517
|
recordedAt: isoTimestamp
|
|
6403
6518
|
}).strict();
|
|
6404
|
-
var EscalationRecordSchema =
|
|
6405
|
-
version:
|
|
6406
|
-
kind:
|
|
6519
|
+
var EscalationRecordSchema = z4.object({
|
|
6520
|
+
version: z4.literal(1),
|
|
6521
|
+
kind: z4.literal("escalation"),
|
|
6407
6522
|
task: taskId,
|
|
6408
|
-
escalationId:
|
|
6523
|
+
escalationId: z4.string().min(1),
|
|
6409
6524
|
round: epochNumber,
|
|
6410
|
-
head:
|
|
6411
|
-
branch:
|
|
6412
|
-
pr:
|
|
6413
|
-
runId:
|
|
6414
|
-
pid:
|
|
6415
|
-
host:
|
|
6416
|
-
agent:
|
|
6417
|
-
reason:
|
|
6418
|
-
detail:
|
|
6419
|
-
evidence:
|
|
6420
|
-
attemptedRecovery:
|
|
6421
|
-
requestedDecision:
|
|
6422
|
-
recipient:
|
|
6423
|
-
briefHash:
|
|
6424
|
-
objectivesVersion:
|
|
6525
|
+
head: z4.string().min(1),
|
|
6526
|
+
branch: z4.string().min(1),
|
|
6527
|
+
pr: z4.number().int().positive().nullable(),
|
|
6528
|
+
runId: z4.string().min(1),
|
|
6529
|
+
pid: z4.number().int().positive(),
|
|
6530
|
+
host: z4.string().min(1),
|
|
6531
|
+
agent: z4.string().min(1).optional(),
|
|
6532
|
+
reason: z4.string().min(1),
|
|
6533
|
+
detail: z4.string().optional(),
|
|
6534
|
+
evidence: z4.string().optional(),
|
|
6535
|
+
attemptedRecovery: z4.string().min(1),
|
|
6536
|
+
requestedDecision: z4.string().min(1),
|
|
6537
|
+
recipient: z4.string().min(1),
|
|
6538
|
+
briefHash: z4.string().min(1).nullable(),
|
|
6539
|
+
objectivesVersion: z4.string().min(1).nullable(),
|
|
6425
6540
|
rulingOrdinal: epochNumber,
|
|
6426
|
-
policyDigest:
|
|
6541
|
+
policyDigest: z4.string().min(1),
|
|
6427
6542
|
recordedAt: isoTimestamp
|
|
6428
6543
|
}).strict();
|
|
6429
|
-
var ResolutionRecordSchema =
|
|
6430
|
-
version:
|
|
6431
|
-
kind:
|
|
6544
|
+
var ResolutionRecordSchema = z4.object({
|
|
6545
|
+
version: z4.literal(1),
|
|
6546
|
+
kind: z4.literal("resolution"),
|
|
6432
6547
|
task: taskId,
|
|
6433
|
-
escalationId:
|
|
6434
|
-
decision:
|
|
6435
|
-
authenticatedBy:
|
|
6436
|
-
authenticatedFrom:
|
|
6548
|
+
escalationId: z4.string().min(1),
|
|
6549
|
+
decision: z4.union([z4.literal("resume"), z4.literal("cancel")]),
|
|
6550
|
+
authenticatedBy: z4.string().min(1),
|
|
6551
|
+
authenticatedFrom: z4.string().min(1),
|
|
6437
6552
|
consumedAt: isoTimestamp
|
|
6438
6553
|
}).strict();
|
|
6554
|
+
// ../../packages/aeg-core/src/control-store/local.ts
|
|
6555
|
+
var CONTROL_AREA_DIRNAME = "control";
|
|
6556
|
+
// src/lib/init-hook-paths.ts
|
|
6557
|
+
var TRACKED_HOOK_DIR = ".vinaya/hooks";
|
|
6558
|
+
var HOOK_DIRS = [".husky", ".git/hooks", TRACKED_HOOK_DIR];
|
|
6559
|
+
var INIT_HOOK_NAMES = ["pre-commit", "pre-push", "commit-msg"];
|
|
6560
|
+
function initHookPaths() {
|
|
6561
|
+
return HOOK_DIRS.flatMap((dir) => INIT_HOOK_NAMES.map((name) => `${dir}/${name}`));
|
|
6562
|
+
}
|
|
6563
|
+
|
|
6439
6564
|
// src/checks/contract.ts
|
|
6440
6565
|
var CHECK_SCHEMA_VERSION = 1;
|
|
6441
6566
|
function emitCheckError(error) {
|
|
@@ -6444,8 +6569,8 @@ function emitCheckError(error) {
|
|
|
6444
6569
|
}
|
|
6445
6570
|
|
|
6446
6571
|
// src/checks/registry.ts
|
|
6447
|
-
import {
|
|
6448
|
-
import {
|
|
6572
|
+
import { join as join2, relative, sep } from "node:path";
|
|
6573
|
+
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
6449
6574
|
|
|
6450
6575
|
// src/lib/package-root.ts
|
|
6451
6576
|
import { existsSync } from "node:fs";
|
|
@@ -6465,10 +6590,14 @@ function packageRoot(moduleUrl) {
|
|
|
6465
6590
|
}
|
|
6466
6591
|
|
|
6467
6592
|
// src/checks/registry.ts
|
|
6468
|
-
|
|
6469
|
-
|
|
6470
|
-
|
|
6471
|
-
|
|
6593
|
+
function resolveCheckBin(packageDir, moduleUrl) {
|
|
6594
|
+
const fromPackage = relative(packageDir, fileURLToPath2(moduleUrl));
|
|
6595
|
+
const bundled = fromPackage === "dist" || fromPackage.startsWith(`dist${sep}`);
|
|
6596
|
+
return bundled ? { dir: join2(packageDir, "dist", "checks", "bin"), ext: ".js" } : { dir: join2(packageDir, "src", "checks", "bin"), ext: ".ts" };
|
|
6597
|
+
}
|
|
6598
|
+
var CHECK_BIN = resolveCheckBin(packageRoot(import.meta.url), import.meta.url);
|
|
6599
|
+
var BIN_DIR = CHECK_BIN.dir;
|
|
6600
|
+
var BIN_EXT = CHECK_BIN.ext;
|
|
6472
6601
|
function bin(name) {
|
|
6473
6602
|
return join2(BIN_DIR, `${name}${BIN_EXT}`);
|
|
6474
6603
|
}
|
|
@@ -6666,23 +6795,6 @@ var REGISTRY = [
|
|
|
6666
6795
|
},
|
|
6667
6796
|
1
|
|
6668
6797
|
],
|
|
6669
|
-
[
|
|
6670
|
-
{
|
|
6671
|
-
name: "token-report",
|
|
6672
|
-
validates: "body",
|
|
6673
|
-
run: bin("check-token-report"),
|
|
6674
|
-
scope: "diff",
|
|
6675
|
-
timeoutMs: 15000,
|
|
6676
|
-
requiresOpenPr: true,
|
|
6677
|
-
env: {
|
|
6678
|
-
PR_BODY: { optional: true },
|
|
6679
|
-
BRANCH: { optional: true },
|
|
6680
|
-
CLAUDE_PROJECT_DIR: { optional: true },
|
|
6681
|
-
CLAUDE_CODE_SESSION_ID: { optional: true }
|
|
6682
|
-
}
|
|
6683
|
-
},
|
|
6684
|
-
1
|
|
6685
|
-
],
|
|
6686
6798
|
[
|
|
6687
6799
|
{
|
|
6688
6800
|
name: "no-disk-state",
|
|
@@ -7033,6 +7145,7 @@ var CHECK_NAME = "registry-gates";
|
|
|
7033
7145
|
var ENFORCEMENT_PATH = "aeg-root/enforcement.md";
|
|
7034
7146
|
var ROLES_DIR = "aeg-root/roles";
|
|
7035
7147
|
var CONTRACTS_DIR = "aeg-root/contracts";
|
|
7148
|
+
var DOCTRINE_DIR = "aeg-root";
|
|
7036
7149
|
function isGithubCrossingLine(line) {
|
|
7037
7150
|
const createMatch = /\bgh\s+(pr|issue)\s+create\b/.test(line);
|
|
7038
7151
|
const editWithBodyOrTitle = /\bgh\s+(pr|issue)\s+edit\b/.test(line) && /--body\b|--body-file\b|--title\b|(?:^|\s)-b(?:\s|$)|(?:^|\s)-F(?:\s|$)|(?:^|\s)-t(?:\s|$)/.test(line);
|
|
@@ -7043,7 +7156,7 @@ function isGithubCrossingLine(line) {
|
|
|
7043
7156
|
}
|
|
7044
7157
|
function globCandidateFiles() {
|
|
7045
7158
|
const out = [];
|
|
7046
|
-
if (
|
|
7159
|
+
if (existsSync2(".husky")) {
|
|
7047
7160
|
for (const name of readdirSync(".husky")) {
|
|
7048
7161
|
if (name === "_")
|
|
7049
7162
|
continue;
|
|
@@ -7052,7 +7165,7 @@ function globCandidateFiles() {
|
|
|
7052
7165
|
out.push(rel);
|
|
7053
7166
|
}
|
|
7054
7167
|
}
|
|
7055
|
-
if (
|
|
7168
|
+
if (existsSync2(".claude/hooks")) {
|
|
7056
7169
|
for (const name of readdirSync(".claude/hooks")) {
|
|
7057
7170
|
if (name.endsWith(".sh"))
|
|
7058
7171
|
out.push(`.claude/hooks/${name}`);
|
|
@@ -7064,8 +7177,24 @@ function findCrossingFiles(candidateFiles) {
|
|
|
7064
7177
|
return candidateFiles.filter((path) => readFileSync2(path, "utf8").split(`
|
|
7065
7178
|
`).some((line) => isGithubCrossingLine(line)));
|
|
7066
7179
|
}
|
|
7180
|
+
function readHookScanFiles(dir) {
|
|
7181
|
+
const out = [];
|
|
7182
|
+
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
7183
|
+
const rel = join3(dir, entry.name);
|
|
7184
|
+
if (entry.isDirectory())
|
|
7185
|
+
out.push(...readHookScanFiles(rel));
|
|
7186
|
+
else if (entry.name.endsWith(".md"))
|
|
7187
|
+
out.push({ path: rel, content: readFileSync2(rel, "utf8") });
|
|
7188
|
+
}
|
|
7189
|
+
return out;
|
|
7190
|
+
}
|
|
7191
|
+
function shippedHookPaths() {
|
|
7192
|
+
const tracked = sh("git ls-files").split(`
|
|
7193
|
+
`).filter(Boolean);
|
|
7194
|
+
return new Set([...tracked, ...initHookPaths()]);
|
|
7195
|
+
}
|
|
7067
7196
|
function readRoles() {
|
|
7068
|
-
if (!
|
|
7197
|
+
if (!existsSync2(ROLES_DIR))
|
|
7069
7198
|
return [];
|
|
7070
7199
|
return readdirSync(ROLES_DIR).filter((name) => name.endsWith(".md")).map((name) => {
|
|
7071
7200
|
const rel = `${ROLES_DIR}/${name}`;
|
|
@@ -7079,7 +7208,7 @@ function readRoles() {
|
|
|
7079
7208
|
});
|
|
7080
7209
|
}
|
|
7081
7210
|
function readContracts() {
|
|
7082
|
-
if (!
|
|
7211
|
+
if (!existsSync2(CONTRACTS_DIR))
|
|
7083
7212
|
return [];
|
|
7084
7213
|
return readdirSync(CONTRACTS_DIR).filter((name) => name.endsWith(".md")).map((name) => {
|
|
7085
7214
|
const rel = `${CONTRACTS_DIR}/${name}`;
|
|
@@ -7154,7 +7283,7 @@ function emitResult(result, blocking) {
|
|
|
7154
7283
|
}
|
|
7155
7284
|
}
|
|
7156
7285
|
async function main() {
|
|
7157
|
-
if (!
|
|
7286
|
+
if (!existsSync2(ENFORCEMENT_PATH)) {
|
|
7158
7287
|
emitCheckError({
|
|
7159
7288
|
schema: CHECK_SCHEMA_VERSION,
|
|
7160
7289
|
check: `${CHECK_NAME}.dormant`,
|
|
@@ -7182,7 +7311,7 @@ async function main() {
|
|
|
7182
7311
|
}
|
|
7183
7312
|
]
|
|
7184
7313
|
};
|
|
7185
|
-
const g1 = checkG1(rows,
|
|
7314
|
+
const g1 = checkG1(rows, existsSync2, { docs: readHookScanFiles(DOCTRINE_DIR), shipped: shippedHookPaths() });
|
|
7186
7315
|
const g2 = checkG2(rows, candidateFiles);
|
|
7187
7316
|
const g3 = checkG3(ring0Rows, crossingFiles);
|
|
7188
7317
|
const g5 = checkG5(roles, contracts);
|