@event4u/agent-config 9.26.0 → 9.28.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 (252) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/AGENTS.md +12 -11
  3. package/CHANGELOG.md +134 -207
  4. package/README.md +1 -1
  5. package/dist/agent-src/commands/analyze/conformance.md +43 -0
  6. package/dist/agent-src/commands/roadmap/next.md +65 -3
  7. package/dist/agent-src/contexts/execution/orchestration-telemetry.md +10 -3
  8. package/dist/agent-src/rules/active-remediation.md +2 -0
  9. package/dist/agent-src/rules/analysis-skill-routing.md +2 -0
  10. package/dist/agent-src/rules/architecture.md +2 -0
  11. package/dist/agent-src/rules/artifact-drafting-protocol.md +2 -0
  12. package/dist/agent-src/rules/artifact-engagement-recording.md +6 -1
  13. package/dist/agent-src/rules/augment-edit-discipline.md +2 -0
  14. package/dist/agent-src/rules/autonomous-execution.md +3 -1
  15. package/dist/agent-src/rules/brand-consistency.md +2 -0
  16. package/dist/agent-src/rules/brand-source-of-truth.md +35 -6
  17. package/dist/agent-src/rules/broken-access-control.md +2 -0
  18. package/dist/agent-src/rules/cli-output-handling.md +2 -0
  19. package/dist/agent-src/rules/code-comment-discipline.md +2 -0
  20. package/dist/agent-src/rules/code-provenance.md +2 -0
  21. package/dist/agent-src/rules/command-suggestion-policy.md +2 -0
  22. package/dist/agent-src/rules/commit-conventions.md +2 -0
  23. package/dist/agent-src/rules/communication-through-line.md +2 -0
  24. package/dist/agent-src/rules/content-quoting-floor.md +2 -0
  25. package/dist/agent-src/rules/context-hygiene.md +13 -1
  26. package/dist/agent-src/rules/copilot-routing.md +2 -0
  27. package/dist/agent-src/rules/council-availability.md +93 -0
  28. package/dist/agent-src/rules/cross-source-consistency.md +5 -0
  29. package/dist/agent-src/rules/decision-revisit-gate.md +2 -0
  30. package/dist/agent-src/rules/delegation-policy.md +31 -5
  31. package/dist/agent-src/rules/design-fidelity.md +5 -0
  32. package/dist/agent-src/rules/design-review-after-ui-write.md +4 -0
  33. package/dist/agent-src/rules/devcontainer-routing.md +2 -0
  34. package/dist/agent-src/rules/doc-screenshot-hygiene.md +2 -0
  35. package/dist/agent-src/rules/docker-commands.md +2 -0
  36. package/dist/agent-src/rules/domain-adoption-policy.md +2 -0
  37. package/dist/agent-src/rules/domain-safety-disclaimer.md +2 -0
  38. package/dist/agent-src/rules/domain-safety-pii.md +2 -0
  39. package/dist/agent-src/rules/domain-safety-retention.md +2 -0
  40. package/dist/agent-src/rules/downstream-changes.md +2 -0
  41. package/dist/agent-src/rules/engineering-safety-floor.md +2 -0
  42. package/dist/agent-src/rules/evaluator-independence.md +14 -3
  43. package/dist/agent-src/rules/external-code-graph-interop.md +4 -1
  44. package/dist/agent-src/rules/external-reference-deep-dive.md +2 -0
  45. package/dist/agent-src/rules/fast-path-marker-visibility.md +2 -0
  46. package/dist/agent-src/rules/finance-safety-floor.md +3 -1
  47. package/dist/agent-src/rules/framework-neutrality-in-generic-skills.md +2 -0
  48. package/dist/agent-src/rules/git-history-discipline.md +3 -1
  49. package/dist/agent-src/rules/guidelines.md +2 -0
  50. package/dist/agent-src/rules/history-discipline.md +5 -1
  51. package/dist/agent-src/rules/icon-consistency.md +2 -0
  52. package/dist/agent-src/rules/image-likeness-and-rights.md +2 -0
  53. package/dist/agent-src/rules/improve-before-implement.md +2 -0
  54. package/dist/agent-src/rules/invite-challenge.md +2 -0
  55. package/dist/agent-src/rules/laravel-routing.md +2 -0
  56. package/dist/agent-src/rules/laravel-translations.md +2 -0
  57. package/dist/agent-src/rules/legal-safety-floor.md +3 -1
  58. package/dist/agent-src/rules/lethal-trifecta-guard.md +2 -0
  59. package/dist/agent-src/rules/linked-projects-onboarding-gate.md +2 -0
  60. package/dist/agent-src/rules/low-impact-corpus-privacy-floor.md +2 -0
  61. package/dist/agent-src/rules/markdown-safe-codeblocks.md +2 -0
  62. package/dist/agent-src/rules/media-governance-routing.md +2 -0
  63. package/dist/agent-src/rules/media-sync-ground-truth.md +2 -0
  64. package/dist/agent-src/rules/minimal-safe-diff.md +2 -0
  65. package/dist/agent-src/rules/missing-tool-handling.md +2 -0
  66. package/dist/agent-src/rules/model-recommendation.md +2 -0
  67. package/dist/agent-src/rules/no-attribution-footers.md +2 -0
  68. package/dist/agent-src/rules/no-decorative-emojis-in-git-surfaces.md +2 -0
  69. package/dist/agent-src/rules/no-pr-progress-comments.md +5 -1
  70. package/dist/agent-src/rules/no-roadmap-references.md +2 -0
  71. package/dist/agent-src/rules/notes-first-reasoning.md +2 -0
  72. package/dist/agent-src/rules/onboarding-gate.md +5 -1
  73. package/dist/agent-src/rules/output-discipline.md +2 -0
  74. package/dist/agent-src/rules/package-ci-checks.md +2 -0
  75. package/dist/agent-src/rules/persona-governance.md +2 -0
  76. package/dist/agent-src/rules/php-coding.md +2 -0
  77. package/dist/agent-src/rules/prefer-enums-over-literals.md +2 -0
  78. package/dist/agent-src/rules/preservation-guard.md +2 -0
  79. package/dist/agent-src/rules/provider-lifecycle-discipline.md +2 -0
  80. package/dist/agent-src/rules/question-not-instruction.md +2 -0
  81. package/dist/agent-src/rules/reviewer-awareness.md +2 -0
  82. package/dist/agent-src/rules/roadmap-ci-steps-policy.md +6 -1
  83. package/dist/agent-src/rules/roadmap-progress-sync.md +2 -0
  84. package/dist/agent-src/rules/role-mode-adherence.md +3 -1
  85. package/dist/agent-src/rules/rule-type-governance.md +2 -0
  86. package/dist/agent-src/rules/runtime-safety.md +2 -0
  87. package/dist/agent-src/rules/scale-discipline.md +5 -1
  88. package/dist/agent-src/rules/secret-vcs-guard.md +2 -0
  89. package/dist/agent-src/rules/security-sensitive-stop.md +2 -0
  90. package/dist/agent-src/rules/self-repair-loop.md +103 -0
  91. package/dist/agent-src/rules/senior-engineering-discipline.md +2 -0
  92. package/dist/agent-src/rules/session-canary.md +62 -19
  93. package/dist/agent-src/rules/settings-ask-protocol.md +4 -0
  94. package/dist/agent-src/rules/size-enforcement.md +2 -0
  95. package/dist/agent-src/rules/skill-improvement-trigger.md +2 -0
  96. package/dist/agent-src/rules/skill-quality.md +2 -0
  97. package/dist/agent-src/rules/slash-command-routing-policy.md +2 -0
  98. package/dist/agent-src/rules/source-confidentiality.md +2 -0
  99. package/dist/agent-src/rules/source-discovery-gate.md +2 -0
  100. package/dist/agent-src/rules/source-of-truth.md +2 -0
  101. package/dist/agent-src/rules/spreadsheet-source-quality.md +2 -0
  102. package/dist/agent-src/rules/strategy-safety-floor.md +3 -1
  103. package/dist/agent-src/rules/symfony-routing.md +2 -0
  104. package/dist/agent-src/rules/think-before-action.md +2 -0
  105. package/dist/agent-src/rules/token-budget-discipline.md +5 -1
  106. package/dist/agent-src/rules/token-efficiency.md +2 -0
  107. package/dist/agent-src/rules/token-optimizer-maintenance.md +2 -0
  108. package/dist/agent-src/rules/tool-safety.md +7 -1
  109. package/dist/agent-src/rules/ui-audit-gate.md +4 -0
  110. package/dist/agent-src/rules/untrusted-input-defense.md +2 -0
  111. package/dist/agent-src/rules/upstream-proposal.md +2 -0
  112. package/dist/agent-src/rules/user-interaction.md +2 -0
  113. package/dist/agent-src/rules/user-interrupt-priority.md +2 -0
  114. package/dist/agent-src/skills/adversarial-review/SKILL.md +1 -1
  115. package/dist/agent-src/skills/analysis-autonomous-mode/SKILL.md +1 -1
  116. package/dist/agent-src/skills/performance-analysis/SKILL.md +1 -1
  117. package/dist/agent-src/skills/persona-improvement/SKILL.md +1 -1
  118. package/dist/agent-src/skills/project-analyzer/SKILL.md +1 -1
  119. package/dist/agent-src/skills/security-audit/SKILL.md +1 -1
  120. package/dist/agent-src/skills/sequential-thinking/SKILL.md +1 -1
  121. package/dist/agent-src/skills/skill-improvement-pipeline/SKILL.md +1 -1
  122. package/dist/agent-src/skills/universal-project-analysis/SKILL.md +1 -1
  123. package/dist/agent-src/templates/AGENTS.md +6 -10
  124. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  125. package/dist/cli/registry.js +9 -0
  126. package/dist/cli/registry.js.map +1 -1
  127. package/dist/cli-delegate/chunk-22GCIJ2O.js +270 -0
  128. package/dist/cli-delegate/{chunk-BSLUHV2F.js → chunk-2BE5I2MN.js} +156 -141
  129. package/dist/cli-delegate/{chunk-AIIUU73N.js → chunk-7OMQCH4V.js} +1 -1
  130. package/dist/cli-delegate/{chunk-HJ6DAJHR.js → chunk-GB2FSUEE.js} +57 -7
  131. package/dist/cli-delegate/{chunk-WR6GTRHJ.js → chunk-JXARCGVN.js} +3 -3
  132. package/dist/cli-delegate/{chunk-SJQMJI7M.js → chunk-PQSAQKHW.js} +467 -305
  133. package/dist/cli-delegate/chunk-REKCMYOU.js +2991 -0
  134. package/dist/cli-delegate/cmd_analyze_session.js +1 -1
  135. package/dist/cli-delegate/cmd_brand_status.js +134 -0
  136. package/dist/cli-delegate/cmd_conformance.js +7 -7
  137. package/dist/cli-delegate/cmd_converge.js +3 -3
  138. package/dist/cli-delegate/cmd_doctor.js +4 -4
  139. package/dist/cli-delegate/cmd_explain.js +80 -330
  140. package/dist/cli-delegate/cmd_export.js +5 -5
  141. package/dist/cli-delegate/cmd_fleet.js +3 -3
  142. package/dist/cli-delegate/cmd_handoff.js +2 -2
  143. package/dist/cli-delegate/cmd_mcp_available.js +433 -0
  144. package/dist/cli-delegate/cmd_migrate.js +3 -3
  145. package/dist/cli-delegate/cmd_packs_active.js +153 -0
  146. package/dist/cli-delegate/cmd_preflight.js +1 -1
  147. package/dist/cli-delegate/cmd_prune.js +5 -5
  148. package/dist/cli-delegate/cmd_route_audit.js +8 -8
  149. package/dist/cli-delegate/cmd_route_explain.js +4 -4
  150. package/dist/cli-delegate/cmd_settings_get.js +272 -0
  151. package/dist/cli-delegate/cmd_settings_migrate.js +5 -5
  152. package/dist/cli-delegate/cmd_settings_set.js +7 -2967
  153. package/dist/cli-delegate/cmd_sync.js +5 -5
  154. package/dist/cli-delegate/cmd_uninstall.js +5 -5
  155. package/dist/cli-delegate/cmd_update.js +4 -4
  156. package/dist/cli-delegate/cmd_upgrade.js +4 -4
  157. package/dist/cli-delegate/cmd_validate.js +5 -5
  158. package/dist/cli-delegate/cmd_versions.js +4 -4
  159. package/dist/discovery/deprecation-report.md +1 -1
  160. package/dist/discovery/discovery-manifest.json +184 -124
  161. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  162. package/dist/discovery/discovery-manifest.summary.md +3 -3
  163. package/dist/discovery/orphan-report.md +1 -1
  164. package/dist/discovery/packs.json +7 -5
  165. package/dist/discovery/trust-report.md +11 -11
  166. package/dist/discovery/workspaces.json +6 -4
  167. package/dist/hooks/dispatch.js +9080 -5701
  168. package/dist/install/install.mjs +698 -508
  169. package/dist/mcp/registry-manifest.json +3 -3
  170. package/dist/mcp/server.json +2 -2
  171. package/dist/mcp/server.mjs +698 -437
  172. package/dist/router.json +1 -1
  173. package/dist/scripts/_lib/agent_settings.js +80 -15
  174. package/dist/scripts/_lib/agent_settings.js.map +1 -1
  175. package/dist/scripts/condense.js +33 -2
  176. package/dist/scripts/condense.js.map +1 -1
  177. package/dist/server/io/yamlIO.js +85 -0
  178. package/dist/server/io/yamlIO.js.map +1 -1
  179. package/dist/server/routes/settings.js +1 -12
  180. package/dist/server/routes/settings.js.map +1 -1
  181. package/dist/server/routes/wizard.js +52 -2
  182. package/dist/server/routes/wizard.js.map +1 -1
  183. package/dist/shared/settingsCarveOut.js +118 -0
  184. package/dist/shared/settingsCarveOut.js.map +1 -0
  185. package/dist/shared/settingsSurface.js +7 -1
  186. package/dist/shared/settingsSurface.js.map +1 -1
  187. package/dist/ui/assets/index-DmR0mbk4.js.map +1 -1
  188. package/docs/contracts/settings-classes.md +29 -8
  189. package/docs/guidelines/agent-infra/memory-access.md +14 -3
  190. package/package.json +1 -1
  191. package/src/agent-src/templates/AGENTS.md +6 -10
  192. package/src/config/budgets.yml +29 -0
  193. package/src/config/evaluator-budgets.json +4 -4
  194. package/src/config/gate-coverage.yml +26 -0
  195. package/src/scripts/_cli/cmd_brand_status.ts +174 -0
  196. package/src/scripts/_cli/cmd_doctor.ts +6 -21
  197. package/src/scripts/_cli/cmd_mcp_available.ts +266 -0
  198. package/src/scripts/_cli/cmd_packs_active.ts +225 -0
  199. package/src/scripts/_cli/cmd_settings_get.ts +324 -0
  200. package/src/scripts/_dispatch.bash +75 -0
  201. package/src/scripts/_lib/agent_settings.ts +82 -16
  202. package/src/scripts/_lib/carrier_divergence.ts +135 -0
  203. package/src/scripts/_lib/git_common_dir.ts +128 -0
  204. package/src/scripts/_lib/host_capability.ts +84 -1
  205. package/src/scripts/_lib/obligation_frequency.ts +391 -0
  206. package/src/scripts/_lib/prompt_shape.ts +88 -0
  207. package/src/scripts/_lib/review_skipped_record.ts +102 -0
  208. package/src/scripts/_lib/rule_layer_overlap.ts +254 -0
  209. package/src/scripts/_lib/self_repair.ts +342 -0
  210. package/src/scripts/_lib/self_repair_store.ts +100 -0
  211. package/src/scripts/_lib/session_register.ts +361 -0
  212. package/src/scripts/_lib/transcript_entry.ts +80 -0
  213. package/src/scripts/check_branch_freshness.ts +255 -0
  214. package/src/scripts/check_council_config_location.ts +125 -1
  215. package/src/scripts/check_enforcement_coverage.ts +192 -7
  216. package/src/scripts/check_rule_projection_integrity.ts +364 -0
  217. package/src/scripts/check_standing_rule_delivery.ts +314 -0
  218. package/src/scripts/condense.ts +36 -2
  219. package/src/scripts/config/profiles.ts +13 -3
  220. package/src/scripts/conformance_scan.ts +307 -24
  221. package/src/scripts/council_availability_hook.ts +188 -0
  222. package/src/scripts/council_cli.ts +126 -7
  223. package/src/scripts/generate_settings_reference.ts +232 -0
  224. package/src/scripts/hook_manifest.yaml +155 -33
  225. package/src/scripts/hooks/block_no_verify.ts +95 -3
  226. package/src/scripts/hooks/block_unauthorized_git.ts +217 -2
  227. package/src/scripts/hooks/concern_registry.ts +12 -0
  228. package/src/scripts/hooks/delegation_nudge_hook.ts +450 -0
  229. package/src/scripts/hooks/end_review_nudge_hook.ts +726 -0
  230. package/src/scripts/hooks/orchestration_record_hook.ts +342 -0
  231. package/src/scripts/install.ts +151 -0
  232. package/src/scripts/language_mirror_hook.ts +49 -6
  233. package/src/scripts/measure_scope_dedup.ts +19 -13
  234. package/src/scripts/onboarding_gate_hook.ts +40 -1
  235. package/src/scripts/orchestration_backfill.ts +354 -0
  236. package/src/scripts/orchestration_record.ts +4 -1
  237. package/src/scripts/preamble_byte_census.ts +9 -20
  238. package/src/scripts/release.ts +142 -36
  239. package/src/scripts/report_carrier_divergence.ts +364 -0
  240. package/src/scripts/report_skill_activation.ts +257 -0
  241. package/src/scripts/report_skill_obligation_violations.ts +579 -0
  242. package/src/scripts/routing_doctor.ts +77 -6
  243. package/src/scripts/schemas/rule.schema.json +5 -0
  244. package/src/scripts/self_repair_cli.ts +240 -0
  245. package/src/scripts/self_repair_hook.ts +241 -0
  246. package/src/scripts/session_canary_hook.ts +35 -3
  247. package/src/scripts/session_register_hook.ts +288 -0
  248. package/src/scripts/sessions_cli.ts +140 -0
  249. package/src/scripts/validate_frontmatter.ts +68 -0
  250. package/src/server/io/yamlIO.ts +87 -0
  251. package/src/shared/settingsCarveOut.ts +143 -0
  252. package/src/shared/settingsSurface.ts +7 -1
@@ -0,0 +1,143 @@
1
+ /**
2
+ * The always-written carve-out set for the sparse settings file.
3
+ *
4
+ * `road-to-zero-ceremony-settings` Phase 3. The user's global settings file
5
+ * becomes a sparse record of decisions actually made, which is safe only while
6
+ * *key absent* resolves exactly like *key set to the template default*.
7
+ *
8
+ * An audit of every reader found that is NOT universally true. For the keys
9
+ * below a reader deliberately resolves an absent key to something other than
10
+ * the template's default, so omitting them from a fresh install's file would
11
+ * silently change behaviour. They are written explicitly instead, with their
12
+ * template value, and stamped `package-default` in the provenance sidecar so
13
+ * the file never claims the user decided them.
14
+ *
15
+ * This is the blocker's "carved out" branch. The alternative branch — "fixed at
16
+ * its reader" — was rejected for the `projection.*` family because the
17
+ * divergence there is the documented upgrade-safety contract
18
+ * (`agent-settings.template.yml`: *"a missing key also still means legacy-all,
19
+ * so only fresh installs get the scoped default"*). Changing those readers
20
+ * would flip existing 5.x installs from `legacy-all` to `scoped`, which is the
21
+ * silent narrowing the contract exists to prevent.
22
+ *
23
+ * Pure module — no I/O. The VALUES are not duplicated here; only the key paths
24
+ * and the reason. The emitter reads each value out of the template, so this
25
+ * list cannot drift from the defaults it is protecting.
26
+ *
27
+ * @see docs/contracts/settings-classes.md
28
+ */
29
+
30
+ /** One key whose absence is not equivalent to its template default. */
31
+ export interface CarveOutKey {
32
+ /** Dotted path into the settings tree. */
33
+ key: string;
34
+ /** The reader that diverges, as `file:line`, so the claim is checkable. */
35
+ reader: string;
36
+ /** What an ABSENT key resolves to at that reader. */
37
+ absentResolvesTo: string;
38
+ /** Why it is carved out rather than fixed at the reader. */
39
+ reason: string;
40
+ }
41
+
42
+ export const SETTINGS_CARVE_OUT: readonly CarveOutKey[] = [
43
+ {
44
+ key: 'projection.mode',
45
+ reader: 'src/scripts/install.ts:3409 _resolve_scoped_projection',
46
+ absentResolvesTo: 'legacy-all',
47
+ reason:
48
+ 'The template fallback applies only when NO global settings file exists. '
49
+ + 'Once a file exists, an absent key means legacy-all by documented contract, '
50
+ + 'so an existing install is never silently narrowed on upgrade.',
51
+ },
52
+ {
53
+ key: 'projection.rule_workspaces',
54
+ reader: 'src/install/rule_scope.ts:96 ruleScopeFromSettings',
55
+ absentResolvesTo: 'null — LEGACY_ALL, i.e. every rule ships including maintainer-only ones',
56
+ reason:
57
+ 'Same upgrade contract as projection.mode, and the failure is louder: '
58
+ + 'an absent list widens the projection instead of narrowing it.',
59
+ },
60
+ {
61
+ key: 'subagents.auto',
62
+ reader: 'src/scripts/routing_doctor.ts:206',
63
+ absentResolvesTo: 'ask',
64
+ reason:
65
+ 'The reader falls back to `ask` while the template ships `on`. Carved out '
66
+ + 'rather than fixed at the reader because the doctor reports what the '
67
+ + 'RESOLVED configuration is; changing its fallback would make the report '
68
+ + 'disagree with what the other readers actually do.',
69
+ },
70
+ {
71
+ key: 'discipline_profile',
72
+ reader: 'work_engine/_lib/agent_settings.ts:1263',
73
+ absentResolvesTo: 'essential, unconditionally',
74
+ reason:
75
+ 'The template ships `auto`, which resolves to `off` on any measured-null model, '
76
+ + 'any non-Claude host, and any host exposing no model id. Absent skips that '
77
+ + 'resolution entirely and loads the essential tier everywhere.',
78
+ },
79
+ {
80
+ key: 'chat_history.frequency',
81
+ reader: 'src/scripts/chat_history.ts:1140',
82
+ absentResolvesTo: 'per_phase',
83
+ reason:
84
+ 'Canonical substitution is `per_turn`. Absent gives coarser capture than the '
85
+ + 'shipped default — an audit-thinning change, which the class contract\'s own '
86
+ + 'test 8 (what can the attacker HIDE) names as the severe direction.',
87
+ },
88
+ {
89
+ key: 'profile.id',
90
+ reader: 'src/scripts/config/profiles.ts:221 resolve_profile',
91
+ absentResolvesTo:
92
+ 'the id `developer`, but a DEGRADED profile — packs: [], personas: [], hints: []',
93
+ reason:
94
+ 'Exactly the projection.mode shape: the template default is honoured only when '
95
+ + 'no settings file exists. With a file present the id resolves but its profile '
96
+ + 'body does not load, so the install silently loses every pack and persona.',
97
+ },
98
+ {
99
+ key: 'quality.local_auto_run',
100
+ reader: 'src/scripts/lint_roadmap_ci_steps.ts:106',
101
+ absentResolvesTo: 'true — which DISABLES the CI-step gate',
102
+ reason:
103
+ 'Inverted polarity, and the most dangerous row in the set: the template ships '
104
+ + '`false`, which ARMS the gate. Omitting the key would disarm a quality gate '
105
+ + 'for every fresh install while the reference page says it is on.',
106
+ },
107
+ {
108
+ key: 'onboarding.onboarded',
109
+ reader: 'src/scripts/onboarding_gate_hook.ts:99',
110
+ absentResolvesTo: 'gate skipped, as if onboarding had already completed',
111
+ reason:
112
+ 'Absent behaves like `onboarded: true`, not like the template default `false`. '
113
+ + 'Omitting it would skip the onboarding gate on precisely the fresh installs '
114
+ + 'the gate exists for.',
115
+ },
116
+ {
117
+ key: 'chat_history.enabled',
118
+ reader: 'src/scripts/chat_history.ts:1025 _read_chat_history_enabled',
119
+ absentResolvesTo: 'false',
120
+ reason:
121
+ 'The reader falls back to false while the template ships true. This one is '
122
+ + 'privacy-shaped: fixing the reader would start recording history for every '
123
+ + 'install whose file lacks the key. Writing it explicitly keeps the decision '
124
+ + 'visible in the file the user can read.',
125
+ },
126
+ ];
127
+
128
+ /** Just the paths — the emitter iterates these against the template. */
129
+ export function carveOutKeys(): readonly string[] {
130
+ return SETTINGS_CARVE_OUT.map((c) => c.key);
131
+ }
132
+
133
+ /**
134
+ * `projection.*` is additionally stripped from the user-global layer by
135
+ * `load_agent_settings`'s `MERGEABLE_KEYS` whitelist, so `_globalRuleScope`
136
+ * (`src/server/routes/install.ts:234`) resolves LEGACY_ALL whether or not the
137
+ * key is written. That is a pre-existing defect, independent of sparseness —
138
+ * widening the whitelist requires an ADR, per its own comment — and the
139
+ * carve-out neither causes nor fixes it. Recorded so the next reader of this
140
+ * module does not mistake the carve-out for a fix.
141
+ */
142
+ export const KNOWN_UNFIXED_BY_CARVE_OUT =
143
+ 'src/server/routes/install.ts:234 _globalRuleScope — MERGEABLE_KEYS strips projection.*; needs an ADR.';
@@ -84,7 +84,13 @@ function unwrapRef(root: JsonSchemaNode): JsonSchemaNode {
84
84
  export function flattenSurface(schema: JsonSchemaNode, version: string): SettingsSurface {
85
85
  const entries: Record<string, SurfaceEntry> = {};
86
86
  const walk = (node: JsonSchemaNode, prefix: string): void => {
87
- if (node.type === 'object' && node.properties !== undefined) {
87
+ // `properties: {}` — a free-form map such as `z.object({}).passthrough()` —
88
+ // is a LEAF, per this function's own contract above. Recursing on the
89
+ // mere presence of the key walked zero children and emitted nothing, so
90
+ // the key vanished from the surface: `subagents.host_capabilities` was
91
+ // classified in the settings contract, present in the template, and
92
+ // absent from every snapshot and upgrade delta.
93
+ if (node.type === 'object' && node.properties !== undefined && Object.keys(node.properties).length > 0) {
88
94
  for (const key of Object.keys(node.properties).sort()) {
89
95
  const child = node.properties[key] as JsonSchemaNode;
90
96
  walk(child, prefix === '' ? key : `${prefix}.${key}`);