Expand description
mushroomdb recall <db>: the body of the UserPromptSubmit hook.
The hook says nothing at all unless the prompt names something — a path, a symbol, a word in backticks. That question is asked once, of the prompt, and it decides both of the shapes below: a prompt made of ordinary words gets no nudge and no digest. The session brief has already told the assistant this repository has a graph and how to reach it, so a hook firing on every prompt has nothing left to say about a prompt that is not about the repository.
Past that gate the hook has two things to say, and says whichever one the moment calls for.
When the prompt arrives from a checkout with a dirty working tree, the change already in progress is the more useful subject: the nudge names what those files reach that is not already open — the files that usually change with them, the files that import them, who owns them, and whether a learned concept has just gone out of date. That is what an assistant would otherwise only find out by reading half the repository.
Otherwise the prompt’s own words are all there is to go on, and the topic
digest answers: pointers to the nodes its identifiers name. The digest
itself is core_api::repograph::recall_digest.
Everything specific to being a hook stays here: reading the payload, opening the store read-only, keeping inside one byte budget, and staying silent on any error. A recall hook must never block or slow the user’s prompt.
Functions§
- run_
recall - The hook body: the nudge for the change in progress, or the digest for the prompt’s own identifiers, or nothing.