-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat(recipes): recipes-as-content registry — bundled .md + project-local .codemap/recipes/ #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
6f3593f
docs(plans): draft recipes-content-registry
SutuSebastian d80d966
docs(plans): settle Q-A — file-pair storage for bundled recipes
SutuSebastian cc0451a
docs(plans): settle Q-B — eager registry load at startup
SutuSebastian f3f9f72
docs(plans): document DB-vs-filesystem rationale + gitignore verifica…
SutuSebastian ec445e3
docs(plans): settle Q-D — YAML frontmatter on .md for project recipe …
SutuSebastian 3132f58
docs(plans): settle Q-E — silent shadowing + shadows flag + agent-ski…
SutuSebastian 6e23bf6
docs(plans): settle Q-F — load-time lexical check + runtime PRAGMA ba…
SutuSebastian b19c603
feat(recipes): loader scaffold + merge logic (Tracer 1 of 6)
SutuSebastian 7fec23e
feat(recipes): migrate bundled recipes to templates/recipes/<id>.{sql…
SutuSebastian 114e01c
feat(recipes): project-local loader for .codemap/recipes/<id>.sql (Tr…
SutuSebastian 0caf6eb
feat(recipes): catalog payload carries source / body / shadows (Trace…
SutuSebastian 05901e9
feat(recipes): YAML frontmatter actions + load-time DML/DDL deny-list…
SutuSebastian 126a518
docs(recipes): architecture/glossary/README/agent rule + skill (Trace…
SutuSebastian e71dddc
fix(recipes): address PR #37 CodeRabbit feedback (1 Major + 6 Minor)
SutuSebastian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| --- | ||
| "@stainless-code/codemap": minor | ||
| --- | ||
|
|
||
| feat(recipes): recipes-as-content registry — bundled .md siblings + project-local recipes | ||
|
|
||
| Two complementary capabilities: | ||
|
|
||
| 1. **Bundled recipes get richer descriptions.** Every bundled recipe in | ||
| `templates/recipes/` is now a `<id>.sql` file paired with an optional | ||
| `<id>.md` description body (replaces the inline TypeScript map in | ||
| `src/cli/query-recipes.ts`). Per-row `actions` templates live in YAML | ||
| frontmatter on the `.md` instead of code. Same surface for end users | ||
| (`--recipe <id>` / `--recipes-json` / `codemap://recipes`); single | ||
| storage shape across bundled + project recipes. | ||
|
|
||
| 2. **Project-local recipes** — drop `<id>.{sql,md}` files into | ||
| `<projectRoot>/.codemap/recipes/` to ship team-internal SQL as first- | ||
| class recipes. Auto-discovered via `--recipe <id>`, surfaced in | ||
| `--recipes-json` and the `codemap://recipes` MCP resource alongside | ||
| bundled. Project recipes win on id collision; the catalog entry | ||
| carries `shadows: true` on overrides so agents reading the catalog | ||
| at session start see when a recipe behaves differently from the | ||
| documented bundled version (per-execution response shape stays | ||
| unchanged — uniformity contract preserved). | ||
|
|
||
| Catalog entries (`--recipes-json` output, `codemap://recipes` | ||
| payload) gain three additive fields: `body` (full Markdown body), | ||
| `source` (`"bundled" | "project"`), and `shadows?` (true on | ||
| project entries that override a bundled id). Existing consumers | ||
| that destructure `{id, description, sql, actions?}` keep working. | ||
|
|
||
| Validation: load-time lexical scan rejects DML / DDL keywords | ||
| (`INSERT` / `UPDATE` / `DELETE` / `DROP` / `CREATE` / `ALTER` / | ||
| `ATTACH` / `DETACH` / `REPLACE` / `TRUNCATE` / `VACUUM` / `PRAGMA`) | ||
| in recipe SQL with recipe-aware error messages — defence in depth | ||
| alongside the runtime `PRAGMA query_only=1` backstop in | ||
| `query-engine.ts` shipped in the previous release. | ||
|
|
||
| Implementation: pure transport-agnostic loader in | ||
| `src/application/recipes-loader.ts`; thin shim in | ||
| `src/cli/query-recipes.ts` preserves backwards-compat exports | ||
| (`QUERY_RECIPES`, `getQueryRecipeSql`, etc.). Hand-rolled YAML | ||
| frontmatter parser scoped to the `actions` shape (no `js-yaml` | ||
| dependency). | ||
|
|
||
| `.codemap.db` is gitignored as before; `.codemap/recipes/` is NOT | ||
| (verified via `git check-ignore`) — recipes are git-tracked source | ||
| code authored for human review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.