@event4u/agent-config 14.5.0 → 14.7.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 (203) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +384 -3
  3. package/README.md +1 -1
  4. package/dist/agent-src/commands/analyze/decision.md +7 -0
  5. package/dist/agent-src/commands/analyze/inbox.md +264 -10
  6. package/dist/agent-src/commands/analyze.md +1 -1
  7. package/dist/agent-src/commands/optimize/project.md +10 -0
  8. package/dist/agent-src/commands/roadmap/process-full.md +132 -4
  9. package/dist/agent-src/contexts/execution/roadmap-execution-contract.md +31 -0
  10. package/dist/agent-src/contexts/execution/roadmap-process-loop.md +161 -1
  11. package/dist/agent-src/rules/context-hygiene.md +2 -0
  12. package/dist/agent-src/rules/decision-revisit-gate.md +111 -7
  13. package/dist/agent-src/rules/fix-what-you-see.md +108 -0
  14. package/dist/agent-src/rules/no-roadmap-references.md +0 -5
  15. package/dist/agent-src/rules/recurring-criticism.md +110 -0
  16. package/dist/agent-src/rules/roadmap-progress-sync.md +1 -1
  17. package/dist/agent-src/rules/rule-type-governance.md +0 -2
  18. package/dist/agent-src/rules/self-repair-loop.md +17 -0
  19. package/dist/agent-src/rules/skill-quality.md +0 -2
  20. package/dist/agent-src/rules/source-confidentiality.md +37 -7
  21. package/dist/agent-src/scripts/archival_sweep.ts +117 -0
  22. package/dist/agent-src/scripts/archive_completed_roadmaps.ts +19 -3
  23. package/dist/agent-src/scripts/gate_budget.ts +282 -0
  24. package/dist/agent-src/scripts/gate_execute.ts +72 -31
  25. package/dist/agent-src/scripts/roadmap_gates.ts +74 -3
  26. package/dist/agent-src/scripts/update_roadmap_progress.ts +251 -7
  27. package/dist/agent-src/skills/adr-create/SKILL.md +25 -3
  28. package/dist/agent-src/skills/ai-council/SKILL.md +48 -807
  29. package/dist/agent-src/skills/ai-council/references/advanced-modes.md +320 -0
  30. package/dist/agent-src/skills/ai-council/references/cost-and-redaction.md +99 -0
  31. package/dist/agent-src/skills/ai-council/references/execution-modes.md +162 -0
  32. package/dist/agent-src/skills/ai-council/references/output-and-synthesis.md +125 -0
  33. package/dist/agent-src/skills/ai-council/references/procedure.md +143 -0
  34. package/dist/agent-src/skills/decision-review/SKILL.md +18 -0
  35. package/dist/agent-src/skills/quality-tools/SKILL.md +34 -326
  36. package/dist/agent-src/skills/quality-tools/references/js-ts-tools.md +113 -0
  37. package/dist/agent-src/skills/quality-tools/references/php-tools.md +222 -0
  38. package/dist/agent-src/skills/roadmap-management/SKILL.md +15 -409
  39. package/dist/agent-src/skills/roadmap-management/references/archival.md +226 -0
  40. package/dist/agent-src/skills/roadmap-management/references/authoring.md +107 -0
  41. package/dist/agent-src/skills/roadmap-management/references/dashboard.md +47 -0
  42. package/dist/agent-src/skills/roadmap-management/references/lifecycle.md +58 -0
  43. package/dist/agent-src/skills/skill-writing/SKILL.md +34 -570
  44. package/dist/agent-src/skills/skill-writing/references/procedure.md +275 -0
  45. package/dist/agent-src/skills/skill-writing/references/read-only-scripts.md +18 -0
  46. package/dist/agent-src/skills/skill-writing/references/section-patterns.md +298 -0
  47. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  48. package/dist/agent-src/templates/roadmaps.md +45 -2
  49. package/dist/agent-src/templates/scripts/telemetry/flush_sender.mjs +163 -0
  50. package/dist/agent-src/templates/scripts/telemetry/remote.ts +160 -7
  51. package/dist/agent-src/templates/scripts/telemetry/transport.ts +169 -0
  52. package/dist/cli/registry.js +1 -1
  53. package/dist/cli/registry.js.map +1 -1
  54. package/dist/cli-delegate/chunk-2GNWGMAL.js +172 -0
  55. package/dist/cli-delegate/{chunk-RLN73PR5.js → chunk-4VR4ORQ6.js} +10 -7
  56. package/dist/cli-delegate/chunk-6EOCNQAM.js +402 -0
  57. package/dist/cli-delegate/{chunk-XURJ4AQC.js → chunk-74E3TKWV.js} +381 -280
  58. package/dist/cli-delegate/{chunk-3UCJWMMP.js → chunk-7F3VYSM2.js} +4 -4
  59. package/dist/cli-delegate/{chunk-BKO2AZ7Z.js → chunk-B2ERU2VA.js} +1 -1
  60. package/dist/cli-delegate/{chunk-NXFWFAYV.js → chunk-G23AT6GD.js} +1 -0
  61. package/dist/cli-delegate/{chunk-63WSP6YZ.js → chunk-GJ5BVHXM.js} +72 -165
  62. package/dist/cli-delegate/{chunk-ZPSXJTLI.js → chunk-JZ4NR2TW.js} +353 -1
  63. package/dist/cli-delegate/chunk-MWRD5YOH.js +100 -0
  64. package/dist/cli-delegate/{chunk-GRRPEPRN.js → chunk-T7L2QK3K.js} +24 -5
  65. package/dist/cli-delegate/{chunk-EVTY7ISR.js → chunk-YM4GZDJG.js} +9 -1
  66. package/dist/cli-delegate/cmd_conformance.js +459 -709
  67. package/dist/cli-delegate/cmd_doctor.js +6 -6
  68. package/dist/cli-delegate/cmd_explain.js +1 -1
  69. package/dist/cli-delegate/cmd_export.js +7 -6
  70. package/dist/cli-delegate/cmd_handoff.js +6 -6
  71. package/dist/cli-delegate/cmd_packs_active.js +1 -1
  72. package/dist/cli-delegate/cmd_preflight.js +2 -2
  73. package/dist/cli-delegate/cmd_prune.js +7 -6
  74. package/dist/cli-delegate/cmd_session_recycle.js +840 -30
  75. package/dist/cli-delegate/cmd_settings_migrate.js +7 -6
  76. package/dist/cli-delegate/cmd_settings_set.js +1 -1
  77. package/dist/cli-delegate/cmd_sync.js +7 -6
  78. package/dist/cli-delegate/cmd_uninstall.js +9 -7
  79. package/dist/cli-delegate/cmd_update.js +1 -1
  80. package/dist/cli-delegate/cmd_upgrade.js +1 -1
  81. package/dist/cli-delegate/cmd_validate.js +7 -6
  82. package/dist/discovery/deprecation-report.md +1 -1
  83. package/dist/discovery/discovery-manifest.json +72 -29
  84. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  85. package/dist/discovery/discovery-manifest.summary.md +4 -4
  86. package/dist/discovery/dormancy-report.md +1 -1
  87. package/dist/discovery/orphan-report.md +1 -1
  88. package/dist/discovery/packs.json +10 -8
  89. package/dist/discovery/trust-report.md +3 -3
  90. package/dist/discovery/workspaces.json +8 -6
  91. package/dist/hooks/dispatch.js +3127 -2022
  92. package/dist/install/claudePathsPlan.js +187 -0
  93. package/dist/install/claudePathsPlan.js.map +1 -0
  94. package/dist/install/hostLayerFingerprint.js +136 -0
  95. package/dist/install/hostLayerFingerprint.js.map +1 -0
  96. package/dist/install/install.mjs +553 -425
  97. package/dist/install/partitionEligibility.js +276 -0
  98. package/dist/install/partitionEligibility.js.map +1 -0
  99. package/dist/mcp/registry-manifest.json +3 -3
  100. package/dist/mcp/server.json +2 -2
  101. package/dist/mcp/server.mjs +1744 -1191
  102. package/dist/router.json +1 -1
  103. package/dist/scripts/_lib/agent_src.js +41 -0
  104. package/dist/scripts/_lib/agent_src.js.map +1 -1
  105. package/dist/scripts/_lib/install_layout.js +83 -0
  106. package/dist/scripts/_lib/install_layout.js.map +1 -0
  107. package/dist/scripts/_lib/installed_lock.js +444 -0
  108. package/dist/scripts/_lib/installed_lock.js.map +1 -0
  109. package/dist/scripts/condense.js +13 -164
  110. package/dist/scripts/condense.js.map +1 -1
  111. package/dist/server/schemas/settings.js +4 -0
  112. package/dist/server/schemas/settings.js.map +1 -1
  113. package/docs/contracts/settings-classes.md +12 -6
  114. package/docs/guidelines/agent-infra/agent-interaction-and-decision-quality.md +8 -3
  115. package/docs/guidelines/agent-infra/context-hygiene-mechanics.md +26 -0
  116. package/docs/guidelines/agent-infra/engineering-memory-data-format.md +49 -0
  117. package/docs/guidelines/agent-infra/memory-access.md +17 -0
  118. package/docs/guidelines/agent-infra/recurring-criticism-mechanics.md +96 -0
  119. package/package.json +1 -1
  120. package/src/agent-src/scripts/archival_sweep.ts +117 -0
  121. package/src/agent-src/scripts/archive_completed_roadmaps.ts +19 -3
  122. package/src/agent-src/scripts/gate_budget.ts +282 -0
  123. package/src/agent-src/scripts/gate_execute.ts +72 -31
  124. package/src/agent-src/scripts/roadmap_gates.ts +74 -3
  125. package/src/agent-src/scripts/update_roadmap_progress.ts +251 -7
  126. package/src/agent-src/templates/scripts/telemetry/flush_sender.mjs +163 -0
  127. package/src/agent-src/templates/scripts/telemetry/remote.ts +160 -7
  128. package/src/agent-src/templates/scripts/telemetry/transport.ts +169 -0
  129. package/src/config/agent-settings.template.yml +27 -2
  130. package/src/config/ci-local-parity.yml +18 -0
  131. package/src/config/estate-count-budget.json +367 -3
  132. package/src/config/gate-violation-baselines.json +41 -41
  133. package/src/config/pack-size-budget.json +3 -2
  134. package/src/config/rule-activation-census.json +14 -6
  135. package/src/config/rule-stub-ceilings.json +19 -6
  136. package/src/install/claudePathsPlan.ts +196 -0
  137. package/src/install/hostLayerFingerprint.ts +145 -0
  138. package/src/install/partitionEligibility.ts +325 -0
  139. package/src/scripts/_cli/cmd_session_recycle.ts +9 -1
  140. package/src/scripts/_dispatch.bash +6 -1
  141. package/src/scripts/_lib/ac_heading.ts +30 -0
  142. package/src/scripts/_lib/agent_src.ts +42 -0
  143. package/src/scripts/_lib/bench_ab_pinned_repo.ts +162 -0
  144. package/src/scripts/_lib/bench_ab_workspace.ts +10 -1
  145. package/src/scripts/_lib/envelope_grounding.ts +38 -8
  146. package/src/scripts/_lib/installed_lock.ts +50 -5
  147. package/src/scripts/_lib/layer_overlap_notice.ts +85 -0
  148. package/src/scripts/_lib/md_section.ts +129 -0
  149. package/src/scripts/_lib/scope_guard.sh +86 -4
  150. package/src/scripts/_lib/self_repair.ts +19 -0
  151. package/src/scripts/_lib/self_repair_class_b.ts +171 -0
  152. package/src/scripts/_lib/subagent_capsule.ts +81 -1
  153. package/src/scripts/adr/regenerate_index.ts +13 -2
  154. package/src/scripts/adr_cite_check.ts +424 -0
  155. package/src/scripts/ai_council/cli_help.ts +55 -0
  156. package/src/scripts/before_complete_hook.ts +153 -28
  157. package/src/scripts/bench_ab_v2_complexity.ts +27 -7
  158. package/src/scripts/check_adr_frontmatter.ts +187 -1
  159. package/src/scripts/check_references.ts +60 -0
  160. package/src/scripts/check_release_published.ts +32 -11
  161. package/src/scripts/check_single_delivery.ts +517 -0
  162. package/src/scripts/ci_settle.ts +170 -0
  163. package/src/scripts/condense.ts +20 -170
  164. package/src/scripts/council_cli.ts +3 -3
  165. package/src/scripts/dispatch_r2_reviewer.ts +6 -14
  166. package/src/scripts/hook_manifest.json +1 -1
  167. package/src/scripts/hook_manifest.yaml +77 -14
  168. package/src/scripts/hooks/block_no_verify.ts +61 -10
  169. package/src/scripts/hooks/block_unauthorized_git.ts +1 -1
  170. package/src/scripts/hooks/concern_registry.ts +4 -0
  171. package/src/scripts/hooks/rtk_wrap_hook.ts +8 -3
  172. package/src/scripts/hooks/run_continuation_hook.ts +887 -68
  173. package/src/scripts/hooks/ship_diff_volume_hook.ts +81 -15
  174. package/src/scripts/hooks/source_first_gate_hook.ts +464 -0
  175. package/src/scripts/hooks/state_io.ts +782 -20
  176. package/src/scripts/hooks/subagent_ledger_hook.ts +44 -15
  177. package/src/scripts/hooks/telemetry_flush_hook.ts +139 -0
  178. package/src/scripts/hooks/telemetry_self_repair.ts +128 -0
  179. package/src/scripts/hooks/telemetry_usage_hook.ts +22 -4
  180. package/src/scripts/hooks/turn_end_gate_hook.ts +81 -15
  181. package/src/scripts/install.sh +12 -2
  182. package/src/scripts/install.ts +16 -11
  183. package/src/scripts/language_mirror_hook.ts +561 -25
  184. package/src/scripts/lint_framework_leakage_allowlist.json +2 -2
  185. package/src/scripts/lint_plan_risk_register.ts +4 -3
  186. package/src/scripts/lint_skill_router_head.ts +4 -4
  187. package/src/scripts/mcp_server/tools.ts +2 -2
  188. package/src/scripts/memory_consolidation.ts +189 -0
  189. package/src/scripts/memory_eviction.ts +384 -0
  190. package/src/scripts/new_roadmap.ts +136 -0
  191. package/src/scripts/pack_mcp_content.ts +20 -5
  192. package/src/scripts/release.ts +37 -38
  193. package/src/scripts/report_layer_overlap.ts +78 -0
  194. package/src/scripts/report_memory_pointers.ts +622 -0
  195. package/src/scripts/self_repair_hook.ts +37 -5
  196. package/src/scripts/session_register_hook.ts +115 -15
  197. package/src/scripts/skill_usage_collect.ts +11 -1
  198. package/src/scripts/skill_usage_report.ts +278 -8
  199. package/src/scripts/sync_pr_branch.ts +7 -0
  200. package/src/server/schemas/settings.ts +8 -0
  201. package/dist/cli-delegate/chunk-EJITJBJX.js +0 -172
  202. package/dist/cli-delegate/chunk-PZWRPRWP.js +0 -38
  203. /package/dist/cli-delegate/{chunk-RYNADUFG.js → chunk-LWTYTX6F.js} +0 -0
@@ -0,0 +1,276 @@
1
+ /**
2
+ * The single-delivery partition predicate — one artefact, one layer.
3
+ *
4
+ * ## What it decides
5
+ *
6
+ * Two layers deliver agent artefacts: a machine-local project layer at
7
+ * `<repo>/.claude/` (gitignored, 0 tracked files, rewritten by every
8
+ * `task generate-tools`) and a host-global layer at `~/.claude/` (written by
9
+ * `agent-config install`, never by the build). Measured 2026-08-19 on a freshly
10
+ * regenerated tree: **110 rules arrive twice**, and standing rule prose is
11
+ * 203,873 tokens against a 110,000 cap (185.3 %).
12
+ *
13
+ * ADR-236 partitions them: an artefact that exists ONLY for this package stays
14
+ * in the project layer; everything else is delivered only globally. That takes
15
+ * `<repo>/.claude/` from 111 rules and 338 skills to **16 rules and zero
16
+ * skills**.
17
+ *
18
+ * ## Why the predicate is fail-safe and never fails the build
19
+ *
20
+ * The partition is a removal, so the build loses its repair path: it can no
21
+ * longer heal a stale global layer by regenerating, because it stops writing
22
+ * those files. Every uncertainty therefore resolves to `standalone/full` — the
23
+ * pre-partition behaviour — and **never** to a refusal:
24
+ *
25
+ * `.github/workflows/consistency.yml:169` runs `task generate-tools` on a fresh
26
+ * checkout where, by that workflow's own comment at `:172-174`, the host rule
27
+ * trees are gitignored and absent. An option that made a missing global layer a
28
+ * hard failure was eliminated by that fact in the 2026-08-19 council round, not
29
+ * by preference. Under-governing a checkout is the one regression this estate
30
+ * exists to prevent; breaking the Consistency pipeline is the other. Full
31
+ * projection is the only branch that does neither.
32
+ *
33
+ * ## Why content and not a version number
34
+ *
35
+ * Rationale and the 153-skill measurement that decided it: see
36
+ * `hostLayerFingerprint.ts`. Version equality is checked too, but as a cheap
37
+ * pre-filter — it is necessary, never sufficient.
38
+ *
39
+ * ## Contract
40
+ *
41
+ * Side-effect-free, no I/O of its own (callers supply the facts), no CLI entry,
42
+ * no `process.exit`. Ships inside the consumer installer bundle, same
43
+ * constraint as `ruleInScope.ts`.
44
+ */
45
+ import * as fs from 'node:fs';
46
+ import * as os from 'node:os';
47
+ import { parseFrontmatter } from './ruleInScope.js';
48
+ import { fingerprintLayers, hostLayerInputs } from './hostLayerFingerprint.js';
49
+ import { current_package_version, read_lockfile, write_lockfile, } from '../scripts/_lib/installed_lock.js';
50
+ /** The workspace id that marks an artefact as existing only for this package. */
51
+ export const MAINTAINER_WORKSPACE = 'agent-config-maintainer';
52
+ /**
53
+ * Select the delivery mode. Total function: always returns a verdict, never
54
+ * throws, never refuses.
55
+ *
56
+ * The order of the guards is the fail-safe order — cheapest and most decisive
57
+ * first, so the fingerprint is computed only when everything else already
58
+ * agrees.
59
+ */
60
+ export function partitionVerdict(inputs) {
61
+ if (!inputs.hostLayerPresent) {
62
+ return {
63
+ mode: 'standalone/full',
64
+ reason: 'no host-global layer on this machine',
65
+ };
66
+ }
67
+ const lock = inputs.lockfile;
68
+ if (lock === null) {
69
+ return {
70
+ mode: 'standalone/full',
71
+ reason: 'host layer present but no install record (installed.lock absent)',
72
+ };
73
+ }
74
+ const recorded = lock.agent_config_version;
75
+ if (!recorded) {
76
+ return {
77
+ mode: 'standalone/full',
78
+ reason: 'install record carries no version',
79
+ };
80
+ }
81
+ // Exact equality, deliberately not `>=`. A NEWER global layer is not a
82
+ // superset: a later release may have renamed or removed an artefact this
83
+ // checkout still expects, and ordering does not establish substitutability.
84
+ if (recorded !== inputs.projectVersion) {
85
+ return {
86
+ mode: 'standalone/full',
87
+ reason: `version mismatch (installed ${recorded}, building ${inputs.projectVersion})`,
88
+ };
89
+ }
90
+ const installedFp = lock.host_layer_fingerprint;
91
+ if (!installedFp) {
92
+ return {
93
+ mode: 'standalone/full',
94
+ reason: 'install predates host-layer fingerprinting — re-run `agent-config install` to enable the partition',
95
+ };
96
+ }
97
+ let expected;
98
+ try {
99
+ expected = inputs.expectedFingerprint();
100
+ }
101
+ catch {
102
+ return {
103
+ mode: 'standalone/full',
104
+ reason: 'could not compute the expected host-layer fingerprint',
105
+ };
106
+ }
107
+ if (installedFp !== expected) {
108
+ return {
109
+ mode: 'standalone/full',
110
+ reason: 'host-layer content differs from this checkout — re-run `agent-config install`',
111
+ };
112
+ }
113
+ return {
114
+ mode: 'dual-layer/partitioned',
115
+ reason: `host layer verified at ${recorded} (fingerprint ${installedFp.slice(0, 12)})`,
116
+ };
117
+ }
118
+ /**
119
+ * Does this artefact exist ONLY for this package?
120
+ *
121
+ * True iff `workspaces:` is present, non-empty, and its every entry is
122
+ * {@link MAINTAINER_WORKSPACE}. Measured 2026-08-20: exactly **16** rules in
123
+ * `src/rules/` satisfy this — the figure ADR-236 partitions on.
124
+ *
125
+ * The direction of the default is the opposite of `rule_in_scope`'s, and that
126
+ * is deliberate rather than an inconsistency. There, an untagged artefact ships
127
+ * — over-shipping is the safe error for a scope filter. Here, an untagged
128
+ * artefact is NOT package-only, so it is delivered globally and withheld from
129
+ * the project layer. Both defaults resolve toward "the artefact is generally
130
+ * useful"; only one of them is about withholding.
131
+ */
132
+ export function isExclusivelyPackageOnly(source_path) {
133
+ let meta;
134
+ try {
135
+ [meta] = parseFrontmatter(fs.readFileSync(source_path, 'utf-8'));
136
+ }
137
+ catch {
138
+ return false; // unreadable → not package-only → delivered globally
139
+ }
140
+ const raw = meta['workspaces'];
141
+ if (!Array.isArray(raw) || raw.length === 0) {
142
+ return false;
143
+ }
144
+ return raw.every((w) => String(w) === MAINTAINER_WORKSPACE);
145
+ }
146
+ let _memo = null;
147
+ let _announce = (m) => process.stdout.write(`${m}\n`);
148
+ /**
149
+ * Install the emitter used for the mode line. Callers pass a function visible at
150
+ * their DEFAULT output level — the first implementation used one that prints only
151
+ * at `verbose`, which withheld ~100 rules while saying nothing in a normal run.
152
+ */
153
+ export function setPartitionAnnounce(fn) {
154
+ _announce = fn;
155
+ }
156
+ /** Test seam — drop the memo so one process can exercise both delivery modes. */
157
+ export function _resetPartitionVerdictForTest() {
158
+ _memo = null;
159
+ }
160
+ /**
161
+ * Is the partition active for this generation? Memoised per process, because the
162
+ * fingerprint costs ~100 ms and the answer cannot change mid-run.
163
+ *
164
+ * This is the single entry point the generators call, deliberately: wiring a
165
+ * feature into two files that are already past the 1,500-line source ceiling
166
+ * costs a ratchet violation per line, so the decision, its fail-safe ordering,
167
+ * its printed reason and its memo all live here and the call sites are one line
168
+ * each.
169
+ */
170
+ export function partitionActive(projectRoot) {
171
+ return resolvePartitionVerdict(projectRoot).mode === 'dual-layer/partitioned';
172
+ }
173
+ /**
174
+ * Resolve the delivery mode for one generation, and say so once.
175
+ *
176
+ * Lives here rather than in `condense.ts` for two reasons. The decision belongs
177
+ * beside {@link partitionVerdict}, whose fail-safe ordering it depends on; and
178
+ * `condense.ts` is 1,500+ lines, where the source-size ratchet counts every
179
+ * added line as a violation — so a block that has no reason to live there is a
180
+ * cost as well as a misplacement.
181
+ *
182
+ * **Both council seats (2026-08-20, 2/2) required that generation PRINT the mode
183
+ * it selected** rather than partition silently: a withheld artefact nobody
184
+ * announced is exactly the under-governance the partition exists to remove. The
185
+ * caller supplies `announce`, and the level matters — the first implementation
186
+ * used an `info()` that prints only at `verbose`, so it withheld ~100 rules while
187
+ * saying nothing in a default run. Pass a function that is visible at the default
188
+ * level. Residual, stated: at an explicitly silent output level the line is
189
+ * dropped; that is an operator choice and the partition stays fail-safe anyway.
190
+ *
191
+ * The fingerprint compares the host layer against **what the installer recorded
192
+ * when it wrote that layer**, not against a re-derivation from source. That
193
+ * avoids guessing the installer's byte representation — a mismatch there would
194
+ * make the partition permanently unreachable rather than merely inactive — and it
195
+ * is the property the partition needs: the omitted artefacts are still present,
196
+ * in the form this version's installer left them.
197
+ *
198
+ * **Known residual:** an installer that crashes mid-write and still reaches the
199
+ * lockfile would fingerprint its own partial layer, and that fingerprint then
200
+ * verifies. Ordering narrows the window (the lockfile is written last) without
201
+ * closing it; a per-artefact manifest would close it and is not built here.
202
+ */
203
+ export function resolvePartitionVerdict(projectRoot) {
204
+ if (_memo !== null) {
205
+ return _memo;
206
+ }
207
+ const layers = hostLayerInputs(os.homedir());
208
+ const present = layers.some((l) => {
209
+ try {
210
+ return fs.statSync(l.root).isDirectory();
211
+ }
212
+ catch {
213
+ return false;
214
+ }
215
+ });
216
+ let lock = null;
217
+ try {
218
+ lock = read_lockfile();
219
+ }
220
+ catch {
221
+ lock = null; // unreadable record → fail safe
222
+ }
223
+ _memo = partitionVerdict({
224
+ projectVersion: current_package_version(projectRoot),
225
+ lockfile: lock,
226
+ hostLayerPresent: present,
227
+ expectedFingerprint: () => fingerprintLayers(layers),
228
+ });
229
+ _announce(`projection mode: ${_memo.mode} — ${_memo.reason}`);
230
+ return _memo;
231
+ }
232
+ /**
233
+ * Stamp the host-layer content fingerprint into the install record.
234
+ *
235
+ * The write side of the partition, and what makes it reachable at all: the build
236
+ * withholds artefacts only when this fingerprint matches what it finds on disk.
237
+ * No fingerprint recorded → full projection, which is the safe direction.
238
+ *
239
+ * **Call it AFTER the deploy and after the failed-tool postcheck.** The install
240
+ * writes its lockfile once before the redeploy; a fingerprint taken there would
241
+ * describe the PREVIOUS install and then verify against a layer this run
242
+ * replaced. Both council seats required the record be written last, and this is
243
+ * the function that respects it.
244
+ *
245
+ * On failure it reports and writes NOTHING. A missing fingerprint is fail-safe; a
246
+ * wrong one would authorise a partition against an unverified layer, so the two
247
+ * errors are not symmetric and this must never prefer the second.
248
+ *
249
+ * Lives here rather than inline in `install.ts` for the same reason
250
+ * {@link resolvePartitionVerdict} does: it belongs beside the predicate it
251
+ * serves, and `install.ts` is 5,000+ lines where the source-size ratchet counts
252
+ * every added line.
253
+ *
254
+ * @returns the fingerprint written, or `null` when nothing was recorded.
255
+ */
256
+ export function stampHostLayerFingerprint(installedVersion, tools, lockfilePath,
257
+ /** Skip entirely — e.g. when the claude-code deploy itself failed. */
258
+ skip, report) {
259
+ if (skip) {
260
+ return null;
261
+ }
262
+ try {
263
+ const fingerprint = fingerprintLayers(hostLayerInputs(os.homedir()));
264
+ write_lockfile(installedVersion, [...tools], {
265
+ path: lockfilePath,
266
+ host_layer_fingerprint: fingerprint,
267
+ });
268
+ report(`Host-layer fingerprint recorded: ${fingerprint.slice(0, 12)} (enables single delivery)`);
269
+ return fingerprint;
270
+ }
271
+ catch (e) {
272
+ report(`Host-layer fingerprint NOT recorded (${String(e)}) — the project layer keeps the full projection.`);
273
+ return null;
274
+ }
275
+ }
276
+ //# sourceMappingURL=partitionEligibility.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"partitionEligibility.js","sourceRoot":"","sources":["../../src/install/partitionEligibility.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EACH,uBAAuB,EACvB,aAAa,EACb,cAAc,GACjB,MAAM,mCAAmC,CAAC;AAE3C,iFAAiF;AACjF,MAAM,CAAC,MAAM,oBAAoB,GAAG,yBAAyB,CAAC;AAgC9D;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAuB;IACpD,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAC;QAC3B,OAAO;YACH,IAAI,EAAE,iBAAiB;YACvB,MAAM,EAAE,sCAAsC;SACjD,CAAC;IACN,CAAC;IACD,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC;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AY;YAClB,sBAAsB,EAAE,WAAW;SACtC,CAAC,CAAC;QACH,MAAM,CAAC,oCAAoC,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,4BAA4B,CAAC,CAAC;QACjG,OAAO,WAAW,CAAC;IACvB,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACT,MAAM,CACF,wCAAwC,MAAM,CAAC,CAAC,CAAC,kDAAkD,CACtG,CAAC;QACF,OAAO,IAAI,CAAC;IAChB,CAAC;AACL,CAAC"}
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "discovery": {
3
- "artefact_count": 609,
3
+ "artefact_count": 611,
4
4
  "scanner_version": "de0a22b4ac4c"
5
5
  },
6
- "generated_at": "2026-08-19",
6
+ "generated_at": "2026-08-21",
7
7
  "package": {
8
8
  "description": "Governed skills, rules and commands for AI coding tools (Claude Code, Cursor, Windsurf, Copilot) \u2014 every claim machine-checked, including \"zero runtime daemon\".",
9
9
  "homepage": "https://event4u-app.github.io/agent-config",
10
10
  "name": "@event4u/agent-config",
11
11
  "repository": "https://github.com/event4u-app/agent-config",
12
- "version": "14.5.0"
12
+ "version": "14.7.0"
13
13
  },
14
14
  "registries": [
15
15
  {
@@ -9,12 +9,12 @@
9
9
  "transport": {
10
10
  "type": "stdio"
11
11
  },
12
- "version": "14.5.0"
12
+ "version": "14.7.0"
13
13
  }
14
14
  ],
15
15
  "repository": {
16
16
  "source": "github",
17
17
  "url": "https://github.com/event4u-app/agent-config"
18
18
  },
19
- "version": "14.5.0"
19
+ "version": "14.7.0"
20
20
  }