@event4u/agent-config 1.15.0 → 1.17.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 (354) hide show
  1. package/.agent-src/commands/{agents-audit.md → agents/audit.md} +4 -3
  2. package/.agent-src/commands/{agents-cleanup.md → agents/cleanup.md} +12 -6
  3. package/.agent-src/commands/{agents-prepare.md → agents/prepare.md} +4 -3
  4. package/.agent-src/commands/agents.md +46 -0
  5. package/.agent-src/commands/bug-fix.md +1 -1
  6. package/.agent-src/commands/bug-investigate.md +2 -2
  7. package/.agent-src/commands/{chat-history-checkpoint.md → chat-history/checkpoint.md} +5 -5
  8. package/.agent-src/commands/{chat-history-clear.md → chat-history/clear.md} +5 -5
  9. package/.agent-src/commands/{chat-history-resume.md → chat-history/resume.md} +4 -4
  10. package/.agent-src/commands/chat-history/show.md +107 -0
  11. package/.agent-src/commands/chat-history.md +33 -89
  12. package/.agent-src/commands/check-current-md.md +1 -1
  13. package/.agent-src/commands/{commit-in-chunks.md → commit/in-chunks.md} +15 -13
  14. package/.agent-src/commands/commit.md +22 -2
  15. package/.agent-src/commands/{context-create.md → context/create.md} +4 -3
  16. package/.agent-src/commands/{context-refactor.md → context/refactor.md} +4 -3
  17. package/.agent-src/commands/context.md +44 -0
  18. package/.agent-src/commands/{copilot-agents-init.md → copilot-agents/init.md} +4 -3
  19. package/.agent-src/commands/{copilot-agents-optimize.md → copilot-agents/optimize.md} +4 -3
  20. package/.agent-src/commands/copilot-agents.md +44 -0
  21. package/.agent-src/commands/council/default.md +221 -0
  22. package/.agent-src/commands/council/design.md +97 -0
  23. package/.agent-src/commands/council/optimize.md +116 -0
  24. package/.agent-src/commands/council/pr.md +124 -0
  25. package/.agent-src/commands/council.md +54 -0
  26. package/.agent-src/commands/{create-pr-description.md → create-pr/description-only.md} +4 -2
  27. package/.agent-src/commands/create-pr.md +49 -5
  28. package/.agent-src/commands/e2e-heal.md +1 -1
  29. package/.agent-src/commands/e2e-plan.md +1 -1
  30. package/.agent-src/commands/{feature-dev.md → feature/dev.md} +6 -3
  31. package/.agent-src/commands/{feature-explore.md → feature/explore.md} +5 -4
  32. package/.agent-src/commands/{feature-plan.md → feature/plan.md} +32 -5
  33. package/.agent-src/commands/{feature-refactor.md → feature/refactor.md} +4 -3
  34. package/.agent-src/commands/{feature-roadmap.md → feature/roadmap.md} +7 -6
  35. package/.agent-src/commands/feature.md +52 -0
  36. package/.agent-src/commands/{fix-ci.md → fix/ci.md} +4 -3
  37. package/.agent-src/commands/{fix-portability.md → fix/portability.md} +4 -3
  38. package/.agent-src/commands/{fix-pr-bot-comments.md → fix/pr-bots.md} +4 -3
  39. package/.agent-src/commands/{fix-pr-developer-comments.md → fix/pr-developers.md} +4 -3
  40. package/.agent-src/commands/{fix-pr-comments.md → fix/pr.md} +7 -6
  41. package/.agent-src/commands/{fix-references.md → fix/refs.md} +4 -3
  42. package/.agent-src/commands/{fix-seeder.md → fix/seeder.md} +4 -3
  43. package/.agent-src/commands/fix.md +54 -0
  44. package/.agent-src/commands/jira-ticket.md +1 -1
  45. package/.agent-src/commands/{do-and-judge.md → judge/on-diff.md} +7 -6
  46. package/.agent-src/commands/judge/solo.md +90 -0
  47. package/.agent-src/commands/{do-in-steps.md → judge/steps.md} +8 -7
  48. package/.agent-src/commands/judge.md +35 -70
  49. package/.agent-src/commands/{memory-add.md → memory/add.md} +7 -6
  50. package/.agent-src/commands/{memory-full.md → memory/load.md} +6 -5
  51. package/.agent-src/commands/{memory-promote.md → memory/promote.md} +6 -5
  52. package/.agent-src/commands/{propose-memory.md → memory/propose.md} +6 -5
  53. package/.agent-src/commands/memory.md +48 -0
  54. package/.agent-src/commands/mode.md +5 -5
  55. package/.agent-src/commands/{module-create.md → module/create.md} +4 -3
  56. package/.agent-src/commands/{module-explore.md → module/explore.md} +4 -3
  57. package/.agent-src/commands/module.md +44 -0
  58. package/.agent-src/commands/onboard.md +3 -3
  59. package/.agent-src/commands/{optimize-agents.md → optimize/agents.md} +5 -4
  60. package/.agent-src/commands/{optimize-augmentignore.md → optimize/augmentignore.md} +4 -4
  61. package/.agent-src/commands/{optimize-rtk-filters.md → optimize/rtk.md} +4 -3
  62. package/.agent-src/commands/{optimize-skills.md → optimize/skills.md} +5 -4
  63. package/.agent-src/commands/optimize.md +48 -0
  64. package/.agent-src/commands/{override-create.md → override/create.md} +4 -3
  65. package/.agent-src/commands/{override-manage.md → override/manage.md} +4 -3
  66. package/.agent-src/commands/override.md +44 -0
  67. package/.agent-src/commands/review-changes.md +26 -1
  68. package/.agent-src/commands/review-routing.md +1 -1
  69. package/.agent-src/commands/{roadmap-create.md → roadmap/create.md} +33 -5
  70. package/.agent-src/commands/{roadmap-execute.md → roadmap/execute.md} +4 -3
  71. package/.agent-src/commands/roadmap.md +44 -0
  72. package/.agent-src/commands/set-cost-profile.md +3 -3
  73. package/.agent-src/commands/sync-agent-settings.md +2 -2
  74. package/.agent-src/commands/{tests-create.md → tests/create.md} +5 -4
  75. package/.agent-src/commands/{tests-execute.md → tests/execute.md} +4 -3
  76. package/.agent-src/commands/tests.md +44 -0
  77. package/.agent-src/commands/upstream-contribute.md +1 -1
  78. package/.agent-src/contexts/authority/commit-mechanics.md +57 -0
  79. package/.agent-src/contexts/authority/destructive-mechanics.md +66 -0
  80. package/.agent-src/contexts/authority/scope-mechanics.md +87 -0
  81. package/.agent-src/contexts/communication/rules-auto/artifact-engagement-recording-mechanics.md +72 -0
  82. package/.agent-src/contexts/communication/rules-auto/augment-portability-mechanics.md +79 -0
  83. package/.agent-src/contexts/communication/rules-auto/augment-source-of-truth-mechanics.md +98 -0
  84. package/.agent-src/contexts/communication/rules-auto/cli-output-handling-mechanics.md +87 -0
  85. package/.agent-src/contexts/communication/rules-auto/command-suggestion-policy-mechanics.md +62 -0
  86. package/.agent-src/contexts/communication/rules-auto/docs-sync-mechanics.md +78 -0
  87. package/.agent-src/contexts/communication/rules-auto/package-ci-checks-mechanics.md +85 -0
  88. package/.agent-src/contexts/communication/rules-auto/review-routing-awareness-mechanics.md +65 -0
  89. package/.agent-src/contexts/communication/rules-auto/roadmap-progress-sync-mechanics.md +78 -0
  90. package/.agent-src/contexts/communication/rules-auto/skill-quality-mechanics.md +62 -0
  91. package/.agent-src/contexts/communication/rules-auto/slash-command-routing-policy-mechanics.md +55 -0
  92. package/.agent-src/contexts/communication/rules-auto/ui-audit-gate-mechanics.md +53 -0
  93. package/.agent-src/contexts/communication/rules-auto/user-interaction-mechanics.md +77 -0
  94. package/.agent-src/contexts/execution/autonomy-detection.md +54 -0
  95. package/.agent-src/contexts/execution/autonomy-examples.md +90 -0
  96. package/.agent-src/contexts/execution/autonomy-mechanics.md +29 -0
  97. package/.agent-src/contexts/execution/verification-mechanics.md +80 -0
  98. package/.agent-src/contexts/judges/no-consolidate-rationale.md +102 -0
  99. package/.agent-src/contexts/judges/persona-voice-rubric.md +140 -0
  100. package/.agent-src/personas/README.md +1 -1
  101. package/.agent-src/rules/agent-authority.md +24 -0
  102. package/.agent-src/rules/architecture.md +1 -1
  103. package/.agent-src/rules/artifact-drafting-protocol.md +1 -1
  104. package/.agent-src/rules/artifact-engagement-recording.md +14 -70
  105. package/.agent-src/rules/ask-when-uncertain.md +28 -43
  106. package/.agent-src/rules/augment-portability.md +15 -61
  107. package/.agent-src/rules/augment-source-of-truth.md +27 -93
  108. package/.agent-src/rules/autonomous-execution.md +78 -114
  109. package/.agent-src/rules/capture-learnings.md +1 -1
  110. package/.agent-src/rules/chat-history-cadence.md +3 -3
  111. package/.agent-src/rules/chat-history-ownership.md +3 -3
  112. package/.agent-src/rules/chat-history-visibility.md +3 -3
  113. package/.agent-src/rules/cli-output-handling.md +10 -76
  114. package/.agent-src/rules/command-suggestion-policy.md +93 -0
  115. package/.agent-src/rules/commit-conventions.md +17 -14
  116. package/.agent-src/rules/commit-policy.md +14 -42
  117. package/.agent-src/rules/context-hygiene.md +3 -3
  118. package/.agent-src/rules/direct-answers.md +34 -49
  119. package/.agent-src/rules/docker-commands.md +5 -5
  120. package/.agent-src/rules/docs-sync.md +16 -70
  121. package/.agent-src/rules/e2e-testing.md +1 -1
  122. package/.agent-src/rules/guidelines.md +4 -4
  123. package/.agent-src/rules/improve-before-implement.md +2 -2
  124. package/.agent-src/rules/language-and-tone.md +50 -133
  125. package/.agent-src/rules/minimal-safe-diff.md +3 -3
  126. package/.agent-src/rules/missing-tool-handling.md +28 -22
  127. package/.agent-src/rules/model-recommendation.md +4 -4
  128. package/.agent-src/rules/no-cheap-questions.md +82 -0
  129. package/.agent-src/rules/no-roadmap-references.md +73 -0
  130. package/.agent-src/rules/non-destructive-by-default.md +15 -49
  131. package/.agent-src/rules/onboarding-gate.md +5 -5
  132. package/.agent-src/rules/package-ci-checks.md +21 -61
  133. package/.agent-src/rules/preservation-guard.md +64 -29
  134. package/.agent-src/rules/review-routing-awareness.md +26 -45
  135. package/.agent-src/rules/roadmap-progress-sync.md +28 -96
  136. package/.agent-src/rules/role-mode-adherence.md +2 -2
  137. package/.agent-src/rules/scope-control.md +65 -46
  138. package/.agent-src/rules/security-sensitive-stop.md +9 -9
  139. package/.agent-src/rules/size-enforcement.md +1 -1
  140. package/.agent-src/rules/skill-quality.md +16 -48
  141. package/.agent-src/rules/{slash-commands.md → slash-command-routing-policy.md} +7 -4
  142. package/.agent-src/rules/think-before-action.md +55 -45
  143. package/.agent-src/rules/token-efficiency.md +4 -4
  144. package/.agent-src/rules/tool-safety.md +19 -16
  145. package/.agent-src/rules/{ui-audit-before-build.md → ui-audit-gate.md} +27 -41
  146. package/.agent-src/rules/user-interaction.md +16 -71
  147. package/.agent-src/rules/verify-before-complete.md +12 -67
  148. package/.agent-src/scripts/update_roadmap_progress.py +9 -4
  149. package/.agent-src/skills/ai-council/SKILL.md +335 -0
  150. package/.agent-src/skills/api-endpoint/SKILL.md +2 -2
  151. package/.agent-src/skills/api-testing/SKILL.md +1 -1
  152. package/.agent-src/skills/blade-ui/SKILL.md +1 -1
  153. package/.agent-src/skills/blast-radius-analyzer/SKILL.md +1 -1
  154. package/.agent-src/skills/bug-analyzer/SKILL.md +1 -1
  155. package/.agent-src/skills/check-refs/SKILL.md +59 -40
  156. package/.agent-src/skills/command-routing/SKILL.md +1 -1
  157. package/.agent-src/skills/command-writing/SKILL.md +1 -1
  158. package/.agent-src/skills/conventional-commits-writing/SKILL.md +86 -28
  159. package/.agent-src/skills/copilot-agents-optimization/SKILL.md +7 -7
  160. package/.agent-src/skills/developer-like-execution/SKILL.md +6 -6
  161. package/.agent-src/skills/finishing-a-development-branch/SKILL.md +101 -65
  162. package/.agent-src/skills/flux/SKILL.md +31 -11
  163. package/.agent-src/skills/git-workflow/SKILL.md +1 -1
  164. package/.agent-src/skills/github-ci/SKILL.md +2 -2
  165. package/.agent-src/skills/guideline-writing/SKILL.md +11 -11
  166. package/.agent-src/skills/judge-code-quality/SKILL.md +7 -8
  167. package/.agent-src/skills/judge-security-auditor/SKILL.md +4 -5
  168. package/.agent-src/skills/judge-test-coverage/SKILL.md +3 -4
  169. package/.agent-src/skills/learning-to-rule-or-skill/SKILL.md +4 -4
  170. package/.agent-src/skills/lint-skills/SKILL.md +57 -39
  171. package/.agent-src/skills/livewire/SKILL.md +1 -1
  172. package/.agent-src/skills/md-language-check/SKILL.md +61 -39
  173. package/.agent-src/skills/override-management/SKILL.md +7 -7
  174. package/.agent-src/skills/php-coder/SKILL.md +1 -1
  175. package/.agent-src/skills/playwright-testing/SKILL.md +2 -2
  176. package/.agent-src/skills/quality-tools/SKILL.md +2 -2
  177. package/.agent-src/skills/react-shadcn-ui/SKILL.md +116 -43
  178. package/.agent-src/skills/readme-reviewer/SKILL.md +31 -30
  179. package/.agent-src/skills/readme-writing/SKILL.md +79 -54
  180. package/.agent-src/skills/readme-writing-package/SKILL.md +51 -48
  181. package/.agent-src/skills/receiving-code-review/SKILL.md +53 -48
  182. package/.agent-src/skills/refine-prompt/SKILL.md +0 -1
  183. package/.agent-src/skills/requesting-code-review/SKILL.md +35 -30
  184. package/.agent-src/skills/review-routing/SKILL.md +2 -2
  185. package/.agent-src/skills/rule-writing/SKILL.md +1 -1
  186. package/.agent-src/skills/security/SKILL.md +7 -2
  187. package/.agent-src/skills/security-audit/SKILL.md +7 -3
  188. package/.agent-src/skills/skill-reviewer/SKILL.md +1 -1
  189. package/.agent-src/skills/skill-writing/SKILL.md +3 -3
  190. package/.agent-src/skills/subagent-orchestration/SKILL.md +1 -0
  191. package/.agent-src/skills/systematic-debugging/SKILL.md +69 -61
  192. package/.agent-src/skills/test-driven-development/SKILL.md +59 -57
  193. package/.agent-src/skills/test-performance/SKILL.md +0 -1
  194. package/.agent-src/skills/traefik/SKILL.md +4 -4
  195. package/.agent-src/skills/upstream-contribute/SKILL.md +1 -1
  196. package/.agent-src/skills/validate-feature-fit/SKILL.md +2 -2
  197. package/.agent-src/skills/{verify-before-complete → verify-completion-evidence}/SKILL.md +30 -28
  198. package/.agent-src/templates/agent-settings.md +8 -8
  199. package/.agent-src/templates/contexts/auth-model.md +1 -1
  200. package/.agent-src/templates/scripts/README.md +2 -2
  201. package/.agent-src/templates/scripts/telemetry/aggregator.py +16 -1
  202. package/.agent-src/templates/scripts/telemetry/engagement.py +59 -0
  203. package/.agent-src/templates/scripts/telemetry/report_renderer.py +28 -1
  204. package/.agent-src/templates/scripts/telemetry_record.py +14 -1
  205. package/.claude-plugin/marketplace.json +31 -12
  206. package/AGENTS.md +11 -9
  207. package/CHANGELOG.md +213 -2
  208. package/README.md +43 -44
  209. package/config/agent-settings.template.yml +58 -1
  210. package/config/gitignore-block.txt +3 -0
  211. package/docs/architecture.md +5 -7
  212. package/docs/catalog.md +359 -0
  213. package/docs/contracts/STABILITY.md +46 -1
  214. package/docs/contracts/adr-chat-history-split.md +1 -3
  215. package/docs/contracts/adr-command-suggestion.md +3 -5
  216. package/docs/contracts/adr-implement-ticket-runtime.md +1 -2
  217. package/docs/contracts/adr-product-ui-track.md +5 -8
  218. package/docs/contracts/adr-prompt-driven-execution.md +3 -4
  219. package/docs/contracts/agent-memory-contract.md +8 -13
  220. package/docs/contracts/artifact-engagement-flow.md +7 -10
  221. package/docs/contracts/command-clusters.md +56 -46
  222. package/docs/contracts/command-suggestion-flow.md +4 -6
  223. package/docs/contracts/context-paths.md +99 -0
  224. package/docs/contracts/file-ownership-matrix.json +6722 -0
  225. package/docs/contracts/file-ownership-matrix.md +134 -0
  226. package/docs/contracts/implement-ticket-flow.md +8 -11
  227. package/docs/contracts/linear-ai-rules-inclusion.md +1 -2
  228. package/docs/contracts/linear-ai-three-layers.md +0 -2
  229. package/docs/contracts/load-context-budget-model.md +178 -0
  230. package/docs/contracts/load-context-schema.md +184 -0
  231. package/docs/contracts/rule-interactions.md +0 -1
  232. package/docs/contracts/rule-interactions.yml +96 -0
  233. package/docs/contracts/rule-priority-hierarchy.md +87 -0
  234. package/docs/contracts/ui-track-flow.md +8 -18
  235. package/docs/customization.md +16 -0
  236. package/docs/end-to-end-walkthroughs.md +165 -0
  237. package/docs/getting-started.md +29 -10
  238. package/docs/github-topics.md +12 -3
  239. package/docs/guidelines/agent-infra/asking-and-brevity-examples.md +100 -0
  240. package/docs/guidelines/agent-infra/language-and-tone-examples.md +79 -0
  241. package/{.agent-src → docs}/guidelines/docs/readme-size-and-splitting.md +26 -25
  242. package/docs/guidelines/php/git.md +164 -0
  243. package/docs/migrations/commands-1.15.0.md +1 -1
  244. package/docs/showcase.md +9 -4
  245. package/docs/skills-catalog.md +14 -8
  246. package/docs/ui-track-mental-model.md +2 -2
  247. package/llms.txt +13 -7
  248. package/package.json +1 -1
  249. package/scripts/_one_off_phase4_dispatch_latency.py +108 -0
  250. package/scripts/_one_off_phase6_trigger_jaccard.py +92 -0
  251. package/scripts/_phase2_shim_helper.py +109 -0
  252. package/scripts/agent-config +33 -0
  253. package/scripts/ai_council/__init__.py +39 -0
  254. package/scripts/ai_council/_default_prices.py +41 -0
  255. package/scripts/ai_council/_one_off_2a4_acceptance.py +208 -0
  256. package/scripts/ai_council/_one_off_context_layer_v1_estimate.py +67 -0
  257. package/scripts/ai_council/_one_off_context_layer_v1_review.py +292 -0
  258. package/scripts/ai_council/_one_off_followups_review.py +259 -0
  259. package/scripts/ai_council/_one_off_nondestructive_inline_audit.py +209 -0
  260. package/scripts/ai_council/_one_off_phase_2a_budget_rebalance.py +257 -0
  261. package/scripts/ai_council/_one_off_phase_2a_post_revert.py +197 -0
  262. package/scripts/ai_council/_one_off_rebalancing_audit.py +149 -0
  263. package/scripts/ai_council/_one_off_roundtrip.py +106 -0
  264. package/scripts/ai_council/_one_off_rule_hardening_v1.py +251 -0
  265. package/scripts/ai_council/_one_off_structural_open_questions.py +232 -0
  266. package/scripts/ai_council/_one_off_structural_optimization.py +144 -0
  267. package/scripts/ai_council/_one_off_structural_v3_gaps.py +252 -0
  268. package/scripts/ai_council/_one_off_structural_v3_review.py +240 -0
  269. package/scripts/ai_council/budget_guard.py +172 -0
  270. package/scripts/ai_council/bundler.py +261 -0
  271. package/scripts/ai_council/clients.py +381 -0
  272. package/scripts/ai_council/modes.py +127 -0
  273. package/scripts/ai_council/orchestrator.py +350 -0
  274. package/scripts/ai_council/pricing.py +213 -0
  275. package/scripts/ai_council/project_context.py +159 -0
  276. package/scripts/ai_council/prompts.py +232 -0
  277. package/scripts/ai_council/session.py +144 -0
  278. package/scripts/check_always_budget.py +444 -0
  279. package/scripts/check_augmentignore.py +69 -0
  280. package/scripts/check_cluster_patterns.py +159 -0
  281. package/scripts/check_command_count_messaging.py +127 -0
  282. package/scripts/check_context_paths.py +201 -0
  283. package/scripts/check_no_roadmap_refs.py +155 -0
  284. package/scripts/check_phase_coupling.py +148 -0
  285. package/scripts/check_portability.py +57 -0
  286. package/scripts/check_public_catalog_links.py +122 -0
  287. package/scripts/check_references.py +33 -3
  288. package/scripts/check_roadmap_trackable.py +111 -0
  289. package/scripts/check_safety_floor_untouched.py +125 -0
  290. package/scripts/command_suggester/cooldown.py +1 -1
  291. package/scripts/command_suggester/loader.py +4 -1
  292. package/scripts/compress.py +59 -13
  293. package/scripts/generate_index.py +270 -0
  294. package/scripts/generate_ownership_matrix.py +323 -0
  295. package/scripts/hooks/augment-roadmap-progress.sh +57 -0
  296. package/scripts/install.py +49 -28
  297. package/scripts/install_anthropic_key.sh +5 -0
  298. package/scripts/install_openai_key.sh +106 -0
  299. package/scripts/lint_load_context.py +163 -0
  300. package/scripts/lint_no_new_atomic_commands.py +12 -11
  301. package/scripts/requirements-evals.txt +1 -0
  302. package/scripts/roadmap_progress_hook.py +159 -0
  303. package/scripts/schemas/command.schema.json +22 -1
  304. package/scripts/schemas/rule.schema.json +10 -0
  305. package/scripts/skill_linter.py +13 -4
  306. package/scripts/sync_agent_settings.py +26 -3
  307. package/scripts/update_counts.py +16 -4
  308. package/scripts/update_prices.py +124 -0
  309. package/.agent-src/guidelines/php/git.md +0 -96
  310. package/.agent-src/rules/command-suggestion.md +0 -134
  311. /package/{.agent-src → docs}/guidelines/agent-infra/agent-interaction-and-decision-quality.md +0 -0
  312. /package/{.agent-src → docs}/guidelines/agent-infra/break-glass-usage.md +0 -0
  313. /package/{.agent-src → docs}/guidelines/agent-infra/developer-judgment.md +0 -0
  314. /package/{.agent-src → docs}/guidelines/agent-infra/engineering-memory-data-format.md +0 -0
  315. /package/{.agent-src → docs}/guidelines/agent-infra/layered-settings.md +0 -0
  316. /package/{.agent-src → docs}/guidelines/agent-infra/memory-access.md +0 -0
  317. /package/{.agent-src → docs}/guidelines/agent-infra/naming.md +0 -0
  318. /package/{.agent-src → docs}/guidelines/agent-infra/output-patterns.md +0 -0
  319. /package/{.agent-src → docs}/guidelines/agent-infra/review-routing-data-format.md +0 -0
  320. /package/{.agent-src → docs}/guidelines/agent-infra/role-contracts.md +0 -0
  321. /package/{.agent-src → docs}/guidelines/agent-infra/role-mode-router.md +0 -0
  322. /package/{.agent-src → docs}/guidelines/agent-infra/runtime-layer.md +0 -0
  323. /package/{.agent-src → docs}/guidelines/agent-infra/self-improvement-pipeline.md +0 -0
  324. /package/{.agent-src → docs}/guidelines/agent-infra/size-and-scope.md +0 -0
  325. /package/{.agent-src → docs}/guidelines/agent-infra/tool-integration.md +0 -0
  326. /package/{.agent-src → docs}/guidelines/e2e/playwright.md +0 -0
  327. /package/{.agent-src → docs}/guidelines/php/api-design.md +0 -0
  328. /package/{.agent-src → docs}/guidelines/php/artisan-commands.md +0 -0
  329. /package/{.agent-src → docs}/guidelines/php/blade-ui.md +0 -0
  330. /package/{.agent-src → docs}/guidelines/php/controllers.md +0 -0
  331. /package/{.agent-src → docs}/guidelines/php/database.md +0 -0
  332. /package/{.agent-src → docs}/guidelines/php/eloquent.md +0 -0
  333. /package/{.agent-src → docs}/guidelines/php/flux.md +0 -0
  334. /package/{.agent-src → docs}/guidelines/php/general.md +0 -0
  335. /package/{.agent-src → docs}/guidelines/php/jobs.md +0 -0
  336. /package/{.agent-src → docs}/guidelines/php/livewire.md +0 -0
  337. /package/{.agent-src → docs}/guidelines/php/logging.md +0 -0
  338. /package/{.agent-src → docs}/guidelines/php/naming.md +0 -0
  339. /package/{.agent-src → docs}/guidelines/php/patterns/dependency-injection.md +0 -0
  340. /package/{.agent-src → docs}/guidelines/php/patterns/dtos.md +0 -0
  341. /package/{.agent-src → docs}/guidelines/php/patterns/events.md +0 -0
  342. /package/{.agent-src → docs}/guidelines/php/patterns/factory.md +0 -0
  343. /package/{.agent-src → docs}/guidelines/php/patterns/pipelines.md +0 -0
  344. /package/{.agent-src → docs}/guidelines/php/patterns/policies.md +0 -0
  345. /package/{.agent-src → docs}/guidelines/php/patterns/repositories.md +0 -0
  346. /package/{.agent-src → docs}/guidelines/php/patterns/service-layer.md +0 -0
  347. /package/{.agent-src → docs}/guidelines/php/patterns/strategy.md +0 -0
  348. /package/{.agent-src → docs}/guidelines/php/patterns.md +0 -0
  349. /package/{.agent-src → docs}/guidelines/php/performance.md +0 -0
  350. /package/{.agent-src → docs}/guidelines/php/resources.md +0 -0
  351. /package/{.agent-src → docs}/guidelines/php/security.md +0 -0
  352. /package/{.agent-src → docs}/guidelines/php/sql.md +0 -0
  353. /package/{.agent-src → docs}/guidelines/php/validations.md +0 -0
  354. /package/{.agent-src → docs}/guidelines/php/websocket.md +0 -0
@@ -0,0 +1,106 @@
1
+ """One-off Phase-1 round-trip runner.
2
+
3
+ Used exactly once to generate the evidence artefact required to lift
4
+ the capture-only fence on `road-to-ai-council.md` Phase 2+ and the
5
+ end-to-end verification on `road-to-council-modes.md` Phase 2a.
6
+
7
+ Not part of the public CLI surface — `/council` remains the supported
8
+ entry point. This script is committed under `scripts/ai_council/` so
9
+ the evidence is reproducible from the git history alone.
10
+
11
+ Invocation:
12
+ .venv/bin/python -m scripts.ai_council._one_off_roundtrip
13
+ """
14
+ from __future__ import annotations
15
+
16
+ import sys
17
+ from pathlib import Path
18
+
19
+ from scripts.ai_council.bundler import bundle_roadmap
20
+ from scripts.ai_council.clients import AnthropicClient, load_anthropic_key
21
+ from scripts.ai_council.orchestrator import (
22
+ CostBudget,
23
+ CouncilQuestion,
24
+ consult,
25
+ estimate,
26
+ )
27
+ from scripts.ai_council.pricing import estimate_cost, load_prices
28
+ from scripts.ai_council.project_context import detect_project_context
29
+ from scripts.ai_council.session import SessionManifest, save as save_session
30
+
31
+ REPO_ROOT = Path(__file__).resolve().parents[2]
32
+ ROADMAP_PATH = REPO_ROOT / "agents/roadmaps/road-to-council-modes.md"
33
+
34
+ ORIGINAL_ASK = (
35
+ "Bitte review die folgende Roadmap (council-modes Phase 2c "
36
+ "Playwright). Die Maintainer-Recommendations für Q1-Q5 sind im "
37
+ "Block 'Decisions Required' bereits hinterlegt. Frage: sollten "
38
+ "wir die Recommendations annehmen wie sie sind, oder gibt es "
39
+ "blinde Flecken die wir vor dem Lift der capture-only fence "
40
+ "kläeren sollten?"
41
+ )
42
+
43
+
44
+ def main() -> int:
45
+ api_key = load_anthropic_key()
46
+ client = AnthropicClient(api_key=api_key)
47
+
48
+ context = bundle_roadmap(ROADMAP_PATH)
49
+ project = detect_project_context(REPO_ROOT)
50
+ table = load_prices()
51
+
52
+ question = CouncilQuestion(
53
+ mode="roadmap",
54
+ user_prompt=context.text,
55
+ max_tokens=2048,
56
+ )
57
+
58
+ estimates = estimate(
59
+ question, [client], table,
60
+ project=project, original_ask=ORIGINAL_ASK,
61
+ )
62
+ print(f"[estimate] {client.name}/{client.model}: "
63
+ f"~{estimates[0].input_tokens} in + {estimates[0].output_tokens} out "
64
+ f"= ${estimates[0].total_usd:.4f}")
65
+
66
+ budget = CostBudget(
67
+ max_input_tokens=50_000,
68
+ max_output_tokens=20_000,
69
+ max_calls=10,
70
+ max_total_usd=0.50,
71
+ )
72
+
73
+ print(f"[consult] calling {client.name}/{client.model} ...")
74
+ responses = consult(
75
+ [client], question, budget,
76
+ table=table, project=project, original_ask=ORIGINAL_ASK,
77
+ )
78
+
79
+ if not responses or responses[0].error:
80
+ err = responses[0].error if responses else "no response"
81
+ print(f"[error] {err}", file=sys.stderr)
82
+ return 1
83
+
84
+ r = responses[0]
85
+ actual = estimate_cost(r.provider, r.model, r.input_tokens, r.output_tokens, table)
86
+ actual_usd = actual.total_usd
87
+ print(f"[done] tokens: {r.input_tokens} in / {r.output_tokens} out · "
88
+ f"latency: {r.latency_ms} ms · actual ${actual_usd:.4f}")
89
+
90
+ manifest = SessionManifest(
91
+ mode="roadmap",
92
+ artefact=str(ROADMAP_PATH.relative_to(REPO_ROOT)),
93
+ original_ask=ORIGINAL_ASK,
94
+ members=[f"{r.provider}/{r.model}"],
95
+ rounds=1,
96
+ cost_usd_estimated=estimates[0].total_usd,
97
+ cost_usd_actual=actual_usd,
98
+ extra={"purpose": "Phase 1 ai-council round-trip + Phase 2a council-modes E2E evidence"},
99
+ )
100
+ session_dir = save_session(manifest=manifest, responses=responses)
101
+ print(f"[saved] {session_dir.relative_to(REPO_ROOT)}/")
102
+ return 0
103
+
104
+
105
+ if __name__ == "__main__":
106
+ raise SystemExit(main())
@@ -0,0 +1,251 @@
1
+ """Council review of road-to-rule-hardening.md v1.
2
+
3
+ Three independent self-check rules silently skipped within one
4
+ session despite being valid, loaded, and active. Host agent drafted
5
+ a 6-phase lightweight roadmap proposing a 3-tier hardening model
6
+ (Mechanical / Nudge / Inherent-soft).
7
+
8
+ Council task: validate the architecture and the pilot order before
9
+ the host agent autonomously implements Tier 1 hooks.
10
+
11
+ Invocation:
12
+ .venv/bin/python -m scripts.ai_council._one_off_rule_hardening_v1
13
+ """
14
+ from __future__ import annotations
15
+
16
+ import sys
17
+ from pathlib import Path
18
+
19
+ from scripts.ai_council.bundler import bundle_prompt
20
+ from scripts.ai_council.clients import (
21
+ AnthropicClient,
22
+ OpenAIClient,
23
+ load_anthropic_key,
24
+ load_openai_key,
25
+ )
26
+ from scripts.ai_council.orchestrator import (
27
+ CostBudget,
28
+ CouncilQuestion,
29
+ consult,
30
+ estimate,
31
+ )
32
+ from scripts.ai_council.pricing import estimate_cost, load_prices
33
+ from scripts.ai_council.project_context import detect_project_context
34
+ from scripts.ai_council.session import SessionManifest, save as save_session
35
+
36
+ REPO_ROOT = Path(__file__).resolve().parents[2]
37
+ ROADMAP_PATH = REPO_ROOT / "agents/roadmaps/road-to-rule-hardening.md"
38
+
39
+ ORIGINAL_ASK = (
40
+ "Three independent self-check rules silently skipped within one "
41
+ "session: model-recommendation (task-start gate), context-hygiene "
42
+ "(turn-count handoff), roadmap-progress-sync (file-write side "
43
+ "effect). All valid, loaded, active. Host agent drafted a 6-phase "
44
+ "lightweight roadmap proposing a 3-tier hardening model. Council "
45
+ "task: validate the architecture and the pilot ordering before "
46
+ "implementation."
47
+ )
48
+
49
+ PROMPT_HEADER = """\
50
+ # Council Review — road-to-rule-hardening.md v1
51
+
52
+ ## Background (verbatim, do not re-frame)
53
+
54
+ Within a single session the host agent observed three rules failing
55
+ the same way:
56
+
57
+ | Rule | Trigger that should have fired | What happened |
58
+ |---|---|---|
59
+ | `model-recommendation` | Opus recommendation at task-start | silently skipped |
60
+ | `context-hygiene` | Handoff at turn-count >= 20/40/60 | silently skipped |
61
+ | `roadmap-progress-sync` | Regenerate dashboard on roadmap touch | silently skipped |
62
+
63
+ All three are valid auto-load rules in `.augment/rules/`, all three
64
+ are part of the active rule set surfaced to the agent. None of them
65
+ fired. Hypothesis: they share a structural property — the trigger
66
+ is observable only inside the agent, the check runs in the agent's
67
+ head, no deterministic gate sits between decision and output. When
68
+ the agent is in flow (multi-tool work, file edits, council
69
+ orchestration), the self-check is the first thing to be dropped.
70
+
71
+ The host agent drafted a 6-phase lightweight roadmap proposing a
72
+ 3-tier model:
73
+
74
+ - **Tier 1 — Mechanical.** Hook + deterministic check.
75
+ Agent-independent.
76
+ - **Tier 2 — Nudge.** Hook detects, marker injected, agent
77
+ formulates the response.
78
+ - **Tier 3 — Inherent soft.** No platform mechanism exists. Either
79
+ accept as self-check, convert to user-invoked `/`-command, or
80
+ deprecate.
81
+
82
+ Pilot order proposed by user: roadmap-progress-sync (1) → onboarding-gate
83
+ (3) → context-hygiene (2). Hook surface available today: Augment
84
+ PostToolUse / Stop, Claude Code Stop / SessionStart. Cursor / Cline /
85
+ Windsurf parity is explicitly out of scope for this roadmap.
86
+
87
+ Existing precedent: `chat-history-cadence` is the only rule already
88
+ mechanically hardened (heartbeat marker pattern). Inventory:
89
+ 57 rules total, 18 contain self-check phrases (`MUST`, `MANDATORY`,
90
+ `pre-send`, `before drafting`), 6 mention hooks today.
91
+
92
+ ## Your task
93
+
94
+ Review road-to-rule-hardening.md v1 (full text appended below).
95
+ Be adversarial — the host will autonomously execute the pilots, so
96
+ catch architectural mistakes now, not after Phase 4.
97
+
98
+ 1. **Three-tier model:** is Mechanical / Nudge / Inherent-soft the
99
+ right partition, or does it collapse meaningful distinctions?
100
+ Specifically: should "Tier 2 Nudge" exist at all, or is it just a
101
+ weaker Tier 1?
102
+ 2. **Pilot order (1, 3, 2):** does roadmap-progress-sync prove the
103
+ pattern, or is it too narrow to generalise? Is per-turn counter
104
+ (context-hygiene) actually feasible cross-platform, or should it
105
+ move to Tier 3?
106
+ 3. **Failure-class generalisation:** are there self-check rules in
107
+ the inventory that the audit will MISS because they fire so
108
+ rarely the agent has not yet observed a skip? Name 1-2 likely
109
+ candidates.
110
+ 4. **Cross-platform scope:** roadmap defers Cursor/Cline/Windsurf.
111
+ Is this honest scope or hidden tech debt that will silently
112
+ block Phase 4 rollout?
113
+ 5. **Tier 3 disposition:** the roadmap allows accept-as-soft as a
114
+ valid disposition. Is that a real choice, or a way to declare
115
+ victory without solving anything?
116
+
117
+ ## Output contract (STRICT)
118
+
119
+ For EACH of the six phases:
120
+
121
+ ```
122
+ ### Phase N — <title>
123
+
124
+ **Verdict:** <ACCEPT | PARTIAL | REJECT>
125
+ **What v1 gets right (1 sentence):** ...
126
+ **What v1 misses or over-reaches (1-2 sentences):** ...
127
+ **Concrete change to v2 (binding):** ...
128
+ ```
129
+
130
+ Then five answers to the questions above (numbered 1-5, ≤ 3 sentences
131
+ each).
132
+
133
+ Then a final block:
134
+
135
+ ```
136
+ ### Greenlight verdict
137
+
138
+ <one of: FULL GREENLIGHT — proceed with pilots / CONDITIONAL GREENLIGHT
139
+ — apply N revisions then proceed / BLOCKED — major rework needed>
140
+
141
+ **Binding revisions for v2 (numbered, ≤ 6):** ...
142
+ **Pilot order recommendation:** <1,3,2 | 1,2,3 | 3,1,2 | other>
143
+ **One-line architectural risk you would still proceed with:** ...
144
+ ```
145
+
146
+ Total response budget: ≤ 1500 words. Do not re-write the roadmap.
147
+ """
148
+
149
+
150
+ def _read(path: Path) -> str:
151
+ return path.read_text(encoding="utf-8") if path.exists() else ""
152
+
153
+
154
+ def main() -> int:
155
+ anthropic = AnthropicClient(api_key=load_anthropic_key(), model="claude-sonnet-4-5")
156
+ openai = OpenAIClient(api_key=load_openai_key(), model="gpt-4o")
157
+ members = [anthropic, openai]
158
+
159
+ roadmap_text = _read(ROADMAP_PATH)
160
+ if not roadmap_text:
161
+ print(f"[error] roadmap not found: {ROADMAP_PATH}", file=sys.stderr)
162
+ return 1
163
+
164
+ bundle_text = "\n\n---\n\n".join([
165
+ PROMPT_HEADER,
166
+ "## Roadmap v1 (verbatim, the artefact to validate)\n\n" + roadmap_text,
167
+ ])
168
+ context = bundle_prompt(bundle_text)
169
+ project = detect_project_context(REPO_ROOT)
170
+ table = load_prices()
171
+
172
+ question = CouncilQuestion(
173
+ mode="prompt",
174
+ user_prompt=context.text,
175
+ max_tokens=4096,
176
+ )
177
+
178
+ estimates = estimate(
179
+ question, members, table, project=project, original_ask=ORIGINAL_ASK,
180
+ )
181
+ print("=== ESTIMATE (single round, max tokens) ===")
182
+ total_est = 0.0
183
+ for c, e in zip(members, estimates):
184
+ print(f" {c.name}/{c.model}: ~{e.input_tokens} in + {e.output_tokens} out = ${e.total_usd:.4f}")
185
+ total_est += e.total_usd
186
+ print(f" TOTAL per round (max): ${total_est:.4f}")
187
+ print()
188
+
189
+ budget = CostBudget(
190
+ max_input_tokens=200_000,
191
+ max_output_tokens=80_000,
192
+ max_calls=20,
193
+ max_total_usd=2.50,
194
+ )
195
+
196
+ rounds_collected: list[list] = []
197
+
198
+ def _on_round_complete(round_idx: int, round_responses) -> None:
199
+ rounds_collected.append(list(round_responses))
200
+ print(f"=== ROUND {round_idx + 1} COMPLETE ===")
201
+ for r in round_responses:
202
+ if r.error:
203
+ print(f" [error] {r.provider}/{r.model}: {r.error}")
204
+ continue
205
+ actual = estimate_cost(r.provider, r.model, r.input_tokens, r.output_tokens, table)
206
+ print(f" [done] {r.provider}/{r.model}: {r.input_tokens} in / "
207
+ f"{r.output_tokens} out · {r.latency_ms} ms · ${actual.total_usd:.4f}")
208
+ print()
209
+
210
+ print("=== CONSULT (1 round) ===")
211
+ consult(
212
+ members, question, budget,
213
+ rounds=1,
214
+ on_round_complete=_on_round_complete,
215
+ table=table, project=project, original_ask=ORIGINAL_ASK,
216
+ )
217
+
218
+ if not rounds_collected:
219
+ print("[error] no rounds completed", file=sys.stderr)
220
+ return 1
221
+
222
+ actual_total = 0.0
223
+ for round_responses in rounds_collected:
224
+ for r in round_responses:
225
+ if r.error:
226
+ continue
227
+ actual = estimate_cost(r.provider, r.model, r.input_tokens, r.output_tokens, table)
228
+ actual_total += actual.total_usd
229
+ print(f"=== TOTAL ACTUAL: ${actual_total:.4f} ===")
230
+
231
+ final_round = rounds_collected[-1]
232
+ if not [r for r in final_round if not r.error]:
233
+ return 1
234
+
235
+ manifest = SessionManifest(
236
+ mode="prompt",
237
+ artefact=str(ROADMAP_PATH.relative_to(REPO_ROOT)),
238
+ original_ask=ORIGINAL_ASK,
239
+ members=[f"{r.provider}/{r.model}" for r in final_round],
240
+ rounds=len(rounds_collected),
241
+ cost_usd_estimated=total_est,
242
+ cost_usd_actual=actual_total,
243
+ extra={"purpose": "Council review of road-to-rule-hardening v1"},
244
+ )
245
+ session_dir = save_session(manifest=manifest, responses=rounds_collected)
246
+ print(f"[saved] {session_dir.relative_to(REPO_ROOT)}/")
247
+ return 1 if any(r.error for round_r in rounds_collected for r in round_r) else 0
248
+
249
+
250
+ if __name__ == "__main__":
251
+ raise SystemExit(main())
@@ -0,0 +1,232 @@
1
+ """One-off council run for the three open questions in road-to-structural-optimization.md v2.
2
+
3
+ Forces a STRUCTURED multiple-choice verdict per question across 2 rounds
4
+ (debate mode). Saves the session under agents/council-sessions/.
5
+
6
+ Invocation:
7
+ .venv/bin/python -m scripts.ai_council._one_off_structural_open_questions
8
+ """
9
+ from __future__ import annotations
10
+
11
+ import sys
12
+ from pathlib import Path
13
+
14
+ from scripts.ai_council.bundler import bundle_roadmap
15
+ from scripts.ai_council.clients import (
16
+ AnthropicClient,
17
+ OpenAIClient,
18
+ load_anthropic_key,
19
+ load_openai_key,
20
+ )
21
+ from scripts.ai_council.orchestrator import (
22
+ CostBudget,
23
+ CouncilQuestion,
24
+ consult,
25
+ estimate,
26
+ )
27
+ from scripts.ai_council.pricing import estimate_cost, load_prices
28
+ from scripts.ai_council.project_context import detect_project_context
29
+ from scripts.ai_council.session import SessionManifest, save as save_session
30
+
31
+ REPO_ROOT = Path(__file__).resolve().parents[2]
32
+ ROADMAP_PATH = REPO_ROOT / "agents/roadmaps/road-to-structural-optimization.md"
33
+
34
+ ORIGINAL_ASK = (
35
+ "Lock the three open design questions on road-to-structural-optimization.md v2 "
36
+ "with binding A/B verdicts + 2-3 sentence rationale each. The roadmap text "
37
+ "is the context. Be decisive — say A or B (or C with new option). Avoid "
38
+ "'depends' or 'further investigation needed'."
39
+ )
40
+
41
+ OPEN_QUESTIONS_PROMPT = """\
42
+ # Lock-the-Decision Council Round
43
+
44
+ You have already reviewed road-to-structural-optimization.md v2 in two prior \
45
+ rounds (architectural / sequencing critique). The roadmap author now needs \
46
+ **binding verdicts** on the three open design questions. Stop re-reviewing the \
47
+ roadmap. Pick A, B, or propose C with explicit justification.
48
+
49
+ ## Output Contract (STRICT)
50
+
51
+ For each question, produce exactly this block:
52
+
53
+ ```
54
+ ### Q<n>: <short title>
55
+
56
+ **Verdict:** <A | B | C>
57
+ **Confidence:** <Low | Medium | High>
58
+ **Rationale (2-4 sentences):** <why this option, what failure mode of the other you avoid>
59
+ **Risk if wrong:** <one sentence — what breaks if your verdict is the wrong call>
60
+ **Rollback if wrong:** <one sentence — how to recover if production reveals the choice was bad>
61
+ ```
62
+
63
+ If you propose C (new option), keep the same block structure.
64
+
65
+ ## Q1 — Phase 3a Skill Consolidation Shape
66
+
67
+ The four `judge-*` skills (`judge-bug-hunter`, `judge-code-quality`, \
68
+ `judge-security-auditor`, `judge-test-coverage`) share procedure but \
69
+ have distinct persona voices. Two consolidation shapes:
70
+
71
+ - **A.** Keep four separate skills. Extract the shared procedure to \
72
+ `contexts/judges/judge-shared-procedure.md`. Each skill's SKILL.md \
73
+ loads the context via `load_context:` and adds its persona-specific \
74
+ delta (review heuristics, persona prompt, examples).
75
+ - **B.** Single skill `judge` with `mode:` parameter \
76
+ (`mode: bug-hunter | code-quality | security-auditor | test-coverage`). \
77
+ One SKILL.md dispatches; persona contexts live at \
78
+ `contexts/judges/personas/<mode>.md` and are loaded based on `mode:`.
79
+
80
+ **Decision criterion:** which preserves persona voice better at LLM \
81
+ runtime, and which is more maintainable when a fifth judge persona is \
82
+ added in 6 months?
83
+
84
+ ## Q2 — Phase 6 chat-history Rule Consolidation Shape
85
+
86
+ Three rules (`chat-history-cadence`, `chat-history-ownership`, \
87
+ `chat-history-visibility`) overlap on triggers and surface but each \
88
+ encodes a distinct concern. Two consolidation shapes:
89
+
90
+ - **A.** One rule `chat-history` + three contexts \
91
+ (`contexts/chat-history/cadence.md`, `.../ownership.md`, \
92
+ `.../visibility.md`). The rule body holds the unified trigger language \
93
+ and routes to the right context section based on the matched anchor.
94
+ - **B.** Router rule `chat-history` + three thin specialist rules \
95
+ (`chat-history-cadence` etc.) reduced to <30 LOC each. Router fires \
96
+ first, dispatches to one specialist based on signal type \
97
+ (heartbeat / ownership-detection / cadence-decision).
98
+
99
+ **Decision criterion:** which is more maintainable when a fourth concern \
100
+ (e.g., `chat-history-archive` for log rotation) is added in 12 months, \
101
+ and which has lower cognitive load for an agent reading the rule first \
102
+ time mid-task?
103
+
104
+ ## Q3 — Phase 5 Safety-Floor Rule Endorsement
105
+
106
+ Phase 5 tightens the always-rule budget. The four safety-floor rules are:
107
+
108
+ - `non-destructive-by-default` (~4,607 chars)
109
+ - `commit-policy` (~2,800 chars)
110
+ - `scope-control` (~3,900 chars)
111
+ - `verify-before-complete` (~3,200 chars)
112
+
113
+ Should these be in scope for slimming?
114
+
115
+ - **A.** Endorse keeping all four UNTOUCHED. Slimming risks weakening Iron \
116
+ Laws under budget pressure. Phase 5 hits target without them.
117
+ - **B.** Allow slimming with stricter 2A.4-style obligation-diff (every \
118
+ MUST/NEVER preserved verbatim, mechanics moved to context). Treat them \
119
+ like normal always-rules.
120
+
121
+ **Decision criterion:** is the marginal budget gain worth the residual \
122
+ risk of an Iron Law regression slipping through the obligation-diff \
123
+ gate?
124
+
125
+ ## Final Output
126
+
127
+ After the three blocks, add:
128
+
129
+ ```
130
+ ### Cross-question coupling
131
+
132
+ <2-3 sentences: do your verdicts on Q1/Q2/Q3 reinforce or conflict with \
133
+ each other? Are there hidden dependencies between them?>
134
+ ```
135
+
136
+ Do not write an executive summary. Do not re-review v2. Pick, justify, \
137
+ ship. Total response budget: ≤ 1500 words.
138
+ """
139
+
140
+
141
+ def main() -> int:
142
+ anthropic = AnthropicClient(api_key=load_anthropic_key(), model="claude-sonnet-4-5")
143
+ openai = OpenAIClient(api_key=load_openai_key(), model="gpt-4o")
144
+ members = [anthropic, openai]
145
+
146
+ context = bundle_roadmap(ROADMAP_PATH)
147
+ project = detect_project_context(REPO_ROOT)
148
+ table = load_prices()
149
+
150
+ user_prompt = OPEN_QUESTIONS_PROMPT + "\n\n---\n\n" + context.text
151
+
152
+ question = CouncilQuestion(
153
+ mode="roadmap",
154
+ user_prompt=user_prompt,
155
+ max_tokens=4096,
156
+ )
157
+
158
+ estimates = estimate(
159
+ question, members, table, project=project, original_ask=ORIGINAL_ASK,
160
+ )
161
+ print("=== ESTIMATE (single round, max tokens) ===")
162
+ total_est = 0.0
163
+ for c, e in zip(members, estimates):
164
+ print(f" {c.name}/{c.model}: ~{e.input_tokens} in + {e.output_tokens} out = ${e.total_usd:.4f}")
165
+ total_est += e.total_usd
166
+ print(f" TOTAL per round (max): ${total_est:.4f}")
167
+ print(f" TOTAL 2 rounds (max): ${total_est * 2:.4f}")
168
+ print()
169
+
170
+ budget = CostBudget(
171
+ max_input_tokens=200_000,
172
+ max_output_tokens=80_000,
173
+ max_calls=20,
174
+ max_total_usd=2.50,
175
+ )
176
+
177
+ rounds_collected: list[list] = []
178
+
179
+ def _on_round_complete(round_idx: int, round_responses) -> None:
180
+ rounds_collected.append(list(round_responses))
181
+ print(f"=== ROUND {round_idx + 1} COMPLETE ===")
182
+ for r in round_responses:
183
+ if r.error:
184
+ print(f" [error] {r.provider}/{r.model}: {r.error}")
185
+ continue
186
+ actual = estimate_cost(r.provider, r.model, r.input_tokens, r.output_tokens, table)
187
+ print(f" [done] {r.provider}/{r.model}: {r.input_tokens} in / "
188
+ f"{r.output_tokens} out · {r.latency_ms} ms · ${actual.total_usd:.4f}")
189
+ print()
190
+
191
+ print("=== CONSULT (2 rounds, debate mode) ===")
192
+ consult(
193
+ members, question, budget,
194
+ rounds=2,
195
+ on_round_complete=_on_round_complete,
196
+ table=table, project=project, original_ask=ORIGINAL_ASK,
197
+ )
198
+
199
+ if not rounds_collected:
200
+ print("[error] no rounds completed", file=sys.stderr)
201
+ return 1
202
+
203
+ actual_total = 0.0
204
+ for round_responses in rounds_collected:
205
+ for r in round_responses:
206
+ if r.error:
207
+ continue
208
+ actual = estimate_cost(r.provider, r.model, r.input_tokens, r.output_tokens, table)
209
+ actual_total += actual.total_usd
210
+ print(f"=== TOTAL ACTUAL: ${actual_total:.4f} (across {len(rounds_collected)} rounds) ===")
211
+
212
+ final_round = rounds_collected[-1]
213
+ if not [r for r in final_round if not r.error]:
214
+ return 1
215
+
216
+ manifest = SessionManifest(
217
+ mode="roadmap",
218
+ artefact=str(ROADMAP_PATH.relative_to(REPO_ROOT)),
219
+ original_ask=ORIGINAL_ASK,
220
+ members=[f"{r.provider}/{r.model}" for r in final_round],
221
+ rounds=len(rounds_collected),
222
+ cost_usd_estimated=total_est * 2,
223
+ cost_usd_actual=actual_total,
224
+ extra={"purpose": "council lock on three open questions of structural-optimization v2"},
225
+ )
226
+ session_dir = save_session(manifest=manifest, responses=rounds_collected)
227
+ print(f"[saved] {session_dir.relative_to(REPO_ROOT)}/")
228
+ return 1 if any(r.error for round_r in rounds_collected for r in round_r) else 0
229
+
230
+
231
+ if __name__ == "__main__":
232
+ raise SystemExit(main())