@attalabs/vinaya 0.36.0 → 0.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/aeg-root/contracts/developer-reviewer.md +1 -1
- package/aeg-root/contracts/planner-operator.md +1 -1
- package/aeg-root/contracts/principal-operator.md +6 -6
- package/aeg-root/contracts/security-archivist.md +1 -1
- package/aeg-root/enforcement.md +14 -14
- package/aeg-root/process.md +3 -1
- package/aeg-root/roles/archivist.md +2 -2
- package/aeg-root/roles/developer/reference.md +36 -37
- package/aeg-root/roles/developer.md +9 -5
- package/aeg-root/roles/operator.md +18 -18
- package/aeg-root/roles/planner/reference.md +15 -4
- package/aeg-root/roles/principal.md +6 -1
- package/aeg-root/roles/reviewer.md +14 -6
- package/aeg-root/roles/security.md +22 -11
- package/aeg-root/roles/tranche-archivist.md +14 -2
- package/aeg-root/state-machine.md +12 -11
- package/aeg-root/templates/brief-template.md +8 -6
- package/aeg-root/templates/pr-report-template.md +1 -9
- package/aeg-root/tranche-model.md +10 -4
- package/dist/checks/bin/check-body-bare-digits.js +823 -595
- package/dist/checks/bin/check-branch-topology.js +796 -478
- package/dist/checks/bin/check-brief-shape.js +824 -596
- package/dist/checks/bin/check-changeset-coverage.js +1337 -747
- package/dist/checks/bin/check-closes-n.js +796 -478
- package/dist/checks/bin/check-coherence.js +914 -611
- package/dist/checks/bin/check-dead-branch-push.js +705 -462
- package/dist/checks/bin/check-dispatch-readiness.js +941 -624
- package/dist/checks/bin/check-doc-coverage-push.js +1332 -742
- package/dist/checks/bin/check-doc-coverage.js +1339 -742
- package/dist/checks/bin/check-doctrine-no-procedures.js +821 -593
- package/dist/checks/bin/check-doctrine-portability.js +1332 -742
- package/dist/checks/bin/check-evidence-fresh.js +1339 -918
- package/dist/checks/bin/check-exec-bits.js +1331 -741
- package/dist/checks/bin/check-first-push-dispatch.js +917 -614
- package/dist/checks/bin/check-issue-assignment.js +796 -478
- package/dist/checks/bin/check-issue-milestone-attach.js +705 -462
- package/dist/checks/bin/check-issue-objectives-numbering.js +821 -593
- package/dist/checks/bin/check-issue-parts-coverage.js +705 -462
- package/dist/checks/bin/check-issue-surface-globs.js +925 -613
- package/dist/checks/bin/check-issue-title-grammar.js +705 -462
- package/dist/checks/bin/check-issue-tranche-label.js +705 -462
- package/dist/checks/bin/check-main-branch-refusal.js +705 -462
- package/dist/checks/bin/check-no-disk-state.js +705 -462
- package/dist/checks/bin/check-pr-premise-reassert.js +821 -593
- package/dist/checks/bin/check-pr-report-density.js +705 -462
- package/dist/checks/bin/check-principal-test-plan-wait.js +705 -462
- package/dist/checks/bin/check-quoted-command.js +1816 -1228
- package/dist/checks/bin/check-reader-resolvable-prose.js +1835 -1235
- package/dist/checks/bin/check-registry-gates.js +993 -526
- package/dist/checks/bin/check-retired-vocabulary.js +1810 -1222
- package/dist/checks/bin/check-review-gate.js +832 -604
- package/dist/checks/bin/check-single-plan-pr.js +705 -462
- package/dist/checks/bin/check-surface-scope.js +796 -478
- package/dist/checks/bin/check-test-plan.js +705 -462
- package/dist/checks/bin/check-token-collection-wired.js +705 -462
- package/dist/checks/bin/check-workspace-escape.js +1332 -742
- package/dist/checks/bin/verify-dispatch.js +3849 -0
- package/dist/index.js +20876 -10091
- package/dist/lib/pre-push-cache-test-run.js +1045 -682
- package/dist/lib/pre-push-changed-files.js +16 -11
- package/dist/lib/pre-push-select-tests.js +785 -500
- package/package.json +2 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/anchored-region.ts +7 -6
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-render.ts +71 -15
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-validation.ts +51 -12
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/index.ts +1 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/local.ts +31 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/records.ts +50 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/assess-round.ts +443 -28
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/fakes.ts +18 -5
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/index.ts +6 -4
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/journal-reconstruction.ts +13 -13
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/render-summary.ts +46 -110
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/types.ts +169 -11
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/doc-claim.ts +32 -6
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/index.ts +3 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/published-prose.ts +30 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/doctrine-portability.ts +6 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/gate-audience.ts +0 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/index.ts +82 -8
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/issue-validation.ts +754 -7
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/leftover-detection.ts +24 -6
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/custom.ts +157 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/envelope.ts +44 -6
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/fixtures/executions.ts +493 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/fixtures/fact-sheets.ts +111 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/fixtures/generator.ts +155 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/fixtures/index.ts +12 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/index.ts +128 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/catches.ts +63 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/checks.ts +146 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/common.ts +137 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/completion.ts +137 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/convergence.ts +420 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/determinism.ts +65 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/index.ts +69 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/judgment.ts +132 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/labels.ts +21 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/time.ts +167 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/usage.ts +139 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/schema.ts +226 -15
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/store.ts +7 -7
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/cache-contract.ts +207 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/contracts.ts +105 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/engine.ts +308 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/index.ts +34 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/measured.ts +20 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/memory-cache.ts +78 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/normalize.ts +156 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/row.ts +103 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/reader-resolvable-prose.ts +34 -6
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/registry-checks.ts +70 -6
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-gate.ts +52 -4
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-input-manifest.ts +19 -14
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-policy.ts +201 -24
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-status.ts +5 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/task-phase-history.ts +46 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/task-tools.ts +15 -28
- package/studio-standalone/apps/vinaya-studio/web/.next/BUILD_ID +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/app-path-routes-manifest.json +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/build-manifest.json +3 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/prerender-manifest.json +3 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/required-server-files.json +0 -5
- package/studio-standalone/apps/vinaya-studio/web/.next/routes-manifest.json +0 -6
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error/page.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.html +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page.js +3 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page.js +3 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page.js +3 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page/server-reference-manifest.json +3 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page.js +5 -5
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page.js +3 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page.js +3 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page.js +3 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app-paths-manifest.json +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/044u_vinaya-studio_web_src_app_studio_backlog__components_BacklogTable_tsx_0oha0bt._.js +3 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/1q96_modules_@clerk_nextjs_dist_esm_app-router_client_keyless-creator-reader_0lom2js.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__1bh2awk._.js → [root-of-the-server]__038scsm._.js} +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__1widio3._.js → [root-of-the-server]__03__s45._.js} +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{_15gdg48._.js → [root-of-the-server]__04adkz-._.js} +3 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__05zwn98._.js +14 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__08e39jo._.js +3 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0h9yhwx._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__1wy7w66._.js → [root-of-the-server]__0jdjsxe._.js} +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0ls23oh._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__10riywf._.js +3 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__13znegp._.js → [root-of-the-server]__134x-65._.js} +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__13eeix2._.js → [root-of-the-server]__1_l_l1u._.js} +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1f4bb3_._.js +3 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1gjqmhq._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__1dky4g0._.js → [root-of-the-server]__1my83lt._.js} +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1ng2x88._.js +3 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__040smoa._.js → [root-of-the-server]__1qpc6at._.js} +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1snpgaw._.js +56 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1wc4-ip._.js +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_06h3wbl._.js +3 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_08onyya._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_096f46i._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0af2one._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0e5tkdd._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0gs4gvl._.js +3 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0kf2g72._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0zf4d27._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1-wo68i._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_121lrn5._.js +3 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1achbh9._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1o4v6lb._.js +3 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1q7h5mz._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1ztd4i3._.js +3 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_209-ugd._.js +3 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_214d71c._.js +3 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/apps_vinaya-studio_web_src_app_studio_projects_[name]_tranches_[slug]_17dho0f._.js +3 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/node_modules_@clerk_nextjs_dist_esm_app-router_server-actions_1x7vfhn.js +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/node_modules_next_dist_1lzmr5o._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/packages_ui_libraries_animate_components_index_ts_186fje1._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/packages_ui_libraries_basic_components_index_ts_0xk1vda._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/middleware-build-manifest.js +3 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/pages/500.html +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/server-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/server-reference-manifest.json +4 -4
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/09fcolor69bun.js +1 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0lcwmwzxacdie.js +1 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0ojry7lrbzkfd.css +1 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1-acpmtfmrc35.js +1 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1giu47hrbhroj.js +1 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1shz6lwruld25.js +1 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1ytvuy1mmnc6j.js +1 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{3oxhhhm_psozq.js → 21a6_5cr956wj.js} +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{2o9l0b7eqbr57.js → 2f2y8xxok8zph.js} +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2g8mwnydod96u.js +1 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{3li0ueedy-ozv.js → 2nrnuawd5fwpv.js} +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2nw47832_uvfe.js +1 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2qdxnj8wk2h0s.js +1 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{3lqjwjrcvq481.js → 2xevgia1h8g0y.js} +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3b9q75p-z5ma5.js +1 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3cv-oe7153242.js +1 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3m310lbjj4p5u.js +1 -0
- package/studio-standalone/apps/vinaya-studio/web/package.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/server.js +1 -1
- package/dist/checks/bin/check-token-report.js +0 -6526
- package/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/aeg-core/bin/verify-coherence.ts +0 -1089
- package/studio-standalone/_node_modules/next/dist/compiled/next-server/app-route-turbo.runtime.prod.js +0 -6
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route/app-paths-manifest.json +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route/build-manifest.json +0 -9
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route/server-reference-manifest.json +0 -4
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route.js +0 -6
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route.js.map +0 -5
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route.js.nft.json +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route_client-reference-manifest.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/044u_vinaya-studio_web__next-internal_server_app_api_coherence_route_actions_1rnzea1.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/[externals]__0cki-x_._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/[root-of-the-server]__02a-3g8._.js +0 -15
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/[turbopack]_runtime.js +0 -903
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__074w9nf._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0ln09ua._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0oegopp._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__13yxbjd._.js +0 -51
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1duqmtm._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1z7dml9._.js +0 -9
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0bfs_u4._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0g8_eot._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0hrh_v-._.js +0 -181
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0i4-dea._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0o54suy._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0rxd7s0._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0y1jv16._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_151m4rz._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1a9dieq._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1sxsf5q._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1sy_yfr._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_219v2an._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/apps_vinaya-studio_web_src_app_studio_projects_[name]_tranches_[slug]_05ufo8i._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/packages_ui_libraries_basic_components_form_input_tsx_0es8d8b._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/packages_ui_libraries_brutal_components_index_ts_0n_lcc4._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/packages_ui_libraries_retro_components_index_ts_0wvpm_z._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/00z3-ljjd1gj9.js +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0bjnj-5fy4e7l.js +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0c8uwz_-m8s99.js +0 -165
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0ct0c-xj0baf6.js +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0ko698wh8xx2g.css +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0t5n_r4xm__t-.js +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0vc2u252q5q6o.js +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/16r_o07lw0vm0.js +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1cah7_e5a1zvu.js +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1gjo9-6dz7nup.js +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/24tz8aro1uto4.js +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2ef2g5fozszw7.js +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2ka8dg687auhj.js +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2pf3f50gbrkyv.js +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2qq49pct3q51-.js +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3et66z7glk65w.js +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3y6u3prmrkea-.js +0 -1
- /package/studio-standalone/apps/vinaya-studio/web/.next/static/{z1fTSBP6ZlUjObzFIp-qq → yNZEFRSjP9BLUfdf96Eol}/_buildManifest.js +0 -0
- /package/studio-standalone/apps/vinaya-studio/web/.next/static/{z1fTSBP6ZlUjObzFIp-qq → yNZEFRSjP9BLUfdf96Eol}/_clientMiddlewareManifest.js +0 -0
- /package/studio-standalone/apps/vinaya-studio/web/.next/static/{z1fTSBP6ZlUjObzFIp-qq → yNZEFRSjP9BLUfdf96Eol}/_ssgManifest.js +0 -0
|
@@ -624,6 +624,33 @@ function tasksFromIssues(issues) {
|
|
|
624
624
|
}
|
|
625
625
|
return tasks.sort((a, b) => compareTaskIds(a.id, b.id));
|
|
626
626
|
}
|
|
627
|
+
function resolveDuplicateTasks(tasks, isOpen) {
|
|
628
|
+
const byId = new Map;
|
|
629
|
+
for (const t of tasks)
|
|
630
|
+
byId.set(t.id, [...byId.get(t.id) ?? [], t]);
|
|
631
|
+
const resolved = [];
|
|
632
|
+
const conflicts = [];
|
|
633
|
+
for (const [id, group] of byId) {
|
|
634
|
+
const first = group[0];
|
|
635
|
+
if (!first)
|
|
636
|
+
continue;
|
|
637
|
+
if (group.length === 1) {
|
|
638
|
+
resolved.push(first);
|
|
639
|
+
continue;
|
|
640
|
+
}
|
|
641
|
+
const number = (t) => t.issue ?? 0;
|
|
642
|
+
const open = group.filter((t) => t.issue !== null && isOpen(t.issue)).sort((a, b) => number(a) - number(b));
|
|
643
|
+
if (open.length > 1) {
|
|
644
|
+
conflicts.push({ id, issues: open.map(number) });
|
|
645
|
+
resolved.push(open[0]);
|
|
646
|
+
} else if (open.length === 1) {
|
|
647
|
+
resolved.push(open[0]);
|
|
648
|
+
} else {
|
|
649
|
+
resolved.push([...group].sort((a, b) => number(b) - number(a))[0]);
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
return { tasks: resolved.sort((a, b) => compareTaskIds(a.id, b.id)), conflicts };
|
|
653
|
+
}
|
|
627
654
|
async function fetchTrancheIssuesAsync(owner, repo, slug) {
|
|
628
655
|
return ghIssueListByAnyLabelAsync(owner, repo, [trancheLabel(slug)]);
|
|
629
656
|
}
|
|
@@ -1431,7 +1458,7 @@ function mapReviewDecision(decision) {
|
|
|
1431
1458
|
function buildBranchName(tranche, taskId) {
|
|
1432
1459
|
return `task/${tranche}/${taskId}`;
|
|
1433
1460
|
}
|
|
1434
|
-
async function
|
|
1461
|
+
async function fetchForgeFactsByIssue(input) {
|
|
1435
1462
|
const token = await resolveGithubToken(input.token);
|
|
1436
1463
|
if (!token) {
|
|
1437
1464
|
return {
|
|
@@ -1441,7 +1468,13 @@ async function fetchForgeFacts(input) {
|
|
|
1441
1468
|
reason: "No GitHub token available (set GITHUB_TOKEN/GH_TOKEN or `gh auth login`)."
|
|
1442
1469
|
};
|
|
1443
1470
|
}
|
|
1444
|
-
const
|
|
1471
|
+
const seen = new Set;
|
|
1472
|
+
const queriedTasks = input.tasks.filter((t) => {
|
|
1473
|
+
if (t.issue === null || seen.has(t.issue))
|
|
1474
|
+
return false;
|
|
1475
|
+
seen.add(t.issue);
|
|
1476
|
+
return true;
|
|
1477
|
+
});
|
|
1445
1478
|
if (queriedTasks.length === 0) {
|
|
1446
1479
|
return { facts: new Map, prRefs: new Map, unavailable: false };
|
|
1447
1480
|
}
|
|
@@ -1469,21 +1502,52 @@ async function fetchForgeFacts(input) {
|
|
|
1469
1502
|
};
|
|
1470
1503
|
}
|
|
1471
1504
|
for (const task of queriedTasks) {
|
|
1472
|
-
const
|
|
1473
|
-
const raw = extractRawFromResponse(response.repository, alias);
|
|
1505
|
+
const raw = extractRawFromResponse(response.repository, aliasFor(task.issue));
|
|
1474
1506
|
const mapped = mapForgeFacts(raw);
|
|
1475
1507
|
if (mapped)
|
|
1476
|
-
facts.set(task.
|
|
1508
|
+
facts.set(task.issue, mapped);
|
|
1477
1509
|
const pr = raw.pullRequest;
|
|
1478
1510
|
if (pr && typeof pr.number === "number" && typeof pr.url === "string") {
|
|
1479
|
-
prRefs.set(task.
|
|
1511
|
+
prRefs.set(task.issue, { number: pr.number, url: pr.url, state: pr.state });
|
|
1480
1512
|
}
|
|
1481
1513
|
}
|
|
1482
1514
|
return { facts, prRefs, unavailable: false };
|
|
1483
1515
|
}
|
|
1516
|
+
async function fetchForgeFacts(input) {
|
|
1517
|
+
const byIssue = await fetchForgeFactsByIssue(input);
|
|
1518
|
+
if (byIssue.unavailable) {
|
|
1519
|
+
return { facts: new Map, prRefs: new Map, unavailable: true, reason: byIssue.reason };
|
|
1520
|
+
}
|
|
1521
|
+
const facts = new Map;
|
|
1522
|
+
const prRefs = new Map;
|
|
1523
|
+
const winner = new Map;
|
|
1524
|
+
for (const task of input.tasks) {
|
|
1525
|
+
if (task.issue === null)
|
|
1526
|
+
continue;
|
|
1527
|
+
const current = winner.get(task.id);
|
|
1528
|
+
if (current === undefined || outranks(byIssue.facts, task.issue, current))
|
|
1529
|
+
winner.set(task.id, task.issue);
|
|
1530
|
+
}
|
|
1531
|
+
for (const [taskId, issue] of winner) {
|
|
1532
|
+
const f = byIssue.facts.get(issue);
|
|
1533
|
+
if (f)
|
|
1534
|
+
facts.set(taskId, f);
|
|
1535
|
+
const pr = byIssue.prRefs.get(issue);
|
|
1536
|
+
if (pr)
|
|
1537
|
+
prRefs.set(taskId, pr);
|
|
1538
|
+
}
|
|
1539
|
+
return { facts, prRefs, unavailable: false };
|
|
1540
|
+
}
|
|
1541
|
+
function outranks(facts, candidate, current) {
|
|
1542
|
+
const candidateOpen = facts.get(candidate)?.issueState === "open";
|
|
1543
|
+
const currentOpen = facts.get(current)?.issueState === "open";
|
|
1544
|
+
if (candidateOpen !== currentOpen)
|
|
1545
|
+
return candidateOpen;
|
|
1546
|
+
return candidate > current;
|
|
1547
|
+
}
|
|
1484
1548
|
function buildBatchQuery(tranche, tasks) {
|
|
1485
1549
|
const perTask = tasks.map((task) => {
|
|
1486
|
-
const a = aliasFor(task.
|
|
1550
|
+
const a = aliasFor(task.issue);
|
|
1487
1551
|
const branch = buildBranchName(tranche, task.id);
|
|
1488
1552
|
return `
|
|
1489
1553
|
${a}_issue: issue(number: ${task.issue}) {
|
|
@@ -1525,9 +1589,8 @@ function buildBatchQuery(tranche, tasks) {
|
|
|
1525
1589
|
}
|
|
1526
1590
|
}`;
|
|
1527
1591
|
}
|
|
1528
|
-
function aliasFor(
|
|
1529
|
-
|
|
1530
|
-
return `t_${sanitized}`;
|
|
1592
|
+
function aliasFor(issue) {
|
|
1593
|
+
return `i_${issue}`;
|
|
1531
1594
|
}
|
|
1532
1595
|
function extractRawFromResponse(repository, alias) {
|
|
1533
1596
|
const issue = repository[`${alias}_issue`];
|
|
@@ -1882,45 +1945,6 @@ var DERIVED_STATUSES = [
|
|
|
1882
1945
|
"incoherent"
|
|
1883
1946
|
];
|
|
1884
1947
|
var DERIVABLE_STATUSES = DERIVED_STATUSES.filter((s) => s !== "backlog");
|
|
1885
|
-
// ../../packages/aeg-core/src/parse-ledger.ts
|
|
1886
|
-
function rowFromCells(cells) {
|
|
1887
|
-
if (cells.length < 7)
|
|
1888
|
-
return null;
|
|
1889
|
-
const phase = (cells[0] ?? "").trim();
|
|
1890
|
-
if (!phase)
|
|
1891
|
-
return null;
|
|
1892
|
-
return {
|
|
1893
|
-
phase,
|
|
1894
|
-
role: (cells[1] ?? "").trim(),
|
|
1895
|
-
agentModel: (cells[2] ?? "").trim(),
|
|
1896
|
-
tokensIn: parseIntCell(cells[3] ?? ""),
|
|
1897
|
-
tokensOut: parseIntCell(cells[4] ?? ""),
|
|
1898
|
-
cost: parseCostCell(cells[5] ?? ""),
|
|
1899
|
-
date: (cells[6] ?? "").trim()
|
|
1900
|
-
};
|
|
1901
|
-
}
|
|
1902
|
-
function parseIntCell(cell) {
|
|
1903
|
-
const trimmed = cell.replace(/`/g, "").trim();
|
|
1904
|
-
if (!trimmed || isEmDashOrDash(trimmed))
|
|
1905
|
-
return null;
|
|
1906
|
-
const normalized = trimmed.replace(/[,_\s]/g, "");
|
|
1907
|
-
if (!/^-?\d+$/.test(normalized))
|
|
1908
|
-
return null;
|
|
1909
|
-
return Number(normalized);
|
|
1910
|
-
}
|
|
1911
|
-
function parseCostCell(cell) {
|
|
1912
|
-
const trimmed = cell.replace(/`/g, "").trim();
|
|
1913
|
-
if (!trimmed || isEmDashOrDash(trimmed))
|
|
1914
|
-
return null;
|
|
1915
|
-
const normalized = trimmed.replace(/^\$/, "").replace(/[,_\s]/g, "");
|
|
1916
|
-
if (!/^-?\d+(\.\d+)?$/.test(normalized))
|
|
1917
|
-
return null;
|
|
1918
|
-
return Number(normalized);
|
|
1919
|
-
}
|
|
1920
|
-
function isEmDashOrDash(s) {
|
|
1921
|
-
const t = s.trim();
|
|
1922
|
-
return t === "—" || t === "-" || t === "–";
|
|
1923
|
-
}
|
|
1924
1948
|
// ../../packages/aeg-core/src/waiver-label.ts
|
|
1925
1949
|
var WAIVER_LABEL = label("waiver-docs");
|
|
1926
1950
|
var WAIVER_LABEL_REVIEW = label("waiver-review");
|
|
@@ -1936,61 +1960,6 @@ function isWaiverLabelActorVerified(opts) {
|
|
|
1936
1960
|
return false;
|
|
1937
1961
|
return isPrincipal(opts.labelActor, opts.principalAllowlist);
|
|
1938
1962
|
}
|
|
1939
|
-
|
|
1940
|
-
// ../../packages/aeg-core/src/parse-token-report.ts
|
|
1941
|
-
var TOKEN_REPORT_HEADING = /^\s*(?:#{1,6}\s*Token report\s*|\*\*Token report\*\*)\s*$/i;
|
|
1942
|
-
var INLINE_FIELD_LIST = /Phase:\s*([^|]+?)\s*\|\s*Role:\s*([^|]+?)\s*\|\s*Agent\/Model:\s*([^|]+?)\s*\|\s*Tokens in:\s*([^|]+?)\s*\|\s*Tokens out:\s*([^|]+?)\s*\|\s*Cost:\s*([^|]+?)\s*\|\s*Date:\s*(.+?)\s*$/im;
|
|
1943
|
-
function parseTokenReportEntries(body) {
|
|
1944
|
-
const lines = body.split(/\r?\n/);
|
|
1945
|
-
const headingIdxs = [];
|
|
1946
|
-
lines.forEach((line, i) => {
|
|
1947
|
-
if (TOKEN_REPORT_HEADING.test(line))
|
|
1948
|
-
headingIdxs.push(i);
|
|
1949
|
-
});
|
|
1950
|
-
const out = [];
|
|
1951
|
-
for (let h = 0;h < headingIdxs.length; h++) {
|
|
1952
|
-
const start = headingIdxs[h] + 1;
|
|
1953
|
-
const end = h + 1 < headingIdxs.length ? headingIdxs[h + 1] : lines.length;
|
|
1954
|
-
const section = lines.slice(start, end).join(`
|
|
1955
|
-
`);
|
|
1956
|
-
const tableRows = parseTableSection(section);
|
|
1957
|
-
if (tableRows.length > 0) {
|
|
1958
|
-
out.push(...tableRows);
|
|
1959
|
-
continue;
|
|
1960
|
-
}
|
|
1961
|
-
const inlineRow = parseInlineFieldList(section);
|
|
1962
|
-
if (inlineRow)
|
|
1963
|
-
out.push(inlineRow);
|
|
1964
|
-
}
|
|
1965
|
-
return out;
|
|
1966
|
-
}
|
|
1967
|
-
function parseTableSection(section) {
|
|
1968
|
-
const lines = section.split(/\r?\n/);
|
|
1969
|
-
let i = 0;
|
|
1970
|
-
for (;i < lines.length; i++) {
|
|
1971
|
-
if ((lines[i] ?? "").trim().startsWith("|"))
|
|
1972
|
-
break;
|
|
1973
|
-
}
|
|
1974
|
-
if (i + 1 >= lines.length)
|
|
1975
|
-
return [];
|
|
1976
|
-
i += 2;
|
|
1977
|
-
const out = [];
|
|
1978
|
-
for (;i < lines.length; i++) {
|
|
1979
|
-
const trimmed = (lines[i] ?? "").trim();
|
|
1980
|
-
if (!trimmed.startsWith("|"))
|
|
1981
|
-
break;
|
|
1982
|
-
const row = rowFromCells(splitTableRow(trimmed));
|
|
1983
|
-
if (row)
|
|
1984
|
-
out.push(row);
|
|
1985
|
-
}
|
|
1986
|
-
return out;
|
|
1987
|
-
}
|
|
1988
|
-
function parseInlineFieldList(section) {
|
|
1989
|
-
const m = section.match(INLINE_FIELD_LIST);
|
|
1990
|
-
if (!m)
|
|
1991
|
-
return null;
|
|
1992
|
-
return rowFromCells([m[1], m[2], m[3], m[4], m[5], m[6], m[7]]);
|
|
1993
|
-
}
|
|
1994
1963
|
// ../../packages/aeg-core/src/verdict-extraction.ts
|
|
1995
1964
|
var HEAD_SHA_PATTERN = /^[ \t]*(?:\*{1,3}|_{1,3})?Judged head:\s*([0-9a-f]{7,40})(?![A-Za-z0-9])/im;
|
|
1996
1965
|
var OBJECTIVES_VERSION_PATTERN = /^[ \t]*(?:\*{1,3}|_{1,3})?Objectives version:\s*([0-9a-f]{64})(?![A-Za-z0-9])/im;
|
|
@@ -2439,10 +2408,12 @@ function evaluateC5(changed, docOwnersContent, prBody, fileExists, waiverActive,
|
|
|
2439
2408
|
var CODE_REVIEW_SEVERITY_ORDER = ["BLOCKER", "MAJOR", "MINOR"];
|
|
2440
2409
|
var SECURITY_SEVERITY_ORDER = ["CRITICAL", "HIGH", "MEDIUM", "LOW"];
|
|
2441
2410
|
var DEFAULT_MAX_ROUNDS = 3;
|
|
2411
|
+
var DEFAULT_MAX_TASK_MINUTES = 180;
|
|
2442
2412
|
var DEFAULT_REVIEW_POLICY = {
|
|
2443
2413
|
codeReviewThreshold: "BLOCKER",
|
|
2444
2414
|
securityThreshold: "HIGH",
|
|
2445
|
-
maxRounds: DEFAULT_MAX_ROUNDS
|
|
2415
|
+
maxRounds: DEFAULT_MAX_ROUNDS,
|
|
2416
|
+
maxTaskMinutes: DEFAULT_MAX_TASK_MINUTES
|
|
2446
2417
|
};
|
|
2447
2418
|
var FILE_SHAPED_LOCATION = /\.[a-zA-Z0-9]{1,10}(:\d+)?\s*$/;
|
|
2448
2419
|
var PROSE_LOCATION_PATTERNS = [/\bpr\s*body\b/i, /\bcomment\b/i];
|
|
@@ -2450,6 +2421,9 @@ var ROLE_FILE_LOCATION = /(^|\/)aeg-root\/roles\//i;
|
|
|
2450
2421
|
function isProseLocation(location) {
|
|
2451
2422
|
if (ROLE_FILE_LOCATION.test(location))
|
|
2452
2423
|
return true;
|
|
2424
|
+
return isBodyOrCommentLocation(location);
|
|
2425
|
+
}
|
|
2426
|
+
function isBodyOrCommentLocation(location) {
|
|
2453
2427
|
if (FILE_SHAPED_LOCATION.test(location))
|
|
2454
2428
|
return false;
|
|
2455
2429
|
return PROSE_LOCATION_PATTERNS.some((pattern) => pattern.test(location));
|
|
@@ -2476,7 +2450,7 @@ function classifyFinding(finding, scale, threshold, context = {}) {
|
|
|
2476
2450
|
const wouldBlock = blockingSeverities(scale, threshold).includes(effectiveSeverity);
|
|
2477
2451
|
if (!wouldBlock)
|
|
2478
2452
|
return { outcome: "non_blocking", deferralReason: null };
|
|
2479
|
-
const hasLocation = location !== undefined && location.length > 0;
|
|
2453
|
+
const hasLocation = location !== undefined && location.length > 0 && !isBodyOrCommentLocation(location);
|
|
2480
2454
|
if (hasLocation && context.inSurface && !context.inSurface(location)) {
|
|
2481
2455
|
return { outcome: "deferred", deferralReason: "outside-surface" };
|
|
2482
2456
|
}
|
|
@@ -2843,11 +2817,13 @@ function checkDocUpdateList(prBody) {
|
|
|
2843
2817
|
return headingCheck(prBody, "(?:documentation|doc)[- ]update(?:\\s+list)?", "Documentation-update list");
|
|
2844
2818
|
}
|
|
2845
2819
|
function checkWorktreeStep0(prBody) {
|
|
2846
|
-
if (/git worktree add/.test(prBody))
|
|
2820
|
+
if (/git worktree add/.test(prBody) || /cd \.worktrees\//.test(prBody) || /bun install --frozen-lockfile/.test(prBody))
|
|
2847
2821
|
return { status: "pass", errors: [] };
|
|
2848
2822
|
return {
|
|
2849
2823
|
status: "fail",
|
|
2850
|
-
errors: [
|
|
2824
|
+
errors: [
|
|
2825
|
+
"brief-validation worktree Step 0: no `git worktree add`, `cd .worktrees/`, or `bun install --frozen-lockfile` command found in the PR body."
|
|
2826
|
+
]
|
|
2851
2827
|
};
|
|
2852
2828
|
}
|
|
2853
2829
|
function checkStopConditions(prBody) {
|
|
@@ -3037,7 +3013,8 @@ function isCommandBlock(content) {
|
|
|
3037
3013
|
return COMMAND_WORDS.includes(commandWordOf(firstNonBlankLine(content)));
|
|
3038
3014
|
}
|
|
3039
3015
|
function isStep0Block(content) {
|
|
3040
|
-
|
|
3016
|
+
const first = firstNonBlankLine(content);
|
|
3017
|
+
return first.startsWith("git worktree add") || first.startsWith("cd .worktrees/") || first.startsWith("bun install --frozen-lockfile");
|
|
3041
3018
|
}
|
|
3042
3019
|
function checkCommandsCarryOutput(prBody) {
|
|
3043
3020
|
const errors = [];
|
|
@@ -3506,10 +3483,14 @@ function legacySlugPattern(legacySlugs) {
|
|
|
3506
3483
|
const alternation = legacySlugs.map((s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|");
|
|
3507
3484
|
return new RegExp(`(^|[^a-zA-Z0-9\\n-])(${alternation})([^a-zA-Z0-9\\n-]|$)`, "g");
|
|
3508
3485
|
}
|
|
3486
|
+
function specGrandfatherPaths(specGrandfather) {
|
|
3487
|
+
return Array.isArray(specGrandfather) ? [...specGrandfather] : Object.keys(specGrandfather);
|
|
3488
|
+
}
|
|
3509
3489
|
function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuffix, legacySlugs = [], shipsPrefix = SHIPS_PREFIX, specGrandfather = [], specPaths = DEFAULT_SPEC_PATHS) {
|
|
3510
3490
|
const findings = [];
|
|
3511
3491
|
const legacyPattern = legacySlugPattern(legacySlugs);
|
|
3512
|
-
const
|
|
3492
|
+
const grandfatheredWhole = new Set(Array.isArray(specGrandfather) ? specGrandfather : []);
|
|
3493
|
+
const limits = new Map(Array.isArray(specGrandfather) ? [] : Object.entries(specGrandfather));
|
|
3513
3494
|
const patterns = [
|
|
3514
3495
|
{ pattern: FORGE_NUMBER_PATTERN, what: "a forge number" },
|
|
3515
3496
|
{ pattern: TRANCHE_SLUG_VN_PATTERN, what: "an internal tranche slug" },
|
|
@@ -3528,18 +3509,19 @@ function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuff
|
|
|
3528
3509
|
continue;
|
|
3529
3510
|
if (cls !== "product" && cls !== "spec" && !SWEPT_CLASSES.has(cls))
|
|
3530
3511
|
continue;
|
|
3531
|
-
if (cls === "spec" &&
|
|
3512
|
+
if (cls === "spec" && grandfatheredWhole.has(file.path))
|
|
3532
3513
|
continue;
|
|
3533
3514
|
const blocking = cls === "product" || cls === "spec";
|
|
3534
3515
|
const scrubbed = cls === "product" ? stripNonProseForProduct(file.path, file.content) : stripNonProse(file.path, file.content);
|
|
3535
3516
|
const patternsToRun = cls === "product" ? productPatterns : cls === "spec" ? specPatterns : patterns;
|
|
3517
|
+
const fileFindings = [];
|
|
3536
3518
|
for (const { pattern, what, group } of patternsToRun) {
|
|
3537
3519
|
pattern.lastIndex = 0;
|
|
3538
3520
|
let match = pattern.exec(scrubbed);
|
|
3539
3521
|
while (match !== null) {
|
|
3540
3522
|
const cited = group !== undefined ? match[group] ?? match[0] : match[0];
|
|
3541
3523
|
const citedIndex = match.index + match[0].indexOf(cited);
|
|
3542
|
-
|
|
3524
|
+
fileFindings.push({
|
|
3543
3525
|
file: file.path,
|
|
3544
3526
|
line: lineAt(scrubbed, citedIndex),
|
|
3545
3527
|
message: `references ${what} ("${cited}") a reader outside this repo's tracker cannot resolve`,
|
|
@@ -3548,6 +3530,15 @@ function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuff
|
|
|
3548
3530
|
match = pattern.exec(scrubbed);
|
|
3549
3531
|
}
|
|
3550
3532
|
}
|
|
3533
|
+
const limit = cls === "spec" ? limits.get(file.path) : undefined;
|
|
3534
|
+
if (limit !== undefined) {
|
|
3535
|
+
if (fileFindings.length <= limit)
|
|
3536
|
+
continue;
|
|
3537
|
+
for (const f of fileFindings) {
|
|
3538
|
+
f.message += `; ${file.path} carries ${fileFindings.length} such findings, over its proseGates.specGrandfather limit of ${limit}`;
|
|
3539
|
+
}
|
|
3540
|
+
}
|
|
3541
|
+
findings.push(...fileFindings);
|
|
3551
3542
|
}
|
|
3552
3543
|
return findings;
|
|
3553
3544
|
}
|
|
@@ -4129,6 +4120,8 @@ var FILE_EXTENSIONS = new Set([
|
|
|
4129
4120
|
"html",
|
|
4130
4121
|
"css"
|
|
4131
4122
|
]);
|
|
4123
|
+
var CI_SHARD_DIR = "apps/cli/tests/ci-shards";
|
|
4124
|
+
var CI_SHARD_PROBE = `${CI_SHARD_DIR}/shard-1.txt`;
|
|
4132
4125
|
|
|
4133
4126
|
// ../../packages/aeg-core/src/task-branch-identity.ts
|
|
4134
4127
|
var ISSUE_BRANCH_PATTERN = /^task\/issue-(\d+)$/;
|
|
@@ -4507,8 +4500,7 @@ function briefHash(brief) {
|
|
|
4507
4500
|
function policyDigest(policy) {
|
|
4508
4501
|
return createHash4("sha256").update(JSON.stringify({
|
|
4509
4502
|
codeReviewThreshold: policy.codeReviewThreshold,
|
|
4510
|
-
securityThreshold: policy.securityThreshold
|
|
4511
|
-
maxRounds: policy.maxRounds
|
|
4503
|
+
securityThreshold: policy.securityThreshold
|
|
4512
4504
|
})).digest("hex");
|
|
4513
4505
|
}
|
|
4514
4506
|
function isBoundToHead(echoed, headSha) {
|
|
@@ -4821,7 +4813,46 @@ function parseEnforcementRegistry(content) {
|
|
|
4821
4813
|
return result;
|
|
4822
4814
|
}
|
|
4823
4815
|
// ../../packages/aeg-core/src/registry-checks.ts
|
|
4824
|
-
|
|
4816
|
+
var HOOK_DIR_PREFIXES = [".claude/hooks/", ".vinaya/hooks/", ".husky/", ".git/hooks/"];
|
|
4817
|
+
var BARE_HOOK_NAME = /^check-[A-Za-z0-9_.-]*\.sh$/;
|
|
4818
|
+
function basename(path) {
|
|
4819
|
+
return path.slice(path.lastIndexOf("/") + 1);
|
|
4820
|
+
}
|
|
4821
|
+
function lineOf(content, index) {
|
|
4822
|
+
let line = 1;
|
|
4823
|
+
for (let i = 0;i < index; i++)
|
|
4824
|
+
if (content.charCodeAt(i) === 10)
|
|
4825
|
+
line++;
|
|
4826
|
+
return line;
|
|
4827
|
+
}
|
|
4828
|
+
function findUnshippedHookRefs(docs, shipped) {
|
|
4829
|
+
const shippedNames = new Set([...shipped].map(basename));
|
|
4830
|
+
const findings = [];
|
|
4831
|
+
const flag = (doc, token, index) => {
|
|
4832
|
+
findings.push({
|
|
4833
|
+
path: doc.path,
|
|
4834
|
+
reason: `${doc.path}:${lineOf(doc.content, index)} names hook "${token}", which is neither tracked in git nor emitted by \`vinaya init\``
|
|
4835
|
+
});
|
|
4836
|
+
};
|
|
4837
|
+
for (const doc of docs) {
|
|
4838
|
+
for (const { cited, index } of extractCitedPaths(doc.content)) {
|
|
4839
|
+
if (cited.endsWith("/") || !HOOK_DIR_PREFIXES.some((p) => cited.startsWith(p)))
|
|
4840
|
+
continue;
|
|
4841
|
+
if (!shipped.has(cited))
|
|
4842
|
+
flag(doc, cited, index);
|
|
4843
|
+
}
|
|
4844
|
+
const spanPattern = /`([^`\n]+)`/g;
|
|
4845
|
+
let match = spanPattern.exec(doc.content);
|
|
4846
|
+
while (match !== null) {
|
|
4847
|
+
const token = match[1] ?? "";
|
|
4848
|
+
if (BARE_HOOK_NAME.test(token) && !shippedNames.has(token))
|
|
4849
|
+
flag(doc, token, match.index);
|
|
4850
|
+
match = spanPattern.exec(doc.content);
|
|
4851
|
+
}
|
|
4852
|
+
}
|
|
4853
|
+
return findings;
|
|
4854
|
+
}
|
|
4855
|
+
function checkG1(rows, existsFn, hookRefs) {
|
|
4825
4856
|
const findings = [];
|
|
4826
4857
|
for (const row of rows) {
|
|
4827
4858
|
if (row.implementation === "")
|
|
@@ -4834,6 +4865,8 @@ function checkG1(rows, existsFn) {
|
|
|
4834
4865
|
});
|
|
4835
4866
|
}
|
|
4836
4867
|
}
|
|
4868
|
+
if (hookRefs)
|
|
4869
|
+
findings.push(...findUnshippedHookRefs(hookRefs.docs, hookRefs.shipped));
|
|
4837
4870
|
return { check: "G1", status: findings.length > 0 ? "fail" : "pass", findings };
|
|
4838
4871
|
}
|
|
4839
4872
|
var SCAFFOLD_PLACEHOLDER = "[undocumented — fill in why]";
|
|
@@ -4966,6 +4999,55 @@ function checkG6(rows, registeredCheckNames) {
|
|
|
4966
4999
|
}
|
|
4967
5000
|
return { check: "G6", status: findings.length > 0 ? "fail" : "pass", findings };
|
|
4968
5001
|
}
|
|
5002
|
+
function reachesProducer(file, producers, imports) {
|
|
5003
|
+
const seen = new Set([file]);
|
|
5004
|
+
const queue = [file];
|
|
5005
|
+
for (let next = queue.pop();next !== undefined; next = queue.pop()) {
|
|
5006
|
+
if (producers.has(next))
|
|
5007
|
+
return true;
|
|
5008
|
+
for (const dep of imports.get(next) ?? []) {
|
|
5009
|
+
if (!seen.has(dep)) {
|
|
5010
|
+
seen.add(dep);
|
|
5011
|
+
queue.push(dep);
|
|
5012
|
+
}
|
|
5013
|
+
}
|
|
5014
|
+
}
|
|
5015
|
+
return false;
|
|
5016
|
+
}
|
|
5017
|
+
function checkG7(input) {
|
|
5018
|
+
if (!input.enforcementMapPresent)
|
|
5019
|
+
return { check: "G7", status: "info", findings: [] };
|
|
5020
|
+
const subjects = new Set([...input.crossingFiles, ...input.blockingFiles]);
|
|
5021
|
+
const findings = [];
|
|
5022
|
+
for (const path of subjects) {
|
|
5023
|
+
if (path in input.exemptions)
|
|
5024
|
+
continue;
|
|
5025
|
+
if (!reachesProducer(path, input.producers, input.imports)) {
|
|
5026
|
+
findings.push({
|
|
5027
|
+
path,
|
|
5028
|
+
reason: `"${path}" ${input.crossingFiles.includes(path) ? "makes a GitHub-writing call" : "implements a blocking gate"} but neither is a log producer nor imports one, and it is not exempted with a reason`
|
|
5029
|
+
});
|
|
5030
|
+
}
|
|
5031
|
+
}
|
|
5032
|
+
for (const [path, reason] of Object.entries(input.exemptions)) {
|
|
5033
|
+
if (reason.trim() === "") {
|
|
5034
|
+
findings.push({ path, reason: `exemption for "${path}" states no reason` });
|
|
5035
|
+
} else if (!input.existsFn(path)) {
|
|
5036
|
+
findings.push({ path, reason: `exemption names "${path}", which no longer exists` });
|
|
5037
|
+
} else if (!subjects.has(path)) {
|
|
5038
|
+
findings.push({
|
|
5039
|
+
path,
|
|
5040
|
+
reason: `exemption names "${path}", which is neither a GitHub-writing file nor a blocking gate's implementation`
|
|
5041
|
+
});
|
|
5042
|
+
} else if (reachesProducer(path, input.producers, input.imports)) {
|
|
5043
|
+
findings.push({
|
|
5044
|
+
path,
|
|
5045
|
+
reason: `exemption names "${path}", which does reach a log producer — remove the exemption`
|
|
5046
|
+
});
|
|
5047
|
+
}
|
|
5048
|
+
}
|
|
5049
|
+
return { check: "G7", status: findings.length > 0 ? "fail" : "pass", findings };
|
|
5050
|
+
}
|
|
4969
5051
|
// ../../packages/aeg-core/src/dead-branch-push-guard.ts
|
|
4970
5052
|
function checkDeadBranchPush(input) {
|
|
4971
5053
|
const { branch, prState, prNumber } = input;
|
|
@@ -5145,6 +5227,11 @@ function checkDispatchReadiness(input) {
|
|
|
5145
5227
|
push("depends-on-unresolvable", `dispatch-gate depends-on: ${taskLabel} depends on "${dep.id}", which is UNRESOLVABLE — the resolver could not find a matching tranche/task/Issue for this edge (not a claim about merge status). Not dispatchable until the edge is corrected.`);
|
|
5146
5228
|
continue;
|
|
5147
5229
|
}
|
|
5230
|
+
if (dep.readFailed === true) {
|
|
5231
|
+
const issueStr = dep.issue !== null ? ` (#${dep.issue})` : "";
|
|
5232
|
+
push("depends-on-read-failed", `dispatch-gate depends-on: ${taskLabel} depends on ${dep.id}${issueStr}, but the forge could not be read for that dependency — not a claim about its merge status. Retry the check.`);
|
|
5233
|
+
continue;
|
|
5234
|
+
}
|
|
5148
5235
|
if (!dep.merged && !isHandClosedByRecognizedPrincipal(dep, principalAllowlist)) {
|
|
5149
5236
|
const issueStr = dep.issue !== null ? ` (#${dep.issue})` : "";
|
|
5150
5237
|
push("depends-on-not-merged", `dispatch-gate depends-on: ${taskLabel} depends on ${dep.id}${issueStr}, whose PR is not merged yet — not dispatchable, it serializes behind it.`);
|
|
@@ -5387,7 +5474,6 @@ var TaskPrPauseSchema = z.object({
|
|
|
5387
5474
|
var TaskPrReviewRecordSchema = z.object({
|
|
5388
5475
|
verdicts: z.array(TaskPrVerdictSchema),
|
|
5389
5476
|
roundMarkers: z.array(z.number().int().nonnegative()),
|
|
5390
|
-
summaryTable: z.string().nullable(),
|
|
5391
5477
|
pause: TaskPrPauseSchema.nullable()
|
|
5392
5478
|
});
|
|
5393
5479
|
var TaskPrReadInputSchema = z.object({
|
|
@@ -5434,16 +5520,6 @@ var TaskCancelResultSchema = z.object({
|
|
|
5434
5520
|
authenticatedFrom: z.string().min(1),
|
|
5435
5521
|
fencedEffectKeys: z.array(z.string())
|
|
5436
5522
|
});
|
|
5437
|
-
var TASK_TOOL_NAMES = [
|
|
5438
|
-
"task_start",
|
|
5439
|
-
"task_status",
|
|
5440
|
-
"task_escalation_read",
|
|
5441
|
-
"task_pr_read",
|
|
5442
|
-
"task_resume",
|
|
5443
|
-
"task_cancel"
|
|
5444
|
-
];
|
|
5445
|
-
var OPERATOR_STATUS_FOLLOW = "task_status_follow";
|
|
5446
|
-
var OPERATOR_TOOL_GRANT = [...TASK_TOOL_NAMES, OPERATOR_STATUS_FOLLOW];
|
|
5447
5523
|
// ../../packages/aeg-core/src/first-push-dispatch-gate.ts
|
|
5448
5524
|
function parseTaskBranch(branch) {
|
|
5449
5525
|
const m = /^task\/([^/]+)\/([^/]+)$/.exec(branch);
|
|
@@ -5674,16 +5750,71 @@ var NO_GATE_CUTOVERS = {
|
|
|
5674
5750
|
briefRulesSincePr: null,
|
|
5675
5751
|
agentBoxesRefusedSincePr: null
|
|
5676
5752
|
};
|
|
5677
|
-
// ../../packages/aeg-core/src/dev-review-loop/types.ts
|
|
5678
|
-
var SEVERITY_COLUMNS = ["blocker", "major", "minor", "critical", "high", "medium", "low"];
|
|
5679
|
-
// ../../packages/aeg-core/src/dev-review-loop/journal-reconstruction.ts
|
|
5680
|
-
var SUMMARY_TABLE_HEADER = `| round | ${SEVERITY_COLUMNS.join(" | ")} | confidence | outcome |`;
|
|
5681
|
-
// ../../packages/aeg-core/src/log/envelope.ts
|
|
5682
|
-
import { createHash as createHash5 } from "node:crypto";
|
|
5683
|
-
|
|
5684
5753
|
// ../../packages/aeg-core/src/log/schema.ts
|
|
5754
|
+
import { z as z3 } from "zod";
|
|
5755
|
+
|
|
5756
|
+
// ../../packages/aeg-core/src/log/custom.ts
|
|
5685
5757
|
import { z as z2 } from "zod";
|
|
5758
|
+
var CUSTOM_EVENT_NAME_PATTERN = /^[a-z][a-z0-9_]*\.[a-z][a-z0-9_.]*$/;
|
|
5759
|
+
var CUSTOM_EVENT_NAME_MAX_LENGTH = 64;
|
|
5760
|
+
var CUSTOM_EVENT_RESERVED_NAMESPACE = "vinaya";
|
|
5761
|
+
var CUSTOM_EVENT_MAX_FIELDS = 20;
|
|
5762
|
+
var CUSTOM_FIELD_NAME_PATTERN = /^[a-z][a-z0-9_]*$/;
|
|
5763
|
+
var CUSTOM_FIELD_NAME_MAX_LENGTH = 64;
|
|
5764
|
+
var CUSTOM_TEXT_MAX_LENGTH = 500;
|
|
5765
|
+
var CUSTOM_WORD_PATTERN = /^[a-z0-9][a-z0-9_-]*$/;
|
|
5766
|
+
var CUSTOM_WORD_MAX_LENGTH = 64;
|
|
5767
|
+
var CUSTOM_FIELD_MAX_WORDS = 50;
|
|
5768
|
+
var CustomFieldTypeSchema = z2.union([z2.enum(["text", "number", "boolean"]), z2.array(z2.string())]);
|
|
5769
|
+
var CustomEventDeclarationsSchema = z2.record(z2.string(), z2.object({
|
|
5770
|
+
fields: z2.record(z2.string(), CustomFieldTypeSchema)
|
|
5771
|
+
}).strict()).superRefine((events, ctx) => {
|
|
5772
|
+
for (const [name, declaration] of Object.entries(events)) {
|
|
5773
|
+
const refuse = (message, path = []) => {
|
|
5774
|
+
ctx.addIssue({
|
|
5775
|
+
code: z2.ZodIssueCode.custom,
|
|
5776
|
+
path: [name, ...path],
|
|
5777
|
+
message: `logs.events "${name}": ${message}`
|
|
5778
|
+
});
|
|
5779
|
+
};
|
|
5780
|
+
if (name.length > CUSTOM_EVENT_NAME_MAX_LENGTH) {
|
|
5781
|
+
refuse(`the name must be at most ${CUSTOM_EVENT_NAME_MAX_LENGTH} characters`);
|
|
5782
|
+
}
|
|
5783
|
+
if (!CUSTOM_EVENT_NAME_PATTERN.test(name)) {
|
|
5784
|
+
refuse("the name must be `<namespace>.<event>` — lowercase letters, digits and `_`, a dot between them");
|
|
5785
|
+
} else if (name.split(".")[0] === CUSTOM_EVENT_RESERVED_NAMESPACE) {
|
|
5786
|
+
refuse(`the \`${CUSTOM_EVENT_RESERVED_NAMESPACE}.\` namespace is reserved for Vinaya's own events`);
|
|
5787
|
+
}
|
|
5788
|
+
const fieldEntries = Object.entries(declaration.fields);
|
|
5789
|
+
if (fieldEntries.length > CUSTOM_EVENT_MAX_FIELDS) {
|
|
5790
|
+
refuse(`at most ${CUSTOM_EVENT_MAX_FIELDS} fields may be declared (found ${fieldEntries.length})`, ["fields"]);
|
|
5791
|
+
}
|
|
5792
|
+
for (const [field, type] of fieldEntries) {
|
|
5793
|
+
if (field.length > CUSTOM_FIELD_NAME_MAX_LENGTH || !CUSTOM_FIELD_NAME_PATTERN.test(field)) {
|
|
5794
|
+
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]);
|
|
5795
|
+
}
|
|
5796
|
+
if (typeof type === "string")
|
|
5797
|
+
continue;
|
|
5798
|
+
if (type.length === 0) {
|
|
5799
|
+
refuse(`field "${field}": a list of words must name at least one word`, ["fields", field]);
|
|
5800
|
+
}
|
|
5801
|
+
if (type.length > CUSTOM_FIELD_MAX_WORDS) {
|
|
5802
|
+
refuse(`field "${field}": a list of words may name at most ${CUSTOM_FIELD_MAX_WORDS}`, ["fields", field]);
|
|
5803
|
+
}
|
|
5804
|
+
const bad = type.filter((w) => w.length > CUSTOM_WORD_MAX_LENGTH || !CUSTOM_WORD_PATTERN.test(w));
|
|
5805
|
+
if (bad.length > 0) {
|
|
5806
|
+
refuse(`field "${field}": a listed word is lowercase letters, digits, \`_\` and \`-\`, at most ${CUSTOM_WORD_MAX_LENGTH} characters`, ["fields", field]);
|
|
5807
|
+
}
|
|
5808
|
+
if (new Set(type).size !== type.length) {
|
|
5809
|
+
refuse(`field "${field}": a list of words names a word twice`, ["fields", field]);
|
|
5810
|
+
}
|
|
5811
|
+
}
|
|
5812
|
+
}
|
|
5813
|
+
});
|
|
5814
|
+
|
|
5815
|
+
// ../../packages/aeg-core/src/log/schema.ts
|
|
5686
5816
|
var CONFIDENCE_REASON_MAX_LENGTH = 280;
|
|
5817
|
+
var REVIEW_FINDING_DESCRIPTION_MAX_LENGTH = 1000;
|
|
5687
5818
|
var ROLE_VALUES = [
|
|
5688
5819
|
"planner",
|
|
5689
5820
|
"developer",
|
|
@@ -5693,178 +5824,214 @@ var ROLE_VALUES = [
|
|
|
5693
5824
|
"archivist",
|
|
5694
5825
|
"architect"
|
|
5695
5826
|
];
|
|
5696
|
-
var RoleSchema =
|
|
5827
|
+
var RoleSchema = z3.enum(ROLE_VALUES);
|
|
5697
5828
|
var HOST_VALUES = ["hook", "ci", "cli", "loop"];
|
|
5698
|
-
var HostSchema =
|
|
5829
|
+
var HostSchema = z3.enum(HOST_VALUES);
|
|
5699
5830
|
var RUN_ID_PATTERN = /^[A-Za-z0-9_.-]{1,128}$/;
|
|
5700
5831
|
var headerMetaCore = {
|
|
5701
|
-
ts:
|
|
5702
|
-
run_id:
|
|
5703
|
-
seq:
|
|
5704
|
-
repo:
|
|
5705
|
-
vinaya:
|
|
5706
|
-
doctrine:
|
|
5832
|
+
ts: z3.string(),
|
|
5833
|
+
run_id: z3.string().regex(RUN_ID_PATTERN),
|
|
5834
|
+
seq: z3.number().int().nonnegative(),
|
|
5835
|
+
repo: z3.string().nullable(),
|
|
5836
|
+
vinaya: z3.string(),
|
|
5837
|
+
doctrine: z3.string(),
|
|
5707
5838
|
host: HostSchema,
|
|
5708
|
-
machine:
|
|
5839
|
+
machine: z3.string()
|
|
5709
5840
|
};
|
|
5710
|
-
var HeaderMetaV1Schema =
|
|
5711
|
-
schema:
|
|
5841
|
+
var HeaderMetaV1Schema = z3.object({
|
|
5842
|
+
schema: z3.literal(1),
|
|
5712
5843
|
...headerMetaCore
|
|
5713
5844
|
}).strict();
|
|
5714
|
-
var LineageSchema =
|
|
5715
|
-
run:
|
|
5716
|
-
attempt:
|
|
5717
|
-
parent:
|
|
5845
|
+
var LineageSchema = z3.object({
|
|
5846
|
+
run: z3.string().nullable(),
|
|
5847
|
+
attempt: z3.number().int().nullable(),
|
|
5848
|
+
parent: z3.string().nullable()
|
|
5718
5849
|
}).strict();
|
|
5719
|
-
var InputVersionsSchema =
|
|
5720
|
-
objectives_version:
|
|
5721
|
-
brief_hash:
|
|
5722
|
-
ruling_ordinal:
|
|
5723
|
-
policy_digest:
|
|
5850
|
+
var InputVersionsSchema = z3.object({
|
|
5851
|
+
objectives_version: z3.string().nullable(),
|
|
5852
|
+
brief_hash: z3.string().nullable(),
|
|
5853
|
+
ruling_ordinal: z3.number().int().nullable(),
|
|
5854
|
+
policy_digest: z3.string().nullable()
|
|
5724
5855
|
}).strict();
|
|
5725
|
-
var ProvenanceSchema =
|
|
5726
|
-
var HeaderMetaV2Schema =
|
|
5727
|
-
schema:
|
|
5856
|
+
var ProvenanceSchema = z3.enum(["parent_attributed", "env_correlated", "self_reported", "unavailable"]);
|
|
5857
|
+
var HeaderMetaV2Schema = z3.object({
|
|
5858
|
+
schema: z3.literal(2),
|
|
5728
5859
|
...headerMetaCore,
|
|
5729
|
-
event_id:
|
|
5730
|
-
process_id:
|
|
5731
|
-
actor_id:
|
|
5860
|
+
event_id: z3.string().min(1),
|
|
5861
|
+
process_id: z3.string().min(1),
|
|
5862
|
+
actor_id: z3.string().nullable(),
|
|
5732
5863
|
lineage: LineageSchema,
|
|
5733
5864
|
input_versions: InputVersionsSchema,
|
|
5734
5865
|
provenance: ProvenanceSchema
|
|
5735
5866
|
}).strict();
|
|
5736
|
-
var
|
|
5737
|
-
|
|
5738
|
-
|
|
5739
|
-
|
|
5740
|
-
|
|
5741
|
-
role: z2.union([RoleSchema, z2.literal("unattributed")]),
|
|
5742
|
-
round: z2.number().int().optional(),
|
|
5743
|
-
objectives_version: z2.string().optional()
|
|
5867
|
+
var WorkSchema = z3.object({
|
|
5868
|
+
ref: z3.string().nullable(),
|
|
5869
|
+
repo: z3.string().nullable(),
|
|
5870
|
+
change: z3.string().nullable(),
|
|
5871
|
+
revision: z3.string().nullable()
|
|
5744
5872
|
}).strict();
|
|
5745
|
-
var
|
|
5873
|
+
var FlowSchema = z3.object({
|
|
5874
|
+
id: z3.string().nullable(),
|
|
5875
|
+
version: z3.string().nullable()
|
|
5876
|
+
}).strict();
|
|
5877
|
+
var HeaderMetaV3Schema = z3.object({
|
|
5878
|
+
schema: z3.literal(3),
|
|
5879
|
+
...headerMetaCore,
|
|
5880
|
+
event_id: z3.string().min(1),
|
|
5881
|
+
process_id: z3.string().min(1),
|
|
5882
|
+
actor_id: z3.string().nullable(),
|
|
5883
|
+
lineage: LineageSchema,
|
|
5884
|
+
input_versions: InputVersionsSchema,
|
|
5885
|
+
provenance: ProvenanceSchema,
|
|
5886
|
+
work: WorkSchema,
|
|
5887
|
+
flow: FlowSchema,
|
|
5888
|
+
runtime: z3.string().nullable(),
|
|
5889
|
+
source: z3.string().nullable()
|
|
5890
|
+
}).strict();
|
|
5891
|
+
var HeaderMetaSchema = z3.discriminatedUnion("schema", [HeaderMetaV1Schema, HeaderMetaV2Schema, HeaderMetaV3Schema]);
|
|
5892
|
+
var SubjectSchema = z3.object({
|
|
5893
|
+
issue: z3.number().int().nullable(),
|
|
5894
|
+
pr: z3.number().int().optional(),
|
|
5895
|
+
sha: z3.string().optional(),
|
|
5896
|
+
role: z3.union([RoleSchema, z3.literal("unattributed")]),
|
|
5897
|
+
round: z3.number().int().optional(),
|
|
5898
|
+
objectives_version: z3.string().optional()
|
|
5899
|
+
}).strict();
|
|
5900
|
+
var HeaderSchema = z3.object({
|
|
5746
5901
|
meta: HeaderMetaSchema,
|
|
5747
5902
|
subject: SubjectSchema
|
|
5748
5903
|
}).strict();
|
|
5749
5904
|
var envelopeTail = {
|
|
5750
|
-
duration_ms:
|
|
5751
|
-
payload:
|
|
5905
|
+
duration_ms: z3.number().nonnegative().optional(),
|
|
5906
|
+
payload: z3.object({}).strict()
|
|
5752
5907
|
};
|
|
5753
|
-
var ReviewFindingSchema =
|
|
5754
|
-
id:
|
|
5755
|
-
severity:
|
|
5756
|
-
|
|
5757
|
-
|
|
5758
|
-
|
|
5759
|
-
|
|
5760
|
-
|
|
5761
|
-
|
|
5908
|
+
var ReviewFindingSchema = z3.object({
|
|
5909
|
+
id: z3.string(),
|
|
5910
|
+
severity: z3.string(),
|
|
5911
|
+
location: z3.string().optional(),
|
|
5912
|
+
deferral_reason: z3.enum(["outside-surface", "unchanged-line"]).optional(),
|
|
5913
|
+
description: z3.string().max(REVIEW_FINDING_DESCRIPTION_MAX_LENGTH).optional(),
|
|
5914
|
+
state: z3.string().optional(),
|
|
5915
|
+
severity_scale: z3.string().optional(),
|
|
5916
|
+
policy_treatment: z3.enum(["blocking", "non_blocking", "unavailable"]).optional(),
|
|
5917
|
+
confidence: z3.number().min(0).max(1).optional(),
|
|
5918
|
+
confidence_scale: z3.string().optional(),
|
|
5919
|
+
confidence_source: z3.string().optional()
|
|
5762
5920
|
}).strict();
|
|
5763
|
-
var DispatchOutcomeSchema =
|
|
5764
|
-
|
|
5765
|
-
|
|
5766
|
-
type:
|
|
5767
|
-
pr:
|
|
5768
|
-
head:
|
|
5769
|
-
comment_id:
|
|
5921
|
+
var DispatchOutcomeSchema = z3.discriminatedUnion("type", [
|
|
5922
|
+
z3.object({ type: z3.literal("pr_opened"), pr: z3.number().int(), head: z3.string() }).strict(),
|
|
5923
|
+
z3.object({
|
|
5924
|
+
type: z3.literal("round_pushed"),
|
|
5925
|
+
pr: z3.number().int(),
|
|
5926
|
+
head: z3.string(),
|
|
5927
|
+
comment_id: z3.number().int()
|
|
5770
5928
|
}).strict(),
|
|
5771
|
-
|
|
5772
|
-
type:
|
|
5773
|
-
verdict:
|
|
5774
|
-
head:
|
|
5775
|
-
comment_id:
|
|
5776
|
-
objectives:
|
|
5777
|
-
findings:
|
|
5929
|
+
z3.object({
|
|
5930
|
+
type: z3.literal("verdict"),
|
|
5931
|
+
verdict: z3.enum(["APPROVE", "REQUEST CHANGES", "PASS", "FAIL"]),
|
|
5932
|
+
head: z3.string(),
|
|
5933
|
+
comment_id: z3.number().int(),
|
|
5934
|
+
objectives: z3.array(z3.object({ id: z3.string(), met: z3.boolean() }).strict()),
|
|
5935
|
+
findings: z3.array(ReviewFindingSchema)
|
|
5778
5936
|
}).strict(),
|
|
5779
|
-
|
|
5780
|
-
type:
|
|
5781
|
-
class:
|
|
5782
|
-
comment_id:
|
|
5937
|
+
z3.object({
|
|
5938
|
+
type: z3.literal("escalation"),
|
|
5939
|
+
class: z3.enum(["authority", "strategy", "product"]),
|
|
5940
|
+
comment_id: z3.number().int()
|
|
5783
5941
|
}).strict(),
|
|
5784
|
-
|
|
5785
|
-
|
|
5786
|
-
|
|
5787
|
-
|
|
5942
|
+
z3.object({ type: z3.literal("brief"), comment_id: z3.number().int(), hash: z3.string() }).strict(),
|
|
5943
|
+
z3.object({ type: z3.literal("plan"), issues: z3.array(z3.number().int()) }).strict(),
|
|
5944
|
+
z3.object({ type: z3.literal("archive"), provenance_comment_id: z3.number().int() }).strict(),
|
|
5945
|
+
z3.object({ type: z3.literal("completed") }).strict()
|
|
5788
5946
|
]);
|
|
5789
5947
|
var dispatchShared = {
|
|
5790
5948
|
meta: HeaderMetaSchema,
|
|
5791
5949
|
subject: SubjectSchema,
|
|
5792
|
-
kind:
|
|
5950
|
+
kind: z3.literal("dispatch"),
|
|
5793
5951
|
...envelopeTail,
|
|
5794
5952
|
target_role: RoleSchema,
|
|
5795
|
-
model:
|
|
5796
|
-
round:
|
|
5797
|
-
effect_id:
|
|
5953
|
+
model: z3.string(),
|
|
5954
|
+
round: z3.number().int().optional(),
|
|
5955
|
+
effect_id: z3.string()
|
|
5798
5956
|
};
|
|
5799
|
-
var dispatchUsageField =
|
|
5800
|
-
var DispatchEventSchema =
|
|
5801
|
-
|
|
5802
|
-
|
|
5957
|
+
var dispatchUsageField = z3.object({ input: z3.number().nonnegative(), output: z3.number().nonnegative() }).strict().nullable();
|
|
5958
|
+
var DispatchEventSchema = z3.discriminatedUnion("event", [
|
|
5959
|
+
z3.object({ ...dispatchShared, event: z3.literal("dispatched"), prompt_hash: z3.string() }).strict(),
|
|
5960
|
+
z3.object({
|
|
5803
5961
|
...dispatchShared,
|
|
5804
|
-
event:
|
|
5962
|
+
event: z3.literal("outcome_received"),
|
|
5805
5963
|
outcome: DispatchOutcomeSchema,
|
|
5806
5964
|
usage: dispatchUsageField
|
|
5807
5965
|
}).strict(),
|
|
5808
|
-
|
|
5966
|
+
z3.object({
|
|
5809
5967
|
...dispatchShared,
|
|
5810
|
-
event:
|
|
5811
|
-
reason:
|
|
5968
|
+
event: z3.literal("dispatch_failed"),
|
|
5969
|
+
reason: z3.enum(["timeout", "crash", "refused", "unattributed_write", "usage_limit"]),
|
|
5970
|
+
usage_limit: z3.object({ agent: z3.string().min(1), reset_at: z3.string().nullable() }).strict().optional(),
|
|
5812
5971
|
usage: dispatchUsageField
|
|
5813
5972
|
}).strict()
|
|
5814
5973
|
]);
|
|
5974
|
+
var CODE_TOKEN_PATTERN = /^[A-Za-z0-9._-]{1,64}$/;
|
|
5975
|
+
var CodeTokenSchema = z3.string().regex(CODE_TOKEN_PATTERN);
|
|
5976
|
+
var ReviewerVerdictSchema = z3.object({
|
|
5977
|
+
role: RoleSchema,
|
|
5978
|
+
outcome: z3.enum(["approve", "changes_requested", "not_reviewed"]),
|
|
5979
|
+
blockers: z3.number().int().nonnegative()
|
|
5980
|
+
}).strict();
|
|
5815
5981
|
var loopShared = {
|
|
5816
5982
|
meta: HeaderMetaSchema,
|
|
5817
5983
|
subject: SubjectSchema,
|
|
5818
|
-
kind:
|
|
5984
|
+
kind: z3.literal("dev_review_loop"),
|
|
5819
5985
|
...envelopeTail,
|
|
5820
|
-
loop_id:
|
|
5986
|
+
loop_id: z3.string()
|
|
5821
5987
|
};
|
|
5822
|
-
var DevReviewLoopEventSchema =
|
|
5823
|
-
|
|
5988
|
+
var DevReviewLoopEventSchema = z3.discriminatedUnion("event", [
|
|
5989
|
+
z3.object({
|
|
5824
5990
|
...loopShared,
|
|
5825
|
-
event:
|
|
5826
|
-
task:
|
|
5827
|
-
policy:
|
|
5828
|
-
max_rounds:
|
|
5829
|
-
reviewers:
|
|
5830
|
-
models:
|
|
5991
|
+
event: z3.literal("loop_started"),
|
|
5992
|
+
task: z3.number().int(),
|
|
5993
|
+
policy: z3.object({
|
|
5994
|
+
max_rounds: z3.number().int().nonnegative(),
|
|
5995
|
+
reviewers: z3.array(RoleSchema),
|
|
5996
|
+
models: z3.record(RoleSchema, z3.string())
|
|
5831
5997
|
}).strict()
|
|
5832
5998
|
}).strict(),
|
|
5833
|
-
|
|
5834
|
-
|
|
5999
|
+
z3.object({ ...loopShared, event: z3.literal("round_started"), round: z3.number().int(), base_head: z3.string() }).strict(),
|
|
6000
|
+
z3.object({
|
|
5835
6001
|
...loopShared,
|
|
5836
|
-
event:
|
|
5837
|
-
round:
|
|
5838
|
-
head:
|
|
5839
|
-
green:
|
|
5840
|
-
confidence_value:
|
|
5841
|
-
confidence_reason:
|
|
5842
|
-
confidence_unavailable:
|
|
5843
|
-
extra_turn_spent:
|
|
6002
|
+
event: z3.literal("gate_result_read"),
|
|
6003
|
+
round: z3.number().int(),
|
|
6004
|
+
head: z3.string(),
|
|
6005
|
+
green: z3.boolean(),
|
|
6006
|
+
confidence_value: z3.number().int().min(0).max(100).optional(),
|
|
6007
|
+
confidence_reason: z3.string().max(CONFIDENCE_REASON_MAX_LENGTH).optional(),
|
|
6008
|
+
confidence_unavailable: z3.boolean().optional(),
|
|
6009
|
+
extra_turn_spent: z3.boolean().optional()
|
|
5844
6010
|
}).strict(),
|
|
5845
|
-
|
|
6011
|
+
z3.object({
|
|
5846
6012
|
...loopShared,
|
|
5847
|
-
event:
|
|
5848
|
-
round:
|
|
5849
|
-
head:
|
|
5850
|
-
all_approve:
|
|
5851
|
-
blockers:
|
|
5852
|
-
findings:
|
|
6013
|
+
event: z3.literal("verdicts_read"),
|
|
6014
|
+
round: z3.number().int(),
|
|
6015
|
+
head: z3.string(),
|
|
6016
|
+
all_approve: z3.boolean(),
|
|
6017
|
+
blockers: z3.number().int().nonnegative(),
|
|
6018
|
+
findings: z3.array(ReviewFindingSchema).optional(),
|
|
6019
|
+
reviewers: z3.array(ReviewerVerdictSchema).optional()
|
|
5853
6020
|
}).strict(),
|
|
5854
|
-
|
|
6021
|
+
z3.object({
|
|
5855
6022
|
...loopShared,
|
|
5856
|
-
event:
|
|
5857
|
-
round:
|
|
5858
|
-
open:
|
|
5859
|
-
resolved:
|
|
5860
|
-
new:
|
|
5861
|
-
recurring:
|
|
6023
|
+
event: z3.literal("findings_compared"),
|
|
6024
|
+
round: z3.number().int(),
|
|
6025
|
+
open: z3.array(z3.string()),
|
|
6026
|
+
resolved: z3.array(z3.string()),
|
|
6027
|
+
new: z3.array(z3.string()),
|
|
6028
|
+
recurring: z3.array(z3.string())
|
|
5862
6029
|
}).strict(),
|
|
5863
|
-
|
|
6030
|
+
z3.object({
|
|
5864
6031
|
...loopShared,
|
|
5865
|
-
event:
|
|
5866
|
-
round:
|
|
5867
|
-
condition:
|
|
6032
|
+
event: z3.literal("stop_condition_met"),
|
|
6033
|
+
round: z3.number().int(),
|
|
6034
|
+
condition: z3.enum([
|
|
5868
6035
|
"green",
|
|
5869
6036
|
"max_rounds",
|
|
5870
6037
|
"no_progress",
|
|
@@ -5873,66 +6040,85 @@ var DevReviewLoopEventSchema = z2.discriminatedUnion("event", [
|
|
|
5873
6040
|
"confidence",
|
|
5874
6041
|
"reappearance",
|
|
5875
6042
|
"repeat_finding",
|
|
5876
|
-
"repeat_failure"
|
|
6043
|
+
"repeat_failure",
|
|
6044
|
+
"time_budget"
|
|
5877
6045
|
])
|
|
5878
6046
|
}).strict(),
|
|
5879
|
-
|
|
6047
|
+
z3.object({
|
|
5880
6048
|
...loopShared,
|
|
5881
|
-
event:
|
|
5882
|
-
round:
|
|
5883
|
-
reason:
|
|
6049
|
+
event: z3.literal("paused"),
|
|
6050
|
+
round: z3.number().int(),
|
|
6051
|
+
reason: z3.enum(["escalation", "principal_item", "refreeze_needed"]),
|
|
6052
|
+
reason_code: CodeTokenSchema.optional()
|
|
5884
6053
|
}).strict(),
|
|
5885
|
-
|
|
6054
|
+
z3.object({
|
|
5886
6055
|
...loopShared,
|
|
5887
|
-
event:
|
|
5888
|
-
round:
|
|
5889
|
-
by:
|
|
6056
|
+
event: z3.literal("resumed"),
|
|
6057
|
+
round: z3.number().int(),
|
|
6058
|
+
by: z3.enum(["principal", "driver"])
|
|
5890
6059
|
}).strict(),
|
|
5891
|
-
|
|
6060
|
+
z3.object({
|
|
5892
6061
|
...loopShared,
|
|
5893
|
-
event:
|
|
5894
|
-
round:
|
|
5895
|
-
by:
|
|
6062
|
+
event: z3.literal("cancelled"),
|
|
6063
|
+
round: z3.number().int(),
|
|
6064
|
+
by: z3.literal("principal")
|
|
5896
6065
|
}).strict(),
|
|
5897
|
-
|
|
6066
|
+
z3.object({
|
|
5898
6067
|
...loopShared,
|
|
5899
|
-
event:
|
|
5900
|
-
round:
|
|
5901
|
-
branch:
|
|
5902
|
-
detail:
|
|
6068
|
+
event: z3.literal("unpushed_work_resume"),
|
|
6069
|
+
round: z3.number().int(),
|
|
6070
|
+
branch: z3.string(),
|
|
6071
|
+
detail: z3.string()
|
|
5903
6072
|
}).strict(),
|
|
5904
|
-
|
|
6073
|
+
z3.object({
|
|
5905
6074
|
...loopShared,
|
|
5906
|
-
event:
|
|
5907
|
-
round:
|
|
5908
|
-
base_head:
|
|
5909
|
-
head:
|
|
5910
|
-
files_changed:
|
|
5911
|
-
insertions:
|
|
5912
|
-
deletions:
|
|
5913
|
-
wall_ms:
|
|
5914
|
-
outcome:
|
|
6075
|
+
event: z3.literal("round_ended"),
|
|
6076
|
+
round: z3.number().int(),
|
|
6077
|
+
base_head: z3.string(),
|
|
6078
|
+
head: z3.string(),
|
|
6079
|
+
files_changed: z3.number().int().nonnegative(),
|
|
6080
|
+
insertions: z3.number().int().nonnegative(),
|
|
6081
|
+
deletions: z3.number().int().nonnegative(),
|
|
6082
|
+
wall_ms: z3.number().nonnegative(),
|
|
6083
|
+
outcome: z3.enum(["green", "changes_requested", "escalated"])
|
|
5915
6084
|
}).strict(),
|
|
5916
|
-
|
|
6085
|
+
z3.object({
|
|
5917
6086
|
...loopShared,
|
|
5918
|
-
event:
|
|
5919
|
-
rounds:
|
|
5920
|
-
total_wall_ms:
|
|
5921
|
-
time_to_green_ms:
|
|
5922
|
-
files_changed_total:
|
|
5923
|
-
final_head:
|
|
5924
|
-
result:
|
|
6087
|
+
event: z3.literal("journal_finalized"),
|
|
6088
|
+
rounds: z3.number().int().nonnegative(),
|
|
6089
|
+
total_wall_ms: z3.number().nonnegative(),
|
|
6090
|
+
time_to_green_ms: z3.number().nonnegative().nullable(),
|
|
6091
|
+
files_changed_total: z3.number().int().nonnegative(),
|
|
6092
|
+
final_head: z3.string(),
|
|
6093
|
+
result: z3.enum(["merged_ready", "stopped"])
|
|
5925
6094
|
}).strict(),
|
|
5926
|
-
|
|
6095
|
+
z3.object({
|
|
5927
6096
|
...loopShared,
|
|
5928
|
-
event:
|
|
5929
|
-
round:
|
|
5930
|
-
failure_kind:
|
|
5931
|
-
attempts:
|
|
5932
|
-
outcome:
|
|
6097
|
+
event: z3.literal("infrastructure_retry"),
|
|
6098
|
+
round: z3.number().int(),
|
|
6099
|
+
failure_kind: z3.enum(["pause_comment_post", "developer_connection"]),
|
|
6100
|
+
attempts: z3.number().int().positive(),
|
|
6101
|
+
outcome: z3.enum(["recovered", "exhausted"])
|
|
6102
|
+
}).strict(),
|
|
6103
|
+
z3.object({
|
|
6104
|
+
...loopShared,
|
|
6105
|
+
event: z3.literal("driver_heartbeat"),
|
|
6106
|
+
task: z3.number().int(),
|
|
6107
|
+
pr: z3.number().int().positive().optional(),
|
|
6108
|
+
round: z3.number().int(),
|
|
6109
|
+
phase: z3.string()
|
|
6110
|
+
}).strict(),
|
|
6111
|
+
z3.object({
|
|
6112
|
+
...loopShared,
|
|
6113
|
+
event: z3.literal("driver_exited"),
|
|
6114
|
+
task: z3.number().int(),
|
|
6115
|
+
reason: z3.enum(["finished", "paused", "reexec", "error", "signal"]),
|
|
6116
|
+
last_decision: z3.string(),
|
|
6117
|
+
exit_code: z3.number().int().optional(),
|
|
6118
|
+
error_class: CodeTokenSchema.optional()
|
|
5933
6119
|
}).strict()
|
|
5934
6120
|
]);
|
|
5935
|
-
var ForgeOpSchema =
|
|
6121
|
+
var ForgeOpSchema = z3.enum([
|
|
5936
6122
|
"pr.create",
|
|
5937
6123
|
"pr.comment",
|
|
5938
6124
|
"pr.body.replace",
|
|
@@ -5946,24 +6132,24 @@ var ForgeOpSchema = z2.enum([
|
|
|
5946
6132
|
"label.add",
|
|
5947
6133
|
"label.remove"
|
|
5948
6134
|
]);
|
|
5949
|
-
var ForgeWriteTargetSchema =
|
|
5950
|
-
issue:
|
|
5951
|
-
pr:
|
|
6135
|
+
var ForgeWriteTargetSchema = z3.object({
|
|
6136
|
+
issue: z3.number().int().optional(),
|
|
6137
|
+
pr: z3.number().int().optional()
|
|
5952
6138
|
}).strict();
|
|
5953
6139
|
var forgeWriteShared = {
|
|
5954
6140
|
meta: HeaderMetaSchema,
|
|
5955
6141
|
subject: SubjectSchema,
|
|
5956
|
-
kind:
|
|
6142
|
+
kind: z3.literal("forge_write"),
|
|
5957
6143
|
...envelopeTail,
|
|
5958
6144
|
op: ForgeOpSchema,
|
|
5959
6145
|
target: ForgeWriteTargetSchema
|
|
5960
6146
|
};
|
|
5961
|
-
var ForgeWriteEventSchema =
|
|
5962
|
-
|
|
5963
|
-
|
|
5964
|
-
|
|
6147
|
+
var ForgeWriteEventSchema = z3.discriminatedUnion("event", [
|
|
6148
|
+
z3.object({ ...forgeWriteShared, event: z3.literal("validated") }).strict(),
|
|
6149
|
+
z3.object({ ...forgeWriteShared, event: z3.literal("refused"), reason: z3.string() }).strict(),
|
|
6150
|
+
z3.object({ ...forgeWriteShared, event: z3.literal("written"), comment_ids: z3.array(z3.string()) }).strict()
|
|
5965
6151
|
]);
|
|
5966
|
-
var GateOutcomeSchema =
|
|
6152
|
+
var GateOutcomeSchema = z3.enum([
|
|
5967
6153
|
"pass",
|
|
5968
6154
|
"fail",
|
|
5969
6155
|
"wait",
|
|
@@ -5976,61 +6162,74 @@ var GateOutcomeSchema = z2.enum([
|
|
|
5976
6162
|
var gateShared = {
|
|
5977
6163
|
meta: HeaderMetaSchema,
|
|
5978
6164
|
subject: SubjectSchema,
|
|
5979
|
-
kind:
|
|
6165
|
+
kind: z3.literal("gate"),
|
|
5980
6166
|
...envelopeTail,
|
|
5981
|
-
check:
|
|
5982
|
-
check_version:
|
|
5983
|
-
policy_version:
|
|
5984
|
-
input_fingerprint:
|
|
6167
|
+
check: z3.string(),
|
|
6168
|
+
check_version: z3.string().nullable(),
|
|
6169
|
+
policy_version: z3.string().nullable(),
|
|
6170
|
+
input_fingerprint: z3.string().nullable()
|
|
5985
6171
|
};
|
|
5986
|
-
var GateEventSchema =
|
|
5987
|
-
|
|
6172
|
+
var GateEventSchema = z3.discriminatedUnion("event", [
|
|
6173
|
+
z3.object({
|
|
5988
6174
|
...gateShared,
|
|
5989
|
-
event:
|
|
6175
|
+
event: z3.literal("checked"),
|
|
5990
6176
|
outcome: GateOutcomeSchema,
|
|
5991
|
-
reason:
|
|
6177
|
+
reason: z3.string().optional()
|
|
6178
|
+
}).strict(),
|
|
6179
|
+
z3.object({
|
|
6180
|
+
meta: HeaderMetaSchema,
|
|
6181
|
+
subject: SubjectSchema,
|
|
6182
|
+
kind: z3.literal("gate"),
|
|
6183
|
+
...envelopeTail,
|
|
6184
|
+
event: z3.literal("summary"),
|
|
6185
|
+
ran: z3.number().int().nonnegative(),
|
|
6186
|
+
passed: z3.number().int().nonnegative(),
|
|
6187
|
+
failed: z3.number().int().nonnegative(),
|
|
6188
|
+
skipped: z3.number().int().nonnegative(),
|
|
6189
|
+
failed_checks: z3.array(z3.string())
|
|
5992
6190
|
}).strict()
|
|
5993
6191
|
]);
|
|
5994
|
-
var OperationResultSchema =
|
|
6192
|
+
var OperationResultSchema = z3.enum(["ok", "error", "refused", "timeout", "cancelled", "unavailable"]);
|
|
5995
6193
|
var operationShared = {
|
|
5996
6194
|
meta: HeaderMetaSchema,
|
|
5997
6195
|
subject: SubjectSchema,
|
|
5998
|
-
kind:
|
|
6196
|
+
kind: z3.literal("operation"),
|
|
5999
6197
|
...envelopeTail,
|
|
6000
|
-
operation:
|
|
6001
|
-
target:
|
|
6198
|
+
operation: z3.string(),
|
|
6199
|
+
target: z3.string().nullable()
|
|
6002
6200
|
};
|
|
6003
|
-
var OperationEventSchema =
|
|
6004
|
-
|
|
6201
|
+
var OperationEventSchema = z3.discriminatedUnion("event", [
|
|
6202
|
+
z3.object({
|
|
6005
6203
|
...operationShared,
|
|
6006
|
-
event:
|
|
6204
|
+
event: z3.literal("completed"),
|
|
6007
6205
|
result: OperationResultSchema,
|
|
6008
|
-
error_class:
|
|
6206
|
+
error_class: z3.string().nullable(),
|
|
6207
|
+
field_names: z3.array(z3.string().max(CUSTOM_FIELD_NAME_MAX_LENGTH)).max(CUSTOM_EVENT_MAX_FIELDS).optional()
|
|
6009
6208
|
}).strict()
|
|
6010
6209
|
]);
|
|
6011
|
-
var UsageUnitsSchema =
|
|
6012
|
-
input:
|
|
6013
|
-
output:
|
|
6014
|
-
cache:
|
|
6210
|
+
var UsageUnitsSchema = z3.object({
|
|
6211
|
+
input: z3.number().nonnegative().nullable(),
|
|
6212
|
+
output: z3.number().nonnegative().nullable(),
|
|
6213
|
+
cache: z3.number().nonnegative().nullable()
|
|
6015
6214
|
}).strict();
|
|
6016
6215
|
var usageShared = {
|
|
6017
6216
|
meta: HeaderMetaSchema,
|
|
6018
6217
|
subject: SubjectSchema,
|
|
6019
|
-
kind:
|
|
6218
|
+
kind: z3.literal("usage"),
|
|
6020
6219
|
...envelopeTail,
|
|
6021
|
-
model:
|
|
6022
|
-
source:
|
|
6023
|
-
semantics:
|
|
6220
|
+
model: z3.string().nullable(),
|
|
6221
|
+
source: z3.string(),
|
|
6222
|
+
semantics: z3.enum(["cumulative", "delta"])
|
|
6024
6223
|
};
|
|
6025
|
-
var UsageEventSchema =
|
|
6026
|
-
|
|
6224
|
+
var UsageEventSchema = z3.discriminatedUnion("event", [
|
|
6225
|
+
z3.object({
|
|
6027
6226
|
...usageShared,
|
|
6028
|
-
event:
|
|
6227
|
+
event: z3.literal("observed"),
|
|
6029
6228
|
units: UsageUnitsSchema,
|
|
6030
|
-
unknown_reason:
|
|
6229
|
+
unknown_reason: z3.string().nullable()
|
|
6031
6230
|
}).strict()
|
|
6032
6231
|
]);
|
|
6033
|
-
var RoleAttemptOutcomeSchema =
|
|
6232
|
+
var RoleAttemptOutcomeSchema = z3.enum([
|
|
6034
6233
|
"completed",
|
|
6035
6234
|
"incomplete",
|
|
6036
6235
|
"infrastructure_failed",
|
|
@@ -6041,17 +6240,17 @@ var RoleAttemptOutcomeSchema = z2.enum([
|
|
|
6041
6240
|
var roleAttemptShared = {
|
|
6042
6241
|
meta: HeaderMetaSchema,
|
|
6043
6242
|
subject: SubjectSchema,
|
|
6044
|
-
kind:
|
|
6243
|
+
kind: z3.literal("role_attempt"),
|
|
6045
6244
|
...envelopeTail,
|
|
6046
|
-
actor:
|
|
6047
|
-
attempt:
|
|
6048
|
-
effect_id:
|
|
6049
|
-
model:
|
|
6245
|
+
actor: z3.string().nullable(),
|
|
6246
|
+
attempt: z3.number().int().nullable(),
|
|
6247
|
+
effect_id: z3.string(),
|
|
6248
|
+
model: z3.string().nullable()
|
|
6050
6249
|
};
|
|
6051
|
-
var RoleAttemptEventSchema =
|
|
6052
|
-
|
|
6250
|
+
var RoleAttemptEventSchema = z3.discriminatedUnion("event", [
|
|
6251
|
+
z3.object({
|
|
6053
6252
|
...roleAttemptShared,
|
|
6054
|
-
event:
|
|
6253
|
+
event: z3.literal("attempted"),
|
|
6055
6254
|
outcome: RoleAttemptOutcomeSchema,
|
|
6056
6255
|
usage: dispatchUsageField
|
|
6057
6256
|
}).strict()
|
|
@@ -6059,42 +6258,59 @@ var RoleAttemptEventSchema = z2.discriminatedUnion("event", [
|
|
|
6059
6258
|
var handoffShared = {
|
|
6060
6259
|
meta: HeaderMetaSchema,
|
|
6061
6260
|
subject: SubjectSchema,
|
|
6062
|
-
kind:
|
|
6261
|
+
kind: z3.literal("handoff"),
|
|
6063
6262
|
...envelopeTail,
|
|
6064
|
-
class:
|
|
6065
|
-
reason:
|
|
6263
|
+
class: z3.enum(["authority", "strategy", "product"]),
|
|
6264
|
+
reason: z3.string()
|
|
6066
6265
|
};
|
|
6067
|
-
var HandoffEventSchema =
|
|
6068
|
-
|
|
6266
|
+
var HandoffEventSchema = z3.discriminatedUnion("event", [
|
|
6267
|
+
z3.object({
|
|
6069
6268
|
...handoffShared,
|
|
6070
|
-
event:
|
|
6071
|
-
requested_decision:
|
|
6269
|
+
event: z3.literal("raised"),
|
|
6270
|
+
requested_decision: z3.string().nullable()
|
|
6072
6271
|
}).strict(),
|
|
6073
|
-
|
|
6272
|
+
z3.object({
|
|
6074
6273
|
...handoffShared,
|
|
6075
|
-
event:
|
|
6076
|
-
resolution:
|
|
6077
|
-
resolved_by:
|
|
6274
|
+
event: z3.literal("resolved"),
|
|
6275
|
+
resolution: z3.string().nullable(),
|
|
6276
|
+
resolved_by: z3.string().nullable()
|
|
6078
6277
|
}).strict()
|
|
6079
6278
|
]);
|
|
6080
|
-
var EffectTargetSchema =
|
|
6081
|
-
kind:
|
|
6082
|
-
ref:
|
|
6279
|
+
var EffectTargetSchema = z3.object({
|
|
6280
|
+
kind: z3.string(),
|
|
6281
|
+
ref: z3.string()
|
|
6083
6282
|
}).strict();
|
|
6084
6283
|
var effectShared = {
|
|
6085
6284
|
meta: HeaderMetaSchema,
|
|
6086
6285
|
subject: SubjectSchema,
|
|
6087
|
-
kind:
|
|
6286
|
+
kind: z3.literal("effect"),
|
|
6088
6287
|
...envelopeTail,
|
|
6089
|
-
effect_id:
|
|
6288
|
+
effect_id: z3.string(),
|
|
6090
6289
|
target: EffectTargetSchema
|
|
6091
6290
|
};
|
|
6092
|
-
var EffectEventSchema =
|
|
6093
|
-
|
|
6094
|
-
|
|
6095
|
-
|
|
6291
|
+
var EffectEventSchema = z3.discriminatedUnion("event", [
|
|
6292
|
+
z3.object({ ...effectShared, event: z3.literal("attempted") }).strict(),
|
|
6293
|
+
z3.object({ ...effectShared, event: z3.literal("observed"), outcome: z3.enum(["success", "failure", "uncertain"]) }).strict(),
|
|
6294
|
+
z3.object({ ...effectShared, event: z3.literal("verified"), outcome: z3.enum(["success", "failure", "uncertain"]) }).strict()
|
|
6295
|
+
]);
|
|
6296
|
+
var CustomFieldValueSchema = z3.union([z3.string().max(CUSTOM_TEXT_MAX_LENGTH), z3.number().finite(), z3.boolean()]);
|
|
6297
|
+
var customShared = {
|
|
6298
|
+
meta: HeaderMetaV3Schema,
|
|
6299
|
+
subject: SubjectSchema,
|
|
6300
|
+
kind: z3.literal("custom"),
|
|
6301
|
+
...envelopeTail
|
|
6302
|
+
};
|
|
6303
|
+
var CustomEventSchema = z3.discriminatedUnion("event", [
|
|
6304
|
+
z3.object({
|
|
6305
|
+
...customShared,
|
|
6306
|
+
event: z3.literal("recorded"),
|
|
6307
|
+
name: z3.string().max(CUSTOM_EVENT_NAME_MAX_LENGTH).regex(CUSTOM_EVENT_NAME_PATTERN),
|
|
6308
|
+
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, {
|
|
6309
|
+
message: `custom: at most ${CUSTOM_EVENT_MAX_FIELDS} fields`
|
|
6310
|
+
})
|
|
6311
|
+
}).strict()
|
|
6096
6312
|
]);
|
|
6097
|
-
var LogEventSchema =
|
|
6313
|
+
var LogEventSchema = z3.union([
|
|
6098
6314
|
DispatchEventSchema,
|
|
6099
6315
|
DevReviewLoopEventSchema,
|
|
6100
6316
|
ForgeWriteEventSchema,
|
|
@@ -6103,10 +6319,11 @@ var LogEventSchema = z2.union([
|
|
|
6103
6319
|
UsageEventSchema,
|
|
6104
6320
|
RoleAttemptEventSchema,
|
|
6105
6321
|
HandoffEventSchema,
|
|
6106
|
-
EffectEventSchema
|
|
6322
|
+
EffectEventSchema,
|
|
6323
|
+
CustomEventSchema
|
|
6107
6324
|
]);
|
|
6108
|
-
|
|
6109
6325
|
// ../../packages/aeg-core/src/log/envelope.ts
|
|
6326
|
+
import { createHash as createHash5 } from "node:crypto";
|
|
6110
6327
|
function isRole(value) {
|
|
6111
6328
|
return value !== undefined && ROLE_VALUES.includes(value);
|
|
6112
6329
|
}
|
|
@@ -6143,18 +6360,27 @@ function roundFromEnv(round) {
|
|
|
6143
6360
|
const n = Number(round);
|
|
6144
6361
|
return Number.isInteger(n) ? n : undefined;
|
|
6145
6362
|
}
|
|
6363
|
+
function prFromEnv(pr) {
|
|
6364
|
+
if (pr === undefined || pr === "")
|
|
6365
|
+
return;
|
|
6366
|
+
const n = Number(pr);
|
|
6367
|
+
return Number.isInteger(n) && n > 0 ? n : undefined;
|
|
6368
|
+
}
|
|
6146
6369
|
function buildHeader(input) {
|
|
6147
6370
|
const role = isRole(input.env.role) ? input.env.role : "unattributed";
|
|
6148
6371
|
const round = roundFromEnv(input.env.round);
|
|
6372
|
+
const pr = prFromEnv(input.env.pr);
|
|
6149
6373
|
const subject = {
|
|
6150
6374
|
issue: issueFromTask(input.env.task) ?? input.branchIssue ?? null,
|
|
6151
6375
|
role,
|
|
6152
6376
|
...round !== undefined ? { round } : {},
|
|
6377
|
+
...pr !== undefined ? { pr } : {},
|
|
6153
6378
|
...input.subject ?? {}
|
|
6154
6379
|
};
|
|
6380
|
+
const issue = subject.issue;
|
|
6155
6381
|
return {
|
|
6156
6382
|
meta: {
|
|
6157
|
-
schema:
|
|
6383
|
+
schema: 3,
|
|
6158
6384
|
ts: input.now.toISOString(),
|
|
6159
6385
|
run_id: input.runId,
|
|
6160
6386
|
seq: input.seq,
|
|
@@ -6177,7 +6403,19 @@ function buildHeader(input) {
|
|
|
6177
6403
|
ruling_ordinal: input.inputVersions?.rulingOrdinal ?? null,
|
|
6178
6404
|
policy_digest: input.inputVersions?.policyDigest ?? null
|
|
6179
6405
|
},
|
|
6180
|
-
provenance: provenanceFor(input)
|
|
6406
|
+
provenance: provenanceFor(input),
|
|
6407
|
+
work: {
|
|
6408
|
+
ref: lineageFieldFromEnv(input.env.workRef) ?? (issue === null ? null : String(issue)),
|
|
6409
|
+
repo: input.repo,
|
|
6410
|
+
change: null,
|
|
6411
|
+
revision: null
|
|
6412
|
+
},
|
|
6413
|
+
flow: {
|
|
6414
|
+
id: lineageFieldFromEnv(input.env.flow) ?? "vinaya",
|
|
6415
|
+
version: lineageFieldFromEnv(input.env.flowVersion)
|
|
6416
|
+
},
|
|
6417
|
+
runtime: lineageFieldFromEnv(input.env.runtime),
|
|
6418
|
+
source: lineageFieldFromEnv(input.env.source)
|
|
6181
6419
|
},
|
|
6182
6420
|
subject
|
|
6183
6421
|
};
|
|
@@ -6220,7 +6458,7 @@ function redact(value, home) {
|
|
|
6220
6458
|
return value;
|
|
6221
6459
|
}
|
|
6222
6460
|
// ../../packages/aeg-core/src/log/store.ts
|
|
6223
|
-
var KNOWN_SCHEMA_VERSIONS = [1, 2];
|
|
6461
|
+
var KNOWN_SCHEMA_VERSIONS = [1, 2, 3];
|
|
6224
6462
|
function metaOf(obj) {
|
|
6225
6463
|
if (obj === null || typeof obj !== "object")
|
|
6226
6464
|
return null;
|
|
@@ -6286,7 +6524,7 @@ function classifyStoredLine(raw, home) {
|
|
|
6286
6524
|
return { status: "invalid", identity: null, raw, reason: "valid event with no derivable identity" };
|
|
6287
6525
|
}
|
|
6288
6526
|
const redacted = redact(event, home);
|
|
6289
|
-
const provenance = version
|
|
6527
|
+
const provenance = version >= 2 ? event.meta.provenance ?? null : null;
|
|
6290
6528
|
return {
|
|
6291
6529
|
status: "ok",
|
|
6292
6530
|
identity,
|
|
@@ -6299,138 +6537,143 @@ function classifyStoredLine(raw, home) {
|
|
|
6299
6537
|
};
|
|
6300
6538
|
}
|
|
6301
6539
|
// ../../packages/aeg-core/src/control-store/records.ts
|
|
6302
|
-
import { z as
|
|
6303
|
-
var isoTimestamp =
|
|
6304
|
-
var taskId =
|
|
6305
|
-
var epochNumber =
|
|
6306
|
-
var RunRecordSchema =
|
|
6307
|
-
version:
|
|
6308
|
-
kind:
|
|
6540
|
+
import { z as z4 } from "zod";
|
|
6541
|
+
var isoTimestamp = z4.string().min(1);
|
|
6542
|
+
var taskId = z4.number().int().positive();
|
|
6543
|
+
var epochNumber = z4.number().int().nonnegative();
|
|
6544
|
+
var RunRecordSchema = z4.object({
|
|
6545
|
+
version: z4.literal(1),
|
|
6546
|
+
kind: z4.literal("run"),
|
|
6309
6547
|
task: taskId,
|
|
6310
|
-
runId:
|
|
6311
|
-
pid:
|
|
6312
|
-
host:
|
|
6548
|
+
runId: z4.string().min(1),
|
|
6549
|
+
pid: z4.number().int().positive(),
|
|
6550
|
+
host: z4.string().min(1),
|
|
6313
6551
|
startedAt: isoTimestamp,
|
|
6314
|
-
childStartedAt:
|
|
6315
|
-
childCommand:
|
|
6552
|
+
childStartedAt: z4.string().min(1).nullable().optional(),
|
|
6553
|
+
childCommand: z4.string().min(1).nullable().optional()
|
|
6316
6554
|
}).strict();
|
|
6317
|
-
var InputRecordSchema =
|
|
6318
|
-
version:
|
|
6319
|
-
kind:
|
|
6555
|
+
var InputRecordSchema = z4.object({
|
|
6556
|
+
version: z4.literal(1),
|
|
6557
|
+
kind: z4.literal("input"),
|
|
6320
6558
|
task: taskId,
|
|
6321
|
-
runId:
|
|
6322
|
-
source:
|
|
6323
|
-
pr:
|
|
6324
|
-
round:
|
|
6559
|
+
runId: z4.string().min(1),
|
|
6560
|
+
source: z4.union([z4.literal("fresh"), z4.literal("resume")]),
|
|
6561
|
+
pr: z4.number().int().positive().nullable(),
|
|
6562
|
+
round: z4.number().int().nonnegative(),
|
|
6325
6563
|
recordedAt: isoTimestamp
|
|
6326
6564
|
}).strict();
|
|
6327
|
-
var OwnershipRecordSchema =
|
|
6328
|
-
version:
|
|
6329
|
-
kind:
|
|
6565
|
+
var OwnershipRecordSchema = z4.object({
|
|
6566
|
+
version: z4.literal(1),
|
|
6567
|
+
kind: z4.literal("ownership"),
|
|
6330
6568
|
task: taskId,
|
|
6331
6569
|
epoch: epochNumber,
|
|
6332
|
-
ownerId:
|
|
6333
|
-
pid:
|
|
6334
|
-
host:
|
|
6570
|
+
ownerId: z4.string().min(1),
|
|
6571
|
+
pid: z4.number().int().positive(),
|
|
6572
|
+
host: z4.string().min(1),
|
|
6335
6573
|
acquiredAt: isoTimestamp
|
|
6336
6574
|
}).strict();
|
|
6337
|
-
var TransitionRecordSchema =
|
|
6338
|
-
version:
|
|
6339
|
-
kind:
|
|
6575
|
+
var TransitionRecordSchema = z4.object({
|
|
6576
|
+
version: z4.literal(1),
|
|
6577
|
+
kind: z4.literal("transition"),
|
|
6340
6578
|
task: taskId,
|
|
6341
6579
|
epoch: epochNumber,
|
|
6342
|
-
seq:
|
|
6343
|
-
from:
|
|
6344
|
-
to:
|
|
6345
|
-
detail:
|
|
6580
|
+
seq: z4.number().int().nonnegative(),
|
|
6581
|
+
from: z4.string().min(1),
|
|
6582
|
+
to: z4.string().min(1),
|
|
6583
|
+
detail: z4.string().optional(),
|
|
6346
6584
|
at: isoTimestamp
|
|
6347
6585
|
}).strict();
|
|
6348
|
-
var ManifestRecordSchema =
|
|
6349
|
-
version:
|
|
6350
|
-
kind:
|
|
6586
|
+
var ManifestRecordSchema = z4.object({
|
|
6587
|
+
version: z4.literal(1),
|
|
6588
|
+
kind: z4.literal("manifest"),
|
|
6351
6589
|
task: taskId,
|
|
6352
6590
|
round: epochNumber,
|
|
6353
|
-
repository:
|
|
6354
|
-
pr:
|
|
6355
|
-
branch:
|
|
6356
|
-
baseSha:
|
|
6357
|
-
headSha:
|
|
6358
|
-
briefHash:
|
|
6359
|
-
objectivesVersion:
|
|
6591
|
+
repository: z4.string().min(1),
|
|
6592
|
+
pr: z4.number().int().positive(),
|
|
6593
|
+
branch: z4.string().min(1),
|
|
6594
|
+
baseSha: z4.string().min(1).nullable(),
|
|
6595
|
+
headSha: z4.string().min(1),
|
|
6596
|
+
briefHash: z4.string().min(1).nullable(),
|
|
6597
|
+
objectivesVersion: z4.string().min(1).nullable(),
|
|
6360
6598
|
rulingOrdinal: epochNumber,
|
|
6361
|
-
policyDigest:
|
|
6599
|
+
policyDigest: z4.string().min(1),
|
|
6362
6600
|
recordedAt: isoTimestamp
|
|
6363
6601
|
}).strict();
|
|
6364
|
-
var roundHeadIdentity =
|
|
6365
|
-
var LoopBudgetsSchema =
|
|
6366
|
-
mechanicalRetries:
|
|
6367
|
-
reviewRounds:
|
|
6368
|
-
infrastructureRetries:
|
|
6602
|
+
var roundHeadIdentity = z4.object({ round: z4.number().int().positive(), head: z4.string().min(1) }).strict();
|
|
6603
|
+
var LoopBudgetsSchema = z4.object({
|
|
6604
|
+
mechanicalRetries: z4.number().int().nonnegative(),
|
|
6605
|
+
reviewRounds: z4.number().int().nonnegative(),
|
|
6606
|
+
infrastructureRetries: z4.number().int().nonnegative()
|
|
6369
6607
|
}).strict();
|
|
6370
|
-
var LoopStateRecordSchema =
|
|
6371
|
-
version:
|
|
6372
|
-
kind:
|
|
6608
|
+
var LoopStateRecordSchema = z4.object({
|
|
6609
|
+
version: z4.literal(1),
|
|
6610
|
+
kind: z4.literal("loop_state"),
|
|
6373
6611
|
task: taskId,
|
|
6374
|
-
round:
|
|
6375
|
-
phase:
|
|
6376
|
-
pauseReason:
|
|
6612
|
+
round: z4.number().int().positive(),
|
|
6613
|
+
phase: z4.string().min(1),
|
|
6614
|
+
pauseReason: z4.string().min(1).nullable(),
|
|
6377
6615
|
budgets: LoopBudgetsSchema,
|
|
6378
6616
|
heldResult: roundHeadIdentity.nullable(),
|
|
6379
6617
|
deliveredFindings: roundHeadIdentity.nullable(),
|
|
6380
|
-
repeatMemory:
|
|
6381
|
-
blockingFindings:
|
|
6382
|
-
lastFailure:
|
|
6618
|
+
repeatMemory: z4.object({
|
|
6619
|
+
blockingFindings: z4.array(z4.string()),
|
|
6620
|
+
lastFailure: z4.object({ signature: z4.string(), message: z4.string() }).nullable()
|
|
6383
6621
|
}).strict().optional(),
|
|
6622
|
+
publicationExpectedBase: z4.string().regex(/^[0-9a-f]{40}$/).nullable().optional(),
|
|
6623
|
+
taskStartedAt: isoTimestamp.optional(),
|
|
6624
|
+
phaseMs: z4.record(z4.string(), z4.number().nonnegative()).optional(),
|
|
6384
6625
|
recordedAt: isoTimestamp
|
|
6385
6626
|
}).strict();
|
|
6386
|
-
var EffectRecordSchema =
|
|
6387
|
-
version:
|
|
6388
|
-
kind:
|
|
6627
|
+
var EffectRecordSchema = z4.object({
|
|
6628
|
+
version: z4.literal(1),
|
|
6629
|
+
kind: z4.literal("effect"),
|
|
6389
6630
|
task: taskId,
|
|
6390
|
-
key:
|
|
6391
|
-
operation:
|
|
6392
|
-
target:
|
|
6393
|
-
inputVersion:
|
|
6394
|
-
payloadDigest:
|
|
6395
|
-
status:
|
|
6396
|
-
url:
|
|
6631
|
+
key: z4.string().min(1),
|
|
6632
|
+
operation: z4.string().min(1),
|
|
6633
|
+
target: z4.string().min(1),
|
|
6634
|
+
inputVersion: z4.number().int().nonnegative(),
|
|
6635
|
+
payloadDigest: z4.string().min(1),
|
|
6636
|
+
status: z4.union([z4.literal("started"), z4.literal("verified"), z4.literal("uncertain")]),
|
|
6637
|
+
url: z4.string().optional(),
|
|
6397
6638
|
recordedAt: isoTimestamp
|
|
6398
6639
|
}).strict();
|
|
6399
|
-
var EscalationRecordSchema =
|
|
6400
|
-
version:
|
|
6401
|
-
kind:
|
|
6640
|
+
var EscalationRecordSchema = z4.object({
|
|
6641
|
+
version: z4.literal(1),
|
|
6642
|
+
kind: z4.literal("escalation"),
|
|
6402
6643
|
task: taskId,
|
|
6403
|
-
escalationId:
|
|
6644
|
+
escalationId: z4.string().min(1),
|
|
6404
6645
|
round: epochNumber,
|
|
6405
|
-
head:
|
|
6406
|
-
branch:
|
|
6407
|
-
pr:
|
|
6408
|
-
runId:
|
|
6409
|
-
pid:
|
|
6410
|
-
host:
|
|
6411
|
-
agent:
|
|
6412
|
-
reason:
|
|
6413
|
-
detail:
|
|
6414
|
-
evidence:
|
|
6415
|
-
attemptedRecovery:
|
|
6416
|
-
requestedDecision:
|
|
6417
|
-
recipient:
|
|
6418
|
-
briefHash:
|
|
6419
|
-
objectivesVersion:
|
|
6646
|
+
head: z4.string().min(1),
|
|
6647
|
+
branch: z4.string().min(1),
|
|
6648
|
+
pr: z4.number().int().positive().nullable(),
|
|
6649
|
+
runId: z4.string().min(1),
|
|
6650
|
+
pid: z4.number().int().positive(),
|
|
6651
|
+
host: z4.string().min(1),
|
|
6652
|
+
agent: z4.string().min(1).optional(),
|
|
6653
|
+
reason: z4.string().min(1),
|
|
6654
|
+
detail: z4.string().optional(),
|
|
6655
|
+
evidence: z4.string().optional(),
|
|
6656
|
+
attemptedRecovery: z4.string().min(1),
|
|
6657
|
+
requestedDecision: z4.string().min(1),
|
|
6658
|
+
recipient: z4.string().min(1),
|
|
6659
|
+
briefHash: z4.string().min(1).nullable(),
|
|
6660
|
+
objectivesVersion: z4.string().min(1).nullable(),
|
|
6420
6661
|
rulingOrdinal: epochNumber,
|
|
6421
|
-
policyDigest:
|
|
6662
|
+
policyDigest: z4.string().min(1),
|
|
6422
6663
|
recordedAt: isoTimestamp
|
|
6423
6664
|
}).strict();
|
|
6424
|
-
var ResolutionRecordSchema =
|
|
6425
|
-
version:
|
|
6426
|
-
kind:
|
|
6665
|
+
var ResolutionRecordSchema = z4.object({
|
|
6666
|
+
version: z4.literal(1),
|
|
6667
|
+
kind: z4.literal("resolution"),
|
|
6427
6668
|
task: taskId,
|
|
6428
|
-
escalationId:
|
|
6429
|
-
decision:
|
|
6430
|
-
authenticatedBy:
|
|
6431
|
-
authenticatedFrom:
|
|
6669
|
+
escalationId: z4.string().min(1),
|
|
6670
|
+
decision: z4.union([z4.literal("resume"), z4.literal("cancel")]),
|
|
6671
|
+
authenticatedBy: z4.string().min(1),
|
|
6672
|
+
authenticatedFrom: z4.string().min(1),
|
|
6432
6673
|
consumedAt: isoTimestamp
|
|
6433
6674
|
}).strict();
|
|
6675
|
+
// ../../packages/aeg-core/src/control-store/local.ts
|
|
6676
|
+
var CONTROL_AREA_DIRNAME = "control";
|
|
6434
6677
|
// src/checks/contract.ts
|
|
6435
6678
|
var CHECK_SCHEMA_VERSION = 1;
|
|
6436
6679
|
function emitCheckError(error) {
|
|
@@ -6457,7 +6700,7 @@ function readIssueCheckEnv(env = process.env) {
|
|
|
6457
6700
|
}
|
|
6458
6701
|
|
|
6459
6702
|
// src/lib/brief-assembly.ts
|
|
6460
|
-
import { execFileSync as
|
|
6703
|
+
import { execFileSync as execFileSync5 } from "node:child_process";
|
|
6461
6704
|
import { existsSync as existsSync4, readFileSync as readFileSync4, readdirSync as readdirSync2 } from "node:fs";
|
|
6462
6705
|
import { join as join4 } from "node:path";
|
|
6463
6706
|
|
|
@@ -6609,20 +6852,31 @@ var COMMANDS = [
|
|
|
6609
6852
|
{
|
|
6610
6853
|
flag: "--agent <claude|codex|gemini>",
|
|
6611
6854
|
description: "Vendor for the developer and both reviewers this run dispatches"
|
|
6855
|
+
},
|
|
6856
|
+
{
|
|
6857
|
+
flag: "--quiet",
|
|
6858
|
+
description: "Hide the detail lines (an agent's prose, full commands, failed-result tails) on the live terminal; the driver log file keeps them"
|
|
6612
6859
|
}
|
|
6613
6860
|
],
|
|
6614
6861
|
details: [
|
|
6615
6862
|
"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.",
|
|
6616
6863
|
"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.",
|
|
6617
6864
|
"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.",
|
|
6618
|
-
"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
|
|
6865
|
+
"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`)."
|
|
6619
6866
|
],
|
|
6620
6867
|
status: "shipped"
|
|
6621
6868
|
},
|
|
6622
6869
|
{
|
|
6623
6870
|
name: "task status",
|
|
6624
6871
|
description: "Every open task with a frozen brief, its pull request, and whether its loop is running, paused, or published",
|
|
6625
|
-
flags: [
|
|
6872
|
+
flags: [
|
|
6873
|
+
{ flag: "--json", description: "Enveloped JSON output (schema: 1)" },
|
|
6874
|
+
{
|
|
6875
|
+
flag: "--follow",
|
|
6876
|
+
description: "Tail the task's driver log live, with its detail lines, on either the `<tranche> <n>` form or `--issue <n>`"
|
|
6877
|
+
},
|
|
6878
|
+
{ flag: "--quiet", description: "With `--follow`, hide the detail lines; the log file is unchanged" }
|
|
6879
|
+
],
|
|
6626
6880
|
details: [
|
|
6627
6881
|
"Read-only: one `gh issue list` for every open task Issue across every tranche (title/label resolved through the same `resolveTaskIssueRef` `list-tasks.ts` already uses), the open pull request per branch, and the driver pid record / pause record / publish effect markers under `<outboxRoot>/dev-review-loop/<task>/` — never a `ps` scan, never a re-parse of posted verdict comments to decide `published`.",
|
|
6628
6882
|
"`running` names the driver's pid (`review-validity-v1` task 7's pid record); `paused` names the reason from the pause record; `published` means the newest round's reviewer and security verdict effect markers both read `posted`; `no driver` is the fallback when none of the above holds.",
|
|
@@ -6658,6 +6912,26 @@ var COMMANDS = [
|
|
|
6658
6912
|
],
|
|
6659
6913
|
status: "shipped"
|
|
6660
6914
|
},
|
|
6915
|
+
{
|
|
6916
|
+
name: "task-tools result-proof",
|
|
6917
|
+
description: "Prove, live on this host, that a CLI delivers the Developer's turn result as its own structured final output",
|
|
6918
|
+
flags: [{ flag: "--agent <claude|codex>", description: "The CLI to prove" }],
|
|
6919
|
+
details: [
|
|
6920
|
+
"Runs real Developer-shaped dispatches on this host — the driver-run dev-tools registered and called, the agent's own sandbox where the host supports it, the subscription login, and the dispatch's own argv — and asks for the versioned `DeveloperTurnResult` (`completed`, `blocked` or `needs_ruling`) through the CLI's native structured output: Claude Code `--json-schema` under `--output-format stream-json`, with the dispatch's Stop hook plus one that rejects the first stop; Codex `--output-schema` under `exec --json` and `exec resume --json`.",
|
|
6921
|
+
"Cases: a first and a resumed session (the same provider session, a fresh result, exactly one accepted); a schema-valid but semantically invalid result (an unknown finding id, a ruling request naming no permissible decision), which the driver rejects; malformed output, which never reaches the driver; and a cancelled run, a provider error and context exhaustion, each ending with no accepted result. Each case prints whether a schema-valid result reached the driver, the result, and the event it was read from; exits 1 when any case fails. Never publishes, opens a pull request or writes the forge."
|
|
6922
|
+
],
|
|
6923
|
+
status: "shipped"
|
|
6924
|
+
},
|
|
6925
|
+
{
|
|
6926
|
+
name: "task-tools review-result-proof",
|
|
6927
|
+
description: "Prove, live on this host, that a CLI delivers a reviewer's result as its own structured final output, concurrent and fresh",
|
|
6928
|
+
flags: [{ flag: "--agent <claude|codex>", description: "The CLI to prove" }],
|
|
6929
|
+
details: [
|
|
6930
|
+
"Runs real reviewer-shaped dispatches on this host — fresh, non-resumed sessions, the agent's own sandbox where the host supports it, the subscription login, read-only grants, and the staged diff and review-input manifest — and asks for the versioned `ReviewResult` (`completed` or `blocked`, bound to the controller's role, head and manifest digest) through the CLI's native structured output: Claude Code `--json-schema` under `--output-format stream-json`; Codex `--output-schema` under `exec --json`. Both the code-reviewer and the security-reviewer role run, concurrently against one manifest, each accepted result attributed to its own role.",
|
|
6931
|
+
"Cases: a role mismatch, a wrong head and a wrong manifest digest; an objective id outside the brief, a severity outside the role's scale and a finding without a file (all refused) and a finding without a line (accepted); and a blocked, malformed, missing, cancelled, provider-error and context-exhausted outcome, each recorded as no review, never approval. Each case prints whether a schema-valid result reached the driver and what the controller made of it; exits 1 when any case fails. Never writes the forge and leaves the loop's reviewer dispatch and result files untouched."
|
|
6932
|
+
],
|
|
6933
|
+
status: "shipped"
|
|
6934
|
+
},
|
|
6661
6935
|
{
|
|
6662
6936
|
name: "pr create",
|
|
6663
6937
|
description: "Open a pull request after full brief-schema validation",
|
|
@@ -6700,13 +6974,14 @@ var COMMANDS = [
|
|
|
6700
6974
|
},
|
|
6701
6975
|
{
|
|
6702
6976
|
flag: "--push",
|
|
6703
|
-
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
|
|
6977
|
+
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."
|
|
6704
6978
|
}
|
|
6705
6979
|
],
|
|
6706
6980
|
details: [
|
|
6707
6981
|
"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.",
|
|
6708
6982
|
"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.",
|
|
6709
|
-
"`--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.
|
|
6983
|
+
"`--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.",
|
|
6984
|
+
"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."
|
|
6710
6985
|
],
|
|
6711
6986
|
status: "shipped"
|
|
6712
6987
|
},
|
|
@@ -6731,7 +7006,7 @@ var COMMANDS = [
|
|
|
6731
7006
|
"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.",
|
|
6732
7007
|
"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.",
|
|
6733
7008
|
"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.",
|
|
6734
|
-
"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
|
|
7009
|
+
"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."
|
|
6735
7010
|
],
|
|
6736
7011
|
status: "shipped"
|
|
6737
7012
|
},
|
|
@@ -6902,7 +7177,7 @@ var COMMANDS = [
|
|
|
6902
7177
|
{ flag: "--secrets", description: "security only: the SECRETS line" },
|
|
6903
7178
|
{
|
|
6904
7179
|
flag: "--secrets-evidence-file",
|
|
6905
|
-
description: 'security only: required whenever `--secrets` claims "none found" — the
|
|
7180
|
+
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'
|
|
6906
7181
|
},
|
|
6907
7182
|
{ flag: "--task-id", description: "the closing `Tokens:` line's task id" },
|
|
6908
7183
|
{ flag: "--model", description: "the closing `Tokens:` line's model name" },
|
|
@@ -7010,7 +7285,20 @@ var COMMANDS = [
|
|
|
7010
7285
|
flags: [{ flag: "--yes", description: "Skip the confirmation prompt" }],
|
|
7011
7286
|
details: [
|
|
7012
7287
|
"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.",
|
|
7013
|
-
"Once every task Issue is closed, prompts for confirmation (unless `--yes`) and closes
|
|
7288
|
+
"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.",
|
|
7289
|
+
"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.",
|
|
7290
|
+
"Idempotent: on a tranche whose Milestone is already closed and carries its retrospective, changes nothing and says it is already archived.",
|
|
7291
|
+
"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."
|
|
7292
|
+
],
|
|
7293
|
+
status: "shipped"
|
|
7294
|
+
},
|
|
7295
|
+
{
|
|
7296
|
+
name: "archive tranches",
|
|
7297
|
+
description: "Archive every finished tranche that has no closed Milestone carrying its retrospective",
|
|
7298
|
+
flags: [{ flag: "--yes", description: "Skip the confirmation prompt" }],
|
|
7299
|
+
details: [
|
|
7300
|
+
"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.",
|
|
7301
|
+
"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."
|
|
7014
7302
|
],
|
|
7015
7303
|
status: "shipped"
|
|
7016
7304
|
},
|
|
@@ -7154,6 +7442,29 @@ var COMMANDS = [
|
|
|
7154
7442
|
],
|
|
7155
7443
|
status: "shipped"
|
|
7156
7444
|
},
|
|
7445
|
+
{
|
|
7446
|
+
name: "log selftest",
|
|
7447
|
+
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)",
|
|
7448
|
+
details: [
|
|
7449
|
+
"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.",
|
|
7450
|
+
"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.",
|
|
7451
|
+
"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."
|
|
7452
|
+
],
|
|
7453
|
+
status: "shipped"
|
|
7454
|
+
},
|
|
7455
|
+
{
|
|
7456
|
+
name: "log emit",
|
|
7457
|
+
description: "Record a consumer-declared event (`logs.events` in vinaya.config.json) from a script or agent outside Vinaya",
|
|
7458
|
+
flags: [
|
|
7459
|
+
{ flag: "--json '<json>'", description: "The field values as one JSON object (else read from standard input)" }
|
|
7460
|
+
],
|
|
7461
|
+
details: [
|
|
7462
|
+
"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.",
|
|
7463
|
+
"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.",
|
|
7464
|
+
"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)."
|
|
7465
|
+
],
|
|
7466
|
+
status: "shipped"
|
|
7467
|
+
},
|
|
7157
7468
|
{
|
|
7158
7469
|
name: "log send",
|
|
7159
7470
|
description: "Deliver this repository's locally-held log events to the configured `logs.url` server, once",
|
|
@@ -7166,12 +7477,19 @@ var COMMANDS = [
|
|
|
7166
7477
|
status: "shipped"
|
|
7167
7478
|
},
|
|
7168
7479
|
{
|
|
7169
|
-
name: "
|
|
7170
|
-
description: "
|
|
7480
|
+
name: "sync",
|
|
7481
|
+
description: "Fill, resume and rebuild the local log cache from this repository's configured destination (read-only)",
|
|
7482
|
+
flags: [
|
|
7483
|
+
{
|
|
7484
|
+
flag: "--rebuild",
|
|
7485
|
+
description: "Delete the cache file and sync from the beginning of what the destination still retains"
|
|
7486
|
+
},
|
|
7487
|
+
{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }
|
|
7488
|
+
],
|
|
7171
7489
|
details: [
|
|
7172
|
-
|
|
7173
|
-
|
|
7174
|
-
"
|
|
7490
|
+
"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.",
|
|
7491
|
+
"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.",
|
|
7492
|
+
"`--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."
|
|
7175
7493
|
],
|
|
7176
7494
|
status: "shipped"
|
|
7177
7495
|
}
|
|
@@ -7185,10 +7503,10 @@ function createForgeSource(config) {
|
|
|
7185
7503
|
};
|
|
7186
7504
|
}
|
|
7187
7505
|
// ../../packages/sources/src/select-source.ts
|
|
7188
|
-
import { z as
|
|
7189
|
-
var StateSourceConfigSchema =
|
|
7190
|
-
|
|
7191
|
-
|
|
7506
|
+
import { z as z5 } from "zod";
|
|
7507
|
+
var StateSourceConfigSchema = z5.discriminatedUnion("kind", [
|
|
7508
|
+
z5.object({ kind: z5.literal("forge"), owner: z5.string(), repo: z5.string() }),
|
|
7509
|
+
z5.object({ kind: z5.literal("file"), root: z5.string().optional() })
|
|
7192
7510
|
]);
|
|
7193
7511
|
// src/checks/edge-resolve.ts
|
|
7194
7512
|
import { execFileSync as execFileSync2 } from "node:child_process";
|
|
@@ -7309,56 +7627,34 @@ async function resolveEdge(id, taskById, factsByTaskId, repo, resolveSibling = d
|
|
|
7309
7627
|
}
|
|
7310
7628
|
|
|
7311
7629
|
// src/lib/config.ts
|
|
7312
|
-
import { execFile as execFile4, execFileSync as
|
|
7630
|
+
import { execFile as execFile4, execFileSync as execFileSync3 } from "node:child_process";
|
|
7313
7631
|
import { promisify as promisify4 } from "node:util";
|
|
7314
7632
|
import { existsSync, mkdirSync, readFileSync as readFileSync2, realpathSync, writeFileSync } from "node:fs";
|
|
7315
7633
|
import { homedir } from "node:os";
|
|
7316
7634
|
import { dirname, isAbsolute, join, resolve } from "node:path";
|
|
7317
|
-
import { z as
|
|
7635
|
+
import { z as z6 } from "zod";
|
|
7318
7636
|
|
|
7319
7637
|
// src/lib/agent-vendors.ts
|
|
7320
7638
|
var AGENT_VENDORS = ["skills", "claude", "gemini"];
|
|
7321
7639
|
|
|
7322
|
-
// src/lib/worker-boundary.ts
|
|
7323
|
-
import { execFileSync as execFileSync3 } from "node:child_process";
|
|
7324
|
-
var LOG_HEADER_KEYCHAIN_SERVICE = "Vinaya Log";
|
|
7325
|
-
var logHeaderKeychainCache = new Map;
|
|
7326
|
-
function readRealLogHeaderKeychainCredential(variable) {
|
|
7327
|
-
if (process.platform !== "darwin")
|
|
7328
|
-
return null;
|
|
7329
|
-
try {
|
|
7330
|
-
return execFileSync3("/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$/, "");
|
|
7331
|
-
} catch {
|
|
7332
|
-
return null;
|
|
7333
|
-
}
|
|
7334
|
-
}
|
|
7335
|
-
function readLogHeaderKeychainCredential(variable) {
|
|
7336
|
-
const cached = logHeaderKeychainCache.get(variable);
|
|
7337
|
-
if (cached !== undefined)
|
|
7338
|
-
return cached;
|
|
7339
|
-
const value = readRealLogHeaderKeychainCredential(variable);
|
|
7340
|
-
logHeaderKeychainCache.set(variable, value);
|
|
7341
|
-
return value;
|
|
7342
|
-
}
|
|
7343
|
-
|
|
7344
7640
|
// src/lib/config.ts
|
|
7345
|
-
var EnvEntrySchema =
|
|
7346
|
-
|
|
7347
|
-
|
|
7348
|
-
|
|
7349
|
-
|
|
7641
|
+
var EnvEntrySchema = z6.union([
|
|
7642
|
+
z6.literal(true),
|
|
7643
|
+
z6.object({ optional: z6.literal(true) }),
|
|
7644
|
+
z6.object({ anyOf: z6.array(z6.string()).min(2) }),
|
|
7645
|
+
z6.string()
|
|
7350
7646
|
]);
|
|
7351
|
-
var CheckEntrySchema =
|
|
7352
|
-
run:
|
|
7353
|
-
scope:
|
|
7354
|
-
include:
|
|
7355
|
-
args:
|
|
7356
|
-
timeoutMs:
|
|
7357
|
-
env:
|
|
7358
|
-
requiresOpenPr:
|
|
7359
|
-
ownWorkflow:
|
|
7360
|
-
principalOwed:
|
|
7361
|
-
validates:
|
|
7647
|
+
var CheckEntrySchema = z6.object({
|
|
7648
|
+
run: z6.string(),
|
|
7649
|
+
scope: z6.enum(["diff", "full"]),
|
|
7650
|
+
include: z6.array(z6.string()).optional(),
|
|
7651
|
+
args: z6.array(z6.string()).optional(),
|
|
7652
|
+
timeoutMs: z6.number().optional(),
|
|
7653
|
+
env: z6.record(z6.string(), EnvEntrySchema).optional(),
|
|
7654
|
+
requiresOpenPr: z6.boolean().optional(),
|
|
7655
|
+
ownWorkflow: z6.boolean().optional(),
|
|
7656
|
+
principalOwed: z6.literal(true).optional(),
|
|
7657
|
+
validates: z6.enum(["body", "issue"]).optional()
|
|
7362
7658
|
}).superRefine((entry, ctx) => {
|
|
7363
7659
|
if (!entry.env)
|
|
7364
7660
|
return;
|
|
@@ -7368,22 +7664,22 @@ var CheckEntrySchema = z5.object({
|
|
|
7368
7664
|
const members = value.anyOf;
|
|
7369
7665
|
if (new Set(members).size !== members.length) {
|
|
7370
7666
|
ctx.addIssue({
|
|
7371
|
-
code:
|
|
7667
|
+
code: z6.ZodIssueCode.custom,
|
|
7372
7668
|
message: `env.${key}.anyOf has duplicate members`,
|
|
7373
7669
|
path: ["env", key, "anyOf"]
|
|
7374
7670
|
});
|
|
7375
7671
|
}
|
|
7376
7672
|
if (!members.includes(key)) {
|
|
7377
7673
|
ctx.addIssue({
|
|
7378
|
-
code:
|
|
7674
|
+
code: z6.ZodIssueCode.custom,
|
|
7379
7675
|
message: `env.${key}.anyOf must include "${key}" itself as a member`,
|
|
7380
7676
|
path: ["env", key, "anyOf"]
|
|
7381
7677
|
});
|
|
7382
7678
|
}
|
|
7383
7679
|
}
|
|
7384
7680
|
});
|
|
7385
|
-
var RoleEntrySchema =
|
|
7386
|
-
contract:
|
|
7681
|
+
var RoleEntrySchema = z6.object({
|
|
7682
|
+
contract: z6.string().refine((p) => p.includes("/"), {
|
|
7387
7683
|
message: 'must be a path (contain at least one "/"), not a bare filename'
|
|
7388
7684
|
})
|
|
7389
7685
|
});
|
|
@@ -7407,17 +7703,17 @@ var BRIEF_BUILTINS = [
|
|
|
7407
7703
|
"briefSections",
|
|
7408
7704
|
"milestoneShape"
|
|
7409
7705
|
];
|
|
7410
|
-
var BriefSectionSchema =
|
|
7411
|
-
|
|
7412
|
-
|
|
7413
|
-
|
|
7414
|
-
|
|
7706
|
+
var BriefSectionSchema = z6.union([
|
|
7707
|
+
z6.object({ builtin: z6.enum(BRIEF_BUILTINS) }),
|
|
7708
|
+
z6.object({ heading: z6.string().min(1), name: z6.string().optional() }),
|
|
7709
|
+
z6.object({ field: z6.string().min(1), name: z6.string().optional() }),
|
|
7710
|
+
z6.object({ phrase: z6.string().min(1), name: z6.string().optional() })
|
|
7415
7711
|
]);
|
|
7416
|
-
var BriefSchemaSchema =
|
|
7417
|
-
pr:
|
|
7418
|
-
issue:
|
|
7419
|
-
milestone:
|
|
7420
|
-
ack:
|
|
7712
|
+
var BriefSchemaSchema = z6.object({
|
|
7713
|
+
pr: z6.object({ sections: z6.array(BriefSectionSchema) }).optional(),
|
|
7714
|
+
issue: z6.object({ sections: z6.array(BriefSectionSchema) }).optional(),
|
|
7715
|
+
milestone: z6.object({ sections: z6.array(BriefSectionSchema) }).optional(),
|
|
7716
|
+
ack: z6.array(z6.enum(BRIEF_BUILTINS)).optional()
|
|
7421
7717
|
});
|
|
7422
7718
|
function isSafeRepoRelPath(p) {
|
|
7423
7719
|
if (p.length === 0)
|
|
@@ -7426,7 +7722,7 @@ function isSafeRepoRelPath(p) {
|
|
|
7426
7722
|
return false;
|
|
7427
7723
|
return p.split(/[\\/]/).every((seg) => seg !== ".." && seg !== "");
|
|
7428
7724
|
}
|
|
7429
|
-
var SafeRepoRelPath =
|
|
7725
|
+
var SafeRepoRelPath = z6.string().refine(isSafeRepoRelPath, {
|
|
7430
7726
|
message: "must be a repo-root-relative path with no `..` segment or absolute root"
|
|
7431
7727
|
});
|
|
7432
7728
|
var CANONICAL_HOOK_BLOCK_PREFIXES = [".git/", ".husky/", ".vinaya/hooks/", ".claude/hooks/"];
|
|
@@ -7436,22 +7732,22 @@ function isCanonicalHookBlockPath(p) {
|
|
|
7436
7732
|
var ManagedHookBlockPath = SafeRepoRelPath.refine(isCanonicalHookBlockPath, {
|
|
7437
7733
|
message: `must start with one of ${CANONICAL_HOOK_BLOCK_PREFIXES.join(", ")} (byte-exact, case-sensitive)`
|
|
7438
7734
|
});
|
|
7439
|
-
var ManagedBlockRecordSchema =
|
|
7735
|
+
var ManagedBlockRecordSchema = z6.object({
|
|
7440
7736
|
path: ManagedHookBlockPath,
|
|
7441
|
-
marker:
|
|
7442
|
-
comment:
|
|
7737
|
+
marker: z6.string(),
|
|
7738
|
+
comment: z6.enum(["hash", "html"])
|
|
7443
7739
|
});
|
|
7444
|
-
var ManagedManifestSchema =
|
|
7445
|
-
version:
|
|
7446
|
-
files:
|
|
7447
|
-
blocks:
|
|
7448
|
-
labels:
|
|
7449
|
-
agents:
|
|
7740
|
+
var ManagedManifestSchema = z6.object({
|
|
7741
|
+
version: z6.number().int().positive(),
|
|
7742
|
+
files: z6.array(SafeRepoRelPath),
|
|
7743
|
+
blocks: z6.array(ManagedBlockRecordSchema),
|
|
7744
|
+
labels: z6.array(z6.string()),
|
|
7745
|
+
agents: z6.array(z6.enum(AGENT_VENDORS)).optional()
|
|
7450
7746
|
});
|
|
7451
|
-
var ProjectEntrySchema =
|
|
7452
|
-
name:
|
|
7453
|
-
description:
|
|
7454
|
-
path:
|
|
7747
|
+
var ProjectEntrySchema = z6.object({
|
|
7748
|
+
name: z6.string().min(1),
|
|
7749
|
+
description: z6.string().min(1).optional(),
|
|
7750
|
+
path: z6.string().min(1).optional()
|
|
7455
7751
|
});
|
|
7456
7752
|
function parseTokensCollectDeclaration(value) {
|
|
7457
7753
|
const m = value.trim().match(/^(\S+)\s+(\S+)$/);
|
|
@@ -7462,90 +7758,97 @@ function parseTokensCollectDeclaration(value) {
|
|
|
7462
7758
|
return null;
|
|
7463
7759
|
return { interpreter, script };
|
|
7464
7760
|
}
|
|
7465
|
-
var VinayaConfigSchema =
|
|
7466
|
-
rings:
|
|
7467
|
-
ring1_forgeWriteInterception:
|
|
7468
|
-
ring2_asyncAudits:
|
|
7761
|
+
var VinayaConfigSchema = z6.object({
|
|
7762
|
+
rings: z6.object({
|
|
7763
|
+
ring1_forgeWriteInterception: z6.boolean(),
|
|
7764
|
+
ring2_asyncAudits: z6.boolean()
|
|
7469
7765
|
}).optional(),
|
|
7470
|
-
checks:
|
|
7471
|
-
roles:
|
|
7766
|
+
checks: z6.record(z6.string(), CheckEntrySchema).optional(),
|
|
7767
|
+
roles: z6.record(z6.string(), RoleEntrySchema).optional(),
|
|
7472
7768
|
briefSchema: BriefSchemaSchema.optional(),
|
|
7473
7769
|
managed: ManagedManifestSchema.optional(),
|
|
7474
|
-
principals:
|
|
7475
|
-
releaseActor:
|
|
7476
|
-
ci:
|
|
7477
|
-
tokens:
|
|
7478
|
-
collect:
|
|
7770
|
+
principals: z6.array(z6.string()).min(1).optional(),
|
|
7771
|
+
releaseActor: z6.string().min(1).optional(),
|
|
7772
|
+
ci: z6.object({ setup: z6.string().min(1) }).optional(),
|
|
7773
|
+
tokens: z6.object({
|
|
7774
|
+
collect: z6.string().min(1).refine((v) => parseTokensCollectDeclaration(v) !== null, {
|
|
7479
7775
|
message: 'tokens.collect must be exactly "<interpreter> <repo-relative-script-path>" — two whitespace-separated tokens, no flags, no shell syntax, no quoting'
|
|
7480
7776
|
})
|
|
7481
7777
|
}).optional(),
|
|
7482
|
-
blastRadius:
|
|
7483
|
-
proseGates:
|
|
7484
|
-
doctrineRoot:
|
|
7485
|
-
readerFacingPrefix:
|
|
7486
|
-
readerFacingSuffix:
|
|
7487
|
-
legacySlugDir:
|
|
7488
|
-
sourceComments:
|
|
7489
|
-
globs:
|
|
7490
|
-
allowlist:
|
|
7491
|
-
severity:
|
|
7778
|
+
blastRadius: z6.object({ extraDomains: z6.array(z6.string()).optional() }).optional(),
|
|
7779
|
+
proseGates: z6.object({
|
|
7780
|
+
doctrineRoot: z6.string().min(1).optional(),
|
|
7781
|
+
readerFacingPrefix: z6.string().min(1).optional(),
|
|
7782
|
+
readerFacingSuffix: z6.string().min(1).optional(),
|
|
7783
|
+
legacySlugDir: z6.string().min(1).optional(),
|
|
7784
|
+
sourceComments: z6.object({
|
|
7785
|
+
globs: z6.array(z6.string().min(1)).optional(),
|
|
7786
|
+
allowlist: z6.array(z6.string().min(1)).optional(),
|
|
7787
|
+
severity: z6.enum(["warning", "error"]).optional()
|
|
7492
7788
|
}).optional(),
|
|
7493
|
-
specGrandfather:
|
|
7494
|
-
specPaths:
|
|
7789
|
+
specGrandfather: z6.union([z6.array(z6.string().min(1)), z6.record(z6.string().min(1), z6.number().int().min(0))]).optional(),
|
|
7790
|
+
specPaths: z6.array(z6.string().min(1).refine((entry) => !entry.startsWith("/") && !/^[A-Za-z]:/.test(entry), {
|
|
7495
7791
|
message: "must be a repository-relative path, not an absolute one"
|
|
7496
7792
|
}).refine((entry) => !entry.split(/[\\/]/).includes(".."), {
|
|
7497
7793
|
message: "must stay inside the repository — no `..` segment"
|
|
7498
7794
|
})).optional()
|
|
7499
7795
|
}).optional(),
|
|
7500
|
-
projects:
|
|
7501
|
-
dispatch:
|
|
7502
|
-
timeoutMs:
|
|
7503
|
-
killGraceMs:
|
|
7504
|
-
agent:
|
|
7505
|
-
requireWorkerIsolation: z5.boolean().optional()
|
|
7796
|
+
projects: z6.array(ProjectEntrySchema).optional(),
|
|
7797
|
+
dispatch: z6.object({
|
|
7798
|
+
timeoutMs: z6.number().int().positive().optional(),
|
|
7799
|
+
killGraceMs: z6.number().int().positive().optional(),
|
|
7800
|
+
agent: z6.enum(["claude", "codex", "gemini"]).optional()
|
|
7506
7801
|
}).optional(),
|
|
7507
|
-
reviewPolicy:
|
|
7508
|
-
codeReviewThreshold:
|
|
7509
|
-
securityThreshold:
|
|
7510
|
-
maxRounds:
|
|
7802
|
+
reviewPolicy: z6.object({
|
|
7803
|
+
codeReviewThreshold: z6.string().min(1).optional(),
|
|
7804
|
+
securityThreshold: z6.string().min(1).optional(),
|
|
7805
|
+
maxRounds: z6.number().optional(),
|
|
7806
|
+
maxTaskMinutes: z6.number().optional()
|
|
7511
7807
|
}).optional(),
|
|
7512
|
-
|
|
7513
|
-
|
|
7514
|
-
briefSectionsSinceIssue: z5.number().int().nonnegative().optional(),
|
|
7515
|
-
documentationSinceIssue: z5.number().int().nonnegative().optional(),
|
|
7516
|
-
briefRulesSincePr: z5.number().int().nonnegative().optional(),
|
|
7517
|
-
agentBoxesRefusedSincePr: z5.number().int().nonnegative().optional()
|
|
7808
|
+
securityScan: z6.object({
|
|
7809
|
+
command: z6.array(z6.string().min(1)).min(1)
|
|
7518
7810
|
}).optional(),
|
|
7519
|
-
|
|
7520
|
-
|
|
7811
|
+
gateCutovers: z6.object({
|
|
7812
|
+
objectivesSinceIssue: z6.number().int().nonnegative().optional(),
|
|
7813
|
+
briefSectionsSinceIssue: z6.number().int().nonnegative().optional(),
|
|
7814
|
+
documentationSinceIssue: z6.number().int().nonnegative().optional(),
|
|
7815
|
+
briefRulesSincePr: z6.number().int().nonnegative().optional(),
|
|
7816
|
+
agentBoxesRefusedSincePr: z6.number().int().nonnegative().optional()
|
|
7521
7817
|
}).optional(),
|
|
7522
|
-
|
|
7523
|
-
|
|
7818
|
+
planning: z6.object({
|
|
7819
|
+
collisionThreshold: z6.number().int().nonnegative().optional()
|
|
7524
7820
|
}).optional(),
|
|
7525
|
-
|
|
7526
|
-
|
|
7821
|
+
prePush: z6.object({
|
|
7822
|
+
alwaysRun: z6.array(z6.string()).optional()
|
|
7823
|
+
}).optional(),
|
|
7824
|
+
report: z6.object({
|
|
7825
|
+
commandTimeoutMs: z6.number().int().positive().optional()
|
|
7527
7826
|
}).superRefine((report, ctx) => {
|
|
7528
7827
|
const commandTimeoutMs = report.commandTimeoutMs;
|
|
7529
7828
|
if (commandTimeoutMs !== undefined && commandTimeoutMs > MAX_REPORT_COMMAND_TIMEOUT_MS) {
|
|
7530
7829
|
ctx.addIssue({
|
|
7531
|
-
code:
|
|
7830
|
+
code: z6.ZodIssueCode.custom,
|
|
7532
7831
|
path: ["commandTimeoutMs"],
|
|
7533
7832
|
message: "must be at most 3600000 (1 hour)"
|
|
7534
7833
|
});
|
|
7535
7834
|
}
|
|
7536
7835
|
}).optional(),
|
|
7537
|
-
logPublish:
|
|
7836
|
+
logPublish: z6.unknown().refine((v) => v === undefined, {
|
|
7538
7837
|
message: "logPublish is removed — telemetry is never posted to a tracker or a code host; configure `logs` instead (a folder or a server destination)"
|
|
7539
7838
|
}),
|
|
7540
|
-
runtimeDir:
|
|
7541
|
-
logs:
|
|
7542
|
-
folder:
|
|
7543
|
-
url:
|
|
7544
|
-
headers:
|
|
7839
|
+
runtimeDir: z6.string().min(1).refine((v) => isAbsolute(v), { message: "runtimeDir: must be an absolute path" }).optional(),
|
|
7840
|
+
logs: z6.object({
|
|
7841
|
+
folder: z6.string().min(1).refine((v) => isAbsolute(v), { message: "logs.folder: must be an absolute path" }).optional(),
|
|
7842
|
+
url: z6.string().url().optional(),
|
|
7843
|
+
headers: z6.record(z6.string()).optional(),
|
|
7844
|
+
readHeaders: z6.record(z6.string()).optional(),
|
|
7845
|
+
events: CustomEventDeclarationsSchema.optional()
|
|
7545
7846
|
}).refine((v) => [v.folder, v.url].filter((x) => x !== undefined).length <= 1, {
|
|
7546
7847
|
message: "logs: set at most one of folder/url"
|
|
7547
7848
|
}).refine((v) => v.headers === undefined || v.url !== undefined, {
|
|
7548
7849
|
message: "logs: headers requires url"
|
|
7850
|
+
}).refine((v) => v.readHeaders === undefined || v.url !== undefined, {
|
|
7851
|
+
message: "logs: readHeaders requires url"
|
|
7549
7852
|
}).optional()
|
|
7550
7853
|
});
|
|
7551
7854
|
var GLOBAL_VINAYA_HOME = join(homedir(), ".vinaya");
|
|
@@ -7650,10 +7953,15 @@ function resolveReviewPolicy(config) {
|
|
|
7650
7953
|
if (!Number.isInteger(maxRounds) || maxRounds < 1) {
|
|
7651
7954
|
throw new Error(`vinaya.config.json: reviewPolicy.maxRounds "${maxRounds}" is not a positive integer — fix the config, this never falls back to a default.`);
|
|
7652
7955
|
}
|
|
7956
|
+
const maxTaskMinutes = raw.maxTaskMinutes ?? DEFAULT_REVIEW_POLICY.maxTaskMinutes;
|
|
7957
|
+
if (!Number.isInteger(maxTaskMinutes) || maxTaskMinutes < 0) {
|
|
7958
|
+
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.`);
|
|
7959
|
+
}
|
|
7653
7960
|
return {
|
|
7654
7961
|
codeReviewThreshold,
|
|
7655
7962
|
securityThreshold,
|
|
7656
|
-
maxRounds
|
|
7963
|
+
maxRounds,
|
|
7964
|
+
maxTaskMinutes
|
|
7657
7965
|
};
|
|
7658
7966
|
}
|
|
7659
7967
|
function resolveGateCutovers(config) {
|
|
@@ -7693,17 +8001,12 @@ function resolveTrustAnchorLogsDestination(local, trustAnchorConfig) {
|
|
|
7693
8001
|
return "url" in anchored && anchored.url === local.url ? anchored : null;
|
|
7694
8002
|
return "folder" in anchored && anchored.folder === local.folder ? anchored : null;
|
|
7695
8003
|
}
|
|
7696
|
-
function resolveLogsHeaderValues(headers, env
|
|
8004
|
+
function resolveLogsHeaderValues(headers, env) {
|
|
7697
8005
|
if (!headers)
|
|
7698
8006
|
return;
|
|
7699
8007
|
const resolved = {};
|
|
7700
8008
|
for (const [key, value] of Object.entries(headers)) {
|
|
7701
|
-
resolved[key] = value.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g, (_match, name) =>
|
|
7702
|
-
const fromEnv = env[name];
|
|
7703
|
-
if (fromEnv !== undefined)
|
|
7704
|
-
return fromEnv;
|
|
7705
|
-
return readKeychain(name) ?? "";
|
|
7706
|
-
});
|
|
8009
|
+
resolved[key] = value.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g, (_match, name) => env[name] ?? "");
|
|
7707
8010
|
}
|
|
7708
8011
|
return resolved;
|
|
7709
8012
|
}
|
|
@@ -7712,7 +8015,7 @@ function trustAnchorRepo() {
|
|
|
7712
8015
|
if (fromRunner)
|
|
7713
8016
|
return fromRunner;
|
|
7714
8017
|
try {
|
|
7715
|
-
const url =
|
|
8018
|
+
const url = execFileSync3("git", ["remote", "get-url", "origin"], {
|
|
7716
8019
|
encoding: "utf-8",
|
|
7717
8020
|
stdio: ["ignore", "pipe", "pipe"]
|
|
7718
8021
|
});
|
|
@@ -7759,7 +8062,7 @@ function resolveCiTrustAnchorProbeRef(env = process.env) {
|
|
|
7759
8062
|
return ref;
|
|
7760
8063
|
}
|
|
7761
8064
|
function readTrustAnchorConfigAtRef(ref) {
|
|
7762
|
-
const raw =
|
|
8065
|
+
const raw = execFileSync3("git", ["show", `${ref}:${LOCAL_CONFIG_FILENAME}`], {
|
|
7763
8066
|
encoding: "utf-8",
|
|
7764
8067
|
stdio: ["ignore", "pipe", "pipe"],
|
|
7765
8068
|
timeout: 1e4
|
|
@@ -7773,7 +8076,7 @@ function ghFetchTrustAnchorConfig() {
|
|
|
7773
8076
|
const repo = trustAnchorRepo();
|
|
7774
8077
|
if (!repo)
|
|
7775
8078
|
throw new Error("could not resolve repo identity for the trust-anchor read");
|
|
7776
|
-
return
|
|
8079
|
+
return execFileSync3("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], {
|
|
7777
8080
|
encoding: "utf-8",
|
|
7778
8081
|
stdio: ["ignore", "pipe", "pipe"]
|
|
7779
8082
|
});
|
|
@@ -7881,17 +8184,26 @@ function packageRoot(moduleUrl) {
|
|
|
7881
8184
|
}
|
|
7882
8185
|
|
|
7883
8186
|
// src/commands/doctrine.ts
|
|
7884
|
-
import { execFileSync as
|
|
8187
|
+
import { execFileSync as execFileSync4 } from "node:child_process";
|
|
7885
8188
|
import { existsSync as existsSync3, readdirSync, readFileSync as readFileSync3 } from "node:fs";
|
|
7886
8189
|
import { dirname as dirname3, join as join3, sep } from "node:path";
|
|
8190
|
+
import matter4 from "gray-matter";
|
|
8191
|
+
|
|
8192
|
+
// ../../packages/aeg-core/src/docs/parse-doc.ts
|
|
7887
8193
|
import matter2 from "gray-matter";
|
|
8194
|
+
// ../../packages/aeg-core/src/docs/surfaced-manifest.ts
|
|
8195
|
+
var NO_MODEL_BACKED_PATHS = new Set;
|
|
8196
|
+
// src/roles/contract.ts
|
|
8197
|
+
import matter3 from "gray-matter";
|
|
8198
|
+
|
|
8199
|
+
// src/commands/doctrine.ts
|
|
7888
8200
|
var ENTRY_SEGMENTS = ["skills", "aeg", "SKILL.md"];
|
|
7889
8201
|
function resolveDoctrineRoot(pkg = packageRoot(import.meta.url), cwd = process.cwd()) {
|
|
7890
8202
|
return resolveDoctrineRootInfo(pkg, cwd)?.root ?? null;
|
|
7891
8203
|
}
|
|
7892
8204
|
function gitToplevel(cwd) {
|
|
7893
8205
|
try {
|
|
7894
|
-
return
|
|
8206
|
+
return execFileSync4("git", ["-C", cwd, "rev-parse", "--show-toplevel"], {
|
|
7895
8207
|
encoding: "utf8",
|
|
7896
8208
|
stdio: ["ignore", "pipe", "pipe"]
|
|
7897
8209
|
}).trim();
|
|
@@ -7920,7 +8232,7 @@ var PACKAGED_TEMPLATE_PATH = join4(PACKAGE_ROOT, "aeg-root", "templates", "brief
|
|
|
7920
8232
|
var TEMPLATE_PATH = existsSync4(PACKAGED_TEMPLATE_PATH) ? PACKAGED_TEMPLATE_PATH : join4(PACKAGE_ROOT, "..", "..", "aeg-root", "templates", "brief-template.md");
|
|
7921
8233
|
function git(args) {
|
|
7922
8234
|
try {
|
|
7923
|
-
return
|
|
8235
|
+
return execFileSync5("git", args, { encoding: "utf8", stdio: ["ignore", "pipe", "ignore"] }).trim();
|
|
7924
8236
|
} catch {
|
|
7925
8237
|
return "";
|
|
7926
8238
|
}
|