@event4u/agent-config 14.10.0 → 14.11.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 (399) hide show
  1. package/.augment-plugin/marketplace.json +3 -3
  2. package/.augment-plugin/plugin.json +1 -1
  3. package/.claude-plugin/marketplace.json +1 -1
  4. package/CHANGELOG.md +335 -0
  5. package/README.md +1 -1
  6. package/dist/agent-src/commands/design.md +88 -0
  7. package/dist/agent-src/commands/project/analyze.md +47 -0
  8. package/dist/agent-src/commands/review/changes.md +67 -6
  9. package/dist/agent-src/commands/roadmap/create.md +49 -0
  10. package/dist/agent-src/commands/roadmap/next.md +27 -11
  11. package/dist/agent-src/commands/roadmap/process-full.md +14 -0
  12. package/dist/agent-src/commands/video/from-script.md +60 -3
  13. package/dist/agent-src/commands/video/stitch.md +14 -0
  14. package/dist/agent-src/contexts/communication/rules-auto/guidelines-mechanics.md +1 -0
  15. package/dist/agent-src/contexts/execution/roadmap-process-loop.md +154 -2
  16. package/dist/agent-src/rules/active-remediation.md +3 -3
  17. package/dist/agent-src/rules/code-provenance.md +2 -2
  18. package/dist/agent-src/rules/context-hygiene.md +13 -33
  19. package/dist/agent-src/rules/council-availability.md +2 -2
  20. package/dist/agent-src/rules/decision-revisit-gate.md +3 -1
  21. package/dist/agent-src/rules/design-fidelity.md +18 -0
  22. package/dist/agent-src/rules/design-review-after-ui-write.md +2 -2
  23. package/dist/agent-src/rules/evaluator-independence.md +56 -44
  24. package/dist/agent-src/rules/fix-what-you-see.md +9 -1
  25. package/dist/agent-src/rules/framework-neutrality-in-generic-skills.md +1 -1
  26. package/dist/agent-src/rules/minimal-safe-diff.md +14 -20
  27. package/dist/agent-src/rules/missing-skill-recovery.md +13 -1
  28. package/dist/agent-src/rules/playbook-precedence.md +105 -0
  29. package/dist/agent-src/rules/recurring-criticism.md +3 -1
  30. package/dist/agent-src/rules/roadmap-progress-sync.md +14 -13
  31. package/dist/agent-src/rules/scale-discipline.md +24 -0
  32. package/dist/agent-src/rules/security-sensitive-stop.md +2 -2
  33. package/dist/agent-src/rules/settings-ask-protocol.md +2 -2
  34. package/dist/agent-src/rules/ui-audit-gate.md +27 -15
  35. package/dist/agent-src/rules/untrusted-input-defense.md +2 -2
  36. package/dist/agent-src/skills/accessibility-auditor/SKILL.md +19 -0
  37. package/dist/agent-src/skills/adr-create/SKILL.md +7 -0
  38. package/dist/agent-src/skills/agents-md-thin-root/SKILL.md +33 -0
  39. package/dist/agent-src/skills/ai-council/references/advanced-modes.md +17 -3
  40. package/dist/agent-src/skills/ai-council/references/output-and-synthesis.md +31 -0
  41. package/dist/agent-src/skills/ai-council/references/procedure.md +19 -0
  42. package/dist/agent-src/skills/alerting-doctrine/SKILL.md +225 -0
  43. package/dist/agent-src/skills/alerting-doctrine/evals/triggers.json +17 -0
  44. package/dist/agent-src/skills/authz-review/SKILL.md +0 -1
  45. package/dist/agent-src/skills/blast-radius-analyzer/SKILL.md +32 -0
  46. package/dist/agent-src/skills/brand/SKILL.md +3 -0
  47. package/dist/agent-src/skills/brand-asset-generation/SKILL.md +3 -0
  48. package/dist/agent-src/skills/brand-audit/SKILL.md +3 -0
  49. package/dist/agent-src/skills/brand-identity/SKILL.md +3 -0
  50. package/dist/agent-src/skills/brand-strategy/SKILL.md +3 -0
  51. package/dist/agent-src/skills/brand-to-tokens/SKILL.md +3 -0
  52. package/dist/agent-src/skills/check-refs/SKILL.md +3 -0
  53. package/dist/agent-src/skills/code-review/SKILL.md +11 -0
  54. package/dist/agent-src/skills/command-routing/SKILL.md +6 -0
  55. package/dist/agent-src/skills/condense-memory/SKILL.md +3 -0
  56. package/dist/agent-src/skills/context-authoring/SKILL.md +1 -1
  57. package/dist/agent-src/skills/conventional-commits-writing/SKILL.md +3 -0
  58. package/dist/agent-src/skills/copilot-agents-optimization/SKILL.md +10 -0
  59. package/dist/agent-src/skills/corpus-grounding/SKILL.md +3 -0
  60. package/dist/agent-src/skills/design-intelligence/SKILL.md +3 -0
  61. package/dist/agent-src/skills/design-intelligence/data/landing.csv +36 -35
  62. package/dist/agent-src/skills/design-intelligence/data/stacks/threejs.csv +1 -0
  63. package/dist/agent-src/skills/design-review/SKILL.md +79 -1
  64. package/dist/agent-src/skills/design-review/references/verification-automation.md +41 -0
  65. package/dist/agent-src/skills/design-system-capture/SKILL.md +35 -40
  66. package/dist/agent-src/skills/design-system-capture/references/import-procedure.md +50 -0
  67. package/dist/agent-src/skills/design-tokens/SKILL.md +3 -0
  68. package/dist/agent-src/skills/design-variations/SKILL.md +3 -0
  69. package/dist/agent-src/skills/developer-like-execution/SKILL.md +3 -0
  70. package/dist/agent-src/skills/estimate-ticket/SKILL.md +3 -0
  71. package/dist/agent-src/skills/existing-ui-audit/SKILL.md +20 -3
  72. package/dist/agent-src/skills/fe-design/SKILL.md +74 -41
  73. package/dist/agent-src/skills/fe-design/evals/triggers.json +65 -53
  74. package/dist/agent-src/skills/fe-design/references/craft-floor.md +52 -0
  75. package/dist/agent-src/skills/fe-design/references/source-led-port.md +36 -0
  76. package/dist/agent-src/skills/file-editor/SKILL.md +5 -0
  77. package/dist/agent-src/skills/finishing-a-development-branch/SKILL.md +2 -2
  78. package/dist/agent-src/skills/git-workflow/SKILL.md +3 -0
  79. package/dist/agent-src/skills/html-deck/SKILL.md +3 -0
  80. package/dist/agent-src/skills/iconography/SKILL.md +3 -0
  81. package/dist/agent-src/skills/image-editing/SKILL.md +3 -0
  82. package/dist/agent-src/skills/image-generation/SKILL.md +3 -0
  83. package/dist/agent-src/skills/image-provider-routing/SKILL.md +3 -0
  84. package/dist/agent-src/skills/incident-commander/SKILL.md +10 -0
  85. package/dist/agent-src/skills/js-library-packaging/SKILL.md +173 -0
  86. package/dist/agent-src/skills/js-library-packaging/evals/triggers.json +17 -0
  87. package/dist/agent-src/skills/js-library-packaging/scripts/check_package_surface.ts +270 -0
  88. package/dist/agent-src/skills/laravel-migration/SKILL.md +3 -0
  89. package/dist/agent-src/skills/learning-to-rule-or-skill/SKILL.md +3 -0
  90. package/dist/agent-src/skills/lint-skills/SKILL.md +3 -0
  91. package/dist/agent-src/skills/llm-provider-knowledge/SKILL.md +3 -0
  92. package/dist/agent-src/skills/logging-monitoring/SKILL.md +234 -51
  93. package/dist/agent-src/skills/logo-generation/SKILL.md +3 -0
  94. package/dist/agent-src/skills/md-language-check/SKILL.md +3 -0
  95. package/dist/agent-src/skills/monorepo-workspace/SKILL.md +149 -0
  96. package/dist/agent-src/skills/monorepo-workspace/evals/triggers.json +17 -0
  97. package/dist/agent-src/skills/motion-choreographer/SKILL.md +6 -0
  98. package/dist/agent-src/skills/multi-tenancy/SKILL.md +4 -0
  99. package/dist/agent-src/skills/operational-readiness/SKILL.md +184 -0
  100. package/dist/agent-src/skills/operational-readiness/evals/triggers.json +17 -0
  101. package/dist/agent-src/skills/override-management/SKILL.md +3 -0
  102. package/dist/agent-src/skills/persona-improvement/SKILL.md +3 -0
  103. package/dist/agent-src/skills/pest-testing/SKILL.md +3 -0
  104. package/dist/agent-src/skills/playbook-authoring/SKILL.md +162 -0
  105. package/dist/agent-src/skills/playwright-testing/SKILL.md +3 -0
  106. package/dist/agent-src/skills/privacy-review/SKILL.md +3 -0
  107. package/dist/agent-src/skills/prompt-engineering-image/SKILL.md +3 -0
  108. package/dist/agent-src/skills/quality-tools/SKILL.md +5 -0
  109. package/dist/agent-src/skills/react-shadcn-ui/SKILL.md +52 -21
  110. package/dist/agent-src/skills/readme-reviewer/SKILL.md +3 -0
  111. package/dist/agent-src/skills/readme-writing/SKILL.md +3 -0
  112. package/dist/agent-src/skills/readme-writing-package/SKILL.md +3 -0
  113. package/dist/agent-src/skills/receiving-code-review/SKILL.md +2 -2
  114. package/dist/agent-src/skills/refine-prompt/SKILL.md +3 -0
  115. package/dist/agent-src/skills/refine-ticket/SKILL.md +3 -0
  116. package/dist/agent-src/skills/requesting-code-review/SKILL.md +2 -2
  117. package/dist/agent-src/skills/review-routing/SKILL.md +2 -2
  118. package/dist/agent-src/skills/roadmap-writing/SKILL.md +23 -41
  119. package/dist/agent-src/skills/roadmap-writing/references/follow-up-roadmap-shape.md +47 -0
  120. package/dist/agent-src/skills/rtk-output-filtering/SKILL.md +22 -6
  121. package/dist/agent-src/skills/runway-cognition/SKILL.md +3 -0
  122. package/dist/agent-src/skills/scene-expander/scene-blueprint.schema.yaml +26 -0
  123. package/dist/agent-src/skills/secrets-management/SKILL.md +4 -0
  124. package/dist/agent-src/skills/server-hardening/SKILL.md +159 -0
  125. package/dist/agent-src/skills/server-hardening/evals/triggers.json +17 -0
  126. package/dist/agent-src/skills/skill-improvement-pipeline/SKILL.md +3 -0
  127. package/dist/agent-src/skills/skill-management/SKILL.md +3 -0
  128. package/dist/agent-src/skills/skill-reviewer/SKILL.md +3 -0
  129. package/dist/agent-src/skills/skill-writing/SKILL.md +6 -0
  130. package/dist/agent-src/skills/spreadsheet-authoring/SKILL.md +3 -0
  131. package/dist/agent-src/skills/storybook-workshop/SKILL.md +194 -0
  132. package/dist/agent-src/skills/storybook-workshop/evals/triggers.json +17 -0
  133. package/dist/agent-src/skills/storybook-workshop/scripts/story_contrast_floor.ts +134 -0
  134. package/dist/agent-src/skills/subagent-orchestration/SKILL.md +1 -1
  135. package/dist/agent-src/skills/subagent-orchestration/prompts/README.md +25 -0
  136. package/dist/agent-src/skills/supply-chain-intake/SKILL.md +12 -0
  137. package/dist/agent-src/skills/systematic-debugging/SKILL.md +1 -1
  138. package/dist/agent-src/skills/terraform/SKILL.md +3 -0
  139. package/dist/agent-src/skills/test-driven-development/SKILL.md +1 -1
  140. package/dist/agent-src/skills/threat-modeling/SKILL.md +0 -3
  141. package/dist/agent-src/skills/token-optimizer/SKILL.md +3 -0
  142. package/dist/agent-src/skills/typography-system/SKILL.md +3 -0
  143. package/dist/agent-src/skills/ui-component-architect/SKILL.md +9 -1
  144. package/dist/agent-src/skills/upstream-contribute/SKILL.md +3 -0
  145. package/dist/agent-src/skills/validate-feature-fit/SKILL.md +3 -0
  146. package/dist/agent-src/skills/verify-completion-evidence/SKILL.md +2 -2
  147. package/dist/agent-src/skills/wireframe/SKILL.md +3 -0
  148. package/dist/agent-src/skills/wireframe/references/story-beat-ledger.schema.json +115 -0
  149. package/dist/agent-src/skills/workspace-link/SKILL.md +131 -0
  150. package/dist/agent-src/skills/workspace-link/evals/triggers.json +17 -0
  151. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  152. package/dist/agent-src/templates/playbook.md +75 -0
  153. package/dist/agent-src/templates/roadmaps.md +37 -0
  154. package/dist/agent-src/templates/scripts/check_playbook_invokes.ts +231 -0
  155. package/dist/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +24 -0
  156. package/dist/agent-src/templates/scripts/work_engine/directives/ui/polish.ts +2 -0
  157. package/dist/agent-src/templates/scripts/work_engine/directives/ui/review.ts +216 -0
  158. package/dist/agent-src/templates/scripts/work_engine/directives/ui/scaffold.ts +159 -0
  159. package/dist/agent-src/templates/scripts/work_engine/directives/ui/stack_bundles.ts +73 -4
  160. package/dist/agent-src/templates/scripts/work_engine/stack/detect.ts +325 -40
  161. package/dist/cli/commands/uiAudit.js +221 -0
  162. package/dist/cli/commands/uiAudit.js.map +1 -0
  163. package/dist/cli/commands/uiRender.js +206 -0
  164. package/dist/cli/commands/uiRender.js.map +1 -0
  165. package/dist/cli/main.js +22 -1
  166. package/dist/cli/main.js.map +1 -1
  167. package/dist/cli/mcp/content.js +64 -1
  168. package/dist/cli/mcp/content.js.map +1 -1
  169. package/dist/cli/mcp/dispatch.js +175 -10
  170. package/dist/cli/mcp/dispatch.js.map +1 -1
  171. package/dist/cli/registry.js +3 -0
  172. package/dist/cli/registry.js.map +1 -1
  173. package/dist/cli-delegate/{chunk-H4VIVD4C.js → chunk-236PNQZK.js} +413 -391
  174. package/dist/cli-delegate/{chunk-G23AT6GD.js → chunk-DMSZHXZS.js} +57 -1
  175. package/dist/cli-delegate/{chunk-77GR3VD4.js → chunk-FF7WAFMR.js} +58 -3
  176. package/dist/cli-delegate/{chunk-PLSG6UL5.js → chunk-K4FFODTS.js} +341 -204
  177. package/dist/cli-delegate/{chunk-YM4GZDJG.js → chunk-L43NCYPB.js} +5 -0
  178. package/dist/cli-delegate/{chunk-B2ERU2VA.js → chunk-WOKWX5PL.js} +1 -1
  179. package/dist/cli-delegate/cmd_brand_status.js +8 -6
  180. package/dist/cli-delegate/cmd_conformance.js +3 -3
  181. package/dist/cli-delegate/cmd_doctor.js +3 -3
  182. package/dist/cli-delegate/cmd_export.js +4 -4
  183. package/dist/cli-delegate/cmd_handoff.js +1 -1
  184. package/dist/cli-delegate/cmd_preflight.js +2 -2
  185. package/dist/cli-delegate/cmd_prune.js +4 -4
  186. package/dist/cli-delegate/cmd_session_recycle.js +70 -9
  187. package/dist/cli-delegate/cmd_settings_migrate.js +4 -4
  188. package/dist/cli-delegate/cmd_settings_set.js +1 -1
  189. package/dist/cli-delegate/cmd_sync.js +4 -4
  190. package/dist/cli-delegate/cmd_uninstall.js +4 -4
  191. package/dist/cli-delegate/cmd_validate.js +4 -4
  192. package/dist/discovery/deprecation-report.md +1 -1
  193. package/dist/discovery/discovery-manifest.json +359 -124
  194. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  195. package/dist/discovery/discovery-manifest.summary.md +4 -4
  196. package/dist/discovery/dormancy-report.md +1 -1
  197. package/dist/discovery/orphan-report.md +1 -1
  198. package/dist/discovery/packs.json +18 -8
  199. package/dist/discovery/trust-report.md +3 -3
  200. package/dist/discovery/workspaces.json +16 -6
  201. package/dist/hooks/dispatch.js +2337 -1436
  202. package/dist/install/install.mjs +795 -708
  203. package/dist/mcp/registry-manifest.json +3 -3
  204. package/dist/mcp/server.json +2 -2
  205. package/dist/mcp/server.mjs +1685 -1250
  206. package/dist/router.json +1 -1
  207. package/dist/scripts/_lib/lean_projection_mode.js +40 -0
  208. package/dist/scripts/_lib/lean_projection_mode.js.map +1 -0
  209. package/dist/scripts/_lib/scoped_projection.js +84 -0
  210. package/dist/scripts/_lib/scoped_projection.js.map +1 -1
  211. package/dist/scripts/_lib/ui_surface.js +89 -0
  212. package/dist/scripts/_lib/ui_surface.js.map +1 -0
  213. package/dist/scripts/condense.js +6 -10
  214. package/dist/scripts/condense.js.map +1 -1
  215. package/dist/scripts/project_thin_rules.js +40 -2
  216. package/dist/scripts/project_thin_rules.js.map +1 -1
  217. package/dist/server/schemas/settings.js +3 -0
  218. package/dist/server/schemas/settings.js.map +1 -1
  219. package/dist/shared/skillRanking.js +159 -0
  220. package/dist/shared/skillRanking.js.map +1 -0
  221. package/docs/contracts/provider-lifecycle.md +47 -18
  222. package/docs/contracts/settings-classes.md +14 -4
  223. package/docs/guidelines/agent-infra/context-hygiene-mechanics.md +49 -0
  224. package/docs/guidelines/agent-infra/evaluator-independence-mechanics.md +92 -0
  225. package/docs/guidelines/agent-infra/minimal-safe-diff-mechanics.md +45 -1
  226. package/docs/guidelines/agent-infra/roadmap-deferred-resolution-provenance.md +54 -0
  227. package/docs/guidelines/design-antipatterns.md +4 -2
  228. package/docs/guidelines/design-asset-discipline.md +38 -0
  229. package/docs/guidelines/design-fidelity-mechanics.md +45 -29
  230. package/docs/guidelines/design-handover-extraction.md +35 -5
  231. package/docs/guidelines/design-modes.md +41 -1
  232. package/docs/guidelines/monorepo-antipatterns.md +141 -0
  233. package/llms.txt +50 -39
  234. package/package.json +1 -1
  235. package/src/agent-src/templates/scripts/check_playbook_invokes.ts +231 -0
  236. package/src/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +24 -0
  237. package/src/agent-src/templates/scripts/work_engine/directives/ui/polish.ts +2 -0
  238. package/src/agent-src/templates/scripts/work_engine/directives/ui/review.ts +216 -0
  239. package/src/agent-src/templates/scripts/work_engine/directives/ui/scaffold.ts +159 -0
  240. package/src/agent-src/templates/scripts/work_engine/directives/ui/stack_bundles.ts +73 -4
  241. package/src/agent-src/templates/scripts/work_engine/stack/detect.ts +325 -40
  242. package/src/config/agent-settings.template.yml +28 -0
  243. package/src/config/assurance-capability-registry.json +223 -0
  244. package/src/config/assurance-threshold-budget.json +65 -0
  245. package/src/config/ci-local-parity.yml +14 -0
  246. package/src/config/discovery/unassigned-artefacts.yml +2 -0
  247. package/src/config/dispatch-economy-metrics.json +4 -2
  248. package/src/config/evaluator-budgets.json +14 -14
  249. package/src/config/gate-coverage.yml +207 -8
  250. package/src/config/gate-violation-baselines.json +76 -72
  251. package/src/config/hook-latency-budget.json +1 -0
  252. package/src/config/hook-token-budget.json +137 -125
  253. package/src/config/pack-size-budget.json +4 -2
  254. package/src/config/quorum-attendance-budget.json +12 -4
  255. package/src/config/rule-activation-census.json +7 -3
  256. package/src/config/rule-enforcement-baseline.json +0 -1
  257. package/src/config/rule-stub-ceilings.json +112 -91
  258. package/src/scripts/_cli/cmd_doctor.ts +15 -16
  259. package/src/scripts/_cli/doctor_install_mode.ts +49 -0
  260. package/src/scripts/_cli/doctor_overrides.ts +154 -0
  261. package/src/scripts/_dispatch.bash +17 -0
  262. package/src/scripts/_lib/as_of.ts +412 -0
  263. package/src/scripts/_lib/exec_evidence.ts +7 -0
  264. package/src/scripts/_lib/hook_settings.ts +33 -0
  265. package/src/scripts/_lib/host_listing_model.ts +192 -0
  266. package/src/scripts/_lib/lean_projection_mode.ts +44 -0
  267. package/src/scripts/_lib/mcp_bridge.ts +199 -0
  268. package/src/scripts/_lib/review_independence.ts +62 -10
  269. package/src/scripts/_lib/rule_injection.ts +239 -0
  270. package/src/scripts/_lib/run_checkpoint.ts +54 -1
  271. package/src/scripts/_lib/scoped_projection.ts +96 -0
  272. package/src/scripts/_lib/session_register.ts +44 -2
  273. package/src/scripts/_lib/skill_catalogue.ts +38 -2
  274. package/src/scripts/_lib/transcript_reads.ts +207 -0
  275. package/src/scripts/_lib/ui_authority.test.ts +251 -0
  276. package/src/scripts/_lib/ui_authority.ts +343 -0
  277. package/src/scripts/ai-video/adapters/fal.sh +8 -3
  278. package/src/scripts/ai-video/adapters/gemini-veo.sh +10 -0
  279. package/src/scripts/ai-video/adapters/higgsfield.sh +10 -2
  280. package/src/scripts/ai-video/adapters/kling.sh +10 -0
  281. package/src/scripts/ai-video/adapters/sora.sh +10 -0
  282. package/src/scripts/ai-video/lib/calibrate-cost.sh +145 -0
  283. package/src/scripts/ai-video/lib/model-capabilities/README.md +53 -7
  284. package/src/scripts/ai-video/lib/model-capabilities/comfyui.json +15 -3
  285. package/src/scripts/ai-video/lib/model-capabilities/fal.json +36 -6
  286. package/src/scripts/ai-video/lib/model-capabilities/gemini-veo.json +23 -0
  287. package/src/scripts/ai-video/lib/model-capabilities/higgsfield.json +23 -0
  288. package/src/scripts/ai-video/lib/model-capabilities/kling.json +23 -0
  289. package/src/scripts/ai-video/lib/model-capabilities/musetalk.json +8 -2
  290. package/src/scripts/ai-video/lib/model-capabilities/replicate.json +36 -6
  291. package/src/scripts/ai-video/lib/model-capabilities/sora.json +45 -0
  292. package/src/scripts/ai-video/lib/model-capabilities/syncso.json +8 -2
  293. package/src/scripts/ai-video/lib/parse-blueprint.sh +52 -5
  294. package/src/scripts/ai-video/lib/resume-scan.sh +92 -3
  295. package/src/scripts/ai-video/lib/seam-plan.sh +212 -0
  296. package/src/scripts/ai-video/smoke-trace.sh +450 -2
  297. package/src/scripts/ai-video/stitch.sh +191 -10
  298. package/src/scripts/ai-video/test-pipeline.sh +84 -6
  299. package/src/scripts/ai_council/cli_agency_bounds.ts +139 -0
  300. package/src/scripts/ai_council/cli_least_agency_canary.ts +347 -0
  301. package/src/scripts/ai_council/clients.ts +3 -2
  302. package/src/scripts/ai_council/consensus.ts +63 -6
  303. package/src/scripts/ai_council/events_log.ts +46 -1
  304. package/src/scripts/ai_council/orchestrator.ts +103 -108
  305. package/src/scripts/ai_council/orchestrator_results.ts +166 -0
  306. package/src/scripts/ai_council/prompts.ts +12 -5
  307. package/src/scripts/ai_council/quorum.ts +82 -1
  308. package/src/scripts/ai_council/quorum_wiring.ts +82 -5
  309. package/src/scripts/ai_council/stance_tally.ts +22 -0
  310. package/src/scripts/bench_hook_latency.ts +62 -0
  311. package/src/scripts/build_proof.ts +12 -1
  312. package/src/scripts/capture_skill_catalogue.ts +21 -0
  313. package/src/scripts/check_always_budget.ts +2 -1
  314. package/src/scripts/check_augmentignore.ts +2 -1
  315. package/src/scripts/check_beta_review_markers.ts +2 -1
  316. package/src/scripts/check_composite_arming.ts +364 -0
  317. package/src/scripts/check_corpus_staleness.ts +2 -1
  318. package/src/scripts/check_council_pin_staleness.ts +3 -1
  319. package/src/scripts/check_enforcement_coverage.ts +116 -3
  320. package/src/scripts/check_enforcement_denominator.ts +365 -0
  321. package/src/scripts/check_gate_coverage.ts +2 -1
  322. package/src/scripts/check_hook_bundle_freshness.ts +13 -1
  323. package/src/scripts/check_knowledge_cards.ts +2 -1
  324. package/src/scripts/check_knowledge_pages.ts +3 -2
  325. package/src/scripts/check_memory.ts +2 -1
  326. package/src/scripts/check_no_automerge_key.ts +287 -0
  327. package/src/scripts/check_pack_conformance_fixture.ts +565 -0
  328. package/src/scripts/check_proposal.ts +2 -1
  329. package/src/scripts/check_reach_staleness.ts +2 -1
  330. package/src/scripts/check_release_adjacent_health.ts +2 -1
  331. package/src/scripts/check_release_pr_shape.ts +5 -0
  332. package/src/scripts/check_review_schema.ts +34 -1
  333. package/src/scripts/check_roadmap_trackable.ts +48 -3
  334. package/src/scripts/check_source_size_budget.ts +2 -1
  335. package/src/scripts/check_standing_payload_delta.ts +505 -0
  336. package/src/scripts/check_trigger_evals.ts +2 -1
  337. package/src/scripts/classify_change_risk.ts +281 -0
  338. package/src/scripts/compute_skill_tiers.ts +186 -0
  339. package/src/scripts/condense.ts +8 -13
  340. package/src/scripts/council_attendance_metrics.ts +183 -0
  341. package/src/scripts/council_cli.ts +10 -8
  342. package/src/scripts/council_parse_rate.ts +116 -0
  343. package/src/scripts/derive_playbooks.ts +406 -0
  344. package/src/scripts/design_slop_rules.test.ts +7 -0
  345. package/src/scripts/design_slop_rules.ts +56 -2
  346. package/src/scripts/dispatch_r2_reviewer.ts +16 -0
  347. package/src/scripts/frontend_corpus_hash.ts +116 -0
  348. package/src/scripts/grade_target_readiness.ts +478 -0
  349. package/src/scripts/hook_manifest.json +1 -1
  350. package/src/scripts/hook_manifest.yaml +97 -16
  351. package/src/scripts/hooks/concern_registry.ts +4 -0
  352. package/src/scripts/hooks/design_pass_hook.ts +356 -0
  353. package/src/scripts/hooks/rtk_wrap_hook.ts +30 -7
  354. package/src/scripts/hooks/rule_inject_hook.ts +318 -0
  355. package/src/scripts/hot_context_hook.ts +74 -7
  356. package/src/scripts/install.ts +40 -89
  357. package/src/scripts/lint_adapter_tier.ts +663 -0
  358. package/src/scripts/lint_archived_skills.ts +93 -0
  359. package/src/scripts/lint_budget_ownership.ts +2 -1
  360. package/src/scripts/lint_deterministic_time.ts +470 -0
  361. package/src/scripts/lint_framework_leakage.ts +5 -0
  362. package/src/scripts/lint_handoffs.ts +525 -1
  363. package/src/scripts/lint_judge_prompt_expectation.ts +155 -0
  364. package/src/scripts/lint_marketplace.ts +88 -0
  365. package/src/scripts/lint_media_policy_linkage.ts +140 -1
  366. package/src/scripts/lint_one_off_age.ts +6 -1
  367. package/src/scripts/lint_override_kernel_guard.ts +87 -5
  368. package/src/scripts/lint_roadmap_complexity.ts +56 -0
  369. package/src/scripts/lint_rule_enforcement_declaration.ts +24 -7
  370. package/src/scripts/lint_rule_norm_pin.ts +321 -0
  371. package/src/scripts/lint_spawn_payload.ts +42 -5
  372. package/src/scripts/lint_symptom_intake.ts +2 -1
  373. package/src/scripts/mcp_parity_smoke.ts +30 -4
  374. package/src/scripts/mcp_render.ts +66 -1
  375. package/src/scripts/mcp_tool_fingerprint.ts +241 -0
  376. package/src/scripts/measure_risk_class_drift.ts +140 -0
  377. package/src/scripts/measure_skill_ranker_baseline.ts +212 -0
  378. package/src/scripts/media/lib/adapter-common.sh +211 -1
  379. package/src/scripts/media/lib/adapter-contract.md +74 -6
  380. package/src/scripts/model_rule_injection.ts +907 -0
  381. package/src/scripts/project_thin_rules.ts +45 -2
  382. package/src/scripts/release.ts +66 -860
  383. package/src/scripts/release_drill.ts +59 -3
  384. package/src/scripts/release_env.ts +298 -0
  385. package/src/scripts/release_publication.ts +720 -0
  386. package/src/scripts/roadmap_context.ts +778 -0
  387. package/src/scripts/schemas/fidelity-measurement-sheet.schema.json +169 -0
  388. package/src/scripts/schemas/rule.schema.json +24 -2
  389. package/src/scripts/schemas/skill.schema.json +39 -0
  390. package/src/scripts/schemas/ui-authority.schema.json +114 -0
  391. package/src/scripts/session_register_hook.ts +29 -3
  392. package/src/scripts/sessions_cli.ts +67 -3
  393. package/src/scripts/skill_tools/score_skill_relevance.ts +36 -53
  394. package/src/scripts/token_sink_report.ts +239 -0
  395. package/src/scripts/trigger_coverage.ts +122 -3
  396. package/src/scripts/update_counts.ts +7 -3
  397. package/src/scripts/validate_frontmatter.ts +66 -0
  398. package/src/server/schemas/settings.ts +5 -0
  399. package/src/shared/skillRanking.ts +183 -0
@@ -91,6 +91,199 @@ aiv_assert_dryrun() {
91
91
  esac
92
92
  }
93
93
 
94
+ # -- Model-capabilities manifests -------------------------------------------
95
+ # Per-model capabilities live in <domain>/lib/model-capabilities/<adapter>.json
96
+ # (schema v2 — see that directory's README). AIV_MODEL_CAPS_DIR overrides the
97
+ # directory: the frame-lock probe and the test suite point the reader at a
98
+ # fixture manifest instead of writing into the tracked one.
99
+ aiv_manifest_path() {
100
+ printf '%s/%s.json' \
101
+ "${AIV_MODEL_CAPS_DIR:-${AIV_LIB_DIR}/model-capabilities}" "${1}"
102
+ }
103
+
104
+ # aiv_warn_unverified <adapter> <model> <manifest> — an entry without a
105
+ # captured smoke trace carries verified:false and must never be trusted
106
+ # silently (model-capabilities/README.md § verified).
107
+ # NB: jq `//` treats false as falsy — the null check is explicit so a
108
+ # present-but-unverified entry is not misreported as absent.
109
+ aiv_warn_unverified() {
110
+ local adapter="${1}" model="${2}" manifest="${3}" verified
111
+ [ -f "${manifest}" ] || return 0
112
+ verified="$(jq -r --arg m "${model}" \
113
+ '.models[$m] | if . == null then "absent" elif .verified == true then "true" else "false" end' \
114
+ "${manifest}" 2>/dev/null || true)"
115
+ case "${verified}" in
116
+ true) : ;;
117
+ absent) printf '%s: model %s not in model-capabilities manifest — capabilities unknown\n' \
118
+ "${adapter}" "${model}" >&2 ;;
119
+ *) printf '%s: model %s capabilities are UNVERIFIED (no smoke trace) — durations/cost are documented-best-effort\n' \
120
+ "${adapter}" "${model}" >&2 ;;
121
+ esac
122
+ }
123
+
124
+ # aiv_assert_frame_coherent <adapter> <model> <manifest> — an entry claiming
125
+ # end_frame:true while start_frame is not true is INCOHERENT: a model that
126
+ # cannot open on a supplied frame cannot close on one either. Refuse the entry
127
+ # rather than hand it to a planner (schema v2, model-capabilities/README.md).
128
+ aiv_assert_frame_coherent() {
129
+ local adapter="${1}" model="${2}" manifest="${3}" bad
130
+ [ -f "${manifest}" ] || return 0
131
+ bad="$(jq -r --arg m "${model}" \
132
+ '.models[$m] // {} | if .end_frame == true and .start_frame != true then "1" else "" end' \
133
+ "${manifest}" 2>/dev/null || true)"
134
+ [ -z "${bad}" ] || aiv_die 3 "${adapter}: model-capabilities entry for ${model} is incoherent — end_frame:true with start_frame not true; a model that cannot open on a supplied frame cannot close on one (see lib/model-capabilities/README.md § Schema v2)"
135
+ }
136
+
137
+ # aiv_manifest_capability <adapter> <default-audio> "$@" — shared
138
+ # manifest-backed `capability`. Without --model it prints the adapter's
139
+ # declared audio flag, byte-identical to the pre-manifest surface. With
140
+ # --model it answers from the manifest and refuses an id the manifest does
141
+ # not carry, rather than returning a default that would read as an answer.
142
+ aiv_manifest_capability() {
143
+ local adapter="${1}" default_audio="${2}"; shift 2
144
+ local model="" manifest
145
+ while [ "$#" -gt 0 ]; do
146
+ case "$1" in
147
+ --model) model="${2:-}"; shift 2 ;;
148
+ *) shift ;;
149
+ esac
150
+ done
151
+ if [ -z "${model}" ]; then
152
+ aiv_capability "${default_audio}"
153
+ return 0
154
+ fi
155
+ aiv_require_cmd jq
156
+ manifest="$(aiv_manifest_path "${adapter}")"
157
+ [ -f "${manifest}" ] || aiv_die 3 "${adapter}: manifest missing: ${manifest}"
158
+ jq -e --arg m "${model}" '.models[$m]' "${manifest}" >/dev/null 2>&1 \
159
+ || aiv_die 7 "${adapter}: model not in manifest: ${model}"
160
+ aiv_assert_frame_coherent "${adapter}" "${model}" "${manifest}"
161
+ aiv_warn_unverified "${adapter}" "${model}" "${manifest}"
162
+ aiv_capability_recheck "${adapter}" "${model}" "${manifest}"
163
+ }
164
+
165
+ # -- Decay markers (recheck_by) ----------------------------------------------
166
+ # A vendor capability is a DATED OBSERVATION, not a permanent fact: endpoints
167
+ # have gained and lost frame conditioning inside weeks, so a manifest entry
168
+ # verified once is evidence about the past presented as the present unless it
169
+ # carries its own expiry. Same idiom as `keep-beta-until` in
170
+ # docs/contracts/skill-bundled-assets.md.
171
+ #
172
+ # The date is DERIVED, never stored twice: the entry's `smoke_trace` id resolves
173
+ # to a row in agents/evidence/ai-video/trace-index.json, whose `captured_at`
174
+ # plus AIV_TRACE_RECHECK_DAYS is the recheck date. One constant, shared with
175
+ # lint_adapter_tier's staleness window and with the `recheck_by` stamp
176
+ # smoke-trace.sh writes into every trace — so a change moves every side or none.
177
+ #
178
+ # Why not read `recheck_by` straight out of the trace: the traces are local-only
179
+ # by a deliberate decision (d7f5d5d3c, reaffirmed by council 2026-08-23) and are
180
+ # absent from every clone. The index is the reviewer-reachable projection, and it
181
+ # carries five fields by design; `captured_at` is one of them and the arithmetic
182
+ # is free, so nothing needs widening.
183
+ AIV_TRACE_INDEX_REL="agents/evidence/ai-video/trace-index.json"
184
+
185
+ # aiv_capability_recheck <adapter> <model> <manifest> — emit the capability JSON
186
+ # with `verified_at` / `recheck_by` appended, and warn on stderr past the date.
187
+ # An entry with no `smoke_trace` gets both as null: unknown, never "fresh".
188
+ aiv_capability_recheck() {
189
+ local adapter="${1}" model="${2}" manifest="${3}"
190
+ local root trace_id index captured recheck days today
191
+
192
+ days="${AIV_TRACE_RECHECK_DAYS:-180}"
193
+ # Walk up for the index rather than counting `..` segments. AIV_LIB_DIR is
194
+ # `src/scripts/<domain>/lib` when an adapter is the entry point and
195
+ # `src/scripts/media/lib` when the common file resolves itself, so a fixed
196
+ # depth is right for one caller and silently wrong for the other — which is
197
+ # exactly how this landed with `verified_at: null` on a traced model the
198
+ # first time.
199
+ index="${AIV_TRACE_INDEX:-}"
200
+ if [ -z "${index}" ]; then
201
+ root="${AIV_LIB_DIR}"
202
+ while [ -n "${root}" ] && [ "${root}" != "/" ]; do
203
+ if [ -f "${root}/${AIV_TRACE_INDEX_REL}" ]; then
204
+ index="${root}/${AIV_TRACE_INDEX_REL}"
205
+ break
206
+ fi
207
+ root="$(dirname "${root}")"
208
+ done
209
+ fi
210
+
211
+ trace_id="$(jq -r --arg m "${model}" '.models[$m].smoke_trace // empty' "${manifest}" 2>/dev/null || true)"
212
+ captured=""
213
+ if [ -n "${trace_id}" ] && [ -f "${index}" ]; then
214
+ captured="$(jq -r --arg t "${trace_id}" 'map(select(.trace_id == $t)) | .[0].captured_at // empty' "${index}" 2>/dev/null || true)"
215
+ fi
216
+
217
+ recheck=""
218
+ if [ -n "${captured}" ]; then
219
+ recheck="$(CAP="${captured}" D="${days}" node -e '
220
+ const iso = process.env.CAP.replace(/T(\d{2})-(\d{2})-(\d{2})Z$/, "T$1:$2:$3Z");
221
+ const t = new Date(iso);
222
+ if (Number.isNaN(t.getTime())) { process.stdout.write(""); process.exit(0); }
223
+ t.setUTCDate(t.getUTCDate() + Number(process.env.D));
224
+ process.stdout.write(t.toISOString().slice(0, 10));
225
+ ' 2>/dev/null || true)"
226
+ fi
227
+
228
+ if [ -n "${recheck}" ]; then
229
+ today="$(date -u +%Y-%m-%d)"
230
+ # String comparison is correct for ISO dates and needs no date parsing.
231
+ if [ "${today}" \> "${recheck}" ]; then
232
+ printf '%s: model %s was verified %s and its recheck-by date %s has PASSED — re-probe before trusting the capability; a vendor may have changed the endpoint since\n' \
233
+ "${adapter}" "${model}" "${captured%T*}" "${recheck}" >&2
234
+ fi
235
+ fi
236
+
237
+ jq --arg m "${model}" \
238
+ --arg va "${captured%T*}" --arg rb "${recheck}" \
239
+ '.models[$m]
240
+ | {audio: (if .audio_sync then "native" else "none" end), model: $m}
241
+ + .
242
+ + {verified_at: (if $va == "" then null else $va end),
243
+ recheck_by: (if $rb == "" then null else $rb end)}' \
244
+ "${manifest}"
245
+ }
246
+
247
+ # -- end_image gate (adapter-contract.md § end_image) ------------------------
248
+ # `end_image` asks the provider to CLOSE the clip on a supplied frame. An
249
+ # adapter may honour it only when the submitted model's manifest entry answers
250
+ # end_frame:true; `null` means unknown, and unknown is never treated as true.
251
+ # Refusal over silent downgrade: dropping the image renders something the
252
+ # caller did not ask for and bills for it — the same register stitch.sh uses
253
+ # when it refuses --crossfade instead of quietly hard-cutting.
254
+ AIV_EXIT_END_FRAME_UNSUPPORTED=12
255
+
256
+ # aiv_assert_end_frame_supported <adapter> <stdin-json> — no-op unless stdin
257
+ # carries a non-null end_image; otherwise refuse with exit 12 naming the model
258
+ # and the field. Model resolution is deliberately conservative (stdin
259
+ # model_id, else AIV_MODEL): an unresolvable model is an unproven capability,
260
+ # and unproven refuses.
261
+ aiv_assert_end_frame_supported() {
262
+ local adapter="${1}" stdin_json="${2}" model manifest end_frame
263
+ command -v jq >/dev/null 2>&1 || return 0
264
+ printf '%s' "${stdin_json}" \
265
+ | jq -e 'type == "object" and has("end_image") and (.end_image != null)' \
266
+ >/dev/null 2>&1 || return 0
267
+
268
+ model="$(printf '%s' "${stdin_json}" | jq -r '.model_id // empty' 2>/dev/null || true)"
269
+ [ -n "${model}" ] || model="${AIV_MODEL:-}"
270
+ [ -n "${model}" ] || model="<unresolved>"
271
+ manifest="$(aiv_manifest_path "${adapter}")"
272
+
273
+ end_frame="null"
274
+ if [ -f "${manifest}" ]; then
275
+ end_frame="$(jq -r --arg m "${model}" \
276
+ '.models[$m] // {} | .end_frame | if . == null then "null" else tostring end' \
277
+ "${manifest}" 2>/dev/null || printf 'null')"
278
+ fi
279
+ if [ "${end_frame}" = "true" ]; then
280
+ aiv_assert_frame_coherent "${adapter}" "${model}" "${manifest}"
281
+ return 0
282
+ fi
283
+ aiv_die "${AIV_EXIT_END_FRAME_UNSUPPORTED}" \
284
+ "${adapter}: end_image submitted for model ${model}, whose model-capabilities entry answers end_frame=${end_frame} (null means unknown, and unknown is never treated as true). The image is refused, never dropped — re-submit without end_image, choose a model whose end_frame is a probed true, or probe this one. See media/lib/adapter-contract.md § end_image."
285
+ }
286
+
94
287
  # -- Trust boundary (adapter-contract.md v2) --------------------------------
95
288
  # Provider-returned artifact paths and downloads are UNTRUSTED input. The
96
289
  # three helpers below are the enforcement surface the live submit/poll/fetch
@@ -234,7 +427,24 @@ aiv_dispatch() {
234
427
  dry-run)
235
428
  aiv_emit_dry_run "${adapter}"
236
429
  ;;
237
- submit|poll|fetch|run)
430
+ submit|run)
431
+ # These two are the only subcommands that consume the contract stdin, so
432
+ # they are the only ones the end_image gate can read. A here-string (not
433
+ # a pipe) re-feeds the bytes: a pipe would run the dispatcher in a
434
+ # subshell and, for an adapter that exits without draining stdin, turn a
435
+ # clean EPIPE into the pipeline's exit code. Skipped on a tty, where
436
+ # there is nothing to read and today's behaviour is an immediate refusal
437
+ # rather than a block.
438
+ if [ -t 0 ]; then
439
+ _aiv_dispatch_timed "${adapter}" "${sub}" "$@"
440
+ else
441
+ local _aiv_stdin
442
+ _aiv_stdin="$(cat)"
443
+ aiv_assert_end_frame_supported "${adapter}" "${_aiv_stdin}"
444
+ _aiv_dispatch_timed "${adapter}" "${sub}" "$@" <<< "${_aiv_stdin}"
445
+ fi
446
+ ;;
447
+ poll|fetch)
238
448
  _aiv_dispatch_timed "${adapter}" "${sub}" "$@"
239
449
  ;;
240
450
  "")
@@ -103,6 +103,7 @@ the same stdout shape on stdout and an exit code on completion.
103
103
  "mood": "..."
104
104
  },
105
105
  "ref_images": ["/abs/path/frame.png", "..."],
106
+ "end_image": "/abs/path/last-frame.png",
106
107
  "duration": 4.5,
107
108
  "aspect": "16:9",
108
109
  "seed": 1234567,
@@ -116,9 +117,45 @@ the same stdout shape on stdout and an exit code on completion.
116
117
  }
117
118
  ```
118
119
 
119
- `ref_images`, `duration`, `aspect`, `seed`, `audio`, `negative` are
120
- optional. `prompt.*` blocks are mandatory. Unknown top-level keys
121
- are logged to stderr and ignored.
120
+ `ref_images`, `end_image`, `duration`, `aspect`, `seed`, `audio`,
121
+ `negative` are optional. `prompt.*` blocks are mandatory. Unknown
122
+ top-level keys are logged to stderr and ignored.
123
+
124
+ <a id="end_image"></a>
125
+
126
+ ### `end_image` — closing frame (additive, v2)
127
+
128
+ `ref_images[0]` is the frame a clip **opens** on. `end_image` is the frame it
129
+ **closes** on — the input a connector clip needs to land exactly on the next
130
+ clip's first frame instead of near it.
131
+
132
+ ```
133
+ NO ADAPTER DROPS AN end_image IT CANNOT HONOUR.
134
+ ```
135
+
136
+ An adapter may honour `end_image` only when the submitted model's
137
+ `model-capabilities` entry answers `end_frame: true`. `false` and `null` both
138
+ refuse, because `null` means *unknown* and unknown is never treated as `true`;
139
+ a model the manifest does not carry at all refuses on the same ground. The
140
+ refusal is **exit 12**, and its message names the model and the field.
141
+
142
+ Enforcement is one shared helper, `aiv_assert_end_frame_supported` in
143
+ `scripts/media/lib/adapter-common.sh`, called by `aiv_dispatch` on the two
144
+ subcommands that consume this stdin (`submit`, `run`) — so every adapter
145
+ refuses identically and none re-implements the rule. Two consequences worth
146
+ stating plainly:
147
+
148
+ - The gate runs **before** `aiv_assert_dryrun`, so a caller in the default
149
+ dry-run mode is told the truth instead of receiving a fixture that reads as
150
+ success. An invalid request is invalid in both modes, and no spend is
151
+ involved in saying so.
152
+ - The `dry-run` subcommand is **not** gated, because it consumes no stdin at
153
+ all — it returns a committed fixture and ignores `duration`, `aspect` and
154
+ every other input alike. It is a fixture echo, not a render preview.
155
+
156
+ Refusal over silent downgrade is the register this contract already uses:
157
+ `scripts/ai-video/stitch.sh` refuses `--crossfade` rather than quietly hard-
158
+ cutting, for the same reason.
122
159
 
123
160
  ### `model_id` — multiplexer model selection (additive, v2)
124
161
 
@@ -136,9 +173,13 @@ Single-model adapters ignore it (unknown-key rule above). Rules:
136
173
  (`<model_id>::<request_id>`) and re-validates both segments on every
137
174
  poll/fetch.
138
175
  - Per-model capabilities (`min_duration`, `max_duration`, `audio_sync`,
139
- `aspect`, modeled cost) live in
140
- `scripts/ai-video/lib/model-capabilities/<adapter>.json` and are
141
- surfaced via `capability --model <id>`. Entries are
176
+ `aspect`, modeled cost, and the `start_frame` / `end_frame` /
177
+ `frame_lock` continuity answers) live in
178
+ `scripts/ai-video/lib/model-capabilities/<adapter>.json` (schema v2 —
179
+ see that directory's README) and are surfaced via
180
+ `capability --model <id>`. A direct adapter with more than one model, or
181
+ with per-model bounds, carries a manifest too; it selects via the XML
182
+ `<default-model>` rather than via `model_id`. Entries are
142
183
  `verified: false` until a real smoke trace exists for that model —
143
184
  consumers must surface the flag, never trust the numbers silently.
144
185
 
@@ -277,6 +318,33 @@ authorize auto-retry either; the orchestrator surfaces a single
277
318
  numbered-options block (retry · regenerate prompt · skip · abort)
278
319
  per `non-destructive-by-default` and waits.
279
320
 
321
+ ### Exit codes
322
+
323
+ Every adapter exits through `aiv_die <code> <message>`. The codes below are
324
+ the whole live set, read out of `scripts/media/lib/adapter-common.sh` and
325
+ `scripts/ai-video/adapters/*.sh`; a new refusal takes the next free number and
326
+ lands in this table in the same change.
327
+
328
+ | Code | Meaning | Raised by |
329
+ |---|---|---|
330
+ | `2` | Usage error, bad argument, or a flag the script refuses rather than downgrades | argv parsing · `stitch.sh --crossfade` |
331
+ | `3` | Missing dependency, missing fixture, or an unusable / incoherent manifest | `aiv_require_cmd` · `aiv_emit_dry_run` · `aiv_assert_frame_coherent` |
332
+ | `4` | Live call refused — `AIV_DRYRUN` is not `false` | `aiv_assert_dryrun` |
333
+ | `5` | Live subcommand not wired (scaffold tier — dry-run only) | `_aiv_dispatch_timed` |
334
+ | `6` | Provider unusable — `<enabled>false</enabled>`, missing key, sandbox refusal | `aiv_provider_enabled` · key checks |
335
+ | `7` | Bad or missing input — illegal or absent `model_id`, missing `ref_images[0]`, a local path where https is required, a missing clip | adapters · `stitch.sh` |
336
+ | `8` | Provider or tool failure — non-2xx HTTP, upload failure, `ffmpeg` failure | adapters · `stitch.sh` |
337
+ | `10` | Artifact-path validation violation (trust boundary) | `aiv_validate_artifact_path` |
338
+ | `11` | Download failed or exceeded the size cap | `aiv_fetch_url` |
339
+ | `12` | `end_image` submitted for a model whose `end_frame` is not a probed `true` — refusal over silent downgrade, never dropped | `aiv_assert_end_frame_supported` |
340
+ | `13` | the calibration probe measured a charge more than the tolerance above the modeled `cost_per_second_usd` — a halt for a human before the batch, never a failure | `lib/calibrate-cost.sh` |
341
+ | `75` | Transient inference failure — the caller MAY retry once or fall back | local engines |
342
+
343
+ `1` is unused (it is the shell's own catch-all). `9` is **retired**: it meant
344
+ "live subcommand not yet wired" until ADR-056 disposed of the five unvalidated
345
+ video adapters and `5` took that role — it is left vacant rather than recycled,
346
+ so an `exit_code: 9` in an archived `error.json` keeps its original meaning.
347
+
280
348
  ## Dry-run
281
349
 
282
350
  `AIV_DRYRUN=true` (set by command default; see Phase 5 Step 6) OR