opencode-self-improvement 0.15.36 → 0.15.37
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/package.json +1 -1
- package/src/inject/digest.ts +6 -1
- package/src/inject/epochs.ts +4 -1
- package/src/tools/consolidate.ts +4 -1
- package/src/tools/decay.ts +8 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-self-improvement",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.37",
|
|
4
4
|
"description": "Durable memory for opencode: remember facts, decisions, and commands across sessions, plus a one-command per-repo setup (/repo-init).",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"exports": {
|
package/src/inject/digest.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { loadAll } from "../store/files/load.ts";
|
|
|
3
3
|
import { type Memory } from "../store/model/memory.ts";
|
|
4
4
|
import { isInjectable } from "../store/model/predicates.ts";
|
|
5
5
|
import { readerFromSid, visibleTo } from "../store/model/visibility.ts";
|
|
6
|
-
import { record } from "../evidence/record.ts";
|
|
6
|
+
import { captureEvidenceContext, record } from "../evidence/record.ts";
|
|
7
7
|
import { frontierBudget } from "../core/config/budgets.ts";
|
|
8
8
|
import { SESSION_CAP, SessionLru } from "../core/lru.ts";
|
|
9
9
|
import { dateStr } from "../core/time.ts";
|
|
@@ -45,6 +45,9 @@ export async function systemDigest(
|
|
|
45
45
|
typeof (_input as Record<string, unknown>).sessionID === "string"
|
|
46
46
|
? String((_input as Record<string, unknown>).sessionID)
|
|
47
47
|
: "?";
|
|
48
|
+
// Snapshot before any awaits; unresolved callers still need a private sid
|
|
49
|
+
// on their evidence even when ordinary call metadata is suppressed (#297).
|
|
50
|
+
const evidenceContext = captureEvidenceContext(sid);
|
|
48
51
|
// Repo-scoped: model-facing reads see the CALLER's repo + global rows, via
|
|
49
52
|
// the sid carried on this flow's input (#127) — never a global re-read
|
|
50
53
|
// after the loadAll await.
|
|
@@ -101,5 +104,7 @@ export async function systemDigest(
|
|
|
101
104
|
ts_since: dateStr(),
|
|
102
105
|
},
|
|
103
106
|
false,
|
|
107
|
+
sid,
|
|
108
|
+
evidenceContext,
|
|
104
109
|
);
|
|
105
110
|
}
|
package/src/inject/epochs.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { type Memory } from "../store/model/memory.ts";
|
|
|
5
5
|
import { isInjectable } from "../store/model/predicates.ts";
|
|
6
6
|
import { isVisibleTo, readerFromSid } from "../store/model/visibility.ts";
|
|
7
7
|
import { SESSION_CAP, SessionLru } from "../core/lru.ts";
|
|
8
|
-
import { record } from "../evidence/record.ts";
|
|
8
|
+
import { captureEvidenceContext, record } from "../evidence/record.ts";
|
|
9
9
|
import { capToBudget, injectedRows } from "./budget.ts";
|
|
10
10
|
import { systemDigest } from "./digest.ts";
|
|
11
11
|
import { storeVersion } from "./version.ts";
|
|
@@ -186,6 +186,7 @@ export function createInjectionEpochs({
|
|
|
186
186
|
};
|
|
187
187
|
const refreshEpoch = async (sid: string, rows?: Memory[]): Promise<void> => {
|
|
188
188
|
if (!latestPrompt.has(sid)) return;
|
|
189
|
+
const evidenceContext = captureEvidenceContext(sid);
|
|
189
190
|
const mems = rows ?? (await injectableRows(sid));
|
|
190
191
|
const version = await storeVersion(mems);
|
|
191
192
|
const cached = epoch.get(sid);
|
|
@@ -259,6 +260,8 @@ export function createInjectionEpochs({
|
|
|
259
260
|
chars: built.block.length,
|
|
260
261
|
},
|
|
261
262
|
false,
|
|
263
|
+
sid,
|
|
264
|
+
evidenceContext,
|
|
262
265
|
);
|
|
263
266
|
epochRecomputes++;
|
|
264
267
|
// Ledger: a store_changed recompute of a live epoch is an
|
package/src/tools/consolidate.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import type { ToolRegister } from "./deps.ts";
|
|
5
5
|
import { proposeConsolidations } from "../consolidate/propose.ts";
|
|
6
6
|
import { renderProposals } from "../consolidate/render.ts";
|
|
7
|
-
import { record } from "../evidence/record.ts";
|
|
7
|
+
import { captureEvidenceContext, record } from "../evidence/record.ts";
|
|
8
8
|
import { readLedger, readReads } from "../hits/ledger.ts";
|
|
9
9
|
import { loadAll } from "../store/files/load.ts";
|
|
10
10
|
import { isInjectable } from "../store/model/predicates.ts";
|
|
@@ -21,6 +21,7 @@ export const register: ToolRegister = (editor, deps) => {
|
|
|
21
21
|
options: direct,
|
|
22
22
|
async execute(args, context): Promise<{ content: string }> {
|
|
23
23
|
const { sid } = toolIds(context);
|
|
24
|
+
const evidenceContext = captureEvidenceContext(sid);
|
|
24
25
|
const reader = readerFromSid(sid);
|
|
25
26
|
const all = (await loadAll())
|
|
26
27
|
.filter(isInjectable)
|
|
@@ -44,6 +45,8 @@ export const register: ToolRegister = (editor, deps) => {
|
|
|
44
45
|
would_drop: report.rowsBefore - report.rowsAfter,
|
|
45
46
|
},
|
|
46
47
|
false,
|
|
48
|
+
sid,
|
|
49
|
+
evidenceContext,
|
|
47
50
|
);
|
|
48
51
|
return { content: out };
|
|
49
52
|
},
|
package/src/tools/decay.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// and handler are byte-identical to the pre-split source; closure access arrives
|
|
3
3
|
// through ToolDeps.
|
|
4
4
|
import type { ToolRegister } from "./deps.ts";
|
|
5
|
-
import { record } from "../evidence/record.ts";
|
|
5
|
+
import { captureEvidenceContext, record } from "../evidence/record.ts";
|
|
6
6
|
import { snapshotFiles } from "../store/files/snapshots.ts";
|
|
7
7
|
import { markManySuperseded } from "../store/files/supersede.ts";
|
|
8
8
|
import { findStaleOpen } from "../portable/decay.ts";
|
|
@@ -19,6 +19,7 @@ export const register: ToolRegister = (editor, deps) => {
|
|
|
19
19
|
options: direct,
|
|
20
20
|
async execute(args, context): Promise<{ content: string }> {
|
|
21
21
|
const { sid } = toolIds(context);
|
|
22
|
+
const evidenceContext = captureEvidenceContext(sid);
|
|
22
23
|
const days =
|
|
23
24
|
Number(args.olderThanDays) > 0 ? Number(args.olderThanDays) : 14;
|
|
24
25
|
const dryRun = args.dryRun !== false; // only an explicit false mutates
|
|
@@ -41,6 +42,8 @@ export const register: ToolRegister = (editor, deps) => {
|
|
|
41
42
|
mem: stale.map((m) => m.ts).join(","),
|
|
42
43
|
},
|
|
43
44
|
false,
|
|
45
|
+
sid,
|
|
46
|
+
evidenceContext,
|
|
44
47
|
);
|
|
45
48
|
return {
|
|
46
49
|
content:
|
|
@@ -82,6 +85,8 @@ export const register: ToolRegister = (editor, deps) => {
|
|
|
82
85
|
error: why,
|
|
83
86
|
},
|
|
84
87
|
false,
|
|
88
|
+
sid,
|
|
89
|
+
evidenceContext,
|
|
85
90
|
).catch((audit) => {
|
|
86
91
|
why += `; audit failed: ${String(audit)}`;
|
|
87
92
|
});
|
|
@@ -98,6 +103,8 @@ export const register: ToolRegister = (editor, deps) => {
|
|
|
98
103
|
snapshot: snapshot.join(",") || "-",
|
|
99
104
|
},
|
|
100
105
|
false,
|
|
106
|
+
sid,
|
|
107
|
+
evidenceContext,
|
|
101
108
|
);
|
|
102
109
|
return {
|
|
103
110
|
content:
|