@witness-ai/opencode 0.7.5 → 0.7.7
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,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@witness-ai/opencode",
|
|
3
3
|
"mcpName": "io.github.IngTian/witness",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.7",
|
|
5
5
|
"description": "MCP memory / second brain for Claude Code & OpenCode — captures your coding sessions and distills how your knowledge and habits evolve over time, queryable by your agent.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./witness.js",
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
"README.md"
|
|
22
22
|
],
|
|
23
23
|
"optionalDependencies": {
|
|
24
|
-
"@witness-ai/opencode-darwin-arm64": "0.7.
|
|
25
|
-
"@witness-ai/opencode-linux-x64": "0.7.
|
|
26
|
-
"@witness-ai/opencode-win32-x64": "0.7.
|
|
27
|
-
"@witness-ai/opencode-win32-arm64": "0.7.
|
|
24
|
+
"@witness-ai/opencode-darwin-arm64": "0.7.7",
|
|
25
|
+
"@witness-ai/opencode-linux-x64": "0.7.7",
|
|
26
|
+
"@witness-ai/opencode-win32-x64": "0.7.7",
|
|
27
|
+
"@witness-ai/opencode-win32-arm64": "0.7.7"
|
|
28
28
|
},
|
|
29
29
|
"keywords": [
|
|
30
30
|
"mcp",
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# corpus-example — a lens for a NON-person corpus
|
|
2
|
+
|
|
3
|
+
Every other lens witness ships watches a *person*. This one watches a **subject that is not you**:
|
|
4
|
+
market commentary, tracking how the regime state changes over time.
|
|
5
|
+
|
|
6
|
+
Copy it as the starting point for any document corpus — research notes, a knowledge base, incident
|
|
7
|
+
reports, meeting logs. The shape transfers; only the dimensions and the prose change.
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
cp -R "$CLAUDE_PLUGIN_ROOT/prompts/lens/corpus-example" ./regime # edit for your domain
|
|
11
|
+
witness lens register regime ./regime
|
|
12
|
+
witness lens enable regime
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
If your archive is *only* a corpus (no person tracking), start it with no person lens at all:
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
WITNESS_NO_DEFAULT_LENS=1 witness doctor # first open decides; the built-in lens is never seeded
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Then feed it records and read the result:
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
witness ingest --file news.ndjson # {"text":"…","id":"n1","session":"2026-01","ts":"2026-01-05"}
|
|
25
|
+
witness facets regime # the current state, with confidence + provenance
|
|
26
|
+
witness profile regime # the narrative brief
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## What makes this lens different from the person lenses
|
|
30
|
+
|
|
31
|
+
**`extract.md` names the subject explicitly** — "notice claims about *the market regime* … not about
|
|
32
|
+
any person, author, or writing style." Without that, a model reading market prose will happily start
|
|
33
|
+
characterizing the *analyst*, because that is the more natural reading of "notice things about the
|
|
34
|
+
subject of this text."
|
|
35
|
+
|
|
36
|
+
**The dimensions are states, not traits.** `rates`, `inflation`, `growth`, `risk_appetite`,
|
|
37
|
+
`positioning` are things that have a *current value which changes*. That is what makes the
|
|
38
|
+
bi-temporal layer earn its keep: when the regime flips, the old value closes with a date and the new
|
|
39
|
+
one opens, so you get a history rather than a replacement.
|
|
40
|
+
|
|
41
|
+
**`review.md` is explicit about what counts as a change.** The instruction is to set
|
|
42
|
+
`contradicts_prior` only for a *sustained* change of state, not a single noisy print — and that
|
|
43
|
+
absence of evidence is not contradiction. Getting this wrong in either direction is the main failure
|
|
44
|
+
mode: too eager and every data release rewrites history, too shy and a real regime change never
|
|
45
|
+
records.
|
|
46
|
+
|
|
47
|
+
**`key` must be a stable slug.** `policy_path` reviewed in January and again in June is one facet with
|
|
48
|
+
two dated versions. A key that drifts (`policy_path_jan`, `jan_policy`) produces two unrelated facets
|
|
49
|
+
and no history at all.
|
|
50
|
+
|
|
51
|
+
## Verified working
|
|
52
|
+
|
|
53
|
+
This lens was run end to end before shipping: 7 market-news records → 22 observations → 13 facets,
|
|
54
|
+
in an archive with no person lens enabled. Then a hawkish→dovish regime flip closed **five** facets
|
|
55
|
+
and opened their replacements, e.g.:
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
inflation/core_trend
|
|
59
|
+
"Disinflation has broken rather than paused: core CPI reaccelerating at 3.8%…" valid_to 2026-06-…
|
|
60
|
+
"Core is disinflating persistently rather than reaccelerating — 2.1% y/y…" (current)
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
The generated brief also flagged that its own earlier sequencing thesis had been falsified by the new
|
|
64
|
+
data — which is the point of keeping the history instead of the latest snapshot.
|
|
65
|
+
|
|
66
|
+
## Also worth knowing
|
|
67
|
+
|
|
68
|
+
The **summary prompt** is person-shaped by default too. If the narrative reads like it is describing a
|
|
69
|
+
personality rather than your subject, override it — one file, no registration:
|
|
70
|
+
|
|
71
|
+
```sh
|
|
72
|
+
mkdir -p "$(witness doctor | awk '/data root/{print $3}')/summarize"
|
|
73
|
+
$EDITOR "$(witness doctor | awk '/data root/{print $3}')/summarize/unified.md"
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
An archive with no override keeps receiving improved defaults on upgrade; once you override, your file
|
|
77
|
+
is never touched.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
You are reading one batch of market commentary. Notice claims about **the market regime** — what
|
|
2
|
+
the prevailing state is and what is changing — not about any person, author, or writing style.
|
|
3
|
+
|
|
4
|
+
Tag each observation with exactly one dimension:
|
|
5
|
+
- rates — the path and expectations for policy rates
|
|
6
|
+
- inflation — level, direction, and composition of price pressure
|
|
7
|
+
- growth — activity, labour, demand
|
|
8
|
+
- risk_appetite — how willing capital is to take risk
|
|
9
|
+
- positioning — how participants are actually positioned vs. what they say
|
|
10
|
+
|
|
11
|
+
Anchor every observation in the text. Prefer a claim that could later be shown WRONG over a vague
|
|
12
|
+
one. Note the direction of change when the text implies one.
|
|
13
|
+
|
|
14
|
+
Return ONLY a JSON array. Each element:
|
|
15
|
+
[{ "dimension": "rates", "observation": "…", "evidence": "…", "poignancy": 6 }]
|
|
16
|
+
|
|
17
|
+
poignancy 1-10: how much this observation would change a reader's model of the regime.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
You are maintaining a REGIME MODEL from accumulated observations about market commentary.
|
|
2
|
+
|
|
3
|
+
You are given observations and the current facets (each an attribute with a confidence 0-1). Decide
|
|
4
|
+
what the regime state is NOW, and mark a facet as contradicting its prior value ONLY when the
|
|
5
|
+
observations show a sustained change of state — not a single noisy print.
|
|
6
|
+
|
|
7
|
+
Return ONLY a JSON array:
|
|
8
|
+
[{
|
|
9
|
+
"dimension": "rates",
|
|
10
|
+
"key": "policy_path",
|
|
11
|
+
"value": "…the current state, one sentence…",
|
|
12
|
+
"confidence": 0.7,
|
|
13
|
+
"because_of": ["obs_id", "…"],
|
|
14
|
+
"contradicts_prior": false
|
|
15
|
+
}]
|
|
16
|
+
|
|
17
|
+
Rules:
|
|
18
|
+
- `key` is a stable slug for the thing being tracked, so the same key across reviews forms a history.
|
|
19
|
+
- Set contradicts_prior=true only for a real regime change; that is what writes a dated change record.
|
|
20
|
+
- Absence of evidence is not contradiction — say nothing rather than assert a reversal.
|
package/witness.js
CHANGED
|
@@ -35,7 +35,7 @@ function warnIfInert() {
|
|
|
35
35
|
function spawnWitness(args, payload) {
|
|
36
36
|
if (!WITNESS_BIN || process.env.WITNESS_WORKER === "1") return
|
|
37
37
|
try {
|
|
38
|
-
const env = { ...process.env
|
|
38
|
+
const env = { ...process.env }
|
|
39
39
|
env.WITNESS_ASSETS ||= modelDir(PACKAGE_ROOT)
|
|
40
40
|
// Point the binary at THIS package's bundled prompts. The binary lives in a
|
|
41
41
|
// separate per-platform package, so its exe-relative probe can't find them —
|