Repository navigation
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #163
A procedure that goes 30 days without use turns stale, and recall then asks for a ranked semantic score of at least 0.6 on top of the exact and lexical evidence. Without the embedding model, which is the default, that score is always 0, so a stale procedure failed the gate on every prompt however exact the match. It could not become active again through use, and after 90 days it was archived. With a pagination procedure learned for
src/paginate.jsand left idle for 40 days,trodden recall "Page 2 of the listing repeats the last item. Fix the pagination in src/paginate.js."showed it as the only candidate, top on lexical and matching the path, and still said "Nothing to inject: the best match was not close enough."When the procedure has no cosine at all, the stale gate now replaces the cosine threshold with stricter lexical and exact evidence instead: the procedure must still be top on lexical rank with at least 2 of exact weight, as before, and on top of that one of the exact matches has to be a file path or an error signature, and the prompt must not be of a different task kind or about a different artifact than the procedure. So an active procedure without embeddings can still be recalled on a symbol plus a command, but a stale one needs the path or the error itself. The envelope already tells the agent that the procedure has not been used in over a month, and once it is served and settled it becomes active again.
The embedding path is unchanged. Whenever a cosine exists for the procedure, stale recall still needs it ranked in the semantic top ten at 0.6 or more, so the calibration for installs with embeddings stays as it was. The ambiguity check after the gate also still applies, so a stale procedure tied with another family abstains as before.
To reproduce, I built the binary, seeded a scratch
TRODDEN_HOMEwith the pagination procedure scoped to a scratch git repository, backdated its last use by 40 days and ingested a session so aging marked it stale. Before the change, the exact prompt above abstained. After it, the same prompt injects the procedure with the "not used in over a month" line, while "Run npm test after you fix paginate so page 2 stops repeating." (a symbol and the check, but no path) still abstains as not confident, and an unrelated prompt matches nothing.New tests recall a stale procedure on an exact path without embeddings, and fail on the old gate. Guard tests compare an active and a stale copy of the same procedure: the symbol-plus-command prompt recalls the active one but not the stale one, and an add prompt on the same file, an unrelated prompt and a prompt about another feature recall nothing stale. Two more tests pin the embedding path: a stale procedure is confident only from a ranked cosine of 0.6, never when it is outside the semantic ranking, and a far prompt with embeddings still abstains.