@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.
Files changed (238) hide show
  1. package/.agent-src/commands/agents.md +1 -1
  2. package/.agent-src/commands/bug-fix.md +1 -1
  3. package/.agent-src/commands/bug-investigate.md +2 -2
  4. package/.agent-src/commands/chat-history/import.md +60 -64
  5. package/.agent-src/commands/compress.md +12 -0
  6. package/.agent-src/commands/context/create.md +2 -2
  7. package/.agent-src/commands/context.md +1 -1
  8. package/.agent-src/commands/copilot-agents.md +1 -1
  9. package/.agent-src/commands/council/default.md +17 -5
  10. package/.agent-src/commands/council.md +1 -1
  11. package/.agent-src/commands/e2e-heal.md +1 -1
  12. package/.agent-src/commands/e2e-plan.md +1 -1
  13. package/.agent-src/commands/feature/dev.md +3 -3
  14. package/.agent-src/commands/feature.md +1 -1
  15. package/.agent-src/commands/fix/seeder.md +2 -2
  16. package/.agent-src/commands/fix.md +1 -1
  17. package/.agent-src/commands/jira-ticket.md +1 -1
  18. package/.agent-src/commands/judge.md +2 -2
  19. package/.agent-src/commands/memory.md +1 -1
  20. package/.agent-src/commands/mode.md +5 -5
  21. package/.agent-src/commands/module.md +1 -1
  22. package/.agent-src/commands/onboard.md +4 -4
  23. package/.agent-src/commands/optimize/augmentignore.md +1 -1
  24. package/.agent-src/commands/optimize-prompt.md +61 -0
  25. package/.agent-src/commands/optimize.md +1 -1
  26. package/.agent-src/commands/override.md +1 -1
  27. package/.agent-src/commands/review-changes.md +1 -1
  28. package/.agent-src/commands/review-routing.md +1 -1
  29. package/.agent-src/commands/roadmap.md +1 -1
  30. package/.agent-src/commands/set-cost-profile.md +3 -3
  31. package/.agent-src/commands/sync-agent-settings.md +2 -2
  32. package/.agent-src/commands/tests/create.md +2 -2
  33. package/.agent-src/commands/tests.md +1 -1
  34. package/.agent-src/commands/threat-model.md +4 -4
  35. package/.agent-src/contexts/authority/commit-mechanics.md +14 -1
  36. package/.agent-src/contexts/authority/destructive-mechanics.md +14 -1
  37. package/.agent-src/contexts/authority/scope-mechanics.md +5 -0
  38. package/.agent-src/contexts/communication/rules-auto/guidelines-mechanics.md +76 -0
  39. package/.agent-src/contexts/communication/rules-auto/slash-command-routing-policy-mechanics.md +1 -1
  40. package/.agent-src/contexts/communication/rules-auto/think-before-action-mechanics.md +98 -0
  41. package/.agent-src/contexts/communication/rules-auto/token-efficiency-mechanics.md +93 -0
  42. package/.agent-src/contexts/communication/rules-auto/user-interaction-mechanics.md +128 -5
  43. package/.agent-src/contexts/execution/autonomy-mechanics.md +44 -0
  44. package/.agent-src/contexts/model-recommendations.md +2 -2
  45. package/.agent-src/contexts/override-system.md +1 -1
  46. package/.agent-src/personas/product-owner.md +2 -2
  47. package/.agent-src/personas/qa.md +1 -1
  48. package/.agent-src/rules/agent-authority.md +5 -6
  49. package/.agent-src/rules/agent-docs.md +11 -53
  50. package/.agent-src/rules/analysis-skill-routing.md +10 -40
  51. package/.agent-src/rules/architecture.md +6 -1
  52. package/.agent-src/rules/artifact-drafting-protocol.md +5 -0
  53. package/.agent-src/rules/artifact-engagement-recording.md +23 -59
  54. package/.agent-src/rules/ask-when-uncertain.md +24 -47
  55. package/.agent-src/rules/augment-portability.md +14 -62
  56. package/.agent-src/rules/augment-source-of-truth.md +10 -1
  57. package/.agent-src/rules/autonomous-execution.md +17 -98
  58. package/.agent-src/rules/capture-learnings.md +9 -80
  59. package/.agent-src/rules/cli-output-handling.md +12 -42
  60. package/.agent-src/rules/command-suggestion-policy.md +25 -73
  61. package/.agent-src/rules/commit-conventions.md +9 -58
  62. package/.agent-src/rules/commit-policy.md +16 -47
  63. package/.agent-src/rules/context-hygiene.md +5 -0
  64. package/.agent-src/rules/direct-answers.md +21 -50
  65. package/.agent-src/rules/docker-commands.md +11 -45
  66. package/.agent-src/rules/docs-sync.md +10 -56
  67. package/.agent-src/rules/downstream-changes.md +5 -0
  68. package/.agent-src/rules/e2e-testing.md +9 -44
  69. package/.agent-src/rules/guidelines.md +13 -75
  70. package/.agent-src/rules/improve-before-implement.md +10 -2
  71. package/.agent-src/rules/language-and-tone.md +41 -106
  72. package/.agent-src/rules/laravel-translations.md +11 -40
  73. package/.agent-src/rules/markdown-safe-codeblocks.md +4 -0
  74. package/.agent-src/rules/minimal-safe-diff.md +4 -0
  75. package/.agent-src/rules/missing-tool-handling.md +4 -0
  76. package/.agent-src/rules/model-recommendation.md +9 -61
  77. package/.agent-src/rules/no-attribution-footers.md +5 -0
  78. package/.agent-src/rules/no-cheap-questions.md +11 -27
  79. package/.agent-src/rules/no-council-references.md +76 -0
  80. package/.agent-src/rules/no-roadmap-references.md +7 -0
  81. package/.agent-src/rules/non-destructive-by-default.md +13 -43
  82. package/.agent-src/rules/onboarding-gate.md +9 -117
  83. package/.agent-src/rules/package-ci-checks.md +10 -37
  84. package/.agent-src/rules/php-coding.md +10 -55
  85. package/.agent-src/rules/preservation-guard.md +9 -0
  86. package/.agent-src/rules/review-routing-awareness.md +9 -97
  87. package/.agent-src/rules/reviewer-awareness.md +8 -83
  88. package/.agent-src/rules/roadmap-progress-sync.md +7 -170
  89. package/.agent-src/rules/role-mode-adherence.md +6 -2
  90. package/.agent-src/rules/rule-type-governance.md +8 -66
  91. package/.agent-src/rules/runtime-safety.md +5 -0
  92. package/.agent-src/rules/scope-control.md +17 -62
  93. package/.agent-src/rules/security-sensitive-stop.md +7 -1
  94. package/.agent-src/rules/size-enforcement.md +6 -1
  95. package/.agent-src/rules/skill-improvement-trigger.md +9 -49
  96. package/.agent-src/rules/skill-quality.md +7 -113
  97. package/.agent-src/rules/slash-command-routing-policy.md +11 -63
  98. package/.agent-src/rules/think-before-action.md +22 -87
  99. package/.agent-src/rules/token-efficiency.md +10 -74
  100. package/.agent-src/rules/token-optimizer-maintenance.md +68 -0
  101. package/.agent-src/rules/tool-safety.md +4 -0
  102. package/.agent-src/rules/ui-audit-gate.md +25 -61
  103. package/.agent-src/rules/upstream-proposal.md +9 -67
  104. package/.agent-src/rules/user-interaction.md +22 -108
  105. package/.agent-src/rules/verify-before-complete.md +1 -1
  106. package/.agent-src/skills/agent-docs-writing/SKILL.md +1 -1
  107. package/.agent-src/skills/ai-council/SKILL.md +65 -0
  108. package/.agent-src/skills/analysis-autonomous-mode/SKILL.md +1 -1
  109. package/.agent-src/skills/analysis-skill-router/SKILL.md +3 -3
  110. package/.agent-src/skills/artisan-commands/SKILL.md +2 -2
  111. package/.agent-src/skills/authz-review/SKILL.md +1 -1
  112. package/.agent-src/skills/aws-infrastructure/SKILL.md +5 -5
  113. package/.agent-src/skills/blast-radius-analyzer/SKILL.md +8 -8
  114. package/.agent-src/skills/bug-analyzer/SKILL.md +5 -5
  115. package/.agent-src/skills/code-refactoring/SKILL.md +4 -4
  116. package/.agent-src/skills/code-review/SKILL.md +2 -2
  117. package/.agent-src/skills/command-writing/SKILL.md +11 -0
  118. package/.agent-src/skills/composer-packages/SKILL.md +2 -2
  119. package/.agent-src/skills/context-authoring/SKILL.md +11 -0
  120. package/.agent-src/skills/context-document/SKILL.md +1 -1
  121. package/.agent-src/skills/copilot-agents-optimization/SKILL.md +23 -0
  122. package/.agent-src/skills/copilot-config/SKILL.md +1 -1
  123. package/.agent-src/skills/dependency-upgrade/SKILL.md +2 -2
  124. package/.agent-src/skills/devcontainer/SKILL.md +2 -2
  125. package/.agent-src/skills/developer-like-execution/SKILL.md +1 -1
  126. package/.agent-src/skills/docker/SKILL.md +1 -1
  127. package/.agent-src/skills/dto-creator/SKILL.md +1 -1
  128. package/.agent-src/skills/estimate-ticket/SKILL.md +2 -2
  129. package/.agent-src/skills/fe-design/SKILL.md +4 -4
  130. package/.agent-src/skills/feature-planning/SKILL.md +5 -5
  131. package/.agent-src/skills/funnel-analysis/SKILL.md +1 -1
  132. package/.agent-src/skills/laravel/SKILL.md +1 -1
  133. package/.agent-src/skills/laravel-notifications/SKILL.md +5 -5
  134. package/.agent-src/skills/laravel-pennant/SKILL.md +1 -1
  135. package/.agent-src/skills/laravel-pulse/SKILL.md +4 -4
  136. package/.agent-src/skills/laravel-reverb/SKILL.md +2 -2
  137. package/.agent-src/skills/laravel-scheduling/SKILL.md +1 -1
  138. package/.agent-src/skills/migration-creator/SKILL.md +7 -7
  139. package/.agent-src/skills/multi-tenancy/SKILL.md +8 -8
  140. package/.agent-src/skills/performance-analysis/SKILL.md +3 -3
  141. package/.agent-src/skills/pest-testing/SKILL.md +6 -6
  142. package/.agent-src/skills/php-service/SKILL.md +2 -2
  143. package/.agent-src/skills/project-analysis-hypothesis-driven/SKILL.md +3 -3
  144. package/.agent-src/skills/project-analysis-react/SKILL.md +1 -1
  145. package/.agent-src/skills/project-analysis-symfony/SKILL.md +1 -1
  146. package/.agent-src/skills/project-analysis-zend-laminas/SKILL.md +2 -2
  147. package/.agent-src/skills/project-analyzer/SKILL.md +4 -4
  148. package/.agent-src/skills/prompt-optimizer/SKILL.md +108 -0
  149. package/.agent-src/skills/readme-reviewer/SKILL.md +1 -1
  150. package/.agent-src/skills/rule-writing/SKILL.md +33 -0
  151. package/.agent-src/skills/sentry-integration/SKILL.md +1 -1
  152. package/.agent-src/skills/skill-writing/SKILL.md +14 -0
  153. package/.agent-src/skills/terraform/SKILL.md +2 -2
  154. package/.agent-src/skills/terragrunt/SKILL.md +8 -8
  155. package/.agent-src/skills/test-performance/SKILL.md +5 -5
  156. package/.agent-src/skills/threat-modeling/SKILL.md +2 -2
  157. package/.agent-src/skills/token-optimizer/SKILL.md +110 -0
  158. package/.agent-src/skills/universal-project-analysis/SKILL.md +1 -1
  159. package/.agent-src/templates/AGENTS.md +1 -1
  160. package/.agent-src/templates/agent-settings.md +21 -16
  161. package/.agent-src/templates/contexts/tenant-boundaries.md +2 -2
  162. package/.agent-src/templates/contexts.md +1 -1
  163. package/.agent-src/templates/copilot-instructions.md +21 -0
  164. package/.agent-src/templates/copilot-review-instructions.md +76 -0
  165. package/.agent-src/templates/features.md +1 -1
  166. package/.agent-src/templates/rule.md +127 -0
  167. package/.claude-plugin/marketplace.json +4 -1
  168. package/AGENTS.md +32 -5
  169. package/CHANGELOG.md +69 -3
  170. package/README.md +22 -21
  171. package/config/agent-settings.template.yml +44 -10
  172. package/config/gitignore-block.txt +7 -0
  173. package/docs/architecture.md +86 -5
  174. package/docs/catalog.md +16 -6
  175. package/docs/contracts/agent-memory-contract.md +1 -1
  176. package/docs/contracts/context-paths.md +2 -1
  177. package/docs/contracts/file-ownership-matrix.json +354 -500
  178. package/docs/contracts/iron-law-overrides.txt +25 -0
  179. package/docs/contracts/kernel-membership.md +273 -0
  180. package/docs/contracts/load-context-schema.md +26 -11
  181. package/docs/contracts/pilot/agent-authority.md +24 -0
  182. package/docs/contracts/pilot/direct-answers.md +70 -0
  183. package/docs/contracts/pilot/language-and-tone.md +63 -0
  184. package/docs/contracts/rule-classification.md +170 -0
  185. package/docs/contracts/rule-router.md +153 -0
  186. package/docs/customization.md +17 -6
  187. package/docs/decisions/ADR-001-kernel-swap-deferred.md +109 -0
  188. package/docs/decisions/ADR-002-kernel-bucket-overrides.md +124 -0
  189. package/docs/decisions/ADR-rule-kernel-and-router.md +122 -0
  190. package/docs/getting-started.md +2 -2
  191. package/docs/guidelines/agent-infra/roadmap-progress-mechanics.md +176 -0
  192. package/docs/guidelines/agent-infra/rule-type-governance.md +73 -0
  193. package/docs/guidelines/agent-infra/size-and-scope.md +13 -2
  194. package/docs/guidelines/agent-infra/skill-quality-checklist.md +119 -0
  195. package/docs/guidelines/augment-portability-patterns.md +68 -0
  196. package/docs/guidelines/php/php-coding-patterns.md +62 -0
  197. package/package.json +1 -1
  198. package/scripts/_p43_bodies.py +235 -0
  199. package/scripts/_p43_compress.py +118 -0
  200. package/scripts/_p4_migrate.py +199 -0
  201. package/scripts/_pilot_council_question.py +57 -0
  202. package/scripts/_pilot_measure.py +53 -0
  203. package/scripts/ai_council/session.py +107 -5
  204. package/scripts/build_linear_digest.py +3 -5
  205. package/scripts/check_always_budget.py +39 -6
  206. package/scripts/check_compressed_paths.py +213 -0
  207. package/scripts/check_compression.py +15 -0
  208. package/scripts/check_context_paths.py +1 -0
  209. package/scripts/check_council_layout.py +105 -0
  210. package/scripts/check_council_references.py +145 -0
  211. package/scripts/check_portability.py +2 -0
  212. package/scripts/check_references.py +2 -0
  213. package/scripts/check_token_optimizer_freshness.py +131 -0
  214. package/scripts/compile_router.py +148 -0
  215. package/scripts/compress.py +219 -11
  216. package/scripts/council_cli.py +9 -5
  217. package/scripts/council_prune.py +81 -0
  218. package/scripts/count_token_optimizer_usage.sh +54 -0
  219. package/scripts/install.sh +44 -2
  220. package/scripts/iron_law_sha.py +98 -0
  221. package/scripts/lint_load_context.py +35 -5
  222. package/scripts/measure_rule_budget.py +314 -0
  223. package/scripts/prototype_lint_contradictions.py +150 -0
  224. package/scripts/schemas/rule.schema.json +55 -6
  225. package/scripts/skill_linter.py +196 -6
  226. package/scripts/smoke_path_resolution.py +93 -0
  227. package/scripts/validate_frontmatter.py +41 -1
  228. package/.agent-src/contexts/communication/rules-auto/artifact-engagement-recording-mechanics.md +0 -72
  229. package/.agent-src/contexts/communication/rules-auto/augment-portability-mechanics.md +0 -79
  230. package/.agent-src/contexts/communication/rules-auto/cli-output-handling-mechanics.md +0 -87
  231. package/.agent-src/contexts/communication/rules-auto/command-suggestion-policy-mechanics.md +0 -62
  232. package/.agent-src/contexts/communication/rules-auto/docs-sync-mechanics.md +0 -78
  233. package/.agent-src/contexts/communication/rules-auto/package-ci-checks-mechanics.md +0 -85
  234. package/.agent-src/contexts/communication/rules-auto/review-routing-awareness-mechanics.md +0 -65
  235. package/.agent-src/contexts/communication/rules-auto/roadmap-progress-sync-mechanics.md +0 -78
  236. package/.agent-src/contexts/communication/rules-auto/ui-audit-gate-mechanics.md +0 -53
  237. /package/{docs → .agent-src/contexts}/contracts/artifact-engagement-flow.md +0 -0
  238. /package/{docs → .agent-src/contexts}/contracts/command-suggestion-flow.md +0 -0
@@ -0,0 +1,25 @@
1
+ # Iron-Law-override allowlist for the kernel-budget check.
2
+ #
3
+ # Source contract: docs/contracts/kernel-membership.md § 5.1
4
+ # Enforced by: scripts/measure_rule_budget.py --kernel-budget-check
5
+ #
6
+ # A rule listed here is allowed to exceed the per-rule hard cap
7
+ # (PER_RULE_HARD = 2 500 chars) up to the override ceiling
8
+ # (PER_RULE_OVERRIDE_CEILING = 4 000 chars). Adding an entry requires a
9
+ # numbered ADR in docs/decisions/ that justifies the Iron-Law density
10
+ # (e.g. multiple Iron-Law fences, exhaustive enumeration that cannot be
11
+ # safely externalised, pre-send/pre-act gate that loses meaning if split).
12
+ #
13
+ # Format: one rule-id per line. Comments start with '#'. Blank lines OK.
14
+
15
+ # ADR-002 (2026-05-06) — kernel-bucket cap raise + per-rule overrides.
16
+ # Source: docs/decisions/ADR-002-kernel-bucket-overrides.md
17
+ # Empirical r_actual=0.795 vs r_projected=0.712. The 6 rules below carry
18
+ # Iron-Law fences + non-externalisable enumerations; further compression
19
+ # would force semantic loss. All sit ≤ 4 000-char override ceiling.
20
+ ask-when-uncertain
21
+ direct-answers
22
+ language-and-tone
23
+ no-cheap-questions
24
+ non-destructive-by-default
25
+ scope-control
@@ -0,0 +1,273 @@
1
+ ---
2
+ stability: beta
3
+ ---
4
+
5
+
6
+ # Kernel Membership — Phase 1.3 of road-to-kernel-and-router
7
+
8
+ > **Status:** active · **Stability:** beta · **Owner:** road-to-kernel-and-router P1.3
9
+ > · **Source of truth:** `docs/contracts/rule-classification.md` § 3.1
10
+ > · **Pilot artifacts:** `docs/contracts/pilot/`
11
+
12
+ Locks the kernel set and the empirical compression rate `r` derived
13
+ from the P1.3 pilot. Phase 2.2 executes against this contract.
14
+
15
+ ## § 1 — Inclusion criteria (kernel-only)
16
+
17
+ A rule belongs in the kernel iff it satisfies **all** of:
18
+
19
+ 1. **Iron-Law floor.** Carries an Iron Law fence (```...```) that
20
+ governs every reply or every action — no skill, no command, no
21
+ guideline can override it.
22
+ 2. **Mode-independent.** Fires under `off`, `auto`, `on`, every
23
+ role mode, every cost profile.
24
+ 3. **Pre-send OR pre-act gate.** Either (3a) scans the reply draft
25
+ before transmission (prose, tone, language, claim verification),
26
+ or (3b) fires before tool execution / commit / workflow progression
27
+ (safety, permission, scope). Post-hoc remediation does not
28
+ qualify.
29
+ 4. **Cross-cutting.** Applies across at least two of the categories
30
+ (behaviour, safety, tone, ask-policy) and cannot be scoped to a
31
+ sub-domain (a stack, a workflow, a single artifact type).
32
+ 5. **Ask-policy floor.** *(included by criterion #1+#4 union, but
33
+ surfaced explicitly: rules governing when/how the agent may ask
34
+ the user a question — wrong ask-behaviour breaks the agent's core
35
+ contract with the user, so `ask-when-uncertain` and
36
+ `no-cheap-questions` are first-class kernel members even though
37
+ they fire during deliberation, not strictly pre-send.)*
38
+
39
+ All other rules → `compress-and-keep` (auto-tier) or migrate to
40
+ skill / guideline per `rule-classification.md`.
41
+
42
+ > **Council amendment (P1.4).** Criterion #3 originally read "must be
43
+ > checked before the agent emits the next token". Sonnet 4.5 noted
44
+ > this conflated pre-send (scanning the draft) with pre-act (gating
45
+ > tool execution); split per #3a / #3b above. Criterion #5 surfaced
46
+ > the ask-policy floor that the original four-gate test left as an
47
+ > implicit consequence of #1+#4. Both amendments preserve the
48
+ > existing 9-rule kernel set. See
49
+ > `agents/council-sessions/20260506T044941Z-phase1-cross-check-r2.json`. <!-- council-ref-allowed: contract decision trace -->
50
+
51
+ ## § 2 — Empirical compression rate (pilot)
52
+
53
+ Pilot picks (per P1.3 algorithm: shortest / median / longest of the 9
54
+ always-rules in `rule-classification.md` § 3.1):
55
+
56
+ | pilot | original | compressed | r | per-rule cap (2.5k) | Iron-Law SHA |
57
+ |---|---:|---:|---:|---|---|
58
+ | agent-authority | 1217 | 1020 | 0.838 | OK | match (`e3b0c442…`) |
59
+ | direct-answers | 3991 | 2841 | 0.712 | +341 over | match (`ef438530…`) |
60
+ | language-and-tone | 5318 | 3602 | 0.677 | +1102 over | match (`c017b26f…`) |
61
+
62
+ | statistic | value |
63
+ |---|---:|
64
+ | mean r (outlier-skewed by lean pilot) | 0.742 |
65
+ | **median r** (locked for projection) | **0.712** |
66
+ | max r (already-lean floor) | 0.838 |
67
+ | min r (most compressible) | 0.677 |
68
+
69
+ Locked `r = 0.712` (median) for P2.2 projection. Council amendment
70
+ (P1.4) — the original lock was the **mean** (0.742), but Sonnet 4.5
71
+ flagged outlier skew: `agent-authority` at 1217 chars pre-pilot was
72
+ already near the compression floor (`r = 0.838`), pulling the mean
73
+ above the typical band. Median (0.712) is robust to the lean
74
+ outlier and sits inside the roadmap-stated 0.6–0.75 band. Risk
75
+ asymmetry confirms the choice: under-estimating compressed size
76
+ blows the 25k cap mid-P2.2 (no abort path); over-estimating just
77
+ yields headroom. GPT-4o concurred. Source:
78
+ `agents/council-sessions/20260506T044941Z-phase1-cross-check-r2.json`. <!-- council-ref-allowed: contract decision trace -->
79
+
80
+ **Pilot caveat — already-lean floor.** `agent-authority` (1217 chars
81
+ pre-pilot) yielded only `r = 0.838`. Pre-compressed rules give less
82
+ back; rules > 3k chars give more back. Future kernel additions
83
+ ≤ 1.5k chars should not assume the median — they may already be at
84
+ floor.
85
+
86
+ **Iron-Law preservation verified.** All three pilot SHAs match the
87
+ originals (whitespace-normalised, case-folded, fence content only).
88
+
89
+ ## § 3 — Projection & demotion log
90
+
91
+ Algorithm (per roadmap P1.3): `projected = current × r`; if sum > 25k,
92
+ demote largest projected, re-sum; abort after 3 rounds.
93
+
94
+ | round | candidates | sum-of-current | sum-of-projected (× 0.712) | budget |
95
+ |---:|:--|---:|---:|---|
96
+ | 0 | all 9 always-rules | 32403 | **23071** | ≤ 25 000 ✓ |
97
+
98
+ **Result: 0 demotions fired.** All 9 always-rules stay in the kernel
99
+ under median projection. Headroom = 1929 chars (= ~one median rule)
100
+ absorbs pilot variance for the 6 untested rules.
101
+
102
+ ## § 4 — Locked kernel set
103
+
104
+ | id | current | projected (× 0.712) | inclusion criterion |
105
+ |---|---:|---:|---|
106
+ | agent-authority | 1217 | 867 | (4) cross-cutting router-of-routers † |
107
+ | ask-when-uncertain | 4096 | 2916 | (1)(5) Iron Law + ask-policy floor |
108
+ | commit-policy | 2972 | 2116 | (1)(2) safety-floor Iron Law |
109
+ | direct-answers | 3991 | 2842 | (1)(3a) three Iron Laws, pre-send gate |
110
+ | language-and-tone | 5318 | 3786 | (1)(3a) language-mirror, pre-send gate |
111
+ | no-cheap-questions | 3875 | 2759 | (1)(2)(5) ask-policy floor |
112
+ | non-destructive-by-default| 4222 | 3006 | (1)(2)(3b) safety-floor Hard Floor |
113
+ | scope-control | 4368 | 3110 | (1)(3b) safety-floor permission gate |
114
+ | verify-before-complete | 2344 | 1669 | (1) completion-claim gate (post-act, pre-claim) ‡ |
115
+ | **total** | **32403** | **23071** | **≤ 25 000** ✓ |
116
+
117
+ ### § 4.1 — Post-P2.2 locked kernel (empirical, 2026-05-06)
118
+
119
+ P2.2 applied compression (imperative rewrite, examples → guidelines,
120
+ rationale → contexts) + verified Iron-Law fence preservation.
121
+ Empirical r=0.795 (vs 0.712 projected). Bucket cap raised 25k → 26k
122
+ via `docs/decisions/ADR-002-kernel-bucket-overrides.md`. Six rules
123
+ sit in the override band (≤ 4k ceiling).
124
+
125
+ | id | post-P2.2 chars | r_actual | Iron-Law SHA-256 (normalised) | per-rule status |
126
+ |---|---:|---:|---|---|
127
+ | agent-authority | 1020 | 0.838 | `e3b0c44298fc1c14…` (no fence) | OK ≤ 2.5k |
128
+ | ask-when-uncertain | 3130 | 0.764 | `6376ee72bbfd1eba…` | override (ADR-002) |
129
+ | commit-policy | 2354 | 0.792 | `e55af7f8a8053…` | OK ≤ 2.5k |
130
+ | direct-answers | 2841 | 0.712 | `ef4385308f52a8e4…` | override (ADR-002) |
131
+ | language-and-tone | 3602 | 0.677 | `c017b26f80c7aa01…` | override (ADR-002) |
132
+ | no-cheap-questions | 3238 | 0.836 | `86e023bee76a0a49…` | override (ADR-002) |
133
+ | non-destructive-by-default| 3420 | 0.810 | `17e6ed8b418d9c49…` | override (ADR-002) |
134
+ | scope-control | 3641 | 0.834 | `03afe036755c8046…` | override (ADR-002) |
135
+ | verify-before-complete | 2344 | 1.000 | `abc942cf369ed60e…` | warn (> 2k target, ≤ 2.5k cap) |
136
+ | **total** | **25590** | **0.795** | — | **≤ 26 000** ✓ |
137
+
138
+ Acceptance gates (P2.2 § Equivalence):
139
+ - ✅ `measure_rule_budget.py --kernel-budget-check` exits 0
140
+ - ✅ `iron_law_sha.py --all-kernel` confirms byte-identical fence content for all 8 fence-bearing rules
141
+ - ✅ `pytest tests/golden/` 29/29 green
142
+
143
+ Future edits to any kernel rule must keep the Iron-Law SHA stable
144
+ (or land a deliberate ADR-tracked SHA update). Cap re-raise requires
145
+ a new ADR.
146
+
147
+ † **agent-authority swap candidate (P1.4 ADR).** Sonnet 4.5 argues
148
+ this is a routing index (zero Iron Law fences, dispatches to other
149
+ kernel rules) and should be `compress-and-keep` (auto-tier-3),
150
+ freeing 867 projected chars. The Council also recommends promoting
151
+ `autonomous-execution` (5631 → 4009 projected) into kernel as a
152
+ mode-independent Band-4 authority. Net effect: 23071 − 867 + 4009 =
153
+ 26213, **over the 25k cap by 1213 chars**. **Resolved by
154
+ `docs/decisions/ADR-001-kernel-swap-deferred.md` (variant a):**
155
+ status quo through P2.2 + P3.1, swap re-evaluated as a P3.2 ADR
156
+ once the router schema and compiler ship.
157
+
158
+ ‡ **verify-before-complete borderline.** Council split criterion #3
159
+ into pre-send (#3a) / pre-act (#3b); this rule fires post-act,
160
+ pre-claim. Treated as Iron Law under criterion #1 alone (no #3
161
+ flag). Demotion candidate if the swap above forces a third
162
+ demotion round.
163
+
164
+ ## § 5 — ADR candidates (P2.1 input)
165
+
166
+ Two distinct ADR classes land in P2.1 from this contract.
167
+
168
+ ### § 5.1 — Iron-Law-override ADRs (per-rule cap)
169
+
170
+ **Council amendment (P1.4).** Per-rule cap raised from 1.5k to **2.5k**.
171
+ Both Council members concurred — the original 1.5k figure forced 8 of
172
+ 9 kernel rules into ADR territory (process theatre, not governance).
173
+ The 2.5k cap fits 7 of 9 rules without ADR; only the two largest
174
+ remain as legitimate Iron-Law-density exceptions.
175
+
176
+ Rules that land **above the 2.5k per-rule cap** even after compression
177
+ and Iron-Law preservation:
178
+
179
+ | rule | post-compression chars | over-cap (2.5k) | reason cap cannot be hit |
180
+ |---|---:|---:|---|
181
+ | direct-answers | 2842 | +342 | Three Iron-Law fences (≈ 470 chars) + severity-tiered claim table required for invented-facts gate |
182
+ | language-and-tone | 3786 | +1286 | Iron-Law fence + exhaustive user-visible-prose catalog + pre-send gate are co-load-bearing |
183
+ | autonomous-execution* | 4009 | +1509 | (*if swap accepted per § 4 †) trivial-vs-blocking matrix + opt-in detection table |
184
+
185
+ `*` = conditional on the agent-authority / autonomous-execution swap
186
+ ADR (see § 5.2).
187
+
188
+ Per roadmap § "Iron-Law over budget = ADR exception, not auto-
189
+ compress" — these surface as `iron-law-override` exceptions for P2.1
190
+ to gate behind ADRs in `docs/decisions/`.
191
+
192
+ The remaining 6 always-rules project to 1669–2916 chars post-
193
+ compression — all under the 2.5k cap with no ADR needed. P2.2
194
+ measures the real post-compression sizes; if any breach the cap, an
195
+ ADR lands per-rule.
196
+
197
+ ### § 5.2 — Kernel-set swap ADR (agent-authority ↔ autonomous-execution)
198
+
199
+ Sonnet 4.5 flagged that `agent-authority` carries no Iron-Law fence
200
+ (it is a routing index, not a governance rule) and that
201
+ `autonomous-execution` does carry a mode-independent Band-4 authority
202
+ that fires on every action decision. Swap proposal: `agent-authority`
203
+ → auto-tier-3 (router-loaded), `autonomous-execution` → kernel.
204
+
205
+ | variant | sum-projected (× 0.712) | bucket budget | per-rule ADRs |
206
+ |---|---:|---|---|
207
+ | (a) status quo (current § 4) | 23 071 | ✓ ≤ 25k | 2 (`direct-answers`, `language-and-tone`) |
208
+ | (b) swap, raise hard cap to 27k | 26 213 | ✓ ≤ 27k | 3 (+`autonomous-execution`) |
209
+ | (c) swap + demote verify-before-complete | 24 545 | ✓ ≤ 25k | 3 (+`autonomous-execution`) |
210
+
211
+ **Resolution: `docs/decisions/ADR-001-kernel-swap-deferred.md`
212
+ (accepted variant a).** Status quo preserves the locked 25k cap and
213
+ the 9-rule set through P2.2. Re-evaluation trigger fires at P3.2
214
+ once the router schema and compiler ship; at that point
215
+ `agent-authority`'s routing role becomes redundant (each kernel rule
216
+ carries its own band as frontmatter, compiled into `router.json`),
217
+ clearing the way for the swap under a fresh ADR.
218
+
219
+ ## § 6 — Abort criteria for P2.2
220
+
221
+ **Council amendment (P1.4).** Sonnet 4.5 flagged that P2.2 compresses
222
+ in place with no defined abort path. The following triggers force
223
+ revert + re-projection rather than mid-phase scramble:
224
+
225
+ - **Iron-Law drift.** Any kernel rule loses Iron-Law SHA equivalence
226
+ after compression (whitespace-normalised, case-folded fence-block
227
+ content). Single occurrence aborts the rule's compression.
228
+ - **Bucket overflow.** Kernel sum post-compression > 27 500 chars
229
+ (10 % over hard cap). Aborts the entire P2.2 phase.
230
+ - **Single-rule runaway.** Any kernel rule post-compression
231
+ > 4 000 chars. Aborts that rule's compression; flag for ADR.
232
+ - **Empirical r drift.** Median of measured r across the first 4
233
+ compressed rules deviates > 0.10 from the locked 0.712 (i.e.,
234
+ measured median outside [0.612, 0.812]). P2.2 pauses, re-locks r,
235
+ re-runs § 3 projection.
236
+
237
+ On abort: revert all P2.2 edits in scope, re-run P1.3 projection
238
+ with the trigger-relaxed parameter, lock new value, re-attempt.
239
+
240
+ ## § 7 — Verification
241
+
242
+ | check | command | acceptance |
243
+ |---|---|---|
244
+ | Pilot reproducibility | `python3 scripts/_pilot_measure.py` | r-values, sum, SHAs identical across runs |
245
+ | Iron-Law preservation | SHA-256 of fence-block content (whitespace-norm, case-fold) | all 3 pilots match originals |
246
+ | Bucket projection | `r_median × sum(always)` | ≤ 25 000 chars |
247
+ | Per-rule cap (P2.1) | `measure_rule_budget.py --kernel-budget-check` (P2 deliverable) | each ≤ 2 500 chars OR ADR |
248
+
249
+ ## § 8 — What this contract does NOT do
250
+
251
+ - It does **not** edit any source rule. P2.2 ships compression to
252
+ `.agent-src.uncompressed/rules/`.
253
+ - It does **not** lock per-rule `chars` (only the bucket sum). Per-
254
+ rule values are projections; P2.2 measures real post-compression.
255
+ - It does **not** decide kernel additions. Adding a rule to the
256
+ kernel requires an ADR per roadmap § "Sequencing-drift time-box"
257
+ and re-runs P1.3 with the new candidate.
258
+ - It does **not** specify P3 router state-machine primitives
259
+ (once / every-turn / on-mode-switch). Council flagged this as a
260
+ P3.1 deliverable dependency before any P4 migration ships.
261
+ - It does **not** specify P4 migration shapes (replace / merge /
262
+ stub / disappear). Council flagged this as a P4 deliverable spec.
263
+
264
+ ## § 9 — Provenance
265
+
266
+ | date | source | scope |
267
+ |---|---|---|
268
+ | 2026-05-06 | `scripts/measure_rule_budget.py` | baseline (32 403 chars across 9 always-rules) |
269
+ | 2026-05-06 | `docs/contracts/pilot/*.md` + `scripts/_pilot_measure.py` | empirical r distribution (3 pilots) |
270
+ | 2026-05-06 | `agents/council-sessions/20260506T044821Z-phase1-cross-check.json` | Council R1 (truncated at 1024 tokens) | <!-- council-ref-allowed: contract decision trace -->
271
+ | 2026-05-06 | `agents/council-sessions/20260506T044941Z-phase1-cross-check-r2.json` | Council R2 (3500 tokens) — locks median r, splits criterion #3, adds criterion #5, raises per-rule cap to 2.5k, defines abort criteria | <!-- council-ref-allowed: contract decision trace -->
272
+ | 2026-05-06 | this file | kernel set locked: 9 rules, projected 23 071 chars (median r = 0.712) |
273
+ | 2026-05-06 | P2.2 compression + `scripts/iron_law_sha.py --all-kernel` | empirical: 25 590 chars (r_actual = 0.795 across kernel; longer rules compress less than the pilot median) — see `docs/decisions/ADR-002-kernel-bucket-overrides.md` (KERNEL_HARD raised 25k → 26k, 6 per-rule overrides ≤ 4k ceiling, all Iron-Law SHAs preserved) |
@@ -25,13 +25,21 @@ Two keys, both optional, both top-level frontmatter:
25
25
  type: "always"
26
26
  description: "..."
27
27
  load_context: # lazy — on-demand reference list
28
- - .agent-src.uncompressed/contexts/<file>.md
29
- - agents/contexts/<file>.md
28
+ - contexts/<area>/<file>.md # logical name (canonical)
29
+ - agents/contexts/<file>.md # project-local
30
30
  load_context_eager: # opt-in eager — auto-loaded on rule fire
31
- - .agent-src.uncompressed/contexts/<file>.md
31
+ - contexts/<area>/<file>.md
32
32
  ---
33
33
  ```
34
34
 
35
+ > **Logical names only.** The `.agent-src.uncompressed/` prefix is
36
+ > rejected by the schema regex (`scripts/schemas/rule.schema.json`) and
37
+ > by `scripts/lint_load_context.py`. The compress-time rewriter
38
+ > (`scripts/compress.py::_rewrite_paths`) resolves logical names to the
39
+ > deployment-correct relative path (e.g. `../contexts/<area>/<file>.md`
40
+ > for a rule at `rules/<name>.md`). The full migration history lives
41
+ > in the archived path-fixes roadmap under `agents/roadmaps/archive/`.
42
+
35
43
  | Key | Loading | When to use |
36
44
  |---|---|---|
37
45
  | `load_context:` | **Lazy.** The agent reads the entry only when the rule's reasoning needs it. | Default. Use for everything that is "available knowledge" rather than "on every turn". |
@@ -43,15 +51,22 @@ opt-in and budget-gated.
43
51
 
44
52
  ## Path rules
45
53
 
46
- - Paths are repo-root relative.
54
+ - Logical names rooted at the source. The rewriter resolves them at
55
+ compress time.
47
56
  - Paths MUST end in `.md`.
48
- - Allowed roots: `.agent-src.uncompressed/contexts/`, `agents/contexts/`,
49
- `.agent-src/contexts/` (compressed mirror). Any other root → linter
50
- error.
51
- - A rule MAY reference contexts under either tree, but a
52
- `.agent-src.uncompressed/` rule SHOULD NOT eager-load an
53
- `agents/contexts/` file (project-local leak into shared package).
54
- Linter warns on this combination.
57
+ - Allowed roots:
58
+ - `contexts/<area>/<file>.md` canonical logical name (resolves
59
+ against `.agent-src.uncompressed/`).
60
+ - `agents/contexts/<file>.md` project-local material (consumer
61
+ repo only).
62
+ - `.agent-src/contexts/<file>.md` compressed mirror; tolerated
63
+ defensively, not authored.
64
+ - The `.agent-src.uncompressed/` prefix is **rejected** by the schema
65
+ regex and by `lint_load_context.py` with a remediation hint pointing
66
+ at the canonical logical name.
67
+ - A rule MAY reference contexts under either tree, but a package-shipped
68
+ rule SHOULD NOT eager-load an `agents/contexts/` file (project-local
69
+ leak into shared package). Linter warns on this combination.
55
70
  - A context file may itself declare `load_context:` (chain reasoning).
56
71
  The linter rejects cycles.
57
72
 
@@ -0,0 +1,24 @@
1
+ ---
2
+ type: "always"
3
+ tier: "3"
4
+ description: "Priority Index for the four authority rules — Hard Floor → Permission Gate → Commit Default → Trivial-vs-Blocking; read first, route to canonical rule"
5
+ alwaysApply: true
6
+ source: package
7
+ ---
8
+
9
+ # Agent Authority — Priority Index
10
+
11
+ Four rules answer **"may the agent do this autonomously?"** Higher band wins.
12
+
13
+ | Band | Trigger | Canonical rule |
14
+ |---|---|---|
15
+ | **1. Hard Floor** | Prod-trunk merge · deploy · push · prod data/infra · whimsical bulk deletion · bulk-deletion or infra commit | [`non-destructive-by-default`](non-destructive-by-default.md) |
16
+ | **2. Permission Gate** | Git op · branch / PR / tag · architectural or library change · scope expansion | [`scope-control`](scope-control.md) |
17
+ | **3. Commit Default** | About to commit — never, unless one of four exceptions fires | [`commit-policy`](commit-policy.md) |
18
+ | **4. Trivial-vs-Blocking** | Routine workflow question — act or ask | [`autonomous-execution`](autonomous-execution.md) |
19
+
20
+ ## Rules
21
+
22
+ - Hard Floor wins, always — autonomy / roadmap / standing instruction never lift.
23
+ - Higher band wins on conflict — commit exception ≠ Hard Floor override; scope permission ≠ commit override.
24
+ - Unsure → [`ask-when-uncertain`](ask-when-uncertain.md).
@@ -0,0 +1,70 @@
1
+ ---
2
+ type: "always"
3
+ tier: "3"
4
+ description: "Always — direct, unembellished answers. No flattery, no invented facts (verify load-bearing claims, otherwise ask). Emojis only as functional markers. Brevity is the default."
5
+ alwaysApply: true
6
+ source: package
7
+ ---
8
+
9
+ # Direct Answers
10
+
11
+ Three Iron Laws govern every reply.
12
+
13
+ ## Iron Law 1 — No Flattery
14
+
15
+ ```
16
+ NEVER OPEN WITH "GREAT QUESTION", "FASCINATING", "EXCELLENT POINT".
17
+ NEVER PRAISE THE USER'S IDEA TO MAKE THEM HAPPY.
18
+ ANSWER THE SUBSTANCE. SHIP THE TRUTH.
19
+ ```
20
+
21
+ - No positive-adjective opener about user / question / idea / work.
22
+ - No subjective judgment on user code unless evaluation was asked.
23
+ - "Good catch" / "you're right" only when literally true.
24
+ - Mistakes — one-sentence acknowledge, switch behavior, no apology theatre.
25
+
26
+ ## Iron Law 2 — No Invented Facts (severity-tiered)
27
+
28
+ ```
29
+ DO NOT CLAIM WHAT YOU HAVEN'T VERIFIED.
30
+ THE MORE LOAD-BEARING THE CLAIM, THE HARDER YOU VERIFY.
31
+ WHEN VERIFICATION IS NOT WORTH THE COST → ASK.
32
+ ```
33
+
34
+ | Severity | Action |
35
+ |---|---|
36
+ | **High** — load-bearing (paths, signatures, versions, security, "this passes") | Verify with `view` / `grep` / `codebase-retrieval` / fresh output. Too expensive → ask. |
37
+ | **Medium** — project-shape (conventions, file location) | One-tool-call verify, else hedge: *"I'd guess X — not checked"*. |
38
+ | **Low** — well-known idioms | Inference OK; mark as inference if not 100% sure. |
39
+
40
+ Override: "just guess" / "rough estimate" / "skip verify" → drop to Low for that turn.
41
+ Examples + hedge patterns: [`asking-and-brevity-examples § severity`](../../docs/guidelines/agent-infra/asking-and-brevity-examples.md#direct-answers--severity-tiered-claim-examples).
42
+
43
+ ## Iron Law 3 — Brevity by Default
44
+
45
+ ```
46
+ THE SHORTEST REPLY THAT FULLY ANSWERS THE QUESTION IS THE RIGHT REPLY.
47
+ LONG ANSWERS ARE A FAILURE MODE, NOT A SIGN OF EFFORT.
48
+ ```
49
+
50
+ - Skip restating the question; skip "Let me…" intent announcements.
51
+ - Skip explaining tool use — the call result speaks.
52
+ - Skip post-hoc summary unless rechecking a decision.
53
+ - Multi-step → bullets. One-true-answer → one sentence.
54
+
55
+ Never overrides `user-interaction` (numbered options stay) or command-mandated steps.
56
+
57
+ ## Emoji Scope — functional markers only
58
+
59
+ **Whitelist:** mode markers (`role-mode-adherence`); CLI status `❌` / `✅` / `⚠️`; roadmap checkboxes `[x]` / `[~]` / `[-]`.
60
+ **Blacklist:** opening flair (✨, 🚀, 🎉, 💡, 🔥, 👍); empathy (❤️, 🤗, 😊); section dividers; reaction emojis. Unsure → blacklist.
61
+
62
+ ## Failure modes & examples
63
+
64
+ Trigger phrases + correction pattern: [`asking-and-brevity-examples § failure-modes`](../../docs/guidelines/agent-infra/asking-and-brevity-examples.md#direct-answers--failure-modes-the-user-will-call-out).
65
+ Pattern Memory (wrong / right / why): [`direct-answers-demos`](../../docs/guidelines/agent-infra/direct-answers-demos.md).
66
+ Outcome baseline: [`tests/golden/outcomes/direct_answers.json`](../../tests/golden/outcomes/direct_answers.json).
67
+
68
+ ## Interactions
69
+
70
+ `language-and-tone` · `ask-when-uncertain` · `think-before-action` · `verify-before-complete` · `token-efficiency` · `user-interaction` (overrides brevity).
@@ -0,0 +1,63 @@
1
+ ---
2
+ type: "always"
3
+ tier: "3"
4
+ description: "Language and tone — informal German Du, English code comments, .md files always English"
5
+ alwaysApply: true
6
+ source: package
7
+ ---
8
+
9
+ # Language and Tone
10
+
11
+ ## Iron Law — mirror the user's language, ALWAYS
12
+
13
+ ```
14
+ MIRROR THE LANGUAGE OF THE USER'S LAST/CURRENT MESSAGE. ALWAYS.
15
+ THE FIRST TOKEN OF EVERY REPLY MUST BE IN THAT LANGUAGE.
16
+ EVERY USER-VISIBLE TOKEN MUST BE IN THAT LANGUAGE — NO EXCEPTIONS.
17
+ A REPLY IN THE WRONG LANGUAGE IS A RULE VIOLATION, NOT A SLIP.
18
+ NO MOMENTUM EXCEPTION. NO TECHNICAL-CONTEXT EXCEPTION.
19
+ NO "SWITCH MID-PARAGRAPH". NO "LAST 20 TURNS WERE ENGLISH".
20
+ NO "INTER-TOOL COMMENT IS JUST A NOTE" EXCEPTION.
21
+ ```
22
+
23
+ Trigger = user's last **chat message**. Not turn count, open file, roadmap, ticket, codebase, tool output, prior reply, or files just edited. Short German (`3`, `weiter`, `mach das`) after many English turns flips the reply to German.
24
+
25
+ ## User-visible prose — every token mirrors
26
+
27
+ Applies to opening / closing line, **inter-tool commentary** (`Found it`, `Let me check`, `OK`, `Alright`, `Here's`, `So`), section headings, table headers and cells, bullet text, blockquote text, status lines, and the `Recommendation:` / `Empfehlung:` label under numbered-options blocks (per [`user-interaction`](user-interaction.md) Iron Law 1). Wrong label = violation.
28
+
29
+ Stays in source language: code blocks, command output, file contents, quoted tool output, frontmatter keys, file paths, identifier names, log lines.
30
+
31
+ ## Pre-send gate — MANDATORY
32
+
33
+ 1. **Detect** — language of user's last chat message. Mixed → dominant; tie → German.
34
+ 2. **Scan** — every user-visible token per catalog above.
35
+ 3. **Rewrite** — wrong-language token → rewrite the whole reply.
36
+ 4. **Confirm** — first sentence in target language; recommendation label matches; no English filler-phrase opener (`Let me`, `Now`, `Found`, `Confirmed`, `OK`, `Alright`, `Here's`, `So`) when target is German; no German opener (`Lass mich`, `Jetzt`, `Gefunden`, `Bestätigt`) when target is English.
37
+
38
+ ## Spelled out
39
+
40
+ - German → informal "Du" (never "Sie"); capitalized at sentence start, lowercase otherwise.
41
+ - Code blocks / command output / file contents / quoted tool output stay native; only surrounding prose mirrors.
42
+ - Numbered options — `.md` source English; rendered reply translated at runtime.
43
+
44
+ ## Slip handling
45
+
46
+ Acknowledge **once** in the correct language ("Entschuldigung" / "Sorry"). Switch on the same reply. No re-explain in wrong language; no "from now on" promise.
47
+
48
+ Examples + wrong-vs-correct: [`language-and-tone-examples`](../../docs/guidelines/agent-infra/language-and-tone-examples.md).
49
+
50
+ ## Other language rules
51
+
52
+ - Code comments in English.
53
+ - `.md` files in English (see below). Translate existing German `.md` files when touched.
54
+ - Two spaces after `❌`, `✅`, `⚠️` in CLI; one space for other icons.
55
+ - One blank line max; no double/triple blanks. File ends with exactly one newline.
56
+
57
+ ## `.md` files — ALWAYS English
58
+
59
+ Every text inside `.md` under `.augment/`, `.agent-src/`, `.agent-src.uncompressed/`, `agents/`: headings, paragraphs, bullets, option labels, prompts, placeholders, ASCII labels, table headers / content. Agent translates at runtime.
60
+
61
+ **Labeled-anchor exception** — quoting German inside English prose is forbidden. Either translate, OR use a labeled `DE: … · EN: …` anchor block (only allowed location for German prose).
62
+
63
+ **Detection heuristic** before saving: scan for umlauts (`ä`, `ö`, `ü`, `Ä`, `Ö`, `Ü`, `ß`) outside fenced code / paths / anchor blocks; German function words (`für`, `nicht`, `dass`, `wenn`, `sollte`, `werden`, `arbeite`, `selbstständig`, `jetzt`, `einfach`, `weiter`, `lösche`, `frag`, `schreib`, `mach`); non-English quoted phrases in body text. Hit → translate or move to `DE: … · EN: …` block.