opencode-self-improvement 0.19.0 → 0.21.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/README.md +19 -1
- package/package.json +2 -1
- package/src/capture/candidates.ts +37 -1
- package/src/capture/guided-rules.ts +198 -0
- package/src/capture/lag.ts +11 -1
- package/src/capture/prompt.ts +23 -0
- package/src/capture/runtime.ts +244 -23
- package/src/capture/transcript.ts +24 -0
- package/src/core/hooks.ts +18 -0
- package/src/gate/gate.ts +5 -0
- package/src/index.ts +8 -0
- package/src/inject/budget.ts +8 -2
- package/src/inject/epochs.ts +74 -5
- package/src/inject/format.ts +8 -1
- package/src/recall/conflicts.ts +247 -0
- package/src/recall/relevant.ts +47 -4
- package/src/store/blocklist.ts +1 -1
- package/src/store/files/append.ts +96 -55
- package/src/store/files/deletions.ts +1 -1
- package/src/store/files/load.ts +99 -2
- package/src/store/files/prune.ts +14 -7
- package/src/store/files/snapshots.ts +3 -3
- package/src/store/files/supersede.ts +125 -74
- package/src/store/lock.ts +17 -1
- package/src/store/model/memory.ts +62 -0
- package/src/store/model/predicates.ts +1 -1
- package/src/store/model/visibility.ts +4 -4
- package/src/store/prune.ts +2 -2
- package/src/store/quarantine/quarantine.ts +12 -3
- package/src/store/quarantine/release.ts +34 -17
- package/src/store/tombstones/rejection.ts +3 -3
- package/src/store/tombstones/tombstone.ts +9 -8
- package/src/store/undo.ts +4 -4
- package/src/tools/update.ts +19 -7
package/src/tools/update.ts
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
// The memory_update tool, extracted from index.ts (#168). Schema, description
|
|
2
2
|
// and handler are byte-identical to the pre-split source; closure access arrives
|
|
3
3
|
// through ToolDeps.
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
import { join } from "node:path";
|
|
5
6
|
import { memoryRoot } from "../core/config/paths.ts";
|
|
7
|
+
import { nonCaptureTags } from "../core/guidance.ts";
|
|
6
8
|
import { record } from "../evidence/record.ts";
|
|
7
9
|
import { auditCaveat, runWriteGate, sameStrList } from "../gate/gate.ts";
|
|
8
|
-
import { withStoreLock } from "../store/lock.ts";
|
|
9
10
|
import { loadAll } from "../store/files/load.ts";
|
|
10
11
|
import { markSuperseded } from "../store/files/supersede.ts";
|
|
11
12
|
import { resolveMemoryTarget } from "../store/files/target.ts";
|
|
13
|
+
import { withStoreLock } from "../store/lock.ts";
|
|
14
|
+
import type { Memory } from "../store/model/memory.ts";
|
|
12
15
|
import { isActive } from "../store/model/predicates.ts";
|
|
13
16
|
import { isVisibleTo, readerFromSid } from "../store/model/visibility.ts";
|
|
14
|
-
import type { Memory } from "../store/model/memory.ts";
|
|
15
|
-
import { UpdateArgs, validated } from "./schema.ts";
|
|
16
17
|
import { redactSecrets } from "../store/secrets.ts";
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
18
|
+
import type { ToolRegister } from "./deps.ts";
|
|
19
|
+
import { UpdateArgs, validated } from "./schema.ts";
|
|
19
20
|
|
|
20
21
|
export const register: ToolRegister = (editor, deps) => {
|
|
21
22
|
const {
|
|
@@ -221,7 +222,18 @@ export const register: ToolRegister = (editor, deps) => {
|
|
|
221
222
|
const partial = (why: string) => ({
|
|
222
223
|
content:
|
|
223
224
|
`memory_update PARTIAL: replacement ${replacement} IS on disk (memory_undo merge or force ` +
|
|
224
|
-
`restores ${retired}), but ${why}. Re-running this update reports the duplicate
|
|
225
|
+
`restores ${retired}), but ${why}. Re-running this update reports the duplicate.` +
|
|
226
|
+
// #215 narrowed a single-row supersede to the day file its ts
|
|
227
|
+
// names, so a busy file now faults HERE instead of faulting
|
|
228
|
+
// somewhere in the gate's sweep. The gate may still have
|
|
229
|
+
// retired OTHER rows at GATE-2 (drift, canonical) before that
|
|
230
|
+
// fault — those tombstones are on disk, and a PARTIAL that
|
|
231
|
+
// omits them reads as "only the target was touched".
|
|
232
|
+
(gateDurable.length > 0
|
|
233
|
+
? ` This call had ALREADY retired ${gateDurable.length} other row(s) (${gateDurable.join(
|
|
234
|
+
", ",
|
|
235
|
+
)}): those retirements ARE on disk; reconcile with memory_evidence.`
|
|
236
|
+
: ""),
|
|
225
237
|
});
|
|
226
238
|
let retiredNow = false;
|
|
227
239
|
try {
|