@event4u/agent-config 1.20.0 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agent-src/commands/agents.md +1 -1
- package/.agent-src/commands/bug-fix.md +1 -1
- package/.agent-src/commands/bug-investigate.md +2 -2
- package/.agent-src/commands/chat-history/import.md +60 -64
- package/.agent-src/commands/compress.md +12 -0
- package/.agent-src/commands/context/create.md +2 -2
- package/.agent-src/commands/context.md +1 -1
- package/.agent-src/commands/copilot-agents.md +1 -1
- package/.agent-src/commands/council/default.md +17 -5
- package/.agent-src/commands/council.md +1 -1
- package/.agent-src/commands/e2e-heal.md +1 -1
- package/.agent-src/commands/e2e-plan.md +1 -1
- package/.agent-src/commands/feature/dev.md +3 -3
- package/.agent-src/commands/feature.md +1 -1
- package/.agent-src/commands/fix/seeder.md +2 -2
- package/.agent-src/commands/fix.md +1 -1
- package/.agent-src/commands/jira-ticket.md +1 -1
- package/.agent-src/commands/judge.md +2 -2
- package/.agent-src/commands/memory.md +1 -1
- package/.agent-src/commands/mode.md +5 -5
- package/.agent-src/commands/module.md +1 -1
- package/.agent-src/commands/onboard.md +4 -4
- package/.agent-src/commands/optimize/augmentignore.md +1 -1
- package/.agent-src/commands/optimize-prompt.md +61 -0
- package/.agent-src/commands/optimize.md +1 -1
- package/.agent-src/commands/override.md +1 -1
- package/.agent-src/commands/review-changes.md +1 -1
- package/.agent-src/commands/review-routing.md +1 -1
- package/.agent-src/commands/roadmap.md +1 -1
- package/.agent-src/commands/set-cost-profile.md +3 -3
- package/.agent-src/commands/sync-agent-settings.md +2 -2
- package/.agent-src/commands/tests/create.md +2 -2
- package/.agent-src/commands/tests.md +1 -1
- package/.agent-src/commands/threat-model.md +4 -4
- package/.agent-src/contexts/authority/commit-mechanics.md +14 -1
- package/.agent-src/contexts/authority/destructive-mechanics.md +14 -1
- package/.agent-src/contexts/authority/scope-mechanics.md +5 -0
- package/.agent-src/contexts/communication/rules-auto/guidelines-mechanics.md +76 -0
- package/.agent-src/contexts/communication/rules-auto/slash-command-routing-policy-mechanics.md +1 -1
- package/.agent-src/contexts/communication/rules-auto/think-before-action-mechanics.md +98 -0
- package/.agent-src/contexts/communication/rules-auto/token-efficiency-mechanics.md +93 -0
- package/.agent-src/contexts/communication/rules-auto/user-interaction-mechanics.md +128 -5
- package/.agent-src/contexts/execution/autonomy-mechanics.md +44 -0
- package/.agent-src/contexts/model-recommendations.md +2 -2
- package/.agent-src/contexts/override-system.md +1 -1
- package/.agent-src/personas/product-owner.md +2 -2
- package/.agent-src/personas/qa.md +1 -1
- package/.agent-src/rules/agent-authority.md +5 -6
- package/.agent-src/rules/agent-docs.md +11 -53
- package/.agent-src/rules/analysis-skill-routing.md +10 -40
- package/.agent-src/rules/architecture.md +6 -1
- package/.agent-src/rules/artifact-drafting-protocol.md +5 -0
- package/.agent-src/rules/artifact-engagement-recording.md +23 -59
- package/.agent-src/rules/ask-when-uncertain.md +24 -47
- package/.agent-src/rules/augment-portability.md +14 -62
- package/.agent-src/rules/augment-source-of-truth.md +10 -1
- package/.agent-src/rules/autonomous-execution.md +17 -98
- package/.agent-src/rules/capture-learnings.md +9 -80
- package/.agent-src/rules/cli-output-handling.md +12 -42
- package/.agent-src/rules/command-suggestion-policy.md +25 -73
- package/.agent-src/rules/commit-conventions.md +9 -58
- package/.agent-src/rules/commit-policy.md +16 -47
- package/.agent-src/rules/context-hygiene.md +5 -0
- package/.agent-src/rules/direct-answers.md +21 -50
- package/.agent-src/rules/docker-commands.md +11 -45
- package/.agent-src/rules/docs-sync.md +10 -56
- package/.agent-src/rules/downstream-changes.md +5 -0
- package/.agent-src/rules/e2e-testing.md +9 -44
- package/.agent-src/rules/guidelines.md +13 -75
- package/.agent-src/rules/improve-before-implement.md +10 -2
- package/.agent-src/rules/language-and-tone.md +41 -106
- package/.agent-src/rules/laravel-translations.md +11 -40
- package/.agent-src/rules/markdown-safe-codeblocks.md +4 -0
- package/.agent-src/rules/minimal-safe-diff.md +4 -0
- package/.agent-src/rules/missing-tool-handling.md +4 -0
- package/.agent-src/rules/model-recommendation.md +9 -61
- package/.agent-src/rules/no-attribution-footers.md +5 -0
- package/.agent-src/rules/no-cheap-questions.md +11 -27
- package/.agent-src/rules/no-council-references.md +76 -0
- package/.agent-src/rules/no-roadmap-references.md +7 -0
- package/.agent-src/rules/non-destructive-by-default.md +13 -43
- package/.agent-src/rules/onboarding-gate.md +9 -117
- package/.agent-src/rules/package-ci-checks.md +10 -37
- package/.agent-src/rules/php-coding.md +10 -55
- package/.agent-src/rules/preservation-guard.md +9 -0
- package/.agent-src/rules/review-routing-awareness.md +9 -97
- package/.agent-src/rules/reviewer-awareness.md +8 -83
- package/.agent-src/rules/roadmap-progress-sync.md +7 -170
- package/.agent-src/rules/role-mode-adherence.md +6 -2
- package/.agent-src/rules/rule-type-governance.md +8 -66
- package/.agent-src/rules/runtime-safety.md +5 -0
- package/.agent-src/rules/scope-control.md +17 -62
- package/.agent-src/rules/security-sensitive-stop.md +7 -1
- package/.agent-src/rules/size-enforcement.md +6 -1
- package/.agent-src/rules/skill-improvement-trigger.md +9 -49
- package/.agent-src/rules/skill-quality.md +7 -113
- package/.agent-src/rules/slash-command-routing-policy.md +11 -63
- package/.agent-src/rules/think-before-action.md +22 -87
- package/.agent-src/rules/token-efficiency.md +10 -74
- package/.agent-src/rules/token-optimizer-maintenance.md +68 -0
- package/.agent-src/rules/tool-safety.md +4 -0
- package/.agent-src/rules/ui-audit-gate.md +25 -61
- package/.agent-src/rules/upstream-proposal.md +9 -67
- package/.agent-src/rules/user-interaction.md +22 -108
- package/.agent-src/rules/verify-before-complete.md +1 -1
- package/.agent-src/skills/agent-docs-writing/SKILL.md +1 -1
- package/.agent-src/skills/ai-council/SKILL.md +65 -0
- package/.agent-src/skills/analysis-autonomous-mode/SKILL.md +1 -1
- package/.agent-src/skills/analysis-skill-router/SKILL.md +3 -3
- package/.agent-src/skills/artisan-commands/SKILL.md +2 -2
- package/.agent-src/skills/authz-review/SKILL.md +1 -1
- package/.agent-src/skills/aws-infrastructure/SKILL.md +5 -5
- package/.agent-src/skills/blast-radius-analyzer/SKILL.md +8 -8
- package/.agent-src/skills/bug-analyzer/SKILL.md +5 -5
- package/.agent-src/skills/code-refactoring/SKILL.md +4 -4
- package/.agent-src/skills/code-review/SKILL.md +2 -2
- package/.agent-src/skills/command-writing/SKILL.md +11 -0
- package/.agent-src/skills/composer-packages/SKILL.md +2 -2
- package/.agent-src/skills/context-authoring/SKILL.md +11 -0
- package/.agent-src/skills/context-document/SKILL.md +1 -1
- package/.agent-src/skills/copilot-agents-optimization/SKILL.md +23 -0
- package/.agent-src/skills/copilot-config/SKILL.md +1 -1
- package/.agent-src/skills/dependency-upgrade/SKILL.md +2 -2
- package/.agent-src/skills/devcontainer/SKILL.md +2 -2
- package/.agent-src/skills/developer-like-execution/SKILL.md +1 -1
- package/.agent-src/skills/docker/SKILL.md +1 -1
- package/.agent-src/skills/dto-creator/SKILL.md +1 -1
- package/.agent-src/skills/estimate-ticket/SKILL.md +2 -2
- package/.agent-src/skills/fe-design/SKILL.md +4 -4
- package/.agent-src/skills/feature-planning/SKILL.md +5 -5
- package/.agent-src/skills/funnel-analysis/SKILL.md +1 -1
- package/.agent-src/skills/laravel/SKILL.md +1 -1
- package/.agent-src/skills/laravel-notifications/SKILL.md +5 -5
- package/.agent-src/skills/laravel-pennant/SKILL.md +1 -1
- package/.agent-src/skills/laravel-pulse/SKILL.md +4 -4
- package/.agent-src/skills/laravel-reverb/SKILL.md +2 -2
- package/.agent-src/skills/laravel-scheduling/SKILL.md +1 -1
- package/.agent-src/skills/migration-creator/SKILL.md +7 -7
- package/.agent-src/skills/multi-tenancy/SKILL.md +8 -8
- package/.agent-src/skills/performance-analysis/SKILL.md +3 -3
- package/.agent-src/skills/pest-testing/SKILL.md +6 -6
- package/.agent-src/skills/php-service/SKILL.md +2 -2
- package/.agent-src/skills/project-analysis-hypothesis-driven/SKILL.md +3 -3
- package/.agent-src/skills/project-analysis-react/SKILL.md +1 -1
- package/.agent-src/skills/project-analysis-symfony/SKILL.md +1 -1
- package/.agent-src/skills/project-analysis-zend-laminas/SKILL.md +2 -2
- package/.agent-src/skills/project-analyzer/SKILL.md +4 -4
- package/.agent-src/skills/prompt-optimizer/SKILL.md +108 -0
- package/.agent-src/skills/readme-reviewer/SKILL.md +1 -1
- package/.agent-src/skills/rule-writing/SKILL.md +33 -0
- package/.agent-src/skills/sentry-integration/SKILL.md +1 -1
- package/.agent-src/skills/skill-writing/SKILL.md +14 -0
- package/.agent-src/skills/terraform/SKILL.md +2 -2
- package/.agent-src/skills/terragrunt/SKILL.md +8 -8
- package/.agent-src/skills/test-performance/SKILL.md +5 -5
- package/.agent-src/skills/threat-modeling/SKILL.md +2 -2
- package/.agent-src/skills/token-optimizer/SKILL.md +110 -0
- package/.agent-src/skills/universal-project-analysis/SKILL.md +1 -1
- package/.agent-src/templates/AGENTS.md +1 -1
- package/.agent-src/templates/agent-settings.md +21 -16
- package/.agent-src/templates/contexts/tenant-boundaries.md +2 -2
- package/.agent-src/templates/contexts.md +1 -1
- package/.agent-src/templates/copilot-instructions.md +21 -0
- package/.agent-src/templates/copilot-review-instructions.md +76 -0
- package/.agent-src/templates/features.md +1 -1
- package/.agent-src/templates/rule.md +127 -0
- package/.claude-plugin/marketplace.json +4 -1
- package/AGENTS.md +32 -5
- package/CHANGELOG.md +69 -3
- package/README.md +22 -21
- package/config/agent-settings.template.yml +44 -10
- package/config/gitignore-block.txt +7 -0
- package/docs/architecture.md +86 -5
- package/docs/catalog.md +16 -6
- package/docs/contracts/agent-memory-contract.md +1 -1
- package/docs/contracts/context-paths.md +2 -1
- package/docs/contracts/file-ownership-matrix.json +354 -500
- package/docs/contracts/iron-law-overrides.txt +25 -0
- package/docs/contracts/kernel-membership.md +273 -0
- package/docs/contracts/load-context-schema.md +26 -11
- package/docs/contracts/pilot/agent-authority.md +24 -0
- package/docs/contracts/pilot/direct-answers.md +70 -0
- package/docs/contracts/pilot/language-and-tone.md +63 -0
- package/docs/contracts/rule-classification.md +170 -0
- package/docs/contracts/rule-router.md +153 -0
- package/docs/customization.md +17 -6
- package/docs/decisions/ADR-001-kernel-swap-deferred.md +109 -0
- package/docs/decisions/ADR-002-kernel-bucket-overrides.md +124 -0
- package/docs/decisions/ADR-rule-kernel-and-router.md +122 -0
- package/docs/getting-started.md +2 -2
- package/docs/guidelines/agent-infra/roadmap-progress-mechanics.md +176 -0
- package/docs/guidelines/agent-infra/rule-type-governance.md +73 -0
- package/docs/guidelines/agent-infra/size-and-scope.md +13 -2
- package/docs/guidelines/agent-infra/skill-quality-checklist.md +119 -0
- package/docs/guidelines/augment-portability-patterns.md +68 -0
- package/docs/guidelines/php/php-coding-patterns.md +62 -0
- package/package.json +1 -1
- package/scripts/_p43_bodies.py +235 -0
- package/scripts/_p43_compress.py +118 -0
- package/scripts/_p4_migrate.py +199 -0
- package/scripts/_pilot_council_question.py +57 -0
- package/scripts/_pilot_measure.py +53 -0
- package/scripts/ai_council/session.py +107 -5
- package/scripts/build_linear_digest.py +3 -5
- package/scripts/check_always_budget.py +39 -6
- package/scripts/check_compressed_paths.py +213 -0
- package/scripts/check_compression.py +15 -0
- package/scripts/check_context_paths.py +1 -0
- package/scripts/check_council_layout.py +105 -0
- package/scripts/check_council_references.py +145 -0
- package/scripts/check_portability.py +2 -0
- package/scripts/check_references.py +2 -0
- package/scripts/check_token_optimizer_freshness.py +131 -0
- package/scripts/compile_router.py +148 -0
- package/scripts/compress.py +219 -11
- package/scripts/council_cli.py +9 -5
- package/scripts/council_prune.py +81 -0
- package/scripts/count_token_optimizer_usage.sh +54 -0
- package/scripts/install.sh +44 -2
- package/scripts/iron_law_sha.py +98 -0
- package/scripts/lint_load_context.py +35 -5
- package/scripts/measure_rule_budget.py +314 -0
- package/scripts/prototype_lint_contradictions.py +150 -0
- package/scripts/schemas/rule.schema.json +55 -6
- package/scripts/skill_linter.py +196 -6
- package/scripts/smoke_path_resolution.py +93 -0
- package/scripts/validate_frontmatter.py +41 -1
- package/.agent-src/contexts/communication/rules-auto/artifact-engagement-recording-mechanics.md +0 -72
- package/.agent-src/contexts/communication/rules-auto/augment-portability-mechanics.md +0 -79
- package/.agent-src/contexts/communication/rules-auto/cli-output-handling-mechanics.md +0 -87
- package/.agent-src/contexts/communication/rules-auto/command-suggestion-policy-mechanics.md +0 -62
- package/.agent-src/contexts/communication/rules-auto/docs-sync-mechanics.md +0 -78
- package/.agent-src/contexts/communication/rules-auto/package-ci-checks-mechanics.md +0 -85
- package/.agent-src/contexts/communication/rules-auto/review-routing-awareness-mechanics.md +0 -65
- package/.agent-src/contexts/communication/rules-auto/roadmap-progress-sync-mechanics.md +0 -78
- package/.agent-src/contexts/communication/rules-auto/ui-audit-gate-mechanics.md +0 -53
- /package/{docs → .agent-src/contexts}/contracts/artifact-engagement-flow.md +0 -0
- /package/{docs → .agent-src/contexts}/contracts/command-suggestion-flow.md +0 -0
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
---
|
|
2
|
+
stability: beta
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
# Rule Classification — Phase 1.2 of road-to-kernel-and-router
|
|
7
|
+
|
|
8
|
+
> **Status:** active · **Stability:** beta · **Owner:** road-to-kernel-and-router P1.2
|
|
9
|
+
> · **Source of truth:** `.agent-src.uncompressed/rules/*.md`
|
|
10
|
+
|
|
11
|
+
Migration plan for all 56 source rules. **No edits land here** — this
|
|
12
|
+
document is the disposition map P2 / P4 will execute against.
|
|
13
|
+
|
|
14
|
+
## § 1 — Disposition codes
|
|
15
|
+
|
|
16
|
+
| code | meaning |
|
|
17
|
+
|---|---|
|
|
18
|
+
| `keep-in-kernel` | Iron Law floor / behaviour / safety / tone / ask-policy. Loaded every session. Compressed to ≤ 2.5k chars (P2.2; raised from 1.5k per Council R2). |
|
|
19
|
+
| `compress-and-keep` | Behavioural rule that stays in `rules/` as auto-tier. Compressed in place per the P2.2 playbook. Loaded by router on trigger match. |
|
|
20
|
+
| `move-to-skill:<id>` | Procedural how-to content. Body migrates into the named skill (P4.1); rule shrinks to Iron Law one-liner + `routes_to:`. |
|
|
21
|
+
| `move-to-guideline:<id>` | Reference / examples / mechanics tables. Body migrates into `docs/guidelines/<id>.md` (P4.2); rule keeps Iron Law + pointer. |
|
|
22
|
+
|
|
23
|
+
## § 2 — Baseline numbers (measured 2026-05-06)
|
|
24
|
+
|
|
25
|
+
| bucket | rules | chars | target after roadmap |
|
|
26
|
+
|---|---:|---:|---|
|
|
27
|
+
| always (kernel proxy) | 9 | 32 403 | ≤ 25 000 hard, ≤ 20 000 target |
|
|
28
|
+
| auto | 47 | 142 297 | ≤ 60 000 |
|
|
29
|
+
| **total** | **56** | **174 700** | **≤ 85 000** |
|
|
30
|
+
|
|
31
|
+
Source: `python3 scripts/measure_rule_budget.py`.
|
|
32
|
+
|
|
33
|
+
## § 3 — Disposition table
|
|
34
|
+
|
|
35
|
+
Sorted by current `type` then `id`. `chars` = body chars after
|
|
36
|
+
frontmatter strip. Disposition is the migration call, **not** an edit
|
|
37
|
+
yet.
|
|
38
|
+
|
|
39
|
+
### § 3.1 — always-rules (kernel candidates)
|
|
40
|
+
|
|
41
|
+
| id | chars | disposition | rationale |
|
|
42
|
+
|---|---:|---|---|
|
|
43
|
+
| agent-authority | 1217 | `keep-in-kernel` | Priority index for the four authority rules; routes-of-routers |
|
|
44
|
+
| ask-when-uncertain | 4096 | `keep-in-kernel` | Iron Law: one-question-per-turn, mirror the user, vague-trigger list |
|
|
45
|
+
| commit-policy | 2972 | `keep-in-kernel` | Iron Law (safety-floor): NEVER commit / NEVER ask about committing |
|
|
46
|
+
| direct-answers | 3991 | `keep-in-kernel` | Three Iron Laws (no flattery, no invented facts, brevity) |
|
|
47
|
+
| language-and-tone | 5318 | `keep-in-kernel` | Iron Law: mirror the user's language; .md always English |
|
|
48
|
+
| no-cheap-questions | 3875 | `keep-in-kernel` | Iron Law: no-cheap-questions self-check; mode-independent |
|
|
49
|
+
| non-destructive-by-default | 4222 | `keep-in-kernel` | Iron Law (safety-floor): Hard Floor for prod / push / bulk-destructive |
|
|
50
|
+
| scope-control | 4368 | `keep-in-kernel` | Iron Law (safety-floor): no unsolicited refactors / git-ops gate |
|
|
51
|
+
| verify-before-complete | 2344 | `keep-in-kernel` | Iron Law: no completion claims without fresh verification |
|
|
52
|
+
|
|
53
|
+
**Always-bucket total: 32 403 chars.** Pilot compression rate `r`
|
|
54
|
+
locked at **median 0.712** (P1.3, Council R2 amendment); projection
|
|
55
|
+
sum = 23 071 chars, under the 25k hard cap with 1 929 chars headroom.
|
|
56
|
+
Per-rule cap raised to ≤ 2.5k (Council R2). Iron-Law-override ADRs
|
|
57
|
+
may lift individual rules above 2.5k where Iron-Law density forbids
|
|
58
|
+
further compression — currently 2 expected (`direct-answers` +342,
|
|
59
|
+
`language-and-tone` +1286). See `kernel-membership.md` § 5.
|
|
60
|
+
|
|
61
|
+
> **Council swap ADR (P2.1 input).** Sonnet 4.5 flagged
|
|
62
|
+
> `agent-authority` as a routing index (no Iron-Law fence; should
|
|
63
|
+
> demote to auto-tier-3) and `autonomous-execution` (currently
|
|
64
|
+
> `compress-and-keep` below) as a mode-independent Band-4 authority
|
|
65
|
+
> that should promote to kernel. Swap accepted ⇒ +1213 chars over
|
|
66
|
+
> the 25k cap. Decision deferred to P2.1 ADR; current dispositions
|
|
67
|
+
> below remain locked until the ADR resolves.
|
|
68
|
+
|
|
69
|
+
### § 3.2 — auto-rules: compress-and-keep (22)
|
|
70
|
+
|
|
71
|
+
Behavioural rules with too much Iron-Law content for migration; compress
|
|
72
|
+
in place per P2.2 playbook. Loaded by router on trigger match.
|
|
73
|
+
|
|
74
|
+
| id | chars | tier | rationale |
|
|
75
|
+
|---|---:|---|---|
|
|
76
|
+
| architecture | 2491 | 3 | Behavioural; project-organization gates |
|
|
77
|
+
| artifact-drafting-protocol | 2957 | 2a | Iron-Law-shaped Understand→Research→Draft sequence |
|
|
78
|
+
| augment-source-of-truth | 2439 | 1 | Behavioural Iron Law: never edit generated dirs |
|
|
79
|
+
| autonomous-execution | 5631 | 3 | Trivial-vs-blocking decision; tier-1 on `balanced` |
|
|
80
|
+
| context-hygiene | 3811 | 1 | Behavioural Iron Law: 3-failure stop, fresh-chat trigger |
|
|
81
|
+
| downstream-changes | 2940 | 2b | Behavioural: every code edit |
|
|
82
|
+
| guidelines | 4184 | 3 | Meta-rule: consult guidelines before code |
|
|
83
|
+
| improve-before-implement | 3838 | 2b | Behavioural: validate before building |
|
|
84
|
+
| markdown-safe-codeblocks | 535 | 2b | Already small; behavioural |
|
|
85
|
+
| minimal-safe-diff | 3324 | 2a | Behavioural Iron Law: smallest change |
|
|
86
|
+
| missing-tool-handling | 2633 | 2a | Behavioural Iron Law: ask, don't install silently |
|
|
87
|
+
| no-attribution-footers | 1462 | 3 | Iron Law (recently trimmed); within budget |
|
|
88
|
+
| no-roadmap-references | 2502 | mech | Scoped Iron Law: no stable→roadmap refs |
|
|
89
|
+
| preservation-guard | 3825 | 2b | Quality gate during merges/refactors |
|
|
90
|
+
| role-mode-adherence | 1682 | 2a | Behavioural: mode-marker contract |
|
|
91
|
+
| runtime-safety | 1133 | 2b | Safety policy for execution metadata |
|
|
92
|
+
| security-sensitive-stop | 3004 | 2a | Safety Iron Law: stop+threat-model |
|
|
93
|
+
| size-enforcement | 865 | mech | Budget enforcement (ties into P5 CI gate) |
|
|
94
|
+
| think-before-action | 5298 | 2b | Behavioural Iron Law: analyze first |
|
|
95
|
+
| token-efficiency | 3885 | 2a | Behavioural: redirect verbose output |
|
|
96
|
+
| tool-safety | 1242 | 2b | Safety: allowlist, deny-by-default |
|
|
97
|
+
| user-interaction | 7657 | 3 | Numbered-options Iron Law |
|
|
98
|
+
|
|
99
|
+
### § 3.3 — auto-rules: move-to-skill (18)
|
|
100
|
+
|
|
101
|
+
Procedural how-to. Rule body migrates into named skill (P4.1); rule
|
|
102
|
+
shrinks to Iron-Law one-liner + `routes_to:`. Skill IDs reference
|
|
103
|
+
existing skills under `.agent-src.uncompressed/skills/`.
|
|
104
|
+
|
|
105
|
+
| id | chars | target skill | rationale |
|
|
106
|
+
|---|---:|---|---|
|
|
107
|
+
| agent-docs | 2575 | `agent-docs-writing` | Procedural: how to author agent-docs |
|
|
108
|
+
| analysis-skill-routing | 1325 | `analysis-skill-router` | Routing procedure |
|
|
109
|
+
| capture-learnings | 2820 | `learning-to-rule-or-skill` | Capture procedure |
|
|
110
|
+
| cli-output-handling | 1801 | `rtk-output-filtering` | Tool-wrapping procedure |
|
|
111
|
+
| commit-conventions | 1938 | `conventional-commits-writing` | Format procedure |
|
|
112
|
+
| docker-commands | 1830 | `docker` | Stack-specific procedure |
|
|
113
|
+
| docs-sync | 3131 | `agent-docs-writing` | Mechanical sync procedure |
|
|
114
|
+
| e2e-testing | 1807 | `e2e-heal` | Procedural; project-specific |
|
|
115
|
+
| laravel-translations | 995 | `laravel` | Stack-specific |
|
|
116
|
+
| model-recommendation | 2909 | `set-cost-profile` | Routing procedure |
|
|
117
|
+
| onboarding-gate | 4881 | `onboard` | Mechanical: meta-rule about /onboard |
|
|
118
|
+
| package-ci-checks | 1342 | `lint-skills` | Repo-specific procedure |
|
|
119
|
+
| review-routing-awareness | 4220 | `review-routing` | Skill exists; large overlap |
|
|
120
|
+
| reviewer-awareness | 3573 | `review-routing` | Merges with above into one skill |
|
|
121
|
+
| skill-improvement-trigger | 1597 | `skill-improvement-pipeline` | Trigger procedure |
|
|
122
|
+
| slash-command-routing-policy | 3218 | `command-routing` | Routing procedure |
|
|
123
|
+
| ui-audit-gate | 3285 | `existing-ui-audit` | Audit procedure |
|
|
124
|
+
| upstream-proposal | 2424 | `upstream-contribute` | Procedural |
|
|
125
|
+
|
|
126
|
+
### § 3.4 — auto-rules: move-to-guideline (7)
|
|
127
|
+
|
|
128
|
+
Reference / examples / mechanics. Body migrates into
|
|
129
|
+
`docs/guidelines/<id>.md` (P4.2); rule keeps Iron Law + pointer.
|
|
130
|
+
|
|
131
|
+
| id | chars | target guideline | rationale |
|
|
132
|
+
|---|---:|---|---|
|
|
133
|
+
| artifact-engagement-recording | 3462 | `artifact-engagement-flow` | Mechanics doc lives in `.agent-src.uncompressed/contexts/contracts/` (P4.1) |
|
|
134
|
+
| augment-portability | 2956 | `augment-portability-patterns` | Project-agnostic-patterns reference |
|
|
135
|
+
| command-suggestion-policy | 3954 | `command-suggestion-flow` | Flow doc already exists |
|
|
136
|
+
| php-coding | 3433 | `php-coding-patterns` | Reference table; per-stack |
|
|
137
|
+
| roadmap-progress-sync | 7455 | `roadmap-progress-mechanics` | Mostly mechanics + checkbox grammar |
|
|
138
|
+
| rule-type-governance | 2661 | `rule-type-governance` | Reference: when always vs auto |
|
|
139
|
+
| skill-quality | 5367 | `skill-quality-checklist` | Reference checklist |
|
|
140
|
+
|
|
141
|
+
## § 4 — Verification
|
|
142
|
+
|
|
143
|
+
| check | command | acceptance |
|
|
144
|
+
|---|---|---|
|
|
145
|
+
| Coverage | `python3 scripts/measure_rule_budget.py` | 56 rules total → 9 kernel + 22 compress + 18 skill + 7 guideline |
|
|
146
|
+
| Determinism | `python3 scripts/measure_rule_budget.py --json` × 2 | byte-identical output |
|
|
147
|
+
| No-edits | `git diff --stat .agent-src.uncompressed/rules/` | clean (this is plan-only) |
|
|
148
|
+
|
|
149
|
+
## § 5 — Open questions
|
|
150
|
+
|
|
151
|
+
1. **Kernel swap ADR (P2.1).** `agent-authority` ↔
|
|
152
|
+
`autonomous-execution`. See `kernel-membership.md` § 5.2 for the
|
|
153
|
+
three resolution variants; this file syncs once the ADR lands.
|
|
154
|
+
2. **`reviewer-awareness` + `review-routing-awareness` merge.** Both
|
|
155
|
+
target the same skill — P4.1 must consolidate, not duplicate.
|
|
156
|
+
3. **`onboarding-gate` migration shape.** The rule fires only on the
|
|
157
|
+
first turn; the migrated form must keep that trigger latch.
|
|
158
|
+
Router state-machine primitives (once / every-turn / on-mode-
|
|
159
|
+
switch) are a P3.1 deliverable dependency before P4 ships
|
|
160
|
+
(Council R2).
|
|
161
|
+
4. **P4 migration shapes spec.** Per-disposition contract
|
|
162
|
+
(replace / merge / stub / disappear) for `move-to-skill` and
|
|
163
|
+
`move-to-guideline` — frontmatter handling, conflict resolution,
|
|
164
|
+
one-liner + `routes_to:` shape vs body merge. P4 deliverable
|
|
165
|
+
spec; flagged by Council R2 to prevent inconsistent implementer
|
|
166
|
+
calls.
|
|
167
|
+
5. **`think-before-action` / `context-hygiene` / `augment-source-of-
|
|
168
|
+
truth` boundary.** Currently `compress-and-keep` (auto). Council
|
|
169
|
+
did not flag for promotion; revisit only if the swap ADR (#1)
|
|
170
|
+
forces a re-projection.
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
---
|
|
2
|
+
stability: beta
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
# Rule Router — Frontmatter Schema and Compiled Output
|
|
7
|
+
|
|
8
|
+
Status: locked for Phase 3 of `road-to-kernel-and-router.md`.
|
|
9
|
+
Owners: this contract; `scripts/compile_router.py` (Phase 3.2);
|
|
10
|
+
`scripts/skill_linter.py` extension (Phase 3.3).
|
|
11
|
+
|
|
12
|
+
## Why a router
|
|
13
|
+
|
|
14
|
+
The kernel (9 rules, ≤ 26k chars per ADR-002) loads on every session.
|
|
15
|
+
Every other rule must declare **when it activates** and **which
|
|
16
|
+
artifacts (skills / guidelines) carry the body**. The router compiles
|
|
17
|
+
those declarations into a deterministic lookup table that host agents
|
|
18
|
+
read once at session start.
|
|
19
|
+
|
|
20
|
+
Kernel rules never appear in the router — they are unconditional.
|
|
21
|
+
|
|
22
|
+
## Frontmatter schema
|
|
23
|
+
|
|
24
|
+
All keys live in the rule's existing YAML frontmatter. Existing fields
|
|
25
|
+
(`type`, `tier`, `description`, `alwaysApply`, `source`, `load_context`)
|
|
26
|
+
are preserved. New / formalized fields:
|
|
27
|
+
|
|
28
|
+
| Key | Required | Values | Purpose |
|
|
29
|
+
|---|---|---|---|
|
|
30
|
+
| `type` | yes | `always` \| `auto` | Existing. Kernel = `always`; everything else = `auto`. |
|
|
31
|
+
| `tier` | yes | `kernel` \| `tier-1` \| `tier-2` | New names. Kernel = always-loaded; tier-1 = balanced + full; tier-2 = full only. |
|
|
32
|
+
| `triggers` | yes for non-kernel | list of objects | When the rule activates. **Forbidden** on kernel rules. |
|
|
33
|
+
| `routes_to` | yes for non-kernel | list of strings | Skills / guidelines whose body fulfils the rule. **Forbidden** on kernel rules. |
|
|
34
|
+
| `profile` | no | `minimal` \| `balanced` \| `full` | Override the tier-derived default profile. Rare; used only when a tier-2 rule must ship in `balanced`. |
|
|
35
|
+
| `triggered_by` | back-ref, on routed artifact | list of strings | Skill / guideline frontmatter declares which rule(s) route to it. Bidirectional check (P3.3). |
|
|
36
|
+
|
|
37
|
+
### `triggers:` shape
|
|
38
|
+
|
|
39
|
+
Each item is an object with exactly one match key plus an optional
|
|
40
|
+
`reason:` for the linter / docs. Match keys (any of):
|
|
41
|
+
|
|
42
|
+
```yaml
|
|
43
|
+
triggers:
|
|
44
|
+
- keyword: "commit" # case-insensitive substring of user prompt
|
|
45
|
+
- phrase: "should I commit" # case-insensitive substring, multi-word
|
|
46
|
+
- intent: "git-write" # named intent token (router-defined vocabulary)
|
|
47
|
+
- file_pattern: "*.tf" # glob over edited / opened paths
|
|
48
|
+
- path_prefix: "agents/" # directory prefix over edited / opened paths
|
|
49
|
+
- command: "/commit" # literal slash-command invocation
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Multiple `triggers:` entries are OR-combined — any match activates the rule.
|
|
53
|
+
Within one entry, only one match key is allowed. The router-defined
|
|
54
|
+
intent vocabulary lives in `docs/contracts/router-intents.md` (Phase 3.2).
|
|
55
|
+
|
|
56
|
+
### `routes_to:` shape
|
|
57
|
+
|
|
58
|
+
Plain string list. Each entry is `<kind>:<id>`:
|
|
59
|
+
|
|
60
|
+
```yaml
|
|
61
|
+
routes_to:
|
|
62
|
+
- skill:php-coder
|
|
63
|
+
- guideline:agent-infra/asking-and-brevity-examples
|
|
64
|
+
- command:onboard
|
|
65
|
+
- contract:command-suggestion-flow
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
`kind` is one of `skill`, `guideline`, `command`, `contract`. `id`
|
|
69
|
+
resolves to the target file under:
|
|
70
|
+
|
|
71
|
+
| kind | path |
|
|
72
|
+
|---|---|
|
|
73
|
+
| `skill` | `.agent-src.uncompressed/skills/<id>/SKILL.md` |
|
|
74
|
+
| `guideline` | `docs/guidelines/<id>.md` |
|
|
75
|
+
| `command` | `.agent-src.uncompressed/commands/<id>.md` |
|
|
76
|
+
| `contract` | `docs/contracts/<id>.md` |
|
|
77
|
+
|
|
78
|
+
Linter checks each target exists. `command` is for procedural rules
|
|
79
|
+
that route to a slash-command's source file. `contract` is for rules
|
|
80
|
+
whose body is fully covered by an existing architectural contract.
|
|
81
|
+
|
|
82
|
+
## Compiled output — `router.json`
|
|
83
|
+
|
|
84
|
+
`scripts/compile_router.py` reads every rule frontmatter and emits
|
|
85
|
+
`router.json` at the repo root, used by host agents at session start.
|
|
86
|
+
Deterministic key order, sorted lists, stable across runs.
|
|
87
|
+
|
|
88
|
+
```json
|
|
89
|
+
{
|
|
90
|
+
"schema_version": 1,
|
|
91
|
+
"kernel": ["agent-authority", "ask-when-uncertain", "commit-policy",
|
|
92
|
+
"direct-answers", "language-and-tone", "no-cheap-questions",
|
|
93
|
+
"non-destructive-by-default", "scope-control",
|
|
94
|
+
"verify-before-complete"],
|
|
95
|
+
"tier_1": [{"id": "augment-source-of-truth",
|
|
96
|
+
"triggers": [{"path_prefix": "agents/"},
|
|
97
|
+
{"path_prefix": ".agent-src/"}],
|
|
98
|
+
"routes_to": ["skill:agent-docs-writing"]}],
|
|
99
|
+
"tier_2": [/* same shape as tier_1 */],
|
|
100
|
+
"profiles": {
|
|
101
|
+
"minimal": ["__kernel__"],
|
|
102
|
+
"balanced": ["__kernel__", "__tier_1__"],
|
|
103
|
+
"full": ["__kernel__", "__tier_1__", "__tier_2__"]
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Generated alongside `marketplace.json` during `task generate-tools`.
|
|
109
|
+
|
|
110
|
+
## Activation semantics
|
|
111
|
+
|
|
112
|
+
The host agent reads `router.json` once per session. Per turn:
|
|
113
|
+
|
|
114
|
+
1. Always evaluate kernel rules.
|
|
115
|
+
2. If `profile = minimal` → stop after kernel.
|
|
116
|
+
3. Otherwise, walk tier_1 (and tier_2 if `profile = full`); a rule
|
|
117
|
+
activates when **any** of its `triggers:` matches the current
|
|
118
|
+
prompt + open files + invoked command.
|
|
119
|
+
4. Active rules are loaded inline; their routed artifacts (`skill:`
|
|
120
|
+
or `guideline:`) are surfaced to the agent for that turn.
|
|
121
|
+
|
|
122
|
+
No runtime profile resolution — the profile is fixed at session
|
|
123
|
+
start, the router lookup is keyword/phrase/path/intent matching only.
|
|
124
|
+
|
|
125
|
+
## Linter contract (Phase 3.3)
|
|
126
|
+
|
|
127
|
+
`scripts/skill_linter.py` extension enforces:
|
|
128
|
+
|
|
129
|
+
- Every kernel rule has **no** `triggers:` and **no** `routes_to:`.
|
|
130
|
+
- Every non-kernel rule has ≥ 1 `triggers:` entry and ≥ 1 `routes_to:` entry.
|
|
131
|
+
- Every `routes_to:` target exists on disk.
|
|
132
|
+
- Every routed skill / guideline declares `triggered_by:` listing the rule(s)
|
|
133
|
+
that route to it (bidirectional check; mirrors the existing back-ref
|
|
134
|
+
pattern in `scripts/check_references.py`).
|
|
135
|
+
- `tier` and `profile` are in the allowed value sets.
|
|
136
|
+
|
|
137
|
+
## Backward compatibility
|
|
138
|
+
|
|
139
|
+
- The legacy `tier: "1" | "2" | "2a" | "3" | "mechanical-already"` values
|
|
140
|
+
remain readable; the compiler maps them to `kernel` / `tier-1` / `tier-2`
|
|
141
|
+
as locked in `kernel-membership.md` § 4 (status-quo bucket model).
|
|
142
|
+
- Rules without `triggers:` keep firing under their current `description`-
|
|
143
|
+
matching behaviour until P4.x migrations land — the linter only enforces
|
|
144
|
+
presence; activation falls back to `description` for unmigrated rules.
|
|
145
|
+
- The router is **additive** to the existing always/auto split; no
|
|
146
|
+
existing rule changes behaviour until its frontmatter is migrated.
|
|
147
|
+
|
|
148
|
+
## Source-of-truth
|
|
149
|
+
|
|
150
|
+
- This file: schema specification.
|
|
151
|
+
- `kernel-membership.md` § 4: kernel locked count + SHAs.
|
|
152
|
+
- `rule-classification.md`: per-rule tier + disposition pre-Phase-4.
|
|
153
|
+
- `router.json` (generated): runtime artifact, never hand-edited.
|
package/docs/customization.md
CHANGED
|
@@ -78,12 +78,23 @@ drift.
|
|
|
78
78
|
|
|
79
79
|
### Cost profiles
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
|
81
|
+
`cost_profile` is the master switch for rule-tier loading. The kernel
|
|
82
|
+
(always-loaded Iron-Law floor, ≤ 26k chars across 9 rules) ships in every
|
|
83
|
+
profile. Tier-1 and tier-2 rules are gated by profile and resolved at
|
|
84
|
+
session start from `router.json` (compiled by `scripts/compile_router.py`).
|
|
85
|
+
|
|
86
|
+
| Profile | Rule tiers loaded | Token footprint | Best for |
|
|
87
|
+
|---|---|---|---|
|
|
88
|
+
| `minimal` | kernel only (no router, no auto-rules) | lowest | Cost-sensitive sessions; trivial Q&A; CI runs |
|
|
89
|
+
| `balanced` | kernel + tier-1 auto-rules (default) | medium | Day-to-day work — current behaviour superset |
|
|
90
|
+
| `full` | kernel + tier-1 + tier-2 (everything) | highest | Agent-config development; full rule fidelity |
|
|
91
|
+
| `custom` | profile ignored — every matrix value must be set explicitly | varies | Power users with bespoke rule sets |
|
|
92
|
+
|
|
93
|
+
The kernel-and-router architecture is documented in
|
|
94
|
+
[`docs/contracts/rule-router.md`](contracts/rule-router.md) and
|
|
95
|
+
[`docs/contracts/kernel-membership.md`](contracts/kernel-membership.md).
|
|
96
|
+
Tier flags live in each rule's frontmatter (`tier: kernel | tier-1 | tier-2`);
|
|
97
|
+
the router compiles them into `router.json` deterministically.
|
|
87
98
|
|
|
88
99
|
All profiles except `custom` ship with `pipelines.skill_improvement: true`,
|
|
89
100
|
so the agent captures learnings after meaningful tasks by default. Set it
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
---
|
|
2
|
+
adr: 001
|
|
3
|
+
status: accepted
|
|
4
|
+
date: 2026-05-06
|
|
5
|
+
decision: kernel-swap-deferred
|
|
6
|
+
supersedes: —
|
|
7
|
+
superseded_by: —
|
|
8
|
+
phase: road-to-kernel-and-router · P2.1
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# ADR-001 — Kernel-Set Swap Deferred (variant a)
|
|
12
|
+
|
|
13
|
+
## Status
|
|
14
|
+
|
|
15
|
+
**Accepted** · 2026-05-06.
|
|
16
|
+
|
|
17
|
+
## Context
|
|
18
|
+
|
|
19
|
+
Phase 1.4 of `road-to-kernel-and-router` ran an AI Council
|
|
20
|
+
cross-check (Sonnet 4.5 + GPT-4o) against the locked 9-rule kernel
|
|
21
|
+
set in `docs/contracts/kernel-membership.md` § 4. Sonnet flagged that
|
|
22
|
+
`agent-authority` carries **no Iron-Law fence** — it is a routing
|
|
23
|
+
index dispatching to four other kernel rules (`non-destructive-by-default`,
|
|
24
|
+
`scope-control`, `commit-policy`, `autonomous-execution`) by Band.
|
|
25
|
+
Sonnet proposed swapping `agent-authority` out of the kernel and
|
|
26
|
+
promoting `autonomous-execution` in. Three resolution variants
|
|
27
|
+
landed in `kernel-membership.md` § 5.2:
|
|
28
|
+
|
|
29
|
+
| variant | sum-projected (× 0.712) | bucket budget | Iron-Law-override ADRs |
|
|
30
|
+
|---|---:|---|---|
|
|
31
|
+
| (a) status quo (current § 4) | 23 071 | ✓ ≤ 25k | 2 (`direct-answers`, `language-and-tone`) |
|
|
32
|
+
| (b) swap, raise hard cap to 27k | 26 213 | ✓ ≤ 27k | 3 (+`autonomous-execution`) |
|
|
33
|
+
| (c) swap + demote `verify-before-complete` | 24 545 | ✓ ≤ 25k | 3 (+`autonomous-execution`) |
|
|
34
|
+
|
|
35
|
+
## Decision
|
|
36
|
+
|
|
37
|
+
**Variant (a) — status quo through P2.2 + P3.1.**
|
|
38
|
+
|
|
39
|
+
- Keep `agent-authority` in the kernel.
|
|
40
|
+
- Keep `autonomous-execution` in `compress-and-keep` (auto-tier) per
|
|
41
|
+
`docs/contracts/rule-classification.md` § 3.2.
|
|
42
|
+
- Re-evaluate the swap as a P3.2 ADR after the router schema and
|
|
43
|
+
compiler ship.
|
|
44
|
+
|
|
45
|
+
## Consequences
|
|
46
|
+
|
|
47
|
+
### Accepted
|
|
48
|
+
|
|
49
|
+
- 25k hard cap stays intact (no governance erosion via cap-raise).
|
|
50
|
+
- 2 Iron-Law-override ADRs land in P2.2 if post-compression
|
|
51
|
+
measurement confirms overage (`direct-answers`, `language-and-tone`).
|
|
52
|
+
- The 9-rule set carried into P2.2 is the locked § 4 list.
|
|
53
|
+
|
|
54
|
+
### Trade-offs
|
|
55
|
+
|
|
56
|
+
- Sonnet's Iron-Law-purity critique stands: `agent-authority`
|
|
57
|
+
remains in the kernel without a fence of its own. Mitigation —
|
|
58
|
+
the rule **mechanically depends** on four other kernel rules
|
|
59
|
+
(every Band redirects), so its kernel residency is structurally
|
|
60
|
+
load-bearing even if not syntactically Iron Law. Treated as a
|
|
61
|
+
routing primitive that dispatches to Iron Laws, not a rule in
|
|
62
|
+
parallel to them.
|
|
63
|
+
- `autonomous-execution` (5631 chars current, ~4009 projected)
|
|
64
|
+
remains in auto-tier. Behaviour preserved because the rule
|
|
65
|
+
already declares `type: auto` and ships under the `balanced` and
|
|
66
|
+
`full` cost profiles by default.
|
|
67
|
+
|
|
68
|
+
## Re-evaluation trigger
|
|
69
|
+
|
|
70
|
+
Phase 3 (`docs/contracts/rule-router.md`) introduces a
|
|
71
|
+
`tier:` / `band:` / `priority:` schema in rule frontmatter. Once
|
|
72
|
+
that schema is locked in P3.1 and the compiler is wired in P3.2,
|
|
73
|
+
`agent-authority` becomes redundant: each kernel rule carries its
|
|
74
|
+
own band as frontmatter, and the compiled `router.json` resolves
|
|
75
|
+
precedence at build time. At that point:
|
|
76
|
+
|
|
77
|
+
- `agent-authority` migrates to a guideline
|
|
78
|
+
(`docs/guidelines/agent-authority.md`) as documentation of the
|
|
79
|
+
band model.
|
|
80
|
+
- `autonomous-execution` can be promoted into the kernel under a
|
|
81
|
+
new ADR (ADR-N) that replaces this one, *if* its post-compression
|
|
82
|
+
size fits the cap with no further demotion.
|
|
83
|
+
|
|
84
|
+
This deferral is **not** indefinite: P3.2 ships the router compiler;
|
|
85
|
+
the swap re-evaluation ADR is mandatory before P4.1 (rule → skill
|
|
86
|
+
migrations) so the migration plan reflects the final kernel set.
|
|
87
|
+
|
|
88
|
+
## Alternatives considered
|
|
89
|
+
|
|
90
|
+
- **Variant (b) — swap + raise cap to 27k.** Rejected. Raising the
|
|
91
|
+
hard cap mid-roadmap weakens the original 25k contract that the
|
|
92
|
+
whole roadmap is built around. If 27k turns out to be the real
|
|
93
|
+
ceiling, that is a separate ADR after compression measurement
|
|
94
|
+
proves the band, not a pre-emptive concession.
|
|
95
|
+
- **Variant (c) — swap + demote `verify-before-complete`.**
|
|
96
|
+
Rejected. `verify-before-complete` carries criterion #1 (Iron
|
|
97
|
+
Law) and gates completion-claims across every reply. Demoting it
|
|
98
|
+
to auto-tier removes the floor that prevents the agent from
|
|
99
|
+
claiming "done" without fresh evidence — a behavioural regression
|
|
100
|
+
that the golden-transcript suite would catch but that no other
|
|
101
|
+
kernel rule replaces.
|
|
102
|
+
|
|
103
|
+
## References
|
|
104
|
+
|
|
105
|
+
- `docs/contracts/kernel-membership.md` § 4, § 5.2
|
|
106
|
+
- `agents/council-sessions/20260506T044941Z-phase1-cross-check-r2.json` <!-- council-ref-allowed: ADR decision trace -->
|
|
107
|
+
- `agents/roadmaps/road-to-kernel-and-router.md` § Decisions, § Phase 2
|
|
108
|
+
- `.agent-src.uncompressed/rules/agent-authority.md` (subject)
|
|
109
|
+
- `.agent-src.uncompressed/rules/autonomous-execution.md` (proposed promotion)
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# ADR-002 — Kernel-Bucket Cap Raise (25k → 26k) and Per-Rule Iron-Law Overrides
|
|
2
|
+
|
|
3
|
+
- **Status:** Accepted (2026-05-06)
|
|
4
|
+
- **Phase:** Road to Rule Kernel and Router · P2.2 (Heavy Compression)
|
|
5
|
+
- **Supersedes:** none — extends the Council R2 amendments locked in
|
|
6
|
+
`docs/contracts/kernel-membership.md` § 5.1 (median r=0.712, per-rule cap 2.5k,
|
|
7
|
+
kernel-bucket 25k).
|
|
8
|
+
- **Related:** ADR-001 (kernel-swap deferred); Council R2 cross-check session
|
|
9
|
+
`agents/council-sessions/20260506T044941Z-phase1-cross-check-r2.json`. <!-- council-ref-allowed: ADR decision trace -->
|
|
10
|
+
|
|
11
|
+
## Context
|
|
12
|
+
|
|
13
|
+
P1.3 projected the post-compression kernel bucket at **23 071 chars** using
|
|
14
|
+
the median pilot ratio r=0.712 (3 pilots: agent-authority, direct-answers,
|
|
15
|
+
language-and-tone). Pilot rules were **short to medium** (1.0k–2.5k baseline).
|
|
16
|
+
|
|
17
|
+
P2.2 applied the same compression discipline to the remaining 6 kernel rules
|
|
18
|
+
(ask-when-uncertain, commit-policy, no-cheap-questions,
|
|
19
|
+
non-destructive-by-default, scope-control, plus the verify-before-complete
|
|
20
|
+
auto-tier rule kept by ADR-001). Iron-Law SHA preservation verified for
|
|
21
|
+
all 8 rules with Iron-Law fences (`scripts/iron_law_sha.py`).
|
|
22
|
+
|
|
23
|
+
**Empirical post-compression measurements (2026-05-06):**
|
|
24
|
+
|
|
25
|
+
| metric | projected | actual |
|
|
26
|
+
|---|---:|---:|
|
|
27
|
+
| kernel bucket sum | 23 071 | **25 590** |
|
|
28
|
+
| compression ratio r (kernel-wide) | 0.712 (median pilot) | **0.795** |
|
|
29
|
+
| rules > 2.5k cap | 2 (pilots) | 6 |
|
|
30
|
+
| rules > 4.0k ceiling | 0 | 0 |
|
|
31
|
+
|
|
32
|
+
The actual ratio (0.795) is worse than the pilot median (0.712) because
|
|
33
|
+
**longer rules compress less efficiently than short ones**: each Iron-Law
|
|
34
|
+
rule has a fixed payload of frontmatter, Iron-Law fence, exception
|
|
35
|
+
enumeration, see-also list — shrinkage is bounded by what cannot leave
|
|
36
|
+
the rule without breaking the rule's contract. The 5 longest source rules
|
|
37
|
+
(non-destructive-by-default, scope-control, no-cheap-questions,
|
|
38
|
+
ask-when-uncertain, language-and-tone) each kept multiple
|
|
39
|
+
non-externalisable structural elements (Iron-Law fence + trigger
|
|
40
|
+
enumeration + pre-send self-check + decline/fence semantics).
|
|
41
|
+
|
|
42
|
+
## Decision
|
|
43
|
+
|
|
44
|
+
1. **Raise KERNEL_HARD from 25 000 → 26 000 chars** in
|
|
45
|
+
`scripts/measure_rule_budget.py`. KERNEL_TARGET stays at 20 000.
|
|
46
|
+
This accommodates the empirical 25 590 with ~410 chars headroom for
|
|
47
|
+
future minor edits (typo fixes, link updates, frontmatter tweaks)
|
|
48
|
+
without re-tripping the gate.
|
|
49
|
+
|
|
50
|
+
2. **Add the following 6 kernel rules to `docs/contracts/iron-law-overrides.txt`**
|
|
51
|
+
with this ADR as their justification. All sit between 2.5k and 4.0k
|
|
52
|
+
(the override ceiling):
|
|
53
|
+
|
|
54
|
+
| rule | chars | + over 2.5k | < 4.0k ceiling |
|
|
55
|
+
|---|---:|---:|---|
|
|
56
|
+
| `language-and-tone` | 3 602 | +1 102 | ✓ |
|
|
57
|
+
| `scope-control` | 3 641 | +1 141 | ✓ |
|
|
58
|
+
| `non-destructive-by-default` | 3 420 | +920 | ✓ |
|
|
59
|
+
| `no-cheap-questions` | 3 238 | +738 | ✓ |
|
|
60
|
+
| `ask-when-uncertain` | 3 130 | +630 | ✓ |
|
|
61
|
+
| `direct-answers` | 2 841 | +341 | ✓ |
|
|
62
|
+
|
|
63
|
+
3. **Cap stays sticky.** Future kernel additions or rule-body growth must
|
|
64
|
+
either (a) compress within the 26k bucket, (b) externalise to a
|
|
65
|
+
`contexts/authority/*` companion, or (c) require a follow-up ADR.
|
|
66
|
+
|
|
67
|
+
## Rationale
|
|
68
|
+
|
|
69
|
+
Each over-cap rule defends a **distinct Iron Law fence** that loses meaning
|
|
70
|
+
if split. Externalising the enumeration to a context file would force the
|
|
71
|
+
agent to load the context every time the Iron Law applies (i.e. always),
|
|
72
|
+
defeating the kernel-vs-auto split that motivates the budget in the first
|
|
73
|
+
place.
|
|
74
|
+
|
|
75
|
+
- `non-destructive-by-default` and `scope-control` carry the **Hard Floor**
|
|
76
|
+
trigger table (prod-trunk merge, deploy, push, prod data/infra, bulk
|
|
77
|
+
deletion) and the per-row example column. Splitting the table breaks
|
|
78
|
+
matching at decision time.
|
|
79
|
+
- `no-cheap-questions` carries the **8-class cheap-question catalog** plus
|
|
80
|
+
a 6-step Pre-Send Self-Check that must be evaluated before every
|
|
81
|
+
numbered-options block — this is the gate, not a footnote.
|
|
82
|
+
- `ask-when-uncertain` carries the **vague-request trigger list** (9 user
|
|
83
|
+
phrasings the agent must recognise without scrolling to a context file).
|
|
84
|
+
- `language-and-tone` carries the **pre-send language gate** for every
|
|
85
|
+
reply token (prose, headings, table cells, inter-tool commentary,
|
|
86
|
+
Recommendation: vs Empfehlung: label) — splitting loses the exhaustive
|
|
87
|
+
catalog the agent matches against.
|
|
88
|
+
- `direct-answers` carries **3 Iron Laws** (no flattery, no invented facts,
|
|
89
|
+
brevity by default) plus the severity-tiered claim table — already the
|
|
90
|
+
most condensed form of these obligations.
|
|
91
|
+
|
|
92
|
+
The `commit-policy` rule was trimmed below 2.5k (2 354 chars) by removing
|
|
93
|
+
a redundant cross-reference line, demonstrating that aggressive trimming
|
|
94
|
+
is possible where the rule does not carry an enumeration. The 6 overrides
|
|
95
|
+
are the rules where further compression would force semantic loss.
|
|
96
|
+
|
|
97
|
+
## Consequences
|
|
98
|
+
|
|
99
|
+
- **Pro:** Iron-Law fidelity preserved — every fence still byte-identical
|
|
100
|
+
to baseline (verified by `iron_law_sha.py --all-kernel`).
|
|
101
|
+
- **Pro:** Empirical compression r=0.795 documented; future kernel work
|
|
102
|
+
uses this as the realistic ratio (not 0.712, which was a pilot-skewed
|
|
103
|
+
optimum).
|
|
104
|
+
- **Pro:** Override ceiling (4 000) untouched — no rule grows
|
|
105
|
+
unboundedly; the 4k cap remains the next checkpoint.
|
|
106
|
+
- **Con:** 25 590 / 26 000 = 98.4 % bucket utilisation. Adding any
|
|
107
|
+
10th kernel rule would require either compression of an existing rule
|
|
108
|
+
or a further cap raise.
|
|
109
|
+
- **Con:** ratio 0.795 means future "always" promotions cost more than
|
|
110
|
+
Phase 1 estimated. Phase 4 token-budget measurements should treat
|
|
111
|
+
0.795 as the reference compression rate.
|
|
112
|
+
|
|
113
|
+
## Rollback
|
|
114
|
+
|
|
115
|
+
If Phase 4 token measurements show that the kernel adds > 10 % to the
|
|
116
|
+
agent's per-turn token cost (`docs/contracts/kernel-membership.md` § 6
|
|
117
|
+
abort criteria), revisit:
|
|
118
|
+
|
|
119
|
+
1. Demote `verify-before-complete` from kernel to auto (saves 2 344 chars,
|
|
120
|
+
bucket → 23 246, falls back inside 25k).
|
|
121
|
+
2. Or split `scope-control` into git-ops and decline/fence halves —
|
|
122
|
+
git-ops stays kernel, decline/fence becomes auto-tier.
|
|
123
|
+
|
|
124
|
+
Both moves are reversible; this ADR does not lock either out.
|