-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat(recency): recipe_recency substrate — last_run_at + run_count #76
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 12 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
59e9ba4
docs(plans): recipe-recency plan with Q1–Q12 resolved
SutuSebastian bcda3a4
feat(recency): recipe_recency schema + engine (Slice 1 of recipe-rece…
SutuSebastian 6ed1c36
feat(recency): wire recordRecipeRun into both write sites (Slice 2)
SutuSebastian 8b8ea45
feat(recency): inline last_run_at + run_count on --recipes-json (Slic…
SutuSebastian d13e170
feat(recency): opt-out config (recipe_recency: false) — Slice 4
SutuSebastian 448e94f
docs(recency): lift to architecture.md + glossary.md, retire plan (Sl…
SutuSebastian 6fcbb18
chore(recency): slim comments + close lifted-to research entry
SutuSebastian 26272fd
chore(changeset): patch bump for recipe-recency tracking
SutuSebastian 649f7d2
fix(db): strip semicolon from `--` comment in createTables (Node CI)
SutuSebastian 5bde603
chore(deps): pin ip-address >=10.2.0 via overrides (CI audit)
SutuSebastian dcf8b08
fix(recency): apply triangulated PR audit (3-agent review)
SutuSebastian b698a4f
docs(recency): apply low-severity audit findings + sweep comments
SutuSebastian df06bca
docs(recency): apply CodeRabbit review — fix stale lazy-on-read prose
SutuSebastian 4a82bf7
refactor(recency): apply CodeRabbit nitpicks (6 of 9)
SutuSebastian 976a223
fix(db): strip `;` from `--` comment + add regression guard
SutuSebastian 5c4485e
chore(recency): final concise-comments sweep before merge
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
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,13 @@ | ||
| --- | ||
| "@stainless-code/codemap": patch | ||
| --- | ||
|
|
||
| **Recipe-recency tracking** — every successful `--recipe` call now writes to a new `recipe_recency(recipe_id PK, last_run_at, run_count)` table. `--recipes-json` and the matching `codemap://recipes` / `codemap://recipes/{id}` MCP resources gain inline `last_run_at: number | null` + `run_count: number` fields per entry, so agent hosts can rank live recipes ahead of historic ones via `jq 'sort_by(.last_run_at // 0) | reverse'`. Default ON; opt-out via `.codemap/config` `recipe_recency: false` (short-circuits before any DB write — no rows ever land). | ||
|
|
||
| Two write sites both call a shared `recordRecipeRun` helper from `application/recipe-recency.ts`: `handleQueryRecipe` in `application/tool-handlers.ts` (covers MCP + HTTP — both flow through it) and `runQueryCmd` in `cli/cmd-query.ts` (CLI — finally-block observes `process.exitCode` as the unified success signal). Counts only successful runs; recency-write failures are swallowed with a stderr `[recency] write failed: <reason>` warning so they NEVER block the recipe response. The 90-day rolling window is enforced lazily on `--recipes-json` reads (no DELETE on the write path). | ||
|
|
||
| The MCP/HTTP catalog cache was dropped — caching the JSON.stringify result alongside recency would freeze `last_run_at` at first-read forever per long-running `codemap mcp` / `codemap serve` lifetime. The underlying `listQueryRecipeCatalog()` is itself module-cached upstream, so the extra cost is one DB-read + one JSON.stringify per call. Schema / skill resources stay cached. | ||
|
|
||
| **Local-only — no upload primitive ever ships.** The Floor exists to resist accumulation pressure. Sibling to `query_baselines` / `coverage`: intentionally absent from `dropAll()` so `--full` and `SCHEMA_VERSION` rebuilds preserve user-activity history. **No `SCHEMA_VERSION` bump** — the new table is purely additive and lands on existing DBs via `CREATE TABLE IF NOT EXISTS` on next boot. | ||
|
|
||
| Schema docs: `architecture.md` § `recipe_recency`. Term entry: `glossary.md`. Bundled agent rule + skill (`templates/agents/`) + dev-side mirror (`.agents/`) updated in lockstep per Rule 10. | ||
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.