@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
|
@@ -626,6 +626,33 @@ function tasksFromIssues(issues) {
|
|
|
626
626
|
}
|
|
627
627
|
return tasks.sort((a, b) => compareTaskIds(a.id, b.id));
|
|
628
628
|
}
|
|
629
|
+
function resolveDuplicateTasks(tasks, isOpen) {
|
|
630
|
+
const byId = new Map;
|
|
631
|
+
for (const t of tasks)
|
|
632
|
+
byId.set(t.id, [...byId.get(t.id) ?? [], t]);
|
|
633
|
+
const resolved = [];
|
|
634
|
+
const conflicts = [];
|
|
635
|
+
for (const [id, group] of byId) {
|
|
636
|
+
const first = group[0];
|
|
637
|
+
if (!first)
|
|
638
|
+
continue;
|
|
639
|
+
if (group.length === 1) {
|
|
640
|
+
resolved.push(first);
|
|
641
|
+
continue;
|
|
642
|
+
}
|
|
643
|
+
const number = (t) => t.issue ?? 0;
|
|
644
|
+
const open = group.filter((t) => t.issue !== null && isOpen(t.issue)).sort((a, b) => number(a) - number(b));
|
|
645
|
+
if (open.length > 1) {
|
|
646
|
+
conflicts.push({ id, issues: open.map(number) });
|
|
647
|
+
resolved.push(open[0]);
|
|
648
|
+
} else if (open.length === 1) {
|
|
649
|
+
resolved.push(open[0]);
|
|
650
|
+
} else {
|
|
651
|
+
resolved.push([...group].sort((a, b) => number(b) - number(a))[0]);
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
return { tasks: resolved.sort((a, b) => compareTaskIds(a.id, b.id)), conflicts };
|
|
655
|
+
}
|
|
629
656
|
async function fetchTrancheIssuesAsync(owner, repo, slug) {
|
|
630
657
|
return ghIssueListByAnyLabelAsync(owner, repo, [trancheLabel(slug)]);
|
|
631
658
|
}
|
|
@@ -1433,7 +1460,7 @@ function mapReviewDecision(decision) {
|
|
|
1433
1460
|
function buildBranchName(tranche, taskId) {
|
|
1434
1461
|
return `task/${tranche}/${taskId}`;
|
|
1435
1462
|
}
|
|
1436
|
-
async function
|
|
1463
|
+
async function fetchForgeFactsByIssue(input) {
|
|
1437
1464
|
const token = await resolveGithubToken(input.token);
|
|
1438
1465
|
if (!token) {
|
|
1439
1466
|
return {
|
|
@@ -1443,7 +1470,13 @@ async function fetchForgeFacts(input) {
|
|
|
1443
1470
|
reason: "No GitHub token available (set GITHUB_TOKEN/GH_TOKEN or `gh auth login`)."
|
|
1444
1471
|
};
|
|
1445
1472
|
}
|
|
1446
|
-
const
|
|
1473
|
+
const seen = new Set;
|
|
1474
|
+
const queriedTasks = input.tasks.filter((t) => {
|
|
1475
|
+
if (t.issue === null || seen.has(t.issue))
|
|
1476
|
+
return false;
|
|
1477
|
+
seen.add(t.issue);
|
|
1478
|
+
return true;
|
|
1479
|
+
});
|
|
1447
1480
|
if (queriedTasks.length === 0) {
|
|
1448
1481
|
return { facts: new Map, prRefs: new Map, unavailable: false };
|
|
1449
1482
|
}
|
|
@@ -1471,21 +1504,52 @@ async function fetchForgeFacts(input) {
|
|
|
1471
1504
|
};
|
|
1472
1505
|
}
|
|
1473
1506
|
for (const task of queriedTasks) {
|
|
1474
|
-
const
|
|
1475
|
-
const raw = extractRawFromResponse(response.repository, alias);
|
|
1507
|
+
const raw = extractRawFromResponse(response.repository, aliasFor(task.issue));
|
|
1476
1508
|
const mapped = mapForgeFacts(raw);
|
|
1477
1509
|
if (mapped)
|
|
1478
|
-
facts.set(task.
|
|
1510
|
+
facts.set(task.issue, mapped);
|
|
1479
1511
|
const pr = raw.pullRequest;
|
|
1480
1512
|
if (pr && typeof pr.number === "number" && typeof pr.url === "string") {
|
|
1481
|
-
prRefs.set(task.
|
|
1513
|
+
prRefs.set(task.issue, { number: pr.number, url: pr.url, state: pr.state });
|
|
1482
1514
|
}
|
|
1483
1515
|
}
|
|
1484
1516
|
return { facts, prRefs, unavailable: false };
|
|
1485
1517
|
}
|
|
1518
|
+
async function fetchForgeFacts(input) {
|
|
1519
|
+
const byIssue = await fetchForgeFactsByIssue(input);
|
|
1520
|
+
if (byIssue.unavailable) {
|
|
1521
|
+
return { facts: new Map, prRefs: new Map, unavailable: true, reason: byIssue.reason };
|
|
1522
|
+
}
|
|
1523
|
+
const facts = new Map;
|
|
1524
|
+
const prRefs = new Map;
|
|
1525
|
+
const winner = new Map;
|
|
1526
|
+
for (const task of input.tasks) {
|
|
1527
|
+
if (task.issue === null)
|
|
1528
|
+
continue;
|
|
1529
|
+
const current = winner.get(task.id);
|
|
1530
|
+
if (current === undefined || outranks(byIssue.facts, task.issue, current))
|
|
1531
|
+
winner.set(task.id, task.issue);
|
|
1532
|
+
}
|
|
1533
|
+
for (const [taskId, issue] of winner) {
|
|
1534
|
+
const f = byIssue.facts.get(issue);
|
|
1535
|
+
if (f)
|
|
1536
|
+
facts.set(taskId, f);
|
|
1537
|
+
const pr = byIssue.prRefs.get(issue);
|
|
1538
|
+
if (pr)
|
|
1539
|
+
prRefs.set(taskId, pr);
|
|
1540
|
+
}
|
|
1541
|
+
return { facts, prRefs, unavailable: false };
|
|
1542
|
+
}
|
|
1543
|
+
function outranks(facts, candidate, current) {
|
|
1544
|
+
const candidateOpen = facts.get(candidate)?.issueState === "open";
|
|
1545
|
+
const currentOpen = facts.get(current)?.issueState === "open";
|
|
1546
|
+
if (candidateOpen !== currentOpen)
|
|
1547
|
+
return candidateOpen;
|
|
1548
|
+
return candidate > current;
|
|
1549
|
+
}
|
|
1486
1550
|
function buildBatchQuery(tranche, tasks) {
|
|
1487
1551
|
const perTask = tasks.map((task) => {
|
|
1488
|
-
const a = aliasFor(task.
|
|
1552
|
+
const a = aliasFor(task.issue);
|
|
1489
1553
|
const branch = buildBranchName(tranche, task.id);
|
|
1490
1554
|
return `
|
|
1491
1555
|
${a}_issue: issue(number: ${task.issue}) {
|
|
@@ -1527,9 +1591,8 @@ function buildBatchQuery(tranche, tasks) {
|
|
|
1527
1591
|
}
|
|
1528
1592
|
}`;
|
|
1529
1593
|
}
|
|
1530
|
-
function aliasFor(
|
|
1531
|
-
|
|
1532
|
-
return `t_${sanitized}`;
|
|
1594
|
+
function aliasFor(issue) {
|
|
1595
|
+
return `i_${issue}`;
|
|
1533
1596
|
}
|
|
1534
1597
|
function extractRawFromResponse(repository, alias) {
|
|
1535
1598
|
const issue = repository[`${alias}_issue`];
|
|
@@ -1884,45 +1947,6 @@ var DERIVED_STATUSES = [
|
|
|
1884
1947
|
"incoherent"
|
|
1885
1948
|
];
|
|
1886
1949
|
var DERIVABLE_STATUSES = DERIVED_STATUSES.filter((s) => s !== "backlog");
|
|
1887
|
-
// ../../packages/aeg-core/src/parse-ledger.ts
|
|
1888
|
-
function rowFromCells(cells) {
|
|
1889
|
-
if (cells.length < 7)
|
|
1890
|
-
return null;
|
|
1891
|
-
const phase = (cells[0] ?? "").trim();
|
|
1892
|
-
if (!phase)
|
|
1893
|
-
return null;
|
|
1894
|
-
return {
|
|
1895
|
-
phase,
|
|
1896
|
-
role: (cells[1] ?? "").trim(),
|
|
1897
|
-
agentModel: (cells[2] ?? "").trim(),
|
|
1898
|
-
tokensIn: parseIntCell(cells[3] ?? ""),
|
|
1899
|
-
tokensOut: parseIntCell(cells[4] ?? ""),
|
|
1900
|
-
cost: parseCostCell(cells[5] ?? ""),
|
|
1901
|
-
date: (cells[6] ?? "").trim()
|
|
1902
|
-
};
|
|
1903
|
-
}
|
|
1904
|
-
function parseIntCell(cell) {
|
|
1905
|
-
const trimmed = cell.replace(/`/g, "").trim();
|
|
1906
|
-
if (!trimmed || isEmDashOrDash(trimmed))
|
|
1907
|
-
return null;
|
|
1908
|
-
const normalized = trimmed.replace(/[,_\s]/g, "");
|
|
1909
|
-
if (!/^-?\d+$/.test(normalized))
|
|
1910
|
-
return null;
|
|
1911
|
-
return Number(normalized);
|
|
1912
|
-
}
|
|
1913
|
-
function parseCostCell(cell) {
|
|
1914
|
-
const trimmed = cell.replace(/`/g, "").trim();
|
|
1915
|
-
if (!trimmed || isEmDashOrDash(trimmed))
|
|
1916
|
-
return null;
|
|
1917
|
-
const normalized = trimmed.replace(/^\$/, "").replace(/[,_\s]/g, "");
|
|
1918
|
-
if (!/^-?\d+(\.\d+)?$/.test(normalized))
|
|
1919
|
-
return null;
|
|
1920
|
-
return Number(normalized);
|
|
1921
|
-
}
|
|
1922
|
-
function isEmDashOrDash(s) {
|
|
1923
|
-
const t = s.trim();
|
|
1924
|
-
return t === "—" || t === "-" || t === "–";
|
|
1925
|
-
}
|
|
1926
1950
|
// ../../packages/aeg-core/src/waiver-label.ts
|
|
1927
1951
|
var WAIVER_LABEL = label("waiver-docs");
|
|
1928
1952
|
var WAIVER_LABEL_REVIEW = label("waiver-review");
|
|
@@ -1938,61 +1962,6 @@ function isWaiverLabelActorVerified(opts) {
|
|
|
1938
1962
|
return false;
|
|
1939
1963
|
return isPrincipal(opts.labelActor, opts.principalAllowlist);
|
|
1940
1964
|
}
|
|
1941
|
-
|
|
1942
|
-
// ../../packages/aeg-core/src/parse-token-report.ts
|
|
1943
|
-
var TOKEN_REPORT_HEADING = /^\s*(?:#{1,6}\s*Token report\s*|\*\*Token report\*\*)\s*$/i;
|
|
1944
|
-
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;
|
|
1945
|
-
function parseTokenReportEntries(body) {
|
|
1946
|
-
const lines = body.split(/\r?\n/);
|
|
1947
|
-
const headingIdxs = [];
|
|
1948
|
-
lines.forEach((line, i) => {
|
|
1949
|
-
if (TOKEN_REPORT_HEADING.test(line))
|
|
1950
|
-
headingIdxs.push(i);
|
|
1951
|
-
});
|
|
1952
|
-
const out = [];
|
|
1953
|
-
for (let h = 0;h < headingIdxs.length; h++) {
|
|
1954
|
-
const start = headingIdxs[h] + 1;
|
|
1955
|
-
const end = h + 1 < headingIdxs.length ? headingIdxs[h + 1] : lines.length;
|
|
1956
|
-
const section = lines.slice(start, end).join(`
|
|
1957
|
-
`);
|
|
1958
|
-
const tableRows = parseTableSection(section);
|
|
1959
|
-
if (tableRows.length > 0) {
|
|
1960
|
-
out.push(...tableRows);
|
|
1961
|
-
continue;
|
|
1962
|
-
}
|
|
1963
|
-
const inlineRow = parseInlineFieldList(section);
|
|
1964
|
-
if (inlineRow)
|
|
1965
|
-
out.push(inlineRow);
|
|
1966
|
-
}
|
|
1967
|
-
return out;
|
|
1968
|
-
}
|
|
1969
|
-
function parseTableSection(section) {
|
|
1970
|
-
const lines = section.split(/\r?\n/);
|
|
1971
|
-
let i = 0;
|
|
1972
|
-
for (;i < lines.length; i++) {
|
|
1973
|
-
if ((lines[i] ?? "").trim().startsWith("|"))
|
|
1974
|
-
break;
|
|
1975
|
-
}
|
|
1976
|
-
if (i + 1 >= lines.length)
|
|
1977
|
-
return [];
|
|
1978
|
-
i += 2;
|
|
1979
|
-
const out = [];
|
|
1980
|
-
for (;i < lines.length; i++) {
|
|
1981
|
-
const trimmed = (lines[i] ?? "").trim();
|
|
1982
|
-
if (!trimmed.startsWith("|"))
|
|
1983
|
-
break;
|
|
1984
|
-
const row = rowFromCells(splitTableRow(trimmed));
|
|
1985
|
-
if (row)
|
|
1986
|
-
out.push(row);
|
|
1987
|
-
}
|
|
1988
|
-
return out;
|
|
1989
|
-
}
|
|
1990
|
-
function parseInlineFieldList(section) {
|
|
1991
|
-
const m = section.match(INLINE_FIELD_LIST);
|
|
1992
|
-
if (!m)
|
|
1993
|
-
return null;
|
|
1994
|
-
return rowFromCells([m[1], m[2], m[3], m[4], m[5], m[6], m[7]]);
|
|
1995
|
-
}
|
|
1996
1965
|
// ../../packages/aeg-core/src/verdict-extraction.ts
|
|
1997
1966
|
var HEAD_SHA_PATTERN = /^[ \t]*(?:\*{1,3}|_{1,3})?Judged head:\s*([0-9a-f]{7,40})(?![A-Za-z0-9])/im;
|
|
1998
1967
|
var OBJECTIVES_VERSION_PATTERN = /^[ \t]*(?:\*{1,3}|_{1,3})?Objectives version:\s*([0-9a-f]{64})(?![A-Za-z0-9])/im;
|
|
@@ -2441,10 +2410,12 @@ function evaluateC5(changed, docOwnersContent, prBody, fileExists, waiverActive,
|
|
|
2441
2410
|
var CODE_REVIEW_SEVERITY_ORDER = ["BLOCKER", "MAJOR", "MINOR"];
|
|
2442
2411
|
var SECURITY_SEVERITY_ORDER = ["CRITICAL", "HIGH", "MEDIUM", "LOW"];
|
|
2443
2412
|
var DEFAULT_MAX_ROUNDS = 3;
|
|
2413
|
+
var DEFAULT_MAX_TASK_MINUTES = 180;
|
|
2444
2414
|
var DEFAULT_REVIEW_POLICY = {
|
|
2445
2415
|
codeReviewThreshold: "BLOCKER",
|
|
2446
2416
|
securityThreshold: "HIGH",
|
|
2447
|
-
maxRounds: DEFAULT_MAX_ROUNDS
|
|
2417
|
+
maxRounds: DEFAULT_MAX_ROUNDS,
|
|
2418
|
+
maxTaskMinutes: DEFAULT_MAX_TASK_MINUTES
|
|
2448
2419
|
};
|
|
2449
2420
|
var FILE_SHAPED_LOCATION = /\.[a-zA-Z0-9]{1,10}(:\d+)?\s*$/;
|
|
2450
2421
|
var PROSE_LOCATION_PATTERNS = [/\bpr\s*body\b/i, /\bcomment\b/i];
|
|
@@ -2452,6 +2423,9 @@ var ROLE_FILE_LOCATION = /(^|\/)aeg-root\/roles\//i;
|
|
|
2452
2423
|
function isProseLocation(location) {
|
|
2453
2424
|
if (ROLE_FILE_LOCATION.test(location))
|
|
2454
2425
|
return true;
|
|
2426
|
+
return isBodyOrCommentLocation(location);
|
|
2427
|
+
}
|
|
2428
|
+
function isBodyOrCommentLocation(location) {
|
|
2455
2429
|
if (FILE_SHAPED_LOCATION.test(location))
|
|
2456
2430
|
return false;
|
|
2457
2431
|
return PROSE_LOCATION_PATTERNS.some((pattern) => pattern.test(location));
|
|
@@ -2478,7 +2452,7 @@ function classifyFinding(finding, scale, threshold, context = {}) {
|
|
|
2478
2452
|
const wouldBlock = blockingSeverities(scale, threshold).includes(effectiveSeverity);
|
|
2479
2453
|
if (!wouldBlock)
|
|
2480
2454
|
return { outcome: "non_blocking", deferralReason: null };
|
|
2481
|
-
const hasLocation = location !== undefined && location.length > 0;
|
|
2455
|
+
const hasLocation = location !== undefined && location.length > 0 && !isBodyOrCommentLocation(location);
|
|
2482
2456
|
if (hasLocation && context.inSurface && !context.inSurface(location)) {
|
|
2483
2457
|
return { outcome: "deferred", deferralReason: "outside-surface" };
|
|
2484
2458
|
}
|
|
@@ -2845,11 +2819,13 @@ function checkDocUpdateList(prBody) {
|
|
|
2845
2819
|
return headingCheck(prBody, "(?:documentation|doc)[- ]update(?:\\s+list)?", "Documentation-update list");
|
|
2846
2820
|
}
|
|
2847
2821
|
function checkWorktreeStep0(prBody) {
|
|
2848
|
-
if (/git worktree add/.test(prBody))
|
|
2822
|
+
if (/git worktree add/.test(prBody) || /cd \.worktrees\//.test(prBody) || /bun install --frozen-lockfile/.test(prBody))
|
|
2849
2823
|
return { status: "pass", errors: [] };
|
|
2850
2824
|
return {
|
|
2851
2825
|
status: "fail",
|
|
2852
|
-
errors: [
|
|
2826
|
+
errors: [
|
|
2827
|
+
"brief-validation worktree Step 0: no `git worktree add`, `cd .worktrees/`, or `bun install --frozen-lockfile` command found in the PR body."
|
|
2828
|
+
]
|
|
2853
2829
|
};
|
|
2854
2830
|
}
|
|
2855
2831
|
function checkStopConditions(prBody) {
|
|
@@ -3039,7 +3015,8 @@ function isCommandBlock(content) {
|
|
|
3039
3015
|
return COMMAND_WORDS.includes(commandWordOf(firstNonBlankLine(content)));
|
|
3040
3016
|
}
|
|
3041
3017
|
function isStep0Block(content) {
|
|
3042
|
-
|
|
3018
|
+
const first = firstNonBlankLine(content);
|
|
3019
|
+
return first.startsWith("git worktree add") || first.startsWith("cd .worktrees/") || first.startsWith("bun install --frozen-lockfile");
|
|
3043
3020
|
}
|
|
3044
3021
|
function checkCommandsCarryOutput(prBody) {
|
|
3045
3022
|
const errors = [];
|
|
@@ -3508,10 +3485,14 @@ function legacySlugPattern(legacySlugs) {
|
|
|
3508
3485
|
const alternation = legacySlugs.map((s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|");
|
|
3509
3486
|
return new RegExp(`(^|[^a-zA-Z0-9\\n-])(${alternation})([^a-zA-Z0-9\\n-]|$)`, "g");
|
|
3510
3487
|
}
|
|
3488
|
+
function specGrandfatherPaths(specGrandfather) {
|
|
3489
|
+
return Array.isArray(specGrandfather) ? [...specGrandfather] : Object.keys(specGrandfather);
|
|
3490
|
+
}
|
|
3511
3491
|
function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuffix, legacySlugs = [], shipsPrefix = SHIPS_PREFIX, specGrandfather = [], specPaths = DEFAULT_SPEC_PATHS) {
|
|
3512
3492
|
const findings = [];
|
|
3513
3493
|
const legacyPattern = legacySlugPattern(legacySlugs);
|
|
3514
|
-
const
|
|
3494
|
+
const grandfatheredWhole = new Set(Array.isArray(specGrandfather) ? specGrandfather : []);
|
|
3495
|
+
const limits = new Map(Array.isArray(specGrandfather) ? [] : Object.entries(specGrandfather));
|
|
3515
3496
|
const patterns = [
|
|
3516
3497
|
{ pattern: FORGE_NUMBER_PATTERN, what: "a forge number" },
|
|
3517
3498
|
{ pattern: TRANCHE_SLUG_VN_PATTERN, what: "an internal tranche slug" },
|
|
@@ -3530,18 +3511,19 @@ function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuff
|
|
|
3530
3511
|
continue;
|
|
3531
3512
|
if (cls !== "product" && cls !== "spec" && !SWEPT_CLASSES.has(cls))
|
|
3532
3513
|
continue;
|
|
3533
|
-
if (cls === "spec" &&
|
|
3514
|
+
if (cls === "spec" && grandfatheredWhole.has(file.path))
|
|
3534
3515
|
continue;
|
|
3535
3516
|
const blocking = cls === "product" || cls === "spec";
|
|
3536
3517
|
const scrubbed = cls === "product" ? stripNonProseForProduct(file.path, file.content) : stripNonProse(file.path, file.content);
|
|
3537
3518
|
const patternsToRun = cls === "product" ? productPatterns : cls === "spec" ? specPatterns : patterns;
|
|
3519
|
+
const fileFindings = [];
|
|
3538
3520
|
for (const { pattern, what, group } of patternsToRun) {
|
|
3539
3521
|
pattern.lastIndex = 0;
|
|
3540
3522
|
let match = pattern.exec(scrubbed);
|
|
3541
3523
|
while (match !== null) {
|
|
3542
3524
|
const cited = group !== undefined ? match[group] ?? match[0] : match[0];
|
|
3543
3525
|
const citedIndex = match.index + match[0].indexOf(cited);
|
|
3544
|
-
|
|
3526
|
+
fileFindings.push({
|
|
3545
3527
|
file: file.path,
|
|
3546
3528
|
line: lineAt(scrubbed, citedIndex),
|
|
3547
3529
|
message: `references ${what} ("${cited}") a reader outside this repo's tracker cannot resolve`,
|
|
@@ -3550,6 +3532,15 @@ function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuff
|
|
|
3550
3532
|
match = pattern.exec(scrubbed);
|
|
3551
3533
|
}
|
|
3552
3534
|
}
|
|
3535
|
+
const limit = cls === "spec" ? limits.get(file.path) : undefined;
|
|
3536
|
+
if (limit !== undefined) {
|
|
3537
|
+
if (fileFindings.length <= limit)
|
|
3538
|
+
continue;
|
|
3539
|
+
for (const f of fileFindings) {
|
|
3540
|
+
f.message += `; ${file.path} carries ${fileFindings.length} such findings, over its proseGates.specGrandfather limit of ${limit}`;
|
|
3541
|
+
}
|
|
3542
|
+
}
|
|
3543
|
+
findings.push(...fileFindings);
|
|
3553
3544
|
}
|
|
3554
3545
|
return findings;
|
|
3555
3546
|
}
|
|
@@ -4131,6 +4122,8 @@ var FILE_EXTENSIONS = new Set([
|
|
|
4131
4122
|
"html",
|
|
4132
4123
|
"css"
|
|
4133
4124
|
]);
|
|
4125
|
+
var CI_SHARD_DIR = "apps/cli/tests/ci-shards";
|
|
4126
|
+
var CI_SHARD_PROBE = `${CI_SHARD_DIR}/shard-1.txt`;
|
|
4134
4127
|
|
|
4135
4128
|
// ../../packages/aeg-core/src/task-branch-identity.ts
|
|
4136
4129
|
var ISSUE_BRANCH_PATTERN = /^task\/issue-(\d+)$/;
|
|
@@ -4509,8 +4502,7 @@ function briefHash(brief) {
|
|
|
4509
4502
|
function policyDigest(policy) {
|
|
4510
4503
|
return createHash4("sha256").update(JSON.stringify({
|
|
4511
4504
|
codeReviewThreshold: policy.codeReviewThreshold,
|
|
4512
|
-
securityThreshold: policy.securityThreshold
|
|
4513
|
-
maxRounds: policy.maxRounds
|
|
4505
|
+
securityThreshold: policy.securityThreshold
|
|
4514
4506
|
})).digest("hex");
|
|
4515
4507
|
}
|
|
4516
4508
|
function isBoundToHead(echoed, headSha) {
|
|
@@ -4823,7 +4815,46 @@ function parseEnforcementRegistry(content) {
|
|
|
4823
4815
|
return result;
|
|
4824
4816
|
}
|
|
4825
4817
|
// ../../packages/aeg-core/src/registry-checks.ts
|
|
4826
|
-
|
|
4818
|
+
var HOOK_DIR_PREFIXES = [".claude/hooks/", ".vinaya/hooks/", ".husky/", ".git/hooks/"];
|
|
4819
|
+
var BARE_HOOK_NAME = /^check-[A-Za-z0-9_.-]*\.sh$/;
|
|
4820
|
+
function basename(path) {
|
|
4821
|
+
return path.slice(path.lastIndexOf("/") + 1);
|
|
4822
|
+
}
|
|
4823
|
+
function lineOf(content, index) {
|
|
4824
|
+
let line = 1;
|
|
4825
|
+
for (let i = 0;i < index; i++)
|
|
4826
|
+
if (content.charCodeAt(i) === 10)
|
|
4827
|
+
line++;
|
|
4828
|
+
return line;
|
|
4829
|
+
}
|
|
4830
|
+
function findUnshippedHookRefs(docs, shipped) {
|
|
4831
|
+
const shippedNames = new Set([...shipped].map(basename));
|
|
4832
|
+
const findings = [];
|
|
4833
|
+
const flag = (doc, token, index) => {
|
|
4834
|
+
findings.push({
|
|
4835
|
+
path: doc.path,
|
|
4836
|
+
reason: `${doc.path}:${lineOf(doc.content, index)} names hook "${token}", which is neither tracked in git nor emitted by \`vinaya init\``
|
|
4837
|
+
});
|
|
4838
|
+
};
|
|
4839
|
+
for (const doc of docs) {
|
|
4840
|
+
for (const { cited, index } of extractCitedPaths(doc.content)) {
|
|
4841
|
+
if (cited.endsWith("/") || !HOOK_DIR_PREFIXES.some((p) => cited.startsWith(p)))
|
|
4842
|
+
continue;
|
|
4843
|
+
if (!shipped.has(cited))
|
|
4844
|
+
flag(doc, cited, index);
|
|
4845
|
+
}
|
|
4846
|
+
const spanPattern = /`([^`\n]+)`/g;
|
|
4847
|
+
let match = spanPattern.exec(doc.content);
|
|
4848
|
+
while (match !== null) {
|
|
4849
|
+
const token = match[1] ?? "";
|
|
4850
|
+
if (BARE_HOOK_NAME.test(token) && !shippedNames.has(token))
|
|
4851
|
+
flag(doc, token, match.index);
|
|
4852
|
+
match = spanPattern.exec(doc.content);
|
|
4853
|
+
}
|
|
4854
|
+
}
|
|
4855
|
+
return findings;
|
|
4856
|
+
}
|
|
4857
|
+
function checkG1(rows, existsFn, hookRefs) {
|
|
4827
4858
|
const findings = [];
|
|
4828
4859
|
for (const row of rows) {
|
|
4829
4860
|
if (row.implementation === "")
|
|
@@ -4836,6 +4867,8 @@ function checkG1(rows, existsFn) {
|
|
|
4836
4867
|
});
|
|
4837
4868
|
}
|
|
4838
4869
|
}
|
|
4870
|
+
if (hookRefs)
|
|
4871
|
+
findings.push(...findUnshippedHookRefs(hookRefs.docs, hookRefs.shipped));
|
|
4839
4872
|
return { check: "G1", status: findings.length > 0 ? "fail" : "pass", findings };
|
|
4840
4873
|
}
|
|
4841
4874
|
var SCAFFOLD_PLACEHOLDER = "[undocumented — fill in why]";
|
|
@@ -4968,6 +5001,55 @@ function checkG6(rows, registeredCheckNames) {
|
|
|
4968
5001
|
}
|
|
4969
5002
|
return { check: "G6", status: findings.length > 0 ? "fail" : "pass", findings };
|
|
4970
5003
|
}
|
|
5004
|
+
function reachesProducer(file, producers, imports) {
|
|
5005
|
+
const seen = new Set([file]);
|
|
5006
|
+
const queue = [file];
|
|
5007
|
+
for (let next = queue.pop();next !== undefined; next = queue.pop()) {
|
|
5008
|
+
if (producers.has(next))
|
|
5009
|
+
return true;
|
|
5010
|
+
for (const dep of imports.get(next) ?? []) {
|
|
5011
|
+
if (!seen.has(dep)) {
|
|
5012
|
+
seen.add(dep);
|
|
5013
|
+
queue.push(dep);
|
|
5014
|
+
}
|
|
5015
|
+
}
|
|
5016
|
+
}
|
|
5017
|
+
return false;
|
|
5018
|
+
}
|
|
5019
|
+
function checkG7(input) {
|
|
5020
|
+
if (!input.enforcementMapPresent)
|
|
5021
|
+
return { check: "G7", status: "info", findings: [] };
|
|
5022
|
+
const subjects = new Set([...input.crossingFiles, ...input.blockingFiles]);
|
|
5023
|
+
const findings = [];
|
|
5024
|
+
for (const path of subjects) {
|
|
5025
|
+
if (path in input.exemptions)
|
|
5026
|
+
continue;
|
|
5027
|
+
if (!reachesProducer(path, input.producers, input.imports)) {
|
|
5028
|
+
findings.push({
|
|
5029
|
+
path,
|
|
5030
|
+
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`
|
|
5031
|
+
});
|
|
5032
|
+
}
|
|
5033
|
+
}
|
|
5034
|
+
for (const [path, reason] of Object.entries(input.exemptions)) {
|
|
5035
|
+
if (reason.trim() === "") {
|
|
5036
|
+
findings.push({ path, reason: `exemption for "${path}" states no reason` });
|
|
5037
|
+
} else if (!input.existsFn(path)) {
|
|
5038
|
+
findings.push({ path, reason: `exemption names "${path}", which no longer exists` });
|
|
5039
|
+
} else if (!subjects.has(path)) {
|
|
5040
|
+
findings.push({
|
|
5041
|
+
path,
|
|
5042
|
+
reason: `exemption names "${path}", which is neither a GitHub-writing file nor a blocking gate's implementation`
|
|
5043
|
+
});
|
|
5044
|
+
} else if (reachesProducer(path, input.producers, input.imports)) {
|
|
5045
|
+
findings.push({
|
|
5046
|
+
path,
|
|
5047
|
+
reason: `exemption names "${path}", which does reach a log producer — remove the exemption`
|
|
5048
|
+
});
|
|
5049
|
+
}
|
|
5050
|
+
}
|
|
5051
|
+
return { check: "G7", status: findings.length > 0 ? "fail" : "pass", findings };
|
|
5052
|
+
}
|
|
4971
5053
|
// ../../packages/aeg-core/src/dead-branch-push-guard.ts
|
|
4972
5054
|
function checkDeadBranchPush(input) {
|
|
4973
5055
|
const { branch, prState, prNumber } = input;
|
|
@@ -5147,6 +5229,11 @@ function checkDispatchReadiness(input) {
|
|
|
5147
5229
|
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.`);
|
|
5148
5230
|
continue;
|
|
5149
5231
|
}
|
|
5232
|
+
if (dep.readFailed === true) {
|
|
5233
|
+
const issueStr = dep.issue !== null ? ` (#${dep.issue})` : "";
|
|
5234
|
+
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.`);
|
|
5235
|
+
continue;
|
|
5236
|
+
}
|
|
5150
5237
|
if (!dep.merged && !isHandClosedByRecognizedPrincipal(dep, principalAllowlist)) {
|
|
5151
5238
|
const issueStr = dep.issue !== null ? ` (#${dep.issue})` : "";
|
|
5152
5239
|
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.`);
|
|
@@ -5389,7 +5476,6 @@ var TaskPrPauseSchema = z.object({
|
|
|
5389
5476
|
var TaskPrReviewRecordSchema = z.object({
|
|
5390
5477
|
verdicts: z.array(TaskPrVerdictSchema),
|
|
5391
5478
|
roundMarkers: z.array(z.number().int().nonnegative()),
|
|
5392
|
-
summaryTable: z.string().nullable(),
|
|
5393
5479
|
pause: TaskPrPauseSchema.nullable()
|
|
5394
5480
|
});
|
|
5395
5481
|
var TaskPrReadInputSchema = z.object({
|
|
@@ -5436,16 +5522,6 @@ var TaskCancelResultSchema = z.object({
|
|
|
5436
5522
|
authenticatedFrom: z.string().min(1),
|
|
5437
5523
|
fencedEffectKeys: z.array(z.string())
|
|
5438
5524
|
});
|
|
5439
|
-
var TASK_TOOL_NAMES = [
|
|
5440
|
-
"task_start",
|
|
5441
|
-
"task_status",
|
|
5442
|
-
"task_escalation_read",
|
|
5443
|
-
"task_pr_read",
|
|
5444
|
-
"task_resume",
|
|
5445
|
-
"task_cancel"
|
|
5446
|
-
];
|
|
5447
|
-
var OPERATOR_STATUS_FOLLOW = "task_status_follow";
|
|
5448
|
-
var OPERATOR_TOOL_GRANT = [...TASK_TOOL_NAMES, OPERATOR_STATUS_FOLLOW];
|
|
5449
5525
|
// ../../packages/aeg-core/src/first-push-dispatch-gate.ts
|
|
5450
5526
|
function parseTaskBranch(branch) {
|
|
5451
5527
|
const m = /^task\/([^/]+)\/([^/]+)$/.exec(branch);
|
|
@@ -5676,16 +5752,71 @@ var NO_GATE_CUTOVERS = {
|
|
|
5676
5752
|
briefRulesSincePr: null,
|
|
5677
5753
|
agentBoxesRefusedSincePr: null
|
|
5678
5754
|
};
|
|
5679
|
-
// ../../packages/aeg-core/src/dev-review-loop/types.ts
|
|
5680
|
-
var SEVERITY_COLUMNS = ["blocker", "major", "minor", "critical", "high", "medium", "low"];
|
|
5681
|
-
// ../../packages/aeg-core/src/dev-review-loop/journal-reconstruction.ts
|
|
5682
|
-
var SUMMARY_TABLE_HEADER = `| round | ${SEVERITY_COLUMNS.join(" | ")} | confidence | outcome |`;
|
|
5683
|
-
// ../../packages/aeg-core/src/log/envelope.ts
|
|
5684
|
-
import { createHash as createHash5 } from "node:crypto";
|
|
5685
|
-
|
|
5686
5755
|
// ../../packages/aeg-core/src/log/schema.ts
|
|
5756
|
+
import { z as z3 } from "zod";
|
|
5757
|
+
|
|
5758
|
+
// ../../packages/aeg-core/src/log/custom.ts
|
|
5687
5759
|
import { z as z2 } from "zod";
|
|
5760
|
+
var CUSTOM_EVENT_NAME_PATTERN = /^[a-z][a-z0-9_]*\.[a-z][a-z0-9_.]*$/;
|
|
5761
|
+
var CUSTOM_EVENT_NAME_MAX_LENGTH = 64;
|
|
5762
|
+
var CUSTOM_EVENT_RESERVED_NAMESPACE = "vinaya";
|
|
5763
|
+
var CUSTOM_EVENT_MAX_FIELDS = 20;
|
|
5764
|
+
var CUSTOM_FIELD_NAME_PATTERN = /^[a-z][a-z0-9_]*$/;
|
|
5765
|
+
var CUSTOM_FIELD_NAME_MAX_LENGTH = 64;
|
|
5766
|
+
var CUSTOM_TEXT_MAX_LENGTH = 500;
|
|
5767
|
+
var CUSTOM_WORD_PATTERN = /^[a-z0-9][a-z0-9_-]*$/;
|
|
5768
|
+
var CUSTOM_WORD_MAX_LENGTH = 64;
|
|
5769
|
+
var CUSTOM_FIELD_MAX_WORDS = 50;
|
|
5770
|
+
var CustomFieldTypeSchema = z2.union([z2.enum(["text", "number", "boolean"]), z2.array(z2.string())]);
|
|
5771
|
+
var CustomEventDeclarationsSchema = z2.record(z2.string(), z2.object({
|
|
5772
|
+
fields: z2.record(z2.string(), CustomFieldTypeSchema)
|
|
5773
|
+
}).strict()).superRefine((events, ctx) => {
|
|
5774
|
+
for (const [name, declaration] of Object.entries(events)) {
|
|
5775
|
+
const refuse = (message, path = []) => {
|
|
5776
|
+
ctx.addIssue({
|
|
5777
|
+
code: z2.ZodIssueCode.custom,
|
|
5778
|
+
path: [name, ...path],
|
|
5779
|
+
message: `logs.events "${name}": ${message}`
|
|
5780
|
+
});
|
|
5781
|
+
};
|
|
5782
|
+
if (name.length > CUSTOM_EVENT_NAME_MAX_LENGTH) {
|
|
5783
|
+
refuse(`the name must be at most ${CUSTOM_EVENT_NAME_MAX_LENGTH} characters`);
|
|
5784
|
+
}
|
|
5785
|
+
if (!CUSTOM_EVENT_NAME_PATTERN.test(name)) {
|
|
5786
|
+
refuse("the name must be `<namespace>.<event>` — lowercase letters, digits and `_`, a dot between them");
|
|
5787
|
+
} else if (name.split(".")[0] === CUSTOM_EVENT_RESERVED_NAMESPACE) {
|
|
5788
|
+
refuse(`the \`${CUSTOM_EVENT_RESERVED_NAMESPACE}.\` namespace is reserved for Vinaya's own events`);
|
|
5789
|
+
}
|
|
5790
|
+
const fieldEntries = Object.entries(declaration.fields);
|
|
5791
|
+
if (fieldEntries.length > CUSTOM_EVENT_MAX_FIELDS) {
|
|
5792
|
+
refuse(`at most ${CUSTOM_EVENT_MAX_FIELDS} fields may be declared (found ${fieldEntries.length})`, ["fields"]);
|
|
5793
|
+
}
|
|
5794
|
+
for (const [field, type] of fieldEntries) {
|
|
5795
|
+
if (field.length > CUSTOM_FIELD_NAME_MAX_LENGTH || !CUSTOM_FIELD_NAME_PATTERN.test(field)) {
|
|
5796
|
+
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]);
|
|
5797
|
+
}
|
|
5798
|
+
if (typeof type === "string")
|
|
5799
|
+
continue;
|
|
5800
|
+
if (type.length === 0) {
|
|
5801
|
+
refuse(`field "${field}": a list of words must name at least one word`, ["fields", field]);
|
|
5802
|
+
}
|
|
5803
|
+
if (type.length > CUSTOM_FIELD_MAX_WORDS) {
|
|
5804
|
+
refuse(`field "${field}": a list of words may name at most ${CUSTOM_FIELD_MAX_WORDS}`, ["fields", field]);
|
|
5805
|
+
}
|
|
5806
|
+
const bad = type.filter((w) => w.length > CUSTOM_WORD_MAX_LENGTH || !CUSTOM_WORD_PATTERN.test(w));
|
|
5807
|
+
if (bad.length > 0) {
|
|
5808
|
+
refuse(`field "${field}": a listed word is lowercase letters, digits, \`_\` and \`-\`, at most ${CUSTOM_WORD_MAX_LENGTH} characters`, ["fields", field]);
|
|
5809
|
+
}
|
|
5810
|
+
if (new Set(type).size !== type.length) {
|
|
5811
|
+
refuse(`field "${field}": a list of words names a word twice`, ["fields", field]);
|
|
5812
|
+
}
|
|
5813
|
+
}
|
|
5814
|
+
}
|
|
5815
|
+
});
|
|
5816
|
+
|
|
5817
|
+
// ../../packages/aeg-core/src/log/schema.ts
|
|
5688
5818
|
var CONFIDENCE_REASON_MAX_LENGTH = 280;
|
|
5819
|
+
var REVIEW_FINDING_DESCRIPTION_MAX_LENGTH = 1000;
|
|
5689
5820
|
var ROLE_VALUES = [
|
|
5690
5821
|
"planner",
|
|
5691
5822
|
"developer",
|
|
@@ -5695,178 +5826,214 @@ var ROLE_VALUES = [
|
|
|
5695
5826
|
"archivist",
|
|
5696
5827
|
"architect"
|
|
5697
5828
|
];
|
|
5698
|
-
var RoleSchema =
|
|
5829
|
+
var RoleSchema = z3.enum(ROLE_VALUES);
|
|
5699
5830
|
var HOST_VALUES = ["hook", "ci", "cli", "loop"];
|
|
5700
|
-
var HostSchema =
|
|
5831
|
+
var HostSchema = z3.enum(HOST_VALUES);
|
|
5701
5832
|
var RUN_ID_PATTERN = /^[A-Za-z0-9_.-]{1,128}$/;
|
|
5702
5833
|
var headerMetaCore = {
|
|
5703
|
-
ts:
|
|
5704
|
-
run_id:
|
|
5705
|
-
seq:
|
|
5706
|
-
repo:
|
|
5707
|
-
vinaya:
|
|
5708
|
-
doctrine:
|
|
5834
|
+
ts: z3.string(),
|
|
5835
|
+
run_id: z3.string().regex(RUN_ID_PATTERN),
|
|
5836
|
+
seq: z3.number().int().nonnegative(),
|
|
5837
|
+
repo: z3.string().nullable(),
|
|
5838
|
+
vinaya: z3.string(),
|
|
5839
|
+
doctrine: z3.string(),
|
|
5709
5840
|
host: HostSchema,
|
|
5710
|
-
machine:
|
|
5841
|
+
machine: z3.string()
|
|
5711
5842
|
};
|
|
5712
|
-
var HeaderMetaV1Schema =
|
|
5713
|
-
schema:
|
|
5843
|
+
var HeaderMetaV1Schema = z3.object({
|
|
5844
|
+
schema: z3.literal(1),
|
|
5714
5845
|
...headerMetaCore
|
|
5715
5846
|
}).strict();
|
|
5716
|
-
var LineageSchema =
|
|
5717
|
-
run:
|
|
5718
|
-
attempt:
|
|
5719
|
-
parent:
|
|
5847
|
+
var LineageSchema = z3.object({
|
|
5848
|
+
run: z3.string().nullable(),
|
|
5849
|
+
attempt: z3.number().int().nullable(),
|
|
5850
|
+
parent: z3.string().nullable()
|
|
5720
5851
|
}).strict();
|
|
5721
|
-
var InputVersionsSchema =
|
|
5722
|
-
objectives_version:
|
|
5723
|
-
brief_hash:
|
|
5724
|
-
ruling_ordinal:
|
|
5725
|
-
policy_digest:
|
|
5852
|
+
var InputVersionsSchema = z3.object({
|
|
5853
|
+
objectives_version: z3.string().nullable(),
|
|
5854
|
+
brief_hash: z3.string().nullable(),
|
|
5855
|
+
ruling_ordinal: z3.number().int().nullable(),
|
|
5856
|
+
policy_digest: z3.string().nullable()
|
|
5726
5857
|
}).strict();
|
|
5727
|
-
var ProvenanceSchema =
|
|
5728
|
-
var HeaderMetaV2Schema =
|
|
5729
|
-
schema:
|
|
5858
|
+
var ProvenanceSchema = z3.enum(["parent_attributed", "env_correlated", "self_reported", "unavailable"]);
|
|
5859
|
+
var HeaderMetaV2Schema = z3.object({
|
|
5860
|
+
schema: z3.literal(2),
|
|
5730
5861
|
...headerMetaCore,
|
|
5731
|
-
event_id:
|
|
5732
|
-
process_id:
|
|
5733
|
-
actor_id:
|
|
5862
|
+
event_id: z3.string().min(1),
|
|
5863
|
+
process_id: z3.string().min(1),
|
|
5864
|
+
actor_id: z3.string().nullable(),
|
|
5734
5865
|
lineage: LineageSchema,
|
|
5735
5866
|
input_versions: InputVersionsSchema,
|
|
5736
5867
|
provenance: ProvenanceSchema
|
|
5737
5868
|
}).strict();
|
|
5738
|
-
var
|
|
5739
|
-
|
|
5740
|
-
|
|
5741
|
-
|
|
5742
|
-
|
|
5743
|
-
|
|
5744
|
-
|
|
5745
|
-
|
|
5869
|
+
var WorkSchema = z3.object({
|
|
5870
|
+
ref: z3.string().nullable(),
|
|
5871
|
+
repo: z3.string().nullable(),
|
|
5872
|
+
change: z3.string().nullable(),
|
|
5873
|
+
revision: z3.string().nullable()
|
|
5874
|
+
}).strict();
|
|
5875
|
+
var FlowSchema = z3.object({
|
|
5876
|
+
id: z3.string().nullable(),
|
|
5877
|
+
version: z3.string().nullable()
|
|
5878
|
+
}).strict();
|
|
5879
|
+
var HeaderMetaV3Schema = z3.object({
|
|
5880
|
+
schema: z3.literal(3),
|
|
5881
|
+
...headerMetaCore,
|
|
5882
|
+
event_id: z3.string().min(1),
|
|
5883
|
+
process_id: z3.string().min(1),
|
|
5884
|
+
actor_id: z3.string().nullable(),
|
|
5885
|
+
lineage: LineageSchema,
|
|
5886
|
+
input_versions: InputVersionsSchema,
|
|
5887
|
+
provenance: ProvenanceSchema,
|
|
5888
|
+
work: WorkSchema,
|
|
5889
|
+
flow: FlowSchema,
|
|
5890
|
+
runtime: z3.string().nullable(),
|
|
5891
|
+
source: z3.string().nullable()
|
|
5892
|
+
}).strict();
|
|
5893
|
+
var HeaderMetaSchema = z3.discriminatedUnion("schema", [HeaderMetaV1Schema, HeaderMetaV2Schema, HeaderMetaV3Schema]);
|
|
5894
|
+
var SubjectSchema = z3.object({
|
|
5895
|
+
issue: z3.number().int().nullable(),
|
|
5896
|
+
pr: z3.number().int().optional(),
|
|
5897
|
+
sha: z3.string().optional(),
|
|
5898
|
+
role: z3.union([RoleSchema, z3.literal("unattributed")]),
|
|
5899
|
+
round: z3.number().int().optional(),
|
|
5900
|
+
objectives_version: z3.string().optional()
|
|
5746
5901
|
}).strict();
|
|
5747
|
-
var HeaderSchema =
|
|
5902
|
+
var HeaderSchema = z3.object({
|
|
5748
5903
|
meta: HeaderMetaSchema,
|
|
5749
5904
|
subject: SubjectSchema
|
|
5750
5905
|
}).strict();
|
|
5751
5906
|
var envelopeTail = {
|
|
5752
|
-
duration_ms:
|
|
5753
|
-
payload:
|
|
5907
|
+
duration_ms: z3.number().nonnegative().optional(),
|
|
5908
|
+
payload: z3.object({}).strict()
|
|
5754
5909
|
};
|
|
5755
|
-
var ReviewFindingSchema =
|
|
5756
|
-
id:
|
|
5757
|
-
severity:
|
|
5758
|
-
|
|
5759
|
-
|
|
5760
|
-
|
|
5761
|
-
|
|
5762
|
-
|
|
5763
|
-
|
|
5910
|
+
var ReviewFindingSchema = z3.object({
|
|
5911
|
+
id: z3.string(),
|
|
5912
|
+
severity: z3.string(),
|
|
5913
|
+
location: z3.string().optional(),
|
|
5914
|
+
deferral_reason: z3.enum(["outside-surface", "unchanged-line"]).optional(),
|
|
5915
|
+
description: z3.string().max(REVIEW_FINDING_DESCRIPTION_MAX_LENGTH).optional(),
|
|
5916
|
+
state: z3.string().optional(),
|
|
5917
|
+
severity_scale: z3.string().optional(),
|
|
5918
|
+
policy_treatment: z3.enum(["blocking", "non_blocking", "unavailable"]).optional(),
|
|
5919
|
+
confidence: z3.number().min(0).max(1).optional(),
|
|
5920
|
+
confidence_scale: z3.string().optional(),
|
|
5921
|
+
confidence_source: z3.string().optional()
|
|
5764
5922
|
}).strict();
|
|
5765
|
-
var DispatchOutcomeSchema =
|
|
5766
|
-
|
|
5767
|
-
|
|
5768
|
-
type:
|
|
5769
|
-
pr:
|
|
5770
|
-
head:
|
|
5771
|
-
comment_id:
|
|
5923
|
+
var DispatchOutcomeSchema = z3.discriminatedUnion("type", [
|
|
5924
|
+
z3.object({ type: z3.literal("pr_opened"), pr: z3.number().int(), head: z3.string() }).strict(),
|
|
5925
|
+
z3.object({
|
|
5926
|
+
type: z3.literal("round_pushed"),
|
|
5927
|
+
pr: z3.number().int(),
|
|
5928
|
+
head: z3.string(),
|
|
5929
|
+
comment_id: z3.number().int()
|
|
5772
5930
|
}).strict(),
|
|
5773
|
-
|
|
5774
|
-
type:
|
|
5775
|
-
verdict:
|
|
5776
|
-
head:
|
|
5777
|
-
comment_id:
|
|
5778
|
-
objectives:
|
|
5779
|
-
findings:
|
|
5931
|
+
z3.object({
|
|
5932
|
+
type: z3.literal("verdict"),
|
|
5933
|
+
verdict: z3.enum(["APPROVE", "REQUEST CHANGES", "PASS", "FAIL"]),
|
|
5934
|
+
head: z3.string(),
|
|
5935
|
+
comment_id: z3.number().int(),
|
|
5936
|
+
objectives: z3.array(z3.object({ id: z3.string(), met: z3.boolean() }).strict()),
|
|
5937
|
+
findings: z3.array(ReviewFindingSchema)
|
|
5780
5938
|
}).strict(),
|
|
5781
|
-
|
|
5782
|
-
type:
|
|
5783
|
-
class:
|
|
5784
|
-
comment_id:
|
|
5939
|
+
z3.object({
|
|
5940
|
+
type: z3.literal("escalation"),
|
|
5941
|
+
class: z3.enum(["authority", "strategy", "product"]),
|
|
5942
|
+
comment_id: z3.number().int()
|
|
5785
5943
|
}).strict(),
|
|
5786
|
-
|
|
5787
|
-
|
|
5788
|
-
|
|
5789
|
-
|
|
5944
|
+
z3.object({ type: z3.literal("brief"), comment_id: z3.number().int(), hash: z3.string() }).strict(),
|
|
5945
|
+
z3.object({ type: z3.literal("plan"), issues: z3.array(z3.number().int()) }).strict(),
|
|
5946
|
+
z3.object({ type: z3.literal("archive"), provenance_comment_id: z3.number().int() }).strict(),
|
|
5947
|
+
z3.object({ type: z3.literal("completed") }).strict()
|
|
5790
5948
|
]);
|
|
5791
5949
|
var dispatchShared = {
|
|
5792
5950
|
meta: HeaderMetaSchema,
|
|
5793
5951
|
subject: SubjectSchema,
|
|
5794
|
-
kind:
|
|
5952
|
+
kind: z3.literal("dispatch"),
|
|
5795
5953
|
...envelopeTail,
|
|
5796
5954
|
target_role: RoleSchema,
|
|
5797
|
-
model:
|
|
5798
|
-
round:
|
|
5799
|
-
effect_id:
|
|
5955
|
+
model: z3.string(),
|
|
5956
|
+
round: z3.number().int().optional(),
|
|
5957
|
+
effect_id: z3.string()
|
|
5800
5958
|
};
|
|
5801
|
-
var dispatchUsageField =
|
|
5802
|
-
var DispatchEventSchema =
|
|
5803
|
-
|
|
5804
|
-
|
|
5959
|
+
var dispatchUsageField = z3.object({ input: z3.number().nonnegative(), output: z3.number().nonnegative() }).strict().nullable();
|
|
5960
|
+
var DispatchEventSchema = z3.discriminatedUnion("event", [
|
|
5961
|
+
z3.object({ ...dispatchShared, event: z3.literal("dispatched"), prompt_hash: z3.string() }).strict(),
|
|
5962
|
+
z3.object({
|
|
5805
5963
|
...dispatchShared,
|
|
5806
|
-
event:
|
|
5964
|
+
event: z3.literal("outcome_received"),
|
|
5807
5965
|
outcome: DispatchOutcomeSchema,
|
|
5808
5966
|
usage: dispatchUsageField
|
|
5809
5967
|
}).strict(),
|
|
5810
|
-
|
|
5968
|
+
z3.object({
|
|
5811
5969
|
...dispatchShared,
|
|
5812
|
-
event:
|
|
5813
|
-
reason:
|
|
5970
|
+
event: z3.literal("dispatch_failed"),
|
|
5971
|
+
reason: z3.enum(["timeout", "crash", "refused", "unattributed_write", "usage_limit"]),
|
|
5972
|
+
usage_limit: z3.object({ agent: z3.string().min(1), reset_at: z3.string().nullable() }).strict().optional(),
|
|
5814
5973
|
usage: dispatchUsageField
|
|
5815
5974
|
}).strict()
|
|
5816
5975
|
]);
|
|
5976
|
+
var CODE_TOKEN_PATTERN = /^[A-Za-z0-9._-]{1,64}$/;
|
|
5977
|
+
var CodeTokenSchema = z3.string().regex(CODE_TOKEN_PATTERN);
|
|
5978
|
+
var ReviewerVerdictSchema = z3.object({
|
|
5979
|
+
role: RoleSchema,
|
|
5980
|
+
outcome: z3.enum(["approve", "changes_requested", "not_reviewed"]),
|
|
5981
|
+
blockers: z3.number().int().nonnegative()
|
|
5982
|
+
}).strict();
|
|
5817
5983
|
var loopShared = {
|
|
5818
5984
|
meta: HeaderMetaSchema,
|
|
5819
5985
|
subject: SubjectSchema,
|
|
5820
|
-
kind:
|
|
5986
|
+
kind: z3.literal("dev_review_loop"),
|
|
5821
5987
|
...envelopeTail,
|
|
5822
|
-
loop_id:
|
|
5988
|
+
loop_id: z3.string()
|
|
5823
5989
|
};
|
|
5824
|
-
var DevReviewLoopEventSchema =
|
|
5825
|
-
|
|
5990
|
+
var DevReviewLoopEventSchema = z3.discriminatedUnion("event", [
|
|
5991
|
+
z3.object({
|
|
5826
5992
|
...loopShared,
|
|
5827
|
-
event:
|
|
5828
|
-
task:
|
|
5829
|
-
policy:
|
|
5830
|
-
max_rounds:
|
|
5831
|
-
reviewers:
|
|
5832
|
-
models:
|
|
5993
|
+
event: z3.literal("loop_started"),
|
|
5994
|
+
task: z3.number().int(),
|
|
5995
|
+
policy: z3.object({
|
|
5996
|
+
max_rounds: z3.number().int().nonnegative(),
|
|
5997
|
+
reviewers: z3.array(RoleSchema),
|
|
5998
|
+
models: z3.record(RoleSchema, z3.string())
|
|
5833
5999
|
}).strict()
|
|
5834
6000
|
}).strict(),
|
|
5835
|
-
|
|
5836
|
-
|
|
6001
|
+
z3.object({ ...loopShared, event: z3.literal("round_started"), round: z3.number().int(), base_head: z3.string() }).strict(),
|
|
6002
|
+
z3.object({
|
|
5837
6003
|
...loopShared,
|
|
5838
|
-
event:
|
|
5839
|
-
round:
|
|
5840
|
-
head:
|
|
5841
|
-
green:
|
|
5842
|
-
confidence_value:
|
|
5843
|
-
confidence_reason:
|
|
5844
|
-
confidence_unavailable:
|
|
5845
|
-
extra_turn_spent:
|
|
6004
|
+
event: z3.literal("gate_result_read"),
|
|
6005
|
+
round: z3.number().int(),
|
|
6006
|
+
head: z3.string(),
|
|
6007
|
+
green: z3.boolean(),
|
|
6008
|
+
confidence_value: z3.number().int().min(0).max(100).optional(),
|
|
6009
|
+
confidence_reason: z3.string().max(CONFIDENCE_REASON_MAX_LENGTH).optional(),
|
|
6010
|
+
confidence_unavailable: z3.boolean().optional(),
|
|
6011
|
+
extra_turn_spent: z3.boolean().optional()
|
|
5846
6012
|
}).strict(),
|
|
5847
|
-
|
|
6013
|
+
z3.object({
|
|
5848
6014
|
...loopShared,
|
|
5849
|
-
event:
|
|
5850
|
-
round:
|
|
5851
|
-
head:
|
|
5852
|
-
all_approve:
|
|
5853
|
-
blockers:
|
|
5854
|
-
findings:
|
|
6015
|
+
event: z3.literal("verdicts_read"),
|
|
6016
|
+
round: z3.number().int(),
|
|
6017
|
+
head: z3.string(),
|
|
6018
|
+
all_approve: z3.boolean(),
|
|
6019
|
+
blockers: z3.number().int().nonnegative(),
|
|
6020
|
+
findings: z3.array(ReviewFindingSchema).optional(),
|
|
6021
|
+
reviewers: z3.array(ReviewerVerdictSchema).optional()
|
|
5855
6022
|
}).strict(),
|
|
5856
|
-
|
|
6023
|
+
z3.object({
|
|
5857
6024
|
...loopShared,
|
|
5858
|
-
event:
|
|
5859
|
-
round:
|
|
5860
|
-
open:
|
|
5861
|
-
resolved:
|
|
5862
|
-
new:
|
|
5863
|
-
recurring:
|
|
6025
|
+
event: z3.literal("findings_compared"),
|
|
6026
|
+
round: z3.number().int(),
|
|
6027
|
+
open: z3.array(z3.string()),
|
|
6028
|
+
resolved: z3.array(z3.string()),
|
|
6029
|
+
new: z3.array(z3.string()),
|
|
6030
|
+
recurring: z3.array(z3.string())
|
|
5864
6031
|
}).strict(),
|
|
5865
|
-
|
|
6032
|
+
z3.object({
|
|
5866
6033
|
...loopShared,
|
|
5867
|
-
event:
|
|
5868
|
-
round:
|
|
5869
|
-
condition:
|
|
6034
|
+
event: z3.literal("stop_condition_met"),
|
|
6035
|
+
round: z3.number().int(),
|
|
6036
|
+
condition: z3.enum([
|
|
5870
6037
|
"green",
|
|
5871
6038
|
"max_rounds",
|
|
5872
6039
|
"no_progress",
|
|
@@ -5875,66 +6042,85 @@ var DevReviewLoopEventSchema = z2.discriminatedUnion("event", [
|
|
|
5875
6042
|
"confidence",
|
|
5876
6043
|
"reappearance",
|
|
5877
6044
|
"repeat_finding",
|
|
5878
|
-
"repeat_failure"
|
|
6045
|
+
"repeat_failure",
|
|
6046
|
+
"time_budget"
|
|
5879
6047
|
])
|
|
5880
6048
|
}).strict(),
|
|
5881
|
-
|
|
6049
|
+
z3.object({
|
|
6050
|
+
...loopShared,
|
|
6051
|
+
event: z3.literal("paused"),
|
|
6052
|
+
round: z3.number().int(),
|
|
6053
|
+
reason: z3.enum(["escalation", "principal_item", "refreeze_needed"]),
|
|
6054
|
+
reason_code: CodeTokenSchema.optional()
|
|
6055
|
+
}).strict(),
|
|
6056
|
+
z3.object({
|
|
6057
|
+
...loopShared,
|
|
6058
|
+
event: z3.literal("resumed"),
|
|
6059
|
+
round: z3.number().int(),
|
|
6060
|
+
by: z3.enum(["principal", "driver"])
|
|
6061
|
+
}).strict(),
|
|
6062
|
+
z3.object({
|
|
5882
6063
|
...loopShared,
|
|
5883
|
-
event:
|
|
5884
|
-
round:
|
|
5885
|
-
|
|
6064
|
+
event: z3.literal("cancelled"),
|
|
6065
|
+
round: z3.number().int(),
|
|
6066
|
+
by: z3.literal("principal")
|
|
5886
6067
|
}).strict(),
|
|
5887
|
-
|
|
6068
|
+
z3.object({
|
|
5888
6069
|
...loopShared,
|
|
5889
|
-
event:
|
|
5890
|
-
round:
|
|
5891
|
-
|
|
6070
|
+
event: z3.literal("unpushed_work_resume"),
|
|
6071
|
+
round: z3.number().int(),
|
|
6072
|
+
branch: z3.string(),
|
|
6073
|
+
detail: z3.string()
|
|
5892
6074
|
}).strict(),
|
|
5893
|
-
|
|
6075
|
+
z3.object({
|
|
5894
6076
|
...loopShared,
|
|
5895
|
-
event:
|
|
5896
|
-
round:
|
|
5897
|
-
|
|
6077
|
+
event: z3.literal("round_ended"),
|
|
6078
|
+
round: z3.number().int(),
|
|
6079
|
+
base_head: z3.string(),
|
|
6080
|
+
head: z3.string(),
|
|
6081
|
+
files_changed: z3.number().int().nonnegative(),
|
|
6082
|
+
insertions: z3.number().int().nonnegative(),
|
|
6083
|
+
deletions: z3.number().int().nonnegative(),
|
|
6084
|
+
wall_ms: z3.number().nonnegative(),
|
|
6085
|
+
outcome: z3.enum(["green", "changes_requested", "escalated"])
|
|
5898
6086
|
}).strict(),
|
|
5899
|
-
|
|
6087
|
+
z3.object({
|
|
5900
6088
|
...loopShared,
|
|
5901
|
-
event:
|
|
5902
|
-
|
|
5903
|
-
|
|
5904
|
-
|
|
6089
|
+
event: z3.literal("journal_finalized"),
|
|
6090
|
+
rounds: z3.number().int().nonnegative(),
|
|
6091
|
+
total_wall_ms: z3.number().nonnegative(),
|
|
6092
|
+
time_to_green_ms: z3.number().nonnegative().nullable(),
|
|
6093
|
+
files_changed_total: z3.number().int().nonnegative(),
|
|
6094
|
+
final_head: z3.string(),
|
|
6095
|
+
result: z3.enum(["merged_ready", "stopped"])
|
|
5905
6096
|
}).strict(),
|
|
5906
|
-
|
|
6097
|
+
z3.object({
|
|
5907
6098
|
...loopShared,
|
|
5908
|
-
event:
|
|
5909
|
-
round:
|
|
5910
|
-
|
|
5911
|
-
|
|
5912
|
-
|
|
5913
|
-
insertions: z2.number().int().nonnegative(),
|
|
5914
|
-
deletions: z2.number().int().nonnegative(),
|
|
5915
|
-
wall_ms: z2.number().nonnegative(),
|
|
5916
|
-
outcome: z2.enum(["green", "changes_requested", "escalated"])
|
|
6099
|
+
event: z3.literal("infrastructure_retry"),
|
|
6100
|
+
round: z3.number().int(),
|
|
6101
|
+
failure_kind: z3.enum(["pause_comment_post", "developer_connection"]),
|
|
6102
|
+
attempts: z3.number().int().positive(),
|
|
6103
|
+
outcome: z3.enum(["recovered", "exhausted"])
|
|
5917
6104
|
}).strict(),
|
|
5918
|
-
|
|
6105
|
+
z3.object({
|
|
5919
6106
|
...loopShared,
|
|
5920
|
-
event:
|
|
5921
|
-
|
|
5922
|
-
|
|
5923
|
-
|
|
5924
|
-
|
|
5925
|
-
final_head: z2.string(),
|
|
5926
|
-
result: z2.enum(["merged_ready", "stopped"])
|
|
6107
|
+
event: z3.literal("driver_heartbeat"),
|
|
6108
|
+
task: z3.number().int(),
|
|
6109
|
+
pr: z3.number().int().positive().optional(),
|
|
6110
|
+
round: z3.number().int(),
|
|
6111
|
+
phase: z3.string()
|
|
5927
6112
|
}).strict(),
|
|
5928
|
-
|
|
6113
|
+
z3.object({
|
|
5929
6114
|
...loopShared,
|
|
5930
|
-
event:
|
|
5931
|
-
|
|
5932
|
-
|
|
5933
|
-
|
|
5934
|
-
|
|
6115
|
+
event: z3.literal("driver_exited"),
|
|
6116
|
+
task: z3.number().int(),
|
|
6117
|
+
reason: z3.enum(["finished", "paused", "reexec", "error", "signal"]),
|
|
6118
|
+
last_decision: z3.string(),
|
|
6119
|
+
exit_code: z3.number().int().optional(),
|
|
6120
|
+
error_class: CodeTokenSchema.optional()
|
|
5935
6121
|
}).strict()
|
|
5936
6122
|
]);
|
|
5937
|
-
var ForgeOpSchema =
|
|
6123
|
+
var ForgeOpSchema = z3.enum([
|
|
5938
6124
|
"pr.create",
|
|
5939
6125
|
"pr.comment",
|
|
5940
6126
|
"pr.body.replace",
|
|
@@ -5948,24 +6134,24 @@ var ForgeOpSchema = z2.enum([
|
|
|
5948
6134
|
"label.add",
|
|
5949
6135
|
"label.remove"
|
|
5950
6136
|
]);
|
|
5951
|
-
var ForgeWriteTargetSchema =
|
|
5952
|
-
issue:
|
|
5953
|
-
pr:
|
|
6137
|
+
var ForgeWriteTargetSchema = z3.object({
|
|
6138
|
+
issue: z3.number().int().optional(),
|
|
6139
|
+
pr: z3.number().int().optional()
|
|
5954
6140
|
}).strict();
|
|
5955
6141
|
var forgeWriteShared = {
|
|
5956
6142
|
meta: HeaderMetaSchema,
|
|
5957
6143
|
subject: SubjectSchema,
|
|
5958
|
-
kind:
|
|
6144
|
+
kind: z3.literal("forge_write"),
|
|
5959
6145
|
...envelopeTail,
|
|
5960
6146
|
op: ForgeOpSchema,
|
|
5961
6147
|
target: ForgeWriteTargetSchema
|
|
5962
6148
|
};
|
|
5963
|
-
var ForgeWriteEventSchema =
|
|
5964
|
-
|
|
5965
|
-
|
|
5966
|
-
|
|
6149
|
+
var ForgeWriteEventSchema = z3.discriminatedUnion("event", [
|
|
6150
|
+
z3.object({ ...forgeWriteShared, event: z3.literal("validated") }).strict(),
|
|
6151
|
+
z3.object({ ...forgeWriteShared, event: z3.literal("refused"), reason: z3.string() }).strict(),
|
|
6152
|
+
z3.object({ ...forgeWriteShared, event: z3.literal("written"), comment_ids: z3.array(z3.string()) }).strict()
|
|
5967
6153
|
]);
|
|
5968
|
-
var GateOutcomeSchema =
|
|
6154
|
+
var GateOutcomeSchema = z3.enum([
|
|
5969
6155
|
"pass",
|
|
5970
6156
|
"fail",
|
|
5971
6157
|
"wait",
|
|
@@ -5978,61 +6164,74 @@ var GateOutcomeSchema = z2.enum([
|
|
|
5978
6164
|
var gateShared = {
|
|
5979
6165
|
meta: HeaderMetaSchema,
|
|
5980
6166
|
subject: SubjectSchema,
|
|
5981
|
-
kind:
|
|
6167
|
+
kind: z3.literal("gate"),
|
|
5982
6168
|
...envelopeTail,
|
|
5983
|
-
check:
|
|
5984
|
-
check_version:
|
|
5985
|
-
policy_version:
|
|
5986
|
-
input_fingerprint:
|
|
6169
|
+
check: z3.string(),
|
|
6170
|
+
check_version: z3.string().nullable(),
|
|
6171
|
+
policy_version: z3.string().nullable(),
|
|
6172
|
+
input_fingerprint: z3.string().nullable()
|
|
5987
6173
|
};
|
|
5988
|
-
var GateEventSchema =
|
|
5989
|
-
|
|
6174
|
+
var GateEventSchema = z3.discriminatedUnion("event", [
|
|
6175
|
+
z3.object({
|
|
5990
6176
|
...gateShared,
|
|
5991
|
-
event:
|
|
6177
|
+
event: z3.literal("checked"),
|
|
5992
6178
|
outcome: GateOutcomeSchema,
|
|
5993
|
-
reason:
|
|
6179
|
+
reason: z3.string().optional()
|
|
6180
|
+
}).strict(),
|
|
6181
|
+
z3.object({
|
|
6182
|
+
meta: HeaderMetaSchema,
|
|
6183
|
+
subject: SubjectSchema,
|
|
6184
|
+
kind: z3.literal("gate"),
|
|
6185
|
+
...envelopeTail,
|
|
6186
|
+
event: z3.literal("summary"),
|
|
6187
|
+
ran: z3.number().int().nonnegative(),
|
|
6188
|
+
passed: z3.number().int().nonnegative(),
|
|
6189
|
+
failed: z3.number().int().nonnegative(),
|
|
6190
|
+
skipped: z3.number().int().nonnegative(),
|
|
6191
|
+
failed_checks: z3.array(z3.string())
|
|
5994
6192
|
}).strict()
|
|
5995
6193
|
]);
|
|
5996
|
-
var OperationResultSchema =
|
|
6194
|
+
var OperationResultSchema = z3.enum(["ok", "error", "refused", "timeout", "cancelled", "unavailable"]);
|
|
5997
6195
|
var operationShared = {
|
|
5998
6196
|
meta: HeaderMetaSchema,
|
|
5999
6197
|
subject: SubjectSchema,
|
|
6000
|
-
kind:
|
|
6198
|
+
kind: z3.literal("operation"),
|
|
6001
6199
|
...envelopeTail,
|
|
6002
|
-
operation:
|
|
6003
|
-
target:
|
|
6200
|
+
operation: z3.string(),
|
|
6201
|
+
target: z3.string().nullable()
|
|
6004
6202
|
};
|
|
6005
|
-
var OperationEventSchema =
|
|
6006
|
-
|
|
6203
|
+
var OperationEventSchema = z3.discriminatedUnion("event", [
|
|
6204
|
+
z3.object({
|
|
6007
6205
|
...operationShared,
|
|
6008
|
-
event:
|
|
6206
|
+
event: z3.literal("completed"),
|
|
6009
6207
|
result: OperationResultSchema,
|
|
6010
|
-
error_class:
|
|
6208
|
+
error_class: z3.string().nullable(),
|
|
6209
|
+
field_names: z3.array(z3.string().max(CUSTOM_FIELD_NAME_MAX_LENGTH)).max(CUSTOM_EVENT_MAX_FIELDS).optional()
|
|
6011
6210
|
}).strict()
|
|
6012
6211
|
]);
|
|
6013
|
-
var UsageUnitsSchema =
|
|
6014
|
-
input:
|
|
6015
|
-
output:
|
|
6016
|
-
cache:
|
|
6212
|
+
var UsageUnitsSchema = z3.object({
|
|
6213
|
+
input: z3.number().nonnegative().nullable(),
|
|
6214
|
+
output: z3.number().nonnegative().nullable(),
|
|
6215
|
+
cache: z3.number().nonnegative().nullable()
|
|
6017
6216
|
}).strict();
|
|
6018
6217
|
var usageShared = {
|
|
6019
6218
|
meta: HeaderMetaSchema,
|
|
6020
6219
|
subject: SubjectSchema,
|
|
6021
|
-
kind:
|
|
6220
|
+
kind: z3.literal("usage"),
|
|
6022
6221
|
...envelopeTail,
|
|
6023
|
-
model:
|
|
6024
|
-
source:
|
|
6025
|
-
semantics:
|
|
6222
|
+
model: z3.string().nullable(),
|
|
6223
|
+
source: z3.string(),
|
|
6224
|
+
semantics: z3.enum(["cumulative", "delta"])
|
|
6026
6225
|
};
|
|
6027
|
-
var UsageEventSchema =
|
|
6028
|
-
|
|
6226
|
+
var UsageEventSchema = z3.discriminatedUnion("event", [
|
|
6227
|
+
z3.object({
|
|
6029
6228
|
...usageShared,
|
|
6030
|
-
event:
|
|
6229
|
+
event: z3.literal("observed"),
|
|
6031
6230
|
units: UsageUnitsSchema,
|
|
6032
|
-
unknown_reason:
|
|
6231
|
+
unknown_reason: z3.string().nullable()
|
|
6033
6232
|
}).strict()
|
|
6034
6233
|
]);
|
|
6035
|
-
var RoleAttemptOutcomeSchema =
|
|
6234
|
+
var RoleAttemptOutcomeSchema = z3.enum([
|
|
6036
6235
|
"completed",
|
|
6037
6236
|
"incomplete",
|
|
6038
6237
|
"infrastructure_failed",
|
|
@@ -6043,17 +6242,17 @@ var RoleAttemptOutcomeSchema = z2.enum([
|
|
|
6043
6242
|
var roleAttemptShared = {
|
|
6044
6243
|
meta: HeaderMetaSchema,
|
|
6045
6244
|
subject: SubjectSchema,
|
|
6046
|
-
kind:
|
|
6245
|
+
kind: z3.literal("role_attempt"),
|
|
6047
6246
|
...envelopeTail,
|
|
6048
|
-
actor:
|
|
6049
|
-
attempt:
|
|
6050
|
-
effect_id:
|
|
6051
|
-
model:
|
|
6247
|
+
actor: z3.string().nullable(),
|
|
6248
|
+
attempt: z3.number().int().nullable(),
|
|
6249
|
+
effect_id: z3.string(),
|
|
6250
|
+
model: z3.string().nullable()
|
|
6052
6251
|
};
|
|
6053
|
-
var RoleAttemptEventSchema =
|
|
6054
|
-
|
|
6252
|
+
var RoleAttemptEventSchema = z3.discriminatedUnion("event", [
|
|
6253
|
+
z3.object({
|
|
6055
6254
|
...roleAttemptShared,
|
|
6056
|
-
event:
|
|
6255
|
+
event: z3.literal("attempted"),
|
|
6057
6256
|
outcome: RoleAttemptOutcomeSchema,
|
|
6058
6257
|
usage: dispatchUsageField
|
|
6059
6258
|
}).strict()
|
|
@@ -6061,42 +6260,59 @@ var RoleAttemptEventSchema = z2.discriminatedUnion("event", [
|
|
|
6061
6260
|
var handoffShared = {
|
|
6062
6261
|
meta: HeaderMetaSchema,
|
|
6063
6262
|
subject: SubjectSchema,
|
|
6064
|
-
kind:
|
|
6263
|
+
kind: z3.literal("handoff"),
|
|
6065
6264
|
...envelopeTail,
|
|
6066
|
-
class:
|
|
6067
|
-
reason:
|
|
6265
|
+
class: z3.enum(["authority", "strategy", "product"]),
|
|
6266
|
+
reason: z3.string()
|
|
6068
6267
|
};
|
|
6069
|
-
var HandoffEventSchema =
|
|
6070
|
-
|
|
6268
|
+
var HandoffEventSchema = z3.discriminatedUnion("event", [
|
|
6269
|
+
z3.object({
|
|
6071
6270
|
...handoffShared,
|
|
6072
|
-
event:
|
|
6073
|
-
requested_decision:
|
|
6271
|
+
event: z3.literal("raised"),
|
|
6272
|
+
requested_decision: z3.string().nullable()
|
|
6074
6273
|
}).strict(),
|
|
6075
|
-
|
|
6274
|
+
z3.object({
|
|
6076
6275
|
...handoffShared,
|
|
6077
|
-
event:
|
|
6078
|
-
resolution:
|
|
6079
|
-
resolved_by:
|
|
6276
|
+
event: z3.literal("resolved"),
|
|
6277
|
+
resolution: z3.string().nullable(),
|
|
6278
|
+
resolved_by: z3.string().nullable()
|
|
6080
6279
|
}).strict()
|
|
6081
6280
|
]);
|
|
6082
|
-
var EffectTargetSchema =
|
|
6083
|
-
kind:
|
|
6084
|
-
ref:
|
|
6281
|
+
var EffectTargetSchema = z3.object({
|
|
6282
|
+
kind: z3.string(),
|
|
6283
|
+
ref: z3.string()
|
|
6085
6284
|
}).strict();
|
|
6086
6285
|
var effectShared = {
|
|
6087
6286
|
meta: HeaderMetaSchema,
|
|
6088
6287
|
subject: SubjectSchema,
|
|
6089
|
-
kind:
|
|
6288
|
+
kind: z3.literal("effect"),
|
|
6090
6289
|
...envelopeTail,
|
|
6091
|
-
effect_id:
|
|
6290
|
+
effect_id: z3.string(),
|
|
6092
6291
|
target: EffectTargetSchema
|
|
6093
6292
|
};
|
|
6094
|
-
var EffectEventSchema =
|
|
6095
|
-
|
|
6096
|
-
|
|
6097
|
-
|
|
6293
|
+
var EffectEventSchema = z3.discriminatedUnion("event", [
|
|
6294
|
+
z3.object({ ...effectShared, event: z3.literal("attempted") }).strict(),
|
|
6295
|
+
z3.object({ ...effectShared, event: z3.literal("observed"), outcome: z3.enum(["success", "failure", "uncertain"]) }).strict(),
|
|
6296
|
+
z3.object({ ...effectShared, event: z3.literal("verified"), outcome: z3.enum(["success", "failure", "uncertain"]) }).strict()
|
|
6297
|
+
]);
|
|
6298
|
+
var CustomFieldValueSchema = z3.union([z3.string().max(CUSTOM_TEXT_MAX_LENGTH), z3.number().finite(), z3.boolean()]);
|
|
6299
|
+
var customShared = {
|
|
6300
|
+
meta: HeaderMetaV3Schema,
|
|
6301
|
+
subject: SubjectSchema,
|
|
6302
|
+
kind: z3.literal("custom"),
|
|
6303
|
+
...envelopeTail
|
|
6304
|
+
};
|
|
6305
|
+
var CustomEventSchema = z3.discriminatedUnion("event", [
|
|
6306
|
+
z3.object({
|
|
6307
|
+
...customShared,
|
|
6308
|
+
event: z3.literal("recorded"),
|
|
6309
|
+
name: z3.string().max(CUSTOM_EVENT_NAME_MAX_LENGTH).regex(CUSTOM_EVENT_NAME_PATTERN),
|
|
6310
|
+
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, {
|
|
6311
|
+
message: `custom: at most ${CUSTOM_EVENT_MAX_FIELDS} fields`
|
|
6312
|
+
})
|
|
6313
|
+
}).strict()
|
|
6098
6314
|
]);
|
|
6099
|
-
var LogEventSchema =
|
|
6315
|
+
var LogEventSchema = z3.union([
|
|
6100
6316
|
DispatchEventSchema,
|
|
6101
6317
|
DevReviewLoopEventSchema,
|
|
6102
6318
|
ForgeWriteEventSchema,
|
|
@@ -6105,10 +6321,11 @@ var LogEventSchema = z2.union([
|
|
|
6105
6321
|
UsageEventSchema,
|
|
6106
6322
|
RoleAttemptEventSchema,
|
|
6107
6323
|
HandoffEventSchema,
|
|
6108
|
-
EffectEventSchema
|
|
6324
|
+
EffectEventSchema,
|
|
6325
|
+
CustomEventSchema
|
|
6109
6326
|
]);
|
|
6110
|
-
|
|
6111
6327
|
// ../../packages/aeg-core/src/log/envelope.ts
|
|
6328
|
+
import { createHash as createHash5 } from "node:crypto";
|
|
6112
6329
|
function isRole(value) {
|
|
6113
6330
|
return value !== undefined && ROLE_VALUES.includes(value);
|
|
6114
6331
|
}
|
|
@@ -6145,18 +6362,27 @@ function roundFromEnv(round) {
|
|
|
6145
6362
|
const n = Number(round);
|
|
6146
6363
|
return Number.isInteger(n) ? n : undefined;
|
|
6147
6364
|
}
|
|
6365
|
+
function prFromEnv(pr) {
|
|
6366
|
+
if (pr === undefined || pr === "")
|
|
6367
|
+
return;
|
|
6368
|
+
const n = Number(pr);
|
|
6369
|
+
return Number.isInteger(n) && n > 0 ? n : undefined;
|
|
6370
|
+
}
|
|
6148
6371
|
function buildHeader(input) {
|
|
6149
6372
|
const role = isRole(input.env.role) ? input.env.role : "unattributed";
|
|
6150
6373
|
const round = roundFromEnv(input.env.round);
|
|
6374
|
+
const pr = prFromEnv(input.env.pr);
|
|
6151
6375
|
const subject = {
|
|
6152
6376
|
issue: issueFromTask(input.env.task) ?? input.branchIssue ?? null,
|
|
6153
6377
|
role,
|
|
6154
6378
|
...round !== undefined ? { round } : {},
|
|
6379
|
+
...pr !== undefined ? { pr } : {},
|
|
6155
6380
|
...input.subject ?? {}
|
|
6156
6381
|
};
|
|
6382
|
+
const issue = subject.issue;
|
|
6157
6383
|
return {
|
|
6158
6384
|
meta: {
|
|
6159
|
-
schema:
|
|
6385
|
+
schema: 3,
|
|
6160
6386
|
ts: input.now.toISOString(),
|
|
6161
6387
|
run_id: input.runId,
|
|
6162
6388
|
seq: input.seq,
|
|
@@ -6179,7 +6405,19 @@ function buildHeader(input) {
|
|
|
6179
6405
|
ruling_ordinal: input.inputVersions?.rulingOrdinal ?? null,
|
|
6180
6406
|
policy_digest: input.inputVersions?.policyDigest ?? null
|
|
6181
6407
|
},
|
|
6182
|
-
provenance: provenanceFor(input)
|
|
6408
|
+
provenance: provenanceFor(input),
|
|
6409
|
+
work: {
|
|
6410
|
+
ref: lineageFieldFromEnv(input.env.workRef) ?? (issue === null ? null : String(issue)),
|
|
6411
|
+
repo: input.repo,
|
|
6412
|
+
change: null,
|
|
6413
|
+
revision: null
|
|
6414
|
+
},
|
|
6415
|
+
flow: {
|
|
6416
|
+
id: lineageFieldFromEnv(input.env.flow) ?? "vinaya",
|
|
6417
|
+
version: lineageFieldFromEnv(input.env.flowVersion)
|
|
6418
|
+
},
|
|
6419
|
+
runtime: lineageFieldFromEnv(input.env.runtime),
|
|
6420
|
+
source: lineageFieldFromEnv(input.env.source)
|
|
6183
6421
|
},
|
|
6184
6422
|
subject
|
|
6185
6423
|
};
|
|
@@ -6222,7 +6460,7 @@ function redact(value, home) {
|
|
|
6222
6460
|
return value;
|
|
6223
6461
|
}
|
|
6224
6462
|
// ../../packages/aeg-core/src/log/store.ts
|
|
6225
|
-
var KNOWN_SCHEMA_VERSIONS = [1, 2];
|
|
6463
|
+
var KNOWN_SCHEMA_VERSIONS = [1, 2, 3];
|
|
6226
6464
|
function metaOf(obj) {
|
|
6227
6465
|
if (obj === null || typeof obj !== "object")
|
|
6228
6466
|
return null;
|
|
@@ -6288,7 +6526,7 @@ function classifyStoredLine(raw, home) {
|
|
|
6288
6526
|
return { status: "invalid", identity: null, raw, reason: "valid event with no derivable identity" };
|
|
6289
6527
|
}
|
|
6290
6528
|
const redacted = redact(event, home);
|
|
6291
|
-
const provenance = version
|
|
6529
|
+
const provenance = version >= 2 ? event.meta.provenance ?? null : null;
|
|
6292
6530
|
return {
|
|
6293
6531
|
status: "ok",
|
|
6294
6532
|
identity,
|
|
@@ -6301,138 +6539,143 @@ function classifyStoredLine(raw, home) {
|
|
|
6301
6539
|
};
|
|
6302
6540
|
}
|
|
6303
6541
|
// ../../packages/aeg-core/src/control-store/records.ts
|
|
6304
|
-
import { z as
|
|
6305
|
-
var isoTimestamp =
|
|
6306
|
-
var taskId =
|
|
6307
|
-
var epochNumber =
|
|
6308
|
-
var RunRecordSchema =
|
|
6309
|
-
version:
|
|
6310
|
-
kind:
|
|
6542
|
+
import { z as z4 } from "zod";
|
|
6543
|
+
var isoTimestamp = z4.string().min(1);
|
|
6544
|
+
var taskId = z4.number().int().positive();
|
|
6545
|
+
var epochNumber = z4.number().int().nonnegative();
|
|
6546
|
+
var RunRecordSchema = z4.object({
|
|
6547
|
+
version: z4.literal(1),
|
|
6548
|
+
kind: z4.literal("run"),
|
|
6311
6549
|
task: taskId,
|
|
6312
|
-
runId:
|
|
6313
|
-
pid:
|
|
6314
|
-
host:
|
|
6550
|
+
runId: z4.string().min(1),
|
|
6551
|
+
pid: z4.number().int().positive(),
|
|
6552
|
+
host: z4.string().min(1),
|
|
6315
6553
|
startedAt: isoTimestamp,
|
|
6316
|
-
childStartedAt:
|
|
6317
|
-
childCommand:
|
|
6554
|
+
childStartedAt: z4.string().min(1).nullable().optional(),
|
|
6555
|
+
childCommand: z4.string().min(1).nullable().optional()
|
|
6318
6556
|
}).strict();
|
|
6319
|
-
var InputRecordSchema =
|
|
6320
|
-
version:
|
|
6321
|
-
kind:
|
|
6557
|
+
var InputRecordSchema = z4.object({
|
|
6558
|
+
version: z4.literal(1),
|
|
6559
|
+
kind: z4.literal("input"),
|
|
6322
6560
|
task: taskId,
|
|
6323
|
-
runId:
|
|
6324
|
-
source:
|
|
6325
|
-
pr:
|
|
6326
|
-
round:
|
|
6561
|
+
runId: z4.string().min(1),
|
|
6562
|
+
source: z4.union([z4.literal("fresh"), z4.literal("resume")]),
|
|
6563
|
+
pr: z4.number().int().positive().nullable(),
|
|
6564
|
+
round: z4.number().int().nonnegative(),
|
|
6327
6565
|
recordedAt: isoTimestamp
|
|
6328
6566
|
}).strict();
|
|
6329
|
-
var OwnershipRecordSchema =
|
|
6330
|
-
version:
|
|
6331
|
-
kind:
|
|
6567
|
+
var OwnershipRecordSchema = z4.object({
|
|
6568
|
+
version: z4.literal(1),
|
|
6569
|
+
kind: z4.literal("ownership"),
|
|
6332
6570
|
task: taskId,
|
|
6333
6571
|
epoch: epochNumber,
|
|
6334
|
-
ownerId:
|
|
6335
|
-
pid:
|
|
6336
|
-
host:
|
|
6572
|
+
ownerId: z4.string().min(1),
|
|
6573
|
+
pid: z4.number().int().positive(),
|
|
6574
|
+
host: z4.string().min(1),
|
|
6337
6575
|
acquiredAt: isoTimestamp
|
|
6338
6576
|
}).strict();
|
|
6339
|
-
var TransitionRecordSchema =
|
|
6340
|
-
version:
|
|
6341
|
-
kind:
|
|
6577
|
+
var TransitionRecordSchema = z4.object({
|
|
6578
|
+
version: z4.literal(1),
|
|
6579
|
+
kind: z4.literal("transition"),
|
|
6342
6580
|
task: taskId,
|
|
6343
6581
|
epoch: epochNumber,
|
|
6344
|
-
seq:
|
|
6345
|
-
from:
|
|
6346
|
-
to:
|
|
6347
|
-
detail:
|
|
6582
|
+
seq: z4.number().int().nonnegative(),
|
|
6583
|
+
from: z4.string().min(1),
|
|
6584
|
+
to: z4.string().min(1),
|
|
6585
|
+
detail: z4.string().optional(),
|
|
6348
6586
|
at: isoTimestamp
|
|
6349
6587
|
}).strict();
|
|
6350
|
-
var ManifestRecordSchema =
|
|
6351
|
-
version:
|
|
6352
|
-
kind:
|
|
6588
|
+
var ManifestRecordSchema = z4.object({
|
|
6589
|
+
version: z4.literal(1),
|
|
6590
|
+
kind: z4.literal("manifest"),
|
|
6353
6591
|
task: taskId,
|
|
6354
6592
|
round: epochNumber,
|
|
6355
|
-
repository:
|
|
6356
|
-
pr:
|
|
6357
|
-
branch:
|
|
6358
|
-
baseSha:
|
|
6359
|
-
headSha:
|
|
6360
|
-
briefHash:
|
|
6361
|
-
objectivesVersion:
|
|
6593
|
+
repository: z4.string().min(1),
|
|
6594
|
+
pr: z4.number().int().positive(),
|
|
6595
|
+
branch: z4.string().min(1),
|
|
6596
|
+
baseSha: z4.string().min(1).nullable(),
|
|
6597
|
+
headSha: z4.string().min(1),
|
|
6598
|
+
briefHash: z4.string().min(1).nullable(),
|
|
6599
|
+
objectivesVersion: z4.string().min(1).nullable(),
|
|
6362
6600
|
rulingOrdinal: epochNumber,
|
|
6363
|
-
policyDigest:
|
|
6601
|
+
policyDigest: z4.string().min(1),
|
|
6364
6602
|
recordedAt: isoTimestamp
|
|
6365
6603
|
}).strict();
|
|
6366
|
-
var roundHeadIdentity =
|
|
6367
|
-
var LoopBudgetsSchema =
|
|
6368
|
-
mechanicalRetries:
|
|
6369
|
-
reviewRounds:
|
|
6370
|
-
infrastructureRetries:
|
|
6604
|
+
var roundHeadIdentity = z4.object({ round: z4.number().int().positive(), head: z4.string().min(1) }).strict();
|
|
6605
|
+
var LoopBudgetsSchema = z4.object({
|
|
6606
|
+
mechanicalRetries: z4.number().int().nonnegative(),
|
|
6607
|
+
reviewRounds: z4.number().int().nonnegative(),
|
|
6608
|
+
infrastructureRetries: z4.number().int().nonnegative()
|
|
6371
6609
|
}).strict();
|
|
6372
|
-
var LoopStateRecordSchema =
|
|
6373
|
-
version:
|
|
6374
|
-
kind:
|
|
6610
|
+
var LoopStateRecordSchema = z4.object({
|
|
6611
|
+
version: z4.literal(1),
|
|
6612
|
+
kind: z4.literal("loop_state"),
|
|
6375
6613
|
task: taskId,
|
|
6376
|
-
round:
|
|
6377
|
-
phase:
|
|
6378
|
-
pauseReason:
|
|
6614
|
+
round: z4.number().int().positive(),
|
|
6615
|
+
phase: z4.string().min(1),
|
|
6616
|
+
pauseReason: z4.string().min(1).nullable(),
|
|
6379
6617
|
budgets: LoopBudgetsSchema,
|
|
6380
6618
|
heldResult: roundHeadIdentity.nullable(),
|
|
6381
6619
|
deliveredFindings: roundHeadIdentity.nullable(),
|
|
6382
|
-
repeatMemory:
|
|
6383
|
-
blockingFindings:
|
|
6384
|
-
lastFailure:
|
|
6620
|
+
repeatMemory: z4.object({
|
|
6621
|
+
blockingFindings: z4.array(z4.string()),
|
|
6622
|
+
lastFailure: z4.object({ signature: z4.string(), message: z4.string() }).nullable()
|
|
6385
6623
|
}).strict().optional(),
|
|
6624
|
+
publicationExpectedBase: z4.string().regex(/^[0-9a-f]{40}$/).nullable().optional(),
|
|
6625
|
+
taskStartedAt: isoTimestamp.optional(),
|
|
6626
|
+
phaseMs: z4.record(z4.string(), z4.number().nonnegative()).optional(),
|
|
6386
6627
|
recordedAt: isoTimestamp
|
|
6387
6628
|
}).strict();
|
|
6388
|
-
var EffectRecordSchema =
|
|
6389
|
-
version:
|
|
6390
|
-
kind:
|
|
6629
|
+
var EffectRecordSchema = z4.object({
|
|
6630
|
+
version: z4.literal(1),
|
|
6631
|
+
kind: z4.literal("effect"),
|
|
6391
6632
|
task: taskId,
|
|
6392
|
-
key:
|
|
6393
|
-
operation:
|
|
6394
|
-
target:
|
|
6395
|
-
inputVersion:
|
|
6396
|
-
payloadDigest:
|
|
6397
|
-
status:
|
|
6398
|
-
url:
|
|
6633
|
+
key: z4.string().min(1),
|
|
6634
|
+
operation: z4.string().min(1),
|
|
6635
|
+
target: z4.string().min(1),
|
|
6636
|
+
inputVersion: z4.number().int().nonnegative(),
|
|
6637
|
+
payloadDigest: z4.string().min(1),
|
|
6638
|
+
status: z4.union([z4.literal("started"), z4.literal("verified"), z4.literal("uncertain")]),
|
|
6639
|
+
url: z4.string().optional(),
|
|
6399
6640
|
recordedAt: isoTimestamp
|
|
6400
6641
|
}).strict();
|
|
6401
|
-
var EscalationRecordSchema =
|
|
6402
|
-
version:
|
|
6403
|
-
kind:
|
|
6642
|
+
var EscalationRecordSchema = z4.object({
|
|
6643
|
+
version: z4.literal(1),
|
|
6644
|
+
kind: z4.literal("escalation"),
|
|
6404
6645
|
task: taskId,
|
|
6405
|
-
escalationId:
|
|
6646
|
+
escalationId: z4.string().min(1),
|
|
6406
6647
|
round: epochNumber,
|
|
6407
|
-
head:
|
|
6408
|
-
branch:
|
|
6409
|
-
pr:
|
|
6410
|
-
runId:
|
|
6411
|
-
pid:
|
|
6412
|
-
host:
|
|
6413
|
-
agent:
|
|
6414
|
-
reason:
|
|
6415
|
-
detail:
|
|
6416
|
-
evidence:
|
|
6417
|
-
attemptedRecovery:
|
|
6418
|
-
requestedDecision:
|
|
6419
|
-
recipient:
|
|
6420
|
-
briefHash:
|
|
6421
|
-
objectivesVersion:
|
|
6648
|
+
head: z4.string().min(1),
|
|
6649
|
+
branch: z4.string().min(1),
|
|
6650
|
+
pr: z4.number().int().positive().nullable(),
|
|
6651
|
+
runId: z4.string().min(1),
|
|
6652
|
+
pid: z4.number().int().positive(),
|
|
6653
|
+
host: z4.string().min(1),
|
|
6654
|
+
agent: z4.string().min(1).optional(),
|
|
6655
|
+
reason: z4.string().min(1),
|
|
6656
|
+
detail: z4.string().optional(),
|
|
6657
|
+
evidence: z4.string().optional(),
|
|
6658
|
+
attemptedRecovery: z4.string().min(1),
|
|
6659
|
+
requestedDecision: z4.string().min(1),
|
|
6660
|
+
recipient: z4.string().min(1),
|
|
6661
|
+
briefHash: z4.string().min(1).nullable(),
|
|
6662
|
+
objectivesVersion: z4.string().min(1).nullable(),
|
|
6422
6663
|
rulingOrdinal: epochNumber,
|
|
6423
|
-
policyDigest:
|
|
6664
|
+
policyDigest: z4.string().min(1),
|
|
6424
6665
|
recordedAt: isoTimestamp
|
|
6425
6666
|
}).strict();
|
|
6426
|
-
var ResolutionRecordSchema =
|
|
6427
|
-
version:
|
|
6428
|
-
kind:
|
|
6667
|
+
var ResolutionRecordSchema = z4.object({
|
|
6668
|
+
version: z4.literal(1),
|
|
6669
|
+
kind: z4.literal("resolution"),
|
|
6429
6670
|
task: taskId,
|
|
6430
|
-
escalationId:
|
|
6431
|
-
decision:
|
|
6432
|
-
authenticatedBy:
|
|
6433
|
-
authenticatedFrom:
|
|
6671
|
+
escalationId: z4.string().min(1),
|
|
6672
|
+
decision: z4.union([z4.literal("resume"), z4.literal("cancel")]),
|
|
6673
|
+
authenticatedBy: z4.string().min(1),
|
|
6674
|
+
authenticatedFrom: z4.string().min(1),
|
|
6434
6675
|
consumedAt: isoTimestamp
|
|
6435
6676
|
}).strict();
|
|
6677
|
+
// ../../packages/aeg-core/src/control-store/local.ts
|
|
6678
|
+
var CONTROL_AREA_DIRNAME = "control";
|
|
6436
6679
|
// src/checks/contract.ts
|
|
6437
6680
|
var CHECK_SCHEMA_VERSION = 1;
|
|
6438
6681
|
function emitCheckError(error) {
|