feat(capabilities): pin public capability surface to a tracked manifest#376
feat(capabilities): pin public capability surface to a tracked manifest#376
Conversation
Introduce a single machine-checked source of truth for the capability claims sqlode makes to public consumers, so new CHANGELOG / README lines cannot silently drift from what the code actually supports. - `src/sqlode/capabilities.gleam` exports the supported engine, runtime, type-mapping, macro, and placeholder-style lists, plus a split between fully-supported and parsed-but-rejected (`:batchone` / `:batchmany` / `:batchexec` / `:copyfrom`) query annotations. Every list derives directly from the `model` / `runtime` types the rest of the compiler uses, so dropping a capability there triggers a compile error here. - `src/sqlode/capabilities.manifest_markdown/0` renders the lists into a stable Markdown manifest. - `doc/capabilities.md` is the committed snapshot. - `test/capabilities_test.gleam` asserts `capabilities.manifest_markdown() == doc/capabilities.md` and prints the expected content on failure so regenerating is a copy/paste; also pins that every advertised section is present in the render and that no category list goes empty. - `CHANGELOG.md` stops claiming batch / copyfrom as "added" and instead calls out that those annotations are parsed for sqlc compatibility but currently fail generation with an unsupported-annotation error, mirroring `generate.gleam` and the README's "Planned annotations" section. `doc/reference/` stays gitignored, per the Issue's suggestion to treat it as disposable research material; public-facing claims now live under the tracked `doc/capabilities.md` instead. Closes #365
ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR introduces a new capabilities module ( Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
Summary
Make sqlode's public capability claims traceable to a single source of truth, so future CHANGELOG / README / doc edits cannot silently drift from what the code actually supports. Introduces a tiny
capabilitiesmodule, a trackeddoc/capabilities.mdsnapshot, a Gleam test that pins the two against each other, and fixes the CHANGELOG entry that overclaimed:batchone/:batchmany/:batchexec/:copyfromas shipped features. Closes #365.Changes
src/sqlode/capabilities.gleam(new): exports the supported engine, runtime, type-mapping, macro, and placeholder-style lists, plus a split between fully-supported query annotations and the ones parsed for sqlc compatibility but currently rejected bygenerate.validate_unsupported_annotations. Each list usesmodel/runtimevalues so a capability cannot be emitted without the enum variant existing;manifest_markdown/0renders them into a stable Markdown manifest.doc/capabilities.md(new, tracked): the committed snapshot.test/capabilities_test.gleam(new): assertscapabilities.manifest_markdown() == doc/capabilities.mdcontents and prints the expected output on failure so regenerating is a copy/paste. Also pins that every advertised section is present in the render and that no capability list goes empty.CHANGELOG.md: replace the line that claimed all ten query annotations were "added" with wording that mirrorsgenerate.gleamand the README's "Planned annotations" section — six are fully supported, four are parsed-but-rejected.Design Decisions
--- expected ---markers intodoc/capabilities.md". No external script or separatejust capabilitiesrecipe to get out of sync.:batchone/:batchmany/:batchexec/:copyfrom, and so does sqlode's parser, but generation currently refuses them. Listing both groups with distinct headings matches the README's "Planned annotations" section and makes the gap visible to anyone reading the manifest.doc/reference/stays gitignored. The Issue explicitly flagged it as research material that should be disposable. The tracked public surface now lives at the newdoc/capabilities.mdinstead, so users reading the repo do not see the stale drift.Limitations
manifest_markdownforces a doc update. That is intentional — the point of the snapshot is to catch unreviewed changes to the public surface — but it does mean the manifest's wording is part of the test contract.doc/reference/specs/sqlc-compatibility.mdanddoc/reference/design/sqlode-architecture.mdare not touched here becausedoc/reference/is gitignored. They can still drift locally; the Issue's "treat as disposable" position stands.Summary by CodeRabbit
Documentation