@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
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The map of questions (`apps/cli/specs/log-sync.md`, "The questions"): one
|
|
3
|
+
* entry per question, under its number. A reader of the log looks a question
|
|
4
|
+
* up here and runs it over a dataset; a question added later is one more entry.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { Dataset } from '../sync'
|
|
8
|
+
import { catchesAndEscapes } from './catches'
|
|
9
|
+
import { checkOutcomes } from './checks'
|
|
10
|
+
import { completionByModel } from './completion'
|
|
11
|
+
import { changeSizeBands, confidenceVsOutcome, outcomesByInstructionVersion, recurringFindings } from './convergence'
|
|
12
|
+
import { determinism } from './determinism'
|
|
13
|
+
import { reviewerStrictness } from './judgment'
|
|
14
|
+
import { timeByUnit } from './time'
|
|
15
|
+
import { usageByUnitAndRole } from './usage'
|
|
16
|
+
|
|
17
|
+
export type Question<Answer> = {
|
|
18
|
+
/** The question's number; `null` for the confidence comparison, a companion comparison the spec names but does not number among the ten. */
|
|
19
|
+
number: number | null
|
|
20
|
+
title: string
|
|
21
|
+
/** A pure function over the dataset: no I/O, no clock. */
|
|
22
|
+
run(dataset: Dataset): Answer
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const QUESTIONS = {
|
|
26
|
+
q1: { number: 1, title: 'Does a cheaper model finish?', run: completionByModel },
|
|
27
|
+
q2: { number: 2, title: 'Are reviewers strict?', run: reviewerStrictness },
|
|
28
|
+
q3: { number: 3, title: 'What does a unit of work cost?', run: usageByUnitAndRole },
|
|
29
|
+
q4: { number: 4, title: 'Where does the time go?', run: timeByUnit },
|
|
30
|
+
q5: { number: 5, title: 'Does the product catch anything?', run: catchesAndEscapes },
|
|
31
|
+
q6: { number: 6, title: 'Which check catches most?', run: checkOutcomes },
|
|
32
|
+
q7: { number: 7, title: 'Are checks deterministic?', run: determinism },
|
|
33
|
+
q8: { number: 8, title: 'Which findings recur?', run: recurringFindings },
|
|
34
|
+
q9: { number: 9, title: 'Is the instruction version the problem?', run: outcomesByInstructionVersion },
|
|
35
|
+
q10: { number: 10, title: 'What change size converges?', run: changeSizeBands },
|
|
36
|
+
confidence: { number: null, title: 'Does stated confidence predict review outcome?', run: confidenceVsOutcome }
|
|
37
|
+
} satisfies Record<`q${number}` | 'confidence', Question<unknown>>
|
|
38
|
+
|
|
39
|
+
export type QuestionId = keyof typeof QUESTIONS
|
|
40
|
+
|
|
41
|
+
export { catchesAndEscapes } from './catches'
|
|
42
|
+
export type { CatchesAnswer } from './catches'
|
|
43
|
+
export { checkOutcomes } from './checks'
|
|
44
|
+
export type { CheckOutcome, ChecksAnswer } from './checks'
|
|
45
|
+
export { completionByModel } from './completion'
|
|
46
|
+
export type { CompletionAnswer, ModelCompletion, RoundsToGreen } from './completion'
|
|
47
|
+
export type { Coverage, UnknownFigure } from './common'
|
|
48
|
+
export { changeSizeBands, confidenceVsOutcome, outcomesByInstructionVersion, recurringFindings } from './convergence'
|
|
49
|
+
export type {
|
|
50
|
+
ChangeSizeAnswer,
|
|
51
|
+
ChangeSizeBand,
|
|
52
|
+
ConfidenceAnswer,
|
|
53
|
+
ConfidenceOutcome,
|
|
54
|
+
OutcomesByVersionAnswer,
|
|
55
|
+
RecurringFinding,
|
|
56
|
+
RecurringFindingsAnswer,
|
|
57
|
+
SizeBandOutcome,
|
|
58
|
+
VersionOutcome
|
|
59
|
+
} from './convergence'
|
|
60
|
+
export { determinism } from './determinism'
|
|
61
|
+
export type { DeterminismAnswer, FailureRecord } from './determinism'
|
|
62
|
+
export { reviewerStrictness } from './judgment'
|
|
63
|
+
export type { JudgmentAnswer, ReviewerStrictness, SeverityFindings, VerdictFindings } from './judgment'
|
|
64
|
+
export { NO_LABELS_REASON } from './labels'
|
|
65
|
+
export type { HumanLabel, HumanLabelKind } from './labels'
|
|
66
|
+
export { timeByUnit } from './time'
|
|
67
|
+
export type { Span, TimeAnswer, UnitTime } from './time'
|
|
68
|
+
export { usageByUnitAndRole } from './usage'
|
|
69
|
+
export type { RoleUsage, UnitUsage, UsageAnswer, UsageTotals } from './usage'
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Question 2 — are reviewers strict? (`apps/cli/specs/log-sync.md`, "The
|
|
3
|
+
* questions".) For each reviewer role and model, the verdicts a `dispatch`
|
|
4
|
+
* recorded and how they read, and the findings and blockers those verdicts
|
|
5
|
+
* carried, by severity. The answer counts what a verdict stated — `APPROVE`
|
|
6
|
+
* or `PASS` read as approved, `REQUEST CHANGES` or `FAIL` as changes
|
|
7
|
+
* requested, a finding's `policy_treatment: 'blocking'` as a blocker — and
|
|
8
|
+
* never scores whether a reviewer was right to decide as it did.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type { Dataset, DatasetRow } from '../sync'
|
|
12
|
+
import type { Coverage, UnknownFigure } from './common'
|
|
13
|
+
import { buildCoverage, compareText, groupBy, objectField, rowsOfKinds, textField, trustedRows } from './common'
|
|
14
|
+
|
|
15
|
+
const JUDGMENT_KINDS = ['dispatch']
|
|
16
|
+
const APPROVED_VERDICTS = ['APPROVE', 'PASS']
|
|
17
|
+
const CHANGES_REQUESTED_VERDICTS = ['REQUEST CHANGES', 'FAIL']
|
|
18
|
+
|
|
19
|
+
export type SeverityFindings = {
|
|
20
|
+
severity: string
|
|
21
|
+
/** Findings of this severity. */
|
|
22
|
+
findings: number
|
|
23
|
+
/** Of those, findings whose `policy_treatment` is `'blocking'`. */
|
|
24
|
+
blockers: number
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export type VerdictFindings = {
|
|
28
|
+
verdict: 'approved' | 'changes_requested'
|
|
29
|
+
/** Ascending by severity. */
|
|
30
|
+
bySeverity: SeverityFindings[]
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export type ReviewerStrictness = {
|
|
34
|
+
role: string
|
|
35
|
+
model: string
|
|
36
|
+
verdictsRead: number
|
|
37
|
+
approved: number
|
|
38
|
+
changesRequested: number
|
|
39
|
+
/** Ascending: `'approved'` then `'changes_requested'`. */
|
|
40
|
+
findings: VerdictFindings[]
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type JudgmentAnswer = {
|
|
44
|
+
/** Ascending by role, then model. */
|
|
45
|
+
reviewers: ReviewerStrictness[]
|
|
46
|
+
coverage: Coverage
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
type FindingFact = { severity: string; blocking: boolean }
|
|
50
|
+
|
|
51
|
+
type Verdict = { outcome: 'approved' | 'changes_requested'; findings: FindingFact[] }
|
|
52
|
+
|
|
53
|
+
function findingsOf(outcome: Record<string, unknown>): FindingFact[] {
|
|
54
|
+
const raw = outcome.findings
|
|
55
|
+
if (!Array.isArray(raw)) return []
|
|
56
|
+
const out: FindingFact[] = []
|
|
57
|
+
for (const item of raw) {
|
|
58
|
+
if (typeof item !== 'object' || item === null) continue
|
|
59
|
+
const severity = (item as Record<string, unknown>).severity
|
|
60
|
+
if (typeof severity !== 'string') continue
|
|
61
|
+
out.push({ severity, blocking: (item as Record<string, unknown>).policy_treatment === 'blocking' })
|
|
62
|
+
}
|
|
63
|
+
return out
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** The verdict a `dispatch`'s `outcome_received` line carries, or `null` when it is not a verdict outcome. */
|
|
67
|
+
function verdictOf(row: DatasetRow): Verdict | null {
|
|
68
|
+
if (row.event !== 'outcome_received') return null
|
|
69
|
+
const outcome = objectField(row, 'outcome')
|
|
70
|
+
if (outcome === null || outcome.type !== 'verdict') return null
|
|
71
|
+
const verdict = outcome.verdict
|
|
72
|
+
if (typeof verdict !== 'string') return null
|
|
73
|
+
if (APPROVED_VERDICTS.includes(verdict)) return { outcome: 'approved', findings: findingsOf(outcome) }
|
|
74
|
+
if (CHANGES_REQUESTED_VERDICTS.includes(verdict))
|
|
75
|
+
return { outcome: 'changes_requested', findings: findingsOf(outcome) }
|
|
76
|
+
return null
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function bySeverityOf(findings: readonly FindingFact[]): SeverityFindings[] {
|
|
80
|
+
return [...groupBy(findings, (f) => f.severity)]
|
|
81
|
+
.sort(([a], [b]) => compareText(a, b))
|
|
82
|
+
.map(([severity, group]) => ({
|
|
83
|
+
severity,
|
|
84
|
+
findings: group.length,
|
|
85
|
+
blockers: group.filter((f) => f.blocking).length
|
|
86
|
+
}))
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** Question 2: verdicts, and their findings and blockers by severity, by reviewer role and model. */
|
|
90
|
+
export function reviewerStrictness(dataset: Dataset): JudgmentAnswer {
|
|
91
|
+
const { rows, lowTrust } = trustedRows(dataset)
|
|
92
|
+
const used = rowsOfKinds(rows, JUDGMENT_KINDS)
|
|
93
|
+
const unknowns: UnknownFigure[] = []
|
|
94
|
+
|
|
95
|
+
type Group = { role: string; model: string; verdicts: Verdict[] }
|
|
96
|
+
const groups = new Map<string, Group>()
|
|
97
|
+
for (const row of used.withUnit) {
|
|
98
|
+
const verdict = verdictOf(row)
|
|
99
|
+
if (verdict === null) continue
|
|
100
|
+
const role = textField(row, 'target_role')
|
|
101
|
+
const model = textField(row, 'model')
|
|
102
|
+
if (role === null || model === null) continue
|
|
103
|
+
const key = JSON.stringify([role, model])
|
|
104
|
+
const group = groups.get(key) ?? { role, model, verdicts: [] }
|
|
105
|
+
group.verdicts.push(verdict)
|
|
106
|
+
groups.set(key, group)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const reviewers: ReviewerStrictness[] = [...groups.values()]
|
|
110
|
+
.sort((a, b) => compareText(a.role, b.role) || compareText(a.model, b.model))
|
|
111
|
+
.map(({ role, model, verdicts }) => {
|
|
112
|
+
const approved = verdicts.filter((v) => v.outcome === 'approved')
|
|
113
|
+
const changesRequested = verdicts.filter((v) => v.outcome === 'changes_requested')
|
|
114
|
+
const findings: VerdictFindings[] = [
|
|
115
|
+
{ verdict: 'approved' as const, bySeverity: bySeverityOf(approved.flatMap((v) => v.findings)) },
|
|
116
|
+
{
|
|
117
|
+
verdict: 'changes_requested' as const,
|
|
118
|
+
bySeverity: bySeverityOf(changesRequested.flatMap((v) => v.findings))
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
return {
|
|
122
|
+
role,
|
|
123
|
+
model,
|
|
124
|
+
verdictsRead: verdicts.length,
|
|
125
|
+
approved: approved.length,
|
|
126
|
+
changesRequested: changesRequested.length,
|
|
127
|
+
findings
|
|
128
|
+
}
|
|
129
|
+
})
|
|
130
|
+
|
|
131
|
+
return { reviewers, coverage: buildCoverage(dataset, lowTrust, used, unknowns) }
|
|
132
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A human label (O5, `apps/cli/specs/log-sync.md`, "The questions"): a fact
|
|
3
|
+
* the Log never captured, supplied from outside it — a later reversal, an
|
|
4
|
+
* incident, a human's verdict that a gate's rejection was false. A label is
|
|
5
|
+
* an optional input to a question, never a row the Log stored; with none
|
|
6
|
+
* supplied, every figure that depends on one reads unknown with the reason
|
|
7
|
+
* `'no labels recorded'`, never zero.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export type HumanLabelKind = 'false_rejection' | 'reversal' | 'incident'
|
|
11
|
+
|
|
12
|
+
export type HumanLabel = {
|
|
13
|
+
kind: HumanLabelKind
|
|
14
|
+
/** The unit of work (work reference) this label concerns. */
|
|
15
|
+
unit: string
|
|
16
|
+
/** Where this label came from — a Principal ruling, an incident report, a forge comment — freeform, attributed by whoever supplied it. */
|
|
17
|
+
provenance: string
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** The reason every label-dependent figure reads unknown when no label was supplied. */
|
|
21
|
+
export const NO_LABELS_REASON = 'no labels recorded'
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Question 4 — where does the time go? (`apps/cli/specs/log-sync.md`, "The
|
|
3
|
+
* questions".) For each unit of work, the time spent developing, reviewing,
|
|
4
|
+
* checking and waiting. Work overlaps, so each duration is reported twice:
|
|
5
|
+
* summed over every interval, and as the length of the union of the intervals
|
|
6
|
+
* — the time that passed on the clock.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { known, unknownBecause } from '../sync'
|
|
10
|
+
import type { Dataset, DatasetRow, Measured } from '../sync'
|
|
11
|
+
import type { Coverage, UnknownFigure } from './common'
|
|
12
|
+
import { buildCoverage, compareText, groupBy, numberField, rowsOfKinds, textField, trustedRows } from './common'
|
|
13
|
+
|
|
14
|
+
export type Span = {
|
|
15
|
+
/** The length of every interval added together. Concurrent work counts once per interval. */
|
|
16
|
+
summedMs: number
|
|
17
|
+
/** The length of the union of the intervals: time on the clock, overlap counted once. */
|
|
18
|
+
elapsedMs: number
|
|
19
|
+
/** Intervals that are in `summedMs` and `elapsedMs`. */
|
|
20
|
+
intervals: number
|
|
21
|
+
/** Intervals that never ended or carried no duration, so they are in neither figure. */
|
|
22
|
+
incomplete: number
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type UnitTime = {
|
|
26
|
+
unit: string
|
|
27
|
+
/** A developer dispatch, from its `dispatched` line to the line that ended it. */
|
|
28
|
+
develop: Measured<Span>
|
|
29
|
+
/** A code-reviewer or security dispatch, the same way. */
|
|
30
|
+
review: Measured<Span>
|
|
31
|
+
/** A check run: the run's own total time, ending at the run's `summary` line. */
|
|
32
|
+
check: Measured<Span>
|
|
33
|
+
/** A pause, from the line that paused the loop to the line that resumed or cancelled it. */
|
|
34
|
+
wait: Measured<Span>
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type TimeAnswer = {
|
|
38
|
+
/** Ascending by unit. */
|
|
39
|
+
units: UnitTime[]
|
|
40
|
+
coverage: Coverage
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const TIME_KINDS = ['dispatch', 'gate', 'dev_review_loop']
|
|
44
|
+
const CATEGORIES = ['develop', 'review', 'check', 'wait'] as const
|
|
45
|
+
type Category = (typeof CATEGORIES)[number]
|
|
46
|
+
|
|
47
|
+
type Interval = { start: number; end: number }
|
|
48
|
+
type Intervals = { done: Interval[]; incomplete: number }
|
|
49
|
+
|
|
50
|
+
const REVIEWERS = ['code-reviewer', 'security']
|
|
51
|
+
/** Why a category has no figure: nothing recorded, or only intervals that cannot be measured. */
|
|
52
|
+
const NOTHING: Record<Category, string> = {
|
|
53
|
+
develop: 'no developer dispatch recorded for this unit',
|
|
54
|
+
review: 'no reviewer dispatch recorded for this unit',
|
|
55
|
+
check: 'no check run recorded a duration for this unit',
|
|
56
|
+
wait: 'no pause recorded for this unit'
|
|
57
|
+
}
|
|
58
|
+
const UNMEASURABLE: Record<Category, (n: number) => string> = {
|
|
59
|
+
develop: (n) => `${n} developer dispatch${n === 1 ? ' has' : 'es have'} no outcome line`,
|
|
60
|
+
review: (n) => `${n} reviewer dispatch${n === 1 ? ' has' : 'es have'} no outcome line`,
|
|
61
|
+
check: (n) => `${n} check run${n === 1 ? ' records' : 's record'} no duration`,
|
|
62
|
+
wait: (n) => `${n} pause${n === 1 ? ' was' : 's were'} never resumed or cancelled`
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function instant(row: DatasetRow): number {
|
|
66
|
+
return Date.parse(row.time)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function categoryOfRole(role: string | null): Category | null {
|
|
70
|
+
if (role === 'developer') return 'develop'
|
|
71
|
+
if (role !== null && REVIEWERS.includes(role)) return 'review'
|
|
72
|
+
return null
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function intervalsOf(rows: readonly DatasetRow[]): Record<Category, Intervals> {
|
|
76
|
+
const out: Record<Category, Intervals> = {
|
|
77
|
+
develop: { done: [], incomplete: 0 },
|
|
78
|
+
review: { done: [], incomplete: 0 },
|
|
79
|
+
check: { done: [], incomplete: 0 },
|
|
80
|
+
wait: { done: [], incomplete: 0 }
|
|
81
|
+
}
|
|
82
|
+
const open = new Map<string, { category: Category; start: number }>()
|
|
83
|
+
let paused: number | null = null
|
|
84
|
+
for (const row of rows) {
|
|
85
|
+
const at = instant(row)
|
|
86
|
+
if (row.kind === 'dispatch') {
|
|
87
|
+
const effect = textField(row, 'effect_id') ?? row.identity
|
|
88
|
+
if (row.event === 'dispatched') {
|
|
89
|
+
const category = categoryOfRole(textField(row, 'target_role'))
|
|
90
|
+
if (category !== null) open.set(effect, { category, start: at })
|
|
91
|
+
} else if (row.event === 'outcome_received' || row.event === 'dispatch_failed') {
|
|
92
|
+
const started = open.get(effect)
|
|
93
|
+
if (started === undefined) {
|
|
94
|
+
const category = categoryOfRole(textField(row, 'target_role'))
|
|
95
|
+
if (category !== null) out[category].incomplete++
|
|
96
|
+
} else {
|
|
97
|
+
out[started.category].done.push({ start: started.start, end: at })
|
|
98
|
+
open.delete(effect)
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
} else if (row.kind === 'gate' && row.event === 'summary') {
|
|
102
|
+
const duration = numberField(row, 'duration_ms')
|
|
103
|
+
if (duration === null) out.check.incomplete++
|
|
104
|
+
else out.check.done.push({ start: at - duration, end: at })
|
|
105
|
+
} else if (row.kind === 'dev_review_loop') {
|
|
106
|
+
if (row.event === 'paused') {
|
|
107
|
+
if (paused === null) paused = at
|
|
108
|
+
} else if ((row.event === 'resumed' || row.event === 'cancelled') && paused !== null) {
|
|
109
|
+
out.wait.done.push({ start: paused, end: at })
|
|
110
|
+
paused = null
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
for (const { category } of open.values()) out[category].incomplete++
|
|
115
|
+
if (paused !== null) out.wait.incomplete++
|
|
116
|
+
return out
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/** The length of the union of the intervals: overlapping and touching stretches are counted once. */
|
|
120
|
+
function unionMs(intervals: readonly Interval[]): number {
|
|
121
|
+
const sorted = [...intervals].sort((a, b) => a.start - b.start || a.end - b.end)
|
|
122
|
+
let total = 0
|
|
123
|
+
let reach: Interval | null = null
|
|
124
|
+
for (const interval of sorted) {
|
|
125
|
+
if (reach === null || interval.start > reach.end) {
|
|
126
|
+
if (reach !== null) total += reach.end - reach.start
|
|
127
|
+
reach = { ...interval }
|
|
128
|
+
} else if (interval.end > reach.end) {
|
|
129
|
+
reach.end = interval.end
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return reach === null ? total : total + (reach.end - reach.start)
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function spanOf(category: Category, { done, incomplete }: Intervals): Measured<Span> {
|
|
136
|
+
if (done.length === 0) return unknownBecause(incomplete > 0 ? UNMEASURABLE[category](incomplete) : NOTHING[category])
|
|
137
|
+
return known({
|
|
138
|
+
summedMs: done.reduce((sum, interval) => sum + (interval.end - interval.start), 0),
|
|
139
|
+
elapsedMs: unionMs(done),
|
|
140
|
+
intervals: done.length,
|
|
141
|
+
incomplete
|
|
142
|
+
})
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/** Question 4: the develop, review, check and wait durations of each unit of work. */
|
|
146
|
+
export function timeByUnit(dataset: Dataset): TimeAnswer {
|
|
147
|
+
const { rows, lowTrust } = trustedRows(dataset)
|
|
148
|
+
const used = rowsOfKinds(rows, TIME_KINDS)
|
|
149
|
+
const unknowns: UnknownFigure[] = []
|
|
150
|
+
|
|
151
|
+
const units = [...groupBy(used.withUnit, (row) => row.workRef)]
|
|
152
|
+
.sort(([a], [b]) => compareText(a, b))
|
|
153
|
+
.map(([unit, unitRows]): UnitTime => {
|
|
154
|
+
const found = intervalsOf(unitRows)
|
|
155
|
+
const measured = Object.fromEntries(CATEGORIES.map((c) => [c, spanOf(c, found[c])])) as Record<
|
|
156
|
+
Category,
|
|
157
|
+
Measured<Span>
|
|
158
|
+
>
|
|
159
|
+
for (const category of CATEGORIES) {
|
|
160
|
+
const span = measured[category]
|
|
161
|
+
if (!span.known) unknowns.push({ figure: `unit ${unit}.${category}`, reason: span.reason })
|
|
162
|
+
}
|
|
163
|
+
return { unit, ...measured }
|
|
164
|
+
})
|
|
165
|
+
|
|
166
|
+
return { units, coverage: buildCoverage(dataset, lowTrust, used, unknowns) }
|
|
167
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Question 3 — what does a unit of work cost? (`apps/cli/specs/log-sync.md`,
|
|
3
|
+
* "The questions".) Usage by unit of work and by role, retries and failed
|
|
4
|
+
* attempts included. A cumulative observation is a running total, so only the
|
|
5
|
+
* last one per run and model stands for it; delta observations are additions;
|
|
6
|
+
* the two are never added to each other. A figure any contributing
|
|
7
|
+
* observation does not state is unknown, never zero.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { known, unknownBecause } from '../sync'
|
|
11
|
+
import type { Dataset, DatasetRow, Measured } from '../sync'
|
|
12
|
+
import type { Coverage, UnknownFigure } from './common'
|
|
13
|
+
import { buildCoverage, compareText, groupBy, objectField, rowsOfKinds, textField, trustedRows } from './common'
|
|
14
|
+
|
|
15
|
+
export type UsageTotals = {
|
|
16
|
+
input: Measured<number>
|
|
17
|
+
output: Measured<number>
|
|
18
|
+
cache: Measured<number>
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type RoleUsage = UsageTotals & {
|
|
22
|
+
role: string
|
|
23
|
+
/** The usage figures counted into the totals: one per delta observation, one per run and model for cumulative ones, one per attempt. */
|
|
24
|
+
observations: number
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export type UnitUsage = UsageTotals & {
|
|
28
|
+
unit: string
|
|
29
|
+
observations: number
|
|
30
|
+
/** Ascending by role. */
|
|
31
|
+
roles: RoleUsage[]
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export type UsageAnswer = {
|
|
35
|
+
/** Ascending by unit. */
|
|
36
|
+
units: UnitUsage[]
|
|
37
|
+
/** The same totals by role across every unit, ascending by role. */
|
|
38
|
+
roles: RoleUsage[]
|
|
39
|
+
coverage: Coverage
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const USAGE_KINDS = ['usage', 'dispatch', 'role_attempt']
|
|
43
|
+
const FIELDS = ['input', 'output', 'cache'] as const
|
|
44
|
+
type Field = (typeof FIELDS)[number]
|
|
45
|
+
|
|
46
|
+
/** One usage figure that stands in the totals: a number per unit, or `null` where the record states none. */
|
|
47
|
+
type Term = { unit: string; role: string } & Record<Field, number | null>
|
|
48
|
+
|
|
49
|
+
function amount(units: Record<string, unknown> | null, field: Field): number | null {
|
|
50
|
+
const value = units?.[field]
|
|
51
|
+
return typeof value === 'number' ? value : null
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function termOf(unit: string, role: string, units: Record<string, unknown> | null): Term {
|
|
55
|
+
return { unit, role, input: amount(units, 'input'), output: amount(units, 'output'), cache: amount(units, 'cache') }
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function isKnown(term: Term): boolean {
|
|
59
|
+
return FIELDS.some((field) => term[field] !== null)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** The terms the dataset's usage records stand for, in the order they were first seen. */
|
|
63
|
+
function termsOf(rows: readonly DatasetRow[]): Term[] {
|
|
64
|
+
const terms = new Map<string, Term>()
|
|
65
|
+
let deltas = 0
|
|
66
|
+
for (const row of rows) {
|
|
67
|
+
const unit = row.workRef as string
|
|
68
|
+
if (row.kind === 'usage' && row.event === 'observed') {
|
|
69
|
+
const term = termOf(unit, row.role, objectField(row, 'units'))
|
|
70
|
+
if (textField(row, 'semantics') === 'cumulative') {
|
|
71
|
+
// A running total: the last observation per run and model stands for all of them.
|
|
72
|
+
const key = JSON.stringify(['cumulative', unit, row.role, row.runId, textField(row, 'model')])
|
|
73
|
+
terms.delete(key)
|
|
74
|
+
terms.set(key, term)
|
|
75
|
+
} else {
|
|
76
|
+
terms.set(JSON.stringify(['delta', deltas++]), term)
|
|
77
|
+
}
|
|
78
|
+
} else if (
|
|
79
|
+
(row.kind === 'dispatch' && (row.event === 'outcome_received' || row.event === 'dispatch_failed')) ||
|
|
80
|
+
(row.kind === 'role_attempt' && row.event === 'attempted')
|
|
81
|
+
) {
|
|
82
|
+
// A dispatch and the role attempt it ran share an effect id: one attempt is one figure, taken from whichever line states it.
|
|
83
|
+
// Neither record carries a cache count, so a cache figure that is not stated stays unknown.
|
|
84
|
+
const role = row.kind === 'dispatch' ? (textField(row, 'target_role') ?? row.role) : row.role
|
|
85
|
+
const term = termOf(unit, role, objectField(row, 'usage'))
|
|
86
|
+
const key = JSON.stringify(['attempt', unit, textField(row, 'effect_id') ?? row.identity])
|
|
87
|
+
const held = terms.get(key)
|
|
88
|
+
if (held === undefined || (!isKnown(held) && isKnown(term))) terms.set(key, term)
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return [...terms.values()]
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function totalOf(terms: readonly Term[], field: Field): Measured<number> {
|
|
95
|
+
const missing = terms.filter((term) => term[field] === null).length
|
|
96
|
+
if (missing > 0) return unknownBecause(`${missing} of ${terms.length} observations record no ${field}`)
|
|
97
|
+
return known(terms.reduce((sum, term) => sum + (term[field] as number), 0))
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function totalsOf(terms: readonly Term[]): UsageTotals {
|
|
101
|
+
return { input: totalOf(terms, 'input'), output: totalOf(terms, 'output'), cache: totalOf(terms, 'cache') }
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function noteUnknowns(unknowns: UnknownFigure[], name: string, totals: UsageTotals): void {
|
|
105
|
+
for (const field of FIELDS) {
|
|
106
|
+
const total = totals[field]
|
|
107
|
+
if (!total.known) unknowns.push({ figure: `${name}.${field}`, reason: total.reason })
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function byRole(terms: readonly Term[], name: (role: string) => string, unknowns: UnknownFigure[]): RoleUsage[] {
|
|
112
|
+
return [...groupBy(terms, (term) => term.role)]
|
|
113
|
+
.sort(([a], [b]) => compareText(a, b))
|
|
114
|
+
.map(([role, group]) => {
|
|
115
|
+
const totals = totalsOf(group)
|
|
116
|
+
noteUnknowns(unknowns, name(role), totals)
|
|
117
|
+
return { role, observations: group.length, ...totals }
|
|
118
|
+
})
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/** Question 3: usage by unit of work and by role. */
|
|
122
|
+
export function usageByUnitAndRole(dataset: Dataset): UsageAnswer {
|
|
123
|
+
const { rows, lowTrust } = trustedRows(dataset)
|
|
124
|
+
const used = rowsOfKinds(rows, USAGE_KINDS)
|
|
125
|
+
const terms = termsOf(used.withUnit)
|
|
126
|
+
const unknowns: UnknownFigure[] = []
|
|
127
|
+
|
|
128
|
+
const units = [...groupBy(terms, (term) => term.unit)]
|
|
129
|
+
.sort(([a], [b]) => compareText(a, b))
|
|
130
|
+
.map(([unit, group]): UnitUsage => {
|
|
131
|
+
const roles = byRole(group, (role) => `unit ${unit} ${role}`, unknowns)
|
|
132
|
+
const totals = totalsOf(group)
|
|
133
|
+
noteUnknowns(unknowns, `unit ${unit}`, totals)
|
|
134
|
+
return { unit, observations: group.length, ...totals, roles }
|
|
135
|
+
})
|
|
136
|
+
|
|
137
|
+
const roles = byRole(terms, (role) => `role ${role}`, unknowns)
|
|
138
|
+
return { units, roles, coverage: buildCoverage(dataset, lowTrust, used, unknowns) }
|
|
139
|
+
}
|