@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
|
@@ -3,7 +3,7 @@ import { createRequire } from "node:module";
|
|
|
3
3
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
4
4
|
|
|
5
5
|
// src/checks/bin/check-coherence.ts
|
|
6
|
-
import { execFile as execFile5, execFileSync as
|
|
6
|
+
import { execFile as execFile5, execFileSync as execFileSync3 } from "node:child_process";
|
|
7
7
|
import { existsSync as existsSync2, readFileSync as readFileSync3 } from "node:fs";
|
|
8
8
|
import { join as join2 } from "node:path";
|
|
9
9
|
import { promisify as promisify5 } from "node:util";
|
|
@@ -1890,45 +1890,6 @@ var DERIVED_STATUSES = [
|
|
|
1890
1890
|
"incoherent"
|
|
1891
1891
|
];
|
|
1892
1892
|
var DERIVABLE_STATUSES = DERIVED_STATUSES.filter((s) => s !== "backlog");
|
|
1893
|
-
// ../../packages/aeg-core/src/parse-ledger.ts
|
|
1894
|
-
function rowFromCells(cells) {
|
|
1895
|
-
if (cells.length < 7)
|
|
1896
|
-
return null;
|
|
1897
|
-
const phase = (cells[0] ?? "").trim();
|
|
1898
|
-
if (!phase)
|
|
1899
|
-
return null;
|
|
1900
|
-
return {
|
|
1901
|
-
phase,
|
|
1902
|
-
role: (cells[1] ?? "").trim(),
|
|
1903
|
-
agentModel: (cells[2] ?? "").trim(),
|
|
1904
|
-
tokensIn: parseIntCell(cells[3] ?? ""),
|
|
1905
|
-
tokensOut: parseIntCell(cells[4] ?? ""),
|
|
1906
|
-
cost: parseCostCell(cells[5] ?? ""),
|
|
1907
|
-
date: (cells[6] ?? "").trim()
|
|
1908
|
-
};
|
|
1909
|
-
}
|
|
1910
|
-
function parseIntCell(cell) {
|
|
1911
|
-
const trimmed = cell.replace(/`/g, "").trim();
|
|
1912
|
-
if (!trimmed || isEmDashOrDash(trimmed))
|
|
1913
|
-
return null;
|
|
1914
|
-
const normalized = trimmed.replace(/[,_\s]/g, "");
|
|
1915
|
-
if (!/^-?\d+$/.test(normalized))
|
|
1916
|
-
return null;
|
|
1917
|
-
return Number(normalized);
|
|
1918
|
-
}
|
|
1919
|
-
function parseCostCell(cell) {
|
|
1920
|
-
const trimmed = cell.replace(/`/g, "").trim();
|
|
1921
|
-
if (!trimmed || isEmDashOrDash(trimmed))
|
|
1922
|
-
return null;
|
|
1923
|
-
const normalized = trimmed.replace(/^\$/, "").replace(/[,_\s]/g, "");
|
|
1924
|
-
if (!/^-?\d+(\.\d+)?$/.test(normalized))
|
|
1925
|
-
return null;
|
|
1926
|
-
return Number(normalized);
|
|
1927
|
-
}
|
|
1928
|
-
function isEmDashOrDash(s) {
|
|
1929
|
-
const t = s.trim();
|
|
1930
|
-
return t === "—" || t === "-" || t === "–";
|
|
1931
|
-
}
|
|
1932
1893
|
// ../../packages/aeg-core/src/waiver-label.ts
|
|
1933
1894
|
var WAIVER_LABEL = label("waiver-docs");
|
|
1934
1895
|
var WAIVER_LABEL_REVIEW = label("waiver-review");
|
|
@@ -1944,61 +1905,6 @@ function isWaiverLabelActorVerified(opts) {
|
|
|
1944
1905
|
return false;
|
|
1945
1906
|
return isPrincipal(opts.labelActor, opts.principalAllowlist);
|
|
1946
1907
|
}
|
|
1947
|
-
|
|
1948
|
-
// ../../packages/aeg-core/src/parse-token-report.ts
|
|
1949
|
-
var TOKEN_REPORT_HEADING = /^\s*(?:#{1,6}\s*Token report\s*|\*\*Token report\*\*)\s*$/i;
|
|
1950
|
-
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;
|
|
1951
|
-
function parseTokenReportEntries(body) {
|
|
1952
|
-
const lines = body.split(/\r?\n/);
|
|
1953
|
-
const headingIdxs = [];
|
|
1954
|
-
lines.forEach((line, i) => {
|
|
1955
|
-
if (TOKEN_REPORT_HEADING.test(line))
|
|
1956
|
-
headingIdxs.push(i);
|
|
1957
|
-
});
|
|
1958
|
-
const out = [];
|
|
1959
|
-
for (let h = 0;h < headingIdxs.length; h++) {
|
|
1960
|
-
const start = headingIdxs[h] + 1;
|
|
1961
|
-
const end = h + 1 < headingIdxs.length ? headingIdxs[h + 1] : lines.length;
|
|
1962
|
-
const section = lines.slice(start, end).join(`
|
|
1963
|
-
`);
|
|
1964
|
-
const tableRows = parseTableSection(section);
|
|
1965
|
-
if (tableRows.length > 0) {
|
|
1966
|
-
out.push(...tableRows);
|
|
1967
|
-
continue;
|
|
1968
|
-
}
|
|
1969
|
-
const inlineRow = parseInlineFieldList(section);
|
|
1970
|
-
if (inlineRow)
|
|
1971
|
-
out.push(inlineRow);
|
|
1972
|
-
}
|
|
1973
|
-
return out;
|
|
1974
|
-
}
|
|
1975
|
-
function parseTableSection(section) {
|
|
1976
|
-
const lines = section.split(/\r?\n/);
|
|
1977
|
-
let i = 0;
|
|
1978
|
-
for (;i < lines.length; i++) {
|
|
1979
|
-
if ((lines[i] ?? "").trim().startsWith("|"))
|
|
1980
|
-
break;
|
|
1981
|
-
}
|
|
1982
|
-
if (i + 1 >= lines.length)
|
|
1983
|
-
return [];
|
|
1984
|
-
i += 2;
|
|
1985
|
-
const out = [];
|
|
1986
|
-
for (;i < lines.length; i++) {
|
|
1987
|
-
const trimmed = (lines[i] ?? "").trim();
|
|
1988
|
-
if (!trimmed.startsWith("|"))
|
|
1989
|
-
break;
|
|
1990
|
-
const row = rowFromCells(splitTableRow(trimmed));
|
|
1991
|
-
if (row)
|
|
1992
|
-
out.push(row);
|
|
1993
|
-
}
|
|
1994
|
-
return out;
|
|
1995
|
-
}
|
|
1996
|
-
function parseInlineFieldList(section) {
|
|
1997
|
-
const m = section.match(INLINE_FIELD_LIST);
|
|
1998
|
-
if (!m)
|
|
1999
|
-
return null;
|
|
2000
|
-
return rowFromCells([m[1], m[2], m[3], m[4], m[5], m[6], m[7]]);
|
|
2001
|
-
}
|
|
2002
1908
|
// ../../packages/aeg-core/src/verdict-extraction.ts
|
|
2003
1909
|
var HEAD_SHA_PATTERN = /^[ \t]*(?:\*{1,3}|_{1,3})?Judged head:\s*([0-9a-f]{7,40})(?![A-Za-z0-9])/im;
|
|
2004
1910
|
var OBJECTIVES_VERSION_PATTERN = /^[ \t]*(?:\*{1,3}|_{1,3})?Objectives version:\s*([0-9a-f]{64})(?![A-Za-z0-9])/im;
|
|
@@ -2447,10 +2353,12 @@ function evaluateC5(changed, docOwnersContent, prBody, fileExists, waiverActive,
|
|
|
2447
2353
|
var CODE_REVIEW_SEVERITY_ORDER = ["BLOCKER", "MAJOR", "MINOR"];
|
|
2448
2354
|
var SECURITY_SEVERITY_ORDER = ["CRITICAL", "HIGH", "MEDIUM", "LOW"];
|
|
2449
2355
|
var DEFAULT_MAX_ROUNDS = 3;
|
|
2356
|
+
var DEFAULT_MAX_TASK_MINUTES = 180;
|
|
2450
2357
|
var DEFAULT_REVIEW_POLICY = {
|
|
2451
2358
|
codeReviewThreshold: "BLOCKER",
|
|
2452
2359
|
securityThreshold: "HIGH",
|
|
2453
|
-
maxRounds: DEFAULT_MAX_ROUNDS
|
|
2360
|
+
maxRounds: DEFAULT_MAX_ROUNDS,
|
|
2361
|
+
maxTaskMinutes: DEFAULT_MAX_TASK_MINUTES
|
|
2454
2362
|
};
|
|
2455
2363
|
var FILE_SHAPED_LOCATION = /\.[a-zA-Z0-9]{1,10}(:\d+)?\s*$/;
|
|
2456
2364
|
var PROSE_LOCATION_PATTERNS = [/\bpr\s*body\b/i, /\bcomment\b/i];
|
|
@@ -2851,11 +2759,13 @@ function checkDocUpdateList(prBody) {
|
|
|
2851
2759
|
return headingCheck(prBody, "(?:documentation|doc)[- ]update(?:\\s+list)?", "Documentation-update list");
|
|
2852
2760
|
}
|
|
2853
2761
|
function checkWorktreeStep0(prBody) {
|
|
2854
|
-
if (/git worktree add/.test(prBody))
|
|
2762
|
+
if (/git worktree add/.test(prBody) || /cd \.worktrees\//.test(prBody) || /bun install --frozen-lockfile/.test(prBody))
|
|
2855
2763
|
return { status: "pass", errors: [] };
|
|
2856
2764
|
return {
|
|
2857
2765
|
status: "fail",
|
|
2858
|
-
errors: [
|
|
2766
|
+
errors: [
|
|
2767
|
+
"brief-validation worktree Step 0: no `git worktree add`, `cd .worktrees/`, or `bun install --frozen-lockfile` command found in the PR body."
|
|
2768
|
+
]
|
|
2859
2769
|
};
|
|
2860
2770
|
}
|
|
2861
2771
|
function checkStopConditions(prBody) {
|
|
@@ -3045,7 +2955,8 @@ function isCommandBlock(content) {
|
|
|
3045
2955
|
return COMMAND_WORDS.includes(commandWordOf(firstNonBlankLine(content)));
|
|
3046
2956
|
}
|
|
3047
2957
|
function isStep0Block(content) {
|
|
3048
|
-
|
|
2958
|
+
const first = firstNonBlankLine(content);
|
|
2959
|
+
return first.startsWith("git worktree add") || first.startsWith("cd .worktrees/") || first.startsWith("bun install --frozen-lockfile");
|
|
3049
2960
|
}
|
|
3050
2961
|
function checkCommandsCarryOutput(prBody) {
|
|
3051
2962
|
const errors = [];
|
|
@@ -3514,10 +3425,14 @@ function legacySlugPattern(legacySlugs) {
|
|
|
3514
3425
|
const alternation = legacySlugs.map((s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|");
|
|
3515
3426
|
return new RegExp(`(^|[^a-zA-Z0-9\\n-])(${alternation})([^a-zA-Z0-9\\n-]|$)`, "g");
|
|
3516
3427
|
}
|
|
3428
|
+
function specGrandfatherPaths(specGrandfather) {
|
|
3429
|
+
return Array.isArray(specGrandfather) ? [...specGrandfather] : Object.keys(specGrandfather);
|
|
3430
|
+
}
|
|
3517
3431
|
function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuffix, legacySlugs = [], shipsPrefix = SHIPS_PREFIX, specGrandfather = [], specPaths = DEFAULT_SPEC_PATHS) {
|
|
3518
3432
|
const findings = [];
|
|
3519
3433
|
const legacyPattern = legacySlugPattern(legacySlugs);
|
|
3520
|
-
const
|
|
3434
|
+
const grandfatheredWhole = new Set(Array.isArray(specGrandfather) ? specGrandfather : []);
|
|
3435
|
+
const limits = new Map(Array.isArray(specGrandfather) ? [] : Object.entries(specGrandfather));
|
|
3521
3436
|
const patterns = [
|
|
3522
3437
|
{ pattern: FORGE_NUMBER_PATTERN, what: "a forge number" },
|
|
3523
3438
|
{ pattern: TRANCHE_SLUG_VN_PATTERN, what: "an internal tranche slug" },
|
|
@@ -3536,18 +3451,19 @@ function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuff
|
|
|
3536
3451
|
continue;
|
|
3537
3452
|
if (cls !== "product" && cls !== "spec" && !SWEPT_CLASSES.has(cls))
|
|
3538
3453
|
continue;
|
|
3539
|
-
if (cls === "spec" &&
|
|
3454
|
+
if (cls === "spec" && grandfatheredWhole.has(file.path))
|
|
3540
3455
|
continue;
|
|
3541
3456
|
const blocking = cls === "product" || cls === "spec";
|
|
3542
3457
|
const scrubbed = cls === "product" ? stripNonProseForProduct(file.path, file.content) : stripNonProse(file.path, file.content);
|
|
3543
3458
|
const patternsToRun = cls === "product" ? productPatterns : cls === "spec" ? specPatterns : patterns;
|
|
3459
|
+
const fileFindings = [];
|
|
3544
3460
|
for (const { pattern, what, group } of patternsToRun) {
|
|
3545
3461
|
pattern.lastIndex = 0;
|
|
3546
3462
|
let match = pattern.exec(scrubbed);
|
|
3547
3463
|
while (match !== null) {
|
|
3548
3464
|
const cited = group !== undefined ? match[group] ?? match[0] : match[0];
|
|
3549
3465
|
const citedIndex = match.index + match[0].indexOf(cited);
|
|
3550
|
-
|
|
3466
|
+
fileFindings.push({
|
|
3551
3467
|
file: file.path,
|
|
3552
3468
|
line: lineAt(scrubbed, citedIndex),
|
|
3553
3469
|
message: `references ${what} ("${cited}") a reader outside this repo's tracker cannot resolve`,
|
|
@@ -3556,6 +3472,15 @@ function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuff
|
|
|
3556
3472
|
match = pattern.exec(scrubbed);
|
|
3557
3473
|
}
|
|
3558
3474
|
}
|
|
3475
|
+
const limit = cls === "spec" ? limits.get(file.path) : undefined;
|
|
3476
|
+
if (limit !== undefined) {
|
|
3477
|
+
if (fileFindings.length <= limit)
|
|
3478
|
+
continue;
|
|
3479
|
+
for (const f of fileFindings) {
|
|
3480
|
+
f.message += `; ${file.path} carries ${fileFindings.length} such findings, over its proseGates.specGrandfather limit of ${limit}`;
|
|
3481
|
+
}
|
|
3482
|
+
}
|
|
3483
|
+
findings.push(...fileFindings);
|
|
3559
3484
|
}
|
|
3560
3485
|
return findings;
|
|
3561
3486
|
}
|
|
@@ -4515,8 +4440,7 @@ function briefHash(brief) {
|
|
|
4515
4440
|
function policyDigest(policy) {
|
|
4516
4441
|
return createHash4("sha256").update(JSON.stringify({
|
|
4517
4442
|
codeReviewThreshold: policy.codeReviewThreshold,
|
|
4518
|
-
securityThreshold: policy.securityThreshold
|
|
4519
|
-
maxRounds: policy.maxRounds
|
|
4443
|
+
securityThreshold: policy.securityThreshold
|
|
4520
4444
|
})).digest("hex");
|
|
4521
4445
|
}
|
|
4522
4446
|
function isBoundToHead(echoed, headSha) {
|
|
@@ -4829,7 +4753,46 @@ function parseEnforcementRegistry(content) {
|
|
|
4829
4753
|
return result;
|
|
4830
4754
|
}
|
|
4831
4755
|
// ../../packages/aeg-core/src/registry-checks.ts
|
|
4832
|
-
|
|
4756
|
+
var HOOK_DIR_PREFIXES = [".claude/hooks/", ".vinaya/hooks/", ".husky/", ".git/hooks/"];
|
|
4757
|
+
var BARE_HOOK_NAME = /^check-[A-Za-z0-9_.-]*\.sh$/;
|
|
4758
|
+
function basename(path) {
|
|
4759
|
+
return path.slice(path.lastIndexOf("/") + 1);
|
|
4760
|
+
}
|
|
4761
|
+
function lineOf(content, index) {
|
|
4762
|
+
let line = 1;
|
|
4763
|
+
for (let i = 0;i < index; i++)
|
|
4764
|
+
if (content.charCodeAt(i) === 10)
|
|
4765
|
+
line++;
|
|
4766
|
+
return line;
|
|
4767
|
+
}
|
|
4768
|
+
function findUnshippedHookRefs(docs, shipped) {
|
|
4769
|
+
const shippedNames = new Set([...shipped].map(basename));
|
|
4770
|
+
const findings = [];
|
|
4771
|
+
const flag = (doc, token, index) => {
|
|
4772
|
+
findings.push({
|
|
4773
|
+
path: doc.path,
|
|
4774
|
+
reason: `${doc.path}:${lineOf(doc.content, index)} names hook "${token}", which is neither tracked in git nor emitted by \`vinaya init\``
|
|
4775
|
+
});
|
|
4776
|
+
};
|
|
4777
|
+
for (const doc of docs) {
|
|
4778
|
+
for (const { cited, index } of extractCitedPaths(doc.content)) {
|
|
4779
|
+
if (cited.endsWith("/") || !HOOK_DIR_PREFIXES.some((p) => cited.startsWith(p)))
|
|
4780
|
+
continue;
|
|
4781
|
+
if (!shipped.has(cited))
|
|
4782
|
+
flag(doc, cited, index);
|
|
4783
|
+
}
|
|
4784
|
+
const spanPattern = /`([^`\n]+)`/g;
|
|
4785
|
+
let match = spanPattern.exec(doc.content);
|
|
4786
|
+
while (match !== null) {
|
|
4787
|
+
const token = match[1] ?? "";
|
|
4788
|
+
if (BARE_HOOK_NAME.test(token) && !shippedNames.has(token))
|
|
4789
|
+
flag(doc, token, match.index);
|
|
4790
|
+
match = spanPattern.exec(doc.content);
|
|
4791
|
+
}
|
|
4792
|
+
}
|
|
4793
|
+
return findings;
|
|
4794
|
+
}
|
|
4795
|
+
function checkG1(rows, existsFn, hookRefs) {
|
|
4833
4796
|
const findings = [];
|
|
4834
4797
|
for (const row of rows) {
|
|
4835
4798
|
if (row.implementation === "")
|
|
@@ -4842,6 +4805,8 @@ function checkG1(rows, existsFn) {
|
|
|
4842
4805
|
});
|
|
4843
4806
|
}
|
|
4844
4807
|
}
|
|
4808
|
+
if (hookRefs)
|
|
4809
|
+
findings.push(...findUnshippedHookRefs(hookRefs.docs, hookRefs.shipped));
|
|
4845
4810
|
return { check: "G1", status: findings.length > 0 ? "fail" : "pass", findings };
|
|
4846
4811
|
}
|
|
4847
4812
|
var SCAFFOLD_PLACEHOLDER = "[undocumented — fill in why]";
|
|
@@ -5395,7 +5360,6 @@ var TaskPrPauseSchema = z.object({
|
|
|
5395
5360
|
var TaskPrReviewRecordSchema = z.object({
|
|
5396
5361
|
verdicts: z.array(TaskPrVerdictSchema),
|
|
5397
5362
|
roundMarkers: z.array(z.number().int().nonnegative()),
|
|
5398
|
-
summaryTable: z.string().nullable(),
|
|
5399
5363
|
pause: TaskPrPauseSchema.nullable()
|
|
5400
5364
|
});
|
|
5401
5365
|
var TaskPrReadInputSchema = z.object({
|
|
@@ -5442,16 +5406,6 @@ var TaskCancelResultSchema = z.object({
|
|
|
5442
5406
|
authenticatedFrom: z.string().min(1),
|
|
5443
5407
|
fencedEffectKeys: z.array(z.string())
|
|
5444
5408
|
});
|
|
5445
|
-
var TASK_TOOL_NAMES = [
|
|
5446
|
-
"task_start",
|
|
5447
|
-
"task_status",
|
|
5448
|
-
"task_escalation_read",
|
|
5449
|
-
"task_pr_read",
|
|
5450
|
-
"task_resume",
|
|
5451
|
-
"task_cancel"
|
|
5452
|
-
];
|
|
5453
|
-
var OPERATOR_STATUS_FOLLOW = "task_status_follow";
|
|
5454
|
-
var OPERATOR_TOOL_GRANT = [...TASK_TOOL_NAMES, OPERATOR_STATUS_FOLLOW];
|
|
5455
5409
|
// ../../packages/aeg-core/src/first-push-dispatch-gate.ts
|
|
5456
5410
|
function parseTaskBranch(branch) {
|
|
5457
5411
|
const m = /^task\/([^/]+)\/([^/]+)$/.exec(branch);
|
|
@@ -5682,15 +5636,69 @@ var NO_GATE_CUTOVERS = {
|
|
|
5682
5636
|
briefRulesSincePr: null,
|
|
5683
5637
|
agentBoxesRefusedSincePr: null
|
|
5684
5638
|
};
|
|
5685
|
-
// ../../packages/aeg-core/src/dev-review-loop/types.ts
|
|
5686
|
-
var SEVERITY_COLUMNS = ["blocker", "major", "minor", "critical", "high", "medium", "low"];
|
|
5687
|
-
// ../../packages/aeg-core/src/dev-review-loop/journal-reconstruction.ts
|
|
5688
|
-
var SUMMARY_TABLE_HEADER = `| round | ${SEVERITY_COLUMNS.join(" | ")} | confidence | outcome |`;
|
|
5689
|
-
// ../../packages/aeg-core/src/log/envelope.ts
|
|
5690
|
-
import { createHash as createHash5 } from "node:crypto";
|
|
5691
|
-
|
|
5692
5639
|
// ../../packages/aeg-core/src/log/schema.ts
|
|
5640
|
+
import { z as z3 } from "zod";
|
|
5641
|
+
|
|
5642
|
+
// ../../packages/aeg-core/src/log/custom.ts
|
|
5693
5643
|
import { z as z2 } from "zod";
|
|
5644
|
+
var CUSTOM_EVENT_NAME_PATTERN = /^[a-z][a-z0-9_]*\.[a-z][a-z0-9_.]*$/;
|
|
5645
|
+
var CUSTOM_EVENT_NAME_MAX_LENGTH = 64;
|
|
5646
|
+
var CUSTOM_EVENT_RESERVED_NAMESPACE = "vinaya";
|
|
5647
|
+
var CUSTOM_EVENT_MAX_FIELDS = 20;
|
|
5648
|
+
var CUSTOM_FIELD_NAME_PATTERN = /^[a-z][a-z0-9_]*$/;
|
|
5649
|
+
var CUSTOM_FIELD_NAME_MAX_LENGTH = 64;
|
|
5650
|
+
var CUSTOM_TEXT_MAX_LENGTH = 500;
|
|
5651
|
+
var CUSTOM_WORD_PATTERN = /^[a-z0-9][a-z0-9_-]*$/;
|
|
5652
|
+
var CUSTOM_WORD_MAX_LENGTH = 64;
|
|
5653
|
+
var CUSTOM_FIELD_MAX_WORDS = 50;
|
|
5654
|
+
var CustomFieldTypeSchema = z2.union([z2.enum(["text", "number", "boolean"]), z2.array(z2.string())]);
|
|
5655
|
+
var CustomEventDeclarationsSchema = z2.record(z2.string(), z2.object({
|
|
5656
|
+
fields: z2.record(z2.string(), CustomFieldTypeSchema)
|
|
5657
|
+
}).strict()).superRefine((events, ctx) => {
|
|
5658
|
+
for (const [name, declaration] of Object.entries(events)) {
|
|
5659
|
+
const refuse = (message, path = []) => {
|
|
5660
|
+
ctx.addIssue({
|
|
5661
|
+
code: z2.ZodIssueCode.custom,
|
|
5662
|
+
path: [name, ...path],
|
|
5663
|
+
message: `logs.events "${name}": ${message}`
|
|
5664
|
+
});
|
|
5665
|
+
};
|
|
5666
|
+
if (name.length > CUSTOM_EVENT_NAME_MAX_LENGTH) {
|
|
5667
|
+
refuse(`the name must be at most ${CUSTOM_EVENT_NAME_MAX_LENGTH} characters`);
|
|
5668
|
+
}
|
|
5669
|
+
if (!CUSTOM_EVENT_NAME_PATTERN.test(name)) {
|
|
5670
|
+
refuse("the name must be `<namespace>.<event>` — lowercase letters, digits and `_`, a dot between them");
|
|
5671
|
+
} else if (name.split(".")[0] === CUSTOM_EVENT_RESERVED_NAMESPACE) {
|
|
5672
|
+
refuse(`the \`${CUSTOM_EVENT_RESERVED_NAMESPACE}.\` namespace is reserved for Vinaya's own events`);
|
|
5673
|
+
}
|
|
5674
|
+
const fieldEntries = Object.entries(declaration.fields);
|
|
5675
|
+
if (fieldEntries.length > CUSTOM_EVENT_MAX_FIELDS) {
|
|
5676
|
+
refuse(`at most ${CUSTOM_EVENT_MAX_FIELDS} fields may be declared (found ${fieldEntries.length})`, ["fields"]);
|
|
5677
|
+
}
|
|
5678
|
+
for (const [field, type] of fieldEntries) {
|
|
5679
|
+
if (field.length > CUSTOM_FIELD_NAME_MAX_LENGTH || !CUSTOM_FIELD_NAME_PATTERN.test(field)) {
|
|
5680
|
+
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]);
|
|
5681
|
+
}
|
|
5682
|
+
if (typeof type === "string")
|
|
5683
|
+
continue;
|
|
5684
|
+
if (type.length === 0) {
|
|
5685
|
+
refuse(`field "${field}": a list of words must name at least one word`, ["fields", field]);
|
|
5686
|
+
}
|
|
5687
|
+
if (type.length > CUSTOM_FIELD_MAX_WORDS) {
|
|
5688
|
+
refuse(`field "${field}": a list of words may name at most ${CUSTOM_FIELD_MAX_WORDS}`, ["fields", field]);
|
|
5689
|
+
}
|
|
5690
|
+
const bad = type.filter((w) => w.length > CUSTOM_WORD_MAX_LENGTH || !CUSTOM_WORD_PATTERN.test(w));
|
|
5691
|
+
if (bad.length > 0) {
|
|
5692
|
+
refuse(`field "${field}": a listed word is lowercase letters, digits, \`_\` and \`-\`, at most ${CUSTOM_WORD_MAX_LENGTH} characters`, ["fields", field]);
|
|
5693
|
+
}
|
|
5694
|
+
if (new Set(type).size !== type.length) {
|
|
5695
|
+
refuse(`field "${field}": a list of words names a word twice`, ["fields", field]);
|
|
5696
|
+
}
|
|
5697
|
+
}
|
|
5698
|
+
}
|
|
5699
|
+
});
|
|
5700
|
+
|
|
5701
|
+
// ../../packages/aeg-core/src/log/schema.ts
|
|
5694
5702
|
var CONFIDENCE_REASON_MAX_LENGTH = 280;
|
|
5695
5703
|
var ROLE_VALUES = [
|
|
5696
5704
|
"planner",
|
|
@@ -5701,178 +5709,210 @@ var ROLE_VALUES = [
|
|
|
5701
5709
|
"archivist",
|
|
5702
5710
|
"architect"
|
|
5703
5711
|
];
|
|
5704
|
-
var RoleSchema =
|
|
5712
|
+
var RoleSchema = z3.enum(ROLE_VALUES);
|
|
5705
5713
|
var HOST_VALUES = ["hook", "ci", "cli", "loop"];
|
|
5706
|
-
var HostSchema =
|
|
5714
|
+
var HostSchema = z3.enum(HOST_VALUES);
|
|
5707
5715
|
var RUN_ID_PATTERN = /^[A-Za-z0-9_.-]{1,128}$/;
|
|
5708
5716
|
var headerMetaCore = {
|
|
5709
|
-
ts:
|
|
5710
|
-
run_id:
|
|
5711
|
-
seq:
|
|
5712
|
-
repo:
|
|
5713
|
-
vinaya:
|
|
5714
|
-
doctrine:
|
|
5717
|
+
ts: z3.string(),
|
|
5718
|
+
run_id: z3.string().regex(RUN_ID_PATTERN),
|
|
5719
|
+
seq: z3.number().int().nonnegative(),
|
|
5720
|
+
repo: z3.string().nullable(),
|
|
5721
|
+
vinaya: z3.string(),
|
|
5722
|
+
doctrine: z3.string(),
|
|
5715
5723
|
host: HostSchema,
|
|
5716
|
-
machine:
|
|
5724
|
+
machine: z3.string()
|
|
5717
5725
|
};
|
|
5718
|
-
var HeaderMetaV1Schema =
|
|
5719
|
-
schema:
|
|
5726
|
+
var HeaderMetaV1Schema = z3.object({
|
|
5727
|
+
schema: z3.literal(1),
|
|
5720
5728
|
...headerMetaCore
|
|
5721
5729
|
}).strict();
|
|
5722
|
-
var LineageSchema =
|
|
5723
|
-
run:
|
|
5724
|
-
attempt:
|
|
5725
|
-
parent:
|
|
5730
|
+
var LineageSchema = z3.object({
|
|
5731
|
+
run: z3.string().nullable(),
|
|
5732
|
+
attempt: z3.number().int().nullable(),
|
|
5733
|
+
parent: z3.string().nullable()
|
|
5726
5734
|
}).strict();
|
|
5727
|
-
var InputVersionsSchema =
|
|
5728
|
-
objectives_version:
|
|
5729
|
-
brief_hash:
|
|
5730
|
-
ruling_ordinal:
|
|
5731
|
-
policy_digest:
|
|
5735
|
+
var InputVersionsSchema = z3.object({
|
|
5736
|
+
objectives_version: z3.string().nullable(),
|
|
5737
|
+
brief_hash: z3.string().nullable(),
|
|
5738
|
+
ruling_ordinal: z3.number().int().nullable(),
|
|
5739
|
+
policy_digest: z3.string().nullable()
|
|
5732
5740
|
}).strict();
|
|
5733
|
-
var ProvenanceSchema =
|
|
5734
|
-
var HeaderMetaV2Schema =
|
|
5735
|
-
schema:
|
|
5741
|
+
var ProvenanceSchema = z3.enum(["parent_attributed", "env_correlated", "self_reported", "unavailable"]);
|
|
5742
|
+
var HeaderMetaV2Schema = z3.object({
|
|
5743
|
+
schema: z3.literal(2),
|
|
5736
5744
|
...headerMetaCore,
|
|
5737
|
-
event_id:
|
|
5738
|
-
process_id:
|
|
5739
|
-
actor_id:
|
|
5745
|
+
event_id: z3.string().min(1),
|
|
5746
|
+
process_id: z3.string().min(1),
|
|
5747
|
+
actor_id: z3.string().nullable(),
|
|
5740
5748
|
lineage: LineageSchema,
|
|
5741
5749
|
input_versions: InputVersionsSchema,
|
|
5742
5750
|
provenance: ProvenanceSchema
|
|
5743
5751
|
}).strict();
|
|
5744
|
-
var
|
|
5745
|
-
|
|
5746
|
-
|
|
5747
|
-
|
|
5748
|
-
|
|
5749
|
-
role: z2.union([RoleSchema, z2.literal("unattributed")]),
|
|
5750
|
-
round: z2.number().int().optional(),
|
|
5751
|
-
objectives_version: z2.string().optional()
|
|
5752
|
+
var WorkSchema = z3.object({
|
|
5753
|
+
ref: z3.string().nullable(),
|
|
5754
|
+
repo: z3.string().nullable(),
|
|
5755
|
+
change: z3.string().nullable(),
|
|
5756
|
+
revision: z3.string().nullable()
|
|
5752
5757
|
}).strict();
|
|
5753
|
-
var
|
|
5758
|
+
var FlowSchema = z3.object({
|
|
5759
|
+
id: z3.string().nullable(),
|
|
5760
|
+
version: z3.string().nullable()
|
|
5761
|
+
}).strict();
|
|
5762
|
+
var HeaderMetaV3Schema = z3.object({
|
|
5763
|
+
schema: z3.literal(3),
|
|
5764
|
+
...headerMetaCore,
|
|
5765
|
+
event_id: z3.string().min(1),
|
|
5766
|
+
process_id: z3.string().min(1),
|
|
5767
|
+
actor_id: z3.string().nullable(),
|
|
5768
|
+
lineage: LineageSchema,
|
|
5769
|
+
input_versions: InputVersionsSchema,
|
|
5770
|
+
provenance: ProvenanceSchema,
|
|
5771
|
+
work: WorkSchema,
|
|
5772
|
+
flow: FlowSchema,
|
|
5773
|
+
runtime: z3.string().nullable(),
|
|
5774
|
+
source: z3.string().nullable()
|
|
5775
|
+
}).strict();
|
|
5776
|
+
var HeaderMetaSchema = z3.discriminatedUnion("schema", [HeaderMetaV1Schema, HeaderMetaV2Schema, HeaderMetaV3Schema]);
|
|
5777
|
+
var SubjectSchema = z3.object({
|
|
5778
|
+
issue: z3.number().int().nullable(),
|
|
5779
|
+
pr: z3.number().int().optional(),
|
|
5780
|
+
sha: z3.string().optional(),
|
|
5781
|
+
role: z3.union([RoleSchema, z3.literal("unattributed")]),
|
|
5782
|
+
round: z3.number().int().optional(),
|
|
5783
|
+
objectives_version: z3.string().optional()
|
|
5784
|
+
}).strict();
|
|
5785
|
+
var HeaderSchema = z3.object({
|
|
5754
5786
|
meta: HeaderMetaSchema,
|
|
5755
5787
|
subject: SubjectSchema
|
|
5756
5788
|
}).strict();
|
|
5757
5789
|
var envelopeTail = {
|
|
5758
|
-
duration_ms:
|
|
5759
|
-
payload:
|
|
5790
|
+
duration_ms: z3.number().nonnegative().optional(),
|
|
5791
|
+
payload: z3.object({}).strict()
|
|
5760
5792
|
};
|
|
5761
|
-
var ReviewFindingSchema =
|
|
5762
|
-
id:
|
|
5763
|
-
severity:
|
|
5764
|
-
state:
|
|
5765
|
-
severity_scale:
|
|
5766
|
-
policy_treatment:
|
|
5767
|
-
confidence:
|
|
5768
|
-
confidence_scale:
|
|
5769
|
-
confidence_source:
|
|
5793
|
+
var ReviewFindingSchema = z3.object({
|
|
5794
|
+
id: z3.string(),
|
|
5795
|
+
severity: z3.string(),
|
|
5796
|
+
state: z3.string().optional(),
|
|
5797
|
+
severity_scale: z3.string().optional(),
|
|
5798
|
+
policy_treatment: z3.enum(["blocking", "non_blocking", "unavailable"]).optional(),
|
|
5799
|
+
confidence: z3.number().min(0).max(1).optional(),
|
|
5800
|
+
confidence_scale: z3.string().optional(),
|
|
5801
|
+
confidence_source: z3.string().optional()
|
|
5770
5802
|
}).strict();
|
|
5771
|
-
var DispatchOutcomeSchema =
|
|
5772
|
-
|
|
5773
|
-
|
|
5774
|
-
type:
|
|
5775
|
-
pr:
|
|
5776
|
-
head:
|
|
5777
|
-
comment_id:
|
|
5803
|
+
var DispatchOutcomeSchema = z3.discriminatedUnion("type", [
|
|
5804
|
+
z3.object({ type: z3.literal("pr_opened"), pr: z3.number().int(), head: z3.string() }).strict(),
|
|
5805
|
+
z3.object({
|
|
5806
|
+
type: z3.literal("round_pushed"),
|
|
5807
|
+
pr: z3.number().int(),
|
|
5808
|
+
head: z3.string(),
|
|
5809
|
+
comment_id: z3.number().int()
|
|
5778
5810
|
}).strict(),
|
|
5779
|
-
|
|
5780
|
-
type:
|
|
5781
|
-
verdict:
|
|
5782
|
-
head:
|
|
5783
|
-
comment_id:
|
|
5784
|
-
objectives:
|
|
5785
|
-
findings:
|
|
5811
|
+
z3.object({
|
|
5812
|
+
type: z3.literal("verdict"),
|
|
5813
|
+
verdict: z3.enum(["APPROVE", "REQUEST CHANGES", "PASS", "FAIL"]),
|
|
5814
|
+
head: z3.string(),
|
|
5815
|
+
comment_id: z3.number().int(),
|
|
5816
|
+
objectives: z3.array(z3.object({ id: z3.string(), met: z3.boolean() }).strict()),
|
|
5817
|
+
findings: z3.array(ReviewFindingSchema)
|
|
5786
5818
|
}).strict(),
|
|
5787
|
-
|
|
5788
|
-
type:
|
|
5789
|
-
class:
|
|
5790
|
-
comment_id:
|
|
5819
|
+
z3.object({
|
|
5820
|
+
type: z3.literal("escalation"),
|
|
5821
|
+
class: z3.enum(["authority", "strategy", "product"]),
|
|
5822
|
+
comment_id: z3.number().int()
|
|
5791
5823
|
}).strict(),
|
|
5792
|
-
|
|
5793
|
-
|
|
5794
|
-
|
|
5795
|
-
|
|
5824
|
+
z3.object({ type: z3.literal("brief"), comment_id: z3.number().int(), hash: z3.string() }).strict(),
|
|
5825
|
+
z3.object({ type: z3.literal("plan"), issues: z3.array(z3.number().int()) }).strict(),
|
|
5826
|
+
z3.object({ type: z3.literal("archive"), provenance_comment_id: z3.number().int() }).strict(),
|
|
5827
|
+
z3.object({ type: z3.literal("completed") }).strict()
|
|
5796
5828
|
]);
|
|
5797
5829
|
var dispatchShared = {
|
|
5798
5830
|
meta: HeaderMetaSchema,
|
|
5799
5831
|
subject: SubjectSchema,
|
|
5800
|
-
kind:
|
|
5832
|
+
kind: z3.literal("dispatch"),
|
|
5801
5833
|
...envelopeTail,
|
|
5802
5834
|
target_role: RoleSchema,
|
|
5803
|
-
model:
|
|
5804
|
-
round:
|
|
5805
|
-
effect_id:
|
|
5835
|
+
model: z3.string(),
|
|
5836
|
+
round: z3.number().int().optional(),
|
|
5837
|
+
effect_id: z3.string()
|
|
5806
5838
|
};
|
|
5807
|
-
var dispatchUsageField =
|
|
5808
|
-
var DispatchEventSchema =
|
|
5809
|
-
|
|
5810
|
-
|
|
5839
|
+
var dispatchUsageField = z3.object({ input: z3.number().nonnegative(), output: z3.number().nonnegative() }).strict().nullable();
|
|
5840
|
+
var DispatchEventSchema = z3.discriminatedUnion("event", [
|
|
5841
|
+
z3.object({ ...dispatchShared, event: z3.literal("dispatched"), prompt_hash: z3.string() }).strict(),
|
|
5842
|
+
z3.object({
|
|
5811
5843
|
...dispatchShared,
|
|
5812
|
-
event:
|
|
5844
|
+
event: z3.literal("outcome_received"),
|
|
5813
5845
|
outcome: DispatchOutcomeSchema,
|
|
5814
5846
|
usage: dispatchUsageField
|
|
5815
5847
|
}).strict(),
|
|
5816
|
-
|
|
5848
|
+
z3.object({
|
|
5817
5849
|
...dispatchShared,
|
|
5818
|
-
event:
|
|
5819
|
-
reason:
|
|
5850
|
+
event: z3.literal("dispatch_failed"),
|
|
5851
|
+
reason: z3.enum(["timeout", "crash", "refused", "unattributed_write"]),
|
|
5820
5852
|
usage: dispatchUsageField
|
|
5821
5853
|
}).strict()
|
|
5822
5854
|
]);
|
|
5855
|
+
var CODE_TOKEN_PATTERN = /^[A-Za-z0-9._-]{1,64}$/;
|
|
5856
|
+
var CodeTokenSchema = z3.string().regex(CODE_TOKEN_PATTERN);
|
|
5857
|
+
var ReviewerVerdictSchema = z3.object({
|
|
5858
|
+
role: RoleSchema,
|
|
5859
|
+
outcome: z3.enum(["approve", "changes_requested", "not_reviewed"]),
|
|
5860
|
+
blockers: z3.number().int().nonnegative()
|
|
5861
|
+
}).strict();
|
|
5823
5862
|
var loopShared = {
|
|
5824
5863
|
meta: HeaderMetaSchema,
|
|
5825
5864
|
subject: SubjectSchema,
|
|
5826
|
-
kind:
|
|
5865
|
+
kind: z3.literal("dev_review_loop"),
|
|
5827
5866
|
...envelopeTail,
|
|
5828
|
-
loop_id:
|
|
5867
|
+
loop_id: z3.string()
|
|
5829
5868
|
};
|
|
5830
|
-
var DevReviewLoopEventSchema =
|
|
5831
|
-
|
|
5869
|
+
var DevReviewLoopEventSchema = z3.discriminatedUnion("event", [
|
|
5870
|
+
z3.object({
|
|
5832
5871
|
...loopShared,
|
|
5833
|
-
event:
|
|
5834
|
-
task:
|
|
5835
|
-
policy:
|
|
5836
|
-
max_rounds:
|
|
5837
|
-
reviewers:
|
|
5838
|
-
models:
|
|
5872
|
+
event: z3.literal("loop_started"),
|
|
5873
|
+
task: z3.number().int(),
|
|
5874
|
+
policy: z3.object({
|
|
5875
|
+
max_rounds: z3.number().int().nonnegative(),
|
|
5876
|
+
reviewers: z3.array(RoleSchema),
|
|
5877
|
+
models: z3.record(RoleSchema, z3.string())
|
|
5839
5878
|
}).strict()
|
|
5840
5879
|
}).strict(),
|
|
5841
|
-
|
|
5842
|
-
|
|
5880
|
+
z3.object({ ...loopShared, event: z3.literal("round_started"), round: z3.number().int(), base_head: z3.string() }).strict(),
|
|
5881
|
+
z3.object({
|
|
5843
5882
|
...loopShared,
|
|
5844
|
-
event:
|
|
5845
|
-
round:
|
|
5846
|
-
head:
|
|
5847
|
-
green:
|
|
5848
|
-
confidence_value:
|
|
5849
|
-
confidence_reason:
|
|
5850
|
-
confidence_unavailable:
|
|
5851
|
-
extra_turn_spent:
|
|
5883
|
+
event: z3.literal("gate_result_read"),
|
|
5884
|
+
round: z3.number().int(),
|
|
5885
|
+
head: z3.string(),
|
|
5886
|
+
green: z3.boolean(),
|
|
5887
|
+
confidence_value: z3.number().int().min(0).max(100).optional(),
|
|
5888
|
+
confidence_reason: z3.string().max(CONFIDENCE_REASON_MAX_LENGTH).optional(),
|
|
5889
|
+
confidence_unavailable: z3.boolean().optional(),
|
|
5890
|
+
extra_turn_spent: z3.boolean().optional()
|
|
5852
5891
|
}).strict(),
|
|
5853
|
-
|
|
5892
|
+
z3.object({
|
|
5854
5893
|
...loopShared,
|
|
5855
|
-
event:
|
|
5856
|
-
round:
|
|
5857
|
-
head:
|
|
5858
|
-
all_approve:
|
|
5859
|
-
blockers:
|
|
5860
|
-
findings:
|
|
5894
|
+
event: z3.literal("verdicts_read"),
|
|
5895
|
+
round: z3.number().int(),
|
|
5896
|
+
head: z3.string(),
|
|
5897
|
+
all_approve: z3.boolean(),
|
|
5898
|
+
blockers: z3.number().int().nonnegative(),
|
|
5899
|
+
findings: z3.array(ReviewFindingSchema).optional(),
|
|
5900
|
+
reviewers: z3.array(ReviewerVerdictSchema).optional()
|
|
5861
5901
|
}).strict(),
|
|
5862
|
-
|
|
5902
|
+
z3.object({
|
|
5863
5903
|
...loopShared,
|
|
5864
|
-
event:
|
|
5865
|
-
round:
|
|
5866
|
-
open:
|
|
5867
|
-
resolved:
|
|
5868
|
-
new:
|
|
5869
|
-
recurring:
|
|
5904
|
+
event: z3.literal("findings_compared"),
|
|
5905
|
+
round: z3.number().int(),
|
|
5906
|
+
open: z3.array(z3.string()),
|
|
5907
|
+
resolved: z3.array(z3.string()),
|
|
5908
|
+
new: z3.array(z3.string()),
|
|
5909
|
+
recurring: z3.array(z3.string())
|
|
5870
5910
|
}).strict(),
|
|
5871
|
-
|
|
5911
|
+
z3.object({
|
|
5872
5912
|
...loopShared,
|
|
5873
|
-
event:
|
|
5874
|
-
round:
|
|
5875
|
-
condition:
|
|
5913
|
+
event: z3.literal("stop_condition_met"),
|
|
5914
|
+
round: z3.number().int(),
|
|
5915
|
+
condition: z3.enum([
|
|
5876
5916
|
"green",
|
|
5877
5917
|
"max_rounds",
|
|
5878
5918
|
"no_progress",
|
|
@@ -5881,66 +5921,85 @@ var DevReviewLoopEventSchema = z2.discriminatedUnion("event", [
|
|
|
5881
5921
|
"confidence",
|
|
5882
5922
|
"reappearance",
|
|
5883
5923
|
"repeat_finding",
|
|
5884
|
-
"repeat_failure"
|
|
5924
|
+
"repeat_failure",
|
|
5925
|
+
"time_budget"
|
|
5885
5926
|
])
|
|
5886
5927
|
}).strict(),
|
|
5887
|
-
|
|
5928
|
+
z3.object({
|
|
5888
5929
|
...loopShared,
|
|
5889
|
-
event:
|
|
5890
|
-
round:
|
|
5891
|
-
reason:
|
|
5930
|
+
event: z3.literal("paused"),
|
|
5931
|
+
round: z3.number().int(),
|
|
5932
|
+
reason: z3.enum(["escalation", "principal_item", "refreeze_needed"]),
|
|
5933
|
+
reason_code: CodeTokenSchema.optional()
|
|
5892
5934
|
}).strict(),
|
|
5893
|
-
|
|
5935
|
+
z3.object({
|
|
5894
5936
|
...loopShared,
|
|
5895
|
-
event:
|
|
5896
|
-
round:
|
|
5897
|
-
by:
|
|
5937
|
+
event: z3.literal("resumed"),
|
|
5938
|
+
round: z3.number().int(),
|
|
5939
|
+
by: z3.enum(["principal", "driver"])
|
|
5898
5940
|
}).strict(),
|
|
5899
|
-
|
|
5941
|
+
z3.object({
|
|
5900
5942
|
...loopShared,
|
|
5901
|
-
event:
|
|
5902
|
-
round:
|
|
5903
|
-
by:
|
|
5943
|
+
event: z3.literal("cancelled"),
|
|
5944
|
+
round: z3.number().int(),
|
|
5945
|
+
by: z3.literal("principal")
|
|
5904
5946
|
}).strict(),
|
|
5905
|
-
|
|
5947
|
+
z3.object({
|
|
5906
5948
|
...loopShared,
|
|
5907
|
-
event:
|
|
5908
|
-
round:
|
|
5909
|
-
branch:
|
|
5910
|
-
detail:
|
|
5949
|
+
event: z3.literal("unpushed_work_resume"),
|
|
5950
|
+
round: z3.number().int(),
|
|
5951
|
+
branch: z3.string(),
|
|
5952
|
+
detail: z3.string()
|
|
5911
5953
|
}).strict(),
|
|
5912
|
-
|
|
5954
|
+
z3.object({
|
|
5913
5955
|
...loopShared,
|
|
5914
|
-
event:
|
|
5915
|
-
round:
|
|
5916
|
-
base_head:
|
|
5917
|
-
head:
|
|
5918
|
-
files_changed:
|
|
5919
|
-
insertions:
|
|
5920
|
-
deletions:
|
|
5921
|
-
wall_ms:
|
|
5922
|
-
outcome:
|
|
5956
|
+
event: z3.literal("round_ended"),
|
|
5957
|
+
round: z3.number().int(),
|
|
5958
|
+
base_head: z3.string(),
|
|
5959
|
+
head: z3.string(),
|
|
5960
|
+
files_changed: z3.number().int().nonnegative(),
|
|
5961
|
+
insertions: z3.number().int().nonnegative(),
|
|
5962
|
+
deletions: z3.number().int().nonnegative(),
|
|
5963
|
+
wall_ms: z3.number().nonnegative(),
|
|
5964
|
+
outcome: z3.enum(["green", "changes_requested", "escalated"])
|
|
5923
5965
|
}).strict(),
|
|
5924
|
-
|
|
5966
|
+
z3.object({
|
|
5925
5967
|
...loopShared,
|
|
5926
|
-
event:
|
|
5927
|
-
rounds:
|
|
5928
|
-
total_wall_ms:
|
|
5929
|
-
time_to_green_ms:
|
|
5930
|
-
files_changed_total:
|
|
5931
|
-
final_head:
|
|
5932
|
-
result:
|
|
5968
|
+
event: z3.literal("journal_finalized"),
|
|
5969
|
+
rounds: z3.number().int().nonnegative(),
|
|
5970
|
+
total_wall_ms: z3.number().nonnegative(),
|
|
5971
|
+
time_to_green_ms: z3.number().nonnegative().nullable(),
|
|
5972
|
+
files_changed_total: z3.number().int().nonnegative(),
|
|
5973
|
+
final_head: z3.string(),
|
|
5974
|
+
result: z3.enum(["merged_ready", "stopped"])
|
|
5933
5975
|
}).strict(),
|
|
5934
|
-
|
|
5976
|
+
z3.object({
|
|
5935
5977
|
...loopShared,
|
|
5936
|
-
event:
|
|
5937
|
-
round:
|
|
5938
|
-
failure_kind:
|
|
5939
|
-
attempts:
|
|
5940
|
-
outcome:
|
|
5978
|
+
event: z3.literal("infrastructure_retry"),
|
|
5979
|
+
round: z3.number().int(),
|
|
5980
|
+
failure_kind: z3.enum(["pause_comment_post", "developer_connection"]),
|
|
5981
|
+
attempts: z3.number().int().positive(),
|
|
5982
|
+
outcome: z3.enum(["recovered", "exhausted"])
|
|
5983
|
+
}).strict(),
|
|
5984
|
+
z3.object({
|
|
5985
|
+
...loopShared,
|
|
5986
|
+
event: z3.literal("driver_heartbeat"),
|
|
5987
|
+
task: z3.number().int(),
|
|
5988
|
+
pr: z3.number().int().positive().optional(),
|
|
5989
|
+
round: z3.number().int(),
|
|
5990
|
+
phase: z3.string()
|
|
5991
|
+
}).strict(),
|
|
5992
|
+
z3.object({
|
|
5993
|
+
...loopShared,
|
|
5994
|
+
event: z3.literal("driver_exited"),
|
|
5995
|
+
task: z3.number().int(),
|
|
5996
|
+
reason: z3.enum(["finished", "paused", "reexec", "error", "signal"]),
|
|
5997
|
+
last_decision: z3.string(),
|
|
5998
|
+
exit_code: z3.number().int().optional(),
|
|
5999
|
+
error_class: CodeTokenSchema.optional()
|
|
5941
6000
|
}).strict()
|
|
5942
6001
|
]);
|
|
5943
|
-
var ForgeOpSchema =
|
|
6002
|
+
var ForgeOpSchema = z3.enum([
|
|
5944
6003
|
"pr.create",
|
|
5945
6004
|
"pr.comment",
|
|
5946
6005
|
"pr.body.replace",
|
|
@@ -5954,24 +6013,24 @@ var ForgeOpSchema = z2.enum([
|
|
|
5954
6013
|
"label.add",
|
|
5955
6014
|
"label.remove"
|
|
5956
6015
|
]);
|
|
5957
|
-
var ForgeWriteTargetSchema =
|
|
5958
|
-
issue:
|
|
5959
|
-
pr:
|
|
6016
|
+
var ForgeWriteTargetSchema = z3.object({
|
|
6017
|
+
issue: z3.number().int().optional(),
|
|
6018
|
+
pr: z3.number().int().optional()
|
|
5960
6019
|
}).strict();
|
|
5961
6020
|
var forgeWriteShared = {
|
|
5962
6021
|
meta: HeaderMetaSchema,
|
|
5963
6022
|
subject: SubjectSchema,
|
|
5964
|
-
kind:
|
|
6023
|
+
kind: z3.literal("forge_write"),
|
|
5965
6024
|
...envelopeTail,
|
|
5966
6025
|
op: ForgeOpSchema,
|
|
5967
6026
|
target: ForgeWriteTargetSchema
|
|
5968
6027
|
};
|
|
5969
|
-
var ForgeWriteEventSchema =
|
|
5970
|
-
|
|
5971
|
-
|
|
5972
|
-
|
|
6028
|
+
var ForgeWriteEventSchema = z3.discriminatedUnion("event", [
|
|
6029
|
+
z3.object({ ...forgeWriteShared, event: z3.literal("validated") }).strict(),
|
|
6030
|
+
z3.object({ ...forgeWriteShared, event: z3.literal("refused"), reason: z3.string() }).strict(),
|
|
6031
|
+
z3.object({ ...forgeWriteShared, event: z3.literal("written"), comment_ids: z3.array(z3.string()) }).strict()
|
|
5973
6032
|
]);
|
|
5974
|
-
var GateOutcomeSchema =
|
|
6033
|
+
var GateOutcomeSchema = z3.enum([
|
|
5975
6034
|
"pass",
|
|
5976
6035
|
"fail",
|
|
5977
6036
|
"wait",
|
|
@@ -5984,61 +6043,74 @@ var GateOutcomeSchema = z2.enum([
|
|
|
5984
6043
|
var gateShared = {
|
|
5985
6044
|
meta: HeaderMetaSchema,
|
|
5986
6045
|
subject: SubjectSchema,
|
|
5987
|
-
kind:
|
|
6046
|
+
kind: z3.literal("gate"),
|
|
5988
6047
|
...envelopeTail,
|
|
5989
|
-
check:
|
|
5990
|
-
check_version:
|
|
5991
|
-
policy_version:
|
|
5992
|
-
input_fingerprint:
|
|
6048
|
+
check: z3.string(),
|
|
6049
|
+
check_version: z3.string().nullable(),
|
|
6050
|
+
policy_version: z3.string().nullable(),
|
|
6051
|
+
input_fingerprint: z3.string().nullable()
|
|
5993
6052
|
};
|
|
5994
|
-
var GateEventSchema =
|
|
5995
|
-
|
|
6053
|
+
var GateEventSchema = z3.discriminatedUnion("event", [
|
|
6054
|
+
z3.object({
|
|
5996
6055
|
...gateShared,
|
|
5997
|
-
event:
|
|
6056
|
+
event: z3.literal("checked"),
|
|
5998
6057
|
outcome: GateOutcomeSchema,
|
|
5999
|
-
reason:
|
|
6058
|
+
reason: z3.string().optional()
|
|
6059
|
+
}).strict(),
|
|
6060
|
+
z3.object({
|
|
6061
|
+
meta: HeaderMetaSchema,
|
|
6062
|
+
subject: SubjectSchema,
|
|
6063
|
+
kind: z3.literal("gate"),
|
|
6064
|
+
...envelopeTail,
|
|
6065
|
+
event: z3.literal("summary"),
|
|
6066
|
+
ran: z3.number().int().nonnegative(),
|
|
6067
|
+
passed: z3.number().int().nonnegative(),
|
|
6068
|
+
failed: z3.number().int().nonnegative(),
|
|
6069
|
+
skipped: z3.number().int().nonnegative(),
|
|
6070
|
+
failed_checks: z3.array(z3.string())
|
|
6000
6071
|
}).strict()
|
|
6001
6072
|
]);
|
|
6002
|
-
var OperationResultSchema =
|
|
6073
|
+
var OperationResultSchema = z3.enum(["ok", "error", "refused", "timeout", "cancelled", "unavailable"]);
|
|
6003
6074
|
var operationShared = {
|
|
6004
6075
|
meta: HeaderMetaSchema,
|
|
6005
6076
|
subject: SubjectSchema,
|
|
6006
|
-
kind:
|
|
6077
|
+
kind: z3.literal("operation"),
|
|
6007
6078
|
...envelopeTail,
|
|
6008
|
-
operation:
|
|
6009
|
-
target:
|
|
6079
|
+
operation: z3.string(),
|
|
6080
|
+
target: z3.string().nullable()
|
|
6010
6081
|
};
|
|
6011
|
-
var OperationEventSchema =
|
|
6012
|
-
|
|
6082
|
+
var OperationEventSchema = z3.discriminatedUnion("event", [
|
|
6083
|
+
z3.object({
|
|
6013
6084
|
...operationShared,
|
|
6014
|
-
event:
|
|
6085
|
+
event: z3.literal("completed"),
|
|
6015
6086
|
result: OperationResultSchema,
|
|
6016
|
-
error_class:
|
|
6087
|
+
error_class: z3.string().nullable(),
|
|
6088
|
+
field_names: z3.array(z3.string().max(CUSTOM_FIELD_NAME_MAX_LENGTH)).max(CUSTOM_EVENT_MAX_FIELDS).optional()
|
|
6017
6089
|
}).strict()
|
|
6018
6090
|
]);
|
|
6019
|
-
var UsageUnitsSchema =
|
|
6020
|
-
input:
|
|
6021
|
-
output:
|
|
6022
|
-
cache:
|
|
6091
|
+
var UsageUnitsSchema = z3.object({
|
|
6092
|
+
input: z3.number().nonnegative().nullable(),
|
|
6093
|
+
output: z3.number().nonnegative().nullable(),
|
|
6094
|
+
cache: z3.number().nonnegative().nullable()
|
|
6023
6095
|
}).strict();
|
|
6024
6096
|
var usageShared = {
|
|
6025
6097
|
meta: HeaderMetaSchema,
|
|
6026
6098
|
subject: SubjectSchema,
|
|
6027
|
-
kind:
|
|
6099
|
+
kind: z3.literal("usage"),
|
|
6028
6100
|
...envelopeTail,
|
|
6029
|
-
model:
|
|
6030
|
-
source:
|
|
6031
|
-
semantics:
|
|
6101
|
+
model: z3.string().nullable(),
|
|
6102
|
+
source: z3.string(),
|
|
6103
|
+
semantics: z3.enum(["cumulative", "delta"])
|
|
6032
6104
|
};
|
|
6033
|
-
var UsageEventSchema =
|
|
6034
|
-
|
|
6105
|
+
var UsageEventSchema = z3.discriminatedUnion("event", [
|
|
6106
|
+
z3.object({
|
|
6035
6107
|
...usageShared,
|
|
6036
|
-
event:
|
|
6108
|
+
event: z3.literal("observed"),
|
|
6037
6109
|
units: UsageUnitsSchema,
|
|
6038
|
-
unknown_reason:
|
|
6110
|
+
unknown_reason: z3.string().nullable()
|
|
6039
6111
|
}).strict()
|
|
6040
6112
|
]);
|
|
6041
|
-
var RoleAttemptOutcomeSchema =
|
|
6113
|
+
var RoleAttemptOutcomeSchema = z3.enum([
|
|
6042
6114
|
"completed",
|
|
6043
6115
|
"incomplete",
|
|
6044
6116
|
"infrastructure_failed",
|
|
@@ -6049,17 +6121,17 @@ var RoleAttemptOutcomeSchema = z2.enum([
|
|
|
6049
6121
|
var roleAttemptShared = {
|
|
6050
6122
|
meta: HeaderMetaSchema,
|
|
6051
6123
|
subject: SubjectSchema,
|
|
6052
|
-
kind:
|
|
6124
|
+
kind: z3.literal("role_attempt"),
|
|
6053
6125
|
...envelopeTail,
|
|
6054
|
-
actor:
|
|
6055
|
-
attempt:
|
|
6056
|
-
effect_id:
|
|
6057
|
-
model:
|
|
6126
|
+
actor: z3.string().nullable(),
|
|
6127
|
+
attempt: z3.number().int().nullable(),
|
|
6128
|
+
effect_id: z3.string(),
|
|
6129
|
+
model: z3.string().nullable()
|
|
6058
6130
|
};
|
|
6059
|
-
var RoleAttemptEventSchema =
|
|
6060
|
-
|
|
6131
|
+
var RoleAttemptEventSchema = z3.discriminatedUnion("event", [
|
|
6132
|
+
z3.object({
|
|
6061
6133
|
...roleAttemptShared,
|
|
6062
|
-
event:
|
|
6134
|
+
event: z3.literal("attempted"),
|
|
6063
6135
|
outcome: RoleAttemptOutcomeSchema,
|
|
6064
6136
|
usage: dispatchUsageField
|
|
6065
6137
|
}).strict()
|
|
@@ -6067,42 +6139,59 @@ var RoleAttemptEventSchema = z2.discriminatedUnion("event", [
|
|
|
6067
6139
|
var handoffShared = {
|
|
6068
6140
|
meta: HeaderMetaSchema,
|
|
6069
6141
|
subject: SubjectSchema,
|
|
6070
|
-
kind:
|
|
6142
|
+
kind: z3.literal("handoff"),
|
|
6071
6143
|
...envelopeTail,
|
|
6072
|
-
class:
|
|
6073
|
-
reason:
|
|
6144
|
+
class: z3.enum(["authority", "strategy", "product"]),
|
|
6145
|
+
reason: z3.string()
|
|
6074
6146
|
};
|
|
6075
|
-
var HandoffEventSchema =
|
|
6076
|
-
|
|
6147
|
+
var HandoffEventSchema = z3.discriminatedUnion("event", [
|
|
6148
|
+
z3.object({
|
|
6077
6149
|
...handoffShared,
|
|
6078
|
-
event:
|
|
6079
|
-
requested_decision:
|
|
6150
|
+
event: z3.literal("raised"),
|
|
6151
|
+
requested_decision: z3.string().nullable()
|
|
6080
6152
|
}).strict(),
|
|
6081
|
-
|
|
6153
|
+
z3.object({
|
|
6082
6154
|
...handoffShared,
|
|
6083
|
-
event:
|
|
6084
|
-
resolution:
|
|
6085
|
-
resolved_by:
|
|
6155
|
+
event: z3.literal("resolved"),
|
|
6156
|
+
resolution: z3.string().nullable(),
|
|
6157
|
+
resolved_by: z3.string().nullable()
|
|
6086
6158
|
}).strict()
|
|
6087
6159
|
]);
|
|
6088
|
-
var EffectTargetSchema =
|
|
6089
|
-
kind:
|
|
6090
|
-
ref:
|
|
6160
|
+
var EffectTargetSchema = z3.object({
|
|
6161
|
+
kind: z3.string(),
|
|
6162
|
+
ref: z3.string()
|
|
6091
6163
|
}).strict();
|
|
6092
6164
|
var effectShared = {
|
|
6093
6165
|
meta: HeaderMetaSchema,
|
|
6094
6166
|
subject: SubjectSchema,
|
|
6095
|
-
kind:
|
|
6167
|
+
kind: z3.literal("effect"),
|
|
6096
6168
|
...envelopeTail,
|
|
6097
|
-
effect_id:
|
|
6169
|
+
effect_id: z3.string(),
|
|
6098
6170
|
target: EffectTargetSchema
|
|
6099
6171
|
};
|
|
6100
|
-
var EffectEventSchema =
|
|
6101
|
-
|
|
6102
|
-
|
|
6103
|
-
|
|
6172
|
+
var EffectEventSchema = z3.discriminatedUnion("event", [
|
|
6173
|
+
z3.object({ ...effectShared, event: z3.literal("attempted") }).strict(),
|
|
6174
|
+
z3.object({ ...effectShared, event: z3.literal("observed"), outcome: z3.enum(["success", "failure", "uncertain"]) }).strict(),
|
|
6175
|
+
z3.object({ ...effectShared, event: z3.literal("verified"), outcome: z3.enum(["success", "failure", "uncertain"]) }).strict()
|
|
6176
|
+
]);
|
|
6177
|
+
var CustomFieldValueSchema = z3.union([z3.string().max(CUSTOM_TEXT_MAX_LENGTH), z3.number().finite(), z3.boolean()]);
|
|
6178
|
+
var customShared = {
|
|
6179
|
+
meta: HeaderMetaV3Schema,
|
|
6180
|
+
subject: SubjectSchema,
|
|
6181
|
+
kind: z3.literal("custom"),
|
|
6182
|
+
...envelopeTail
|
|
6183
|
+
};
|
|
6184
|
+
var CustomEventSchema = z3.discriminatedUnion("event", [
|
|
6185
|
+
z3.object({
|
|
6186
|
+
...customShared,
|
|
6187
|
+
event: z3.literal("recorded"),
|
|
6188
|
+
name: z3.string().max(CUSTOM_EVENT_NAME_MAX_LENGTH).regex(CUSTOM_EVENT_NAME_PATTERN),
|
|
6189
|
+
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, {
|
|
6190
|
+
message: `custom: at most ${CUSTOM_EVENT_MAX_FIELDS} fields`
|
|
6191
|
+
})
|
|
6192
|
+
}).strict()
|
|
6104
6193
|
]);
|
|
6105
|
-
var LogEventSchema =
|
|
6194
|
+
var LogEventSchema = z3.union([
|
|
6106
6195
|
DispatchEventSchema,
|
|
6107
6196
|
DevReviewLoopEventSchema,
|
|
6108
6197
|
ForgeWriteEventSchema,
|
|
@@ -6111,10 +6200,11 @@ var LogEventSchema = z2.union([
|
|
|
6111
6200
|
UsageEventSchema,
|
|
6112
6201
|
RoleAttemptEventSchema,
|
|
6113
6202
|
HandoffEventSchema,
|
|
6114
|
-
EffectEventSchema
|
|
6203
|
+
EffectEventSchema,
|
|
6204
|
+
CustomEventSchema
|
|
6115
6205
|
]);
|
|
6116
|
-
|
|
6117
6206
|
// ../../packages/aeg-core/src/log/envelope.ts
|
|
6207
|
+
import { createHash as createHash5 } from "node:crypto";
|
|
6118
6208
|
function isRole(value) {
|
|
6119
6209
|
return value !== undefined && ROLE_VALUES.includes(value);
|
|
6120
6210
|
}
|
|
@@ -6151,18 +6241,27 @@ function roundFromEnv(round) {
|
|
|
6151
6241
|
const n = Number(round);
|
|
6152
6242
|
return Number.isInteger(n) ? n : undefined;
|
|
6153
6243
|
}
|
|
6244
|
+
function prFromEnv(pr) {
|
|
6245
|
+
if (pr === undefined || pr === "")
|
|
6246
|
+
return;
|
|
6247
|
+
const n = Number(pr);
|
|
6248
|
+
return Number.isInteger(n) && n > 0 ? n : undefined;
|
|
6249
|
+
}
|
|
6154
6250
|
function buildHeader(input) {
|
|
6155
6251
|
const role = isRole(input.env.role) ? input.env.role : "unattributed";
|
|
6156
6252
|
const round = roundFromEnv(input.env.round);
|
|
6253
|
+
const pr = prFromEnv(input.env.pr);
|
|
6157
6254
|
const subject = {
|
|
6158
6255
|
issue: issueFromTask(input.env.task) ?? input.branchIssue ?? null,
|
|
6159
6256
|
role,
|
|
6160
6257
|
...round !== undefined ? { round } : {},
|
|
6258
|
+
...pr !== undefined ? { pr } : {},
|
|
6161
6259
|
...input.subject ?? {}
|
|
6162
6260
|
};
|
|
6261
|
+
const issue = subject.issue;
|
|
6163
6262
|
return {
|
|
6164
6263
|
meta: {
|
|
6165
|
-
schema:
|
|
6264
|
+
schema: 3,
|
|
6166
6265
|
ts: input.now.toISOString(),
|
|
6167
6266
|
run_id: input.runId,
|
|
6168
6267
|
seq: input.seq,
|
|
@@ -6185,7 +6284,19 @@ function buildHeader(input) {
|
|
|
6185
6284
|
ruling_ordinal: input.inputVersions?.rulingOrdinal ?? null,
|
|
6186
6285
|
policy_digest: input.inputVersions?.policyDigest ?? null
|
|
6187
6286
|
},
|
|
6188
|
-
provenance: provenanceFor(input)
|
|
6287
|
+
provenance: provenanceFor(input),
|
|
6288
|
+
work: {
|
|
6289
|
+
ref: lineageFieldFromEnv(input.env.workRef) ?? (issue === null ? null : String(issue)),
|
|
6290
|
+
repo: input.repo,
|
|
6291
|
+
change: null,
|
|
6292
|
+
revision: null
|
|
6293
|
+
},
|
|
6294
|
+
flow: {
|
|
6295
|
+
id: lineageFieldFromEnv(input.env.flow) ?? "vinaya",
|
|
6296
|
+
version: lineageFieldFromEnv(input.env.flowVersion)
|
|
6297
|
+
},
|
|
6298
|
+
runtime: lineageFieldFromEnv(input.env.runtime),
|
|
6299
|
+
source: lineageFieldFromEnv(input.env.source)
|
|
6189
6300
|
},
|
|
6190
6301
|
subject
|
|
6191
6302
|
};
|
|
@@ -6228,7 +6339,7 @@ function redact(value, home) {
|
|
|
6228
6339
|
return value;
|
|
6229
6340
|
}
|
|
6230
6341
|
// ../../packages/aeg-core/src/log/store.ts
|
|
6231
|
-
var KNOWN_SCHEMA_VERSIONS = [1, 2];
|
|
6342
|
+
var KNOWN_SCHEMA_VERSIONS = [1, 2, 3];
|
|
6232
6343
|
function metaOf(obj) {
|
|
6233
6344
|
if (obj === null || typeof obj !== "object")
|
|
6234
6345
|
return null;
|
|
@@ -6294,7 +6405,7 @@ function classifyStoredLine(raw, home) {
|
|
|
6294
6405
|
return { status: "invalid", identity: null, raw, reason: "valid event with no derivable identity" };
|
|
6295
6406
|
}
|
|
6296
6407
|
const redacted = redact(event, home);
|
|
6297
|
-
const provenance = version
|
|
6408
|
+
const provenance = version >= 2 ? event.meta.provenance ?? null : null;
|
|
6298
6409
|
return {
|
|
6299
6410
|
status: "ok",
|
|
6300
6411
|
identity,
|
|
@@ -6307,138 +6418,143 @@ function classifyStoredLine(raw, home) {
|
|
|
6307
6418
|
};
|
|
6308
6419
|
}
|
|
6309
6420
|
// ../../packages/aeg-core/src/control-store/records.ts
|
|
6310
|
-
import { z as
|
|
6311
|
-
var isoTimestamp =
|
|
6312
|
-
var taskId =
|
|
6313
|
-
var epochNumber =
|
|
6314
|
-
var RunRecordSchema =
|
|
6315
|
-
version:
|
|
6316
|
-
kind:
|
|
6421
|
+
import { z as z4 } from "zod";
|
|
6422
|
+
var isoTimestamp = z4.string().min(1);
|
|
6423
|
+
var taskId = z4.number().int().positive();
|
|
6424
|
+
var epochNumber = z4.number().int().nonnegative();
|
|
6425
|
+
var RunRecordSchema = z4.object({
|
|
6426
|
+
version: z4.literal(1),
|
|
6427
|
+
kind: z4.literal("run"),
|
|
6317
6428
|
task: taskId,
|
|
6318
|
-
runId:
|
|
6319
|
-
pid:
|
|
6320
|
-
host:
|
|
6429
|
+
runId: z4.string().min(1),
|
|
6430
|
+
pid: z4.number().int().positive(),
|
|
6431
|
+
host: z4.string().min(1),
|
|
6321
6432
|
startedAt: isoTimestamp,
|
|
6322
|
-
childStartedAt:
|
|
6323
|
-
childCommand:
|
|
6433
|
+
childStartedAt: z4.string().min(1).nullable().optional(),
|
|
6434
|
+
childCommand: z4.string().min(1).nullable().optional()
|
|
6324
6435
|
}).strict();
|
|
6325
|
-
var InputRecordSchema =
|
|
6326
|
-
version:
|
|
6327
|
-
kind:
|
|
6436
|
+
var InputRecordSchema = z4.object({
|
|
6437
|
+
version: z4.literal(1),
|
|
6438
|
+
kind: z4.literal("input"),
|
|
6328
6439
|
task: taskId,
|
|
6329
|
-
runId:
|
|
6330
|
-
source:
|
|
6331
|
-
pr:
|
|
6332
|
-
round:
|
|
6440
|
+
runId: z4.string().min(1),
|
|
6441
|
+
source: z4.union([z4.literal("fresh"), z4.literal("resume")]),
|
|
6442
|
+
pr: z4.number().int().positive().nullable(),
|
|
6443
|
+
round: z4.number().int().nonnegative(),
|
|
6333
6444
|
recordedAt: isoTimestamp
|
|
6334
6445
|
}).strict();
|
|
6335
|
-
var OwnershipRecordSchema =
|
|
6336
|
-
version:
|
|
6337
|
-
kind:
|
|
6446
|
+
var OwnershipRecordSchema = z4.object({
|
|
6447
|
+
version: z4.literal(1),
|
|
6448
|
+
kind: z4.literal("ownership"),
|
|
6338
6449
|
task: taskId,
|
|
6339
6450
|
epoch: epochNumber,
|
|
6340
|
-
ownerId:
|
|
6341
|
-
pid:
|
|
6342
|
-
host:
|
|
6451
|
+
ownerId: z4.string().min(1),
|
|
6452
|
+
pid: z4.number().int().positive(),
|
|
6453
|
+
host: z4.string().min(1),
|
|
6343
6454
|
acquiredAt: isoTimestamp
|
|
6344
6455
|
}).strict();
|
|
6345
|
-
var TransitionRecordSchema =
|
|
6346
|
-
version:
|
|
6347
|
-
kind:
|
|
6456
|
+
var TransitionRecordSchema = z4.object({
|
|
6457
|
+
version: z4.literal(1),
|
|
6458
|
+
kind: z4.literal("transition"),
|
|
6348
6459
|
task: taskId,
|
|
6349
6460
|
epoch: epochNumber,
|
|
6350
|
-
seq:
|
|
6351
|
-
from:
|
|
6352
|
-
to:
|
|
6353
|
-
detail:
|
|
6461
|
+
seq: z4.number().int().nonnegative(),
|
|
6462
|
+
from: z4.string().min(1),
|
|
6463
|
+
to: z4.string().min(1),
|
|
6464
|
+
detail: z4.string().optional(),
|
|
6354
6465
|
at: isoTimestamp
|
|
6355
6466
|
}).strict();
|
|
6356
|
-
var ManifestRecordSchema =
|
|
6357
|
-
version:
|
|
6358
|
-
kind:
|
|
6467
|
+
var ManifestRecordSchema = z4.object({
|
|
6468
|
+
version: z4.literal(1),
|
|
6469
|
+
kind: z4.literal("manifest"),
|
|
6359
6470
|
task: taskId,
|
|
6360
6471
|
round: epochNumber,
|
|
6361
|
-
repository:
|
|
6362
|
-
pr:
|
|
6363
|
-
branch:
|
|
6364
|
-
baseSha:
|
|
6365
|
-
headSha:
|
|
6366
|
-
briefHash:
|
|
6367
|
-
objectivesVersion:
|
|
6472
|
+
repository: z4.string().min(1),
|
|
6473
|
+
pr: z4.number().int().positive(),
|
|
6474
|
+
branch: z4.string().min(1),
|
|
6475
|
+
baseSha: z4.string().min(1).nullable(),
|
|
6476
|
+
headSha: z4.string().min(1),
|
|
6477
|
+
briefHash: z4.string().min(1).nullable(),
|
|
6478
|
+
objectivesVersion: z4.string().min(1).nullable(),
|
|
6368
6479
|
rulingOrdinal: epochNumber,
|
|
6369
|
-
policyDigest:
|
|
6480
|
+
policyDigest: z4.string().min(1),
|
|
6370
6481
|
recordedAt: isoTimestamp
|
|
6371
6482
|
}).strict();
|
|
6372
|
-
var roundHeadIdentity =
|
|
6373
|
-
var LoopBudgetsSchema =
|
|
6374
|
-
mechanicalRetries:
|
|
6375
|
-
reviewRounds:
|
|
6376
|
-
infrastructureRetries:
|
|
6483
|
+
var roundHeadIdentity = z4.object({ round: z4.number().int().positive(), head: z4.string().min(1) }).strict();
|
|
6484
|
+
var LoopBudgetsSchema = z4.object({
|
|
6485
|
+
mechanicalRetries: z4.number().int().nonnegative(),
|
|
6486
|
+
reviewRounds: z4.number().int().nonnegative(),
|
|
6487
|
+
infrastructureRetries: z4.number().int().nonnegative()
|
|
6377
6488
|
}).strict();
|
|
6378
|
-
var LoopStateRecordSchema =
|
|
6379
|
-
version:
|
|
6380
|
-
kind:
|
|
6489
|
+
var LoopStateRecordSchema = z4.object({
|
|
6490
|
+
version: z4.literal(1),
|
|
6491
|
+
kind: z4.literal("loop_state"),
|
|
6381
6492
|
task: taskId,
|
|
6382
|
-
round:
|
|
6383
|
-
phase:
|
|
6384
|
-
pauseReason:
|
|
6493
|
+
round: z4.number().int().positive(),
|
|
6494
|
+
phase: z4.string().min(1),
|
|
6495
|
+
pauseReason: z4.string().min(1).nullable(),
|
|
6385
6496
|
budgets: LoopBudgetsSchema,
|
|
6386
6497
|
heldResult: roundHeadIdentity.nullable(),
|
|
6387
6498
|
deliveredFindings: roundHeadIdentity.nullable(),
|
|
6388
|
-
repeatMemory:
|
|
6389
|
-
blockingFindings:
|
|
6390
|
-
lastFailure:
|
|
6499
|
+
repeatMemory: z4.object({
|
|
6500
|
+
blockingFindings: z4.array(z4.string()),
|
|
6501
|
+
lastFailure: z4.object({ signature: z4.string(), message: z4.string() }).nullable()
|
|
6391
6502
|
}).strict().optional(),
|
|
6503
|
+
publicationExpectedBase: z4.string().regex(/^[0-9a-f]{40}$/).nullable().optional(),
|
|
6504
|
+
taskStartedAt: isoTimestamp.optional(),
|
|
6505
|
+
phaseMs: z4.record(z4.string(), z4.number().nonnegative()).optional(),
|
|
6392
6506
|
recordedAt: isoTimestamp
|
|
6393
6507
|
}).strict();
|
|
6394
|
-
var EffectRecordSchema =
|
|
6395
|
-
version:
|
|
6396
|
-
kind:
|
|
6508
|
+
var EffectRecordSchema = z4.object({
|
|
6509
|
+
version: z4.literal(1),
|
|
6510
|
+
kind: z4.literal("effect"),
|
|
6397
6511
|
task: taskId,
|
|
6398
|
-
key:
|
|
6399
|
-
operation:
|
|
6400
|
-
target:
|
|
6401
|
-
inputVersion:
|
|
6402
|
-
payloadDigest:
|
|
6403
|
-
status:
|
|
6404
|
-
url:
|
|
6512
|
+
key: z4.string().min(1),
|
|
6513
|
+
operation: z4.string().min(1),
|
|
6514
|
+
target: z4.string().min(1),
|
|
6515
|
+
inputVersion: z4.number().int().nonnegative(),
|
|
6516
|
+
payloadDigest: z4.string().min(1),
|
|
6517
|
+
status: z4.union([z4.literal("started"), z4.literal("verified"), z4.literal("uncertain")]),
|
|
6518
|
+
url: z4.string().optional(),
|
|
6405
6519
|
recordedAt: isoTimestamp
|
|
6406
6520
|
}).strict();
|
|
6407
|
-
var EscalationRecordSchema =
|
|
6408
|
-
version:
|
|
6409
|
-
kind:
|
|
6521
|
+
var EscalationRecordSchema = z4.object({
|
|
6522
|
+
version: z4.literal(1),
|
|
6523
|
+
kind: z4.literal("escalation"),
|
|
6410
6524
|
task: taskId,
|
|
6411
|
-
escalationId:
|
|
6525
|
+
escalationId: z4.string().min(1),
|
|
6412
6526
|
round: epochNumber,
|
|
6413
|
-
head:
|
|
6414
|
-
branch:
|
|
6415
|
-
pr:
|
|
6416
|
-
runId:
|
|
6417
|
-
pid:
|
|
6418
|
-
host:
|
|
6419
|
-
agent:
|
|
6420
|
-
reason:
|
|
6421
|
-
detail:
|
|
6422
|
-
evidence:
|
|
6423
|
-
attemptedRecovery:
|
|
6424
|
-
requestedDecision:
|
|
6425
|
-
recipient:
|
|
6426
|
-
briefHash:
|
|
6427
|
-
objectivesVersion:
|
|
6527
|
+
head: z4.string().min(1),
|
|
6528
|
+
branch: z4.string().min(1),
|
|
6529
|
+
pr: z4.number().int().positive().nullable(),
|
|
6530
|
+
runId: z4.string().min(1),
|
|
6531
|
+
pid: z4.number().int().positive(),
|
|
6532
|
+
host: z4.string().min(1),
|
|
6533
|
+
agent: z4.string().min(1).optional(),
|
|
6534
|
+
reason: z4.string().min(1),
|
|
6535
|
+
detail: z4.string().optional(),
|
|
6536
|
+
evidence: z4.string().optional(),
|
|
6537
|
+
attemptedRecovery: z4.string().min(1),
|
|
6538
|
+
requestedDecision: z4.string().min(1),
|
|
6539
|
+
recipient: z4.string().min(1),
|
|
6540
|
+
briefHash: z4.string().min(1).nullable(),
|
|
6541
|
+
objectivesVersion: z4.string().min(1).nullable(),
|
|
6428
6542
|
rulingOrdinal: epochNumber,
|
|
6429
|
-
policyDigest:
|
|
6543
|
+
policyDigest: z4.string().min(1),
|
|
6430
6544
|
recordedAt: isoTimestamp
|
|
6431
6545
|
}).strict();
|
|
6432
|
-
var ResolutionRecordSchema =
|
|
6433
|
-
version:
|
|
6434
|
-
kind:
|
|
6546
|
+
var ResolutionRecordSchema = z4.object({
|
|
6547
|
+
version: z4.literal(1),
|
|
6548
|
+
kind: z4.literal("resolution"),
|
|
6435
6549
|
task: taskId,
|
|
6436
|
-
escalationId:
|
|
6437
|
-
decision:
|
|
6438
|
-
authenticatedBy:
|
|
6439
|
-
authenticatedFrom:
|
|
6550
|
+
escalationId: z4.string().min(1),
|
|
6551
|
+
decision: z4.union([z4.literal("resume"), z4.literal("cancel")]),
|
|
6552
|
+
authenticatedBy: z4.string().min(1),
|
|
6553
|
+
authenticatedFrom: z4.string().min(1),
|
|
6440
6554
|
consumedAt: isoTimestamp
|
|
6441
6555
|
}).strict();
|
|
6556
|
+
// ../../packages/aeg-core/src/control-store/local.ts
|
|
6557
|
+
var CONTROL_AREA_DIRNAME = "control";
|
|
6442
6558
|
// ../../packages/sources/src/commands.ts
|
|
6443
6559
|
var COMMANDS = [
|
|
6444
6560
|
{
|
|
@@ -6593,7 +6709,7 @@ var COMMANDS = [
|
|
|
6593
6709
|
"Composes `task brief`'s own preparation (`prepareTask`) with the watching driver (`runDriverLoop`, `dev-review-loop.ts`) — nothing else. Preparation starts no agent; the loop's own round 1 reads the frozen brief off the Issue and is the only place a developer is ever dispatched from a fresh task, so exactly one developer is started by construction.",
|
|
6594
6710
|
"A brief already frozen on the Issue is reused, never re-posted — the second `task dispatch`/`task brief` call this composes around does not fail the whole run, it just skips straight to running the loop. A task whose Issue refuses preparation (a missing brief section, an unmet dispatch gate) is refused before any agent starts, with nothing posted.",
|
|
6595
6711
|
"Refuses when the frozen brief's developer branch already has an open pull request AND a driver is still live for it — a driver that crashed or was killed leaves its PR behind, and this command is the one that revives it, in any state, pause held or not.",
|
|
6596
|
-
"issue-711 O4: a pause never ends this process — it keeps running and watches the pull request, continuing on its own once a newer Principal ruling appears (or, for an `'infrastructure'`/`'stale_driver'` pause, after a bounded backoff), with no `--resume` command needed for the ordinary case. Exit and printed summary distinguish a published pull request OR a watched pause's own genuine end — merged, closed, or an operator's own `--cancel` (exit `0` either way, the PR URL) — from the one pause this process can never watch (no pull request exists yet — exit `1`, with the
|
|
6712
|
+
"issue-711 O4: a pause never ends this process — it keeps running and watches the pull request, continuing on its own once a newer Principal ruling appears (or, for an `'infrastructure'`/`'stale_driver'` pause, after a bounded backoff), with no `--resume` command needed for the ordinary case. Exit and printed summary distinguish a published pull request OR a watched pause's own genuine end — merged, closed, or an operator's own `--cancel` (exit `0` either way, the PR URL) — from the one pause this process can never watch (no pull request exists yet — exit `1`, with the working `vinaya task run` command for this task's own branch to continue by hand — `<tranche> <n>` for a tranche task, `--issue <n>` for a backlog one — never a `dev-review-loop --resume` line naming a pull-request number this pause does not have), a usage/argv error (exit `2`), and any other failure (exit `3`)."
|
|
6597
6713
|
],
|
|
6598
6714
|
status: "shipped"
|
|
6599
6715
|
},
|
|
@@ -6678,13 +6794,14 @@ var COMMANDS = [
|
|
|
6678
6794
|
},
|
|
6679
6795
|
{
|
|
6680
6796
|
flag: "--push",
|
|
6681
|
-
description: "PR number; splices the same content into that PR's LIVE body (fetched from the forge) and pushes it via `gh pr edit`, self-verifying nothing outside the AEG:EVIDENCE
|
|
6797
|
+
description: "PR number; splices the same content into that PR's LIVE body (fetched from the forge) and pushes it via `gh pr edit`, self-verifying nothing outside the AEG:EVIDENCE region changed. Mutually exclusive with --write."
|
|
6682
6798
|
}
|
|
6683
6799
|
],
|
|
6684
6800
|
details: [
|
|
6685
6801
|
"Two groups: Group A (recomputable) is the head sha and a width-invariant `git diff --numstat` against the merge-base with `BASE_SHA` (else `origin/main`, then `main`) — `check-evidence-fresh` recomputes and byte-compares this exactly. Group B (attested) is the result of `vinaya check --all --diff-only`, this CLI's own portable gate suite — `check-evidence-fresh` can only check it for staleness (the block's recorded head still matches the PR's real head), never re-run it.",
|
|
6686
6802
|
"With no `--write`/`--push`, prints the block to stdout instead of writing a file. Exits non-zero whenever the gate run failed, whether or not `--write`/`--push` was given — the block records a failing result rather than hiding one, and a non-zero exit stops a scripted `--write && open-pr` (or `--push`) from carrying a failing suite onto the forge.",
|
|
6687
|
-
"`--push` refuses before writing anything when the live body carries no real `AEG:EVIDENCE` pair (it never appends one, unlike `--write`), when the anchor resolves differently before and after normalisation, or when `<pr>` isn't a bare number.
|
|
6803
|
+
"`--push` refuses before writing anything when the live body carries no real `AEG:EVIDENCE` pair (it never appends one, unlike `--write`), when the anchor resolves differently before and after normalisation, or when `<pr>` isn't a bare number. After pushing, it re-reads the live body and restores the pre-edit body — exiting non-zero — if anything outside that one anchored region changed.",
|
|
6804
|
+
"A pull-request body carries no token table, and this command writes none: a dispatched turn's token use is recorded as the Vinaya log's own `usage` event instead. A body that still carries an older run's table keeps it byte for byte — it is prose this command does not own, and a change inside it reads as real drift."
|
|
6688
6805
|
],
|
|
6689
6806
|
status: "shipped"
|
|
6690
6807
|
},
|
|
@@ -6709,7 +6826,7 @@ var COMMANDS = [
|
|
|
6709
6826
|
"Deliberately a command, not a check: `evidence-fresh` runs inside `vinaya check --all`, and `pr report` runs `vinaya check --all --diff-only`, so a check that regenerated the block would run the suite containing itself. That recursion is why `evidence-fresh` verifies Group A only and leaves Group B attested.",
|
|
6710
6827
|
"Must be run from the repository ROOT of a CLEAN checkout at the pull request's head, and refuses otherwise. The regeneration inherits the working directory and several gates resolve their scan root from it, so a subdirectory silently narrows what the fresh run inspects. On cleanliness: Group B is regenerated by diff-scoped checks, so uncommitted or untracked files change which files are scanned and can produce a MATCH a clean checkout would not. Ignored paths are deliberately NOT inspected — `git diff` never reports one, so they cannot change the scope, and including them would refuse in every real checkout since `node_modules` is ignored and always present. The head is read from the forge and both a mismatch AND an unreadable head refuse — the verdict is bound to a commit, never merely attested. `BASE_SHA` is refused as well, since it steers the regeneration's merge-base.",
|
|
6711
6828
|
"Exits 0 on MATCH; 1 on DIFFERS, HIDDEN, or no block; 2 on a refusal (dirty worktree, wrong head, usage error). HIDDEN means the anchor pair sits inside a collapsed `<details>` block, where `body-bare-digits` blanks every digit and nothing can verify what it claims.",
|
|
6712
|
-
"Comparison is a multiset of repo-relative, control-stripped lines: absolute paths (local AND foreign, so a block generated in CI compares against one generated on a laptop) and line order are ignored — a reorder is not a fabrication. Only the AEG:EVIDENCE region is read
|
|
6829
|
+
"Comparison is a multiset of repo-relative, control-stripped lines: absolute paths (local AND foreign, so a block generated in CI compares against one generated on a laptop) and line order are ignored — a reorder is not a fabrication. Only the AEG:EVIDENCE region is read: every other section of the body is prose no regeneration reproduces. A moved merge-base is reported ALONGSIDE the differing lines, never instead of them."
|
|
6713
6830
|
],
|
|
6714
6831
|
status: "shipped"
|
|
6715
6832
|
},
|
|
@@ -6880,7 +6997,7 @@ var COMMANDS = [
|
|
|
6880
6997
|
{ flag: "--secrets", description: "security only: the SECRETS line" },
|
|
6881
6998
|
{
|
|
6882
6999
|
flag: "--secrets-evidence-file",
|
|
6883
|
-
description: 'security only: required whenever `--secrets` claims "none found" — the
|
|
7000
|
+
description: 'security only: required whenever `--secrets` claims "none found" — the passing `atta-labs/secret-scan` check result on the judged head that backs it; never run or paste the scanner'
|
|
6884
7001
|
},
|
|
6885
7002
|
{ flag: "--task-id", description: "the closing `Tokens:` line's task id" },
|
|
6886
7003
|
{ flag: "--model", description: "the closing `Tokens:` line's model name" },
|
|
@@ -6988,7 +7105,20 @@ var COMMANDS = [
|
|
|
6988
7105
|
flags: [{ flag: "--yes", description: "Skip the confirmation prompt" }],
|
|
6989
7106
|
details: [
|
|
6990
7107
|
"Refuses if any task Issue attached to the named tranche is still open, naming each one — closing a tranche with unresolved work is never silently allowed.",
|
|
6991
|
-
"Once every task Issue is closed, prompts for confirmation (unless `--yes`) and closes
|
|
7108
|
+
"Once every task Issue is closed, prompts for confirmation (unless `--yes`), records the tranche's retrospective in the Milestone its task Issues are attached to, and closes that Milestone once nothing else in it is still open.",
|
|
7109
|
+
"A tranche none of whose task Issues carry a Milestone gets one: a Milestone titled with the tranche's slug is created, the tranche's closed task Issues are attached to it, the retrospective is recorded, and it is closed — so the tranche reads as archived. An Issue already on a Milestone is never moved.",
|
|
7110
|
+
"Idempotent: on a tranche whose Milestone is already closed and carries its retrospective, changes nothing and says it is already archived.",
|
|
7111
|
+
"The generated `vinaya-archivist.yml` workflow runs it after a task pull request merges, and again when an Issue labeled with the tranche closes without a merge (dropped, replaced or closed by hand) — the tranche's slug read from that Issue's own label."
|
|
7112
|
+
],
|
|
7113
|
+
status: "shipped"
|
|
7114
|
+
},
|
|
7115
|
+
{
|
|
7116
|
+
name: "archive tranches",
|
|
7117
|
+
description: "Archive every finished tranche that has no closed Milestone carrying its retrospective",
|
|
7118
|
+
flags: [{ flag: "--yes", description: "Skip the confirmation prompt" }],
|
|
7119
|
+
details: [
|
|
7120
|
+
"Walks every `vinaya/tranche:<slug>` label, skips each tranche that still has an open task Issue, and runs `archive tranche` for each finished one whose Milestone is not already closed with its retrospective. One tranche failing does not stop the others; the exit code reports it.",
|
|
7121
|
+
"The generated `vinaya-archivist.yml` workflow calls it on its daily scheduled run, so a tranche that finished before the workflow could see it is archived within a day. Running it again when every finished tranche is archived changes nothing and says so."
|
|
6992
7122
|
],
|
|
6993
7123
|
status: "shipped"
|
|
6994
7124
|
},
|
|
@@ -7132,6 +7262,29 @@ var COMMANDS = [
|
|
|
7132
7262
|
],
|
|
7133
7263
|
status: "shipped"
|
|
7134
7264
|
},
|
|
7265
|
+
{
|
|
7266
|
+
name: "log selftest",
|
|
7267
|
+
description: "Prove log delivery works end to end: send one marked test event and read it back — PASS (exit 0) or FAIL with the one reason (exit 1)",
|
|
7268
|
+
details: [
|
|
7269
|
+
"Resolves the destination exactly as an UNATTENDED review-loop run does in this repository — the same trust-anchor read and credential lookup, forced unattended so running it by hand proves the launch path's own resolution, not a human's. It sends one test event to the configured `logs.url` server, then reads it back from the server by the event's own id through the server's cursor read.",
|
|
7270
|
+
"PASS (exit 0) only when the event round-trips. Otherwise FAIL (exit 1) with the ONE reason that stopped it: no server is configured, the default branch's config could not be read to confirm the url (and why), this host holds no ingest or read credential, the server refused with its status, or the event could not be read back. It never prints a credential value.",
|
|
7271
|
+
"The read-back needs a READ credential distinct from the write-only ingest one the server refuses on a read route: set `logs.readHeaders` in vinaya.config.json to the server's read token (referenced by variable name, resolved from the environment exactly as `logs.headers` is). The test event is marked `operation: 'log.selftest'` so a reader can exclude it from real telemetry."
|
|
7272
|
+
],
|
|
7273
|
+
status: "shipped"
|
|
7274
|
+
},
|
|
7275
|
+
{
|
|
7276
|
+
name: "log emit",
|
|
7277
|
+
description: "Record a consumer-declared event (`logs.events` in vinaya.config.json) from a script or agent outside Vinaya",
|
|
7278
|
+
flags: [
|
|
7279
|
+
{ flag: "--json '<json>'", description: "The field values as one JSON object (else read from standard input)" }
|
|
7280
|
+
],
|
|
7281
|
+
details: [
|
|
7282
|
+
"Reads the field values as ONE JSON object — `--json '<json>'` or piped on standard input, never positional arguments — and records them through `emitCustomEvent`, the same chokepoint every custom event goes through, so the refusal event and the redaction stay in one place.",
|
|
7283
|
+
"A declared event with every field present and of its declared type exits 0 and prints the event name and the kind of destination it was recorded toward (`folder`, `server`, or `none`) — never a field value. A refused event (an undeclared name, or a missing, extra, wrong-typed or too-long field) exits 1 and prints the reason class and the field names — never a value, since a rejected value may be the secret. A missing event name, unreadable JSON, or JSON that is not a flat object is a usage error: exit 2, before anything is recorded.",
|
|
7284
|
+
"A process with only `VINAYA_WORK_REF` and `VINAYA_FLOW` set, and no Vinaya role or task, still gets a header carrying that work reference and way-of-working id — the same environment read every event already honours (`apps/cli/specs/log.md` § Attribution)."
|
|
7285
|
+
],
|
|
7286
|
+
status: "shipped"
|
|
7287
|
+
},
|
|
7135
7288
|
{
|
|
7136
7289
|
name: "log send",
|
|
7137
7290
|
description: "Deliver this repository's locally-held log events to the configured `logs.url` server, once",
|
|
@@ -7144,12 +7297,19 @@ var COMMANDS = [
|
|
|
7144
7297
|
status: "shipped"
|
|
7145
7298
|
},
|
|
7146
7299
|
{
|
|
7147
|
-
name: "
|
|
7148
|
-
description: "
|
|
7300
|
+
name: "sync",
|
|
7301
|
+
description: "Fill, resume and rebuild the local log cache from this repository's configured destination (read-only)",
|
|
7302
|
+
flags: [
|
|
7303
|
+
{
|
|
7304
|
+
flag: "--rebuild",
|
|
7305
|
+
description: "Delete the cache file and sync from the beginning of what the destination still retains"
|
|
7306
|
+
},
|
|
7307
|
+
{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }
|
|
7308
|
+
],
|
|
7149
7309
|
details: [
|
|
7150
|
-
|
|
7151
|
-
|
|
7152
|
-
"
|
|
7310
|
+
"Resolves the destination exactly the way a normal event does — the sink's own decision over `vinaya.config.json`'s `logs` setting, trust-anchor-gated for an unattended caller — then reads a folder destination through the folder source or a server destination through the server source (with the configured `logs.readHeaders`, substituted from the environment), and runs the bounded sync engine against the durable cache this repository holds under its runtime directory. Prints pages read, rows stored, duplicates, edits, deletions, gaps, quarantined lines and, for a server destination, its lost-event diagnostic. Reads the destination and writes only its own cache directory — never the folder, the server, or the forge.",
|
|
7311
|
+
"Exits 0 when the run completed or stopped cleanly on its page bound (and says more is available), 1 when it failed part way (the progress made is kept — a second run resumes from the stored cursor), and 2 for a usage or configuration problem: no destination is configured, or a server destination is configured with no usable read credential. A missing credential names the environment variable to set and never prints its value.",
|
|
7312
|
+
"`--rebuild` deletes the cache file ALONE — never anything else under the cache directory — and syncs again from the beginning of what the destination still retains; an event already rotated out of a folder's single backup slot, or no longer retained by the destination, cannot be recovered and shows up as a gap, never silently."
|
|
7153
7313
|
],
|
|
7154
7314
|
status: "shipped"
|
|
7155
7315
|
}
|
|
@@ -7163,10 +7323,10 @@ function createForgeSource(config) {
|
|
|
7163
7323
|
};
|
|
7164
7324
|
}
|
|
7165
7325
|
// ../../packages/sources/src/select-source.ts
|
|
7166
|
-
import { z as
|
|
7167
|
-
var StateSourceConfigSchema =
|
|
7168
|
-
|
|
7169
|
-
|
|
7326
|
+
import { z as z5 } from "zod";
|
|
7327
|
+
var StateSourceConfigSchema = z5.discriminatedUnion("kind", [
|
|
7328
|
+
z5.object({ kind: z5.literal("forge"), owner: z5.string(), repo: z5.string() }),
|
|
7329
|
+
z5.object({ kind: z5.literal("file"), root: z5.string().optional() })
|
|
7170
7330
|
]);
|
|
7171
7331
|
// src/checks/contract.ts
|
|
7172
7332
|
var CHECK_SCHEMA_VERSION = 1;
|
|
@@ -7176,56 +7336,34 @@ function emitCheckError(error) {
|
|
|
7176
7336
|
}
|
|
7177
7337
|
|
|
7178
7338
|
// src/lib/config.ts
|
|
7179
|
-
import { execFile as execFile4, execFileSync as
|
|
7339
|
+
import { execFile as execFile4, execFileSync as execFileSync2 } from "node:child_process";
|
|
7180
7340
|
import { promisify as promisify4 } from "node:util";
|
|
7181
7341
|
import { existsSync, mkdirSync, readFileSync as readFileSync2, realpathSync, writeFileSync } from "node:fs";
|
|
7182
7342
|
import { homedir } from "node:os";
|
|
7183
7343
|
import { dirname, isAbsolute, join, resolve } from "node:path";
|
|
7184
|
-
import { z as
|
|
7344
|
+
import { z as z6 } from "zod";
|
|
7185
7345
|
|
|
7186
7346
|
// src/lib/agent-vendors.ts
|
|
7187
7347
|
var AGENT_VENDORS = ["skills", "claude", "gemini"];
|
|
7188
7348
|
|
|
7189
|
-
// src/lib/worker-boundary.ts
|
|
7190
|
-
import { execFileSync as execFileSync2 } from "node:child_process";
|
|
7191
|
-
var LOG_HEADER_KEYCHAIN_SERVICE = "Vinaya Log";
|
|
7192
|
-
var logHeaderKeychainCache = new Map;
|
|
7193
|
-
function readRealLogHeaderKeychainCredential(variable) {
|
|
7194
|
-
if (process.platform !== "darwin")
|
|
7195
|
-
return null;
|
|
7196
|
-
try {
|
|
7197
|
-
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$/, "");
|
|
7198
|
-
} catch {
|
|
7199
|
-
return null;
|
|
7200
|
-
}
|
|
7201
|
-
}
|
|
7202
|
-
function readLogHeaderKeychainCredential(variable) {
|
|
7203
|
-
const cached = logHeaderKeychainCache.get(variable);
|
|
7204
|
-
if (cached !== undefined)
|
|
7205
|
-
return cached;
|
|
7206
|
-
const value = readRealLogHeaderKeychainCredential(variable);
|
|
7207
|
-
logHeaderKeychainCache.set(variable, value);
|
|
7208
|
-
return value;
|
|
7209
|
-
}
|
|
7210
|
-
|
|
7211
7349
|
// src/lib/config.ts
|
|
7212
|
-
var EnvEntrySchema =
|
|
7213
|
-
|
|
7214
|
-
|
|
7215
|
-
|
|
7216
|
-
|
|
7350
|
+
var EnvEntrySchema = z6.union([
|
|
7351
|
+
z6.literal(true),
|
|
7352
|
+
z6.object({ optional: z6.literal(true) }),
|
|
7353
|
+
z6.object({ anyOf: z6.array(z6.string()).min(2) }),
|
|
7354
|
+
z6.string()
|
|
7217
7355
|
]);
|
|
7218
|
-
var CheckEntrySchema =
|
|
7219
|
-
run:
|
|
7220
|
-
scope:
|
|
7221
|
-
include:
|
|
7222
|
-
args:
|
|
7223
|
-
timeoutMs:
|
|
7224
|
-
env:
|
|
7225
|
-
requiresOpenPr:
|
|
7226
|
-
ownWorkflow:
|
|
7227
|
-
principalOwed:
|
|
7228
|
-
validates:
|
|
7356
|
+
var CheckEntrySchema = z6.object({
|
|
7357
|
+
run: z6.string(),
|
|
7358
|
+
scope: z6.enum(["diff", "full"]),
|
|
7359
|
+
include: z6.array(z6.string()).optional(),
|
|
7360
|
+
args: z6.array(z6.string()).optional(),
|
|
7361
|
+
timeoutMs: z6.number().optional(),
|
|
7362
|
+
env: z6.record(z6.string(), EnvEntrySchema).optional(),
|
|
7363
|
+
requiresOpenPr: z6.boolean().optional(),
|
|
7364
|
+
ownWorkflow: z6.boolean().optional(),
|
|
7365
|
+
principalOwed: z6.literal(true).optional(),
|
|
7366
|
+
validates: z6.enum(["body", "issue"]).optional()
|
|
7229
7367
|
}).superRefine((entry, ctx) => {
|
|
7230
7368
|
if (!entry.env)
|
|
7231
7369
|
return;
|
|
@@ -7235,22 +7373,22 @@ var CheckEntrySchema = z5.object({
|
|
|
7235
7373
|
const members = value.anyOf;
|
|
7236
7374
|
if (new Set(members).size !== members.length) {
|
|
7237
7375
|
ctx.addIssue({
|
|
7238
|
-
code:
|
|
7376
|
+
code: z6.ZodIssueCode.custom,
|
|
7239
7377
|
message: `env.${key}.anyOf has duplicate members`,
|
|
7240
7378
|
path: ["env", key, "anyOf"]
|
|
7241
7379
|
});
|
|
7242
7380
|
}
|
|
7243
7381
|
if (!members.includes(key)) {
|
|
7244
7382
|
ctx.addIssue({
|
|
7245
|
-
code:
|
|
7383
|
+
code: z6.ZodIssueCode.custom,
|
|
7246
7384
|
message: `env.${key}.anyOf must include "${key}" itself as a member`,
|
|
7247
7385
|
path: ["env", key, "anyOf"]
|
|
7248
7386
|
});
|
|
7249
7387
|
}
|
|
7250
7388
|
}
|
|
7251
7389
|
});
|
|
7252
|
-
var RoleEntrySchema =
|
|
7253
|
-
contract:
|
|
7390
|
+
var RoleEntrySchema = z6.object({
|
|
7391
|
+
contract: z6.string().refine((p) => p.includes("/"), {
|
|
7254
7392
|
message: 'must be a path (contain at least one "/"), not a bare filename'
|
|
7255
7393
|
})
|
|
7256
7394
|
});
|
|
@@ -7274,17 +7412,17 @@ var BRIEF_BUILTINS = [
|
|
|
7274
7412
|
"briefSections",
|
|
7275
7413
|
"milestoneShape"
|
|
7276
7414
|
];
|
|
7277
|
-
var BriefSectionSchema =
|
|
7278
|
-
|
|
7279
|
-
|
|
7280
|
-
|
|
7281
|
-
|
|
7415
|
+
var BriefSectionSchema = z6.union([
|
|
7416
|
+
z6.object({ builtin: z6.enum(BRIEF_BUILTINS) }),
|
|
7417
|
+
z6.object({ heading: z6.string().min(1), name: z6.string().optional() }),
|
|
7418
|
+
z6.object({ field: z6.string().min(1), name: z6.string().optional() }),
|
|
7419
|
+
z6.object({ phrase: z6.string().min(1), name: z6.string().optional() })
|
|
7282
7420
|
]);
|
|
7283
|
-
var BriefSchemaSchema =
|
|
7284
|
-
pr:
|
|
7285
|
-
issue:
|
|
7286
|
-
milestone:
|
|
7287
|
-
ack:
|
|
7421
|
+
var BriefSchemaSchema = z6.object({
|
|
7422
|
+
pr: z6.object({ sections: z6.array(BriefSectionSchema) }).optional(),
|
|
7423
|
+
issue: z6.object({ sections: z6.array(BriefSectionSchema) }).optional(),
|
|
7424
|
+
milestone: z6.object({ sections: z6.array(BriefSectionSchema) }).optional(),
|
|
7425
|
+
ack: z6.array(z6.enum(BRIEF_BUILTINS)).optional()
|
|
7288
7426
|
});
|
|
7289
7427
|
function isSafeRepoRelPath(p) {
|
|
7290
7428
|
if (p.length === 0)
|
|
@@ -7293,7 +7431,7 @@ function isSafeRepoRelPath(p) {
|
|
|
7293
7431
|
return false;
|
|
7294
7432
|
return p.split(/[\\/]/).every((seg) => seg !== ".." && seg !== "");
|
|
7295
7433
|
}
|
|
7296
|
-
var SafeRepoRelPath =
|
|
7434
|
+
var SafeRepoRelPath = z6.string().refine(isSafeRepoRelPath, {
|
|
7297
7435
|
message: "must be a repo-root-relative path with no `..` segment or absolute root"
|
|
7298
7436
|
});
|
|
7299
7437
|
var CANONICAL_HOOK_BLOCK_PREFIXES = [".git/", ".husky/", ".vinaya/hooks/", ".claude/hooks/"];
|
|
@@ -7303,22 +7441,22 @@ function isCanonicalHookBlockPath(p) {
|
|
|
7303
7441
|
var ManagedHookBlockPath = SafeRepoRelPath.refine(isCanonicalHookBlockPath, {
|
|
7304
7442
|
message: `must start with one of ${CANONICAL_HOOK_BLOCK_PREFIXES.join(", ")} (byte-exact, case-sensitive)`
|
|
7305
7443
|
});
|
|
7306
|
-
var ManagedBlockRecordSchema =
|
|
7444
|
+
var ManagedBlockRecordSchema = z6.object({
|
|
7307
7445
|
path: ManagedHookBlockPath,
|
|
7308
|
-
marker:
|
|
7309
|
-
comment:
|
|
7446
|
+
marker: z6.string(),
|
|
7447
|
+
comment: z6.enum(["hash", "html"])
|
|
7310
7448
|
});
|
|
7311
|
-
var ManagedManifestSchema =
|
|
7312
|
-
version:
|
|
7313
|
-
files:
|
|
7314
|
-
blocks:
|
|
7315
|
-
labels:
|
|
7316
|
-
agents:
|
|
7449
|
+
var ManagedManifestSchema = z6.object({
|
|
7450
|
+
version: z6.number().int().positive(),
|
|
7451
|
+
files: z6.array(SafeRepoRelPath),
|
|
7452
|
+
blocks: z6.array(ManagedBlockRecordSchema),
|
|
7453
|
+
labels: z6.array(z6.string()),
|
|
7454
|
+
agents: z6.array(z6.enum(AGENT_VENDORS)).optional()
|
|
7317
7455
|
});
|
|
7318
|
-
var ProjectEntrySchema =
|
|
7319
|
-
name:
|
|
7320
|
-
description:
|
|
7321
|
-
path:
|
|
7456
|
+
var ProjectEntrySchema = z6.object({
|
|
7457
|
+
name: z6.string().min(1),
|
|
7458
|
+
description: z6.string().min(1).optional(),
|
|
7459
|
+
path: z6.string().min(1).optional()
|
|
7322
7460
|
});
|
|
7323
7461
|
function parseTokensCollectDeclaration(value) {
|
|
7324
7462
|
const m = value.trim().match(/^(\S+)\s+(\S+)$/);
|
|
@@ -7329,90 +7467,97 @@ function parseTokensCollectDeclaration(value) {
|
|
|
7329
7467
|
return null;
|
|
7330
7468
|
return { interpreter, script };
|
|
7331
7469
|
}
|
|
7332
|
-
var VinayaConfigSchema =
|
|
7333
|
-
rings:
|
|
7334
|
-
ring1_forgeWriteInterception:
|
|
7335
|
-
ring2_asyncAudits:
|
|
7470
|
+
var VinayaConfigSchema = z6.object({
|
|
7471
|
+
rings: z6.object({
|
|
7472
|
+
ring1_forgeWriteInterception: z6.boolean(),
|
|
7473
|
+
ring2_asyncAudits: z6.boolean()
|
|
7336
7474
|
}).optional(),
|
|
7337
|
-
checks:
|
|
7338
|
-
roles:
|
|
7475
|
+
checks: z6.record(z6.string(), CheckEntrySchema).optional(),
|
|
7476
|
+
roles: z6.record(z6.string(), RoleEntrySchema).optional(),
|
|
7339
7477
|
briefSchema: BriefSchemaSchema.optional(),
|
|
7340
7478
|
managed: ManagedManifestSchema.optional(),
|
|
7341
|
-
principals:
|
|
7342
|
-
releaseActor:
|
|
7343
|
-
ci:
|
|
7344
|
-
tokens:
|
|
7345
|
-
collect:
|
|
7479
|
+
principals: z6.array(z6.string()).min(1).optional(),
|
|
7480
|
+
releaseActor: z6.string().min(1).optional(),
|
|
7481
|
+
ci: z6.object({ setup: z6.string().min(1) }).optional(),
|
|
7482
|
+
tokens: z6.object({
|
|
7483
|
+
collect: z6.string().min(1).refine((v) => parseTokensCollectDeclaration(v) !== null, {
|
|
7346
7484
|
message: 'tokens.collect must be exactly "<interpreter> <repo-relative-script-path>" — two whitespace-separated tokens, no flags, no shell syntax, no quoting'
|
|
7347
7485
|
})
|
|
7348
7486
|
}).optional(),
|
|
7349
|
-
blastRadius:
|
|
7350
|
-
proseGates:
|
|
7351
|
-
doctrineRoot:
|
|
7352
|
-
readerFacingPrefix:
|
|
7353
|
-
readerFacingSuffix:
|
|
7354
|
-
legacySlugDir:
|
|
7355
|
-
sourceComments:
|
|
7356
|
-
globs:
|
|
7357
|
-
allowlist:
|
|
7358
|
-
severity:
|
|
7487
|
+
blastRadius: z6.object({ extraDomains: z6.array(z6.string()).optional() }).optional(),
|
|
7488
|
+
proseGates: z6.object({
|
|
7489
|
+
doctrineRoot: z6.string().min(1).optional(),
|
|
7490
|
+
readerFacingPrefix: z6.string().min(1).optional(),
|
|
7491
|
+
readerFacingSuffix: z6.string().min(1).optional(),
|
|
7492
|
+
legacySlugDir: z6.string().min(1).optional(),
|
|
7493
|
+
sourceComments: z6.object({
|
|
7494
|
+
globs: z6.array(z6.string().min(1)).optional(),
|
|
7495
|
+
allowlist: z6.array(z6.string().min(1)).optional(),
|
|
7496
|
+
severity: z6.enum(["warning", "error"]).optional()
|
|
7359
7497
|
}).optional(),
|
|
7360
|
-
specGrandfather:
|
|
7361
|
-
specPaths:
|
|
7498
|
+
specGrandfather: z6.union([z6.array(z6.string().min(1)), z6.record(z6.string().min(1), z6.number().int().min(0))]).optional(),
|
|
7499
|
+
specPaths: z6.array(z6.string().min(1).refine((entry) => !entry.startsWith("/") && !/^[A-Za-z]:/.test(entry), {
|
|
7362
7500
|
message: "must be a repository-relative path, not an absolute one"
|
|
7363
7501
|
}).refine((entry) => !entry.split(/[\\/]/).includes(".."), {
|
|
7364
7502
|
message: "must stay inside the repository — no `..` segment"
|
|
7365
7503
|
})).optional()
|
|
7366
7504
|
}).optional(),
|
|
7367
|
-
projects:
|
|
7368
|
-
dispatch:
|
|
7369
|
-
timeoutMs:
|
|
7370
|
-
killGraceMs:
|
|
7371
|
-
agent:
|
|
7372
|
-
|
|
7505
|
+
projects: z6.array(ProjectEntrySchema).optional(),
|
|
7506
|
+
dispatch: z6.object({
|
|
7507
|
+
timeoutMs: z6.number().int().positive().optional(),
|
|
7508
|
+
killGraceMs: z6.number().int().positive().optional(),
|
|
7509
|
+
agent: z6.enum(["claude", "codex", "gemini"]).optional()
|
|
7510
|
+
}).optional(),
|
|
7511
|
+
reviewPolicy: z6.object({
|
|
7512
|
+
codeReviewThreshold: z6.string().min(1).optional(),
|
|
7513
|
+
securityThreshold: z6.string().min(1).optional(),
|
|
7514
|
+
maxRounds: z6.number().optional(),
|
|
7515
|
+
maxTaskMinutes: z6.number().optional()
|
|
7373
7516
|
}).optional(),
|
|
7374
|
-
|
|
7375
|
-
|
|
7376
|
-
securityThreshold: z5.string().min(1).optional(),
|
|
7377
|
-
maxRounds: z5.number().optional()
|
|
7517
|
+
securityScan: z6.object({
|
|
7518
|
+
command: z6.array(z6.string().min(1)).min(1)
|
|
7378
7519
|
}).optional(),
|
|
7379
|
-
gateCutovers:
|
|
7380
|
-
objectivesSinceIssue:
|
|
7381
|
-
briefSectionsSinceIssue:
|
|
7382
|
-
documentationSinceIssue:
|
|
7383
|
-
briefRulesSincePr:
|
|
7384
|
-
agentBoxesRefusedSincePr:
|
|
7520
|
+
gateCutovers: z6.object({
|
|
7521
|
+
objectivesSinceIssue: z6.number().int().nonnegative().optional(),
|
|
7522
|
+
briefSectionsSinceIssue: z6.number().int().nonnegative().optional(),
|
|
7523
|
+
documentationSinceIssue: z6.number().int().nonnegative().optional(),
|
|
7524
|
+
briefRulesSincePr: z6.number().int().nonnegative().optional(),
|
|
7525
|
+
agentBoxesRefusedSincePr: z6.number().int().nonnegative().optional()
|
|
7385
7526
|
}).optional(),
|
|
7386
|
-
planning:
|
|
7387
|
-
collisionThreshold:
|
|
7527
|
+
planning: z6.object({
|
|
7528
|
+
collisionThreshold: z6.number().int().nonnegative().optional()
|
|
7388
7529
|
}).optional(),
|
|
7389
|
-
prePush:
|
|
7390
|
-
alwaysRun:
|
|
7530
|
+
prePush: z6.object({
|
|
7531
|
+
alwaysRun: z6.array(z6.string()).optional()
|
|
7391
7532
|
}).optional(),
|
|
7392
|
-
report:
|
|
7393
|
-
commandTimeoutMs:
|
|
7533
|
+
report: z6.object({
|
|
7534
|
+
commandTimeoutMs: z6.number().int().positive().optional()
|
|
7394
7535
|
}).superRefine((report, ctx) => {
|
|
7395
7536
|
const commandTimeoutMs = report.commandTimeoutMs;
|
|
7396
7537
|
if (commandTimeoutMs !== undefined && commandTimeoutMs > MAX_REPORT_COMMAND_TIMEOUT_MS) {
|
|
7397
7538
|
ctx.addIssue({
|
|
7398
|
-
code:
|
|
7539
|
+
code: z6.ZodIssueCode.custom,
|
|
7399
7540
|
path: ["commandTimeoutMs"],
|
|
7400
7541
|
message: "must be at most 3600000 (1 hour)"
|
|
7401
7542
|
});
|
|
7402
7543
|
}
|
|
7403
7544
|
}).optional(),
|
|
7404
|
-
logPublish:
|
|
7545
|
+
logPublish: z6.unknown().refine((v) => v === undefined, {
|
|
7405
7546
|
message: "logPublish is removed — telemetry is never posted to a tracker or a code host; configure `logs` instead (a folder or a server destination)"
|
|
7406
7547
|
}),
|
|
7407
|
-
runtimeDir:
|
|
7408
|
-
logs:
|
|
7409
|
-
folder:
|
|
7410
|
-
url:
|
|
7411
|
-
headers:
|
|
7548
|
+
runtimeDir: z6.string().min(1).refine((v) => isAbsolute(v), { message: "runtimeDir: must be an absolute path" }).optional(),
|
|
7549
|
+
logs: z6.object({
|
|
7550
|
+
folder: z6.string().min(1).refine((v) => isAbsolute(v), { message: "logs.folder: must be an absolute path" }).optional(),
|
|
7551
|
+
url: z6.string().url().optional(),
|
|
7552
|
+
headers: z6.record(z6.string()).optional(),
|
|
7553
|
+
readHeaders: z6.record(z6.string()).optional(),
|
|
7554
|
+
events: CustomEventDeclarationsSchema.optional()
|
|
7412
7555
|
}).refine((v) => [v.folder, v.url].filter((x) => x !== undefined).length <= 1, {
|
|
7413
7556
|
message: "logs: set at most one of folder/url"
|
|
7414
7557
|
}).refine((v) => v.headers === undefined || v.url !== undefined, {
|
|
7415
7558
|
message: "logs: headers requires url"
|
|
7559
|
+
}).refine((v) => v.readHeaders === undefined || v.url !== undefined, {
|
|
7560
|
+
message: "logs: readHeaders requires url"
|
|
7416
7561
|
}).optional()
|
|
7417
7562
|
});
|
|
7418
7563
|
var GLOBAL_VINAYA_HOME = join(homedir(), ".vinaya");
|
|
@@ -7517,10 +7662,15 @@ function resolveReviewPolicy(config) {
|
|
|
7517
7662
|
if (!Number.isInteger(maxRounds) || maxRounds < 1) {
|
|
7518
7663
|
throw new Error(`vinaya.config.json: reviewPolicy.maxRounds "${maxRounds}" is not a positive integer — fix the config, this never falls back to a default.`);
|
|
7519
7664
|
}
|
|
7665
|
+
const maxTaskMinutes = raw.maxTaskMinutes ?? DEFAULT_REVIEW_POLICY.maxTaskMinutes;
|
|
7666
|
+
if (!Number.isInteger(maxTaskMinutes) || maxTaskMinutes < 0) {
|
|
7667
|
+
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.`);
|
|
7668
|
+
}
|
|
7520
7669
|
return {
|
|
7521
7670
|
codeReviewThreshold,
|
|
7522
7671
|
securityThreshold,
|
|
7523
|
-
maxRounds
|
|
7672
|
+
maxRounds,
|
|
7673
|
+
maxTaskMinutes
|
|
7524
7674
|
};
|
|
7525
7675
|
}
|
|
7526
7676
|
function resolveGateCutovers(config) {
|
|
@@ -7560,17 +7710,12 @@ function resolveTrustAnchorLogsDestination(local, trustAnchorConfig) {
|
|
|
7560
7710
|
return "url" in anchored && anchored.url === local.url ? anchored : null;
|
|
7561
7711
|
return "folder" in anchored && anchored.folder === local.folder ? anchored : null;
|
|
7562
7712
|
}
|
|
7563
|
-
function resolveLogsHeaderValues(headers, env
|
|
7713
|
+
function resolveLogsHeaderValues(headers, env) {
|
|
7564
7714
|
if (!headers)
|
|
7565
7715
|
return;
|
|
7566
7716
|
const resolved = {};
|
|
7567
7717
|
for (const [key, value] of Object.entries(headers)) {
|
|
7568
|
-
resolved[key] = value.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g, (_match, name) =>
|
|
7569
|
-
const fromEnv = env[name];
|
|
7570
|
-
if (fromEnv !== undefined)
|
|
7571
|
-
return fromEnv;
|
|
7572
|
-
return readKeychain(name) ?? "";
|
|
7573
|
-
});
|
|
7718
|
+
resolved[key] = value.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g, (_match, name) => env[name] ?? "");
|
|
7574
7719
|
}
|
|
7575
7720
|
return resolved;
|
|
7576
7721
|
}
|
|
@@ -7579,7 +7724,7 @@ function trustAnchorRepo() {
|
|
|
7579
7724
|
if (fromRunner)
|
|
7580
7725
|
return fromRunner;
|
|
7581
7726
|
try {
|
|
7582
|
-
const url =
|
|
7727
|
+
const url = execFileSync2("git", ["remote", "get-url", "origin"], {
|
|
7583
7728
|
encoding: "utf-8",
|
|
7584
7729
|
stdio: ["ignore", "pipe", "pipe"]
|
|
7585
7730
|
});
|
|
@@ -7626,7 +7771,7 @@ function resolveCiTrustAnchorProbeRef(env = process.env) {
|
|
|
7626
7771
|
return ref;
|
|
7627
7772
|
}
|
|
7628
7773
|
function readTrustAnchorConfigAtRef(ref) {
|
|
7629
|
-
const raw =
|
|
7774
|
+
const raw = execFileSync2("git", ["show", `${ref}:${LOCAL_CONFIG_FILENAME}`], {
|
|
7630
7775
|
encoding: "utf-8",
|
|
7631
7776
|
stdio: ["ignore", "pipe", "pipe"],
|
|
7632
7777
|
timeout: 1e4
|
|
@@ -7640,7 +7785,7 @@ function ghFetchTrustAnchorConfig() {
|
|
|
7640
7785
|
const repo = trustAnchorRepo();
|
|
7641
7786
|
if (!repo)
|
|
7642
7787
|
throw new Error("could not resolve repo identity for the trust-anchor read");
|
|
7643
|
-
return
|
|
7788
|
+
return execFileSync2("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], {
|
|
7644
7789
|
encoding: "utf-8",
|
|
7645
7790
|
stdio: ["ignore", "pipe", "pipe"]
|
|
7646
7791
|
});
|
|
@@ -7735,7 +7880,7 @@ var CHECK_NAME = "coherence";
|
|
|
7735
7880
|
var execFileAsync5 = promisify5(execFile5);
|
|
7736
7881
|
function git(args) {
|
|
7737
7882
|
try {
|
|
7738
|
-
return
|
|
7883
|
+
return execFileSync3("git", args, { encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] }).trim();
|
|
7739
7884
|
} catch {
|
|
7740
7885
|
return "";
|
|
7741
7886
|
}
|