Editors
lore in Emacs
lore.el puts lore’s answers where you edit. Open any file in a lore repo and the notes that govern it are beside it, every citation is a link, and lore check problems are diagnostics at their lines.
import { sign, verify } from "./jwt";
import { store, SessionError } from "./store";
// see lore:decision/0002 -- a refresh token is good for one use.
export async function refresh(token: string) {
const claims = verify(token);
if (!(await store.consume(token))) {
throw new SessionError("refresh token already used");
}
return issue(claims);
}
pkg/auth/session.ts
3 notes
Rotating refresh tokens Decision, accepted
cited at session.ts:4
Refresh tokens rotate on every use; access
tokens last 15 minutes.
Auth Spec, accepted
anchor pkg/auth/**; spec of Rotating refresh tokens
Who can sign in, how, and for how long.
Auth package
CONTEXT.md in pkg/auth/
Owns session issuance and validation. Never
import from pkg/billing.The sidebar text is what lore-sidebar-mode renders for this file. The mode line counts the notes, and eldoc shows the summary of the note under point.
Set up
The package is editors/emacs/lore.el, built by the flake as packages.<system>.emacs. It needs Emacs 29 or later and lore on exec-path.
(require 'lore)
(global-lore-mode 1)
(keymap-global-set "C-c l" lore-command-map)
global-lore-mode turns lore-mode on only in files under a directory with .lore/, so it costs nothing elsewhere.
The sidebar
M-x lore-sidebar-mode opens a side window listing the notes for the selected file, in lore context order: the title, which is a button that opens the note, its type and status, why it matched, and its summary. Set lore-sidebar-full to see bodies too.
It follows you. Switch windows or buffers and it refreshes after a moment of idle; save any file and it fetches again, since a saved note can change what governs anything.
Follow citations and links
M-. on a citation in code, lore:decision/0002, or on a link in a note, [[spec/auth]], [[spec/auth][the spec]] or [[file:prd.org][the PRD]], opens the note. M-? lists everything pointing at it: the code citing it and the notes linking to it.
Off a citation or link, M-. falls through to your usual backend, so it sits alongside eglot or lsp-mode without taking over.
While you write
- Eldoc shows the title and summary of the note named at point.
- Completion after
[[orlore:offers every note’s name, annotated with its title. Type the filename and it finds the name:bilcompletes tospec/billing. - Flymake reports
lore checkproblems for the file at their lines: a broken link, a bad status, a citation of a superseded decision. - The mode line shows
lore:N, the number of notes governing the file, once lore has answered. lore runs in the background and never blocks typing.
Commands
| Key | Command | Does |
|---|---|---|
| n | lore-next | lore next, with repo paths as buttons. |
| s | lore-show | Show a note, chosen with completion. |
| c | lore-check | A compilation buffer, so next-error walks the problems. |
| N | lore-new | Pick a type from the schema, give a title, and visit the new note. |
| t | lore-tick | Save, tick the next item, revert, and name the next one. |
| f | lore-freeze | Save, freeze the effort, revert. |
| l | lore-sidebar-mode | Toggle the sidebar. |
| g | lore-refresh | Refresh the sidebar now. |
The keys are on lore-command-map, under whatever prefix you bind it to.
Org
In Org, lore: is a link type: [[lore:decision/0002][rotating tokens]] opens the note with C-c C-o, from any Org file inside the repo.
Limits
lore reads files from disk, so the sidebar and Flymake reflect the file as last saved. lore.el keeps no index of its own; beyond a few seconds of cached note names for completion, every answer comes from lore. Everything it uses is lore … --json, which is also the interface to build another editor’s integration on.
bun run test:emacs runs its tests in a batch Emacs against a real repo, and nix flake check runs them too.