counterparts 0.3.13 → 0.3.15

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.
Files changed (106) hide show
  1. package/CHANGELOG.md +264 -0
  2. package/docs/QUICKSTART.md +22 -0
  3. package/docs/README.md +1 -0
  4. package/package.json +1 -1
  5. package/src/adapters/claude-code/CONTRACT.md +48 -0
  6. package/src/adapters/claude-code/NOTES.md +148 -0
  7. package/src/adapters/claude-code/bin/hook.mjs +4 -2
  8. package/src/adapters/claude-code/bin/hook.ts +61 -7
  9. package/src/adapters/claude-code/bin/nightly.ts +5 -1
  10. package/src/adapters/claude-code/bin/runner.ts +11 -3
  11. package/src/adapters/claude-code/claim.ts +319 -0
  12. package/src/adapters/claude-code/doctor.ts +170 -16
  13. package/src/adapters/claude-code/embed-client.ts +3 -0
  14. package/src/adapters/cli/CONTRACT.md +5 -0
  15. package/src/adapters/cli/NOTES.md +25 -0
  16. package/src/adapters/cli/bin/counterparts.mjs +4 -2
  17. package/src/adapters/cli/bin/counterparts.ts +49 -3
  18. package/src/adapters/cli/commands.ts +169 -32
  19. package/src/adapters/cli/desktop.ts +112 -7
  20. package/src/adapters/cli/help.ts +10 -0
  21. package/src/adapters/cli/index.ts +1 -0
  22. package/src/adapters/cli/install.ts +94 -14
  23. package/src/adapters/cli/self-page.ts +5 -8
  24. package/src/adapters/cli/settle.ts +39 -2
  25. package/src/adapters/cli/wire.ts +18 -1
  26. package/src/adapters/config.ts +29 -1
  27. package/src/adapters/dashboard/NOTES.md +33 -0
  28. package/src/adapters/dashboard/bin/dashboard.mjs +4 -2
  29. package/src/adapters/dashboard/bin/dashboard.ts +11 -3
  30. package/src/adapters/dashboard/index.ts +14 -0
  31. package/src/adapters/dashboard/registries.ts +3 -0
  32. package/src/adapters/dashboard/source.ts +0 -8
  33. package/src/adapters/dashboard/web/fired.ts +8 -0
  34. package/src/adapters/dashboard/web/flow.ts +1 -0
  35. package/src/adapters/dashboard/web/lanes.ts +1 -0
  36. package/src/adapters/dashboard/web/narrate.ts +11 -0
  37. package/src/adapters/dashboard/web/pages/flow/sections/fired.js +1 -1
  38. package/src/adapters/dashboard/web/pages/health/sections/cycle.js +7 -10
  39. package/src/adapters/dashboard/web/pages/memories/memories.css +3 -0
  40. package/src/adapters/dashboard/web/pages/memories/row.js +5 -2
  41. package/src/adapters/dashboard/web/pages/memories/sections/hold.js +2 -1
  42. package/src/adapters/dashboard/web/pages/memories/sections/search.js +19 -3
  43. package/src/adapters/dashboard/web/server.ts +16 -4
  44. package/src/adapters/dashboard/web/shared/dates.js +6 -16
  45. package/src/adapters/dashboard/web/shared/memory-modal.js +21 -8
  46. package/src/adapters/dashboard/web/views/health.ts +19 -5
  47. package/src/adapters/dashboard/web/views/mechanism-panel.ts +8 -5
  48. package/src/adapters/dashboard/web/views/memories.ts +26 -7
  49. package/src/adapters/dashboard/web/views/memory-words.ts +16 -0
  50. package/src/adapters/dashboard/web/views/memory.ts +51 -2
  51. package/src/adapters/dashboard/web/views/mind.ts +38 -6
  52. package/src/adapters/empty-bunfig.toml +5 -0
  53. package/src/adapters/fired.ts +16 -2
  54. package/src/adapters/host-wiring.ts +112 -17
  55. package/src/adapters/log/index.ts +2 -2
  56. package/src/adapters/mcp/CONTRACT.md +17 -2
  57. package/src/adapters/mcp/INTERFACE-GAPS.md +15 -1
  58. package/src/adapters/mcp/NOTES.md +269 -0
  59. package/src/adapters/mcp/bin/serve.mjs +4 -2
  60. package/src/adapters/mcp/bin/serve.ts +17 -6
  61. package/src/adapters/mcp/facts.ts +72 -4
  62. package/src/adapters/mcp/meaning.ts +218 -15
  63. package/src/adapters/mcp/server.ts +21 -6
  64. package/src/adapters/mcp/tools.ts +86 -61
  65. package/src/adapters/plugin-run.sh +413 -34
  66. package/src/adapters/plugin.ts +141 -17
  67. package/src/adapters/runtime.ts +192 -17
  68. package/src/adapters/sessions.ts +2 -2
  69. package/src/core/associate/NOTES.md +10 -0
  70. package/src/core/bridge.ts +1 -1
  71. package/src/core/briefing.ts +20 -3
  72. package/src/core/contradictions.ts +56 -20
  73. package/src/core/counterpart.ts +72 -23
  74. package/src/core/dream/CONTRACT.md +6 -14
  75. package/src/core/dream/INTERFACE-GAPS.md +3 -2
  76. package/src/core/dream/NOTES.md +10 -0
  77. package/src/core/dream/index.ts +11 -53
  78. package/src/core/dream/reflect.ts +11 -2
  79. package/src/core/embed/static.ts +5 -1
  80. package/src/core/encode/INTERFACE-GAPS.md +2 -1
  81. package/src/core/encode/NOTES.md +12 -0
  82. package/src/core/encode/chunk.ts +6 -30
  83. package/src/core/encode/index.ts +0 -1
  84. package/src/core/encode/types.ts +1 -13
  85. package/src/core/handoff/INTERFACE-GAPS.md +1 -1
  86. package/src/core/handoff/index.ts +2 -1
  87. package/src/core/handoff/last-here.ts +18 -2
  88. package/src/core/physics/CONTRACT.md +6 -0
  89. package/src/core/physics/NOTES.md +33 -2
  90. package/src/core/physics/index.ts +22 -7
  91. package/src/core/prospective/CONTRACT.md +3 -1
  92. package/src/core/prospective/NOTES.md +15 -0
  93. package/src/core/recall/activate.ts +1 -1
  94. package/src/core/recall/time-ask.ts +173 -19
  95. package/src/core/self/CONTRACT.md +56 -19
  96. package/src/core/self/NOTES.md +172 -0
  97. package/src/core/self/behind.ts +6 -3
  98. package/src/core/self/briefing.ts +384 -28
  99. package/src/core/self/index.ts +105 -44
  100. package/src/core/self/page.ts +12 -85
  101. package/src/core/self/tunables.ts +16 -19
  102. package/src/core/self/writer.ts +31 -4
  103. package/src/core/sleep/NOTES.md +32 -0
  104. package/src/core/store/NOTES.md +21 -2
  105. package/src/core/store/index.ts +2 -1
  106. package/src/core/time.ts +15 -0
@@ -59,6 +59,7 @@ import { CORE_EMOTIONS } from "../../core/feelings-wheel.js";
59
59
  import { RECALL_MAX_IDS } from "./deliberate.js";
60
60
  import { FACTS_MEANING_CAP, FACTS_PAGE_SIZE } from "./facts.js";
61
61
  import { RECURRENCES } from "../../core/time.js";
62
+ import { PAGE_LIMIT_BYTES } from "../../core/self/briefing.js";
62
63
 
63
64
  /**
64
65
  * A MEMORY'S TITLE, ASKED FOR AS ONE LINE (2026-09-28, build B). Indexes — the
@@ -373,14 +374,20 @@ const REMIND_PROPERTY = {
373
374
  'Optional, with eventDate: how it comes back. "plain" when you judge it genuinely matters for remembering to DO something — a real deadline, an important date — or when the person says it matters ("don\'t let me forget to pay taxes before Oct 15th!"): on the day it is said plainly, once, to them in their terminal and to you in context (a month or range: its first day and its last). Otherwise "quiet", the default: it can surface as a footnote around the date, at most twice — giving it a date is itself what makes it eligible, whatever its salience.',
374
375
  } as const;
375
376
 
376
- /** The two privileges `note` and `session_end` share for the date fields. */
377
- const DATE_PRIVILEGES: readonly Privilege[] = [
378
- {
379
- claim:
380
- "`eventDate` is a FIELD, never read out of your text: it is checked by the one module that reads dates, and an unreadable one is refused by name before anything is stored.",
381
- mechanizedBy:
382
- "src/adapters/mcp/server.ts#readReminder -> src/core/remember/proposals.ts#intake (EVENT_DATE_UNREADABLE) -> src/core/time.ts#parseCalendarDate",
383
- },
377
+ /**
378
+ * The date field's own privilege — how to CALL it — kept apart from the two
379
+ * about what a reminder then does, so `note` can lead with it (inside the
380
+ * host's 2,048-character cut, `renderDescription`).
381
+ */
382
+ const EVENT_DATE_FIELD_PRIVILEGE: Privilege = {
383
+ claim:
384
+ "`eventDate` is a FIELD, never read out of your text: it is checked by the one module that reads dates, and an unreadable one is refused by name before anything is stored.",
385
+ mechanizedBy:
386
+ "src/adapters/mcp/server.ts#readReminder -> src/core/remember/proposals.ts#intake (EVENT_DATE_UNREADABLE) -> src/core/time.ts#parseCalendarDate",
387
+ };
388
+
389
+ /** The two privileges `note` and `session_end` share about what a reminder does. */
390
+ const REMINDER_PRIVILEGES: readonly Privilege[] = [
384
391
  {
385
392
  claim:
386
393
  'A "plain" reminder is said at most once per beat — on its day, or on the first and the last day of a month or range — and never under observer stance; a "quiet" one is only ever a cue, capped at the footnote tier and spent at most twice per window. A recurring date counts each time it comes round as its own, and each time it is said or surfaced counts once as a use of the memory; while it repeats, the nightly prune keeps it, and it comes round on its date even when it has faded.',
@@ -458,22 +465,21 @@ const NOTE: ToolSpec = {
458
465
  "Do NOT call it to store a credential, key or token 'for later' — the gate redacts it and the note is refused as empty.",
459
466
  "Do NOT use `feelingsNow` for a feeling in this moment about something new — that is `feelings` on the note that remembers it — nor to restate how an old memory felt: only when it feels DIFFERENT now.",
460
467
  ],
468
+ // How to call it first: a host that loads this tool up front serves only the
469
+ // first 2,048 characters of the description (`renderDescription`).
461
470
  privileges: [
462
471
  {
463
472
  claim:
464
- "It takes the same road as ambient memory: one write chokepoint, the full gate battery, no exceptions for being asked politely.",
465
- mechanizedBy: "src/core/counterpart.ts#deposit -> bridge.batteryGate()",
473
+ "`updates` is a FIELD, not prose: name the id of the memory this revises and the engine resolves it, writes the resolved id, and leaves the note unlinked rather than refusing it when the address does not hold.",
474
+ mechanizedBy:
475
+ "src/core/remember/updates.ts#resolveUpdates -> src/core/mint.ts#mintProposal (UPDATES_META_KEY)",
466
476
  },
477
+ EVENT_DATE_FIELD_PRIVILEGE,
467
478
  {
468
479
  claim:
469
480
  "A salience you claim is a FLOOR, not a value: it can raise how strongly this is held, never lower it, and every lift is recorded.",
470
481
  mechanizedBy: "src/core/physics/index.ts#clampSalienceAtSeam",
471
482
  },
472
- {
473
- claim:
474
- "Credentials are redacted before anything is stored, and a note that was nothing but a credential is refused outright.",
475
- mechanizedBy: "src/core/encode/secrets.ts + src/core/encode/floor.ts#contentFloor",
476
- },
477
483
  {
478
484
  claim:
479
485
  "Claim nothing and this still counts as something: an unclaimed note gets an ordinary default floor, not zero. An explicit claim, however low, is kept as you wrote it.",
@@ -488,6 +494,16 @@ const NOTE: ToolSpec = {
488
494
  claim: "A stub is refused: a note has to say something.",
489
495
  mechanizedBy: "src/core/encode/floor.ts#contentFloor",
490
496
  },
497
+ {
498
+ claim:
499
+ "It takes the same road as ambient memory: one write chokepoint, the full gate battery, no exceptions for being asked politely.",
500
+ mechanizedBy: "src/core/counterpart.ts#deposit -> bridge.batteryGate()",
501
+ },
502
+ {
503
+ claim:
504
+ "Credentials are redacted before anything is stored, and a note that was nothing but a credential is refused outright.",
505
+ mechanizedBy: "src/core/encode/secrets.ts + src/core/encode/floor.ts#contentFloor",
506
+ },
491
507
  {
492
508
  claim: "The same content twice is refused, not stored twice.",
493
509
  mechanizedBy: "src/core/remember/proposals.ts#submitProposal (content-idempotency ledger)",
@@ -497,13 +513,7 @@ const NOTE: ToolSpec = {
497
513
  "Your own words ride the buffer as their own span, so the end-of-session sweep does not mint them a second time.",
498
514
  mechanizedBy: "src/core/counterpart.ts#captureJot -> SubmitContext.ownSpanHash",
499
515
  },
500
- {
501
- claim:
502
- "`updates` is a FIELD, not prose: name the id of the memory this revises and the engine resolves it, writes the resolved id, and leaves the note unlinked rather than refusing it when the address does not hold.",
503
- mechanizedBy:
504
- "src/core/remember/updates.ts#resolveUpdates -> src/core/mint.ts#mintProposal (UPDATES_META_KEY)",
505
- },
506
- ...DATE_PRIVILEGES,
516
+ ...REMINDER_PRIVILEGES,
507
517
  WRITE_FACTS_PRIVILEGE,
508
518
  {
509
519
  claim: "Under observer stance nothing is written and the refusal says so.",
@@ -596,12 +606,14 @@ const RECALL: ToolSpec = {
596
606
  "Do NOT pass a question and ids together, or ids you have not seen in a result: ids is the follow-up to a list, not a second way to search.",
597
607
  "Do NOT send a question without a mode: there is no default, and the call is refused with the two modes named.",
598
608
  ],
609
+ // How to call it first — the three kinds of ask — inside the host's
610
+ // 2,048-character cut (`renderDescription`).
599
611
  privileges: [
600
612
  {
601
613
  claim:
602
- "A search strengthens nothing — a memory you were only shown in a list is no stronger for having been listed. OPENING one, by id or by title handle, is using it, and so is QUOTING the words a question's answer showed you in your reply: either is credited at the session boundary, once per lived day. The tool never writes a memory; what it writes is bookkeeping — which memory a title reached, which memories an answer showed this session, and one count row per call.",
614
+ "A question needs mode: \"facts\" or \"meaning\". Each is its own path, with its own ranking and its own answer, returned as labeled lines in `answer`; tuning one does not change the other.",
603
615
  mechanizedBy:
604
- "src/adapters/mcp/facts.ts#factsRecall (reads only) + src/adapters/expansions.ts#recordHandleResolution -> src/adapters/lifecycle.ts#creditAtBoundary -> src/core/recall/reference.ts (expansion and quote) + src/adapters/mcp/server.ts#noteAsked -> src/core/counterpart.ts#noteAsked / creditReferences (asked records) -> src/core/recall/index.ts#resolveUse (once per lived day)",
616
+ "src/adapters/mcp/server.ts#recallTool (mode-required, mode-unknown) + src/adapters/mcp/facts.ts#factsRecall + src/adapters/mcp/meaning.ts#meaningRecall",
605
617
  },
606
618
  {
607
619
  claim:
@@ -610,9 +622,14 @@ const RECALL: ToolSpec = {
610
622
  },
611
623
  {
612
624
  claim:
613
- "A question needs mode: \"facts\" or \"meaning\". Each is its own path, with its own ranking and its own answer, returned as labeled lines in `answer`; tuning one does not change the other.",
625
+ `Pass ids to read those memories whole. It takes up to ${RECALL_MAX_IDS}, each resolved as an exact address with the same confidentiality boundary; a long body comes in parts, and ids past the result's room wait, named. Ids and a handle take no mode.`,
626
+ mechanizedBy: "src/adapters/mcp/deliberate.ts#expandIds (RECALL_MAX_IDS, expandHandle per id) + src/adapters/mcp/deliberate.ts#boundById (RECALL_BODY_CHARS parts, RECALL_ID_RESULT_CHARS)",
627
+ },
628
+ {
629
+ claim:
630
+ "A search strengthens nothing — a memory you were only shown in a list is no stronger for having been listed. OPENING one, by id or by title handle, is using it, and so is QUOTING the words a question's answer showed you in your reply: either is credited at the session boundary, once per lived day. The tool never writes a memory; what it writes is bookkeeping — which memory a title reached, which memories an answer showed this session, and one count row per call.",
614
631
  mechanizedBy:
615
- "src/adapters/mcp/server.ts#recallTool (mode-required, mode-unknown) + src/adapters/mcp/facts.ts#factsRecall + src/adapters/mcp/meaning.ts#meaningRecall",
632
+ "src/adapters/mcp/facts.ts#factsRecall (reads only) + src/adapters/expansions.ts#recordHandleResolution -> src/adapters/lifecycle.ts#creditAtBoundary -> src/core/recall/reference.ts (expansion and quote) + src/adapters/mcp/server.ts#noteAsked -> src/core/counterpart.ts#noteAsked / creditReferences (asked records) -> src/core/recall/index.ts#resolveUse (once per lived day)",
616
633
  },
617
634
  {
618
635
  claim: `Facts mode considers every memory the question's words reach, every memory linked to a person or project it names, and the ${String(FACTS_MEANING_CAP)} closest by meaning — and, for a question that is only a time, everything in that window. A memory matched more ways ranks higher; it ranks by how strongly it matched, and newer comes first only on a tie.`,
@@ -630,7 +647,7 @@ const RECALL: ToolSpec = {
630
647
  },
631
648
  {
632
649
  claim:
633
- "Each fact says who said it (\"you said\" is the owner, \"I said\" is you, or \"inferred\"), what kind of thing it is (done, planned, proposed, asked), when it happened (or \"no event date\"), when and where it was learned, and whether it is CURRENT. A field the writer did not record says so (\"speaker unknown\"). Earlier versions are folded under the current one with their dates; a corrected one is hidden and counted.",
650
+ "Each fact says who said it (\"you said\" is the owner, \"I said\" is you, or \"inferred\"), what kind of thing it is (done, planned, proposed, asked), when it happened (or \"no event date\"), when and where it was learned, and whether it is CURRENT. A field the writer did not record says so (\"speaker unknown\"). Earlier versions are folded under the current one with their dates; a corrected one was wrong and is never a result, but is named under it as \"corrected (was wrong)\" with its id, to open by id.",
634
651
  mechanizedBy: "src/adapters/mcp/facts.ts#factItem (occurred_on, said_by, status; versions rows + contradictions pairs) + src/adapters/mcp/deliberate.ts#provenanceParts",
635
652
  },
636
653
  {
@@ -649,11 +666,6 @@ const RECALL: ToolSpec = {
649
666
  "An answer is bounded and never ships every body at full length: a short fact comes whole, a long one as an excerpt, and the whole answer stays under the result's room. An answer the host truncates is not a smaller answer, it is no answer.",
650
667
  mechanizedBy: "src/adapters/mcp/facts.ts#renderFacts (RECALL_EXCERPT_CHARS, RECALL_RESULT_CHARS)",
651
668
  },
652
- {
653
- claim:
654
- `Pass ids to read those memories whole. It takes up to ${RECALL_MAX_IDS}, each resolved as an exact address with the same confidentiality boundary; a long body comes in parts, and ids past the result's room wait, named. Ids and a handle take no mode.`,
655
- mechanizedBy: "src/adapters/mcp/deliberate.ts#expandIds (RECALL_MAX_IDS, expandHandle per id) + src/adapters/mcp/deliberate.ts#boundById (RECALL_BODY_CHARS parts, RECALL_ID_RESULT_CHARS)",
656
- },
657
669
  {
658
670
  claim:
659
671
  "Confidential material is returned only in the owner's own session: a direct lookup says it is withholding, a list simply does not contain it.",
@@ -765,17 +777,15 @@ const SESSION_END: ToolSpec = {
765
777
  "Do NOT call it for another session's id, or for an id you guessed at: pass the id the end-of-session ask named, and nothing else. The one exception is `writeUp`, and only for the ended session a session-start write-up pointer named.",
766
778
  "Do NOT summarize the conversation; a transcript is not a memory. Write what was LEARNED.",
767
779
  ],
780
+ // How to call it first, inside the host's 2,048-character cut
781
+ // (`renderDescription`); the salience claims stay inside it
782
+ // (`test/stop-ask-quiet.test.ts`).
768
783
  privileges: [
769
784
  {
770
785
  claim:
771
786
  "It is bound to ONE session for the life of this server: the one the host named at launch, or — when the host could not name one — the first session id you pass that this machine's hooks have recorded as live, in this project. A second, different id is refused.",
772
787
  mechanizedBy: "src/adapters/mcp/server.ts#requireBoundSession",
773
788
  },
774
- {
775
- claim:
776
- "The id you pass is checked against host state you cannot write — the hooks' own live-session registry — and a claim that is unknown there, ended, silent too long, or running in another project is refused with which of the four it was.",
777
- mechanizedBy: "src/adapters/sessions.ts#readSession + isLive + sameScope",
778
- },
779
789
  {
780
790
  claim:
781
791
  "`updates` is a FIELD on an entry, not prose: name the id of the memory that entry revises and the engine resolves it, writes the resolved id, and leaves the entry unlinked rather than refusing it when the address does not hold.",
@@ -783,28 +793,40 @@ const SESSION_END: ToolSpec = {
783
793
  "src/core/remember/updates.ts#resolveUpdates -> src/core/mint.ts#mintProposal (UPDATES_META_KEY)",
784
794
  },
785
795
  {
786
- claim: "Each entry takes the same road as ambient memory, gate battery included.",
787
- mechanizedBy: "src/core/counterpart.ts#submitSessionEnd -> bridge.batteryGate()",
796
+ claim: "A salience you claim is a floor, clamped, and every lift is recorded.",
797
+ mechanizedBy: "src/core/physics/index.ts#clampSalienceAtSeam",
788
798
  },
789
799
  {
790
800
  claim:
791
- "The authorship record is set by the engine: what you write is recorded as authored, and nothing a transcript sweep produces can claim to be.",
792
- mechanizedBy: "src/core/counterpart.ts#deposit (channel: authored, engine-set)",
801
+ "An entry that claims no salience gets an ordinary default floor rather than zero, and each entry may score relevance, emotional and predictive itself.",
802
+ mechanizedBy: "src/core/mint.ts#mintProposal -> src/core/physics/index.ts#clampSalienceAtSeam",
793
803
  },
794
804
  {
795
- claim: "A salience you claim is a floor, clamped, and every lift is recorded.",
796
- mechanizedBy: "src/core/physics/index.ts#clampSalienceAtSeam",
805
+ claim:
806
+ "An EMPTY `memories` array is a real answer, not an error: nothing worth keeping here. It mints nothing, is recorded against this session as answered, and counts what this session said so far as written up, whatever happens to a `handoff` sent with it — the handoff's own outcome rides beside the answer. Only a call that leaves `memories` out and lands no handoff is refused.",
807
+ mechanizedBy:
808
+ "src/adapters/mcp/server.ts#sessionEndTool (nothing-new, handoff-only) -> src/adapters/sessions.ts#markNothingNew, src/core/coverage/index.ts#claimUnwritten",
797
809
  },
798
810
  {
799
811
  claim:
800
- "An entry that claims no salience gets an ordinary default floor rather than zero, and each entry may score relevance, emotional and predictive itself.",
801
- mechanizedBy: "src/core/mint.ts#mintProposal -> src/core/physics/index.ts#clampSalienceAtSeam",
812
+ "The id you pass is checked against host state you cannot write — the hooks' own live-session registry — and a claim that is unknown there, ended, silent too long, or running in another project is refused with which of the four it was.",
813
+ mechanizedBy: "src/adapters/sessions.ts#readSession + isLive + sameScope",
814
+ },
815
+ {
816
+ claim: "Each entry takes the same road as ambient memory, gate battery included.",
817
+ mechanizedBy: "src/core/counterpart.ts#submitSessionEnd -> bridge.batteryGate()",
818
+ },
819
+ {
820
+ claim:
821
+ "The authorship record is set by the engine: what you write is recorded as authored, and nothing a transcript sweep produces can claim to be.",
822
+ mechanizedBy: "src/core/counterpart.ts#deposit (channel: authored, engine-set)",
802
823
  },
803
824
  {
804
825
  claim: "Credentials are redacted and empty entries are refused, per entry, without failing the batch.",
805
826
  mechanizedBy: "src/core/encode/secrets.ts + src/adapters/mcp/server.ts#sessionEndTool (per-entry isolation)",
806
827
  },
807
- ...DATE_PRIVILEGES,
828
+ EVENT_DATE_FIELD_PRIVILEGE,
829
+ ...REMINDER_PRIVILEGES,
808
830
  WRITE_FACTS_PRIVILEGE,
809
831
  {
810
832
  claim: "Under observer stance nothing is written and the refusal says so.",
@@ -835,12 +857,6 @@ const SESSION_END: ToolSpec = {
835
857
  "The handoff is refused past its size limit rather than cut, and passes the same gate battery, because what is cut at write time is the only copy.",
836
858
  mechanizedBy: "src/core/handoff/index.ts#Handoffs.write (HANDOFF_MAX_BYTES, gate-refused)",
837
859
  },
838
- {
839
- claim:
840
- "An EMPTY `memories` array is a real answer, not an error: nothing worth keeping here. It mints nothing, is recorded against this session as answered, and counts what this session said so far as written up, whatever happens to a `handoff` sent with it — the handoff's own outcome rides beside the answer. Only a call that leaves `memories` out and lands no handoff is refused.",
841
- mechanizedBy:
842
- "src/adapters/mcp/server.ts#sessionEndTool (nothing-new, handoff-only) -> src/adapters/sessions.ts#markNothingNew, src/core/coverage/index.ts#claimUnwritten",
843
- },
844
860
  {
845
861
  claim:
846
862
  "`writeUp` writes up a session that ended here before it was written up, and ONLY the one a session-start pointer named for THIS session. With no `memories` it returns that session's next part (what was said to it, up to ~24 KB); with `memories` it answers the part you fetched — recorded as this session's, through the same road as every entry, and `[]` is a real answer (nothing worth keeping). When the last part comes back the ended session is marked written up. A live session, an unknown one, one from another project, one that owes nothing or is already written up, and one you were not pointed at are each refused by name, and nothing is written.",
@@ -1165,9 +1181,9 @@ const SELF_PAGE: ToolSpec = {
1165
1181
  mechanizedBy: "src/core/self/index.ts#revisePage (SELF_PAGE_REVISED_EVENT / SELF_PAGE_REFUSED_EVENT -> store.appendEvent)",
1166
1182
  },
1167
1183
  {
1168
- claim:
1169
- "The page is kept whole and the WAKE shows as much of it as its byte cap allows, cut at a section or paragraph boundary with a marker naming what it left out. A page past the hard limit is refused rather than trimmed, because what gets trimmed at write time is the only copy.",
1170
- mechanizedBy: "src/core/self/page.ts#renderPage + src/core/self/tunables.ts (PAGE_WAKE_BYTES, PAGE_MAX_BYTES)",
1184
+ claim: `The wake prints the page WHOLE, never cut. A page past ${String(PAGE_LIMIT_BYTES)} bytes (UTF-8) — the most the wake prints whole — is refused rather than trimmed, with the limit in the answer, because what gets trimmed at write time is the only copy: say it shorter and send it again. A wake configured too small for the page says so in one line and names this tool.`,
1185
+ mechanizedBy:
1186
+ "src/core/self/index.ts#revisePage (PAGE_MAX_BYTES -> too-large) + #pageBlock (whole, or briefing.ts#pageTooLargeLine) + src/core/self/briefing.ts#PAGE_LIMIT_BYTES",
1171
1187
  },
1172
1188
  {
1173
1189
  claim:
@@ -1190,7 +1206,7 @@ const SELF_PAGE: ToolSpec = {
1190
1206
  body: {
1191
1207
  type: "string",
1192
1208
  description:
1193
- "The WHOLE page, first person, in your own voice — `## Core` and `## Lately` by convention, and any other `##` section the page has grown. Omit it to read the page instead of writing it.",
1209
+ `The WHOLE page, first person, in your own voice — \`## Core\` and \`## Lately\` by convention, and any other \`##\` section the page has grown. At most ${String(PAGE_LIMIT_BYTES)} bytes (UTF-8; an em dash or an accented letter is more than one): a longer page is refused, never cut, so tighten it before you send it. Omit it to read the page instead of writing it.`,
1194
1210
  },
1195
1211
  reason: {
1196
1212
  type: "string",
@@ -1383,6 +1399,11 @@ const REFLECT: ToolSpec = {
1383
1399
  "It is shown only what could surface in this session anyway (recall's gates), and it can cite, feel or mark only memories it was shown.",
1384
1400
  mechanizedBy: "src/core/dream/reflect.ts#Reflections.showable + #Reflections.finish (shown ids)",
1385
1401
  },
1402
+ {
1403
+ claim:
1404
+ "`settle` settles two memories it was shown — changed, corrected or open — only with a plain reason, and the record names the reflection; it can be undone like any settle.",
1405
+ mechanizedBy: "src/core/dream/reflect.ts#Reflections.settle -> src/core/contradictions.ts#settle",
1406
+ },
1386
1407
  {
1387
1408
  claim:
1388
1409
  "A memory it cites comes back — a return that slows its fading and counts toward the core's lanes — at most once a lived day, and once a week from reflections; it promotes nothing itself.",
@@ -1408,11 +1429,6 @@ const REFLECT: ToolSpec = {
1408
1429
  "Every word it writes is scanned for credentials first; its hand-back carries the mark capture refuses, so the share is told in the session's own words rather than filed from the tool's.",
1409
1430
  mechanizedBy: "src/core/dream/reflect.ts#Reflections.words + src/core/dream/mark.ts#DREAM_MARK -> src/core/remember/spans.ts#enters",
1410
1431
  },
1411
- {
1412
- claim:
1413
- "`settle` settles two memories it was shown — changed, corrected or open — only with a plain reason, and the record names the reflection; it can be undone like any settle.",
1414
- mechanizedBy: "src/core/dream/reflect.ts#Reflections.settle -> src/core/contradictions.ts#settle",
1415
- },
1416
1432
  ],
1417
1433
  inputSchema: {
1418
1434
  type: "object",
@@ -1597,6 +1613,15 @@ export function toolSpec(name: string, desktop = false): ToolSpec | undefined {
1597
1613
  * examples, then the privileges — each one a claim that has a `mechanizedBy`
1598
1614
  * row behind it. Nothing here is free-form: adding a sentence means adding a
1599
1615
  * registry entry, which means naming the code that enforces it.
1616
+ *
1617
+ * The order is what a model reads when a host serves only the start (2026-10-09).
1618
+ * Claude Code keeps the first 2,048 characters of a tool description when the
1619
+ * tool is loaded up front — tool search off, a custom base URL or proxy, a model
1620
+ * without tool search — and the whole of it (to 16,384) only through tool
1621
+ * search; the field descriptions in the schema are served whole either way. So
1622
+ * the summary, the admission test and every negative example come before the
1623
+ * list, and each list leads with the claims that say how to call the tool
1624
+ * (`test/description-cut.test.ts` holds both).
1600
1625
  */
1601
1626
  export function renderDescription(spec: ToolSpec): string {
1602
1627
  const lines: string[] = [spec.summary, "", `When: ${spec.admission}`];