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.
@@ -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
- import type { ToolRegister } from "./deps.ts";
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 { join } from "node:path";
18
- import { nonCaptureTags } from "../core/guidance.ts";
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 {