@event4u/agent-config 16.3.0 → 16.5.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/.augment-plugin/marketplace.json +3 -3
- package/.augment-plugin/plugin.json +1 -1
- package/.claude-plugin/marketplace.json +1 -1
- package/CHANGELOG.md +178 -78
- package/README.md +2 -2
- package/agents/templates/.ai-council.yml.example +26 -8
- package/dist/agent-src/commands/analyze/inbox.md +10 -7
- package/dist/agent-src/commands/bug/investigate.md +1 -1
- package/dist/agent-src/commands/commit/in-chunks.md +40 -31
- package/dist/agent-src/commands/commit.md +72 -33
- package/dist/agent-src/commands/condense.md +2 -8
- package/dist/agent-src/commands/council/debate.md +11 -7
- package/dist/agent-src/commands/council/default.md +10 -9
- package/dist/agent-src/commands/council.md +1 -1
- package/dist/agent-src/commands/design.md +1 -1
- package/dist/agent-src/commands/estimate-ticket.md +1 -1
- package/dist/agent-src/commands/feature/explore.md +3 -3
- package/dist/agent-src/commands/feature/plan.md +1 -1
- package/dist/agent-src/commands/fix/ci.md +17 -3
- package/dist/agent-src/commands/fix/commit-messages.md +48 -23
- package/dist/agent-src/commands/fix/pr-comments.md +3 -6
- package/dist/agent-src/commands/implement-ticket.md +3 -3
- package/dist/agent-src/commands/memory/add.md +4 -16
- package/dist/agent-src/commands/memory/load.md +5 -6
- package/dist/agent-src/commands/memory/promote.md +3 -16
- package/dist/agent-src/commands/mission/upgrade.md +3 -2
- package/dist/agent-src/commands/optimize/agents-dir.md +2 -2
- package/dist/agent-src/commands/optimize/deep.md +4 -2
- package/dist/agent-src/commands/optimize/rtk.md +4 -26
- package/dist/agent-src/commands/pr/create/description-only.md +18 -15
- package/dist/agent-src/commands/pr/create.md +42 -34
- package/dist/agent-src/commands/pr/merge.md +136 -9
- package/dist/agent-src/commands/prepare-for-review.md +13 -11
- package/dist/agent-src/commands/project/analyze.md +7 -35
- package/dist/agent-src/commands/refine-ticket.md +1 -1
- package/dist/agent-src/commands/review/changes.md +14 -19
- package/dist/agent-src/commands/roadmap/next.md +10 -1
- package/dist/agent-src/commands/roadmap/process-full.md +52 -38
- package/dist/agent-src/commands/roadmap/resolve-blockers.md +64 -14
- package/dist/agent-src/commands/worktree/create.md +7 -3
- package/dist/agent-src/commands/worktree/verify.md +2 -1
- package/dist/agent-src/contexts/communication/rules-auto/think-before-action-mechanics.md +5 -3
- package/dist/agent-src/contexts/communication/rules-auto/token-efficiency-mechanics.md +7 -9
- package/dist/agent-src/contexts/contracts/command-suggestion-flow.md +8 -6
- package/dist/agent-src/contexts/contracts/frugality-charter.md +8 -5
- package/dist/agent-src/contexts/execution/auto-dispatch-classification.md +1 -1
- package/dist/agent-src/contexts/execution/auto-orchestration-activation.md +0 -1
- package/dist/agent-src/contexts/execution/evidence-discipline.md +2 -2
- package/dist/agent-src/contexts/execution/non-interactive-contract.md +5 -8
- package/dist/agent-src/contexts/execution/rdp-gate.md +4 -4
- package/dist/agent-src/contexts/execution/roadmap-execution-contract.md +9 -8
- package/dist/agent-src/contexts/execution/roadmap-process-loop.md +67 -52
- package/dist/agent-src/contexts/execution/subagent-routing.md +8 -8
- package/dist/agent-src/contexts/execution/subagent-steering.md +6 -4
- package/dist/agent-src/contexts/execution/terminal-states.md +2 -2
- package/dist/agent-src/contexts/execution/toolchain-resolver.md +4 -10
- package/dist/agent-src/contexts/subagent-configuration.md +1 -1
- package/dist/agent-src/guidelines/agent-infra/active-remediation-mechanics.md +39 -0
- package/dist/agent-src/guidelines/agent-infra/context-hygiene-mechanics.md +1 -1
- package/dist/agent-src/guidelines/agent-infra/cross-source-consistency-mechanics.md +8 -10
- package/dist/agent-src/guidelines/agent-infra/frontier-reasoning-operating-profile.md +3 -2
- package/dist/agent-src/guidelines/agent-infra/layered-settings.md +13 -1
- package/dist/agent-src/guidelines/agent-infra/roadmap-progress-mechanics.md +1 -1
- package/dist/agent-src/guidelines/agent-infra/self-improvement-pipeline.md +10 -3
- package/dist/agent-src/guidelines/agent-infra/size-and-scope.md +36 -0
- package/dist/agent-src/guidelines/design-antipatterns.md +1 -1
- package/dist/agent-src/guidelines/php/git.md +15 -2
- package/dist/agent-src/rules/active-remediation.md +0 -1
- package/dist/agent-src/rules/analysis-skill-routing.md +0 -1
- package/dist/agent-src/rules/architecture.md +0 -1
- package/dist/agent-src/rules/artifact-drafting-protocol.md +0 -1
- package/dist/agent-src/rules/artifact-engagement-recording.md +0 -1
- package/dist/agent-src/rules/augment-edit-discipline.md +0 -1
- package/dist/agent-src/rules/autonomous-execution.md +0 -1
- package/dist/agent-src/rules/brand-consistency.md +0 -1
- package/dist/agent-src/rules/brand-source-of-truth.md +0 -1
- package/dist/agent-src/rules/broken-access-control.md +0 -1
- package/dist/agent-src/rules/cli-output-handling.md +0 -1
- package/dist/agent-src/rules/code-comment-discipline.md +0 -1
- package/dist/agent-src/rules/code-provenance.md +0 -1
- package/dist/agent-src/rules/command-suggestion-policy.md +0 -1
- package/dist/agent-src/rules/commit-conventions.md +1 -2
- package/dist/agent-src/rules/communication-through-line.md +1 -2
- package/dist/agent-src/rules/content-quoting-floor.md +1 -2
- package/dist/agent-src/rules/context-hygiene.md +5 -5
- package/dist/agent-src/rules/copilot-routing.md +1 -2
- package/dist/agent-src/rules/council-availability.md +4 -4
- package/dist/agent-src/rules/cross-source-consistency.md +4 -6
- package/dist/agent-src/rules/decision-revisit-gate.md +2 -3
- package/dist/agent-src/rules/delegation-policy.md +2 -3
- package/dist/agent-src/rules/design-fidelity.md +0 -1
- package/dist/agent-src/rules/design-review-after-ui-write.md +3 -3
- package/dist/agent-src/rules/devcontainer-routing.md +1 -2
- package/dist/agent-src/rules/doc-screenshot-hygiene.md +0 -1
- package/dist/agent-src/rules/docker-commands.md +0 -1
- package/dist/agent-src/rules/domain-adoption-policy.md +0 -1
- package/dist/agent-src/rules/domain-safety-disclaimer.md +0 -1
- package/dist/agent-src/rules/domain-safety-pii.md +0 -1
- package/dist/agent-src/rules/domain-safety-retention.md +0 -1
- package/dist/agent-src/rules/downstream-changes.md +0 -1
- package/dist/agent-src/rules/engineering-safety-floor.md +0 -1
- package/dist/agent-src/rules/external-code-graph-interop.md +0 -1
- package/dist/agent-src/rules/external-reference-deep-dive.md +0 -1
- package/dist/agent-src/rules/fast-path-marker-visibility.md +1 -2
- package/dist/agent-src/rules/finance-safety-floor.md +0 -1
- package/dist/agent-src/rules/fix-what-you-see.md +6 -32
- package/dist/agent-src/rules/framework-neutrality-in-generic-skills.md +0 -1
- package/dist/agent-src/rules/git-history-discipline.md +1 -2
- package/dist/agent-src/rules/guidelines.md +0 -1
- package/dist/agent-src/rules/history-discipline.md +0 -1
- package/dist/agent-src/rules/icon-consistency.md +0 -1
- package/dist/agent-src/rules/image-likeness-and-rights.md +0 -1
- package/dist/agent-src/rules/improve-before-implement.md +0 -1
- package/dist/agent-src/rules/invite-challenge.md +0 -1
- package/dist/agent-src/rules/laravel-routing.md +1 -2
- package/dist/agent-src/rules/laravel-translations.md +0 -1
- package/dist/agent-src/rules/legal-safety-floor.md +0 -1
- package/dist/agent-src/rules/lethal-trifecta-guard.md +0 -1
- package/dist/agent-src/rules/linked-projects-onboarding-gate.md +0 -1
- package/dist/agent-src/rules/low-impact-corpus-privacy-floor.md +0 -1
- package/dist/agent-src/rules/markdown-safe-codeblocks.md +0 -1
- package/dist/agent-src/rules/media-governance-routing.md +1 -2
- package/dist/agent-src/rules/media-sync-ground-truth.md +0 -1
- package/dist/agent-src/rules/minimal-safe-diff.md +0 -1
- package/dist/agent-src/rules/missing-skill-recovery.md +0 -1
- package/dist/agent-src/rules/missing-tool-handling.md +0 -1
- package/dist/agent-src/rules/model-recommendation.md +0 -1
- package/dist/agent-src/rules/neighbour-precedence.md +64 -0
- package/dist/agent-src/rules/no-attribution-footers.md +0 -1
- package/dist/agent-src/rules/no-decorative-emojis-in-git-surfaces.md +0 -1
- package/dist/agent-src/rules/no-pr-progress-comments.md +0 -1
- package/dist/agent-src/rules/no-roadmap-references.md +0 -1
- package/dist/agent-src/rules/notes-first-reasoning.md +0 -1
- package/dist/agent-src/rules/onboarding-gate.md +0 -1
- package/dist/agent-src/rules/output-discipline.md +0 -1
- package/dist/agent-src/rules/package-ci-checks.md +0 -1
- package/dist/agent-src/rules/persona-governance.md +2 -3
- package/dist/agent-src/rules/php-coding.md +0 -1
- package/dist/agent-src/rules/prefer-enums-over-literals.md +0 -1
- package/dist/agent-src/rules/preservation-guard.md +0 -1
- package/dist/agent-src/rules/provider-lifecycle-discipline.md +2 -3
- package/dist/agent-src/rules/question-not-instruction.md +0 -1
- package/dist/agent-src/rules/reviewer-awareness.md +0 -1
- package/dist/agent-src/rules/roadmap-ci-steps-policy.md +0 -1
- package/dist/agent-src/rules/roadmap-progress-sync.md +3 -6
- package/dist/agent-src/rules/role-mode-adherence.md +0 -1
- package/dist/agent-src/rules/rule-type-governance.md +0 -1
- package/dist/agent-src/rules/runtime-safety.md +0 -1
- package/dist/agent-src/rules/scale-discipline.md +0 -1
- package/dist/agent-src/rules/secret-vcs-guard.md +0 -1
- package/dist/agent-src/rules/security-sensitive-stop.md +0 -1
- package/dist/agent-src/rules/self-repair-loop.md +0 -1
- package/dist/agent-src/rules/senior-engineering-discipline.md +0 -1
- package/dist/agent-src/rules/session-canary.md +0 -1
- package/dist/agent-src/rules/settings-ask-protocol.md +5 -6
- package/dist/agent-src/rules/size-enforcement.md +0 -1
- package/dist/agent-src/rules/skill-improvement-trigger.md +2 -3
- package/dist/agent-src/rules/skill-quality.md +0 -1
- package/dist/agent-src/rules/slash-command-routing-policy.md +0 -1
- package/dist/agent-src/rules/source-confidentiality.md +0 -1
- package/dist/agent-src/rules/source-discovery-gate.md +0 -1
- package/dist/agent-src/rules/source-of-truth.md +0 -1
- package/dist/agent-src/rules/spreadsheet-source-quality.md +1 -2
- package/dist/agent-src/rules/strategy-safety-floor.md +0 -1
- package/dist/agent-src/rules/symfony-routing.md +1 -2
- package/dist/agent-src/rules/think-before-action.md +0 -1
- package/dist/agent-src/rules/token-budget-discipline.md +14 -48
- package/dist/agent-src/rules/token-efficiency.md +0 -1
- package/dist/agent-src/rules/token-optimizer-maintenance.md +0 -1
- package/dist/agent-src/rules/tool-safety.md +0 -1
- package/dist/agent-src/rules/ui-audit-gate.md +1 -2
- package/dist/agent-src/rules/untrusted-input-defense.md +0 -1
- package/dist/agent-src/rules/upstream-proposal.md +0 -1
- package/dist/agent-src/rules/user-interaction.md +0 -1
- package/dist/agent-src/rules/user-interrupt-priority.md +0 -1
- package/dist/agent-src/scripts/gate_budget.ts +47 -23
- package/dist/agent-src/scripts/gate_execute.ts +12 -4
- package/dist/agent-src/skills/accessibility-auditor/data/aria-patterns.csv +2 -0
- package/dist/agent-src/skills/accessibility-auditor/data/manifest.json +3 -3
- package/dist/agent-src/skills/ai-council/SKILL.md +7 -4
- package/dist/agent-src/skills/ai-council/references/cost-and-redaction.md +21 -11
- package/dist/agent-src/skills/ai-council/references/procedure.md +12 -6
- package/dist/agent-src/skills/analysis-autonomous-mode/SKILL.md +1 -1
- package/dist/agent-src/skills/bug-analyzer/SKILL.md +1 -1
- package/dist/agent-src/skills/canvas-design/SKILL.md +4 -2
- package/dist/agent-src/skills/command-routing/SKILL.md +3 -4
- package/dist/agent-src/skills/conventional-commits-writing/SKILL.md +127 -139
- package/dist/agent-src/skills/corpus-grounding/ATTRIBUTION.md +39 -0
- package/dist/agent-src/skills/corpus-grounding/SKILL.md +8 -2
- package/dist/agent-src/skills/database/data/manifest.json +2 -2
- package/dist/agent-src/skills/database/data/query-tuning.csv +13 -13
- package/dist/agent-src/skills/design-intelligence/references/integration-mapping.md +13 -10
- package/dist/agent-src/skills/design-system-capture/SKILL.md +0 -3
- package/dist/agent-src/skills/estimate-ticket/SKILL.md +1 -1
- package/dist/agent-src/skills/fe-design/references/design-patterns.md +49 -2
- package/dist/agent-src/skills/feature-planning/SKILL.md +1 -1
- package/dist/agent-src/skills/frontend-render-security/SKILL.md +9 -0
- package/dist/agent-src/skills/git-workflow/SKILL.md +44 -44
- package/dist/agent-src/skills/git-workflow/references/branch-update.md +312 -0
- package/dist/agent-src/skills/git-workflow/references/commit-subject.md +205 -0
- package/dist/agent-src/skills/iconography/SKILL.md +4 -2
- package/dist/agent-src/skills/image-provider-routing/SKILL.md +16 -5
- package/dist/agent-src/skills/jira-integration/SKILL.md +3 -3
- package/dist/agent-src/skills/logo-generation/SKILL.md +12 -8
- package/dist/agent-src/skills/merge-conflicts/SKILL.md +10 -4
- package/dist/agent-src/skills/po-discovery/SKILL.md +1 -1
- package/dist/agent-src/skills/refine-ticket/SKILL.md +4 -4
- package/dist/agent-src/skills/roadmap-writing/SKILL.md +2 -2
- package/dist/agent-src/skills/skill-improvement-pipeline/SKILL.md +4 -2
- package/dist/agent-src/skills/source-discovery/SKILL.md +1 -1
- package/dist/agent-src/skills/svg-authoring/SKILL.md +318 -0
- package/dist/agent-src/skills/tailwind-engineer/SKILL.md +3 -1
- package/dist/agent-src/skills/testing-anti-patterns/SKILL.md +1 -1
- package/dist/agent-src/skills/using-git-worktrees/SKILL.md +1 -1
- package/dist/agent-src/skills/verify-repair-loop/SKILL.md +2 -2
- package/dist/agent-src/skills/wireframe/SKILL.md +5 -2
- package/dist/agent-src/templates/AGENTS.md +1 -1
- package/dist/agent-src/templates/agent-settings.md +46 -129
- package/dist/agent-src/templates/agents/agent-project-settings.example.yml +3 -3
- package/dist/agent-src/templates/command.md +2 -2
- package/dist/agent-src/templates/roadmaps.md +6 -1
- package/dist/agent-src/templates/scripts/work_engine/_lib/agent_settings.ts +0 -6
- package/dist/agent-src/templates/scripts/work_engine/directives/backend/_self_fix.ts +11 -7
- package/dist/agent-src/templates/scripts/work_engine/hooks/builtin/decision_trace.ts +3 -2
- package/dist/agent-src/templates/scripts/work_engine/hooks/builtin/memory_visibility.ts +2 -1
- package/dist/agent-src/templates/scripts/work_engine/hooks/settings.ts +0 -6
- package/dist/agent-src/templates/scripts/work_engine/scoring/decision_engine.ts +9 -12
- package/dist/agent-src/templates/scripts/work_engine/scoring/memory_visibility.ts +2 -1
- package/dist/agent-src/templates/skill.md +1 -1
- package/dist/cli/commands/uiRender.js +201 -4
- package/dist/cli/commands/uiRenderAsset.js +1308 -0
- package/dist/cli/commands/uiRenderAssetCompare.js +752 -0
- package/dist/cli/commands/uiRenderAssetGrid.js +265 -0
- package/dist/cli/commands/uiRenderAssetGrounds.js +323 -0
- package/dist/cli/commands/uiRenderAssetIsolation.js +85 -0
- package/dist/cli/commands/uiRenderAssetTypes.js +145 -0
- package/dist/cli/main.js +47 -1
- package/dist/cli/registry.js +2 -1
- package/dist/cli-delegate/check_update_banner.js +195 -119
- package/dist/cli-delegate/{chunk-S4UMZNES.js → chunk-4DBG5K7M.js} +5 -5
- package/dist/cli-delegate/{chunk-TRI6DQZ6.js → chunk-5GPULQBE.js} +60 -42
- package/dist/cli-delegate/{chunk-JQVYKIZA.js → chunk-6SRJTYJS.js} +33 -177
- package/dist/cli-delegate/chunk-6V5FMA3P.js +186 -0
- package/dist/cli-delegate/chunk-6YQC2HLF.js +415 -0
- package/dist/cli-delegate/{chunk-E4XIZDIB.js → chunk-7HKRE54K.js} +1 -64
- package/dist/cli-delegate/{chunk-7HQ52DHU.js → chunk-AL3RZ22D.js} +1 -1
- package/dist/cli-delegate/{chunk-DBH4AHDK.js → chunk-ED7KCMLB.js} +9 -11
- package/dist/cli-delegate/{chunk-NXEILF2K.js → chunk-F3QDG2GT.js} +481 -72
- package/dist/cli-delegate/{chunk-CQWX336L.js → chunk-G5VVIZRC.js} +3 -3
- package/dist/cli-delegate/{chunk-JY2I2DXV.js → chunk-H76PHZBI.js} +137 -60
- package/dist/cli-delegate/chunk-IAYTIIQW.js +67 -0
- package/dist/cli-delegate/{chunk-LIYTLH6O.js → chunk-KXXWJTDO.js} +5 -10
- package/dist/cli-delegate/{chunk-T7L2QK3K.js → chunk-LQOCRFWT.js} +1 -1
- package/dist/cli-delegate/{chunk-S4YWNRKO.js → chunk-MDPPKQCQ.js} +34 -1
- package/dist/cli-delegate/chunk-OAFSJBHH.js +272 -0
- package/dist/cli-delegate/{chunk-GKE7ZVFA.js → chunk-PWX7CKMD.js} +1 -1
- package/dist/cli-delegate/{chunk-NDJLNC6Q.js → chunk-T6BP34WI.js} +1 -0
- package/dist/cli-delegate/{chunk-RQNNW7IF.js → chunk-T7XSJSUQ.js} +433 -632
- package/dist/cli-delegate/{chunk-NQ7WT43P.js → chunk-TMWYUOK4.js} +75 -12
- package/dist/cli-delegate/{chunk-EEHDXSYD.js → chunk-WQWXGIWB.js} +12 -273
- package/dist/cli-delegate/{chunk-QLDHIPWR.js → chunk-XQTPXKFA.js} +1 -1
- package/dist/cli-delegate/cmd_analyze_session.js +223 -43
- package/dist/cli-delegate/cmd_brand_status.js +3 -2
- package/dist/cli-delegate/cmd_conformance.js +489 -238
- package/dist/cli-delegate/cmd_converge.js +3 -3
- package/dist/cli-delegate/cmd_doctor.js +15 -12
- package/dist/cli-delegate/cmd_doctor_neighbours.js +11 -4
- package/dist/cli-delegate/cmd_explain.js +43 -19
- package/dist/cli-delegate/cmd_export.js +10 -10
- package/dist/cli-delegate/cmd_git_convention.js +1851 -0
- package/dist/cli-delegate/cmd_handoff.js +40 -21
- package/dist/cli-delegate/cmd_mcp_available.js +3 -2
- package/dist/cli-delegate/cmd_migrate.js +3 -3
- package/dist/cli-delegate/cmd_packs_active.js +4 -3
- package/dist/cli-delegate/cmd_prune.js +10 -10
- package/dist/cli-delegate/cmd_route_audit.js +7 -7
- package/dist/cli-delegate/cmd_route_explain.js +5 -5
- package/dist/cli-delegate/cmd_session_recycle.js +9 -7
- package/dist/cli-delegate/cmd_settings_check.js +54 -7
- package/dist/cli-delegate/cmd_settings_get.js +18 -8
- package/dist/cli-delegate/cmd_settings_migrate.js +10 -10
- package/dist/cli-delegate/cmd_settings_set.js +1 -1
- package/dist/cli-delegate/cmd_sync.js +10 -10
- package/dist/cli-delegate/cmd_uninstall.js +10 -10
- package/dist/cli-delegate/cmd_update.js +7 -7
- package/dist/cli-delegate/cmd_upgrade.js +7 -7
- package/dist/cli-delegate/cmd_validate.js +10 -10
- package/dist/cli-delegate/cmd_versions.js +5 -5
- package/dist/cli-delegate/gate_budget.js +1 -1
- package/dist/cli-delegate/gate_execute.js +2 -2
- package/dist/cli-delegate/roadmap_gates.js +2 -2
- package/dist/discovery/deprecation-report.md +1 -1
- package/dist/discovery/discovery-manifest.json +171 -107
- package/dist/discovery/discovery-manifest.json.sha256 +1 -1
- package/dist/discovery/discovery-manifest.summary.md +7 -7
- package/dist/discovery/dormancy-report.md +1 -1
- package/dist/discovery/orphan-report.md +1 -1
- package/dist/discovery/packs.json +41 -22
- package/dist/discovery/trust-report.md +3 -3
- package/dist/discovery/workspaces.json +16 -11
- package/dist/hooks/dispatch.js +2520 -1924
- package/dist/hooks/dispatch.sha256 +1 -1
- package/dist/hooks/svg_rules.chunk.cjs +1626 -0
- package/dist/hooks/svg_rules.chunk.cjs.sha256 +1 -0
- package/dist/install/install.mjs +462 -431
- package/dist/install/installThinLayer.js +40 -12
- package/dist/install/installedRuleLinks.js +105 -19
- package/dist/mcp/awesome-mcp-servers.row.md +1 -1
- package/dist/mcp/mcp-cloudflare-catalogue.json +2 -2
- package/dist/mcp/registry-manifest.json +5 -5
- package/dist/mcp/server.json +2 -2
- package/dist/mcp/server.mjs +3063 -2160
- package/dist/router.json +1 -1
- package/dist/scripts/_lib/agent_settings.js +15 -120
- package/dist/scripts/_lib/compile_time_toggles.js +12 -21
- package/dist/scripts/_lib/git_convention.js +232 -0
- package/dist/scripts/_lib/global_deploy_inventory.js +730 -0
- package/dist/scripts/_lib/installed_layer.js +344 -18
- package/dist/scripts/_lib/package_root.js +68 -0
- package/dist/scripts/_lib/rule_law_section.js +1 -1
- package/dist/scripts/_lib/scan_scope.js +105 -0
- package/dist/scripts/_lib/settings_removed_keys.js +168 -0
- package/dist/scripts/_lib/svg_dom.js +284 -0
- package/dist/scripts/_lib/svg_geometry.js +477 -0
- package/dist/scripts/_lib/svg_motion.js +179 -0
- package/dist/scripts/_lib/svg_rules.js +1337 -0
- package/dist/scripts/_lib/svg_urls.js +67 -0
- package/dist/scripts/_lib/thin_rules.js +80 -3
- package/dist/scripts/lint_svg_asset.js +324 -0
- package/dist/server/app.js +2 -1
- package/dist/server/gitKeysGate.js +105 -0
- package/dist/server/routes/settings.js +67 -8
- package/dist/server/routes/wizard.js +4 -0
- package/dist/server/schemas/settings.js +23 -81
- package/dist/shared/skillRanking.js +30 -4
- package/dist/ui/assets/{index-Cwq4d0hX.js → index-C3djEJah.js} +2 -2
- package/dist/ui/index.html +1 -1
- package/docs/MIGRATION.md +72 -1
- package/docs/contracts/settings-classes.md +35 -65
- package/docs/guidelines/agent-infra/active-remediation-mechanics.md +39 -0
- package/docs/guidelines/agent-infra/context-hygiene-mechanics.md +1 -1
- package/docs/guidelines/agent-infra/cross-source-consistency-mechanics.md +8 -10
- package/docs/guidelines/agent-infra/frontier-reasoning-operating-profile.md +3 -2
- package/docs/guidelines/agent-infra/layered-settings.md +13 -1
- package/docs/guidelines/agent-infra/roadmap-progress-mechanics.md +1 -1
- package/docs/guidelines/agent-infra/self-improvement-pipeline.md +10 -3
- package/docs/guidelines/agent-infra/size-and-scope.md +36 -0
- package/docs/guidelines/design-antipatterns.md +1 -1
- package/docs/guidelines/php/git.md +15 -2
- package/package.json +4 -3
- package/src/agent-src/scripts/gate_budget.ts +47 -23
- package/src/agent-src/scripts/gate_execute.ts +12 -4
- package/src/agent-src/templates/AGENTS.md +1 -1
- package/src/agent-src/templates/scripts/work_engine/_lib/agent_settings.ts +0 -6
- package/src/agent-src/templates/scripts/work_engine/directives/backend/_self_fix.ts +11 -7
- package/src/agent-src/templates/scripts/work_engine/hooks/builtin/decision_trace.ts +3 -2
- package/src/agent-src/templates/scripts/work_engine/hooks/builtin/memory_visibility.ts +2 -1
- package/src/agent-src/templates/scripts/work_engine/hooks/settings.ts +0 -6
- package/src/agent-src/templates/scripts/work_engine/scoring/decision_engine.ts +9 -12
- package/src/agent-src/templates/scripts/work_engine/scoring/memory_visibility.ts +2 -1
- package/src/config/agent-settings.template.yml +79 -312
- package/src/config/agents-paths.yml +16 -0
- package/src/config/assurance-capability-registry.json +7 -3
- package/src/config/ci-local-parity.yml +3 -0
- package/src/config/continuity-surface.json +3 -3
- package/src/config/discovery/packs.yml +17 -1
- package/src/config/evaluator-budgets.json +19 -6
- package/src/config/gate-coverage.yml +65 -23
- package/src/config/gate-violation-baselines.json +56 -16
- package/src/config/gitignore-block.txt +19 -0
- package/src/config/hook-bundle-budget.json +1 -1
- package/src/config/release-gate-locality.yml +2 -1
- package/src/config/routing-coverage-seed.json +55 -6
- package/src/config/rule-law-ceilings.json +12 -6
- package/src/config/rule-obligations.json +833 -0
- package/src/install/installThinLayer.ts +76 -10
- package/src/install/installedRuleLinks.ts +105 -17
- package/src/scripts/_cli/cmd_analyze_session.ts +9 -15
- package/src/scripts/_cli/cmd_conformance.ts +13 -2
- package/src/scripts/_cli/cmd_doctor.ts +10 -10
- package/src/scripts/_cli/cmd_doctor_neighbours.ts +133 -0
- package/src/scripts/_cli/cmd_explain.ts +72 -14
- package/src/scripts/_cli/cmd_git_convention.ts +637 -0
- package/src/scripts/_cli/cmd_settings_check.ts +66 -8
- package/src/scripts/_cli/cmd_settings_get.ts +18 -3
- package/src/scripts/_cli/doctor_execution.ts +72 -1
- package/src/scripts/_dispatch.bash +37 -2
- package/src/scripts/_lib/agent_settings.ts +15 -124
- package/src/scripts/_lib/blocked_by_marker.ts +1 -1
- package/src/scripts/_lib/compile_time_toggles.ts +12 -21
- package/src/scripts/_lib/dispatch_import_closure.ts +163 -0
- package/src/scripts/_lib/git_base_ref.ts +92 -0
- package/src/scripts/_lib/git_convention.ts +291 -0
- package/src/scripts/_lib/git_convention_carrier.ts +389 -0
- package/src/scripts/_lib/git_convention_grammar.ts +246 -0
- package/src/scripts/_lib/git_convention_measure.ts +344 -0
- package/src/scripts/_lib/global_deploy_inventory.ts +74 -0
- package/src/scripts/_lib/graph_feeder_record.ts +236 -13
- package/src/scripts/_lib/installed_layer.ts +448 -23
- package/src/scripts/_lib/knowledge_global.ts +14 -1
- package/src/scripts/_lib/module_reach.ts +456 -0
- package/src/scripts/_lib/neighbour_contradictions.ts +236 -0
- package/src/scripts/_lib/neighbour_tool_use.ts +8 -10
- package/src/scripts/_lib/ratification_artifact.ts +220 -1
- package/src/scripts/_lib/ratification_subject.ts +92 -0
- package/src/scripts/_lib/release_findings_ingest.ts +15 -7
- package/src/scripts/_lib/release_highlights.ts +5 -0
- package/src/scripts/_lib/rule_law_section.ts +1 -1
- package/src/scripts/_lib/rule_obligations.ts +205 -0
- package/src/scripts/_lib/self_repair.ts +1 -1
- package/src/scripts/_lib/settings_removed_keys.ts +173 -0
- package/src/scripts/_lib/svg_dom.ts +318 -0
- package/src/scripts/_lib/svg_geometry.ts +480 -0
- package/src/scripts/_lib/svg_motion.ts +208 -0
- package/src/scripts/_lib/svg_rules.ts +1453 -0
- package/src/scripts/_lib/svg_urls.ts +72 -0
- package/src/scripts/_lib/test_red_state.ts +5 -0
- package/src/scripts/_lib/thin_rules.ts +83 -3
- package/src/scripts/_lib/touched_file_quality.ts +142 -6
- package/src/scripts/_lib/verification_command.ts +59 -0
- package/src/scripts/_lib/verify_clause.ts +27 -17
- package/src/scripts/_lib/worker_budget.ts +1 -1
- package/src/scripts/adr/regenerate_index.ts +16 -1
- package/src/scripts/ai_council/config.ts +7 -7
- package/src/scripts/ai_council/modification_review.ts +100 -0
- package/src/scripts/ai_council/modification_review_questions.ts +90 -0
- package/src/scripts/ai_council/orchestrator.ts +5 -5
- package/src/scripts/ai_council/spend_gate.ts +18 -7
- package/src/scripts/ai_team/config.ts +11 -16
- package/src/scripts/audit_user_type_axis.ts +20 -8
- package/src/scripts/bench_ab_clone.ts +1 -2
- package/src/scripts/bench_concern_spawn_path.ts +129 -0
- package/src/scripts/bench_graph_feeder_latency.ts +584 -0
- package/src/scripts/check_agent_artifact_location.ts +36 -0
- package/src/scripts/check_branch_freshness.ts +147 -24
- package/src/scripts/check_enforcement_coverage.ts +130 -0
- package/src/scripts/check_evaluator_budgets.ts +4 -0
- package/src/scripts/check_finding_dispositions.ts +88 -25
- package/src/scripts/check_gate_coverage.ts +4 -3
- package/src/scripts/check_gate_reachability.ts +48 -1
- package/src/scripts/check_generator_sync.ts +48 -0
- package/src/scripts/check_hook_bundle_composition.ts +107 -0
- package/src/scripts/check_kernel_edit_ratified.ts +86 -6
- package/src/scripts/check_pack_size.ts +1 -1
- package/src/scripts/check_release_manifest_content.ts +189 -0
- package/src/scripts/check_standing_rule_delivery.ts +96 -0
- package/src/scripts/check_suppression_hygiene.ts +2 -5
- package/src/scripts/ci_settle.ts +42 -5
- package/src/scripts/classify_merge_risk.ts +320 -0
- package/src/scripts/closure_scan.ts +91 -1
- package/src/scripts/command_suggester/settings.ts +8 -108
- package/src/scripts/command_suggester/types.ts +4 -5
- package/src/scripts/consumer_matrix.ts +102 -0
- package/src/scripts/context_hygiene_hook.ts +13 -23
- package/src/scripts/cost/preflight.mjs +12 -1
- package/src/scripts/council_cli.ts +7 -7
- package/src/scripts/dispatch_r2_reviewer.ts +24 -11
- package/src/scripts/explain_run.ts +8 -13
- package/src/scripts/generate_git_convention_grammar.ts +127 -0
- package/src/scripts/generate_host_cost_table.ts +20 -3
- package/src/scripts/handoff_context_hook.ts +86 -37
- package/src/scripts/hook_manifest.json +1 -1
- package/src/scripts/hook_manifest.yaml +25 -6
- package/src/scripts/hooks/block_config_weakening.ts +48 -5
- package/src/scripts/hooks/block_plumbing_writes.ts +8 -4
- package/src/scripts/hooks/block_speaking_inbox_dir.ts +16 -1
- package/src/scripts/hooks/concern_registry.ts +2 -0
- package/src/scripts/hooks/delegation_nudge_hook.ts +2 -3
- package/src/scripts/hooks/design_pass_hook.ts +157 -3
- package/src/scripts/hooks/evidence_independence.ts +12 -4
- package/src/scripts/hooks/mcp_usage_observation_hook.ts +121 -0
- package/src/scripts/hooks/push_settle_hook.ts +4 -3
- package/src/scripts/hooks/rule_inject_hook.ts +44 -3
- package/src/scripts/hooks/state_io.ts +8 -4
- package/src/scripts/hooks/svg_obligation.ts +497 -0
- package/src/scripts/hooks/svg_rules_loader.ts +133 -0
- package/src/scripts/hooks/telemetry_usage_hook.ts +7 -46
- package/src/scripts/hooks/turn_end_gate_hook.ts +6 -3
- package/src/scripts/install-hooks.sh +42 -14
- package/src/scripts/install.ts +7 -31
- package/src/scripts/lint_blocker_citations.ts +198 -0
- package/src/scripts/lint_consolidation_lineage.ts +6 -3
- package/src/scripts/lint_design_quality.ts +60 -12
- package/src/scripts/lint_evidence_artifacts.ts +9 -0
- package/src/scripts/lint_hook_concern_budget.ts +10 -21
- package/src/scripts/lint_motion_authority_drift.ts +27 -0
- package/src/scripts/lint_pack_boundaries.ts +406 -28
- package/src/scripts/lint_roadmap_blockers.ts +282 -29
- package/src/scripts/lint_roadmap_complexity.ts +4 -2
- package/src/scripts/lint_rule_law_section.ts +151 -21
- package/src/scripts/lint_rule_skill_pack_reach.ts +17 -0
- package/src/scripts/lint_settings_classes.ts +1 -1
- package/src/scripts/lint_svg_asset.ts +365 -0
- package/src/scripts/lint_ticked_unmet_criteria.ts +165 -0
- package/src/scripts/lint_workflow_security.ts +12 -1
- package/src/scripts/measure_skill_ranker_baseline.ts +5 -0
- package/src/scripts/model_rule_injection.ts +3 -3
- package/src/scripts/onboarding_gate_hook.ts +7 -6
- package/src/scripts/print_required_checks.ts +15 -3
- package/src/scripts/probe_host_compliance.ts +33 -5
- package/src/scripts/probe_turnaround.ts +183 -3
- package/src/scripts/ratification_header.ts +77 -0
- package/src/scripts/refusal_envelope.ts +138 -0
- package/src/scripts/release_publication.ts +29 -3
- package/src/scripts/report_dispatch_import_closure.ts +76 -0
- package/src/scripts/report_installed_rule_links.ts +118 -1
- package/src/scripts/report_module_reach.ts +212 -0
- package/src/scripts/report_obligation_mechanism.ts +16 -18
- package/src/scripts/report_parked_blockers.ts +222 -0
- package/src/scripts/report_required_checks_drift.ts +196 -0
- package/src/scripts/report_skill_ranker_confusion.ts +103 -2
- package/src/scripts/report_standing_payload_by_host.ts +1 -1
- package/src/scripts/routing_doctor.ts +2 -2
- package/src/scripts/schemas/agent-settings.schema.json +17 -31
- package/src/scripts/schemas/command.schema.json +1 -1
- package/src/scripts/schemas/skill.schema.json +1 -1
- package/src/scripts/self_review_gate.ts +39 -2
- package/src/scripts/skill_tools/score_skill_relevance.ts +28 -19
- package/src/scripts/sync_pr_branch.ts +403 -132
- package/src/scripts/trigger_eval_grandfather.json +0 -16
- package/src/server/schemas/settings.ts +33 -177
- package/src/shared/skillRanking.ts +53 -4
- package/dist/cli-delegate/chunk-NYX3L2PZ.js +0 -99
- package/src/scripts/_lib/config_chain.ts +0 -477
- package/src/scripts/_lib/conformance_report.ts +0 -403
- package/src/scripts/_lib/eval_discrimination.ts +0 -95
- package/src/scripts/_lib/evaluator_promotion.ts +0 -225
- package/src/scripts/_lib/file_slicer.ts +0 -117
- package/src/scripts/_lib/legacy_boundary_map.ts +0 -228
- package/src/scripts/_lib/minimality_tiebreak.ts +0 -168
- package/src/scripts/_lib/overbuild_lens_contract.ts +0 -196
- package/src/scripts/_lib/role_split.ts +0 -338
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* modification_review — the review verb for a diff whose bundle contains a
|
|
3
|
+
* gated path: how a seat closes, and how the record's verdict follows.
|
|
4
|
+
*
|
|
5
|
+
* `road-to-self-modification-that-a-council-must-pass` steps 3.2 and 3.3.
|
|
6
|
+
*
|
|
7
|
+
* WHY THE EXISTING STANCE PARSER AND NOT A NEW ONE. Seats already close on a
|
|
8
|
+
* `STANCE: … | CONFIDENCE: … | DEALBREAKER: …` line, and `stance_tally` already
|
|
9
|
+
* parses it — including the two cosmetic defects it forgives. A second grammar
|
|
10
|
+
* for the same closing line would be a second thing to keep in step with the
|
|
11
|
+
* prompt, and the first time they diverged a seat's verdict would be read by
|
|
12
|
+
* one and dropped by the other.
|
|
13
|
+
*
|
|
14
|
+
* WHAT IS DELIBERATELY NOT USED. Not the option tally, and not the synthesis
|
|
15
|
+
* verdict line. Both answer which OPTION wins a deliberation; this review asks
|
|
16
|
+
* whether each SEAT passed a change, which is a different question over the
|
|
17
|
+
* same replies. Nor is the diff lens's own closing line asked for — a lens is
|
|
18
|
+
* not a seat.
|
|
19
|
+
*
|
|
20
|
+
* WHY A VERB OF ITS OWN HERE RATHER THAN AN `agent-config` COMMAND. The CLI
|
|
21
|
+
* help-count budget is at its maximum (`cli_help_command_count` in
|
|
22
|
+
* `src/config/evaluator-budgets.json`), so a new top-level verb would spend a
|
|
23
|
+
* ratchet this change has no claim on. It dispatches inside `council_cli`.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
import { parse_stance_line } from './stance_tally.js';
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The closed vocabulary a seat may close on. Open it and a grep for a passing
|
|
30
|
+
* verdict starts reading words nobody adjudicated — the failure
|
|
31
|
+
* `ratification-artifact.md` names for its own `verdict` field.
|
|
32
|
+
*/
|
|
33
|
+
export const MODIFICATION_VERDICT_LABELS = [
|
|
34
|
+
'ratified',
|
|
35
|
+
'confirmed-non-expanding',
|
|
36
|
+
'refused',
|
|
37
|
+
] as const;
|
|
38
|
+
|
|
39
|
+
export type ModificationVerdictLabel = (typeof MODIFICATION_VERDICT_LABELS)[number];
|
|
40
|
+
|
|
41
|
+
/** The record's verdict: a seat label, or the one value no seat may utter. */
|
|
42
|
+
export type ModificationVerdict = ModificationVerdictLabel | 'non-convergent';
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Read ONE seat's reply. Returns its label when the seat concluded, `null`
|
|
46
|
+
* otherwise — a missing line, an abstention, or any other label.
|
|
47
|
+
*
|
|
48
|
+
* `null` is never inferred from surrounding prose: a seat that writes
|
|
49
|
+
* "I would call this ratified" has not closed on a stance line, and reading it
|
|
50
|
+
* as a conclusion is how a review starts reporting verdicts nobody gave.
|
|
51
|
+
*/
|
|
52
|
+
export function seatConclusion(text: string): ModificationVerdictLabel | null {
|
|
53
|
+
const line = parse_stance_line(text);
|
|
54
|
+
if (line === null) return null;
|
|
55
|
+
const label = line.label.trim().toLowerCase();
|
|
56
|
+
return (MODIFICATION_VERDICT_LABELS as readonly string[]).includes(label)
|
|
57
|
+
? (label as ModificationVerdictLabel)
|
|
58
|
+
: null;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Read every seat, keeping the non-concluding ones present and `null` rather
|
|
63
|
+
* than dropping them. A dropped seat is indistinguishable from a seat that was
|
|
64
|
+
* never asked, and the quorum rule below has to tell those apart.
|
|
65
|
+
*/
|
|
66
|
+
export function readSeatConclusions(
|
|
67
|
+
replies: Readonly<Record<string, string>>,
|
|
68
|
+
): Record<string, ModificationVerdictLabel | null> {
|
|
69
|
+
const out: Record<string, ModificationVerdictLabel | null> = {};
|
|
70
|
+
for (const [seat, text] of Object.entries(replies)) {
|
|
71
|
+
out[seat] = seatConclusion(text);
|
|
72
|
+
}
|
|
73
|
+
return out;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Derive the record's verdict. ONE rule, and the ORDER is the rule:
|
|
78
|
+
*
|
|
79
|
+
* 1. any concluding seat on `refused` → `refused`
|
|
80
|
+
* 2. concluding providers < required → `non-convergent`
|
|
81
|
+
* 3. any concluding seat on `ratified` → `ratified`
|
|
82
|
+
* 4. otherwise (all concluded, all non-expanding) → `confirmed-non-expanding`
|
|
83
|
+
*
|
|
84
|
+
* Step 1 precedes step 2 on purpose. A single refusing seat is a refusal even
|
|
85
|
+
* when it is the only seat that concluded: letting the quorum rule fire first
|
|
86
|
+
* would turn "one reviewer said no" into "not enough reviewers answered", which
|
|
87
|
+
* reads as a retryable condition rather than as the objection it is.
|
|
88
|
+
*/
|
|
89
|
+
export function deriveModificationVerdict(
|
|
90
|
+
seats: Readonly<Record<string, ModificationVerdictLabel | null>>,
|
|
91
|
+
requiredProviders: number,
|
|
92
|
+
): ModificationVerdict {
|
|
93
|
+
const concluded = Object.values(seats).filter(
|
|
94
|
+
(v): v is ModificationVerdictLabel => v !== null,
|
|
95
|
+
);
|
|
96
|
+
if (concluded.includes('refused')) return 'refused';
|
|
97
|
+
if (concluded.length < requiredProviders) return 'non-convergent';
|
|
98
|
+
if (concluded.includes('ratified')) return 'ratified';
|
|
99
|
+
return 'confirmed-non-expanding';
|
|
100
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* modification_review_questions — the fixed set a modification review asks
|
|
3
|
+
* every seat, one by one.
|
|
4
|
+
*
|
|
5
|
+
* `road-to-self-modification-that-a-council-must-pass` step 3.1. The owner's
|
|
6
|
+
* directive of 2026-10-05 is that self-modification is a goal, confirmed by a
|
|
7
|
+
* council that "always questions critically and checks what the modification
|
|
8
|
+
* does". A council that is merely ASKED for an opinion produces an opinion; a
|
|
9
|
+
* council handed a fixed list answers the same nine things about every change,
|
|
10
|
+
* and a reader can tell which one a seat skipped.
|
|
11
|
+
*
|
|
12
|
+
* WHY A CONSTANT RATHER THAN PROSE IN A PROMPT. The list is the review's
|
|
13
|
+
* contract, so it is quoted in `docs/contracts/ratification-artifact.md` and
|
|
14
|
+
* read from here by whatever renders the prompt. One definition, two readers —
|
|
15
|
+
* the alternative is a prompt and a contract that drift apart silently, which
|
|
16
|
+
* is the drift this package's own gates exist to catch.
|
|
17
|
+
*
|
|
18
|
+
* WHERE THE TREE ALREADY WORDS A QUESTION, THAT WORDING IS USED rather than
|
|
19
|
+
* paraphrased. Two do: `evaluator-independence`'s weakening clause and the
|
|
20
|
+
* synthesis prompt's kill-switch criteria. A paraphrase would be a second,
|
|
21
|
+
* slightly different standard for the same thing — and each carries a `source`
|
|
22
|
+
* so a reader can check the borrow rather than take it.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/** One question, addressable on its own so a skipped answer is visible. */
|
|
26
|
+
export interface ModificationReviewQuestion {
|
|
27
|
+
/** Stable id; the record's body keys each seat's answer by it. */
|
|
28
|
+
readonly id: string;
|
|
29
|
+
/** The question as asked, verbatim. */
|
|
30
|
+
readonly text: string;
|
|
31
|
+
/** Where the wording came from, when it was taken rather than written. */
|
|
32
|
+
readonly source?: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* The nine, in the order step 3.1 enumerates them. Order is part of the
|
|
37
|
+
* contract: a seat answering one by one answers them in this sequence, so a
|
|
38
|
+
* record can be read against the list without matching prose to intent.
|
|
39
|
+
*/
|
|
40
|
+
export const MODIFICATION_REVIEW_QUESTIONS: readonly ModificationReviewQuestion[] = [
|
|
41
|
+
{
|
|
42
|
+
id: 'behaviour-change',
|
|
43
|
+
text: 'What behaviour changes, including what follows from it that the diff does not state?',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
id: 'boundary-direction',
|
|
47
|
+
text: 'Which authority or safety boundary becomes wider or narrower, and in which direction?',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
id: 'weakens-its-own-judge',
|
|
51
|
+
text:
|
|
52
|
+
'Does the change weaken anything that judges it — a test, a gate, a threshold, this review? ' +
|
|
53
|
+
'The standard is quoted rather than paraphrased: the implementer never silently ' +
|
|
54
|
+
'weakens an assertion, deletes, skips or xfails a failing test, lowers a threshold, ' +
|
|
55
|
+
'or changes fixture semantics to fit the code. Does this change do any of those?',
|
|
56
|
+
source: 'src/rules/evaluator-independence.md § Tests are evaluators',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
id: 'route-around',
|
|
60
|
+
text: 'Is another host or projection left as a way around the control this change touches?',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
id: 'undo',
|
|
64
|
+
text: 'Can it be undone, and how — by whom, with what authority, and against which revision?',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
id: 'falsifier',
|
|
68
|
+
text:
|
|
69
|
+
'What observation would show the claimed benefit to be false, and what rollback / ' +
|
|
70
|
+
'kill-switch criteria does the change omit?',
|
|
71
|
+
source: 'src/scripts/ai_council/prompts.ts (DESIGN_MODE, ROADMAP_MODE)',
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
id: 'smaller-change',
|
|
75
|
+
text: 'Would a smaller change do, and what does the larger one buy that the smaller one does not?',
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
id: 'instruction-weight',
|
|
79
|
+
text: 'What does it add to standing instruction weight that every later session pays?',
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
id: 'untrusted-steering',
|
|
83
|
+
text: 'Could untrusted content steer the path this change opens, and what bounds it if so?',
|
|
84
|
+
},
|
|
85
|
+
];
|
|
86
|
+
|
|
87
|
+
/** The list as a seat sees it: numbered, in order, nothing dropped. */
|
|
88
|
+
export function renderModificationReviewQuestions(): string {
|
|
89
|
+
return MODIFICATION_REVIEW_QUESTIONS.map((q, i) => `${i + 1}. ${q.text}`).join('\n');
|
|
90
|
+
}
|
|
@@ -412,7 +412,7 @@ export function consult(
|
|
|
412
412
|
return [];
|
|
413
413
|
}
|
|
414
414
|
const resolvedBudget = budget ?? new CostBudget();
|
|
415
|
-
if (members.length > resolvedBudget.max_calls) {
|
|
415
|
+
if (resolvedBudget.max_calls > 0 && members.length > resolvedBudget.max_calls) {
|
|
416
416
|
throw new Error(
|
|
417
417
|
`Council has ${members.length} members but budget caps at ` +
|
|
418
418
|
`${resolvedBudget.max_calls} calls.`,
|
|
@@ -802,9 +802,9 @@ function _run_round(
|
|
|
802
802
|
);
|
|
803
803
|
actual_usd = _total_usd(actual);
|
|
804
804
|
spent.usd += _total_usd(actual);
|
|
805
|
-
//
|
|
806
|
-
//
|
|
807
|
-
if (
|
|
805
|
+
// Ledger every billable response, bounded or not (ADR-279): a cap
|
|
806
|
+
// decides whether the total is compared, never whether it is kept.
|
|
807
|
+
if (!response.error) {
|
|
808
808
|
_record_daily_spend(_total_usd(actual), effective.name, effective.model, {
|
|
809
809
|
cache_read_input_tokens: response.cache_read_input_tokens,
|
|
810
810
|
cache_creation_input_tokens: response.cache_creation_input_tokens,
|
|
@@ -1246,7 +1246,7 @@ export function run_debate(
|
|
|
1246
1246
|
return [];
|
|
1247
1247
|
}
|
|
1248
1248
|
const budget = budget0 ?? new CostBudget();
|
|
1249
|
-
if (members.length > budget.max_calls) {
|
|
1249
|
+
if (budget.max_calls > 0 && members.length > budget.max_calls) {
|
|
1250
1250
|
throw new Error(
|
|
1251
1251
|
`Debate has ${members.length} members but budget caps at ` +
|
|
1252
1252
|
`${budget.max_calls} calls.`,
|
|
@@ -20,9 +20,9 @@ import type { ExternalAIClient } from './clients.js';
|
|
|
20
20
|
import { would_exceed as _would_exceed_daily } from './budget_guard.js';
|
|
21
21
|
|
|
22
22
|
export class CostBudget {
|
|
23
|
-
max_input_tokens: number;
|
|
24
|
-
max_output_tokens: number;
|
|
25
|
-
max_calls: number;
|
|
23
|
+
max_input_tokens: number; // 0 = input-token ceiling disabled
|
|
24
|
+
max_output_tokens: number; // 0 = output-token ceiling disabled
|
|
25
|
+
max_calls: number; // 0 = per-invocation call cap disabled (fan-out unbounded)
|
|
26
26
|
max_total_usd: number; // 0 = USD ceiling disabled (token caps still apply)
|
|
27
27
|
daily_limit_usd: number; // 0 = rolling 24h cap disabled (D3)
|
|
28
28
|
|
|
@@ -35,8 +35,11 @@ export class CostBudget {
|
|
|
35
35
|
daily_limit_usd?: number;
|
|
36
36
|
} = {},
|
|
37
37
|
) {
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
// ADR-279: the two token ceilings default to 0 = unbounded, as the two
|
|
39
|
+
// USD ceilings below already did. `max_calls` keeps its default — it
|
|
40
|
+
// bounds fan-out against a plan quota, not money.
|
|
41
|
+
this.max_input_tokens = args.max_input_tokens ?? 0;
|
|
42
|
+
this.max_output_tokens = args.max_output_tokens ?? 0;
|
|
40
43
|
this.max_calls = args.max_calls ?? 10;
|
|
41
44
|
this.max_total_usd = args.max_total_usd ?? 0.0;
|
|
42
45
|
this.daily_limit_usd = args.daily_limit_usd ?? 0.0;
|
|
@@ -101,9 +104,17 @@ export function _breach(
|
|
|
101
104
|
budget: CostBudget,
|
|
102
105
|
): BreachKind {
|
|
103
106
|
const usd = est ? _total_usd(est) : 0.0;
|
|
107
|
+
// Zero disables a token cap, as `ai-council-config.md:84-86` has always
|
|
108
|
+
// said it does. Until 2026-10-06 these two comparisons carried no guard
|
|
109
|
+
// while the two USD comparisons below them did, so a budget with every
|
|
110
|
+
// cap at zero — the contract's "no bound at all" — breached on a
|
|
111
|
+
// ten-token estimate. The guard goes on each cap separately: a user who
|
|
112
|
+
// set one and left the other at zero is bounded by the one they set.
|
|
104
113
|
if (
|
|
105
|
-
|
|
106
|
-
|
|
114
|
+
(budget.max_input_tokens > 0 &&
|
|
115
|
+
spent.input + (est ? est.input_tokens : 0) > budget.max_input_tokens) ||
|
|
116
|
+
(budget.max_output_tokens > 0 &&
|
|
117
|
+
spent.output + (est ? est.output_tokens : 0) > budget.max_output_tokens)
|
|
107
118
|
) {
|
|
108
119
|
return 'tokens';
|
|
109
120
|
}
|
|
@@ -31,9 +31,10 @@
|
|
|
31
31
|
* 1. `ai_team` absent → defaults. Non-mapping → error.
|
|
32
32
|
* 2. Unknown keys under `ai_team` are rejected — a typo must never
|
|
33
33
|
* silently disable a gate (`allow_delegate` misspelled = delegation
|
|
34
|
-
* stays off AND the load fails loudly). `enabled`
|
|
35
|
-
* deliberate
|
|
36
|
-
*
|
|
34
|
+
* stays off AND the load fails loudly). `enabled` and
|
|
35
|
+
* `suppress_setup_hint` are the deliberate exceptions: retired keys,
|
|
36
|
+
* accepted, untyped, ignored, so a leftover line never fails `/team`.
|
|
37
|
+
* 3. `allow_delegate` is a boolean.
|
|
37
38
|
* 4. `model` is a non-empty string. `'auto'` = pass no `--model` flag
|
|
38
39
|
* (the codex CLI default applies); any other value passes through
|
|
39
40
|
* verbatim.
|
|
@@ -63,7 +64,6 @@ export interface AiTeamConfig {
|
|
|
63
64
|
readonly model: string;
|
|
64
65
|
readonly allow_delegate: boolean;
|
|
65
66
|
readonly max_calls_per_day: number;
|
|
66
|
-
readonly suppress_setup_hint: boolean;
|
|
67
67
|
readonly review_gate: AiTeamReviewGateConfig;
|
|
68
68
|
}
|
|
69
69
|
|
|
@@ -78,7 +78,6 @@ export const AI_TEAM_DEFAULTS: AiTeamConfig = Object.freeze({
|
|
|
78
78
|
model: 'auto',
|
|
79
79
|
allow_delegate: false,
|
|
80
80
|
max_calls_per_day: 50,
|
|
81
|
-
suppress_setup_hint: false,
|
|
82
81
|
review_gate: AI_TEAM_REVIEW_GATE_DEFAULTS,
|
|
83
82
|
});
|
|
84
83
|
|
|
@@ -93,17 +92,18 @@ const _KNOWN_KEYS: ReadonlySet<string> = new Set([
|
|
|
93
92
|
'model',
|
|
94
93
|
'allow_delegate',
|
|
95
94
|
'max_calls_per_day',
|
|
96
|
-
'suppress_setup_hint',
|
|
97
95
|
'review_gate',
|
|
98
96
|
]);
|
|
99
97
|
|
|
100
98
|
/**
|
|
101
|
-
* Deleted
|
|
102
|
-
* Never added to `_KNOWN_KEYS` —
|
|
103
|
-
* read into `AiTeamConfig`;
|
|
99
|
+
* Deleted keys accepted-and-ignored for migration grace (see module docstring).
|
|
100
|
+
* Never added to `_KNOWN_KEYS` — they carry no validated type and are never
|
|
101
|
+
* read into `AiTeamConfig`; they exist in this set only so the unknown-key
|
|
104
102
|
* loop below does not fail-closed an existing project's leftover value.
|
|
103
|
+
* `suppress_setup_hint` is the shipped template's own line, so every install
|
|
104
|
+
* that ran the wizard carries it.
|
|
105
105
|
*/
|
|
106
|
-
const _DELETED_KEYS: ReadonlySet<string> = new Set(['enabled']);
|
|
106
|
+
const _DELETED_KEYS: ReadonlySet<string> = new Set(['enabled', 'suppress_setup_hint']);
|
|
107
107
|
|
|
108
108
|
const _KNOWN_REVIEW_GATE_KEYS: ReadonlySet<string> = new Set([
|
|
109
109
|
'managed',
|
|
@@ -205,11 +205,6 @@ export function build_ai_team_config(raw: unknown): AiTeamConfig {
|
|
|
205
205
|
}
|
|
206
206
|
|
|
207
207
|
const allow_delegate = _requireBool(raw, 'allow_delegate', AI_TEAM_DEFAULTS.allow_delegate);
|
|
208
|
-
const suppress_setup_hint = _requireBool(
|
|
209
|
-
raw,
|
|
210
|
-
'suppress_setup_hint',
|
|
211
|
-
AI_TEAM_DEFAULTS.suppress_setup_hint,
|
|
212
|
-
);
|
|
213
208
|
|
|
214
209
|
let model = AI_TEAM_DEFAULTS.model;
|
|
215
210
|
if ('model' in raw) {
|
|
@@ -236,7 +231,7 @@ export function build_ai_team_config(raw: unknown): AiTeamConfig {
|
|
|
236
231
|
|
|
237
232
|
const review_gate = _build_review_gate('review_gate' in raw ? raw['review_gate'] : undefined);
|
|
238
233
|
|
|
239
|
-
return { model, allow_delegate, max_calls_per_day,
|
|
234
|
+
return { model, allow_delegate, max_calls_per_day, review_gate };
|
|
240
235
|
}
|
|
241
236
|
|
|
242
237
|
/**
|
|
@@ -3,10 +3,15 @@
|
|
|
3
3
|
* Audit the user-type axis frontmatter coverage (step-9 Phase 4).
|
|
4
4
|
*
|
|
5
5
|
* Ported from the retired Python `src/scripts/audit_user_type_axis.py` (ADR-200,
|
|
6
|
-
* Phase 8 / Wave 8a). The CLI contract is pinned —
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
6
|
+
* Phase 8 / Wave 8a). The CLI contract is pinned — `--quiet`, exit code (1
|
|
7
|
+
* when orphans exist, else 0), the stdout split, byte-identical stdout
|
|
8
|
+
* summary, AND byte-identical generated Markdown report. Stdlib-only — no YAML
|
|
9
|
+
* dependency.
|
|
10
|
+
*
|
|
11
|
+
* `--write` (2026-10-07) is the one deliberate addition: the report is written
|
|
12
|
+
* ONLY under it. Every run used to rewrite the tracked report, so the
|
|
13
|
+
* `lint-user-type-axis` task — a read — dirtied the working tree. The lint
|
|
14
|
+
* reads; `task regen-user-type-axis-report` writes.
|
|
10
15
|
*
|
|
11
16
|
* Two checks across `src/skills/`:
|
|
12
17
|
*
|
|
@@ -242,6 +247,7 @@ export function _render_report(
|
|
|
242
247
|
|
|
243
248
|
export function main(argv: string[]): number {
|
|
244
249
|
const quiet = argv.includes('--quiet');
|
|
250
|
+
const write = argv.includes('--write');
|
|
245
251
|
// Scope assertion: the orphan/unused verdict is a set difference against
|
|
246
252
|
// the skills corpus, so an unreadable corpus does not yield "no orphans",
|
|
247
253
|
// it yields a vacuous answer that looks identical to a clean one.
|
|
@@ -267,9 +273,11 @@ export function main(argv: string[]): number {
|
|
|
267
273
|
const orphans = new Set<string>([...used].filter((v) => !declared.has(v)));
|
|
268
274
|
const unused = new Set<string>([...declared].filter((v) => !used.has(v)));
|
|
269
275
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
276
|
+
if (write) {
|
|
277
|
+
const report = _render_report(declared, byValue, orphans, unused);
|
|
278
|
+
fs.mkdirSync(path.dirname(REPORT_PATH), { recursive: true });
|
|
279
|
+
fs.writeFileSync(REPORT_PATH, report, 'utf-8');
|
|
280
|
+
}
|
|
273
281
|
|
|
274
282
|
if (!quiet) {
|
|
275
283
|
process.stdout.write(
|
|
@@ -283,7 +291,11 @@ export function main(argv: string[]): number {
|
|
|
283
291
|
if (unused.size > 0) {
|
|
284
292
|
process.stdout.write(' warn unused: ' + _sorted(unused).join(', ') + '\n');
|
|
285
293
|
}
|
|
286
|
-
process.stdout.write(
|
|
294
|
+
process.stdout.write(
|
|
295
|
+
write
|
|
296
|
+
? ` report: ${_relativeToPosix(REPORT_PATH, REPO_ROOT)}\n`
|
|
297
|
+
: ' report: not written (pass --write to regenerate it)\n',
|
|
298
|
+
);
|
|
287
299
|
}
|
|
288
300
|
|
|
289
301
|
if (orphans.size === 0) {
|
|
@@ -199,8 +199,7 @@ export function write_clone_settings(variant: string, target: string): void {
|
|
|
199
199
|
'# Generated by bench_ab_clone.py for the A/B/C value benchmark.\n' +
|
|
200
200
|
'# Only the RDP toggle is set here; everything else uses package defaults.\n' +
|
|
201
201
|
'reasoning:\n' +
|
|
202
|
-
` enabled: ${enabled}\n
|
|
203
|
-
' auto_gate: true\n';
|
|
202
|
+
` enabled: ${enabled}\n`;
|
|
204
203
|
fs.writeFileSync(path.join(target, '.agent-settings.yml'), settings, 'utf-8');
|
|
205
204
|
}
|
|
206
205
|
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
#!/usr/bin/env tsx
|
|
2
|
+
/**
|
|
3
|
+
* Wall time of one blocking `pre_tool_use` concern through the SPAWN path —
|
|
4
|
+
* interpreter start included — as p50 and p95.
|
|
5
|
+
*
|
|
6
|
+
* `road-to-a-ratification-fence-that-follows-its-imports` 4.1, the receiver for
|
|
7
|
+
* the half of the archived plumbing roadmap's AC-3 that was carried "as the
|
|
8
|
+
* narrowing it is". `concern_sla_ms` measures in-process concern work only, so
|
|
9
|
+
* `sla_ms x 3` could not be judged as a spawn timeout: the tree had no
|
|
10
|
+
* spawn-path number. This produces one.
|
|
11
|
+
*
|
|
12
|
+
* It replicates `dispatch_hook._run_concern`'s isolated branch rather than
|
|
13
|
+
* calling it (that function is private plumbing and editing it to export a
|
|
14
|
+
* helper would be a gated change for a measurement): the same `tsx` binary the
|
|
15
|
+
* dispatcher resolves from `node_modules/.bin`, the same envelope builder
|
|
16
|
+
* (`_build_envelope`), the same hardened env, the envelope on stdin, and the
|
|
17
|
+
* concern's own `--platform` argument. What it does not include is the
|
|
18
|
+
* dispatcher's own start-up, which happens once per event, not once per
|
|
19
|
+
* concern.
|
|
20
|
+
*
|
|
21
|
+
* It gates nothing and wires nothing. Whether a timeout of `sla_ms x 3` is
|
|
22
|
+
* tenable is a READING of its output, made by whoever reads it, and one
|
|
23
|
+
* machine's p95 is that machine's.
|
|
24
|
+
*
|
|
25
|
+
* Usage:
|
|
26
|
+
* npx tsx src/scripts/bench_concern_spawn_path.ts [--runs 20] [--concern block-no-verify]
|
|
27
|
+
*
|
|
28
|
+
* Exit 0 on a measurement, 2 when the concern or `tsx` cannot be found.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
import { spawnSync } from 'node:child_process';
|
|
32
|
+
import * as fs from 'node:fs';
|
|
33
|
+
import * as os from 'node:os';
|
|
34
|
+
import * as path from 'node:path';
|
|
35
|
+
import { performance } from 'node:perf_hooks';
|
|
36
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
37
|
+
|
|
38
|
+
import { parse as parseYaml } from 'yaml';
|
|
39
|
+
|
|
40
|
+
import { hardenedSpawnEnv } from './_lib/spawn_env.js';
|
|
41
|
+
import { _build_envelope } from './hooks/dispatch_hook.js';
|
|
42
|
+
|
|
43
|
+
const _HERE = fileURLToPath(import.meta.url);
|
|
44
|
+
const REPO = path.resolve(path.dirname(_HERE), '..', '..');
|
|
45
|
+
|
|
46
|
+
/** Nearest-rank percentile over a sorted copy. */
|
|
47
|
+
export function percentile(samples: readonly number[], p: number): number {
|
|
48
|
+
if (samples.length === 0) {
|
|
49
|
+
return Number.NaN;
|
|
50
|
+
}
|
|
51
|
+
const sorted = [...samples].sort((a, b) => a - b);
|
|
52
|
+
const rank = Math.max(1, Math.ceil((p / 100) * sorted.length));
|
|
53
|
+
return sorted[Math.min(rank, sorted.length) - 1] as number;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function concernScript(name: string): string | null {
|
|
57
|
+
const manifest = parseYaml(fs.readFileSync(path.join(REPO, 'src/scripts/hook_manifest.yaml'), 'utf8')) as {
|
|
58
|
+
concerns?: Record<string, { script?: string; severity?: string }>;
|
|
59
|
+
};
|
|
60
|
+
const def = manifest.concerns?.[name];
|
|
61
|
+
return def?.script === undefined ? null : path.join(REPO, def.script);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function main(argv: readonly string[] = process.argv.slice(2)): number {
|
|
65
|
+
let runs = 20;
|
|
66
|
+
let concern = 'block-no-verify';
|
|
67
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
68
|
+
if (argv[i] === '--runs') {
|
|
69
|
+
runs = Number(argv[i + 1] ?? runs);
|
|
70
|
+
i += 1;
|
|
71
|
+
} else if (argv[i] === '--concern') {
|
|
72
|
+
concern = argv[i + 1] ?? concern;
|
|
73
|
+
i += 1;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const script = concernScript(concern);
|
|
77
|
+
const tsx = path.join(REPO, 'node_modules', '.bin', process.platform === 'win32' ? 'tsx.cmd' : 'tsx');
|
|
78
|
+
if (script === null || !fs.existsSync(script) || !fs.existsSync(tsx)) {
|
|
79
|
+
process.stderr.write(`bench_concern_spawn_path: concern ${concern} or ${tsx} not found\n`);
|
|
80
|
+
return 2;
|
|
81
|
+
}
|
|
82
|
+
const payload = JSON.stringify({
|
|
83
|
+
session_id: 'bench',
|
|
84
|
+
hook_event_name: 'PreToolUse',
|
|
85
|
+
tool_name: 'Bash',
|
|
86
|
+
tool_input: { command: 'ls' },
|
|
87
|
+
});
|
|
88
|
+
const envelope = _build_envelope(
|
|
89
|
+
{
|
|
90
|
+
platform: 'claude',
|
|
91
|
+
event: 'pre_tool_use',
|
|
92
|
+
native_event: 'PreToolUse',
|
|
93
|
+
} as Parameters<typeof _build_envelope>[0],
|
|
94
|
+
payload,
|
|
95
|
+
);
|
|
96
|
+
const input = JSON.stringify(envelope);
|
|
97
|
+
const env = hardenedSpawnEnv({ AGENT_CONFIG_PACKAGE_ROOT: REPO });
|
|
98
|
+
|
|
99
|
+
const samples: number[] = [];
|
|
100
|
+
const codes = new Set<number | null>();
|
|
101
|
+
for (let i = 0; i < runs; i += 1) {
|
|
102
|
+
const t0 = performance.now();
|
|
103
|
+
const proc = spawnSync(tsx, [script, '--platform', 'claude'], {
|
|
104
|
+
input,
|
|
105
|
+
encoding: 'utf-8',
|
|
106
|
+
cwd: REPO,
|
|
107
|
+
env,
|
|
108
|
+
timeout: 30_000,
|
|
109
|
+
});
|
|
110
|
+
samples.push(performance.now() - t0);
|
|
111
|
+
codes.add(proc.status);
|
|
112
|
+
}
|
|
113
|
+
const cpu = os.cpus()[0]?.model ?? 'unknown cpu';
|
|
114
|
+
process.stdout.write(
|
|
115
|
+
[
|
|
116
|
+
`concern: ${concern} (${path.relative(REPO, script)})`,
|
|
117
|
+
`runner: ${os.platform()} ${os.arch()} · ${cpu} · ${String(os.cpus().length)} cpus · node ${process.version}`,
|
|
118
|
+
`runs: ${String(runs)} · exit codes: ${[...codes].join(', ')}`,
|
|
119
|
+
`p50: ${percentile(samples, 50).toFixed(1)} ms`,
|
|
120
|
+
`p95: ${percentile(samples, 95).toFixed(1)} ms`,
|
|
121
|
+
`max: ${Math.max(...samples).toFixed(1)} ms`,
|
|
122
|
+
].join('\n') + '\n',
|
|
123
|
+
);
|
|
124
|
+
return 0;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
if (process.argv[1] !== undefined && import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
128
|
+
process.exit(main());
|
|
129
|
+
}
|