@gamaze/hicortex 0.24.1 → 0.26.0

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.
package/README.md CHANGED
@@ -273,12 +273,14 @@ Config at `~/.hicortex/config.json`. Created by `init`. Key options:
273
273
  | _env_ `HICORTEX_DISTILL_BODY_LIMIT_MB` | Environment override for the `/distill` body limit — **wins over the `distillBodyLimitMb` config key in every mode** (that is the point: a deployment operator pins it so tenant-writable config cannot raise it). Unset = config/default applies. |
274
274
  | _env_ `HICORTEX_MEMORY_CAP` | Environment override for the memory soft cap — a **positive** value wins over the `memorySoftCap` config key in every mode; `0`/negative/malformed fall through to the config key, then the 10000 default (an env can pin a cap, never disable one — config `memorySoftCap: 0` still disables when the env is unset). Mode-agnostic operator knob: nightly eviction, the dashboard-snapshot capacity stamp, and the live dashboard gauge all resolve through the same resolver, so the enforced and displayed caps can never disagree. Drives `nightly --evict-only` the same way. |
275
275
  | `domains` | Your memory domain list (`[{name, description}]`). Scaffolded by `init`; edit freely — see [Memory Domains & Tags](#memory-domains--tags) |
276
+ | `projectAliases` | Explicit project-label synonyms (`{ "raw": "canonical" }`), applied on top of the automatic case fold (every project string is trimmed + lowercased at every entry point — ingest, distill, search, recall). Single-hop: point every synonym directly at its canonical label. Keys and targets are folded at read (case/whitespace insensitive); an alias cycle rejects the whole map with a warning (mechanical fold still applies); a blank target drops just that entry. **Never scaffolded by `init`** — the map is yours to curate; `hicortex reconcile-projects` (dry run by default, `--apply` after review) renames existing rows to match. Boot-time (restart to apply) |
276
277
  | `lessonsLimit` | Max lessons injected into an agent's session-start context (default: 10). Lessons are ranked per session by project/domain affinity + recency + strength + access, so each session sees its most-relevant slice. Lower = leaner system prompts. |
277
278
  | `identityClients` | Which harnesses inject the [identity layer](#identity-layer) at session start (default `["cc"]`; `"all"` or any subset of `cc`/`hermes`/`oc`/`pi`/`opencode`) |
278
279
  | `identityAgents` | Per-agent identity modes (0.13): `{ "<id>": "override" \| "global" \| "off" }`. Absent + no `agents/<id>/` dir → every agent gets the global set. Boot-time (restart to apply) — see [Per-agent identity](#per-agent-identity-013) |
279
280
  | `agentName` | This install's per-agent identity id sent as `?agent=`. **Unset by default** (CC shares the global identity — no `?agent=` sent). Explicit opt-in via `init --agent-name <name>`; `init --agent-name ""` clears it. An empty/whitespace value equals unset |
280
281
  | `captureCooldownHours` | Success-cooldown (hours) for the **capture watchdog** (0.17). The capture timer polls every ~20 min; the watchdog captures only if more than this has elapsed since the last *successful* capture (`state.lastNightly`). Default `6` (≈4 captures/day). A failed preflight retries on the next poll (~20 min) — so a transient fire-instant network miss costs minutes, not a day (#239) |
281
282
  | `firstRunLookbackDays` | Days of session history the FIRST nightly run discovers (default `7`). A long-term AI user's entire session store is deliberately not distilled on night one — the first watermark is `now − this many days`, not the beginning of time. Already-running installs are unaffected (they have a real watermark). To import more history, run `hicortex nightly --recapture-window <days>` once — widening-only, per-session cursors keep the re-scan cheap. Invalid value → warn + default (#436) |
283
+ | `recallCrossProjectMinSimilarity` | The cross-project recall fence bar (default `0.72`, fence **ON when the key is absent**). When a recall or search request carries a project, a memory from a *different* project must clear this similarity on a measured cosine to be admitted — pushed recall (`/recall-index`), `GET /search`, and the `hicortex_search` tool all fence identically; same-project and unscoped recall are unchanged. `0` or any value ≤ the recall floor (`0.62`) turns the fence off (today's scope-blind behavior). Clamped to `[0,1]`; a wrong type → warn + default. Boot-time (restart to apply) |
282
284
  | `consolidationHours` | Hours (0–23, local) for the **consolidation** timer — the full nightly (capture + distill + score + reflect + link). Installed for **server/co-located only** (clients have no local DB). Default `[10, 22]`: the 22:00 evening slot runs after the day's capture waves (same-day results); the 10:00 morning slot runs *after* the morning capture so wake-up pushes are caught. Omitted on clients |
283
285
  | `timerJitterSeconds` | Max random delay (seconds) added to **generated** consolidation timers (#256), so a fleet doesn't all fire on the same minute (thundering-herd → LLM-backend contention). systemd: a single `RandomizedDelaySec=<n>`; launchd has no native equivalent so a per-install randomized `Minute` offset is baked into every `StartCalendarInterval` dict (sub-60s values no-op on launchd). Default `3600` (≈±30 min spread on the 2-slot/day cadence); `0` disables. Affects timers on the next `init` (re-init rewrites the unit files; installs that don't re-init keep their existing timers) |
284
286
  | `nightlyTimeBudgetMinutes` | The ONE wall-clock budget (minutes) for a nightly run: capture and every consolidation stage share one cooperative deadline, checked at safe boundaries (capture segments, stage boundaries, item loops, the merge zone). A run whose deadline fires reports consolidation `deferred` and resumes from its cursors next run — no work lost, none redone. Default `240`; `0`/invalid → default (a deadline always exists — there is no "off"). The systemd unit's `TimeoutStartSec` is derived from this (+60 min slack) at `init` |
@@ -286,9 +288,11 @@ Config at `~/.hicortex/config.json`. Created by `init`. Key options:
286
288
  | `memorySoftCap` | Soft cap on the memory corpus (default 10000). When the corpus exceeds this, the nightly's capacity-eviction stage removes the lowest-`effectiveStrength` memories (ties broken by oldest access) until under the cap — the active forgetting mechanism that bounds DB size, vector-index RAM, and consolidation workload. `0` disables eviction (indefinite growth — the pre-#245 behaviour). The evicted tail is cold by construction (effectiveStrength is the same decay-weighted score the recall ranker uses, so these were not surfacing in the top-k anyway). At 10K memories the load + JS sort is <100 ms |
287
289
  | `updateChannel` | Release channel pinned into the generated daemon/timer ExecStart for **npx-thin** installs (global-binary installs use the absolute binary and are unaffected). A dist-tag (`"rc"`, `"next"`) or an exact version (`"0.17.1"`). E.g. `"rc"` → the timer runs `npx -y @gamaze/hicortex@rc nightly`, so the host tracks the rc dist-tag (an internal fleet can ride rc through a pre-promotion soak). Validated as `[\w.\-]+` (rejects anything that'd break the unit/plist templates). Absent → auto-detect (bare on `latest`, else `@next`). (0.17.1) |
288
290
  | `nightlyHour` | **Deprecated (0.17) single-slot fallback.** Local hour (0–23) honoured only when `consolidationHours` is absent — yields one daily consolidation slot at that hour (preserves the pre-0.17 "one daily job" intent). New installs should use `consolidationHours` |
291
+ | `qualityGrading` | Explicit opt-in for the weekly recall-quality grading pass (default **off**). The pass sends a redacted prompt excerpt and the pushed index line to a third-party decisions endpoint for scoring; with the key off (or absent) the stage skips and logs a health line. Also requires the endpoint API key (OPENROUTER_HICORTEX_KEY env) and `qualityGradeModel`. |
292
+ | `qualityGradeModel` | The model id the grading lane requests when `qualityGrading` is on. No default — absent → the stage skips (greppable health line). |
289
293
  | `telemetry` | Anonymous usage telemetry. **On by default and not written into config by `init`** — add `"telemetry": false` yourself (or set `HICORTEX_TELEMETRY=off`) to opt out. Inspect exactly what is sent with `hicortex telemetry` |
290
294
 
291
- **Calibration is release-managed.** The ~35 tuning keys earlier releases exposed (recall breadth, relevance floors, ranking weights, decay speed, dedup/supersession/correction thresholds, the weak-primary floor) are no longer config: they are constants that ship with each release and change only in releases, with the eval evidence linked in the changelog. Config values for them are ignored — the server prints a one-time boot warning naming each ignored key. Your config file now describes your *install* (mode, model, schedules, identity, budgets), not the brain's tuning.
295
+ **Calibration is release-managed.** The ~35 tuning keys earlier releases exposed (recall breadth, relevance floors, ranking weights, decay speed, dedup/supersession/correction thresholds, the weak-primary floor) are no longer config: they are constants that ship with each release and change only in releases, with the eval evidence linked in the changelog. Config values for them are ignored — the server prints a one-time boot warning naming each ignored key. Your config file now describes your *install* (mode, model, schedules, identity, budgets), not the brain's tuning. The one deliberate exception is `recallCrossProjectMinSimilarity` — on the `firstRunLookbackDays` precedent, it is a per-install posture dial rather than corpus calibration, so it stayed a live config key.
292
296
 
293
297
  **Diagnostic tier (environment).** Three niche, ollama-only operational values moved from config to environment variables: `HICORTEX_NUM_CTX` (context window for ollama, default 8192), `HICORTEX_OLLAMA_FLUSH_EVERY` (flush ollama's accumulated memory every N LLM calls; default 0 = off), and `HICORTEX_OLLAMA_FLUSH_WAIT_MS` (post-flush wait, default 180000). Pin them in a service unit's environment when needed; the old config keys are ignored with a boot warning naming the replacement.
294
298
 
@@ -467,7 +467,23 @@
467
467
  .rec-l1 .l1txt{ color:var(--dim); overflow:hidden; text-overflow:ellipsis; font-size:10.5px; letter-spacing:-.01em; }
468
468
  .rec-l1 b{ color:var(--green-mid); font-weight:600; }
469
469
  .rec-l1.below b{ color:var(--dim); }
470
- #rec-div{ color:var(--amber); overflow:hidden; text-overflow:ellipsis; }
470
+ /* #578 quality drawers (divergence + contested): native details/summary
471
+ in the card's .csub scale — collapsed they are one dim line, open they
472
+ stack their rows inside the card (no page modal for ~5 rows/week).
473
+ Theme tokens only; the thumbs are small ghost buttons. */
474
+ .rec-det{ font-size:10.5px; color:var(--dim); }
475
+ .rec-det summary{ cursor:pointer; color:var(--dim); letter-spacing:-.01em; user-select:none; }
476
+ .rec-det summary:hover{ color:var(--text); }
477
+ .rec-det[open] summary{ color:var(--text); }
478
+ .rec-det-body{ margin:4px 0 2px; display:flex; flex-direction:column; gap:4px; }
479
+ .rec-det-body .rec-line{ font-size:10.5px; color:var(--dim); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
480
+ .rec-contest-empty{ font-style:italic; }
481
+ .rec-thumb{ border:1px solid color-mix(in srgb, var(--text) 22%, transparent); background:none; color:var(--dim); border-radius:5px; font-size:11px; line-height:1; padding:2px 6px; cursor:pointer; }
482
+ .rec-thumb:hover{ color:var(--text); border-color:color-mix(in srgb, var(--text) 45%, transparent); }
483
+ .rec-thumb.ok:hover{ color:var(--green); border-color:var(--green); }
484
+ .rec-thumb.no:hover{ color:var(--red); border-color:var(--red); }
485
+ .rec-item{ display:flex; align-items:center; gap:6px; min-width:0; }
486
+ .rec-item .rec-item-line{ flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:10.5px; color:var(--dim); }
471
487
  .b-health{ display:flex; align-items:center; gap:7px; font-size:11px; color:var(--dim); white-space:nowrap; }
472
488
  .dot{ width:6px; height:6px; border-radius:50%; background:var(--green); box-shadow:0 0 10px color-mix(in srgb, var(--green) 70%, transparent); animation:breathe 3.2s ease-in-out infinite; flex:none; }
473
489
  .dot.blue{ background:var(--blue); box-shadow:0 0 10px color-mix(in srgb, var(--blue) 70%, transparent); }
@@ -1264,32 +1280,49 @@
1264
1280
  <div class="csub" id="tok-sub">&nbsp;</div>
1265
1281
  <div id="tok-nights" aria-label="LLM tokens per nightly run this billing period"></div>
1266
1282
  </div>
1267
- <!-- Memory Precision (#476, owner retitle) — ONE card, two context
1268
- levels. Level 2 (recall depth) keeps the #426 U-band + zone word +
1269
- provisional-hover semantics; the marker/tooltip read the WINDOW
1270
- ratio off D.memory_precision.level2 (a pre-#476 server has no block
1271
- → the headline ratio — today's rendering exactly). Level 1 (pushed
1272
- index) is a compact second row: mean similarity of pushed lines to
1273
- their prompt, with a floor marker at the echoed
1274
- recall_min_similarity and muted below it (the index's bar reads
1275
- conservative — its noise costs compound per prompt) + the
1276
- redundancy share; direction-only coloring, NO verdict words (the
1277
- #426 semantics ruling extended: similarity is
1278
- conversation-dependent). Divergence count on the FACE, the ≤3
1279
- titles hover-only (no memory lists on the main page — owner ruling
1280
- 2026-09-12; the header search panel is the list surface). The
1281
- window rides the #452 selector via the echoed window_days — never
1282
- hardcoded, never a second range control. -->
1283
+ <!-- Memory Precision (#476, owner retitle; #578 quality audit) — ONE
1284
+ card, two context levels + the quality instrument. Level 2 (recall
1285
+ depth) keeps the #426 U-band + zone word + provisional-hover
1286
+ semantics; the marker/tooltip read the WINDOW ratio off
1287
+ D.memory_precision.level2 (a pre-#476 server has no block → the
1288
+ headline ratio — today's rendering exactly). The #578 audit
1289
+ (owner: "do the numbers earn their place"): mean similarity and
1290
+ redundant share are TOOLTIP-ONLY (high cosine was the noise's
1291
+ camouflage — not actionable), divergence lives in a details
1292
+ drawer, and the FACE carries what answers "is recall quality
1293
+ improving": uses-per-showing (the big word), pushes/lines volume,
1294
+ and the Tier-1 rows (block size, cross-project share + attribution
1295
+ coverage, sub-bar share at the echoed fence bar, distinct-memory
1296
+ recycling) with per-change deltas off the server's change-registry
1297
+ entries while the raw window covers them. The contested drawer
1298
+ (#578 judgment layer) lazily fetches /dashboard/quality/contested
1299
+ and PUTs the owner's thumbs — no grading data in the ≤ 2 KB
1300
+ memory_precision block. The window rides the #452 selector via the
1301
+ echoed window_days — never hardcoded, never a second range
1302
+ control. -->
1283
1303
  <div class="bseg" id="lim-rec">
1284
1304
  <div class="gh"><span class="t">Memory Precision</span><span class="sub" id="rec-sub">uses per showing</span></div>
1285
1305
  <div class="big"><b class="n rec-word" id="rec-zone">—</b></div>
1286
1306
  <div class="rec-bandrow" id="rec-bandrow"><div class="rec-band" id="rec-band"></div><i class="rec-dot" id="rec-dot" hidden></i></div>
1287
1307
  <div class="rec-l1" id="rec-l1" hidden style="display:block">
1288
- <div class="l1row" id="l1-rel">&nbsp;</div>
1289
- <div class="l1row" id="l1-rep">&nbsp;</div>
1290
- <div class="l1row" id="l1-off">&nbsp;</div>
1308
+ <div class="l1row" id="l1-blk">&nbsp;</div>
1309
+ <div class="l1row" id="l1-cross">&nbsp;</div>
1310
+ <div class="l1row" id="l1-sub">&nbsp;</div>
1311
+ <div class="l1row" id="l1-recy">&nbsp;</div>
1312
+ <div class="l1row" id="l1-vol">&nbsp;</div>
1291
1313
  </div>
1292
- <div class="csub rec-foot"><span id="rec-div" hidden></span></div>
1314
+ <details id="rec-divdet" class="rec-det" hidden>
1315
+ <summary>divergence &middot; <span id="rec-divn">0</span> never read</summary>
1316
+ <div id="rec-div-lines" class="rec-det-body"></div>
1317
+ </details>
1318
+ <details id="rec-series" class="rec-det" hidden>
1319
+ <summary>corpus &amp; graded &middot; last nightly</summary>
1320
+ <div id="rec-series-body" class="rec-det-body"></div>
1321
+ </details>
1322
+ <details id="rec-contest" class="rec-det">
1323
+ <summary>contested lines &middot; <span id="rec-contest-n">&mdash;</span></summary>
1324
+ <div id="rec-contest-rows" class="rec-det-body rec-contest-empty">open to load</div>
1325
+ </details>
1293
1326
  </div>
1294
1327
  </div>
1295
1328
  <!-- row 2 · ops & maturity — capture health · 30 nights · maturity split · model -->
@@ -3385,6 +3418,7 @@ function renderRecBand(ups){
3385
3418
  if(mp&&mp.level2) ups=mp.level2.uses_per_showing;
3386
3419
  lastRecUses=ups;
3387
3420
  renderRecL1(mp);
3421
+ renderRecSeries();
3388
3422
  const z=F&&F.thresholds?F.thresholds.recall_uses:null;
3389
3423
  const axis=z&&typeof z.axis_max==='number'&&z.axis_max>0?z.axis_max:null;
3390
3424
  const row=el('rec-bandrow'), band=el('rec-band'), dot=el('rec-dot'), word=el('rec-zone');
@@ -3431,22 +3465,24 @@ function renderRecBand(ups){
3431
3465
  before the counter was ever seeded). */
3432
3466
  }
3433
3467
 
3434
- /* ---------- Memory Precision — Level 1, the pushed index (#476). A compact
3435
- second row beside Level 2's U-band: mean similarity of pushed lines to
3436
- their prompt (a 0..1 bar with a floor tick at the /dashboard/field echo of
3437
- recall_min_similarity — the server's own recall floor, never a page
3438
- literal), muted below the floor (the index row reads conservative: its
3439
- noise lands on every prompt), plus the redundancy share (lines restating
3440
- the session's standing context at/above the echoed cosine). Direction-only
3441
- coloring, NO verdict words — the #426 semantics ruling extended.
3442
- Divergence: the COUNT on the card face, the ≤3 titles hover-only (no
3443
- memory lists on the main page, owner 2026-09-12 — the search panel is the
3444
- list surface). Absent block (pre-#476 server) → the whole row hides and
3445
- the sub keeps the old label — today's rendering exactly. */
3468
+ /* ---------- Memory Precision — Level 1, the pushed index (#476) + the #578
3469
+ quality audit (owner: "do the numbers earn their place"). The FACE carries
3470
+ the Tier-1 quality rows — block size (lines per push), cross-project share
3471
+ with its attribution coverage, sub-bar share at the ECHOED fence bar,
3472
+ distinct-memory recycling — each tagged with the per-change deltas off the
3473
+ server's change-registry entries (mp.changes; numbers computed at render
3474
+ server-side, the page never freezes one), plus the pushes/lines volume
3475
+ (the denominators). Mean similarity + redundant share are TOOLTIP-ONLY
3476
+ (they were the noise's camouflage); divergence lives in the #rec-divdet
3477
+ drawer below. NO verdict words anywhere — numbers, the #426 ruling. Absent
3478
+ tier1 (a pre-#578 server) → the quality rows hide and the card keeps the
3479
+ #476 shape; absent block entirely → the whole row hides and the sub keeps
3480
+ the old label (the capture card's block-absence guard). */
3446
3481
  function renderRecL1(mp){
3447
- const row=el('rec-l1'), sub=el('rec-sub'), dv=el('rec-div');
3482
+ const row=el('rec-l1'), sub=el('rec-sub');
3448
3483
  if(!mp||!mp.level1||!mp.level2){
3449
- row.hidden=true; dv.hidden=true; dv.title='';
3484
+ row.hidden=true;
3485
+ const dd0=el('rec-divdet'); if(dd0) dd0.hidden=true;
3450
3486
  if(sub) sub.textContent='uses per showing';
3451
3487
  return;
3452
3488
  }
@@ -3454,39 +3490,166 @@ function renderRecL1(mp){
3454
3490
  const l1=mp.level1;
3455
3491
  const floor=(F&&F.thresholds&&typeof F.thresholds.recall_min_similarity==='number')?F.thresholds.recall_min_similarity:null;
3456
3492
  const ra=(l1.thresholds&&typeof l1.thresholds.redundant_above==='number')?l1.thresholds.redundant_above:null;
3457
- const mins=(l1.thresholds&&typeof l1.thresholds.divergence_min_shown==='number')?l1.thresholds.divergence_min_shown:5;
3458
3493
  const sim=(typeof l1.mean_similarity==='number'&&isFinite(l1.mean_similarity))?l1.mean_similarity:null;
3459
3494
  const red=(typeof l1.redundant_share==='number'&&isFinite(l1.redundant_share))?l1.redundant_share:null;
3460
- if(sim===null){
3461
- row.hidden=true; /* nothing measured in the window — the row degrades away */
3462
- }else{
3463
- row.hidden=false;
3464
- row.classList.toggle('below',floor!==null&&sim<floor);
3465
- /* numbers only on the face — direction carries the meaning, no verdict words */
3466
- /* #476 owner rename (2026-09-20): the three buckets as named — Relevant /
3467
- Repeated known / Off-target. Relevant = the mean relevance; Repeated =
3468
- the redundant share; Off-target = the remainder (pushed lines that were
3469
- neither relevant nor new). Numbers, no verdict words (#426). */
3470
- const relPct=Math.round(clamp(sim,0,1)*100);
3471
- const repPct=red!==null?Math.round(clamp(red,0,1)*100):0;
3472
- const offPct=Math.max(0,100-relPct-repPct);
3473
- const dv=mp.divergence, nUsed=(dv&&typeof dv.count==='number')?dv.count:0;
3474
- el('l1-rel').innerHTML='<b>Relevant: '+relPct+'%</b>';
3475
- el('l1-rep').textContent='Repeated known: '+repPct+'%';
3476
- el('l1-off').textContent='Off-target: '+offPct+'%'+(nUsed>0?' ('+nUsed+' never used)':'');
3477
- row.title='pushed index, last '+(mp.window_days||90)+' days — mean similarity of pushed lines to their prompt (tick at the recall floor '+
3478
- (floor!==null?floor.toFixed(2):'—')+'; muted below it)'+
3479
- (ra!==null?'; redundant = share of lines at ≥'+ra.toFixed(2)+' cosine vs the session\'s standing context (lessons + identity)':'')+
3480
- ' · '+fmt(l1.pushes)+' pushes, '+fmt(l1.lines)+' lines';
3481
- }
3482
- /* divergence — the face count is amber; the ≤3 lines ride the native
3483
- tooltip ONLY (text via .title, never face content) */
3484
- /* #476 owner bundling (2026-09-20): the never-used count rides inside
3485
- Off-target; the separate face element stays hidden (titles on hover) */
3486
- const dEl=el('rec-div');
3487
- if(dEl){ dEl.hidden=true; }
3495
+ /* the tooltip carries the demoted #476 numbers — mean similarity (with the
3496
+ recall-floor context) + the redundant share (#578 audit: face rows these
3497
+ are not; high cosine was the noise's camouflage) */
3498
+ row.title='pushed index, last '+(mp.window_days||90)+' days — mean similarity '+
3499
+ (sim!==null?sim.toFixed(2):'—')+
3500
+ (floor!==null?' (recall floor '+floor.toFixed(2)+')':'')+
3501
+ (red!==null&&ra!==null?'; repeated-known '+Math.round(clamp(red,0,1)*100)+'% (≥'+ra.toFixed(2)+' cosine vs the session\'s standing context — lessons + identity)':'');
3502
+ renderRecDivDet(mp);
3503
+ const t=mp.tier1;
3504
+ if(!t){
3505
+ /* pre-#578 server: no quality rows exist — the face rows hide (their
3506
+ markup is #578's), the tooltip above still carries the #476 numbers,
3507
+ and the divergence drawer still renders from mp.divergence. */
3508
+ row.hidden=true;
3509
+ return;
3510
+ }
3511
+ row.hidden=false;
3512
+ row.classList.remove('below');
3513
+ /* per-change delta tags: one dim tag per registry entry the window covers
3514
+ and the server computed both sides for. pct when the before is nonzero,
3515
+ the raw arrow otherwise (a 0→x move has no honest percentage). */
3516
+ const tag=(k)=>{
3517
+ if(!Array.isArray(mp.changes)) return '';
3518
+ const parts=[];
3519
+ for(const ch of mp.changes){
3520
+ const b=ch.before&&typeof ch.before[k]==='number'?ch.before[k]:null;
3521
+ const a=ch.after&&typeof ch.after[k]==='number'?ch.after[k]:null;
3522
+ if(b===null||a===null) continue;
3523
+ let d;
3524
+ if(b!==0){ d=Math.round((a-b)/b*100); d=(d>0?'+':'')+d+'%'; }
3525
+ else { d=(a===0?'±0%':b+'→'+a); }
3526
+ parts.push(ch.id+' '+d);
3527
+ }
3528
+ return parts.length?' ('+parts.join(', ')+')':'';
3529
+ };
3530
+ const bs=(typeof t.block_size==='number'&&isFinite(t.block_size))?t.block_size.toFixed(2):'—';
3531
+ const cs=(typeof t.cross_share==='number'&&isFinite(t.cross_share))?Math.round(t.cross_share*100)+'%':'—';
3532
+ const cv=(typeof t.attribution_coverage==='number'&&isFinite(t.attribution_coverage))?Math.round(t.attribution_coverage*100)+'%':'—';
3533
+ const sb=(typeof t.sub_bar_share==='number'&&isFinite(t.sub_bar_share))?Math.round(t.sub_bar_share*100)+'%':'—';
3534
+ const rc=(typeof t.recycling==='number'&&isFinite(t.recycling))?Math.round(t.recycling).toString():'—';
3535
+ el('l1-blk').innerHTML='<b>Block: '+bs+' lines/push</b>'+tag('block_size');
3536
+ el('l1-cross').textContent='Cross-project: '+cs+' (attributed '+cv+')'+tag('cross_share');
3537
+ el('l1-sub').textContent='Sub-bar: '+sb+' below bar '+(typeof t.cross_project_bar==='number'?t.cross_project_bar.toFixed(2):'—')+tag('sub_bar_share');
3538
+ el('l1-recy').textContent='Recycling: '+rc+' memories/day'+tag('recycling');
3539
+ el('l1-vol').textContent=fmt(t.pushes)+' pushes · '+fmt(t.lines)+' lines';
3540
+ }
3541
+
3542
+ /* divergence drawer (#578 audit: off the face, into the details element).
3543
+ The count rides the summary; the ≤3 lines ride the drawer body — no memory
3544
+ lists on the card FACE (the 2026-09-12 ruling stands; a drawer is not a
3545
+ face row). */
3546
+ function renderRecDivDet(mp){
3547
+ const dd=el('rec-divdet'), dn=el('rec-divn'), dl=el('rec-div-lines');
3548
+ if(!dd||!dn||!dl) return;
3549
+ const dv=mp&&mp.divergence, n=(dv&&typeof dv.count==='number')?dv.count:0;
3550
+ if(!dv||!n){ dd.hidden=true; return; }
3551
+ dd.hidden=false;
3552
+ dn.textContent=n;
3553
+ dl.innerHTML='';
3554
+ for(const it of (dv.top||[])){
3555
+ const d=document.createElement('div');
3556
+ d.className='rec-line';
3557
+ d.textContent=it.line+' ('+it.shown+'×)';
3558
+ dl.appendChild(d);
3559
+ }
3560
+ }
3561
+
3562
+ /* ---------- corpus &amp; graded drawer (#578): the snapshot-stamped half.
3563
+ The corpus-health trio (near-dup clusters, scope-anchor rate, canonical
3564
+ label drift) and the graded aggregates are computed by the NIGHTLY
3565
+ snapshot writer only (the dup-cluster KNN alone forbids a per-request
3566
+ path), so they render from the SNAPSHOT SERIES — the newest snapshot row
3567
+ carrying metrics.quality — never from live work. No snapshots with the
3568
+ block yet (first nights after upgrade) → the drawer hides. */
3569
+ function renderRecSeries(){
3570
+ const det=el('rec-series'), body=el('rec-series-body');
3571
+ if(!det||!body) return;
3572
+ let q=null;
3573
+ if(D&&Array.isArray(D.series)){
3574
+ for(let i=D.series.length-1;i>=0;i--){
3575
+ const m=D.series[i]&&D.series[i].metrics;
3576
+ if(m&&m.quality){ q=m.quality; break; }
3577
+ }
3578
+ }
3579
+ if(!q){ det.hidden=true; return; }
3580
+ det.hidden=false;
3581
+ const c=q.corpus||{}, g=q.graded||{};
3582
+ body.innerHTML='';
3583
+ const row=(k,v)=>{
3584
+ const d=document.createElement('div');
3585
+ d.className='rec-line';
3586
+ d.textContent=k+': '+v;
3587
+ body.appendChild(d);
3588
+ };
3589
+ row('near-dup clusters',(typeof c.dup_clusters==='number'?c.dup_clusters:'—')+' at the merge bar');
3590
+ row('scope-anchored',(typeof c.scope_anchor_rate==='number'?Math.round(c.scope_anchor_rate*100)+'%':'—')+' of live memories');
3591
+ row('label drift',(typeof c.canonical_drift==='number'?c.canonical_drift:'—')+' non-canonical');
3592
+ row('graded useful',(typeof g.useful_share==='number'?Math.round(g.useful_share*100)+'%':'—')+' of '+(typeof g.graded==='number'?g.graded:0)+' verdicts');
3488
3593
  }
3489
3594
 
3595
+ /* ---------- contested drawer (#578 judgment layer). Lazy by design: graded
3596
+ data NEVER rides the memory_precision block (≤ 2 KB discipline); the list
3597
+ is fetched on FIRST OPEN of the details element only, then kept in sync
3598
+ after each thumb. Thumbs PUT /dashboard/quality/verdict {id, verdict:
3599
+ 1|-1} (numeric — the server's strict body), and a thumbed item leaves the
3600
+ list (the server clears owner-answered rows). Fail-soft: a fetch error
3601
+ renders the error line, never a dead drawer. */
3602
+ let CONTESTED_LOADED=false;
3603
+ async function loadContested(force){
3604
+ const box=el('rec-contest-rows'), num=el('rec-contest-n');
3605
+ if(!box) return;
3606
+ if(CONTESTED_LOADED&&!force) return;
3607
+ try{
3608
+ const r=await api('/dashboard/quality/contested?limit=20');
3609
+ CONTESTED_LOADED=true;
3610
+ if(num) num.textContent=String(r.total);
3611
+ box.innerHTML='';
3612
+ box.classList.remove('rec-contest-empty');
3613
+ if(!r.items||!r.items.length){
3614
+ box.classList.add('rec-contest-empty');
3615
+ box.textContent='nothing contested — the grader is confident this week';
3616
+ return;
3617
+ }
3618
+ for(const it of r.items){
3619
+ const row=document.createElement('div');
3620
+ row.className='rec-item';
3621
+ const line=document.createElement('span');
3622
+ line.className='rec-item-line';
3623
+ line.textContent=(it.line||('['+it.memory_id+'] memory no longer available'))+
3624
+ (it.prompt_excerpt?' — prompt: '+it.prompt_excerpt:'');
3625
+ line.title='score '+(typeof it.score==='number'?it.score.toFixed(2):'—')+
3626
+ ', confidence '+(typeof it.confidence==='number'?it.confidence.toFixed(2):'—');
3627
+ const up=document.createElement('button');
3628
+ up.className='rec-thumb ok'; up.textContent='👍'; up.title='useful';
3629
+ const down=document.createElement('button');
3630
+ down.className='rec-thumb no'; down.textContent='👎'; down.title='not useful';
3631
+ const send=async(v)=>{
3632
+ try{
3633
+ await api('/dashboard/quality/verdict',{method:'PUT',body:JSON.stringify({id:it.id,verdict:v})});
3634
+ row.remove();
3635
+ if(num) num.textContent=String(Math.max(0,(parseInt(num.textContent,10)||1)-1));
3636
+ }catch(e){ /* fail-soft: the row stays, the next open retries */ }
3637
+ };
3638
+ up.addEventListener('click',()=>send(1));
3639
+ down.addEventListener('click',()=>send(-1));
3640
+ row.appendChild(line); row.appendChild(up); row.appendChild(down);
3641
+ box.appendChild(row);
3642
+ }
3643
+ }catch(e){
3644
+ box.classList.add('rec-contest-empty');
3645
+ box.textContent='contested list unavailable ('+(e&&e.message?e.message:'load failed')+')';
3646
+ }
3647
+ }
3648
+ (function(){
3649
+ const det=el('rec-contest');
3650
+ if(det) det.addEventListener('toggle',()=>{ if(det.open) loadContested(); });
3651
+ })();
3652
+
3490
3653
  let MODEL_LABEL='';
3491
3654
  /* #409 fix round 5 — owner ruling 2026-09-14 (verbatim): "I do NOT want to
3492
3655
  know what it is compatible with, I want to know the fucking model." The
@@ -77,6 +77,27 @@ export declare const SESSION_INTENT_WEIGHT = 0.33;
77
77
  * rewritten corpus): steady ~3:1 noise:signal removal with no knee; sits
78
78
  * below the 0.63 local pessimum. FTS-matched candidates pass regardless. */
79
79
  export declare const RECALL_MIN_SIMILARITY = 0.62;
80
+ /**
81
+ * Cross-project recall fence bar (#566) — a memory from a DIFFERENT project
82
+ * than the request's must clear this on a MEASURED cosine to be admitted
83
+ * into recall/search results; same-project and no-scope candidates keep the
84
+ * RECALL_MIN_SIMILARITY floor above, byte-identical.
85
+ *
86
+ * Measured 2026-10-28 on the #565 WS2 snapshot bar sweep: at 0.72 a
87
+ * scope-conditional bar keeps ~18% of today's cross-project admissions
88
+ * (projected multi-project cross-share ~29%, audit target ≤35%); a GLOBAL
89
+ * 0.72 floor would kill 91% of same-project admissions, which is why the bar
90
+ * is scope-conditional. Owner ruling 2026-10-28: 0.72 now, 0.75 (the stricter
91
+ * option, keeps ~7.5%) one config edit away.
92
+ *
93
+ * Unlike every other constant in the recall family, this one KEEPS a config
94
+ * override (`recallCrossProjectMinSimilarity`, resolved once at server boot)
95
+ * — the ONE deliberate #408 exception, on the DEFAULT_FIRST_RUN_LOOKBACK_DAYS
96
+ * precedent: a posture dial the owner tunes per install, not corpus
97
+ * calibration. 0 or any value ≤ the recall floor (0.62) disarms the fence
98
+ * (today's scope-blind behavior).
99
+ */
100
+ export declare const CROSS_PROJECT_MIN_SIMILARITY = 0.72;
80
101
  /** Max lines in the pushed recall index. 5 (lowered from 6 on 2026-08-03):
81
102
  * per-slot decomposition at floor 0.62 showed slot 6 gives NO prompt its
82
103
  * first relevant memory. The K-sweep is monotone toward 4, but the 4-vs-5
@@ -138,6 +159,65 @@ export declare const MEMORY_PRECISION_DIVERGENCE_MIN_SHOWN = 5;
138
159
  * the same trust boundary as /distill's denoised conversation text).
139
160
  */
140
161
  export declare const MEMORY_PRECISION_PROMPT_EXCERPT_CHARS = 256;
162
+ /**
163
+ * One pinned quality change — the Tier-3 baseline discipline (#578): every
164
+ * change that can move recall quality pins its deploy DATE here (edited at
165
+ * release, exactly like a calibration constant's rationale comment), and the
166
+ * card computes each entry's before/after from the RAW event store at render
167
+ * (before = window up to the date, after = the date onward). No frozen
168
+ * numbers: a pinned number freezes a metric definition that will evolve
169
+ * (the moving-reference problem), a date does not. Baselines age out of raw
170
+ * events after the 90-day retention; the nightly snapshot's quality block
171
+ * carries the trend from there.
172
+ */
173
+ export interface QualityChange {
174
+ /** Short machine id (rendered as the delta tag on the card face). */
175
+ id: string;
176
+ /** ISO date (UTC) the change deployed — the before/after split day. */
177
+ date: string;
178
+ /** Human label for the drawer/tooltip. */
179
+ label: string;
180
+ /** Source issue (provenance, the house convention). */
181
+ issue: number;
182
+ }
183
+ /**
184
+ * The seeded change registry (#578): TWO
185
+ * entries for 2026-10-28 — #566 (the cross-project recall fence, bar
186
+ * CROSS_PROJECT_MIN_SIMILARITY) and #567 (project-label reconciliation,
187
+ * shipped in the same 0.25.0 release) — independent changes, independent
188
+ * before/afters, back-pinned now while the 90-day raw window still covers
189
+ * them. Future quality changes append their entry at release time (#569's
190
+ * decay fix is the next: its date lands when it deploys).
191
+ */
192
+ export declare const QUALITY_CHANGES: readonly QualityChange[];
193
+ /**
194
+ * Weekly quality-grading call cap (#578: its own weekly lane, separate from
195
+ * nightlyLlmCallBudget) — different provider, different endpoint,
196
+ * independent starvation risk; folding it into the one #405 ceiling would
197
+ * let the consolidation LLM starve grading (or vice versa) with no signal.
198
+ * The per-call cost is negligible, so the cap bounds spend trivially.
199
+ * At cap the remaining sampled items DEFER to the next week (the week
200
+ * cursor does not advance past ungraded items — dup-over-loss).
201
+ * Release-managed: no config key, moving it is a release decision.
202
+ */
203
+ export declare const QUALITY_GRADE_WEEKLY_CALL_CAP = 60;
204
+ /**
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
208
+ * (raw score + confidence are stored threshold-free; a recalibration never
209
+ * rewrites history).
210
+ */
211
+ export declare const QUALITY_CONTESTED_CONFIDENCE = 0.7;
212
+ /**
213
+ * Render edge for "useful" on a graded score (#578): a grading `score`
214
+ * question answers 0..1; ≥ this reads useful in the graded-useful share.
215
+ * 0.5 — the scale's own midpoint, deliberately NOT the utility threshold
216
+ * calibrated for recall INJECTION trimming (0.75 — a different decision).
217
+ * Derived at render, never stored. PROVISIONAL alongside
218
+ * QUALITY_CONTESTED_CONFIDENCE.
219
+ */
220
+ export declare const QUALITY_USEFUL_SCORE = 0.5;
141
221
  /**
142
222
  * Kill-switch for the deterministic volatility gate (#489, owner decision 5):
143
223
  * false disables isVolatileStatusEntry's use in the distill path (entries
@@ -24,8 +24,8 @@
24
24
  * the removal is never silent.
25
25
  */
26
26
  Object.defineProperty(exports, "__esModule", { value: true });
27
- exports.STAGE_BELIEF_STRENGTH = exports.STAGE_FADING_STRENGTH = exports.STAGE_FADING_DAYS = exports.WEAK_PRIMARY_FLOOR = exports.CORRECTION_REWRITE_MIN_CONFIDENCE = exports.CORRECTION_MIN_SIMILARITY = exports.DEDUP_AUTO_MERGE_THRESHOLD = exports.IMPORTANCE_SETTLE_WINDOW_DAYS = exports.IMPORTANCE_CEILING = exports.BM25_WEIGHT_DOMAIN = exports.BM25_WEIGHT_PROJECT = exports.BM25_WEIGHT_BODY = exports.BOTH_CHANNEL_BOOST = exports.RRF_VECTOR_WEIGHT = exports.RRF_FTS_WEIGHT = exports.RRF_COMPOSITE_WEIGHT = exports.RRF_K = exports.SCOPE_AFFINITY_WEIGHT = exports.SUPERSEDED_DEMOTION = exports.RECENCY_HEAD_DAYS = exports.RECENCY_HEAD_WEIGHT = exports.RECENCY_HOURLY_DECAY = exports.SCORE_RECENCY_WEIGHT = exports.CONNECTIONS_SATURATION_DEGREE = exports.SCORE_CONNECTIONS_WEIGHT = exports.SCORE_STRENGTH_WEIGHT = exports.SCORE_SIMILARITY_WEIGHT = exports.VOLATILE_GATE_MAX_CHARS = exports.VOLATILE_STATUS_FILTER = exports.MEMORY_PRECISION_PROMPT_EXCERPT_CHARS = exports.MEMORY_PRECISION_DIVERGENCE_MIN_SHOWN = exports.MEMORY_PRECISION_REDUNDANT_ABOVE = exports.MEMORY_PRECISION_WINDOW_DAYS = exports.RECALL_USES_AXIS_MAX = exports.RECALL_USES_NORMAL_MAX = exports.RECALL_USES_LOW_MAX = exports.RECALL_RESHOW_TURNS = exports.NOVELTY_FLOOR_SLOTS = exports.RECALL_TITLE_CHARS = exports.RECALL_MIN_PROMPT_CHARS = exports.RECALL_MAX_ITEMS = exports.RECALL_MIN_SIMILARITY = exports.SESSION_INTENT_WEIGHT = exports.COLD_EXPOSURE_SLOTS = exports.RECENT_WINDOW_DAYS = exports.RECENT_LIMIT = exports.SEARCH_LIMIT = exports.PROMOTION_STRENGTH_FLOOR = exports.PROMOTION_RATE = exports.DECAY_HALF_LIFE_DAYS = void 0;
28
- exports.DRAIN_QUEUE_WARN_AGE_HOURS = exports.DRAIN_YIELD_PROBE_TIMEOUT_MS = exports.DRAIN_YIELD_WAIT_CAP_MS = exports.DRAIN_YIELD_POLL_MS = exports.DIAGNOSTIC_ENV_TIER = exports.OLLAMA_FLUSH_WAIT_MS = exports.OLLAMA_FLUSH_EVERY = exports.NUM_CTX = exports.DEFAULT_FIRST_RUN_LOOKBACK_DAYS = exports.ENRICH_STRENGTH_DELTA = exports.STAGE_TRUTH_STRENGTH = void 0;
27
+ exports.CORRECTION_MIN_SIMILARITY = exports.DEDUP_AUTO_MERGE_THRESHOLD = exports.IMPORTANCE_SETTLE_WINDOW_DAYS = exports.IMPORTANCE_CEILING = exports.BM25_WEIGHT_DOMAIN = exports.BM25_WEIGHT_PROJECT = exports.BM25_WEIGHT_BODY = exports.BOTH_CHANNEL_BOOST = exports.RRF_VECTOR_WEIGHT = exports.RRF_FTS_WEIGHT = exports.RRF_COMPOSITE_WEIGHT = exports.RRF_K = exports.SCOPE_AFFINITY_WEIGHT = exports.SUPERSEDED_DEMOTION = exports.RECENCY_HEAD_DAYS = exports.RECENCY_HEAD_WEIGHT = exports.RECENCY_HOURLY_DECAY = exports.SCORE_RECENCY_WEIGHT = exports.CONNECTIONS_SATURATION_DEGREE = exports.SCORE_CONNECTIONS_WEIGHT = exports.SCORE_STRENGTH_WEIGHT = exports.SCORE_SIMILARITY_WEIGHT = exports.VOLATILE_GATE_MAX_CHARS = exports.VOLATILE_STATUS_FILTER = exports.QUALITY_USEFUL_SCORE = exports.QUALITY_CONTESTED_CONFIDENCE = exports.QUALITY_GRADE_WEEKLY_CALL_CAP = exports.QUALITY_CHANGES = exports.MEMORY_PRECISION_PROMPT_EXCERPT_CHARS = exports.MEMORY_PRECISION_DIVERGENCE_MIN_SHOWN = exports.MEMORY_PRECISION_REDUNDANT_ABOVE = exports.MEMORY_PRECISION_WINDOW_DAYS = exports.RECALL_USES_AXIS_MAX = exports.RECALL_USES_NORMAL_MAX = exports.RECALL_USES_LOW_MAX = exports.RECALL_RESHOW_TURNS = exports.NOVELTY_FLOOR_SLOTS = exports.RECALL_TITLE_CHARS = exports.RECALL_MIN_PROMPT_CHARS = exports.RECALL_MAX_ITEMS = exports.CROSS_PROJECT_MIN_SIMILARITY = exports.RECALL_MIN_SIMILARITY = exports.SESSION_INTENT_WEIGHT = exports.COLD_EXPOSURE_SLOTS = exports.RECENT_WINDOW_DAYS = exports.RECENT_LIMIT = exports.SEARCH_LIMIT = exports.PROMOTION_STRENGTH_FLOOR = exports.PROMOTION_RATE = exports.DECAY_HALF_LIFE_DAYS = void 0;
28
+ exports.DRAIN_QUEUE_WARN_AGE_HOURS = exports.DRAIN_YIELD_PROBE_TIMEOUT_MS = exports.DRAIN_YIELD_WAIT_CAP_MS = exports.DRAIN_YIELD_POLL_MS = exports.DIAGNOSTIC_ENV_TIER = exports.OLLAMA_FLUSH_WAIT_MS = exports.OLLAMA_FLUSH_EVERY = exports.NUM_CTX = exports.DEFAULT_FIRST_RUN_LOOKBACK_DAYS = exports.ENRICH_STRENGTH_DELTA = exports.STAGE_TRUTH_STRENGTH = exports.STAGE_BELIEF_STRENGTH = exports.STAGE_FADING_STRENGTH = exports.STAGE_FADING_DAYS = exports.WEAK_PRIMARY_FLOOR = exports.CORRECTION_REWRITE_MIN_CONFIDENCE = void 0;
29
29
  exports.resolveNumCtx = resolveNumCtx;
30
30
  exports.resolveOllamaFlushEvery = resolveOllamaFlushEvery;
31
31
  exports.resolveOllamaFlushWaitMs = resolveOllamaFlushWaitMs;
@@ -89,6 +89,27 @@ exports.SESSION_INTENT_WEIGHT = 0.33;
89
89
  * rewritten corpus): steady ~3:1 noise:signal removal with no knee; sits
90
90
  * below the 0.63 local pessimum. FTS-matched candidates pass regardless. */
91
91
  exports.RECALL_MIN_SIMILARITY = 0.62;
92
+ /**
93
+ * Cross-project recall fence bar (#566) — a memory from a DIFFERENT project
94
+ * than the request's must clear this on a MEASURED cosine to be admitted
95
+ * into recall/search results; same-project and no-scope candidates keep the
96
+ * RECALL_MIN_SIMILARITY floor above, byte-identical.
97
+ *
98
+ * Measured 2026-10-28 on the #565 WS2 snapshot bar sweep: at 0.72 a
99
+ * scope-conditional bar keeps ~18% of today's cross-project admissions
100
+ * (projected multi-project cross-share ~29%, audit target ≤35%); a GLOBAL
101
+ * 0.72 floor would kill 91% of same-project admissions, which is why the bar
102
+ * is scope-conditional. Owner ruling 2026-10-28: 0.72 now, 0.75 (the stricter
103
+ * option, keeps ~7.5%) one config edit away.
104
+ *
105
+ * Unlike every other constant in the recall family, this one KEEPS a config
106
+ * override (`recallCrossProjectMinSimilarity`, resolved once at server boot)
107
+ * — the ONE deliberate #408 exception, on the DEFAULT_FIRST_RUN_LOOKBACK_DAYS
108
+ * precedent: a posture dial the owner tunes per install, not corpus
109
+ * calibration. 0 or any value ≤ the recall floor (0.62) disarms the fence
110
+ * (today's scope-blind behavior).
111
+ */
112
+ exports.CROSS_PROJECT_MIN_SIMILARITY = 0.72;
92
113
  /** Max lines in the pushed recall index. 5 (lowered from 6 on 2026-08-03):
93
114
  * per-slot decomposition at floor 0.62 showed slot 6 gives NO prompt its
94
115
  * first relevant memory. The K-sweep is monotone toward 4, but the 4-vs-5
@@ -165,6 +186,57 @@ exports.MEMORY_PRECISION_DIVERGENCE_MIN_SHOWN = 5;
165
186
  * the same trust boundary as /distill's denoised conversation text).
166
187
  */
167
188
  exports.MEMORY_PRECISION_PROMPT_EXCERPT_CHARS = 256;
189
+ /**
190
+ * The seeded change registry (#578): TWO
191
+ * entries for 2026-10-28 — #566 (the cross-project recall fence, bar
192
+ * CROSS_PROJECT_MIN_SIMILARITY) and #567 (project-label reconciliation,
193
+ * shipped in the same 0.25.0 release) — independent changes, independent
194
+ * before/afters, back-pinned now while the 90-day raw window still covers
195
+ * them. Future quality changes append their entry at release time (#569's
196
+ * decay fix is the next: its date lands when it deploys).
197
+ */
198
+ exports.QUALITY_CHANGES = Object.freeze([
199
+ Object.freeze({
200
+ id: "fence",
201
+ date: "2026-10-28",
202
+ label: "cross-project recall fence (0.72 bar)",
203
+ issue: 566,
204
+ }),
205
+ Object.freeze({
206
+ id: "labels",
207
+ date: "2026-10-28",
208
+ label: "project-label reconciliation (canonicalize at gate + ingest)",
209
+ issue: 567,
210
+ }),
211
+ ]);
212
+ /**
213
+ * Weekly quality-grading call cap (#578: its own weekly lane, separate from
214
+ * nightlyLlmCallBudget) — different provider, different endpoint,
215
+ * independent starvation risk; folding it into the one #405 ceiling would
216
+ * let the consolidation LLM starve grading (or vice versa) with no signal.
217
+ * The per-call cost is negligible, so the cap bounds spend trivially.
218
+ * At cap the remaining sampled items DEFER to the next week (the week
219
+ * cursor does not advance past ungraded items — dup-over-loss).
220
+ * Release-managed: no config key, moving it is a release decision.
221
+ */
222
+ exports.QUALITY_GRADE_WEEKLY_CALL_CAP = 60;
223
+ /**
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
227
+ * (raw score + confidence are stored threshold-free; a recalibration never
228
+ * rewrites history).
229
+ */
230
+ exports.QUALITY_CONTESTED_CONFIDENCE = 0.70;
231
+ /**
232
+ * Render edge for "useful" on a graded score (#578): a grading `score`
233
+ * question answers 0..1; ≥ this reads useful in the graded-useful share.
234
+ * 0.5 — the scale's own midpoint, deliberately NOT the utility threshold
235
+ * calibrated for recall INJECTION trimming (0.75 — a different decision).
236
+ * Derived at render, never stored. PROVISIONAL alongside
237
+ * QUALITY_CONTESTED_CONFIDENCE.
238
+ */
239
+ exports.QUALITY_USEFUL_SCORE = 0.5;
168
240
  // ---------------------------------------------------------------------------
169
241
  // Volatility gate (#489) — deterministic drop of GH-ticket-status /
170
242
  // version-bump / commit-state entries at the distill gate, and the one-shot
package/dist/cli.d.ts CHANGED
@@ -16,6 +16,10 @@
16
16
  * dedup --apply Execute the merge (default: dry run);
17
17
  * losers are absorbed (kept as evidence,
18
18
  * hidden from recall), not deleted
19
+ * reconcile-projects One-shot project-label reconciliation (issue #567)
20
+ * reconcile-projects --apply Execute the renames (default: dry
21
+ * run); canonicalizes existing rows via
22
+ * the case fold + the projectAliases map
19
23
  * sweep-volatile One-shot sweep of volatile GH-status/version rows (#489)
20
24
  * sweep-volatile --apply Demote matches via absorb (default:
21
25
  * dry run; backup first, audit trail)