@homeflare/alchemy 0.36.0 → 0.37.1

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 (116) hide show
  1. package/README.md +14 -0
  2. package/dist/argocd/cluster.d.ts +102 -0
  3. package/dist/argocd/cluster.d.ts.map +1 -0
  4. package/dist/argocd/credentials.d.ts +37 -0
  5. package/dist/argocd/credentials.d.ts.map +1 -0
  6. package/dist/argocd/fake-argocd.d.ts +42 -0
  7. package/dist/argocd/fake-argocd.d.ts.map +1 -0
  8. package/dist/argocd/git-credentials.d.ts +29 -0
  9. package/dist/argocd/git-credentials.d.ts.map +1 -0
  10. package/dist/argocd/index.d.ts +19 -0
  11. package/dist/argocd/index.d.ts.map +1 -0
  12. package/dist/argocd/index.js +306 -0
  13. package/dist/argocd/index.js.map +17 -0
  14. package/dist/argocd/providers.d.ts +13 -0
  15. package/dist/argocd/providers.d.ts.map +1 -0
  16. package/dist/argocd/repo-creds.d.ts +67 -0
  17. package/dist/argocd/repo-creds.d.ts.map +1 -0
  18. package/dist/argocd/repository.d.ts +87 -0
  19. package/dist/argocd/repository.d.ts.map +1 -0
  20. package/dist/argocd/resource.d.ts +90 -0
  21. package/dist/argocd/resource.d.ts.map +1 -0
  22. package/dist/cloudflare/index.js +4 -4
  23. package/dist/cloudflare/index.js.map +3 -3
  24. package/dist/cloudflare/r2-bucket-lock.d.ts +14 -5
  25. package/dist/cloudflare/r2-bucket-lock.d.ts.map +1 -1
  26. package/dist/litellm/index.js.map +2 -2
  27. package/dist/litellm/operations.d.ts.map +1 -1
  28. package/dist/proxmox/ceph-daemon-form.d.ts +4 -5
  29. package/dist/proxmox/ceph-daemon-form.d.ts.map +1 -1
  30. package/dist/proxmox/ceph-daemon-wire.d.ts +31 -0
  31. package/dist/proxmox/ceph-daemon-wire.d.ts.map +1 -0
  32. package/dist/proxmox/ceph-daemon.d.ts +40 -6
  33. package/dist/proxmox/ceph-daemon.d.ts.map +1 -1
  34. package/dist/proxmox/ceph-fs-distilled.d.ts +33 -0
  35. package/dist/proxmox/ceph-fs-distilled.d.ts.map +1 -0
  36. package/dist/proxmox/ceph-fs-wire.d.ts +20 -11
  37. package/dist/proxmox/ceph-fs-wire.d.ts.map +1 -1
  38. package/dist/proxmox/ceph-fs.d.ts +30 -6
  39. package/dist/proxmox/ceph-fs.d.ts.map +1 -1
  40. package/dist/proxmox/ceph-osd-tree.d.ts +12 -3
  41. package/dist/proxmox/ceph-osd-tree.d.ts.map +1 -1
  42. package/dist/proxmox/ceph-osd-write.d.ts +17 -2
  43. package/dist/proxmox/ceph-osd-write.d.ts.map +1 -1
  44. package/dist/proxmox/ceph-osd.d.ts +6 -0
  45. package/dist/proxmox/ceph-osd.d.ts.map +1 -1
  46. package/dist/proxmox/ceph-pool-settle.d.ts +19 -12
  47. package/dist/proxmox/ceph-pool-settle.d.ts.map +1 -1
  48. package/dist/proxmox/ceph-pool-wire.d.ts +37 -0
  49. package/dist/proxmox/ceph-pool-wire.d.ts.map +1 -0
  50. package/dist/proxmox/ceph-pool.d.ts +10 -5
  51. package/dist/proxmox/ceph-pool.d.ts.map +1 -1
  52. package/dist/proxmox/group-wire.d.ts +8 -13
  53. package/dist/proxmox/group-wire.d.ts.map +1 -1
  54. package/dist/proxmox/index.js +605 -483
  55. package/dist/proxmox/index.js.map +20 -17
  56. package/dist/proxmox/storage-wire.d.ts +15 -11
  57. package/dist/proxmox/storage-wire.d.ts.map +1 -1
  58. package/dist/proxmox/unreadable-read.d.ts +7 -7
  59. package/dist/proxmox/user-wire.d.ts +8 -11
  60. package/dist/proxmox/user-wire.d.ts.map +1 -1
  61. package/dist/proxmox/user.d.ts +5 -5
  62. package/docs/argocd-kubernetes.md +100 -0
  63. package/docs/argocd.md +139 -0
  64. package/docs/credentials.md +9 -0
  65. package/docs/distilled-interim.md +15 -3
  66. package/docs/litellm.md +17 -0
  67. package/docs/peers.md +7 -0
  68. package/docs/provider-standard.md +24 -6
  69. package/docs/proxmox.md +20 -0
  70. package/docs/unifi.md +45 -0
  71. package/docs/upstream-conformance-bun.md +67 -0
  72. package/docs/upstream-conformance-conforms.md +55 -0
  73. package/docs/upstream-conformance-families.md +95 -0
  74. package/docs/upstream-conformance-grafana.md +106 -0
  75. package/docs/upstream-conformance.md +20 -298
  76. package/package.json +8 -3
  77. package/src/argocd/cluster.test.ts +120 -0
  78. package/src/argocd/cluster.ts +222 -0
  79. package/src/argocd/credentials.ts +38 -0
  80. package/src/argocd/fake-argocd.ts +60 -0
  81. package/src/argocd/git-credentials.ts +71 -0
  82. package/src/argocd/index.ts +40 -0
  83. package/src/argocd/providers.ts +17 -0
  84. package/src/argocd/repo-creds.test.ts +123 -0
  85. package/src/argocd/repo-creds.ts +115 -0
  86. package/src/argocd/repository.test.ts +167 -0
  87. package/src/argocd/repository.ts +165 -0
  88. package/src/argocd/resource.ts +150 -0
  89. package/src/cloudflare/r2-bucket-lock.test.ts +54 -18
  90. package/src/cloudflare/r2-bucket-lock.ts +25 -18
  91. package/src/litellm/operations.ts +8 -4
  92. package/src/proxmox/ceph-daemon-form.ts +7 -8
  93. package/src/proxmox/ceph-daemon-wire.ts +112 -0
  94. package/src/proxmox/ceph-daemon-write.test.ts +158 -0
  95. package/src/proxmox/ceph-daemon.ts +70 -53
  96. package/src/proxmox/ceph-fs-delete.test.ts +81 -0
  97. package/src/proxmox/ceph-fs-distilled.ts +100 -0
  98. package/src/proxmox/ceph-fs-wire.ts +17 -31
  99. package/src/proxmox/ceph-fs-write.test.ts +67 -0
  100. package/src/proxmox/ceph-fs.ts +68 -73
  101. package/src/proxmox/ceph-osd-tree.ts +14 -5
  102. package/src/proxmox/ceph-osd-write.test.ts +61 -0
  103. package/src/proxmox/ceph-osd-write.ts +33 -6
  104. package/src/proxmox/ceph-osd.ts +6 -0
  105. package/src/proxmox/ceph-pool-settle.ts +24 -17
  106. package/src/proxmox/ceph-pool-wire.ts +101 -0
  107. package/src/proxmox/ceph-pool-write.test.ts +146 -0
  108. package/src/proxmox/ceph-pool.ts +87 -98
  109. package/src/proxmox/group-wire.ts +7 -12
  110. package/src/proxmox/read-failure-propagation.test.ts +5 -5
  111. package/src/proxmox/storage-wire.ts +9 -10
  112. package/src/proxmox/typed-absence.test.ts +146 -0
  113. package/src/proxmox/unreadable-read.ts +7 -7
  114. package/src/proxmox/user-wire.ts +7 -10
  115. package/src/proxmox/user.ts +5 -5
  116. package/src/proxmox/distilled-task-await.test.ts +0 -124
@@ -0,0 +1,67 @@
1
+ # The Bun line
2
+
3
+ Status: extracted from the [conformance ledger](./upstream-conformance.md); its dated
4
+ measurements and open findings are preserved below.
5
+
6
+ These are non-test files under `src/` that the standard (S42) says must be portable. "Exp"
7
+ marks files exported from a subpath `index.ts`. `git grep` on `origin/main` finds 23 non-test
8
+ files under `src/` that call `Bun.*` or import `node:*`/`bun:*`. Six of them are outside
9
+ S42's scope:
10
+
11
+ - four loopback fakes (`caddy/fake-caddy.ts`, `openbao/fake-bao.ts`, `proxmox/fake-pve.ts`,
12
+ `proxmox/fake-pve-lxc.ts`), which are test-side under S44;
13
+ - `proxmox/provision-cli-fake.ts`, which is used only by tests;
14
+ - `verify/args.ts`, which belongs to the CLI and so is tooling under S43.
15
+
16
+ That leaves 17 files. The table lists them, plus `provision-cli-fake.ts`, which should move
17
+ out of `src/`. The six out-of-scope files still ship in the tarball's `src/`, but no export
18
+ reaches them.
19
+ ⚠️ The first version of this table said 16 files and left out `launchd/job-form.ts`.
20
+ ⚠️ Corrected 2026-09-22: 14 of the 17 break upstream's rule. `launchd/job-form.ts`,
21
+ `proxmox/write-only.ts` and `proxmox/pbs-notification-target-wire.ts` use only synchronous
22
+ `node:crypto` or `Buffer`. Upstream allows those inside `Effect.sync`
23
+ (`AGENTS.md@v2.0.0-beta.79#Workflow`), and 40 upstream `src/` files import `node:crypto`,
24
+ among them `Fly/Secret.ts` and `Railway/Variable.ts`. They were listed under a blanket
25
+ `node:*` ban that upstream does not have.
26
+
27
+ | file | API | exp | portable replacement |
28
+ | ---------------------------------------------------------- | -------------------------------------------- | --- | -------------------------------------------- |
29
+ | `openbao/cloudflare-roles-config.ts` | `Bun.YAML` | yes | parse on the tooling side; pass data in |
30
+ | `openbao/digest.ts` (14 importers) | `Bun.CryptoHasher` | — | `Crypto.digest` + hex; keep `canonical()` ⚠️ |
31
+ | `openbao/cloudflare-parity-snapshot.ts` | `Bun.file`, `Bun.Glob` | — | `FileSystem` + `Path` |
32
+ | `openbao/approle-login-form.ts` | `Bun.file` | — | `FileSystem.readFileString` |
33
+ | `openbao/approle-login-result.ts` | `Bun.inspect` | — | a plain formatter |
34
+ | `openbao/forgejo-bootstrap.ts` | `Bun.spawn` | — | unreferenced; `ChildProcessSpawner` or drop |
35
+ | `talos/credentials.ts` | `Bun.write/file/env/randomUUIDv7`, `node:fs` | — | `FileSystem.makeTempFileScoped` |
36
+ | `talos/kubeconfig.ts` | `Bun.file` | yes | `FileSystem` |
37
+ | `talos/talos-machine-config.ts` | `Bun.file` | yes | `FileSystem` |
38
+ | `talos/values.ts` | `Bun.YAML`, `node:crypto` | — | tooling-side parse; hash may stay |
39
+ | `launchd/local-runner.ts` | `node:child_process`, `node:fs/promises` | yes | H3 above |
40
+ | `launchd/sudo-stage.ts` | `node:fs/promises`, `node:os`, `node:path` | — | `FileSystem`, `Path` |
41
+ | `launchd/job-form.ts` | `node:crypto` (`createHash`) | — | allowed in `Effect.sync` |
42
+ | `linux/ssh-runner.ts` | `node:child_process`, `node:crypto` | yes | H3 above |
43
+ | `caddy/caddy-http-client.ts` | `node:http`, `node:stream` (unix socket) | yes | inherent — an Effect `HttpClient`, not H3 ⚠️ |
44
+ | `proxmox/write-only.ts`, `pbs-notification-target-wire.ts` | `node:crypto`, `node:buffer` | — | allowed in `Effect.sync` ⚠️ |
45
+ | `proxmox/provision-cli-fake.ts` | `Bun.spawn`, `node:fs` | — | test-only; move out of `src/` |
46
+
47
+ The ⚠️ rows:
48
+
49
+ - `openbao/digest.ts`: every `Bao.*` family persists this digest in state, so a swap must
50
+ hash the same bytes (`canonical()`, lowercase hex), or every row plans an update.
51
+ `Crypto.digest` from `effect/Crypto` is in every stack's services and fails with a typed
52
+ error; `alchemy/Util/sha256` wraps WebCrypto in `Effect.promise`.
53
+ - `proxmox/write-only.ts`: a salted scrypt seal with `timingSafeEqual`. No Alchemy helper
54
+ replaces it. A plain `sha256` would make a write-only secret cheap to brute-force from
55
+ state, and it would change the persisted seal format.
56
+ - `caddy/caddy-http-client.ts`: unlike `launchd/local-runner.ts` and `linux/ssh-runner.ts`
57
+ (H3, plain `async` interfaces), this is already the Effect `HttpClient.HttpClient` the
58
+ distilled SDK's own protocol runs on — `node:http` here is the same kind of unavoidable,
59
+ bottom-of-the-stack platform adapter `@effect/platform-node`'s own `NodeHttpClient.ts` is,
60
+ extended with `socketPath` dialing (that module has none) because a unix socket is the
61
+ measured transport a local Caddy needs and neither `FetchHttpClient` (Bun-only `unix`
62
+ option) nor stock `NodeHttpClient` (URL-only) speaks one on both Bun and Node. There is no
63
+ more-portable replacement to point to; the file already conforms to S19 (no async/await,
64
+ no raw `Promise` — `Effect.callback`/`Effect.tryPromise` throughout).
65
+
66
+ Test runners: 51 files import `node:test`/`node:assert` (openbao 42, proxmox 7, forgejo 1,
67
+ talos 1), and 126 import `bun:test`. S43 says `bun:test`.
@@ -0,0 +1,55 @@
1
+ # Upstream conformance: conforming building blocks
2
+
3
+ Status: extracted from the [conformance ledger](./upstream-conformance.md); its dated
4
+ measurements and open findings are preserved below.
5
+
6
+ - **`paperless/*` (`Tag`, `DocumentType`, `StoragePath`, `CustomField`)** — ✅ **S23 fixed
7
+ 2026-09-24** (branch `claude2/distilled-paperless-family`, decision 43, mirroring the
8
+ netbox/forgejo migrations above). Every call now goes through `@distilled.cloud/paperless-ngx`'s
9
+ typed operations, `catchTag('NotFound', …)` replaced the status-carrying `PaperlessError`
10
+ union, and `client.ts`/`errors.ts`/`credentials.ts` are deleted. The shared
11
+ `matching.ts`/`matching-locate.ts` engine (locate-by-name before state, by `output.id` after —
12
+ PR 163) is unchanged in shape. Not published upstream yet, aliased onto
13
+ `@homeflare/distilled-paperless-ngx@0.3.0` — [distilled-interim.md](./distilled-interim.md).
14
+ State did not move: props/attributes stay byte-identical, proven by `tag.test.ts` and the full
15
+ PR 163 regression suite (`tag-identity.test.ts`) against a fake exercising the real distilled
16
+ protocol. ⛔ **Still diverges on credentials (S24):** `PAPERLESS_URL`/`PAPERLESS_TOKEN` are read
17
+ at call time, now through the SDK's `CredentialsFromEnv` — same divergence, unchanged by the
18
+ transport swap.
19
+ - **`github/RepositoryRuleset`** (added 2026-09-23) closes the hazard the row above names:
20
+ probes by name (`read`/`reconcile` both), answers `Unowned` on a cold name match (H1),
21
+ normalizes before comparing so a matching live ruleset is a true noop, and refuses
22
+ (rather than silently drops) a live rule type it does not model. Two recorded
23
+ divergences: the type string sits in upstream's own `GitHub` namespace (H14), and the
24
+ client is Octokit rather than distilled because distilled's `S.Struct` request schemas
25
+ have no field for `require_extra_approval_for_unattributed_changes` (H15) — see
26
+ [repository-ruleset.md](./repository-ruleset.md). `declareRepoPolicy` is rewired onto
27
+ it; the row below is now describing upstream `GitHub.Ruleset` itself, which this family
28
+ does not touch and remains usable directly.
29
+ - **`github/declareRepoPolicy`** composes upstream `GitHub.Repository` and
30
+ `GitHub.Ruleset`. Its one hazard is upstream's own: `Ruleset.read` returns `undefined`
31
+ without prior output, so a first deploy creates a duplicate
32
+ ([repo-policy.md](./repo-policy.md)). The fix belongs upstream: read by name and answer
33
+ `Unowned`. Since 2026-09-23 `declareRepoPolicy` no longer takes this path (see the
34
+ `RepositoryRuleset` row above); this remains accurate for upstream `Ruleset` on its own.
35
+ - **`cloudflare/website.ts`** sets house defaults over upstream `Website.Astro` and
36
+ `Website.Vite`.
37
+ - **`ownership/*`** is built only on `AdoptPolicy`, `Stack`, `State` and `Artifacts`. Its
38
+ apply-time re-check (H2) exists because beta.79 skips the adoption probe while props hold
39
+ an Output. That fix also belongs in the engine upstream.
40
+ - **`verify/*`** (`hf-adopt-verify`) runs Alchemy's own planner. It exists because beta.79
41
+ labels every cold adoption as an update (H6).
42
+ - **`google-workspace/*`** (new 2026-09-24, `Group`, `GroupMember`, `DomainAlias`, `OrgUnit`)
43
+ is built directly on `@distilled.cloud/google-workspace@1.0.0-rc.12`'s typed
44
+ `unstable/admin_directory_v1` operations from the first commit — no hand-rolled client ever
45
+ existed for it to migrate off (S23), so there is no `client.ts` deletion to record. Every
46
+ `fetchLive` is get-by-key with its own `catchTag('NotFound', …)`, the same split forgejo's and
47
+ netbox's engines use (resource.ts). Get-by-key rather than NetBox's list-then-disambiguate,
48
+ since Directory addresses every object this family models by a stable key. ⛔ **Diverges on
49
+ credentials, same shape as the rest of this ledger (S24):** `GOOGLE_ACCESS_TOKEN` is read at
50
+ call time through the SDK's own `CredentialsFromEnv` — but here the SDK provides no way to
51
+ MINT that token at all (no service-account/DWD support), so a Bun wrapper outside this
52
+ package (H8, unwritten by this PR) is load-bearing in a way NetBox's/Forgejo's simple
53
+ API-token env vars are not. SDK gaps (the `unstable/` service tree, no per-operation error
54
+ beyond the shared 4xx set, no group-alias update) and the full credential/scope setup:
55
+ [google-workspace.md](./google-workspace.md).
@@ -0,0 +1,95 @@
1
+ # Upstream conformance: remaining family findings
2
+
3
+ Status: extracted from the [conformance ledger](./upstream-conformance.md); its dated
4
+ measurements and open findings are preserved below.
5
+
6
+ 7. **`proxmox/*` is the model for S38.** Its types and constraints are generated from the
7
+ vendor schema, and a manifest records the version and sha256. It diverges in four ways:
8
+ - the generic factory's `read` returns plain attributes, so every family except `Lxc`
9
+ adopts silently, against the house's own H1;
10
+ - 27 `Effect.die` sites in non-test source (defect risk, not a separate S20 ban);
11
+ - 7 test files on `node:test`;
12
+ - `Pbs.*` type strings (H14).
13
+ 8. **`talos/*`.** Its `talosctl` calls go through `ChildProcessSpawner`, as upstream's Docker
14
+ provider does, which conforms. Its file handling uses `Bun.file`, `Bun.write`,
15
+ `Bun.YAML` and `node:fs` (S42), and it uses `Effect.promise` in 3 files (S19). The
16
+ kubeconfig it writes is meant to be consumed through upstream's
17
+ `Kubernetes.KubeConfig({ path })`.
18
+ 9. **`netbox/*` conforms mostly.** Its constraints are generated from NetBox 4.7.0's
19
+ OpenAPI. Adopting first is documented as deliberate.
20
+ - ✅ **S23 fixed 2026-09-23** (branch `claude2/distilled-netbox-family`, mirroring the
21
+ Forgejo migration above, decision 42). `Netbox.Prefix` now calls
22
+ `@distilled.cloud/netbox`'s typed `ipam` operations instead of a hand-rolled `Effect
23
+ HttpClient` client. The old status-carrying `NetboxError` and its `cause.status ===
24
+ 404` check are gone entirely — `Netbox.Prefix` locates by a server-side list filter,
25
+ which never 404s (an empty page is a normal 200), so nothing here checks a status
26
+ code at all, a stronger form of the same rule `catchTag('NotFound', …)` enforces for
27
+ a family that reads by direct key. `client.ts` is deleted. Not published upstream
28
+ yet, so aliased onto `@homeflare/distilled-netbox@0.2.0` as a plain `dependencies`
29
+ entry, not a peer — [distilled-interim.md](./distilled-interim.md). State did not
30
+ move: props/attributes stay byte-identical, proven by the family's unchanged
31
+ existing tests plus new tests against a fake NetBox exercising the real distilled
32
+ protocol.
33
+ - ⛔ **Still diverges on credentials (S24):** `NETBOX_TOKEN` / `NETBOX_URL` are read at
34
+ call time, now through the SDK's `CredentialsFromEnv` rather than a hand-rolled
35
+ `token()` — same divergence, unchanged by the transport swap.
36
+ 10. **`litellm/*` has no upstream equivalent** (LiteLLM has no upstream Alchemy family, the
37
+ same situation `openbao/*` is in above), and conforms on the transport contract.
38
+ - ✅ **S23 fixed 2026-09-24** (branch `claude2/litellm-distilled`, mirroring the NetBox
39
+ migration above, decision 43). `LiteLLM.PassThroughEndpoint` now calls
40
+ `@distilled.cloud/litellm`'s typed `misc` operations (`operations.ts`) instead of a
41
+ hand-rolled `Effect HttpClient` client. The old status-carrying `LitellmBadRequestError`
42
+ family is gone: every failure the four operations declare (`BadRequest`, `NotFound` on
43
+ update, `UnprocessableEntity`, plus the shared `Unauthorized`/`TooManyRequests`/server
44
+ errors) is the SDK's own typed error, `catchTag`'d — `deletePassThroughEndpoint`'s
45
+ re-list-on-ambiguous-`BadRequest` trick (S21: a status-and-a-real-read decision, never
46
+ body text) is unchanged, now keyed on the tag instead of the status code. The
47
+ per-base-URL write semaphore this vendor's whole-list storage forces (docs/litellm.md)
48
+ is unchanged too — the SDK has no opinion on it, so it stays one layer above the typed
49
+ calls, in `operations.ts`. `client.ts` and the kit's own hand-generated
50
+ `generated/pass-through.ts` are both deleted (the SDK's `misc.PassThroughGenericEndpoint`
51
+ is the same shape, generated from the same LiteLLM 1.100.0 OpenAPI document — see
52
+ `codegen/manifest.json`'s `litellm-openapi` entry, left in place and unconsumed rather
53
+ than deleted, the same pattern the two UniFi entries already establish). Not published
54
+ upstream yet, so aliased onto `@homeflare/distilled-litellm@0.2.0` as a plain
55
+ `dependencies` entry, not a peer — [distilled-interim.md](./distilled-interim.md). State
56
+ did not move: props/attributes stay byte-identical, proven by the family's unchanged
57
+ existing tests (now against a fake LiteLLM exercising the real distilled protocol
58
+ through `FetchHttpClient.Fetch`, not a loopback `Bun.serve`) plus the engine-level
59
+ replace test through `fake-stack.ts`. No stack in this estate currently imports
60
+ `litellmProviders`/`LiteLLM.PassThroughEndpoint` (measured 2026-09-24 across
61
+ homeflare-landscape's own repositories, including this one's `stacks/`), so there is no
62
+ live plan to re-run.
63
+ - ⛔ **Still diverges on credentials (S24):** `LITELLM_PROXY_URL` / `LITELLM_PROXY_API_KEY`
64
+ are read at call time, now through the SDK's `CredentialsFromEnv` rather than a
65
+ hand-rolled `resolveCreds` — same divergence, unchanged by the transport swap.
66
+ - **Credentials resolution, decision 49 (2026-09-24):** the temporary typed-`ConfigError`
67
+ change was reverted in [PR #261](https://github.com/taslabs-net/homeflare-kit/pull/261).
68
+ `CredentialsFromEnv` retains distilled's own `Effect.orDie` convention. S20 forbids it
69
+ in lifecycle operations; it is not a separate credentials-layer prohibition. The same
70
+ shape in NetBox is therefore not an S20 follow-up. See [LiteLLM's Q6 resolution](./litellm.md#credentials).
71
+ 11. **Every family repeats `list: () => Effect.succeed([])`**, 30 times, and only
72
+ `R2BucketLock` and `MeshNode` declare `nuke`. The constructor already defaults `list`
73
+ (S12). **Fix:** write the reason where it differs, and declare `nuke: { skip: true }`
74
+ where nuke must never reach the object.
75
+ 12. **Resource JSDoc is not in upstream's generator format.** Zero files use `@resource`,
76
+ `**Example:**` or `### Section` (S31, H10). **Decision:** maintainer, because it moves
77
+ the house's glyph rationale into `//` comments.
78
+ 13. **Tests never use `alchemy/Test/Bun`.** Every lifecycle is proven against loopback
79
+ fakes (S28, H12). Live suites need a place to run, and that is a maintainer decision.
80
+ 14. **`discord/*` is new (2026-09-24, task-authorized, kit PR TBD) and built directly on
81
+ `@distilled.cloud/discord` — no hand-rolled `client.ts` ever existed to retire.**
82
+ `Discord.ApplicationCommand` and `Discord.GuildApplicationCommand` call the SDK's
83
+ typed operations, `catchTag`'d through the shared `DiscordOpError` union (S21), with no
84
+ status sniffing anywhere in `resource.ts`. It follows upstream's `Snippet.ts` reference
85
+ exactly for a marker-less API (S7, S8): a cold `read` returns `Unowned(attrs)`, and both
86
+ convenience constructors pipe `adopt(true)` (H5) — a stricter posture than `netbox/*`'s
87
+ documented H1 gap, not a repeat of it. Rate-limit handling is the SDK's own default
88
+ `Retry` policy (bounded: `Schedule.recurs(8)`, S26) — this family adds nothing on top.
89
+ Full detail, the live Halibut census and its ownership-handover sequence, and every SDK
90
+ gap: [`discord.md`](./discord.md). ⛔ **Diverges on S24/S25 the same way every distilled
91
+ family in this ledger does:** credentials are read at call time through the SDK's own
92
+ `CredentialsFromEnv`, not a house `alchemy/Auth` provider — unchanged from `netbox/*`
93
+ and `litellm/*`'s entries above. **Gap, not yet fixed:** no vendor constraint table
94
+ (unlike NetBox/Paperless); `options` passed through opaquely rather than modeled from
95
+ the schema (`docs/discord.md#sdk-gaps`).
@@ -0,0 +1,106 @@
1
+ # Upstream conformance: Grafana
2
+
3
+ Status: extracted from the [conformance ledger](./upstream-conformance.md); its dated
4
+ measurements and open findings are preserved below.
5
+
6
+ 15. **`grafana/*` (added 2026-09-24) ships only `Datasource` — a real SDK gap, not scope-trimming.**
7
+ Measured against the published `@distilled.cloud/grafana@1.0.0-rc.12` tarball's
8
+ `lib/services/grafana.d.ts` (4,938 lines): the package has no create/read/update/delete
9
+ operations for folders (only `updateFolderPermissions` exists), plain dashboards (only
10
+ snapshot/public-dashboard routes exist — no `POST /dashboards/db`, no
11
+ `GET/DELETE /dashboards/uid/{uid}`), alert rules or contact points (both have only a
12
+ `routeGet*Export` read-only route under `/v1/provisioning/`, no create/update/delete). S1
13
+ found no upstream `Alchemy` family for any of these either. Full detail:
14
+ [grafana.md](./grafana.md#the-sdk-gap--why-only-datasource-ships).
15
+
16
+ ✅ **S22 fixed 2026-09-24** (branch `claude2/distilled-grafana`): root cause measured to be
17
+ `skipDeprecated: true` dropping 64 operations Grafana's own spec marks `deprecated: true` in
18
+ favor of a separate, undocumented-here Kubernetes-apiserver route — not a spec omission. RFC-6902
19
+ patches un-deprecate exactly the 32 operations this finding named (folders, dashboards,
20
+ alerting-provisioning writes); the other 32 stay excluded. Shipped as
21
+ `@homeflare/distilled-grafana` (0.1.0 pre-release, 0.2.0 once this PR's `minor` changeset
22
+ releases it), aliased onto `@distilled.cloud/grafana` the same S22 route
23
+ `@homeflare/distilled-netbox` established. `Grafana.Datasource`'s props/attributes/generated code
24
+ are unchanged (diffed operation-by-operation against the prior commit).
25
+ - ⚠️ **Knowing departure from upstream (Q8, decision 49 "upstream wins", 2026-09-24, WI-13):**
26
+ upstream's own rule for a deprecated vendor API is to document it _out of scope_, not
27
+ implement it — "Deprecated APIs (superseded by Rulesets etc.) … are documented as out of
28
+ scope in `INDEX.md` rather than implemented" (A `AGENTS.md:155`). The 32 un-deprecated
29
+ operations above do the opposite: they are un-deprecated and implemented. The reason is that
30
+ there is no in-scope replacement to point at instead — Grafana's spec marks these
31
+ `deprecated: true` in favor of a Kubernetes-style aggregated apiserver under
32
+ `/apis/{folder,dashboard,...}.grafana.app/v1…`, and that route family is **absent from the
33
+ pinned spec entirely**: MEASURED 2026-09-24 in the grafana worktree
34
+ (`packages/grafana/specs/spec-mirror-grafana/specs/openapi3.json`), 0 of 207 paths start
35
+ with `/apis` — the un-deprecation patches' own descriptions already say the same thing
36
+ (`packages/grafana/patches/001-undeprecate-folders.patch.json`: "That newer route … [is] not
37
+ present in this spec at all"). Following upstream's rule literally here would mean shipping
38
+ no `Grafana.Folder`/`Dashboard`/alerting-provisioning family at all, on an API the kit
39
+ already needs. The departure is scoped to exactly these 32 operations; the other 32 stay
40
+ excluded, deprecated, out of scope, matching upstream on that half.
41
+
42
+ ✅ **`Grafana.Folder`/`Grafana.Dashboard` shipped** (PR 245, on top of the same
43
+ `@distilled.cloud/grafana` operations S22 unblocked) — the uid-required doctrine, the
44
+ provisioned-object refusal, the parentUid-is-create-only refusal and the volatile-field
45
+ normalization that makes an unchanged dashboard a true noop are all in
46
+ [grafana-folder-dashboard.md](./grafana-folder-dashboard.md), not repeated here.
47
+
48
+ ✅ **`Grafana.ContactPoint`/`Grafana.MuteTiming`/`Grafana.MessageTemplate` shipped** (kit PR
49
+ 250, first of three stacked PRs — `Grafana.AlertRuleGroup` then `Grafana.NotificationPolicy`
50
+ follow):
51
+ the foreign-provenance refusal (`alerting-provenance.ts`, an allowlist of Grafana's own
52
+ `ProvenanceNone`/`ProvenanceAPI` values, measured against `pkg/services/ngalert/models` and
53
+ Grafana's v13.1 docs) and the secret-settings-ref seam (`secret-refs.ts`, shared with
54
+ `Grafana.Datasource`) are both new shared building blocks — full detail:
55
+ [grafana-alerting.md](./grafana-alerting.md).
56
+ - 🔴 **New SDK gap found, not fixed here:** `MuteTimeInterval`'s generated type has no
57
+ `provenance`/`version` fields, and the SDK's own `TimeInterval` type is missing the real
58
+ Alertmanager time-interval fields (`weekdays`/`times`/`months`/etc.) entirely — Grafana's real
59
+ API returns and accepts all of them. NOT a data-loss gap: `@distilled.cloud/core`'s response
60
+ decoding never runs a strict schema decode (`JSON.parse` + a key-rename pass that leaves any
61
+ unmodeled key verbatim — `protocol-http.ts`'s `mapKeys`, confirmed by driving the real
62
+ operation through this family's fake-Grafana harness), so `mute-timing.ts` reads/writes both
63
+ through a locally-widened type instead. Same S22 fix route as the other named gaps
64
+ (regenerate the distilled clone's spec, copy forward) — not attempted here, since
65
+ `packages/distilled-grafana/src/` is vendored and never hand-edited.
66
+ - Measured, read-only, same census as PR 245's: `teslamate-grafana` has no contact points, mute
67
+ timings or templates configured either (consistent with the alerting-provisioning gap having
68
+ been real, not merely unexploited).
69
+
70
+ ✅ **`Grafana.AlertRuleGroup` shipped** (kit PR 254, second of three, branched fresh off `main`
71
+ after PR 250 merged): group, not per-rule, is the unit — `PUT .../rule-groups/{Group}` owns
72
+ evaluation `interval` and the full ordered `rules[]` together, which per-rule operations
73
+ cannot express (no `interval` field, no reordering). Rule order is significant, proven by a
74
+ dedicated test. The per-rule provenance refusal (each `ProvisionedAlertRule.provenance`, since
75
+ the group type itself carries none) reuses `alerting-provenance.ts` unchanged, including the
76
+ missing-means-foreign fix from PR 250's review. A declared group whose folder does not exist
77
+ refuses as a typed `BadRequest` (`RoutePutAlertRuleGroupError` has no `NotFound` case) rather
78
+ than being auto-created — this resource never calls `Grafana.Folder`'s create path. A whole-group
79
+ write silently dropping a live rule not in the declaration (found by that PR's own adversarial
80
+ review) is now warned about loudly rather than silent, never a refusal. Full detail:
81
+ [grafana-alerting-rules.md](./grafana-alerting-rules.md).
82
+
83
+ ✅ **`Grafana.NotificationPolicy` shipped** (this PR, third and last of the stacked PRs,
84
+ branched fresh off `main` after PR 254 merged): a SINGLETON — `fetchLive` never returns
85
+ `undefined` (`RouteGetPolicyTreeError` has no `NotFound` case), so this resource has no create
86
+ or delete in the sense every sibling resource does, only adopt-and-update. `destroy` never
87
+ calls `routeResetPolicyTree` without an explicit `allowReset: true` prop, a gate independent of
88
+ (and in addition to) `defaultRemovalPolicy: 'retain'` — two gates, since resetting wipes the
89
+ WHOLE instance's routing back to Grafana's bare default, not one object. The tree is opaque
90
+ `Record<string, unknown>` (same reasoning as `mute-timing.ts`'s `timeIntervals` — Grafana's
91
+ matcher-expression types are complex unions this family does not hand-model), compared via
92
+ `subset-match.ts` for Grafana-injected-default tolerance, with route order significant. The
93
+ same dropped-item warning kit PR 254 introduced for rule groups is mirrored here for dropped
94
+ routes. Full detail: [grafana-notification-policy.md](./grafana-notification-policy.md).
95
+
96
+ This completes the alerting-provisioning family this project set out to cover.
97
+ - ⛔ **Same open gaps as `forgejo/*` and `netbox/*` above:** `read` never answers `Unowned`
98
+ (H1), and credentials come from an explicit env var NAME at call time rather than an
99
+ `alchemy/Auth` provider (S24) — here the house's own `grafanaCredentials(target)`, not the
100
+ SDK's `CredentialsFromEnv`, because more than one Grafana instance exists on this estate
101
+ (grafana.md's own Credentials section).
102
+ - Measured, read-only, on `teslamate-grafana.service` (CT100, `teslamate/grafana:4.2.0`,
103
+ Grafana 13.1.3): one datasource (file-provisioned, not API-managed — a live example this
104
+ family COULD adopt), dashboards baked into the image (not API-managed either way), and no
105
+ folders, alert rules or contact points configured — consistent with the gap being real
106
+ rather than merely unexploited. No stack yet imports `@homeflare/alchemy/grafana`.