@event4u/agent-config 14.23.0 → 16.0.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 +144 -152
- package/README.md +1 -1
- package/dist/agent-src/commands/agent-handoff.md +8 -7
- package/dist/agent-src/commands/agents/init.md +1 -1
- package/dist/agent-src/commands/agents/user/accept.md +4 -4
- package/dist/agent-src/commands/agents/user/delete.md +2 -2
- package/dist/agent-src/commands/agents/user/init.md +3 -3
- package/dist/agent-src/commands/agents/user/review.md +3 -3
- package/dist/agent-src/commands/agents/user/show.md +3 -3
- package/dist/agent-src/commands/agents/user/update.md +2 -2
- package/dist/agent-src/commands/agents/user.md +6 -6
- package/dist/agent-src/commands/analytics/prune.md +1 -1
- package/dist/agent-src/commands/analytics/show.md +2 -2
- package/dist/agent-src/commands/analyze/decision.md +2 -2
- package/dist/agent-src/commands/analyze/inbox.md +5 -5
- package/dist/agent-src/commands/analyze/incident.md +3 -3
- package/dist/agent-src/commands/analyze/near-miss.md +3 -3
- package/dist/agent-src/commands/analyze/postmortem.md +4 -4
- package/dist/agent-src/commands/analyze/premortem.md +2 -2
- package/dist/agent-src/commands/analyze.md +2 -2
- package/dist/agent-src/commands/bug/fix.md +1 -1
- package/dist/agent-src/commands/bug/investigate.md +2 -2
- package/dist/agent-src/commands/cost/profile.md +3 -3
- package/dist/agent-src/commands/design.md +1 -1
- package/dist/agent-src/commands/feature/explore.md +1 -1
- package/dist/agent-src/commands/feature/plan.md +2 -2
- package/dist/agent-src/commands/feature/roadmap.md +2 -2
- package/dist/agent-src/commands/ghostwriter/fetch.md +4 -4
- package/dist/agent-src/commands/ghostwriter/list.md +1 -1
- package/dist/agent-src/commands/ghostwriter/show.md +1 -1
- package/dist/agent-src/commands/ghostwriter/write.md +9 -9
- package/dist/agent-src/commands/humanize.md +6 -6
- package/dist/agent-src/commands/jira-ticket.md +1 -1
- package/dist/agent-src/commands/judge/solo.md +1 -1
- package/dist/agent-src/commands/judge.md +1 -1
- package/dist/agent-src/commands/knowledge/cross-repo.md +1 -1
- package/dist/agent-src/commands/knowledge/forget.md +1 -1
- package/dist/agent-src/commands/knowledge/ingest.md +2 -2
- package/dist/agent-src/commands/knowledge/list.md +1 -1
- package/dist/agent-src/commands/memory/add.md +3 -3
- package/dist/agent-src/commands/memory/load.md +4 -4
- package/dist/agent-src/commands/memory/mine-session.md +1 -1
- package/dist/agent-src/commands/memory/promote.md +4 -4
- package/dist/agent-src/commands/memory/propose.md +2 -2
- package/dist/agent-src/commands/mode.md +5 -5
- package/dist/agent-src/commands/post-as/ghostwriter.md +3 -3
- package/dist/agent-src/commands/post-as/me.md +7 -7
- package/dist/agent-src/commands/pr/create.md +1 -1
- package/dist/agent-src/commands/pr/merge.md +1 -1
- package/dist/agent-src/commands/profile/activate.md +1 -1
- package/dist/agent-src/commands/profile/show.md +1 -1
- package/dist/agent-src/commands/research/deep.md +2 -2
- package/dist/agent-src/commands/research/report.md +2 -2
- package/dist/agent-src/commands/review/changes.md +1 -1
- package/dist/agent-src/commands/review/routing.md +1 -1
- package/dist/agent-src/commands/roadmap/create.md +4 -3
- package/dist/agent-src/commands/roadmap/materialize.md +2 -2
- package/dist/agent-src/commands/roadmap/next.md +1 -1
- package/dist/agent-src/commands/roadmap/process-full.md +2 -2
- package/dist/agent-src/commands/security-audit-config.md +3 -3
- package/dist/agent-src/commands/skill/preview.md +1 -1
- package/dist/agent-src/commands/skills/discover.md +1 -1
- package/dist/agent-src/commands/sync/agent-settings.md +2 -2
- package/dist/agent-src/commands/sync/gitignore/fix.md +1 -1
- package/dist/agent-src/commands/tests/create.md +1 -1
- package/dist/agent-src/commands/tests/e2e-heal.md +1 -1
- package/dist/agent-src/commands/tests/e2e-plan.md +1 -1
- package/dist/agent-src/contexts/authority/kernel-rule-edits.md +6 -6
- package/dist/agent-src/contexts/communication/rules-auto/slash-command-routing-policy-mechanics.md +1 -2
- package/dist/agent-src/contexts/communication/rules-auto/think-before-action-mechanics.md +2 -2
- package/dist/agent-src/contexts/communication/rules-auto/token-efficiency-mechanics.md +88 -1
- package/dist/agent-src/contexts/communication/rules-auto/user-interaction-mechanics.md +51 -1
- package/dist/agent-src/contexts/contracts/frugality-charter.md +1 -1
- package/dist/agent-src/contexts/execution/auto-dispatch-classification.md +1 -1
- package/dist/agent-src/contexts/execution/auto-orchestration-activation.md +1 -1
- package/dist/agent-src/contexts/execution/autonomy-mechanics.md +1 -1
- package/dist/agent-src/contexts/execution/cheap-question-mechanics.md +1 -1
- package/dist/agent-src/contexts/execution/contract-decision-sheet.md +3 -3
- package/dist/agent-src/contexts/execution/mandated-lines.md +1 -1
- package/dist/agent-src/contexts/execution/non-interactive-contract.md +1 -1
- package/dist/agent-src/contexts/execution/orchestration-telemetry.md +1 -1
- package/dist/agent-src/contexts/execution/plan-confidence-gate.md +5 -5
- package/dist/agent-src/contexts/execution/roadmap-execution-contract.md +1 -1
- package/dist/agent-src/contexts/execution/subagent-modes-detail.md +1 -1
- package/dist/agent-src/contexts/execution/subagent-routing.md +2 -2
- package/dist/agent-src/contexts/execution/subagent-spawn-contract.md +1 -1
- package/dist/agent-src/contexts/execution/user-memory-channels.md +3 -3
- package/dist/agent-src/contexts/execution/verification-mechanics.md +1 -1
- package/dist/agent-src/contexts/judges/persona-voice-rubric.md +2 -2
- package/dist/agent-src/guidelines/abstraction-thresholds.md +88 -0
- package/dist/agent-src/guidelines/agent-infra/5w2h-analysis.md +260 -0
- package/dist/agent-src/guidelines/agent-infra/active-remediation-mechanics.md +99 -0
- package/dist/agent-src/guidelines/agent-infra/agent-interaction-and-decision-quality.md +325 -0
- package/dist/agent-src/guidelines/agent-infra/api-cost-levers.md +177 -0
- package/dist/agent-src/guidelines/agent-infra/artifact-drafting-protocol-mechanics.md +222 -0
- package/dist/agent-src/guidelines/agent-infra/ask-when-uncertain-demos.md +134 -0
- package/dist/agent-src/guidelines/agent-infra/asking-and-brevity-examples.md +198 -0
- package/dist/agent-src/guidelines/agent-infra/break-glass-usage.md +113 -0
- package/dist/agent-src/guidelines/agent-infra/carve-out-predicates.md +17 -0
- package/dist/agent-src/guidelines/agent-infra/comparison-matrix.md +179 -0
- package/dist/agent-src/guidelines/agent-infra/context-hygiene-mechanics.md +165 -0
- package/dist/agent-src/guidelines/agent-infra/corpus-grounding-authoring.md +91 -0
- package/dist/agent-src/guidelines/agent-infra/critical-thinking.md +156 -0
- package/dist/agent-src/guidelines/agent-infra/cross-source-consistency-mechanics.md +109 -0
- package/dist/agent-src/guidelines/agent-infra/developer-judgment.md +82 -0
- package/dist/agent-src/guidelines/agent-infra/direct-answers-demos.md +142 -0
- package/dist/agent-src/guidelines/agent-infra/domain-adoption-gates.md +112 -0
- package/dist/agent-src/guidelines/agent-infra/domain-eval-anti-pattern.md +53 -0
- package/dist/agent-src/guidelines/agent-infra/domain-pack-architecture.md +56 -0
- package/dist/agent-src/guidelines/agent-infra/downstream-changes-mechanics.md +91 -0
- package/dist/agent-src/guidelines/agent-infra/emphasis-budget.md +45 -0
- package/dist/agent-src/guidelines/agent-infra/engineering-memory-data-format.md +210 -0
- package/dist/agent-src/guidelines/agent-infra/evaluator-independence-mechanics.md +92 -0
- package/dist/agent-src/guidelines/agent-infra/existence-question-verdicts.md +80 -0
- package/dist/agent-src/guidelines/agent-infra/failure-signatures.md +70 -0
- package/dist/agent-src/guidelines/agent-infra/false-green.md +233 -0
- package/dist/agent-src/guidelines/agent-infra/first-principles.md +192 -0
- package/dist/agent-src/guidelines/agent-infra/framework-neutrality-patterns.md +66 -0
- package/dist/agent-src/guidelines/agent-infra/frontier-reasoning-operating-profile.md +169 -0
- package/dist/agent-src/guidelines/agent-infra/gate-authoring.md +177 -0
- package/dist/agent-src/guidelines/agent-infra/guarded-baseline.md +39 -0
- package/dist/agent-src/guidelines/agent-infra/installed-tools-manifest.md +142 -0
- package/dist/agent-src/guidelines/agent-infra/inversion-thinking.md +388 -0
- package/dist/agent-src/guidelines/agent-infra/ios-simulator-guide.md +378 -0
- package/dist/agent-src/guidelines/agent-infra/language-and-tone-examples.md +141 -0
- package/dist/agent-src/guidelines/agent-infra/layered-settings.md +317 -0
- package/dist/agent-src/guidelines/agent-infra/linked-projects-onboarding-gate.md +80 -0
- package/dist/agent-src/guidelines/agent-infra/mcp-request-signing.md +197 -0
- package/dist/agent-src/guidelines/agent-infra/memory-access.md +149 -0
- package/dist/agent-src/guidelines/agent-infra/mental-models.md +314 -0
- package/dist/agent-src/guidelines/agent-infra/minimal-safe-diff-mechanics.md +241 -0
- package/dist/agent-src/guidelines/agent-infra/missing-tool-handling.md +66 -0
- package/dist/agent-src/guidelines/agent-infra/model-recommendation.md +101 -0
- package/dist/agent-src/guidelines/agent-infra/naming.md +69 -0
- package/dist/agent-src/guidelines/agent-infra/notes-horizon-mechanics.md +90 -0
- package/dist/agent-src/guidelines/agent-infra/output-patterns.md +117 -0
- package/dist/agent-src/guidelines/agent-infra/recurring-criticism-mechanics.md +96 -0
- package/dist/agent-src/guidelines/agent-infra/reuse-verdict-mechanics.md +71 -0
- package/dist/agent-src/guidelines/agent-infra/review-routing-data-format.md +143 -0
- package/dist/agent-src/guidelines/agent-infra/roadmap-deferred-resolution-provenance.md +54 -0
- package/dist/agent-src/guidelines/agent-infra/roadmap-progress-mechanics.md +274 -0
- package/dist/agent-src/guidelines/agent-infra/role-contracts.md +209 -0
- package/dist/agent-src/guidelines/agent-infra/role-mode-router.md +89 -0
- package/dist/agent-src/guidelines/agent-infra/rule-body-migration-inventory.md +241 -0
- package/dist/agent-src/guidelines/agent-infra/rule-type-governance.md +73 -0
- package/dist/agent-src/guidelines/agent-infra/runtime-layer.md +89 -0
- package/dist/agent-src/guidelines/agent-infra/scqa-framework.md +526 -0
- package/dist/agent-src/guidelines/agent-infra/security-lint-containment.md +121 -0
- package/dist/agent-src/guidelines/agent-infra/self-improvement-pipeline.md +134 -0
- package/dist/agent-src/guidelines/agent-infra/simplicity-and-goal-demos.md +211 -0
- package/dist/agent-src/guidelines/agent-infra/six-hats.md +353 -0
- package/dist/agent-src/guidelines/agent-infra/size-and-scope.md +229 -0
- package/dist/agent-src/guidelines/agent-infra/skill-quality-checklist.md +157 -0
- package/dist/agent-src/guidelines/agent-infra/source-confidentiality-mechanics.md +109 -0
- package/dist/agent-src/guidelines/agent-infra/symptom-driven-harvest-loop.md +104 -0
- package/dist/agent-src/guidelines/agent-infra/systems-thinking.md +220 -0
- package/dist/agent-src/guidelines/agent-infra/tool-description-as-policy.md +35 -0
- package/dist/agent-src/guidelines/agent-infra/tool-integration.md +73 -0
- package/dist/agent-src/guidelines/agent-infra/traceability-field-mechanics.md +50 -0
- package/dist/agent-src/guidelines/agent-infra/untrusted-input-spotlighting.md +166 -0
- package/dist/agent-src/guidelines/agent-infra/verify-before-complete-demos.md +128 -0
- package/dist/agent-src/guidelines/augment-portability-patterns.md +70 -0
- package/dist/agent-src/guidelines/code-clarity.md +350 -0
- package/dist/agent-src/guidelines/component-oriented-and-oop-development.md +189 -0
- package/dist/agent-src/guidelines/cross-role-handoff.md +127 -0
- package/dist/agent-src/guidelines/design-antipatterns-triggers.json +18 -0
- package/dist/agent-src/guidelines/design-antipatterns.md +327 -0
- package/dist/agent-src/guidelines/design-asset-discipline.md +38 -0
- package/dist/agent-src/guidelines/design-canon.md +63 -0
- package/dist/agent-src/guidelines/design-fidelity-mechanics.md +293 -0
- package/dist/agent-src/guidelines/design-fidelity-routing.md +78 -0
- package/dist/agent-src/guidelines/design-handover-extraction.md +117 -0
- package/dist/agent-src/guidelines/design-modes.md +143 -0
- package/dist/agent-src/guidelines/design-reconciliation.md +172 -0
- package/dist/agent-src/guidelines/docs/readme-size-and-splitting.md +209 -0
- package/dist/agent-src/guidelines/e2e/playwright.md +363 -0
- package/dist/agent-src/guidelines/gtm-handoff.md +114 -0
- package/dist/agent-src/guidelines/monorepo-antipatterns.md +141 -0
- package/dist/agent-src/guidelines/php/api-design.md +115 -0
- package/dist/agent-src/guidelines/php/artisan-commands.md +81 -0
- package/dist/agent-src/guidelines/php/blade-ui.md +78 -0
- package/dist/agent-src/guidelines/php/controllers.md +90 -0
- package/dist/agent-src/guidelines/php/database.md +194 -0
- package/dist/agent-src/guidelines/php/eloquent.md +208 -0
- package/dist/agent-src/guidelines/php/flux.md +80 -0
- package/dist/agent-src/guidelines/php/general.md +207 -0
- package/dist/agent-src/guidelines/php/git.md +164 -0
- package/dist/agent-src/guidelines/php/jobs.md +111 -0
- package/dist/agent-src/guidelines/php/livewire.md +71 -0
- package/dist/agent-src/guidelines/php/logging.md +79 -0
- package/dist/agent-src/guidelines/php/naming.md +89 -0
- package/dist/agent-src/guidelines/php/patterns/dependency-injection.md +57 -0
- package/dist/agent-src/guidelines/php/patterns/dtos.md +199 -0
- package/dist/agent-src/guidelines/php/patterns/events.md +67 -0
- package/dist/agent-src/guidelines/php/patterns/factory.md +53 -0
- package/dist/agent-src/guidelines/php/patterns/pipelines.md +66 -0
- package/dist/agent-src/guidelines/php/patterns/policies.md +66 -0
- package/dist/agent-src/guidelines/php/patterns/repositories.md +122 -0
- package/dist/agent-src/guidelines/php/patterns/service-layer.md +64 -0
- package/dist/agent-src/guidelines/php/patterns/strategy.md +247 -0
- package/dist/agent-src/guidelines/php/patterns.md +28 -0
- package/dist/agent-src/guidelines/php/performance.md +92 -0
- package/dist/agent-src/guidelines/php/php-coding-patterns.md +80 -0
- package/dist/agent-src/guidelines/php/resources.md +100 -0
- package/dist/agent-src/guidelines/php/security.md +110 -0
- package/dist/agent-src/guidelines/php/sql.md +97 -0
- package/dist/agent-src/guidelines/php/validations.md +119 -0
- package/dist/agent-src/guidelines/php/websocket.md +100 -0
- package/dist/agent-src/guidelines/prompt-templates.md +189 -0
- package/dist/agent-src/guidelines/redundancy-taxonomy.md +208 -0
- package/dist/agent-src/guidelines/wing4-handoff.md +127 -0
- package/dist/agent-src/personas/README.md +1 -1
- package/dist/agent-src/personas/_template-specialist/persona.md +1 -1
- package/dist/agent-src/personas/product-owner.md +1 -1
- package/dist/agent-src/rules/active-remediation.md +1 -1
- package/dist/agent-src/rules/architecture.md +2 -2
- package/dist/agent-src/rules/artifact-drafting-protocol.md +1 -1
- package/dist/agent-src/rules/ask-when-uncertain.md +2 -2
- package/dist/agent-src/rules/brand-source-of-truth.md +9 -7
- package/dist/agent-src/rules/code-comment-discipline.md +2 -2
- package/dist/agent-src/rules/code-provenance.md +1 -1
- package/dist/agent-src/rules/content-quoting-floor.md +1 -1
- package/dist/agent-src/rules/context-hygiene.md +5 -5
- package/dist/agent-src/rules/cross-source-consistency.md +1 -1
- package/dist/agent-src/rules/design-fidelity.md +36 -46
- package/dist/agent-src/rules/direct-answers.md +2 -2
- package/dist/agent-src/rules/domain-adoption-policy.md +1 -1
- package/dist/agent-src/rules/evaluator-independence.md +1 -1
- package/dist/agent-src/rules/framework-neutrality-in-generic-skills.md +1 -1
- package/dist/agent-src/rules/icon-consistency.md +5 -1
- package/dist/agent-src/rules/improve-before-implement.md +1 -1
- package/dist/agent-src/rules/language-and-tone.md +3 -3
- package/dist/agent-src/rules/minimal-safe-diff.md +1 -1
- package/dist/agent-src/rules/notes-first-reasoning.md +2 -2
- package/dist/agent-src/rules/recurring-criticism.md +1 -1
- package/dist/agent-src/rules/roadmap-progress-sync.md +1 -1
- package/dist/agent-src/rules/role-mode-adherence.md +2 -2
- package/dist/agent-src/rules/security-sensitive-stop.md +1 -1
- package/dist/agent-src/rules/size-enforcement.md +1 -1
- package/dist/agent-src/rules/source-confidentiality.md +2 -2
- package/dist/agent-src/rules/think-before-action.md +1 -1
- package/dist/agent-src/rules/token-efficiency.md +7 -5
- package/dist/agent-src/rules/ui-audit-gate.md +3 -2
- package/dist/agent-src/rules/untrusted-input-defense.md +3 -3
- package/dist/agent-src/rules/user-interaction.md +31 -30
- package/dist/agent-src/skills/activation-design/SKILL.md +2 -2
- package/dist/agent-src/skills/adr-create/SKILL.md +5 -5
- package/dist/agent-src/skills/ai-council/SKILL.md +1 -1
- package/dist/agent-src/skills/ai-council/references/advanced-modes.md +1 -1
- package/dist/agent-src/skills/blade-ui/SKILL.md +1 -1
- package/dist/agent-src/skills/blast-radius-analyzer/SKILL.md +1 -1
- package/dist/agent-src/skills/brand-to-tokens/SKILL.md +24 -3
- package/dist/agent-src/skills/bug-analyzer/SKILL.md +1 -1
- package/dist/agent-src/skills/build-buy-partner/SKILL.md +1 -1
- package/dist/agent-src/skills/churn-prevention/SKILL.md +2 -2
- package/dist/agent-src/skills/code-refactoring/SKILL.md +3 -3
- package/dist/agent-src/skills/code-review/SKILL.md +3 -3
- package/dist/agent-src/skills/command-writing/SKILL.md +3 -3
- package/dist/agent-src/skills/comp-banding/SKILL.md +1 -1
- package/dist/agent-src/skills/competitive-moat-analysis/SKILL.md +1 -1
- package/dist/agent-src/skills/competitive-positioning/SKILL.md +2 -2
- package/dist/agent-src/skills/complexity-first-planning/SKILL.md +1 -1
- package/dist/agent-src/skills/condense-memory/SKILL.md +1 -1
- package/dist/agent-src/skills/content-funnel-design/SKILL.md +2 -2
- package/dist/agent-src/skills/contracts-cognition/SKILL.md +1 -1
- package/dist/agent-src/skills/copilot-agents-optimization/SKILL.md +2 -2
- package/dist/agent-src/skills/corpus-grounding/SKILL.md +2 -2
- package/dist/agent-src/skills/customer-research/SKILL.md +2 -2
- package/dist/agent-src/skills/dashboard-design/SKILL.md +1 -1
- package/dist/agent-src/skills/data-handling-judgment/SKILL.md +1 -1
- package/dist/agent-src/skills/deal-qualification-meddic/SKILL.md +2 -2
- package/dist/agent-src/skills/decision-record/SKILL.md +3 -3
- package/dist/agent-src/skills/decision-review/SKILL.md +8 -8
- package/dist/agent-src/skills/deep-reading-analyst/SKILL.md +22 -22
- package/dist/agent-src/skills/design-intelligence/SKILL.md +4 -4
- package/dist/agent-src/skills/design-intelligence/references/context-and-registers.md +2 -2
- package/dist/agent-src/skills/design-review/SKILL.md +4 -4
- package/dist/agent-src/skills/design-system-capture/references/design-system-json.md +20 -1
- package/dist/agent-src/skills/design-tokens/SKILL.md +17 -2
- package/dist/agent-src/skills/design-variations/SKILL.md +2 -2
- package/dist/agent-src/skills/developer-like-execution/SKILL.md +2 -2
- package/dist/agent-src/skills/discovery-interview/SKILL.md +2 -2
- package/dist/agent-src/skills/doc-coauthoring/SKILL.md +3 -3
- package/dist/agent-src/skills/editorial-calendar/SKILL.md +2 -2
- package/dist/agent-src/skills/error-handling-patterns/SKILL.md +9 -0
- package/dist/agent-src/skills/existing-ui-audit/SKILL.md +44 -1
- package/dist/agent-src/skills/existing-ui-audit/references/anti-slop-cross-reference.md +2 -2
- package/dist/agent-src/skills/expansion-playbook/SKILL.md +2 -2
- package/dist/agent-src/skills/experiment-loop/SKILL.md +1 -1
- package/dist/agent-src/skills/experiment-loop/references/protocol.md +1 -1
- package/dist/agent-src/skills/fe-design/SKILL.md +3 -3
- package/dist/agent-src/skills/fe-design/references/design-patterns.md +1 -1
- package/dist/agent-src/skills/fe-design/references/design-read-and-memory.md +3 -3
- package/dist/agent-src/skills/fe-design/references/source-led-port.md +1 -1
- package/dist/agent-src/skills/feature-planning/SKILL.md +1 -1
- package/dist/agent-src/skills/flux/SKILL.md +1 -1
- package/dist/agent-src/skills/forecast-accuracy/SKILL.md +2 -2
- package/dist/agent-src/skills/forecasting/SKILL.md +2 -2
- package/dist/agent-src/skills/fundraising-narrative/SKILL.md +2 -2
- package/dist/agent-src/skills/funnel-analysis/SKILL.md +2 -2
- package/dist/agent-src/skills/gtm-launch/SKILL.md +2 -2
- package/dist/agent-src/skills/hiring-loop-design/SKILL.md +1 -1
- package/dist/agent-src/skills/html-deck/SKILL.md +5 -5
- package/dist/agent-src/skills/humanizer/SKILL.md +1 -1
- package/dist/agent-src/skills/humanizer/data/patterns.md +1 -1
- package/dist/agent-src/skills/iconography/SKILL.md +3 -3
- package/dist/agent-src/skills/judge-synthesis/SKILL.md +1 -1
- package/dist/agent-src/skills/laravel-api-endpoint/SKILL.md +2 -2
- package/dist/agent-src/skills/launch-readiness/SKILL.md +3 -3
- package/dist/agent-src/skills/learning-to-rule-or-skill/SKILL.md +6 -6
- package/dist/agent-src/skills/livewire/SKILL.md +1 -1
- package/dist/agent-src/skills/market-entry-analysis/SKILL.md +1 -1
- package/dist/agent-src/skills/mcp-builder/SKILL.md +1 -1
- package/dist/agent-src/skills/memory-consolidation/SKILL.md +3 -3
- package/dist/agent-src/skills/messaging-architecture/SKILL.md +2 -2
- package/dist/agent-src/skills/monorepo-workspace/SKILL.md +1 -1
- package/dist/agent-src/skills/onboarding-design/SKILL.md +2 -2
- package/dist/agent-src/skills/onboarding-program/SKILL.md +1 -1
- package/dist/agent-src/skills/one-on-one-cadence/SKILL.md +1 -1
- package/dist/agent-src/skills/org-design/SKILL.md +1 -1
- package/dist/agent-src/skills/overbuild-review-lens/SKILL.md +3 -3
- package/dist/agent-src/skills/override-management/SKILL.md +1 -1
- package/dist/agent-src/skills/perf-feedback-craft/SKILL.md +1 -1
- package/dist/agent-src/skills/persona-writing/SKILL.md +1 -1
- package/dist/agent-src/skills/php-coder/SKILL.md +1 -1
- package/dist/agent-src/skills/pipeline-strategy/SKILL.md +2 -2
- package/dist/agent-src/skills/playwright-testing/SKILL.md +3 -3
- package/dist/agent-src/skills/po-discovery/SKILL.md +1 -1
- package/dist/agent-src/skills/positioning-strategy/SKILL.md +2 -2
- package/dist/agent-src/skills/privacy-review/SKILL.md +1 -1
- package/dist/agent-src/skills/prompt-optimizer/SKILL.md +3 -3
- package/dist/agent-src/skills/react-shadcn-ui/SKILL.md +1 -1
- package/dist/agent-src/skills/reasoning-orchestrator/SKILL.md +2 -2
- package/dist/agent-src/skills/receiving-code-review/SKILL.md +1 -1
- package/dist/agent-src/skills/refine-ticket/SKILL.md +2 -2
- package/dist/agent-src/skills/release-comms/SKILL.md +2 -2
- package/dist/agent-src/skills/retention-loops/SKILL.md +2 -2
- package/dist/agent-src/skills/review-routing/SKILL.md +2 -2
- package/dist/agent-src/skills/roadmap-management/SKILL.md +1 -1
- package/dist/agent-src/skills/roadmap-management/references/archival.md +1 -1
- package/dist/agent-src/skills/roadmap-writing/SKILL.md +5 -5
- package/dist/agent-src/skills/rule-writing/SKILL.md +6 -6
- package/dist/agent-src/skills/runway-cognition/SKILL.md +2 -2
- package/dist/agent-src/skills/scenario-modeling/SKILL.md +2 -2
- package/dist/agent-src/skills/skill-writing/SKILL.md +2 -2
- package/dist/agent-src/skills/skill-writing/references/procedure.md +1 -1
- package/dist/agent-src/skills/skill-writing/references/section-patterns.md +3 -3
- package/dist/agent-src/skills/spreadsheet-authoring/SKILL.md +1 -1
- package/dist/agent-src/skills/stakeholder-tradeoff/SKILL.md +3 -3
- package/dist/agent-src/skills/subagent-orchestration/SKILL.md +1 -1
- package/dist/agent-src/skills/supply-chain-intake/SKILL.md +1 -1
- package/dist/agent-src/skills/systematic-debugging/SKILL.md +2 -2
- package/dist/agent-src/skills/tailwind-engineer/SKILL.md +11 -5
- package/dist/agent-src/skills/throughput-vs-morale-tradeoff/SKILL.md +1 -1
- package/dist/agent-src/skills/token-optimizer/SKILL.md +1 -1
- package/dist/agent-src/skills/typography-system/SKILL.md +2 -2
- package/dist/agent-src/skills/ui-component-architect/SKILL.md +28 -8
- package/dist/agent-src/skills/unit-economics-modeling/SKILL.md +2 -2
- package/dist/agent-src/skills/upstream-contribute/SKILL.md +1 -1
- package/dist/agent-src/skills/validate-feature-fit/SKILL.md +2 -2
- package/dist/agent-src/skills/verify-repair-loop/SKILL.md +2 -2
- package/dist/agent-src/skills/vision-articulation/SKILL.md +1 -1
- package/dist/agent-src/skills/voc-extract/SKILL.md +2 -2
- package/dist/agent-src/skills/voice-and-tone-design/SKILL.md +2 -2
- package/dist/agent-src/skills/wireframe/SKILL.md +1 -1
- package/dist/agent-src/skills/workspace-link/SKILL.md +1 -1
- package/dist/agent-src/templates/agent-settings.md +6 -6
- package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
- package/dist/agent-src/templates/contexts/knowledge-pages.md +2 -3
- package/dist/agent-src/templates/copilot-instructions.md +1 -1
- package/dist/agent-src/templates/roadmaps.md +1 -1
- package/dist/agent-src/templates/scripts/README.md +2 -2
- package/dist/agent-src/user-types/_template/user-type.md +1 -1
- package/dist/cli-delegate/check_update_banner.js +12 -1
- package/dist/cli-delegate/{chunk-NLP54U3J.js → chunk-2XY7ILBT.js} +13 -1
- package/dist/cli-delegate/{chunk-IAI3XL43.js → chunk-3FKR64R5.js} +22 -6
- package/dist/cli-delegate/{chunk-J3RFNKG4.js → chunk-55ACLDUE.js} +2 -2
- package/dist/cli-delegate/{chunk-PKOBQADP.js → chunk-57PN4GYJ.js} +1 -1
- package/dist/cli-delegate/{chunk-KCNTUSPI.js → chunk-AK6HODNQ.js} +4 -4
- package/dist/cli-delegate/{chunk-2FTMENJL.js → chunk-GYC3VRYN.js} +1 -1
- package/dist/cli-delegate/{chunk-LWTYTX6F.js → chunk-H32DGUJH.js} +15 -84
- package/dist/cli-delegate/{chunk-6RJA2F5A.js → chunk-IVBPRCQO.js} +1 -1
- package/dist/cli-delegate/chunk-NUHLI2RX.js +80 -0
- package/dist/cli-delegate/{chunk-TYSY33MD.js → chunk-QJWAUMJW.js} +12 -2
- package/dist/cli-delegate/{chunk-2KKXJW25.js → chunk-S3VFXMTM.js} +1 -1
- package/dist/cli-delegate/{chunk-I6RHFQEG.js → chunk-YUM5KURG.js} +17 -1
- package/dist/cli-delegate/cmd_analyze_session.js +1 -1
- package/dist/cli-delegate/cmd_brand_status.js +1 -1
- package/dist/cli-delegate/cmd_conformance.js +834 -275
- package/dist/cli-delegate/cmd_doctor.js +3 -3
- package/dist/cli-delegate/cmd_explain.js +5 -3
- package/dist/cli-delegate/cmd_export.js +4 -4
- package/dist/cli-delegate/cmd_handoff.js +6 -6
- package/dist/cli-delegate/cmd_mcp_available.js +1 -1
- package/dist/cli-delegate/cmd_memory_get.js +1 -1
- package/dist/cli-delegate/cmd_migrate.js +2 -2
- package/dist/cli-delegate/cmd_packs_active.js +3 -2
- package/dist/cli-delegate/cmd_prune.js +4 -4
- package/dist/cli-delegate/cmd_route_audit.js +3 -3
- package/dist/cli-delegate/cmd_route_explain.js +1 -1
- package/dist/cli-delegate/cmd_session_recycle.js +3 -3
- package/dist/cli-delegate/cmd_settings_get.js +15 -9
- package/dist/cli-delegate/cmd_settings_migrate.js +4 -4
- package/dist/cli-delegate/cmd_settings_set.js +54 -11
- package/dist/cli-delegate/cmd_sync.js +4 -4
- package/dist/cli-delegate/cmd_uninstall.js +4 -4
- package/dist/cli-delegate/cmd_update.js +1 -1
- package/dist/cli-delegate/cmd_upgrade.js +1 -1
- package/dist/cli-delegate/cmd_validate.js +4 -4
- package/dist/cli-delegate/cmd_versions.js +1 -1
- package/dist/discovery/deprecation-report.md +1 -1
- package/dist/discovery/discovery-manifest.json +25 -78
- package/dist/discovery/discovery-manifest.json.sha256 +1 -1
- package/dist/discovery/discovery-manifest.summary.md +3 -3
- package/dist/discovery/dormancy-report.md +1 -1
- package/dist/discovery/orphan-report.md +1 -1
- package/dist/discovery/packs.json +5 -7
- package/dist/discovery/trust-report.md +2 -2
- package/dist/discovery/workspaces.json +4 -6
- package/dist/hooks/dispatch.js +9684 -9304
- package/dist/install/install.mjs +36 -8
- package/dist/mcp/registry-manifest.json +3 -3
- package/dist/mcp/server.json +2 -2
- package/dist/mcp/server.mjs +2147 -1470
- package/dist/router.json +1 -1
- package/dist/scripts/_lib/agent_settings.js +73 -0
- package/dist/scripts/_lib/agent_src.js +20 -0
- package/dist/scripts/_lib/guidelines_lane.js +158 -0
- package/dist/scripts/_lib/installed_lock.js +1 -1
- package/dist/scripts/condense.js +2 -5
- package/dist/server/io/yamlIO.js +175 -17
- package/dist/server/schemas/settings.js +18 -4
- package/dist/shared/settingsSurface.js +6 -1
- package/docs/contracts/settings-classes.md +18 -9
- package/docs/guidelines/abstraction-thresholds.md +35 -0
- package/docs/guidelines/agent-infra/active-remediation-mechanics.md +3 -3
- package/docs/guidelines/agent-infra/false-green.md +2 -2
- package/docs/guidelines/agent-infra/roadmap-progress-mechanics.md +1 -1
- package/docs/guidelines/agent-infra/skill-quality-checklist.md +1 -1
- package/docs/guidelines/design-fidelity-mechanics.md +4 -0
- package/docs/guidelines/design-fidelity-routing.md +78 -0
- package/docs/guidelines/design-reconciliation.md +172 -0
- package/docs/guidelines/gtm-handoff.md +2 -2
- package/docs/guidelines/wing4-handoff.md +2 -2
- package/package.json +7 -3
- package/src/config/agent-settings.template.yml +55 -8
- package/src/config/ci-local-parity.yml +34 -0
- package/src/config/continuity-surface.json +11 -32
- package/src/config/gate-coverage.yml +31 -8
- package/src/config/gate-reachability-exemptions.json +1 -0
- package/src/config/gate-violation-baselines.json +3 -3
- package/src/config/hook-token-budget.json +1 -1
- package/src/config/host-injection-effect.json +2 -2
- package/src/config/pack-size-budget.json +55 -4
- package/src/config/platform-anchor.json +47 -0
- package/src/config/preamble-payload-budget.json +12 -8
- package/src/config/preamble-payload-exceptions.json +28 -0
- package/src/config/publish-surface.json +4 -2
- package/src/config/ratification-policy.json +7 -0
- package/src/config/rule-stub-ceilings.json +16 -9
- package/src/scripts/_cli/cmd_settings_get.ts +22 -7
- package/src/scripts/_dispatch.bash +3 -1
- package/src/scripts/_lib/agent_settings.ts +85 -0
- package/src/scripts/_lib/agent_src.ts +21 -0
- package/src/scripts/_lib/artifact_maturity.ts +242 -0
- package/src/scripts/_lib/base_ref_payload.ts +315 -0
- package/src/scripts/_lib/conformance_report.ts +403 -0
- package/src/scripts/_lib/continuity_writer.ts +72 -13
- package/src/scripts/_lib/design_system_import.ts +20 -0
- package/src/scripts/_lib/design_tolerance.ts +281 -0
- package/src/scripts/_lib/dropped_decision.ts +142 -0
- package/src/scripts/_lib/guidelines_lane.ts +164 -0
- package/src/scripts/_lib/installed_lock.ts +1 -1
- package/src/scripts/_lib/measured_payload_ceiling.ts +424 -0
- package/src/scripts/_lib/obligation_frequency.ts +2 -3
- package/src/scripts/_lib/payload_catalogue_completeness.ts +211 -0
- package/src/scripts/_lib/platform_anchor.ts +1053 -0
- package/src/scripts/_lib/ratification_artifact.ts +278 -0
- package/src/scripts/_lib/release_findings_ingest.ts +324 -0
- package/src/scripts/_lib/release_tag_dispatch.ts +63 -0
- package/src/scripts/_lib/review_baseline.ts +254 -0
- package/src/scripts/_lib/review_skipped_record.ts +61 -1
- package/src/scripts/_lib/security_lint.ts +23 -2
- package/src/scripts/_lib/self_repair.ts +21 -0
- package/src/scripts/_lib/session_index_trust.ts +42 -1
- package/src/scripts/_lib/standing_bound_ratchet.ts +267 -88
- package/src/scripts/_lib/tolerance_shadow.ts +177 -0
- package/src/scripts/_lib/turn_end_refusals.ts +51 -4
- package/src/scripts/ai_council/redact_low_impact_entry.ts +8 -0
- package/src/scripts/autonomy_friction_traffic.ts +379 -0
- package/src/scripts/check_beta_review_markers.ts +35 -4
- package/src/scripts/check_finding_dispositions.ts +167 -16
- package/src/scripts/check_held_object_arrivals.ts +381 -0
- package/src/scripts/check_kernel_edit_ratified.ts +462 -0
- package/src/scripts/check_loss_class_declared.ts +793 -46
- package/src/scripts/check_platform_anchor.ts +390 -0
- package/src/scripts/check_preamble_payload_budget.ts +672 -107
- package/src/scripts/check_projected_rule_routes.ts +395 -0
- package/src/scripts/check_release_published.ts +1 -1
- package/src/scripts/check_reply_consistency.ts +86 -17
- package/src/scripts/code_graph/cli.ts +6 -0
- package/src/scripts/condense.ts +2 -6
- package/src/scripts/generate_host_cost_table.ts +354 -0
- package/src/scripts/hook_manifest.json +1 -1
- package/src/scripts/hook_manifest.yaml +74 -30
- package/src/scripts/hooks/block_kernel_rule_writes.ts +12 -2
- package/src/scripts/hooks/category_a.ts +1 -1
- package/src/scripts/hooks/chain_nudge_hook.ts +311 -25
- package/src/scripts/hooks/concern_registry.ts +2 -0
- package/src/scripts/hooks/end_review_nudge_hook.ts +101 -21
- package/src/scripts/hooks/review_baseline_hook.ts +130 -0
- package/src/scripts/hooks/session_eol_hook.ts +68 -154
- package/src/scripts/hooks/source_first_gate_hook.ts +12 -0
- package/src/scripts/hooks/turn_end_gate_hook.ts +232 -14
- package/src/scripts/hooks/ui_route_nudge_hook.ts +52 -15
- package/src/scripts/hooks_doctor.ts +4 -1
- package/src/scripts/hot_context_hook.ts +41 -401
- package/src/scripts/install.ts +1 -1
- package/src/scripts/interruption_report.ts +8 -2
- package/src/scripts/janitor.ts +8 -1
- package/src/scripts/lint_evidence_artifacts.ts +1 -0
- package/src/scripts/lint_knowledge_scale.ts +0 -26
- package/src/scripts/measure_turn_end_gate.ts +302 -5
- package/src/scripts/memory_lookup.ts +9 -9
- package/src/scripts/release.ts +52 -64
- package/src/scripts/release_drill.ts +193 -14
- package/src/scripts/release_env.ts +1 -1
- package/src/scripts/release_publication.ts +1 -1
- package/src/scripts/report_held_object_arrivals.ts +456 -0
- package/src/scripts/report_standing_payload_by_host.ts +7 -7
- package/src/scripts/session_memory_index.ts +5 -0
- package/src/scripts/sync_agent_settings.ts +394 -12
- package/src/server/io/yamlIO.ts +175 -17
- package/src/server/schemas/settings.ts +25 -5
- package/src/shared/settingsSurface.ts +13 -2
- package/src/templates/compact-instructions.md +8 -3
- package/dist/agent-src/commands/chat-history/import.md +0 -170
- package/dist/agent-src/commands/chat-history.md +0 -63
|
@@ -3,38 +3,63 @@
|
|
|
3
3
|
*
|
|
4
4
|
* WHY THIS EXISTS
|
|
5
5
|
* ---------------
|
|
6
|
-
* `src/config/preamble-payload-budget.json`
|
|
7
|
-
* never move UP."* `grace_ceiling_history` in the same file
|
|
8
|
-
* twice — 138,212 → 138,273 on 2026-09-02 and 138,273 → 138,490 on
|
|
9
|
-
* each with a careful prose justification. ADR-264 resolved that
|
|
10
|
-
* against the practice: the sentence stands, the two raises are
|
|
11
|
-
* by contradictory wording, and standing-rule growth needs a
|
|
12
|
-
* reduction elsewhere.
|
|
6
|
+
* `src/config/preamble-payload-budget.json` said of its grace ceiling: *"It may
|
|
7
|
+
* never move UP."* `grace_ceiling_history` in the same file recorded it moving
|
|
8
|
+
* up twice — 138,212 → 138,273 on 2026-09-02 and 138,273 → 138,490 on
|
|
9
|
+
* 2026-09-08 — each with a careful prose justification. ADR-264 resolved that
|
|
10
|
+
* contradiction against the practice: the sentence stands, the two raises are
|
|
11
|
+
* violations caused by contradictory wording, and standing-rule growth needs a
|
|
12
|
+
* compensating reduction elsewhere.
|
|
13
13
|
*
|
|
14
14
|
* That decision then had no enforcement. A sentence in a JSON string is not a
|
|
15
|
-
* gate, and the file's own history
|
|
16
|
-
* This module is the enforcement
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
15
|
+
* gate, and the file's own history was the evidence: nothing objected either
|
|
16
|
+
* time. This module is the enforcement.
|
|
17
|
+
*
|
|
18
|
+
* WHAT IT BOUNDS NOW — AND WHY THE SUBJECT CHANGED
|
|
19
|
+
* -------------------------------------------------
|
|
20
|
+
* It used to bound one number, `ci_delivery.grace_ceiling`. That key is GONE
|
|
21
|
+
* (`road-to-delivery-for-every-host` 4.4): the ceiling is no longer stored, it
|
|
22
|
+
* is MEASURED at the base ref as `max(design_ceiling, base + active grants)`.
|
|
23
|
+
* A measured ceiling captures every merged reduction automatically, which a
|
|
24
|
+
* stored one never did.
|
|
25
|
+
*
|
|
26
|
+
* Moving the ceiling out of the config did not remove the need for a
|
|
27
|
+
* shrink-only bound — it moved the attack surface. Three numbers in the tree
|
|
28
|
+
* can still widen the effective ceiling without adding a single token of
|
|
29
|
+
* payload, and all three are now bounded:
|
|
30
|
+
*
|
|
31
|
+
* · `design_ceiling`, derived from `baseline_tokens` × `headroom_pct`. It is
|
|
32
|
+
* the FLOOR of the measured ceiling, so raising it raises the ceiling
|
|
33
|
+
* directly. ADR-264's sentence applies to it verbatim.
|
|
34
|
+
* · every existing exception's `granted_tokens` — enlarging a live grant is
|
|
35
|
+
* a raise wearing a break-glass label.
|
|
36
|
+
* · every existing exception's `watermark` — the watermark is what pins the
|
|
37
|
+
* base while a grant is live, so raising it launders the grant into the
|
|
38
|
+
* next base, which is precisely the failure the watermark exists to stop.
|
|
39
|
+
*
|
|
40
|
+
* A NEW exception id is deliberately NOT a violation: recording a fresh,
|
|
41
|
+
* approved, dated grant is the break-glass path working. Editing one that
|
|
42
|
+
* already existed is not.
|
|
20
43
|
*
|
|
21
44
|
* WHAT IT CANNOT DO, STATED PLAINLY
|
|
22
45
|
* ---------------------------------
|
|
23
46
|
* The change under review can edit this file. Both council seats named that as
|
|
24
|
-
* the defect fatal to
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
47
|
+
* the defect fatal to a mechanism that GRANTS budget, and it is not fatal to
|
|
48
|
+
* one that only REFUSES: disabling this check requires visibly editing it, and
|
|
49
|
+
* every gate in this repository already rests on that same review. A ratchet
|
|
50
|
+
* whose only failure mode is "someone deleted the ratchet" is strictly better
|
|
51
|
+
* than the sentence it replaces, which had no failure mode because it did
|
|
52
|
+
* nothing. The 2026-09-10 verdict added one mitigation on top and named its
|
|
53
|
+
* limit in the same breath: CI runs this code AS IT EXISTS AT THE BASE REF, so
|
|
54
|
+
* a same-PR weakening cannot measure its own change — *"the mechanism does not
|
|
55
|
+
* prevent the exploit; it makes the exploit auditable."*
|
|
33
56
|
*/
|
|
34
57
|
import { spawnSync } from 'node:child_process';
|
|
35
58
|
|
|
36
|
-
/** Repo-relative path of the budget config the
|
|
59
|
+
/** Repo-relative path of the budget config the bounds live in. */
|
|
37
60
|
export const BUDGET_CONFIG_PATH = 'src/config/preamble-payload-budget.json';
|
|
61
|
+
/** Repo-relative path of the break-glass ledger the grant bounds live in. */
|
|
62
|
+
export const EXCEPTIONS_CONFIG_PATH = 'src/config/preamble-payload-exceptions.json';
|
|
38
63
|
|
|
39
64
|
/** Injection seam: run git, capture output, never throw on a non-zero exit. */
|
|
40
65
|
export type GitRunner = (args: readonly string[], cwd: string) => {
|
|
@@ -48,15 +73,66 @@ export const realGit: GitRunner = (args, cwd) => {
|
|
|
48
73
|
return { ok: r.status === 0, stdout: r.stdout ?? '', stderr: r.stderr ?? '' };
|
|
49
74
|
};
|
|
50
75
|
|
|
76
|
+
/** Named shrink-only numbers, keyed by a stable bound id. */
|
|
77
|
+
export type BoundSet = Record<string, number>;
|
|
78
|
+
|
|
51
79
|
export interface BoundsRatchetVerdict {
|
|
52
80
|
ok: boolean;
|
|
53
81
|
violations: string[];
|
|
54
|
-
/** The
|
|
55
|
-
|
|
82
|
+
/** The bounds read at the base ref, or `null` when they could not be read. */
|
|
83
|
+
baseBounds: BoundSet | null;
|
|
56
84
|
/** The ref compared against, or `null` when none resolved. */
|
|
57
85
|
baseRef: string | null;
|
|
58
86
|
/** Why the comparison was skipped, when it was. Printed, never silent. */
|
|
59
87
|
note: string | null;
|
|
88
|
+
/**
|
|
89
|
+
* `false` means the bounds could not be READ, not that one rose.
|
|
90
|
+
*
|
|
91
|
+
* Two refusals reach a caller with `ok: false` and they need opposite
|
|
92
|
+
* actions: a risen bound is fixed by lowering the addition, an unverifiable
|
|
93
|
+
* one by repairing the checkout. A completion review caught both being
|
|
94
|
+
* rendered as "ROSE", which would send an operator to shrink a rule over
|
|
95
|
+
* what was a fetch problem.
|
|
96
|
+
*/
|
|
97
|
+
verified: boolean;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* The bound map, derived identically from head and base configs.
|
|
102
|
+
*
|
|
103
|
+
* ONE function for both sides, on purpose: two derivations of one boundary is
|
|
104
|
+
* the drift shape that let the grace ceiling rise twice under a sentence
|
|
105
|
+
* forbidding it. `budget` and `exceptions` are parsed JSON, or `null` when the
|
|
106
|
+
* file is absent — an absent exceptions ledger contributes no bounds, which is
|
|
107
|
+
* correct: there are no grants to protect.
|
|
108
|
+
*/
|
|
109
|
+
export function boundsFrom(budget: unknown, exceptions: unknown): BoundSet | null {
|
|
110
|
+
const b = (budget ?? null) as Record<string, unknown> | null;
|
|
111
|
+
if (b === null) return null;
|
|
112
|
+
const baseline = Number(b['baseline_tokens']);
|
|
113
|
+
const headroom = Number(b['headroom_pct']);
|
|
114
|
+
if (!Number.isFinite(baseline) || !Number.isFinite(headroom)) return null;
|
|
115
|
+
// `design_ceiling` is the whole config-side bound now. The retained stored
|
|
116
|
+
// allowance stage 1 kept beside it was deleted in stage 2 (ADR-276), so a
|
|
117
|
+
// tree at or below design is bounded by this number and a tree above it is
|
|
118
|
+
// bounded by its own base measurement — neither of which lives in a field
|
|
119
|
+
// anyone can edit upward.
|
|
120
|
+
const out: BoundSet = { design_ceiling: Math.round(baseline * (1 + headroom / 100)) };
|
|
121
|
+
|
|
122
|
+
const ex = (exceptions ?? null) as Record<string, unknown> | null;
|
|
123
|
+
const list = ex === null ? null : ex['exceptions'];
|
|
124
|
+
if (Array.isArray(list)) {
|
|
125
|
+
for (const item of list) {
|
|
126
|
+
const e = (item ?? {}) as Record<string, unknown>;
|
|
127
|
+
const id = e['id'];
|
|
128
|
+
if (typeof id !== 'string' || id.trim() === '') continue;
|
|
129
|
+
const granted = Number(e['granted_tokens']);
|
|
130
|
+
const watermark = Number(e['watermark']);
|
|
131
|
+
if (Number.isFinite(granted)) out[`exception:${id}:granted_tokens`] = granted;
|
|
132
|
+
if (Number.isFinite(watermark)) out[`exception:${id}:watermark`] = watermark;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return out;
|
|
60
136
|
}
|
|
61
137
|
|
|
62
138
|
function showAtRef(git: GitRunner, repoRoot: string, ref: string, relPath: string): string | null {
|
|
@@ -65,90 +141,193 @@ function showAtRef(git: GitRunner, repoRoot: string, ref: string, relPath: strin
|
|
|
65
141
|
}
|
|
66
142
|
|
|
67
143
|
/**
|
|
68
|
-
*
|
|
144
|
+
* A condition that stops the comparison: skip when advisory, refuse when not.
|
|
69
145
|
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
146
|
+
* One helper for all causes rather than an inline branch each, so the posture
|
|
147
|
+
* cannot drift between them — the failure this closes was four independent
|
|
148
|
+
* `ok: true` returns that all had to be found before any of them could be
|
|
149
|
+
* trusted.
|
|
150
|
+
*/
|
|
151
|
+
function unverified(reason: string, requireBase: boolean, baseRef: string | null): BoundsRatchetVerdict {
|
|
152
|
+
if (requireBase) {
|
|
153
|
+
return {
|
|
154
|
+
ok: false,
|
|
155
|
+
verified: false,
|
|
156
|
+
baseBounds: null,
|
|
157
|
+
baseRef,
|
|
158
|
+
note: `${reason}, so the shrink-only bounds were NOT verified in this run`,
|
|
159
|
+
violations: [
|
|
160
|
+
`the shrink-only bounds could not be verified: ${reason}. This run is `
|
|
161
|
+
+ 'ENFORCING, so an unverifiable bound refuses rather than skips — an '
|
|
162
|
+
+ 'unreadable base would otherwise grant budget on an infrastructure '
|
|
163
|
+
+ 'failure. This is NOT a bound rise: fix the checkout (a full fetch '
|
|
164
|
+
+ 'of the base ref) rather than lowering the addition.',
|
|
165
|
+
],
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
return {
|
|
169
|
+
ok: true,
|
|
170
|
+
verified: false,
|
|
171
|
+
violations: [],
|
|
172
|
+
baseBounds: null,
|
|
173
|
+
baseRef,
|
|
174
|
+
note: `${reason}, so the shrink-only bounds were NOT verified in this run`,
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Compare every shrink-only bound in this tree against the one at the base ref.
|
|
180
|
+
*
|
|
181
|
+
* TWO POSTURES, AND WHICH ONE APPLIES IS THE CALLER'S TO DECLARE.
|
|
182
|
+
*
|
|
183
|
+
* Advisory (the default): a base ref or base config that cannot be read SKIPS,
|
|
77
184
|
* reported in both the human and JSON output so it cannot pass for a check.
|
|
185
|
+
* That default is not laziness and the original reasoning still holds — a
|
|
186
|
+
* shallow clone, a first commit and a detached build all legitimately have no
|
|
187
|
+
* base, and a gate that reds on them gets switched off, which is how a
|
|
188
|
+
* repository loses the enforcement it just built.
|
|
189
|
+
*
|
|
190
|
+
* Enforcing (`requireBase: true`): the same conditions REFUSE. An AI council
|
|
191
|
+
* (2/2, 2026-09-10) made this blocking for the move to a base-measured ceiling,
|
|
192
|
+
* because the asymmetry inverts once the base ref stops being a cross-check and
|
|
193
|
+
* becomes the ceiling itself. Today an unreadable base costs a comparison;
|
|
194
|
+
* there it would grant an unbounded budget on an infrastructure failure.
|
|
195
|
+
*
|
|
196
|
+
* The flag is the caller's rather than derived from `GITHUB_ACTIONS` here: this
|
|
197
|
+
* module cannot tell an enforcing CI run from a diagnostic one on the same
|
|
198
|
+
* runner, and a gate that guesses its own strictness from an environment
|
|
199
|
+
* variable is one `env` change away from being advisory everywhere.
|
|
78
200
|
*/
|
|
79
201
|
export function assertBoundsDidNotRise(opts: {
|
|
80
202
|
repoRoot: string;
|
|
81
203
|
baseRef: string | null;
|
|
82
204
|
git?: GitRunner;
|
|
83
205
|
/**
|
|
84
|
-
*
|
|
206
|
+
* Refuse instead of skipping when the base cannot be read.
|
|
85
207
|
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
* arrive here as one value, which closes the second path without a second
|
|
89
|
-
* check.
|
|
208
|
+
* Absent is advisory, which keeps every pre-existing caller on the
|
|
209
|
+
* behaviour it was written against. The CI path sets it.
|
|
90
210
|
*/
|
|
91
|
-
|
|
211
|
+
requireBase?: boolean;
|
|
212
|
+
/**
|
|
213
|
+
* The shrink-only numbers as they stand in THIS tree.
|
|
214
|
+
*
|
|
215
|
+
* Passed in rather than re-read here so head and base go through
|
|
216
|
+
* `boundsFrom` from the caller's own configuration objects — including an
|
|
217
|
+
* effective value the caller may have taken from a flag rather than the
|
|
218
|
+
* file, which is the second path a bound could otherwise be widened by.
|
|
219
|
+
*/
|
|
220
|
+
headBounds: BoundSet;
|
|
92
221
|
}): BoundsRatchetVerdict {
|
|
93
222
|
const git = opts.git ?? realGit;
|
|
223
|
+
const requireBase = opts.requireBase === true;
|
|
94
224
|
if (opts.baseRef === null || opts.baseRef.trim() === '') {
|
|
95
|
-
return
|
|
96
|
-
ok: true,
|
|
97
|
-
violations: [],
|
|
98
|
-
baseGraceCeiling: null,
|
|
99
|
-
baseRef: null,
|
|
100
|
-
note: 'no base ref resolved, so the shrink-only bound was NOT verified in this run',
|
|
101
|
-
};
|
|
225
|
+
return unverified('no base ref resolved', requireBase, null);
|
|
102
226
|
}
|
|
103
227
|
const cfg = showAtRef(git, opts.repoRoot, opts.baseRef, BUDGET_CONFIG_PATH);
|
|
104
228
|
if (cfg === null) {
|
|
105
|
-
return {
|
|
106
|
-
ok: true,
|
|
107
|
-
violations: [],
|
|
108
|
-
baseGraceCeiling: null,
|
|
109
|
-
baseRef: opts.baseRef,
|
|
110
|
-
note: `${BUDGET_CONFIG_PATH} could not be read at ${opts.baseRef}, so the shrink-only bound was NOT verified`,
|
|
111
|
-
};
|
|
229
|
+
return unverified(`${BUDGET_CONFIG_PATH} could not be read at ${opts.baseRef}`, requireBase, opts.baseRef);
|
|
112
230
|
}
|
|
113
|
-
let
|
|
231
|
+
let baseBudget: unknown;
|
|
114
232
|
try {
|
|
115
|
-
|
|
116
|
-
const delivery = (parsed['ci_delivery'] ?? {}) as Record<string, unknown>;
|
|
117
|
-
const n = Number(delivery['grace_ceiling']);
|
|
118
|
-
baseGrace = Number.isFinite(n) ? n : null;
|
|
233
|
+
baseBudget = JSON.parse(cfg);
|
|
119
234
|
} catch {
|
|
120
|
-
return {
|
|
121
|
-
ok: true,
|
|
122
|
-
violations: [],
|
|
123
|
-
baseGraceCeiling: null,
|
|
124
|
-
baseRef: opts.baseRef,
|
|
125
|
-
note: `${BUDGET_CONFIG_PATH} at ${opts.baseRef} is not parseable, so the shrink-only bound was NOT verified`,
|
|
126
|
-
};
|
|
235
|
+
return unverified(`${BUDGET_CONFIG_PATH} at ${opts.baseRef} is not parseable`, requireBase, opts.baseRef);
|
|
127
236
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
237
|
+
// An absent exceptions ledger at the base ref is normal — it did not exist
|
|
238
|
+
// before this mechanism landed, and a ref predating it has no grants to
|
|
239
|
+
// protect. An unparseable one is not, and refuses like a bad budget.
|
|
240
|
+
const exRaw = showAtRef(git, opts.repoRoot, opts.baseRef, EXCEPTIONS_CONFIG_PATH);
|
|
241
|
+
let baseExceptions: unknown = null;
|
|
242
|
+
if (exRaw !== null) {
|
|
243
|
+
try {
|
|
244
|
+
baseExceptions = JSON.parse(exRaw);
|
|
245
|
+
} catch {
|
|
246
|
+
return unverified(
|
|
247
|
+
`${EXCEPTIONS_CONFIG_PATH} at ${opts.baseRef} is not parseable`,
|
|
248
|
+
requireBase,
|
|
249
|
+
opts.baseRef,
|
|
250
|
+
);
|
|
251
|
+
}
|
|
136
252
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
253
|
+
|
|
254
|
+
const baseBounds = boundsFrom(baseBudget, baseExceptions);
|
|
255
|
+
if (baseBounds === null) {
|
|
256
|
+
return unverified(
|
|
257
|
+
`there are no shrink-only bounds at ${opts.baseRef} to ratchet against`,
|
|
258
|
+
requireBase,
|
|
259
|
+
opts.baseRef,
|
|
260
|
+
);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
const violations: string[] = [];
|
|
264
|
+
for (const [name, head] of Object.entries(opts.headBounds)) {
|
|
265
|
+
const base = baseBounds[name];
|
|
266
|
+
// A bound absent at the base is a NEW one — a freshly recorded grant,
|
|
267
|
+
// which is the break-glass path working rather than a rise.
|
|
268
|
+
if (base === undefined) continue;
|
|
269
|
+
if (head > base) violations.push(explain(name, base, head, opts.baseRef));
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
// DELETION CANNOT DISCHARGE DEBT. A grant that existed at the base and is
|
|
273
|
+
// gone at head was not repaid, it was erased — the 2026-09-11 council's
|
|
274
|
+
// blocking finding #3, and the one failure a shrink-only comparison misses
|
|
275
|
+
// by construction, because a removed number is not a smaller number.
|
|
276
|
+
// Only `exception:` bounds are checked for deletion: `design_ceiling` is
|
|
277
|
+
// always present, and the stored allowance that used to need an exemption
|
|
278
|
+
// here no longer exists.
|
|
279
|
+
const reportedDeletions = new Set<string>();
|
|
280
|
+
for (const name of Object.keys(baseBounds)) {
|
|
281
|
+
if (!name.startsWith('exception:')) continue;
|
|
282
|
+
if (opts.headBounds[name] !== undefined) continue;
|
|
283
|
+
const m = /^exception:(.+):(?:granted_tokens|watermark)$/.exec(name);
|
|
284
|
+
const id = m === null ? name : String(m[1]);
|
|
285
|
+
// One record carries two bounds; report the record once.
|
|
286
|
+
if (reportedDeletions.has(id)) continue;
|
|
287
|
+
reportedDeletions.add(id);
|
|
288
|
+
violations.push(
|
|
289
|
+
`standing-payload exception '${id}' existed at ${opts.baseRef} and is gone at head. A deleted ` +
|
|
290
|
+
'record is not a repaid one: repayment is established by the payload returning to the ' +
|
|
291
|
+
'watermark, and erasing the entry erases the debt along with the evidence of it. Mark it ' +
|
|
292
|
+
'repaid once the measurement supports that, or leave it in place.',
|
|
293
|
+
);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
if (violations.length > 0) {
|
|
297
|
+
return { ok: false, verified: true, baseBounds, baseRef: opts.baseRef, note: null, violations };
|
|
298
|
+
}
|
|
299
|
+
return { ok: true, verified: true, violations: [], baseBounds, baseRef: opts.baseRef, note: null };
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/** One refusal message per bound kind — a generic "a bound rose" sends the
|
|
303
|
+
* reader nowhere, and the three kinds have three different fixes. */
|
|
304
|
+
function explain(name: string, base: number, head: number, baseRef: string): string {
|
|
305
|
+
const rose = `rose from ${String(base)} to ${String(head)} against ${baseRef}`;
|
|
306
|
+
if (name === 'design_ceiling') {
|
|
307
|
+
return (
|
|
308
|
+
`the standing-payload design ceiling ${rose}. It derives from baseline_tokens × ` +
|
|
309
|
+
`headroom_pct in ${BUDGET_CONFIG_PATH}, and it is the FLOOR of the measured ceiling, so ` +
|
|
310
|
+
'raising it widens every future budget without adding a token of payload. ADR-264 decided ' +
|
|
311
|
+
'that standing-rule growth needs a compensating reduction elsewhere, not a bigger ceiling. ' +
|
|
312
|
+
'Lower the addition, migrate the prose out of the standing rule, or reduce another standing ' +
|
|
313
|
+
'asset by the same amount.'
|
|
314
|
+
);
|
|
315
|
+
}
|
|
316
|
+
const m = /^exception:(.+):(granted_tokens|watermark)$/.exec(name);
|
|
317
|
+
if (m !== null && m[2] === 'granted_tokens') {
|
|
318
|
+
return (
|
|
319
|
+
`standing-payload exception '${String(m[1])}' had its grant ${rose}. Enlarging a grant that ` +
|
|
320
|
+
'already exists is a ceiling raise wearing a break-glass label. Record a NEW approved, dated ' +
|
|
321
|
+
'exception instead, so the enlargement carries its own approver, reason and expiry.'
|
|
322
|
+
);
|
|
323
|
+
}
|
|
324
|
+
if (m !== null) {
|
|
325
|
+
return (
|
|
326
|
+
`standing-payload exception '${String(m[1])}' had its watermark ${rose}. The watermark pins the ` +
|
|
327
|
+
'base while the grant is live, and raising it launders the granted tokens into the next base — ' +
|
|
328
|
+
'which is exactly the failure the watermark exists to prevent. It is the payload measured ' +
|
|
329
|
+
'BEFORE the grant and does not change afterwards.'
|
|
330
|
+
);
|
|
152
331
|
}
|
|
153
|
-
return
|
|
332
|
+
return `the shrink-only bound '${name}' ${rose}, and ${BUDGET_CONFIG_PATH} says it may not move upward.`;
|
|
154
333
|
}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shadow records for the value-reconciliation tolerance — the window whose
|
|
3
|
+
* distribution a threshold may later be read off.
|
|
4
|
+
*
|
|
5
|
+
* NO NEW CONCERN. `check_estate_count` reports zero growth allowance on hook
|
|
6
|
+
* concerns, and the roadmap step says so in as many words: extend the existing
|
|
7
|
+
* shadow gate. These records therefore ride `source_first_gate_hook.ts`'s
|
|
8
|
+
* `SHADOW_LOG` — the same JSONL file, the same gitignored local-only path — and
|
|
9
|
+
* are told apart by their own `record` discriminator. Nothing new is registered,
|
|
10
|
+
* nothing new fires, and the concern count is unmoved.
|
|
11
|
+
*
|
|
12
|
+
* NO SELF-REPORTED VERDICT, which is the property the step's verify clause
|
|
13
|
+
* names and the one most easily lost. A record says what the distance WAS and
|
|
14
|
+
* what each candidate threshold WOULD have done with it. It never says whether
|
|
15
|
+
* that was right. A field like `was_correct` would be the mechanism grading its
|
|
16
|
+
* own homework, and a distribution of self-assessments measures the assessor —
|
|
17
|
+
* the same reason `source_first_gate_hook` records `would_warn` per candidate
|
|
18
|
+
* instead of one `warn`.
|
|
19
|
+
*
|
|
20
|
+
* COUNTERFACTUAL, NOT CHOSEN. `CANDIDATE_COLOR_THRESHOLDS` and
|
|
21
|
+
* `CANDIDATE_LENGTH_THRESHOLDS` are evaluation points, not defaults: every
|
|
22
|
+
* record carries the outcome at each, so the window yields a curve rather than
|
|
23
|
+
* a yes/no. That is the council's own instruction — evaluate several candidate
|
|
24
|
+
* thresholds counterfactually, never select one as behaviour — and it is why a
|
|
25
|
+
* spread exists at all. `SHIPPED_TOLERANCE` stays `null` on both axes
|
|
26
|
+
* throughout the window.
|
|
27
|
+
*
|
|
28
|
+
* PRIVACY BY CONSTRUCTION. The record type carries a kind, a metric, numbers,
|
|
29
|
+
* a token NAME, and booleans. It has no field able to hold a file path, a
|
|
30
|
+
* prompt, a selector, or any document content — the same stance
|
|
31
|
+
* `source_first_gate_hook.ts` states for its own record. A token name is a
|
|
32
|
+
* project's own vocabulary and is the one string here; it is what makes a
|
|
33
|
+
* distribution readable per token rather than only in aggregate.
|
|
34
|
+
*/
|
|
35
|
+
import { appendShadowLine } from '../hooks/source_first_gate_hook.js';
|
|
36
|
+
|
|
37
|
+
import type {
|
|
38
|
+
COLOR_DISTANCE_METRIC,
|
|
39
|
+
LENGTH_DISTANCE_METRIC,
|
|
40
|
+
ValueKind,
|
|
41
|
+
ValueRow,
|
|
42
|
+
} from './design_tolerance.js';
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Colour ΔEOK evaluation points. Spread deliberately across two orders of
|
|
46
|
+
* magnitude: the window has to show where the curve bends, and a spread
|
|
47
|
+
* clustered around a guess would only confirm the guess.
|
|
48
|
+
*/
|
|
49
|
+
export const CANDIDATE_COLOR_THRESHOLDS: readonly number[] = [0.001, 0.005, 0.01, 0.02, 0.05];
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Length evaluation points, in CSS pixels. `1` is here because it is the one
|
|
53
|
+
* externally observed candidate in the evidence set (Primer's spacing plugin),
|
|
54
|
+
* and it is one point on a curve rather than a preferred value.
|
|
55
|
+
*/
|
|
56
|
+
export const CANDIDATE_LENGTH_THRESHOLDS: readonly number[] = [0.5, 1, 2, 4];
|
|
57
|
+
|
|
58
|
+
/** Discriminator on the shared shadow log. */
|
|
59
|
+
export const TOLERANCE_SHADOW_RECORD = 'tolerance_shadow' as const;
|
|
60
|
+
|
|
61
|
+
export interface CounterfactualOutcome {
|
|
62
|
+
threshold: number;
|
|
63
|
+
/** Would this value have been reconciled onto the token at that threshold? */
|
|
64
|
+
would_reconcile: boolean;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface ToleranceShadowRecord {
|
|
68
|
+
record: typeof TOLERANCE_SHADOW_RECORD;
|
|
69
|
+
kind: ValueKind;
|
|
70
|
+
metric: typeof COLOR_DISTANCE_METRIC | typeof LENGTH_DISTANCE_METRIC;
|
|
71
|
+
/** Distance to the nearest project token, in `metric`. */
|
|
72
|
+
distance: number;
|
|
73
|
+
/** The token's own name. No value, no path, no content. */
|
|
74
|
+
nearest_token: string;
|
|
75
|
+
/** What the mechanism actually did — `false` throughout the shadow window. */
|
|
76
|
+
acted: boolean;
|
|
77
|
+
counterfactual: CounterfactualOutcome[];
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function candidatesFor(kind: ValueKind): readonly number[] {
|
|
81
|
+
return kind === 'color' ? CANDIDATE_COLOR_THRESHOLDS : CANDIDATE_LENGTH_THRESHOLDS;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Build a record from a reconciled value row, or `null` when the row carries
|
|
86
|
+
* nothing to measure.
|
|
87
|
+
*
|
|
88
|
+
* A row with no candidate token is deliberately NOT recorded as a distance of
|
|
89
|
+
* zero or of infinity: it is the absence of a measurement, and a window that
|
|
90
|
+
* silently folded those in would report a distribution over a population that
|
|
91
|
+
* includes non-observations.
|
|
92
|
+
*/
|
|
93
|
+
export function toleranceShadowRecord(
|
|
94
|
+
kind: ValueKind,
|
|
95
|
+
row: ValueRow,
|
|
96
|
+
): ToleranceShadowRecord | null {
|
|
97
|
+
if (row.nearest === null || row.distance === null || row.metric === null) return null;
|
|
98
|
+
const distance = row.distance;
|
|
99
|
+
return {
|
|
100
|
+
record: TOLERANCE_SHADOW_RECORD,
|
|
101
|
+
kind,
|
|
102
|
+
metric: row.metric,
|
|
103
|
+
distance,
|
|
104
|
+
nearest_token: row.nearest.name,
|
|
105
|
+
acted: row.outcome === 'reconciled',
|
|
106
|
+
counterfactual: candidatesFor(kind).map((threshold) => ({
|
|
107
|
+
threshold,
|
|
108
|
+
would_reconcile: distance <= threshold,
|
|
109
|
+
})),
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Append the records for one reconciliation pass to the shared shadow log.
|
|
115
|
+
*
|
|
116
|
+
* THE WINDOW IS ONLY OPEN IF SOMETHING WRITES TO IT. A blind review of the
|
|
117
|
+
* branch that shipped this module found the header above claiming records ride
|
|
118
|
+
* `SHADOW_LOG` while the module had no writer and no caller — so
|
|
119
|
+
* `FLIP_CRITERION`'s reverse trigger ("fewer than 20 records in 8 weeks")
|
|
120
|
+
* was satisfied by construction, which is a criterion that measures nothing.
|
|
121
|
+
* The writer is `appendShadowLine`, reused rather than reimplemented: it is
|
|
122
|
+
* already replay-aware and already fail-open, and a second writer to one log is
|
|
123
|
+
* two chances to disagree about the format.
|
|
124
|
+
*
|
|
125
|
+
* Returns the number of records written — rows with nothing to measure are
|
|
126
|
+
* skipped, so this is not `rows.length`.
|
|
127
|
+
*/
|
|
128
|
+
export function recordToleranceShadow(
|
|
129
|
+
root: string,
|
|
130
|
+
rows: ReadonlyArray<{ kind: ValueKind; row: ValueRow }>,
|
|
131
|
+
): number {
|
|
132
|
+
let written = 0;
|
|
133
|
+
for (const { kind, row } of rows) {
|
|
134
|
+
const record = toleranceShadowRecord(kind, row);
|
|
135
|
+
if (record === null) continue;
|
|
136
|
+
appendShadowLine(root, record as unknown as Record<string, unknown>);
|
|
137
|
+
written += 1;
|
|
138
|
+
}
|
|
139
|
+
return written;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Pre-registered flip criterion, written BEFORE the window opens — which is the
|
|
144
|
+
* third clause of the step's verify and the one a later reader cannot
|
|
145
|
+
* reconstruct. Prose rather than code on purpose: nothing evaluates it
|
|
146
|
+
* automatically, and a function that returned `true` here would be the
|
|
147
|
+
* mechanism authorising its own promotion.
|
|
148
|
+
*/
|
|
149
|
+
export const FLIP_CRITERION = `
|
|
150
|
+
Shadow -> a shipped tolerance, when ALL of:
|
|
151
|
+
|
|
152
|
+
a. >= 200 tolerance_shadow records, or >= 4 weeks of window, whichever comes
|
|
153
|
+
first, with at least 50 records on EACH axis. Colour and length are
|
|
154
|
+
separate distributions and a threshold read off a pooled one is read off
|
|
155
|
+
the wrong population.
|
|
156
|
+
b. The chosen candidate's counterfactual FALSE-RECONCILIATION share -- rows a
|
|
157
|
+
human reviewer marks as "should have been preserved" that the candidate
|
|
158
|
+
would have reconciled -- is at or below 1 %, estimated per axis. The
|
|
159
|
+
reviewer labels are collected OUTSIDE this record type on purpose: a
|
|
160
|
+
record that carried its own correctness label would be the self-report
|
|
161
|
+
this module refuses.
|
|
162
|
+
c. The MISSED-reconciliation share is reported alongside it and is not
|
|
163
|
+
optimised away. A threshold of zero trivially satisfies (b) and is useless;
|
|
164
|
+
both error directions are stated or the criterion is not met.
|
|
165
|
+
d. The distribution is not obviously bimodal. A bimodal curve means the
|
|
166
|
+
tolerance model itself is wrong -- two populations are being measured as
|
|
167
|
+
one -- and the response is to re-cut the model, never to pick a threshold
|
|
168
|
+
between the modes.
|
|
169
|
+
|
|
170
|
+
Reverse trigger: fewer than 20 records in 8 weeks -> evaluate removing the
|
|
171
|
+
mechanism. A reconciliation nobody exercises is prose with a config key.
|
|
172
|
+
|
|
173
|
+
Never lifted by this criterion: enabling the mechanism BY DEFAULT is a
|
|
174
|
+
consumer-facing default flip and stays owner-reserved, recorded in
|
|
175
|
+
agents/roadmaps/stubs/road-to-frontend-power-default-flip.md. Meeting a to d
|
|
176
|
+
authorises a shipped tolerance VALUE, not a shipped default.
|
|
177
|
+
`.trim();
|