@celilo/cli 1.1.0 → 1.2.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.
@@ -0,0 +1,404 @@
1
+ /**
2
+ * Baseline for the module-business barrier gate
3
+ * (openspec/changes/module-business-barrier/inventory.md section 5).
4
+ *
5
+ * **This file is a debt ledger, not a configuration knob.** Every entry is a
6
+ * place where celilo core holds knowledge that belongs to a provider module.
7
+ * The gate enforces *monotonic improvement*: an entry may shrink or disappear
8
+ * freely, and may only grow with a justification a reviewer sees in the diff.
9
+ *
10
+ * Seeded from the 48 open rows of the audit. Row ids (`T1`, `S8`, `L12`, `X3`…)
11
+ * refer to that document's sections 1-4 — read the row before changing a line
12
+ * here.
13
+ *
14
+ * Two kinds of entry live here and they must not be confused:
15
+ *
16
+ * - **Debt** — the default. It is here because it is wrong and not yet fixed.
17
+ * - **Permanent** — marked `PERMANENT` in `why`. Not debt, and no one should
18
+ * try to pay it down. `notification` is both a capability name and an
19
+ * ordinary English word the alerting subsystem uses constantly, so its rows
20
+ * never go away.
21
+ */
22
+
23
+ /**
24
+ * Tables tagged `@owner capability:*` in `db/schema.ts`, and the capability
25
+ * each belongs to. Scan A asserts the tagged set EQUALS this map — not that it
26
+ * is empty. These four exist today (audit T1, T2, T3, T6) and Phase 1 migrates
27
+ * nothing; an assertion that core holds none would be red the day it landed.
28
+ */
29
+ export const CAPABILITY_OWNED_TABLES: Readonly<Record<string, string>> = {
30
+ web_routes: 'public_web',
31
+ port_forwards: 'firewall',
32
+ trusted_sources: 'firewall',
33
+ dns_internal_records: 'dns_internal',
34
+ };
35
+
36
+ /** One `{file, capability}` pair and how many times core names it. */
37
+ export interface CapabilityNameRow {
38
+ /** Repo-relative path, POSIX separators. */
39
+ readonly file: string;
40
+ readonly capability: string;
41
+ /**
42
+ * Exact occurrence count. The count is the mechanism: `capability-loader.ts`
43
+ * already carried 21 `firewall` hits, so at file-granularity a 22nd would be
44
+ * invisible — and the 22nd is `baf2c70d` (row L12), the commit this whole
45
+ * change exists because of.
46
+ */
47
+ readonly count: number;
48
+ readonly why: string;
49
+ }
50
+
51
+ /** Scan C: a file under `services/**` whose NAME carries a capability name. */
52
+ export interface ServiceFilenameRow {
53
+ readonly file: string;
54
+ readonly capability: string;
55
+ readonly why: string;
56
+ }
57
+
58
+ /** Scan D: a provider-implementation literal appearing in core's code. */
59
+ export interface ProviderLiteralRow {
60
+ readonly file: string;
61
+ readonly literal: string;
62
+ readonly count: number;
63
+ readonly why: string;
64
+ }
65
+
66
+ export const CAPABILITY_NAME_BASELINE: readonly CapabilityNameRow[] = [
67
+ {
68
+ file: 'apps/celilo/src/capabilities/well-known.ts',
69
+ capability: 'dhcp_server',
70
+ count: 1,
71
+ why: 'X1 — hardcoded canonical hostnames, required zones and literal ports; Phase 2',
72
+ },
73
+ {
74
+ file: 'apps/celilo/src/capabilities/well-known.ts',
75
+ capability: 'dns_internal',
76
+ count: 1,
77
+ why: 'X1 — hardcoded canonical hostnames, required zones and literal ports; Phase 2',
78
+ },
79
+ {
80
+ file: 'apps/celilo/src/capabilities/well-known.ts',
81
+ capability: 'dns_registrar',
82
+ count: 1,
83
+ why: 'X1 — hardcoded canonical hostnames, required zones and literal ports; Phase 2',
84
+ },
85
+ {
86
+ file: 'apps/celilo/src/capabilities/well-known.ts',
87
+ capability: 'public_web',
88
+ count: 1,
89
+ why: 'X1 — hardcoded canonical hostnames, required zones and literal ports; Phase 2',
90
+ },
91
+ {
92
+ file: 'apps/celilo/src/cli/commands/notify-config.ts',
93
+ capability: 'notification',
94
+ count: 2,
95
+ why: "PERMANENT — 'notification' here is the English word, not the capability; celilo's own alerting surface",
96
+ },
97
+ {
98
+ file: 'apps/celilo/src/cli/commands/token.ts',
99
+ capability: 'idp',
100
+ count: 1,
101
+ why: 'X7 — a top-level CLI verb backed by the idp capability; Phase 5',
102
+ },
103
+ {
104
+ file: 'apps/celilo/src/cli/completion.ts',
105
+ capability: 'firewall',
106
+ count: 3,
107
+ why: 'X6 — tab completion for the capability-named CLI verbs; falls out with X6',
108
+ },
109
+ {
110
+ file: 'apps/celilo/src/cli/index.ts',
111
+ capability: 'firewall',
112
+ count: 2,
113
+ why: 'X5/X6/X7 — the command tree wiring the capability-named CLI verbs; Phase 5',
114
+ },
115
+ {
116
+ file: 'apps/celilo/src/hooks/capability-loader.ts',
117
+ capability: 'control_plane_vpn',
118
+ count: 1,
119
+ why: 'L1-L12 — core branches on the capability NAME; becomes a provider declaration in Phase 3',
120
+ },
121
+ {
122
+ file: 'apps/celilo/src/hooks/capability-loader.ts',
123
+ capability: 'dhcp_server',
124
+ count: 1,
125
+ why: 'L1-L12 — core branches on the capability NAME; becomes a provider declaration in Phase 3',
126
+ },
127
+ {
128
+ file: 'apps/celilo/src/hooks/capability-loader.ts',
129
+ capability: 'dns_internal',
130
+ count: 3,
131
+ why: 'L1-L12 — core branches on the capability NAME; becomes a provider declaration in Phase 3',
132
+ },
133
+ {
134
+ file: 'apps/celilo/src/hooks/capability-loader.ts',
135
+ capability: 'dns_registrar',
136
+ count: 4,
137
+ why: 'L1-L12 — core branches on the capability NAME; becomes a provider declaration in Phase 3',
138
+ },
139
+ {
140
+ file: 'apps/celilo/src/hooks/capability-loader.ts',
141
+ capability: 'external_web',
142
+ count: 1,
143
+ why: 'L1-L12 — core branches on the capability NAME; becomes a provider declaration in Phase 3',
144
+ },
145
+ {
146
+ file: 'apps/celilo/src/hooks/capability-loader.ts',
147
+ capability: 'firewall',
148
+ count: 12,
149
+ why: 'L1-L12 — core branches on the capability NAME; becomes a provider declaration in Phase 3',
150
+ },
151
+ {
152
+ file: 'apps/celilo/src/hooks/capability-loader.ts',
153
+ capability: 'idp',
154
+ count: 1,
155
+ why: 'L1-L12 — core branches on the capability NAME; becomes a provider declaration in Phase 3',
156
+ },
157
+ {
158
+ file: 'apps/celilo/src/hooks/capability-loader.ts',
159
+ capability: 'notification',
160
+ count: 1,
161
+ why: 'L1-L12 — core branches on the capability NAME; becomes a provider declaration in Phase 3',
162
+ },
163
+ {
164
+ file: 'apps/celilo/src/hooks/capability-loader.ts',
165
+ capability: 'private_web',
166
+ count: 1,
167
+ why: 'L1-L12 — core branches on the capability NAME; becomes a provider declaration in Phase 3',
168
+ },
169
+ {
170
+ file: 'apps/celilo/src/hooks/capability-loader.ts',
171
+ capability: 'public_web',
172
+ count: 8,
173
+ why: 'L1-L12 — core branches on the capability NAME; becomes a provider declaration in Phase 3',
174
+ },
175
+ {
176
+ file: 'apps/celilo/src/hooks/capability-loader.ts',
177
+ capability: 'registry_publish',
178
+ count: 1,
179
+ why: 'L1-L12 — core branches on the capability NAME; becomes a provider declaration in Phase 3',
180
+ },
181
+ {
182
+ file: 'apps/celilo/src/hooks/capability-loader.ts',
183
+ capability: 'source_forge',
184
+ count: 1,
185
+ why: 'L1-L12 — core branches on the capability NAME; becomes a provider declaration in Phase 3',
186
+ },
187
+ {
188
+ file: 'apps/celilo/src/manifest/validate.ts',
189
+ capability: 'cross_module_read',
190
+ count: 1,
191
+ why: "PERMANENT — validating a manifest's declared capability names against the registry is core's job",
192
+ },
193
+ {
194
+ file: 'apps/celilo/src/services/alerting/inbound-poller.ts',
195
+ capability: 'notification',
196
+ count: 1,
197
+ why: "PERMANENT — celilo's own alerting subsystem; 'notification' is the English word",
198
+ },
199
+ {
200
+ file: 'apps/celilo/src/services/alerting/transport-loader.ts',
201
+ capability: 'notification',
202
+ count: 1,
203
+ why: "PERMANENT — celilo's own alerting subsystem; 'notification' is the English word",
204
+ },
205
+ {
206
+ file: 'apps/celilo/src/services/cross-module-read.ts',
207
+ capability: 'cross_module_read',
208
+ count: 1,
209
+ why: 'PERMANENT — cross_module_read is a framework-granted privilege, not a module-provided capability (X10)',
210
+ },
211
+ {
212
+ file: 'apps/celilo/src/services/dns-provider-backfill.ts',
213
+ capability: 'dns_internal',
214
+ count: 2,
215
+ why: 'S3 — the generic event-replay half is core; the dns_internal gate is not',
216
+ },
217
+ {
218
+ file: 'apps/celilo/src/services/firewall-reach.ts',
219
+ capability: 'firewall',
220
+ count: 1,
221
+ why: 'S8 — core shells iptables-save at a remote box and parses the output',
222
+ },
223
+ {
224
+ file: 'apps/celilo/src/services/infrastructure-selector.ts',
225
+ capability: 'firewall',
226
+ count: 1,
227
+ why: 'S15 — isFirewallModule hardcodes a placement rule the manifest should declare',
228
+ },
229
+ {
230
+ file: 'apps/celilo/src/services/module-deploy.ts',
231
+ capability: 'firewall',
232
+ count: 2,
233
+ why: "S16 — two more copies of S15's decision; fixing S15 removes all three",
234
+ },
235
+ {
236
+ file: 'apps/celilo/src/services/public-web-republish.ts',
237
+ capability: 'public_web',
238
+ count: 1,
239
+ why: "S2 — encodes caddy's redeploy behaviour; generalise to a provider-declared re-assert signal",
240
+ },
241
+ {
242
+ file: 'apps/celilo/src/services/zone-policy.ts',
243
+ capability: 'public_web',
244
+ count: 1,
245
+ why: 'S13 — ZONE_REQUIREMENTS, a second hand-maintained copy of well-known.ts; Phase 2',
246
+ },
247
+ {
248
+ file: 'apps/celilo/src/templates/generator.ts',
249
+ capability: 'dns_internal',
250
+ count: 1,
251
+ why: 'X4 — declaration-driven and the model for the rest; only the error string names the capability',
252
+ },
253
+ {
254
+ file: 'apps/celilo/src/variables/context.ts',
255
+ capability: 'dns_internal',
256
+ count: 1,
257
+ why: 'X3 — reaches capabilitiesMap.dns_internal by name; should read a declared field (X4 is the model)',
258
+ },
259
+ {
260
+ file: 'packages/capabilities/src/capability-contract.ts',
261
+ capability: 'control_plane_vpn',
262
+ count: 1,
263
+ why: 'PERMANENT — X10, a contract declaration with no implementation; this is the package doing its job',
264
+ },
265
+ {
266
+ file: 'packages/capabilities/src/capability-contract.ts',
267
+ capability: 'cross_module_read',
268
+ count: 1,
269
+ why: 'PERMANENT — X10, a contract declaration with no implementation; this is the package doing its job',
270
+ },
271
+ {
272
+ file: 'packages/capabilities/src/capability-contract.ts',
273
+ capability: 'dhcp_server',
274
+ count: 1,
275
+ why: 'PERMANENT — X10, a contract declaration with no implementation; this is the package doing its job',
276
+ },
277
+ {
278
+ file: 'packages/capabilities/src/capability-contract.ts',
279
+ capability: 'dns_internal',
280
+ count: 1,
281
+ why: 'PERMANENT — X10, a contract declaration with no implementation; this is the package doing its job',
282
+ },
283
+ {
284
+ file: 'packages/capabilities/src/capability-contract.ts',
285
+ capability: 'dns_registrar',
286
+ count: 1,
287
+ why: 'PERMANENT — X10, a contract declaration with no implementation; this is the package doing its job',
288
+ },
289
+ {
290
+ file: 'packages/capabilities/src/capability-contract.ts',
291
+ capability: 'external_web',
292
+ count: 1,
293
+ why: 'PERMANENT — X10, a contract declaration with no implementation; this is the package doing its job',
294
+ },
295
+ {
296
+ file: 'packages/capabilities/src/capability-contract.ts',
297
+ capability: 'firewall',
298
+ count: 1,
299
+ why: 'PERMANENT — X10, a contract declaration with no implementation; this is the package doing its job',
300
+ },
301
+ {
302
+ file: 'packages/capabilities/src/capability-contract.ts',
303
+ capability: 'idp',
304
+ count: 1,
305
+ why: 'PERMANENT — X10, a contract declaration with no implementation; this is the package doing its job',
306
+ },
307
+ {
308
+ file: 'packages/capabilities/src/capability-contract.ts',
309
+ capability: 'notification',
310
+ count: 1,
311
+ why: 'PERMANENT — X10, a contract declaration with no implementation; this is the package doing its job',
312
+ },
313
+ {
314
+ file: 'packages/capabilities/src/capability-contract.ts',
315
+ capability: 'private_web',
316
+ count: 1,
317
+ why: 'PERMANENT — X10, a contract declaration with no implementation; this is the package doing its job',
318
+ },
319
+ {
320
+ file: 'packages/capabilities/src/capability-contract.ts',
321
+ capability: 'public_web',
322
+ count: 1,
323
+ why: 'PERMANENT — X10, a contract declaration with no implementation; this is the package doing its job',
324
+ },
325
+ {
326
+ file: 'packages/capabilities/src/capability-contract.ts',
327
+ capability: 'registry_publish',
328
+ count: 1,
329
+ why: 'PERMANENT — X10, a contract declaration with no implementation; this is the package doing its job',
330
+ },
331
+ {
332
+ file: 'packages/capabilities/src/capability-contract.ts',
333
+ capability: 'source_forge',
334
+ count: 1,
335
+ why: 'PERMANENT — X10, a contract declaration with no implementation; this is the package doing its job',
336
+ },
337
+ {
338
+ file: 'packages/capabilities/src/firewall.ts',
339
+ capability: 'firewall',
340
+ count: 2,
341
+ why: 'PERMANENT — X10, the firewall capability contract',
342
+ },
343
+ {
344
+ file: 'packages/capabilities/src/public-web.ts',
345
+ capability: 'public_web',
346
+ count: 1,
347
+ why: "X8 — generateCaddyfile renders caddy's complete config from the shared package; Phase 5",
348
+ },
349
+ {
350
+ file: 'packages/capabilities/src/utils.ts',
351
+ capability: 'public_web',
352
+ count: 3,
353
+ why: 'X8 — shared helpers that name the capability they serve; moves with X8 in Phase 5',
354
+ },
355
+ ];
356
+
357
+ export const SERVICE_FILENAME_BASELINE: readonly ServiceFilenameRow[] = [
358
+ {
359
+ file: 'apps/celilo/src/services/alerting/notification-responder.ts',
360
+ capability: 'notification',
361
+ why: "PERMANENT — false positive; celilo's own alerting responder, unrelated to the notification capability",
362
+ },
363
+ {
364
+ file: 'apps/celilo/src/services/cross-module-read.ts',
365
+ capability: 'cross_module_read',
366
+ why: 'PERMANENT — cross_module_read is a framework privilege, not a module capability',
367
+ },
368
+ {
369
+ file: 'apps/celilo/src/services/dns-internal-records.ts',
370
+ capability: 'dns_internal',
371
+ why: 'S5 — the store for T6; moves with the table in Phase 4',
372
+ },
373
+ {
374
+ file: 'apps/celilo/src/services/firewall-reach.ts',
375
+ capability: 'firewall',
376
+ why: 'S8 — core reaching into one provider implementation',
377
+ },
378
+ {
379
+ file: 'apps/celilo/src/services/public-web-republish.ts',
380
+ capability: 'public_web',
381
+ why: "S2 — named for one provider's redeploy behaviour",
382
+ },
383
+ ];
384
+
385
+ export const PROVIDER_LITERAL_BASELINE: readonly ProviderLiteralRow[] = [
386
+ {
387
+ file: 'apps/celilo/src/secrets/generators.ts',
388
+ literal: 'wg pubkey',
389
+ count: 1,
390
+ why: 'X11 — core shells `wg pubkey` to derive a key, and tells the operator to brew install wireguard-tools',
391
+ },
392
+ {
393
+ file: 'apps/celilo/src/services/firewall-reach.ts',
394
+ literal: 'iptables-save',
395
+ count: 1,
396
+ why: "S8 — core parses a firewall's live ruleset; implementation-specific, not merely capability-specific",
397
+ },
398
+ {
399
+ file: 'packages/capabilities/src/public-web.ts',
400
+ literal: '/srv/www',
401
+ count: 4,
402
+ why: "X8 — the Caddyfile generator knows caddy's on-disk asset layout",
403
+ },
404
+ ];