@event4u/agent-config 14.9.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 (426) 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 +384 -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/async-python-patterns/SKILL.md +1 -1
  45. package/dist/agent-src/skills/authz-review/SKILL.md +0 -1
  46. package/dist/agent-src/skills/blast-radius-analyzer/SKILL.md +32 -0
  47. package/dist/agent-src/skills/brand/SKILL.md +3 -0
  48. package/dist/agent-src/skills/brand-asset-generation/SKILL.md +3 -0
  49. package/dist/agent-src/skills/brand-audit/SKILL.md +3 -0
  50. package/dist/agent-src/skills/brand-identity/SKILL.md +3 -0
  51. package/dist/agent-src/skills/brand-strategy/SKILL.md +3 -0
  52. package/dist/agent-src/skills/brand-to-tokens/SKILL.md +3 -0
  53. package/dist/agent-src/skills/check-refs/SKILL.md +3 -0
  54. package/dist/agent-src/skills/code-refactoring/SKILL.md +1 -1
  55. package/dist/agent-src/skills/code-review/SKILL.md +11 -0
  56. package/dist/agent-src/skills/command-routing/SKILL.md +6 -0
  57. package/dist/agent-src/skills/condense-memory/SKILL.md +4 -1
  58. package/dist/agent-src/skills/context-authoring/SKILL.md +1 -1
  59. package/dist/agent-src/skills/conventional-commits-writing/SKILL.md +4 -1
  60. package/dist/agent-src/skills/copilot-agents-optimization/SKILL.md +10 -0
  61. package/dist/agent-src/skills/corpus-grounding/SKILL.md +3 -0
  62. package/dist/agent-src/skills/design-intelligence/SKILL.md +3 -0
  63. package/dist/agent-src/skills/design-intelligence/data/landing.csv +36 -35
  64. package/dist/agent-src/skills/design-intelligence/data/stacks/threejs.csv +1 -0
  65. package/dist/agent-src/skills/design-review/SKILL.md +80 -2
  66. package/dist/agent-src/skills/design-review/references/verification-automation.md +41 -0
  67. package/dist/agent-src/skills/design-system-capture/SKILL.md +35 -40
  68. package/dist/agent-src/skills/design-system-capture/references/import-procedure.md +50 -0
  69. package/dist/agent-src/skills/design-tokens/SKILL.md +3 -0
  70. package/dist/agent-src/skills/design-variations/SKILL.md +3 -0
  71. package/dist/agent-src/skills/developer-like-execution/SKILL.md +3 -0
  72. package/dist/agent-src/skills/discovery-interview/SKILL.md +1 -1
  73. package/dist/agent-src/skills/doc-coauthoring/SKILL.md +1 -1
  74. package/dist/agent-src/skills/docx-authoring/SKILL.md +1 -1
  75. package/dist/agent-src/skills/editorial-calendar/SKILL.md +1 -1
  76. package/dist/agent-src/skills/estimate-ticket/SKILL.md +3 -0
  77. package/dist/agent-src/skills/existing-ui-audit/SKILL.md +20 -3
  78. package/dist/agent-src/skills/fe-design/SKILL.md +74 -41
  79. package/dist/agent-src/skills/fe-design/evals/triggers.json +65 -53
  80. package/dist/agent-src/skills/fe-design/references/craft-floor.md +52 -0
  81. package/dist/agent-src/skills/fe-design/references/source-led-port.md +36 -0
  82. package/dist/agent-src/skills/file-editor/SKILL.md +5 -0
  83. package/dist/agent-src/skills/finishing-a-development-branch/SKILL.md +2 -2
  84. package/dist/agent-src/skills/git-workflow/SKILL.md +3 -0
  85. package/dist/agent-src/skills/github-ci/SKILL.md +1 -1
  86. package/dist/agent-src/skills/html-deck/SKILL.md +3 -0
  87. package/dist/agent-src/skills/iconography/SKILL.md +3 -0
  88. package/dist/agent-src/skills/image-editing/SKILL.md +3 -0
  89. package/dist/agent-src/skills/image-generation/SKILL.md +3 -0
  90. package/dist/agent-src/skills/image-provider-routing/SKILL.md +3 -0
  91. package/dist/agent-src/skills/incident-commander/SKILL.md +10 -0
  92. package/dist/agent-src/skills/js-library-packaging/SKILL.md +173 -0
  93. package/dist/agent-src/skills/js-library-packaging/evals/triggers.json +17 -0
  94. package/dist/agent-src/skills/js-library-packaging/scripts/check_package_surface.ts +270 -0
  95. package/dist/agent-src/skills/judge-artifact-completeness/SKILL.md +1 -1
  96. package/dist/agent-src/skills/judge-injection-defense/SKILL.md +1 -1
  97. package/dist/agent-src/skills/laravel-migration/SKILL.md +3 -0
  98. package/dist/agent-src/skills/laravel-validation/SKILL.md +1 -1
  99. package/dist/agent-src/skills/learning-to-rule-or-skill/SKILL.md +3 -0
  100. package/dist/agent-src/skills/legal-intake-triage/SKILL.md +1 -1
  101. package/dist/agent-src/skills/legal-practice-profile/SKILL.md +1 -1
  102. package/dist/agent-src/skills/lint-skills/SKILL.md +3 -0
  103. package/dist/agent-src/skills/llm-provider-knowledge/SKILL.md +3 -0
  104. package/dist/agent-src/skills/logging-monitoring/SKILL.md +234 -51
  105. package/dist/agent-src/skills/logo-generation/SKILL.md +3 -0
  106. package/dist/agent-src/skills/md-language-check/SKILL.md +3 -0
  107. package/dist/agent-src/skills/messaging-architecture/SKILL.md +1 -1
  108. package/dist/agent-src/skills/migration-architect/SKILL.md +1 -1
  109. package/dist/agent-src/skills/module-detect-on-the-fly/SKILL.md +1 -1
  110. package/dist/agent-src/skills/module-management/SKILL.md +1 -1
  111. package/dist/agent-src/skills/monorepo-workspace/SKILL.md +149 -0
  112. package/dist/agent-src/skills/monorepo-workspace/evals/triggers.json +17 -0
  113. package/dist/agent-src/skills/motion-choreographer/SKILL.md +7 -1
  114. package/dist/agent-src/skills/multi-tenancy/SKILL.md +4 -0
  115. package/dist/agent-src/skills/onboarding-program/SKILL.md +1 -1
  116. package/dist/agent-src/skills/operational-readiness/SKILL.md +184 -0
  117. package/dist/agent-src/skills/operational-readiness/evals/triggers.json +17 -0
  118. package/dist/agent-src/skills/override-management/SKILL.md +3 -0
  119. package/dist/agent-src/skills/perf-feedback-craft/SKILL.md +1 -1
  120. package/dist/agent-src/skills/persona-improvement/SKILL.md +3 -0
  121. package/dist/agent-src/skills/pest-testing/SKILL.md +3 -0
  122. package/dist/agent-src/skills/playbook-authoring/SKILL.md +162 -0
  123. package/dist/agent-src/skills/playwright-testing/SKILL.md +3 -0
  124. package/dist/agent-src/skills/privacy-review/SKILL.md +3 -0
  125. package/dist/agent-src/skills/prompt-engineering-image/SKILL.md +3 -0
  126. package/dist/agent-src/skills/prompt-optimizer/SKILL.md +1 -1
  127. package/dist/agent-src/skills/quality-tools/SKILL.md +5 -0
  128. package/dist/agent-src/skills/react-shadcn-ui/SKILL.md +52 -21
  129. package/dist/agent-src/skills/readme-reviewer/SKILL.md +3 -0
  130. package/dist/agent-src/skills/readme-writing/SKILL.md +3 -0
  131. package/dist/agent-src/skills/readme-writing-package/SKILL.md +3 -0
  132. package/dist/agent-src/skills/receiving-code-review/SKILL.md +3 -3
  133. package/dist/agent-src/skills/refine-prompt/SKILL.md +3 -0
  134. package/dist/agent-src/skills/refine-ticket/SKILL.md +3 -0
  135. package/dist/agent-src/skills/requesting-code-review/SKILL.md +2 -2
  136. package/dist/agent-src/skills/review-routing/SKILL.md +2 -2
  137. package/dist/agent-src/skills/roadmap-writing/SKILL.md +23 -41
  138. package/dist/agent-src/skills/roadmap-writing/references/follow-up-roadmap-shape.md +47 -0
  139. package/dist/agent-src/skills/rtk-output-filtering/SKILL.md +22 -6
  140. package/dist/agent-src/skills/runway-cognition/SKILL.md +3 -0
  141. package/dist/agent-src/skills/scene-expander/SKILL.md +1 -1
  142. package/dist/agent-src/skills/scene-expander/scene-blueprint.schema.yaml +26 -0
  143. package/dist/agent-src/skills/secrets-management/SKILL.md +5 -1
  144. package/dist/agent-src/skills/server-hardening/SKILL.md +159 -0
  145. package/dist/agent-src/skills/server-hardening/evals/triggers.json +17 -0
  146. package/dist/agent-src/skills/skill-improvement-pipeline/SKILL.md +3 -0
  147. package/dist/agent-src/skills/skill-management/SKILL.md +3 -0
  148. package/dist/agent-src/skills/skill-reviewer/SKILL.md +3 -0
  149. package/dist/agent-src/skills/skill-writing/SKILL.md +6 -0
  150. package/dist/agent-src/skills/spreadsheet-authoring/SKILL.md +3 -0
  151. package/dist/agent-src/skills/storybook-workshop/SKILL.md +194 -0
  152. package/dist/agent-src/skills/storybook-workshop/evals/triggers.json +17 -0
  153. package/dist/agent-src/skills/storybook-workshop/scripts/story_contrast_floor.ts +134 -0
  154. package/dist/agent-src/skills/subagent-orchestration/SKILL.md +1 -1
  155. package/dist/agent-src/skills/subagent-orchestration/prompts/README.md +25 -0
  156. package/dist/agent-src/skills/supply-chain-intake/SKILL.md +12 -0
  157. package/dist/agent-src/skills/systematic-debugging/SKILL.md +1 -1
  158. package/dist/agent-src/skills/terraform/SKILL.md +3 -0
  159. package/dist/agent-src/skills/test-driven-development/SKILL.md +1 -1
  160. package/dist/agent-src/skills/threat-modeling/SKILL.md +0 -3
  161. package/dist/agent-src/skills/token-optimizer/SKILL.md +3 -0
  162. package/dist/agent-src/skills/typography-system/SKILL.md +3 -0
  163. package/dist/agent-src/skills/ui-component-architect/SKILL.md +9 -1
  164. package/dist/agent-src/skills/upstream-contribute/SKILL.md +3 -0
  165. package/dist/agent-src/skills/using-git-worktrees/SKILL.md +1 -1
  166. package/dist/agent-src/skills/validate-feature-fit/SKILL.md +3 -0
  167. package/dist/agent-src/skills/verify-completion-evidence/SKILL.md +2 -2
  168. package/dist/agent-src/skills/wireframe/SKILL.md +3 -0
  169. package/dist/agent-src/skills/wireframe/references/story-beat-ledger.schema.json +115 -0
  170. package/dist/agent-src/skills/workspace-link/SKILL.md +131 -0
  171. package/dist/agent-src/skills/workspace-link/evals/triggers.json +17 -0
  172. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  173. package/dist/agent-src/templates/playbook.md +75 -0
  174. package/dist/agent-src/templates/roadmaps.md +37 -0
  175. package/dist/agent-src/templates/scripts/check_playbook_invokes.ts +231 -0
  176. package/dist/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +24 -0
  177. package/dist/agent-src/templates/scripts/work_engine/directives/ui/polish.ts +2 -0
  178. package/dist/agent-src/templates/scripts/work_engine/directives/ui/review.ts +216 -0
  179. package/dist/agent-src/templates/scripts/work_engine/directives/ui/scaffold.ts +159 -0
  180. package/dist/agent-src/templates/scripts/work_engine/directives/ui/stack_bundles.ts +73 -4
  181. package/dist/agent-src/templates/scripts/work_engine/stack/detect.ts +325 -40
  182. package/dist/cli/commands/uiAudit.js +221 -0
  183. package/dist/cli/commands/uiAudit.js.map +1 -0
  184. package/dist/cli/commands/uiRender.js +206 -0
  185. package/dist/cli/commands/uiRender.js.map +1 -0
  186. package/dist/cli/main.js +22 -1
  187. package/dist/cli/main.js.map +1 -1
  188. package/dist/cli/mcp/content.js +64 -1
  189. package/dist/cli/mcp/content.js.map +1 -1
  190. package/dist/cli/mcp/dispatch.js +175 -10
  191. package/dist/cli/mcp/dispatch.js.map +1 -1
  192. package/dist/cli/registry.js +3 -0
  193. package/dist/cli/registry.js.map +1 -1
  194. package/dist/cli-delegate/{chunk-H4VIVD4C.js → chunk-236PNQZK.js} +413 -391
  195. package/dist/cli-delegate/{chunk-G23AT6GD.js → chunk-DMSZHXZS.js} +57 -1
  196. package/dist/cli-delegate/{chunk-77GR3VD4.js → chunk-FF7WAFMR.js} +58 -3
  197. package/dist/cli-delegate/{chunk-PLSG6UL5.js → chunk-K4FFODTS.js} +341 -204
  198. package/dist/cli-delegate/{chunk-YM4GZDJG.js → chunk-L43NCYPB.js} +5 -0
  199. package/dist/cli-delegate/{chunk-B2ERU2VA.js → chunk-WOKWX5PL.js} +1 -1
  200. package/dist/cli-delegate/cmd_brand_status.js +8 -6
  201. package/dist/cli-delegate/cmd_conformance.js +3 -3
  202. package/dist/cli-delegate/cmd_doctor.js +3 -3
  203. package/dist/cli-delegate/cmd_export.js +4 -4
  204. package/dist/cli-delegate/cmd_handoff.js +1 -1
  205. package/dist/cli-delegate/cmd_preflight.js +2 -2
  206. package/dist/cli-delegate/cmd_prune.js +4 -4
  207. package/dist/cli-delegate/cmd_session_recycle.js +70 -9
  208. package/dist/cli-delegate/cmd_settings_migrate.js +4 -4
  209. package/dist/cli-delegate/cmd_settings_set.js +1 -1
  210. package/dist/cli-delegate/cmd_sync.js +4 -4
  211. package/dist/cli-delegate/cmd_uninstall.js +4 -4
  212. package/dist/cli-delegate/cmd_validate.js +4 -4
  213. package/dist/discovery/deprecation-report.md +1 -1
  214. package/dist/discovery/discovery-manifest.json +380 -145
  215. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  216. package/dist/discovery/discovery-manifest.summary.md +4 -4
  217. package/dist/discovery/dormancy-report.md +1 -1
  218. package/dist/discovery/orphan-report.md +1 -1
  219. package/dist/discovery/packs.json +18 -8
  220. package/dist/discovery/trust-report.md +3 -3
  221. package/dist/discovery/workspaces.json +16 -6
  222. package/dist/hooks/dispatch.js +2337 -1436
  223. package/dist/install/install.mjs +795 -708
  224. package/dist/mcp/registry-manifest.json +3 -3
  225. package/dist/mcp/server.json +2 -2
  226. package/dist/mcp/server.mjs +1685 -1250
  227. package/dist/router.json +1 -1
  228. package/dist/scripts/_lib/lean_projection_mode.js +40 -0
  229. package/dist/scripts/_lib/lean_projection_mode.js.map +1 -0
  230. package/dist/scripts/_lib/scoped_projection.js +84 -0
  231. package/dist/scripts/_lib/scoped_projection.js.map +1 -1
  232. package/dist/scripts/_lib/ui_surface.js +89 -0
  233. package/dist/scripts/_lib/ui_surface.js.map +1 -0
  234. package/dist/scripts/condense.js +6 -10
  235. package/dist/scripts/condense.js.map +1 -1
  236. package/dist/scripts/project_thin_rules.js +40 -2
  237. package/dist/scripts/project_thin_rules.js.map +1 -1
  238. package/dist/server/schemas/settings.js +3 -0
  239. package/dist/server/schemas/settings.js.map +1 -1
  240. package/dist/shared/skillRanking.js +159 -0
  241. package/dist/shared/skillRanking.js.map +1 -0
  242. package/docs/contracts/provider-lifecycle.md +47 -18
  243. package/docs/contracts/settings-classes.md +14 -4
  244. package/docs/guidelines/agent-infra/context-hygiene-mechanics.md +49 -0
  245. package/docs/guidelines/agent-infra/evaluator-independence-mechanics.md +92 -0
  246. package/docs/guidelines/agent-infra/minimal-safe-diff-mechanics.md +45 -1
  247. package/docs/guidelines/agent-infra/roadmap-deferred-resolution-provenance.md +54 -0
  248. package/docs/guidelines/design-antipatterns.md +4 -2
  249. package/docs/guidelines/design-asset-discipline.md +38 -0
  250. package/docs/guidelines/design-fidelity-mechanics.md +45 -29
  251. package/docs/guidelines/design-handover-extraction.md +35 -5
  252. package/docs/guidelines/design-modes.md +41 -1
  253. package/docs/guidelines/monorepo-antipatterns.md +141 -0
  254. package/llms.txt +50 -39
  255. package/package.json +1 -1
  256. package/src/agent-src/templates/scripts/check_playbook_invokes.ts +231 -0
  257. package/src/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +24 -0
  258. package/src/agent-src/templates/scripts/work_engine/directives/ui/polish.ts +2 -0
  259. package/src/agent-src/templates/scripts/work_engine/directives/ui/review.ts +216 -0
  260. package/src/agent-src/templates/scripts/work_engine/directives/ui/scaffold.ts +159 -0
  261. package/src/agent-src/templates/scripts/work_engine/directives/ui/stack_bundles.ts +73 -4
  262. package/src/agent-src/templates/scripts/work_engine/stack/detect.ts +325 -40
  263. package/src/config/agent-settings.template.yml +28 -0
  264. package/src/config/assurance-capability-registry.json +223 -0
  265. package/src/config/assurance-threshold-budget.json +65 -0
  266. package/src/config/ci-local-parity.yml +14 -0
  267. package/src/config/discovery/unassigned-artefacts.yml +2 -0
  268. package/src/config/dispatch-economy-metrics.json +4 -2
  269. package/src/config/evaluator-budgets.json +14 -14
  270. package/src/config/gate-coverage.yml +227 -8
  271. package/src/config/gate-violation-baselines.json +76 -72
  272. package/src/config/hook-latency-budget.json +1 -0
  273. package/src/config/hook-token-budget.json +137 -125
  274. package/src/config/pack-size-budget.json +4 -2
  275. package/src/config/preamble-payload-budget.json +71 -67
  276. package/src/config/quorum-attendance-budget.json +12 -4
  277. package/src/config/rule-activation-census.json +7 -3
  278. package/src/config/rule-enforcement-baseline.json +0 -1
  279. package/src/config/rule-stub-ceilings.json +112 -91
  280. package/src/scripts/_cli/cmd_doctor.ts +15 -16
  281. package/src/scripts/_cli/doctor_install_mode.ts +49 -0
  282. package/src/scripts/_cli/doctor_overrides.ts +154 -0
  283. package/src/scripts/_dispatch.bash +17 -0
  284. package/src/scripts/_lib/as_of.ts +412 -0
  285. package/src/scripts/_lib/exec_evidence.ts +7 -0
  286. package/src/scripts/_lib/hook_settings.ts +33 -0
  287. package/src/scripts/_lib/host_listing_model.ts +192 -0
  288. package/src/scripts/_lib/lean_projection_mode.ts +44 -0
  289. package/src/scripts/_lib/mcp_bridge.ts +199 -0
  290. package/src/scripts/_lib/review_independence.ts +62 -10
  291. package/src/scripts/_lib/rule_injection.ts +239 -0
  292. package/src/scripts/_lib/run_checkpoint.ts +54 -1
  293. package/src/scripts/_lib/scoped_projection.ts +96 -0
  294. package/src/scripts/_lib/session_register.ts +44 -2
  295. package/src/scripts/_lib/skill_catalogue.ts +38 -2
  296. package/src/scripts/_lib/transcript_reads.ts +207 -0
  297. package/src/scripts/_lib/ui_authority.test.ts +251 -0
  298. package/src/scripts/_lib/ui_authority.ts +343 -0
  299. package/src/scripts/ai-video/adapters/fal.sh +8 -3
  300. package/src/scripts/ai-video/adapters/gemini-veo.sh +10 -0
  301. package/src/scripts/ai-video/adapters/higgsfield.sh +10 -2
  302. package/src/scripts/ai-video/adapters/kling.sh +10 -0
  303. package/src/scripts/ai-video/adapters/sora.sh +10 -0
  304. package/src/scripts/ai-video/lib/calibrate-cost.sh +145 -0
  305. package/src/scripts/ai-video/lib/model-capabilities/README.md +53 -7
  306. package/src/scripts/ai-video/lib/model-capabilities/comfyui.json +15 -3
  307. package/src/scripts/ai-video/lib/model-capabilities/fal.json +36 -6
  308. package/src/scripts/ai-video/lib/model-capabilities/gemini-veo.json +23 -0
  309. package/src/scripts/ai-video/lib/model-capabilities/higgsfield.json +23 -0
  310. package/src/scripts/ai-video/lib/model-capabilities/kling.json +23 -0
  311. package/src/scripts/ai-video/lib/model-capabilities/musetalk.json +8 -2
  312. package/src/scripts/ai-video/lib/model-capabilities/replicate.json +36 -6
  313. package/src/scripts/ai-video/lib/model-capabilities/sora.json +45 -0
  314. package/src/scripts/ai-video/lib/model-capabilities/syncso.json +8 -2
  315. package/src/scripts/ai-video/lib/parse-blueprint.sh +52 -5
  316. package/src/scripts/ai-video/lib/resume-scan.sh +92 -3
  317. package/src/scripts/ai-video/lib/seam-plan.sh +212 -0
  318. package/src/scripts/ai-video/smoke-trace.sh +450 -2
  319. package/src/scripts/ai-video/stitch.sh +191 -10
  320. package/src/scripts/ai-video/test-pipeline.sh +84 -6
  321. package/src/scripts/ai_council/cli_agency_bounds.ts +139 -0
  322. package/src/scripts/ai_council/cli_least_agency_canary.ts +347 -0
  323. package/src/scripts/ai_council/clients.ts +3 -2
  324. package/src/scripts/ai_council/consensus.ts +63 -6
  325. package/src/scripts/ai_council/events_log.ts +46 -1
  326. package/src/scripts/ai_council/orchestrator.ts +103 -108
  327. package/src/scripts/ai_council/orchestrator_results.ts +166 -0
  328. package/src/scripts/ai_council/prompts.ts +12 -5
  329. package/src/scripts/ai_council/quorum.ts +82 -1
  330. package/src/scripts/ai_council/quorum_wiring.ts +82 -5
  331. package/src/scripts/ai_council/seating.ts +211 -0
  332. package/src/scripts/ai_council/stance_tally.ts +22 -0
  333. package/src/scripts/bench_hook_latency.ts +62 -0
  334. package/src/scripts/build_proof.ts +12 -1
  335. package/src/scripts/capture_skill_catalogue.ts +21 -0
  336. package/src/scripts/check_always_budget.ts +2 -1
  337. package/src/scripts/check_augmentignore.ts +2 -1
  338. package/src/scripts/check_beta_review_markers.ts +2 -1
  339. package/src/scripts/check_composite_arming.ts +364 -0
  340. package/src/scripts/check_corpus_staleness.ts +2 -1
  341. package/src/scripts/check_council_pin_staleness.ts +3 -1
  342. package/src/scripts/check_enforcement_coverage.ts +116 -3
  343. package/src/scripts/check_enforcement_denominator.ts +365 -0
  344. package/src/scripts/check_gate_coverage.ts +2 -1
  345. package/src/scripts/check_hook_bundle_freshness.ts +13 -1
  346. package/src/scripts/check_knowledge_cards.ts +2 -1
  347. package/src/scripts/check_knowledge_pages.ts +3 -2
  348. package/src/scripts/check_memory.ts +2 -1
  349. package/src/scripts/check_no_automerge_key.ts +287 -0
  350. package/src/scripts/check_pack_conformance_fixture.ts +565 -0
  351. package/src/scripts/check_pack_passport_reconciliation.ts +274 -0
  352. package/src/scripts/check_proposal.ts +2 -1
  353. package/src/scripts/check_reach_staleness.ts +2 -1
  354. package/src/scripts/check_release_adjacent_health.ts +2 -1
  355. package/src/scripts/check_release_pr_shape.ts +5 -0
  356. package/src/scripts/check_review_schema.ts +34 -1
  357. package/src/scripts/check_roadmap_trackable.ts +48 -3
  358. package/src/scripts/check_source_size_budget.ts +2 -1
  359. package/src/scripts/check_standing_payload_delta.ts +505 -0
  360. package/src/scripts/check_trigger_evals.ts +2 -1
  361. package/src/scripts/classify_change_risk.ts +281 -0
  362. package/src/scripts/compute_skill_tiers.ts +186 -0
  363. package/src/scripts/condense.ts +8 -13
  364. package/src/scripts/council_attendance_metrics.ts +183 -0
  365. package/src/scripts/council_cli.ts +10 -8
  366. package/src/scripts/council_parse_rate.ts +116 -0
  367. package/src/scripts/derive_playbooks.ts +406 -0
  368. package/src/scripts/design_slop_rules.test.ts +7 -0
  369. package/src/scripts/design_slop_rules.ts +56 -2
  370. package/src/scripts/dispatch_r2_reviewer.ts +16 -0
  371. package/src/scripts/frontend_corpus_hash.ts +116 -0
  372. package/src/scripts/generate_pack_manifests.ts +78 -0
  373. package/src/scripts/grade_target_readiness.ts +478 -0
  374. package/src/scripts/hook_manifest.json +1 -1
  375. package/src/scripts/hook_manifest.yaml +97 -16
  376. package/src/scripts/hooks/concern_registry.ts +4 -0
  377. package/src/scripts/hooks/design_pass_hook.ts +356 -0
  378. package/src/scripts/hooks/rtk_wrap_hook.ts +30 -7
  379. package/src/scripts/hooks/rule_inject_hook.ts +318 -0
  380. package/src/scripts/hot_context_hook.ts +74 -7
  381. package/src/scripts/install.ts +40 -89
  382. package/src/scripts/lint_adapter_tier.ts +663 -0
  383. package/src/scripts/lint_archived_skills.ts +93 -0
  384. package/src/scripts/lint_budget_ownership.ts +2 -1
  385. package/src/scripts/lint_deterministic_time.ts +470 -0
  386. package/src/scripts/lint_framework_leakage.ts +5 -0
  387. package/src/scripts/lint_handoffs.ts +525 -1
  388. package/src/scripts/lint_judge_prompt_expectation.ts +155 -0
  389. package/src/scripts/lint_marketplace.ts +88 -0
  390. package/src/scripts/lint_media_policy_linkage.ts +140 -1
  391. package/src/scripts/lint_one_off_age.ts +6 -1
  392. package/src/scripts/lint_override_kernel_guard.ts +87 -5
  393. package/src/scripts/lint_roadmap_complexity.ts +56 -0
  394. package/src/scripts/lint_rule_enforcement_declaration.ts +24 -7
  395. package/src/scripts/lint_rule_norm_pin.ts +321 -0
  396. package/src/scripts/lint_spawn_payload.ts +42 -5
  397. package/src/scripts/lint_symptom_intake.ts +2 -1
  398. package/src/scripts/mcp_parity_smoke.ts +30 -4
  399. package/src/scripts/mcp_render.ts +66 -1
  400. package/src/scripts/mcp_tool_fingerprint.ts +241 -0
  401. package/src/scripts/measure_risk_class_drift.ts +140 -0
  402. package/src/scripts/measure_skill_ranker_baseline.ts +212 -0
  403. package/src/scripts/media/lib/adapter-common.sh +211 -1
  404. package/src/scripts/media/lib/adapter-contract.md +74 -6
  405. package/src/scripts/model_rule_injection.ts +907 -0
  406. package/src/scripts/project_thin_rules.ts +45 -2
  407. package/src/scripts/release.ts +66 -860
  408. package/src/scripts/release_drill.ts +59 -3
  409. package/src/scripts/release_env.ts +298 -0
  410. package/src/scripts/release_publication.ts +720 -0
  411. package/src/scripts/roadmap_context.ts +778 -0
  412. package/src/scripts/schemas/fidelity-measurement-sheet.schema.json +169 -0
  413. package/src/scripts/schemas/pack.schema.json +62 -4
  414. package/src/scripts/schemas/rule.schema.json +24 -2
  415. package/src/scripts/schemas/skill.schema.json +41 -2
  416. package/src/scripts/schemas/ui-authority.schema.json +114 -0
  417. package/src/scripts/session_register_hook.ts +29 -3
  418. package/src/scripts/sessions_cli.ts +67 -3
  419. package/src/scripts/skill_tools/score_skill_relevance.ts +36 -53
  420. package/src/scripts/tighten_skill_descriptions.ts +264 -0
  421. package/src/scripts/token_sink_report.ts +239 -0
  422. package/src/scripts/trigger_coverage.ts +122 -3
  423. package/src/scripts/update_counts.ts +7 -3
  424. package/src/scripts/validate_frontmatter.ts +66 -0
  425. package/src/server/schemas/settings.ts +5 -0
  426. package/src/shared/skillRanking.ts +183 -0
@@ -34,6 +34,27 @@ Gather in parallel:
34
34
  - Check for module roots (resolve via `scripts/_lib/agent_settings.ts::enumerate_modules()`; Laravel shape: `app/Modules/`), multi-tenant indicators (`customer_database`)
35
35
  - Read: `AGENTS.md`, `.github/copilot-instructions.md` (if exist)
36
36
 
37
+ **Assurance dimensions — do NOT hand-detect these.** Run
38
+
39
+ ```bash
40
+ ./scripts-run src/scripts/grade_target_readiness --target <project root>
41
+ ```
42
+
43
+ It probes the ten readiness dimensions in one pass — test-runner config
44
+ (vitest/jest/phpunit/pest/pytest), mutation config (`stryker.conf.*`,
45
+ `infection.json*`, `[tool.mutmut]`), property-based libraries, static analysis
46
+ (`phpstan.neon`, `psalm.xml`, `tsconfig.json`), architecture gates
47
+ (`.dependency-cruiser.*`, `deptrac.yaml`), SAST (`.semgrep*`, bandit),
48
+ lockfiles, audit steps, `CODEOWNERS`, decision-record directories — **and
49
+ whether CI actually blocks on each**, which is the 1 → 2 distinction a
50
+ hand-read gets wrong: a job that exists is `Present`, a job that can fail the
51
+ build is `Enforced-in-CI`.
52
+
53
+ Hand-detecting these was tried and rejected: a gather list in this file cannot
54
+ be asserted by a test, and step 1.1 of the source roadmap requires that each
55
+ dimension's presence be detected **and its absence not be**, both pinned by a
56
+ vitest spec. That spec is `tests/scripts/grade_target_readiness.test.ts`.
57
+
37
58
  Display:
38
59
 
39
60
  ```
@@ -58,6 +79,32 @@ TECH STACK:
58
79
  Frontend: {Vue / React / Blade / none}
59
80
  Testing: {Pest / PHPUnit}
60
81
 
82
+ ───────────────────────────────────────────────
83
+ READINESS (verbatim from grade_target_readiness)
84
+ ───────────────────────────────────────────────
85
+
86
+ L{n} — bound by {dimension}
87
+
88
+ {the ten rows, exactly as the script printed them}
89
+
90
+ **Print the script's output verbatim. Do not summarise it and do not compute
91
+ anything from it.** Three rules, each of which the script already enforces and
92
+ which this template must not undo:
93
+
94
+ 1. **Never emit an aggregate.** No percentage, no `x/100`, no mean, no letter
95
+ grade. A single number is the vanity metric this section exists to avoid, and
96
+ a ten-row vector with a binding dimension is the whole point of the format.
97
+ 2. **The level is the MINIMUM over the four knockout dimensions** — test presence
98
+ & types, static analysis & types, CI enforcement, security & supply chain.
99
+ Nine dimensions at 3 and one knockout at 0 is `L0`, not "mostly ready".
100
+ 3. **`not detectable` is not `0`.** A `0` claims the target lacks something; `not
101
+ detectable` says this tool cannot tell. For a Python target, static analysis
102
+ prints `not detectable — quality-tools has no Python mode`, and because that
103
+ dimension is a knockout it **binds at L0 with the reason shown**.
104
+
105
+ Whether a missing gate then gets created in the target is out of scope here —
106
+ this section grades, it does not install.
107
+
61
108
  ───────────────────────────────────────────────
62
109
  TOOLING:
63
110
  ───────────────────────────────────────────────
@@ -3,12 +3,12 @@ model_tier: high
3
3
  name: review-changes
4
4
  pack: engineering-base
5
5
  intent: "Multi-judge review of the current diff — bugs, security, tests, quality, architecture"
6
- routes_to: [code-review, judge-bug-hunter, judge-security-auditor, judge-test-coverage, judge-code-quality, architecture-review-lens]
6
+ routes_to: [code-review, judge-bug-hunter, judge-security-auditor, judge-test-coverage, judge-code-quality, architecture-review-lens, overbuild-review-lens]
7
7
  replaces: []
8
8
  visibility: internal
9
9
  sub: changes
10
10
  cluster: review
11
- skills: [code-review, subagent-orchestration, judge-bug-hunter, judge-security-auditor, judge-test-coverage, judge-code-quality, architecture-review-lens, judge-synthesis, git-workflow]
11
+ skills: [code-review, subagent-orchestration, judge-bug-hunter, judge-security-auditor, judge-test-coverage, judge-code-quality, architecture-review-lens, overbuild-review-lens, judge-synthesis, git-workflow]
12
12
  description: Self-review local changes before creating a PR — dispatches to six specialized judges (bug, security, tests, quality, architecture, spec) and consolidates verdicts
13
13
  suggestion:
14
14
  eligible: false
@@ -122,10 +122,21 @@ PR body, commit messages) and runs independently. The judges are:
122
122
  | [`judge-code-quality`](../../skills/judge-code-quality/SKILL.md) | Naming, SRP, DRY, dead code, consistency with codebase conventions |
123
123
  | [`architecture-review-lens`](../../skills/architecture-review-lens/SKILL.md) | Layer violations, dependency direction, leaky abstractions, cross-service contract drift |
124
124
  | [`judge-spec-compliance`](../../skills/judge-spec-compliance/SKILL.md) | Does the diff satisfy every acceptance criterion **as stated**? Reads the criteria before the diff, and never infers them from it |
125
+ | [`overbuild-review-lens`](../../skills/overbuild-review-lens/SKILL.md) | Speculative abstraction, premature generality, features nobody asked for, a rewrite where an edit was the task |
125
126
 
126
- The six judges weight equally in the consolidated verdict — none
127
+ The seven judges weight equally in the consolidated verdict — none
127
128
  overrides another.
128
129
 
130
+ **Why the seventh exists (road-to-trigger-delivered-rule-bodies A5).**
131
+ `overbuild-review-lens` shipped and **no command routed to it** — `grep -rln
132
+ overbuild-review-lens dist/agent-src/commands/` returned nothing, so a lens
133
+ built to catch the most common failure of AI-written code was reachable only by
134
+ being asked for by name. The other six all ask whether the diff is *good*; this
135
+ one asks whether it should have been this *large*, which is the one question a
136
+ diff cannot answer about itself. It is dispatched on demand like the others, so
137
+ it adds no standing token cost — verified: `check_preamble_payload_budget`'s
138
+ measured total is unchanged by this routing.
139
+
129
140
  **Why the sixth exists, and why it is not a severity.** The other five all ask a
130
141
  craft-or-correctness question, so a change that is correct, clean, well-tested
131
142
  and architecturally sound — and **does not do what was asked** — used to pass
@@ -146,12 +157,12 @@ Pick dispatch mode based on diff size and environment:
146
157
 
147
158
  - **Sequential** (default, simplest) — run bug-hunter → security-auditor
148
159
  → test-coverage → code-quality → architecture-review-lens →
149
- spec-compliance, collect each verdict
160
+ spec-compliance → overbuild, collect each verdict
150
161
  - **Parallel** — if `subagents.max_parallel` in `.agent-settings.yml` is
151
- ≥ 5 and subagent dispatch is available, run all six concurrently
162
+ ≥ 5 and subagent dispatch is available, run all seven concurrently
152
163
  following the `do-in-parallel` pattern in
153
164
  [`subagent-orchestration`](../../skills/subagent-orchestration/SKILL.md);
154
- the six judges operate on the same diff but produce independent
165
+ the seven judges operate on the same diff but produce independent
155
166
  reports, so no shared-state risk
156
167
 
157
168
  Each judge returns its own `Judge / Model / Target / Verdict /
@@ -189,6 +200,56 @@ If picked **1**:
189
200
 
190
201
  If picked **2** → continue with internal judges only.
191
202
 
203
+ ### 4b-fresh. The fresh reviewer — the one input with no implementation context
204
+
205
+ The six judges above all read **the same diff plus the task context**, and on the common
206
+ path they run in-session: the party that wrote the diff also reads it, with the whole
207
+ implementation context in scope. That is a self-review, and calling it a review is the
208
+ defect `road-to-review-independence` exists to close.
209
+
210
+ So a **seventh input** is added, and its distinguishing property is a negative one: it
211
+ has **no implementation context**. Not a new mechanism —
212
+ [`dispatch_r2_reviewer.ts`](../../../../scripts/dispatch_r2_reviewer.ts) already derives
213
+ the scope and persists the prompt it sent:
214
+
215
+ ```bash
216
+ ./scripts-run src/scripts/dispatch_r2_reviewer --slug <slug> --base origin/main
217
+ ```
218
+
219
+ The six in-session judges stay exactly as they are. This is an addition, not a
220
+ replacement — a fresh reviewer is worse than a spec judge at spec compliance, and the
221
+ point is not to be better at their job but to be uncontaminated by the author's framing.
222
+
223
+ **When the route is taken.** Whenever the diff is going to a PR — i.e. every
224
+ pre-PR review, which is what this command's own opening line describes itself as. It is
225
+ skipped only for a diff that will not be proposed to anyone: a scratch branch, a probe,
226
+ a measurement re-run.
227
+
228
+ **When dispatch is unavailable — the honest degraded answer.** If a fresh dispatch cannot
229
+ be made (no subagent primitive on this host, a spend ceiling, a dispatcher error), the
230
+ review **says so in the report** and records `fresh_review: unavailable` with the reason.
231
+ It does **not** fall back to the in-session judges and present the result as a review:
232
+
233
+ ```
234
+ A SELF-REVIEW PRESENTED AS A REVIEW IS THE DEFECT, NOT THE DEGRADED MODE.
235
+ NO FRESH REVIEWER -> THE REPORT SAYS SO. NEVER SILENTLY.
236
+ ```
237
+
238
+ That wording is deliberate. A silent fallback is worse than a missing input, because the
239
+ reader cannot tell which one they got — and this command's own `criteria_source` table
240
+ already applies the same rule to a different input (`not_provided` is never a pass).
241
+
242
+ **The implementer envelope does NOT reach this reviewer.** The judge prompts hand it over
243
+ on purpose — `prompts/do-and-judge.md:70` carries an `IMPLEMENTER ENVELOPE:` line with the
244
+ envelope placeholder — which is correct for a judge validating a claim and wrong for a
245
+ reviewer whose entire value is not having the author's framing.
246
+
247
+ The placeholder is described rather than written out here on purpose: step 1.3's verify is
248
+ a grep for its **absence** from this route, and prose that trips a grep-shaped verify is a
249
+ trap for the next reader. The asymmetry is stated in
250
+ [`prompts/README.md`](../../../../skills/subagent-orchestration/prompts/README.md) so the
251
+ next prompt author does not copy the envelope line into a fresh-reviewer template.
252
+
192
253
  ### 4c. Optional adversarial verification council (opt-in, high-risk)
193
254
 
194
255
  Read `subagents.adversarial_council` from `.agent-settings.yml` (default
@@ -35,6 +35,50 @@ lookup, and assess the four 95%-conditions against the seed.
35
35
  - **Explicit user bypass** ("just write it") → skip the gate for this turn;
36
36
  count the bypass.
37
37
 
38
+ ### 0b. Context probe — before step 1
39
+
40
+ ```bash
41
+ agent-config roadmap:context
42
+ ```
43
+
44
+ Run it before gathering any content, and surface its hits to the user as ONE
45
+ list:
46
+
47
+ - an `agents/tmp/` inbox note on the same topic (names only — the probe never
48
+ reads the bodies);
49
+ - a sibling roadmap in `later/`, `stubs/`, `archive/` or the active set whose
50
+ slug or title shares the topic;
51
+ - an open PR touching the paths the new roadmap would cite.
52
+
53
+ This is the axis step 6's collision check cannot reach. That check is a
54
+ recursive `find -iname`, so it already covers `later/`, `stubs/` and `archive/`
55
+ — **lexically**. Same topic under a different name passes it clean, and the
56
+ probe is the semantic half.
57
+
58
+ Naming an overlap is **required**, not optional, and it is coordination rather
59
+ than content generation — see the amended rule below.
60
+
61
+ **Then write the `relates:` block from the hits** (template rule 18). One
62
+ numbered-options question per hit — `extends` / `supersedes` / `depends` /
63
+ `disjoint` — and the relation is never inferred: `extends` and `supersedes` rest
64
+ on the same lexical evidence and are opposite decisions, so guessing manufactures
65
+ the reflex-empty failure in a louder form. A `depends` answer mirrors into
66
+ `depends:` in the same edit.
67
+
68
+ Zero hits needs no question — it is fully determined, so write it silently:
69
+
70
+ ```bash
71
+ agent-config roadmap:context --relates # prints the block, ready to paste
72
+ ```
73
+
74
+ ```yaml
75
+ relates: [] # scanned: 716 roadmap file(s), 0 sibling hits
76
+ ```
77
+
78
+ The `scanned:` count is what separates *somebody looked and found nothing* from
79
+ *nobody looked*; without it the empty list carries no information and is worse
80
+ than an absent field.
81
+
38
82
  ### 1. Determine location
39
83
 
40
84
  Ask the user (in their language) where the roadmap should be created:
@@ -313,6 +357,11 @@ Failure modes covered by this hard stop:
313
357
  ### Rules
314
358
 
315
359
  - **Do NOT auto-generate content** — always ask the user for input.
360
+ - **Naming an overlap is coordination, not content generation, and it is
361
+ required.** The rule above governs the roadmap's *substance*; it never
362
+ licenses staying silent about a sibling roadmap, an inbox note, or an open PR
363
+ that step 0b's probe surfaced. Report every hit, let the user decide what it
364
+ means, and write the outcome into the `relates:` block (template rule 18).
316
365
  - **Do NOT commit or push.**
317
366
  - **Do NOT offer execution after save** — Step 11 is a hard stop.
318
367
  Execution starts on a later turn with an explicit execution verb
@@ -34,20 +34,28 @@ One invocation = one roadmap = one branch = one PR.
34
34
  Selection reads live state, never memory, a dashboard count, or an
35
35
  earlier fetch (per [`direct-answers`](../../rules/direct-answers.md)
36
36
  Iron Law 2 and [`roadmap-process-loop § 1`](../../contexts/execution/roadmap-process-loop.md#1-resolve-roadmap)).
37
- Run as ONE block:
37
+ Run ONE command:
38
38
 
39
39
  ```bash
40
- git fetch origin --prune
41
- git ls-tree --name-only origin/main agents/roadmaps/ # still active?
42
- git ls-tree --name-only origin/main agents/roadmaps/archive/ # already closed?
43
- gh pr list --state open --json number,title,headRefName # in flight?
44
- agent-config sessions:list # claimed right now?
40
+ agent-config roadmap:context
45
41
  ```
46
42
 
47
- `sessions:list` without `--json` on purpose: the human form carries **both**
48
- axes — the live records AND the unmerged branches checked out in other
49
- worktrees. `--json` returns only the records unless `--branches` is passed, and
50
- the branch axis is the one that does not need a peer to have claimed anything.
43
+ The four hand-written reads this block used to carry — the pruning fetch, the
44
+ active and archived roadmap listings, the open-PR listing, and the session
45
+ register — are now one probe
46
+ ([`roadmap_context.ts`](../../../../scripts/roadmap_context.ts)), so all five
47
+ `/roadmap:*` entry points screen the same way instead of one command file
48
+ screening well and four not screening at all.
49
+
50
+ Both session axes are still in the report and for the same reason: the live
51
+ records AND the unmerged branches checked out in other worktrees. The branch
52
+ axis is the one that does not need a peer to have claimed anything, and it is
53
+ the half that cannot be silent.
54
+
55
+ The probe never refuses. With no network, no `gh`, or no authentication it
56
+ prints `scanned: 0 PRs (network unavailable)` and exits 0 — a probe that failed
57
+ closed would make the call site conditional, which is the failure this
58
+ extraction removes.
51
59
 
52
60
  Excluded from the candidate set: `template.md`, `archive/`,
53
61
  `skipped/`, `later/`, anything with `status: draft` whose promotion
@@ -157,9 +165,17 @@ GOODHART MOVE THIS PACKAGE'S OWN DISCIPLINE FORBIDS.
157
165
  ### 3b. Claim the pick, so the next session's screen sees it
158
166
 
159
167
  ```bash
160
- agent-config sessions:claim <roadmap-slug>
168
+ agent-config sessions:claim <roadmap-slug> [--paths src/a.ts,src/b.ts]
161
169
  ```
162
170
 
171
+ `--paths` publishes the run's owned-path set — the same set the § 2 screen
172
+ derived — into the session record as `owned_paths`. It is what turns the third
173
+ collision axis on: without it a peer editing the same file under a different
174
+ roadmap and a different branch name is invisible on every axis, which is the
175
+ shape of the two duplications the branch axis already failed to catch. Declaring
176
+ nothing degrades to today's behaviour exactly, and the field is absent rather
177
+ than empty in the record.
178
+
163
179
  Immediately after the pick, before any branch or commit. This writes the slug
164
180
  into `agents/runtime/state/roadmap-claim-<session>.json`; the next heartbeat lifts
165
181
  it into this session's register record, so another session's step 1 excludes it
@@ -98,6 +98,20 @@ command already does.
98
98
  `archive/` and `stubs/` are out of scope.
99
99
  2. **Order the queue.** Roadmaps at or above 10 % checkbox progress first, in
100
100
  **descending** progress — nearly-done first, because they convert soonest.
101
+
102
+ **This is a recorded exception to [`/roadmap:next` § 3](../next/command.md),
103
+ not an oversight.** That command's Iron Law is explicit: *"RANK BY DEFECT
104
+ SEVERITY, NEVER BY PERCENT-DONE OR STEP COUNT … picking by checkbox count is
105
+ the Goodhart move this package's own discipline forbids."* This step orders by
106
+ exactly that. The two are not in conflict because they answer different
107
+ questions: `next` **selects one** roadmap out of many and must not be gamed by
108
+ a cheap-to-finish file, while `--all` has already committed to draining the
109
+ **whole** estate — every member runs, so the ranking decides only the order in
110
+ which finished work becomes reviewable, never what gets done. Under a total
111
+ drain the Goodhart pressure is absent by construction: there is nothing to
112
+ pick, so a proxy cannot be optimised against.
113
+ The exception is scoped to `--all`. A single-roadmap invocation of this
114
+ command selects nothing and inherits `next`'s doctrine unchanged.
101
115
  Roadmaps below 10 % are appended after, ascending by declared `complexity:`
102
116
  tier (lightweight → bounded → structural), tiebreak ascending total
103
117
  checkbox count. Both buckets need a **total** order or two runs over the
@@ -6,7 +6,7 @@ visibility: internal
6
6
  cluster: video
7
7
  sub: from-script
8
8
  description: Drive a script end-to-end through the AI video pipeline — scenes → blueprint → image → operator pick → motion → video → stitch. Preview default; --mode commit spends behind the cost gate.
9
- argument-hint: "<path-to-script.md> [--mode preview|commit] [--max-spend-usd <usd>] [--image-provider <id>] [--video-provider <id>]"
9
+ argument-hint: "<path-to-script.md> [--mode preview|commit] [--max-spend-usd <usd>] [--no-calibrate] [--{image,video}-provider <id>]"
10
10
  personas: [hollywood-director, ai-video-technical-director]
11
11
  skills: [scene-expander, video-director, pixar-storyteller, character-consistency, motion-choreographer]
12
12
  suggestion:
@@ -20,7 +20,7 @@ packs:
20
20
 
21
21
  # /video:from-script
22
22
 
23
- `/video:from-script <path-to-script.md> [--mode preview|commit] [--max-spend-usd <usd>] [--image-provider <id>] [--video-provider <id>]`
23
+ `/video:from-script <path-to-script.md> [--mode preview|commit] [--max-spend-usd <usd>] [--no-calibrate] [--image-provider <id>] [--video-provider <id>]`
24
24
 
25
25
  Drives a Markdown script through the full pipeline. Provider flags
26
26
  override the `<default-image-provider>` / `<default-video-provider>`
@@ -89,9 +89,66 @@ For each scene blueprint:
89
89
  `0`). When `--max-spend-usd` is set and the summed estimate exceeds
90
90
  it, hard-block before the first live call — confirmation does not
91
91
  override the cap.
92
- 3. Call the image adapter (`run` subcommand) N times where N =
92
+ 3. **Calibration probe (default on; `--no-calibrate` skips).** Before the
93
+ batch, render exactly **one** still and **one** clip, then run:
94
+
95
+ ```bash
96
+ scripts/ai-video/lib/calibrate-cost.sh <project> <scene-id> \
97
+ --adapter <id> --model <id> --scenes <n>
98
+ ```
99
+
100
+ It reads the `charged_usd` the pipeline already writes to
101
+ `<project>/scenes/<id>/cost.json` and prints one line:
102
+
103
+ ```
104
+ calibration: modeled $0.0800/s · charged $0.1100/s · +37.5 % · extrapolated batch $4.40 (modeled $3.20)
105
+ ```
106
+
107
+ Re-confirm **only** when the charged figure exceeds the modeled one by
108
+ more than **25 %** — the script exits **13** in that case and **0**
109
+ otherwise. Under the threshold, print the line and continue: a calibration
110
+ that interrupts on every run is a confirmation nobody reads.
111
+
112
+ Exit 13 is a halt for a human, not a failure. `--max-spend-usd` is not a
113
+ substitute for it — that cap bounds *total spend*, while this catches a
114
+ wrong *per-second model*, which is what makes the total wrong in the first
115
+ place.
116
+
117
+ This folds into the existing `lib/operator-pick.sh` moment rather than
118
+ adding a gate of its own, so the operator sees the calibration line at
119
+ the checkpoint they were already stopping at.
120
+
121
+ `charged: null` is **not** `0`: an unpriceable or not-yet-charged scene
122
+ prints `charged: null`, extrapolates nothing, and never re-confirms. A
123
+ modeled figure is only ever corrected by a measured one.
124
+
125
+ Every reading appends one row to
126
+ `agents/evidence/ai-video/cost-ledger.jsonl` — see § Cost ledger below.
127
+ The read-back itself is not new: `lib/resume-scan.sh` already reads
128
+ `cost.json .charged_usd` and sums it as `spent_usd`. What is new is that
129
+ the number now **feeds back**: before this, money spent was recorded and
130
+ never read into the model it contradicted.
131
+
132
+ 4. Call the image adapter (`run` subcommand) N times where N =
93
133
  `<tuning/best-of-n>` (default 1).
94
134
 
135
+ ### 5b. Cost ledger — the only route from charged to modeled
136
+
137
+ `manifest.cost_per_second_usd` is a **modeled** estimate. It may be
138
+ re-modeled only from measured charges, and only with the rows it averaged
139
+ cited in the same diff:
140
+
141
+ ```bash
142
+ # one row per (adapter, model) reading, append-only
143
+ {"adapter":"fal","model":"fal-ai/ltx-2/text-to-video","modeled":0.16,"charged":0.21,"date":"2026-08-23"}
144
+ ```
145
+
146
+ `lint_adapter_tier --cost-diff <base-ref>` **warns** when a manifest's
147
+ `cost_per_second_usd` changed in a diff that adds no ledger row. A warning,
148
+ not a failure: re-modelling an estimate is a legitimate human act. Doing it
149
+ silently *after* a live run measured the real charge is not — that is the
150
+ moment a guess becomes a contradicted measurement.
151
+
95
152
  ### 6. Operator pick (best-of-N checkpoint)
96
153
 
97
154
  ```bash
@@ -55,6 +55,20 @@ the first missing clip) flags. Reject any other flag — this command
55
55
  does not render, so `--image-provider` / `--video-provider` are
56
56
  contract bugs.
57
57
 
58
+ **`--mode` and `--xfade` exist on the script and are deliberately not
59
+ reachable from here.** `stitch.sh` now carries `--mode cut|handoff`, and in
60
+ handoff mode an optional `--xfade <s>` (≤ 0.25) at handoff seams. `cut` is the
61
+ default and is byte-identical to the only behaviour this command has ever
62
+ produced. `handoff` **re-encodes** (`libx264 -crf 20 -g 8 +faststart -an`) where
63
+ `cut` stream-copies, so it pays a generation loss and drops audio — a spend-free
64
+ but not cost-free change of the output. Reaching it needs the seam plan that
65
+ `lib/seam-plan.sh` builds from per-scene `continuity:` directives, which this
66
+ command does not read. Passing either flag here is therefore rejected by the
67
+ rule above, and that is the intended answer, not a gap: the continuity path is
68
+ driven from `/video:from-script`, and `--crossfade` remains refused in every
69
+ mode. Port invariants: `docs/contracts/skill-bundled-assets.md` § Port
70
+ invariants.
71
+
58
72
  ### 4. Stitch
59
73
 
60
74
  ```bash
@@ -11,6 +11,7 @@ before writing or reviewing code); this file is the catalog.
11
11
  |---|---|
12
12
  | `abstraction-thresholds.md` | Per-class extraction-threshold canon (code 2 · UI shell 3+ · stateful component ~4+state · utility-class string ≥3) — the single source every numeric threshold cites (ADR-213) |
13
13
  | `code-clarity.md` | Cross-language clarity rules — inline single-use values, carve-outs (side effects, loops, type narrowing, debugger) |
14
+ | `monorepo-antipatterns.md` | Diff-detectable monorepo task-graph anti-patterns (root scripts bypassing the runner, lifecycle-hook sibling builds, `&&`-chained tasks, shared code under `apps/`, `../` in `inputs`, missing `outputs`) plus the classes deliberately not harvested |
14
15
  | `component-oriented-and-oop-development.md` | Reuse-first components (FE) + OOP-where-it-reduces-complexity (backend); carve-out index; bounded by the anti-over-engineering anchors |
15
16
 
16
17
  ## PHP (`docs/guidelines/php/`)
@@ -8,10 +8,62 @@ resolution, commit-step pre-scan, halt conditions, and archival check.
8
8
  The three command files are thin wrappers that bind only the **scope
9
9
  delta**.
10
10
 
11
- **Size budget:** ≤ 4,000 chars.
11
+ **Size budget:** ≤ 57,000 chars — restated from the original 4,000.
12
+
13
+ The old figure described nothing: the file measured 47,115 bytes against it, a
14
+ factor of 11.8, so it was a dead budget rather than a typo. Restated at the
15
+ measured size rather than split, because splitting a contract this load-bearing
16
+ into referenced fragments is a large change with its own risk, and the step that
17
+ found this asked for hygiene.
18
+
19
+ **Why it moved:** this file is not a page a reader skims but the canonical
20
+ autonomous-execution loop — roadmap discovery, cadence resolution, the step loop,
21
+ the flip-guard, the halt list, the terminal outcomes, and the archival check. The
22
+ original 4,000 was inherited from the sibling context docs (`≤ 3,000`, `≤ 6,000`)
23
+ without asking whether the same shape applied.
24
+
25
+ **Read it as a ratchet, not a target.** A budget that rises whenever the file
26
+ does is not a budget. It may fall; raising it again needs the same kind of note
27
+ as this one.
28
+
29
+ **Nothing enforces this line**, and saying so is the point: no gate reads it, so
30
+ it is a declaration a future edit can falsify exactly as the 4,000 was falsified.
31
+ A true declaration with a stated enforcement boundary is worth more than a false
32
+ one, and less than a check — the same `enforced_by: none` honesty the rules in
33
+ this tree state about their own obligations.
12
34
 
13
35
  ## 1. Resolve roadmap
14
36
 
37
+ ### Context probe — unconditionally, before resolving the roadmap
38
+
39
+ ```bash
40
+ agent-config roadmap:context --roadmap <slug> # slug omitted on a bare invocation
41
+ ```
42
+
43
+ Run it **before resolving the roadmap**, on every invocation, and print its
44
+ report in the pre-run summary (§ 2). Unconditional is the whole point: the live
45
+ merge-state clause below fires only when a message would *describe* a roadmap
46
+ as in-flight or merged, so a run that never makes such a claim has never looked.
47
+ Measured on the population that motivated this: 4 of 24 active roadmaps were
48
+ already closed in an open PR, and 2 of 22 six days later — the same sample
49
+ halved inside a week, which is why the probe re-runs on a cadence (§ 5e) rather
50
+ than once at branch time.
51
+
52
+ The report carries open PRs with the files they change, remote branches carrying
53
+ a roadmap slug, live sessions on both axes, `agents/tmp/` note names, sibling
54
+ roadmaps on the same topic, and roadmap-to-PR file overlap. Two readings act:
55
+
56
+ - **The roadmap is closed in an open PR** → name the PR number and stop. This is
57
+ a **selection error**, not a halt: nothing on the halt list fired, the run
58
+ simply picked work that is already done. It does not touch the halt list and
59
+ it is not a `blocked` outcome.
60
+ - **The roadmap is partially covered by an open PR** → name the PR and continue,
61
+ on a branch cut from `origin/main`. Never rebase onto the foreign branch.
62
+
63
+ Same honesty boundary the probe states in its own header: **the probe is
64
+ deterministic once invoked, and the invocation is model-carried.** Nothing fires
65
+ it and nothing notices when it is skipped.
66
+
15
67
  Search both locations:
16
68
 
17
69
  - `agents/roadmaps/*.md` (project root)
@@ -417,6 +469,34 @@ of [`roadmap-progress-sync`](../../rules/roadmap-progress-sync.md))
417
469
  forces an immediate regen regardless of cadence. The checkbox flip
418
470
  itself is **never** batchable — only the subprocess.
419
471
 
472
+ ### Context refresh — a comparison, not a third cadence key
473
+
474
+ There is **no `roadmap.context_refresh_cadence` setting**, deliberately. The
475
+ refresh trigger is derived:
476
+
477
+ ```bash
478
+ agent-config roadmap:context --fingerprint # cheap: one rev-parse + one gh call
479
+ ```
480
+
481
+ At every phase boundary (and at run end), take the fingerprint and compare it
482
+ with the one § 1's probe returned. **Differs → re-probe in full** and apply the
483
+ reaction table in § 5e. **Same → nothing moved; continue without paying for a
484
+ probe.** Cache the new value as the run's baseline either way.
485
+
486
+ The fingerprint covers `origin/main` **and the head SHA of every open PR**. The
487
+ second half is the case a `main`-only trigger misses: a peer pushing to their own
488
+ PR branch mid-run can add a file that now overlaps this run's owned paths while
489
+ `origin/main` has not moved at all.
490
+
491
+ Why a comparison and not a knob: `docs/contracts/settings-classes.md` classifies
492
+ a fixed-beat flag as `derivable` — "the mechanism itself can decide, from the
493
+ situation, better than a flag can" — behind a ratchet whose count may only fall.
494
+ A cadence enum was implemented, refused by `lint_settings_classes`, and replaced
495
+ by this; the full reasoning, the options rejected, and what the substitution costs
496
+ are in `agents/evidence/analysis/situational-awareness-cadence-key-decision.md`.
497
+ Turning the refresh off is a one-line revert of this subsection, which is the same
498
+ reversibility a `cadence: off` value would have bought.
499
+
420
500
  ## 5. Step loop
421
501
 
422
502
  For each open step in the working set (scope-bound — see wrapper):
@@ -510,6 +590,26 @@ For each open step in the working set (scope-bound — see wrapper):
510
590
  links the directory. Not a gate: the memo is what makes an
511
591
  autonomous resolution reviewable after the fact, which is the
512
592
  condition under which it is legitimate at all.
593
+ 4b. **Stale-artefact check — a vanished file is never a closed step.**
594
+
595
+ Before flipping anything, check the step's own cited paths against the tree:
596
+
597
+ ```
598
+ NEVER MARK STALE WORK COMPLETE JUST BECAUSE IT DISAPPEARED.
599
+ ABSENCE OF THE FILE IS ABSENCE OF EVIDENCE, NOT EVIDENCE OF COMPLETION.
600
+ ```
601
+
602
+ Any cited path missing → the step resolves to **`unverified`**: surface it in
603
+ the run report, name the missing path, and flip **no** checkbox. Not `[x]`
604
+ (the evidence cannot be checked), not `[-]` (nobody decided to skip it), not
605
+ `[~]` (nobody deferred it) — the box stays open and the report carries the
606
+ reason. `staleArtefactVerdict` in `roadmap_context.ts` is the predicate.
607
+
608
+ The failure this catches is quiet: "nothing to do here" reads identically to
609
+ "already done", and one of those is a closed step while the other is a lost
610
+ one. A step citing no paths is unaffected — there is nothing to check, and
611
+ inventing a doubt would fire this on every prose step.
612
+
513
613
  5. **Atomic flip — same reply, every step.**
514
614
  Flip the checkbox in `agents/roadmaps/<file>.md`: `[x]` done ·
515
615
  `[~]` partial · `[-]` skipped. **Non-skippable, non-batchable**
@@ -634,10 +734,46 @@ sibling worktree moved, the dying session finished a step it never recorded),
634
734
  and the `actual` column is what to resume from. Treating progress as corruption
635
735
  would refuse every healthy resume.
636
736
 
737
+ **The checkpoint carries a repository fingerprint too, not only roadmap counts.**
738
+ `context_fingerprint` is the `roadmap:context --fingerprint` value the dying run
739
+ last held. Every other field on the checkpoint reports **roadmap** drift; none
740
+ reported **repository** drift, so a run resumed after a long gap trusted a context
741
+ reading it never re-took — the exact staleness § 4's refresh exists to end,
742
+ reappearing across the one boundary a mid-run cadence cannot see.
743
+
744
+ A resumed run therefore re-probes and passes the fresh fingerprint into
745
+ `verifyCheckpoint`. A disagreement forces a full re-probe and the § 5e reactions
746
+ **before the first step**. A `null` or absent value on either side reads as *not
747
+ known* and never as a disagreement — the same rule `head` already follows, and for
748
+ the same reason: a false alarm on the field whose job is to say whether anything
749
+ moved trains the reader to skip the line.
750
+
637
751
  `agent-config run:supervise --once` reports which runs died with open steps
638
752
  left. It never merges, pushes, or closes anything — that boundary is a named
639
753
  rejection, not a missing feature.
640
754
 
755
+ ### 5e. Context refresh — four reactions, enumerated and closed
756
+
757
+ At each due point (§ 4 — fingerprint differs) re-probe and act. **These four rows
758
+ are the whole set.** Nothing here is a halt: none of them appears on the halt list
759
+ and none of them is a `blocked` outcome.
760
+
761
+ | # | What the refresh found | Reaction |
762
+ |---|---|---|
763
+ | a | A PR touching my owned paths **merged** since the last refresh | Run `sync_pr_branch` now — already the documented resolution, only push-bound until this row existed. Re-read the current step's files, continue. |
764
+ | b | An **open** PR touches my owned paths | Continue. Name the collision in the PR description and in the final report. **Never rebase onto a foreign branch.** |
765
+ | c | A peer session shows `PATH OVERLAP` | Take disjoint steps first if ordering allows; otherwise name it and continue. The register is advisory, never a lock. |
766
+ | d | The roadmap itself was **archived on `origin/main`** | Stop. The same **selection error** as § 1, detected late — not a halt, and no checkbox is flipped to reach it. |
767
+
768
+ Deliberately NOT a drift-level taxonomy. A severity ladder over these four would
769
+ invite a fifth row for every new shape of surprise, and the value here is that the
770
+ set is closed: an agent that meets something outside it has met an ordinary step,
771
+ not a new reaction.
772
+
773
+ Row (a) is the one that changes behaviour mid-run rather than only reporting. Rows
774
+ (b) and (c) exist to make the collision **visible in the artefact** — a run that
775
+ silently produces a conflicting PR has spent the reviewer's time, not its own.
776
+
641
777
  ### Halt conditions
642
778
 
643
779
  - Hard-Floor trigger ([`non-destructive-by-default`](../../rules/non-destructive-by-default.md))
@@ -681,14 +817,30 @@ setting, pushing, opening a PR, re-running CI, updating a merge base, fixing a
681
817
  test, spending inside a budget — the agent can do all of it. That is remediation
682
818
  work, and a `process-full` invocation grants it.
683
819
 
684
- Three outcomes, and only one of them is success:
820
+ Four outcomes, and only one of them is success:
685
821
 
686
822
  | Outcome | When | What it reports |
687
823
  |---|---|---|
688
824
  | `complete` | `count_open == 0` and the PR is open | the roadmap is finished; archival check runs (§ 6) |
689
825
  | `blocked` | every remaining open step is **externally impossible** for the agent | the work that DID close, plus the specific impossibility |
826
+ | `superseded` | the remaining work **already landed** on `origin/main`, in a merged PR | which steps the tree already satisfies, with the PR number and the evidence per step |
690
827
  | a halt | one of the five conditions above fired | the halt, its evidence, and what remains |
691
828
 
829
+ **Why `superseded` is here and not on the halt list.** A run that meets a merged
830
+ PR which already closed its remaining steps had, until this row existed, no legal
831
+ move: *"let the open PRs merge first"* is a forbidden non-halt reason below, the
832
+ halt list calls itself exhaustive, and neither `complete` nor `blocked` is true —
833
+ the work is done and it was not externally impossible. The only two available
834
+ actions were a rule violation or duplicate work. This row is the third.
835
+
836
+ It is a **report**, not a licence to flip anything. Marking a step the tree
837
+ already closed is a separate, deliberately unbuilt mechanism: it needs the step's
838
+ own `verify:` green against `origin/main`, a decision memo, and a one-strike kill
839
+ criterion, and an autonomous run writing a completion marker into the source of
840
+ truth is not switched on unasked. Until it is, `superseded` reports and the boxes
841
+ stay open — the same discipline the `[~]` prohibition below enforces for
842
+ `blocked`.
843
+
692
844
  `blocked-preflight` **no longer exists** (ADR-237 § 4). A run always starts.
693
845
 
694
846
  ```