Design: mcl-scribe, the one way in and out of a team's knowledge (LLM for text, evolved ranker for judgment) #1

Closed
opened 2026-11-25 13:08:22 +00:00 by uranus · 3 comments
Member

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.svg and assets/c4-container.svg, shown from README.md.

The problem

  • Knowledge is written but rarely read. Over 7 days: 175 writes to local memory files, 16 crew memory notes in mcl-rag, 18 crew memory searches, and 0 general mesh searches or notes.
  • Nothing searches by itself. No hook, session start or standing instruction asks a member to look anything up.
  • One lesson, many copies. The same lesson can sit in a memory file, a crew note and a corpus file. mcl-rag merges only identical text, so the copies come back twice and drift apart.
  • mcl-rag and mcl-graph aren't linked. They share no data and no query.

The design

One way in, one way out. mcl-scribe is an mcl_om mesh service, one OTP 28 release in one container, with five procedures:

Procedure Caller Does
record_lesson a member appends the lesson as written to the scribe log and returns at once with its lesson id and queued; 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, merged into a lesson id, or refused with the reason. While the budget rests the lesson stays queued; nothing is dropped
lesson_status a member a lesson id in, its state from the log out: queued, stored, merged (into which) or refused (why)
search_lessons a member mcl-rag plus mcl-graph, ranked and sourced; the result is logged
brief_package Martha, at package start search, keep the top lessons, the LLM writes a short brief that cites each one; while the budget rests, the brief is the ranked list without prose. Synchronous, it always answers; the lessons shown are logged
report_outcome Martha, from its ledger rounds, PASS or FAIL, send-backs and overrules, logged against the lessons that package was shown: the reward

mcl-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.

  1. v1: the LLM plus fixed rules (similarity threshold, recency), and every input and outcome logged from day one.
  2. brief_package at every package start, so reading happens and the log fills.
  3. v2: faber-neuroevolution evolves a ranker from the log. Version 2 also sets the duplicate threshold and retires stale lessons per realm (v1: fixed values). It runs in shadow beside v1 and is promoted only when it wins on outcomes it was not trained on.

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_lesson answers with the lesson id at once, lesson_status and brief_package answer 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's mind_llm, mind_breaker and mind_budget; a shared library follows later (DECIDED "Copy now, library later"). The reasoning is in architecture/README.md.

Answered (2026-11-25, see the comment below)

  1. Private collections: DECIDED "yes, that's in fact one of the reasons why I introduced (sub) realms, but let's not throw away the idea of private collections alltogether". Privacy is the realm; v1 does not wait; the idea stays at mcl-rag#12.
  2. Every Martha lesson through mcl-scribe: DECIDED "Yes, from v1 (Recommended)".
  3. Model: qwen2.5:7b-instruct on msi00 is v1's default (Supervisor ruling; Raf can overrule).
  4. One scribe per realm: yes, settled by 1.
  5. Briefs unasked: a brief at package start is enough for v1 (Supervisor ruling; Raf can overrule).
  6. Shared LLM library: DECIDED "Copy now, library later (Recommended)".

Open questions

  1. How a merge reaches mcl-rag. mcl-rag merges only identical text. Is a merge retire_document on the old lesson plus add_knowledge of 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

  • The design is read (fable) and the open questions are answered or deferred by name.
  • The C4 context and container diagrams are on main, shown from README.md, and c4_model.sh --design passes.
  • Packages for v1 are filed from this design.
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.svg` and `assets/c4-container.svg`, shown from `README.md`. ## The problem - **Knowledge is written but rarely read.** Over 7 days: 175 writes to local memory files, 16 crew memory notes in mcl-rag, 18 crew memory searches, and 0 general mesh searches or notes. - **Nothing searches by itself.** No hook, session start or standing instruction asks a member to look anything up. - **One lesson, many copies.** The same lesson can sit in a memory file, a crew note and a corpus file. mcl-rag merges only identical text, so the copies come back twice and drift apart. - **mcl-rag and mcl-graph aren't linked.** They share no data and no query. ## The design **One way in, one way out.** mcl-scribe is an `mcl_om` mesh service, one OTP 28 release in one container, with five procedures: | Procedure | Caller | Does | | --- | --- | --- | | `record_lesson` | a member | appends the lesson as written to the scribe log and **returns at once with its lesson id and `queued`**; 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`, `merged` into a lesson id, or `refused` with the reason. While the budget rests the lesson stays `queued`; nothing is dropped | | `lesson_status` | a member | a lesson id in, its state from the log out: `queued`, `stored`, `merged` (into which) or `refused` (why) | | `search_lessons` | a member | mcl-rag plus mcl-graph, ranked and sourced; the result is logged | | `brief_package` | Martha, at package start | search, keep the top lessons, the LLM writes a short brief that cites each one; while the budget rests, the brief is the ranked list without prose. Synchronous, it always answers; the lessons shown are logged | | `report_outcome` | Martha, from its ledger | rounds, PASS or FAIL, send-backs and overrules, logged against the lessons that package was shown: the reward | mcl-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.** 1. v1: the LLM plus fixed rules (similarity threshold, recency), and every input and outcome logged from day one. 2. `brief_package` at every package start, so reading happens and the log fills. 3. v2: faber-neuroevolution evolves a ranker from the log. Version 2 also sets the duplicate threshold and retires stale lessons per realm (v1: fixed values). It runs in shadow beside v1 and is promoted only when it wins on outcomes it was not trained on. **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_lesson` answers with the lesson id at once, `lesson_status` and `brief_package` answer 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's `mind_llm`, `mind_breaker` and `mind_budget`; a shared library follows later (DECIDED "Copy now, library later"). The reasoning is in `architecture/README.md`. ## Answered (2026-11-25, see the comment below) 1. **Private collections:** DECIDED "yes, that's in fact one of the reasons why I introduced (sub) realms, but let's not throw away the idea of private collections alltogether". Privacy is the realm; v1 does not wait; the idea stays at mcl-rag#12. 2. **Every Martha lesson through mcl-scribe:** DECIDED "Yes, from v1 (Recommended)". 3. **Model:** `qwen2.5:7b-instruct` on msi00 is v1's default (Supervisor ruling; Raf can overrule). 4. **One scribe per realm:** yes, settled by 1. 5. **Briefs unasked:** a brief at package start is enough for v1 (Supervisor ruling; Raf can overrule). 6. **Shared LLM library:** DECIDED "Copy now, library later (Recommended)". ## Open questions 7. **How a merge reaches mcl-rag.** mcl-rag merges only identical text. Is a merge `retire_document` on the old lesson plus `add_knowledge` of 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 - [ ] The design is read (fable) and the open questions are answered or deferred by name. - [ ] The C4 context and container diagrams are on `main`, shown from `README.md`, and `c4_model.sh --design` passes. - [ ] Packages for v1 are filed from this design.
Author
Member

Answers to the open questions (2026-11-25):

  • Q1, private collections: Raf DECIDED "yes, that's in fact one of the reasons why I introduced (sub) realms, but let's not throw away the idea of private collections alltogether".
    • A team's privacy comes from its own realm or sub-realm, with one mcl-rag and one mcl-scribe per realm.
    • v1 doesn't wait for private collections in mcl-rag. The idea is kept, unscheduled, at macula-services/mcl-rag#12.
    • The "private stays in the scribe log" rule is dropped.
  • Q2, every Martha lesson through mcl-scribe: Raf DECIDED "Yes, from v1 (Recommended)".
    • From v1, every Martha lesson goes through record_lesson, and mcl-scribe writes mcl-rag, mcl-graph and the anonymized corpus push.
    • Until v1 runs, members push to the corpus themselves.
  • Q3, model: Supervisor ruling, which Raf can overrule: qwen2.5:7b-instruct on msi00 is v1's default.
  • Q4, one scribe per realm: settled by Q1.
  • Q5, briefs unasked: Supervisor ruling, which Raf can overrule: a brief at package start is enough for v1.
  • Q6, shared LLM library: Raf DECIDED "Copy now, library later (Recommended)".
  • Q7, how a merge reaches mcl-rag: still open.

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.

Answers to the open questions (2026-11-25): - **Q1, private collections:** Raf DECIDED "yes, that's in fact one of the reasons why I introduced (sub) realms, but let's not throw away the idea of private collections alltogether". - A team's privacy comes from its own realm or sub-realm, with one mcl-rag and one mcl-scribe per realm. - v1 doesn't wait for private collections in mcl-rag. The idea is kept, unscheduled, at macula-services/mcl-rag#12. - The "private stays in the scribe log" rule is dropped. - **Q2, every Martha lesson through mcl-scribe:** Raf DECIDED "Yes, from v1 (Recommended)". - From v1, every Martha lesson goes through `record_lesson`, and mcl-scribe writes mcl-rag, mcl-graph and the anonymized corpus push. - Until v1 runs, members push to the corpus themselves. - **Q3, model:** Supervisor ruling, which Raf can overrule: `qwen2.5:7b-instruct` on msi00 is v1's default. - **Q4, one scribe per realm:** settled by Q1. - **Q5, briefs unasked:** Supervisor ruling, which Raf can overrule: a brief at package start is enough for v1. - **Q6, shared LLM library:** Raf DECIDED "Copy now, library later (Recommended)". - **Q7, how a merge reaches mcl-rag:** still open. 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.
Owner

Q7, how a merge reaches mcl-rag: Supervisor ruling (Raf can overrule). Use the procedures mcl-rag already has: add_knowledge for the merged text, then retire_document on 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.

**Q7, how a merge reaches mcl-rag: Supervisor ruling (Raf can overrule).** Use the procedures mcl-rag already has: `add_knowledge` for the merged text, then `retire_document` on 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.
Author
Member

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.

# Slice After
#4 1: record_lesson and lesson_status, stored as written (walking skeleton: release, scribe log, leak scan, mcl-rag store, tag CI) —
#5 2: the model generalizes and anonymizes, under a rate and a daily cap (copies spartan's mind_llm, mind_breaker, mind_budget) #4
#6 3: judge duplicates and merge: add, then retire (Q7) #5
#7 4: links in mcl-graph #5
#8 5: corpus push, optional, after the leak scan #4
#9 6: search_lessons, v1 ranker, logged #4, #7
#10 7: brief_package #9
#11 8: report_outcome #10
#12 9: grants: realm only, Martha alone for brief and outcome #4, before any deploy

Outside this repo:

  • martha-ai/martha#190: Martha records lessons through the scribe, briefs at package start, reports outcomes.
  • macula-io/macula-fleet#78: msi00 runs mcl-scribe beside mcl-rag (qwen2.5:7b-instruct-q4_K_M is already on msi00's ollama).

Done when, all met:

  • Design read: Mars PASS, PR 2 r2 (fable). Open questions answered by name: Q1–Q7.
  • C4 context and container on main, shown from README.md (PRs 2 and 3).
  • v1 packages filed: above.

Closing as met. Placement is Mars's.

**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. | # | Slice | After | | --- | --- | --- | | #4 | 1: record_lesson and lesson_status, stored as written (walking skeleton: release, scribe log, leak scan, mcl-rag store, tag CI) | — | | #5 | 2: the model generalizes and anonymizes, under a rate and a daily cap (copies spartan's mind_llm, mind_breaker, mind_budget) | #4 | | #6 | 3: judge duplicates and merge: add, then retire (Q7) | #5 | | #7 | 4: links in mcl-graph | #5 | | #8 | 5: corpus push, optional, after the leak scan | #4 | | #9 | 6: search_lessons, v1 ranker, logged | #4, #7 | | #10 | 7: brief_package | #9 | | #11 | 8: report_outcome | #10 | | #12 | 9: grants: realm only, Martha alone for brief and outcome | #4, before any deploy | Outside this repo: - martha-ai/martha#190: Martha records lessons through the scribe, briefs at package start, reports outcomes. - macula-io/macula-fleet#78: msi00 runs mcl-scribe beside mcl-rag (`qwen2.5:7b-instruct-q4_K_M` is already on msi00's ollama). Done when, all met: - Design read: Mars PASS, PR 2 r2 (fable). Open questions answered by name: Q1–Q7. - C4 context and container on main, shown from README.md (PRs 2 and 3). - v1 packages filed: above. Closing as met. Placement is Mars's.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
macula-services/mcl-scribe#1
No description provided.