@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.
- package/.agent-src/commands/{agents-audit.md → agents/audit.md} +4 -3
- package/.agent-src/commands/{agents-cleanup.md → agents/cleanup.md} +12 -6
- package/.agent-src/commands/{agents-prepare.md → agents/prepare.md} +4 -3
- package/.agent-src/commands/agents.md +46 -0
- package/.agent-src/commands/bug-fix.md +1 -1
- package/.agent-src/commands/bug-investigate.md +2 -2
- package/.agent-src/commands/{chat-history-checkpoint.md → chat-history/checkpoint.md} +5 -5
- package/.agent-src/commands/{chat-history-clear.md → chat-history/clear.md} +5 -5
- package/.agent-src/commands/{chat-history-resume.md → chat-history/resume.md} +4 -4
- package/.agent-src/commands/chat-history/show.md +107 -0
- package/.agent-src/commands/chat-history.md +33 -89
- package/.agent-src/commands/check-current-md.md +1 -1
- package/.agent-src/commands/{commit-in-chunks.md → commit/in-chunks.md} +15 -13
- package/.agent-src/commands/commit.md +22 -2
- package/.agent-src/commands/{context-create.md → context/create.md} +4 -3
- package/.agent-src/commands/{context-refactor.md → context/refactor.md} +4 -3
- package/.agent-src/commands/context.md +44 -0
- package/.agent-src/commands/{copilot-agents-init.md → copilot-agents/init.md} +4 -3
- package/.agent-src/commands/{copilot-agents-optimize.md → copilot-agents/optimize.md} +4 -3
- package/.agent-src/commands/copilot-agents.md +44 -0
- package/.agent-src/commands/council/default.md +221 -0
- package/.agent-src/commands/council/design.md +97 -0
- package/.agent-src/commands/council/optimize.md +116 -0
- package/.agent-src/commands/council/pr.md +124 -0
- package/.agent-src/commands/council.md +54 -0
- package/.agent-src/commands/{create-pr-description.md → create-pr/description-only.md} +4 -2
- package/.agent-src/commands/create-pr.md +49 -5
- package/.agent-src/commands/e2e-heal.md +1 -1
- package/.agent-src/commands/e2e-plan.md +1 -1
- package/.agent-src/commands/{feature-dev.md → feature/dev.md} +6 -3
- package/.agent-src/commands/{feature-explore.md → feature/explore.md} +5 -4
- package/.agent-src/commands/{feature-plan.md → feature/plan.md} +32 -5
- package/.agent-src/commands/{feature-refactor.md → feature/refactor.md} +4 -3
- package/.agent-src/commands/{feature-roadmap.md → feature/roadmap.md} +7 -6
- package/.agent-src/commands/feature.md +52 -0
- package/.agent-src/commands/{fix-ci.md → fix/ci.md} +4 -3
- package/.agent-src/commands/{fix-portability.md → fix/portability.md} +4 -3
- package/.agent-src/commands/{fix-pr-bot-comments.md → fix/pr-bots.md} +4 -3
- package/.agent-src/commands/{fix-pr-developer-comments.md → fix/pr-developers.md} +4 -3
- package/.agent-src/commands/{fix-pr-comments.md → fix/pr.md} +7 -6
- package/.agent-src/commands/{fix-references.md → fix/refs.md} +4 -3
- package/.agent-src/commands/{fix-seeder.md → fix/seeder.md} +4 -3
- package/.agent-src/commands/fix.md +54 -0
- package/.agent-src/commands/jira-ticket.md +1 -1
- package/.agent-src/commands/{do-and-judge.md → judge/on-diff.md} +7 -6
- package/.agent-src/commands/judge/solo.md +90 -0
- package/.agent-src/commands/{do-in-steps.md → judge/steps.md} +8 -7
- package/.agent-src/commands/judge.md +35 -70
- package/.agent-src/commands/{memory-add.md → memory/add.md} +7 -6
- package/.agent-src/commands/{memory-full.md → memory/load.md} +6 -5
- package/.agent-src/commands/{memory-promote.md → memory/promote.md} +6 -5
- package/.agent-src/commands/{propose-memory.md → memory/propose.md} +6 -5
- package/.agent-src/commands/memory.md +48 -0
- package/.agent-src/commands/mode.md +5 -5
- package/.agent-src/commands/{module-create.md → module/create.md} +4 -3
- package/.agent-src/commands/{module-explore.md → module/explore.md} +4 -3
- package/.agent-src/commands/module.md +44 -0
- package/.agent-src/commands/onboard.md +3 -3
- package/.agent-src/commands/{optimize-agents.md → optimize/agents.md} +5 -4
- package/.agent-src/commands/{optimize-augmentignore.md → optimize/augmentignore.md} +4 -4
- package/.agent-src/commands/{optimize-rtk-filters.md → optimize/rtk.md} +4 -3
- package/.agent-src/commands/{optimize-skills.md → optimize/skills.md} +5 -4
- package/.agent-src/commands/optimize.md +48 -0
- package/.agent-src/commands/{override-create.md → override/create.md} +4 -3
- package/.agent-src/commands/{override-manage.md → override/manage.md} +4 -3
- package/.agent-src/commands/override.md +44 -0
- package/.agent-src/commands/review-changes.md +26 -1
- package/.agent-src/commands/review-routing.md +1 -1
- package/.agent-src/commands/{roadmap-create.md → roadmap/create.md} +33 -5
- package/.agent-src/commands/{roadmap-execute.md → roadmap/execute.md} +4 -3
- package/.agent-src/commands/roadmap.md +44 -0
- package/.agent-src/commands/set-cost-profile.md +3 -3
- package/.agent-src/commands/sync-agent-settings.md +2 -2
- package/.agent-src/commands/{tests-create.md → tests/create.md} +5 -4
- package/.agent-src/commands/{tests-execute.md → tests/execute.md} +4 -3
- package/.agent-src/commands/tests.md +44 -0
- package/.agent-src/commands/upstream-contribute.md +1 -1
- package/.agent-src/contexts/authority/commit-mechanics.md +57 -0
- package/.agent-src/contexts/authority/destructive-mechanics.md +66 -0
- package/.agent-src/contexts/authority/scope-mechanics.md +87 -0
- package/.agent-src/contexts/communication/rules-auto/artifact-engagement-recording-mechanics.md +72 -0
- package/.agent-src/contexts/communication/rules-auto/augment-portability-mechanics.md +79 -0
- package/.agent-src/contexts/communication/rules-auto/augment-source-of-truth-mechanics.md +98 -0
- package/.agent-src/contexts/communication/rules-auto/cli-output-handling-mechanics.md +87 -0
- package/.agent-src/contexts/communication/rules-auto/command-suggestion-policy-mechanics.md +62 -0
- package/.agent-src/contexts/communication/rules-auto/docs-sync-mechanics.md +78 -0
- package/.agent-src/contexts/communication/rules-auto/package-ci-checks-mechanics.md +85 -0
- package/.agent-src/contexts/communication/rules-auto/review-routing-awareness-mechanics.md +65 -0
- package/.agent-src/contexts/communication/rules-auto/roadmap-progress-sync-mechanics.md +78 -0
- package/.agent-src/contexts/communication/rules-auto/skill-quality-mechanics.md +62 -0
- package/.agent-src/contexts/communication/rules-auto/slash-command-routing-policy-mechanics.md +55 -0
- package/.agent-src/contexts/communication/rules-auto/ui-audit-gate-mechanics.md +53 -0
- package/.agent-src/contexts/communication/rules-auto/user-interaction-mechanics.md +77 -0
- package/.agent-src/contexts/execution/autonomy-detection.md +54 -0
- package/.agent-src/contexts/execution/autonomy-examples.md +90 -0
- package/.agent-src/contexts/execution/autonomy-mechanics.md +29 -0
- package/.agent-src/contexts/execution/verification-mechanics.md +80 -0
- package/.agent-src/contexts/judges/no-consolidate-rationale.md +102 -0
- package/.agent-src/contexts/judges/persona-voice-rubric.md +140 -0
- package/.agent-src/personas/README.md +1 -1
- package/.agent-src/rules/agent-authority.md +24 -0
- package/.agent-src/rules/architecture.md +1 -1
- package/.agent-src/rules/artifact-drafting-protocol.md +1 -1
- package/.agent-src/rules/artifact-engagement-recording.md +14 -70
- package/.agent-src/rules/ask-when-uncertain.md +28 -43
- package/.agent-src/rules/augment-portability.md +15 -61
- package/.agent-src/rules/augment-source-of-truth.md +27 -93
- package/.agent-src/rules/autonomous-execution.md +78 -114
- package/.agent-src/rules/capture-learnings.md +1 -1
- package/.agent-src/rules/chat-history-cadence.md +3 -3
- package/.agent-src/rules/chat-history-ownership.md +3 -3
- package/.agent-src/rules/chat-history-visibility.md +3 -3
- package/.agent-src/rules/cli-output-handling.md +10 -76
- package/.agent-src/rules/command-suggestion-policy.md +93 -0
- package/.agent-src/rules/commit-conventions.md +17 -14
- package/.agent-src/rules/commit-policy.md +14 -42
- package/.agent-src/rules/context-hygiene.md +3 -3
- package/.agent-src/rules/direct-answers.md +34 -49
- package/.agent-src/rules/docker-commands.md +5 -5
- package/.agent-src/rules/docs-sync.md +16 -70
- package/.agent-src/rules/e2e-testing.md +1 -1
- package/.agent-src/rules/guidelines.md +4 -4
- package/.agent-src/rules/improve-before-implement.md +2 -2
- package/.agent-src/rules/language-and-tone.md +50 -133
- package/.agent-src/rules/minimal-safe-diff.md +3 -3
- package/.agent-src/rules/missing-tool-handling.md +28 -22
- package/.agent-src/rules/model-recommendation.md +4 -4
- package/.agent-src/rules/no-cheap-questions.md +82 -0
- package/.agent-src/rules/no-roadmap-references.md +73 -0
- package/.agent-src/rules/non-destructive-by-default.md +15 -49
- package/.agent-src/rules/onboarding-gate.md +5 -5
- package/.agent-src/rules/package-ci-checks.md +21 -61
- package/.agent-src/rules/preservation-guard.md +64 -29
- package/.agent-src/rules/review-routing-awareness.md +26 -45
- package/.agent-src/rules/roadmap-progress-sync.md +28 -96
- package/.agent-src/rules/role-mode-adherence.md +2 -2
- package/.agent-src/rules/scope-control.md +65 -46
- package/.agent-src/rules/security-sensitive-stop.md +9 -9
- package/.agent-src/rules/size-enforcement.md +1 -1
- package/.agent-src/rules/skill-quality.md +16 -48
- package/.agent-src/rules/{slash-commands.md → slash-command-routing-policy.md} +7 -4
- package/.agent-src/rules/think-before-action.md +55 -45
- package/.agent-src/rules/token-efficiency.md +4 -4
- package/.agent-src/rules/tool-safety.md +19 -16
- package/.agent-src/rules/{ui-audit-before-build.md → ui-audit-gate.md} +27 -41
- package/.agent-src/rules/user-interaction.md +16 -71
- package/.agent-src/rules/verify-before-complete.md +12 -67
- package/.agent-src/scripts/update_roadmap_progress.py +9 -4
- package/.agent-src/skills/ai-council/SKILL.md +335 -0
- package/.agent-src/skills/api-endpoint/SKILL.md +2 -2
- package/.agent-src/skills/api-testing/SKILL.md +1 -1
- package/.agent-src/skills/blade-ui/SKILL.md +1 -1
- package/.agent-src/skills/blast-radius-analyzer/SKILL.md +1 -1
- package/.agent-src/skills/bug-analyzer/SKILL.md +1 -1
- package/.agent-src/skills/check-refs/SKILL.md +59 -40
- package/.agent-src/skills/command-routing/SKILL.md +1 -1
- package/.agent-src/skills/command-writing/SKILL.md +1 -1
- package/.agent-src/skills/conventional-commits-writing/SKILL.md +86 -28
- package/.agent-src/skills/copilot-agents-optimization/SKILL.md +7 -7
- package/.agent-src/skills/developer-like-execution/SKILL.md +6 -6
- package/.agent-src/skills/finishing-a-development-branch/SKILL.md +101 -65
- package/.agent-src/skills/flux/SKILL.md +31 -11
- package/.agent-src/skills/git-workflow/SKILL.md +1 -1
- package/.agent-src/skills/github-ci/SKILL.md +2 -2
- package/.agent-src/skills/guideline-writing/SKILL.md +11 -11
- package/.agent-src/skills/judge-code-quality/SKILL.md +7 -8
- package/.agent-src/skills/judge-security-auditor/SKILL.md +4 -5
- package/.agent-src/skills/judge-test-coverage/SKILL.md +3 -4
- package/.agent-src/skills/learning-to-rule-or-skill/SKILL.md +4 -4
- package/.agent-src/skills/lint-skills/SKILL.md +57 -39
- package/.agent-src/skills/livewire/SKILL.md +1 -1
- package/.agent-src/skills/md-language-check/SKILL.md +61 -39
- package/.agent-src/skills/override-management/SKILL.md +7 -7
- package/.agent-src/skills/php-coder/SKILL.md +1 -1
- package/.agent-src/skills/playwright-testing/SKILL.md +2 -2
- package/.agent-src/skills/quality-tools/SKILL.md +2 -2
- package/.agent-src/skills/react-shadcn-ui/SKILL.md +116 -43
- package/.agent-src/skills/readme-reviewer/SKILL.md +31 -30
- package/.agent-src/skills/readme-writing/SKILL.md +79 -54
- package/.agent-src/skills/readme-writing-package/SKILL.md +51 -48
- package/.agent-src/skills/receiving-code-review/SKILL.md +53 -48
- package/.agent-src/skills/refine-prompt/SKILL.md +0 -1
- package/.agent-src/skills/requesting-code-review/SKILL.md +35 -30
- package/.agent-src/skills/review-routing/SKILL.md +2 -2
- package/.agent-src/skills/rule-writing/SKILL.md +1 -1
- package/.agent-src/skills/security/SKILL.md +7 -2
- package/.agent-src/skills/security-audit/SKILL.md +7 -3
- package/.agent-src/skills/skill-reviewer/SKILL.md +1 -1
- package/.agent-src/skills/skill-writing/SKILL.md +3 -3
- package/.agent-src/skills/subagent-orchestration/SKILL.md +1 -0
- package/.agent-src/skills/systematic-debugging/SKILL.md +69 -61
- package/.agent-src/skills/test-driven-development/SKILL.md +59 -57
- package/.agent-src/skills/test-performance/SKILL.md +0 -1
- package/.agent-src/skills/traefik/SKILL.md +4 -4
- package/.agent-src/skills/upstream-contribute/SKILL.md +1 -1
- package/.agent-src/skills/validate-feature-fit/SKILL.md +2 -2
- package/.agent-src/skills/{verify-before-complete → verify-completion-evidence}/SKILL.md +30 -28
- package/.agent-src/templates/agent-settings.md +8 -8
- package/.agent-src/templates/contexts/auth-model.md +1 -1
- package/.agent-src/templates/scripts/README.md +2 -2
- package/.agent-src/templates/scripts/telemetry/aggregator.py +16 -1
- package/.agent-src/templates/scripts/telemetry/engagement.py +59 -0
- package/.agent-src/templates/scripts/telemetry/report_renderer.py +28 -1
- package/.agent-src/templates/scripts/telemetry_record.py +14 -1
- package/.claude-plugin/marketplace.json +31 -12
- package/AGENTS.md +11 -9
- package/CHANGELOG.md +213 -2
- package/README.md +43 -44
- package/config/agent-settings.template.yml +58 -1
- package/config/gitignore-block.txt +3 -0
- package/docs/architecture.md +5 -7
- package/docs/catalog.md +359 -0
- package/docs/contracts/STABILITY.md +46 -1
- package/docs/contracts/adr-chat-history-split.md +1 -3
- package/docs/contracts/adr-command-suggestion.md +3 -5
- package/docs/contracts/adr-implement-ticket-runtime.md +1 -2
- package/docs/contracts/adr-product-ui-track.md +5 -8
- package/docs/contracts/adr-prompt-driven-execution.md +3 -4
- package/docs/contracts/agent-memory-contract.md +8 -13
- package/docs/contracts/artifact-engagement-flow.md +7 -10
- package/docs/contracts/command-clusters.md +56 -46
- package/docs/contracts/command-suggestion-flow.md +4 -6
- package/docs/contracts/context-paths.md +99 -0
- package/docs/contracts/file-ownership-matrix.json +6722 -0
- package/docs/contracts/file-ownership-matrix.md +134 -0
- package/docs/contracts/implement-ticket-flow.md +8 -11
- package/docs/contracts/linear-ai-rules-inclusion.md +1 -2
- package/docs/contracts/linear-ai-three-layers.md +0 -2
- package/docs/contracts/load-context-budget-model.md +178 -0
- package/docs/contracts/load-context-schema.md +184 -0
- package/docs/contracts/rule-interactions.md +0 -1
- package/docs/contracts/rule-interactions.yml +96 -0
- package/docs/contracts/rule-priority-hierarchy.md +87 -0
- package/docs/contracts/ui-track-flow.md +8 -18
- package/docs/customization.md +16 -0
- package/docs/end-to-end-walkthroughs.md +165 -0
- package/docs/getting-started.md +29 -10
- package/docs/github-topics.md +12 -3
- package/docs/guidelines/agent-infra/asking-and-brevity-examples.md +100 -0
- package/docs/guidelines/agent-infra/language-and-tone-examples.md +79 -0
- package/{.agent-src → docs}/guidelines/docs/readme-size-and-splitting.md +26 -25
- package/docs/guidelines/php/git.md +164 -0
- package/docs/migrations/commands-1.15.0.md +1 -1
- package/docs/showcase.md +9 -4
- package/docs/skills-catalog.md +14 -8
- package/docs/ui-track-mental-model.md +2 -2
- package/llms.txt +13 -7
- package/package.json +1 -1
- package/scripts/_one_off_phase4_dispatch_latency.py +108 -0
- package/scripts/_one_off_phase6_trigger_jaccard.py +92 -0
- package/scripts/_phase2_shim_helper.py +109 -0
- package/scripts/agent-config +33 -0
- package/scripts/ai_council/__init__.py +39 -0
- package/scripts/ai_council/_default_prices.py +41 -0
- package/scripts/ai_council/_one_off_2a4_acceptance.py +208 -0
- package/scripts/ai_council/_one_off_context_layer_v1_estimate.py +67 -0
- package/scripts/ai_council/_one_off_context_layer_v1_review.py +292 -0
- package/scripts/ai_council/_one_off_followups_review.py +259 -0
- package/scripts/ai_council/_one_off_nondestructive_inline_audit.py +209 -0
- package/scripts/ai_council/_one_off_phase_2a_budget_rebalance.py +257 -0
- package/scripts/ai_council/_one_off_phase_2a_post_revert.py +197 -0
- package/scripts/ai_council/_one_off_rebalancing_audit.py +149 -0
- package/scripts/ai_council/_one_off_roundtrip.py +106 -0
- package/scripts/ai_council/_one_off_rule_hardening_v1.py +251 -0
- package/scripts/ai_council/_one_off_structural_open_questions.py +232 -0
- package/scripts/ai_council/_one_off_structural_optimization.py +144 -0
- package/scripts/ai_council/_one_off_structural_v3_gaps.py +252 -0
- package/scripts/ai_council/_one_off_structural_v3_review.py +240 -0
- package/scripts/ai_council/budget_guard.py +172 -0
- package/scripts/ai_council/bundler.py +261 -0
- package/scripts/ai_council/clients.py +381 -0
- package/scripts/ai_council/modes.py +127 -0
- package/scripts/ai_council/orchestrator.py +350 -0
- package/scripts/ai_council/pricing.py +213 -0
- package/scripts/ai_council/project_context.py +159 -0
- package/scripts/ai_council/prompts.py +232 -0
- package/scripts/ai_council/session.py +144 -0
- package/scripts/check_always_budget.py +444 -0
- package/scripts/check_augmentignore.py +69 -0
- package/scripts/check_cluster_patterns.py +159 -0
- package/scripts/check_command_count_messaging.py +127 -0
- package/scripts/check_context_paths.py +201 -0
- package/scripts/check_no_roadmap_refs.py +155 -0
- package/scripts/check_phase_coupling.py +148 -0
- package/scripts/check_portability.py +57 -0
- package/scripts/check_public_catalog_links.py +122 -0
- package/scripts/check_references.py +33 -3
- package/scripts/check_roadmap_trackable.py +111 -0
- package/scripts/check_safety_floor_untouched.py +125 -0
- package/scripts/command_suggester/cooldown.py +1 -1
- package/scripts/command_suggester/loader.py +4 -1
- package/scripts/compress.py +59 -13
- package/scripts/generate_index.py +270 -0
- package/scripts/generate_ownership_matrix.py +323 -0
- package/scripts/hooks/augment-roadmap-progress.sh +57 -0
- package/scripts/install.py +49 -28
- package/scripts/install_anthropic_key.sh +5 -0
- package/scripts/install_openai_key.sh +106 -0
- package/scripts/lint_load_context.py +163 -0
- package/scripts/lint_no_new_atomic_commands.py +12 -11
- package/scripts/requirements-evals.txt +1 -0
- package/scripts/roadmap_progress_hook.py +159 -0
- package/scripts/schemas/command.schema.json +22 -1
- package/scripts/schemas/rule.schema.json +10 -0
- package/scripts/skill_linter.py +13 -4
- package/scripts/sync_agent_settings.py +26 -3
- package/scripts/update_counts.py +16 -4
- package/scripts/update_prices.py +124 -0
- package/.agent-src/guidelines/php/git.md +0 -96
- package/.agent-src/rules/command-suggestion.md +0 -134
- /package/{.agent-src → docs}/guidelines/agent-infra/agent-interaction-and-decision-quality.md +0 -0
- /package/{.agent-src → docs}/guidelines/agent-infra/break-glass-usage.md +0 -0
- /package/{.agent-src → docs}/guidelines/agent-infra/developer-judgment.md +0 -0
- /package/{.agent-src → docs}/guidelines/agent-infra/engineering-memory-data-format.md +0 -0
- /package/{.agent-src → docs}/guidelines/agent-infra/layered-settings.md +0 -0
- /package/{.agent-src → docs}/guidelines/agent-infra/memory-access.md +0 -0
- /package/{.agent-src → docs}/guidelines/agent-infra/naming.md +0 -0
- /package/{.agent-src → docs}/guidelines/agent-infra/output-patterns.md +0 -0
- /package/{.agent-src → docs}/guidelines/agent-infra/review-routing-data-format.md +0 -0
- /package/{.agent-src → docs}/guidelines/agent-infra/role-contracts.md +0 -0
- /package/{.agent-src → docs}/guidelines/agent-infra/role-mode-router.md +0 -0
- /package/{.agent-src → docs}/guidelines/agent-infra/runtime-layer.md +0 -0
- /package/{.agent-src → docs}/guidelines/agent-infra/self-improvement-pipeline.md +0 -0
- /package/{.agent-src → docs}/guidelines/agent-infra/size-and-scope.md +0 -0
- /package/{.agent-src → docs}/guidelines/agent-infra/tool-integration.md +0 -0
- /package/{.agent-src → docs}/guidelines/e2e/playwright.md +0 -0
- /package/{.agent-src → docs}/guidelines/php/api-design.md +0 -0
- /package/{.agent-src → docs}/guidelines/php/artisan-commands.md +0 -0
- /package/{.agent-src → docs}/guidelines/php/blade-ui.md +0 -0
- /package/{.agent-src → docs}/guidelines/php/controllers.md +0 -0
- /package/{.agent-src → docs}/guidelines/php/database.md +0 -0
- /package/{.agent-src → docs}/guidelines/php/eloquent.md +0 -0
- /package/{.agent-src → docs}/guidelines/php/flux.md +0 -0
- /package/{.agent-src → docs}/guidelines/php/general.md +0 -0
- /package/{.agent-src → docs}/guidelines/php/jobs.md +0 -0
- /package/{.agent-src → docs}/guidelines/php/livewire.md +0 -0
- /package/{.agent-src → docs}/guidelines/php/logging.md +0 -0
- /package/{.agent-src → docs}/guidelines/php/naming.md +0 -0
- /package/{.agent-src → docs}/guidelines/php/patterns/dependency-injection.md +0 -0
- /package/{.agent-src → docs}/guidelines/php/patterns/dtos.md +0 -0
- /package/{.agent-src → docs}/guidelines/php/patterns/events.md +0 -0
- /package/{.agent-src → docs}/guidelines/php/patterns/factory.md +0 -0
- /package/{.agent-src → docs}/guidelines/php/patterns/pipelines.md +0 -0
- /package/{.agent-src → docs}/guidelines/php/patterns/policies.md +0 -0
- /package/{.agent-src → docs}/guidelines/php/patterns/repositories.md +0 -0
- /package/{.agent-src → docs}/guidelines/php/patterns/service-layer.md +0 -0
- /package/{.agent-src → docs}/guidelines/php/patterns/strategy.md +0 -0
- /package/{.agent-src → docs}/guidelines/php/patterns.md +0 -0
- /package/{.agent-src → docs}/guidelines/php/performance.md +0 -0
- /package/{.agent-src → docs}/guidelines/php/resources.md +0 -0
- /package/{.agent-src → docs}/guidelines/php/security.md +0 -0
- /package/{.agent-src → docs}/guidelines/php/sql.md +0 -0
- /package/{.agent-src → docs}/guidelines/php/validations.md +0 -0
- /package/{.agent-src → docs}/guidelines/php/websocket.md +0 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"""One-off council run for road-to-structural-optimization.md.
|
|
2
|
+
|
|
3
|
+
Invokes the council in `design` mode with Anthropic + OpenAI members.
|
|
4
|
+
Saves the session under agents/contexts/ai-council-sessions/.
|
|
5
|
+
|
|
6
|
+
Invocation:
|
|
7
|
+
.venv/bin/python -m scripts.ai_council._one_off_structural_optimization
|
|
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
|
+
"Review road-to-structural-optimization.md DRAFT v2 (council-revised). "
|
|
36
|
+
"This is a SECOND independent review of a roadmap that already folded "
|
|
37
|
+
"in five convergence findings from a prior council pass (2026-05-03 "
|
|
38
|
+
"06:52 UTC, anthropic+openai). v2 changes vs. v1: 2A/2B split (always "
|
|
39
|
+
"vs. auto rules), Spike 3a.0 with kill criterion before 3a.1+, "
|
|
40
|
+
"obligation-diff contract 2A.4 with worked example, budget kill-switch "
|
|
41
|
+
"2A, Phase-6-before-2B sequencing, file-ownership matrix gate, per-skill "
|
|
42
|
+
"30%% LOC bar (not average). Three open questions remain: (1) Phase 3a "
|
|
43
|
+
"shape — separate skills + shared context vs. single dispatcher with "
|
|
44
|
+
"mode parameter; (2) Phase 6 shape — one rule + three contexts vs. "
|
|
45
|
+
"router + three thin specialists; (3) Phase 5 endorsement that safety-"
|
|
46
|
+
"floor rules (non-destructive-by-default, commit-policy, scope-control, "
|
|
47
|
+
"verify-before-complete) stay untouched. Mode: design — focus on "
|
|
48
|
+
"architectural risk, sequencing risk, missing rollback, hidden coupling, "
|
|
49
|
+
"AND whether v2's mitigations actually close the v1 critiques. Be hard "
|
|
50
|
+
"on residual gaps; do not rubber-stamp."
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def main() -> int:
|
|
55
|
+
anthropic = AnthropicClient(api_key=load_anthropic_key(), model="claude-sonnet-4-5")
|
|
56
|
+
openai = OpenAIClient(api_key=load_openai_key(), model="gpt-4o")
|
|
57
|
+
members = [anthropic, openai]
|
|
58
|
+
|
|
59
|
+
context = bundle_roadmap(ROADMAP_PATH)
|
|
60
|
+
project = detect_project_context(REPO_ROOT)
|
|
61
|
+
table = load_prices()
|
|
62
|
+
|
|
63
|
+
question = CouncilQuestion(
|
|
64
|
+
mode="roadmap",
|
|
65
|
+
user_prompt=context.text,
|
|
66
|
+
max_tokens=8192,
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
estimates = estimate(
|
|
70
|
+
question, members, table, project=project, original_ask=ORIGINAL_ASK,
|
|
71
|
+
)
|
|
72
|
+
print("=== ESTIMATE (single round, max tokens) ===")
|
|
73
|
+
total_est = 0.0
|
|
74
|
+
for c, e in zip(members, estimates):
|
|
75
|
+
print(f" {c.name}/{c.model}: ~{e.input_tokens} in + {e.output_tokens} out = ${e.total_usd:.4f}")
|
|
76
|
+
total_est += e.total_usd
|
|
77
|
+
print(f" TOTAL per round (max): ${total_est:.4f}")
|
|
78
|
+
print(f" TOTAL 2 rounds (max, ignoring round-2 prompt growth): ${total_est * 2:.4f}")
|
|
79
|
+
print()
|
|
80
|
+
|
|
81
|
+
budget = CostBudget(
|
|
82
|
+
max_input_tokens=200_000,
|
|
83
|
+
max_output_tokens=80_000,
|
|
84
|
+
max_calls=20,
|
|
85
|
+
max_total_usd=2.50,
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
rounds_collected: list[list] = []
|
|
89
|
+
|
|
90
|
+
def _on_round_complete(round_idx: int, round_responses) -> None:
|
|
91
|
+
rounds_collected.append(list(round_responses))
|
|
92
|
+
print(f"=== ROUND {round_idx + 1} COMPLETE ===")
|
|
93
|
+
for r in round_responses:
|
|
94
|
+
if r.error:
|
|
95
|
+
print(f" [error] {r.provider}/{r.model}: {r.error}")
|
|
96
|
+
continue
|
|
97
|
+
actual = estimate_cost(r.provider, r.model, r.input_tokens, r.output_tokens, table)
|
|
98
|
+
print(f" [done] {r.provider}/{r.model}: {r.input_tokens} in / "
|
|
99
|
+
f"{r.output_tokens} out · {r.latency_ms} ms · ${actual.total_usd:.4f}")
|
|
100
|
+
print()
|
|
101
|
+
|
|
102
|
+
print("=== CONSULT (2 rounds, debate mode) ===")
|
|
103
|
+
consult(
|
|
104
|
+
members, question, budget,
|
|
105
|
+
rounds=2,
|
|
106
|
+
on_round_complete=_on_round_complete,
|
|
107
|
+
table=table, project=project, original_ask=ORIGINAL_ASK,
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
if not rounds_collected:
|
|
111
|
+
print("[error] no rounds completed", file=sys.stderr)
|
|
112
|
+
return 1
|
|
113
|
+
|
|
114
|
+
actual_total = 0.0
|
|
115
|
+
for round_idx, round_responses in enumerate(rounds_collected, start=1):
|
|
116
|
+
for r in round_responses:
|
|
117
|
+
if r.error:
|
|
118
|
+
continue
|
|
119
|
+
actual = estimate_cost(r.provider, r.model, r.input_tokens, r.output_tokens, table)
|
|
120
|
+
actual_total += actual.total_usd
|
|
121
|
+
print(f"=== TOTAL ACTUAL: ${actual_total:.4f} (across {len(rounds_collected)} rounds) ===")
|
|
122
|
+
|
|
123
|
+
final_round = rounds_collected[-1]
|
|
124
|
+
successes = [r for r in final_round if not r.error]
|
|
125
|
+
if not successes:
|
|
126
|
+
return 1
|
|
127
|
+
|
|
128
|
+
manifest = SessionManifest(
|
|
129
|
+
mode="roadmap",
|
|
130
|
+
artefact=str(ROADMAP_PATH.relative_to(REPO_ROOT)),
|
|
131
|
+
original_ask=ORIGINAL_ASK,
|
|
132
|
+
members=[f"{r.provider}/{r.model}" for r in final_round],
|
|
133
|
+
rounds=len(rounds_collected),
|
|
134
|
+
cost_usd_estimated=total_est * 2,
|
|
135
|
+
cost_usd_actual=actual_total,
|
|
136
|
+
extra={"purpose": "council-design 2-round debate on structural optimization roadmap v2"},
|
|
137
|
+
)
|
|
138
|
+
session_dir = save_session(manifest=manifest, responses=rounds_collected)
|
|
139
|
+
print(f"[saved] {session_dir.relative_to(REPO_ROOT)}/")
|
|
140
|
+
return 1 if any(r.error for round_r in rounds_collected for r in round_r) else 0
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
if __name__ == "__main__":
|
|
144
|
+
raise SystemExit(main())
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
"""Round-5 council tie-break on the three v3-introduced gaps.
|
|
2
|
+
|
|
3
|
+
Anthropic R4 raised five new gaps in v3 (G1 HIGH, G2/G3 MODERATE,
|
|
4
|
+
G4/G5 LOW); OpenAI R4 issued FULL GREENLIGHT with zero residual.
|
|
5
|
+
This round forces a binding consensus per gap so the user can decide
|
|
6
|
+
v3.1 vs ship.
|
|
7
|
+
|
|
8
|
+
Single round, structured per-gap verdict.
|
|
9
|
+
|
|
10
|
+
Invocation:
|
|
11
|
+
.venv/bin/python -m scripts.ai_council._one_off_structural_v3_gaps
|
|
12
|
+
"""
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
import sys
|
|
16
|
+
from pathlib import Path
|
|
17
|
+
|
|
18
|
+
from scripts.ai_council.bundler import bundle_roadmap
|
|
19
|
+
from scripts.ai_council.clients import (
|
|
20
|
+
AnthropicClient,
|
|
21
|
+
OpenAIClient,
|
|
22
|
+
load_anthropic_key,
|
|
23
|
+
load_openai_key,
|
|
24
|
+
)
|
|
25
|
+
from scripts.ai_council.orchestrator import (
|
|
26
|
+
CostBudget,
|
|
27
|
+
CouncilQuestion,
|
|
28
|
+
consult,
|
|
29
|
+
estimate,
|
|
30
|
+
)
|
|
31
|
+
from scripts.ai_council.pricing import estimate_cost, load_prices
|
|
32
|
+
from scripts.ai_council.project_context import detect_project_context
|
|
33
|
+
from scripts.ai_council.session import SessionManifest, save as save_session
|
|
34
|
+
|
|
35
|
+
REPO_ROOT = Path(__file__).resolve().parents[2]
|
|
36
|
+
ROADMAP_PATH = REPO_ROOT / "agents/roadmaps/road-to-structural-optimization.md"
|
|
37
|
+
|
|
38
|
+
ORIGINAL_ASK = (
|
|
39
|
+
"Round-4 produced divergent verdicts on v3: OpenAI FULL GREENLIGHT, "
|
|
40
|
+
"Anthropic CONDITIONAL with five v3-introduced gaps (G1 HIGH, G2/G3 "
|
|
41
|
+
"MODERATE, G4/G5 LOW). Force binding per-gap consensus: REAL GAP / "
|
|
42
|
+
"OVER-CALIBRATED / NOT A GAP, with one-sentence justification. "
|
|
43
|
+
"Decide whether each gap blocks Phase-0 execution."
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
GAPS_PROMPT = """\
|
|
47
|
+
# Round-5 Tie-Break — Five v3-Introduced Gaps
|
|
48
|
+
|
|
49
|
+
Round 4 produced divergent verdicts on road-to-structural-optimization.md v3:
|
|
50
|
+
|
|
51
|
+
- **OpenAI gpt-4o:** FULL GREENLIGHT, all 15 Round-2/Round-3 findings ACCEPT, \
|
|
52
|
+
zero residual.
|
|
53
|
+
- **Anthropic Claude Sonnet 4.5:** All 15 Round-2/Round-3 findings ACCEPT, \
|
|
54
|
+
but flagged **five new gaps** introduced by v3 itself (1.2 engineer-days \
|
|
55
|
+
to fix).
|
|
56
|
+
|
|
57
|
+
You both reviewed v3 already. **Stop re-reviewing v3 broadly.** Pick a \
|
|
58
|
+
binding verdict per gap. The user will decide v3.1 vs. ship based on \
|
|
59
|
+
your consensus.
|
|
60
|
+
|
|
61
|
+
## Output Contract (STRICT)
|
|
62
|
+
|
|
63
|
+
For each gap, produce exactly this block:
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
### G<n>: <short title>
|
|
67
|
+
|
|
68
|
+
**Verdict:** <REAL_GAP | OVER_CALIBRATED | NOT_A_GAP>
|
|
69
|
+
**Blocks Phase 0?:** <YES | NO>
|
|
70
|
+
**Justification (1-2 sentences):** <why this verdict>
|
|
71
|
+
**If REAL_GAP, minimal fix:** <one sentence — smallest change that closes it>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Verdict definitions:
|
|
75
|
+
- **REAL_GAP** — fix required before Phase 0 starts.
|
|
76
|
+
- **OVER_CALIBRATED** — gap exists but is lower severity than Anthropic R4 \
|
|
77
|
+
claimed; can be a Risk-Register entry, not a phase-blocking fix.
|
|
78
|
+
- **NOT_A_GAP** — Anthropic R4 was wrong; v3 already addresses this or it \
|
|
79
|
+
is not a real risk.
|
|
80
|
+
|
|
81
|
+
## The Five Gaps
|
|
82
|
+
|
|
83
|
+
### G1 (Anthropic R4: HIGH) — Phase 3a.0.1 collision-proxy under-tests mode collision
|
|
84
|
+
|
|
85
|
+
v3 Phase 3a.0.1 prompts `judge-test-coverage` with a security-only diff and \
|
|
86
|
+
checks for `judge-security-auditor` framing leak. With 4 judges, the \
|
|
87
|
+
collision space is C(4,2)=6 pairs plus C(4,3)=4 triples. Testing **one \
|
|
88
|
+
pair** is 1/10 coverage. Anthropic R4 argues this undermines the 3a.0.2 \
|
|
89
|
+
kill-criterion because mode-collision was the failure mode this proxy \
|
|
90
|
+
was designed to catch.
|
|
91
|
+
|
|
92
|
+
**Anthropic R4's fix:** Expand to all 6 pairs; threshold ≤1/6 collisions \
|
|
93
|
+
→ ship; ≥2/6 → kill 3a. +0.5 days.
|
|
94
|
+
|
|
95
|
+
**Counter-argument to consider:** Pairwise testing scales with persona \
|
|
96
|
+
count; one well-chosen pair (most-distant personas) may be a sufficient \
|
|
97
|
+
canary. Manual voice comparison on 6 prompts is 6× the human review time.
|
|
98
|
+
|
|
99
|
+
### G2 (Anthropic R4: MODERATE) — Phase 0.1.2 fan-out accounting under-specified
|
|
100
|
+
|
|
101
|
+
v3 Phase 0.1.2 says the generator "must account for context-file fan-out" \
|
|
102
|
+
but does not say whether it follows **transitive** `load_context:` chains \
|
|
103
|
+
(rule A → context X → nested context Y). Phase 0.2.4 caps nesting at \
|
|
104
|
+
depth 2. Without an explicit rule, the matrix could miss READ_ONLY deps \
|
|
105
|
+
or generate false-negative BLOCKS_IF_CONCURRENT cells.
|
|
106
|
+
|
|
107
|
+
**Anthropic R4's fix:** Add to 0.1.2 spec: "Generator follows transitive \
|
|
108
|
+
chains up to depth 2; depth-3 nesting → matrix entry becomes \
|
|
109
|
+
BLOCKS_IF_CONCURRENT automatically." +0.3 days.
|
|
110
|
+
|
|
111
|
+
### G3 (Anthropic R4: MODERATE) — Phase 0.2.3 retroactive test has no tolerance band
|
|
112
|
+
|
|
113
|
+
v3 Phase 0.2.3 retroactively tests PR #34's `autonomous-execution` split \
|
|
114
|
+
under the new budget model. Phase-wide kill-switch (line 150): "If 0.2.3 \
|
|
115
|
+
retroactive test fails → escalate to council; entire roadmap pauses." \
|
|
116
|
+
This is binary (pass/fail). A 0.4% overshoot (200 chars over 49,000 cap) \
|
|
117
|
+
triggers a roadmap-wide pause.
|
|
118
|
+
|
|
119
|
+
**Anthropic R4's fix:** Add tolerance: "≤5% overshoot → council \
|
|
120
|
+
refinement of model (b) (e.g., amortization factor); >5% → model (b) \
|
|
121
|
+
rejected, escalate." +0.1 days (contract language only).
|
|
122
|
+
|
|
123
|
+
### G4 (Anthropic R4: LOW) — Phase 6.1 zero-overlap escalation has no default
|
|
124
|
+
|
|
125
|
+
v3 Phase 6.1 says: if zero shared triggers between any two of the three \
|
|
126
|
+
chat-history concerns → halt Phase 6, escalate to council. No default \
|
|
127
|
+
action specified.
|
|
128
|
+
|
|
129
|
+
**Anthropic R4's fix:** "Zero overlap confirmed → default = keep three \
|
|
130
|
+
separate rules; Q2 rollback not required because the unified shape was \
|
|
131
|
+
never built." +0.1 days.
|
|
132
|
+
|
|
133
|
+
### G5 (Anthropic R4: LOW) — Phase 0.4 worked example may be atypical
|
|
134
|
+
|
|
135
|
+
v3 Phase 0.4 picks `direct-answers` for the worked example. If that rule \
|
|
136
|
+
is unusually clean (well-separated MECHANICS/LOGIC), the 2A.4 contract \
|
|
137
|
+
may fail on rule #2 (`ask-when-uncertain` or `language-and-tone`).
|
|
138
|
+
|
|
139
|
+
**Anthropic R4's fix:** "If the first Phase-2A rule after 0.4 acceptance \
|
|
140
|
+
fails 2A.4, re-run worked example on that rule before Rule #3." +0.2 days.
|
|
141
|
+
|
|
142
|
+
## Final Output
|
|
143
|
+
|
|
144
|
+
After all five blocks, add:
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
### Consensus verdict
|
|
148
|
+
|
|
149
|
+
<count of REAL_GAP / OVER_CALIBRATED / NOT_A_GAP across G1-G5>
|
|
150
|
+
|
|
151
|
+
**Recommendation:** <one of: SHIP V3 AS-IS · FIX <list> THEN SHIP · PRODUCE V3.1>
|
|
152
|
+
**Blocks Phase 0:** <gap ids that must be fixed before Phase 0 starts>
|
|
153
|
+
**Total residual effort:** <engineer-days>
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Be decisive. Anthropic R4 already had its say — now you weigh in with a \
|
|
157
|
+
binding verdict. If a gap is over-engineering, say so. Total response \
|
|
158
|
+
budget: ≤ 1200 words.
|
|
159
|
+
"""
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
def main() -> int:
|
|
163
|
+
anthropic = AnthropicClient(api_key=load_anthropic_key(), model="claude-sonnet-4-5")
|
|
164
|
+
openai = OpenAIClient(api_key=load_openai_key(), model="gpt-4o")
|
|
165
|
+
members = [anthropic, openai]
|
|
166
|
+
|
|
167
|
+
context = bundle_roadmap(ROADMAP_PATH)
|
|
168
|
+
project = detect_project_context(REPO_ROOT)
|
|
169
|
+
table = load_prices()
|
|
170
|
+
|
|
171
|
+
user_prompt = GAPS_PROMPT + "\n\n---\n\n" + context.text
|
|
172
|
+
|
|
173
|
+
question = CouncilQuestion(
|
|
174
|
+
mode="roadmap",
|
|
175
|
+
user_prompt=user_prompt,
|
|
176
|
+
max_tokens=4096,
|
|
177
|
+
)
|
|
178
|
+
|
|
179
|
+
estimates = estimate(
|
|
180
|
+
question, members, table, project=project, original_ask=ORIGINAL_ASK,
|
|
181
|
+
)
|
|
182
|
+
print("=== ESTIMATE (single round, max tokens) ===")
|
|
183
|
+
total_est = 0.0
|
|
184
|
+
for c, e in zip(members, estimates):
|
|
185
|
+
print(f" {c.name}/{c.model}: ~{e.input_tokens} in + {e.output_tokens} out = ${e.total_usd:.4f}")
|
|
186
|
+
total_est += e.total_usd
|
|
187
|
+
print(f" TOTAL per round (max): ${total_est:.4f}")
|
|
188
|
+
print()
|
|
189
|
+
|
|
190
|
+
budget = CostBudget(
|
|
191
|
+
max_input_tokens=200_000,
|
|
192
|
+
max_output_tokens=80_000,
|
|
193
|
+
max_calls=20,
|
|
194
|
+
max_total_usd=2.50,
|
|
195
|
+
)
|
|
196
|
+
|
|
197
|
+
rounds_collected: list[list] = []
|
|
198
|
+
|
|
199
|
+
def _on_round_complete(round_idx: int, round_responses) -> None:
|
|
200
|
+
rounds_collected.append(list(round_responses))
|
|
201
|
+
print(f"=== ROUND {round_idx + 1} COMPLETE ===")
|
|
202
|
+
for r in round_responses:
|
|
203
|
+
if r.error:
|
|
204
|
+
print(f" [error] {r.provider}/{r.model}: {r.error}")
|
|
205
|
+
continue
|
|
206
|
+
actual = estimate_cost(r.provider, r.model, r.input_tokens, r.output_tokens, table)
|
|
207
|
+
print(f" [done] {r.provider}/{r.model}: {r.input_tokens} in / "
|
|
208
|
+
f"{r.output_tokens} out · {r.latency_ms} ms · ${actual.total_usd:.4f}")
|
|
209
|
+
print()
|
|
210
|
+
|
|
211
|
+
print("=== CONSULT (1 round, gap tie-break) ===")
|
|
212
|
+
consult(
|
|
213
|
+
members, question, budget,
|
|
214
|
+
rounds=1,
|
|
215
|
+
on_round_complete=_on_round_complete,
|
|
216
|
+
table=table, project=project, original_ask=ORIGINAL_ASK,
|
|
217
|
+
)
|
|
218
|
+
|
|
219
|
+
if not rounds_collected:
|
|
220
|
+
print("[error] no rounds completed", file=sys.stderr)
|
|
221
|
+
return 1
|
|
222
|
+
|
|
223
|
+
actual_total = 0.0
|
|
224
|
+
for round_responses in rounds_collected:
|
|
225
|
+
for r in round_responses:
|
|
226
|
+
if r.error:
|
|
227
|
+
continue
|
|
228
|
+
actual = estimate_cost(r.provider, r.model, r.input_tokens, r.output_tokens, table)
|
|
229
|
+
actual_total += actual.total_usd
|
|
230
|
+
print(f"=== TOTAL ACTUAL: ${actual_total:.4f} ===")
|
|
231
|
+
|
|
232
|
+
final_round = rounds_collected[-1]
|
|
233
|
+
if not [r for r in final_round if not r.error]:
|
|
234
|
+
return 1
|
|
235
|
+
|
|
236
|
+
manifest = SessionManifest(
|
|
237
|
+
mode="roadmap",
|
|
238
|
+
artefact=str(ROADMAP_PATH.relative_to(REPO_ROOT)),
|
|
239
|
+
original_ask=ORIGINAL_ASK,
|
|
240
|
+
members=[f"{r.provider}/{r.model}" for r in final_round],
|
|
241
|
+
rounds=len(rounds_collected),
|
|
242
|
+
cost_usd_estimated=total_est,
|
|
243
|
+
cost_usd_actual=actual_total,
|
|
244
|
+
extra={"purpose": "Round-5 tie-break on five v3-introduced gaps"},
|
|
245
|
+
)
|
|
246
|
+
session_dir = save_session(manifest=manifest, responses=rounds_collected)
|
|
247
|
+
print(f"[saved] {session_dir.relative_to(REPO_ROOT)}/")
|
|
248
|
+
return 1 if any(r.error for round_r in rounds_collected for r in round_r) else 0
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
if __name__ == "__main__":
|
|
252
|
+
raise SystemExit(main())
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
"""Round-4 council validation of road-to-structural-optimization.md v3.
|
|
2
|
+
|
|
3
|
+
Focused close-out review: do the Phase-0 items and the Round-3 locked
|
|
4
|
+
decisions cleanly close every CRITICAL / HIGH / MODERATE finding from
|
|
5
|
+
Round 2, and did v3 introduce any new structural gap?
|
|
6
|
+
|
|
7
|
+
Single round, structured per-finding accept/reject verdict. Saves the
|
|
8
|
+
session under agents/council-sessions/.
|
|
9
|
+
|
|
10
|
+
Invocation:
|
|
11
|
+
.venv/bin/python -m scripts.ai_council._one_off_structural_v3_review
|
|
12
|
+
"""
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
import sys
|
|
16
|
+
from pathlib import Path
|
|
17
|
+
|
|
18
|
+
from scripts.ai_council.bundler import bundle_roadmap
|
|
19
|
+
from scripts.ai_council.clients import (
|
|
20
|
+
AnthropicClient,
|
|
21
|
+
OpenAIClient,
|
|
22
|
+
load_anthropic_key,
|
|
23
|
+
load_openai_key,
|
|
24
|
+
)
|
|
25
|
+
from scripts.ai_council.orchestrator import (
|
|
26
|
+
CostBudget,
|
|
27
|
+
CouncilQuestion,
|
|
28
|
+
consult,
|
|
29
|
+
estimate,
|
|
30
|
+
)
|
|
31
|
+
from scripts.ai_council.pricing import estimate_cost, load_prices
|
|
32
|
+
from scripts.ai_council.project_context import detect_project_context
|
|
33
|
+
from scripts.ai_council.session import SessionManifest, save as save_session
|
|
34
|
+
|
|
35
|
+
REPO_ROOT = Path(__file__).resolve().parents[2]
|
|
36
|
+
ROADMAP_PATH = REPO_ROOT / "agents/roadmaps/road-to-structural-optimization.md"
|
|
37
|
+
|
|
38
|
+
ORIGINAL_ASK = (
|
|
39
|
+
"Validate that road-to-structural-optimization.md v3 cleanly closes every "
|
|
40
|
+
"CRITICAL / HIGH / MODERATE finding from the Round-2 council debate and "
|
|
41
|
+
"the three locked decisions (Q1=A, Q2=A, Q3=A) from Round 3. Per-finding "
|
|
42
|
+
"binding ACCEPT / REJECT / PARTIAL verdict + one-sentence justification. "
|
|
43
|
+
"Flag any new structural gap v3 introduced."
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
REVIEW_PROMPT = """\
|
|
47
|
+
# Round-4 Close-Out Review — v3 Final Validation
|
|
48
|
+
|
|
49
|
+
You have already reviewed road-to-structural-optimization.md across three \
|
|
50
|
+
prior rounds (Round 1 design, Round 2 critique with CONDITIONAL GREENLIGHT, \
|
|
51
|
+
Round 3 locked decisions Q1=A / Q2=A / Q3=A). The author has now produced \
|
|
52
|
+
**v3** — Phase 0 added (6 work-streams), all CRITICAL/HIGH/MODERATE findings \
|
|
53
|
+
folded in, locked decisions referenced.
|
|
54
|
+
|
|
55
|
+
**Your task:** Verify that v3 closes every Round-2 finding cleanly. Pick \
|
|
56
|
+
ACCEPT / REJECT / PARTIAL per finding. Do not re-litigate the design — \
|
|
57
|
+
just check whether the fix is in the document and whether it is structurally \
|
|
58
|
+
sound.
|
|
59
|
+
|
|
60
|
+
## Output Contract (STRICT)
|
|
61
|
+
|
|
62
|
+
For each finding, produce exactly this block:
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
### F<id>: <short title>
|
|
66
|
+
|
|
67
|
+
**Verdict:** <ACCEPT | PARTIAL | REJECT>
|
|
68
|
+
**v3 location:** <line range or section reference where the fix lives>
|
|
69
|
+
**Justification (1-2 sentences):** <why the fix closes — or fails to close — the finding>
|
|
70
|
+
**Residual gap (if PARTIAL/REJECT):** <one sentence — what is still missing>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Findings to validate (all from Round 2 unless noted)
|
|
74
|
+
|
|
75
|
+
### CRITICAL tier — must close before Phase 1
|
|
76
|
+
|
|
77
|
+
- **C1.** File-ownership matrix was a ghost reference (3× cited, 0× defined). \
|
|
78
|
+
v3 adds Phase 0.1 with schema, generator script, JSON + human projection, \
|
|
79
|
+
and lock-in before Phase 1. Closed?
|
|
80
|
+
- **C2.** `load_context:` budget accounting model was undefined (rule chars \
|
|
81
|
+
only? rule + context? per-loader split?). v3 adds Phase 0.2 with default \
|
|
82
|
+
model (b) "rule + every loaded context", retroactive PR #34 test, max \
|
|
83
|
+
nesting depth 2. Closed?
|
|
84
|
+
- **C3.** Phase 6 → 2B decoupling was asserted without proof. v3 adds \
|
|
85
|
+
Phase 0.3 grep-and-document with three branch outcomes (0 hits / >0 hits / \
|
|
86
|
+
linter check). Closed?
|
|
87
|
+
|
|
88
|
+
### HIGH tier — must close before Phase 2A
|
|
89
|
+
|
|
90
|
+
- **H1.** 2A.4 worked example was inside the phase, not a pre-phase spike. \
|
|
91
|
+
v3 adds Phase 0.4 (pick `direct-answers`, run obligation diff, council \
|
|
92
|
+
reviews artefact). Closed?
|
|
93
|
+
- **H2.** Phase 3a spike scoring was subjective with no deadline. v3 adds \
|
|
94
|
+
Phase 0.5: 3-scorer protocol, persona-voice rubric file, 5-day deadline, \
|
|
95
|
+
default = A on tie. Closed?
|
|
96
|
+
- **H3.** Context-file path conventions were undefined for Phase 2A/2B/3. \
|
|
97
|
+
v3 adds Phase 0.6: locked path tree + `check_context_paths.py` linter + \
|
|
98
|
+
docs-sync orphan check. Closed?
|
|
99
|
+
|
|
100
|
+
### MODERATE tier — must close before Phase 3
|
|
101
|
+
|
|
102
|
+
- **M1.** Phase 3a rollback atomicity (per-skill vs. family-level). v3 \
|
|
103
|
+
rewrites 3a.2 as staged extraction (3a.2.1 in-place slim → 3a.2.2 parity → \
|
|
104
|
+
3a.2.3 atomic shared-context extract → 3a.2.4 post-parity). Closed?
|
|
105
|
+
- **M2.** Phase 2B's flat 30% LOC reduction target was unvalidated for \
|
|
106
|
+
logic-heavy rules. v3 adds 2B.0 LOC feasibility audit with custom targets \
|
|
107
|
+
for >70% LOGIC rules. Closed?
|
|
108
|
+
- **M3.** Phase 5 absolute slimming did not address proportional concentration. \
|
|
109
|
+
v3 adds 5.2.1 concentration threshold (≤12% per rule, ≤30% top-3) with \
|
|
110
|
+
re-distribution path. Closed?
|
|
111
|
+
|
|
112
|
+
### NICE-TO-HAVE tier (treat as "should be present")
|
|
113
|
+
|
|
114
|
+
- **N1.** Phase 1.4.1 cluster-pattern compliance check (`scripts/check_cluster_patterns.py`). Present?
|
|
115
|
+
- **N2.** Phase 4.3.1 dispatch-latency benchmark (≤+100ms gate). Present?
|
|
116
|
+
- **N3.** Locked-contract terminology (External-locked / Internal-locked / Deferred) at top of doc. Present?
|
|
117
|
+
|
|
118
|
+
### Round-3 locked decisions — must be referenceable + rollback-defined
|
|
119
|
+
|
|
120
|
+
- **Q1=A** (separate skills + shared context): rollback path in v3?
|
|
121
|
+
- **Q2=A** (one rule + three contexts): rollback path in v3?
|
|
122
|
+
- **Q3=A** (safety floor untouched): rollback path in v3 (two-gate)?
|
|
123
|
+
|
|
124
|
+
### v3-introduced new gaps (open-ended)
|
|
125
|
+
|
|
126
|
+
After validating the above, do a final scan: did v3's structural changes \
|
|
127
|
+
(Phase 0 insertion, gating contracts, expanded risk register) introduce \
|
|
128
|
+
any new contradictions, ghost references, or sequencing bugs? List up to \
|
|
129
|
+
three, ACCEPT-as-written if none.
|
|
130
|
+
|
|
131
|
+
## Final Output
|
|
132
|
+
|
|
133
|
+
After all per-finding blocks, add:
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
### Greenlight verdict
|
|
137
|
+
|
|
138
|
+
<one of: FULL GREENLIGHT — execute Phase 0 / CONDITIONAL GREENLIGHT — \
|
|
139
|
+
fix N residual gaps first / BLOCKED — major rework needed>
|
|
140
|
+
|
|
141
|
+
**Residual fix list (if any):** <numbered list, ≤5 items>
|
|
142
|
+
**Estimated residual effort:** <engineer-days>
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Do not re-write the roadmap. Do not propose v4 unless BLOCKED. Verdict \
|
|
146
|
+
language must be unambiguous. Total response budget: ≤ 1800 words.
|
|
147
|
+
"""
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
def main() -> int:
|
|
151
|
+
anthropic = AnthropicClient(api_key=load_anthropic_key(), model="claude-sonnet-4-5")
|
|
152
|
+
openai = OpenAIClient(api_key=load_openai_key(), model="gpt-4o")
|
|
153
|
+
members = [anthropic, openai]
|
|
154
|
+
|
|
155
|
+
context = bundle_roadmap(ROADMAP_PATH)
|
|
156
|
+
project = detect_project_context(REPO_ROOT)
|
|
157
|
+
table = load_prices()
|
|
158
|
+
|
|
159
|
+
user_prompt = REVIEW_PROMPT + "\n\n---\n\n" + context.text
|
|
160
|
+
|
|
161
|
+
question = CouncilQuestion(
|
|
162
|
+
mode="roadmap",
|
|
163
|
+
user_prompt=user_prompt,
|
|
164
|
+
max_tokens=4096,
|
|
165
|
+
)
|
|
166
|
+
|
|
167
|
+
estimates = estimate(
|
|
168
|
+
question, members, table, project=project, original_ask=ORIGINAL_ASK,
|
|
169
|
+
)
|
|
170
|
+
print("=== ESTIMATE (single round, max tokens) ===")
|
|
171
|
+
total_est = 0.0
|
|
172
|
+
for c, e in zip(members, estimates):
|
|
173
|
+
print(f" {c.name}/{c.model}: ~{e.input_tokens} in + {e.output_tokens} out = ${e.total_usd:.4f}")
|
|
174
|
+
total_est += e.total_usd
|
|
175
|
+
print(f" TOTAL per round (max): ${total_est:.4f}")
|
|
176
|
+
print()
|
|
177
|
+
|
|
178
|
+
budget = CostBudget(
|
|
179
|
+
max_input_tokens=200_000,
|
|
180
|
+
max_output_tokens=80_000,
|
|
181
|
+
max_calls=20,
|
|
182
|
+
max_total_usd=2.50,
|
|
183
|
+
)
|
|
184
|
+
|
|
185
|
+
rounds_collected: list[list] = []
|
|
186
|
+
|
|
187
|
+
def _on_round_complete(round_idx: int, round_responses) -> None:
|
|
188
|
+
rounds_collected.append(list(round_responses))
|
|
189
|
+
print(f"=== ROUND {round_idx + 1} COMPLETE ===")
|
|
190
|
+
for r in round_responses:
|
|
191
|
+
if r.error:
|
|
192
|
+
print(f" [error] {r.provider}/{r.model}: {r.error}")
|
|
193
|
+
continue
|
|
194
|
+
actual = estimate_cost(r.provider, r.model, r.input_tokens, r.output_tokens, table)
|
|
195
|
+
print(f" [done] {r.provider}/{r.model}: {r.input_tokens} in / "
|
|
196
|
+
f"{r.output_tokens} out · {r.latency_ms} ms · ${actual.total_usd:.4f}")
|
|
197
|
+
print()
|
|
198
|
+
|
|
199
|
+
print("=== CONSULT (1 round, focused close-out) ===")
|
|
200
|
+
consult(
|
|
201
|
+
members, question, budget,
|
|
202
|
+
rounds=1,
|
|
203
|
+
on_round_complete=_on_round_complete,
|
|
204
|
+
table=table, project=project, original_ask=ORIGINAL_ASK,
|
|
205
|
+
)
|
|
206
|
+
|
|
207
|
+
if not rounds_collected:
|
|
208
|
+
print("[error] no rounds completed", file=sys.stderr)
|
|
209
|
+
return 1
|
|
210
|
+
|
|
211
|
+
actual_total = 0.0
|
|
212
|
+
for round_responses in rounds_collected:
|
|
213
|
+
for r in round_responses:
|
|
214
|
+
if r.error:
|
|
215
|
+
continue
|
|
216
|
+
actual = estimate_cost(r.provider, r.model, r.input_tokens, r.output_tokens, table)
|
|
217
|
+
actual_total += actual.total_usd
|
|
218
|
+
print(f"=== TOTAL ACTUAL: ${actual_total:.4f} (across {len(rounds_collected)} rounds) ===")
|
|
219
|
+
|
|
220
|
+
final_round = rounds_collected[-1]
|
|
221
|
+
if not [r for r in final_round if not r.error]:
|
|
222
|
+
return 1
|
|
223
|
+
|
|
224
|
+
manifest = SessionManifest(
|
|
225
|
+
mode="roadmap",
|
|
226
|
+
artefact=str(ROADMAP_PATH.relative_to(REPO_ROOT)),
|
|
227
|
+
original_ask=ORIGINAL_ASK,
|
|
228
|
+
members=[f"{r.provider}/{r.model}" for r in final_round],
|
|
229
|
+
rounds=len(rounds_collected),
|
|
230
|
+
cost_usd_estimated=total_est,
|
|
231
|
+
cost_usd_actual=actual_total,
|
|
232
|
+
extra={"purpose": "Round-4 close-out review of structural-optimization v3"},
|
|
233
|
+
)
|
|
234
|
+
session_dir = save_session(manifest=manifest, responses=rounds_collected)
|
|
235
|
+
print(f"[saved] {session_dir.relative_to(REPO_ROOT)}/")
|
|
236
|
+
return 1 if any(r.error for round_r in rounds_collected for r in round_r) else 0
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
if __name__ == "__main__":
|
|
240
|
+
raise SystemExit(main())
|