Design: mcl-scribe, the one way in and out of a team's knowledge (LLM for text, evolved ranker for judgment) #1
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Purpose (design): agree how mcl-scribe works before any code. It is the one way in and the one way out of a team's knowledge in mcl-rag and mcl-graph, and it runs on someone's own hardware with little friction.
DECIDED 2026-11-25: "yes! This must come directly behind Martha's initial release" and "v0.4.2 counts, start now". The starting point is Raf's doc mcl-scribe: a knowledge steward for mcl-rag and mcl-graph. The constraint is DECIDED 2026-11-23: "people are supposed to be able to run a mcl service ON THEIR OWN HARDWARE WITHOUT TOO MUCH FRICTION".
The C4 model (context and containers) is on the design branch in
architecture/README.md,assets/c4-context.svgandassets/c4-container.svg, shown fromREADME.md.The problem
The design
One way in, one way out. mcl-scribe is an
mcl_ommesh service, one OTP 28 release in one container, with five procedures:record_lessonqueued; it never waits for the model. In the background, in log order, at the model's rate and under its daily cap: 1. the LLM generalizes and anonymizes it; 2. the deterministic leak scan refuses it by name if anything private is left; 3. the LLM judges it against its nearest neighbours from mcl-rag, then merges it or stores it new (add_knowledge); 4. the LLM extracts services, rules and failure kinds into mcl-graph (learn_link). The final state goes to the log:stored,mergedinto a lesson id, orrefusedwith the reason. While the budget rests the lesson staysqueued; nothing is droppedlesson_statusqueued,stored,merged(into which) orrefused(why)search_lessonsbrief_packagereport_outcomemcl-scribe serves one realm: one mcl-rag and one mcl-scribe per realm or sub-realm, and no caller outside the realm is granted its procedures. From v1, every Martha lesson goes through
record_lesson, and mcl-scribe writes mcl-rag, mcl-graph and the anonymized corpus push (libgit2, after the leak scan; optional for a self-hoster). Until v1 runs, members push to the corpus themselves.Two engines, each for its job. A small local LLM on ollama does the text work: rewrite, judge duplicates, extract, write. CPU is enough, and a model is a setting, not a dependency. A faber-tweann network ranks results and later decides when to surface a lesson unasked: numbers in, a score out, improving with reward. Its inputs are similarity, age, how often the lesson was shown, its outcomes, whether its services match the package's repository, and the member's role.
Learning path.
brief_packageat every package start, so reading happens and the log fills.State. A reckon-db store (the scribe log) holds every lesson, search, brief and outcome as an event. Read models are rebuilt at boot, and the store is v2's training set. Besides that: a read-only leak-rules file the operator owns, and the mcl-om identity key volume.
Own hardware. One container and ollama make the whole install: no GPU, no API key, no database server, no Python. Without a model it still runs: lessons are taken only if they pass the scan as written, duplicates are judged by threshold, and a brief is a ranked list without prose.
Privacy is the realm; it never rests on the model. A team's privacy comes from its own realm or sub-realm. Every rewrite goes through the leak scan, and a refused lesson goes nowhere. The corpus push is the one way out of the realm, so it is optional and comes after the scan. Private collections inside one mcl-rag are kept as an idea, unscheduled, at macula-services/mcl-rag#12.
Not an mcl-spartan mind (weighed on request). A spartan mind with a scribe charter would bring a pool, a rate clock, a token cap and harness provenance for free. But it drops an item that arrives inside its clock (a lesson must never be dropped; the scribe log is the queue), it offers no procedure (
record_lessonanswers with the lesson id at once,lesson_statusandbrief_packageanswer too), one charter is one prompt (scribe has four, two of them with structured output), and two services double a self-hoster's install. So mcl-scribe calls the model itself. v1 copies spartan'smind_llm,mind_breakerandmind_budget; a shared library follows later (DECIDED "Copy now, library later"). The reasoning is inarchitecture/README.md.Answered (2026-11-25, see the comment below)
qwen2.5:7b-instructon msi00 is v1's default (Supervisor ruling; Raf can overrule).Open questions
retire_documenton the old lesson plusadd_knowledgeof the merged text (both operator procedures, so mcl-scribe is an mcl-rag operator), or a new mcl-rag procedure that replaces a document in place?Done when
main, shown fromREADME.md, andc4_model.sh --designpasses.Answers to the open questions (2026-11-25):
record_lesson, and mcl-scribe writes mcl-rag, mcl-graph and the anonymized corpus push.qwen2.5:7b-instructon msi00 is v1's default.The design, the C4 model and this issue's body are updated to match. The model now shows mcl-corpus as something mcl-scribe writes.
Q7, how a merge reaches mcl-rag: Supervisor ruling (Raf can overrule). Use the procedures mcl-rag already has:
add_knowledgefor the merged text, thenretire_documenton the old lesson. mcl-scribe runs one per realm beside that realm's mcl-rag, so it is that mcl-rag's operator. No new mcl-rag procedure. Add first, retire second, so a failure in between leaves a duplicate for a while, never a lost lesson; the scribe log records both steps and retries the retire. This is the simplest path, and it changes nothing in mcl-rag for v1. All open questions are now answered; v1 packages can be filed.v1 packages filed (2026-11-25), from this design on main
266b15a8. Every open question is answered: Q1–Q6 in comment 4632, Q7 by the Supervisor's ruling in comment 4644.Outside this repo:
qwen2.5:7b-instruct-q4_K_Mis already on msi00's ollama).Done when, all met:
Closing as met. Placement is Mars's.