counterparts 0.3.39 → 0.3.40
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 +18 -0
- package/package.json +1 -1
- package/src/adapters/claude-code/doctor-open.ts +28 -0
- package/src/adapters/claude-code/doctor.ts +5 -1
- package/src/adapters/mcp/server-words.ts +1 -1
- package/src/adapters/mcp/server.ts +28 -10
- package/src/adapters/update-check.ts +1 -1
- package/src/core/counterpart.ts +5 -4
- package/src/core/dream/reflect.ts +4 -2
- package/src/core/self/NOTES.md +77 -0
- package/src/core/self/briefing-room.ts +88 -12
- package/src/core/self/briefing.ts +114 -15
- package/src/core/self/identity.ts +40 -8
- package/src/core/self/index.ts +56 -23
- package/src/core/self/tunables.ts +12 -2
- package/src/core/store/index.ts +4 -3
- package/src/core/store/reads-memories.ts +37 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.40 — 2026-10-29
|
|
4
|
+
|
|
5
|
+
Open items nobody has touched for two weeks are now parked: they leave the wake's "Still open", which says how many are parked (`· 12 parked`), and nothing is deleted or closed. `recall "still open"` still lists every one (the parked last, marked), a question about one still finds it, and using one again brings it back. Items with a date still to come, a `settlesWhen`, or `status: "asked"` (a question or request still waiting) are never parked. The first wake after upgrading may count a lot of parked items at once on a store that has gathered many; that's the backlog of two-week-old threads, all still there. `counterparts doctor` has an Open items line. No store-format change (store v15, cache v7), and nothing to run after upgrading beyond the usual restart of the dashboard and every Claude Code session. Going back to 0.3.39 needs no store restore: `counterparts disconnect`, 0.3.39's install, then `counterparts connect`.
|
|
6
|
+
|
|
7
|
+
- **Open items nobody has touched for two weeks are parked.** An open item untouched for 14
|
|
8
|
+
lived days (it was 21) leaves the wake's "Still open", and the list's count line ends with
|
|
9
|
+
how many are parked (`· 12 parked`). Parked isn't closed: `recall "still open"` lists parked
|
|
10
|
+
items last, marked, a question about the thing still finds one, and using one again (opening
|
|
11
|
+
it and working with it, quoting it, revising it) brings it back. Items with a date still
|
|
12
|
+
to come (or a week past it, or repeating), or that say what would settle them
|
|
13
|
+
(`settlesWhen`), are never parked; a one-off date that has gone by parks like the rest. `counterparts doctor` has an
|
|
14
|
+
Open items line counting open, carried and parked.
|
|
15
|
+
- **The wake says how many open items are parked, even when "Still open" is short or empty.**
|
|
16
|
+
When "Still open" lists everything it carries, it now ends with `(3 parked; recall "still
|
|
17
|
+
open" lists them)`; when nothing is carried at all it reads `Still open: nothing current · 3
|
|
18
|
+
parked (recall "still open" lists them)`. The one-line summary a tight wake folds its lanes
|
|
19
|
+
into keeps the parked count too. Nothing is added when nothing is parked.
|
|
20
|
+
|
|
3
21
|
## 0.3.39 — 2026-10-28
|
|
4
22
|
|
|
5
23
|
Counterparts now tells you when an update is out: once a day it asks the npm registry for the newest version number (nothing about you or your memory goes with it), and when you're a few releases behind, or a release is worth taking, your Claude says so once, with the steps for how you installed. **To turn it off,** tell your Claude to stop reminding you about updates, or set `"updateCheck": false` in `~/.counterparts/claude-code.json`, or `COUNTERPARTS_UPDATE_CHECK=off`; it never runs under Claude Code's `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`. A store now keeps its id after its first week (the session-start cleanup no longer deletes its handle salt). When `claude` isn't on PATH, the `claude mcp add …` line to paste sits on one line of its own. No store-format change (store v15, cache v7), and nothing to run after upgrading beyond the usual restart of the dashboard and every Claude Code session. Going back to 0.3.38 needs no store restore: `counterparts disconnect`, 0.3.38's install, then `counterparts connect`.
|
package/package.json
CHANGED
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
import type { EventRow } from "../../core/store/index.js";
|
|
15
15
|
import { BUSY_TIMEOUT_MS, journalModeOf } from "../../core/store/db.js";
|
|
16
16
|
import { JOURNAL_COPY_FAILED_EVENT, JOURNAL_COPY_WRITTEN_EVENT } from "../../core/self/journal-file.js";
|
|
17
|
+
import { SELF_TUNABLES, STILL_OPEN_HANDLE, openCarry } from "../../core/self/index.js";
|
|
17
18
|
// The same vocabulary the hook's stand-down uses, so the terminal and the
|
|
18
19
|
// console cannot end up with two answers to "why did it not open".
|
|
19
20
|
import { describeFault, faultPath, faultId } from "./standdown.js";
|
|
@@ -386,3 +387,30 @@ export function chapterSummaryFindings(store: Store): Finding[] {
|
|
|
386
387
|
),
|
|
387
388
|
];
|
|
388
389
|
}
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* OPEN ITEMS, CARRIED AND PARKED (P2, 2026-10-28; roadmap 10-28, lightly
|
|
393
|
+
* held): how many open threads the store holds, how many the wake's "Still
|
|
394
|
+
* open" carries, and how many are parked — untouched `OPEN_CARRY_DAYS` lived
|
|
395
|
+
* days with no date and no `settlesWhen` (`self/identity.ts#openCarry`, the
|
|
396
|
+
* one rule). Green and informational: parking is not a fault, and nothing is
|
|
397
|
+
* closed by it. Silent with no open thread. One read of the open rows.
|
|
398
|
+
*/
|
|
399
|
+
export function openItemsFindings(store: Store): Finding[] {
|
|
400
|
+
const days = SELF_TUNABLES.OPEN_CARRY_DAYS;
|
|
401
|
+
const carry = openCarry(store, store.livedDay(), days, SELF_TUNABLES.OPEN_CARRY_GLIMPSE_TOUCH);
|
|
402
|
+
const carried = carry.carried.length;
|
|
403
|
+
const parked = carry.notCarried.size;
|
|
404
|
+
const open = carried + parked;
|
|
405
|
+
if (open === 0) return [];
|
|
406
|
+
return [
|
|
407
|
+
finding(
|
|
408
|
+
"open-items",
|
|
409
|
+
"green",
|
|
410
|
+
"Open items",
|
|
411
|
+
`${String(open)} open: ${String(carried)} carried in Still open, ${String(parked)} parked (untouched ${String(days)}+ lived days; not closed, and recall "${STILL_OPEN_HANDLE}" lists them)`,
|
|
412
|
+
"",
|
|
413
|
+
{ open, carried, parked, days },
|
|
414
|
+
),
|
|
415
|
+
];
|
|
416
|
+
}
|
|
@@ -139,7 +139,7 @@ import type { UpdateSwitch } from "../update-check.js";
|
|
|
139
139
|
import type { Finding } from "./doctor-finding.js";
|
|
140
140
|
import { checkoutFindings } from "./doctor-checkout.js";
|
|
141
141
|
import type { CheckoutReading } from "./doctor-checkout.js";
|
|
142
|
-
import { openFindings, journalFindings, journalCopyFindings, chapterSummaryFindings } from "./doctor-open.js";
|
|
142
|
+
import { openFindings, journalFindings, journalCopyFindings, chapterSummaryFindings, openItemsFindings } from "./doctor-open.js";
|
|
143
143
|
import { aheadWriter } from "./standdown.js";
|
|
144
144
|
import type { OpenReading, MigrationReading } from "./doctor-open.js";
|
|
145
145
|
import {
|
|
@@ -3498,6 +3498,10 @@ export function doctorFindings(input: DoctorInput): Finding[] {
|
|
|
3498
3498
|
["journal-copy", () => journalCopyFindings(store)],
|
|
3499
3499
|
// 2026-10-15: written vs automatic chapter summaries this week. Silent without any.
|
|
3500
3500
|
["chapter-summaries", () => chapterSummaryFindings(store)],
|
|
3501
|
+
// P2 (2026-10-28): open items, carried and parked; silent with none. Not in
|
|
3502
|
+
// the session-start reading (review of #674): it is never red, which is all
|
|
3503
|
+
// that notice prints, and it reads every open row (`openCarry`).
|
|
3504
|
+
...(input.budgetMs !== undefined ? [] : [["open-items", (): Finding[] => openItemsFindings(store)] as const]),
|
|
3501
3505
|
// The process log (2026-09-30): one directory listing and today's file.
|
|
3502
3506
|
// Not in the session-start reading: it is never red, and it reads a file.
|
|
3503
3507
|
...(input.budgetMs !== undefined ? [] : [["log", (): Finding[] => logFindings(input)] as const]),
|
|
@@ -21,7 +21,7 @@ export const SERVER_NAME = "counterparts";
|
|
|
21
21
|
* host decides whether to trust what follows. Read from a constant rather than
|
|
22
22
|
* from disk so the server opens no file to answer its first message.
|
|
23
23
|
*/
|
|
24
|
-
export const SERVER_VERSION = "0.3.
|
|
24
|
+
export const SERVER_VERSION = "0.3.40";
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* THE ONE LINE EVERY TOOL ANSWERS WITH when the store on disk is a schema AHEAD
|
|
@@ -237,7 +237,7 @@ export function asksStillOpen(question: string): boolean {
|
|
|
237
237
|
const folded = question.toLowerCase().replace(/[’']/g, "").replace(/[^a-z ]+/g, " ").replace(/\s+/g, " ").trim();
|
|
238
238
|
return STILL_OPEN_QUESTIONS.has(folded);
|
|
239
239
|
}
|
|
240
|
-
import { openSettlesCounts, STILL_OPEN_HANDLE, WAKE_BUILD_KEY } from "../../core/self/index.js";
|
|
240
|
+
import { openCarry, openSettlesCounts, STILL_OPEN_HANDLE, WAKE_BUILD_KEY } from "../../core/self/index.js";
|
|
241
241
|
import type { PageWriterMode } from "../../core/self/index.js";
|
|
242
242
|
import { canonicalToolName, toolDefinitions, toolSpec } from "./tools.js";
|
|
243
243
|
import { writeUpDoor } from "./write-up.js";
|
|
@@ -2566,7 +2566,8 @@ export class McpServer {
|
|
|
2566
2566
|
* on the owner's 10-25 snapshot, those matched none of 156 open threads.
|
|
2567
2567
|
* For THIS folder since 2026-10-26 (O2), as its wake reads the lane: its
|
|
2568
2568
|
* own threads first, the personal ones after, another folder's work not
|
|
2569
|
-
* listed and not counted.
|
|
2569
|
+
* listed and not counted. Then the parked ones (P2, 2026-10-28), listed
|
|
2570
|
+
* last and marked `parked: true`, with `parked` their count.
|
|
2570
2571
|
*
|
|
2571
2572
|
* Reads only, like `last exchange`: no recall row, no credit, no seen set,
|
|
2572
2573
|
* no quotable record — a ring event alone. Being listed is not a touch
|
|
@@ -2611,21 +2612,32 @@ export class McpServer {
|
|
|
2611
2612
|
);
|
|
2612
2613
|
}
|
|
2613
2614
|
|
|
2615
|
+
/** How many open threads are parked, store-wide (P2, `self/identity.ts#openCarry`); 0 when the store cannot answer. */
|
|
2616
|
+
private parkedCount(): number {
|
|
2617
|
+
const t = this.counterpart.self.tunables;
|
|
2618
|
+
const store = this.counterpart.store;
|
|
2619
|
+
return openCarry(store, store.livedDay(), t.OPEN_CARRY_DAYS, t.OPEN_CARRY_GLIMPSE_TOUCH).notCarried.size;
|
|
2620
|
+
}
|
|
2621
|
+
|
|
2614
2622
|
private stillOpenTool(page: number, routed: boolean): ToolResult {
|
|
2615
2623
|
// For this folder, as its wake reads it (O2, 2026-10-26): its own first,
|
|
2616
2624
|
// the personal ones after, another folder's work not listed or counted;
|
|
2617
2625
|
// a joined folder the setting has off is not this one's (`folderOn`).
|
|
2618
2626
|
const on = this.folderOn();
|
|
2619
|
-
const { items,
|
|
2627
|
+
const { items, parked } = this.counterpart.stillOpen({ scope: this.scope, ...(on === undefined ? {} : { exportsFrom: on }) });
|
|
2620
2628
|
const pages = Math.max(1, Math.ceil(items.length / STILL_OPEN_PAGE));
|
|
2621
2629
|
const at = Math.min(page, pages);
|
|
2622
2630
|
const shown = items.slice((at - 1) * STILL_OPEN_PAGE, at * STILL_OPEN_PAGE);
|
|
2623
|
-
this.emit("mcp.recall.stillopen", undefined, { total: items.length, page: at, shown: shown.length,
|
|
2631
|
+
this.emit("mcp.recall.stillopen", undefined, { total: items.length, page: at, shown: shown.length, parked, routed });
|
|
2624
2632
|
const touched = (n: number): string => (n === 0 ? "this lived day" : n === 1 ? "1 lived day ago" : `${String(n)} lived days ago`);
|
|
2625
|
-
|
|
2626
|
-
|
|
2633
|
+
// THE PARKED, LISTED AND MARKED (P2, 2026-10-28): after every carried
|
|
2634
|
+
// item, the open threads nobody touched in `OPEN_CARRY_DAYS` lived days —
|
|
2635
|
+
// in no lane of the wake, not closed. Said once here, `parked: true` on each.
|
|
2636
|
+
const carried = items.length - parked;
|
|
2637
|
+
const parkedNote =
|
|
2638
|
+
parked === 0
|
|
2627
2639
|
? ""
|
|
2628
|
-
: `
|
|
2640
|
+
: ` ${carried === 0 ? (parked === 1 ? "It is" : "All are") : parked === 1 ? "The last one is" : `The last ${String(parked)} are`} parked (parked: true): open, untouched for ${String(this.counterpart.self.tunables.OPEN_CARRY_DAYS)}+ lived days, so left out of the wake's Still open — not closed. A touch (opened by id and used, quoted, drawn on, revised) brings one back.`;
|
|
2629
2641
|
return this.result(
|
|
2630
2642
|
{
|
|
2631
2643
|
path: "handle",
|
|
@@ -2635,7 +2647,7 @@ export class McpServer {
|
|
|
2635
2647
|
total: items.length,
|
|
2636
2648
|
page: at,
|
|
2637
2649
|
pages,
|
|
2638
|
-
...(
|
|
2650
|
+
...(parked === 0 ? {} : { parked }),
|
|
2639
2651
|
items: shown.map((i) => ({
|
|
2640
2652
|
id: i.id,
|
|
2641
2653
|
title: i.title,
|
|
@@ -2643,11 +2655,12 @@ export class McpServer {
|
|
|
2643
2655
|
...(i.reconsidering === true ? { reconsidering: "a core memory being reconsidered: keep or retire it" } : {}),
|
|
2644
2656
|
...(i.date === undefined ? {} : { date: i.date }),
|
|
2645
2657
|
...(i.settlesWhen === undefined ? {} : { settlesWhen: i.settlesWhen }),
|
|
2658
|
+
...(i.parked === true ? { parked: true } : {}),
|
|
2646
2659
|
})),
|
|
2647
2660
|
note:
|
|
2648
2661
|
(items.length === 0
|
|
2649
2662
|
? "Nothing is still open."
|
|
2650
|
-
: `What "Still open" carries, in the wake's order: what is live first, newest touched first
|
|
2663
|
+
: `${carried === 0 ? `Nothing open is carried in the wake's "Still open" now.` : `What "Still open" carries, in the wake's order: what is live first, newest touched first.`}${at < pages ? ` More on page ${String(at + 1)} (page: ${String(at + 1)}).` : ""} Recall an id to read it whole. A lived day is a day the memory was in use.`) + parkedNote,
|
|
2651
2664
|
},
|
|
2652
2665
|
false,
|
|
2653
2666
|
);
|
|
@@ -3576,7 +3589,12 @@ export class McpServer {
|
|
|
3576
3589
|
// WHAT WOULD SETTLE THEM (2026-10-27, S1): every open item, carried or
|
|
3577
3590
|
// not, and how many name a trigger — counted so a "let it go" offer
|
|
3578
3591
|
// for the rest can be decided later. Nothing acts on it yet.
|
|
3579
|
-
|
|
3592
|
+
// And how many are parked (P2, 2026-10-28, `openCarry`).
|
|
3593
|
+
openItems: {
|
|
3594
|
+
...openSettlesCounts(store),
|
|
3595
|
+
parked: this.parkedCount(),
|
|
3596
|
+
note: `Open items (unresolved), carried or not: how many name what would settle them (settlesWhen), how many have only a date (eventDate), and how many have neither. parked: untouched for ${String(this.counterpart.self.tunables.OPEN_CARRY_DAYS)}+ lived days with no date still to come and no settlesWhen, so left out of the wake's Still open — not closed; recall "still open" lists them last.`,
|
|
3597
|
+
},
|
|
3580
3598
|
stance: { observer: this.observer },
|
|
3581
3599
|
};
|
|
3582
3600
|
}
|
|
@@ -63,7 +63,7 @@ import { PLUGIN_UPDATE_COMMUNITY, PLUGIN_UPDATE_STEP, PLUGIN_UPDATE_SYNCED, npmU
|
|
|
63
63
|
* 30 days old from this alone, with nothing fetched. `test/update-check.test.ts`
|
|
64
64
|
* holds it to CHANGELOG's heading for `SERVER_VERSION` once there is one.
|
|
65
65
|
*/
|
|
66
|
-
export const RELEASE_DATE = "2026-10-
|
|
66
|
+
export const RELEASE_DATE = "2026-10-29";
|
|
67
67
|
|
|
68
68
|
export const UPDATE_CHECK_ENV = "COUNTERPARTS_UPDATE_CHECK";
|
|
69
69
|
export const NONESSENTIAL_TRAFFIC_ENV = "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC";
|
package/src/core/counterpart.ts
CHANGED
|
@@ -1556,18 +1556,19 @@ export class Counterpart {
|
|
|
1556
1556
|
* EVERYTHING "STILL OPEN" CARRIES, today (2026-10-25, the O1 builder;
|
|
1557
1557
|
* `Self#stillOpen`): what the `still open` recall handle lists — the open
|
|
1558
1558
|
* threads the carry rule keeps (`self/identity.ts#openCarry`) and the core
|
|
1559
|
-
* memories being reconsidered, in the wake's order;
|
|
1560
|
-
*
|
|
1559
|
+
* memories being reconsidered, in the wake's order; then the parked ones
|
|
1560
|
+
* (P2, 2026-10-28: untouched `OPEN_CARRY_DAYS` lived days), listed after
|
|
1561
|
+
* and marked, and `parked` counts them.
|
|
1561
1562
|
* Reads only: nothing it lists is touched, so listing cannot keep a thread
|
|
1562
1563
|
* carried. Empty on a store that cannot answer; never throws. `here` (O2,
|
|
1563
1564
|
* 2026-10-26): the folder asking and the host's setting, read as the wake
|
|
1564
1565
|
* there reads them (`threadReader`); absent, every folder's threads.
|
|
1565
1566
|
*/
|
|
1566
|
-
stillOpen(here?: { scope?: string; exportsFrom?: (scope: string) => boolean }): { items: StillOpenItem[];
|
|
1567
|
+
stillOpen(here?: { scope?: string; exportsFrom?: (scope: string) => boolean }): { items: StillOpenItem[]; parked: number } {
|
|
1567
1568
|
try {
|
|
1568
1569
|
return this.self.stillOpen(this.store.livedDay(), here === undefined ? undefined : this.threadReader(here.scope, here.exportsFrom));
|
|
1569
1570
|
} catch {
|
|
1570
|
-
return { items: [],
|
|
1571
|
+
return { items: [], parked: 0 };
|
|
1571
1572
|
}
|
|
1572
1573
|
}
|
|
1573
1574
|
|
|
@@ -442,7 +442,8 @@ export interface ReflectBundle {
|
|
|
442
442
|
* threads stopped being carried since the last reflection whose share reached a session —
|
|
443
443
|
* untouched for `SELF_TUNABLES.OPEN_CARRY_DAYS`, so out of "Still open"
|
|
444
444
|
* and `staleOpen` (`self/identity.ts#openCarry`). A count, never the list:
|
|
445
|
-
* the share says it once
|
|
445
|
+
* the share says it once — as PARKED since P2 (2026-10-28), the word the
|
|
446
|
+
* wake's tail and `recall "still open"` use. Absent when none.
|
|
446
447
|
*/
|
|
447
448
|
readonly noLongerCarried?: number;
|
|
448
449
|
/**
|
|
@@ -1244,9 +1245,10 @@ export class Reflections {
|
|
|
1244
1245
|
]
|
|
1245
1246
|
: []),
|
|
1246
1247
|
// NO LONGER CARRIED (2026-10-22, the open-threads brief): the count, once, never the list.
|
|
1248
|
+
// Said as PARKED since P2 (2026-10-28), the word the wake's tail and the handle use.
|
|
1247
1249
|
...(bundle.noLongerCarried !== undefined && bundle.noLongerCarried > 0
|
|
1248
1250
|
? [
|
|
1249
|
-
`- noLongerCarried: ${String(bundle.noLongerCarried)}. Your share says it once, as a count and never a list: "${String(bundle.noLongerCarried)} open ${bundle.noLongerCarried === 1 ? "item nobody touched in" : "items nobody touched in"} ${String(SELF_TUNABLES.OPEN_CARRY_DAYS)} lived days ${bundle.noLongerCarried === 1 ? "is" : "are"}
|
|
1251
|
+
`- noLongerCarried: ${String(bundle.noLongerCarried)}. Your share says it once, as a count and never a list: "${String(bundle.noLongerCarried)} open ${bundle.noLongerCarried === 1 ? "item nobody touched in" : "items nobody touched in"} ${String(SELF_TUNABLES.OPEN_CARRY_DAYS)} lived days ${bundle.noLongerCarried === 1 ? "is" : "are"} parked; recall "still open" lists them." Parked is not closed: a touch brings one back.`,
|
|
1250
1252
|
]
|
|
1251
1253
|
: []),
|
|
1252
1254
|
...(bundle.feelingWeeks !== null
|
package/src/core/self/NOTES.md
CHANGED
|
@@ -2864,3 +2864,80 @@ random-5b's wake on 0.3.35 (8,981 B) had four rough spots; each is now a smaller
|
|
|
2864
2864
|
`still-open-and-night.test.ts`'s sweep (1,600–3,000 B, 1 and 50 open, the night before
|
|
2865
2865
|
and today's) keeps the item due today and Still open's first item at every budget, and
|
|
2866
2866
|
fails at 1,600 B with the rescue reading only "Last night:".
|
|
2867
|
+
|
|
2868
|
+
## 2026-10-28 — open threads parked at 14 lived days (P2; roadmap 10-28, Mike's "ok your lean sounds good"; lightly held)
|
|
2869
|
+
|
|
2870
|
+
The brief asked the night to park an open item nobody touched for 2+ weeks. The carry rule of
|
|
2871
|
+
2026-10-22 (`identity.ts#openCarry`, 21 lived days) already did most of it — out of "Still
|
|
2872
|
+
open" and its count, not closed, a touch carries it again, the reflection told the count — so
|
|
2873
|
+
P2 is that rule retuned and said aloud, not a second mechanism beside it:
|
|
2874
|
+
|
|
2875
|
+
- **14 lived days** (`OPEN_CARRY_DAYS`, was 21): the lived days "Still open" and the handle
|
|
2876
|
+
already count age in (`livedDaysSinceTouched`). `STILL_OPEN_STALE_DAYS` is also 14, so it
|
|
2877
|
+
now orders only what is never parked.
|
|
2878
|
+
- **Never parked**: a dated item (as before), an `asked` one (as before), and one naming what
|
|
2879
|
+
would settle it (`meta.settlesWhen`, S1; read in the same SQL, `reads-memories.ts#
|
|
2880
|
+
openThreadTouches`'s `settles`). Its door is the reflection's `settlesOpen`, which a parked
|
|
2881
|
+
item would leave. **Dated means still to come** (review of #674): ahead of the store's day,
|
|
2882
|
+
inside its grace week after (`HOLD_GRACE_DAYS`), or repeating (`openThreadTouches`'s `at`,
|
|
2883
|
+
`openCarry`'s `at`, `Store#today` by default). A one-off past its grace parks like the rest —
|
|
2884
|
+
exempt, a 10-05 vet visit was still in "Still open" on 11-10, which "Coming up" had let go.
|
|
2885
|
+
- **Doctor's Open items line is not in the session-start reading** (review of #674): it is
|
|
2886
|
+
never red, the only thing that notice prints, and `openCarry` reads every open row.
|
|
2887
|
+
- **Said**: "Still open"'s count line ends `· N parked` after its paren (`briefing.ts#
|
|
2888
|
+
parkedTail`; `countedLanes` reads the count before it as before), the collapsed line too;
|
|
2889
|
+
the count is per reader (another folder's work not counted, O2), set on `Lanes.parked` by
|
|
2890
|
+
`Self` and carried on `BriefingRequest.threadsParked`. (A lane with no count line said
|
|
2891
|
+
nothing of what it parked; P2b below closed that.)
|
|
2892
|
+
`recall "still open"` lists the parked after the carried, `parked: true`, most recently
|
|
2893
|
+
touched first, with `parked` their count (it used to count them as `notCarried`). The
|
|
2894
|
+
reflection's share says "N open items nobody touched in 14 lived days are parked; recall
|
|
2895
|
+
"still open" lists them." `status`'s `openItems` gains `parked`; doctor gains an Open items
|
|
2896
|
+
line (green, silent with none).
|
|
2897
|
+
- **Read live, nothing written**: parked is computed from the store's own facts at every wake,
|
|
2898
|
+
so a touch un-parks at once, and a host whose nights never run parks all the same. The night
|
|
2899
|
+
records what it parked (`reflections.detail.notCarried`, the 10-22 name kept so rows written
|
|
2900
|
+
since read the same).
|
|
2901
|
+
- **The reflection**: `staleOpen` and the close proposals still skip the parked — being offered
|
|
2902
|
+
is not a touch, and offering them nightly would turn parking into closing by another door.
|
|
2903
|
+
|
|
2904
|
+
Revert: `OPEN_CARRY_DAYS` 21 (or `Infinity`); `parkedTail` returning "".
|
|
2905
|
+
|
|
2906
|
+
**P2b, the same day — the parked are counted whatever line the lane has** (the brief: parked
|
|
2907
|
+
items are counted, not vanished; its main aim a clean list for a new user in week 3). P2 put
|
|
2908
|
+
`· N parked` only on the lane's own count line, so a lane listing fewer than `THREADS_MAX`
|
|
2909
|
+
said nothing, and a store carrying nothing said nothing at all (day 40, 3 parked: no word).
|
|
2910
|
+
Now (`briefing.ts#parkedLine`, placed by `briefing-room.ts#owedParked`):
|
|
2911
|
+
|
|
2912
|
+
- a lane that lists items and counts none it left out ends `(3 parked; recall "still open"
|
|
2913
|
+
lists them)` (42 bytes);
|
|
2914
|
+
- a wake carrying no open item gets the lane as one line, `Still open: nothing current · 3
|
|
2915
|
+
parked (recall "still open" lists them)` (72 bytes). `collapsedLane` reads it as "Still
|
|
2916
|
+
open"'s (the dashboard, the delivery, the claude.ai wake's lane move); `countedLanes` counts
|
|
2917
|
+
nothing from it, since the parked are not "more";
|
|
2918
|
+
- the folded line's "Still open" part ends `· 3 parked` too (`foldedLine`'s `parked`; it
|
|
2919
|
+
dropped it before).
|
|
2920
|
+
|
|
2921
|
+
The line is reserved like a lane's count line: the trim loop composes with it, and with
|
|
2922
|
+
nothing else to pop it takes room as the lanes' lines do (`counting` in `render`) or goes with
|
|
2923
|
+
a bare floor; `tellLost` never accepts a composition over its limit for it and reports whether
|
|
2924
|
+
it was said (`parked`), so the top-item upgrade cannot drop it silently. Nothing when none is
|
|
2925
|
+
parked: a wake with no parked thread is byte for byte what it was. Revert: `parkedLine`
|
|
2926
|
+
returning null.
|
|
2927
|
+
|
|
2928
|
+
**Review of #675, the same day — the parked words give way first.** As built, the parked words
|
|
2929
|
+
were reserved down to a bare floor, so ` · N parked` on the folded line could push the fold a
|
|
2930
|
+
few bytes past its room and the loop went bare: every lane untold, and the parked unsaid too
|
|
2931
|
+
(the PR's own sweep, 700 bytes: "Still open" and "Coming up" both gone; a 4,000-case render
|
|
2932
|
+
fuzz against master: 48 wakes told fewer lanes than #674's). And with no page they outranked
|
|
2933
|
+
"Who I am" items. Now (`render`'s `hush`, `briefing-room.ts#withoutParked`): before the loop
|
|
2934
|
+
pops a "Who I am" item for them, and before a floor that found no room (`takeRoom` to
|
|
2935
|
+
`arrivingFirst`) goes bare, the parked words go quiet — no parked line, no ` · N parked` tail
|
|
2936
|
+
— and the rescues compose without them too; `tellLost` tries every form with them, then every
|
|
2937
|
+
form without them, before its last resort. Where they are not said, the wake is byte for byte
|
|
2938
|
+
the wake with nothing parked (the fuzz checks it; `test/park-old-threads.test.ts` sweeps it).
|
|
2939
|
+
They still take room from "Work here", the Yesterday line's titles and the handoffs when that
|
|
2940
|
+
room is there, as the lanes' lines do. Still to see: in about 10 of the 4,000 cases a "Coming
|
|
2941
|
+
up" count goes untold while the parked are said; the same lanes with nothing parked go untold
|
|
2942
|
+
the same way a few bytes lower (a due-day head kept past its lane's count, #442), so that one
|
|
2943
|
+
is the old floor shifted by the parked words' bytes, not theirs.
|
|
@@ -9,7 +9,7 @@ import type { LaneName, Ranked } from "./identity.js";
|
|
|
9
9
|
import { byteLength } from "./identity.js";
|
|
10
10
|
import { addDays, isDay } from "../time.js";
|
|
11
11
|
import { TODAY_ELSEWHERE_MAX_BYTES } from "../handoff/last-here.js";
|
|
12
|
-
import { LANE_ORDER, ROOM_ORDER, collapsedLine, compose, flatten, foldedLine, isNightLine, moreLine } from "./briefing.js";
|
|
12
|
+
import { LANE_ORDER, ROOM_ORDER, collapsedLine, compose, flatten, foldedLine, isNightLine, moreLine, parkedLine } from "./briefing.js";
|
|
13
13
|
import type { BriefingRequest, Composed, HorizonCounted, IdentityBlock, Resolve, RoomLane, TrimEvent } from "./briefing.js";
|
|
14
14
|
|
|
15
15
|
|
|
@@ -86,22 +86,71 @@ export function lendOf(n: number | undefined): number {
|
|
|
86
86
|
/**
|
|
87
87
|
* The count lines a composition carries for its pinned lanes: "N more", or —
|
|
88
88
|
* a lane that lists nothing — its one collapsed line (`collapsedLine`).
|
|
89
|
+
* And "Still open"'s parked line when the lane has no count line of its own
|
|
90
|
+
* (`owedParked`, P2b): reserved like the others.
|
|
89
91
|
*/
|
|
90
92
|
export function pinnedLines(
|
|
91
93
|
pinned: Partial<Record<LaneName, readonly string[]>>,
|
|
92
94
|
kept: Kept,
|
|
93
95
|
/** What "Coming up" counts rather than lists (`BriefingRequest.horizonLater`, `.horizonOverdue`). */
|
|
94
96
|
counted?: HorizonCounted,
|
|
97
|
+
): Partial<Record<LaneName, string>> {
|
|
98
|
+
return withParked(countLines(pinned, kept, counted), pinned, kept, counted);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function countLines(
|
|
102
|
+
pinned: Partial<Record<LaneName, readonly string[]>>,
|
|
103
|
+
kept: Kept,
|
|
104
|
+
counted?: HorizonCounted,
|
|
95
105
|
): Partial<Record<LaneName, string>> {
|
|
96
106
|
const out: Partial<Record<LaneName, string>> = {};
|
|
97
107
|
for (const lane of LANE_ORDER) {
|
|
98
108
|
const ids = pinned[lane];
|
|
99
109
|
if (ids === undefined || ids.length === 0) continue;
|
|
100
|
-
out[lane] = lane !== "identity" && kept[lane].length === 0 ? collapsedLine(lane, ids, counted) : moreLine(lane, ids, counted?.horizonOverdue);
|
|
110
|
+
out[lane] = lane !== "identity" && kept[lane].length === 0 ? collapsedLine(lane, ids, counted) : moreLine(lane, ids, counted?.horizonOverdue, counted?.threadsParked);
|
|
101
111
|
}
|
|
102
112
|
return out;
|
|
103
113
|
}
|
|
104
114
|
|
|
115
|
+
/**
|
|
116
|
+
* "STILL OPEN"'S PARKED, SAID WHEN THE LANE HAS NO COUNT LINE (P2b,
|
|
117
|
+
* 2026-10-28): the line `parkedLine` composes — under the items the lane
|
|
118
|
+
* lists, or the lane's one line when it lists nothing — when some threads are
|
|
119
|
+
* parked and the lane counts none it left out (`pinned.threads` empty; a lane
|
|
120
|
+
* that does carries ` · N parked` on its own line). Null otherwise.
|
|
121
|
+
*/
|
|
122
|
+
export function owedParked(
|
|
123
|
+
pinned: Partial<Record<LaneName, readonly string[]>>,
|
|
124
|
+
kept: Kept,
|
|
125
|
+
counted?: HorizonCounted,
|
|
126
|
+
): string | null {
|
|
127
|
+
if ((pinned.threads?.length ?? 0) > 0) return null;
|
|
128
|
+
return parkedLine(kept.threads.length > 0, counted?.threadsParked);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* The request with its parked count gone quiet (review of #675): no parked
|
|
133
|
+
* line, no ` · N parked` on a count line or the folded one. The render and
|
|
134
|
+
* `tellLost` compose with it once the parked count has given way — before a
|
|
135
|
+
* lane goes untold or an identity item is popped for it: an aside about what
|
|
136
|
+
* nobody touched in 14 lived days never costs a current lane its count.
|
|
137
|
+
*/
|
|
138
|
+
export function withoutParked(req: BriefingRequest): BriefingRequest {
|
|
139
|
+
if (req.threadsParked === undefined) return req;
|
|
140
|
+
const { threadsParked: _parked, ...rest } = req;
|
|
141
|
+
return rest;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function withParked(
|
|
145
|
+
lines: Partial<Record<LaneName, string>>,
|
|
146
|
+
pinned: Partial<Record<LaneName, readonly string[]>>,
|
|
147
|
+
kept: Kept,
|
|
148
|
+
counted?: HorizonCounted,
|
|
149
|
+
): Partial<Record<LaneName, string>> {
|
|
150
|
+
const line = owedParked(pinned, kept, counted);
|
|
151
|
+
return line === null ? lines : { ...lines, threads: line };
|
|
152
|
+
}
|
|
153
|
+
|
|
105
154
|
/**
|
|
106
155
|
* THE SAME COUNTS, FOLDED (2026-10-12, decided by COUNTERPARTS, lightly
|
|
107
156
|
* held): a lane that still lists an item keeps its own "N more" line under
|
|
@@ -121,8 +170,11 @@ export function foldParts(
|
|
|
121
170
|
if (lane !== "identity" && kept[lane].length === 0) empty[lane] = ids;
|
|
122
171
|
else listing[lane] = ids;
|
|
123
172
|
}
|
|
124
|
-
const fold = foldedLine(empty);
|
|
125
|
-
|
|
173
|
+
const fold = foldedLine(empty, counted?.threadsParked);
|
|
174
|
+
// The parked line only for a lane neither listed nor folded (`owedParked`
|
|
175
|
+
// reads the whole of `pinned`, so a folded "Still open" is not said twice).
|
|
176
|
+
const more = withParked(countLines(listing, kept, counted), pinned, kept, counted);
|
|
177
|
+
return fold === null ? { more } : { more, fold };
|
|
126
178
|
}
|
|
127
179
|
|
|
128
180
|
/**
|
|
@@ -547,6 +599,9 @@ export function tellLost(ctx: {
|
|
|
547
599
|
folded: boolean;
|
|
548
600
|
untold: Partial<Record<LaneName, number>>;
|
|
549
601
|
quiet: Partial<Record<LaneName, number>>;
|
|
602
|
+
/** Whether the composition says how many threads are parked (P2b): on
|
|
603
|
+
* "Still open"'s own line or its parked line. False with none parked. */
|
|
604
|
+
parked: boolean;
|
|
550
605
|
} {
|
|
551
606
|
const at = (more: Partial<Record<LaneName, string>>, fold?: string): Composed =>
|
|
552
607
|
compose(ctx.kept, ctx.req.day, ctx.resolve, ctx.coreName, ctx.identity, more, ctx.yesterday, ctx.elsewhere, fold);
|
|
@@ -559,51 +614,72 @@ export function tellLost(ctx: {
|
|
|
559
614
|
return out;
|
|
560
615
|
};
|
|
561
616
|
const counts = countsOf(ctx.lost);
|
|
617
|
+
// Some threads parked: the tries below say so — on the lane's own line, in
|
|
618
|
+
// the folded one, or in its parked line (`pinnedLines`) — so a try that
|
|
619
|
+
// lost nothing must still fit (P2b). Then the same tries without it
|
|
620
|
+
// (`withoutParked`, review of #675): the parked count is the first of the
|
|
621
|
+
// lanes' words to give way, before a lane goes untold.
|
|
622
|
+
const parkedNow = (ctx.req.threadsParked ?? 0) >= 1;
|
|
623
|
+
const quietReq = withoutParked(ctx.req);
|
|
562
624
|
const reserved = withoutNearby(ctx.lost);
|
|
563
625
|
const hints = ctx.lost.hints?.length ?? 0;
|
|
564
626
|
const quiet: Partial<Record<LaneName, number>> = hints > 0 ? { hints } : {};
|
|
565
|
-
const
|
|
627
|
+
const base: { lost: Partial<Record<LaneName, readonly string[]>>; fold: boolean }[] = [
|
|
566
628
|
{ lost: ctx.lost, fold: false },
|
|
567
629
|
{ lost: ctx.lost, fold: true },
|
|
568
630
|
...(hints > 0 ? [{ lost: reserved, fold: false }, { lost: reserved, fold: true }] : []),
|
|
569
631
|
...(ctx.pinned === undefined ? [] : [{ lost: ctx.pinned, fold: false }, { lost: ctx.pinned, fold: true }]),
|
|
570
632
|
];
|
|
633
|
+
const tries = [
|
|
634
|
+
...base.map((t) => ({ ...t, req: ctx.req, parked: parkedNow })),
|
|
635
|
+
...(parkedNow ? base.map((t) => ({ ...t, req: quietReq, parked: false })) : []),
|
|
636
|
+
];
|
|
571
637
|
for (const t of tries) {
|
|
572
|
-
const
|
|
638
|
+
const parked = t.parked;
|
|
639
|
+
const parts = t.fold ? foldParts(t.lost, ctx.kept, t.req) : { more: pinnedLines(t.lost, ctx.kept, t.req) };
|
|
573
640
|
if (t.fold && parts.fold === undefined) continue;
|
|
574
641
|
const c = at(parts.more, parts.fold);
|
|
575
|
-
if (Object.keys(counts).length === 0 || c.bytes <= ctx.limit) {
|
|
642
|
+
if ((Object.keys(counts).length === 0 && !parked) || c.bytes <= ctx.limit) {
|
|
576
643
|
const said = countsOf(t.lost);
|
|
577
644
|
const untold: Partial<Record<LaneName, number>> = {};
|
|
578
645
|
for (const lane of LANE_ORDER) {
|
|
579
646
|
const n = counts[lane];
|
|
580
647
|
if (n !== undefined && said[lane] === undefined && lane !== "hints") untold[lane] = n;
|
|
581
648
|
}
|
|
582
|
-
return { composed: c, more: said, folded: parts.fold !== undefined, untold, quiet: said.hints === undefined ? quiet : {} };
|
|
649
|
+
return { composed: c, more: said, folded: parts.fold !== undefined, untold, quiet: said.hints === undefined ? quiet : {}, parked };
|
|
583
650
|
}
|
|
584
651
|
}
|
|
585
652
|
// The last resort: what fits, lane by lane; the rest is untold ("Nearby": quiet).
|
|
586
653
|
let current = at({});
|
|
587
654
|
const lines: Partial<Record<LaneName, string>> = {};
|
|
588
655
|
const more: Partial<Record<LaneName, number>> = {};
|
|
656
|
+
let saidParked = false;
|
|
589
657
|
for (const lane of MORE_ORDER) {
|
|
590
658
|
const ids = ctx.lost[lane];
|
|
591
|
-
|
|
592
|
-
|
|
659
|
+
// "Still open" with nothing it left out: its parked line, when owed (P2b).
|
|
660
|
+
const owed = lane === "threads" ? owedParked(ctx.lost, ctx.kept, ctx.req) : null;
|
|
661
|
+
if ((ids === undefined || ids.length === 0) && owed === null) continue;
|
|
662
|
+
lines[lane] =
|
|
663
|
+
ids === undefined || ids.length === 0
|
|
664
|
+
? (owed ?? "")
|
|
665
|
+
: lane !== "identity" && ctx.kept[lane].length === 0
|
|
666
|
+
? collapsedLine(lane, ids, ctx.req)
|
|
667
|
+
: moreLine(lane, ids, ctx.req.horizonOverdue, ctx.req.threadsParked);
|
|
593
668
|
const candidate = at(lines);
|
|
594
669
|
if (candidate.bytes > ctx.limit) {
|
|
595
670
|
delete lines[lane];
|
|
596
671
|
continue;
|
|
597
672
|
}
|
|
598
673
|
current = candidate;
|
|
599
|
-
|
|
674
|
+
if (lane === "threads" && parkedNow) saidParked = true;
|
|
675
|
+
if (ids !== undefined && ids.length > 0) more[lane] = ids.length;
|
|
600
676
|
}
|
|
601
677
|
const untold: Partial<Record<LaneName, number>> = {};
|
|
602
678
|
for (const lane of LANE_ORDER) {
|
|
603
679
|
const n = counts[lane];
|
|
604
680
|
if (n !== undefined && more[lane] === undefined && lane !== "hints") untold[lane] = n;
|
|
605
681
|
}
|
|
606
|
-
return { composed: current, more, folded: false, untold, quiet: more.hints === undefined ? quiet : {} };
|
|
682
|
+
return { composed: current, more, folded: false, untold, quiet: more.hints === undefined ? quiet : {}, parked: saidParked };
|
|
607
683
|
}
|
|
608
684
|
|
|
609
685
|
/** The lanes whose count is reserved: every lane but "Nearby" (2026-10-12). */
|
|
@@ -56,6 +56,8 @@ import type { SelfTunables } from "./tunables.js";
|
|
|
56
56
|
import type { Kept, RescueCtx, Rescued } from "./briefing-room.js";
|
|
57
57
|
import {
|
|
58
58
|
foldParts,
|
|
59
|
+
owedParked,
|
|
60
|
+
withoutParked,
|
|
59
61
|
withoutNearby,
|
|
60
62
|
arrivingHead,
|
|
61
63
|
arrivingNear,
|
|
@@ -525,7 +527,7 @@ export const STILL_OPEN_HANDLE = "still open";
|
|
|
525
527
|
* The line it replaces — `(96 more still open, 15 untouched for 2+ weeks;
|
|
526
528
|
* recall ids (the first 5): mem_…×5)` — read as guilt, and five bare ids said
|
|
527
529
|
* nothing of what they were. Its "untouched" count was a third rule beside
|
|
528
|
-
* the carry (`identity.ts#openCarry`: 21 lived days, a glimpse is not a
|
|
530
|
+
* the carry (`identity.ts#openCarry`: 21 lived days then, 14 since P2; a glimpse is not a
|
|
529
531
|
* touch) and the order (`STILL_OPEN_STALE_DAYS`: 14, born or used), so it is
|
|
530
532
|
* dropped rather than realigned; the order still puts the weeks-old last.
|
|
531
533
|
*
|
|
@@ -550,11 +552,62 @@ export const OPEN_TAIL_WORDS = `kept quietly; recall "${STILL_OPEN_HANDLE}" list
|
|
|
550
552
|
/** "Still open"'s tail words from #623 (2026-10-25, morning), read back off a bundle stored with them. */
|
|
551
553
|
export const OPEN_TAIL_WORDS_BEFORE = "kept quietly; recall finds one by what it's about";
|
|
552
554
|
|
|
555
|
+
/**
|
|
556
|
+
* WHAT "STILL OPEN" PARKED, COUNTED ON ITS TAIL (P2, 2026-10-28; roadmap
|
|
557
|
+
* 10-28, lightly held): `(5 more open, kept quietly; recall "still open"
|
|
558
|
+
* lists them) · 41 parked`. A parked thread (untouched `OPEN_CARRY_DAYS`
|
|
559
|
+
* lived days, `identity.ts#openCarry`) is in no lane and not in the "more"
|
|
560
|
+
* count; this says how many there are, after the paren so `countedLanes`
|
|
561
|
+
* reads the count as before, and the handle the tail names lists them,
|
|
562
|
+
* marked. It rides on the lane's own count line — the "more" line, the
|
|
563
|
+
* collapsed one, or the lane's part of the folded line (`foldedLine`).
|
|
564
|
+
*
|
|
565
|
+
* AND A LANE WITH NO COUNT LINE STILL SAYS IT (P2b, 2026-10-28; the brief:
|
|
566
|
+
* parked items are counted, not vanished, and a clean list for a new user in
|
|
567
|
+
* week 3 is its main aim): a lane that lists all it carries gets one short
|
|
568
|
+
* line under its items, `(3 parked; recall "still open" lists them)`, and a
|
|
569
|
+
* wake that carries no open item at all gets the lane as one line, `Still
|
|
570
|
+
* open: nothing current · 3 parked (recall "still open" lists them)`
|
|
571
|
+
* (`parkedLine`). Before this, on day 40 a store with 3 parked items and
|
|
572
|
+
* nothing carried woke with no word of them. Reserved like a lane's count
|
|
573
|
+
* line (`briefing-room.ts#pinnedLines`), never a second count: the lane's own
|
|
574
|
+
* line carries the tail when it has one. Nothing when none is parked.
|
|
575
|
+
* Revert: `parkedTail` returns "" and `parkedLine` null.
|
|
576
|
+
*/
|
|
577
|
+
export const PARKED_WORDS = "parked";
|
|
578
|
+
|
|
579
|
+
/** ` · 41 parked`, or nothing for none. */
|
|
580
|
+
export function parkedTail(parked: number | undefined): string {
|
|
581
|
+
return parked === undefined || !(parked >= 1) ? "" : ` · ${String(Math.floor(parked))} ${PARKED_WORDS}`;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
/** "Still open" carrying nothing, said in its one line (`parkedLine`). */
|
|
585
|
+
export const NOTHING_CURRENT_WORDS = "nothing current";
|
|
586
|
+
|
|
587
|
+
/** Where the parked are listed, as the parked line says it. */
|
|
588
|
+
export const PARKED_HANDLE_WORDS = `recall "${STILL_OPEN_HANDLE}" lists them`;
|
|
589
|
+
|
|
590
|
+
/**
|
|
591
|
+
* "Still open"'s line when the lane has no count line of its own but some
|
|
592
|
+
* are parked (P2b, `PARKED_WORDS`): under the items it lists (`listing`),
|
|
593
|
+
* `(3 parked; recall "still open" lists them)`; with none listed, the lane
|
|
594
|
+
* as one line, `Still open: nothing current · 3 parked (recall "still open"
|
|
595
|
+
* lists them)`, which `collapsedLane` reads as the lane's. Null for none.
|
|
596
|
+
*/
|
|
597
|
+
export function parkedLine(listing: boolean, parked: number | undefined): string | null {
|
|
598
|
+
if (parked === undefined || !(parked >= 1)) return null;
|
|
599
|
+
const n = String(Math.floor(parked));
|
|
600
|
+
return listing
|
|
601
|
+
? `(${n} ${PARKED_WORDS}; ${PARKED_HANDLE_WORDS})`
|
|
602
|
+
: `${laneHeading("threads")} ${NOTHING_CURRENT_WORDS}${parkedTail(parked)} (${PARKED_HANDLE_WORDS})`;
|
|
603
|
+
}
|
|
604
|
+
|
|
553
605
|
/** `(3 more might be relevant; recall ids: mem_…, mem_…, mem_…)`; for "Still
|
|
554
|
-
* open" `(56 more open, kept quietly; …)` (`OPEN_TAIL_WORDS`)
|
|
606
|
+
* open" `(56 more open, kept quietly; …)` (`OPEN_TAIL_WORDS`), and ` · N
|
|
607
|
+
* parked` after it when some are (`parkedTail`); for "Coming up"
|
|
555
608
|
* `(2 overdue, 4 more coming up; recall ids: …)` or `(2 overdue; recall ids: …)`. */
|
|
556
|
-
export function moreLine(lane: LaneName, ids: readonly string[], overdue?: readonly string[]): string {
|
|
557
|
-
if (lane === "threads") return `(${String(ids.length)} more open, ${OPEN_TAIL_WORDS})`;
|
|
609
|
+
export function moreLine(lane: LaneName, ids: readonly string[], overdue?: readonly string[], parked?: number): string {
|
|
610
|
+
if (lane === "threads") return `(${String(ids.length)} more open, ${OPEN_TAIL_WORDS})${parkedTail(parked)}`;
|
|
558
611
|
const late = overdueAmong(lane, ids, overdue);
|
|
559
612
|
if (late === 0) return `(${String(ids.length)} more ${MORE_NOUN[lane]}; ${recallIds(ids)})`;
|
|
560
613
|
const rest = ids.length - late;
|
|
@@ -579,14 +632,16 @@ const FOLD_ORDER: readonly LaneName[] = ["horizon", "threads", "identity", "craf
|
|
|
579
632
|
/** How many ids each folded lane names — fewer than its own line's five. */
|
|
580
633
|
export const FOLD_LINE_IDS = 3;
|
|
581
634
|
|
|
582
|
-
/** `More than this wake lists: 7 coming up (recall ids: mem_…, mem_…, mem_…, and 4 more); 5 might be relevant (recall ids: …)
|
|
583
|
-
|
|
635
|
+
/** `More than this wake lists: 7 coming up (recall ids: mem_…, mem_…, mem_…, and 4 more); 5 might be relevant (recall ids: …)`;
|
|
636
|
+
* "Still open"'s part ends ` · N parked` when some are (`parkedTail`; P2b,
|
|
637
|
+
* 2026-10-28 — the folded line dropped it before). */
|
|
638
|
+
export function foldedLine(lost: Partial<Record<LaneName, readonly string[]>>, parked?: number): string | null {
|
|
584
639
|
const lanes = FOLD_ORDER.filter((l) => (lost[l]?.length ?? 0) > 0);
|
|
585
640
|
if (lanes.length === 0) return null;
|
|
586
641
|
const part = (l: LaneName): string => {
|
|
587
642
|
const ids = lost[l] ?? [];
|
|
588
643
|
const shown = ids.slice(0, FOLD_LINE_IDS);
|
|
589
|
-
return `${String(ids.length)} ${MORE_NOUN[l]} (recall ids: ${shown.join(", ")}${ids.length > shown.length ? `, and ${String(ids.length - shown.length)} more` : ""})`;
|
|
644
|
+
return `${String(ids.length)} ${MORE_NOUN[l]} (recall ids: ${shown.join(", ")}${ids.length > shown.length ? `, and ${String(ids.length - shown.length)} more` : ""})${l === "threads" ? parkedTail(parked) : ""}`;
|
|
590
645
|
};
|
|
591
646
|
return `${FOLDED_WORDS} ${lanes.map(part).join("; ")}`;
|
|
592
647
|
}
|
|
@@ -612,7 +667,10 @@ export function countedLanes(text: string): Partial<Record<LaneName, number>> {
|
|
|
612
667
|
const collapsed = collapsedLane(line);
|
|
613
668
|
if (collapsed !== null) {
|
|
614
669
|
const heading = headingsOf(collapsed).find((h) => line.startsWith(`${h} `)) ?? laneHeading(collapsed);
|
|
615
|
-
|
|
670
|
+
// "Still open: nothing current · 3 parked (…)" (`parkedLine`) counts
|
|
671
|
+
// nothing the lane left out: the parked are not "more".
|
|
672
|
+
const n = /^\D*(\d+) — /.exec(line.slice(heading.length))?.[1];
|
|
673
|
+
if (n !== undefined) out[collapsed] = Number(n);
|
|
616
674
|
continue;
|
|
617
675
|
}
|
|
618
676
|
// "Still open"'s calm tail (2026-10-25): `(96 more open, kept quietly; …)`,
|
|
@@ -680,12 +738,14 @@ export function collapsedLine(lane: LaneName, ids: readonly string[], counted?:
|
|
|
680
738
|
// Those past their date said as such (review of #511): `none due today, 2 overdue`.
|
|
681
739
|
const late = none ? overdueAmong(lane, ids, counted?.horizonOverdue) : 0;
|
|
682
740
|
const why = none ? `${NONE_TODAY_WORDS}${late === 0 ? "" : `, ${String(late)} ${OVERDUE_WORD}`}` : COLLAPSED_WORDS;
|
|
683
|
-
|
|
741
|
+
// "Still open"'s parked, after the ids (P2, `parkedTail`).
|
|
742
|
+
return `${laneHeading(lane)} ${String(ids.length)} — ${why}; ${recallIds(ids)}${lane === "threads" ? parkedTail(counted?.threadsParked) : ""}`;
|
|
684
743
|
}
|
|
685
744
|
|
|
686
745
|
/** What "Coming up" counts rather than lists, as a composition's request
|
|
687
|
-
* carries it (`BriefingRequest.horizonLater`, `.horizonOverdue`)
|
|
688
|
-
|
|
746
|
+
* carries it (`BriefingRequest.horizonLater`, `.horizonOverdue`) — and
|
|
747
|
+
* what "Still open" parked (`.threadsParked`, P2). */
|
|
748
|
+
export type HorizonCounted = Pick<BriefingRequest, "horizonLater" | "horizonOverdue" | "threadsParked">;
|
|
689
749
|
|
|
690
750
|
/** The lane a collapsed line (`collapsedLine`) speaks for, or null for any other line. */
|
|
691
751
|
export function collapsedLane(line: string): LaneName | null {
|
|
@@ -693,6 +753,8 @@ export function collapsedLane(line: string): LaneName | null {
|
|
|
693
753
|
for (const heading of headingsOf(lane)) {
|
|
694
754
|
if (!line.startsWith(`${heading} `)) continue;
|
|
695
755
|
if (new RegExp(`^ \\d+ — (?:${COLLAPSED_WORDS}|${NONE_TODAY_WORDS}(?:, \\d+ ${OVERDUE_WORD})?); recall ids`).test(line.slice(heading.length))) return lane;
|
|
756
|
+
// "Still open" carrying nothing, its parked counted (`parkedLine`, P2b).
|
|
757
|
+
if (lane === "threads" && new RegExp(`^ ${NOTHING_CURRENT_WORDS} · \\d+ ${PARKED_WORDS} `).test(line.slice(heading.length))) return lane;
|
|
696
758
|
}
|
|
697
759
|
}
|
|
698
760
|
return null;
|
|
@@ -947,6 +1009,12 @@ export interface BriefingRequest {
|
|
|
947
1009
|
/** Those of `horizonLater` past their date (review of #511): the line
|
|
948
1010
|
* counts them as overdue. Absent: none said so. */
|
|
949
1011
|
readonly horizonOverdue?: readonly string[];
|
|
1012
|
+
/**
|
|
1013
|
+
* HOW MANY OPEN THREADS ARE PARKED, for this reader (P2, 2026-10-28;
|
|
1014
|
+
* `identity.ts#openCarry`): "Still open"'s count line says it after its
|
|
1015
|
+
* paren (`parkedTail`). Absent or 0: nothing said.
|
|
1016
|
+
*/
|
|
1017
|
+
readonly threadsParked?: number;
|
|
950
1018
|
}
|
|
951
1019
|
|
|
952
1020
|
export interface TrimEvent {
|
|
@@ -1555,7 +1623,9 @@ export function render(
|
|
|
1555
1623
|
// (`Self#composeLanes`), give it nothing. Not a lane: no trim row.
|
|
1556
1624
|
const elsewhereForms = elsewhereFormsOf(req.elsewhere, req.elsewhereShorter);
|
|
1557
1625
|
let elsewhere: string | undefined = elsewhereForms[0];
|
|
1558
|
-
|
|
1626
|
+
// `let`: once the parked count gives way (`hush` below), the rescues
|
|
1627
|
+
// compose without it too.
|
|
1628
|
+
let ctx: RescueCtx = { req, resolve, coreName, identity, head: arrivingHead(lanes.horizon), elsewhereForms };
|
|
1559
1629
|
// "Still open"'s last item left is its first, which outranks the line
|
|
1560
1630
|
// with its count (`openFirst`, as `keepFirstOpen` restores them): the line
|
|
1561
1631
|
// finds room for itself beside both, or steps down, before the trim loop
|
|
@@ -1585,9 +1655,26 @@ export function render(
|
|
|
1585
1655
|
// COUNTERPARTS, 2026-10-12, lightly held).
|
|
1586
1656
|
let fold = false;
|
|
1587
1657
|
let bare = false;
|
|
1658
|
+
// THE PARKED COUNT GIVES WAY FIRST (review of #675, 2026-10-28): "Still
|
|
1659
|
+
// open"'s parked words — its parked line, or ` · N parked` on its count
|
|
1660
|
+
// line or in the folded line — are an aside about what nobody touched in 14
|
|
1661
|
+
// lived days. They take room as the lanes' lines do, but before the loop
|
|
1662
|
+
// pops a "Who I am" item for them, and before a floor goes bare (every lane
|
|
1663
|
+
// untold) for them, they go quiet (`withoutParked`), and the loop composes
|
|
1664
|
+
// without them. `tellLost` still says them when the room turns out to hold
|
|
1665
|
+
// them. Without this, a folded line 12 bytes longer than the room went
|
|
1666
|
+
// bare: "Still open" untold, and the parked unsaid as well.
|
|
1667
|
+
let hushed = false;
|
|
1668
|
+
const lineReq = (): BriefingRequest => (hushed ? withoutParked(req) : req);
|
|
1669
|
+
const parkedIn = (lost: Partial<Record<LaneName, readonly string[]>>): boolean =>
|
|
1670
|
+
!hushed && (req.threadsParked ?? 0) >= 1 && ((lost.threads?.length ?? 0) > 0 || owedParked(lost, kept, req) !== null);
|
|
1671
|
+
const hush = (): void => {
|
|
1672
|
+
hushed = true;
|
|
1673
|
+
ctx = { ...ctx, req: withoutParked(req) };
|
|
1674
|
+
};
|
|
1588
1675
|
const lostNow = (): Partial<Record<LaneName, string[]>> => withoutNearby(lostByLane(lanes.overflow, trimmed, held, suppressList));
|
|
1589
1676
|
const linesFor = (lost: Partial<Record<LaneName, readonly string[]>>, k: Kept, folded: boolean): { more: Partial<Record<LaneName, string>>; fold?: string } =>
|
|
1590
|
-
folded ? foldParts(lost, k,
|
|
1677
|
+
folded ? foldParts(lost, k, lineReq()) : { more: pinnedLines(lost, k, lineReq()) };
|
|
1591
1678
|
|
|
1592
1679
|
for (;;) {
|
|
1593
1680
|
const lost = lostNow();
|
|
@@ -1633,6 +1720,12 @@ export function render(
|
|
|
1633
1720
|
break;
|
|
1634
1721
|
}
|
|
1635
1722
|
}
|
|
1723
|
+
// Not a "Who I am" item for the parked count (review of #675).
|
|
1724
|
+
if (lane === "identity" && parkedIn(lost)) {
|
|
1725
|
+
hush();
|
|
1726
|
+
stepped = true;
|
|
1727
|
+
break;
|
|
1728
|
+
}
|
|
1636
1729
|
const dropped = items.pop();
|
|
1637
1730
|
if (dropped === undefined) continue;
|
|
1638
1731
|
cut = { lane, id: dropped.id, strength: dropped.strength };
|
|
@@ -1644,7 +1737,11 @@ export function render(
|
|
|
1644
1737
|
// `arrivingFirst`: "Work here", the Yesterday line's titles, the
|
|
1645
1738
|
// handoffs' room, "Today, elsewhere", Arriving past its head) — and
|
|
1646
1739
|
// only when even that finds none do the lanes go untold (`bare`).
|
|
1647
|
-
|
|
1740
|
+
// "Still open"'s parked line is a lane's line like these (P2b): it
|
|
1741
|
+
// takes room the same way; when none is found the parked words go
|
|
1742
|
+
// quiet first (`hush`), and the lanes try again without them before
|
|
1743
|
+
// a bare floor goes without all of them.
|
|
1744
|
+
const counting = Object.keys(lost).length > 0 || owedParked(lost, kept, lineReq()) !== null;
|
|
1648
1745
|
if (counting && !fold) {
|
|
1649
1746
|
fold = true;
|
|
1650
1747
|
continue;
|
|
@@ -1653,7 +1750,8 @@ export function render(
|
|
|
1653
1750
|
const from: Rescued = { kept, trimmed: [...trimmed], yesterday, elsewhere, pinned: lost, composed: c, lent: base - req.budgetBytes, fold: true };
|
|
1654
1751
|
const got = takeRoom("arrivingFirst", from, kept, lost, trimmed, ctx, true);
|
|
1655
1752
|
if (got === null) {
|
|
1656
|
-
|
|
1753
|
+
if (parkedIn(lost)) hush();
|
|
1754
|
+
else bare = true;
|
|
1657
1755
|
} else {
|
|
1658
1756
|
for (const l of LANE_ORDER) kept[l] = got.kept[l];
|
|
1659
1757
|
trimmed.splice(0, trimmed.length, ...got.trimmed);
|
|
@@ -1767,6 +1865,7 @@ export function render(
|
|
|
1767
1865
|
const next = tell();
|
|
1768
1866
|
const same =
|
|
1769
1867
|
next.folded === told.folded &&
|
|
1868
|
+
next.parked === told.parked &&
|
|
1770
1869
|
JSON.stringify([next.more, next.untold, next.quiet]) === JSON.stringify([told.more, told.untold, told.quiet]);
|
|
1771
1870
|
if (same && next.composed.bytes <= budgetBytes) told = next;
|
|
1772
1871
|
else kept[lane][0] = top;
|
|
@@ -281,7 +281,7 @@ export function openSettlesCounts(store: Store): { open: number; withSettlesWhen
|
|
|
281
281
|
* WHICH OPEN THREADS ARE STILL CARRIED (2026-10-22, the open-threads brief;
|
|
282
282
|
* the one place the rule lives — the wake's "Still open", built and
|
|
283
283
|
* assembled, the reflection's `staleOpen` and its `noLongerCarried` count
|
|
284
|
-
* all read it). Of the open threads (`openThread`), one with no `eventDate
|
|
284
|
+
* all read it). Of the open threads (`openThread`), one with no `eventDate` still to come,
|
|
285
285
|
* not `asked`, untouched for `days` lived days or more
|
|
286
286
|
* (`SelfTunables.OPEN_CARRY_DAYS`) is NOT carried: the wake shows it in no
|
|
287
287
|
* lane ("Nearby" would read as carried still). It is not closed: the flag
|
|
@@ -291,6 +291,21 @@ export function openSettlesCounts(store: Store): { open: number; withSettlesWhen
|
|
|
291
291
|
* bundle or glimpsed as a footnote writes none of what counts, so being shown
|
|
292
292
|
* cannot keep it carried.
|
|
293
293
|
*
|
|
294
|
+
* PARKED (P2, 2026-10-28; roadmap 10-28, Mike's "ok your lean sounds good",
|
|
295
|
+
* lightly held): what this rule leaves out is what the owner-facing words
|
|
296
|
+
* now call PARKED — after 14 lived days untouched (`OPEN_CARRY_DAYS`, 21
|
|
297
|
+
* until P2), the same lived days "Still open" and `recall "still open"` count
|
|
298
|
+
* age in. An item that names what would settle it (`meta.settlesWhen`, S1) is
|
|
299
|
+
* never parked either: it has its own door, the reflection's `settlesOpen`,
|
|
300
|
+
* which a parked item would leave. The wake's "Still open" tail counts the
|
|
301
|
+
* parked (`briefing.ts#PARKED_WORDS`), the handle lists them after the
|
|
302
|
+
* carried ones, marked, and doctor's Open items line counts them. The rule
|
|
303
|
+
* is read live, at every wake, from the store's own facts — no flag is
|
|
304
|
+
* written — so a touch un-parks at once and a host whose nights never run
|
|
305
|
+
* parks all the same; the night records what it parked on the reflection's
|
|
306
|
+
* row (`detail.notCarried`) and its share says the count. `notCarried` keeps
|
|
307
|
+
* its name: reflection rows written since 10-22 carry it.
|
|
308
|
+
*
|
|
294
309
|
* `touched`: every open thread → the lived day it was last touched;
|
|
295
310
|
* `carried` the ones still carried, in the store's order (oldest born first).
|
|
296
311
|
* Fail-open for the wake: a store that cannot answer leaves all empty, and
|
|
@@ -299,24 +314,37 @@ export function openSettlesCounts(store: Store): { open: number; withSettlesWhen
|
|
|
299
314
|
export interface OpenCarry {
|
|
300
315
|
readonly touched: ReadonlyMap<string, number>;
|
|
301
316
|
readonly carried: readonly string[];
|
|
302
|
-
/** Open threads no longer carried → lived days untouched. */
|
|
317
|
+
/** Open threads no longer carried — parked — → lived days untouched. */
|
|
303
318
|
readonly notCarried: ReadonlyMap<string, number>;
|
|
304
319
|
}
|
|
305
320
|
|
|
306
|
-
/** The rule itself, on one thread's facts (see `openCarry`)
|
|
307
|
-
|
|
308
|
-
|
|
321
|
+
/** The rule itself, on one thread's facts (see `openCarry`): dated, asked or
|
|
322
|
+
* naming what would settle it (`settles`, P2), never parked. */
|
|
323
|
+
export function carriesOpen(
|
|
324
|
+
f: { readonly touchedDay: number; readonly dated: boolean; readonly asked: boolean; readonly settles?: boolean },
|
|
325
|
+
day: number,
|
|
326
|
+
days: number,
|
|
327
|
+
): boolean {
|
|
328
|
+
if (f.dated || f.asked || f.settles === true || !Number.isFinite(days)) return true;
|
|
309
329
|
return day - f.touchedDay < days;
|
|
310
330
|
}
|
|
311
331
|
|
|
312
332
|
/** `glimpses`: `SelfTunables.OPEN_CARRY_GLIMPSE_TOUCH` — true counts an
|
|
313
|
-
* unrated footnote as a touch again (the revert of the 10-22 call).
|
|
314
|
-
|
|
333
|
+
* unrated footnote as a touch again (the revert of the 10-22 call).
|
|
334
|
+
*
|
|
335
|
+
* DATED MEANS STILL TO COME (review of #674, 2026-10-28; the brief: "dated
|
|
336
|
+
* items (eventDate in the future) … probably never parked"): a date is
|
|
337
|
+
* never parked while it is ahead, inside its grace after (the week "Coming
|
|
338
|
+
* up" still says it was due) or repeating. A one-off whose date and grace
|
|
339
|
+
* are behind `at` (the store's own day, `Store#today`, by default) is parked
|
|
340
|
+
* like any open item once untouched for `days` lived days — before this it
|
|
341
|
+
* sat in "Still open" for good, which "Coming up" had already let go. */
|
|
342
|
+
export function openCarry(store: Store, day: number, days: number, glimpses = false, at?: string): OpenCarry {
|
|
315
343
|
const touched = new Map<string, number>();
|
|
316
344
|
const carried: string[] = [];
|
|
317
345
|
const notCarried = new Map<string, number>();
|
|
318
346
|
try {
|
|
319
|
-
for (const f of store.openThreadTouches({ glimpses })) {
|
|
347
|
+
for (const f of store.openThreadTouches({ glimpses, at: at ?? store.today() })) {
|
|
320
348
|
if (!openThread(store, f.id)) continue;
|
|
321
349
|
touched.set(f.id, f.touchedDay);
|
|
322
350
|
if (carriesOpen(f, day, days)) carried.push(f.id);
|
|
@@ -523,6 +551,10 @@ export interface Lanes {
|
|
|
523
551
|
later?: readonly string[];
|
|
524
552
|
/** Those of `later` past their date (review of #511): counted as overdue. */
|
|
525
553
|
overdue?: readonly string[];
|
|
554
|
+
/** How many open threads are parked for this composition's reader (P2,
|
|
555
|
+
* 2026-10-28, `openCarry`): "Still open"'s count line says it. Set by
|
|
556
|
+
* `Self`, not by `rankLanes`. */
|
|
557
|
+
parked?: number;
|
|
526
558
|
}
|
|
527
559
|
|
|
528
560
|
/**
|
package/src/core/self/index.ts
CHANGED
|
@@ -351,6 +351,10 @@ export interface StillOpenItem {
|
|
|
351
351
|
readonly date?: string;
|
|
352
352
|
/** What would settle it, when one was named (`meta.settlesWhen`, S1 2026-10-27). */
|
|
353
353
|
readonly settlesWhen?: string;
|
|
354
|
+
/** Parked (P2, 2026-10-28): untouched `OPEN_CARRY_DAYS` lived days, so in
|
|
355
|
+
* no lane of the wake; not closed, and a touch un-parks it. Listed after
|
|
356
|
+
* every carried item. */
|
|
357
|
+
readonly parked?: true;
|
|
354
358
|
}
|
|
355
359
|
|
|
356
360
|
/** The most characters of a title the `still open` handle gives. */
|
|
@@ -1107,10 +1111,13 @@ export class Self {
|
|
|
1107
1111
|
...supplied.filter((r) => r.due !== true && r.near === true),
|
|
1108
1112
|
...supplied.filter((r) => r.due !== true && r.near !== true),
|
|
1109
1113
|
];
|
|
1114
|
+
// Which open threads are still carried (2026-10-22, `openCarry`), and
|
|
1115
|
+
// how many are parked — counted on "Still open"'s tail (P2, 2026-10-28).
|
|
1116
|
+
const carry = openCarry(this.store, req.day, this.tunables.OPEN_CARRY_DAYS, this.tunables.OPEN_CARRY_GLIMPSE_TOUCH);
|
|
1110
1117
|
const lanes: Lanes = {
|
|
1118
|
+
...(req.omit === undefined && carry.notCarried.size > 0 ? { parked: carry.notCarried.size } : {}),
|
|
1111
1119
|
...rankLanes(scanned, horizon, this.tunables, {
|
|
1112
|
-
|
|
1113
|
-
carry: openCarry(this.store, req.day, this.tunables.OPEN_CARRY_DAYS, this.tunables.OPEN_CARRY_GLIMPSE_TOUCH),
|
|
1120
|
+
carry,
|
|
1114
1121
|
settledOver: settledOver(this.store),
|
|
1115
1122
|
// "Still open"'s unsettled ones rank after the rest (2026-10-18): one
|
|
1116
1123
|
// read of the pairs, for the open candidates only.
|
|
@@ -1173,11 +1180,15 @@ export class Self {
|
|
|
1173
1180
|
* only: no stamp, no return, no seen set — being listed is not a touch
|
|
1174
1181
|
* (`openCarry`), so the handle cannot keep a thread carried.
|
|
1175
1182
|
*
|
|
1183
|
+
* THEN THE PARKED (P2, 2026-10-28): every open thread the carry leaves out,
|
|
1184
|
+
* listed after the carried ones and marked `parked` — not closed, findable
|
|
1185
|
+
* here as well as by what it is about. `parked` counts them.
|
|
1186
|
+
*
|
|
1176
1187
|
* `reader` (O2, 2026-10-26): the folder asking, as the wake assembled there
|
|
1177
1188
|
* reads it — its threads first, the personal ones after, another folder's
|
|
1178
|
-
* work neither listed nor counted
|
|
1189
|
+
* work neither listed nor counted as parked. Absent: every thread.
|
|
1179
1190
|
*/
|
|
1180
|
-
stillOpen(day: number, reader?: ThreadReader): { items: StillOpenItem[];
|
|
1191
|
+
stillOpen(day: number, reader?: ThreadReader): { items: StillOpenItem[]; parked: number } {
|
|
1181
1192
|
const { open, carry } = this.openScanned(day);
|
|
1182
1193
|
const settled = settledOver(this.store);
|
|
1183
1194
|
const place = reader === undefined ? undefined : this.threadPlaceFor(reader);
|
|
@@ -1189,35 +1200,51 @@ export class Self {
|
|
|
1189
1200
|
...(place === undefined ? {} : { threadPlace: place }),
|
|
1190
1201
|
});
|
|
1191
1202
|
const byId = new Map(open.map((s) => [s.id, s] as const));
|
|
1192
|
-
const
|
|
1193
|
-
for (const id of [...lanes.threads.map((r) => r.id), ...(lanes.overflow?.threads ?? [])]) {
|
|
1194
|
-
const s = byId.get(id);
|
|
1195
|
-
if (s === undefined) continue;
|
|
1203
|
+
const item = (s: Scanned, parked: boolean): StillOpenItem => {
|
|
1196
1204
|
const first = s.doc.body.split("\n").find((l) => l.trim().length > 0) ?? "";
|
|
1197
1205
|
const whole = flatten((s.doc.title ?? "").trim() || first);
|
|
1198
1206
|
const title = whole.length <= STILL_OPEN_TITLE_CHARS ? whole : `${whole.slice(0, STILL_OPEN_TITLE_CHARS - 1).trimEnd()}…`;
|
|
1199
|
-
const touched = carry.touched.get(id) ?? Math.max(s.doc.bornDay, s.physics.lastUsedDay);
|
|
1207
|
+
const touched = carry.touched.get(s.id) ?? Math.max(s.doc.bornDay, s.physics.lastUsedDay);
|
|
1200
1208
|
const settles = s.unresolved ? settlesWhenOf(s.doc.meta) : null;
|
|
1201
|
-
|
|
1202
|
-
id,
|
|
1209
|
+
return {
|
|
1210
|
+
id: s.id,
|
|
1203
1211
|
title,
|
|
1204
1212
|
livedDaysSinceTouched: Math.max(0, day - touched),
|
|
1205
1213
|
...(s.reconsidering === true ? { reconsidering: true } : {}),
|
|
1206
1214
|
...(s.doc.eventDate === undefined ? {} : { date: s.doc.eventDate }),
|
|
1207
1215
|
...(settles === null ? {} : { settlesWhen: settles }),
|
|
1208
|
-
|
|
1216
|
+
...(parked ? { parked: true } : {}),
|
|
1217
|
+
};
|
|
1218
|
+
};
|
|
1219
|
+
const out: StillOpenItem[] = [];
|
|
1220
|
+
for (const id of [...lanes.threads.map((r) => r.id), ...(lanes.overflow?.threads ?? [])]) {
|
|
1221
|
+
const s = byId.get(id);
|
|
1222
|
+
if (s !== undefined) out.push(item(s, false));
|
|
1209
1223
|
}
|
|
1210
|
-
//
|
|
1211
|
-
// folder's work is not this
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1224
|
+
// THE PARKED, AFTER THE CARRIED (P2, 2026-10-28): listed and marked, the
|
|
1225
|
+
// most recently touched first; another folder's work is not this
|
|
1226
|
+
// reader's (O2), as the wake's count reads them (`parkedOf`).
|
|
1227
|
+
const parked = this.parkedOf(carry, day, place);
|
|
1228
|
+
for (const s of parked) out.push(item(s, true));
|
|
1229
|
+
return { items: out, parked: parked.length };
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
/**
|
|
1233
|
+
* THE PARKED OPEN THREADS FOR ONE READER (P2, 2026-10-28): what the carry
|
|
1234
|
+
* leaves out (`openCarry`'s `notCarried`), less another folder's work when
|
|
1235
|
+
* a reader's place is given (O2), the most recently touched first, then by
|
|
1236
|
+
* id. One row read each; reads only.
|
|
1237
|
+
*/
|
|
1238
|
+
private parkedOf(carry: OpenCarry, day: number, place?: (s: Scanned) => "here" | "personal" | "out"): Scanned[] {
|
|
1239
|
+
const ids = [...carry.notCarried.entries()].sort((a, b) => a[1] - b[1] || (a[0] < b[0] ? -1 : a[0] > b[0] ? 1 : 0)).map(([id]) => id);
|
|
1240
|
+
const out: Scanned[] = [];
|
|
1241
|
+
for (const id of ids) {
|
|
1242
|
+
const s = scanOne(this.store, id, day);
|
|
1243
|
+
if (s === null || !s.unresolved) continue;
|
|
1244
|
+
if (place !== undefined && place(s) === "out") continue;
|
|
1245
|
+
out.push(s);
|
|
1219
1246
|
}
|
|
1220
|
-
return
|
|
1247
|
+
return out;
|
|
1221
1248
|
}
|
|
1222
1249
|
|
|
1223
1250
|
/**
|
|
@@ -1300,6 +1327,9 @@ export class Self {
|
|
|
1300
1327
|
// reconsidered, which wait on a decision (2026-10-11).
|
|
1301
1328
|
const { open: openRead, carry, flagged } = this.openScanned(day);
|
|
1302
1329
|
const open = openRead.map(note);
|
|
1330
|
+
const place = req.reader === undefined ? undefined : this.threadPlaceFor(req.reader);
|
|
1331
|
+
// How many are parked for this reader (P2, 2026-10-28): its tail says so.
|
|
1332
|
+
const parked = carry.notCarried.size === 0 ? 0 : this.parkedOf(carry, day, place).length;
|
|
1303
1333
|
const fresh = rankLanes(open, horizon, this.tunables, {
|
|
1304
1334
|
carry,
|
|
1305
1335
|
settledOver: settled,
|
|
@@ -1307,7 +1337,7 @@ export class Self {
|
|
|
1307
1337
|
waiting: waitingIds(this.store, day),
|
|
1308
1338
|
workAtDelivery: this.tunables.CRAFT_AT_DELIVERY,
|
|
1309
1339
|
craftSince: craftSince(this.store),
|
|
1310
|
-
...(
|
|
1340
|
+
...(place === undefined ? {} : { threadPlace: place }),
|
|
1311
1341
|
...(coming.more.length === 0 ? {} : { horizonMore: coming.more }),
|
|
1312
1342
|
...(coming.later.length === 0 ? {} : { later: coming.later }),
|
|
1313
1343
|
});
|
|
@@ -1352,6 +1382,7 @@ export class Self {
|
|
|
1352
1382
|
},
|
|
1353
1383
|
...(coming.later.length === 0 ? {} : { later: coming.later }),
|
|
1354
1384
|
...(coming.overdue.length === 0 ? {} : { overdue: coming.overdue }),
|
|
1385
|
+
...(parked === 0 ? {} : { parked }),
|
|
1355
1386
|
};
|
|
1356
1387
|
return this.composeLanes(lanes, docs, sources, {
|
|
1357
1388
|
day,
|
|
@@ -1516,6 +1547,8 @@ export class Self {
|
|
|
1516
1547
|
...(lanes.later === undefined || lanes.later.length === 0 || req.omit !== undefined ? {} : { horizonLater: lanes.later }),
|
|
1517
1548
|
// And which of them are past their date, so it says "overdue" (review of #511).
|
|
1518
1549
|
...(lanes.overdue === undefined || lanes.overdue.length === 0 || req.omit !== undefined ? {} : { horizonOverdue: lanes.overdue }),
|
|
1550
|
+
// How many open threads are parked: "Still open"'s count line says so (P2, 2026-10-28).
|
|
1551
|
+
...(lanes.parked === undefined || lanes.parked === 0 || req.omit !== undefined ? {} : { threadsParked: lanes.parked }),
|
|
1519
1552
|
...(req.elsewhereShorter === undefined || req.elsewhere === undefined || req.omit !== undefined
|
|
1520
1553
|
? {}
|
|
1521
1554
|
: { elsewhereShorter: req.elsewhereShorter }),
|
|
@@ -131,7 +131,9 @@ export interface SelfTunables {
|
|
|
131
131
|
* beside `OPEN_CARRY_DAYS`, `briefing.ts#OPEN_TAIL_WORDS`.) "Untouched" is read as #489 D's `staleOpen`
|
|
132
132
|
* reads it (born or used), but the thresholds differ: the nightly
|
|
133
133
|
* close-offer looks from `REFLECT_TUNABLES.STALE_OPEN_DAYS` (4) and offers
|
|
134
|
-
* at most 5 a night, so it does not count what this counts.
|
|
134
|
+
* at most 5 a night, so it does not count what this counts. Since P2
|
|
135
|
+
* (2026-10-28) parks at the same 14, it orders only what is never parked:
|
|
136
|
+
* a thread that names what would settle it, or is `asked`. CAL.
|
|
135
137
|
*/
|
|
136
138
|
STILL_OPEN_STALE_DAYS: number;
|
|
137
139
|
/**
|
|
@@ -146,6 +148,14 @@ export interface SelfTunables {
|
|
|
146
148
|
* the memory stays in the store (in no lane of the wake), recall shows it, and any touch carries it
|
|
147
149
|
* again (`identity.ts#openCarry`, the one place the rule lives). Revert:
|
|
148
150
|
* very large (`Infinity` carries everything, as before). CAL.
|
|
151
|
+
*
|
|
152
|
+
* PARKED AT 14 (P2, 2026-10-28; roadmap 10-28, Mike agreed the lean,
|
|
153
|
+
* lightly held): 21 until then. What this leaves out is now called PARKED
|
|
154
|
+
* where the owner or a model reads it — the wake's tail counts it (`· N
|
|
155
|
+
* parked`), `recall "still open"` lists it after the carried ones, marked,
|
|
156
|
+
* doctor's Open items line counts it — and an item with a `settlesWhen` is
|
|
157
|
+
* never parked (its door is the reflection's `settlesOpen`). Lived days, as
|
|
158
|
+
* "Still open" counts age. Revert: 21 (or `Infinity`, every item carried).
|
|
149
159
|
*/
|
|
150
160
|
OPEN_CARRY_DAYS: number;
|
|
151
161
|
/**
|
|
@@ -487,7 +497,7 @@ export const SELF_TUNABLES: SelfTunables = {
|
|
|
487
497
|
THREADS_MAX: 5,
|
|
488
498
|
RECONSIDERING_MAX: 1,
|
|
489
499
|
STILL_OPEN_STALE_DAYS: 14,
|
|
490
|
-
OPEN_CARRY_DAYS:
|
|
500
|
+
OPEN_CARRY_DAYS: 14,
|
|
491
501
|
OPEN_CARRY_GLIMPSE_TOUCH: false,
|
|
492
502
|
HINTS_MAX: 8,
|
|
493
503
|
HORIZON_MAX: 6,
|
package/src/core/store/index.ts
CHANGED
|
@@ -5336,9 +5336,10 @@ export class Store {
|
|
|
5336
5336
|
|
|
5337
5337
|
/** The open memories with the lived day each was last TOUCHED (born, used beyond a glimpse,
|
|
5338
5338
|
* revised — never a dream's or a reflection's return) and whether it is
|
|
5339
|
-
* dated
|
|
5340
|
-
*
|
|
5341
|
-
|
|
5339
|
+
* dated, `asked`, or names what would settle it (2026-10-22; `settles`
|
|
5340
|
+
* P2 2026-10-28; `reads-memories.ts#openThreadTouches`): what the parking
|
|
5341
|
+
* rule reads (`self/identity.ts#openCarry`). */
|
|
5342
|
+
openThreadTouches(opts: { glimpses?: boolean; at?: string } = {}): { id: string; touchedDay: number; dated: boolean; asked: boolean; settles: boolean }[] {
|
|
5342
5343
|
return memoryReads.openThreadTouches(this, opts);
|
|
5343
5344
|
}
|
|
5344
5345
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/** `Store`'s reads of memories — a row, its copies and versions, the candidates and lists its readers ask for, the nearest neighbours, the claims era (bodies moved out of `store/index.ts`, 2026-10-11; the class keeps a delegate, and its doc comment, for each). */
|
|
2
|
-
import { calendarOverlaps, compareCalendarDates } from "../time.js";
|
|
2
|
+
import { addDays, calendarOverlaps, compareCalendarDates, isDay, parseCalendarDate } from "../time.js";
|
|
3
3
|
import { LATER_FEELING_SOURCES } from "./feelings.js";
|
|
4
4
|
import { TUNABLES as PHYSICS_TUNABLES } from "../physics/index.js";
|
|
5
5
|
import { StoreError } from "./errors.js";
|
|
6
|
+
import { SETTLES_WHEN_META_KEY } from "../types.js";
|
|
6
7
|
import {
|
|
7
8
|
CLAIMS_ERA_CUTOFF_KEY,
|
|
8
9
|
rowToPhysics,
|
|
@@ -423,18 +424,47 @@ function openTouchedSql(glimpses: boolean): string {
|
|
|
423
424
|
* THE OPEN THREADS AND WHEN EACH WAS LAST TOUCHED (2026-10-22): every live
|
|
424
425
|
* memory the loose `unresolved` match finds (`openThreadIds`'s match,
|
|
425
426
|
* answered by `memories_open`), with the lived day it was last touched
|
|
426
|
-
* (`openTouchedSql`) and the
|
|
427
|
-
* (`self/identity.ts#openCarry`, which also decides which are threads at all)
|
|
427
|
+
* (`openTouchedSql`) and the facts the parking rule reads
|
|
428
|
+
* (`self/identity.ts#openCarry`, which also decides which are threads at all):
|
|
429
|
+
* dated, `asked`, and — since P2 (2026-10-28) — whether it names what would
|
|
430
|
+
* settle it (`meta.settlesWhen` as non-blank text, as `types.ts#settlesWhenOf`
|
|
431
|
+
* reads it). Meta is JSON on the row: no schema change.
|
|
432
|
+
*
|
|
433
|
+
* `at` (review of #674, 2026-10-28): the calendar day asked about. With it,
|
|
434
|
+
* `dated` means a date still to come — ahead of `at`, or inside its grace
|
|
435
|
+
* after (`HOLD_GRACE_DAYS`, the days "Coming up" still says it was due) — or
|
|
436
|
+
* one that repeats. A one-off whose date and grace are behind it is no
|
|
437
|
+
* longer dated here: "Coming up" has let it go, and without this it sat in
|
|
438
|
+
* "Still open" for good, never parked. An unreadable date stays dated.
|
|
439
|
+
* Without `at`, any date is dated, as before.
|
|
428
440
|
*/
|
|
429
|
-
export function openThreadTouches(
|
|
441
|
+
export function openThreadTouches(
|
|
442
|
+
store: Store,
|
|
443
|
+
opts: { glimpses?: boolean; at?: string } = {},
|
|
444
|
+
): { id: string; touchedDay: number; dated: boolean; asked: boolean; settles: boolean }[] {
|
|
445
|
+
const settles = `CASE WHEN json_valid(m.meta) AND json_type(m.meta, '$.${SETTLES_WHEN_META_KEY}') = 'text'
|
|
446
|
+
AND TRIM(json_extract(m.meta, '$.${SETTLES_WHEN_META_KEY}')) <> '' THEN 1 ELSE 0 END`;
|
|
447
|
+
const at = opts.at !== undefined && isDay(opts.at) ? opts.at : null;
|
|
448
|
+
const behind = (date: string): boolean => {
|
|
449
|
+
if (at === null) return false;
|
|
450
|
+
const c = parseCalendarDate(date);
|
|
451
|
+
return c !== null && addDays(c.last, PHYSICS_TUNABLES.HOLD_GRACE_DAYS) < at;
|
|
452
|
+
};
|
|
430
453
|
return store["ops"]
|
|
431
|
-
.all<{ id: string; touched: number; event_date: string | null; status: string | null }>(
|
|
432
|
-
`SELECT m.id AS id, m.event_date AS event_date, m.status AS status, ${openTouchedSql(opts.glimpses === true)} AS touched
|
|
454
|
+
.all<{ id: string; touched: number; event_date: string | null; status: string | null; settles: number; recurring: number }>(
|
|
455
|
+
`SELECT m.id AS id, m.event_date AS event_date, m.status AS status, ${openTouchedSql(opts.glimpses === true)} AS touched,
|
|
456
|
+
${settles} AS settles, CASE WHEN m.meta LIKE '%"${RECURRING_META}":"%' THEN 1 ELSE 0 END AS recurring
|
|
433
457
|
FROM memories m
|
|
434
458
|
WHERE m.type = 'memory' AND m.archived = 0 AND m.meta LIKE '%"unresolved":true%'
|
|
435
459
|
ORDER BY m.birth_day, m.id`,
|
|
436
460
|
)
|
|
437
|
-
.map((r) => ({
|
|
461
|
+
.map((r) => ({
|
|
462
|
+
id: r.id,
|
|
463
|
+
touchedDay: r.touched,
|
|
464
|
+
dated: r.event_date !== null && (r.recurring === 1 || !behind(r.event_date)),
|
|
465
|
+
asked: r.status === "asked",
|
|
466
|
+
settles: r.settles === 1,
|
|
467
|
+
}));
|
|
438
468
|
}
|
|
439
469
|
|
|
440
470
|
/**
|