counterparts 0.3.40 → 0.3.41
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/CHANGELOG.md +29 -0
- package/package.json +1 -1
- package/src/adapters/dashboard/registries.ts +3 -0
- package/src/adapters/dashboard/web/flow.ts +2 -0
- package/src/adapters/dashboard/web/lanes.ts +1 -0
- package/src/adapters/dashboard/web/narrate.ts +19 -0
- package/src/adapters/fired.ts +1 -1
- package/src/adapters/mcp/NOTES.md +59 -0
- package/src/adapters/mcp/server-words.ts +1 -1
- package/src/adapters/mcp/server.ts +15 -7
- package/src/adapters/mcp/tools.ts +23 -5
- package/src/adapters/remote/NOTES.md +2 -1
- package/src/adapters/update-check.ts +1 -1
- package/src/core/counterpart-events.ts +5 -1
- package/src/core/counterpart.ts +65 -7
- package/src/core/onboarding.ts +35 -7
- package/src/core/recall/CONTRACT.md +23 -2
- package/src/core/recall/NOTES.md +101 -0
- package/src/core/recall/activate.ts +188 -31
- package/src/core/recall/gate.ts +8 -2
- package/src/core/recall/index.ts +52 -11
- package/src/core/recall/prime.ts +7 -1
- package/src/core/recall/rated.ts +1 -1
- package/src/core/recall/render.ts +15 -2
- package/src/core/recall/session.ts +8 -4
- package/src/core/recall/tunables.ts +34 -4
- package/src/core/schemas/NOTES.md +8 -0
- package/src/core/schemas/tunables.ts +6 -1
- package/src/core/self/work.ts +20 -0
package/src/core/recall/NOTES.md
CHANGED
|
@@ -1502,3 +1502,104 @@ counts flat (the near miss as `nearMissCount`), `turn`, and `startedBy` (`person
|
|
|
1502
1502
|
`below-bar` verdicts they name. And the count runs guarded: a throw in it leaves the row without
|
|
1503
1503
|
the five keys (as off) and rings `recall.stopcounts.failed`, rather than reaching the adapter's
|
|
1504
1504
|
guard and costing the turn its recall.
|
|
1505
|
+
|
|
1506
|
+
## PP1 — see-also from named ids (2026-10-29, an experiment; switch `recall.SEE_ALSO_NAMED_IDS`)
|
|
1507
|
+
|
|
1508
|
+
The ping/pong miss of 10-25 (the 10-29 read, item 8): the rule (`mem_0ca7f032368a`) lost a bare
|
|
1509
|
+
"ping" to its bar (6.59 against 8.05), "ping" is in 90 live memories now, and cue learning had
|
|
1510
|
+
wired `ping → mem_66bb7d836201` (the note ABOUT the miss, 0.727) and nothing to the rule: cue
|
|
1511
|
+
learning trains a turn's words only to what the turn showed, so every "pong" answered from the
|
|
1512
|
+
note trained the note. The planned "(b) see-also" was through links; there is no link from the
|
|
1513
|
+
note to the rule, but the note NAMES its id. So `activate.ts#seeAlso` reads ids named in text.
|
|
1514
|
+
|
|
1515
|
+
- **What it is.** After the gate, the texts (title and body) of what the turn shows — the loud
|
|
1516
|
+
line and the cued footnotes, in the gate's order; never a quiet pointer and never a see-also
|
|
1517
|
+
(no chains) — are read for `mem_…` ids, at most `SEE_ALSO_NAMES_READ` (4) a memory. The first
|
|
1518
|
+
that may ride along is brought as one footnote line, `See also: <title> [id]`, title clipped at
|
|
1519
|
+
`SEE_ALSO_TITLE_BYTES` (100). One per shown memory, `SEE_ALSO_MAX` (2) a turn, after the cued
|
|
1520
|
+
footnotes and the pointers, so `TRIM_ORDER`'s pop drops them first among footnotes (the
|
|
1521
|
+
beliefs slot, first in `TRIM_ORDER`, goes before them).
|
|
1522
|
+
- **What may ride along.** The named id resolved to the memory that holds now (`headOf`: a
|
|
1523
|
+
corrected one brings its head, never itself), then held to the candidates' own test
|
|
1524
|
+
(`activate.ts#recallableRow`, factored out of the `recallable` closure for this: not removed,
|
|
1525
|
+
archived, superseded, below reach, the self page, a handoff, a card or a belief), then to what
|
|
1526
|
+
the turn would not show again: already shown this turn or this session, written by this
|
|
1527
|
+
session (`echo`), another project's under `RECALL_BY_PROJECT`, habituated (rated 0 in two
|
|
1528
|
+
sessions this week: it rests, as its raised bar would have it), or a candidate the gate
|
|
1529
|
+
inhibited (a near-duplicate of something shown, an earlier version). Confidential is not a
|
|
1530
|
+
test: the column is inert since 10-21 (CONTRACT item 9).
|
|
1531
|
+
- **Its verdict, and why that is the whole credit path.** A brought-along candidate's own verdict
|
|
1532
|
+
(below its bar, say) is REPLACED by `footnoted`, `trains` true, `via: "see-also"`, `seeAlso.by`
|
|
1533
|
+
the memory that named it, its numbers kept (so `activation < bar` still says it would not have
|
|
1534
|
+
shown on its own); a memory no channel reached gets one with 0s and the turn's background bar.
|
|
1535
|
+
The record step then writes an ordinary footnote's gate record (`trains` from the verdict —
|
|
1536
|
+
without the replacement `trainsOf` would read the old one, or default) with `via` in the row's
|
|
1537
|
+
`value` column (`SEE_ALSO_VALUE`, no schema change), and the turn's cue record is written
|
|
1538
|
+
because the turn showed something. So `resolveUse` and `cueTraining` need nothing new: an open,
|
|
1539
|
+
a quote or a rating 1–3 trains this turn's words to it at its tier, exactly as for a footnote;
|
|
1540
|
+
a 0 on the NOTE depresses `ping → note` through `cueDepress`, as before (confirmed in the
|
|
1541
|
+
test, not built). Ratings file it under `footnotes` (`rateableSet`: `via` other than `link`);
|
|
1542
|
+
the durable row tells it apart (`footnotes[].via` / `seeAlso.by`, as primed footnotes are
|
|
1543
|
+
told apart), which is what the CHECK-AFTER read joins on.
|
|
1544
|
+
- **Measured on the demo fixture** (`see-also-named-ids.test.ts`: 120 topic notes, 300
|
|
1545
|
+
unrelated, 12 "ping" memories, the rule, the note naming it, `ping → note` seeded at 0.727).
|
|
1546
|
+
Fresh "ping": the note LOUD at 26.2 (bar 4.3), the rule below its own bar at 3.4 (bar 18.3),
|
|
1547
|
+
brought along. Rated 3 (and the note 0): `ping → rule` 0.5, `ping → note` 0.227. The next fresh
|
|
1548
|
+
"ping": the rule a footnote on its own pair at 19.5 (bar 8.2), no see-also; the note below its
|
|
1549
|
+
bar (10.0 against 14.1). One use turned the miss around on this fixture; the live store is
|
|
1550
|
+
bigger and the bar there is different, which is the CHECK-AFTER row's question.
|
|
1551
|
+
- **Bytes.** A see-also line is `- See also: ` (12) + title (≤ 100) + ` [mem_…]` (19 for a
|
|
1552
|
+
minted 12-hex id, ≤ 23) + a newline: ≤ 132 bytes for the ids the store mints. Two a turn, and
|
|
1553
|
+
the footnote header with its blank line (76) when nothing else was a footnote (the loud note
|
|
1554
|
+
alone): ≤ 342 bytes, plus a sentinel digit. A standing label (`Unsettled — …`, `(disagrees
|
|
1555
|
+
with …)`) costs what it costs on any footnote. Always inside the turn's budget: the render
|
|
1556
|
+
trims them first among footnotes, after any belief line. The "Since you started" line takes what recall leaves of the budget, so a
|
|
1557
|
+
see-also line can delay it a prompt, as any footnote can. The wake is untouched.
|
|
1558
|
+
- **Judgment calls, lightly held.** The loud line names ids too (the brief said "a footnote
|
|
1559
|
+
surfaces"; the task said "surfaces ambiently"): a loud note naming its rule is the live case
|
|
1560
|
+
(the note was loud for "ping" on the fixture). A habituated memory does not ride along. Two a
|
|
1561
|
+
turn, not one: a turn whose loud line and a footnote both name one keeps both.
|
|
1562
|
+
- **Not handled.** A reminder said outright this turn (`withhold`, temporal arrivals only) could
|
|
1563
|
+
ride along if a shown memory names it — rare, and the Turn does not carry the set.
|
|
1564
|
+
- **Where it lives.** In `activate.ts` (`seeAlso`, beside `recallableRow`), not a module of its
|
|
1565
|
+
own: first built as `see-also.ts`, it took the directory plugin flavor to 511 files, past
|
|
1566
|
+
`plugin-bundle.test.ts`'s 510 margin under the directory's 512 limit.
|
|
1567
|
+
- **Never another project's work (review of #681, coordinator's call 10-29).** At default settings
|
|
1568
|
+
(`RECALL_BY_PROJECT` off, `CROSS_PROJECT_BAR_LIFT` 1.25) the first build let a shown memory that named
|
|
1569
|
+
another project's work memory bring it along, past the higher bar the lift exists to hold. `seeAlso` now
|
|
1570
|
+
gets `elsewhere` whenever either is on, so a named id carries within the project and personal memories
|
|
1571
|
+
(owner/us) cross as ever. Tested: under the lift alone the crossing memory is kept back and counted in
|
|
1572
|
+
`crossProjectLifted`; it fails without the change.
|
|
1573
|
+
|
|
1574
|
+
## 2026-10-29 — the beliefs slot shows one belief (a finding, no change; K1 from the 10-29 read)
|
|
1575
|
+
|
|
1576
|
+
The 10-29 read: the slot (`BELIEFS_IN_RECALL`) fired on 62 turns, every time with the same
|
|
1577
|
+
belief, `sch_305a1aabc8fa` ("Mike would rather ship once something is tested…", about Mike, 5
|
|
1578
|
+
supports), while 6 beliefs were held. Read on the 10-29 snapshot copy (lived day 38) through
|
|
1579
|
+
`Schemas#beliefStanding` and `Schemas#beliefsNamedIn`, the code paths the slot uses:
|
|
1580
|
+
|
|
1581
|
+
| belief | subject | about | strength | supports | why it never shows |
|
|
1582
|
+
|---|---|---|---|---|---|
|
|
1583
|
+
| `sch_305a1aabc8fa` | Mike (person card) | — | 0.521 | 5 | shows: Mike named, above the floor |
|
|
1584
|
+
| `sch_4faa5260842d` | Mike (person card) | — | 0.203 | 1 | offered whenever "Mike" is named, but under the strict 0.3 floor (`BELIEFS_SLOT_FLOOR`; born at the 0.3 ceiling, fading since, one support) |
|
|
1585
|
+
| `sch_0ce801b0a9ea` | the self subject | me | 0.378 | 5 | never offered: the self subject is left out |
|
|
1586
|
+
| `sch_215f0850cb74` | the self subject | us | 0.348 | 2 | never offered: the self subject is left out |
|
|
1587
|
+
| `sch_d30a699eaa63` | the self subject | us | 0.229 | 2 | never offered (and under the floor) |
|
|
1588
|
+
| `sch_e4b2b893ff80` | the self subject | me | 0.157 | 2 | never offered (and under the floor) |
|
|
1589
|
+
|
|
1590
|
+
- **Why four never pass, whatever a turn says.** A belief about me or us attaches to the self
|
|
1591
|
+
subject (`store#ensureSelfSubject`), an entity card with no name, so the alias index links no
|
|
1592
|
+
word to it, and `beliefsNamedIn` also deletes it from a turn's subjects by name
|
|
1593
|
+
("the self is the wake's page"). Two of the four are above the floor, so the floor is not what
|
|
1594
|
+
holds them; their subject is. The "us" belief `sch_215f0850cb74` says "Mike" in its text, but
|
|
1595
|
+
the slot reads a belief's subject, never its words.
|
|
1596
|
+
- **Why the fifth never passes.** `sch_4faa5260842d` is on the Mike card, so every turn naming
|
|
1597
|
+
Mike offers it beside `sch_305a1aabc8fa`; its strength (0.228 on the 10-28 copy, 0.203 on
|
|
1598
|
+
10-29) is under the floor, which is strict (`>`). A second support would lift it; nothing
|
|
1599
|
+
else will.
|
|
1600
|
+
- **So:** not a bug against the slot's contract (lane E: beliefs on the cards a turn names,
|
|
1601
|
+
above the floor; the self is not one of them). The slot can only ever show a belief about a
|
|
1602
|
+
named card, and the reflection births mostly beliefs about me or us (4 of 6), so on this
|
|
1603
|
+
store it is measuring one belief. A dated read learns little more unless a belief about
|
|
1604
|
+
another card is born and backed, so the slot's read now waits until 3+ beliefs about other
|
|
1605
|
+
people pass the floor (`docs/CHECK-AFTER.md`). Decided 10-29: page-only stays (the self lives on the page, per the wave-2 design); the owner has it as an FYI; if any later earn an ambient door, the "us" beliefs are the likelier ones.
|
|
@@ -65,6 +65,8 @@ import { NO_MOOD, hasMood, moodLift } from "./mood.js";
|
|
|
65
65
|
import type { Mood } from "./mood.js";
|
|
66
66
|
import { cosine } from "./prime.js";
|
|
67
67
|
import type { PrimeActivation, PrimeSourceKind } from "./prime.js";
|
|
68
|
+
import type { CandidateVerdict, Verdict } from "./gate.js";
|
|
69
|
+
import { headOf } from "./standing.js";
|
|
68
70
|
|
|
69
71
|
export interface Candidate {
|
|
70
72
|
readonly id: string;
|
|
@@ -508,6 +510,51 @@ export function gatedSal(p: MemoryPhysics, selfFelt: boolean): number {
|
|
|
508
510
|
return selfFelt ? salArm(p) : curveSal(p);
|
|
509
511
|
}
|
|
510
512
|
|
|
513
|
+
/**
|
|
514
|
+
* The row, when this id is live memory that may be recalled at all: not
|
|
515
|
+
* denied (removed), not archived, not superseded, not the self page, a
|
|
516
|
+
* handoff, an entity card or a belief, and (ambient) not BELOW REACH —
|
|
517
|
+
* `"below-reach"` says that one, so the turn can count it. One test for a
|
|
518
|
+
* candidate, a link-only pointer and a memory a shown one names
|
|
519
|
+
* (see-also, 2026-10-29). Reads only.
|
|
520
|
+
*/
|
|
521
|
+
export function recallableRow(
|
|
522
|
+
store: Store,
|
|
523
|
+
id: string,
|
|
524
|
+
opts: { readonly denied: ReadonlySet<string>; readonly ambient: boolean; readonly day: number },
|
|
525
|
+
): ReturnType<Store["row"]> | "below-reach" {
|
|
526
|
+
if (opts.denied.has(id)) return undefined;
|
|
527
|
+
const row = store.row(id);
|
|
528
|
+
// Archive is a state, not a deletion: it keeps its id and simply never
|
|
529
|
+
// surfaces (§4.2 G3). A superseded head forwards; the successor is reached
|
|
530
|
+
// on its own merits, never by dragging the old id along.
|
|
531
|
+
if (row === undefined || row.archived === 1 || row.superseded_by !== null) return undefined;
|
|
532
|
+
// The self page, which is delivered at wake and never here (`isSelfPage`).
|
|
533
|
+
// The prose read is gated on the row's own columns, so only a SCHEMA row of
|
|
534
|
+
// the self kind pays for it — the page, the identity core, and the handful
|
|
535
|
+
// of beliefs held about the self.
|
|
536
|
+
if (row.type === "schema" && row.kind === "self" && isPageRow(store, id)) return undefined;
|
|
537
|
+
// The per-directory handoff (E1), for the page's reason and one of its own:
|
|
538
|
+
// it is already delivered as a pointer at the wake of the directory it
|
|
539
|
+
// belongs to, and it has no project scope of its own that a search could
|
|
540
|
+
// honour — so left in the pool it would surface one directory's working
|
|
541
|
+
// context inside another's turn. Gated on the row's own columns, as above,
|
|
542
|
+
// so only a SCHEMA row of the place kind pays for the prose read.
|
|
543
|
+
if (row.type === "schema" && row.kind === "place" && isHandoffRow(store, id)) return undefined;
|
|
544
|
+
// An entity CARD (2026-10-11, Group 3 part D): the index a name reaches
|
|
545
|
+
// its memories through, a stub that asserts nothing itself. Once cards were
|
|
546
|
+
// born from the names the memories say, a turn naming someone surfaced
|
|
547
|
+
// the stub as a footnote. Off the row's meta column; no prose read.
|
|
548
|
+
if (row.type === "schema" && isEntityCardRow(row)) return undefined;
|
|
549
|
+
// A belief (wave 2 lane C): never a candidate; lane E's slot shows it (`isBeliefRow`).
|
|
550
|
+
if (isBeliefRow(row)) return undefined;
|
|
551
|
+
// BELOW REACH, exactly (2026-10-10): the ranking cache's prefilter is a
|
|
552
|
+
// pass stale at most; this is the day's own number. Ambient only; never a
|
|
553
|
+
// chapter, a chapter's copy or an entity card (`reachExempt`).
|
|
554
|
+
if (opts.ambient && !reachExempt(row) && belowReach(rowToPhysics(row), opts.day)) return "below-reach";
|
|
555
|
+
return row;
|
|
556
|
+
}
|
|
557
|
+
|
|
511
558
|
export function activate(
|
|
512
559
|
store: Store,
|
|
513
560
|
input: ActivationInput,
|
|
@@ -844,41 +891,15 @@ export function activate(
|
|
|
844
891
|
readonly prime?: CandidatePrime;
|
|
845
892
|
}
|
|
846
893
|
/** The row, when this id is live memory that may be recalled at all; the
|
|
847
|
-
* same test for a candidate
|
|
894
|
+
* same test for a candidate, a link-only pointer and a named one
|
|
895
|
+
* (`recallableRow`, see-also 2026-10-29). */
|
|
848
896
|
const recallable = (id: string): ReturnType<Store["row"]> => {
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
// Archive is a state, not a deletion: it keeps its id and simply never
|
|
852
|
-
// surfaces (§4.2 G3). A superseded head forwards; the successor is reached
|
|
853
|
-
// on its own merits, never by dragging the old id along.
|
|
854
|
-
if (row === undefined || row.archived === 1 || row.superseded_by !== null) return undefined;
|
|
855
|
-
// The self page, which is delivered at wake and never here (`isSelfPage`).
|
|
856
|
-
// The prose read is gated on the row's own columns, so only a SCHEMA row of
|
|
857
|
-
// the self kind pays for it — the page, the identity core, and the handful
|
|
858
|
-
// of beliefs held about the self.
|
|
859
|
-
if (row.type === "schema" && row.kind === "self" && isPageRow(store, id)) return undefined;
|
|
860
|
-
// The per-directory handoff (E1), for the page's reason and one of its own:
|
|
861
|
-
// it is already delivered as a pointer at the wake of the directory it
|
|
862
|
-
// belongs to, and it has no project scope of its own that a search could
|
|
863
|
-
// honour — so left in the pool it would surface one directory's working
|
|
864
|
-
// context inside another's turn. Gated on the row's own columns, as above,
|
|
865
|
-
// so only a SCHEMA row of the place kind pays for the prose read.
|
|
866
|
-
if (row.type === "schema" && row.kind === "place" && isHandoffRow(store, id)) return undefined;
|
|
867
|
-
// An entity CARD (2026-10-11, Group 3 part D): the index a name reaches
|
|
868
|
-
// its memories through, a stub that asserts nothing itself. Once cards were
|
|
869
|
-
// born from the names the memories say, a turn naming someone surfaced
|
|
870
|
-
// the stub as a footnote. Off the row's meta column; no prose read.
|
|
871
|
-
if (row.type === "schema" && isEntityCardRow(row)) return undefined;
|
|
872
|
-
// A belief (wave 2 lane C): never a candidate; lane E's slot shows it (`isBeliefRow`).
|
|
873
|
-
if (isBeliefRow(row)) return undefined;
|
|
874
|
-
// BELOW REACH, exactly (2026-10-10): the ranking cache's prefilter is a
|
|
875
|
-
// pass stale at most; this is the day's own number. Ambient only; never a
|
|
876
|
-
// chapter, a chapter's copy or an entity card (`reachExempt`).
|
|
877
|
-
if (ambient && !reachExempt(row) && belowReach(rowToPhysics(row), input.day)) {
|
|
897
|
+
const r = recallableRow(store, id, { denied, ambient, day: input.day });
|
|
898
|
+
if (r === "below-reach") {
|
|
878
899
|
belowReachCount += 1;
|
|
879
900
|
return undefined;
|
|
880
901
|
}
|
|
881
|
-
return
|
|
902
|
+
return r;
|
|
882
903
|
};
|
|
883
904
|
|
|
884
905
|
// ── a question about feeling: stamps nominate (2026-09-30, U13) ─────────
|
|
@@ -1599,3 +1620,139 @@ export function salienceRank(activation: number, sal: number, t: RecallTunables)
|
|
|
1599
1620
|
export function recordedIdentity(store: Store): string | null {
|
|
1600
1621
|
return store.rankingIdentity();
|
|
1601
1622
|
}
|
|
1623
|
+
|
|
1624
|
+
// ── see-also from named ids (PP1, 2026-10-29) ──────────────────────────────
|
|
1625
|
+
// Here rather than a module of its own: the directory plugin flavor is one file
|
|
1626
|
+
// under its 512 limit.
|
|
1627
|
+
|
|
1628
|
+
/**
|
|
1629
|
+
* SEE-ALSO FROM NAMED IDS (2026-10-29, PP1; an experiment, switch
|
|
1630
|
+
* `SEE_ALSO_NAMED_IDS`).
|
|
1631
|
+
*
|
|
1632
|
+
* A memory whose text names another memory's id (`mem_…`) brings that memory
|
|
1633
|
+
* along when the turn shows it: one footnote line, labelled `See also:`, after
|
|
1634
|
+
* everything the gate admitted. The 10-25 ping/pong miss is the case: the
|
|
1635
|
+
* note about the miss names the rule, cue learning wires a turn's words only
|
|
1636
|
+
* to what the turn showed, so every "pong" answered from the note trained
|
|
1637
|
+
* `ping → note` and the rule never came back on its own. Brought along and
|
|
1638
|
+
* used, the rule gets the turn's cue credit like any footnote (the gate
|
|
1639
|
+
* record is an ordinary footnote's, `trains` true), so the next bare "ping"
|
|
1640
|
+
* reaches it by its own learned pair.
|
|
1641
|
+
*
|
|
1642
|
+
* Read from the texts of what the turn SHOWS — the loud line and the cued
|
|
1643
|
+
* footnotes, never a quiet pointer or another see-also (no chains) — in the
|
|
1644
|
+
* order the gate ranked them. Each named id is resolved to the memory that
|
|
1645
|
+
* holds now (`headOf`), then held to what the turn could have shown at all
|
|
1646
|
+
* (`recallableRow`: not removed, archived, superseded, the self page, a
|
|
1647
|
+
* handoff, a card or a belief; not below reach) and to what it would not
|
|
1648
|
+
* show again (already shown this turn or this session, written by this
|
|
1649
|
+
* session, another project's under `RECALL_BY_PROJECT`, habituated, or a
|
|
1650
|
+
* candidate the gate inhibited). One per shown memory, `SEE_ALSO_MAX` a
|
|
1651
|
+
* turn. Reads only; the caller records.
|
|
1652
|
+
*/
|
|
1653
|
+
/** A memory id anywhere in a text, as the store mints them. */
|
|
1654
|
+
const NAMED_ID = /\bmem_[0-9a-f]{12,16}\b/g;
|
|
1655
|
+
|
|
1656
|
+
/** How many named ids one shown memory's text is read for: bounded reads on a
|
|
1657
|
+
* text that names many. The first that may ride along is the one. */
|
|
1658
|
+
export const SEE_ALSO_NAMES_READ = 4;
|
|
1659
|
+
|
|
1660
|
+
/** Verdicts that mean the turn would not show the memory whatever named it. */
|
|
1661
|
+
const HELD: ReadonlySet<Verdict> = new Set<Verdict>(["inhibited", "echo-skipped", "project-skipped", "dedup-suppressed"]);
|
|
1662
|
+
|
|
1663
|
+
/** The ids a text names, first mention first, each once. */
|
|
1664
|
+
export function namedIds(text: string): string[] {
|
|
1665
|
+
const out: string[] = [];
|
|
1666
|
+
for (const m of text.matchAll(NAMED_ID)) if (!out.includes(m[0])) out.push(m[0]);
|
|
1667
|
+
return out;
|
|
1668
|
+
}
|
|
1669
|
+
|
|
1670
|
+
export interface SeeAlsoInput {
|
|
1671
|
+
readonly store: Store;
|
|
1672
|
+
readonly day: number;
|
|
1673
|
+
/** What the turn shows, ids in render order (loud, then footnotes). */
|
|
1674
|
+
readonly shown: readonly string[];
|
|
1675
|
+
/** Of `shown`, the ones whose text is read: loud and cued footnotes. */
|
|
1676
|
+
readonly namers: readonly string[];
|
|
1677
|
+
/** Every candidate of the turn, by id (its doc, its verdict). */
|
|
1678
|
+
readonly candidates: ReadonlyMap<string, Candidate>;
|
|
1679
|
+
readonly verdicts: readonly CandidateVerdict[];
|
|
1680
|
+
/** This session's earlier showings. */
|
|
1681
|
+
readonly seen: Readonly<Record<string, unknown>>;
|
|
1682
|
+
readonly echo?: ReadonlySet<string>;
|
|
1683
|
+
/** Another project's work, when `RECALL_BY_PROJECT` holds it back. */
|
|
1684
|
+
readonly elsewhere?: (id: string) => boolean;
|
|
1685
|
+
readonly habituated?: ReadonlyMap<string, number>;
|
|
1686
|
+
readonly background: number;
|
|
1687
|
+
readonly t: RecallTunables;
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1690
|
+
export interface SeeAlso {
|
|
1691
|
+
readonly id: string;
|
|
1692
|
+
/** The shown memory whose text named it. */
|
|
1693
|
+
readonly by: string;
|
|
1694
|
+
readonly doc: ProseDoc;
|
|
1695
|
+
/** Its verdict as shown: footnoted, via `see-also`. */
|
|
1696
|
+
readonly verdict: CandidateVerdict;
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
/** The memories this turn's shown ones bring along. Never throws: a failure brings none. */
|
|
1700
|
+
export function seeAlso(input: SeeAlsoInput): SeeAlso[] {
|
|
1701
|
+
const { store, t } = input;
|
|
1702
|
+
if (!t.SEE_ALSO_NAMED_IDS || !(t.SEE_ALSO_MAX >= 1)) return [];
|
|
1703
|
+
const max = Math.floor(t.SEE_ALSO_MAX);
|
|
1704
|
+
const out: SeeAlso[] = [];
|
|
1705
|
+
try {
|
|
1706
|
+
const taken = new Set<string>(input.shown);
|
|
1707
|
+
const verdictOf = new Map(input.verdicts.map((v) => [v.id, v]));
|
|
1708
|
+
let denied: Set<string> | null = null;
|
|
1709
|
+
for (const by of input.namers) {
|
|
1710
|
+
if (out.length >= max) break;
|
|
1711
|
+
const doc = input.candidates.get(by)?.doc;
|
|
1712
|
+
if (doc === undefined) continue;
|
|
1713
|
+
const names = namedIds(`${doc.title ?? ""}\n${doc.body}`).filter((id) => id !== by).slice(0, SEE_ALSO_NAMES_READ);
|
|
1714
|
+
for (const named of names) {
|
|
1715
|
+
const id = headOf(store, named) ?? named;
|
|
1716
|
+
if (taken.has(id) || id === by) continue;
|
|
1717
|
+
if (input.seen[id] !== undefined || input.echo?.has(id) === true || input.habituated?.has(id) === true) continue;
|
|
1718
|
+
if (input.elsewhere?.(id) === true) continue;
|
|
1719
|
+
const prior = verdictOf.get(id);
|
|
1720
|
+
if (prior !== undefined && HELD.has(prior.verdict)) continue;
|
|
1721
|
+
denied ??= new Set(store.deniedIds());
|
|
1722
|
+
const row = recallableRow(store, id, { denied, ambient: true, day: input.day });
|
|
1723
|
+
if (row === undefined || row === "below-reach") continue;
|
|
1724
|
+
const cand = input.candidates.get(id);
|
|
1725
|
+
const physics = cand?.physics ?? rowToPhysics(row);
|
|
1726
|
+
const verdict: CandidateVerdict =
|
|
1727
|
+
prior !== undefined
|
|
1728
|
+
? { ...prior, verdict: "footnoted", trains: true, via: "see-also", seeAlso: { by } }
|
|
1729
|
+
: {
|
|
1730
|
+
id,
|
|
1731
|
+
kind: row.kind as Kind,
|
|
1732
|
+
verdict: "footnoted",
|
|
1733
|
+
activation: 0,
|
|
1734
|
+
cue: 0,
|
|
1735
|
+
temporal: 0,
|
|
1736
|
+
semantic: 0,
|
|
1737
|
+
arrival: 0,
|
|
1738
|
+
hops: 0,
|
|
1739
|
+
cueFraction: 0,
|
|
1740
|
+
sal: gatedSal(physics, false),
|
|
1741
|
+
strength: strength(physics, input.day),
|
|
1742
|
+
// An id is an address, not an ambiguous handle: a use of what
|
|
1743
|
+
// it brought is a use like any other, and it trains.
|
|
1744
|
+
trains: true,
|
|
1745
|
+
bar: input.background,
|
|
1746
|
+
via: "see-also",
|
|
1747
|
+
seeAlso: { by },
|
|
1748
|
+
};
|
|
1749
|
+
out.push({ id, by, doc: cand?.doc ?? store.readProse(id), verdict });
|
|
1750
|
+
taken.add(id);
|
|
1751
|
+
break;
|
|
1752
|
+
}
|
|
1753
|
+
}
|
|
1754
|
+
return out;
|
|
1755
|
+
} catch {
|
|
1756
|
+
return [];
|
|
1757
|
+
}
|
|
1758
|
+
}
|
package/src/core/recall/gate.ts
CHANGED
|
@@ -105,8 +105,14 @@ export interface CandidateVerdict {
|
|
|
105
105
|
/** `"link"` for a QUIET POINTER — a memory only links reached (2026-09-28,
|
|
106
106
|
* `activate.ts#Candidate.linkOnly`). Its verdict is one of the ordinary ones;
|
|
107
107
|
* this says which lane it came by. Absent for everything the conversation
|
|
108
|
-
* reached.
|
|
109
|
-
|
|
108
|
+
* reached. `"see-also"` (2026-10-29, `activate.ts#seeAlso`): brought along because
|
|
109
|
+
* a memory the turn shows NAMES its id; `seeAlso.by` is that memory. */
|
|
110
|
+
readonly via?: "link" | "see-also";
|
|
111
|
+
/** SEE-ALSO (2026-10-29): the shown memory whose text named this one. Set
|
|
112
|
+
* only with `via: "see-also"`; its verdict is then `footnoted`, whatever
|
|
113
|
+
* the gate said of it on its own (the number fields are the gate's, or 0
|
|
114
|
+
* for a memory no channel reached). */
|
|
115
|
+
readonly seeAlso?: { readonly by: string };
|
|
110
116
|
/** HABITUATED (2026-10-19, `habituation.ts`): rated 0 in enough recent
|
|
111
117
|
* sessions that the bar it faced (`bar`) was raised. Absent otherwise. */
|
|
112
118
|
readonly habituated?: true;
|
package/src/core/recall/index.ts
CHANGED
|
@@ -33,7 +33,7 @@ import { TUNABLES as PHYSICS, USE_TIER_WEIGHT, strength } from "../physics/index
|
|
|
33
33
|
import type { CreditOutcome, UseTier } from "../physics/index.js";
|
|
34
34
|
import type { ProseDoc, Store } from "../store/index.js";
|
|
35
35
|
import { isChapterSummary, stemTerm, tokenize } from "../store/index.js";
|
|
36
|
-
import { activate, isBeliefRow, primeOf } from "./activate.js";
|
|
36
|
+
import { activate, isBeliefRow, primeOf, seeAlso } from "./activate.js";
|
|
37
37
|
import type { Candidate, LearnedCuesFn, SpreadFn, SpreadStats } from "./activate.js";
|
|
38
38
|
import type { FeelingAskInput } from "./feeling-ask.js";
|
|
39
39
|
import { buildCues, detectAffect, stripBoilerplate } from "./cues.js";
|
|
@@ -82,6 +82,8 @@ export * from "./habituation.js";
|
|
|
82
82
|
export * from "./prime.js";
|
|
83
83
|
export * from "./render.js";
|
|
84
84
|
export * from "./session.js";
|
|
85
|
+
export { SEE_ALSO_NAMES_READ, namedIds, recallableRow, seeAlso } from "./activate.js";
|
|
86
|
+
export type { SeeAlso, SeeAlsoInput } from "./activate.js";
|
|
85
87
|
export * from "./standing.js";
|
|
86
88
|
export * from "./recency-ask.js";
|
|
87
89
|
export * from "./time-ask.js";
|
|
@@ -750,8 +752,45 @@ export class Recall {
|
|
|
750
752
|
|
|
751
753
|
if (this.now() - started > budgetMs) return quiet("latency-abort");
|
|
752
754
|
|
|
755
|
+
// SEE-ALSO FROM NAMED IDS (PP1, 2026-10-29, an experiment): a shown
|
|
756
|
+
// memory whose text names another's id brings it along, one each,
|
|
757
|
+
// `SEE_ALSO_MAX` a turn, after everything the gate admitted (so the byte
|
|
758
|
+
// budget trims them first among footnotes; a belief line goes before). Its verdict becomes an ordinary footnote's,
|
|
759
|
+
// `trains` true, marked `via: "see-also"` — the record step and the
|
|
760
|
+
// credit pass then treat it as any footnote: a use trains this turn's
|
|
761
|
+
// words to it. Off, or nothing named: the turn is as before.
|
|
762
|
+
const byId = new Map(candidates.map((c) => [c.id, c]));
|
|
763
|
+
const along = seeAlso({
|
|
764
|
+
store: this.store,
|
|
765
|
+
day,
|
|
766
|
+
shown: [...gated.surfaced, ...gated.footnotes].map((c) => c.id),
|
|
767
|
+
namers: [...gated.surfaced, ...gated.footnotes].filter((c) => c.linkOnly !== true).map((c) => c.id),
|
|
768
|
+
candidates: byId,
|
|
769
|
+
verdicts: gated.verdicts,
|
|
770
|
+
seen: state.surfaced,
|
|
771
|
+
...(turn.echo === undefined ? {} : { echo: turn.echo }),
|
|
772
|
+
// Never another project's work, under the hard filter OR the higher bar
|
|
773
|
+
// (review of #681): a named id is no way round Mike's "slightly higher
|
|
774
|
+
// bar" for crossing work; personal memories cross as ever.
|
|
775
|
+
...(turn.elsewhere !== undefined && (this.tunables.RECALL_BY_PROJECT || this.tunables.CROSS_PROJECT_BAR_LIFT > 1)
|
|
776
|
+
? { elsewhere: turn.elsewhere }
|
|
777
|
+
: {}),
|
|
778
|
+
...(habituated.size === 0 ? {} : { habituated }),
|
|
779
|
+
background: gated.background.bar,
|
|
780
|
+
t: this.tunables,
|
|
781
|
+
});
|
|
782
|
+
const alongIds = new Set(along.map((x) => x.id));
|
|
783
|
+
// The turn's verdicts from here on: a brought-along candidate's own
|
|
784
|
+
// (below its bar, say) is replaced by its see-also one; one no channel
|
|
785
|
+
// reached is added.
|
|
786
|
+
const verdicts: CandidateVerdict[] = along.length === 0 ? gated.verdicts : [
|
|
787
|
+
...gated.verdicts.map((v) => along.find((x) => x.id === v.id)?.verdict ?? v),
|
|
788
|
+
...along.filter((x) => !gated.verdicts.some((v) => v.id === x.id)).map((x) => x.verdict),
|
|
789
|
+
];
|
|
790
|
+
|
|
753
791
|
const docs = new Map<string, ProseDoc>();
|
|
754
792
|
for (const c of candidates) docs.set(c.id, c.doc);
|
|
793
|
+
for (const x of along) docs.set(x.id, x.doc);
|
|
755
794
|
// Quiet pointers render with their one-word label (`FRAMING.linked`).
|
|
756
795
|
const linked = new Set(candidates.filter((c) => c.linkOnly === true).map((c) => c.id));
|
|
757
796
|
const lifted = new Set(candidates.filter((c) => c.lifted === true).map((c) => c.id));
|
|
@@ -774,6 +813,7 @@ export class Recall {
|
|
|
774
813
|
const r = resolveDoc(docs.get(id), id);
|
|
775
814
|
const st = standing(id);
|
|
776
815
|
const withStanding = st === null ? r : { ...r, standing: { prefix: st.prefix, suffix: st.suffix } };
|
|
816
|
+
if (alongIds.has(id)) return { ...withStanding, seeAlso: true, titleBytes: this.tunables.SEE_ALSO_TITLE_BYTES };
|
|
777
817
|
return linked.has(id) ? { ...withStanding, linked: true } : withStanding;
|
|
778
818
|
};
|
|
779
819
|
|
|
@@ -782,7 +822,7 @@ export class Recall {
|
|
|
782
822
|
turn: turnNo,
|
|
783
823
|
affectFlag: gated.affectFlag,
|
|
784
824
|
surfaced: gated.surfaced.map((c) => c.id),
|
|
785
|
-
footnotes: gated.footnotes.map((c) => c.id),
|
|
825
|
+
footnotes: [...gated.footnotes.map((c) => c.id), ...along.map((x) => x.id)],
|
|
786
826
|
...(beliefPicks === null || beliefPicks.lines.length === 0 ? {} : { beliefs: beliefPicks.lines }),
|
|
787
827
|
budgetBytes,
|
|
788
828
|
gistBytes: this.tunables.GIST_BYTES,
|
|
@@ -808,12 +848,12 @@ export class Recall {
|
|
|
808
848
|
|
|
809
849
|
// The admitted memories the mood lifted, by id (2026-10-14): `moodMatched`
|
|
810
850
|
// counts them all, `moodMatchedIds` names the first MOOD_MATCHED_IDS_CAP.
|
|
811
|
-
const moodLifted =
|
|
851
|
+
const moodLifted = verdicts
|
|
812
852
|
.filter((v) => (v.verdict === "surfaced" || v.verdict === "footnoted") && (v.mood ?? 0) > 0)
|
|
813
853
|
.map((v) => v.id);
|
|
814
854
|
// What priming did to what was SHOWN (after the render's trim).
|
|
815
855
|
const shownSet = new Set([...rendered.surfaced, ...rendered.footnotes]);
|
|
816
|
-
const shownPrimed =
|
|
856
|
+
const shownPrimed = verdicts.filter((v) => v.primed !== undefined && shownSet.has(v.id) && (v.verdict === "surfaced" || v.verdict === "footnoted"));
|
|
817
857
|
const primed: PrimeSummary | null =
|
|
818
858
|
plan === null
|
|
819
859
|
? null
|
|
@@ -848,17 +888,18 @@ export class Recall {
|
|
|
848
888
|
semanticSource,
|
|
849
889
|
semanticFromTurn,
|
|
850
890
|
candidates: act.candidates.length,
|
|
851
|
-
verdicts
|
|
891
|
+
verdicts,
|
|
852
892
|
surfaced: rendered.surfaced,
|
|
853
893
|
footnotes: rendered.footnotes,
|
|
854
894
|
affectFlag: rendered.affectFlag,
|
|
855
895
|
affectReason: gated.affectReason,
|
|
856
896
|
moodMatched: moodLifted.length,
|
|
857
897
|
moodMatchedIds: moodLifted.slice(0, MOOD_MATCHED_IDS_CAP),
|
|
858
|
-
echoSkipped:
|
|
859
|
-
projectSkipped:
|
|
860
|
-
|
|
861
|
-
|
|
898
|
+
echoSkipped: verdicts.filter((v) => v.verdict === "echo-skipped").length,
|
|
899
|
+
projectSkipped: verdicts.filter((v) => v.verdict === "project-skipped").length,
|
|
900
|
+
// What the lift alone kept back, less what see-also then showed.
|
|
901
|
+
crossProjectLifted: alongIds.size === 0 ? gated.crossLifted.length : gated.crossLifted.filter((id) => !alongIds.has(id)).length,
|
|
902
|
+
...this.stops(turn.sessionId, () => stopCounts(verdicts, gated.crossLifted, rendered.trimmed, this.tunables)),
|
|
862
903
|
...(competing === null ? {} : { pairsCompeted: gated.competed.length }),
|
|
863
904
|
primed,
|
|
864
905
|
beliefs: beliefPicks === null ? null : { offered: beliefPicks.offered, shown: rendered.beliefs, bytes: rendered.beliefBytes },
|
|
@@ -871,7 +912,7 @@ export class Recall {
|
|
|
871
912
|
...act.spread,
|
|
872
913
|
pointersShown: rendered.footnotes.filter((id) => linked.has(id)).length,
|
|
873
914
|
liftedShown: [...rendered.surfaced, ...rendered.footnotes].filter((id) => lifted.has(id)).length,
|
|
874
|
-
pointersUnanchored:
|
|
915
|
+
pointersUnanchored: verdicts.filter((v) => v.via === "link" && v.verdict === "dark-uncued").length,
|
|
875
916
|
},
|
|
876
917
|
dropped: act.dropped,
|
|
877
918
|
bytes: rendered.bytes,
|
|
@@ -935,7 +976,7 @@ export class Recall {
|
|
|
935
976
|
turn: d.turn,
|
|
936
977
|
tier: "footnoted",
|
|
937
978
|
trains: trainsOf(d.verdicts, id),
|
|
938
|
-
...(via === "link" ? { via } : {}),
|
|
979
|
+
...(via === "link" || via === "see-also" ? { via } : {}),
|
|
939
980
|
};
|
|
940
981
|
}
|
|
941
982
|
// THE BELIEFS THE SLOT SHOWED (lane E): their own records, so the slot
|
package/src/core/recall/prime.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* CONTEXT PRIMING — an experiment, 2026-10-19 (check ~10-22, two lived days
|
|
3
3
|
* after install; revert by setting `PRIME_LINK_UNITS` and `PRIME_TRAIN_SHARE`
|
|
4
|
-
* to 0, or by reverting the PR
|
|
4
|
+
* to 0, or by reverting the PR; the train's share is 0 since the 10-29 read,
|
|
5
|
+
* so only links and tags prime now). Brief:
|
|
5
6
|
* `~/counterparts-notes/2026-10-19-context-priming-brief.md`.
|
|
6
7
|
*
|
|
7
8
|
* Walk into the kitchen and kitchen things come to mind more easily. Until
|
|
@@ -484,6 +485,11 @@ export function planPrime(input: {
|
|
|
484
485
|
}
|
|
485
486
|
}
|
|
486
487
|
|
|
488
|
+
// THE TRAIN'S SHARE AT 0 (the 10-29 read) IS OFF, NOT JUST WEIGHTLESS: no
|
|
489
|
+
// train is handed to scoring, so no candidate's vector is read for it and
|
|
490
|
+
// the turn's row says `train: false`. The train itself is still kept (the
|
|
491
|
+
// `next` below), so turning the share back on starts warm.
|
|
492
|
+
if (!(t.PRIME_TRAIN_SHARE > 0)) scoring = null;
|
|
487
493
|
return {
|
|
488
494
|
activation: { link, train: scoring, trainWeight: scoring === null ? 0 : Math.min(1, scoringMass), exclude: input.echo ?? new Set<string>() },
|
|
489
495
|
sources,
|
package/src/core/recall/rated.ts
CHANGED
|
@@ -163,7 +163,7 @@ export interface ShownEntry {
|
|
|
163
163
|
* `beliefs` the slot's (`GateState.beliefs`, belief id → turn; lane E).
|
|
164
164
|
*/
|
|
165
165
|
export function rateableSet(
|
|
166
|
-
surfaced: Readonly<Record<string, { turn: number; tier: "surfaced" | "footnoted"; via?: "link" }>>,
|
|
166
|
+
surfaced: Readonly<Record<string, { turn: number; tier: "surfaced" | "footnoted"; via?: "link" | "see-also" }>>,
|
|
167
167
|
asked: Iterable<string>,
|
|
168
168
|
opened: Iterable<string>,
|
|
169
169
|
beliefs: Readonly<Record<string, number>> = {},
|
|
@@ -71,6 +71,12 @@ export const FRAMING = {
|
|
|
71
71
|
* reason as `journal`: a label, never a filter.
|
|
72
72
|
*/
|
|
73
73
|
linked: "Linked:",
|
|
74
|
+
/**
|
|
75
|
+
* ONE LABEL, IN FRONT OF A MEMORY ANOTHER NAMED (see-also, 2026-10-29): it
|
|
76
|
+
* is here because a memory this turn shows names its id, not because the
|
|
77
|
+
* turn's words or meaning reached it. Same shape and reason as `linked`.
|
|
78
|
+
*/
|
|
79
|
+
seeAlso: "See also:",
|
|
74
80
|
/**
|
|
75
81
|
* THE BELIEFS SLOT'S HEADER (wave 2 lane E, 2026-10-22; design §7): what
|
|
76
82
|
* the subjects this turn named are held to be, in a slot of their own, so
|
|
@@ -130,6 +136,12 @@ export interface Resolved {
|
|
|
130
136
|
/** True for a quiet pointer (`Candidate.linkOnly`), which renders with
|
|
131
137
|
* `FRAMING.linked` in front of it. Absent reads as false. */
|
|
132
138
|
readonly linked?: boolean;
|
|
139
|
+
/** True for a memory a shown one named (`activate.ts#seeAlso`), which renders with
|
|
140
|
+
* `FRAMING.seeAlso` in front of it. Absent reads as false. */
|
|
141
|
+
readonly seeAlso?: boolean;
|
|
142
|
+
/** A tighter title clip for this line (see-also's `SEE_ALSO_TITLE_BYTES`);
|
|
143
|
+
* the render's `titleBytes` when absent, never wider than it. */
|
|
144
|
+
readonly titleBytes?: number;
|
|
133
145
|
/**
|
|
134
146
|
* The memory's STANDING in a contradiction (2026-09-29, `standing.ts`): a
|
|
135
147
|
* qualifier in front (`Earlier (now [id]): `, `Unsettled — may be out of
|
|
@@ -208,7 +220,7 @@ export function clip(text: string, maxBytes: number): string {
|
|
|
208
220
|
* belongs.
|
|
209
221
|
*/
|
|
210
222
|
function label(r: Resolved): string {
|
|
211
|
-
return `${r.linked === true ? `${FRAMING.linked} ` : ""}${r.journal === true ? `${FRAMING.journal} ` : ""}${r.standing?.prefix ?? ""}`;
|
|
223
|
+
return `${r.linked === true ? `${FRAMING.linked} ` : ""}${r.seeAlso === true ? `${FRAMING.seeAlso} ` : ""}${r.journal === true ? `${FRAMING.journal} ` : ""}${r.standing?.prefix ?? ""}`;
|
|
212
224
|
}
|
|
213
225
|
|
|
214
226
|
/** The standing's pointer, after the text and outside the clip, like the label. */
|
|
@@ -261,7 +273,8 @@ function compose(
|
|
|
261
273
|
// Pointers with short titles, NEVER bodies (§9 OUTPUTS).
|
|
262
274
|
for (const id of footnotes) {
|
|
263
275
|
const r = resolve(id);
|
|
264
|
-
|
|
276
|
+
const titleBytes = r.titleBytes === undefined ? input.titleBytes : Math.min(input.titleBytes, r.titleBytes);
|
|
277
|
+
lines.push(`- ${label(r)}${clip(r.title, titleBytes)} [${id}]${after(r)}`);
|
|
265
278
|
}
|
|
266
279
|
}
|
|
267
280
|
// THE BELIEFS SLOT (lane E), after the footnotes, in its own labelled block.
|
|
@@ -144,6 +144,8 @@ export const SCALAR_REF = "state";
|
|
|
144
144
|
export const SEMANTIC_REF = "lag";
|
|
145
145
|
/** A `surfaced` row's `value` when the memory was a quiet pointer (2026-09-28). */
|
|
146
146
|
export const POINTER_VALUE = "link";
|
|
147
|
+
/** A `surfaced` row's `value` when a shown memory's text named it (see-also, 2026-10-29). */
|
|
148
|
+
export const SEE_ALSO_VALUE = "see-also";
|
|
147
149
|
|
|
148
150
|
/** What a memory got, the turn it got it, and whether it may ever train. */
|
|
149
151
|
export interface SurfaceRecord {
|
|
@@ -153,8 +155,10 @@ export interface SurfaceRecord {
|
|
|
153
155
|
trains: boolean;
|
|
154
156
|
/** `"link"` when it was a QUIET POINTER — reached only through links
|
|
155
157
|
* (2026-09-28). Kept in the row's otherwise unused `value` column, so the
|
|
156
|
-
* credit pass can count pointers that were later expanded. No schema change.
|
|
157
|
-
|
|
158
|
+
* credit pass can count pointers that were later expanded. No schema change.
|
|
159
|
+
* `"see-also"` (2026-10-29) when a shown memory's text named it; the same
|
|
160
|
+
* column. Either way an ordinary footnote to credit and to rate. */
|
|
161
|
+
via?: "link" | "see-also";
|
|
158
162
|
}
|
|
159
163
|
|
|
160
164
|
export interface CreditRecord {
|
|
@@ -263,7 +267,7 @@ export function loadGateState(store: Store, sessionId: string, max = Infinity):
|
|
|
263
267
|
turn: row.turn,
|
|
264
268
|
tier: row.tier === "footnoted" ? "footnoted" : "surfaced",
|
|
265
269
|
trains: row.trains !== 0,
|
|
266
|
-
...(row.value === POINTER_VALUE ? { via: "link" as const } : {}),
|
|
270
|
+
...(row.value === POINTER_VALUE ? { via: "link" as const } : row.value === SEE_ALSO_VALUE ? { via: "see-also" as const } : {}),
|
|
267
271
|
};
|
|
268
272
|
} else if (row.kind === "credited") {
|
|
269
273
|
credited[row.ref] = { turn: row.turn, tier: (row.tier ?? "referenced") as UseTier, day: row.last_day };
|
|
@@ -332,7 +336,7 @@ export function saveGateState(store: Store, state: GateState, max: number, extra
|
|
|
332
336
|
lastDay: state.lastDay,
|
|
333
337
|
tier: rec.tier,
|
|
334
338
|
trains: rec.trains,
|
|
335
|
-
...(rec.via === "link" ? { value: POINTER_VALUE } : {}),
|
|
339
|
+
...(rec.via === "link" ? { value: POINTER_VALUE } : rec.via === "see-also" ? { value: SEE_ALSO_VALUE } : {}),
|
|
336
340
|
});
|
|
337
341
|
}
|
|
338
342
|
const keptSurfaced = bound(state.surfaced, max);
|