@gamaze/hicortex 0.27.2 → 0.27.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -98,8 +98,8 @@
98
98
  within ~2–2.5× (owner: no huge green balls, nothing barely visible);
99
99
  stage colors untouched.
100
100
 
101
- FIX ROUND 6 (owner-approved proto of record mockups/progress-bar.html,
102
- 2026-09-14 — variant 3 + copy A): ENTRY LOADING SCREEN. Pure inline
101
+ FIX ROUND 6 (the approved mockup, variant 3 + copy A): ENTRY LOADING
102
+ SCREEN. Pure inline
103
103
  HTML+CSS at the very top of the body, BEFORE the app markup and the
104
104
  engine script — it paints on URL entry with ZERO script (the real
105
105
  page is black for seconds while the engine parses/boots; the splash
@@ -457,7 +457,7 @@
457
457
  right. The value is the hero (≥2x the label size — tests pin the
458
458
  ratio), neutral --text; the chips are the ONLY colored element on the
459
459
  face (green improving / red worsening / gray flat or no baseline).
460
- Rows breathe — the card may grow taller (owner 2026-11-10). Theme
460
+ Rows breathe — the card may grow taller. Theme
461
461
  tokens only, both themes. */
462
462
  .rec-l1{ display:flex; flex-direction:column; gap:8px; min-width:0; }
463
463
  .rec-l1[hidden]{ display:none; } /* author display beats the UA's [hidden] — the #billing-banner idiom; without it the flex rule un-hides the container */
@@ -1177,9 +1177,9 @@
1177
1177
  </script>
1178
1178
  </head>
1179
1179
  <body class="booting">
1180
- <!-- ============ entry loading screen (#409 fix round 6 — the owner-
1181
- approved proto of record mockups/progress-bar.html, variant 3 + copy
1182
- A). Sits at the very top of the body with its OWN style block: it paints
1180
+ <!-- ============ entry loading screen (#409 fix round 6 — the approved
1181
+ mockup, variant 3 + copy A). Sits at the very top of the body with
1182
+ its OWN style block: it paints
1183
1183
  on URL entry with ZERO script, fully opaque black in both themes, and
1184
1184
  the engine only ever fades it away (entrySplashDismiss at the boot
1185
1185
  reveal). On failure the copy line swaps to an honest error — never an
@@ -1297,24 +1297,24 @@
1297
1297
  <div class="csub" id="tok-sub">&nbsp;</div>
1298
1298
  <div id="tok-nights" aria-label="LLM tokens per nightly run this billing period"></div>
1299
1299
  </div>
1300
- <!-- Memory Precision (#476, owner retitle; #578 quality audit; #591
1300
+ <!-- Memory Precision (#476 retitle; #578 quality audit; #591
1301
1301
  presentation pass; #593 stat-table round 2) — ONE card, two
1302
1302
  context levels + the quality instrument. Level 2 (recall depth)
1303
1303
  keeps the #426 U-band + zone word + provisional-hover semantics;
1304
1304
  the marker/tooltip read the WINDOW ratio off
1305
1305
  D.memory_precision.level2 (a pre-#476 server has no block → the
1306
- headline ratio — today's rendering exactly). The #578 audit
1307
- (owner: "do the numbers earn their place"): mean similarity and
1308
- redundant share are TOOLTIP-ONLY (high cosine was the noise's
1309
- camouflage — not actionable), and the FACE carries what answers
1306
+ headline ratio — today's rendering exactly). The #578 audit:
1307
+ mean similarity and redundant share are TOOLTIP-ONLY (high cosine
1308
+ was the noise's camouflage — not actionable), and the FACE
1309
+ carries what answers
1310
1310
  "is recall quality improving": uses-per-showing (the big word),
1311
1311
  pushes/lines volume, and the Tier-1 rows with per-change deltas
1312
1312
  off the server's change-registry entries while the raw window
1313
- covers them. The #591 pass (owner product feedback: the card must
1313
+ covers them. The #591 pass (the card must
1314
1314
  SELF-INTERPRET) made every row read in plain words (MP_NAME) with
1315
1315
  deltas valenced by the explicit per-metric map (MP_GOOD) and the
1316
1316
  technical layer demoted behind per-row tooltips. The #593 round 2
1317
- (owner amendment 2026-11-10: the card reads as a STAT TABLE)
1317
+ (the card reads as a STAT TABLE)
1318
1318
  reshapes that face: EXACTLY 4 stat rows (clutter / foreign
1319
1319
  content / weak matches / churn), ONE stat per row in a fixed
1320
1320
  value/label/chip grid that can never wrap — the value is the
@@ -1323,7 +1323,7 @@
1323
1323
  tooltips, the headline is ONE neutral line (direction · caveat)
1324
1324
  and the zone word's tooltip carries the plain meaning +
1325
1325
  uses-per-showing. The divergence drawer is GONE from the card
1326
- (owner: the row double-counted the gauge's own reason; the data
1326
+ (the row double-counted the gauge's own reason; the data
1327
1327
  still flows into the nightly snapshots — the page just never
1328
1328
  renders it), and the contested row is presence-gated: hidden
1329
1329
  unless the grading lane ran AND something is contested (no
@@ -3419,7 +3419,7 @@ const RECALL_ZONE_PLAIN={low:'shown memories are rarely picked up',normal:'shown
3419
3419
  assumption on the card; a metric whose good direction flips changes
3420
3420
  here and nowhere else. Plain names beside it: the reader-facing
3421
3421
  vocabulary (the internal metric keys stay in the payload; #593 renamed
3422
- cross_share's face label to the amendment's "Foreign content"). */
3422
+ cross_share's face label to "Foreign content"). */
3423
3423
  const MP_GOOD={block_size:'down',cross_share:'down',sub_bar_share:'down',recycling:'down'};
3424
3424
  const MP_NAME={block_size:'Clutter per prompt',cross_share:'Foreign content',sub_bar_share:'Weak matches',recycling:'Memory churn'};
3425
3425
  /* #593 plain headline — pure composer (the recallUsesZone convention):
@@ -3549,7 +3549,7 @@ function renderRecBand(ups){
3549
3549
  }
3550
3550
 
3551
3551
  /* ---------- Memory Precision — Level 1, the pushed index (#476) + the #578
3552
- quality audit (owner: "do the numbers earn their place") + the #591
3552
+ quality audit + the #591
3553
3553
  presentation pass + the #593 stat-table reshape. The FACE is EXACTLY 4
3554
3554
  stat rows (MP_NAME labels) + the denominators foot line (.l1vol): ONE
3555
3555
  stat per row in the fixed value/label/chip grid — the hero value
@@ -3560,7 +3560,7 @@ function renderRecBand(ups){
3560
3560
  MP_GOOD valence, no covered entry → the gray no-baseline dash. Row
3561
3561
  meanings ("fewer is better", attribution coverage, the bar value) live
3562
3562
  in PER-ROW titles; mean similarity + repeated-known stay card-level
3563
- TOOLTIP-ONLY (the #578 ruling — high cosine was the noise's camouflage).
3563
+ TOOLTIP-ONLY (high cosine was the noise's camouflage).
3564
3564
  Absent tier1 (a pre-#578 server) → the stat rows hide and the card
3565
3565
  keeps the #476 shape; absent block entirely → the whole row hides and
3566
3566
  the sub keeps the old label (the capture card's block-absence guard). */
@@ -4042,7 +4042,7 @@ function agoLabel(iso){
4042
4042
  /* ---------- #601: the confidential circle — fleet.circle rides the same
4043
4043
  /dashboard/data payload (ALWAYS present; roster [] when nothing is
4044
4044
  configured). VISIBILITY ONLY: the dashboard stays ungated (confidential
4045
- content remains visible here — the standing ruling); standard agents
4045
+ content remains visible here — by design); standard agents
4046
4046
  render NO badge (honest absence — red would read as error, amber reads as
4047
4047
  restricted). D.fleet.circle is ABSENT on a pre-#601 server → every helper
4048
4048
  degrades to the exact prior rendering. members is keyed by the OBSERVED
@@ -4064,7 +4064,7 @@ function circleCount(agentId){
4064
4064
  function circlePill(agentId){
4065
4065
  const n=circleCount(agentId);
4066
4066
  if(n===null) return '';
4067
- return '<span class="conf-pill" title="Inner circle — this agent\'s captures are confidential, hidden from other agents\' recall · '+n+' confidential '+(n===1?'memory':'memories')+'">confidential</span>';
4067
+ return '<span class="conf-pill" title="Confidential circle — this agent\'s captures are confidential, hidden from other agents\' recall · '+n+' confidential '+(n===1?'memory':'memories')+'">confidential</span>';
4068
4068
  }
4069
4069
  /** Bundle-level pill (rail card header / capture rows) — the tooltip names
4070
4070
  every member agent + its count; '' when none of the ids are members. */
@@ -203,8 +203,8 @@ export declare const QUALITY_CHANGES: readonly QualityChange[];
203
203
  export declare const QUALITY_GRADE_WEEKLY_CALL_CAP = 60;
204
204
  /**
205
205
  * Auto-grader confidence below which a graded line lands in the CONTESTED
206
- * slice for the owner's thumbs (#578). PROVISIONAL first anchor (the #426
207
- * posture): 0.70, expected to move on fleet data. Applied at RENDER only
206
+ * slice for manual review (#578). PROVISIONAL first anchor: 0.70, expected
207
+ * to move as real-world data accumulates. Applied at RENDER only
208
208
  * (raw score + confidence are stored threshold-free; a recalibration never
209
209
  * rewrites history).
210
210
  */
@@ -222,8 +222,8 @@ exports.QUALITY_CHANGES = Object.freeze([
222
222
  exports.QUALITY_GRADE_WEEKLY_CALL_CAP = 60;
223
223
  /**
224
224
  * Auto-grader confidence below which a graded line lands in the CONTESTED
225
- * slice for the owner's thumbs (#578). PROVISIONAL first anchor (the #426
226
- * posture): 0.70, expected to move on fleet data. Applied at RENDER only
225
+ * slice for manual review (#578). PROVISIONAL first anchor: 0.70, expected
226
+ * to move as real-world data accumulates. Applied at RENDER only
227
227
  * (raw score + confidence are stored threshold-free; a recalibration never
228
228
  * rewrites history).
229
229
  */
package/dist/capture.d.ts CHANGED
@@ -48,6 +48,14 @@ export interface Segment {
48
48
  * memories collide on the UNIQUE index.
49
49
  */
50
50
  idSuffix: string;
51
+ /**
52
+ * #619: the running per-entry workspace this segment's entries ran in (the
53
+ * packer splits at every workspace CHANGE). Null when the caller passed no
54
+ * `entryWorkspaces` (the whole-batch fallback applies) or the group's
55
+ * entries carried none — the POST layer resolves `seg.workspacePath ??
56
+ * batch.workspacePath ?? null`.
57
+ */
58
+ workspacePath: string | null;
51
59
  }
52
60
  /** The wire body for POST /distill. */
53
61
  export interface DistillBody {
@@ -241,8 +249,18 @@ export declare function hardSplitText(text: string, maxChars?: number): string[]
241
249
  * the grouped entries (extractConversationText) so cleaning/redaction stay
242
250
  * coherent. A single entry larger than maxChars is emitted as its own run of
243
251
  * hard-split pieces (A2).
252
+ *
253
+ * #619: with `entryWorkspaces` (CC's per-entry `cwd`, aligned with `entries`)
254
+ * the packer ALSO breaks the group at every workspace change, and each flushed
255
+ * segment (and each hard-split piece of an oversized entry) carries the
256
+ * running workspace as `workspacePath`. The splits only ADD boundaries —
257
+ * segStart/segEnd stay exact entry-cursor boundaries and the segments remain a
258
+ * contiguous partition of the delta, so the cursor discipline is unchanged.
259
+ * Without `entryWorkspaces` every segment gets `workspacePath: null` and the
260
+ * caller falls back to the batch-level workspace — byte-identical to the
261
+ * pre-#619 behavior for Hermes/Pi/OC/opencode.
244
262
  */
245
- export declare function packSegments(entries: unknown[], startCursor: number, entryCursors: number[], maxChars?: number): Segment[];
263
+ export declare function packSegments(entries: unknown[], startCursor: number, entryCursors: number[], maxChars?: number, entryWorkspaces?: Array<string | null>): Segment[];
246
264
  /** True when a 429 result is the tenant token-budget gate (terminal). */
247
265
  export declare function isTokenBudget429(result: PostResult): boolean;
248
266
  /** In-run retries for a rate-limit 429 before giving up as transient. */
package/dist/capture.js CHANGED
@@ -145,13 +145,28 @@ function hardSplitText(text, maxChars = exports.SEGMENT_MAX_CHARS) {
145
145
  * the grouped entries (extractConversationText) so cleaning/redaction stay
146
146
  * coherent. A single entry larger than maxChars is emitted as its own run of
147
147
  * hard-split pieces (A2).
148
+ *
149
+ * #619: with `entryWorkspaces` (CC's per-entry `cwd`, aligned with `entries`)
150
+ * the packer ALSO breaks the group at every workspace change, and each flushed
151
+ * segment (and each hard-split piece of an oversized entry) carries the
152
+ * running workspace as `workspacePath`. The splits only ADD boundaries —
153
+ * segStart/segEnd stay exact entry-cursor boundaries and the segments remain a
154
+ * contiguous partition of the delta, so the cursor discipline is unchanged.
155
+ * Without `entryWorkspaces` every segment gets `workspacePath: null` and the
156
+ * caller falls back to the batch-level workspace — byte-identical to the
157
+ * pre-#619 behavior for Hermes/Pi/OC/opencode.
148
158
  */
149
- function packSegments(entries, startCursor, entryCursors, maxChars = exports.SEGMENT_MAX_CHARS) {
159
+ function packSegments(entries, startCursor, entryCursors, maxChars = exports.SEGMENT_MAX_CHARS, entryWorkspaces) {
150
160
  const segments = [];
151
161
  // Boundary cursor before entry i (startCursor for i=0, else entryCursors[i-1]).
152
162
  const boundaryBefore = (i) => (i === 0 ? startCursor : entryCursors[i - 1]);
153
163
  let groupStartIdx = -1;
154
164
  let groupSize = 0;
165
+ // #619: the running workspace of the OPEN group. Starts null; a non-empty
166
+ // per-entry value that DIFFERS flushes the open group first (the group
167
+ // belongs to the old workspace) and then becomes the running value. null
168
+ // entries (no cwd of their own) never split — they inherit the run.
169
+ let groupWorkspace = null;
155
170
  const flushGroup = (endIdxExclusive) => {
156
171
  if (groupStartIdx < 0)
157
172
  return;
@@ -161,11 +176,22 @@ function packSegments(entries, startCursor, entryCursors, maxChars = exports.SEG
161
176
  segStart: boundaryBefore(groupStartIdx),
162
177
  segEnd: entryCursors[endIdxExclusive - 1],
163
178
  idSuffix: "",
179
+ workspacePath: groupWorkspace,
164
180
  });
165
181
  groupStartIdx = -1;
166
182
  groupSize = 0;
167
183
  };
168
184
  for (let i = 0; i < entries.length; i++) {
185
+ // #619: a mid-session workspace change is a HARD boundary — the open
186
+ // group must not absorb entries from the new workspace (a confidential
187
+ // workspace's entries would silently take the previous birthplace).
188
+ if (entryWorkspaces) {
189
+ const ws = entryWorkspaces[i];
190
+ if (typeof ws === "string" && ws && ws !== groupWorkspace) {
191
+ flushGroup(i);
192
+ groupWorkspace = ws;
193
+ }
194
+ }
169
195
  const entryText = (0, distiller_js_1.extractConversationText)([entries[i]]);
170
196
  const entryLen = entryText.length;
171
197
  if (entryLen > maxChars) {
@@ -182,6 +208,7 @@ function packSegments(entries, startCursor, entryCursors, maxChars = exports.SEG
182
208
  segStart: boundaryBefore(i),
183
209
  segEnd: entryCursors[i],
184
210
  idSuffix: `.p${p}`,
211
+ workspacePath: groupWorkspace,
185
212
  });
186
213
  });
187
214
  continue;
@@ -290,7 +317,7 @@ async function captureBatches(batches, opts) {
290
317
  const distillUsage = { prompt: 0, completion: 0, total: 0 };
291
318
  for (const [batchIdx, batch] of batches.entries()) {
292
319
  const short = batch.sessionId.slice(0, 8);
293
- const segments = packSegments(batch.entries, batch.startCursor, batch.entryCursors, segmentMaxChars);
320
+ const segments = packSegments(batch.entries, batch.startCursor, batch.entryCursors, segmentMaxChars, batch.entryWorkspaces);
294
321
  if (segments.length === 0)
295
322
  continue;
296
323
  // Fresh whole-session degenerate floor (fix 5): only a startCursor-0 capture
@@ -313,16 +340,26 @@ async function captureBatches(batches, opts) {
313
340
  // has no prefix — keeps ids byte-identical to first-cut and to any already
314
341
  // stored on an older server.
315
342
  const genPrefix = batch.generation > 0 ? `g${batch.generation}.` : "";
316
- // #609/#614: the workspace birthplace signals, computed ONCE per batch
317
- // before the segment loop — the marker walk reads the workspace and each
318
- // ancestor (first hit wins), and both values ride EVERY segment POST so
319
- // the server can compose its confidentialPaths rule and validate the
320
- // marker key. null workspace (Hermes / unknown) sends a null path and a
321
- // null marker — never invented. #614: the client RELAYS marker content
322
- // (client_marker); it no longer asserts a confidentiality boolean —
323
- // validation is server-side.
324
- const workspacePath = batch.workspacePath ?? null;
325
- const markerContent = readConfidentialMarker(workspacePath);
343
+ // #609/#614/#619: the workspace birthplace signals, resolved PER SEGMENT
344
+ // below. The packer splits the delta at every per-entry workspace change
345
+ // (CC writes cwd on every entry), so each segment carries the workspace
346
+ // its OWN entries ran in — a mid-session cd must not silently re-
347
+ // birthplace later entries under the session's first workspace (#619:
348
+ // that mis-stamp lost confidential-workspace content its classification).
349
+ // Batches without per-entry workspaces (Pi/OC/opencode session cwd,
350
+ // Hermes null) pack null and fall back to `batch.workspacePath` —
351
+ // byte-identical to the pre-#619 single-stamp behavior. null workspace
352
+ // sends a null path and a null marker — never invented. #614: the client
353
+ // RELAYS marker content (client_marker); it no longer asserts a
354
+ // confidentiality boolean — validation is server-side. The walk is
355
+ // memoized per resolved path so the same workspace across segments never
356
+ // re-reads the filesystem (readConfidentialMarker semantics unchanged).
357
+ const markerCache = new Map();
358
+ const markerFor = (ws) => {
359
+ if (!markerCache.has(ws))
360
+ markerCache.set(ws, readConfidentialMarker(ws));
361
+ return markerCache.get(ws);
362
+ };
326
363
  // Cursor value the last confirmed boundary reached — advanced once, at
327
364
  // session end (A4), so per-session file writes stay bounded.
328
365
  let lastConfirmedEnd = batch.startCursor;
@@ -351,6 +388,10 @@ async function captureBatches(batches, opts) {
351
388
  lastConfirmedEnd = seg.segEnd;
352
389
  continue;
353
390
  }
391
+ // #619: this segment's own workspace — the per-entry value the packer
392
+ // stamped, falling back to the batch-level one when the reader had no
393
+ // per-entry cwds (the pre-#619 single-stamp shape).
394
+ const segWorkspace = seg.workspacePath ?? batch.workspacePath ?? null;
354
395
  const body = {
355
396
  text: seg.text,
356
397
  source_agent: batch.sourceAgent ?? `claude-code/${batch.projectName}`,
@@ -361,15 +402,15 @@ async function captureBatches(batches, opts) {
361
402
  session_id: batch.sessionId,
362
403
  segment_id: `${genPrefix}${seg.segStart}-${seg.segEnd}${seg.idSuffix}`,
363
404
  session_date: batch.date,
364
- // #609/#614: both workspace signals on every segment (see the
365
- // per-batch computation above) — the path verbatim, the marker's
405
+ // #609/#614/#619: both workspace signals on every segment (see the
406
+ // per-segment derivation above) — the path verbatim, the marker's
366
407
  // relayed CONTENT. Old servers never read unknown fields; the
367
408
  // pre-#614 client_confidential boolean is deliberately NOT sent
368
409
  // (DistillBody keeps the field documented as legacy for the skew
369
410
  // window — a #609 server reading only the boolean sees standard,
370
411
  // fail-closed, intended).
371
- workspace_path: workspacePath,
372
- client_marker: markerContent,
412
+ workspace_path: segWorkspace,
413
+ client_marker: markerFor(segWorkspace),
373
414
  };
374
415
  let result;
375
416
  try {
@@ -3,13 +3,13 @@
3
3
  * memory classification (`standard` | `confidential`, carried by
4
4
  * `memories.privacy`; see MemoryPrivacy in types.ts).
5
5
  *
6
- * The model, in one paragraph: an operator lists inner-circle agents in
6
+ * The model, in one paragraph: an operator lists confidential-circle agents in
7
7
  * config (`confidentialAgents`, the same agent-id namespace as
8
8
  * `identityAgents` / `?agent=`). Captures whose `source_agent` is rostered
9
9
  * are stamped `confidential` at intake — server-derived, deterministic, by
10
10
  * birthplace; never a content judgment (content classification was rejected,
11
11
  * #197) and never client-declared. The workspace marker (#609/#614) is
12
- * client-RELAYED but server-VALIDATED: the marker file carries the owner-set
12
+ * client-RELAYED but server-VALIDATED: the marker file carries the operator-set
13
13
  * `confidentialMarkerKey` as its content, compared timing-safe at intake —
14
14
  * marker content without the key never stamps (the client-writable
15
15
  * classification channel #614 closes; an unkeyed install ignores markers
@@ -46,11 +46,11 @@ export declare function resolveConfidentialAgents(config: Record<string, unknown
46
46
  };
47
47
  /**
48
48
  * Normalize a capture-side `source_agent` for roster matching. Capture stamps
49
- * harness-qualified ids (`hermes/nano`, `claude-code/myproject`), while the
49
+ * harness-qualified ids (`hermes/atlas`, `claude-code/myproject`), while the
50
50
  * roster carries bare agent ids (the same ids the read side receives as
51
51
  * `agent`) — ONE config list, no read-ids/capture-ids sync hazard. The match
52
- * is exact, or exact after stripping the FIRST path segment (so `hermes/nano`
53
- * matches roster `nano`, and a future `anything/nano` matches too — generic
52
+ * is exact, or exact after stripping the FIRST path segment (so `hermes/atlas`
53
+ * matches roster `atlas`, and a future `anything/atlas` matches too — generic
54
54
  * prefix, not a per-harness table). Case-insensitive on the id half via the
55
55
  * roster's sanitized (lowercased) form.
56
56
  */
@@ -115,7 +115,7 @@ export declare function matchesConfidentialPath(workspacePath: string | null | u
115
115
  */
116
116
  export declare function safeMarkerKeyEqual(markerContent: string, key: string): boolean;
117
117
  /**
118
- * Resolve the `confidentialMarkerKey` (#614) — the owner-set secret a
118
+ * Resolve the `confidentialMarkerKey` (#614) — the operator-set secret a
119
119
  * workspace marker must carry for its folder to stamp confidential at
120
120
  * intake. Precedence: env `HICORTEX_CONFIDENTIAL_MARKER_KEY` OVERRIDES the
121
121
  * config value (the env-last-word ops override, so a restart-free rotation
@@ -142,7 +142,7 @@ export declare function resolveConfidentialMarkerKey(config: Record<string, unkn
142
142
  * inert (the empty-marker client-writable channel is closed), and a
143
143
  * present-but-refused marker never reduces a server rule (markers only add,
144
144
  * never subtract — safe because a token holder can already POST arbitrary
145
- * content, the #599 F5 ruling, token = owner). The optional third argument
145
+ * content). The optional third argument
146
146
  * keeps every existing caller byte-identical (no signals = the #332
147
147
  * agent-only rule).
148
148
  */
@@ -180,8 +180,8 @@ export interface IntakeWorkspaceSignals {
180
180
  * blank, or unknown `agent` → false (fail-closed: an unknown id can never
181
181
  * widen visibility, exactly like the identity layer's mode resolution). The
182
182
  * `agent` value is sanitized first so a wire id arrives in the roster's
183
- * namespace (`Nano` → `nano`); note sanitizeAgentId also collapses inner
184
- * separators, so `hermes/nano` sent as a requester id reads as `hermes-nano`
183
+ * namespace (`Atlas` → `atlas`); note sanitizeAgentId also collapses inner
184
+ * separators, so `hermes/atlas` sent as a requester id reads as `hermes-atlas`
185
185
  * — the read side intentionally matches BARE ids only (plugins send their
186
186
  * resolved profile name, not their capture-side qualified stamp).
187
187
  */
@@ -4,13 +4,13 @@
4
4
  * memory classification (`standard` | `confidential`, carried by
5
5
  * `memories.privacy`; see MemoryPrivacy in types.ts).
6
6
  *
7
- * The model, in one paragraph: an operator lists inner-circle agents in
7
+ * The model, in one paragraph: an operator lists confidential-circle agents in
8
8
  * config (`confidentialAgents`, the same agent-id namespace as
9
9
  * `identityAgents` / `?agent=`). Captures whose `source_agent` is rostered
10
10
  * are stamped `confidential` at intake — server-derived, deterministic, by
11
11
  * birthplace; never a content judgment (content classification was rejected,
12
12
  * #197) and never client-declared. The workspace marker (#609/#614) is
13
- * client-RELAYED but server-VALIDATED: the marker file carries the owner-set
13
+ * client-RELAYED but server-VALIDATED: the marker file carries the operator-set
14
14
  * `confidentialMarkerKey` as its content, compared timing-safe at intake —
15
15
  * marker content without the key never stamps (the client-writable
16
16
  * classification channel #614 closes; an unkeyed install ignores markers
@@ -84,11 +84,11 @@ function resolveConfidentialAgents(config) {
84
84
  }
85
85
  /**
86
86
  * Normalize a capture-side `source_agent` for roster matching. Capture stamps
87
- * harness-qualified ids (`hermes/nano`, `claude-code/myproject`), while the
87
+ * harness-qualified ids (`hermes/atlas`, `claude-code/myproject`), while the
88
88
  * roster carries bare agent ids (the same ids the read side receives as
89
89
  * `agent`) — ONE config list, no read-ids/capture-ids sync hazard. The match
90
- * is exact, or exact after stripping the FIRST path segment (so `hermes/nano`
91
- * matches roster `nano`, and a future `anything/nano` matches too — generic
90
+ * is exact, or exact after stripping the FIRST path segment (so `hermes/atlas`
91
+ * matches roster `atlas`, and a future `anything/atlas` matches too — generic
92
92
  * prefix, not a per-harness table). Case-insensitive on the id half via the
93
93
  * roster's sanitized (lowercased) form.
94
94
  */
@@ -103,8 +103,8 @@ function isConfidentialSourceAgent(sourceAgent, roster) {
103
103
  return false;
104
104
  const bare = agent.slice(slash + 1);
105
105
  const rest = bare.indexOf("/");
106
- // Strip only the FIRST segment — `hermes/nano` → `nano`, but
107
- // `a/b/nano` → `b/nano` (never a deep-suffix match; capture ids are
106
+ // Strip only the FIRST segment — `hermes/atlas` → `atlas`, but
107
+ // `a/b/atlas` → `b/atlas` (never a deep-suffix match; capture ids are
108
108
  // single-qualified by construction).
109
109
  return rest < 0 && roster.includes(bare);
110
110
  }
@@ -247,7 +247,7 @@ function safeMarkerKeyEqual(markerContent, key) {
247
247
  return a.length === b.length && (0, node_crypto_1.timingSafeEqual)(a, b);
248
248
  }
249
249
  /**
250
- * Resolve the `confidentialMarkerKey` (#614) — the owner-set secret a
250
+ * Resolve the `confidentialMarkerKey` (#614) — the operator-set secret a
251
251
  * workspace marker must carry for its folder to stamp confidential at
252
252
  * intake. Precedence: env `HICORTEX_CONFIDENTIAL_MARKER_KEY` OVERRIDES the
253
253
  * config value (the env-last-word ops override, so a restart-free rotation
@@ -279,7 +279,7 @@ function resolveConfidentialMarkerKey(config) {
279
279
  * inert (the empty-marker client-writable channel is closed), and a
280
280
  * present-but-refused marker never reduces a server rule (markers only add,
281
281
  * never subtract — safe because a token holder can already POST arbitrary
282
- * content, the #599 F5 ruling, token = owner). The optional third argument
282
+ * content). The optional third argument
283
283
  * keeps every existing caller byte-identical (no signals = the #332
284
284
  * agent-only rule).
285
285
  */
@@ -302,8 +302,8 @@ function deriveIntakePrivacy(sourceAgent, roster, signals) {
302
302
  * blank, or unknown `agent` → false (fail-closed: an unknown id can never
303
303
  * widen visibility, exactly like the identity layer's mode resolution). The
304
304
  * `agent` value is sanitized first so a wire id arrives in the roster's
305
- * namespace (`Nano` → `nano`); note sanitizeAgentId also collapses inner
306
- * separators, so `hermes/nano` sent as a requester id reads as `hermes-nano`
305
+ * namespace (`Atlas` → `atlas`); note sanitizeAgentId also collapses inner
306
+ * separators, so `hermes/atlas` sent as a requester id reads as `hermes-atlas`
307
307
  * — the read side intentionally matches BARE ids only (plugins send their
308
308
  * resolved profile name, not their capture-side qualified stamp).
309
309
  */
package/dist/cluster.d.ts CHANGED
@@ -27,7 +27,7 @@ export declare function clusterEdges(edges: Edge[], threshold: number): string[]
27
27
  export declare function clusterExcess(clusters: string[][]): number;
28
28
  /** Metadata row shape for the merge-safety check. `source_agent` is on the
29
29
  * row (the column still exists) but is NOT a merge-safety field: the agent
30
- * rail was REMOVED by owner decision (#206 decision 2, 2026-09-21) —
30
+ * rail was REMOVED (#206 decision 2) —
31
31
  * cross-agent clusters merge, because attribution survives on the retained
32
32
  * absorbed-loser row and no recall path filters by source_agent. Project is
33
33
  * one rail; `privacy` (the #332 classification, standard | confidential) is
@@ -65,7 +65,7 @@ export interface ConfidentialMarkerOptions {
65
65
  /**
66
66
  * Explicit marker key (#616 ROTATION, the CLI `--key` flag): PUT the chosen
67
67
  * value to the server, persist it locally, then write the marker. Checked
68
- * BEFORE env and config — an owner rotating deliberately pushes the new
68
+ * BEFORE env and config — an operator rotating deliberately pushes the new
69
69
  * value, not the locally-cached old one.
70
70
  */
71
71
  key?: string;
@@ -248,11 +248,12 @@ export interface LinkCandidate {
248
248
  *
249
249
  * #602 — ADAPTIVE CLASS-SCOPED FETCH. The pre-#602 code fetched a fixed
250
250
  * top-10 UNFILTERED window and then dropped cross-class neighbors in the
251
- * loop — the #192 filtered-over-fetch defect class. Starvation math: in a
252
- * 22K-standard / 1K-confidential corpus a confidential memory's 10 nearest
253
- * neighbors are usually ALL standard (the classes are topically distinct but
254
- * the majority class is 22× larger), so the confidential pool systematically
255
- * under-linked — its same-class neighbors never made the window. The fix
251
+ * loop — the #192 filtered-over-fetch defect class. Starvation math: when
252
+ * the standard pool heavily outnumbers the confidential pool, a confidential
253
+ * memory's 10 nearest neighbors are usually ALL standard (the classes are
254
+ * topically distinct but the majority class is much larger), so the
255
+ * confidential pool systematically under-linked — its same-class neighbors
256
+ * never made the window. The fix
256
257
  * escalates the window (k × 4 per step, capped at CONSOLIDATE_LINK_FETCH_MAX_K
257
258
  * = the #192 over-fetch cap) until the window holds CONSOLIDATE_LINK_TOP_K
258
259
  * same-class neighbors, comes back short (no more rows may exist), or hits
@@ -1083,11 +1083,12 @@ async function stageDomainCuration(db, llm, budget, dryRun, stateDir) {
1083
1083
  *
1084
1084
  * #602 — ADAPTIVE CLASS-SCOPED FETCH. The pre-#602 code fetched a fixed
1085
1085
  * top-10 UNFILTERED window and then dropped cross-class neighbors in the
1086
- * loop — the #192 filtered-over-fetch defect class. Starvation math: in a
1087
- * 22K-standard / 1K-confidential corpus a confidential memory's 10 nearest
1088
- * neighbors are usually ALL standard (the classes are topically distinct but
1089
- * the majority class is 22× larger), so the confidential pool systematically
1090
- * under-linked — its same-class neighbors never made the window. The fix
1086
+ * loop — the #192 filtered-over-fetch defect class. Starvation math: when
1087
+ * the standard pool heavily outnumbers the confidential pool, a confidential
1088
+ * memory's 10 nearest neighbors are usually ALL standard (the classes are
1089
+ * topically distinct but the majority class is much larger), so the
1090
+ * confidential pool systematically under-linked — its same-class neighbors
1091
+ * never made the window. The fix
1091
1092
  * escalates the window (k × 4 per step, capped at CONSOLIDATE_LINK_FETCH_MAX_K
1092
1093
  * = the #192 over-fetch cap) until the window holds CONSOLIDATE_LINK_TOP_K
1093
1094
  * same-class neighbors, comes back short (no more rows may exist), or hits
@@ -9,7 +9,7 @@
9
9
  * /dashboard/data, GET /dashboard/field and GET /dashboard/events. The
10
10
  * mutation surface is deliberately narrow: PUT /dashboard/model (#422),
11
11
  * PUT /dashboard/capture-pause (#423), and PUT /dashboard/quality/verdict
12
- * (#578 — the contested thumbs) — each an owner-ruled scoped writer, never
12
+ * (#578 — the contested thumbs) — each an explicitly scoped writer, never
13
13
  * a general write path.
14
14
  *
15
15
  * Layering (mirrors how recall-index.ts holds pure logic and viz.ts holds
@@ -179,16 +179,16 @@ export interface DashboardSnapshot {
179
179
  }
180
180
  /**
181
181
  * #601 — the confidential circle's VISIBILITY block: which agents are
182
- * inner-circle and, for the observed ones, how many confidential memories
183
- * they carry. Purely informational (the dashboard is NOT gated — confidential
184
- * content stays visible on the console by the standing ruling); the page
182
+ * confidential-circle and, for the observed ones, how many confidential
183
+ * memories they carry. Purely informational (the dashboard is NOT gated —
184
+ * confidential content stays visible on the console by design); the page
185
185
  * renders amber pills on circle agents, nothing on standard ones.
186
186
  */
187
187
  export interface AgentCircle {
188
188
  /** The sanitized roster (resolveConfidentialAgents — the one agent-id
189
189
  * namespace shared with `?agent=` and identityAgents). */
190
190
  roster: string[];
191
- /** OBSERVED source_agent values (e.g. "hermes/nano") that match the
191
+ /** OBSERVED source_agent values (e.g. "hermes/atlas") that match the
192
192
  * roster, each mapped to that agent's confidential memory count.
193
193
  * Membership is KEY PRESENCE (a rostered agent observed with 0
194
194
  * confidential rows is a member at 0); NULL source_agent never matches. */
package/dist/dashboard.js CHANGED
@@ -10,7 +10,7 @@
10
10
  * /dashboard/data, GET /dashboard/field and GET /dashboard/events. The
11
11
  * mutation surface is deliberately narrow: PUT /dashboard/model (#422),
12
12
  * PUT /dashboard/capture-pause (#423), and PUT /dashboard/quality/verdict
13
- * (#578 — the contested thumbs) — each an owner-ruled scoped writer, never
13
+ * (#578 — the contested thumbs) — each an explicitly scoped writer, never
14
14
  * a general write path.
15
15
  *
16
16
  * Layering (mirrors how recall-index.ts holds pure logic and viz.ts holds
@@ -1327,7 +1327,7 @@ function dashboardCapturePausePutHandler(getDb) {
1327
1327
  // (the recall-precision layering law); these are the thin express adapters
1328
1328
  // (the dashboardDataHandler convention). The GET is lazy + paginated so the
1329
1329
  // graded data stays out of the ≤ 2 KB memory_precision block; the PUT is the
1330
- // dashboard's THIRD scoped writer (owner thumbs — the calibration
1330
+ // dashboard's THIRD scoped writer (manual thumbs — the calibration
1331
1331
  // reference), after /dashboard/model and /dashboard/capture-pause.
1332
1332
  // ---------------------------------------------------------------------------
1333
1333
  /**
package/dist/db.js CHANGED
@@ -860,7 +860,7 @@ const MIGRATIONS = [
860
860
  // (shown-then-fetched, marked useful with zero grading calls). score +
861
861
  // confidence are stored RAW and THRESHOLD-FREE (the #476 law —
862
862
  // "useful" and "contested" are derived at render), verdict carries the
863
- // owner's ±1 thumb (NULL for the 'auto' grader, derived at render). Pruned with
863
+ // reviewer's ±1 thumb (NULL for the 'auto' grader, derived at render). Pruned with
864
864
  // the 90-day horizon EXCEPT grader='owner' rows.
865
865
  //
866
866
  // Idempotent: hasColumn-guarded ALTER (v15 pattern) + IF NOT EXISTS.
package/dist/graph.d.ts CHANGED
@@ -51,8 +51,7 @@ export declare function confidentialNodeIds(db: Database.Database): Set<string>;
51
51
  * #332: `includeConfidential` defaults to FALSE — the agent-facing surfaces
52
52
  * (REST /graph?op=hubs without a member agent, the MCP graph tool) hard-omit
53
53
  * confidential hubs (their content snippets ARE content-bearing). The /viz
54
- * export (the owner surface — deliberately ungated per the #332 owner ruling)
55
- * passes true.
54
+ * export (deliberately ungated, #332) passes true.
56
55
  */
57
56
  export declare function detectHubs(db: Database.Database, thresholdMultiplier?: number, minLinks?: number, opts?: {
58
57
  includeConfidential?: boolean;
package/dist/graph.js CHANGED
@@ -159,8 +159,7 @@ function confidentialNodeIds(db) {
159
159
  * #332: `includeConfidential` defaults to FALSE — the agent-facing surfaces
160
160
  * (REST /graph?op=hubs without a member agent, the MCP graph tool) hard-omit
161
161
  * confidential hubs (their content snippets ARE content-bearing). The /viz
162
- * export (the owner surface — deliberately ungated per the #332 owner ruling)
163
- * passes true.
162
+ * export (deliberately ungated, #332) passes true.
164
163
  */
165
164
  function detectHubs(db, thresholdMultiplier = 2, minLinks = 3, opts) {
166
165
  const hidden = opts?.includeConfidential === true ? null : confidentialNodeIds(db);
@@ -205,7 +204,7 @@ function getNeighbors(db, memoryId, limit = 10, relationship, opts) {
205
204
  // row). The CENTER memory's own class is the CALLER's gate — an
206
205
  // agent-facing adapter must refuse a confidential center id before calling
207
206
  // (REST /graph and the MCP tool 404 it for non-members, same contract as
208
- // GET /memory). Default false = omit; the owner surfaces pass true.
207
+ // GET /memory). Default false = omit; member-gated callers pass true.
209
208
  const hidden = opts?.includeConfidential === true ? null : confidentialNodeIds(db);
210
209
  let sql = `SELECT source_id, target_id, relationship, strength
211
210
  FROM memory_links
@@ -300,9 +299,8 @@ function exportGraph(db, options = {}) {
300
299
  if (where.length > 0)
301
300
  sql += ` WHERE ${where.join(" AND ")}`;
302
301
  const rows = db.prepare(sql).all(...params);
303
- // #332: the /viz export is the OWNER surface — deliberately ungated per the
304
- // issue-332 owner ruling ("dashboard/viz NOT gated in this build"; a
305
- // show-confidential graph toggle is a separate later item). Explicit true.
302
+ // #332: the /viz export is deliberately ungated (a show-confidential
303
+ // graph toggle is a separate later item). Explicit true.
306
304
  const hubIds = new Set(detectHubs(db, 2, 3, { includeConfidential: true }).map((h) => h.id));
307
305
  // Score, filter on effective strength, rank, cap
308
306
  const scored = rows.map((row) => {
@@ -80,10 +80,10 @@ export declare function resolveConfig(): ResolvedConfig | null;
80
80
  export declare function deriveHookProject(cwd: string, aliases?: Readonly<Record<string, string>> | null): string | null;
81
81
  /**
82
82
  * #600: the workspace-scoped agent id a CC client sends on its read calls —
83
- * the SANITIZED basename of the session's working directory (owner ruling
84
- * 2026-11-17: the workspace folder name IS the agent name, the same basename
85
- * `project` is derived from; no precedence chain, no configured-name
86
- * override). The server's confidential-circle gate matches rostered BARE ids
83
+ * the SANITIZED basename of the session's working directory (the workspace
84
+ * folder name IS the agent name, the same basename `project` is derived
85
+ * from; no precedence chain, no configured-name override). The server's
86
+ * confidential-circle gate matches rostered BARE ids
87
87
  * here. null when the basename sanitizes to nothing (e.g. "!!!" or "/") → the
88
88
  * caller omits the `agent` param entirely, never sending an id the server
89
89
  * would 400 on (the fail-soft hook would silently swallow that and drop the
@@ -105,10 +105,10 @@ function deriveHookProject(cwd, aliases) {
105
105
  }
106
106
  /**
107
107
  * #600: the workspace-scoped agent id a CC client sends on its read calls —
108
- * the SANITIZED basename of the session's working directory (owner ruling
109
- * 2026-11-17: the workspace folder name IS the agent name, the same basename
110
- * `project` is derived from; no precedence chain, no configured-name
111
- * override). The server's confidential-circle gate matches rostered BARE ids
108
+ * the SANITIZED basename of the session's working directory (the workspace
109
+ * folder name IS the agent name, the same basename `project` is derived
110
+ * from; no precedence chain, no configured-name override). The server's
111
+ * confidential-circle gate matches rostered BARE ids
112
112
  * here. null when the basename sanitizes to nothing (e.g. "!!!" or "/") → the
113
113
  * caller omits the `agent` param entirely, never sending an id the server
114
114
  * would 400 on (the fail-soft hook would silently swallow that and drop the
@@ -330,8 +330,8 @@ function gateAndRenderIdentity(data, harness, opts) {
330
330
  async function fetchIdentityBlock(cfg, cwd = process.cwd()) {
331
331
  // Send ?agent= only when we have a valid id; the server does the merge and
332
332
  // returns the resolved sections, so the hook stays dumb (no client-side mode
333
- // logic). #600: the id is the SANITIZED WORKSPACE BASENAME (owner ruling
334
- // 2026-11-17: the folder name IS the agent name — it replaces the configured
333
+ // logic). #600: the id is the SANITIZED WORKSPACE BASENAME (the folder
334
+ // name IS the agent name — it replaces the configured
335
335
  // agentName on the hook path, which stays config/status-reported only). A
336
336
  // null id (a basename that sanitizes to nothing) → bare /identity → the
337
337
  // shared global set.
@@ -5,7 +5,7 @@
5
5
  * The problem (#616): `hicortex confidential` (#614) requires the server's
6
6
  * `confidentialMarkerKey` on the machine it runs on, and distributing it by
7
7
  * hand (mirror into each client's config.json, or export its env mirror) is
8
- * ceremony an owner does once per machine. The fix keeps the client's ONE
8
+ * ceremony the operator repeats once per machine. The fix keeps the client's ONE
9
9
  * existing credential: the machine already holds the server URL + authToken,
10
10
  * so the command can FETCH the key (second machine: no new key generated) or
11
11
  * GENERATE one and REGISTER it with the server (first machine ever) — one
@@ -16,12 +16,12 @@
16
16
  * and NOTHING else. Anything richer would turn the bearer token into a
17
17
  * config exfiltration/write surface it deliberately is not today.
18
18
  *
19
- * Accepted trade-off (owner ruling on the issue — do not re-litigate): the
20
- * key is fetchable by token, which collapses the marker key's barrier to
21
- * token = owner. Fine: the marker key's real protection is against workspace
22
- * processes WITHOUT the token/config access (a shell script or agent reading
23
- * the marker file cannot forge one); a token holder can already POST
24
- * arbitrary content (the #599 F5 ruling).
19
+ * Accepted trade-off (settled design decision — do not re-litigate): the key
20
+ * is fetchable by token, which collapses the marker key's barrier to the
21
+ * token itself. That is acceptable: the marker key's real protection is
22
+ * against workspace processes WITHOUT the token/config access (a shell
23
+ * script or agent reading the marker file cannot forge one); a token holder
24
+ * can already POST arbitrary content.
25
25
  *
26
26
  * Layout follows the identity-store.ts precedent: pure, side-effect-free
27
27
  * handlers HERE (validation + response shaping), thin adapters in
@@ -6,7 +6,7 @@
6
6
  * The problem (#616): `hicortex confidential` (#614) requires the server's
7
7
  * `confidentialMarkerKey` on the machine it runs on, and distributing it by
8
8
  * hand (mirror into each client's config.json, or export its env mirror) is
9
- * ceremony an owner does once per machine. The fix keeps the client's ONE
9
+ * ceremony the operator repeats once per machine. The fix keeps the client's ONE
10
10
  * existing credential: the machine already holds the server URL + authToken,
11
11
  * so the command can FETCH the key (second machine: no new key generated) or
12
12
  * GENERATE one and REGISTER it with the server (first machine ever) — one
@@ -17,12 +17,12 @@
17
17
  * and NOTHING else. Anything richer would turn the bearer token into a
18
18
  * config exfiltration/write surface it deliberately is not today.
19
19
  *
20
- * Accepted trade-off (owner ruling on the issue — do not re-litigate): the
21
- * key is fetchable by token, which collapses the marker key's barrier to
22
- * token = owner. Fine: the marker key's real protection is against workspace
23
- * processes WITHOUT the token/config access (a shell script or agent reading
24
- * the marker file cannot forge one); a token holder can already POST
25
- * arbitrary content (the #599 F5 ruling).
20
+ * Accepted trade-off (settled design decision — do not re-litigate): the key
21
+ * is fetchable by token, which collapses the marker key's barrier to the
22
+ * token itself. That is acceptable: the marker key's real protection is
23
+ * against workspace processes WITHOUT the token/config access (a shell
24
+ * script or agent reading the marker file cannot forge one); a token holder
25
+ * can already POST arbitrary content.
26
26
  *
27
27
  * Layout follows the identity-store.ts precedent: pure, side-effect-free
28
28
  * handlers HERE (validation + response shaping), thin adapters in
@@ -1528,8 +1528,8 @@ async function startServer(options = {}) {
1528
1528
  // HICORTEX_CONFIDENTIAL_MARKER_KEY env override 409s (the env would shadow
1529
1529
  // the write — no no-op success; the rule lives in the pure handler).
1530
1530
  // Bearer-only: the standard auth middleware above, no exemption — the key
1531
- // is the confidential circle's secret, fetchable by token = owner (the
1532
- // #616 accepted trade-off). Pure handlers in marker-key-api.ts.
1531
+ // is the confidential circle's secret, fetchable by token (the #616
1532
+ // accepted trade-off). Pure handlers in marker-key-api.ts.
1533
1533
  app.get("/confidential/marker-key", (_req, res) => {
1534
1534
  const r = (0, marker_key_api_js_1.handleMarkerKeyGet)(confidentialMarkerKey);
1535
1535
  res.status(r.status).json(r.body);
@@ -1713,8 +1713,8 @@ async function startServer(options = {}) {
1713
1713
  // messages branch is already covered above. Disable-resistance
1714
1714
  // (hostedMode) is Phase 0b.
1715
1715
  // #332 redaction pilot: CONFIDENTIAL deliveries use the extended preset
1716
- // (DEFAULT_PATTERNS + emails + phone numbers) — the material an
1717
- // inner-circle agent captures is exactly the contact-identifier-rich
1716
+ // (DEFAULT_PATTERNS + emails + phone numbers) — the material a
1717
+ // confidential-circle agent captures is exactly the contact-identifier-rich
1718
1718
  // kind (#558). Standard deliveries keep today's set byte-identically.
1719
1719
  if (fromTextBranch) {
1720
1720
  const { text: redacted, count } = (0, redact_js_1.redact)(conversationText, {
@@ -1969,8 +1969,8 @@ async function startServer(options = {}) {
1969
1969
  return;
1970
1970
  }
1971
1971
  // NOTE (#332): `privacy` is no longer a writable field — classification is
1972
- // server-derived at intake and changed only by the owner's
1973
- // `hicortex backfill-privacy`. A body privacy field is ignored (kept out
1972
+ // server-derived at intake and changed only by the `hicortex
1973
+ // backfill-privacy` command. A body privacy field is ignored (kept out
1974
1974
  // of the destructure so the intent is structural).
1975
1975
  const { id, content, project, memory_type } = req.body ?? {};
1976
1976
  if (!id || typeof id !== "string") {
@@ -2176,9 +2176,9 @@ async function startServer(options = {}) {
2176
2176
  const filterDomain = typeof req.query.domain === "string" && req.query.domain ? req.query.domain : undefined;
2177
2177
  const filterRelationship = typeof req.query.relationship === "string" && req.query.relationship ? req.query.relationship : undefined;
2178
2178
  // #332: the optional `agent` param gates neighbors/hubs/path (the
2179
- // content-bearing ops). op=export stays UNGATED — it is the /viz owner
2180
- // surface (owner ruling: dashboard/viz not gated in this build; a
2181
- // show-confidential toggle is a separate later item).
2179
+ // content-bearing ops). op=export stays UNGATED — it feeds /viz, which
2180
+ // is deliberately ungated (a show-confidential toggle is a separate
2181
+ // later item).
2182
2182
  const member = requestSeesConfidential(req.query.agent);
2183
2183
  // A confidential endpoint/center id is invisible to non-members — same
2184
2184
  // 404 contract as GET /memory (existence is not revealed).
@@ -2359,13 +2359,13 @@ async function startServer(options = {}) {
2359
2359
  // src/dashboard.ts.
2360
2360
  app.get("/dashboard/quality/contested", (0, dashboard_js_1.dashboardQualityContestedHandler)(() => db));
2361
2361
  // PUT /dashboard/quality/verdict — the dashboard's THIRD scoped writer
2362
- // (after /dashboard/model and /dashboard/capture-pause): the owner's thumbs
2363
- // on a contested line. Body {id, verdict: 1|-1} (numeric: 1 useful, -1
2364
- // not) — persisted as grader='owner', a NEW verdict row against the same
2365
- // (push, memory) so history is append-only; these rows are the
2366
- // owner calibration reference and are NEVER pruned by the nightly verdict
2367
- // retention. 404 on an unknown id, 400 on a malformed body. Bearer-only
2368
- // like every dashboard writer; localhost bypass applies.
2362
+ // (after /dashboard/model and /dashboard/capture-pause): manual review
2363
+ // (thumbs) on a contested line. Body {id, verdict: 1|-1} (numeric: 1
2364
+ // useful, -1 not) — persisted as grader='owner', a NEW verdict row against
2365
+ // the same (push, memory) so history is append-only; these rows are the
2366
+ // manual-verdict calibration reference and are NEVER pruned by the nightly
2367
+ // verdict retention. 404 on an unknown id, 400 on a malformed body.
2368
+ // Bearer-only like every dashboard writer; localhost bypass applies.
2369
2369
  app.put("/dashboard/quality/verdict", (0, dashboard_js_1.dashboardQualityVerdictPutHandler)(() => db));
2370
2370
  // GET /account — account identity for the console nav (name/org/plan from
2371
2371
  // config). The LIGHTWEIGHT twin of the account block inside /dashboard/data:
package/dist/prompts.d.ts CHANGED
@@ -18,8 +18,8 @@ import type { MemoryPrivacy } from "./types.js";
18
18
  export declare const REFLECTION_PRIVACY_LINE_STANDARD = "Privacy: Never include personal data (names, health, finances, credentials) in lesson text. Abstract to the process level.";
19
19
  /**
20
20
  * The CONFIDENTIAL pool's reflection privacy line (#602). Three elements:
21
- * (a) the pool serves the owner's inner circle only (confidential circle,
22
- * #598 — its lessons stay inside the pool via the inherited stamp);
21
+ * (a) the pool is scoped to the confidential circle only (#598 — its
22
+ * lessons stay inside the pool via the inherited stamp);
23
23
  * (b) lesson text MAY reference the user's personal domains at the process
24
24
  * level where needed to make the lesson actionable — the standard line
25
25
  * suppressed all confidential lessons by construction (#602 finding);
@@ -46,16 +46,14 @@ export declare function importanceScoring(memoriesBlock: string): string;
46
46
  * POOL-AWARE (#602): the optional `pool` argument swaps ONLY the privacy line.
47
47
  * Absent/undefined = "standard" = the pre-#602 prompt BYTE-IDENTICAL — the
48
48
  * standard pool's prompt must never change. The confidential variant exists
49
- * because the confidential pool is BY DEFINITION personal-domain content
50
- * (health, finances, the people in the owner's inner circle), so the standard
51
- * line ("Never include personal data (names, health, finances, credentials)")
52
- * suppressed every confidential lesson by construction — #602's measured
53
- * finding: 0 confidential lessons from a real cohort. Owner ruling
54
- * 2026-11-12: the confidential pool SHOULD generate lessons for the inner
55
- * circle; only the PROMPT suppressed them. The confidential line keeps one
56
- * absolute: credentials/passwords/API keys/secrets are never included.
57
- * Everything else in the prompt (generality bar, examples, output schema) is
58
- * shared verbatim by both pools — pinned by tests/reflection-prompt.test.ts.
49
+ * because the confidential pool is personal-domain content by definition,
50
+ * so the standard line ("Never include personal data (names, health,
51
+ * finances, credentials)") suppressed confidential lessons by construction
52
+ * — only the PROMPT suppressed them; the confidential pool SHOULD generate
53
+ * lessons. The confidential line keeps one absolute: credentials/passwords/
54
+ * API keys/secrets are never included. Everything else in the prompt
55
+ * (generality bar, examples, output schema) is shared verbatim by both
56
+ * pools — pinned by tests/reflection-prompt.test.ts.
59
57
  */
60
58
  export declare function reflection(memoriesBlock: string, recentLessons?: string, pool?: MemoryPrivacy): string;
61
59
  /**
package/dist/prompts.js CHANGED
@@ -24,8 +24,8 @@ exports.domainCuration = domainCuration;
24
24
  exports.REFLECTION_PRIVACY_LINE_STANDARD = "Privacy: Never include personal data (names, health, finances, credentials) in lesson text. Abstract to the process level.";
25
25
  /**
26
26
  * The CONFIDENTIAL pool's reflection privacy line (#602). Three elements:
27
- * (a) the pool serves the owner's inner circle only (confidential circle,
28
- * #598 — its lessons stay inside the pool via the inherited stamp);
27
+ * (a) the pool is scoped to the confidential circle only (#598 — its
28
+ * lessons stay inside the pool via the inherited stamp);
29
29
  * (b) lesson text MAY reference the user's personal domains at the process
30
30
  * level where needed to make the lesson actionable — the standard line
31
31
  * suppressed all confidential lessons by construction (#602 finding);
@@ -83,16 +83,14 @@ No explanations. Just the JSON array.`;
83
83
  * POOL-AWARE (#602): the optional `pool` argument swaps ONLY the privacy line.
84
84
  * Absent/undefined = "standard" = the pre-#602 prompt BYTE-IDENTICAL — the
85
85
  * standard pool's prompt must never change. The confidential variant exists
86
- * because the confidential pool is BY DEFINITION personal-domain content
87
- * (health, finances, the people in the owner's inner circle), so the standard
88
- * line ("Never include personal data (names, health, finances, credentials)")
89
- * suppressed every confidential lesson by construction — #602's measured
90
- * finding: 0 confidential lessons from a real cohort. Owner ruling
91
- * 2026-11-12: the confidential pool SHOULD generate lessons for the inner
92
- * circle; only the PROMPT suppressed them. The confidential line keeps one
93
- * absolute: credentials/passwords/API keys/secrets are never included.
94
- * Everything else in the prompt (generality bar, examples, output schema) is
95
- * shared verbatim by both pools — pinned by tests/reflection-prompt.test.ts.
86
+ * because the confidential pool is personal-domain content by definition,
87
+ * so the standard line ("Never include personal data (names, health,
88
+ * finances, credentials)") suppressed confidential lessons by construction
89
+ * — only the PROMPT suppressed them; the confidential pool SHOULD generate
90
+ * lessons. The confidential line keeps one absolute: credentials/passwords/
91
+ * API keys/secrets are never included. Everything else in the prompt
92
+ * (generality bar, examples, output schema) is shared verbatim by both
93
+ * pools — pinned by tests/reflection-prompt.test.ts.
96
94
  */
97
95
  function reflection(memoriesBlock, recentLessons, pool) {
98
96
  const recentSection = recentLessons
@@ -562,11 +562,18 @@ async function runQualityGradeStageInner(db, gradedWeek, opts) {
562
562
  const fromDay = windowStartDay(now, calibration_js_1.MEMORY_PRECISION_WINDOW_DAYS);
563
563
  const nowIso = now.toISOString();
564
564
  // --- Population: every shown (push, memory) pair in the retention window,
565
- // with the push's prompt excerpt + the memory row for the line render. ---
565
+ // with the push's prompt excerpt + the memory row for the line render.
566
+ // STANDARD-ONLY by construction (#618): the LEFT JOIN + privacy filter keep
567
+ // confidential rows out of BOTH arms of the lane (revealed-useful marking
568
+ // AND auto-grading) — a confidential line or excerpt must never egress.
569
+ // LEFT JOIN so a standard-class row whose memory row is gone still flows
570
+ // (renderLine already returns null for deleted memories — unchanged). ---
566
571
  const shownRows = db
567
572
  .prepare(`SELECT e.push_id AS push_id, e.memory_id AS memory_id, p.prompt_excerpt AS prompt_excerpt
568
573
  FROM recall_events e JOIN recall_pushes p ON p.id = e.push_id
569
- WHERE e.day >= ? AND e.kind = 'shown'`)
574
+ LEFT JOIN memories m ON m.id = e.memory_id
575
+ WHERE e.day >= ? AND e.kind = 'shown'
576
+ AND (m.privacy IS NULL OR m.privacy != 'confidential')`)
570
577
  .all(fromDay);
571
578
  const fetchedInWindow = new Set(db
572
579
  .prepare("SELECT DISTINCT memory_id FROM recall_events WHERE day >= ? AND kind = 'fetch'")
@@ -578,12 +585,17 @@ async function runQualityGradeStageInner(db, gradedWeek, opts) {
578
585
  .prepare("SELECT push_id, memory_id FROM recall_verdicts WHERE grader = 'revealed'")
579
586
  .all().map((r) => `${r.push_id ?? ""}|${r.memory_id}`));
580
587
  const requestProject = resolveRequestProjects(db, fromDay, null);
581
- const memStmt = db.prepare(`SELECT id, content, created_at, domain, project, source_agent, memory_type
588
+ const memStmt = db.prepare(`SELECT id, content, created_at, domain, project, source_agent, memory_type, privacy
582
589
  FROM memories WHERE id = ?`);
583
590
  const renderLine = (memoryId) => {
584
591
  const row = memStmt.get(memoryId);
585
592
  if (!row)
586
593
  return null; // memory gone (deleted) — not gradable, skipped
594
+ // #618 belt: the population filter above is the gate; this render-path
595
+ // refusal means confidential content can NEVER reach the egress even if
596
+ // the population query changes shape later.
597
+ if (row.privacy === "confidential")
598
+ return null;
587
599
  return (0, recall_index_js_1.formatIndexLine)({
588
600
  id: row.id,
589
601
  content: row.content,
@@ -95,8 +95,8 @@ export declare function recordRecallFetch(db: Database.Database, memoryId: strin
95
95
  * is deleted — retained rows == window rows.
96
96
  *
97
97
  * #578 retention split — recall_verdicts rides the SAME horizon with ONE
98
- * carve-out: grader='owner' rows are NEVER dropped (they are the owner's
99
- * calibration reference, tiny volume by construction — about
98
+ * carve-out: grader='owner' rows are NEVER dropped (they are the
99
+ * manual-verdict calibration reference, tiny volume by construction — about
100
100
  * five thumbs a week). Machine rows ('auto', 'revealed') prune with the events
101
101
  * they were derived from — a revealed verdict outliving its own event rows
102
102
  * would claim a window the store no longer holds.
@@ -161,8 +161,8 @@ function recordRecallFetch(db, memoryId, ts) {
161
161
  * is deleted — retained rows == window rows.
162
162
  *
163
163
  * #578 retention split — recall_verdicts rides the SAME horizon with ONE
164
- * carve-out: grader='owner' rows are NEVER dropped (they are the owner's
165
- * calibration reference, tiny volume by construction — about
164
+ * carve-out: grader='owner' rows are NEVER dropped (they are the
165
+ * manual-verdict calibration reference, tiny volume by construction — about
166
166
  * five thumbs a week). Machine rows ('auto', 'revealed') prune with the events
167
167
  * they were derived from — a revealed verdict outliving its own event rows
168
168
  * would claim a window the store no longer holds.
package/dist/redact.js CHANGED
@@ -63,7 +63,7 @@ const DEFAULT_PATTERNS = [
63
63
  /**
64
64
  * The CONFIDENTIAL preset (#332 redaction pilot, the #558 gap): everything in
65
65
  * DEFAULT_PATTERNS plus emails and phone numbers. Confidential-pool content
66
- * is the material an inner-circle agent captures (finance, medical, personal
66
+ * is the material a confidential-circle agent captures (finance, medical, personal
67
67
  * correspondence), so its intake redacts contact identifiers BEFORE queueing
68
68
  * — standard deliveries keep today's set unchanged (the general email/phone
69
69
  * fix for standard rows is deliberately out of scope, #332 non-goals).
@@ -30,6 +30,16 @@ export interface TranscriptBatch {
30
30
  * conversations, no cwd in its store; never invented).
31
31
  */
32
32
  workspacePath?: string | null;
33
+ /**
34
+ * Per-DELTA-entry workspace (#619), aligned with `entries` (length ===
35
+ * entries.length) — entry i's OWN workspace, null when that entry carries
36
+ * none. CC fills it (CC writes `cwd` on every entry) so the packer can
37
+ * split the delta at every mid-session workspace change; readers with a
38
+ * session-level workspace (Pi/OC/opencode: the header `cwd` /
39
+ * `session.directory`) or none (Hermes) OMIT it and keep `workspacePath`
40
+ * as the whole batch's birthplace — the capture loop falls back to it.
41
+ */
42
+ entryWorkspaces?: Array<string | null>;
33
43
  /**
34
44
  * Per-session cursor key (`<prefix>:<sessionId>`) — the capture-cursors.json
35
45
  * key whose value gates and advances this session's incremental capture (#189).
@@ -148,6 +148,9 @@ function parseTranscriptFile(filePath, projectName, cursorKey, startCursor, gene
148
148
  // entries (CC writes the session's cwd on every entry; the delta slice keeps
149
149
  // the value authoritative for what THIS capture covers). projectName stays
150
150
  // the lossy directory-name decode — it keeps serving only the label.
151
+ // #619: this stays the BATCH-LEVEL fallback; `entryWorkspaces` below carries
152
+ // each entry's own cwd so a mid-session cd re-birthplaces only the entries
153
+ // after it (the packer splits on changes, never rewrites this label).
151
154
  let workspacePath = null;
152
155
  for (const entry of delta) {
153
156
  const cwd = entry?.cwd;
@@ -156,6 +159,10 @@ function parseTranscriptFile(filePath, projectName, cursorKey, startCursor, gene
156
159
  break;
157
160
  }
158
161
  }
162
+ const entryWorkspaces = delta.map((entry) => {
163
+ const cwd = entry?.cwd;
164
+ return typeof cwd === "string" && cwd ? cwd : null;
165
+ });
159
166
  return {
160
167
  sessionId: (0, node_path_1.basename)(filePath, ".jsonl"),
161
168
  projectName,
@@ -164,6 +171,7 @@ function parseTranscriptFile(filePath, projectName, cursorKey, startCursor, gene
164
171
  : new Date().toISOString().slice(0, 10),
165
172
  entries: delta,
166
173
  workspacePath,
174
+ entryWorkspaces,
167
175
  cursorKey,
168
176
  startCursor: start,
169
177
  generation: gen,
package/dist/types.d.ts CHANGED
@@ -10,7 +10,7 @@
10
10
  * server: derived at intake from `source_agent` × the `confidentialAgents`
11
11
  * config roster, a `confidentialPaths` workspace match (#609), or marker
12
12
  * content validated against the server's `confidentialMarkerKey` (#614) — or
13
- * stamped by the `backfill-privacy` owner command; the client only RELAYS
13
+ * stamped by the `hicortex backfill-privacy` command; the client only RELAYS
14
14
  * raw inputs, it never declares the class. The class is a hard gate on every
15
15
  * agent-facing read path (absent/unknown requester = non-member =
16
16
  * confidential rows omitted, single fetch 404) and routes every LLM touch of
@@ -852,8 +852,8 @@ export interface HicortexConfig {
852
852
  * #332 — the confidential-circle roster: agent ids (the same sanitized id
853
853
  * namespace as `identityAgents` / `?agent=`) whose captures are stamped
854
854
  * `confidential` at intake (matched by `source_agent` with the first
855
- * `<harness>/` segment stripped, so a Hermes profile `nano` capturing as
856
- * `hermes/nano` matches the roster entry `nano`) and whose read requests
855
+ * `<harness>/` segment stripped, so a Hermes profile `atlas` capturing as
856
+ * `hermes/atlas` matches the roster entry `atlas`) and whose read requests
857
857
  * (the optional `agent` param on every agent-facing read path) see both
858
858
  * pools. Absent/empty (the default) = no circle: every capture is
859
859
  * standard, nothing is ever omitted, zero behavior change. Deploy-time
@@ -862,7 +862,7 @@ export interface HicortexConfig {
862
862
  */
863
863
  confidentialAgents?: string[];
864
864
  /**
865
- * #614 — the confidential marker key: the owner-set secret the workspace
865
+ * #614 — the confidential marker key: the operator-set secret the workspace
866
866
  * marker `.hicortex-confidential` must carry (as its single-line content)
867
867
  * for a client-marked folder to stamp `confidential` at intake. The client
868
868
  * RELAYS the marker's content (`client_marker` on /distill); the server
@@ -308,7 +308,7 @@ function sanitizeAgentId(raw: string): string | null {
308
308
  /**
309
309
  * #600: the workspace-scoped agent id sent on every read call — the sanitized
310
310
  * basename of the working directory (the same basename `project` is derived
311
- * from; the folder name IS the agent name, owner ruling 2026-11-17). null
311
+ * from; the folder name IS the agent name). null
312
312
  * when the basename sanitizes to nothing → the caller omits `agent` entirely
313
313
  * (fail-closed: the request reads as a non-member, never an id the server
314
314
  * would 400 on and a fail-soft path would silently swallow).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gamaze/hicortex",
3
- "version": "0.27.2",
3
+ "version": "0.27.3",
4
4
  "description": "Persistent agent identity for AI agents \u2014 a hand-edited identity layer, nightly-distilled experience, and lessons injected every session, shared across your whole fleet. Works with Hermes, OpenClaw, Claude Code, Pi, and opencode.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -280,7 +280,7 @@ function sanitizeAgentId(raw: string): string | null {
280
280
  /**
281
281
  * #600: the workspace-scoped agent id sent on every read call — the sanitized
282
282
  * basename of the session cwd (the same basename `project` is derived from;
283
- * the folder name IS the agent name, owner ruling 2026-11-17). null when the
283
+ * the folder name IS the agent name). null when the
284
284
  * basename sanitizes to nothing → the caller omits `agent` entirely
285
285
  * (fail-closed: the request reads as a non-member, never an id the server
286
286
  * would 400 on and a fail-soft path would silently swallow). Exported for
package/server.json CHANGED
@@ -3,12 +3,12 @@
3
3
  "name": "io.github.gamaze-labs/hicortex",
4
4
  "title": "Hicortex \u2014 AI Fleet Memory",
5
5
  "description": "Shared fleet memory for AI agents: nightly self-correction, recall every prompt (supported agents).",
6
- "version": "0.27.2",
6
+ "version": "0.27.3",
7
7
  "packages": [
8
8
  {
9
9
  "registryType": "npm",
10
10
  "identifier": "@gamaze/hicortex",
11
- "version": "0.27.2",
11
+ "version": "0.27.3",
12
12
  "transport": {
13
13
  "type": "stdio",
14
14
  "command": "npx",