Skip to content

Librarian — Corpus & Curation

The Librarian is the single write gate. Every source — whether Scout discovered it, Sentinel flagged it, or you uploaded it — becomes a change set that a human reviews before anything reaches the corpus. This human-in-the-loop (HITL) gate is the core of Polaris.

What the Librarian does

flowchart LR
    ING[Ingest document] --> EX[Background extraction] --> CS[Change set]
    CS --> RV[Review: include / exclude / resolve] --> AP{Approve?}
    AP -->|yes| DR[Draft]
    AP -->|no| REJ[Rejected]
    DR --> CERT[Certify & publish] --> VER[Published version]

The Librarian dashboard

The header — Corpus & curation — shows a Librarian status pill, an amber "N awaiting review" chip when change sets need attention, a Certify & publish button, and a settings gear.

Stat tiles: Sources · Knowledge units (facts + rubrics) · Graph entities · Vectors.

The body is two columns:

  • Left (live work) — the Awaiting review queue, the Reviewed ledger, and the Change ledger (audit).
  • Right (status) — the pipeline funnel, lifecycle stepper, coverage, and indexed sources.

Ingesting a document

Use Add document to ingest a file directly. Supported types are .txt, .md, .markdown, .pdf, .docx, up to 5 MB. After submission you'll see "Submitted … extracting in the background; the change set will appear shortly."

Documents targeted from Scout or confirmed from Sentinel arrive the same way — you'll see an optimistic "Extracting & staging…" row until the real change set lands.

The awaiting-review queue

Each row shows the change set's id and title, submitter and date, a status pill, fact/rubric count badges, a confidence percentage, and — in amber — any escalation count. Click a row to open the review sheet.

Reviewing a change set (the HITL gate)

The review sheet is where curation happens. You can:

  1. Include or exclude each proposed knowledge unit.
  2. Resolve escalations — items that require an explicit decision. Commit stays disabled until every escalation is resolved.
  3. Preview the resulting artifact.
  4. Approve (commit the included units to the draft) or reject.

Outcomes surface as toasts on the dashboard. Approved and rejected sets move to the Reviewed ledger; every action is recorded in the Change ledger.

(Reviewing requires the review capability — Curator or Admin.)

Wiki proposals

Alongside change sets, the Librarian is where wiki-originated proposals are reviewed. When a Curator proposes an edit, flag-for-removal (prune), or enrichment from a Wiki article, it lands here as a proposal.

  • Each proposal shows its intent (enrich / edit / prune), the target concept, who proposed it, and — for an enrichment — the grounding confidence.
  • Confirm applies the change to the draft via the audited edit primitives; Dismiss records the decision with no corpus effect. Any Curator or Admin may confirm — including the proposer.
  • A prune that would strand neighbouring concepts surfaces a needs-resolution notice; resolve the orphans (keep / remove / reattach) first, exactly like removing concepts.

Confirmed proposals become part of the draft and go live on the next Certify & publish. This is the same governed loop Sentinel uses for confirmed flags — see Wiki › How this relates to the Sentinel flow.

Certify & publish

When the draft is ready, click Certify & publish (requires the certify capability):

  • If any reviewable items would be excluded, you're asked to confirm first.
  • Certification runs a safety hard-gate; the button shows Certifying… N% while it works.
  • On success a new immutable version is published — and the Wiki is (re)generated. The Advisor serves only from published versions.

Removing concepts

The Librarian can also remove concepts from the draft. When a removal would strand a concept, an orphan resolution step appears: for each stranded concept you choose Keep, Remove, or Reattach (to a target). Every orphan must be resolved before the removal can be committed.

Status & history panels

Panel Shows
Reviewed ledger History of approved/rejected change sets with a running tally.
Change ledger (audit) Actor/action rows over a selectable time window (1h / 12h / 1d / 7d).
Pipeline The curation funnel: In review → Awaiting certification → Published.
Lifecycle Draft → Certify → Publish stepper, safety-eval checklist, and Q&A / grounding progress.
Coverage Knowledge depth per practice area, with source counts.
Indexed sources Ingested documents with type, units, jurisdiction, and an extracted / pending pill.

\"Extracted\" is not \"in the corpus\"

An extracted source still needs curator approval through the review gate before it becomes part of the published brain.

Role summary

Action Minimum role
View queues & ledgers Reader
Ingest, review/approve, certify & publish, remove concepts Curator