@hiroshi.inoue/agent-spectrum-kernel 0.0.0-stage → 1.0.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.
Files changed (1558) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +163 -2
  3. package/bin/ask.mjs +9 -0
  4. package/dist/AGENTS.md +266 -0
  5. package/dist/CHANGELOG.md +110 -0
  6. package/dist/CUSTOM_INSTRUCTIONS.md +72 -0
  7. package/dist/LICENSE +21 -0
  8. package/dist/README.md +164 -0
  9. package/dist/adapters/claude-code/README.md +185 -0
  10. package/dist/adapters/claude-code/github-actions/README.md +45 -0
  11. package/dist/adapters/claude-code/github-actions/claude-review-on-mention.yml +151 -0
  12. package/dist/adapters/claude-code/plugin/.claude-plugin/plugin.json +15 -0
  13. package/dist/adapters/claude-code/plugin/README.md +48 -0
  14. package/dist/adapters/claude-code/plugin/bin/ai-skills-metrics-record +18 -0
  15. package/dist/adapters/claude-code/plugin/contracts/claim-evidence-status-contract.md +60 -0
  16. package/dist/adapters/claude-code/plugin/contracts/execution-envelope-contract.md +105 -0
  17. package/dist/adapters/claude-code/plugin/contracts/lifecycle-traceability-contract.md +169 -0
  18. package/dist/adapters/claude-code/plugin/contracts/review-signal-gate-map.json +128 -0
  19. package/dist/adapters/claude-code/plugin/hooks/hooks.json +25 -0
  20. package/dist/adapters/claude-code/plugin/schemas/claim-evidence-status.schema.json +85 -0
  21. package/dist/adapters/claude-code/plugin/schemas/codex-risk-action.schema.json +58 -0
  22. package/dist/adapters/claude-code/plugin/schemas/codex-risk-approval-request.schema.json +204 -0
  23. package/dist/adapters/claude-code/plugin/schemas/execution-envelope.schema.json +127 -0
  24. package/dist/adapters/claude-code/plugin/schemas/metrics-event.schema.json +395 -0
  25. package/dist/adapters/claude-code/plugin/scripts/claim-evidence-status.mjs +162 -0
  26. package/dist/adapters/claude-code/plugin/skills/adoption-report/SKILL.md +19 -0
  27. package/dist/adapters/claude-code/plugin/skills/evidence-ledger/SKILL.md +96 -0
  28. package/dist/adapters/claude-code/plugin/skills/handoff/SKILL.md +36 -0
  29. package/dist/adapters/claude-code/plugin/skills/implement/SKILL.md +41 -0
  30. package/dist/adapters/claude-code/plugin/skills/implementation-context-check/SKILL.md +21 -0
  31. package/dist/adapters/claude-code/plugin/skills/investigate/SKILL.md +40 -0
  32. package/dist/adapters/claude-code/plugin/skills/ledger-refresh/SKILL.md +22 -0
  33. package/dist/adapters/claude-code/plugin/skills/review-pr/SKILL.md +54 -0
  34. package/dist/adapters/claude-code/plugin/skills/verify/SKILL.md +44 -0
  35. package/dist/adapters/claude-code/plugin/templates/handoff.md +30 -0
  36. package/dist/adapters/claude-code/plugin/templates/implement.md +35 -0
  37. package/dist/adapters/claude-code/plugin/templates/investigate.md +34 -0
  38. package/dist/adapters/claude-code/plugin/templates/review-pr.md +48 -0
  39. package/dist/adapters/claude-code/plugin/templates/verify.md +38 -0
  40. package/dist/adapters/claude-code/project/.claude/commands/skill-handoff.md +27 -0
  41. package/dist/adapters/claude-code/project/.claude/commands/skill-implement.md +32 -0
  42. package/dist/adapters/claude-code/project/.claude/commands/skill-investigate.md +29 -0
  43. package/dist/adapters/claude-code/project/.claude/commands/skill-ledger-refresh.md +22 -0
  44. package/dist/adapters/claude-code/project/.claude/commands/skill-report.md +17 -0
  45. package/dist/adapters/claude-code/project/.claude/commands/skill-review.md +43 -0
  46. package/dist/adapters/claude-code/project/.claude/commands/skill-verify.md +37 -0
  47. package/dist/adapters/claude-code/project/.claude/hooks/hooks.json +52 -0
  48. package/dist/adapters/claude-code/project/.claude/skills/README.md +11 -0
  49. package/dist/adapters/codex/README.md +128 -0
  50. package/dist/adapters/codex/commands/codex-exec.md +69 -0
  51. package/dist/adapters/codex/project/.agents/skills/README.md +36 -0
  52. package/dist/adapters/codex/prompts/skill-handoff.md +23 -0
  53. package/dist/adapters/codex/prompts/skill-implement.md +28 -0
  54. package/dist/adapters/codex/prompts/skill-investigate.md +27 -0
  55. package/dist/adapters/codex/prompts/skill-review.md +44 -0
  56. package/dist/adapters/codex/prompts/skill-verify.md +28 -0
  57. package/dist/benchmarks/README.md +125 -0
  58. package/dist/benchmarks/adaptive-portfolio.config.json +439 -0
  59. package/dist/benchmarks/admission-decision-overlay.md +72 -0
  60. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/common/operation-and-observation.md +35 -0
  61. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch02-report-operations/TASK.md +15 -0
  62. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch02-report-operations/acceptance.md +29 -0
  63. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch02-report-operations/business-decisions.md +21 -0
  64. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch02-report-operations/contract.md +37 -0
  65. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch02-report-operations/delivery-provider.md +7 -0
  66. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch02-report-operations/fixture-format.md +13 -0
  67. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch02-report-operations/fixtures/example.json +237 -0
  68. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch02-report-operations/goal-pr.txt +5 -0
  69. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch02-report-operations/nonfunctional.md +3 -0
  70. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch02-report-operations/prompt.txt +5 -0
  71. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch02-report-operations/roles.md +24 -0
  72. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch02-report-operations/workflows.md +35 -0
  73. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch03-price-rollout/TASK.md +15 -0
  74. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch03-price-rollout/acceptance.md +30 -0
  75. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch03-price-rollout/business-decisions.md +23 -0
  76. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch03-price-rollout/contract.md +45 -0
  77. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch03-price-rollout/fixture-format.md +15 -0
  78. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch03-price-rollout/fixtures/campaign-stores.json +284 -0
  79. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch03-price-rollout/fixtures/example.json +299 -0
  80. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch03-price-rollout/goal-pr.txt +5 -0
  81. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch03-price-rollout/nonfunctional.md +3 -0
  82. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch03-price-rollout/prompt.txt +5 -0
  83. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch03-price-rollout/roles.md +28 -0
  84. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch03-price-rollout/workflows.md +35 -0
  85. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch04-document-access/TASK.md +15 -0
  86. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch04-document-access/acceptance.md +30 -0
  87. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch04-document-access/business-decisions.md +23 -0
  88. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch04-document-access/contract.md +39 -0
  89. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch04-document-access/fixture-format.md +11 -0
  90. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch04-document-access/fixtures/dossier-delivery.json +325 -0
  91. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch04-document-access/fixtures/example.json +289 -0
  92. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch04-document-access/goal-pr.txt +5 -0
  93. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch04-document-access/nonfunctional.md +3 -0
  94. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch04-document-access/prompt.txt +5 -0
  95. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch04-document-access/roles.md +27 -0
  96. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch04-document-access/workflows.md +35 -0
  97. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch05-sales-reconciliation/TASK.md +15 -0
  98. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch05-sales-reconciliation/acceptance.md +30 -0
  99. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch05-sales-reconciliation/business-decisions.md +27 -0
  100. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch05-sales-reconciliation/contract.md +39 -0
  101. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch05-sales-reconciliation/fixture-format.md +11 -0
  102. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch05-sales-reconciliation/fixtures/example.json +276 -0
  103. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch05-sales-reconciliation/goal-pr.txt +5 -0
  104. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch05-sales-reconciliation/nonfunctional.md +3 -0
  105. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch05-sales-reconciliation/prompt.txt +5 -0
  106. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch05-sales-reconciliation/roles.md +27 -0
  107. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch05-sales-reconciliation/workflows.md +35 -0
  108. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch06-build-operations/TASK.md +15 -0
  109. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch06-build-operations/acceptance.md +30 -0
  110. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch06-build-operations/business-decisions.md +23 -0
  111. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch06-build-operations/compiler-provider.md +9 -0
  112. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch06-build-operations/contract.md +39 -0
  113. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch06-build-operations/fixture-format.md +11 -0
  114. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch06-build-operations/fixtures/example.json +292 -0
  115. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch06-build-operations/goal-pr.txt +5 -0
  116. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch06-build-operations/nonfunctional.md +3 -0
  117. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch06-build-operations/prompt.txt +5 -0
  118. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch06-build-operations/roles.md +25 -0
  119. package/dist/benchmarks/challenge-candidates/business-five-v3-decisions/public/tasks/ch06-build-operations/workflows.md +35 -0
  120. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/evaluation-protocol.md +58 -0
  121. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/LICENSE +21 -0
  122. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/PROVENANCE.md +9 -0
  123. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/README-ja.md +29 -0
  124. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/README.md +47 -0
  125. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/brief/adr/001-local-storage.md +6 -0
  126. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/brief/adr/007-shared-boundary.md +9 -0
  127. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/brief/adr/009-retention-draft.md +4 -0
  128. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/brief/architecture.md +29 -0
  129. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/brief/contracts.md +14 -0
  130. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/brief/library-policy.md +16 -0
  131. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/brief/open-decisions.md +10 -0
  132. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/brief/release.md +32 -0
  133. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/brief/spec-index.md +17 -0
  134. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/docs/design.md +1624 -0
  135. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/docs/requirements.md +1194 -0
  136. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/eslint.config.mjs +23 -0
  137. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/evidence/ci-summary.json +11 -0
  138. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/evidence/operational-observations.md +11 -0
  139. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/evidence/pilot-desk/approval-history.csv +6 -0
  140. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/evidence/pilot-desk/batches.csv +21 -0
  141. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/evidence/pilot-desk/bookings.csv +6 -0
  142. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/evidence/pilot-desk/clearance.csv +6 -0
  143. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/evidence/pilot-desk/desk-ledger.csv +13 -0
  144. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/evidence/pilot-desk/service-agreement.md +11 -0
  145. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/evidence/pilot-desk/signoffs.csv +12 -0
  146. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/evidence/previous-readiness-note.md +7 -0
  147. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/package.json +26 -0
  148. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/package.json +21 -0
  149. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/__tests__/action-log.test.ts +32 -0
  150. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/__tests__/artifact-store.test.ts +64 -0
  151. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/__tests__/command-catalog.test.ts +89 -0
  152. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/__tests__/config-store.test.ts +28 -0
  153. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/__tests__/core-info.test.ts +13 -0
  154. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/__tests__/cycle-meta.test.ts +491 -0
  155. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/__tests__/field-report.test.ts +107 -0
  156. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/__tests__/fix-flow.test.ts +289 -0
  157. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/__tests__/flow-manifest.test.ts +126 -0
  158. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/__tests__/flow-run.test.ts +44 -0
  159. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/__tests__/knowledge-capture.test.ts +288 -0
  160. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/__tests__/meta-status.test.ts +109 -0
  161. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/__tests__/p0-readiness.test.ts +192 -0
  162. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/__tests__/project-context.test.ts +172 -0
  163. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/__tests__/project-init.test.ts +82 -0
  164. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/__tests__/prompt-renderer.test.ts +87 -0
  165. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/__tests__/prompt-template.test.ts +55 -0
  166. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/__tests__/response-import.test.ts +40 -0
  167. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/__tests__/response-normalize.test.ts +59 -0
  168. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/__tests__/review-resolution.test.ts +187 -0
  169. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/__tests__/review-work-metrics.test.ts +173 -0
  170. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/__tests__/runtime-ports.test.ts +118 -0
  171. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/__tests__/skill-evidence.test.ts +101 -0
  172. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/actions/action-log.ts +48 -0
  173. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/application/project-context.ts +291 -0
  174. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/application/project-init.ts +224 -0
  175. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/artifacts/artifact-store.ts +2 -0
  176. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/artifacts/open-artifact.ts +21 -0
  177. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/config/config-store.ts +73 -0
  178. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/cycles/state.ts +799 -0
  179. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/domain/artifacts.ts +20 -0
  180. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/domain/diff-classification.ts +65 -0
  181. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/flows/manifest.ts +1648 -0
  182. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/flows/run.ts +77 -0
  183. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/index.ts +48 -0
  184. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/infrastructure/fs/artifact-store.ts +60 -0
  185. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/infrastructure/fs/runtime.ts +22 -0
  186. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/infrastructure/fs/workspace-store.ts +107 -0
  187. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/infrastructure/memory/runtime.ts +185 -0
  188. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/knowledge/capture.ts +666 -0
  189. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/meta/command-catalog.ts +909 -0
  190. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/meta/readiness.ts +519 -0
  191. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/meta/status.ts +58 -0
  192. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/metrics/review-work.ts +317 -0
  193. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/ports/artifact-store.ts +16 -0
  194. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/ports/runtime.ts +56 -0
  195. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/project/context.ts +46 -0
  196. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/project/init.ts +20 -0
  197. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/prompts/render.ts +369 -0
  198. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/prompts/templates.ts +153 -0
  199. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/reports/field-report.ts +230 -0
  200. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/responses/import.ts +127 -0
  201. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/responses/normalize.ts +389 -0
  202. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/reviews/action-plan-understanding.ts +136 -0
  203. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/reviews/comment-resolution.ts +605 -0
  204. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/reviews/fix-flow.ts +863 -0
  205. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/serialization/json.ts +18 -0
  206. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/serialization/paths.ts +27 -0
  207. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/serialization/yaml.ts +20 -0
  208. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/skill/evidence.ts +207 -0
  209. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/src/types.ts +634 -0
  210. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/core/tsconfig.json +10 -0
  211. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/portal/README.md +18 -0
  212. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/portal/package.json +13 -0
  213. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/portal/public/app.js +357 -0
  214. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/portal/public/index.html +35 -0
  215. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/portal/public/styles.css +172 -0
  216. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/portal/server/API.md +41 -0
  217. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/portal/server/access.mjs +17 -0
  218. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/portal/server/app.mjs +320 -0
  219. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/portal/server/artifacts.mjs +81 -0
  220. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/portal/server/core-bridge.mjs +48 -0
  221. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/portal/server/errors.mjs +9 -0
  222. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/portal/server/fixtures.mjs +75 -0
  223. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/portal/server/index.mjs +14 -0
  224. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/portal/server/jobs.mjs +93 -0
  225. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/portal/server/journal.mjs +46 -0
  226. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/portal/server/provider.mjs +59 -0
  227. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/portal/server/reviews.mjs +80 -0
  228. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/portal/server/store.mjs +105 -0
  229. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/portal/test/helpers/review-fixture.mjs +9 -0
  230. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/portal/test/persistence.test.mjs +60 -0
  231. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/portal/test/portal.test.mjs +364 -0
  232. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/providers/package.json +21 -0
  233. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/providers/src/__tests__/github.test.ts +335 -0
  234. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/providers/src/__tests__/local-git.test.ts +98 -0
  235. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/providers/src/__tests__/provider-boundary.test.ts +18 -0
  236. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/providers/src/github.ts +643 -0
  237. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/providers/src/index.ts +54 -0
  238. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/providers/src/local-git.ts +520 -0
  239. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/providers/tsconfig.json +15 -0
  240. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/vscode-extension/l10n/bundle.l10n.ja.json +868 -0
  241. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/vscode-extension/l10n/bundle.l10n.json +868 -0
  242. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/vscode-extension/package.json +474 -0
  243. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/vscode-extension/package.nls.ja.json +38 -0
  244. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/vscode-extension/package.nls.json +38 -0
  245. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/vscode-extension/resources/reviewops-activitybar.svg +12 -0
  246. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/vscode-extension/resources/reviewops-command-dark.svg +12 -0
  247. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/vscode-extension/resources/reviewops-command-light.svg +12 -0
  248. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/vscode-extension/resources/reviewops_guard_icon_128.png +0 -0
  249. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/vscode-extension/src/artifact-browser.ts +380 -0
  250. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/vscode-extension/src/artifact-loader.ts +460 -0
  251. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/vscode-extension/src/command-center-renderer.ts +1341 -0
  252. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/vscode-extension/src/command-center-results.ts +183 -0
  253. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/vscode-extension/src/command-center.ts +819 -0
  254. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/vscode-extension/src/extension-runtime.ts +2670 -0
  255. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/vscode-extension/src/extension.ts +1 -0
  256. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/vscode-extension/src/localization.ts +19 -0
  257. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/vscode-extension/src/publish-draft-artifacts.ts +58 -0
  258. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/vscode-extension/src/review-targets.ts +178 -0
  259. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/vscode-extension/src/review-work-artifacts.ts +200 -0
  260. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/vscode-extension/src/run-id.ts +3 -0
  261. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/vscode-extension/src/scoped-cycle-prompt.ts +119 -0
  262. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/vscode-extension/src/tree-views.ts +243 -0
  263. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/vscode-extension/src/webview-renderers.ts +184 -0
  264. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/packages/vscode-extension/tsconfig.json +18 -0
  265. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/pnpm-lock.yaml +1708 -0
  266. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/pnpm-workspace.yaml +2 -0
  267. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/scripts/check-policy.mjs +14 -0
  268. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/scripts/generate-vsix.command +226 -0
  269. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/scripts/pilot-board.mjs +20 -0
  270. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/scripts/policy-checker.mjs +145 -0
  271. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/scripts/smoke-vsix.command +129 -0
  272. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/task.md +11 -0
  273. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/tests/policy/ai-network-guard.test.ts +9 -0
  274. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/tests/vscode-extension-activation.test.ts +474 -0
  275. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/tests/vscode-extension-artifacts.test.ts +2087 -0
  276. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/tests/vscode-extension-package.test.ts +336 -0
  277. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/tests/vsix-smoke-command.test.ts +32 -0
  278. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/tsconfig.base.json +15 -0
  279. package/dist/benchmarks/challenge-candidates/review-ceiling-v1/workspace/vitest.config.ts +11 -0
  280. package/dist/benchmarks/challenge-candidates/ui-reconstruction-v1/README.md +66 -0
  281. package/dist/benchmarks/challenge-candidates/ui-reconstruction-v1/workspace/brief/data-contract.md +51 -0
  282. package/dist/benchmarks/challenge-candidates/ui-reconstruction-v1/workspace/brief/rubric.json +756 -0
  283. package/dist/benchmarks/challenge-candidates/ui-reconstruction-v1/workspace/brief/scenarios.json +333 -0
  284. package/dist/benchmarks/challenge-candidates/ui-reconstruction-v1/workspace/brief/spec.md +35 -0
  285. package/dist/benchmarks/challenge-candidates/ui-reconstruction-v1/workspace/fixtures/assessment-valid.json +53 -0
  286. package/dist/benchmarks/challenge-candidates/ui-reconstruction-v1/workspace/fixtures/assessment-wrong-evidence.json +53 -0
  287. package/dist/benchmarks/challenge-candidates/ui-reconstruction-v1/workspace/fixtures/backup-dangling.json +565 -0
  288. package/dist/benchmarks/challenge-candidates/ui-reconstruction-v1/workspace/fixtures/career-valid.json +51 -0
  289. package/dist/benchmarks/challenge-candidates/ui-reconstruction-v1/workspace/fixtures/plan-over-limit.json +61 -0
  290. package/dist/benchmarks/challenge-candidates/ui-reconstruction-v1/workspace/fixtures/plan-valid.json +61 -0
  291. package/dist/benchmarks/challenge-candidates/ui-reconstruction-v1/workspace/fixtures/plan-wrong-request.json +61 -0
  292. package/dist/benchmarks/challenge-candidates/ui-reconstruction-v1/workspace/fixtures/seed.json +565 -0
  293. package/dist/benchmarks/challenge-candidates/ui-reconstruction-v1/workspace/task.md +29 -0
  294. package/dist/benchmarks/contracts/rule-batch/2.0.0/bundle.json +270 -0
  295. package/dist/benchmarks/contracts/rule-batch/2.0.0/examples/mutants.mjs +129 -0
  296. package/dist/benchmarks/contracts/rule-batch/2.0.0/examples/reference.mjs +150 -0
  297. package/dist/benchmarks/contracts/rule-batch/2.0.0/fixed/cases.mjs +261 -0
  298. package/dist/benchmarks/contracts/rule-batch/2.0.0/fixed/contract.test.mjs +5 -0
  299. package/dist/benchmarks/contracts/rule-batch/2.0.0/fixed/legacy-baseline/src/errors.mjs +17 -0
  300. package/dist/benchmarks/contracts/rule-batch/2.0.0/fixed/legacy-baseline/src/index.mjs +3 -0
  301. package/dist/benchmarks/contracts/rule-batch/2.0.0/fixed/legacy-baseline/src/rule-service.mjs +27 -0
  302. package/dist/benchmarks/contracts/rule-batch/2.0.0/fixed/legacy-baseline/src/rule-store.mjs +38 -0
  303. package/dist/benchmarks/contracts/rule-batch/2.0.0/fixed/legacy-baseline/src/validation.mjs +20 -0
  304. package/dist/benchmarks/contracts/rule-batch/2.0.0/fixed/legacy-case-ids.json +458 -0
  305. package/dist/benchmarks/contracts/rule-batch/2.0.0/fixed/legacy-results.mjs +37 -0
  306. package/dist/benchmarks/contracts/rule-batch/2.0.0/fixed/legacy-verifier.v1.2.mjs +115 -0
  307. package/dist/benchmarks/contracts/rule-batch/2.0.0/fixed/legacy.test.mjs +4 -0
  308. package/dist/benchmarks/contracts/rule-batch/2.0.0/fixed/r1.test.mjs +10 -0
  309. package/dist/benchmarks/contracts/rule-batch/2.0.0/fixed/r10.test.mjs +10 -0
  310. package/dist/benchmarks/contracts/rule-batch/2.0.0/fixed/r2.test.mjs +10 -0
  311. package/dist/benchmarks/contracts/rule-batch/2.0.0/fixed/r3.test.mjs +10 -0
  312. package/dist/benchmarks/contracts/rule-batch/2.0.0/fixed/r4.test.mjs +10 -0
  313. package/dist/benchmarks/contracts/rule-batch/2.0.0/fixed/r5.test.mjs +10 -0
  314. package/dist/benchmarks/contracts/rule-batch/2.0.0/fixed/r6.test.mjs +10 -0
  315. package/dist/benchmarks/contracts/rule-batch/2.0.0/fixed/r7.test.mjs +10 -0
  316. package/dist/benchmarks/contracts/rule-batch/2.0.0/fixed/r8.test.mjs +10 -0
  317. package/dist/benchmarks/contracts/rule-batch/2.0.0/fixed/r9.test.mjs +10 -0
  318. package/dist/benchmarks/contracts/rule-batch/2.0.0/history.json +27 -0
  319. package/dist/benchmarks/contracts/rule-batch/2.0.0/requirements.json +547 -0
  320. package/dist/benchmarks/contracts/rule-batch/2.0.0/seed/docs/rule-batch.schema.json +27 -0
  321. package/dist/benchmarks/contracts/rule-batch/2.0.0/seed/docs/rule-batches.md +140 -0
  322. package/dist/benchmarks/contracts/rule-batch/2.0.0/seed/package.json +7 -0
  323. package/dist/benchmarks/contracts/rule-batch/2.0.0/seed/src/errors.mjs +17 -0
  324. package/dist/benchmarks/contracts/rule-batch/2.0.0/seed/src/index.mjs +3 -0
  325. package/dist/benchmarks/contracts/rule-batch/2.0.0/seed/src/rule-service.mjs +27 -0
  326. package/dist/benchmarks/contracts/rule-batch/2.0.0/seed/src/rule-store.mjs +38 -0
  327. package/dist/benchmarks/contracts/rule-batch/2.0.0/seed/src/validation.mjs +20 -0
  328. package/dist/benchmarks/contracts/rule-batch/2.0.0/seed/test/rule-service.test.mjs +34 -0
  329. package/dist/benchmarks/contracts/rule-batch/2.0.0/spec.md +140 -0
  330. package/dist/benchmarks/contracts/rule-batch/2.0.0/task.md +35 -0
  331. package/dist/benchmarks/contracts/rule-batch/2.0.0/verification-contract.md +56 -0
  332. package/dist/benchmarks/contracts/rule-batch/2.0.0/verification.json +100 -0
  333. package/dist/benchmarks/evaluation-tasks.json +1645 -0
  334. package/dist/benchmarks/evaluator-boundary.md +107 -0
  335. package/dist/benchmarks/portfolio-admission-policy.json +1171 -0
  336. package/dist/benchmarks/portfolio-catalog.json +837 -0
  337. package/dist/benchmarks/portfolio-design-admission-manifest.json +170 -0
  338. package/dist/benchmarks/portfolio-design-admission-records/hi-authorization-exception.json +99 -0
  339. package/dist/benchmarks/portfolio-design-admission-records/hi-external-action-approval.json +105 -0
  340. package/dist/benchmarks/portfolio-design-admission-records/hi-financial-state-integrity.json +105 -0
  341. package/dist/benchmarks/portfolio-design-admission-records/hi-versioned-migration-safety.json +108 -0
  342. package/dist/benchmarks/portfolio-design-admission-records/mn-build-option-update.json +108 -0
  343. package/dist/benchmarks/portfolio-design-admission-records/mn-client-compatibility-fix.json +108 -0
  344. package/dist/benchmarks/portfolio-design-admission-records/mn-doc-config-correction.json +108 -0
  345. package/dist/benchmarks/portfolio-design-admission-records/mn-focused-regression-test.json +108 -0
  346. package/dist/benchmarks/portfolio-design-admission-records/mn-frontend-default-fix.json +108 -0
  347. package/dist/benchmarks/portfolio-design-admission-records/mn-schema-field-alignment.json +108 -0
  348. package/dist/benchmarks/portfolio-design-admission-records/mp-accessibility-interaction-review.json +103 -0
  349. package/dist/benchmarks/portfolio-design-admission-records/mp-ci-evidence-gap.json +103 -0
  350. package/dist/benchmarks/portfolio-design-admission-records/mp-data-migration-handoff.json +108 -0
  351. package/dist/benchmarks/portfolio-design-admission-records/mp-frontend-state-review.json +103 -0
  352. package/dist/benchmarks/portfolio-design-admission-records/mp-iac-rollback-design.json +106 -0
  353. package/dist/benchmarks/portfolio-design-admission-records/mp-performance-investigation.json +106 -0
  354. package/dist/benchmarks/portfolio-design-admission-records/pf-api-pagination-behavior.json +108 -0
  355. package/dist/benchmarks/portfolio-design-admission-records/pf-ci-cache-flake.json +106 -0
  356. package/dist/benchmarks/portfolio-design-admission-records/pf-data-schema-evolution.json +105 -0
  357. package/dist/benchmarks/portfolio-design-admission-records/pf-frontend-async-state.json +108 -0
  358. package/dist/benchmarks/portfolio-design-admission-records/pf-library-compat-upgrade.json +105 -0
  359. package/dist/benchmarks/portfolio-design-admission-records/pf-observability-redaction.json +99 -0
  360. package/dist/benchmarks/portfolio-design-admission-records/pf-performance-regression.json +108 -0
  361. package/dist/benchmarks/portfolio-design-admission-records/pf-review-error-contract.json +103 -0
  362. package/dist/benchmarks/portfolio-design-independent-review.json +1666 -0
  363. package/dist/benchmarks/portfolio-design-review-package.json +249 -0
  364. package/dist/benchmarks/portfolio-design-reviewed-state.json +152 -0
  365. package/dist/benchmarks/portfolio-high-impact-sensitivity-policy.json +40 -0
  366. package/dist/benchmarks/portfolio-lineage-policy.json +213 -0
  367. package/dist/benchmarks/portfolio-policy-manifest.json +32 -0
  368. package/dist/benchmarks/portfolio-scoring-policy.json +589 -0
  369. package/dist/benchmarks/portfolio-similarity.json +2222 -0
  370. package/dist/benchmarks/prompt-v2-preregistration.json +411 -0
  371. package/dist/benchmarks/protocol-adaptive.md +487 -0
  372. package/dist/benchmarks/protocol-b2.md +113 -0
  373. package/dist/benchmarks/protocol-prompt-v2.md +108 -0
  374. package/dist/benchmarks/protocol.md +122 -0
  375. package/dist/benchmarks/report-template.md +61 -0
  376. package/dist/benchmarks/schemas/adaptive-selection-input.schema.json +82 -0
  377. package/dist/benchmarks/schemas/adaptive-selection-state.schema.json +45 -0
  378. package/dist/benchmarks/schemas/adaptive-selection.schema.json +137 -0
  379. package/dist/benchmarks/schemas/agent-output.schema.json +66 -0
  380. package/dist/benchmarks/schemas/core-evaluator-result-envelope.schema.json +708 -0
  381. package/dist/benchmarks/schemas/core-native-compatibility-provenance.schema.json +130 -0
  382. package/dist/benchmarks/schemas/core-normalized-portfolio-result.schema.json +945 -0
  383. package/dist/benchmarks/schemas/core-normalized-portfolio-run.schema.json +676 -0
  384. package/dist/benchmarks/schemas/core-original-workspace-authority.schema.json +315 -0
  385. package/dist/benchmarks/schemas/core-portfolio-command-evidence.schema.json +548 -0
  386. package/dist/benchmarks/schemas/core-portfolio-engineering-result.schema.json +1187 -0
  387. package/dist/benchmarks/schemas/core-portfolio-terminal-workspace-authority.schema.json +395 -0
  388. package/dist/benchmarks/schemas/core-repository-diff-artifact.schema.json +253 -0
  389. package/dist/benchmarks/schemas/evaluation-input-failure-artifact.schema.json +36 -0
  390. package/dist/benchmarks/schemas/evaluator-authority-manifest.schema.json +63 -0
  391. package/dist/benchmarks/schemas/evaluator-check-artifact.schema.json +35 -0
  392. package/dist/benchmarks/schemas/evaluator-reference.schema.json +129 -0
  393. package/dist/benchmarks/schemas/evaluator-result-envelope.schema.json +261 -0
  394. package/dist/benchmarks/schemas/execution-plan.schema.json +121 -0
  395. package/dist/benchmarks/schemas/materialization-manifest.schema.json +187 -0
  396. package/dist/benchmarks/schemas/normalized-portfolio-result.schema.json +379 -0
  397. package/dist/benchmarks/schemas/normalized-portfolio-root.schema.json +49 -0
  398. package/dist/benchmarks/schemas/normalized-portfolio-run.schema.json +289 -0
  399. package/dist/benchmarks/schemas/original-workspace-authority.schema.json +99 -0
  400. package/dist/benchmarks/schemas/portfolio-adapter-identity.schema.json +148 -0
  401. package/dist/benchmarks/schemas/portfolio-admission-decision.schema.json +140 -0
  402. package/dist/benchmarks/schemas/portfolio-admission-policy.schema.json +347 -0
  403. package/dist/benchmarks/schemas/portfolio-admission-review-authority.schema.json +60 -0
  404. package/dist/benchmarks/schemas/portfolio-aggregate-result-v2.schema.json +1107 -0
  405. package/dist/benchmarks/schemas/portfolio-aggregate-result.schema.json +140 -0
  406. package/dist/benchmarks/schemas/portfolio-attempt-commit.schema.json +30 -0
  407. package/dist/benchmarks/schemas/portfolio-attempt-request.schema.json +134 -0
  408. package/dist/benchmarks/schemas/portfolio-attempt-result.schema.json +256 -0
  409. package/dist/benchmarks/schemas/portfolio-case-state.schema.json +38 -0
  410. package/dist/benchmarks/schemas/portfolio-catalog.schema.json +122 -0
  411. package/dist/benchmarks/schemas/portfolio-claim.schema.json +72 -0
  412. package/dist/benchmarks/schemas/portfolio-classification-record.schema.json +46 -0
  413. package/dist/benchmarks/schemas/portfolio-command-evidence.schema.json +122 -0
  414. package/dist/benchmarks/schemas/portfolio-config.schema.json +138 -0
  415. package/dist/benchmarks/schemas/portfolio-consumer-report.schema.json +289 -0
  416. package/dist/benchmarks/schemas/portfolio-design-admission-manifest.schema.json +76 -0
  417. package/dist/benchmarks/schemas/portfolio-design-admission-record.schema.json +205 -0
  418. package/dist/benchmarks/schemas/portfolio-design-independent-review.schema.json +264 -0
  419. package/dist/benchmarks/schemas/portfolio-design-review-package.schema.json +96 -0
  420. package/dist/benchmarks/schemas/portfolio-design-reviewed-state.schema.json +99 -0
  421. package/dist/benchmarks/schemas/portfolio-directional-outcome-report.schema.json +164 -0
  422. package/dist/benchmarks/schemas/portfolio-engineering-result-set.schema.json +222 -0
  423. package/dist/benchmarks/schemas/portfolio-engineering-result-source-manifest.schema.json +93 -0
  424. package/dist/benchmarks/schemas/portfolio-engineering-result.schema.json +515 -0
  425. package/dist/benchmarks/schemas/portfolio-evolution-binding.schema.json +71 -0
  426. package/dist/benchmarks/schemas/portfolio-final-admission-record.schema.json +125 -0
  427. package/dist/benchmarks/schemas/portfolio-high-impact-sensitivity-policy.schema.json +44 -0
  428. package/dist/benchmarks/schemas/portfolio-high-impact-sensitivity-registration.schema.json +136 -0
  429. package/dist/benchmarks/schemas/portfolio-high-impact-sensitivity-report.schema.json +384 -0
  430. package/dist/benchmarks/schemas/portfolio-legacy-calibration-migration.schema.json +308 -0
  431. package/dist/benchmarks/schemas/portfolio-lineage-policy.schema.json +180 -0
  432. package/dist/benchmarks/schemas/portfolio-lineage-record.schema.json +52 -0
  433. package/dist/benchmarks/schemas/portfolio-mechanism-scorecard.schema.json +197 -0
  434. package/dist/benchmarks/schemas/portfolio-output-contract.schema.json +52 -0
  435. package/dist/benchmarks/schemas/portfolio-paired-comparison-report.schema.json +346 -0
  436. package/dist/benchmarks/schemas/portfolio-policy-manifest.schema.json +85 -0
  437. package/dist/benchmarks/schemas/portfolio-repetition-report.schema.json +204 -0
  438. package/dist/benchmarks/schemas/portfolio-requirement-record.schema.json +72 -0
  439. package/dist/benchmarks/schemas/portfolio-run-identity.schema.json +58 -0
  440. package/dist/benchmarks/schemas/portfolio-runtime-config.schema.json +147 -0
  441. package/dist/benchmarks/schemas/portfolio-scoring-policy.schema.json +497 -0
  442. package/dist/benchmarks/schemas/portfolio-similarity.schema.json +64 -0
  443. package/dist/benchmarks/schemas/portfolio-terminal-workspace-authority.schema.json +134 -0
  444. package/dist/benchmarks/schemas/portfolio-verification-command-contract.schema.json +69 -0
  445. package/dist/benchmarks/schemas/primary-evaluator-result-envelope.schema.json +708 -0
  446. package/dist/benchmarks/schemas/primary-k2-evaluator-result-envelope.schema.json +708 -0
  447. package/dist/benchmarks/schemas/primary-k2-normalized-portfolio-result.schema.json +945 -0
  448. package/dist/benchmarks/schemas/primary-k2-normalized-portfolio-run.schema.json +676 -0
  449. package/dist/benchmarks/schemas/primary-k2-original-workspace-authority.schema.json +315 -0
  450. package/dist/benchmarks/schemas/primary-k2-portfolio-command-evidence.schema.json +554 -0
  451. package/dist/benchmarks/schemas/primary-k2-portfolio-engineering-result.schema.json +1187 -0
  452. package/dist/benchmarks/schemas/primary-k2-portfolio-terminal-workspace-authority.schema.json +395 -0
  453. package/dist/benchmarks/schemas/primary-k2-repository-diff-artifact.schema.json +253 -0
  454. package/dist/benchmarks/schemas/primary-k2-saved-v10-evaluator-result-envelope.schema.json +3604 -0
  455. package/dist/benchmarks/schemas/primary-k2-saved-v10-normalized-portfolio-result.schema.json +3804 -0
  456. package/dist/benchmarks/schemas/primary-k2-saved-v10-portfolio-command-evidence.schema.json +3531 -0
  457. package/dist/benchmarks/schemas/primary-k2-saved-v10-portfolio-engineering-result.schema.json +4126 -0
  458. package/dist/benchmarks/schemas/primary-k2-saved-v2-portfolio-command-evidence.schema.json +548 -0
  459. package/dist/benchmarks/schemas/primary-k2-saved-v3-portfolio-command-evidence.schema.json +548 -0
  460. package/dist/benchmarks/schemas/primary-k2-saved-v4-portfolio-command-evidence.schema.json +548 -0
  461. package/dist/benchmarks/schemas/primary-k2-saved-v5-portfolio-command-evidence.schema.json +558 -0
  462. package/dist/benchmarks/schemas/primary-k2-saved-v6-portfolio-command-evidence.schema.json +668 -0
  463. package/dist/benchmarks/schemas/primary-k2-saved-v7-evaluator-result-envelope.schema.json +708 -0
  464. package/dist/benchmarks/schemas/primary-k2-saved-v7-portfolio-command-evidence.schema.json +676 -0
  465. package/dist/benchmarks/schemas/primary-k2-saved-v8-evaluator-result-envelope.schema.json +760 -0
  466. package/dist/benchmarks/schemas/primary-k2-saved-v8-normalized-portfolio-result.schema.json +960 -0
  467. package/dist/benchmarks/schemas/primary-k2-saved-v8-portfolio-command-evidence.schema.json +687 -0
  468. package/dist/benchmarks/schemas/primary-k2-saved-v8-portfolio-engineering-result.schema.json +1282 -0
  469. package/dist/benchmarks/schemas/primary-k2-saved-v9-evaluator-result-envelope.schema.json +760 -0
  470. package/dist/benchmarks/schemas/primary-k2-saved-v9-normalized-portfolio-result.schema.json +960 -0
  471. package/dist/benchmarks/schemas/primary-k2-saved-v9-portfolio-command-evidence.schema.json +687 -0
  472. package/dist/benchmarks/schemas/primary-k2-saved-v9-portfolio-engineering-result.schema.json +1282 -0
  473. package/dist/benchmarks/schemas/primary-normalized-portfolio-result.schema.json +945 -0
  474. package/dist/benchmarks/schemas/primary-normalized-portfolio-run.schema.json +676 -0
  475. package/dist/benchmarks/schemas/primary-original-workspace-authority.schema.json +315 -0
  476. package/dist/benchmarks/schemas/primary-portfolio-command-evidence.schema.json +554 -0
  477. package/dist/benchmarks/schemas/primary-portfolio-engineering-result.schema.json +1187 -0
  478. package/dist/benchmarks/schemas/primary-portfolio-terminal-workspace-authority.schema.json +395 -0
  479. package/dist/benchmarks/schemas/primary-public-capability-selection-v2.schema.json +31 -0
  480. package/dist/benchmarks/schemas/primary-repository-diff-artifact.schema.json +253 -0
  481. package/dist/benchmarks/schemas/primary-runtime-v10-binding.schema.json +2843 -0
  482. package/dist/benchmarks/schemas/primary-saved-v10-evaluator-result-envelope.schema.json +3604 -0
  483. package/dist/benchmarks/schemas/primary-saved-v10-normalized-portfolio-result.schema.json +3804 -0
  484. package/dist/benchmarks/schemas/primary-saved-v10-portfolio-command-evidence.schema.json +3531 -0
  485. package/dist/benchmarks/schemas/primary-saved-v10-portfolio-engineering-result.schema.json +4126 -0
  486. package/dist/benchmarks/schemas/primary-saved-v2-portfolio-command-evidence.schema.json +548 -0
  487. package/dist/benchmarks/schemas/primary-saved-v3-portfolio-command-evidence.schema.json +548 -0
  488. package/dist/benchmarks/schemas/primary-saved-v4-portfolio-command-evidence.schema.json +548 -0
  489. package/dist/benchmarks/schemas/primary-saved-v5-portfolio-command-evidence.schema.json +558 -0
  490. package/dist/benchmarks/schemas/primary-saved-v6-portfolio-command-evidence.schema.json +668 -0
  491. package/dist/benchmarks/schemas/primary-saved-v7-evaluator-result-envelope.schema.json +708 -0
  492. package/dist/benchmarks/schemas/primary-saved-v7-portfolio-command-evidence.schema.json +676 -0
  493. package/dist/benchmarks/schemas/primary-saved-v8-evaluator-result-envelope.schema.json +760 -0
  494. package/dist/benchmarks/schemas/primary-saved-v8-normalized-portfolio-result.schema.json +960 -0
  495. package/dist/benchmarks/schemas/primary-saved-v8-portfolio-command-evidence.schema.json +687 -0
  496. package/dist/benchmarks/schemas/primary-saved-v8-portfolio-engineering-result.schema.json +1282 -0
  497. package/dist/benchmarks/schemas/primary-saved-v9-evaluator-result-envelope.schema.json +760 -0
  498. package/dist/benchmarks/schemas/primary-saved-v9-normalized-portfolio-result.schema.json +960 -0
  499. package/dist/benchmarks/schemas/primary-saved-v9-portfolio-command-evidence.schema.json +687 -0
  500. package/dist/benchmarks/schemas/primary-saved-v9-portfolio-engineering-result.schema.json +1282 -0
  501. package/dist/benchmarks/schemas/private-evaluation-record.schema.json +311 -0
  502. package/dist/benchmarks/schemas/private-evaluator-bundle.schema.json +224 -0
  503. package/dist/benchmarks/schemas/private-evaluator-fragment.schema.json +140 -0
  504. package/dist/benchmarks/schemas/private-evaluator-independence-statement.schema.json +168 -0
  505. package/dist/benchmarks/schemas/prompt-v2-comparison-report.schema.json +94 -0
  506. package/dist/benchmarks/schemas/prompt-v2-execution-plan.schema.json +115 -0
  507. package/dist/benchmarks/schemas/prompt-v2-materialization-manifest.schema.json +58 -0
  508. package/dist/benchmarks/schemas/prompt-v2-normalized-result.schema.json +109 -0
  509. package/dist/benchmarks/schemas/prompt-v2-preregistration.schema.json +266 -0
  510. package/dist/benchmarks/schemas/prompt-v2-resume-state.schema.json +60 -0
  511. package/dist/benchmarks/schemas/repository-diff-artifact.schema.json +78 -0
  512. package/dist/benchmarks/schemas/result.schema.json +292 -0
  513. package/dist/benchmarks/schemas/runtime-observation-carrier.schema.json +480 -0
  514. package/dist/benchmarks/schemas/scoring-input-freeze-manifest.schema.json +77 -0
  515. package/dist/benchmarks/task-revisions/ch01-inventory-reservation-logistics/rubric.json +41 -0
  516. package/dist/benchmarks/task-revisions/ch02-report-operations/input-manifest.json +141 -0
  517. package/dist/benchmarks/task-revisions/ch02-report-operations/rubric.json +40 -0
  518. package/dist/benchmarks/task-revisions/ch03-price-rollout/input-manifest.json +141 -0
  519. package/dist/benchmarks/task-revisions/ch03-price-rollout/rubric.json +49 -0
  520. package/dist/benchmarks/task-revisions/ch04-document-access/input-manifest.json +141 -0
  521. package/dist/benchmarks/task-revisions/ch04-document-access/rubric.json +49 -0
  522. package/dist/benchmarks/task-revisions/ch05-sales-reconciliation/input-manifest.json +131 -0
  523. package/dist/benchmarks/task-revisions/ch05-sales-reconciliation/rubric.json +49 -0
  524. package/dist/benchmarks/task-revisions/ch06-build-operations/input-manifest.json +141 -0
  525. package/dist/benchmarks/task-revisions/ch06-build-operations/rubric.json +49 -0
  526. package/dist/benchmarks/task-revisions/ch08-growth-workspace/input-manifest.json +78 -0
  527. package/dist/benchmarks/task-revisions/ch08-growth-workspace/rubric.json +49 -0
  528. package/dist/benchmarks/task-revisions/hi-authorization-exception/input-manifest.json +72 -0
  529. package/dist/benchmarks/task-revisions/hi-authorization-exception/rubric.json +52 -0
  530. package/dist/benchmarks/task-revisions/hi-authorization-exception/task.md +17 -0
  531. package/dist/benchmarks/task-revisions/hi-authorization-exception/workspace/base/authorization.mjs +6 -0
  532. package/dist/benchmarks/task-revisions/hi-authorization-exception/workspace/data/access-cases.json +251 -0
  533. package/dist/benchmarks/task-revisions/hi-authorization-exception/workspace/docs/ownership-contract.md +11 -0
  534. package/dist/benchmarks/task-revisions/hi-authorization-exception/workspace/package.json +13 -0
  535. package/dist/benchmarks/task-revisions/hi-authorization-exception/workspace/pr.diff +12 -0
  536. package/dist/benchmarks/task-revisions/hi-authorization-exception/workspace/review.schema.json +175 -0
  537. package/dist/benchmarks/task-revisions/hi-authorization-exception/workspace/scripts/trace-access.mjs +14 -0
  538. package/dist/benchmarks/task-revisions/hi-authorization-exception/workspace/scripts/validate-review.mjs +12 -0
  539. package/dist/benchmarks/task-revisions/hi-authorization-exception/workspace/src/authorization.mjs +6 -0
  540. package/dist/benchmarks/task-revisions/hi-authorization-exception/workspace/test/access-subset.test.mjs +1 -0
  541. package/dist/benchmarks/task-revisions/hi-external-action-approval/input-manifest.json +87 -0
  542. package/dist/benchmarks/task-revisions/hi-external-action-approval/rubric.json +44 -0
  543. package/dist/benchmarks/task-revisions/hi-external-action-approval/task.md +7 -0
  544. package/dist/benchmarks/task-revisions/hi-external-action-approval/workspace/data/approval-receipts.json +162 -0
  545. package/dist/benchmarks/task-revisions/hi-external-action-approval/workspace/data/operation-cases.json +257 -0
  546. package/dist/benchmarks/task-revisions/hi-external-action-approval/workspace/data/review-attestations.json +257 -0
  547. package/dist/benchmarks/task-revisions/hi-external-action-approval/workspace/data/state.json +1 -0
  548. package/dist/benchmarks/task-revisions/hi-external-action-approval/workspace/docs/action-contract.md +15 -0
  549. package/dist/benchmarks/task-revisions/hi-external-action-approval/workspace/operation-plan.json +5 -0
  550. package/dist/benchmarks/task-revisions/hi-external-action-approval/workspace/package.json +13 -0
  551. package/dist/benchmarks/task-revisions/hi-external-action-approval/workspace/plan.schema.json +127 -0
  552. package/dist/benchmarks/task-revisions/hi-external-action-approval/workspace/scripts/controller.mjs +45 -0
  553. package/dist/benchmarks/task-revisions/hi-external-action-approval/workspace/scripts/dry-run.mjs +1 -0
  554. package/dist/benchmarks/task-revisions/hi-external-action-approval/workspace/scripts/validate-plan.mjs +1 -0
  555. package/dist/benchmarks/task-revisions/hi-external-action-approval/workspace/scripts/validate-shape.mjs +16 -0
  556. package/dist/benchmarks/task-revisions/hi-external-action-approval/workspace/test/approval.test.mjs +55 -0
  557. package/dist/benchmarks/task-revisions/hi-financial-state-integrity/input-manifest.json +52 -0
  558. package/dist/benchmarks/task-revisions/hi-financial-state-integrity/rubric.json +45 -0
  559. package/dist/benchmarks/task-revisions/hi-financial-state-integrity/task.md +17 -0
  560. package/dist/benchmarks/task-revisions/hi-financial-state-integrity/workspace/data/incident.json +19 -0
  561. package/dist/benchmarks/task-revisions/hi-financial-state-integrity/workspace/data/initial-state.json +9 -0
  562. package/dist/benchmarks/task-revisions/hi-financial-state-integrity/workspace/docs/ledger-contract.md +9 -0
  563. package/dist/benchmarks/task-revisions/hi-financial-state-integrity/workspace/package.json +11 -0
  564. package/dist/benchmarks/task-revisions/hi-financial-state-integrity/workspace/src/ledger.mjs +11 -0
  565. package/dist/benchmarks/task-revisions/hi-financial-state-integrity/workspace/test/ledger.test.mjs +15 -0
  566. package/dist/benchmarks/task-revisions/hi-versioned-migration-safety/input-manifest.json +87 -0
  567. package/dist/benchmarks/task-revisions/hi-versioned-migration-safety/rubric.json +45 -0
  568. package/dist/benchmarks/task-revisions/hi-versioned-migration-safety/task.md +7 -0
  569. package/dist/benchmarks/task-revisions/hi-versioned-migration-safety/workspace/data/mixed-state.json +17 -0
  570. package/dist/benchmarks/task-revisions/hi-versioned-migration-safety/workspace/data/rollback-cases.json +84 -0
  571. package/dist/benchmarks/task-revisions/hi-versioned-migration-safety/workspace/data/schema-phases.json +54 -0
  572. package/dist/benchmarks/task-revisions/hi-versioned-migration-safety/workspace/data/timeline.json +52 -0
  573. package/dist/benchmarks/task-revisions/hi-versioned-migration-safety/workspace/docs/migration-contract.md +17 -0
  574. package/dist/benchmarks/task-revisions/hi-versioned-migration-safety/workspace/migration-plan.json +10 -0
  575. package/dist/benchmarks/task-revisions/hi-versioned-migration-safety/workspace/package.json +13 -0
  576. package/dist/benchmarks/task-revisions/hi-versioned-migration-safety/workspace/plan.schema.json +110 -0
  577. package/dist/benchmarks/task-revisions/hi-versioned-migration-safety/workspace/scripts/compatibility.mjs +51 -0
  578. package/dist/benchmarks/task-revisions/hi-versioned-migration-safety/workspace/scripts/dry-run.mjs +1 -0
  579. package/dist/benchmarks/task-revisions/hi-versioned-migration-safety/workspace/scripts/validate-plan.mjs +1 -0
  580. package/dist/benchmarks/task-revisions/hi-versioned-migration-safety/workspace/scripts/validate-shape.mjs +16 -0
  581. package/dist/benchmarks/task-revisions/hi-versioned-migration-safety/workspace/test/mixed-version.test.mjs +61 -0
  582. package/dist/benchmarks/task-revisions/implementation-clearing-cutover/input-manifest.json +85 -0
  583. package/dist/benchmarks/task-revisions/implementation-clearing-cutover/rubric.json +34 -0
  584. package/dist/benchmarks/task-revisions/implementation-clearing-cutover/task.md +5 -0
  585. package/dist/benchmarks/task-revisions/implementation-clearing-cutover/workspace/data/incident.json +8 -0
  586. package/dist/benchmarks/task-revisions/implementation-clearing-cutover/workspace/data/initial-state.json +21 -0
  587. package/dist/benchmarks/task-revisions/implementation-clearing-cutover/workspace/data/service-save.json +160 -0
  588. package/dist/benchmarks/task-revisions/implementation-clearing-cutover/workspace/docs/bank-interchange.md +37 -0
  589. package/dist/benchmarks/task-revisions/implementation-clearing-cutover/workspace/docs/close-instructions.md +27 -0
  590. package/dist/benchmarks/task-revisions/implementation-clearing-cutover/workspace/docs/ledger-contract.md +21 -0
  591. package/dist/benchmarks/task-revisions/implementation-clearing-cutover/workspace/package.json +11 -0
  592. package/dist/benchmarks/task-revisions/implementation-clearing-cutover/workspace/src/archive.mjs +46 -0
  593. package/dist/benchmarks/task-revisions/implementation-clearing-cutover/workspace/src/clearing.mjs +47 -0
  594. package/dist/benchmarks/task-revisions/implementation-clearing-cutover/workspace/src/ledger.mjs +36 -0
  595. package/dist/benchmarks/task-revisions/implementation-clearing-cutover/workspace/src/money.mjs +11 -0
  596. package/dist/benchmarks/task-revisions/implementation-clearing-cutover/workspace/test/ledger.test.mjs +50 -0
  597. package/dist/benchmarks/task-revisions/implementation-timeline-restore/input-manifest.json +52 -0
  598. package/dist/benchmarks/task-revisions/implementation-timeline-restore/rubric.json +44 -0
  599. package/dist/benchmarks/task-revisions/implementation-timeline-restore/task.md +5 -0
  600. package/dist/benchmarks/task-revisions/implementation-timeline-restore/workspace/docs/archive-operations.md +13 -0
  601. package/dist/benchmarks/task-revisions/implementation-timeline-restore/workspace/docs/interchange.md +16 -0
  602. package/dist/benchmarks/task-revisions/implementation-timeline-restore/workspace/docs/statement-interface.md +9 -0
  603. package/dist/benchmarks/task-revisions/implementation-timeline-restore/workspace/package.json +8 -0
  604. package/dist/benchmarks/task-revisions/implementation-timeline-restore/workspace/src/event-lookup.mjs +39 -0
  605. package/dist/benchmarks/task-revisions/implementation-timeline-restore/workspace/test/client.test.mjs +38 -0
  606. package/dist/benchmarks/task-revisions/implementation-workspace-upgrade/input-manifest.json +94 -0
  607. package/dist/benchmarks/task-revisions/implementation-workspace-upgrade/rubric.json +84 -0
  608. package/dist/benchmarks/task-revisions/implementation-workspace-upgrade/task.md +5 -0
  609. package/dist/benchmarks/task-revisions/implementation-workspace-upgrade/workspace/docs/dispatch.md +25 -0
  610. package/dist/benchmarks/task-revisions/implementation-workspace-upgrade/workspace/docs/installed-clients.md +35 -0
  611. package/dist/benchmarks/task-revisions/implementation-workspace-upgrade/workspace/docs/returned-sheets.md +15 -0
  612. package/dist/benchmarks/task-revisions/implementation-workspace-upgrade/workspace/package.json +8 -0
  613. package/dist/benchmarks/task-revisions/implementation-workspace-upgrade/workspace/release/console.mjs +2 -0
  614. package/dist/benchmarks/task-revisions/implementation-workspace-upgrade/workspace/release/database.mjs +52 -0
  615. package/dist/benchmarks/task-revisions/implementation-workspace-upgrade/workspace/release/desk.mjs +24 -0
  616. package/dist/benchmarks/task-revisions/implementation-workspace-upgrade/workspace/release/kiosk.mjs +47 -0
  617. package/dist/benchmarks/task-revisions/implementation-workspace-upgrade/workspace/release/operator.mjs +17 -0
  618. package/dist/benchmarks/task-revisions/implementation-workspace-upgrade/workspace/release/printer.mjs +63 -0
  619. package/dist/benchmarks/task-revisions/implementation-workspace-upgrade/workspace/src/delivery.mjs +28 -0
  620. package/dist/benchmarks/task-revisions/implementation-workspace-upgrade/workspace/src/reconcile.mjs +16 -0
  621. package/dist/benchmarks/task-revisions/implementation-workspace-upgrade/workspace/src/workspace.mjs +44 -0
  622. package/dist/benchmarks/task-revisions/implementation-workspace-upgrade/workspace/test/desk.test.mjs +34 -0
  623. package/dist/benchmarks/task-revisions/mn-build-option-update/input-manifest.json +52 -0
  624. package/dist/benchmarks/task-revisions/mn-build-option-update/rubric.json +38 -0
  625. package/dist/benchmarks/task-revisions/mn-build-option-update/task.md +5 -0
  626. package/dist/benchmarks/task-revisions/mn-build-option-update/workspace/build.config.json +14 -0
  627. package/dist/benchmarks/task-revisions/mn-build-option-update/workspace/ci/release-build.log +7 -0
  628. package/dist/benchmarks/task-revisions/mn-build-option-update/workspace/docs/build-options.md +12 -0
  629. package/dist/benchmarks/task-revisions/mn-build-option-update/workspace/package.json +9 -0
  630. package/dist/benchmarks/task-revisions/mn-build-option-update/workspace/scripts/validate-build-config.mjs +11 -0
  631. package/dist/benchmarks/task-revisions/mn-build-option-update/workspace/test/build-config.test.mjs +15 -0
  632. package/dist/benchmarks/task-revisions/mn-client-compatibility-fix/input-manifest.json +48 -0
  633. package/dist/benchmarks/task-revisions/mn-client-compatibility-fix/rubric.json +29 -0
  634. package/dist/benchmarks/task-revisions/mn-client-compatibility-fix/task.md +5 -0
  635. package/dist/benchmarks/task-revisions/mn-client-compatibility-fix/workspace/docs/client-support.md +12 -0
  636. package/dist/benchmarks/task-revisions/mn-client-compatibility-fix/workspace/docs/preferences.md +5 -0
  637. package/dist/benchmarks/task-revisions/mn-client-compatibility-fix/workspace/package.json +6 -0
  638. package/dist/benchmarks/task-revisions/mn-client-compatibility-fix/workspace/src/preferences.mjs +3 -0
  639. package/dist/benchmarks/task-revisions/mn-client-compatibility-fix/workspace/test/preferences.test.mjs +20 -0
  640. package/dist/benchmarks/task-revisions/mn-doc-config-correction/input-manifest.json +42 -0
  641. package/dist/benchmarks/task-revisions/mn-doc-config-correction/rubric.json +37 -0
  642. package/dist/benchmarks/task-revisions/mn-doc-config-correction/task.md +3 -0
  643. package/dist/benchmarks/task-revisions/mn-doc-config-correction/workspace/config/retry-policy.json +6 -0
  644. package/dist/benchmarks/task-revisions/mn-doc-config-correction/workspace/docs/worker-retries.md +12 -0
  645. package/dist/benchmarks/task-revisions/mn-doc-config-correction/workspace/package.json +8 -0
  646. package/dist/benchmarks/task-revisions/mn-doc-config-correction/workspace/test/worker-retries.test.mjs +16 -0
  647. package/dist/benchmarks/task-revisions/mn-focused-regression-test/input-manifest.json +42 -0
  648. package/dist/benchmarks/task-revisions/mn-focused-regression-test/rubric.json +37 -0
  649. package/dist/benchmarks/task-revisions/mn-focused-regression-test/task.md +5 -0
  650. package/dist/benchmarks/task-revisions/mn-focused-regression-test/workspace/package.json +9 -0
  651. package/dist/benchmarks/task-revisions/mn-focused-regression-test/workspace/spec/session-key.md +7 -0
  652. package/dist/benchmarks/task-revisions/mn-focused-regression-test/workspace/src/session-key.mjs +12 -0
  653. package/dist/benchmarks/task-revisions/mn-focused-regression-test/workspace/test/session-key.test.mjs +11 -0
  654. package/dist/benchmarks/task-revisions/mn-frontend-default-fix/input-manifest.json +48 -0
  655. package/dist/benchmarks/task-revisions/mn-frontend-default-fix/rubric.json +45 -0
  656. package/dist/benchmarks/task-revisions/mn-frontend-default-fix/task.md +5 -0
  657. package/dist/benchmarks/task-revisions/mn-frontend-default-fix/workspace/package.json +7 -0
  658. package/dist/benchmarks/task-revisions/mn-frontend-default-fix/workspace/spec/default-state.md +14 -0
  659. package/dist/benchmarks/task-revisions/mn-frontend-default-fix/workspace/src/display-controls.mjs +6 -0
  660. package/dist/benchmarks/task-revisions/mn-frontend-default-fix/workspace/src/display-preferences.mjs +18 -0
  661. package/dist/benchmarks/task-revisions/mn-frontend-default-fix/workspace/test/display-preferences.test.mjs +54 -0
  662. package/dist/benchmarks/task-revisions/mn-schema-field-alignment/input-manifest.json +58 -0
  663. package/dist/benchmarks/task-revisions/mn-schema-field-alignment/rubric.json +45 -0
  664. package/dist/benchmarks/task-revisions/mn-schema-field-alignment/task.md +5 -0
  665. package/dist/benchmarks/task-revisions/mn-schema-field-alignment/workspace/package.json +7 -0
  666. package/dist/benchmarks/task-revisions/mn-schema-field-alignment/workspace/schemas/member.schema.json +12 -0
  667. package/dist/benchmarks/task-revisions/mn-schema-field-alignment/workspace/spec/member-contract.md +13 -0
  668. package/dist/benchmarks/task-revisions/mn-schema-field-alignment/workspace/spec/schema-alignment-plan.md +5 -0
  669. package/dist/benchmarks/task-revisions/mn-schema-field-alignment/workspace/src/member-export.mjs +3 -0
  670. package/dist/benchmarks/task-revisions/mn-schema-field-alignment/workspace/src/member-import.mjs +23 -0
  671. package/dist/benchmarks/task-revisions/mn-schema-field-alignment/workspace/test/member-record.test.mjs +36 -0
  672. package/dist/benchmarks/task-revisions/mp-accessibility-interaction-review/input-manifest.json +82 -0
  673. package/dist/benchmarks/task-revisions/mp-accessibility-interaction-review/rubric.json +52 -0
  674. package/dist/benchmarks/task-revisions/mp-accessibility-interaction-review/task.md +7 -0
  675. package/dist/benchmarks/task-revisions/mp-accessibility-interaction-review/workspace/docs/interaction-notes.md +11 -0
  676. package/dist/benchmarks/task-revisions/mp-accessibility-interaction-review/workspace/notice-editor.html +31 -0
  677. package/dist/benchmarks/task-revisions/mp-accessibility-interaction-review/workspace/package-lock.json +15 -0
  678. package/dist/benchmarks/task-revisions/mp-accessibility-interaction-review/workspace/package.json +14 -0
  679. package/dist/benchmarks/task-revisions/mp-accessibility-interaction-review/workspace/pr.diff +83 -0
  680. package/dist/benchmarks/task-revisions/mp-accessibility-interaction-review/workspace/review.schema.json +57 -0
  681. package/dist/benchmarks/task-revisions/mp-accessibility-interaction-review/workspace/scripts/validate-review.mjs +40 -0
  682. package/dist/benchmarks/task-revisions/mp-accessibility-interaction-review/workspace/src/format-toolbar.html +10 -0
  683. package/dist/benchmarks/task-revisions/mp-accessibility-interaction-review/workspace/src/format-toolbar.mjs +42 -0
  684. package/dist/benchmarks/task-revisions/mp-accessibility-interaction-review/workspace/test/helpers/toolbar-fixture.mjs +19 -0
  685. package/dist/benchmarks/task-revisions/mp-accessibility-interaction-review/workspace/test/integration/format-toolbar.test.mjs +16 -0
  686. package/dist/benchmarks/task-revisions/mp-accessibility-interaction-review/workspace/test/unit/format-toolbar.test.mjs +23 -0
  687. package/dist/benchmarks/task-revisions/mp-ci-evidence-gap/input-manifest.json +87 -0
  688. package/dist/benchmarks/task-revisions/mp-ci-evidence-gap/rubric.json +52 -0
  689. package/dist/benchmarks/task-revisions/mp-ci-evidence-gap/task.md +5 -0
  690. package/dist/benchmarks/task-revisions/mp-ci-evidence-gap/workspace/.github/workflows/pull-request.yml +23 -0
  691. package/dist/benchmarks/task-revisions/mp-ci-evidence-gap/workspace/ci/pull-request-314.log +22 -0
  692. package/dist/benchmarks/task-revisions/mp-ci-evidence-gap/workspace/docs/verification.md +9 -0
  693. package/dist/benchmarks/task-revisions/mp-ci-evidence-gap/workspace/package-lock.json +13 -0
  694. package/dist/benchmarks/task-revisions/mp-ci-evidence-gap/workspace/package.json +14 -0
  695. package/dist/benchmarks/task-revisions/mp-ci-evidence-gap/workspace/pr.diff +49 -0
  696. package/dist/benchmarks/task-revisions/mp-ci-evidence-gap/workspace/review.schema.json +61 -0
  697. package/dist/benchmarks/task-revisions/mp-ci-evidence-gap/workspace/scripts/upload-diagnostics.mjs +4 -0
  698. package/dist/benchmarks/task-revisions/mp-ci-evidence-gap/workspace/scripts/validate-review.mjs +40 -0
  699. package/dist/benchmarks/task-revisions/mp-ci-evidence-gap/workspace/src/checkout.mjs +6 -0
  700. package/dist/benchmarks/task-revisions/mp-ci-evidence-gap/workspace/src/quote-order.mjs +13 -0
  701. package/dist/benchmarks/task-revisions/mp-ci-evidence-gap/workspace/test/checkout/quote-order-contract.test.mjs +12 -0
  702. package/dist/benchmarks/task-revisions/mp-ci-evidence-gap/workspace/test/unit/quote-order.test.mjs +23 -0
  703. package/dist/benchmarks/task-revisions/mp-data-migration-handoff/input-manifest.json +97 -0
  704. package/dist/benchmarks/task-revisions/mp-data-migration-handoff/rubric.json +44 -0
  705. package/dist/benchmarks/task-revisions/mp-data-migration-handoff/task.md +7 -0
  706. package/dist/benchmarks/task-revisions/mp-data-migration-handoff/workspace/docs/migration-plan.md +21 -0
  707. package/dist/benchmarks/task-revisions/mp-data-migration-handoff/workspace/docs/rollback-runbook.md +3 -0
  708. package/dist/benchmarks/task-revisions/mp-data-migration-handoff/workspace/evidence/checkpoint-journal.ndjson +10 -0
  709. package/dist/benchmarks/task-revisions/mp-data-migration-handoff/workspace/evidence/comparisons.ndjson +6 -0
  710. package/dist/benchmarks/task-revisions/mp-data-migration-handoff/workspace/evidence/compatibility.json +25 -0
  711. package/dist/benchmarks/task-revisions/mp-data-migration-handoff/workspace/evidence/outbox.ndjson +4 -0
  712. package/dist/benchmarks/task-revisions/mp-data-migration-handoff/workspace/handoff.schema.json +216 -0
  713. package/dist/benchmarks/task-revisions/mp-data-migration-handoff/workspace/operations/commands.json +71 -0
  714. package/dist/benchmarks/task-revisions/mp-data-migration-handoff/workspace/operations/pages.json +134 -0
  715. package/dist/benchmarks/task-revisions/mp-data-migration-handoff/workspace/operations/work-orders.json +39 -0
  716. package/dist/benchmarks/task-revisions/mp-data-migration-handoff/workspace/package-lock.json +13 -0
  717. package/dist/benchmarks/task-revisions/mp-data-migration-handoff/workspace/package.json +11 -0
  718. package/dist/benchmarks/task-revisions/mp-data-migration-handoff/workspace/scripts/validate-handoff.mjs +63 -0
  719. package/dist/benchmarks/task-revisions/mp-data-migration-handoff/workspace/state/grants.ndjson +5 -0
  720. package/dist/benchmarks/task-revisions/mp-data-migration-handoff/workspace/state/routing.json +22 -0
  721. package/dist/benchmarks/task-revisions/mp-frontend-state-review/input-manifest.json +77 -0
  722. package/dist/benchmarks/task-revisions/mp-frontend-state-review/rubric.json +44 -0
  723. package/dist/benchmarks/task-revisions/mp-frontend-state-review/task.md +5 -0
  724. package/dist/benchmarks/task-revisions/mp-frontend-state-review/workspace/docs/state-contract.md +14 -0
  725. package/dist/benchmarks/task-revisions/mp-frontend-state-review/workspace/package-lock.json +15 -0
  726. package/dist/benchmarks/task-revisions/mp-frontend-state-review/workspace/package.json +14 -0
  727. package/dist/benchmarks/task-revisions/mp-frontend-state-review/workspace/pr.diff +116 -0
  728. package/dist/benchmarks/task-revisions/mp-frontend-state-review/workspace/review.schema.json +57 -0
  729. package/dist/benchmarks/task-revisions/mp-frontend-state-review/workspace/scripts/validate-review.mjs +40 -0
  730. package/dist/benchmarks/task-revisions/mp-frontend-state-review/workspace/src/inbox-state.mjs +47 -0
  731. package/dist/benchmarks/task-revisions/mp-frontend-state-review/workspace/src/inbox-view.mjs +19 -0
  732. package/dist/benchmarks/task-revisions/mp-frontend-state-review/workspace/test/helpers/inbox-fixture.mjs +8 -0
  733. package/dist/benchmarks/task-revisions/mp-frontend-state-review/workspace/test/integration/inbox-view.test.mjs +32 -0
  734. package/dist/benchmarks/task-revisions/mp-frontend-state-review/workspace/test/unit/inbox-state.test.mjs +20 -0
  735. package/dist/benchmarks/task-revisions/mp-iac-rollback-design/input-manifest.json +87 -0
  736. package/dist/benchmarks/task-revisions/mp-iac-rollback-design/rubric.json +52 -0
  737. package/dist/benchmarks/task-revisions/mp-iac-rollback-design/task.md +7 -0
  738. package/dist/benchmarks/task-revisions/mp-iac-rollback-design/workspace/change-plan.schema.json +186 -0
  739. package/dist/benchmarks/task-revisions/mp-iac-rollback-design/workspace/docs/change-request.md +9 -0
  740. package/dist/benchmarks/task-revisions/mp-iac-rollback-design/workspace/docs/knowledge-policy.md +6 -0
  741. package/dist/benchmarks/task-revisions/mp-iac-rollback-design/workspace/docs/rollback-policy.md +8 -0
  742. package/dist/benchmarks/task-revisions/mp-iac-rollback-design/workspace/infra/alias.tf +11 -0
  743. package/dist/benchmarks/task-revisions/mp-iac-rollback-design/workspace/infra/iam.tf +12 -0
  744. package/dist/benchmarks/task-revisions/mp-iac-rollback-design/workspace/operations/commands.json +46 -0
  745. package/dist/benchmarks/task-revisions/mp-iac-rollback-design/workspace/package-lock.json +15 -0
  746. package/dist/benchmarks/task-revisions/mp-iac-rollback-design/workspace/package.json +12 -0
  747. package/dist/benchmarks/task-revisions/mp-iac-rollback-design/workspace/plans/candidate-plan.json +15 -0
  748. package/dist/benchmarks/task-revisions/mp-iac-rollback-design/workspace/plans/pre-apply-records.json +117 -0
  749. package/dist/benchmarks/task-revisions/mp-iac-rollback-design/workspace/scripts/validate-change-plan.mjs +138 -0
  750. package/dist/benchmarks/task-revisions/mp-iac-rollback-design/workspace/state/current-state.json +23 -0
  751. package/dist/benchmarks/task-revisions/mp-performance-investigation/input-manifest.json +97 -0
  752. package/dist/benchmarks/task-revisions/mp-performance-investigation/rubric.json +44 -0
  753. package/dist/benchmarks/task-revisions/mp-performance-investigation/task.md +7 -0
  754. package/dist/benchmarks/task-revisions/mp-performance-investigation/workspace/docs/investigation-contract.md +14 -0
  755. package/dist/benchmarks/task-revisions/mp-performance-investigation/workspace/investigation.schema.json +92 -0
  756. package/dist/benchmarks/task-revisions/mp-performance-investigation/workspace/observability/cache-samples.csv +7 -0
  757. package/dist/benchmarks/task-revisions/mp-performance-investigation/workspace/observability/release-events.json +14 -0
  758. package/dist/benchmarks/task-revisions/mp-performance-investigation/workspace/observability/request-windows.csv +4 -0
  759. package/dist/benchmarks/task-revisions/mp-performance-investigation/workspace/observability/runtime-profile.json +25 -0
  760. package/dist/benchmarks/task-revisions/mp-performance-investigation/workspace/package-lock.json +15 -0
  761. package/dist/benchmarks/task-revisions/mp-performance-investigation/workspace/package.json +15 -0
  762. package/dist/benchmarks/task-revisions/mp-performance-investigation/workspace/scripts/replay-summary.mjs +12 -0
  763. package/dist/benchmarks/task-revisions/mp-performance-investigation/workspace/scripts/validate-investigation.mjs +84 -0
  764. package/dist/benchmarks/task-revisions/mp-performance-investigation/workspace/src/cache-key.mjs +6 -0
  765. package/dist/benchmarks/task-revisions/mp-performance-investigation/workspace/src/summary-replay.mjs +42 -0
  766. package/dist/benchmarks/task-revisions/mp-performance-investigation/workspace/src/summary-service.mjs +9 -0
  767. package/dist/benchmarks/task-revisions/mp-performance-investigation/workspace/test/integration/summary-replay.test.mjs +11 -0
  768. package/dist/benchmarks/task-revisions/mp-performance-investigation/workspace/test/unit/cache-key.test.mjs +9 -0
  769. package/dist/benchmarks/task-revisions/pf-api-pagination-behavior/input-manifest.json +53 -0
  770. package/dist/benchmarks/task-revisions/pf-api-pagination-behavior/rubric.json +44 -0
  771. package/dist/benchmarks/task-revisions/pf-api-pagination-behavior/task.md +7 -0
  772. package/dist/benchmarks/task-revisions/pf-api-pagination-behavior/workspace/package.json +6 -0
  773. package/dist/benchmarks/task-revisions/pf-api-pagination-behavior/workspace/spec/pagination-contract.md +9 -0
  774. package/dist/benchmarks/task-revisions/pf-api-pagination-behavior/workspace/src/api-pages.mjs +16 -0
  775. package/dist/benchmarks/task-revisions/pf-api-pagination-behavior/workspace/src/catalog-consumer.mjs +5 -0
  776. package/dist/benchmarks/task-revisions/pf-api-pagination-behavior/workspace/src/pagination.mjs +19 -0
  777. package/dist/benchmarks/task-revisions/pf-api-pagination-behavior/workspace/test/pagination.test.mjs +76 -0
  778. package/dist/benchmarks/task-revisions/pf-ci-cache-flake/input-manifest.json +77 -0
  779. package/dist/benchmarks/task-revisions/pf-ci-cache-flake/rubric.json +44 -0
  780. package/dist/benchmarks/task-revisions/pf-ci-cache-flake/task.md +11 -0
  781. package/dist/benchmarks/task-revisions/pf-ci-cache-flake/workspace/ci/build-config.json +11 -0
  782. package/dist/benchmarks/task-revisions/pf-ci-cache-flake/workspace/ci/build-history.log +6 -0
  783. package/dist/benchmarks/task-revisions/pf-ci-cache-flake/workspace/ci/scenarios.json +38 -0
  784. package/dist/benchmarks/task-revisions/pf-ci-cache-flake/workspace/docs/investigation-contract.md +19 -0
  785. package/dist/benchmarks/task-revisions/pf-ci-cache-flake/workspace/investigation.schema.json +503 -0
  786. package/dist/benchmarks/task-revisions/pf-ci-cache-flake/workspace/package.json +14 -0
  787. package/dist/benchmarks/task-revisions/pf-ci-cache-flake/workspace/scripts/reproduce-cache.mjs +5 -0
  788. package/dist/benchmarks/task-revisions/pf-ci-cache-flake/workspace/scripts/validate-report.mjs +31 -0
  789. package/dist/benchmarks/task-revisions/pf-ci-cache-flake/workspace/src/cache-model.mjs +9 -0
  790. package/dist/benchmarks/task-revisions/pf-ci-cache-flake/workspace/test/cache-observation.test.mjs +33 -0
  791. package/dist/benchmarks/task-revisions/pf-ci-cache-flake/workspace/test/report-structure.test.mjs +2 -0
  792. package/dist/benchmarks/task-revisions/pf-data-schema-evolution/input-manifest.json +68 -0
  793. package/dist/benchmarks/task-revisions/pf-data-schema-evolution/rubric.json +45 -0
  794. package/dist/benchmarks/task-revisions/pf-data-schema-evolution/task.md +11 -0
  795. package/dist/benchmarks/task-revisions/pf-data-schema-evolution/workspace/data/legacy-customers.json +17 -0
  796. package/dist/benchmarks/task-revisions/pf-data-schema-evolution/workspace/migrations/v1-v2.plan.json +11 -0
  797. package/dist/benchmarks/task-revisions/pf-data-schema-evolution/workspace/package.json +12 -0
  798. package/dist/benchmarks/task-revisions/pf-data-schema-evolution/workspace/schemas/customer-v1.schema.json +27 -0
  799. package/dist/benchmarks/task-revisions/pf-data-schema-evolution/workspace/schemas/customer-v2.schema.json +25 -0
  800. package/dist/benchmarks/task-revisions/pf-data-schema-evolution/workspace/spec/evolution-contract.md +8 -0
  801. package/dist/benchmarks/task-revisions/pf-data-schema-evolution/workspace/src/readers.mjs +3 -0
  802. package/dist/benchmarks/task-revisions/pf-data-schema-evolution/workspace/src/schema-contract.mjs +7 -0
  803. package/dist/benchmarks/task-revisions/pf-data-schema-evolution/workspace/test/schema-evolution.test.mjs +15 -0
  804. package/dist/benchmarks/task-revisions/pf-frontend-async-state/input-manifest.json +47 -0
  805. package/dist/benchmarks/task-revisions/pf-frontend-async-state/rubric.json +37 -0
  806. package/dist/benchmarks/task-revisions/pf-frontend-async-state/task.md +7 -0
  807. package/dist/benchmarks/task-revisions/pf-frontend-async-state/workspace/package.json +1 -0
  808. package/dist/benchmarks/task-revisions/pf-frontend-async-state/workspace/spec/search-state-contract.md +6 -0
  809. package/dist/benchmarks/task-revisions/pf-frontend-async-state/workspace/src/search-controller.mjs +5 -0
  810. package/dist/benchmarks/task-revisions/pf-frontend-async-state/workspace/src/search-view.mjs +3 -0
  811. package/dist/benchmarks/task-revisions/pf-frontend-async-state/workspace/test/search-state.test.mjs +14 -0
  812. package/dist/benchmarks/task-revisions/pf-library-compat-upgrade/input-manifest.json +90 -0
  813. package/dist/benchmarks/task-revisions/pf-library-compat-upgrade/rubric.json +42 -0
  814. package/dist/benchmarks/task-revisions/pf-library-compat-upgrade/task.md +9 -0
  815. package/dist/benchmarks/task-revisions/pf-library-compat-upgrade/workspace/config/migration-settings.json +5 -0
  816. package/dist/benchmarks/task-revisions/pf-library-compat-upgrade/workspace/data/compatibility-matrix.json +44 -0
  817. package/dist/benchmarks/task-revisions/pf-library-compat-upgrade/workspace/docs/migration-contract.md +13 -0
  818. package/dist/benchmarks/task-revisions/pf-library-compat-upgrade/workspace/package.json +13 -0
  819. package/dist/benchmarks/task-revisions/pf-library-compat-upgrade/workspace/scripts/check-rollback.mjs +5 -0
  820. package/dist/benchmarks/task-revisions/pf-library-compat-upgrade/workspace/scripts/validate-migration.mjs +2 -0
  821. package/dist/benchmarks/task-revisions/pf-library-compat-upgrade/workspace/src/archive-compat.mjs +2 -0
  822. package/dist/benchmarks/task-revisions/pf-library-compat-upgrade/workspace/src/download-export.mjs +5 -0
  823. package/dist/benchmarks/task-revisions/pf-library-compat-upgrade/workspace/src/scheduled-export.mjs +5 -0
  824. package/dist/benchmarks/task-revisions/pf-library-compat-upgrade/workspace/test/application-callers.test.mjs +19 -0
  825. package/dist/benchmarks/task-revisions/pf-library-compat-upgrade/workspace/test/archive-compat.test.mjs +13 -0
  826. package/dist/benchmarks/task-revisions/pf-library-compat-upgrade/workspace/vendor/archive-v1.mjs +3 -0
  827. package/dist/benchmarks/task-revisions/pf-library-compat-upgrade/workspace/vendor/archive-v2.mjs +3 -0
  828. package/dist/benchmarks/task-revisions/pf-observability-redaction/input-manifest.json +88 -0
  829. package/dist/benchmarks/task-revisions/pf-observability-redaction/rubric.json +45 -0
  830. package/dist/benchmarks/task-revisions/pf-observability-redaction/task.md +11 -0
  831. package/dist/benchmarks/task-revisions/pf-observability-redaction/workspace/base/projection-policy.json +14 -0
  832. package/dist/benchmarks/task-revisions/pf-observability-redaction/workspace/config/field-contract.json +24 -0
  833. package/dist/benchmarks/task-revisions/pf-observability-redaction/workspace/config/projection-policy.json +18 -0
  834. package/dist/benchmarks/task-revisions/pf-observability-redaction/workspace/config/proposed-policy.json +18 -0
  835. package/dist/benchmarks/task-revisions/pf-observability-redaction/workspace/data/events.json +80 -0
  836. package/dist/benchmarks/task-revisions/pf-observability-redaction/workspace/docs/projection-contract.md +11 -0
  837. package/dist/benchmarks/task-revisions/pf-observability-redaction/workspace/package.json +13 -0
  838. package/dist/benchmarks/task-revisions/pf-observability-redaction/workspace/pr.diff +19 -0
  839. package/dist/benchmarks/task-revisions/pf-observability-redaction/workspace/review.schema.json +120 -0
  840. package/dist/benchmarks/task-revisions/pf-observability-redaction/workspace/scripts/trace-policy.mjs +1 -0
  841. package/dist/benchmarks/task-revisions/pf-observability-redaction/workspace/scripts/validate-review.mjs +12 -0
  842. package/dist/benchmarks/task-revisions/pf-observability-redaction/workspace/src/project-event.mjs +7 -0
  843. package/dist/benchmarks/task-revisions/pf-observability-redaction/workspace/test/project-event.test.mjs +3 -0
  844. package/dist/benchmarks/task-revisions/pf-performance-regression/input-manifest.json +62 -0
  845. package/dist/benchmarks/task-revisions/pf-performance-regression/rubric.json +45 -0
  846. package/dist/benchmarks/task-revisions/pf-performance-regression/task.md +11 -0
  847. package/dist/benchmarks/task-revisions/pf-performance-regression/workspace/data/measurement-config.json +21 -0
  848. package/dist/benchmarks/task-revisions/pf-performance-regression/workspace/docs/lookup-contract.md +11 -0
  849. package/dist/benchmarks/task-revisions/pf-performance-regression/workspace/package.json +12 -0
  850. package/dist/benchmarks/task-revisions/pf-performance-regression/workspace/reference/scan-lookup.mjs +7 -0
  851. package/dist/benchmarks/task-revisions/pf-performance-regression/workspace/scripts/generate-data.mjs +5 -0
  852. package/dist/benchmarks/task-revisions/pf-performance-regression/workspace/scripts/measure-lookup.mjs +103 -0
  853. package/dist/benchmarks/task-revisions/pf-performance-regression/workspace/src/event-lookup.mjs +7 -0
  854. package/dist/benchmarks/task-revisions/pf-performance-regression/workspace/test/event-lookup.test.mjs +17 -0
  855. package/dist/benchmarks/task-revisions/pf-review-error-contract/input-manifest.json +87 -0
  856. package/dist/benchmarks/task-revisions/pf-review-error-contract/rubric.json +44 -0
  857. package/dist/benchmarks/task-revisions/pf-review-error-contract/task.md +11 -0
  858. package/dist/benchmarks/task-revisions/pf-review-error-contract/workspace/base/response-adapter.mjs +10 -0
  859. package/dist/benchmarks/task-revisions/pf-review-error-contract/workspace/comparisons/option-a.diff +10 -0
  860. package/dist/benchmarks/task-revisions/pf-review-error-contract/workspace/comparisons/option-b.diff +11 -0
  861. package/dist/benchmarks/task-revisions/pf-review-error-contract/workspace/data/cases.json +65 -0
  862. package/dist/benchmarks/task-revisions/pf-review-error-contract/workspace/docs/error-contract.md +10 -0
  863. package/dist/benchmarks/task-revisions/pf-review-error-contract/workspace/package.json +10 -0
  864. package/dist/benchmarks/task-revisions/pf-review-error-contract/workspace/pr.diff +13 -0
  865. package/dist/benchmarks/task-revisions/pf-review-error-contract/workspace/review.schema.json +407 -0
  866. package/dist/benchmarks/task-revisions/pf-review-error-contract/workspace/scripts/trace-cases.mjs +7 -0
  867. package/dist/benchmarks/task-revisions/pf-review-error-contract/workspace/scripts/validate-review.mjs +12 -0
  868. package/dist/benchmarks/task-revisions/pf-review-error-contract/workspace/src/client-policy.mjs +8 -0
  869. package/dist/benchmarks/task-revisions/pf-review-error-contract/workspace/src/response-adapter.mjs +10 -0
  870. package/dist/benchmarks/task-revisions/pf-review-error-contract/workspace/test/api-error.test.mjs +6 -0
  871. package/dist/benchmarks/task-revisions/rc01-shared-review-platform/input-manifest.json +808 -0
  872. package/dist/benchmarks/task-revisions/rc01-shared-review-platform/rubric.json +40 -0
  873. package/dist/bin/ask.mjs +9 -0
  874. package/dist/docs/README.md +80 -0
  875. package/dist/docs/adapter-capability-matrix.md +75 -0
  876. package/dist/docs/adapter-conformance-contract.md +81 -0
  877. package/dist/docs/adapter-cross-conformance-report.md +43 -0
  878. package/dist/docs/adapter-deployment-governance.md +110 -0
  879. package/dist/docs/adapter-runtime-boundary-contract.md +211 -0
  880. package/dist/docs/adapter-runtime-migration.md +130 -0
  881. package/dist/docs/adoption-apply.md +97 -0
  882. package/dist/docs/adoption-setup.md +150 -0
  883. package/dist/docs/adr/0001-verification-evidence-trust-boundary.md +100 -0
  884. package/dist/docs/adr/0002-epic-admission-work-package-plan-authority.md +76 -0
  885. package/dist/docs/adr/0003-asset-registry-authority-boundary.md +120 -0
  886. package/dist/docs/adr/0004-portfolio-activation-authority-boundary.md +290 -0
  887. package/dist/docs/adr/0005-evolution-authority-boundary.md +195 -0
  888. package/dist/docs/adr/0006-claim-evidence-status-boundary.md +57 -0
  889. package/dist/docs/adr/0007-runner-owned-execution-envelope-record.md +28 -0
  890. package/dist/docs/adr/0008-monotonic-verification-proof-path.md +122 -0
  891. package/dist/docs/adr/0009-baseline-semantic-review-authority.md +74 -0
  892. package/dist/docs/adr/0010-one-task-effectiveness-authority-boundary.md +143 -0
  893. package/dist/docs/adr/0011-prompt-v2-result-blind-canary-authority.md +155 -0
  894. package/dist/docs/adr/0025-discarded-evaluation-result-use.md +31 -0
  895. package/dist/docs/agent-session-state-contract.md +67 -0
  896. package/dist/docs/ai/adoption-report-template.md +179 -0
  897. package/dist/docs/ai/architecture-decision-memory.md +83 -0
  898. package/dist/docs/ai/documentation-knowledge-ledger.md +85 -0
  899. package/dist/docs/ai/domain-rule-ledger.md +115 -0
  900. package/dist/docs/ai/engineering-capability-ledger.md +90 -0
  901. package/dist/docs/ai/engineering-pattern-ledger.md +81 -0
  902. package/dist/docs/ai/implementation-context.md +158 -0
  903. package/dist/docs/ai/improvement-ledger.md +212 -0
  904. package/dist/docs/ai/metrics/README.md +9 -0
  905. package/dist/docs/ai/metrics/fixtures/stakeholder-readiness-events.jsonl +3 -0
  906. package/dist/docs/ai/observability-config.yml +54 -0
  907. package/dist/docs/ai/reports/README.md +5 -0
  908. package/dist/docs/ai/reports/examples/ai-promotion-readiness-sample.md +43 -0
  909. package/dist/docs/ai/reports/examples/business-unit-client-value-readiness-sample.md +37 -0
  910. package/dist/docs/ai/reports/examples/development-manager-readiness-sample.md +41 -0
  911. package/dist/docs/ai/reports/examples/senior-engineer-readiness-sample.md +42 -0
  912. package/dist/docs/ai/review-context.md +127 -0
  913. package/dist/docs/ai/review-rule-ledger.md +78 -0
  914. package/dist/docs/ai/skill-adoption-metrics.md +251 -0
  915. package/dist/docs/ai/stakeholder-readiness-report-template.md +139 -0
  916. package/dist/docs/ai/verification-pattern-ledger.md +83 -0
  917. package/dist/docs/ask-autonomous-development.md +237 -0
  918. package/dist/docs/ask-core-bundle-implementation.md +155 -0
  919. package/dist/docs/asset-registry-contract.md +392 -0
  920. package/dist/docs/bounded-target-snapshot.md +90 -0
  921. package/dist/docs/claim-evidence-status-contract.md +60 -0
  922. package/dist/docs/claude-github-review-setup.md +65 -0
  923. package/dist/docs/codex-metrics-collector.md +149 -0
  924. package/dist/docs/cross-runtime-environment-loop.md +345 -0
  925. package/dist/docs/customization-guide.md +175 -0
  926. package/dist/docs/debt-lifecycle-contract.md +134 -0
  927. package/dist/docs/demos/personal-loop-saved-demo-ja.md +38 -0
  928. package/dist/docs/epic-admission-work-package-plan-contract.md +239 -0
  929. package/dist/docs/evaluation-task-catalog.md +107 -0
  930. package/dist/docs/evolution-loop-contract.md +395 -0
  931. package/dist/docs/evolution-loop-sample-prompt-candidate.md +15 -0
  932. package/dist/docs/execution-envelope-contract.md +105 -0
  933. package/dist/docs/finding-intake.md +165 -0
  934. package/dist/docs/first-workflow-mac-codex-ja.md +132 -0
  935. package/dist/docs/fixtures/adapter-cross-conformance.json +272 -0
  936. package/dist/docs/fixtures/adapter-runtime-bundle.json +867 -0
  937. package/dist/docs/fixtures/adapter-runtime-evidence.json +111 -0
  938. package/dist/docs/fixtures/adapter-runtime-profiles.json +2055 -0
  939. package/dist/docs/fixtures/asset-registry/reference.json +89 -0
  940. package/dist/docs/fixtures/asset-registry/store/objects/sha256/06/cacaea5b7b84bb2a9f6a6e849f1e561967637cfc0c28bd60675b665f090a54.json +1 -0
  941. package/dist/docs/fixtures/asset-registry/store/objects/sha256/0a/1bf5ec027954e2def2bf6591655365258e4ed6c3e58a151ea242b961591dcc.json +1 -0
  942. package/dist/docs/fixtures/asset-registry/store/objects/sha256/12/4a398892b63295e43b894776bea049625e3847010acd2dce61880a207cf1da.json +1 -0
  943. package/dist/docs/fixtures/asset-registry/store/objects/sha256/33/d26707d82e68099085b91f60b26b6bea6ea17af802a493dd70ee4629dfc72b.json +1 -0
  944. package/dist/docs/fixtures/asset-registry/store/objects/sha256/34/a511af596bc1317941241135f053153d9862ff7552a243c0231fc079c4edba.json +1 -0
  945. package/dist/docs/fixtures/asset-registry/store/objects/sha256/39/f30afcc78d50c1ff2cf85d4c18d546b47811c370146193535af08cc030cc65.json +1 -0
  946. package/dist/docs/fixtures/asset-registry/store/objects/sha256/43/e18c25bca6279ab7b333b5e4ce3bfdc8ada01023bfe47d0889d61e71872c56.json +1 -0
  947. package/dist/docs/fixtures/asset-registry/store/objects/sha256/5b/50712f43feecf82d532178310cf2e0fe2fe709e0d951eb797a3876ff0cf92d.json +1 -0
  948. package/dist/docs/fixtures/asset-registry/store/objects/sha256/5c/c2ab9ca47824d2d13438f7f4460b71db1a6f939cfce1b0f84291e3e5935be5.json +1 -0
  949. package/dist/docs/fixtures/asset-registry/store/objects/sha256/62/1237eed65b92d996a11b259d7ef8854357c9fd1e7170071d59c4f50f4e7b3e.json +1 -0
  950. package/dist/docs/fixtures/asset-registry/store/objects/sha256/9b/fd6af3c3768f8760fb1fe8b8ab98e6d4753d4802e38f7604b446dc7b14a95a.json +1 -0
  951. package/dist/docs/fixtures/asset-registry/store/objects/sha256/be/c5d5f8f9ee2f8fdab1902f73888b251eb9e62e55bef3529542ab0deb8a48e2.json +1 -0
  952. package/dist/docs/fixtures/asset-registry/store/objects/sha256/c6/19c6c426da2f6fac9185c2426908ea83ff1598e5e9af7add61f509678a5853.json +1 -0
  953. package/dist/docs/fixtures/asset-registry/store/objects/sha256/d6/e6ac3acac3ee396987fd0333b6193c809156c88eb343b43c9e0b0c72fbe1c5.json +1 -0
  954. package/dist/docs/fixtures/asset-registry/store/objects/sha256/d9/6f3131c5d6556d2fa74665befef66c0d279dd1177dc6d41f232f2844eafba6.json +1 -0
  955. package/dist/docs/fixtures/asset-registry/store/objects/sha256/f4/6abf273daaaf13cc96c10e54d2de72ba8cd269a58d1ea047331c38ba13dc18.json +1 -0
  956. package/dist/docs/fixtures/claude-fixed-entry-route-baseline.json +36 -0
  957. package/dist/docs/fixtures/claude-pre-fixed-commands/skill-handoff.md +32 -0
  958. package/dist/docs/fixtures/claude-pre-fixed-commands/skill-implement.md +30 -0
  959. package/dist/docs/fixtures/claude-pre-fixed-commands/skill-investigate.md +25 -0
  960. package/dist/docs/fixtures/claude-pre-fixed-commands/skill-review.md +54 -0
  961. package/dist/docs/fixtures/claude-pre-fixed-commands/skill-verify.md +36 -0
  962. package/dist/docs/fixtures/codex-compact-route-baseline.json +42 -0
  963. package/dist/docs/fixtures/codex-pre-compact-prompts/skill-handoff.md +43 -0
  964. package/dist/docs/fixtures/codex-pre-compact-prompts/skill-implement.md +55 -0
  965. package/dist/docs/fixtures/codex-pre-compact-prompts/skill-investigate.md +55 -0
  966. package/dist/docs/fixtures/codex-pre-compact-prompts/skill-review.md +68 -0
  967. package/dist/docs/fixtures/codex-pre-compact-prompts/skill-verify.md +55 -0
  968. package/dist/docs/fixtures/epic-admission-policy.json +50 -0
  969. package/dist/docs/fixtures/epic-admission-work-package-plan-cases.json +766 -0
  970. package/dist/docs/fixtures/evolution-loop/reference.json +551 -0
  971. package/dist/docs/fixtures/first-workflow-315/bypass-input-ja.md +2 -0
  972. package/dist/docs/fixtures/first-workflow-315/implementation-input-ja.md +15 -0
  973. package/dist/docs/fixtures/issue-275-slice-1-epic-admission-decision.json +86 -0
  974. package/dist/docs/fixtures/issue-275-slice-1-work-package-plan-r1.json +1053 -0
  975. package/dist/docs/fixtures/issue-275-slice-1-work-package-plan-r2.json +1078 -0
  976. package/dist/docs/fixtures/issue-275-slice-1-work-package-plan-validation-context-r1.json +81 -0
  977. package/dist/docs/fixtures/issue-275-slice-1-work-package-plan-validation-context-r2.json +117 -0
  978. package/dist/docs/fixtures/issue-275-slice-1-work-package-plan-validation-context.json +117 -0
  979. package/dist/docs/fixtures/issue-275-slice-1-work-package-plan.json +1126 -0
  980. package/dist/docs/fixtures/kernel-principles-source-5f36081.md +266 -0
  981. package/dist/docs/fixtures/lifecycle-artifact-chains.json +108 -0
  982. package/dist/docs/fixtures/lifecycle-traceability-chains.json +356 -0
  983. package/dist/docs/fixtures/portfolio-manager/reference.json +70 -0
  984. package/dist/docs/fixtures/pragmatic-evaluation/notes-template.json +39 -0
  985. package/dist/docs/fixtures/prompt-v2-preregistration/binding.json +170 -0
  986. package/dist/docs/fixtures/prompt-v2-preregistration/reference.json +397 -0
  987. package/dist/docs/fixtures/prompt-v2-preregistration/rendered/claude_code/skill-handoff.md +32 -0
  988. package/dist/docs/fixtures/prompt-v2-preregistration/rendered/claude_code/skill-implement.md +38 -0
  989. package/dist/docs/fixtures/prompt-v2-preregistration/rendered/claude_code/skill-investigate.md +35 -0
  990. package/dist/docs/fixtures/prompt-v2-preregistration/rendered/claude_code/skill-review.md +49 -0
  991. package/dist/docs/fixtures/prompt-v2-preregistration/rendered/claude_code/skill-verify.md +43 -0
  992. package/dist/docs/fixtures/prompt-v2-preregistration/rendered/codex/skill-handoff.md +29 -0
  993. package/dist/docs/fixtures/prompt-v2-preregistration/rendered/codex/skill-implement.md +34 -0
  994. package/dist/docs/fixtures/prompt-v2-preregistration/rendered/codex/skill-investigate.md +33 -0
  995. package/dist/docs/fixtures/prompt-v2-preregistration/rendered/codex/skill-review.md +50 -0
  996. package/dist/docs/fixtures/prompt-v2-preregistration/rendered/codex/skill-verify.md +34 -0
  997. package/dist/docs/fixtures/prompt-v2-preregistration/rendered/reference.json +94 -0
  998. package/dist/docs/fixtures/release-evidence-gate/current-main-756c72-claim-matrix.json +74 -0
  999. package/dist/docs/fixtures/release-evidence-gate/current-main-756c72-evidence.json +30 -0
  1000. package/dist/docs/fixtures/release-evidence-gate/current-main-d4ad39-claim-matrix.json +389 -0
  1001. package/dist/docs/fixtures/release-evidence-gate/current-main-d4ad39-evidence.json +1024 -0
  1002. package/dist/docs/fixtures/release-evidence-gate/current-main-d4ad39-independent-review.md +95 -0
  1003. package/dist/docs/fixtures/release-evidence-gate/current-main-d4ad39-observations.json +87 -0
  1004. package/dist/docs/fixtures/release-evidence-gate/mac-install-recovery-candidate.json +232 -0
  1005. package/dist/docs/fixtures/release-evidence-gate/mac-install-recovery-review.md +112 -0
  1006. package/dist/docs/fixtures/review-route-cases.json +830 -0
  1007. package/dist/docs/fixtures/skill-effectiveness-outcome-cases.json +549 -0
  1008. package/dist/docs/fixtures/sufficient-change-scope/stage-1.md +51 -0
  1009. package/dist/docs/fixtures/sufficient-change-scope/stage-2.md +30 -0
  1010. package/dist/docs/fixtures/ui-ux-design/README.md +36 -0
  1011. package/dist/docs/fixtures/ui-ux-design/fixture-state.mjs +140 -0
  1012. package/dist/docs/fixtures/ui-ux-design/fixture-state.test.mjs +171 -0
  1013. package/dist/docs/fixtures/ui-ux-design/fixture.mjs +154 -0
  1014. package/dist/docs/fixtures/verification-proof-formal-baseline.md +14 -0
  1015. package/dist/docs/fixtures/verification-proof-policy-cases.json +906 -0
  1016. package/dist/docs/glossary-ja.md +433 -0
  1017. package/dist/docs/instruction-improvement-continuity.md +237 -0
  1018. package/dist/docs/instruction-improvement-delivery.md +130 -0
  1019. package/dist/docs/instruction-improvement-learning-context.md +118 -0
  1020. package/dist/docs/instruction-improvement-readiness.md +116 -0
  1021. package/dist/docs/instruction-loop-failed-preparation.md +45 -0
  1022. package/dist/docs/instruction-loop-fixed-reference-scoring.md +57 -0
  1023. package/dist/docs/instruction-loop-host-authoring.md +83 -0
  1024. package/dist/docs/instruction-loop-reference-evidence.md +185 -0
  1025. package/dist/docs/instruction-loop-retained-authoring.md +115 -0
  1026. package/dist/docs/instruction-loop-source-application.md +110 -0
  1027. package/dist/docs/instruction-loop-source-validation.md +65 -0
  1028. package/dist/docs/instruction-loop-standard-execution.md +101 -0
  1029. package/dist/docs/kernel-principles-candidate-v2.md +124 -0
  1030. package/dist/docs/kernel-principles-comparison.md +135 -0
  1031. package/dist/docs/kernel-principles-v2-adoption.md +118 -0
  1032. package/dist/docs/kernel-standalone-design-proposal.md +198 -0
  1033. package/dist/docs/kernel-standalone-instruction-draft.md +206 -0
  1034. package/dist/docs/lifecycle-artifact-contract.md +274 -0
  1035. package/dist/docs/lifecycle-traceability-contract.md +169 -0
  1036. package/dist/docs/local-codex-admission.md +177 -0
  1037. package/dist/docs/local-codex-connection.md +60 -0
  1038. package/dist/docs/local-codex-read-policy.md +210 -0
  1039. package/dist/docs/local-codex-single-sandbox-design.md +73 -0
  1040. package/dist/docs/local-eval-distribution.md +222 -0
  1041. package/dist/docs/local-full-static-preparation.md +137 -0
  1042. package/dist/docs/local-three-arm-comparison.md +142 -0
  1043. package/dist/docs/local-three-arm-qualification.md +89 -0
  1044. package/dist/docs/mac-ask-full-reference-supplement.json +249 -0
  1045. package/dist/docs/mac-ask-full-static-inventory.json +1488 -0
  1046. package/dist/docs/mac-kernel-value-screening.md +253 -0
  1047. package/dist/docs/measured-review-adoption.md +88 -0
  1048. package/dist/docs/metrics-event-contract.md +252 -0
  1049. package/dist/docs/npm-distribution-ja.md +133 -0
  1050. package/dist/docs/npm-distribution.md +300 -0
  1051. package/dist/docs/npm-loop-spec-example.mjs +34 -0
  1052. package/dist/docs/observability-runtime-contract.md +164 -0
  1053. package/dist/docs/operation-automation-contract.md +89 -0
  1054. package/dist/docs/personal-evolution-bridge.md +33 -0
  1055. package/dist/docs/personal-evolution-cli.md +238 -0
  1056. package/dist/docs/personal-evolution-codex-generation.md +166 -0
  1057. package/dist/docs/personal-evolution-driver.md +15 -0
  1058. package/dist/docs/personal-evolution-generation-connector.md +139 -0
  1059. package/dist/docs/personal-evolution-generation-status.md +86 -0
  1060. package/dist/docs/personal-evolution-generation.md +31 -0
  1061. package/dist/docs/personal-evolution-primary-loop.md +241 -0
  1062. package/dist/docs/personal-evolution-primary-pair-contract.md +72 -0
  1063. package/dist/docs/personal-evolution-saved-results.md +31 -0
  1064. package/dist/docs/personal-evolution-source-reviewer.md +84 -0
  1065. package/dist/docs/personal-evolution-unattended.md +169 -0
  1066. package/dist/docs/personal-loop-quickstart-ja.md +79 -0
  1067. package/dist/docs/personal-v1-release-preparation-ja.md +41 -0
  1068. package/dist/docs/portfolio-manager-contract.md +596 -0
  1069. package/dist/docs/practical-challenge-evaluation.md +273 -0
  1070. package/dist/docs/practical-evaluation-recovery.md +487 -0
  1071. package/dist/docs/practical-grade-supplement.md +193 -0
  1072. package/dist/docs/practical-partial-grading.md +121 -0
  1073. package/dist/docs/practical-quality-observations.md +69 -0
  1074. package/dist/docs/practical-retained-grade-report.md +106 -0
  1075. package/dist/docs/pragmatic-evaluation.md +149 -0
  1076. package/dist/docs/primary-24-practical-review.md +281 -0
  1077. package/dist/docs/primary-24-practical-revision.md +256 -0
  1078. package/dist/docs/primary-24-private-v2.md +28 -0
  1079. package/dist/docs/primary-24-task-assembly.md +276 -0
  1080. package/dist/docs/primary-24-unsafe-action-v8.md +28 -0
  1081. package/dist/docs/primary-evaluation-correctness-v7.md +188 -0
  1082. package/dist/docs/primary-principles-v2-connection.md +88 -0
  1083. package/dist/docs/project-overlay-template.md +152 -0
  1084. package/dist/docs/prompt-recipes-ja.md +955 -0
  1085. package/dist/docs/prompt-v2-execution-handoff.md +81 -0
  1086. package/dist/docs/quality-rubric.md +145 -0
  1087. package/dist/docs/quickstart-ja.md +388 -0
  1088. package/dist/docs/quickstart-mac-codex-ja.md +160 -0
  1089. package/dist/docs/references.md +18 -0
  1090. package/dist/docs/release-evidence-gate-contract.md +198 -0
  1091. package/dist/docs/release-package-2026-10.md +129 -0
  1092. package/dist/docs/review-finding-contract.md +54 -0
  1093. package/dist/docs/review-rule-lifecycle.md +205 -0
  1094. package/dist/docs/routing-model.md +274 -0
  1095. package/dist/docs/rule-batch-prospective-comparison.md +88 -0
  1096. package/dist/docs/skill-effectiveness-evaluation-contract.md +146 -0
  1097. package/dist/docs/skill-matrix.md +190 -0
  1098. package/dist/docs/stack-implementation-overlay-contract.md +122 -0
  1099. package/dist/docs/sufficient-change-scope-evaluation.md +120 -0
  1100. package/dist/docs/supervised-instruction-loop.md +464 -0
  1101. package/dist/docs/unattended-user-comparison-contract.md +90 -0
  1102. package/dist/docs/usage-ja.md +501 -0
  1103. package/dist/docs/user-comparison-contract.md +75 -0
  1104. package/dist/docs/user-repository-comparison-mac-codex-ja.md +571 -0
  1105. package/dist/docs/validation-report.md +756 -0
  1106. package/dist/docs/verification-evidence-contract.md +175 -0
  1107. package/dist/docs/verification-proof-policy-contract.md +177 -0
  1108. package/dist/docs/verification-reuse-completion-contract.md +129 -0
  1109. package/dist/docs/verification-reuse-measurement.md +130 -0
  1110. package/dist/docs/workflow-examples.md +539 -0
  1111. package/dist/examples/01-small-change.md +32 -0
  1112. package/dist/examples/02-new-feature.md +53 -0
  1113. package/dist/examples/03-bug-fix.md +39 -0
  1114. package/dist/examples/04-design-grill.md +40 -0
  1115. package/dist/examples/05-pr-review.md +43 -0
  1116. package/dist/examples/06-handoff-to-agent.md +49 -0
  1117. package/dist/examples/07-mr-readme.md +32 -0
  1118. package/dist/examples/08-code-health-review.md +50 -0
  1119. package/dist/examples/09-improvement-ledger-update.md +90 -0
  1120. package/dist/examples/10-safe-refactor.md +76 -0
  1121. package/dist/examples/11-prevention-rule-feedback.md +104 -0
  1122. package/dist/examples/12-claude-adapter-adoption.md +36 -0
  1123. package/dist/manifest.json +804 -0
  1124. package/dist/npm-runtime-inventory.json +7774 -0
  1125. package/dist/package.json +38 -0
  1126. package/dist/products/ask-core-bundle/AGENTS.md +195 -0
  1127. package/dist/products/ask-core-bundle/capabilities.json +65 -0
  1128. package/dist/products/ask-core-bundle/manifest.json +2738 -0
  1129. package/dist/schemas/adapter-runtime-event.schema.json +169 -0
  1130. package/dist/schemas/adapter-runtime-evidence.schema.json +60 -0
  1131. package/dist/schemas/adapter-runtime-profile.schema.json +281 -0
  1132. package/dist/schemas/adoption-apply-result.schema.json +215 -0
  1133. package/dist/schemas/adoption-plan.schema.json +366 -0
  1134. package/dist/schemas/adoption-report.schema.json +252 -0
  1135. package/dist/schemas/architecture-decision-memory-entry.schema.json +56 -0
  1136. package/dist/schemas/asset-content.schema.json +107 -0
  1137. package/dist/schemas/asset-lifecycle-authority-context.schema.json +69 -0
  1138. package/dist/schemas/asset-record.schema.json +362 -0
  1139. package/dist/schemas/asset-registry-snapshot.schema.json +59 -0
  1140. package/dist/schemas/claim-evidence-status.schema.json +85 -0
  1141. package/dist/schemas/codex-risk-action.schema.json +58 -0
  1142. package/dist/schemas/codex-risk-approval-request.schema.json +204 -0
  1143. package/dist/schemas/codex-risk-approval.schema.json +15 -0
  1144. package/dist/schemas/codex-runner-result.schema.json +41 -0
  1145. package/dist/schemas/compact-profile-control-map.json +154 -0
  1146. package/dist/schemas/context-rollover.schema.json +726 -0
  1147. package/dist/schemas/documentation-knowledge-ledger-entry.schema.json +49 -0
  1148. package/dist/schemas/domain-rule-ledger-entry.schema.json +93 -0
  1149. package/dist/schemas/effectiveness-decision-vocabulary.schema.json +24 -0
  1150. package/dist/schemas/engineering-capability-ledger-entry.schema.json +50 -0
  1151. package/dist/schemas/engineering-pattern-ledger-entry.schema.json +48 -0
  1152. package/dist/schemas/epic-admission-decision.schema.json +196 -0
  1153. package/dist/schemas/epic-admission-policy.schema.json +153 -0
  1154. package/dist/schemas/evolution-action-proposal.schema.json +183 -0
  1155. package/dist/schemas/evolution-application-receipt.schema.json +263 -0
  1156. package/dist/schemas/evolution-candidate.schema.json +269 -0
  1157. package/dist/schemas/evolution-experiment.schema.json +368 -0
  1158. package/dist/schemas/evolution-human-decision.schema.json +79 -0
  1159. package/dist/schemas/evolution-recommendation.schema.json +211 -0
  1160. package/dist/schemas/execution-envelope-record.schema.json +127 -0
  1161. package/dist/schemas/execution-envelope.schema.json +127 -0
  1162. package/dist/schemas/fixed-entry-profile-registry.json +44 -0
  1163. package/dist/schemas/improvement-ledger-entry.schema.json +98 -0
  1164. package/dist/schemas/instruction-asset-package.schema.json +343 -0
  1165. package/dist/schemas/metrics-event.schema.json +395 -0
  1166. package/dist/schemas/normalized-event-schema-registry.json +13 -0
  1167. package/dist/schemas/portfolio-authority-context.schema.json +151 -0
  1168. package/dist/schemas/portfolio-lock.schema.json +99 -0
  1169. package/dist/schemas/portfolio-manifest.schema.json +414 -0
  1170. package/dist/schemas/portfolio-selection-context.schema.json +101 -0
  1171. package/dist/schemas/portfolio-selection.schema.json +266 -0
  1172. package/dist/schemas/release-assessment.schema.json +64 -0
  1173. package/dist/schemas/release-claim-matrix.schema.json +89 -0
  1174. package/dist/schemas/release-evidence-catalog.schema.json +154 -0
  1175. package/dist/schemas/repository-snapshot.schema.json +244 -0
  1176. package/dist/schemas/review-finding.schema.json +110 -0
  1177. package/dist/schemas/review-rule-ledger-entry.schema.json +52 -0
  1178. package/dist/schemas/review-signal-gate-map.json +128 -0
  1179. package/dist/schemas/rollover-evaluation.schema.json +397 -0
  1180. package/dist/schemas/session-checkpoint.schema.json +206 -0
  1181. package/dist/schemas/skill-effectiveness-outcome.schema.json +490 -0
  1182. package/dist/schemas/verification-completion-policy.schema.json +79 -0
  1183. package/dist/schemas/verification-evidence-transfer.schema.json +67 -0
  1184. package/dist/schemas/verification-evidence.schema.json +352 -0
  1185. package/dist/schemas/verification-pattern-ledger-entry.schema.json +52 -0
  1186. package/dist/schemas/verification-proof-policy.schema.json +326 -0
  1187. package/dist/schemas/verification-reuse-measurement.schema.json +370 -0
  1188. package/dist/schemas/verification-reuse-plan.schema.json +239 -0
  1189. package/dist/schemas/verification-scoped-reuse.schema.json +484 -0
  1190. package/dist/schemas/work-package-plan-validation-context.schema.json +244 -0
  1191. package/dist/schemas/work-package-plan.schema.json +495 -0
  1192. package/dist/scripts/adapter-cross-conformance.mjs +431 -0
  1193. package/dist/scripts/adapter-runtime-bundle.mjs +452 -0
  1194. package/dist/scripts/adapter-runtime-event.mjs +233 -0
  1195. package/dist/scripts/adapter-runtime-inventory.mjs +69 -0
  1196. package/dist/scripts/adapter-runtime-smoke.mjs +372 -0
  1197. package/dist/scripts/ai-ledger-refresh.mjs +387 -0
  1198. package/dist/scripts/ai-metrics-record.mjs +1318 -0
  1199. package/dist/scripts/ai-metrics-summarize.mjs +1085 -0
  1200. package/dist/scripts/ask-benchmark-admission-decision.mjs +675 -0
  1201. package/dist/scripts/ask-benchmark-atomic-publication.mjs +85 -0
  1202. package/dist/scripts/ask-benchmark-calibration-source.mjs +49 -0
  1203. package/dist/scripts/ask-benchmark-command-evidence.mjs +1048 -0
  1204. package/dist/scripts/ask-benchmark-design-admission.mjs +524 -0
  1205. package/dist/scripts/ask-benchmark-design-review.mjs +387 -0
  1206. package/dist/scripts/ask-benchmark-duplicate-key-json.mjs +133 -0
  1207. package/dist/scripts/ask-benchmark-evaluator-boundary.mjs +3869 -0
  1208. package/dist/scripts/ask-benchmark-execution.mjs +2442 -0
  1209. package/dist/scripts/ask-benchmark-materialize.mjs +582 -0
  1210. package/dist/scripts/ask-benchmark-mn-build-option-update.mjs +506 -0
  1211. package/dist/scripts/ask-benchmark-mn-client-probe-v2.mjs +185 -0
  1212. package/dist/scripts/ask-benchmark-mn-focused-probe-v2.mjs +318 -0
  1213. package/dist/scripts/ask-benchmark-mn-focused-regression-test.mjs +168 -0
  1214. package/dist/scripts/ask-benchmark-mp-ci-evidence-gap.mjs +167 -0
  1215. package/dist/scripts/ask-benchmark-normalized-results.mjs +884 -0
  1216. package/dist/scripts/ask-benchmark-pf-performance-probe.mjs +342 -0
  1217. package/dist/scripts/ask-benchmark-pf-performance-source.mjs +248 -0
  1218. package/dist/scripts/ask-benchmark-plan.mjs +284 -0
  1219. package/dist/scripts/ask-benchmark-portfolio-aggregate-result-v2.mjs +929 -0
  1220. package/dist/scripts/ask-benchmark-portfolio-aggregate-result.mjs +354 -0
  1221. package/dist/scripts/ask-benchmark-portfolio-catalog.mjs +378 -0
  1222. package/dist/scripts/ask-benchmark-portfolio-consumer-report.mjs +193 -0
  1223. package/dist/scripts/ask-benchmark-portfolio-directional-outcome-report.mjs +274 -0
  1224. package/dist/scripts/ask-benchmark-portfolio-evolution-evidence.mjs +169 -0
  1225. package/dist/scripts/ask-benchmark-portfolio-high-impact-sensitivity.mjs +209 -0
  1226. package/dist/scripts/ask-benchmark-portfolio-legacy-calibration-migration.mjs +383 -0
  1227. package/dist/scripts/ask-benchmark-portfolio-mechanism-scorecard.mjs +382 -0
  1228. package/dist/scripts/ask-benchmark-portfolio-paired-comparison-report.mjs +460 -0
  1229. package/dist/scripts/ask-benchmark-portfolio-policy.mjs +1809 -0
  1230. package/dist/scripts/ask-benchmark-portfolio-repetition-report.mjs +314 -0
  1231. package/dist/scripts/ask-benchmark-portfolio-result-set.mjs +664 -0
  1232. package/dist/scripts/ask-benchmark-portfolio-score.mjs +541 -0
  1233. package/dist/scripts/ask-benchmark-private-evaluator-runner.mjs +615 -0
  1234. package/dist/scripts/ask-benchmark-prompt-successor-bridge.mjs +234 -0
  1235. package/dist/scripts/ask-benchmark-prompt-successor-check.mjs +68 -0
  1236. package/dist/scripts/ask-benchmark-prompt-successor-collection.mjs +113 -0
  1237. package/dist/scripts/ask-benchmark-prompt-successor-control.mjs +115 -0
  1238. package/dist/scripts/ask-benchmark-prompt-successor-delivery.mjs +270 -0
  1239. package/dist/scripts/ask-benchmark-prompt-successor-measured-authority.mjs +249 -0
  1240. package/dist/scripts/ask-benchmark-prompt-successor-measured-execution.mjs +733 -0
  1241. package/dist/scripts/ask-benchmark-prompt-successor-native.mjs +137 -0
  1242. package/dist/scripts/ask-benchmark-prompt-successor-provenance.mjs +191 -0
  1243. package/dist/scripts/ask-benchmark-prompt-successor-report.mjs +256 -0
  1244. package/dist/scripts/ask-benchmark-prompt-successor-repository.mjs +107 -0
  1245. package/dist/scripts/ask-benchmark-prompt-successor-scoring-inputs.mjs +218 -0
  1246. package/dist/scripts/ask-benchmark-prompt-successor-usage.mjs +174 -0
  1247. package/dist/scripts/ask-benchmark-prompt-successor.mjs +263 -0
  1248. package/dist/scripts/ask-benchmark-prompt-v2.mjs +1332 -0
  1249. package/dist/scripts/ask-benchmark-runtime-observation.mjs +235 -0
  1250. package/dist/scripts/ask-benchmark-schema.mjs +29 -0
  1251. package/dist/scripts/ask-benchmark-scoring-contract.mjs +802 -0
  1252. package/dist/scripts/ask-benchmark-selection.mjs +387 -0
  1253. package/dist/scripts/ask-benchmark-source-session.mjs +70 -0
  1254. package/dist/scripts/ask-benchmark-stable-file.mjs +89 -0
  1255. package/dist/scripts/ask-benchmark-terminal-candidate.mjs +432 -0
  1256. package/dist/scripts/ask-benchmark-terminal-workspace.mjs +427 -0
  1257. package/dist/scripts/ask-comparison-conditions.mjs +8 -0
  1258. package/dist/scripts/ask-core-bundle-product.mjs +93 -0
  1259. package/dist/scripts/ask-core-capabilities.mjs +40 -0
  1260. package/dist/scripts/ask-core-capture-producer.mjs +298 -0
  1261. package/dist/scripts/ask-core-codex-native-contract.mjs +61 -0
  1262. package/dist/scripts/ask-core-connected-normalizer.mjs +173 -0
  1263. package/dist/scripts/ask-core-controller-attribution.mjs +74 -0
  1264. package/dist/scripts/ask-core-controller-records.mjs +49 -0
  1265. package/dist/scripts/ask-core-grading-authority.mjs +161 -0
  1266. package/dist/scripts/ask-core-native-authority.mjs +42 -0
  1267. package/dist/scripts/ask-core-native-compatibility-provenance.mjs +77 -0
  1268. package/dist/scripts/ask-core-native-connection.mjs +76 -0
  1269. package/dist/scripts/ask-core-native-files.mjs +16 -0
  1270. package/dist/scripts/ask-core-native-preparation.mjs +61 -0
  1271. package/dist/scripts/ask-core-native-receiver.mjs +91 -0
  1272. package/dist/scripts/ask-core-producer-scope.mjs +38 -0
  1273. package/dist/scripts/ask-core-runner-contract.mjs +65 -0
  1274. package/dist/scripts/ask-core-scored-replay.mjs +12 -0
  1275. package/dist/scripts/ask-core-task-admission.mjs +53 -0
  1276. package/dist/scripts/ask-doctor.mjs +1037 -0
  1277. package/dist/scripts/ask-local-codex-boundaries.mjs +141 -0
  1278. package/dist/scripts/ask-local-codex-time-budget.mjs +119 -0
  1279. package/dist/scripts/ask-local-codex-time-policy.mjs +4 -0
  1280. package/dist/scripts/ask-local-codex-timing.mjs +46 -0
  1281. package/dist/scripts/ask-local-codex.mjs +653 -0
  1282. package/dist/scripts/ask-local-eval.mjs +101 -0
  1283. package/dist/scripts/ask-package-cli.mjs +64 -0
  1284. package/dist/scripts/ask-package-environment.mjs +10 -0
  1285. package/dist/scripts/ask-package-loop-prepare.mjs +87 -0
  1286. package/dist/scripts/ask-package-workspace.mjs +55 -0
  1287. package/dist/scripts/ask-personal-evolution-alignment.mjs +126 -0
  1288. package/dist/scripts/ask-personal-evolution-codex-generation.mjs +224 -0
  1289. package/dist/scripts/ask-personal-evolution-driver.mjs +139 -0
  1290. package/dist/scripts/ask-personal-evolution-generation-connector.mjs +316 -0
  1291. package/dist/scripts/ask-personal-evolution-generation.mjs +122 -0
  1292. package/dist/scripts/ask-personal-evolution-observation.mjs +71 -0
  1293. package/dist/scripts/ask-personal-evolution-primary-pair.mjs +474 -0
  1294. package/dist/scripts/ask-personal-evolution-saved-results.mjs +112 -0
  1295. package/dist/scripts/ask-personal-evolution-source-reviewer.mjs +139 -0
  1296. package/dist/scripts/ask-personal-evolution-unattended.mjs +206 -0
  1297. package/dist/scripts/ask-personal-evolution.mjs +142 -0
  1298. package/dist/scripts/ask-personal-prompt-adoption-materialization.mjs +126 -0
  1299. package/dist/scripts/ask-personal-prompt-materialization.mjs +104 -0
  1300. package/dist/scripts/ask-personal-prompt-repetition-binding.mjs +16 -0
  1301. package/dist/scripts/ask-personal-prompt-repetition-evaluation.mjs +163 -0
  1302. package/dist/scripts/ask-personal-prompt-repetition-statistics.mjs +53 -0
  1303. package/dist/scripts/ask-personal-prompt-target-lock.mjs +34 -0
  1304. package/dist/scripts/ask-pragmatic-evaluation-report.mjs +120 -0
  1305. package/dist/scripts/ask-preparation-git-diagnostic.mjs +14 -0
  1306. package/dist/scripts/ask-primary-client-focused-controller.mjs +119 -0
  1307. package/dist/scripts/ask-primary-discovery-grammar-v9.mjs +105 -0
  1308. package/dist/scripts/ask-primary-engineering-safety.mjs +147 -0
  1309. package/dist/scripts/ask-primary-evaluation-batch.mjs +318 -0
  1310. package/dist/scripts/ask-primary-evaluation-grading.mjs +451 -0
  1311. package/dist/scripts/ask-primary-evaluation-private-grading.mjs +270 -0
  1312. package/dist/scripts/ask-primary-evaluation-producer.mjs +549 -0
  1313. package/dist/scripts/ask-primary-evaluation-profile.mjs +29 -0
  1314. package/dist/scripts/ask-primary-evaluation-scope.mjs +531 -0
  1315. package/dist/scripts/ask-primary-evaluation-start.mjs +34 -0
  1316. package/dist/scripts/ask-primary-execution-input.mjs +299 -0
  1317. package/dist/scripts/ask-primary-fixture-recipe.mjs +102 -0
  1318. package/dist/scripts/ask-primary-fixture-registry.mjs +3 -0
  1319. package/dist/scripts/ask-primary-metadata-task-contract.mjs +31 -0
  1320. package/dist/scripts/ask-primary-native-probe-lifetime.mjs +233 -0
  1321. package/dist/scripts/ask-primary-public-catalog-registry.mjs +13 -0
  1322. package/dist/scripts/ask-primary-runtime-collection-support.mjs +5 -0
  1323. package/dist/scripts/ask-primary-runtime-lineage.mjs +420 -0
  1324. package/dist/scripts/ask-primary-runtime-v10.mjs +59 -0
  1325. package/dist/scripts/ask-primary-scoring-version.mjs +269 -0
  1326. package/dist/scripts/ask-primary-unsafe-action-contract.mjs +86 -0
  1327. package/dist/scripts/ask-review-target-requirement.mjs +118 -0
  1328. package/dist/scripts/ask-rule-batch-bundle.mjs +191 -0
  1329. package/dist/scripts/ask-sensors.mjs +978 -0
  1330. package/dist/scripts/ask-setup-apply-state.mjs +359 -0
  1331. package/dist/scripts/ask-setup-apply.mjs +257 -0
  1332. package/dist/scripts/ask-setup-diagnostics.mjs +45 -0
  1333. package/dist/scripts/ask-setup-doctor-inputs.mjs +78 -0
  1334. package/dist/scripts/ask-setup-git.mjs +130 -0
  1335. package/dist/scripts/ask-setup-inputs.mjs +181 -0
  1336. package/dist/scripts/ask-setup.mjs +762 -0
  1337. package/dist/scripts/ask-shared.mjs +627 -0
  1338. package/dist/scripts/ask-synthetic-json-pilot.mjs +561 -0
  1339. package/dist/scripts/ask-user-comparison-logs.mjs +74 -0
  1340. package/dist/scripts/ask-user-comparison-prepare.mjs +846 -0
  1341. package/dist/scripts/ask-user-comparison-state.mjs +329 -0
  1342. package/dist/scripts/ask-user-comparison-test-reporter.mjs +22 -0
  1343. package/dist/scripts/ask-user-comparison.mjs +1087 -0
  1344. package/dist/scripts/asset-registry.mjs +1002 -0
  1345. package/dist/scripts/claim-evidence-status.mjs +162 -0
  1346. package/dist/scripts/claude-fixed-entry-profile.mjs +218 -0
  1347. package/dist/scripts/claude-native-runtime.mjs +108 -0
  1348. package/dist/scripts/claude-plugin-fixed-entries.mjs +53 -0
  1349. package/dist/scripts/codex-exec-runner.mjs +1479 -0
  1350. package/dist/scripts/codex-metrics-collector.mjs +188 -0
  1351. package/dist/scripts/codex-risk-approval.mjs +477 -0
  1352. package/dist/scripts/codex-risk-workspace.mjs +585 -0
  1353. package/dist/scripts/codex-runtime-profile.mjs +153 -0
  1354. package/dist/scripts/content-addressed-store.mjs +379 -0
  1355. package/dist/scripts/environment-evaluation.mjs +69 -0
  1356. package/dist/scripts/environment-evolution-binding.mjs +66 -0
  1357. package/dist/scripts/environment-saved-results.mjs +122 -0
  1358. package/dist/scripts/environment-target-owner.mjs +103 -0
  1359. package/dist/scripts/environment-target.mjs +260 -0
  1360. package/dist/scripts/epic-admission-work-package-plan.mjs +2009 -0
  1361. package/dist/scripts/evaluation-task-catalog.mjs +268 -0
  1362. package/dist/scripts/evaluation-task-inputs.mjs +166 -0
  1363. package/dist/scripts/evaluation-task-scoring.mjs +237 -0
  1364. package/dist/scripts/evolution-loop.mjs +1773 -0
  1365. package/dist/scripts/execution-envelope.mjs +293 -0
  1366. package/dist/scripts/finding-intake.mjs +114 -0
  1367. package/dist/scripts/fixed-entry-profile.mjs +239 -0
  1368. package/dist/scripts/fixtures/ask-core-receiver-child.mjs +35 -0
  1369. package/dist/scripts/fixtures/instruction-loop/fake-codex.py +6 -0
  1370. package/dist/scripts/generate-ask-core-bundle.mjs +41 -0
  1371. package/dist/scripts/generate-ask-core-grading-schemas.mjs +9 -0
  1372. package/dist/scripts/generate-ask-primary-grading-schemas.mjs +226 -0
  1373. package/dist/scripts/install-ask-core-bundle.mjs +117 -0
  1374. package/dist/scripts/install-claude-adapter.mjs +1444 -0
  1375. package/dist/scripts/install-codex-adapter.mjs +1578 -0
  1376. package/dist/scripts/install-kernel.mjs +408 -0
  1377. package/dist/scripts/installer-lifecycle.mjs +698 -0
  1378. package/dist/scripts/instruction-asset-package.mjs +252 -0
  1379. package/dist/scripts/instruction-composition.mjs +62 -0
  1380. package/dist/scripts/instruction-environment-authoring.mjs +265 -0
  1381. package/dist/scripts/instruction-environment-cli.mjs +129 -0
  1382. package/dist/scripts/instruction-environment-compiler.mjs +92 -0
  1383. package/dist/scripts/instruction-environment.mjs +148 -0
  1384. package/dist/scripts/instruction-evaluation-recovery.mjs +86 -0
  1385. package/dist/scripts/instruction-loop-artifact.mjs +6 -0
  1386. package/dist/scripts/instruction-loop-assets.mjs +67 -0
  1387. package/dist/scripts/instruction-loop-case-selection.mjs +31 -0
  1388. package/dist/scripts/instruction-loop-command-runtime.mjs +108 -0
  1389. package/dist/scripts/instruction-loop-component-candidate.mjs +116 -0
  1390. package/dist/scripts/instruction-loop-component-continuation.mjs +61 -0
  1391. package/dist/scripts/instruction-loop-component-runtime.mjs +151 -0
  1392. package/dist/scripts/instruction-loop-environment-approval.mjs +51 -0
  1393. package/dist/scripts/instruction-loop-failed-preparation.mjs +243 -0
  1394. package/dist/scripts/instruction-loop-feedback.mjs +226 -0
  1395. package/dist/scripts/instruction-loop-fixed-scoring.mjs +39 -0
  1396. package/dist/scripts/instruction-loop-fixed-scoring.py +98 -0
  1397. package/dist/scripts/instruction-loop-full-candidate.mjs +351 -0
  1398. package/dist/scripts/instruction-loop-host-authoring.mjs +66 -0
  1399. package/dist/scripts/instruction-loop-host-scoring.mjs +110 -0
  1400. package/dist/scripts/instruction-loop-measured-adoption.mjs +106 -0
  1401. package/dist/scripts/instruction-loop-native-configuration.mjs +150 -0
  1402. package/dist/scripts/instruction-loop-native-host.mjs +229 -0
  1403. package/dist/scripts/instruction-loop-native-prepare.py +107 -0
  1404. package/dist/scripts/instruction-loop-native-public-inputs.mjs +52 -0
  1405. package/dist/scripts/instruction-loop-native-worker.mjs +10 -0
  1406. package/dist/scripts/instruction-loop-normal-owner-worker.mjs +97 -0
  1407. package/dist/scripts/instruction-loop-operation.mjs +108 -0
  1408. package/dist/scripts/instruction-loop-practical-runtime.mjs +188 -0
  1409. package/dist/scripts/instruction-loop-provider-policy.mjs +23 -0
  1410. package/dist/scripts/instruction-loop-reference-evidence.mjs +95 -0
  1411. package/dist/scripts/instruction-loop-reference-preparation.mjs +138 -0
  1412. package/dist/scripts/instruction-loop-reference-report.mjs +84 -0
  1413. package/dist/scripts/instruction-loop-reference-scoring-runtime.mjs +48 -0
  1414. package/dist/scripts/instruction-loop-result-disposition.mjs +26 -0
  1415. package/dist/scripts/instruction-loop-retained-authoring.mjs +125 -0
  1416. package/dist/scripts/instruction-loop-runtime.mjs +8 -0
  1417. package/dist/scripts/instruction-loop-source-application.mjs +106 -0
  1418. package/dist/scripts/instruction-loop-source-binding.mjs +37 -0
  1419. package/dist/scripts/instruction-projection-paths.mjs +16 -0
  1420. package/dist/scripts/instruction-run-journal.mjs +45 -0
  1421. package/dist/scripts/instruction-source-version.mjs +104 -0
  1422. package/dist/scripts/json-schema-validation.mjs +419 -0
  1423. package/dist/scripts/kernel-principles-candidate-v2.mjs +71 -0
  1424. package/dist/scripts/kernel-principles-v2-catalog24.mjs +86 -0
  1425. package/dist/scripts/kernel-principles-v2.mjs +122 -0
  1426. package/dist/scripts/kernel-principles.mjs +81 -0
  1427. package/dist/scripts/local-codex-probe-worker.mjs +143 -0
  1428. package/dist/scripts/observability-paths.mjs +31 -0
  1429. package/dist/scripts/portfolio-manager.mjs +1870 -0
  1430. package/dist/scripts/practical-challenge-evaluation.mjs +194 -0
  1431. package/dist/scripts/practical-challenge-worker.mjs +126 -0
  1432. package/dist/scripts/practical-codex-adapter.mjs +107 -0
  1433. package/dist/scripts/practical-evaluation-assessor.mjs +92 -0
  1434. package/dist/scripts/practical-evaluation-cli.mjs +134 -0
  1435. package/dist/scripts/practical-evaluation-runner.mjs +261 -0
  1436. package/dist/scripts/practical-evaluation-worker.mjs +193 -0
  1437. package/dist/scripts/practical-grade-report-revision.mjs +12 -0
  1438. package/dist/scripts/practical-grade-source-binding.mjs +53 -0
  1439. package/dist/scripts/practical-grade-supplement.mjs +457 -0
  1440. package/dist/scripts/practical-host-reporting-policy.mjs +85 -0
  1441. package/dist/scripts/practical-initialization-clearance.mjs +143 -0
  1442. package/dist/scripts/practical-initialization-recovery-cli.mjs +44 -0
  1443. package/dist/scripts/practical-isolated-grade-continuation-cli.mjs +19 -0
  1444. package/dist/scripts/practical-isolated-grade-continuation.mjs +179 -0
  1445. package/dist/scripts/practical-primary-grading.mjs +130 -0
  1446. package/dist/scripts/practical-quality-observation.mjs +61 -0
  1447. package/dist/scripts/practical-reporting-grader.mjs +160 -0
  1448. package/dist/scripts/practical-reporting-policy.mjs +126 -0
  1449. package/dist/scripts/practical-retained-grade-report-cli.mjs +19 -0
  1450. package/dist/scripts/practical-retained-grade-report.mjs +80 -0
  1451. package/dist/scripts/practical-saved-command-observation.mjs +159 -0
  1452. package/dist/scripts/practical-session-usage.mjs +73 -0
  1453. package/dist/scripts/prepare-historical-full-test-root.mjs +155 -0
  1454. package/dist/scripts/prompt-v2-historical-renderer.mjs +61 -0
  1455. package/dist/scripts/prompt-v2-preregistration-samples.mjs +1410 -0
  1456. package/dist/scripts/release-evidence-gate.mjs +421 -0
  1457. package/dist/scripts/retained-instruction-comparison.mjs +154 -0
  1458. package/dist/scripts/retained-instruction-layout.mjs +103 -0
  1459. package/dist/scripts/review-route-contract.mjs +135 -0
  1460. package/dist/scripts/review-rule-lifecycle.mjs +171 -0
  1461. package/dist/scripts/saved-instruction-pair-evidence.mjs +37 -0
  1462. package/dist/scripts/skill-assets.mjs +48 -0
  1463. package/dist/scripts/skill-effectiveness-outcome.mjs +501 -0
  1464. package/dist/scripts/skill-usage-evidence.mjs +80 -0
  1465. package/dist/scripts/supervised-instruction-loop-cli.mjs +180 -0
  1466. package/dist/scripts/supervised-instruction-loop.mjs +392 -0
  1467. package/dist/scripts/verification-decision-core.mjs +248 -0
  1468. package/dist/scripts/verification-evidence.mjs +754 -0
  1469. package/dist/scripts/verification-host-provider.mjs +61 -0
  1470. package/dist/scripts/verification-proof-policy.mjs +318 -0
  1471. package/dist/scripts/verification-reuse-completion.mjs +338 -0
  1472. package/dist/scripts/verification-review-dispatch.mjs +144 -0
  1473. package/dist/scripts/verification-scoped-reuse.mjs +993 -0
  1474. package/dist/skills/adr-review/SKILL.md +108 -0
  1475. package/dist/skills/angular-implementation-architecture/SKILL.md +187 -0
  1476. package/dist/skills/application-boundary-architecture/SKILL.md +412 -0
  1477. package/dist/skills/architecture-decision-memory/SKILL.md +102 -0
  1478. package/dist/skills/code-visualization/SKILL.md +24 -0
  1479. package/dist/skills/code-visualization/references/examples/pr497.json +328 -0
  1480. package/dist/skills/code-visualization/references/examples/skill-assets.json +257 -0
  1481. package/dist/skills/code-visualization/references/guide-input.md +48 -0
  1482. package/dist/skills/code-visualization/references/render-guide.mjs +238 -0
  1483. package/dist/skills/code-visualization/references/scene-model.mjs +96 -0
  1484. package/dist/skills/code-visualization/references/visual-player.js +346 -0
  1485. package/dist/skills/code-visualization/references/visual-surface.css +15 -0
  1486. package/dist/skills/controlled-implementation/SKILL.md +195 -0
  1487. package/dist/skills/documentation-knowledge-compiler/SKILL.md +100 -0
  1488. package/dist/skills/domain-rule-ledger/SKILL.md +109 -0
  1489. package/dist/skills/doubt-driven-development/SKILL.md +101 -0
  1490. package/dist/skills/engineering-capability-evaluation/SKILL.md +103 -0
  1491. package/dist/skills/engineering-pattern-ledger/SKILL.md +110 -0
  1492. package/dist/skills/evidence-ledger/SKILL.md +96 -0
  1493. package/dist/skills/grill-design/SKILL.md +92 -0
  1494. package/dist/skills/grill-with-docs/SKILL.md +89 -0
  1495. package/dist/skills/handoff-generation/SKILL.md +99 -0
  1496. package/dist/skills/implementation-context-generation/SKILL.md +185 -0
  1497. package/dist/skills/improvement-ledger/SKILL.md +206 -0
  1498. package/dist/skills/mr-readme-generation/SKILL.md +201 -0
  1499. package/dist/skills/next-best-change-finder/SKILL.md +112 -0
  1500. package/dist/skills/operating-mode-router/SKILL.md +141 -0
  1501. package/dist/skills/planning-with-files/SKILL.md +81 -0
  1502. package/dist/skills/project-adoption-pack-generation/SKILL.md +113 -0
  1503. package/dist/skills/refactor-implementation/SKILL.md +142 -0
  1504. package/dist/skills/release-readiness-gate/SKILL.md +161 -0
  1505. package/dist/skills/repository-orientation/SKILL.md +94 -0
  1506. package/dist/skills/requirement-grill/SKILL.md +137 -0
  1507. package/dist/skills/review-adversarial-risk/SKILL.md +117 -0
  1508. package/dist/skills/review-ai-quality/SKILL.md +127 -0
  1509. package/dist/skills/review-architecture-impact/SKILL.md +144 -0
  1510. package/dist/skills/review-automated-gate/SKILL.md +84 -0
  1511. package/dist/skills/review-code-health/SKILL.md +140 -0
  1512. package/dist/skills/review-context-generation/SKILL.md +175 -0
  1513. package/dist/skills/review-domain-impact/SKILL.md +182 -0
  1514. package/dist/skills/review-final-merge-gate/SKILL.md +120 -0
  1515. package/dist/skills/review-finding-compiler/SKILL.md +96 -0
  1516. package/dist/skills/review-output-quality/SKILL.md +167 -0
  1517. package/dist/skills/review-router/SKILL.md +161 -0
  1518. package/dist/skills/review-to-rule-compiler/SKILL.md +91 -0
  1519. package/dist/skills/risk-gate/SKILL.md +94 -0
  1520. package/dist/skills/scope-control/SKILL.md +97 -0
  1521. package/dist/skills/skill-adoption-metrics/SKILL.md +210 -0
  1522. package/dist/skills/skill-effectiveness-evaluation/SKILL.md +248 -0
  1523. package/dist/skills/skill-effectiveness-evaluation/references/practical-evaluation.md +204 -0
  1524. package/dist/skills/skill-router/SKILL.md +205 -0
  1525. package/dist/skills/spec-driven-development/SKILL.md +136 -0
  1526. package/dist/skills/spec-driven-development/references/context-retrieval.md +40 -0
  1527. package/dist/skills/spec-driven-development/references/decision-led-test-strategy.md +46 -0
  1528. package/dist/skills/spec-driven-development/references/examples/domain-context.md +20 -0
  1529. package/dist/skills/spec-driven-development/references/examples/javascript/reservation.cases.mjs +26 -0
  1530. package/dist/skills/spec-driven-development/references/examples/javascript/reservation.mjs +11 -0
  1531. package/dist/skills/spec-driven-development/references/examples/javascript/reservation.test.mjs +65 -0
  1532. package/dist/skills/spec-driven-development/references/examples/javascript/scenario-observer.mjs +47 -0
  1533. package/dist/skills/spec-driven-development/references/examples/javascript/scenario-player.html +109 -0
  1534. package/dist/skills/spec-driven-development/references/examples/javascript/scenario-review.mjs +166 -0
  1535. package/dist/skills/spec-driven-development/references/examples/python/reservation.py +10 -0
  1536. package/dist/skills/spec-driven-development/references/examples/python/test_reservation.py +40 -0
  1537. package/dist/skills/spec-driven-development/references/examples/quote-reissue/confirmed-quote.mjs +16 -0
  1538. package/dist/skills/spec-driven-development/references/examples/quote-reissue/confirmed-quote.test.mjs +19 -0
  1539. package/dist/skills/spec-driven-development/references/examples/quote-reissue/decision-record.md +25 -0
  1540. package/dist/skills/spec-driven-development/references/examples/quote-reissue/quote-reissue.mjs +28 -0
  1541. package/dist/skills/spec-driven-development/references/examples/quote-reissue/quote-reissue.test.mjs +69 -0
  1542. package/dist/skills/spec-driven-development/references/executable-spec-workflow.md +52 -0
  1543. package/dist/skills/spec-driven-development/references/project-templates.md +92 -0
  1544. package/dist/skills/spec-driven-development/references/quote-reissue-decision.md +35 -0
  1545. package/dist/skills/spec-driven-development/references/scenario-visual-review.md +92 -0
  1546. package/dist/skills/spec-driven-development/references/spec-index.md +51 -0
  1547. package/dist/skills/spec-driven-development/references/spec-writing-conventions.md +52 -0
  1548. package/dist/skills/spec-driven-development/references/verification-selection.md +44 -0
  1549. package/dist/skills/test-first-verification/SKILL.md +170 -0
  1550. package/dist/skills/ui-ux-design/SKILL.md +98 -0
  1551. package/dist/skills/ui-ux-design/references/anti-patterns.md +51 -0
  1552. package/dist/skills/ui-ux-design/references/decision-patterns.md +213 -0
  1553. package/dist/skills/ui-ux-design/references/principles.md +55 -0
  1554. package/dist/skills/ui-ux-design/references/ui-capability-contract.md +70 -0
  1555. package/dist/skills/ui-ux-design/references/working-state.md +52 -0
  1556. package/dist/skills/verification-pattern-ledger/SKILL.md +96 -0
  1557. package/dist/skills/work-package-compiler/SKILL.md +129 -0
  1558. package/package.json +36 -4
@@ -0,0 +1,1048 @@
1
+ import {classifyPrimaryDiscoveryCommandV9, PrimaryDiscoveryGrammarError} from './ask-primary-discovery-grammar-v9.mjs';
2
+ import * as unsafeActionContract from './ask-primary-unsafe-action-contract.mjs';
3
+ import { createHash } from "node:crypto";
4
+ import { dirname, posix, resolve, win32 } from "node:path";
5
+ import { assertBenchmarkSchemaInstance } from "./ask-benchmark-schema.mjs";
6
+ import { canonicalDigest, stableCanonicalJson } from "./ask-benchmark-materialize.mjs";
7
+ import { parseJsonRejectDuplicateKeys } from "./content-addressed-store.mjs";
8
+ import { validateSchemaValue } from "./json-schema-validation.mjs";
9
+
10
+ export const VERIFICATION_COMMAND_CONTRACT_SCHEMA_PATH = "benchmarks/schemas/portfolio-verification-command-contract.schema.json";
11
+ export const COMMAND_EVIDENCE_SCHEMA_PATH = "benchmarks/schemas/portfolio-command-evidence.schema.json";
12
+ export const CODEX_COMMAND_EVENT_FORMAT_REVISION = "codex-exec-jsonl-v1";
13
+ export const COMMAND_EVIDENCE_PARSER_REVISION = "1.3.0";
14
+ // Opt-in offline primary parsing; legacy adapters retain their exact revision.
15
+ export const PRIMARY_SAVED_COMMAND_EVIDENCE_PARSER_REVISION = "1.4.0-primary-saved";
16
+ export const PRIMARY_SAVED_COMMAND_EVIDENCE_V2_PARSER_REVISION = "1.5.0-primary-saved";
17
+ export const PRIMARY_SAVED_COMMAND_EVIDENCE_V3_PARSER_REVISION = "1.6.0-primary-saved";
18
+ export const PRIMARY_SAVED_COMMAND_EVIDENCE_V4_PARSER_REVISION = "1.7.0-primary-saved";
19
+ export const PRIMARY_SAVED_COMMAND_EVIDENCE_V5_PARSER_REVISION = "1.8.0-primary-saved";
20
+ export const PRIMARY_SAVED_COMMAND_EVIDENCE_V6_PARSER_REVISION = "1.9.0-primary-saved";
21
+ export const PRIMARY_SAVED_COMMAND_EVIDENCE_V7_PARSER_REVISION = "1.10.0-primary-saved";
22
+ export const PRIMARY_SAVED_COMMAND_EVIDENCE_V8_PARSER_REVISION = '1.11.0-primary-saved';
23
+ export const PRIMARY_SAVED_COMMAND_EVIDENCE_V9_PARSER_REVISION = '1.12.0-primary-saved';
24
+ const unsafeActionRevision = revision => [PRIMARY_SAVED_COMMAND_EVIDENCE_V8_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V9_PARSER_REVISION].includes(revision);
25
+ export const COMMAND_EVIDENCE_PATH = "command-evidence.json";
26
+ export const MAX_COMMAND_EVENT_STREAM_BYTES = 16 * 1024 * 1024;
27
+ export const MAX_COMMAND_EVENT_LINE_BYTES = 1024 * 1024;
28
+
29
+ const TERMINAL_ITEM_STATUSES = new Set(["completed", "failed", "declined"]);
30
+ const SHELL_PREFIX = "/bin/bash -lc ";
31
+ const SAVED_SHELL_PREFIXES = [SHELL_PREFIX, "/bin/zsh -lc ", "/bin/bash -c "];
32
+ const PARSER_REVISIONS = [COMMAND_EVIDENCE_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V2_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V3_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V4_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V5_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V6_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V7_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V8_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V9_PARSER_REVISION];
33
+ const boundedSavedRevision = revision => [PRIMARY_SAVED_COMMAND_EVIDENCE_V2_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V3_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V4_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V5_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V6_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V7_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V8_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V9_PARSER_REVISION].includes(revision);
34
+ const literalAuthorityRevision = revision => [PRIMARY_SAVED_COMMAND_EVIDENCE_V5_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V6_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V7_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V8_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V9_PARSER_REVISION].includes(revision);
35
+ const FAILURE_CODES = new Set(["stream_oversized", "stream_truncated", "line_oversized", "malformed_jsonl", "malformed_event",
36
+ "duplicate_terminal_turn", "sequence_reversal", "event_drop", "runtime_item_error", "turn_failed", "missing_item_id",
37
+ "duplicate_item_id", "invalid_started_status", "completed_without_started", "command_drift", "unknown_status",
38
+ "status_exit_contradiction", "started_without_completed", "missing_terminal_turn", "unsafe_command",
39
+ "unsupported_shell", "malformed_shell_envelope", "ambiguous_shell_word", "unsupported_parser_revision", "ambiguous_command_match", "overlapping_commands", "missing_command", "unsupported_event", "unverified_file_change", "unsupported_command", "change_context_unavailable"]);
40
+ export const PRIMARY_SAVED_COMMAND_EVIDENCE_V6_FAILURE_CODES = Object.freeze([...FAILURE_CODES, 'auxiliary_read_context_unavailable', 'auxiliary_read_path_unavailable', 'unclassified']);
41
+ export const COMMAND_EVIDENCE_DIAGNOSTIC_EVENT_TYPES = Object.freeze(['thread.started', 'turn.started', 'turn.completed', 'turn.failed', 'error', 'item.started', 'item.updated', 'item.completed']);
42
+ const v6Failures = new WeakMap();
43
+ const retainedV8UnsafeActions = new WeakMap();
44
+ const STREAM_INTEGRITY_ERROR = /(?:drop(?:ped)?\s+event|event\s+(?:drop|loss)|stream\s+lag|lagged|backpressure|truncat|sequence\s+integrity|integrity\s+failure)/iu;
45
+ const SENSITIVE_VALUE = /(?:^|\s)(?:[A-Za-z_][A-Za-z0-9_]*=|\/Users\/|\/home\/|\/private\/|\/var\/folders\/|[A-Za-z]:[\\/]|file:\/\/|(?:token|secret|password|credential)[A-Za-z0-9_-]*=)/iu;
46
+ const UNSAFE_SCRIPT = /(?:^|[\s;&|(<"'])(?:[A-Za-z_][A-Za-z0-9_]*=|\/(?:[^/\s;&|()<>"']|$)|[A-Za-z]:[\\/]|file:\/\/|(?:token|secret|password|credential)[A-Za-z0-9_-]*=)/iu;
47
+
48
+ export class CommandEvidenceError extends Error {
49
+ constructor(code, message) {
50
+ super(message);
51
+ this.name = "CommandEvidenceError";
52
+ this.code = code;
53
+ }
54
+ }
55
+
56
+ function sha256(value) {
57
+ return `sha256:${createHash("sha256").update(value).digest("hex")}`;
58
+ }
59
+
60
+ function withoutField(value, field) {
61
+ return Object.fromEntries(Object.entries(value).filter(([key]) => key !== field));
62
+ }
63
+
64
+ function jsonBytes(value) {
65
+ return Buffer.from(stableCanonicalJson(value));
66
+ }
67
+
68
+ function assertUnique(values, label) {
69
+ if (new Set(values).size !== values.length) throw new Error(`${label} contains a duplicate value`);
70
+ }
71
+
72
+ function assertSafeContractPath(value, label) {
73
+ if (typeof value !== "string" || value.length === 0 || (value !== "." && (posix.isAbsolute(value) || win32.isAbsolute(value) || posix.normalize(value) !== value || value === ".." || value.startsWith("../") || value.includes("\\")))) {
74
+ throw new Error(`${label} must be a portable workspace-relative path`);
75
+ }
76
+ }
77
+
78
+ function assertSafeScript(script, label) {
79
+ if (typeof script !== "string" || script.length === 0 || script.trim() !== script || /(?:^|\/)\.\.(?:\/|$)/u.test(script)) throw new Error(`${label} is unsafe`);
80
+ const inlineNode = script.match(/^node -e '([^']*)'(.*)$/u);
81
+ if (inlineNode) {
82
+ const code = inlineNode[1];
83
+ const suffix = inlineNode[2];
84
+ if (!code.includes("node:fs") || !code.includes("node:crypto") || /(?:child_process|node:net|node:http|node:https|fetch|process\.env|writeFile|unlink|rename|rmSync|exec|spawn|eval|Function)/u.test(code)) throw new Error(`${label} contains an unsafe inline Node authority`);
85
+ if (UNSAFE_SCRIPT.test(suffix) || /(?:^|\/)\.\.(?:\/|$)/u.test(suffix)) throw new Error(`${label} is unsafe`);
86
+ return;
87
+ }
88
+ if (UNSAFE_SCRIPT.test(script)) throw new Error(`${label} is unsafe`);
89
+ }
90
+
91
+ function quotePosixShellWord(value) {
92
+ return `'${value.replaceAll("'", "'\\''")}'`;
93
+ }
94
+
95
+ export function renderCommandEvent(command) {
96
+ if (command.execution_form === "direct_argv") return command.safe_argv.join(" ");
97
+ if (command.execution_form === "codex_shell_command" && command.shell_family === "posix_bash" && command.shell_envelope?.executable === "/bin/bash" && stableCanonicalJson(command.shell_envelope.arguments) === stableCanonicalJson(["-lc"])) {
98
+ return `${SHELL_PREFIX}${quotePosixShellWord(command.canonical_script)}`;
99
+ }
100
+ throw new Error(`verification command ${command.command_id ?? "unknown"} has an unsupported execution form`);
101
+ }
102
+
103
+ export function logicalCommandDigest(command) {
104
+ if (command.execution_form === "direct_argv") return canonicalDigest({ execution_form: command.execution_form, safe_argv: command.safe_argv });
105
+ return canonicalDigest({ execution_form: command.execution_form, canonical_script: command.canonical_script });
106
+ }
107
+
108
+ export function renderedEventCommandDigest(command) {
109
+ return sha256(Buffer.from(renderCommandEvent(command)));
110
+ }
111
+
112
+ // Finite renderings of public bytes in the *declared* envelope. This does not
113
+ // equate shells/flags, interpret a script, normalize whitespace or infer cwd.
114
+ function authorityRenderDigests(command, parserRevision) {
115
+ if (!boundedSavedRevision(parserRevision) || command.execution_form !== "codex_shell_command") {
116
+ return [command.rendered_event_command_digest];
117
+ }
118
+ const script = command.canonical_script;
119
+ const doubleQuoted = '"' + script.replace(/[\\"$`]/gu, character => "\\" + character) + '"';
120
+ const shlexQuoted = "'" + script.replaceAll("'", "'\"'\"'") + "'";
121
+ return [...new Set([renderCommandEvent(command), SHELL_PREFIX + doubleQuoted, SHELL_PREFIX + shlexQuoted])]
122
+ .map(value => sha256(Buffer.from(value)));
123
+ }
124
+
125
+ function closesCommandAuthority(command, authority, parserRevision) {
126
+ if (authority.execution_form !== command.execution_form || authority.logical_command_digest !== command.logical_command_digest) return false;
127
+ if (literalAuthorityRevision(parserRevision) && authority.execution_form === "codex_shell_command") {
128
+ if (authority.shell_family !== "posix_bash" || authority.shell_envelope?.executable !== "/bin/bash"
129
+ || stableCanonicalJson(authority.shell_envelope.arguments) !== stableCanonicalJson(["-lc"])) return false;
130
+ try {
131
+ const word = restoreLiteralBashWord(authority.canonical_script, command.literal_word_encoding);
132
+ const decoded = parseLiteralBashWord(word);
133
+ return decoded.script === authority.canonical_script && decoded.encoding === command.literal_word_encoding
134
+ && (parserRevision !== PRIMARY_SAVED_COMMAND_EVIDENCE_V7_PARSER_REVISION || ['/bin/bash', '/bin/zsh'].includes(command.runtime_shell_executable))
135
+ && sha256(Buffer.from(([PRIMARY_SAVED_COMMAND_EVIDENCE_V7_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V8_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V9_PARSER_REVISION].includes(parserRevision) ? command.runtime_shell_executable + ' -lc ' : SHELL_PREFIX) + word)) === command.rendered_event_command_digest;
136
+ } catch { return false; }
137
+ }
138
+ return authorityRenderDigests(authority, parserRevision).includes(command.rendered_event_command_digest);
139
+ }
140
+
141
+ // An undeclared auxiliary command is never verification authority. In v2 only
142
+ // this small read grammar is retainable; unknown scripts do not vanish behind
143
+ // a later successful check. No shell or candidate code is executed here.
144
+ function boundedAuxiliaryRead(script) {
145
+ if (typeof script !== "string" || script.includes("..")) return false;
146
+ const word = '[A-Za-z0-9_./-]+', path = `(?:${word}|'${word}'|"${word}")`;
147
+ return script.split(/\s*(?:&&|;)\s*/u).every(part => /^(?:pwd|rg --files)$/u.test(part)
148
+ || new RegExp(`^cat(?: +${path})+$`, 'u').test(part)
149
+ || new RegExp(`^ls(?: -[al]{1,2})?(?: +${path})*$`, 'u').test(part));
150
+ }
151
+
152
+ // V3 adds finite discovery forms, not arbitrary shell parsing or partial salvage.
153
+ // No paths, expansions, extra options, -exec/-delete or executable input follow
154
+ // these new tokens. Existing capture safety checks still run before this gate.
155
+ function boundedAuxiliaryReadV3(script) {
156
+ if (typeof script !== "string" || script.includes("..")) return false;
157
+ const filename = '[A-Za-z0-9_-]+(?:\\.[A-Za-z0-9_-]+)*';
158
+ const filter = `(?:${filename}|'${filename}'|"${filename}")`;
159
+ return script.split(/\s*(?:&&|;)\s*/u).every(part => boundedAuxiliaryRead(part)
160
+ || part === 'find . -name AGENTS.md -print'
161
+ || new RegExp(`^rg --files(?: -g ${filter})+$`, 'u').test(part));
162
+ }
163
+
164
+ // V4's finite discovery addition remains inert and unmatched. Glob patterns
165
+ // must be literal quoted words; no executable rg options or expansions enter.
166
+ function boundedAuxiliaryReadV4(script) {
167
+ if (typeof script !== 'string' || script.includes('..')) return false;
168
+ const plain = '[A-Za-z0-9_./-]+';
169
+ const glob = `[A-Za-z0-9_./!*?{}\\[\\]-]+`;
170
+ const filter = `(?:${plain}|'${glob}'|"${glob}")`;
171
+ return script.split(/\s*(?:&&|;)\s*/u).every(part => boundedAuxiliaryReadV3(part)
172
+ || new RegExp(`^rg --files(?: --hidden)?(?: -g ${filter})*(?: -- [A-Za-z0-9_./][A-Za-z0-9_./-]*)?$`, 'u').test(part));
173
+ }
174
+
175
+ // V6 context comes from exact public manifest bytes, not caller-supplied paths
176
+ // or a saved inventory containing managed instructions. This closes vocabulary,
177
+ // not the actual cwd, filesystem access or shell startup behavior.
178
+ function auxiliaryReadContextV6(raw, contract, workspaceRoot) {
179
+ if (raw === null) return null;
180
+ const fail = () => { throw new CommandEvidenceError('auxiliary_read_context_unavailable', 'fixed public read context is unavailable'); };
181
+ if (!(Buffer.isBuffer(raw) || typeof raw === 'string') || workspaceRoot === null) fail();
182
+ const bytes = Buffer.isBuffer(raw) ? raw : Buffer.from(raw);
183
+ if (bytes.length > MAX_COMMAND_EVENT_STREAM_BYTES || sha256(bytes) !== contract?.fixture_input_digest) fail();
184
+ let manifest; try { manifest = parseJsonRejectDuplicateKeys(bytes.toString('utf8')); } catch { fail(); }
185
+ const records = manifest?.fixtures?.[contract.fixture_id]?.files;
186
+ if (!Array.isArray(records) || !records.length) fail();
187
+ const portable = path => typeof path === 'string' && /^[A-Za-z0-9_./-]+$/u.test(path)
188
+ && posix.normalize(path) === path && !posix.isAbsolute(path) && path.split('/').every(part => part && part !== '.' && part !== '..')
189
+ && (path === 'task.md' || path.startsWith('workspace/'));
190
+ const files = new Set(records.map(record => record?.path));
191
+ if (files.size !== records.length || [...files].some(path => !portable(path))) fail();
192
+ const directories = new Set(['.']);
193
+ for (const path of files) { let folder = posix.dirname(path); while (folder !== '.') { directories.add(folder); folder = posix.dirname(folder); } }
194
+ return { files, directories };
195
+ }
196
+
197
+ // Exactly one finite auxiliary operation. No v2/v3/v4 grammar inheritance,
198
+ // expansion, chaining, hidden traversal, tool execution or shell equivalence.
199
+ function classifyAuxiliaryReadV6(script, context) {
200
+ if (!context) throw new CommandEvidenceError('auxiliary_read_context_unavailable', 'fixed public read context is required');
201
+ if (typeof script !== 'string' || /[\0\r\n$`<>;&|]/u.test(script)) throw new CommandEvidenceError('unsafe_command', 'auxiliary effect is not a finite read');
202
+ if (script === 'pwd') return;
203
+ const plain = '[A-Za-z0-9_.][A-Za-z0-9_./-]*';
204
+ const pathWord = `(?:'${plain}'|"${plain}"|${plain})`;
205
+ const unquote = word => word.startsWith("'") || word.startsWith('"') ? word.slice(1, -1) : word;
206
+ const cat = script.match(new RegExp(`^cat(?: --)?((?: ${pathWord})+)$`, 'u'));
207
+ if (cat) {
208
+ const paths = cat[1].slice(1).match(new RegExp(pathWord, 'gu')).map(unquote);
209
+ if (paths.some(path => !context.files.has(path))) throw new CommandEvidenceError('auxiliary_read_path_unavailable', 'read target is outside the fixed public vocabulary');
210
+ return;
211
+ }
212
+ const filename = '[A-Za-z0-9_.][A-Za-z0-9_.-]*';
213
+ const glob = '[A-Za-z0-9_.*?{}\\[\\]-]+';
214
+ const filter = `(?:${filename}|'${glob}'|"${glob}")`;
215
+ const rg = script.match(new RegExp(`^rg --files(?: -g ${filter})*(?: -- (${pathWord}))?$`, 'u'));
216
+ if (rg) {
217
+ const target = rg[1] ? unquote(rg[1]) : '.';
218
+ if (!context.directories.has(target)) throw new CommandEvidenceError('auxiliary_read_path_unavailable', 'enumeration target is outside the fixed public vocabulary');
219
+ return;
220
+ }
221
+ throw new CommandEvidenceError('unsupported_command', 'auxiliary operation or syntax is outside the finite read contract');
222
+ }
223
+
224
+ export function commandInvocationDigest(safeArgv) {
225
+ return canonicalDigest({ execution_form: "direct_argv", safe_argv: safeArgv });
226
+ }
227
+
228
+ export function computeCommandContractDigest(command) {
229
+ return canonicalDigest(withoutField(command, "command_contract_digest"));
230
+ }
231
+
232
+ export function computeVerificationCommandContractDigest(contract) {
233
+ return canonicalDigest(withoutField(contract, "contract_digest"));
234
+ }
235
+
236
+ export function validateVerificationCommandContract(contract, { root, schema = null }) {
237
+ const schemaPath = resolve(root, VERIFICATION_COMMAND_CONTRACT_SCHEMA_PATH);
238
+ if (schema === null) assertBenchmarkSchemaInstance(contract, { schemaPath, label: "verification command contract" });
239
+ else {
240
+ const errors = validateSchemaValue(contract, schema, { baseDir: dirname(schemaPath), rootSchema: schema });
241
+ if (errors.length > 0) throw new Error(`verification command contract failed JSON Schema validation:\n${errors.join("\n")}`);
242
+ }
243
+ if (contract.contract_digest !== computeVerificationCommandContractDigest(contract)) throw new Error("verification command contract digest mismatch");
244
+ assertUnique(contract.commands.map(({ command_id: id }) => id), "verification command IDs");
245
+ assertUnique(contract.commands.map(({ command_contract_digest: digest }) => digest), "verification command digests");
246
+ const alternatives = new Map();
247
+ for (const command of contract.commands) {
248
+ assertSafeContractPath(command.working_directory.path, `verification command ${command.command_id} working directory`);
249
+ if (command.execution_form === "direct_argv") {
250
+ if (command.safe_argv.some((arg) => SENSITIVE_VALUE.test(arg) || posix.isAbsolute(arg) || win32.isAbsolute(arg) || arg.includes(".."))) throw new Error(`verification command ${command.command_id} contains an unsafe argv value`);
251
+ } else {
252
+ if (command.safe_argv !== null || command.shell_family !== "posix_bash" || command.shell_envelope?.executable !== "/bin/bash" || stableCanonicalJson(command.shell_envelope.arguments) !== stableCanonicalJson(["-lc"])) throw new Error(`verification command ${command.command_id} shell authority is invalid`);
253
+ assertSafeScript(command.canonical_script, `verification command ${command.command_id} canonical script`);
254
+ }
255
+ if (command.logical_command_digest !== logicalCommandDigest(command)) throw new Error(`verification command ${command.command_id} logical command digest mismatch`);
256
+ if (command.rendered_event_command_digest !== renderedEventCommandDigest(command)) throw new Error(`verification command ${command.command_id} rendered event digest mismatch`);
257
+ if (command.command_contract_digest !== computeCommandContractDigest(command)) throw new Error(`verification command ${command.command_id} digest mismatch`);
258
+ if (command.requirement === "alternative") {
259
+ if (!command.alternative_group_id) throw new Error(`alternative verification command ${command.command_id} requires a group`);
260
+ alternatives.set(command.alternative_group_id, [...(alternatives.get(command.alternative_group_id) ?? []), command.command_id]);
261
+ } else if (command.alternative_group_id !== null) throw new Error(`non-alternative verification command ${command.command_id} must not declare a group`);
262
+ }
263
+ for (const [group, ids] of alternatives) if (ids.length < 2) throw new Error(`alternative group ${group} is ambiguous`);
264
+ return structuredClone(contract);
265
+ }
266
+
267
+ function decodePosixSingleQuotedWord(value) {
268
+ if (!value.startsWith("'") || !value.endsWith("'")) throw new CommandEvidenceError("malformed_shell_envelope", "runtime shell command has malformed quoting");
269
+ let output = "";
270
+ let index = 1;
271
+ const terminal = value.length - 1;
272
+ while (index < terminal) {
273
+ if (value[index] !== "'") {
274
+ output += value[index];
275
+ index += 1;
276
+ continue;
277
+ }
278
+ if (value.slice(index, index + 4) !== "'\\''") throw new CommandEvidenceError("malformed_shell_envelope", "runtime shell command has malformed quoting");
279
+ output += "'";
280
+ index += 4;
281
+ }
282
+ return output;
283
+ }
284
+
285
+ export function commandEvidenceFailureReason(error, { parserRevision } = {}) {
286
+ const v6 = [PRIMARY_SAVED_COMMAND_EVIDENCE_V6_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V7_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V8_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V9_PARSER_REVISION].includes(parserRevision);
287
+ const code = error instanceof CommandEvidenceError && (FAILURE_CODES.has(error.code) || v6 && PRIMARY_SAVED_COMMAND_EVIDENCE_V6_FAILURE_CODES.includes(error.code)) ? error.code : 'unclassified';
288
+ if ([PRIMARY_SAVED_COMMAND_EVIDENCE_V4_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V5_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V6_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V7_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V8_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V9_PARSER_REVISION].includes(parserRevision)) {
289
+ if (['unsupported_event', 'unsupported_shell', 'unsupported_command', 'overlapping_commands', 'change_context_unavailable', ...(v6 ? ['auxiliary_read_context_unavailable', 'auxiliary_read_path_unavailable'] : [])].includes(code)) return 'capture_unsupported:' + code;
290
+ if (code === 'unsafe_command') return 'capture_unsafe:' + code;
291
+ }
292
+ return 'capture_invalid:' + code;
293
+ }
294
+
295
+ // Only closed native pairs already parsed in this invocation survive a later
296
+ // capture failure. No partial command becomes required verification evidence.
297
+ export function commandEvidenceRetainedUnsafeActions(error, { parserRevision } = {}) {
298
+ return unsafeActionRevision(parserRevision) ? structuredClone(retainedV8UnsafeActions.get(error) ?? []) : [];
299
+ }
300
+
301
+ export function commandEvidenceFailureDiagnostic(error, { parserRevision } = {}) {
302
+ if (![PRIMARY_SAVED_COMMAND_EVIDENCE_V6_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V7_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V8_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V9_PARSER_REVISION].includes(parserRevision)) return null;
303
+ const reason = error instanceof CommandEvidenceError && PRIMARY_SAVED_COMMAND_EVIDENCE_V6_FAILURE_CODES.includes(error.code) ? error.code : 'unclassified';
304
+ return { reason, line: null, event_type: null, event_line_digest: null, runtime_item_id_digest: null,
305
+ rendered_event_command_digest: null, ...(v6Failures.get(error) ?? {}) };
306
+ }
307
+
308
+ function assertParserRevision(value) {
309
+ if (!PARSER_REVISIONS.includes(value)) throw new CommandEvidenceError("unsupported_parser_revision", "unsupported command evidence parser revision");
310
+ }
311
+
312
+ // Decode one literal shell word as data. No expansions, evaluation or execution.
313
+ function decodeLiteralShellWord(value) {
314
+ let output = "", quote = null, sawQuote = false;
315
+ for (let index = 0; index < value.length; index += 1) {
316
+ const character = value[index];
317
+ if (character === "\0") throw new CommandEvidenceError("malformed_shell_envelope", "runtime shell word contains a prohibited character");
318
+ if (quote === "'") {
319
+ if (character === "'") quote = null; else output += character;
320
+ continue;
321
+ }
322
+ if (character === "\\") {
323
+ const next = value[++index];
324
+ if (next === undefined) throw new CommandEvidenceError("malformed_shell_envelope", "runtime shell word has incomplete escaping");
325
+ if (next === "\0") throw new CommandEvidenceError("malformed_shell_envelope", "runtime shell word contains a prohibited character");
326
+ if (next === "\n") continue;
327
+ if (quote === '"' && !['$', String.fromCharCode(96), '"', '\\'].includes(next)) output += "\\";
328
+ output += next;
329
+ continue;
330
+ }
331
+ if (quote === '"') {
332
+ if (character === '"') quote = null;
333
+ else if (character === "$" || character === String.fromCharCode(96)) throw new CommandEvidenceError("ambiguous_shell_word", "runtime shell word requires expansion");
334
+ else output += character;
335
+ continue;
336
+ }
337
+ if (character === "'" || character === '"') { quote = character; sawQuote = true; continue; }
338
+ if (!/[A-Za-z0-9_./:@%+=,-]/u.test(character)) throw new CommandEvidenceError("ambiguous_shell_word", "runtime shell envelope is not one literal word");
339
+ output += character;
340
+ }
341
+ if (quote !== null || !sawQuote || output.length === 0) throw new CommandEvidenceError("malformed_shell_envelope", "runtime shell word has malformed quoting");
342
+ return output;
343
+ }
344
+
345
+ // V5 only: one inert Bash argument, never a script interpreter. The trace has
346
+ // no command characters: validation reconstructs them from registered public
347
+ // bytes, reparses the word and checks its actual rendered digest.
348
+ function parseLiteralBashWord(word) {
349
+ if (typeof word !== 'string' || !word.length || !word.isWellFormed() || Buffer.byteLength(word) > MAX_COMMAND_EVENT_LINE_BYTES) {
350
+ throw new CommandEvidenceError('malformed_shell_envelope', 'literal word is unavailable');
351
+ }
352
+ const points = [...word], output = [], encoding = [];
353
+ let quote = null;
354
+ const copy = value => { output.push(value); encoding.push('l'); };
355
+ for (let index = 0; index < points.length; index++) {
356
+ const character = points[index];
357
+ if (character === '\0') throw new CommandEvidenceError('malformed_shell_envelope', 'literal word contains NUL');
358
+ if (quote === "'") {
359
+ if (character === "'") { quote = null; encoding.push('s'); } else copy(character);
360
+ continue;
361
+ }
362
+ if (character === '\\') {
363
+ const next = points[++index];
364
+ if (next === undefined || next === '\0') throw new CommandEvidenceError('malformed_shell_envelope', 'literal word has incomplete escaping');
365
+ if (next === '\n') encoding.push('n');
366
+ else if (quote === '"' && !['$', '`', '"', '\\'].includes(next)) { copy('\\'); copy(next); }
367
+ else { output.push(next); encoding.push('e'); }
368
+ continue;
369
+ }
370
+ if (quote === '"') {
371
+ if (character === '"') { quote = null; encoding.push('d'); }
372
+ else if (character === '$' || character === '`') throw new CommandEvidenceError('ambiguous_shell_word', 'literal word requires expansion');
373
+ else copy(character);
374
+ continue;
375
+ }
376
+ if (character === "'" || character === '"') { quote = character; encoding.push(character === "'" ? 's' : 'd'); continue; }
377
+ const plain = /[A-Za-z0-9_./:@%+=,-]/u.test(character)
378
+ || character.codePointAt(0) > 127 && /[\p{L}\p{N}\p{M}\p{S}]/u.test(character);
379
+ if (!plain) throw new CommandEvidenceError('ambiguous_shell_word', 'literal argument is not one finite word');
380
+ copy(character);
381
+ }
382
+ if (quote !== null || !output.length) throw new CommandEvidenceError('malformed_shell_envelope', 'literal word has unclosed quoting or no body');
383
+ return { script: output.join(''), encoding: encoding.join('') };
384
+ }
385
+
386
+ function restoreLiteralBashWord(script, encoding) {
387
+ if (typeof encoding !== 'string' || !/^[lensd]+$/u.test(encoding) || encoding.length > MAX_COMMAND_EVENT_LINE_BYTES) throw new Error('invalid literal word encoding');
388
+ const points = [...script], word = []; let index = 0;
389
+ for (const operation of encoding) {
390
+ if (operation === 's') word.push("'");
391
+ else if (operation === 'd') word.push('"');
392
+ else if (operation === 'n') word.push(String.fromCharCode(92, 10));
393
+ else {
394
+ if (index >= points.length) throw new Error('literal word encoding exceeds public body');
395
+ word.push(operation === 'e' ? '\\' + points[index++] : points[index++]);
396
+ }
397
+ }
398
+ if (index !== points.length) throw new Error('literal word encoding omits public body');
399
+ return word.join('');
400
+ }
401
+
402
+ function classifyRuntimeCommand(rawCommand, contract, parserRevision, readContext = null) {
403
+ if (typeof rawCommand !== "string" || rawCommand.length === 0) throw new CommandEvidenceError("unsafe_command", "runtime command cannot be safely classified");
404
+ const actualPrefix = ([PRIMARY_SAVED_COMMAND_EVIDENCE_V7_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V8_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V9_PARSER_REVISION].includes(parserRevision) ? [SHELL_PREFIX, '/bin/zsh -lc '] : [SHELL_PREFIX]).find(prefix => rawCommand.startsWith(prefix));
405
+ if (literalAuthorityRevision(parserRevision) && actualPrefix) {
406
+ const decoded = parseLiteralBashWord(rawCommand.slice(actualPrefix.length));
407
+ const exact = contract?.commands.find(command => command.execution_form === 'codex_shell_command'
408
+ && command.shell_family === 'posix_bash' && command.shell_envelope?.executable === '/bin/bash'
409
+ && stableCanonicalJson(command.shell_envelope.arguments) === stableCanonicalJson(['-lc'])
410
+ && command.canonical_script === decoded.script);
411
+ if (exact) return { execution_form: exact.execution_form, logical_digest: exact.logical_command_digest,
412
+ rendered_digest: sha256(Buffer.from(rawCommand)), script: exact.canonical_script, literal_word_encoding: decoded.encoding, ...([PRIMARY_SAVED_COMMAND_EVIDENCE_V7_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V8_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V9_PARSER_REVISION].includes(parserRevision) ? { runtime_shell_executable: actualPrefix.slice(0, -5) } : {}) };
413
+ }
414
+ if (parserRevision === PRIMARY_SAVED_COMMAND_EVIDENCE_V4_PARSER_REVISION) {
415
+ const exact = contract?.commands.find(command => authorityRenderDigests(command, parserRevision).includes(sha256(Buffer.from(rawCommand))));
416
+ if (exact) return { execution_form: exact.execution_form, logical_digest: exact.logical_command_digest,
417
+ rendered_digest: sha256(Buffer.from(rawCommand)), script: exact.canonical_script ?? null };
418
+ }
419
+ const direct = contract?.commands.filter(({ execution_form }) => execution_form === "direct_argv").find((command) => renderCommandEvent(command) === rawCommand);
420
+ if (direct) return { execution_form: "direct_argv", logical_digest: direct.logical_command_digest, rendered_digest: sha256(Buffer.from(rawCommand)), script: null };
421
+ if ([PRIMARY_SAVED_COMMAND_EVIDENCE_V6_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V7_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V8_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V9_PARSER_REVISION].includes(parserRevision)) {
422
+ const prefix = [SHELL_PREFIX, '/bin/zsh -lc '].find(value => rawCommand.startsWith(value));
423
+ if (!prefix) throw new CommandEvidenceError('unsupported_shell', 'auxiliary shell envelope is outside the finite contract');
424
+ const { script } = parseLiteralBashWord(rawCommand.slice(prefix.length));
425
+ if (contract?.commands.some(command => command.execution_form === 'codex_shell_command' && command.canonical_script === script)) {
426
+ throw new CommandEvidenceError('unsupported_shell', 'a public check requires its exact declared Bash-lc envelope');
427
+ }
428
+ if (parserRevision === PRIMARY_SAVED_COMMAND_EVIDENCE_V9_PARSER_REVISION) {
429
+ if (!readContext) throw new CommandEvidenceError('auxiliary_read_context_unavailable', 'fixed public read context is required');
430
+ try { classifyPrimaryDiscoveryCommandV9(rawCommand, { publicFiles: [...readContext.files] }); }
431
+ catch (error) {
432
+ if (!(error instanceof PrimaryDiscoveryGrammarError)) throw error;
433
+ throw new CommandEvidenceError(error.code, 'command is outside the explicit V9 public read vocabulary');
434
+ }
435
+ } else classifyAuxiliaryReadV6(script, readContext);
436
+ return { execution_form: 'codex_shell_command', logical_digest: canonicalDigest({ execution_form: 'codex_shell_command', canonical_script: script }),
437
+ rendered_digest: sha256(Buffer.from(rawCommand)), script, auxiliary_read: true };
438
+ }
439
+ if (parserRevision === PRIMARY_SAVED_COMMAND_EVIDENCE_V5_PARSER_REVISION && !rawCommand.startsWith(SHELL_PREFIX)) {
440
+ throw new CommandEvidenceError('unsupported_shell', 'v5 requires the exact declared Bash-lc envelope');
441
+ }
442
+ const saved = parserRevision !== COMMAND_EVIDENCE_PARSER_REVISION;
443
+ const prefix = (saved ? SAVED_SHELL_PREFIXES : [SHELL_PREFIX]).find(value => rawCommand.startsWith(value));
444
+ if (!prefix) throw new CommandEvidenceError("unsupported_shell", "runtime command uses an unsupported shell envelope");
445
+ const word = rawCommand.slice(prefix.length);
446
+ // Only this complete literal auxiliary word bypasses quoted-word decoding.
447
+ // It remains unmatched; this does not add unquoted verification renderings.
448
+ const script = [PRIMARY_SAVED_COMMAND_EVIDENCE_V3_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V4_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V5_PARSER_REVISION].includes(parserRevision) && word === 'pwd'
449
+ ? 'pwd' : saved ? decodeLiteralShellWord(word) : decodePosixSingleQuotedWord(word);
450
+ if (/(?:^|[;,])\s*(?:token|secret|password|credential)[A-Za-z0-9_-]*\s*=/iu.test(script)) throw new CommandEvidenceError("unsafe_command", "runtime command cannot be safely classified");
451
+ if ([PRIMARY_SAVED_COMMAND_EVIDENCE_V4_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V5_PARSER_REVISION].includes(parserRevision)) {
452
+ if (UNSAFE_SCRIPT.test(script) || /(?:^|[;&|])\s*(?:rm|mv|cp|touch|tee|chmod|chown|mkdir|rmdir)\b|[<>]|\$\(|`|\b(?:writeFile|unlink|rename|rmSync|process\.env)\b/u.test(script)) throw new CommandEvidenceError('unsafe_command', 'runtime operation can change or expose evidence');
453
+ if (!boundedAuxiliaryReadV4(script)) throw new CommandEvidenceError('unsupported_command', 'runtime command meaning is outside the finite read grammar');
454
+ } else try { assertSafeScript(script, "runtime canonical script"); } catch { throw new CommandEvidenceError("unsafe_command", "runtime command cannot be safely classified"); }
455
+ return { execution_form: "codex_shell_command", logical_digest: canonicalDigest({ execution_form: "codex_shell_command", canonical_script: script }), rendered_digest: sha256(Buffer.from(rawCommand)), script };
456
+ }
457
+
458
+ function commandTerminalOutcome(completed) {
459
+ if (!TERMINAL_ITEM_STATUSES.has(completed.status)) throw new CommandEvidenceError("unknown_status", "completed command event has an unsupported terminal status");
460
+ const exitCode = completed.exit_code ?? null;
461
+ if (completed.status === "completed" && (!Number.isInteger(exitCode) || exitCode !== 0)) throw new CommandEvidenceError("status_exit_contradiction", "command status contradicts exit code: completed requires zero");
462
+ if (completed.status === "failed" && (!Number.isInteger(exitCode) || exitCode === 0)) throw new CommandEvidenceError("status_exit_contradiction", "command status contradicts exit code: failed requires a nonzero integer");
463
+ if (completed.status === "declined" && exitCode !== null) throw new CommandEvidenceError("status_exit_contradiction", "command status contradicts exit code: declined requires absent or null");
464
+ return { status: completed.status === "completed" ? "succeeded" : completed.status, exitCode };
465
+ }
466
+
467
+ function assertCommandPairIntegrity(started, completed) {
468
+ if (started.command !== undefined && completed.command !== undefined && started.command !== completed.command) throw new CommandEvidenceError("command_drift", "runtime command changed between started and completed events");
469
+ if (started.status !== undefined && started.status !== "in_progress") throw new CommandEvidenceError("invalid_started_status", "started command event has a non-progress status");
470
+ commandTerminalOutcome(completed);
471
+ }
472
+
473
+ function commandAuthority(rawCommand, contract, parserRevision, readContext = null) {
474
+ if (unsafeActionRevision(parserRevision)) {
475
+ const prefix = [SHELL_PREFIX, '/bin/zsh -lc '].find(value => rawCommand.startsWith(value));
476
+ if (prefix) {
477
+ const { script } = parseLiteralBashWord(rawCommand.slice(prefix.length));
478
+ const rule = unsafeActionContract.primaryUnsafeActionRule(contract?.fixture_id, script, contract?.contract_digest);
479
+ if (rule && rawCommand === prefix + quotePosixShellWord(script)) return { classified: { execution_form: 'codex_shell_command',
480
+ logical_digest: canonicalDigest({ execution_form: 'codex_shell_command', canonical_script: script }),
481
+ rendered_digest: sha256(Buffer.from(rawCommand)), script, unsafe_action_category: rule.category }, commandMatch: null };
482
+ }
483
+ }
484
+ const classified = classifyRuntimeCommand(rawCommand, contract, parserRevision, readContext);
485
+ const candidate = { execution_form: classified.execution_form, logical_command_digest: classified.logical_digest,
486
+ rendered_event_command_digest: classified.rendered_digest,
487
+ ...(literalAuthorityRevision(parserRevision) ? { literal_word_encoding: classified.literal_word_encoding ?? null } : {}),
488
+ ...([PRIMARY_SAVED_COMMAND_EVIDENCE_V7_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V8_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V9_PARSER_REVISION].includes(parserRevision) ? { runtime_shell_executable: classified.runtime_shell_executable ?? null } : {}) };
489
+ const matches = contract?.commands.filter(command => closesCommandAuthority(candidate, command, parserRevision)) ?? [];
490
+ if (boundedSavedRevision(parserRevision)) {
491
+ if (matches.length > 1) throw new CommandEvidenceError("ambiguous_command_match", "multiple public command IDs match one invocation");
492
+ const declaredBody = contract?.commands.some(command => command.execution_form === classified.execution_form && command.logical_command_digest === classified.logical_digest);
493
+ const auxiliaryRead = [PRIMARY_SAVED_COMMAND_EVIDENCE_V6_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V7_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V8_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V9_PARSER_REVISION].includes(parserRevision) ? classified.auxiliary_read === true
494
+ : [PRIMARY_SAVED_COMMAND_EVIDENCE_V4_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V5_PARSER_REVISION].includes(parserRevision) ? boundedAuxiliaryReadV4(classified.script)
495
+ : parserRevision === PRIMARY_SAVED_COMMAND_EVIDENCE_V3_PARSER_REVISION ? boundedAuxiliaryReadV3(classified.script) : boundedAuxiliaryRead(classified.script);
496
+ // V2 retained a declared body under a different envelope as unmatched. V3
497
+ // cannot establish that invocation's relationship/side effects and refuses.
498
+ const legacyDeclaredBody = parserRevision === PRIMARY_SAVED_COMMAND_EVIDENCE_V2_PARSER_REVISION && declaredBody;
499
+ if (!matches.length && !legacyDeclaredBody && !auxiliaryRead) throw new CommandEvidenceError([PRIMARY_SAVED_COMMAND_EVIDENCE_V4_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V5_PARSER_REVISION].includes(parserRevision) ? 'unsupported_command' : 'unsafe_command', "undeclared command is outside the bounded auxiliary read grammar");
500
+ }
501
+ return { classified, commandMatch: matches[0] ?? null };
502
+ }
503
+
504
+ function commandEvidenceBase({ sequence, started, completed, contract, parserRevision, readContext = null }) {
505
+ const rawCommand = completed.command ?? started.command;
506
+ const { classified, commandMatch } = commandAuthority(rawCommand, contract, parserRevision, readContext);
507
+ const matched = commandMatch?.working_directory.evidence_requirement === "not_required" ? commandMatch : null;
508
+ const matchState = matched ? "matched" : commandMatch ? "cwd_unverified" : "unmatched";
509
+ const outcome = commandTerminalOutcome(completed);
510
+ const output = Buffer.from(completed.aggregated_output ?? "");
511
+ return {
512
+ event_sequence: { started: sequence.started, completed: sequence.completed },
513
+ runtime_item_id_digest: sha256(Buffer.from(started.id)),
514
+ matched_command_id: matched?.command_id ?? null,
515
+ match_state: matchState,
516
+ execution_form: classified.execution_form,
517
+ logical_command_digest: classified.logical_digest,
518
+ rendered_event_command_digest: classified.rendered_digest,
519
+ ...(literalAuthorityRevision(parserRevision) ? { literal_word_encoding: classified.literal_word_encoding ?? null } : {}),
520
+ ...([PRIMARY_SAVED_COMMAND_EVIDENCE_V7_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V8_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V9_PARSER_REVISION].includes(parserRevision) ? { runtime_shell_executable: classified.runtime_shell_executable ?? null } : {}),
521
+ working_directory: { status: "unavailable", classification: null, value: null, digest: null, source: "codex_exec_jsonl_cwd_not_exposed" },
522
+ status: outcome.status,
523
+ exit_code: outcome.exitCode,
524
+ duration: { status: "unknown", milliseconds: null },
525
+ aggregated_output: { bytes: output.length, digest: sha256(output) },
526
+ ...(unsafeActionRevision(parserRevision) ? { unsafe_action_category: classified.unsafe_action_category ?? null } : {}),
527
+ capture_source: "codex_exec_jsonl",
528
+ evidence_level: "executed",
529
+ };
530
+ }
531
+
532
+ function closeCommandEvidence(base, identity) {
533
+ const digest = canonicalDigest({ ...identity, ...base });
534
+ const id = `command-evidence-${digest.slice("sha256:".length, "sha256:".length + 32)}`;
535
+ const bytes = jsonBytes({ command_evidence_id: id, command_evidence_digest: digest, ...base }).length;
536
+ return { command_evidence_id: id, command_evidence_digest: digest, ...base, bytes };
537
+ }
538
+
539
+ function failOnRuntimeErrorEvent(event) {
540
+ const topLevel = event.type === "error";
541
+ const itemLevel = event.type === "item.completed" && event.item?.type === "error";
542
+ if (!topLevel && !itemLevel) return;
543
+ const category = String(event.category ?? event.error_category ?? event.item?.category ?? event.item?.error_category ?? "");
544
+ const message = String(event.message ?? event.error ?? event.item?.message ?? event.item?.error ?? "");
545
+ if (STREAM_INTEGRITY_ERROR.test(`${category} ${message}`)) throw new CommandEvidenceError("event_drop", "runtime reported an event stream integrity failure");
546
+ throw new CommandEvidenceError("runtime_item_error", "runtime emitted an unclassified error item");
547
+ }
548
+
549
+ // An inert type must not conceal an opaque tool payload. Other event forms are
550
+ // unknown in V3, not assumed harmless merely because they are not commands.
551
+ function assertV3EventShape(event) {
552
+ const closed = (value, keys) => value && typeof value === 'object' && !Array.isArray(value)
553
+ && Object.keys(value).every(key => keys.includes(key));
554
+ const item = event.item;
555
+ if (event.type === 'error' || event.type === 'turn.failed' || event.type === 'item.completed' && item?.type === 'error') return;
556
+ let valid = false;
557
+ if (event.type === 'thread.started') valid = closed(event, ['type', 'thread_id']) && typeof event.thread_id === 'string' && event.thread_id.length > 0;
558
+ else if (event.type === 'turn.started') valid = closed(event, ['type']);
559
+ else if (event.type === 'turn.completed') valid = closed(event, ['type', 'usage']) && (event.usage === undefined
560
+ || closed(event.usage, ['input_tokens', 'cached_input_tokens', 'output_tokens'])
561
+ && Object.values(event.usage).every(value => Number.isInteger(value) && value >= 0));
562
+ else if (closed(event, ['type', 'item']) && ['item.started', 'item.updated', 'item.completed'].includes(event.type)
563
+ && typeof item?.id === 'string' && item.id.length > 0) {
564
+ if (item.type === 'command_execution') valid = event.type !== 'item.updated'
565
+ && closed(item, ['id', 'type', 'command', 'status', 'exit_code', 'aggregated_output', 'cwd', 'command_id']);
566
+ else if (item.type === 'file_change') valid = event.type === 'item.completed' && closed(item, ['id', 'type', 'changes', 'status'])
567
+ && Array.isArray(item.changes) && item.changes.length > 0
568
+ && item.changes.every(change => closed(change, ['path', 'kind']) && typeof change.path === 'string' && ['add', 'delete', 'update'].includes(change.kind));
569
+ else if (['agent_message', 'reasoning'].includes(item.type)) valid = closed(item, ['id', 'type', 'text'])
570
+ && (event.type === 'item.started' && item.text === undefined || typeof item.text === 'string');
571
+ else if (item.type === 'todo_list') valid = closed(item, ['id', 'type', 'items']) && Array.isArray(item.items)
572
+ && item.items.every(entry => closed(entry, ['text', 'completed']) && typeof entry.text === 'string' && typeof entry.completed === 'boolean');
573
+ }
574
+ if (!valid) throw new CommandEvidenceError('unsupported_event', 'event meaning or side effects are not established');
575
+ }
576
+
577
+ function assertV4EventShape(event) {
578
+ const closed = (value, keys) => value && typeof value === 'object' && !Array.isArray(value)
579
+ && Object.keys(value).every(key => keys.includes(key));
580
+ if (event.type === 'turn.completed') {
581
+ if (!closed(event, ['type', 'usage']) || event.usage !== undefined && (!closed(event.usage,
582
+ ['input_tokens', 'cached_input_tokens', 'output_tokens', 'cache_write_input_tokens', 'reasoning_output_tokens'])
583
+ || Object.values(event.usage).some(value => !Number.isSafeInteger(value) || value < 0))) {
584
+ throw new CommandEvidenceError('unsupported_event', 'terminal telemetry shape is outside the finite contract');
585
+ }
586
+ return;
587
+ }
588
+ if (event.item?.type === 'file_change') {
589
+ const item = event.item;
590
+ if (!closed(event, ['type', 'item']) || !['item.started', 'item.completed'].includes(event.type)
591
+ || !closed(item, ['id', 'type', 'changes', 'status']) || typeof item.id !== 'string' || !item.id
592
+ || !Array.isArray(item.changes) || !item.changes.length || item.changes.some(change => !closed(change, ['path', 'kind'])
593
+ || typeof change.path !== 'string' || !['add', 'delete', 'update'].includes(change.kind))) {
594
+ throw new CommandEvidenceError('unsupported_event', 'file change shape is outside the finite contract');
595
+ }
596
+ return;
597
+ }
598
+ assertV3EventShape(event);
599
+ }
600
+
601
+ // One owner for this invocation's finite action relationships. Nothing is
602
+ // published until the complete thread/turn and every edit/check have closed.
603
+ function parseClosedCodexCommandEvents({ stream, identity, contract, parserRevision, candidateChangePaths, candidateChanges, candidateWorkspaceRoot, auxiliaryReadInputManifest }) {
604
+ const portable = path => typeof path === 'string' && path !== '.' && /^[A-Za-z0-9._/-]+$/u.test(path)
605
+ && !posix.isAbsolute(path) && posix.normalize(path) === path && !path.split('/').includes('..');
606
+ if (!Array.isArray(candidateChangePaths) || candidateChangePaths.some(path => !portable(path))
607
+ || !Array.isArray(candidateChanges) || candidateChanges.some(change => !change || Object.keys(change).sort().join(',') !== 'kind,path'
608
+ || !portable(change.path) || !['add', 'delete', 'update'].includes(change.kind))) {
609
+ throw new CommandEvidenceError('change_context_unavailable', 'closed candidate delta context is required');
610
+ }
611
+ const allowed = new Set(candidateChangePaths), expected = new Map(candidateChanges.map(change => [change.path, change.kind]));
612
+ if (expected.size !== candidateChanges.length || candidateChanges.some(change => !allowed.has(change.path))) {
613
+ throw new CommandEvidenceError('unverified_file_change', 'candidate delta is outside the finite mutable scope');
614
+ }
615
+ if (candidateWorkspaceRoot !== null && (typeof candidateWorkspaceRoot !== 'string' || !posix.isAbsolute(candidateWorkspaceRoot)
616
+ || posix.normalize(candidateWorkspaceRoot) !== candidateWorkspaceRoot || candidateWorkspaceRoot === '/' || candidateWorkspaceRoot.endsWith('/'))) {
617
+ throw new CommandEvidenceError('change_context_unavailable', 'exact canonical arm-root context is required');
618
+ }
619
+ const v6 = [PRIMARY_SAVED_COMMAND_EVIDENCE_V6_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V7_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V8_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V9_PARSER_REVISION].includes(parserRevision);
620
+ const readContext = v6 ? auxiliaryReadContextV6(auxiliaryReadInputManifest, contract, candidateWorkspaceRoot) : null;
621
+ const canonicalChanges = changes => {
622
+ const result = changes.map(change => {
623
+ const path = posix.isAbsolute(change.path) && candidateWorkspaceRoot !== null && change.path.startsWith(candidateWorkspaceRoot + '/')
624
+ ? change.path.slice(candidateWorkspaceRoot.length + 1) : change.path;
625
+ if (!portable(path) || !allowed.has(path) || expected.get(path) !== change.kind) throw new CommandEvidenceError('unverified_file_change', 'file change does not close to the public scope and final snapshot delta');
626
+ return { path, kind: change.kind };
627
+ }).sort((a,b) => a.path < b.path ? -1 : a.path > b.path ? 1 : 0);
628
+ if (new Set(result.map(change => change.path)).size !== result.length) throw new CommandEvidenceError('unverified_file_change', 'file-change aliases are ambiguous');
629
+ return result;
630
+ };
631
+ const bytes = Buffer.isBuffer(stream) ? stream : Buffer.from(stream ?? '');
632
+ if (bytes.length > MAX_COMMAND_EVENT_STREAM_BYTES) throw new CommandEvidenceError('stream_oversized', 'command event stream exceeds the byte limit');
633
+ if (!bytes.length || bytes.at(-1) !== 0x0a) throw new CommandEvidenceError('stream_truncated', 'command event stream is empty or truncated');
634
+ const decoded = bytes.toString('utf8');
635
+ if (!Buffer.from(decoded).equals(bytes)) throw new CommandEvidenceError('malformed_jsonl', 'command event stream contains malformed UTF8');
636
+ const active = new Map(), items = new Map(), edited = new Set(), commands = [];
637
+ let threadStarted = false, turnStarted = false, terminal = false, verificationStarted = false, editing = null, sequence = 0;
638
+ let failureLine = null, failureRawLine = null, failureEvent = null;
639
+ try {
640
+ for (const line of decoded.split('\n').slice(0,-1)) {
641
+ if (v6) { failureLine = sequence + 1; failureRawLine = line; failureEvent = null; }
642
+ if (Buffer.byteLength(line) > MAX_COMMAND_EVENT_LINE_BYTES) throw new CommandEvidenceError('line_oversized', 'command event line exceeds the byte limit');
643
+ let event;
644
+ try { event = parseJsonRejectDuplicateKeys(line); }
645
+ catch { throw new CommandEvidenceError('malformed_jsonl', 'command event stream contains malformed JSONL'); }
646
+ if (v6) failureEvent = event;
647
+ if (!event || typeof event !== 'object' || Array.isArray(event) || typeof event.type !== 'string') throw new CommandEvidenceError('malformed_event', 'command event has no unambiguous type');
648
+ sequence++;
649
+ assertV4EventShape(event);
650
+ if (terminal) throw new CommandEvidenceError(event.type === 'turn.completed' ? 'duplicate_terminal_turn' : 'sequence_reversal', 'activity follows terminal completion');
651
+ failOnRuntimeErrorEvent(event);
652
+ if (event.type === 'turn.failed') throw new CommandEvidenceError('turn_failed', 'runtime turn failed');
653
+ if (event.type === 'thread.started') {
654
+ if (threadStarted || turnStarted || items.size) throw new CommandEvidenceError('unsupported_event', 'thread boundary changed');
655
+ threadStarted = true; continue;
656
+ }
657
+ if (event.type === 'turn.started') {
658
+ if (!threadStarted || turnStarted || items.size) throw new CommandEvidenceError('unsupported_event', 'turn boundary changed');
659
+ turnStarted = true; continue;
660
+ }
661
+ if (!turnStarted) throw new CommandEvidenceError('unsupported_event', 'explicit thread and turn headers are required');
662
+ if (event.type === 'turn.completed') {
663
+ if (active.size || editing || [...items.values()].some(item => item.state === 'started')) throw new CommandEvidenceError('started_without_completed', 'an item is not terminal');
664
+ terminal = true; continue;
665
+ }
666
+ const item = event.item, prior = items.get(item.id);
667
+ if (prior && prior.type !== item.type) throw new CommandEvidenceError('unsupported_event', 'item identity changed meaning');
668
+ if (prior?.state === 'completed' || prior && event.type === 'item.started') throw new CommandEvidenceError('duplicate_item_id', 'item identity was reused');
669
+ if (item.type === 'command_execution') {
670
+ if (typeof item.command !== 'string' || !item.command) throw new CommandEvidenceError('missing_command', 'both command events must identify the invocation');
671
+ if (event.type === 'item.started') {
672
+ if (editing) throw new CommandEvidenceError('unverified_file_change', 'command started during an unfinished edit');
673
+ if (item.status !== undefined && item.status !== 'in_progress') throw new CommandEvidenceError('invalid_started_status', 'command start is not in progress');
674
+ const { commandMatch } = commandAuthority(item.command, contract, parserRevision, readContext);
675
+ if (commandMatch) {
676
+ verificationStarted = true;
677
+ if ([...active.values()].some(value => value.commandId === commandMatch.command_id)) throw new CommandEvidenceError('overlapping_commands', 'the same declared check has no serial precedence');
678
+ }
679
+ active.set(item.id, { item, sequence, commandId: commandMatch?.command_id ?? null });
680
+ } else {
681
+ const started = active.get(item.id);
682
+ if (!started) throw new CommandEvidenceError('completed_without_started', 'command completion lacks its invocation');
683
+ assertCommandPairIntegrity(started.item, item);
684
+ commands.push(closeCommandEvidence(commandEvidenceBase({ sequence:{started:started.sequence,completed:sequence}, started:started.item, completed:item, contract, parserRevision, readContext }), identity));
685
+ active.delete(item.id);
686
+ }
687
+ } else if (item.type === 'file_change') {
688
+ if (verificationStarted || active.size) throw new CommandEvidenceError('unverified_file_change', 'edit is not in the quiet pre-verification phase');
689
+ const changes = canonicalChanges(item.changes);
690
+ if (event.type === 'item.started') {
691
+ if (editing || item.status !== 'in_progress' || changes.some(change => edited.has(change.path))) throw new CommandEvidenceError('unverified_file_change', 'edit history is outside the finite snapshot-bound scope');
692
+ editing = { id:item.id, changes };
693
+ } else {
694
+ if (!editing || editing.id !== item.id || item.status !== 'completed' || stableCanonicalJson(changes) !== stableCanonicalJson(editing.changes)) throw new CommandEvidenceError('unverified_file_change', 'edit completion does not close its start');
695
+ changes.forEach(change => edited.add(change.path)); editing = null;
696
+ }
697
+ } else if (event.type === 'item.updated' && prior?.state !== 'started') throw new CommandEvidenceError('unsupported_event', 'item update lacks its lifetime');
698
+ items.set(item.id, { type:item.type, state:event.type === 'item.completed' ? 'completed' : 'started' });
699
+ }
700
+ failureLine = null; failureRawLine = null; failureEvent = null;
701
+ if (!terminal) throw new CommandEvidenceError('missing_terminal_turn', 'command event stream lacks terminal completion');
702
+ if (edited.size !== expected.size || [...expected.keys()].some(path => !edited.has(path))) throw new CommandEvidenceError('unverified_file_change', 'snapshot delta has an unexplained change');
703
+ return { stream:{bytes:bytes.length,digest:sha256(bytes)}, command_event_count:commands.length, commands };
704
+ } catch (error) {
705
+ if (unsafeActionRevision(parserRevision) && error instanceof CommandEvidenceError) retainedV8UnsafeActions.set(error, commands.filter(command=>command.unsafe_action_category==='unauthorized_attempt'));
706
+ if (v6 && error instanceof CommandEvidenceError && failureLine !== null) v6Failures.set(error, {
707
+ line: failureLine,
708
+ event_type: COMMAND_EVIDENCE_DIAGNOSTIC_EVENT_TYPES.includes(failureEvent?.type) ? failureEvent.type : null,
709
+ event_line_digest: sha256(Buffer.from(failureRawLine)),
710
+ runtime_item_id_digest: typeof failureEvent?.item?.id === 'string' ? sha256(Buffer.from(failureEvent.item.id)) : null,
711
+ rendered_event_command_digest: typeof failureEvent?.item?.command === 'string' ? sha256(Buffer.from(failureEvent.item.command)) : null,
712
+ });
713
+ throw error;
714
+ }
715
+ }
716
+
717
+ export function parseCodexCommandEvents({ stream, identity, contract, parserRevision = COMMAND_EVIDENCE_PARSER_REVISION, candidateChangePaths = [], candidateChanges = [], candidateWorkspaceRoot = null, auxiliaryReadInputManifest = null }) {
718
+ assertParserRevision(parserRevision);
719
+ if ([PRIMARY_SAVED_COMMAND_EVIDENCE_V4_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V5_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V6_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V7_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V8_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V9_PARSER_REVISION].includes(parserRevision)) return parseClosedCodexCommandEvents({stream,identity,contract,parserRevision,candidateChangePaths,candidateChanges,candidateWorkspaceRoot,auxiliaryReadInputManifest});
720
+ const v3 = parserRevision === PRIMARY_SAVED_COMMAND_EVIDENCE_V3_PARSER_REVISION;
721
+ if (v3 && (!Array.isArray(candidateChangePaths) || candidateChangePaths.some(path => typeof path !== 'string'
722
+ || path === '.' || !/^[A-Za-z0-9._/-]+$/u.test(path) || posix.isAbsolute(path)
723
+ || posix.normalize(path) !== path || path.split('/').includes('..')))) throw new CommandEvidenceError('unverified_file_change', 'candidate change context is not canonical');
724
+ const changePaths = new Set(v3 ? candidateChangePaths : []);
725
+ const bytes = Buffer.isBuffer(stream) ? stream : Buffer.from(stream ?? "");
726
+ if (bytes.length > MAX_COMMAND_EVENT_STREAM_BYTES) throw new CommandEvidenceError("stream_oversized", "command event stream exceeds the byte limit");
727
+ if (bytes.length === 0 || bytes.at(-1) !== 0x0a) throw new CommandEvidenceError("stream_truncated", "command event stream is empty or truncated");
728
+ const decoded = bytes.toString("utf8");
729
+ if (v3 && !Buffer.from(decoded, 'utf8').equals(bytes)) throw new CommandEvidenceError('malformed_jsonl', 'command event stream contains malformed UTF8');
730
+ const lines = decoded.split("\n").slice(0, -1);
731
+ const active = new Map();
732
+ const completedIds = new Set();
733
+ const itemTypes = new Map();
734
+ const commandPairs = [];
735
+ let verificationStarted = false;
736
+ let threadStarted = false, turnStarted = false;
737
+ let terminalTurn = false;
738
+ let eventSequence = 0;
739
+ for (const line of lines) {
740
+ if (Buffer.byteLength(line) > MAX_COMMAND_EVENT_LINE_BYTES) throw new CommandEvidenceError("line_oversized", "command event line exceeds the byte limit");
741
+ let event;
742
+ try { event = parserRevision !== COMMAND_EVIDENCE_PARSER_REVISION ? parseJsonRejectDuplicateKeys(line) : JSON.parse(line); }
743
+ catch { throw new CommandEvidenceError("malformed_jsonl", "command event stream contains malformed JSONL"); }
744
+ if (parserRevision !== COMMAND_EVIDENCE_PARSER_REVISION && (!event || typeof event !== "object" || Array.isArray(event) || typeof event.type !== "string" || !event.type)) throw new CommandEvidenceError("malformed_event", "command event has no unambiguous type");
745
+ if (v3) assertV3EventShape(event);
746
+ eventSequence += 1;
747
+ if (event.type === "turn.completed") {
748
+ if (terminalTurn) throw new CommandEvidenceError("duplicate_terminal_turn", "command event stream contains duplicate terminal turn events");
749
+ terminalTurn = true;
750
+ continue;
751
+ }
752
+ if (terminalTurn) throw new CommandEvidenceError("sequence_reversal", "runtime event appears after terminal turn completion");
753
+ failOnRuntimeErrorEvent(event);
754
+ if (event.type === "turn.failed") throw new CommandEvidenceError("turn_failed", "runtime turn failed before command evidence completion");
755
+ if (v3 && event.type === 'thread.started') {
756
+ if (threadStarted || turnStarted || itemTypes.size) throw new CommandEvidenceError('unsupported_event', 'thread lifecycle changed within command capture');
757
+ threadStarted = true;
758
+ }
759
+ if (v3 && event.type === 'turn.started') {
760
+ if (turnStarted || itemTypes.size) throw new CommandEvidenceError('unsupported_event', 'turn lifecycle changed within command capture');
761
+ turnStarted = true;
762
+ }
763
+ if (v3 && event.item) {
764
+ const { id, type } = event.item;
765
+ if (itemTypes.has(id) && itemTypes.get(id) !== type) throw new CommandEvidenceError('unsupported_event', 'item identity changed its event meaning');
766
+ itemTypes.set(id, type);
767
+ if (type === 'file_change') {
768
+ if (completedIds.has(id)) throw new CommandEvidenceError('duplicate_item_id', 'file change item ID is duplicated');
769
+ if (verificationStarted || active.size || event.item.status !== 'completed'
770
+ || event.item.changes.some(change => !changePaths.has(change.path))) throw new CommandEvidenceError('unverified_file_change', 'file change is outside the established pre-verification candidate scope');
771
+ completedIds.add(id);
772
+ continue;
773
+ }
774
+ }
775
+ if (!["item.started", "item.completed"].includes(event.type) || event.item?.type !== "command_execution") continue;
776
+ const item = event.item;
777
+ if (typeof item.id !== "string" || item.id.length === 0) throw new CommandEvidenceError("missing_item_id", "command event lacks a stable item ID");
778
+ if (parserRevision === PRIMARY_SAVED_COMMAND_EVIDENCE_V3_PARSER_REVISION && (typeof item.command !== 'string' || !item.command.length)) throw new CommandEvidenceError('missing_command', 'both command events must identify the invocation');
779
+ if (event.type === "item.started") {
780
+ if (active.has(item.id) || completedIds.has(item.id)) throw new CommandEvidenceError("duplicate_item_id", "command event item ID is duplicated");
781
+ if (parserRevision === PRIMARY_SAVED_COMMAND_EVIDENCE_V3_PARSER_REVISION && active.size) throw new CommandEvidenceError('overlapping_commands', 'command relationship is not serially established');
782
+ if (item.status !== undefined && item.status !== "in_progress") throw new CommandEvidenceError("invalid_started_status", "started command event has a non-progress status");
783
+ // The boundary begins at invocation start, even if the eventual check
784
+ // fails, is declined, or cannot close required cwd evidence.
785
+ if (v3 && contract?.commands.some(command => authorityRenderDigests(command, parserRevision).includes(sha256(Buffer.from(item.command))))) verificationStarted = true;
786
+ active.set(item.id, { item, sequence: eventSequence });
787
+ continue;
788
+ }
789
+ if (completedIds.has(item.id)) throw new CommandEvidenceError("duplicate_item_id", "command event item ID is duplicated");
790
+ const started = active.get(item.id);
791
+ if (!started) throw new CommandEvidenceError("completed_without_started", "command completed without a matching started event");
792
+ assertCommandPairIntegrity(started.item, item);
793
+ active.delete(item.id);
794
+ completedIds.add(item.id);
795
+ commandPairs.push({ sequence: { started: started.sequence, completed: eventSequence }, started: started.item, completed: item });
796
+ }
797
+ if (active.size > 0) throw new CommandEvidenceError("started_without_completed", "command started without a matching completed event");
798
+ if (!terminalTurn) throw new CommandEvidenceError("missing_terminal_turn", "command event stream lacks terminal turn completion");
799
+ const commands = [];
800
+ let unsupportedShell = null;
801
+ for (const pair of commandPairs) {
802
+ try {
803
+ commands.push(closeCommandEvidence(commandEvidenceBase({ ...pair, contract, parserRevision }), identity));
804
+ } catch (error) {
805
+ if (error?.code !== "unsupported_shell") throw error;
806
+ unsupportedShell ??= error;
807
+ }
808
+ }
809
+ if (unsupportedShell) throw unsupportedShell;
810
+ return { stream: { bytes: bytes.length, digest: sha256(bytes) }, command_event_count: commands.length, commands };
811
+ }
812
+
813
+ function manifestIdentity(args) {
814
+ return {
815
+ run_instance_id: args.run_instance_id,
816
+ case_id: args.case_id,
817
+ attempt: args.attempt,
818
+ adapter: args.adapter,
819
+ condition: args.condition,
820
+ fixture_id: args.fixture_id,
821
+ repetition: args.repetition,
822
+ fixture_input_digest: args.fixture_input_digest,
823
+ verification_command_contract_digest: args.verification_command_contract_digest,
824
+ runtime_identity_digest: args.runtime_identity_digest,
825
+ effective_command_digest: args.effective_command_digest,
826
+ };
827
+ }
828
+
829
+ export function buildCommandEvidenceManifest({ identity, capture, stream, command_event_count, commands }) {
830
+ const base = {
831
+ schema_version: "1.2.0",
832
+ schema_path: COMMAND_EVIDENCE_SCHEMA_PATH,
833
+ program: "adaptive_ask_command_evidence",
834
+ ...manifestIdentity(identity),
835
+ capture,
836
+ stream,
837
+ command_event_count,
838
+ commands,
839
+ privacy: { raw_command_stored: false, raw_output_stored: false, full_event_stream_stored: false, absolute_paths_stored: false, secrets_stored: false },
840
+ };
841
+ return { ...base, manifest_digest: canonicalDigest(base) };
842
+ }
843
+
844
+ export function buildUnavailableCommandEvidence({ identity, support, probe, reason, stream = Buffer.alloc(0), parserRevision = COMMAND_EVIDENCE_PARSER_REVISION, failureDiagnostic = null, retainedUnsafeActions = [] }) {
845
+ assertParserRevision(parserRevision);
846
+ if (!Array.isArray(retainedUnsafeActions) || retainedUnsafeActions.some(command=>command.unsafe_action_category!=='unauthorized_attempt') || !unsafeActionRevision(parserRevision) && retainedUnsafeActions.length) throw new Error('only v8 closed unsafe-action pairs may survive failed capture');
847
+ const bytes = Buffer.isBuffer(stream) ? stream : Buffer.from(stream ?? "");
848
+ return buildCommandEvidenceManifest({
849
+ identity,
850
+ capture: {
851
+ support,
852
+ evidence_level: "unavailable",
853
+ event_transport: support === "supported" ? "codex_exec_jsonl" : "none",
854
+ event_format_revision: support === "supported" ? CODEX_COMMAND_EVENT_FORMAT_REVISION : null,
855
+ parser_revision: support === "supported" ? parserRevision : null,
856
+ contract_probe_evidence: probe,
857
+ downgrade_reason: reason,
858
+ ...(unsafeActionRevision(parserRevision) ? {unsafe_action_contract_revision: unsafeActionContract.PRIMARY_UNSAFE_ACTION_CONTRACT_REVISION} : {}),
859
+ ...([PRIMARY_SAVED_COMMAND_EVIDENCE_V6_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V7_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V8_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V9_PARSER_REVISION].includes(parserRevision) ? { failure_diagnostic: failureDiagnostic } : {}),
860
+ },
861
+ stream: { bytes: bytes.length, digest: sha256(bytes) },
862
+ command_event_count: retainedUnsafeActions.length,
863
+ commands: structuredClone(retainedUnsafeActions),
864
+ });
865
+ }
866
+
867
+ export function buildCodexCommandEvidence({ identity, stream, contract, parserRevision = COMMAND_EVIDENCE_PARSER_REVISION, candidateChangePaths = [], candidateChanges = [], candidateWorkspaceRoot = null, auxiliaryReadInputManifest = null }) {
868
+ const parsed = parseCodexCommandEvents({ stream, identity: manifestIdentity(identity), contract, parserRevision, candidateChangePaths,candidateChanges,candidateWorkspaceRoot,auxiliaryReadInputManifest });
869
+ return buildCommandEvidenceManifest({
870
+ identity,
871
+ capture: {
872
+ support: "supported",
873
+ evidence_level: "executed",
874
+ event_transport: "codex_exec_jsonl",
875
+ event_format_revision: CODEX_COMMAND_EVENT_FORMAT_REVISION,
876
+ parser_revision: parserRevision,
877
+ contract_probe_evidence: "runtime_event_shell_authority",
878
+ downgrade_reason: null,
879
+ ...(unsafeActionRevision(parserRevision) ? {unsafe_action_contract_revision: unsafeActionContract.PRIMARY_UNSAFE_ACTION_CONTRACT_REVISION} : {}),
880
+ ...([PRIMARY_SAVED_COMMAND_EVIDENCE_V6_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V7_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V8_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V9_PARSER_REVISION].includes(parserRevision) ? { failure_diagnostic: null } : {}),
881
+ },
882
+ ...parsed,
883
+ });
884
+ }
885
+
886
+ function assertCaptureSemantics(manifest) {
887
+ const capture = manifest.capture;
888
+ if (capture.evidence_level === "executed") {
889
+ if (capture.support !== "supported" || capture.event_transport !== "codex_exec_jsonl" || capture.event_format_revision !== CODEX_COMMAND_EVENT_FORMAT_REVISION || !PARSER_REVISIONS.includes(capture.parser_revision) || capture.contract_probe_evidence !== "runtime_event_shell_authority" || capture.downgrade_reason !== null) throw new Error("executed command evidence capture contract is inconsistent");
890
+ return;
891
+ }
892
+ if (capture.support === "supported") {
893
+ if (capture.event_transport !== "codex_exec_jsonl" || capture.event_format_revision !== CODEX_COMMAND_EVENT_FORMAT_REVISION || !PARSER_REVISIONS.includes(capture.parser_revision) || !["capture_invalid", "command_contract_unavailable", "runtime_unavailable", "shell_capability_unavailable"].includes(capture.contract_probe_evidence) || capture.downgrade_reason === null) throw new Error("supported unavailable command evidence capture contract is inconsistent");
894
+ } else if (capture.event_transport !== "none" || capture.event_format_revision !== null || capture.parser_revision !== null || capture.downgrade_reason === null) throw new Error("unsupported command evidence capture contract is inconsistent");
895
+ }
896
+
897
+ export function validateCommandEvidenceManifest(manifest, { root, contract = null, expectedContractDigest = contract?.contract_digest ?? null, requireContractClosure = contract !== null || expectedContractDigest === null }) {
898
+ assertBenchmarkSchemaInstance(manifest, { schemaPath: resolve(root, COMMAND_EVIDENCE_SCHEMA_PATH), label: "command evidence manifest" });
899
+ if (manifest.manifest_digest !== canonicalDigest(withoutField(manifest, "manifest_digest"))) throw new Error("command evidence manifest digest mismatch");
900
+ if (expectedContractDigest !== manifest.verification_command_contract_digest) throw new Error("command evidence contract binding mismatch");
901
+ assertCaptureSemantics(manifest);
902
+ if (manifest.capture.unsafe_action_contract_revision && manifest.capture.parser_revision !== null && !unsafeActionRevision(manifest.capture.parser_revision)) throw new Error('unsafe action observation requires explicit v8 capture');
903
+ if (Object.hasOwn(manifest.capture, 'failure_diagnostic') && ![PRIMARY_SAVED_COMMAND_EVIDENCE_V6_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V7_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V8_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V9_PARSER_REVISION].includes(manifest.capture.parser_revision)
904
+ && manifest.capture.failure_diagnostic !== null) throw new Error('non-v6 capture cannot carry an event diagnostic');
905
+ if ([PRIMARY_SAVED_COMMAND_EVIDENCE_V6_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V7_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V8_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V9_PARSER_REVISION].includes(manifest.capture.parser_revision)) {
906
+ const diagnostic = manifest.capture.failure_diagnostic;
907
+ if (manifest.capture.evidence_level === 'executed' && diagnostic !== null) throw new Error('executed capture cannot carry a failure diagnostic');
908
+ if (diagnostic !== null) {
909
+ if (!PRIMARY_SAVED_COMMAND_EVIDENCE_V6_FAILURE_CODES.includes(diagnostic.reason)
910
+ || !manifest.capture.downgrade_reason?.endsWith(':' + diagnostic.reason)) throw new Error('failure diagnostic reason differs from capture');
911
+ if (diagnostic.line === null && Object.entries(diagnostic).some(([key, value]) => key !== 'reason' && value !== null)) throw new Error('non-local failure cannot identify an event');
912
+ }
913
+ }
914
+ assertUnique(manifest.commands.map(({ command_evidence_id: id }) => id), "command evidence IDs");
915
+ assertUnique(manifest.commands.map(({ runtime_item_id_digest: digest }) => digest), "runtime item identity digests");
916
+ assertUnique(manifest.commands.map(({ event_sequence: sequence }) => `${sequence.started}:${sequence.completed}`), "command event sequences");
917
+ if (manifest.command_event_count !== manifest.commands.length) throw new Error("command evidence event count mismatch");
918
+ if (manifest.capture.evidence_level === "unavailable" && !(manifest.capture.unsafe_action_contract_revision && manifest.commands.every(command=>command.unsafe_action_category==='unauthorized_attempt')) && (manifest.command_event_count !== 0 || manifest.commands.length !== 0)) throw new Error("unavailable command evidence must have zero events");
919
+ const commandById = new Map(contract?.commands.map((command) => [command.command_id, command]) ?? []);
920
+ const closedActions = [PRIMARY_SAVED_COMMAND_EVIDENCE_V4_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V5_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V6_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V7_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V8_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V9_PARSER_REVISION].includes(manifest.capture.parser_revision);
921
+ const v5 = literalAuthorityRevision(manifest.capture.parser_revision);
922
+ if (closedActions) assertUnique(manifest.commands.flatMap(command => [command.event_sequence.started, command.event_sequence.completed]), 'command event positions');
923
+ const latestCompletion = new Map();
924
+ let previousCompleted = 0;
925
+ for (const command of manifest.commands) {
926
+ if (unsafeActionRevision(manifest.capture.parser_revision)) {
927
+ const rule = unsafeActionContract.primaryUnsafeActionRuleFromDigest(manifest.fixture_id, command.logical_command_digest, canonicalDigest, manifest.verification_command_contract_digest);
928
+ if (command.unsafe_action_category !== (rule?.category ?? null)) throw new Error('unsafe action category differs from source-owned literal contract');
929
+ if (rule && (command.match_state !== 'unmatched' || command.matched_command_id !== null)) throw new Error('unsafe action cannot be verification authority');
930
+ if (rule && ![SHELL_PREFIX,'/bin/zsh -lc '].some(prefix=>sha256(Buffer.from(prefix+quotePosixShellWord(rule.canonical_script)))===command.rendered_event_command_digest)) throw new Error('unsafe action invocation differs from the exact source-owned rule');
931
+ }
932
+ if ([PRIMARY_SAVED_COMMAND_EVIDENCE_V7_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V8_PARSER_REVISION, PRIMARY_SAVED_COMMAND_EVIDENCE_V9_PARSER_REVISION].includes(manifest.capture.parser_revision)
933
+ && (command.execution_form === 'direct_argv' || command.match_state === 'unmatched') && command.runtime_shell_executable !== null) throw new Error('non-authority command must not carry a runtime shell witness');
934
+ if (v5 && (command.execution_form === 'direct_argv' || command.match_state === 'unmatched') && command.literal_word_encoding !== null) throw new Error('non-authority command must not carry literal word encoding');
935
+ const base = withoutField(withoutField(withoutField(command, "command_evidence_id"), "command_evidence_digest"), "bytes");
936
+ const digest = canonicalDigest({ ...manifestIdentity(manifest), ...base });
937
+ const id = `command-evidence-${digest.slice("sha256:".length, "sha256:".length + 32)}`;
938
+ if (command.command_evidence_digest !== digest || command.command_evidence_id !== id) throw new Error("command evidence identity mismatch");
939
+ if (command.bytes !== jsonBytes({ command_evidence_id: id, command_evidence_digest: digest, ...base }).length) throw new Error("command evidence byte count mismatch");
940
+ if (command.event_sequence.completed <= command.event_sequence.started || command.event_sequence.completed <= previousCompleted) throw new Error("command event sequence is reversed");
941
+ if (manifest.capture.parser_revision === PRIMARY_SAVED_COMMAND_EVIDENCE_V3_PARSER_REVISION && command.event_sequence.started <= previousCompleted) throw new Error('command event sequences overlap');
942
+ previousCompleted = command.event_sequence.completed;
943
+ if (closedActions && contract) {
944
+ const authority = contract.commands.find(item => closesCommandAuthority(command, item, manifest.capture.parser_revision));
945
+ if (authority) {
946
+ if (command.event_sequence.started <= (latestCompletion.get(authority.command_id) ?? 0)) throw new Error('overlapping invocations of one public command are ambiguous');
947
+ latestCompletion.set(authority.command_id, command.event_sequence.completed);
948
+ }
949
+ }
950
+ if ((command.status === "succeeded" && command.exit_code !== 0) || (command.status === "failed" && (!Number.isInteger(command.exit_code) || command.exit_code === 0)) || (command.status === "declined" && command.exit_code !== null)) throw new Error("command evidence status contradicts exit code");
951
+ if (command.match_state === "matched") {
952
+ const authority = commandById.get(command.matched_command_id);
953
+ if (requireContractClosure && (!authority || !closesCommandAuthority(command, authority, manifest.capture.parser_revision) || authority.working_directory.evidence_requirement !== "not_required" || command.working_directory.status !== "unavailable")) throw new Error("matched command evidence does not close to public authority");
954
+ if (requireContractClosure && boundedSavedRevision(manifest.capture.parser_revision) && contract.commands.filter(item => closesCommandAuthority(command, item, manifest.capture.parser_revision)).length !== 1) throw new Error("ambiguous public command authority");
955
+ } else {
956
+ if (command.matched_command_id !== null) throw new Error("unmatched or cwd-unverified command evidence must not name a command ID");
957
+ if (requireContractClosure && command.match_state === "cwd_unverified" && !contract?.commands.some((authority) => closesCommandAuthority(command, authority, manifest.capture.parser_revision) && authority.working_directory.evidence_requirement === "runtime_observed")) throw new Error("cwd-unverified command evidence does not close to public authority");
958
+ }
959
+ }
960
+ return structuredClone(manifest);
961
+ }
962
+
963
+ export function projectVerifiedCommandEvidence({ manifest, contract }) {
964
+ const commands = contract?.commands ?? [];
965
+ const commandOrder = new Map(commands.map((command, index) => [command.command_id, index]));
966
+ const byId = new Map();
967
+ for (const evidence of manifest.commands) {
968
+ if (evidence.matched_command_id === null) continue;
969
+ byId.set(evidence.matched_command_id, [...(byId.get(evidence.matched_command_id) ?? []), evidence]);
970
+ }
971
+ const attempted = commands.filter(({ command_id }) => byId.has(command_id)).map(({ command_id }) => command_id);
972
+ const summaries = attempted.map((commandId) => {
973
+ const executions = byId.get(commandId);
974
+ const latest = executions.at(-1).status;
975
+ return {
976
+ command_id: commandId,
977
+ execution_count: executions.length,
978
+ latest_outcome: latest,
979
+ any_success: executions.some(({ status }) => status === "succeeded"),
980
+ any_failure: executions.some(({ status }) => status === "failed"),
981
+ any_declined: executions.some(({ status }) => status === "declined"),
982
+ };
983
+ });
984
+ const latestById = new Map(summaries.map((summary) => [summary.command_id, summary.latest_outcome]));
985
+ const succeeded = attempted.filter((id) => latestById.get(id) === "succeeded");
986
+ const failed = attempted.filter((id) => latestById.get(id) === "failed");
987
+ const declined = attempted.filter((id) => latestById.get(id) === "declined");
988
+ const required = commands.filter(({ requirement }) => requirement === "required").map(({ command_id }) => command_id);
989
+ const unavailable = required.filter((id) => !latestById.has(id));
990
+ const groups = new Map();
991
+ for (const command of commands.filter(({ requirement }) => requirement === "alternative")) {
992
+ if (!groups.has(command.alternative_group_id)) groups.set(command.alternative_group_id, []);
993
+ groups.get(command.alternative_group_id).push(command.command_id);
994
+ }
995
+ const requiredAlternativeGroups = [...groups.entries()].map(([groupId, memberIds]) => {
996
+ const attemptedIds = memberIds.filter((id) => latestById.has(id));
997
+ const succeededIds = memberIds.filter((id) => latestById.get(id) === "succeeded");
998
+ return {
999
+ group_id: groupId,
1000
+ member_ids: memberIds,
1001
+ attempted_ids: attemptedIds,
1002
+ succeeded_ids: succeededIds,
1003
+ satisfaction_state: manifest.capture.evidence_level === "unavailable" ? "unavailable" : succeededIds.length > 0 ? "satisfied" : "unsatisfied",
1004
+ };
1005
+ });
1006
+ for (const values of [required, attempted, succeeded, failed, declined, unavailable]) assertUnique(values, "normalized command evidence inventory");
1007
+ for (const group of requiredAlternativeGroups) for (const id of [...group.attempted_ids, ...group.succeeded_ids]) if (!commandOrder.has(id)) throw new Error("alternative group contains an undeclared command ID");
1008
+ return {
1009
+ manifest_digest: manifest.manifest_digest,
1010
+ ...(manifest.capture.unsafe_action_contract_revision === unsafeActionContract.PRIMARY_UNSAFE_ACTION_CONTRACT_REVISION ? { unsafe_action_capture_state:
1011
+ manifest.capture.evidence_level === 'executed' ? 'observed_finite_scope'
1012
+ : manifest.capture.contract_probe_evidence === 'capture_invalid' ? 'invalid' : 'unavailable' } : {}),
1013
+ capture_support: manifest.capture.support,
1014
+ evidence_level: manifest.capture.evidence_level,
1015
+ command_event_count: manifest.command_event_count,
1016
+ verification_command_contract_digest: manifest.verification_command_contract_digest,
1017
+ required_command_ids: required,
1018
+ required_alternative_groups: requiredAlternativeGroups,
1019
+ command_summaries: summaries,
1020
+ attempted_command_ids: attempted,
1021
+ succeeded_command_ids: succeeded,
1022
+ failed_command_ids: failed,
1023
+ declined_command_ids: declined,
1024
+ unavailable_command_ids: unavailable,
1025
+ unmatched_command_count: manifest.commands.filter(({ match_state }) => match_state === "unmatched").length,
1026
+ cwd_unverified_command_count: manifest.commands.filter(({ match_state }) => match_state === "cwd_unverified").length,
1027
+ references: manifest.commands.map((command) => ({
1028
+ command_id: command.matched_command_id,
1029
+ ...(unsafeActionRevision(manifest.capture.parser_revision) ? { unsafe_action_category: command.unsafe_action_category } : {}),
1030
+ match_state: command.match_state,
1031
+ command_evidence_id: command.command_evidence_id,
1032
+ digest: command.command_evidence_digest,
1033
+ bytes: command.bytes,
1034
+ outcome: command.status,
1035
+ exit_code: command.exit_code,
1036
+ })),
1037
+ declined_references: manifest.commands.filter(({ status }) => status === "declined").map((command) => ({
1038
+ command_id: command.matched_command_id,
1039
+ ...(unsafeActionRevision(manifest.capture.parser_revision) ? { unsafe_action_category: command.unsafe_action_category } : {}),
1040
+ match_state: command.match_state,
1041
+ command_evidence_id: command.command_evidence_id,
1042
+ digest: command.command_evidence_digest,
1043
+ bytes: command.bytes,
1044
+ outcome: command.status,
1045
+ exit_code: command.exit_code,
1046
+ })),
1047
+ };
1048
+ }