opencode-self-improvement 0.15.8 → 0.15.10

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-self-improvement",
3
- "version": "0.15.8",
3
+ "version": "0.15.10",
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": {
@@ -11,6 +11,7 @@ import { dirname, join } from "node:path";
11
11
  import { allowOutsideStorePaths, exportsDir, memoryRoot } from "../core/config/paths.ts";
12
12
  import { resolveContained } from "../store/containment.ts";
13
13
  import { loadAll } from "../store/files/load.ts"
14
+ import { redactSecrets } from "../store/secrets.ts"
14
15
  import { isActive } from "../store/model/predicates.ts"
15
16
  import { isVisibleTo, readerFromSid } from "../store/model/visibility.ts";
16
17
 
@@ -148,16 +149,20 @@ export async function exportMemories(opts: ExportOptions = {}): Promise<ExportRe
148
149
  exportedAt: new Date().toISOString(),
149
150
  count: mems.length,
150
151
  });
152
+ // An export is a copy at rest, so it must not carry credentials that were
153
+ // stored before the write-side redaction existed (#74 slice 1). Redaction is
154
+ // applied to the value being serialised, never to the row: export stays a
155
+ // read path, and the store remains the byte-of-record for memory_undo.
151
156
  const lines = mems.map((m) =>
152
157
  JSON.stringify({
153
158
  ts: m.ts,
154
159
  type: m.type,
155
160
  scope: m.scope,
156
- content: m.content,
161
+ content: redactSecrets(m.content),
157
162
  status: m.status,
158
163
  tags: m.tags,
159
164
  kw: m.kw,
160
- issue: m.issue,
165
+ issue: m.issue === undefined ? m.issue : redactSecrets(m.issue),
161
166
  // Origin stamps ride along so a same-repo machine hop can retain them.
162
167
  // Import validates them against its current repo before promotion.
163
168
  repo: m.repo,
@@ -1,6 +1,5 @@
1
- // The memory_merge_review tool, extracted from index.ts (#168). Schema, description
2
- // and handler are byte-identical to the pre-split source; closure access arrives
3
- // through ToolDeps.
1
+ // The memory_merge_review tool, extracted from index.ts (#168).
2
+ // Closure access arrives through ToolDeps.
4
3
  import type { ToolRegister } from "./deps.ts";
5
4
  import { memoryRoot } from "../core/config/paths.ts";
6
5
  import { record } from "../evidence/record.ts";
@@ -16,7 +15,7 @@ export const register: ToolRegister = (editor, deps) => {
16
15
  editor.add(validated(MergeReviewArgs, {
17
16
  name: "memory_merge_review",
18
17
  description:
19
- "Resolve an open merge/review gate non-destructively: mark the loser as superseded_by the survivor, and clear any supersession the survivor itself carries so the canonical row stays recallable. Both rows stay active data (the loser is recoverable via memory_undo); nothing is deleted. A session may merge exactly the rows it may read: global rows are mergeable from anywhere, but a row belonging to another repository is refused in either seat. Refuses before writing when the reason or the survivor id is missing, the survivor id names no row in the store, the loser is already superseded or is the survivor itself, or either seat names a foreign repository's row. Later lock or I/O failures can leave partial changes; the reply names the completed retirement and failure.",
18
+ "Resolve an open merge/review gate non-destructively: mark the loser as superseded_by the survivor, and clear any supersession the survivor itself carries so the canonical row stays recallable. Both rows stay active data (the loser is recoverable via memory_undo); nothing is deleted. A session may merge exactly the rows it may read: global rows are mergeable from anywhere, but a row belonging to another repository is refused in either seat. Refuses before writing when the reason or the survivor id is missing, either id names a missing or blocklisted row, the loser is already superseded or is the survivor itself, or either seat names a foreign repository's row. Later lock or I/O failures can leave partial changes; the reply names the completed retirement and failure.",
20
19
  options: direct,
21
20
  async execute(args, context): Promise<{ content: string }> {
22
21
  const { sid } = toolIds(context);
@@ -57,6 +56,12 @@ export const register: ToolRegister = (editor, deps) => {
57
56
  return { content: `merge_review blocked: survivor ${args.survivor} does not exist in the store — nothing to resolve. No evidence written.` };
58
57
  }
59
58
  const loserRow = all.find((m) => m.ts === args.loser);
59
+ // loadAll omits blocklisted rows. An unresolved id therefore
60
+ // proves neither existence nor ownership; raw mutation helpers
61
+ // must not use it to bypass this read boundary (#204).
62
+ if (!loserRow) {
63
+ return { content: "merge_review blocked: loser is missing or unavailable — nothing to resolve. No evidence written." };
64
+ }
60
65
  // Visibility is the authorization contract (#131): a session
61
66
  // may merge exactly the rows it may read. Global and legacy
62
67
  // unstamped rows are visible everywhere and therefore
@@ -64,7 +69,7 @@ export const register: ToolRegister = (editor, deps) => {
64
69
  // implicitly by store-wide reach. A foreign row in EITHER
65
70
  // seat — including an attempt to revive another repository's
66
71
  // superseded survivor — is refused before any mutation.
67
- if (loserRow && !isVisibleTo(loserRow, reader)) {
72
+ if (!isVisibleTo(loserRow, reader)) {
68
73
  return { content: "merge_review blocked: the loser belongs to another repository — this session may not retire it. Nothing was done. No evidence written." };
69
74
  }
70
75
  if (!isVisibleTo(survivorRow, reader)) {