Skip to content

armgit / xerj

Public Imported from GitHub
0

AI search engine and MCP server for bots and agents. One Rust binary indexes code, docs, logs, JSONL/CSV and PDFs for BM25 full-text, vector and hybrid search, code search without grep, agent memory and RAG. Elasticsearch-compatible API; Corpus Hub serves hundreds of reference memory corpora.

fix(console): corpus-aware Second Brain vocabulary (#1100)

xerj-org8e01de99c45e
diff --git a/xerj-ux/src/dashboards/second-brain.js b/xerj-ux/src/dashboards/second-brain.js
index 50310391f..37a6620b5 100644
--- a/xerj-ux/src/dashboards/second-brain.js
+++ b/xerj-ux/src/dashboards/second-brain.js
@@ -32,6 +32,7 @@
import { renderPanelBody } from '../ux/ego-ledger.js';
import { sbAfterRender } from '../data/second-brain-api.js';
+import { vocabFor } from '../ux/sb-vocab.js';
/** One panel body: renderPanelBody draws the inner HTML; the
* `data-sb-body` wrapper is the in-place re-render target the
@@ -45,6 +46,9 @@ export const secondBrain = {
// Traces + the map mount need real layout; schedule a post-paint
// measure+draw pass. No-op outside a browser.
sbAfterRender();
+ // #1100: eyebrows speak the corpus's own frame — "notes / believed" for
+ // a note-like corpus, the neutral "records / active" frame otherwise.
+ const voc = vocabFor(!!(data && data.sb && data.sb.noteLike));
return {
title: 'SECOND BRAIN',
// "EVERY LINK SHOWS ITS EVIDENCE", not "HAS A QUOTE": manual and
@@ -67,9 +71,9 @@ export const secondBrain = {
render: () => body('controls', data) },
{ id: 'map', eyebrow: 'THE MAP · THE WHOLE BRAIN AT A GLANCE', cols: 12, type: 'map',
render: () => body('map', data) },
- { id: 'scrub', eyebrow: 'BELIEF TIME · ONE CARET DRIVES THE WHOLE PAGE', cols: 12, type: 'scrub',
+ { id: 'scrub', eyebrow: `${voc.timeAxis} · ONE CARET DRIVES THE WHOLE PAGE`, cols: 12, type: 'scrub',
render: () => body('scrub', data) },
- { id: 'edgesLive', eyebrow: 'BELIEVED AT THIS MOMENT', cols: 3, type: 'metric',
+ { id: 'edgesLive', eyebrow: voc.atMoment, cols: 3, type: 'metric',
render: () => body('edgesLive', data) },
{ id: 'edgesTotal', eyebrow: 'EVER ASSERTED', cols: 3, type: 'metric',
render: () => body('edgesTotal', data) },
@@ -77,7 +81,7 @@ export const secondBrain = {
render: () => body('invalidated', data) },
{ id: 'detectors', eyebrow: 'WHAT TAUGHT THIS BRAIN', cols: 3, type: 'metric',
render: () => body('detectors', data) },
- { id: 'typeDist', eyebrow: 'HOW NOTES CONNECT', cols: 6, type: 'dist',
+ { id: 'typeDist', eyebrow: voc.typeDistEye, cols: 6, type: 'dist',
render: () => body('typeDist', data) },
{ id: 'edgeTimeline', eyebrow: 'NEW LINKS PER DAY', cols: 6, type: 'series',
render: () => body('edgeTimeline', data) },
@@ -87,7 +91,7 @@ export const secondBrain = {
render: () => body('crossings', data) },
{ id: 'reads', eyebrow: 'WHAT THIS VIEW READ · AND WHY', cols: 4, type: 'reads',
render: () => body('reads', data) },
- { id: 'ego', eyebrow: 'THE LEDGER · ONE NOTE, EVERYTHING IT TOUCHES', cols: 12, type: 'ego',
+ { id: 'ego', eyebrow: voc.egoEye, cols: 12, type: 'ego',
render: () => body('ego', data) },
{ id: 'hubs', eyebrow: 'CENTERS OF GRAVITY', cols: 6, type: 'topn',
render: () => body('hubs', data) },
diff --git a/xerj-ux/src/data/second-brain-api.js b/xerj-ux/src/data/second-brain-api.js
index f62f3a0d0..b836ef4e6 100644
--- a/xerj-ux/src/data/second-brain-api.js
+++ b/xerj-ux/src/data/second-brain-api.js
@@ -50,6 +50,7 @@ import {
renderPanelBody, drawLedgerTraces, edgeStateAt, fmtTs, caretAlignClass,
EvidencePreview, FindResults, authoredSplit, splitLabel,
} from '../ux/ego-ledger.js';
+import { isNoteLikeCorpus, vocabFor } from '../ux/sb-vocab.js';
/** Panel ids of the second-brain dashboard, in render order. The
* controller patches exactly these after an interaction — except a
@@ -565,6 +566,27 @@ async function fetchServerReads(signal) {
}
}
+// ----- corpus-aware vocabulary (issue #1100) ------------------------
+//
+// Whether this brain's corpus is note-like (speak "notes / believed") or
+// not (speak the neutral "records / active" frame) is decided ONCE, from
+// the `ax_format` tally the notes tile already runs (fetchNodeStats). The
+// map (ux/brain-map.js) has no `data` bag of its own, so it reads the same
+// decision through these getters — one source of truth for the whole page.
+
+function currentFormats() {
+ const ns = S.nodeStats;
+ return ns && !ns.error && Array.isArray(ns.formats) ? ns.formats : [];
+}
+function currentOtherFormats() {
+ const ns = S.nodeStats;
+ return ns && !ns.error && Number.isFinite(ns.otherFormats) ? ns.otherFormats : 0;
+}
+/** Is the open brain's corpus note-like? False (neutral) when unknown. */
+export const sbNoteLike = () => isNoteLikeCorpus(currentFormats(), currentOtherFormats());
+/** The open brain's display vocabulary (ux/sb-vocab.js), for the map. */
+export const sbVocabNow = () => vocabFor(sbNoteLike());
+
// ----- data assembly (§7.3 shape, extras under `sb`) ---------------
function assemble() {
@@ -617,6 +639,10 @@ function assemble() {
reads: S.reads,
readsTotal: S.readsTotal,
mapStats: S.mapStats,
+ // #1100: note-like corpus → "notes / believed" persona; otherwise the
+ // neutral "records / active" frame. Decided from the format tally so a
+ // source tree does not render as a notebook of beliefs.
+ noteLike: sbNoteLike(),
},
};
}
diff --git a/xerj-ux/src/ux/brain-map.js b/xerj-ux/src/ux/brain-map.js
index 07494998c..cf0ae67df 100644
--- a/xerj-ux/src/ux/brain-map.js
+++ b/xerj-ux/src/ux/brain-map.js
@@ -37,7 +37,7 @@
import { esc, num } from './text.js';
import { typeName, detectorName, evidenceKind, displayId } from './ego-ledger.js';
-import { sbRefocus, sbLogRead, sbPublishMapStats, sbSnapshot } from '../data/second-brain-api.js';
+import { sbRefocus, sbLogRead, sbPublishMapStats, sbSnapshot, sbVocabNow } from '../data/second-brain-api.js';
import {
buildMap, restateAt, memberOrder, bundleLiveAt, phyllotaxis, edgeStateAtI,
MAP_PAGE, MAP_EDGE_BUDGET, MAP_EXPAND_CAP,
@@ -691,7 +691,7 @@ function layoutBodyLabels(ctx, v, t) {
}
const fpx = c.isElse ? 13 : rankFontPx(ci); // clusters arrive rank-ordered
const live = M.previewT !== undefined ? clusterLiveAt(ci, t) : c.linkLive;
- const countLine = `${num(c.noteCount)} notes · ${num(live)} link${live === 1 ? '' : 's'}`;
+ const countLine = `${num(c.noteCount)} ${sbVocabNow().items} · ${num(live)} link${live === 1 ? '' : 's'}`;
const name = ex === ci ? `▾ ${clusterName(ci)}` : clusterName(ci);
ctx.font = bodyFont(fpx);
const w1 = ctx.measureText(name).width;
@@ -907,7 +907,7 @@ function drawMembers(ctx, v, t, colors, bodyRects) {
if (md.satellite > 0 && spread > 0.85) {
const [sx, sy] = toScreen(md.satX, md.satY, v);
const selected = M.sel && M.sel.kind === 'satellite';
- labelBlock(ctx, sx, sy, `+ ${num(md.satellite)} MORE NOTES`, null, 13,
+ labelBlock(ctx, sx, sy, `+ ${num(md.satellite)} MORE ${sbVocabNow().Items}`, null, 13,
selected ? colors.accent : colors.mute, 0.9, { kind: 'satellite' });
}
ctx.globalAlpha = 1;
@@ -936,7 +936,7 @@ function drawDirect(ctx, v, t, colors, dimAll) {
const fpx = d >= maxDeg * 0.8 ? 16 : d > 0 ? 13 : 11;
const notes = fg.fileSize[f];
const countLine = notes > 1
- ? `${num(notes)} notes · ${num(d)} link${d === 1 ? '' : 's'}`
+ ? `${num(notes)} ${sbVocabNow().items} · ${num(d)} link${d === 1 ? '' : 's'}`
: `${num(d)} link${d === 1 ? '' : 's'}`;
const name = fileLabel(f);
ctx.font = bodyFont(fpx);
@@ -1321,10 +1321,11 @@ function railHome() {
if (M.status === 'loading') return `<div class="panel-empty mono faint">READING EVERY LINK…</div>`;
if (M.status === 'error') return `<div class="panel-empty mono faint">COULD NOT READ THE LINK GRAPH · ${esc(String(M.error).slice(0, 90))}</div>`;
if (!model) return '';
+ const voc = sbVocabNow();
const capped = !!M.capped;
const orphanRow = M.nodesTotal != null
- ? railRow('notes with no links', `${capped ? '≥ ' : ''}${num(Math.max(0, M.nodesTotal - model.distinctNotes))}`)
- : railRow('notes with no links', 'could not be counted');
+ ? railRow(`${voc.items} with no links`, `${capped ? '≥ ' : ''}${num(Math.max(0, M.nodesTotal - model.distinctNotes))}`)
+ : railRow(`${voc.items} with no links`, 'could not be counted');
const hl = M.highlightFiles
? `<div class="sb-map-note accent">FIND: ${num(M.highlightFiles.size)} document${M.highlightFiles.size === 1 ? '' : 's'} lit up${M.highlightMiss ? ` · ${num(M.highlightMiss)} match${M.highlightMiss === 1 ? '' : 'es'} have no links — not on the map` : ''}</div>`
: '';
@@ -1334,13 +1335,14 @@ function railHome() {
${railRow('links beyond the map budget', capped ? `${M.serverTotalIsFloor ? '≥ ' : ''}${num(Math.max(0, M.serverTotal - model.g.n))}` : '0')}
${railRow('links inside single documents', num(model.fg.selfLoops))}
${orphanRow}
- ${railRow('notes drawn per opened group', `≤ ${num(MAP_EXPAND_CAP)} — the rest wait in a satellite`)}
+ ${railRow(`${voc.items} drawn per opened group`, `≤ ${num(MAP_EXPAND_CAP)} — the rest wait in a satellite`)}
<div class="sb-hgroup key">HOW TO READ IT</div>
- <div class="sb-map-note faint">each name is a group of documents that cite each other or share a folder · line thickness is how many links cross · click a group to spread it · click a line to see the quotes that taught those links · click a note to open its ledger below</div>`;
+ <div class="sb-map-note faint">each name is a group of documents that cite each other or share a folder · line thickness is how many links cross · click a group to spread it · click a line to see the quotes that taught those links · click a ${voc.item} to open its ledger below</div>`;
}
function railCluster(ci) {
const model = M.model;
+ const voc = sbVocabNow();
const c = model.clusters[ci];
const t = caretT();
const live = M.previewT !== undefined ? clusterLiveAt(ci, t) : c.linkLive;
@@ -1358,23 +1360,24 @@ function railCluster(ci) {
? railRow('links drawn inside this group', `strongest ${num(MAP_INTRA_EDGE_DRAW)} of ${num(md.intraTotal)}`) : '';
return `
<div class="sb-map-selname">${esc(clusterName(ci))}</div>
- ${railRow('notes', num(c.noteCount))}
+ ${railRow(voc.items, num(c.noteCount))}
${railRow('documents', num(c.files.length))}
- ${railRow('links believed at this moment', num(live))}
- ${notNow > 0 ? railRow('links retired or not yet believed', num(notNow)) : ''}
+ ${railRow(voc.linksAtMoment, num(live))}
+ ${notNow > 0 ? railRow(voc.linksNotNow, num(notNow)) : ''}
${domKind ? railRow('mostly connected by', typeName(model.g.typeNames[domKind[0]]).toLowerCase()) : ''}
${c.isElse
- ? `<div class="sb-map-note faint">small groups and loose notes pooled so the picture stays readable — nothing is hidden, it is all here</div>`
+ ? `<div class="sb-map-note faint">small groups and loose ${voc.items} pooled so the picture stays readable — nothing is hidden, it is all here</div>`
: (c.dirLabel
? railRow('named after its folder', `holds ≥ 60% of its links`)
- : railRow('named after its busiest note', 'no folder holds 60% of its links'))}
+ : railRow(`named after its busiest ${voc.item}`, 'no folder holds 60% of its links'))}
${capNote}${intraNote}
- ${openBtn(fileRepId(c.hubFile), 'OPEN ITS BUSIEST NOTE IN THE LEDGER')}
- <div class="sb-map-note faint">${M.expanded === ci ? 'click the group name again to fold it away' : 'click the group on the map to spread its notes'}</div>`;
+ ${openBtn(fileRepId(c.hubFile), `OPEN ITS BUSIEST ${voc.Item} IN THE LEDGER`)}
+ <div class="sb-map-note faint">${M.expanded === ci ? 'click the group name again to fold it away' : `click the group on the map to spread its ${voc.items}`}</div>`;
}
function railMember(f) {
const id = fileRepId(f);
+ const voc = sbVocabNow();
const meta = M.names.get(id) || {};
const model = M.model;
const notes = model.fg.fileSize[f];
@@ -1392,16 +1395,16 @@ function railMember(f) {
const exploreBlock = ex
? (ex.error
? `<div class="sb-map-note">COULD NOT WALK FURTHER · ${esc(ex.error.slice(0, 120))}</div>`
- : `<div class="sb-map-note accent">${num(ex.reached.size)} note${ex.reached.size === 1 ? '' : 's'} within ${num(ex.hops)} hop${ex.hops === 1 ? '' : 's'} · ${num(ex.calls)} walk${ex.calls === 1 ? '' : 's'} of 2 hops each${ex.clipped > 0 ? ` · ${num(ex.clipped)} starting notes past the per-walk cap wait for the next walk` : ''}</div>
+ : `<div class="sb-map-note accent">${num(ex.reached.size)} ${ex.reached.size === 1 ? voc.item : voc.items} within ${num(ex.hops)} hop${ex.hops === 1 ? '' : 's'} · ${num(ex.calls)} walk${ex.calls === 1 ? '' : 's'} of 2 hops each${ex.clipped > 0 ? ` · ${num(ex.clipped)} starting ${voc.items} past the per-walk cap wait for the next walk` : ''}</div>
<div class="sb-map-note faint">depth comes from repeated 2-hop walks — the engine caps each walk at 2 hops, and this view says so instead of pretending otherwise</div>`)
: '';
return `
<div class="sb-map-selname">${esc(meta.path ? meta.path.split('/').pop() : (meta.title || displayId(id)))}</div>
${meta.path ? `<div class="sb-map-note faint">${esc(meta.path)}</div>` : ''}
${meta.title && meta.path ? `<div class="sb-map-note">${esc(meta.title.slice(0, 90))}</div>` : ''}
- ${notes > 1 ? railRow('notes inside (reading order)', num(notes)) : ''}
- ${railRow('links believed at this moment', num(live))}
- ${total > live ? railRow('links retired or not yet believed', num(total - live)) : ''}
+ ${notes > 1 ? railRow(`${voc.items} inside (reading order)`, num(notes)) : ''}
+ ${railRow(voc.linksAtMoment, num(live))}
+ ${total > live ? railRow(voc.linksNotNow, num(total - live)) : ''}
${openBtn(id, 'OPEN THE LEDGER · EVERY LINK, WITH WHAT TAUGHT IT')}
<button type="button" class="text-btn sb-map-act" data-sb-map-explore${ex && ex.running ? ' disabled' : ''}>${ex ? (ex.running ? 'WALKING…' : 'WALK 2 MORE HOPS') : 'EXPLORE · WALK 2 HOPS FROM HERE'}</button>
${exploreBlock}`;
@@ -1417,12 +1420,12 @@ function railSatellite() {
// Re-render only when names actually landed; hydrateNames settles
// every asked-for id (hit or miss) and returns 0 once nothing is
// new, so the render→hydrate→render chain cannot loop.
- hydrateNames(listed.map(fileRepId), 'naming the notes in the satellite')
+ hydrateNames(listed.map(fileRepId), `naming the ${sbVocabNow().items} in the satellite`)
.then((added) => { if (added) renderRail(); });
const rows = listed.map((f) =>
`<button type="button" class="sb-clink sb-map-satrow" data-sb-map-open="${esc(fileRepId(f))}">${esc(fileLabel(f, 40))}</button>`).join('');
return `
- <div class="sb-map-selname">+ ${num(md.satellite)} MORE NOTES</div>
+ <div class="sb-map-selname">+ ${num(md.satellite)} MORE ${sbVocabNow().Items}</div>
<div class="sb-map-note">${listed.length < rest.length ? `FIRST ${num(listed.length)} OF ${num(rest.length)} · ` : ''}each opens its ledger below</div>
<div class="sb-map-satlist">${rows}</div>`;
}
diff --git a/xerj-ux/src/ux/ego-ledger.js b/xerj-ux/src/ux/ego-ledger.js
index 07c0156a0..820656983 100644
--- a/xerj-ux/src/ux/ego-ledger.js
+++ b/xerj-ux/src/ux/ego-ledger.js
@@ -42,6 +42,12 @@
import { esc, fmt, num, Num } from './text.js';
import { Spark, Series, Dist } from './charts.js';
+import { vocabFor } from './sb-vocab.js';
+
+/** The display vocabulary for a render's data bag — note-like corpora keep
+ * the "notes / believed" persona, everything else gets the neutral
+ * "records / active" frame (issue #1100). Unknown ⇒ neutral. */
+const vocOf = (data) => vocabFor(!!(data && data.sb && data.sb.noteLike));
// Rows shown per link-kind group before the in-band "TOP n OF m" cap.
export const LEDGER_GROUP_CAP = 12;
@@ -250,14 +256,14 @@ const evidenceLine = (e) => {
* This block is the ONLY place raw ids surface — labelled. `pinned`
* renders it open in-flow (the pin set lives in module state on the
* controller side, so pins survive every re-render). */
-const EvidenceBlock = (e, pinned) => {
+const EvidenceBlock = (e, pinned, voc = vocabFor(false)) => {
const ev = e.evidence || {};
const src = ev.source
? `<span>from ${esc(ev.source)}${ev.offset != null && ev.offset > 0 ? ` · byte ${esc(ev.offset)}` : ''}</span>`
: '';
const conf = e.confidence ?? 1;
const invalid = e.invalid_at != null
- ? ` · believed until ${esc(fmtTs(e.invalid_at))}` : '';
+ ? ` · ${voc.until} ${esc(fmtTs(e.invalid_at))}` : '';
const expired = e.expired_at != null
? ` · retirement recorded ${esc(fmtTs(e.expired_at))}` : '';
return `
@@ -266,7 +272,7 @@ const EvidenceBlock = (e, pinned) => {
<div class="sb-evmeta mono faint">
${src}
<span>taught by ${esc(detectorName(e.detector).toLowerCase())} (${esc(e.detector || 'unknown detector')}) · ${esc(fmt(conf * 100, { decimals: 0 }))}% confident · strength ${esc(fmt(e.weight ?? 1, { decimals: 2 }))}</span>
- <span>believed since ${esc(fmtTs(e.valid_at))}${invalid}${expired}</span>
+ <span>${voc.since} ${esc(fmtTs(e.valid_at))}${invalid}${expired}</span>
<span>link id ${esc(e.edge_id)} · this is the handle the API takes</span>
</div>
</div>`;
@@ -297,7 +303,7 @@ const evidenceChip = (e) => {
return '<span class="sb-eq sb-eq-none">NO EVIDENCE</span>';
};
-const edgeRow = (e, side, { counts, asOf, clipped, nodes, names, open }) => {
+const edgeRow = (e, side, { counts, asOf, clipped, nodes, names, open, voc = vocabFor(false) }) => {
const id = farEnd(e);
const state = edgeStateAt(e, asOf);
const n = counts.get(id) || 0;
@@ -321,7 +327,7 @@ const edgeRow = (e, side, { counts, asOf, clipped, nodes, names, open }) => {
<span class="sb-tag sb-tag-notyet">NOT YET</span>
</button>
</div>
- ${EvidenceBlock(e, pinned)}
+ ${EvidenceBlock(e, pinned, voc)}
</div>`;
};
@@ -464,7 +470,7 @@ export const caretAlignClass = (pct) =>
* interval set is pinned at NOW with retired links included, so
* scrubbing never removes data from the strip — only states change.
*/
-export const BeliefScrubber = ({ timeline, asOf, shift }) => {
+export const BeliefScrubber = ({ timeline, asOf, shift, voc = vocabFor(false) }) => {
const edges = (timeline && timeline.edges) || [];
if (!edges.length) {
return `<div class="sb-scrub" data-sb-scrub><div class="panel-empty mono faint">NOTHING TO REPLAY YET · EVERY LINK WILL DRAW ITS LIFETIME HERE</div></div>`;
@@ -575,7 +581,7 @@ export const BeliefScrubber = ({ timeline, asOf, shift }) => {
<polyline points="${pts}" fill="none" stroke="currentColor" stroke-width="1"/>
</svg>
<span class="sb-curvemax mono faint">peak ${esc(floor)}${num(maxC)}</span>`;
- explain = `THE LINE COUNTS BELIEFS OVER TIME — TOO MANY LINKS (${floor}${num(edges.length)}) TO DRAW ONE PER ROW`;
+ explain = `THE LINE COUNTS LIVE LINKS OVER TIME — TOO MANY LINKS (${floor}${num(edges.length)}) TO DRAW ONE PER ROW`;
}
// What the last time-travel changed, stated in the legend: counts of
@@ -597,7 +603,7 @@ export const BeliefScrubber = ({ timeline, asOf, shift }) => {
return `
<div class="sb-scrub" data-sb-scrub data-d0="${d0}" data-d1="${d1}"${stepsAttr}${eventsAttr}>
- <div class="key">BELIEF TIME · DRAG ANYWHERE ON THE STRIP — THE PAGE REPLAYS WHAT THIS BRAIN BELIEVED AT THAT MOMENT</div>
+ <div class="key">${esc(voc.timeAxis)} · DRAG ANYWHERE ON THE STRIP — ${esc(voc.replayLine)}</div>
<div class="sb-strip" data-sb-strip style="height:${h}px;">
${stripInner}
<div class="sb-caret" data-sb-caret style="left:${caretPct}%;" role="slider" tabindex="0"
@@ -608,7 +614,7 @@ export const BeliefScrubber = ({ timeline, asOf, shift }) => {
</div>
<div class="sb-scrub-legend mono faint">
<span>${esc(fmtDay(d0raw))}</span>
- <span class="mid"><span data-sb-livecount>${esc(floor)}${num(liveAtCaret)} OF ${esc(floor)}${num(edges.length)}</span> BELIEVED AT THIS MOMENT<span class="sb-scrub-explain"> · ${explain}</span>${shiftHtml}</span>
+ <span class="mid"><span data-sb-livecount>${esc(floor)}${num(liveAtCaret)} OF ${esc(floor)}${num(edges.length)}</span> ${esc(voc.atMoment)}<span class="sb-scrub-explain"> · ${explain}</span>${shiftHtml}</span>
<span>${asOf != null ? `<button type="button" class="text-btn" data-sb-now>BACK TO NOW</button>` : `TODAY · ${esc(fmtDay(now))}`}</span>
</div>
</div>`;
@@ -638,9 +644,10 @@ export const EgoLedger = ({ data }) => {
const ego = data.ego;
const asOf = sb.asOf ?? null;
const names = sb.names || {};
+ const voc = vocOf(data);
if (!ego) {
return `
- <div class="panel-empty mono faint">${sb.focus ? 'READING WHAT THE BRAIN BELIEVES ABOUT ' + esc(String(sb.focus).toUpperCase()) + '…' : 'NO NOTE IN FOCUS · CLICK ANY NOTE ON THIS PAGE TO OPEN ITS LEDGER'}</div>`;
+ <div class="panel-empty mono faint">${sb.focus ? voc.readingFocus + esc(String(sb.focus).toUpperCase()) + '…' : `NO ${voc.Item} IN FOCUS · CLICK ANY ${voc.item} ON THIS PAGE TO OPEN ITS LEDGER`}</div>`;
}
const nodes = ego.nodes || {};
const clipped = !!(ego.not_shown && ego.not_shown.edges_clipped > 0);
@@ -649,6 +656,7 @@ export const EgoLedger = ({ data }) => {
nodes, names, counts, asOf, clipped,
open: sb.openEvidence, // pinned paper trails — survive re-renders
collapsed: sb.collapsed, // folded link-kind groups
+ voc, // corpus-aware wording (#1100)
};
const inGroups = groupEdges(ego.edges, 'in');
const outGroups = groupEdges(ego.edges, 'out');
@@ -693,6 +701,7 @@ const hrow = (k, v, emph, rawName) => `
export const HonestyList = ({ data }) => {
const ns = (data.ego && data.ego.not_shown) || {};
const on = (data.overview && data.overview.not_shown) || {};
+ const voc = vocOf(data);
const z = (v) => num(v || 0);
const dangling = Array.isArray(ns.dangling_ids) && ns.dangling_ids.length
? `<div class="sb-hids mono faint">no document behind: ${ns.dangling_ids.slice(0, 8).map(esc).join(', ')}${ns.dangling_ids.length > 8 ? ` +${ns.dangling_ids.length - 8} more` : ''}</div>`
@@ -705,18 +714,18 @@ export const HonestyList = ({ data }) => {
<div class="sb-honesty mono">
<div class="sb-hgroup key">THE LEDGER READ</div>
${hrow('links beyond the fetch cap (not drawn)', z(ns.edges_clipped), true, 'edges_clipped')}
- ${hrow('starting notes the walk had to drop', z(ns.frontier_clipped), true, 'frontier_clipped')}
+ ${hrow(`starting ${voc.items} the walk had to drop`, z(ns.frontier_clipped), true, 'frontier_clipped')}
${hrow('links hidden by the belief-time cut', z(ns.expired_excluded), false, 'expired_excluded')}
${hrow('links hidden by a kind filter', z(ns.type_filtered), false, 'type_filtered')}
${hrow('storage segments this read had to skip', z(ns.segments_without_columns), true, 'segments_without_columns')}
${hrow('unflushed writes checked (cost, not loss)', z(ns.memtable_docs_scanned), false, 'memtable_docs_scanned')}
- ${hrow('links pointing at notes with no document', z(ns.dangling_nodes), true, 'dangling_nodes')}
+ ${hrow(`links pointing at ${voc.items} with no document`, z(ns.dangling_nodes), true, 'dangling_nodes')}
${dangling}
<div class="sb-hgroup key">THE COUNTS ABOVE</div>
${hrow('link kinds beyond the top list', z(on.types_not_listed), true, 'types_not_listed')}
${hrow('detectors beyond the top list', z(on.detectors_not_listed), true, 'detectors_not_listed')}
- ${hrow('most-citing notes beyond the top list', z(on.hubs_out_not_listed), false, 'hubs_out_not_listed')}
- ${hrow('most-cited notes beyond the top list', z(on.hubs_in_not_listed), false, 'hubs_in_not_listed')}
+ ${hrow(`most-citing ${voc.items} beyond the top list`, z(on.hubs_out_not_listed), false, 'hubs_out_not_listed')}
+ ${hrow(`most-cited ${voc.items} beyond the top list`, z(on.hubs_in_not_listed), false, 'hubs_in_not_listed')}
<div class="sb-hgroup key">CAPS THIS PAGE APPLIES</div>
${hrow('ledger rows per link kind (capped groups say so)', `≤ ${num(LEDGER_GROUP_CAP)}`, false)}
${hrow('belief-strip lifetimes beyond its fetch cap', z(tlns.edges_clipped), true, 'edges_clipped')}
@@ -747,6 +756,7 @@ const hubList = (items, notListed, focus, ctx) => {
export const HubsPanel = ({ data }) => {
const o = data.overview || {};
+ const voc = vocOf(data);
const hubs = o.hubs || { out: [], in: [] };
const ns = o.not_shown || {};
const sb = data.sb || {};
@@ -755,15 +765,15 @@ export const HubsPanel = ({ data }) => {
return `
<div class="sb-hubs">
<div>
- <div class="key">MOST CITED · LINKS POINTING AT A NOTE</div>
+ <div class="key">MOST CITED · LINKS POINTING AT A ${voc.Item}</div>
${hubList(hubs.in, ns.hubs_in_not_listed, focus, ctx)}
</div>
<div>
- <div class="key">CITES THE MOST · LINKS A NOTE SENDS OUT</div>
+ <div class="key">CITES THE MOST · LINKS A ${voc.Item} SENDS OUT</div>
${hubList(hubs.out, ns.hubs_out_not_listed, focus, ctx)}
</div>
</div>
- <div class="hint" style="margin-top:var(--sp-1);">click any note to open its ledger above</div>`;
+ <div class="hint" style="margin-top:var(--sp-1);">click any ${voc.item} to open its ledger above</div>`;
};
// ----- small panels -------------------------------------------------
@@ -780,6 +790,7 @@ const legChip = (cls, label) =>
*/
const BelievedPanel = ({ data }) => {
const o = data.overview || {};
+ const voc = vocOf(data);
const ed = o.edges || { total: 0, live: 0, invalidated: 0 };
const m = (data.metrics && data.metrics.edgesLive) || { formatted: num(ed.live), hint: '' };
if (!ed.total) {
@@ -802,7 +813,7 @@ const BelievedPanel = ({ data }) => {
<div class="sb-splitwrap">
${bar}
<div class="sb-splitleg mono">
- ${legChip('sb-seg-live', `${num(ed.live)} BELIEVED`)}
+ ${legChip('sb-seg-live', `${num(ed.live)} ${voc.live}`)}
${legChip('sb-seg-retired', `${num(ed.invalidated)} RETIRED`)}
</div>
</div>`;
@@ -970,7 +981,7 @@ export const EmptyBrainNote = ({ brain, connected, error }) => {
<p class="sb-ftext">Point it at a folder of notes, docs or exports. Every wiki-link,
relative link, reading sequence and folder neighborhood becomes a link that
remembers the exact quote that taught it — then this page turns into a ledger
- of what your notes believe, replayable at any moment in time.</p>
+ of what your documents link to, replayable at any moment in time.</p>
<div class="sb-cmdrow"><pre class="sb-cmd mono" data-sb-cmd>xerj brain ~/your-folder</pre><button type="button" class="text-btn" data-sb-copy>COPY</button></div>
<p class="sb-ftext">The folder's name becomes the brain's name here. Detection is
deterministic — the same folder always produces the same brain, and re-running
@@ -1032,7 +1043,7 @@ const MapPanel = ({ data }) => {
* map restyles and the ledger rows restate from the same drag. */
const ScrubPanel = ({ data }) => {
const sb = data.sb || {};
- return BeliefScrubber({ timeline: sb.timeline, asOf: sb.asOf ?? null, shift: sb.lastShift });
+ return BeliefScrubber({ timeline: sb.timeline, asOf: sb.asOf ?? null, shift: sb.lastShift, voc: vocOf(data) });
};
// ----- statistics row -----------------------------------------------
@@ -1070,6 +1081,7 @@ const statRow = (label, count, max, title) => `
const NotesPanel = ({ data }) => {
const o = data.overview || {};
const sb = data.sb || {};
+ const voc = vocOf(data);
const st = sb.nodeStats || null;
// overview.nodes.total is live-verified to be a false 0 when the
// brain spans several notes indices (comma-list) — only fall back to
@@ -1079,23 +1091,23 @@ const NotesPanel = ({ data }) => {
: (singleIndex && o.nodes && Number.isFinite(o.nodes.total) ? o.nodes.total : null);
if (total == null) {
return st && st.error
- ? `<div class="panel-empty mono faint">COULD NOT COUNT THE NOTES · ${esc(String(st.error).slice(0, 60))}</div>`
+ ? `<div class="panel-empty mono faint">COULD NOT COUNT THE ${voc.Items} · ${esc(String(st.error).slice(0, 60))}</div>`
: `<div class="panel-empty mono faint">NOT COUNTED YET</div>`;
}
const formats = (st && st.formats) || [];
const max = Math.max(...formats.map((f) => f.count), 1);
const rows = formats.map((f) => statRow(fmtFormat(f.format), f.count, max)).join('');
const other = st && st.otherFormats > 0
- ? `<div class="hint">+ ${num(st.otherFormats)} notes in file types beyond this list</div>` : '';
- // Notes with no links: the map computes it (distinct linked notes out
- // of its weight-ranked fetch), so it is a floor whenever that fetch
+ ? `<div class="hint">+ ${num(st.otherFormats)} ${voc.items} in file types beyond this list</div>` : '';
+ // Records with no links: the map computes it (distinct linked records
+ // out of its weight-ranked fetch), so it is a floor whenever that fetch
// was budget-truncated — say which.
const ms = sb.mapStats || null;
const orphans = ms && Number.isFinite(ms.orphansFloor)
- ? `<div class="hint" style="margin-top:6px;">notes with no links: ${ms.orphansIsFloor ? '≥ ' : ''}${num(ms.orphansFloor)}${ms.orphansIsFloor ? ' — a floor; the map read the strongest links, not all of them' : ''}</div>`
- : `<div class="hint" style="margin-top:6px;">notes with no links: counted once the map has read the links</div>`;
+ ? `<div class="hint" style="margin-top:6px;">${voc.items} with no links: ${ms.orphansIsFloor ? '≥ ' : ''}${num(ms.orphansFloor)}${ms.orphansIsFloor ? ' — a floor; the map read the strongest links, not all of them' : ''}</div>`
+ : `<div class="hint" style="margin-top:6px;">${voc.items} with no links: counted once the map has read the links</div>`;
return `
- ${Num({ value: num(total), unit: 'notes', hint: 'each file counts once, and its sections count as their own notes', emphasis: false })}
+ ${Num({ value: num(total), unit: voc.items, hint: `each file counts once, and its sections count as their own ${voc.items}`, emphasis: false })}
<div class="sb-dets" style="margin-top:var(--sp-1);">${rows}</div>
${other}${orphans}`;
};
@@ -1209,6 +1221,7 @@ const ReadsPanel = ({ data }) => {
export function renderPanelBody(id, data) {
if (!data || !data.sb) return LiveOnlyNote();
const sb = data.sb;
+ const voc = vocOf(data);
const hasBrain = !!(data.overview && data.overview.exists !== false);
const hasEdges = hasBrain && data.overview.edges && data.overview.edges.total > 0;
const broken = !!sb.overviewError && sb.connected; // engine up, brain unreadable
@@ -1274,7 +1287,7 @@ export function renderPanelBody(id, data) {
return EmptyBrainNote({ brain: data.brain, connected: sb.connected, error: sb.error });
case 'hubs':
if (offline) return offNote;
- return hasEdges ? HubsPanel({ data }) : `<div class="panel-empty mono faint">YOUR MOST-CITED NOTES WILL RANK HERE</div>`;
+ return hasEdges ? HubsPanel({ data }) : `<div class="panel-empty mono faint">YOUR MOST-CITED ${voc.Items} WILL RANK HERE</div>`;
case 'notShown':
// Always renders — zeros prove absence.
return HonestyList({ data });
diff --git a/xerj-ux/src/ux/sb-vocab.js b/xerj-ux/src/ux/sb-vocab.js
new file mode 100644
index 000000000..ef931f212
--- /dev/null
+++ b/xerj-ux/src/ux/sb-vocab.js
@@ -0,0 +1,112 @@
+// ============================================================
+// XERJ.ai — SECOND BRAIN · corpus-aware vocabulary (issue #1100)
+//
+// The Second Brain page is the graph layer over WHATEVER was indexed —
+// mail, PDFs, source code, JSON. Its "notes / believed" persona is only
+// truthful for note-like corpora (personal notes, correspondence); on a
+// source tree (95.8% `code` records) the same copy tells a user they are
+// looking at notes and beliefs, which is the "weird knowledge-base mode"
+// users report (#1100).
+//
+// This module is the ONE place that decides, from the corpus's own format
+// distribution (the `ax_format` tally the page already runs), whether to
+// speak the note persona or neutral wording — records, links, active. It
+// is PURE: no DOM, no fetch, no module state, so it is unit-testable and
+// has one definition both the ledger (ego-ledger.js) and the map
+// (brain-map.js, via second-brain-api.js) read from.
+//
+// The neutral term for a NODE is "record", never "document": the map
+// already uses "document" for a FILE and "note" for a record (one file
+// holds many), so collapsing records into documents would double-count.
+// ============================================================
+
+/**
+ * Families whose records read as personal notes or correspondence — the
+ * only corpora for which "notes" and "believed" are honest. Markdown and
+ * plain prose sniff as `txt-prose`; mail is `eml` / `mbox` (see
+ * engine/crates/xerj-autoindex/src/sniff.rs Family::as_str). Everything
+ * else (code, json, csv, logs, txt-lines, html, pdf, …) gets the neutral
+ * frame — truthful whatever was indexed.
+ */
+export const NOTE_LIKE_FORMATS = new Set(['txt-prose', 'mbox', 'eml', 'md', 'markdown']);
+
+/** The single most common format in a `[{ format, count }]` tally, or
+ * null when the tally is empty. Does not assume the list is sorted. */
+export function dominantFormat(formats) {
+ let best = null;
+ let bestN = -1;
+ for (const f of Array.isArray(formats) ? formats : []) {
+ const n = Number(f && f.count) || 0;
+ if (n > bestN) { bestN = n; best = f && f.format != null ? String(f.format) : null; }
+ }
+ return best;
+}
+
+/**
+ * Is this corpus note-like? True only when note-like records are a STRICT
+ * MAJORITY of the counted records. An unknown or empty tally (the stats
+ * read has not run or failed) returns false: the neutral record/link frame
+ * is the safe default, and it already matches the page's own kicker/caption
+ * ("the documents you indexed"). `otherFormats` (records in formats past
+ * the agg's bucket cap) count as non-note — a conservative, never-overclaim
+ * reading of the persona.
+ *
+ * @param {Array<{format:string,count:number}>} formats
+ * @param {number} [otherFormats] records whose format fell past the cap
+ */
+export function isNoteLikeCorpus(formats, otherFormats = 0) {
+ const list = Array.isArray(formats) ? formats : [];
+ let note = 0;
+ let total = Number(otherFormats) || 0;
+ for (const f of list) {
+ const n = Number(f && f.count) || 0;
+ total += n;
+ if (NOTE_LIKE_FORMATS.has(String(f && f.format))) note += n;
+ }
+ return total > 0 && note * 2 > total;
+}
+
+const NOTE_VOC = Object.freeze({
+ noteLike: true,
+ item: 'note', items: 'notes', Item: 'NOTE', Items: 'NOTES',
+ // belief-time strip
+ atMoment: 'BELIEVED AT THIS MOMENT',
+ live: 'BELIEVED',
+ timeAxis: 'BELIEF TIME',
+ replayLine: 'THE PAGE REPLAYS WHAT THIS BRAIN BELIEVED AT THAT MOMENT',
+ since: 'believed since',
+ until: 'believed until',
+ // map / ledger rows
+ linksAtMoment: 'links believed at this moment',
+ linksNotNow: 'links retired or not yet believed',
+ readingFocus: 'READING WHAT THE BRAIN BELIEVES ABOUT ',
+ // panel eyebrows
+ typeDistEye: 'HOW NOTES CONNECT',
+ egoEye: 'THE LEDGER · ONE NOTE, EVERYTHING IT TOUCHES',
+});
+
+const DOC_VOC = Object.freeze({
+ noteLike: false,
+ item: 'record', items: 'records', Item: 'RECORD', Items: 'RECORDS',
+ atMoment: 'ACTIVE AT THIS MOMENT',
+ live: 'ACTIVE',
+ timeAxis: 'LINK TIME',
+ replayLine: 'THE PAGE REPLAYS WHICH LINKS WERE ACTIVE AT THAT MOMENT',
+ since: 'active since',
+ until: 'active until',
+ linksAtMoment: 'links active at this moment',
+ linksNotNow: 'links retired or not yet active',
+ readingFocus: 'READING THE LINKS FOR ',
+ typeDistEye: 'HOW RECORDS CONNECT',
+ egoEye: 'THE LEDGER · ONE RECORD, EVERYTHING IT LINKS TO',
+});
+
+/** The vocabulary for a known note-like flag. */
+export function vocabFor(noteLike) {
+ return noteLike ? NOTE_VOC : DOC_VOC;
+}
+
+/** The vocabulary for a format tally (classify + pick in one call). */
+export function sbVocab(formats, otherFormats = 0) {
+ return vocabFor(isNoteLikeCorpus(formats, otherFormats));
+}
diff --git a/xerj-ux/test/second-brain-vocab.test.mjs b/xerj-ux/test/second-brain-vocab.test.mjs
new file mode 100644
index 000000000..536b8a6bf
--- /dev/null
+++ b/xerj-ux/test/second-brain-vocab.test.mjs
@@ -0,0 +1,151 @@
+// Issue #1100 — the Second Brain is the graph layer over WHATEVER was
+// indexed. Its "notes / believed" persona is only truthful for note-like
+// corpora (prose, mail); on a source tree (95.8% `code` records) the same
+// copy tells a user they are looking at notes and beliefs. These tests pin
+// the corpus-aware vocabulary: the classifier, the panel bodies, and the
+// dashboard eyebrows must speak the neutral "records / active" frame for a
+// code-dominant corpus, and keep the persona for a note-dominant one.
+//
+// Run: node --test xerj-ux/test/
+import test from 'node:test';
+import assert from 'node:assert/strict';
+
+// second-brain-api.js reads location.hash at import time on some paths; the
+// rest of its browser surface is guarded (document, storage, rAF).
+globalThis.location = { hash: '' };
+
+const {
+ isNoteLikeCorpus, dominantFormat, vocabFor, sbVocab,
+} = await import('../src/ux/sb-vocab.js');
+const { renderPanelBody } = await import('../src/ux/ego-ledger.js');
+const { secondBrain } = await import('../src/dashboards/second-brain.js');
+
+// A realistic code tree — the autoindexed `engine/crates` from the issue:
+// overwhelmingly `code`, a little json, a couple of prose files. Many more
+// records than a single page so the plurality is the corpus's, not a page's.
+const CODE_FORMATS = [
+ { format: 'code', count: 9580 },
+ { format: 'json', count: 320 },
+ { format: 'txt-prose', count: 100 },
+];
+// A notes / mail corpus: prose and mbox are the strict majority.
+const NOTE_FORMATS = [
+ { format: 'txt-prose', count: 1400 },
+ { format: 'mbox', count: 300 },
+ { format: 'code', count: 60 },
+];
+
+// ---- the classifier -------------------------------------------------
+
+test('isNoteLikeCorpus: a code-dominant corpus is NOT note-like', () => {
+ assert.equal(isNoteLikeCorpus(CODE_FORMATS), false);
+});
+
+test('isNoteLikeCorpus: a prose/mail-dominant corpus IS note-like', () => {
+ assert.equal(isNoteLikeCorpus(NOTE_FORMATS), true);
+});
+
+test('isNoteLikeCorpus: unknown/empty tally defaults to NOT note-like (neutral is the safe frame)', () => {
+ assert.equal(isNoteLikeCorpus([]), false);
+ assert.equal(isNoteLikeCorpus(null), false);
+ assert.equal(isNoteLikeCorpus(undefined), false);
+});
+
+test('isNoteLikeCorpus: note formats must be a STRICT majority (a plurality is not enough)', () => {
+ // 40% prose, 60% code → neutral.
+ assert.equal(isNoteLikeCorpus([{ format: 'txt-prose', count: 40 }, { format: 'code', count: 60 }]), false);
+ // otherFormats (records past the agg bucket cap) count as non-note.
+ assert.equal(isNoteLikeCorpus([{ format: 'txt-prose', count: 60 }], 60), false);
+});
+
+test('dominantFormat picks the largest bucket regardless of order', () => {
+ assert.equal(dominantFormat(CODE_FORMATS), 'code');
+ assert.equal(dominantFormat([{ format: 'a', count: 1 }, { format: 'b', count: 9 }]), 'b');
+ assert.equal(dominantFormat([]), null);
+});
+
+test('sbVocab wires the classifier to the vocabulary', () => {
+ assert.equal(sbVocab(CODE_FORMATS).noteLike, false);
+ assert.equal(sbVocab(CODE_FORMATS).items, 'records');
+ assert.equal(sbVocab(NOTE_FORMATS).noteLike, true);
+ assert.equal(sbVocab(NOTE_FORMATS).items, 'notes');
+});
+
+// ---- panel bodies ---------------------------------------------------
+
+const dataFor = (noteLike) => ({
+ brain: 'repo',
+ overview: { exists: true, edges: { total: 5, live: 3, invalidated: 2 }, types: [], detectors: [], hubs: { in: [], out: [] }, not_shown: {} },
+ ego: null,
+ metrics: { edgesLive: { formatted: '3', hint: '' } },
+ series: { created: [], createdT: [] },
+ sb: {
+ connected: true, error: null, uiError: null, overviewError: null,
+ brains: ['repo'], focus: null, asOf: null, trail: [],
+ timeline: { edges: [{ edge_id: 'e1', valid_at: Date.now() - 86_400_000, weight: 1 }] },
+ names: {}, openEvidence: new Set(), collapsed: new Set(),
+ reads: [], readsTotal: 0, mapStats: null, nodeStats: null,
+ noteLike,
+ },
+});
+
+test('the BELIEVED-NOW tile reads ACTIVE on a code corpus, BELIEVED on a note corpus', () => {
+ const neutral = renderPanelBody('edgesLive', dataFor(false));
+ assert.match(neutral, /ACTIVE/);
+ assert.doesNotMatch(neutral, /BELIEVED/);
+
+ const persona = renderPanelBody('edgesLive', dataFor(true));
+ assert.match(persona, /BELIEVED/);
+});
+
+test('the belief-time scrubber reads LINK TIME / ACTIVE on a code corpus', () => {
+ const neutral = renderPanelBody('scrub', dataFor(false));
+ assert.match(neutral, /LINK TIME/);
+ assert.match(neutral, /ACTIVE AT THIS MOMENT/);
+ assert.doesNotMatch(neutral, /BELIEF TIME/);
+ assert.doesNotMatch(neutral, /BELIEVED AT THIS MOMENT/);
+
+ const persona = renderPanelBody('scrub', dataFor(true));
+ assert.match(persona, /BELIEF TIME/);
+ assert.match(persona, /BELIEVED AT THIS MOMENT/);
+});
+
+test('the empty-ledger prompt says RECORD, not NOTE, on a code corpus', () => {
+ // ego panel with edges but no ego read → the "nothing in focus" prompt.
+ const d = dataFor(false);
+ d.overview.edges.total = 5; // hasEdges true → EgoLedger path
+ const html = renderPanelBody('ego', d);
+ assert.match(html, /NO RECORD IN FOCUS/);
+ assert.doesNotMatch(html, /NO NOTE IN FOCUS/);
+});
+
+// ---- dashboard eyebrows --------------------------------------------
+
+const eyebrowOf = (panels, id) => (panels.find((p) => p.id === id) || {}).eyebrow;
+
+test('dashboard eyebrows are neutral for a code corpus', () => {
+ const view = secondBrain.render({ data: dataFor(false), time: 'now' });
+ assert.equal(eyebrowOf(view.panels, 'edgesLive'), 'ACTIVE AT THIS MOMENT');
+ assert.equal(eyebrowOf(view.panels, 'typeDist'), 'HOW RECORDS CONNECT');
+ assert.equal(eyebrowOf(view.panels, 'ego'), 'THE LEDGER · ONE RECORD, EVERYTHING IT LINKS TO');
+ assert.match(eyebrowOf(view.panels, 'scrub'), /^LINK TIME ·/);
+});
+
+test('dashboard eyebrows keep the persona for a note corpus', () => {
+ const view = secondBrain.render({ data: dataFor(true), time: 'now' });
+ assert.equal(eyebrowOf(view.panels, 'edgesLive'), 'BELIEVED AT THIS MOMENT');
+ assert.equal(eyebrowOf(view.panels, 'typeDist'), 'HOW NOTES CONNECT');
+ assert.equal(eyebrowOf(view.panels, 'ego'), 'THE LEDGER · ONE NOTE, EVERYTHING IT TOUCHES');
+ assert.match(eyebrowOf(view.panels, 'scrub'), /^BELIEF TIME ·/);
+});
+
+// ---- vocabFor shape -------------------------------------------------
+
+test('vocabFor exposes both frames with the same keys', () => {
+ const n = vocabFor(true);
+ const d = vocabFor(false);
+ for (const k of Object.keys(n)) assert.ok(k in d, `neutral vocab missing ${k}`);
+ assert.equal(d.item, 'record');
+ assert.equal(d.Items, 'RECORDS');
+ assert.equal(n.item, 'note');
+});