opencode-self-improvement 0.30.5 → 0.31.1

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.
Files changed (56) hide show
  1. package/README.md +71 -244
  2. package/docs/auto-capture-evidence.md +8 -1
  3. package/docs/contradiction-authority.md +40 -4
  4. package/docs/development.md +23 -3
  5. package/docs/export-import.md +61 -0
  6. package/docs/flags.md +10 -2
  7. package/docs/import-quarantine.md +18 -2
  8. package/docs/injection-cost.md +10 -5
  9. package/docs/install.md +45 -0
  10. package/docs/options.md +41 -0
  11. package/docs/pre-release-ritual.md +4 -0
  12. package/docs/recall-quality.md +56 -0
  13. package/docs/repo-scoping.md +29 -5
  14. package/docs/secret-redaction.md +51 -0
  15. package/docs/store-concurrency.md +14 -1
  16. package/docs/surfaces.md +39 -0
  17. package/docs/troubleshooting.md +29 -0
  18. package/docs/use-ledger.md +61 -0
  19. package/docs/write-gates.md +17 -2
  20. package/docs/write-latency.md +25 -0
  21. package/package.json +1 -1
  22. package/src/capture/candidates.ts +1 -1
  23. package/src/capture/prompt.ts +1 -1
  24. package/src/capture/runtime.ts +19 -17
  25. package/src/capture/triggers.ts +1 -1
  26. package/src/consolidate/propose.ts +1 -1
  27. package/src/core/config/paths.ts +1 -1
  28. package/src/events.ts +2 -2
  29. package/src/gate/gate.ts +1 -1
  30. package/src/identity/session-context.ts +1 -1
  31. package/src/index.ts +18 -18
  32. package/src/init/run.ts +1 -1
  33. package/src/init/stamp.ts +1 -1
  34. package/src/inject/digest.ts +1 -1
  35. package/src/inject/epochs.ts +2 -2
  36. package/src/recall/gate.ts +30 -4
  37. package/src/status/report.ts +4 -4
  38. package/src/status/store-summary.ts +1 -1
  39. package/src/store/files/load.ts +1 -1
  40. package/src/store/lock.ts +1 -1
  41. package/src/store/prune.ts +1 -1
  42. package/src/store/tombstones/rejection.ts +1 -1
  43. package/src/store/tombstones/tombstone.ts +1 -1
  44. package/src/store/undo.ts +1 -1
  45. package/src/tools/consolidate.ts +2 -2
  46. package/src/tools/decay.ts +1 -1
  47. package/src/tools/deps.ts +1 -1
  48. package/src/tools/evidence.ts +1 -1
  49. package/src/tools/merge-review.ts +1 -1
  50. package/src/tools/recall.ts +15 -6
  51. package/src/tools/status-tool.ts +1 -1
  52. package/src/tools/update.ts +1 -1
  53. package/src/viewer/mutate.ts +1 -1
  54. /package/src/{command → init}/ensure.ts +0 -0
  55. /package/src/{hits → telemetry}/ledger.ts +0 -0
  56. /package/src/{evidence → telemetry}/record.ts +0 -0
@@ -2,10 +2,11 @@
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 { record } from "../telemetry/record.ts";
6
6
  import { formatMemory } from "../inject/format.ts";
7
7
  import {
8
8
  admitsRow,
9
+ exactAliasMatches,
9
10
  gateEnabled,
10
11
  queryConcepts,
11
12
  recallHaystack,
@@ -51,14 +52,22 @@ export const register: ToolRegister = (editor, deps) => {
51
52
  results = results.filter((m) => m.scope.includes(args.scope!));
52
53
  if (args.type) results = results.filter((m) => m.type === args.type);
53
54
  if (args.query) {
54
- // Default on: a row must share two whole words of the query — the
55
- // concepts rule, not the scorer's substring test (src/recall/gate.ts,
56
- //). OPENCODE_MEMORY_QUERY_GATE=off restores the old matcher.
57
55
  const gate = gateEnabled();
58
56
  const concepts = gate ? queryConcepts(args.query) : [];
57
+ const aliases = exactAliasMatches(args.query, concepts, results);
59
58
  results = results
60
- .map((m) => ({ m, score: scoreMemory(m, args.query!) }))
61
- .filter((x) => x.score > 0 && (!gate || admitsRow(x.m, concepts)))
59
+ .map((m) => ({
60
+ m,
61
+ score: Math.max(
62
+ scoreMemory(m, args.query!),
63
+ aliases.has(m) ? 1 : 0,
64
+ ),
65
+ }))
66
+ .filter(
67
+ (x) =>
68
+ x.score > 0 &&
69
+ (!gate || aliases.has(x.m) || admitsRow(x.m, concepts)),
70
+ )
62
71
  .sort((a, b) => b.score - a.score)
63
72
  .map((x) => x.m);
64
73
  }
@@ -1,7 +1,7 @@
1
1
  // The memory_status tool, extracted from index.ts.
2
2
  // Closure access arrives through ToolDeps.
3
3
  import type { ToolRegister } from "./deps.ts";
4
- import { readLedger } from "../hits/ledger.ts";
4
+ import { readLedger } from "../telemetry/ledger.ts";
5
5
  import { formatMemory } from "../inject/format.ts";
6
6
  import { loadAll, malformedCount } from "../store/files/load.ts";
7
7
  import { isVisibleTo, readerFromSid } from "../store/model/visibility.ts";
@@ -5,7 +5,7 @@
5
5
  import { join } from "node:path";
6
6
  import { memoryRoot } from "../core/config/paths.ts";
7
7
  import { nonCaptureTags } from "../core/guidance.ts";
8
- import { record } from "../evidence/record.ts";
8
+ import { record } from "../telemetry/record.ts";
9
9
  import { auditCaveat, runWriteGate, sameStrList } from "../gate/gate.ts";
10
10
  import { loadAll } from "../store/files/load.ts";
11
11
  import { markSuperseded } from "../store/files/supersede.ts";
@@ -13,7 +13,7 @@ import {
13
13
  chainId,
14
14
  contentHash,
15
15
  targetRepoFields,
16
- } from "../evidence/record.ts";
16
+ } from "../telemetry/record.ts";
17
17
  import { removeTombstone, tombstone } from "../store/tombstones/tombstone.ts";
18
18
  import { redactSecrets } from "../store/secrets.ts";
19
19
  import { formatLine, parseLine } from "../core/logfmt/format.ts";
File without changes
File without changes
File without changes