opencode-growth 0.1.0 → 0.1.2

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 (2) hide show
  1. package/README.md +59 -30
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -1,52 +1,81 @@
1
1
  # opencode-growth
2
2
 
3
- Cross-project memory for OpenCode — **memory / capability / preference / fact** — with
4
- evidence, review and withdrawal.
5
-
6
- > **Status: P0 in progress.** The storage/manifest/identity foundation, the injection (read)
7
- > path, withdrawal-on-read, the review/publish protocol and the CLI exist. What is still
8
- > missing before this is usable: the host adapter (S5/S6) that talks to a real OpenCode
9
- > session. See `STATUS.md` for what each slice promises, and `ENFORCEMENT.md` for which
10
- > guarantees are actually protected by a test.
11
- >
12
- > Try it against a scratch store:
3
+ Cross-project memory for OpenCode — memory, capability, preference and fact — with evidence,
4
+ review and withdrawal.
5
+
6
+ > **Status: published.** `opencode-growth` is on npm (Apache-2.0), cut from tagged commits of
7
+ > this repository. A release is made by pushing a tag: GitHub Actions publishes through npm
8
+ > trusted publishing, so no long-lived npm token is involved.
13
9
  >
14
10
  > ```bash
15
- > oc-grow --store /tmp/ocg status # what is in effect
16
- > oc-grow --store /tmp/ocg doctor # can this store do its job? (exits 5 if not)
17
- > oc-grow --store /tmp/ocg --help
11
+ > npm i -g opencode-growth # provides the `oc-grow` command
12
+ > oc-grow install # writes the host plugin file, registers D/skills/
13
+ > oc-grow --store ~/.opencode-growth status
14
+ > oc-grow --store ~/.opencode-growth doctor # exits 5 when a capability is missing
18
15
  > ```
16
+ >
17
+ > `install` and `uninstall` only add or remove the host plugin file. Nothing inside the store is
18
+ > touched — your Markdown stays yours. Node >= 24.
19
+
20
+ ## What it does
19
21
 
20
- ## What it is meant to do
22
+ Every statement below is backed by a test in this repository or by an end-to-end run on a real
23
+ host.
21
24
 
22
- Remember the corrections a user makes, reuse them in the right scope, be able to explain
23
- where each one came from and which version was used, and be able to withdraw one that
24
- turned out wrong — with bounded extra cost.
25
+ - **Remembers across projects.** Say one sentence in a session and it maintains memory itself;
26
+ you can also edit the files by hand whenever you prefer.
27
+ - **Bounded.** A write through the tool that would exceed the limit fails and asks for a
28
+ tidy-up; an edit you make by hand that exceeds it only warns, and the file is still loaded in
29
+ full.
30
+ - **Retrieval over history.** Ask about something said in another project and get the original
31
+ wording back — Chinese or English, down to two characters.
32
+ - **Learns after your turns.** A background review runs between turns and turns your
33
+ corrections into proposals, which are consumed at the session boundary.
34
+ - **Safe when nobody is watching.** Unattended, additions apply directly while edits and
35
+ removals are staged for your approval.
36
+ - **Two stores.** Memory and user profile live in separate files (`MEMORY.md`, `USER.md`), each
37
+ with its own limits.
38
+ - **Addressable.** Edits and removals address an entry by a substring of its text; an ambiguous
39
+ match is refused rather than guessed.
40
+ - **Inspectable.** One command shows what is in effect and what is pending, and the tool reports
41
+ itself as degraded (exit 5) instead of a false green.
42
+ - **Nothing behind it.** The default backend is a human-readable Markdown tree with a
43
+ rebuildable index. No external memory service is required.
25
44
 
26
45
  ## What it deliberately does not do
27
46
 
28
- - It does not call model APIs out of band. Every LLM step happens inside an OpenCode
29
- session (a headless `opencode run` driven by an external scheduler, or a restricted
30
- child session created via `session.create`).
31
- - It does not need OpenViking or any external memory service. The default backend is a
32
- human-readable Markdown tree with a rebuildable index.
47
+ - It does not call model APIs out of band. Every LLM step happens inside an OpenCode session (a
48
+ headless `opencode run` driven by an external scheduler, or a restricted child session created
49
+ via `session.create`).
50
+ - It does not need OpenViking or any external memory service.
33
51
  - It does not touch OpenCode's source, and it does not assume Hermes is present.
34
52
 
53
+ ## Not built yet
54
+
55
+ Sharing one memory store with other agents, and a timeline of what has been learned.
56
+
57
+ ## Platforms
58
+
59
+ Run and verified on Windows (native), WSL2, macOS (arm64) and Linux.
60
+
35
61
  ## Layout
36
62
 
37
63
  ```
38
- src/core/ storage, manifest, identity, candidates, writer, audit, lock
39
- src/core/render.mjs injection / read path (blocks, budgets, eviction reasons)
40
- src/core/context.mjs context epochs, frozen per-session snapshots, `context show`
41
- src/index.mjs public entry
42
- test/ invariant tests (node --test)
64
+ src/core/ storage, candidates, writer, audit, lock, budget, threats, retrieval
65
+ src/core/snapshot.mjs the frozen per-session block (MEMORY.md / USER.md)
66
+ src/core/skills.mjs skill index (always resident) vs. body (on demand)
67
+ src/adapter-opencode/ the host plugin: memory tool, review runner, installer
68
+ src/learn/ headless consume path (corrections -> candidates)
69
+ src/cli/ `oc-grow` commands and the single JSON envelope
70
+ test/contracts/ acceptance tests
71
+ tools/ release and gate machinery
43
72
  ```
44
73
 
45
- Read the design before changing anything: the invariants in `src/core/manifest.mjs` and
46
- `src/core/writer.mjs` are the whole point of the kit.
74
+ The acceptance tests under `test/contracts/` and the documents in `docs/` explain the intended
75
+ behaviour — read them before changing anything.
47
76
 
48
77
  ## Tests
49
78
 
50
79
  ```bash
51
- node --test test/
80
+ node --test "test/**/*.test.mjs"
52
81
  ```
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "opencode-growth",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "OpenCode growth kit: cross-project memory (memory / capability / preference / fact) with evidence and withdrawal.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
7
7
  "engines": {
8
- "node": ">=22.18.0"
8
+ "node": ">=24"
9
9
  },
10
10
  "bin": {
11
11
  "oc-grow": "./bin/oc-grow.mjs"
@@ -15,7 +15,7 @@
15
15
  "./adapter/opencode": "./src/adapter-opencode/index.mjs"
16
16
  },
17
17
  "scripts": {
18
- "test": "node --test test/"
18
+ "test": "node --test \"test/**/*.test.mjs\""
19
19
  },
20
20
  "files": [
21
21
  "src",