open-memex 0.10.0-alpha.3 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +15 -3
- package/CHANGELOG.md +4 -2
- package/README.md +49 -2
- package/README.zh-CN.md +26 -2
- package/dist/.build-stamp +1 -1
- package/dist/capture/handoff.js +22 -1
- package/dist/capture/length.js +26 -0
- package/dist/cli.js +8 -2
- package/dist/mcp.js +7 -0
- package/dist/plugin-core.js +61 -21
- package/dist/submit.js +45 -15
- package/dist/tools/ops.js +8 -0
- package/docs/V2-DESIGN.md +1 -1
- package/docs/design/decisions.md +6 -3
- package/package.json +1 -1
- package/scripts/curate-eval.ts +399 -376
- package/scripts/smoke-pure.ts +24 -0
- package/scripts/token-cost.ts +142 -0
- package/server.json +2 -2
- package/skills/open-memex/SKILL.md +16 -0
- package/src/capture/handoff.ts +39 -2
- package/src/capture/length.ts +29 -0
- package/src/cli.ts +8 -3
- package/src/curate.ts +236 -236
- package/src/graph/lint.ts +1 -1
- package/src/mcp.ts +7 -0
- package/src/plugin-core.ts +65 -15
- package/src/submit.ts +240 -212
- package/src/tools/ops.ts +7 -0
package/scripts/smoke-pure.ts
CHANGED
|
@@ -35,7 +35,9 @@ import {
|
|
|
35
35
|
isTurnEcho,
|
|
36
36
|
freshCaptures,
|
|
37
37
|
formatHandoffBlock,
|
|
38
|
+
formatCaptureDropBlock,
|
|
38
39
|
} from "../src/capture/handoff.ts";
|
|
40
|
+
import { LENGTH_NUDGE_CHARS, lengthNudge } from "../src/capture/length.ts";
|
|
39
41
|
import { userMcpConfigPath, mergeServerEntry, detectInstalledClients, mergePluginEntry, mergeV2PluginEntry, removeV2PluginEntry, opencodeGlobalConfigPath, printManualEntryHint, parseJsonConfig, removeServerEntry, removePluginEntry, removeInstructionsSection, LEGACY_PACKAGE_NAME, shouldInstallSkill } from "../src/init.ts";
|
|
40
42
|
import { z } from "zod";
|
|
41
43
|
import { memoryAddArgs } from "../src/tools/ops.ts";
|
|
@@ -716,6 +718,28 @@ ok(
|
|
|
716
718
|
);
|
|
717
719
|
ok("window is 10 minutes", TURN_ECHO_WINDOW_MS === 10 * 60 * 1000);
|
|
718
720
|
|
|
721
|
+
console.log("== capture length nudge (D94) ==");
|
|
722
|
+
// Threshold logic is pure and inclusive-boundary: 500 chars = no hint, 501 = hint.
|
|
723
|
+
ok("threshold is 500", LENGTH_NUDGE_CHARS === 500);
|
|
724
|
+
ok("empty body → no nudge", lengthNudge("") === null);
|
|
725
|
+
ok("at threshold → no nudge", lengthNudge("a".repeat(500)) === null);
|
|
726
|
+
ok("one over threshold → nudge", lengthNudge("a".repeat(501)) !== null);
|
|
727
|
+
const nudge = lengthNudge("a".repeat(1234))!;
|
|
728
|
+
ok("nudge reports the length", nudge.includes("1234"));
|
|
729
|
+
ok("nudge says the save happened", nudge.includes("saved fine"));
|
|
730
|
+
ok("nudge is a hint, not a refusal", !nudge.includes("Not saved") && nudge.includes("saved fine"));
|
|
731
|
+
|
|
732
|
+
console.log("== over-cap drop hand-off note (D94) ==");
|
|
733
|
+
ok("no drops → no block", formatCaptureDropBlock([]) === "");
|
|
734
|
+
const drop = { content: "a".repeat(2500), at: now };
|
|
735
|
+
const dropBlock = formatCaptureDropBlock([drop]);
|
|
736
|
+
ok("drop block reports the cap", dropBlock.includes("2000"));
|
|
737
|
+
ok("drop block reports the length", dropBlock.includes("2500"));
|
|
738
|
+
ok("drop block previews the content", dropBlock.includes("aaaa"));
|
|
739
|
+
ok("drop block points at memory_add", dropBlock.includes("memory_add"));
|
|
740
|
+
ok("drop block never truncates into a memory claim", dropBlock.includes("never truncated"));
|
|
741
|
+
ok("multiple drops listed", formatCaptureDropBlock([drop, { ...drop, content: "b".repeat(2100) }]).split("\n- ").length === 3);
|
|
742
|
+
|
|
719
743
|
console.log("== init --global: userMcpConfigPath / mergeServerEntry ==");
|
|
720
744
|
// D45: user-level MCP config locations, per platform (platform param is injectable).
|
|
721
745
|
ok("vscode win32", userMcpConfigPath("vscode", "win32").endsWith(path.join("Code", "User", "mcp.json")));
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Token cost as spec (D94, OptMem small item 1): measure open-memex's
|
|
3
|
+
* prompt/token overhead instead of asserting it.
|
|
4
|
+
*
|
|
5
|
+
* Two surfaces are measured separately, then summed:
|
|
6
|
+
* (a) the session-start injection block - `buildContextBlock`'s real output
|
|
7
|
+
* on a scratch fixture store (8 project memories + 5 personal +
|
|
8
|
+
* the compiled graph outline, i.e. the default-shape block every
|
|
9
|
+
* opencode session starts with);
|
|
10
|
+
* (b) all MCP tool descriptions - `TOOL_DESCRIPTIONS`' actual text, what
|
|
11
|
+
* an MCP client pays once per session at handshake.
|
|
12
|
+
*
|
|
13
|
+
* Method (also printed in the output): characters counted on the exact
|
|
14
|
+
* strings, tokens estimated as characters / 4. That is the usual rough
|
|
15
|
+
* ratio for English prose; it is an estimate, not a tokenizer count - no
|
|
16
|
+
* tokenizer dependency is added on purpose (D94). The README quotes these
|
|
17
|
+
* numbers as approximations ("约数"); re-run this script and update the
|
|
18
|
+
* README whenever the fixture or the block shape changes - never hand-edit
|
|
19
|
+
* the numbers.
|
|
20
|
+
*
|
|
21
|
+
* Usage: node --experimental-strip-types scripts/token-cost.ts
|
|
22
|
+
*/
|
|
23
|
+
import fs from "node:fs";
|
|
24
|
+
import os from "node:os";
|
|
25
|
+
import path from "node:path";
|
|
26
|
+
|
|
27
|
+
const HOME = fs.mkdtempSync(path.join(os.tmpdir(), "token-cost-"));
|
|
28
|
+
process.env.OPEN_MEMEX_HOME = HOME;
|
|
29
|
+
|
|
30
|
+
import { buildContextBlock } from "../src/retrieve/inject.ts";
|
|
31
|
+
import { TOOL_DESCRIPTIONS } from "../src/tools/ops.ts";
|
|
32
|
+
import { DEFAULT_CONFIG, type MyOMemoryConfig } from "../src/config.ts";
|
|
33
|
+
import type { Scope } from "../src/scope.ts";
|
|
34
|
+
import {
|
|
35
|
+
writeMemoryFile,
|
|
36
|
+
ulid,
|
|
37
|
+
msToRfc3339,
|
|
38
|
+
type Frontmatter,
|
|
39
|
+
} from "../src/store/markdown.ts";
|
|
40
|
+
import { syncScope } from "../src/store/sync.ts";
|
|
41
|
+
import { PERSONAL_SCOPE } from "../src/scope.ts";
|
|
42
|
+
|
|
43
|
+
/** Same shape/size as a real default session: 8 project + 5 personal. */
|
|
44
|
+
const FIXTURE_SCOPE: Scope = {
|
|
45
|
+
key: "project__token-cost-fixture__000000000000",
|
|
46
|
+
kind: "project",
|
|
47
|
+
projectName: "token-cost-fixture",
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const now = msToRfc3339(Date.now());
|
|
51
|
+
|
|
52
|
+
function fmFor(scopeKey: string, kind: "project" | "personal", type: string, tags: string[]): Frontmatter {
|
|
53
|
+
return {
|
|
54
|
+
id: ulid(),
|
|
55
|
+
schema_version: 2,
|
|
56
|
+
scope_key: scopeKey,
|
|
57
|
+
scope: kind,
|
|
58
|
+
visibility: kind === "project" ? "internal" : "private",
|
|
59
|
+
project_name: kind === "project" ? FIXTURE_SCOPE.projectName : "personal",
|
|
60
|
+
type,
|
|
61
|
+
role: "knowledge",
|
|
62
|
+
importance: "normal",
|
|
63
|
+
status: "active",
|
|
64
|
+
tags,
|
|
65
|
+
source: "token-cost fixture",
|
|
66
|
+
created_at: now,
|
|
67
|
+
updated_at: now,
|
|
68
|
+
supersedes: null,
|
|
69
|
+
superseded_by: null,
|
|
70
|
+
review_state: kind === "project" ? "published" : "draft",
|
|
71
|
+
proposed_by: null,
|
|
72
|
+
approved_by: kind === "project" ? "fixture" : null,
|
|
73
|
+
derived_from: null,
|
|
74
|
+
review_note: null,
|
|
75
|
+
review_history: [],
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const PROJECT_MEMORIES: Array<{ body: string; type: string; tags: string[] }> = [
|
|
80
|
+
{ body: "We deploy on Fridays; the release train leaves at 10:00 and the freeze window starts at 09:00.", type: "decision", tags: ["deploy", "release", "git"] },
|
|
81
|
+
{ body: "All PRs go dev/<topic> -> main; the V2 integration branch was retired 2026-09-29.", type: "decision", tags: ["git", "release", "typescript"] },
|
|
82
|
+
{ body: "Markdown files are the source of truth; index.db is a rebuildable search accelerator.", type: "constraint", tags: ["storage", "architecture", "typescript"] },
|
|
83
|
+
{ body: "Every memory-file write goes through atomicWriteTextSync - a torn read mid-rewrite parses as a deletion.", type: "constraint", tags: ["storage", "architecture", "reliability"] },
|
|
84
|
+
{ body: "Import paths must use explicit .ts extensions; moduleResolution is Bundler with allowImportingTsExtensions.", type: "howto", tags: ["build", "typescript", "architecture"] },
|
|
85
|
+
{ body: "Never import better-sqlite3 or bun:sqlite directly outside src/store/db.ts - the backend is chosen at runtime.", type: "gotcha", tags: ["architecture", "sqlite", "build"] },
|
|
86
|
+
{ body: "The Node floor is 22.14 (better-sqlite3 13 needs Node-API 10); never lower engines.node back to 22.6.", type: "constraint", tags: ["sqlite", "build", "windows"] },
|
|
87
|
+
{ body: "Windows is a first-class target: use node:path, never hardcode /, and keep temp files under the OS temp dir.", type: "gotcha", tags: ["windows", "typescript", "build"] },
|
|
88
|
+
];
|
|
89
|
+
|
|
90
|
+
const PERSONAL_MEMORIES: string[] = [
|
|
91
|
+
"I prefer concise diffs over verbose explanations.",
|
|
92
|
+
"My standup notes go into the team wiki, not chat.",
|
|
93
|
+
"Public holidays are listed in the HR portal.",
|
|
94
|
+
"I read Chinese faster than English - summarize in Chinese when both work.",
|
|
95
|
+
"Do not schedule meetings before 10:00.",
|
|
96
|
+
];
|
|
97
|
+
|
|
98
|
+
// --- seed ---
|
|
99
|
+
const cfg: MyOMemoryConfig = DEFAULT_CONFIG;
|
|
100
|
+
for (const m of PROJECT_MEMORIES) {
|
|
101
|
+
writeMemoryFile(fmFor(FIXTURE_SCOPE.key, "project", m.type, m.tags), m.body);
|
|
102
|
+
}
|
|
103
|
+
for (const body of PERSONAL_MEMORIES) {
|
|
104
|
+
writeMemoryFile(fmFor(PERSONAL_SCOPE.key, "personal", "preference", []), body);
|
|
105
|
+
}
|
|
106
|
+
syncScope(FIXTURE_SCOPE.key);
|
|
107
|
+
syncScope(PERSONAL_SCOPE.key);
|
|
108
|
+
|
|
109
|
+
// --- measure ---
|
|
110
|
+
const block = buildContextBlock(FIXTURE_SCOPE, cfg);
|
|
111
|
+
if (!block) throw new Error("fixture produced an empty context block - fix the fixture");
|
|
112
|
+
|
|
113
|
+
const toolText = Object.values(TOOL_DESCRIPTIONS).join("\n");
|
|
114
|
+
|
|
115
|
+
// Method: chars on the exact strings; tokens estimated as chars / 4
|
|
116
|
+
// (rough English-prose ratio - deliberately no tokenizer dependency).
|
|
117
|
+
function estimate(label: string, text: string): { chars: number; tokens: number } {
|
|
118
|
+
const chars = text.length;
|
|
119
|
+
const tokens = Math.round(chars / 4);
|
|
120
|
+
return { chars, tokens };
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const a = estimate("injection block", block);
|
|
124
|
+
const b = estimate("tool descriptions", toolText);
|
|
125
|
+
const totalChars = a.chars + b.chars;
|
|
126
|
+
const totalTokens = a.tokens + b.tokens;
|
|
127
|
+
|
|
128
|
+
console.log("open-memex token cost (D94, OptMem small item 1)");
|
|
129
|
+
console.log(`method: exact string character counts; tokens = chars / 4 (rough estimate, no tokenizer)`);
|
|
130
|
+
console.log(`fixture: ${PROJECT_MEMORIES.length} project + ${PERSONAL_MEMORIES.length} personal memories + graph outline, default config`);
|
|
131
|
+
console.log("");
|
|
132
|
+
console.log(`(a) session-start injection block : ${a.chars} chars ~ ${a.tokens} tokens (once per session, not per turn)`);
|
|
133
|
+
console.log(`(b) MCP tool descriptions (13) : ${b.chars} chars ~ ${b.tokens} tokens (once per session at handshake)`);
|
|
134
|
+
console.log(`total : ${totalChars} chars ~ ${totalTokens} tokens`);
|
|
135
|
+
console.log("");
|
|
136
|
+
console.log("The block text measured:");
|
|
137
|
+
console.log("---");
|
|
138
|
+
console.log(block);
|
|
139
|
+
console.log("---");
|
|
140
|
+
// The scratch store's SQLite file is held open by the better-sqlite3
|
|
141
|
+
// connection until process exit, so rmSync fails with EPERM on Windows -
|
|
142
|
+
// leave the scratch dir to the OS temp cleaner instead of failing the run.
|
package/server.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "io.github.stoneskin/open-memex",
|
|
4
4
|
"title": "open-memex",
|
|
5
5
|
"description": "Local-first memory for AI coding agents — Markdown + SQLite FTS5, shared across editors via MCP.",
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.10.0",
|
|
7
7
|
"repository": {
|
|
8
8
|
"url": "https://github.com/stoneskin/open-memex",
|
|
9
9
|
"source": "github"
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
{
|
|
14
14
|
"registryType": "npm",
|
|
15
15
|
"identifier": "open-memex",
|
|
16
|
-
"version": "0.
|
|
16
|
+
"version": "0.10.0",
|
|
17
17
|
"runtimeHint": "npx",
|
|
18
18
|
"packageArguments": [
|
|
19
19
|
{
|
|
@@ -12,6 +12,22 @@ If `open-memex` MCP tools (`memory_add`, `memory_search`, …) are available in
|
|
|
12
12
|
this session, prefer them. Otherwise use the CLI below. If `open-memex` is not
|
|
13
13
|
on PATH, prefix commands with `npx -y open-memex@latest`.
|
|
14
14
|
|
|
15
|
+
## Session start - the wake ritual
|
|
16
|
+
|
|
17
|
+
Start the session from what memory already holds, not from questions to the
|
|
18
|
+
user:
|
|
19
|
+
|
|
20
|
+
- Read the `[OPEN-MEMEX]` block injected at session start (opencode plugin) or
|
|
21
|
+
the equivalent guidance in the MCP handshake instructions. It carries the top
|
|
22
|
+
project memories, the user's preferences, the working-state note from a
|
|
23
|
+
previous session (if any), and the compiled memory map.
|
|
24
|
+
- If the block is empty or doesn't cover the current task, call `memory_search`
|
|
25
|
+
once with the task's keywords - try 2-3 phrasings and check both scopes -
|
|
26
|
+
before concluding anything is missing.
|
|
27
|
+
- Do not ask the user to re-explain what memory already holds; repeated
|
|
28
|
+
"didn't we decide X?" questions are the failure open-memex exists to prevent.
|
|
29
|
+
Ask only about what neither the block nor search can answer.
|
|
30
|
+
|
|
15
31
|
## Save — be proactive
|
|
16
32
|
|
|
17
33
|
When the user shares something worth remembering — a fact, preference,
|
package/src/capture/handoff.ts
CHANGED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
* Pure module: no db, no fs, no config, so the threshold behavior is testable
|
|
18
18
|
* in scripts/smoke-pure.ts.
|
|
19
19
|
*/
|
|
20
|
+
import { MAX_CAPTURE_CHARS } from "./keywords.ts";
|
|
20
21
|
|
|
21
22
|
/**
|
|
22
23
|
* Overlap bar for refusing a re-save of a just-captured user statement.
|
|
@@ -37,7 +38,7 @@ export const TURN_ECHO_THRESHOLD = 0.28;
|
|
|
37
38
|
/** How long a hook capture counts as "this turn" (10 minutes). */
|
|
38
39
|
export const TURN_ECHO_WINDOW_MS = 10 * 60 * 1000;
|
|
39
40
|
|
|
40
|
-
/** One hook capture, in memory only
|
|
41
|
+
/** One hook capture, in memory only - never persisted (like `injectedSessions`). */
|
|
41
42
|
export interface CaptureRecord {
|
|
42
43
|
id: string;
|
|
43
44
|
scopeKey: string;
|
|
@@ -47,6 +48,22 @@ export interface CaptureRecord {
|
|
|
47
48
|
delivered?: boolean;
|
|
48
49
|
}
|
|
49
50
|
|
|
51
|
+
/**
|
|
52
|
+
* D94: one over-cap keyword drop, in memory only. Only `too-long` drops
|
|
53
|
+
* surface here - a `too-short` match is noise (a trigger that yields "OK"
|
|
54
|
+
* is not a memory, D67), but an over-2000-char match can carry real
|
|
55
|
+
* content the agent is otherwise never told about: the capture proceeds
|
|
56
|
+
* with no agent in the loop, so without this note the sentence silently
|
|
57
|
+
* vanishes. Debug logging (keywords.ts) is unchanged; this is the
|
|
58
|
+
* upgrade from log to the agent's face.
|
|
59
|
+
*/
|
|
60
|
+
export interface CaptureDropRecord {
|
|
61
|
+
content: string;
|
|
62
|
+
at: number;
|
|
63
|
+
/** The note has already been pushed for this drop. */
|
|
64
|
+
delivered?: boolean;
|
|
65
|
+
}
|
|
66
|
+
|
|
50
67
|
export function isTurnEcho(score: number): boolean {
|
|
51
68
|
return score >= TURN_ECHO_THRESHOLD;
|
|
52
69
|
}
|
|
@@ -68,7 +85,27 @@ export function formatHandoffBlock(records: CaptureRecord[]): string {
|
|
|
68
85
|
return [
|
|
69
86
|
"[open-memex] The user's own wording in this turn was ALREADY stored verbatim, before you saw it. It is not unsaved.",
|
|
70
87
|
...lines,
|
|
71
|
-
"Do not call memory_add to save that text again in any rewording
|
|
88
|
+
"Do not call memory_add to save that text again in any rewording - one statement is already one memory, and a rewording only adds a second copy that retrieval will return alongside the first.",
|
|
72
89
|
"Save a memory only for information those lines do NOT contain, as its own self-contained statement. If your version is meant to replace one of them, call memory_supersede with that id instead of memory_add.",
|
|
73
90
|
].join("\n");
|
|
74
91
|
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* D94: the over-cap drop note. Tells the agent a keyword match was dropped
|
|
95
|
+
* for exceeding MAX_CAPTURE_CHARS (imported, not hardcoded) so it can
|
|
96
|
+
* re-save a shortened version. Empty string when there is nothing to
|
|
97
|
+
* report; never mentions too-short drops.
|
|
98
|
+
*/
|
|
99
|
+
export function formatCaptureDropBlock(drops: CaptureDropRecord[]): string {
|
|
100
|
+
if (drops.length === 0) return "";
|
|
101
|
+
const lines = drops.map((d) => {
|
|
102
|
+
const one = d.content.replace(/\s+/g, " ").trim();
|
|
103
|
+
const preview = one.length > 120 ? `${one.slice(0, 120)}...` : one;
|
|
104
|
+
return `- "${preview}" (${d.content.length} chars)`;
|
|
105
|
+
});
|
|
106
|
+
return [
|
|
107
|
+
`[open-memex] A keyword capture in this turn matched but was NOT saved: the body is over the ${MAX_CAPTURE_CHARS}-character hard cap, so it was dropped.`,
|
|
108
|
+
...lines,
|
|
109
|
+
"Long matches are never truncated into a memory - the cap is unchanged. If any of the dropped text is worth keeping, save a shortened, self-contained version with memory_add.",
|
|
110
|
+
].join("\n");
|
|
111
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capture length nudge (D94, OptMem small item 3): a soft length hint at
|
|
3
|
+
* capture time. Inspired by OptMem's 280-byte hard cap, but deliberately
|
|
4
|
+
* softer: a long body is saved normally and the caller just gets a hint
|
|
5
|
+
* appended to the result. Nothing is ever refused for length - the only
|
|
6
|
+
* hard ceiling is the keyword-capture `MAX_CAPTURE_CHARS` (2000, D67),
|
|
7
|
+
* which stays untouched.
|
|
8
|
+
*
|
|
9
|
+
* Pure module: no db, no fs, no config, so the threshold behavior is
|
|
10
|
+
* testable in scripts/smoke-pure.ts.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/** Over this many characters a save proceeds but its result carries a hint. */
|
|
14
|
+
export const LENGTH_NUDGE_CHARS = 500;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* One-line hint appended to the save result when the body is long.
|
|
18
|
+
* Returns null at or under the threshold - the boundary is inclusive:
|
|
19
|
+
* 500 chars = no hint, 501 = hint. The wording says the save happened, so
|
|
20
|
+
* an agent reading only the hint never mistakes it for a refusal.
|
|
21
|
+
*/
|
|
22
|
+
export function lengthNudge(content: string): string | null {
|
|
23
|
+
if (content.length <= LENGTH_NUDGE_CHARS) return null;
|
|
24
|
+
return (
|
|
25
|
+
`Note: this memory is ${content.length} characters, over the ${LENGTH_NUDGE_CHARS}-character soft limit. ` +
|
|
26
|
+
`It saved fine - nothing was refused. Short, self-contained statements retrieve better; ` +
|
|
27
|
+
`consider replacing it with a tighter version (supersede) if one exists.`
|
|
28
|
+
);
|
|
29
|
+
}
|
package/src/cli.ts
CHANGED
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
import { loadConfig, configSource } from "./config.ts";
|
|
26
26
|
import { paths, projectRoot, isInRepoMemoryFile } from "./paths.ts";
|
|
27
27
|
import { redact } from "./redact.ts";
|
|
28
|
+
import { lengthNudge } from "./capture/length.ts";
|
|
28
29
|
import { readWorkingState, clearWorkingState, workingStatePath } from "./working-state.ts";
|
|
29
30
|
import { refreshGraph, refreshGraphQuiet, ensureGraph, loadGraphEdges, loadGraphNodes, loadAllMemoryIds } from "./store/graph.ts";
|
|
30
31
|
import { graphNeighbours, shortestPath } from "./graph/queries.ts";
|
|
@@ -344,8 +345,9 @@ Example:
|
|
|
344
345
|
curate: `Undo one deterministic curation action applied by submit.
|
|
345
346
|
|
|
346
347
|
Every action is recorded in the memory file's review_history, so undo works
|
|
347
|
-
across branches and machines.
|
|
348
|
-
|
|
348
|
+
across branches and machines. Only the most recent curation action on an id is
|
|
349
|
+
undoable: an undo appends its own receipt, so a second run refuses. Inspect the
|
|
350
|
+
file's review_history for the older trail.
|
|
349
351
|
|
|
350
352
|
Usage: open-memex curate undo <id>
|
|
351
353
|
|
|
@@ -1436,6 +1438,9 @@ async function main() {
|
|
|
1436
1438
|
`warning: similar memory exists (score ${n.score.toFixed(2)}): id=${n.id}\n ${n.snippet}\n use \`open-memex supersede ${n.id} "new content"\` if this replaces it.`,
|
|
1437
1439
|
);
|
|
1438
1440
|
}
|
|
1441
|
+
// D94: soft length hint - the save already happened; this is advisory only.
|
|
1442
|
+
const nudge = lengthNudge(red);
|
|
1443
|
+
if (nudge) console.log(nudge);
|
|
1439
1444
|
return;
|
|
1440
1445
|
}
|
|
1441
1446
|
|
|
@@ -1975,7 +1980,7 @@ function positionalArgs(argv: string[], booleans: ReadonlySet<string> = new Set(
|
|
|
1975
1980
|
for (const w of c.warnings) console.log(` curation note: ${w}`);
|
|
1976
1981
|
for (const s of r.submitted) {
|
|
1977
1982
|
console.log(`submitted ${s.id} → ${path.relative(process.cwd(), s.filePath)} [${s.reviewState}]`);
|
|
1978
|
-
}
|
|
1983
|
+
}
|
|
1979
1984
|
for (const id of r.skippedIdentical) {
|
|
1980
1985
|
console.log(`already on branch: ${id} (identical content — outbox copy removed)`);
|
|
1981
1986
|
}
|