pi-supernova 0.2.0 → 0.3.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.
- package/README.md +196 -196
- package/{CHANGELOG.md → docs/CHANGELOG.md} +54 -1
- package/index.js +81 -68
- package/package.json +12 -31
- package/{catalog.js → src/bridge/catalog.js} +7 -5
- package/{host-bridge.js → src/bridge/host-bridge.js} +232 -87
- package/src/bridge/native-tools.js +155 -0
- package/src/bridge/pi-extension.ts +2 -0
- package/{config.js → src/config/config.js} +1 -1
- package/{evidence.js → src/context/evidence.js} +23 -12
- package/{outline.js → src/context/outline.js} +1 -1
- package/{repo-index.js → src/context/repo-index.js} +11 -9
- package/{search.js → src/context/search.js} +34 -1
- package/{snap.js → src/context/snap.js} +51 -31
- package/{surface.js → src/context/surface.js} +1 -1
- package/{diff.js → src/fs/diff.js} +12 -9
- package/{patch.js → src/fs/patch.js} +1 -1
- package/{vfs.js → src/fs/vfs.js} +55 -14
- package/{workspace.js → src/fs/workspace.js} +22 -6
- package/{bottleneck.js → src/output/bottleneck.js} +23 -6
- package/{format.js → src/output/format.js} +20 -1
- package/{guest-worker.js → src/runtime/guest-worker.js} +90 -21
- package/{parallel.js → src/runtime/parallel.js} +68 -1
- package/{runtime.js → src/runtime/runtime.js} +14 -5
- package/{omp-frame.js → src/ui/omp-frame.js} +1 -1
- package/{render-measure.js → src/ui/render-measure.js} +27 -1
- package/{render.js → src/ui/render.js} +42 -20
- /package/{config.default.json → src/config/config.default.json} +0 -0
- /package/{fuzzy.js → src/context/fuzzy.js} +0 -0
- /package/{ledger.js → src/context/ledger.js} +0 -0
- /package/{check.js → src/fs/check.js} +0 -0
- /package/{decode.js → src/shared/decode.js} +0 -0
package/README.md
CHANGED
|
@@ -1,229 +1,229 @@
|
|
|
1
1
|
# pi-supernova
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
[](https://github.com/AdityaVG13/pi-stack/blob/main/packages/pi-supernova/LICENSE)
|
|
5
|
-
[](https://nodejs.org)
|
|
6
|
-
[](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/docs/packages.md)
|
|
3
|
+
**One nova / `supernova({code})` invocation. Four commands inside CodeMode.**
|
|
7
4
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
pi install npm:pi-supernova
|
|
12
|
-
omp install npm:pi-supernova
|
|
5
|
+
```javascript
|
|
6
|
+
const source = await read("validateRefreshToken");
|
|
7
|
+
return source;
|
|
13
8
|
```
|
|
14
9
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
An unrelated Pi extension’s tools are not callable through Supernova. OMP 18.1.10 supports those calls through its session registry.
|
|
20
|
-
|
|
21
|
-
Both hosts use the same runtime, transactions, and result limits. Hiding a top-level native tool does not remove its internal Supernova adapter.
|
|
22
|
-
|
|
23
|
-
Use `excludeTools` to disable an internal adapter. Delegated extension tools still require host permission and active status. Replaced or disposed sessions cannot call tools.
|
|
10
|
+
The model submits JavaScript, not four separately advertised native tools.
|
|
11
|
+
Ordinary JavaScript control flow remains available; the guest command bindings
|
|
12
|
+
are only `read`, `edit`, `write`, and `bash`. Supernova supplies retrieval,
|
|
13
|
+
transactional file operations, batching, bounded results and the grouped nova UI.
|
|
24
14
|
|
|
25
|
-
|
|
15
|
+
## Install and update
|
|
26
16
|
|
|
27
|
-
|
|
17
|
+
Install the published package in your host:
|
|
28
18
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
| Multi-step | Model stitches turns | One in-process program |
|
|
33
|
-
| Parallel reads | Ad hoc | `callMany` Auto / `parallel()` |
|
|
34
|
-
| Hosts | Separate packages | Same tarball for Pi **and** OMP |
|
|
35
|
-
|
|
36
|
-
Guest code runs as an `AsyncFunction` in a new worker for each program. It has the same trust level as host `bash`.
|
|
37
|
-
|
|
38
|
-
The host parses the bounded source with Acorn before execution. Tool calls use RPC. Deadlines and cancellation cover worker startup, tool discovery, and execution.
|
|
39
|
-
|
|
40
|
-
A completed worker cannot supply callbacks or globals to another program. Concurrent programs have separate transactions, traces, cancellation signals, and call budgets.
|
|
41
|
-
|
|
42
|
-
---
|
|
43
|
-
|
|
44
|
-
## Quick example
|
|
45
|
-
|
|
46
|
-
```js
|
|
47
|
-
const hit = JSON.parse(await read("src", {about: "validateJwtRefreshToken"}));
|
|
48
|
-
if (hit.status !== "found") return hit;
|
|
49
|
-
return await read(hit.path, {about: "expired tokens"});
|
|
19
|
+
```bash
|
|
20
|
+
pi install npm:pi-supernova
|
|
21
|
+
omp install npm:pi-supernova
|
|
50
22
|
```
|
|
51
23
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
| Command | Result |
|
|
55
|
-
|---------|--------|
|
|
56
|
-
| `read(file, offset?, limit?)` | File text; line numbers start at one |
|
|
57
|
-
| `read(files)` | An array of file texts |
|
|
58
|
-
| `read(directory)` | Direct directory entries |
|
|
59
|
-
| `read("symbol or question")` | JSON text with source status, path, line, signature, and context |
|
|
60
|
-
| `read(path, {about: question})` | Relevant file bodies, or source selection inside a directory |
|
|
61
|
-
| `write(path, text)` | Write a file |
|
|
62
|
-
| `edit(path, oldText, newText)` | Post-edit lines, a structural check, and references |
|
|
63
|
-
| `bash(command, options?)` | Bounded command output; failure throws |
|
|
64
|
-
|
|
65
|
-
### Source selection
|
|
66
|
-
|
|
67
|
-
`read` reports `found`, `ambiguous`, `not_found`, or `incomplete`.
|
|
68
|
-
Only `found` selects a path. Uncertain results contain at most three candidates.
|
|
69
|
-
|
|
70
|
-
Identifier declarations take priority over callers and filenames. Natural-language selection uses text matches, not semantic inference. Use a symbol or a narrower directory when needed.
|
|
71
|
-
|
|
72
|
-
The confidence value is a ranking heuristic, not a measured probability. Duplicate declarations do not produce a confident winner.
|
|
73
|
-
|
|
74
|
-
Search uses ripgrep without loading every file into the text cache. It can locate declarations beyond the 512 KiB whole-file cache limit.
|
|
75
|
-
|
|
76
|
-
Each candidate contains up to seven source lines. Signatures and individual lines have a 240-character limit, with explicit truncation markers.
|
|
24
|
+
Local checkout installs are for development, not distribution:
|
|
77
25
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
The measured 10,001-file fixture returned a 199-character result. This is about 50 tokens at four characters per token, not an exact token count.
|
|
81
|
-
|
|
82
|
-
In the 23-question source check, 17 questions selected the correct file and six returned candidates. No result selected a wrong file.
|
|
83
|
-
All 15 identifier questions selected the correct file. Natural-language questions can still miss the intended file in their candidates.
|
|
84
|
-
|
|
85
|
-
Search scans disk on each question. Warm searches can be slower than the previous full-content cache, but do not retain every source file.
|
|
86
|
-
|
|
87
|
-
Already-seen result lines collapse to references. `read(path, firstLine, lineCount)` shows a range again. `edit` returns changed lines without a verification read.
|
|
88
|
-
|
|
89
|
-
The returned value is rendered as a compact JS literal (unquoted keys, one item per line only when a container exceeds 120 columns) and capped at `maxReturnChars`. Strings are returned raw. This costs ~43% fewer tokens than pretty JSON. Return small shaped values, not raw file dumps.
|
|
90
|
-
|
|
91
|
-
Unified Pi/OMP card: one aligned row per call (status · tool · duration · target) with bounded mutation diffs.
|
|
92
|
-
|
|
93
|
-
```text
|
|
94
|
-
╭─── nova: 4 calls · 6.9s ─────────────────────────────────────╮
|
|
95
|
-
│ ✓ bash 6.2s python3 - <<'EOF' …+3 lines │
|
|
96
|
-
│ × bash 120ms exit 3 pytest -q │
|
|
97
|
-
│ ✓ read 3ms packages/pi-supernova/host-bridge.js │
|
|
98
|
-
│ ✓ edit 4ms +1/-1 src/a.ts │
|
|
99
|
-
│ -143 │ - const oldValue = before; │
|
|
100
|
-
│ +143 │ + const newValue = after; │
|
|
101
|
-
╰───────────────────────────────────────────────────────────────╯
|
|
26
|
+
```bash
|
|
27
|
+
pi install /path/to/pi-stack/packages/pi-supernova
|
|
102
28
|
```
|
|
103
29
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
|
123
|
-
|
|
|
124
|
-
|
|
125
|
-
`
|
|
126
|
-
|
|
127
|
-
`
|
|
128
|
-
|
|
129
|
-
`
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
30
|
+
Git pushes do not update npm installations. Publish the new npm version first;
|
|
31
|
+
then reinstall it in the host. Reinstall explicitly when an existing version
|
|
32
|
+
range excludes the new minor version (for example, `^0.2.0` excludes `0.3.0`).
|
|
33
|
+
|
|
34
|
+
Both package manifests use `index.js`. The old `src/bridge/pi-extension.ts` path
|
|
35
|
+
remains a compatibility entrypoint but no longer imports Pi tool factories.
|
|
36
|
+
After updating JavaScript sources, fully exit Pi and resume in a new process.
|
|
37
|
+
Pi 0.85.1 can retain native ESM modules across `/reload`, even after its extension
|
|
38
|
+
factory cache is cleared; `/reload` alone is not sufficient in that case.
|
|
39
|
+
OMP uses the same shared engine; restart it after updating the link as well.
|
|
40
|
+
|
|
41
|
+
For deferred-context-engine, pin `supernova` in `alwaysActive` and `neverDefer`.
|
|
42
|
+
Remove the four native names from those pins and restore their previous blocks
|
|
43
|
+
if you want the wrapper to be the only file/shell surface. Preserve unrelated
|
|
44
|
+
settings. The runtime does not silently rewrite your tool policy.
|
|
45
|
+
|
|
46
|
+
## Four guest commands
|
|
47
|
+
|
|
48
|
+
| Function | Examples and behavior |
|
|
49
|
+
| --- | --- |
|
|
50
|
+
| `read` | `read(path, offset?, limit?)`, `read({path,offset,limit})`; one-based line windows |
|
|
51
|
+
| `read` | `read(directory)`, `read("symbol or question")`, `read(path,{about:question})`; questions locate and open source directly |
|
|
52
|
+
| `read` | `read({query,resolve:true})`; structured source and status for a resolve-to-edit handoff |
|
|
53
|
+
| `read` | `read({query,evidence:true})`; ranked evidence with provenance; optional `path` scopes discovery |
|
|
54
|
+
| `read` | `read({path,outline:true})`; structural declarations |
|
|
55
|
+
| `read` | `read([path1,path2])`; up to 64 paths, ordered values with labelled individual failures |
|
|
56
|
+
| `edit` | `edit(path,oldText,newText)`, `edit({path,edits:[{oldText,newText}]})`; related edits validated against one original file |
|
|
57
|
+
| `edit` | `edit({path,patch})`; unified patch application |
|
|
58
|
+
| `edit` | `edit(async () => {...})`; filesystem-only checkpoint, described below |
|
|
59
|
+
| `write` | `write(path,text)`, `write({path,content})`; atomic replacement |
|
|
60
|
+
| `bash` | `bash(command,{cwd,timeoutMs})`, `bash({command,timeoutMs})`; bounded output, nonzero exits throw |
|
|
61
|
+
| `bash` | `bash({command,args:[...]})`; literal executable argv, without shell expansion of argument strings |
|
|
62
|
+
|
|
63
|
+
`bash` also accepts `timeout` in seconds for familiar object arguments. `timeoutMs`
|
|
64
|
+
is milliseconds and takes precedence. The owned POSIX adapter launches executable
|
|
65
|
+
argv directly; use the string form for shell builtins, functions or startup hooks.
|
|
66
|
+
Windows and delegated/older executors retain quoted-shell compatibility. Argument
|
|
67
|
+
payloads are not repeated in owned direct-execution errors;
|
|
68
|
+
stdout/stderr, exit status and source context remain. Session environment variables are taken
|
|
69
|
+
from the current execution context, not inherited from a different parent session.
|
|
70
|
+
|
|
71
|
+
Source questions resolve and open the selected file in one command. An exact
|
|
72
|
+
declaration match uses one bounded direct ripgrep search, without a prerequisite
|
|
73
|
+
file listing, persistent index, embeddings or summarization. A transient filename
|
|
74
|
+
listing is a fallback for unmatched content or unresolved bare filenames. Natural-language
|
|
75
|
+
questions reuse lexical stemming. Ripgrep must be available on PATH.
|
|
76
|
+
|
|
77
|
+
Successful question reads return raw source with a path/range header, not the old
|
|
78
|
+
JSON location preview. Use the structured form when code needs the path:
|
|
79
|
+
|
|
80
|
+
```javascript
|
|
81
|
+
const source = await read({query: "validateRefreshToken", resolve: true});
|
|
82
|
+
if (source.status !== "found") return source;
|
|
83
|
+
return await edit(source.path, "token.length > 3", "token.length > 5");
|
|
154
84
|
```
|
|
155
85
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
86
|
+
The structured result contains `status`, `path`, the matching `line`, delivered
|
|
87
|
+
`lines`, unchanged `text`, `complete`, and `nextOffset` when more source follows.
|
|
88
|
+
Files that fit the output budget are returned in full. Oversized files open near
|
|
89
|
+
the matching line and give a continuation; they are not summarized. Uncertain
|
|
90
|
+
results report `ambiguous`, `not_found` or `incomplete` with no selected path.
|
|
91
|
+
Use `{path: directory, about: question, resolve: true}` to narrow the scope.
|
|
92
|
+
|
|
93
|
+
Ordinary reads stay self-contained. Outlines and graph evidence remain explicit
|
|
94
|
+
options, not mandatory stages of source resolution. Ordinary calls also get:
|
|
95
|
+
|
|
96
|
+
- Bounded fuzzy filename hints when a bare source name has no literal match. Existing
|
|
97
|
+
frecency/directory ranking orders hints; fuzzy matches never select a path. This
|
|
98
|
+
reuses filename discovery, examines at most 1024 paths and reports incomplete hints.
|
|
99
|
+
- Post-edit source windows and structural warnings for both replacement and patch
|
|
100
|
+
edits. Body-only edits reuse local declaration spans for lexical reference hints.
|
|
101
|
+
Up to three names share one bounded, cancellable search; staged callers override disk.
|
|
102
|
+
These hints do not build an index, are not semantic caller resolution, and report
|
|
103
|
+
unavailable/truncated searches rather than silently claiming completeness.
|
|
104
|
+
- Structural warnings on writes without echoing successful file contents.
|
|
105
|
+
- Fresh workspace source around up to four failure locations, including shell
|
|
106
|
+
timeouts and paths relative to the command cwd. Implicit snippets exclude external
|
|
107
|
+
symlink targets and files over 1 MiB.
|
|
108
|
+
|
|
109
|
+
Distant edit regions have separate windows and continuation pointers for omitted
|
|
110
|
+
lines. Structural warnings and source windows are not substitutes for tests.
|
|
111
|
+
|
|
112
|
+
## Execution and automatic batching
|
|
113
|
+
|
|
114
|
+
Compatible independently started reads coalesce at the worker/host boundary.
|
|
115
|
+
No additional batching command is required. Individual promises preserve their
|
|
116
|
+
values, errors and per-read budgets. File reads have bounded parallelism; writes,
|
|
117
|
+
edits, shell calls and checkpoint transitions form ordering barriers.
|
|
118
|
+
|
|
119
|
+
This does **not** reorder sequential `await`s or predict future model decisions.
|
|
120
|
+
An explicit path-array read uses an aggregate text budget; automatic coalescing
|
|
121
|
+
retains each independent read's budget instead of silently shrinking its result.
|
|
122
|
+
|
|
123
|
+
Every program runs in a fresh worker. One pristine worker is prepared for the next
|
|
124
|
+
invocation, then disposed on session shutdown. Executed workers are never reused,
|
|
125
|
+
so guest globals cannot leak into a later program. Worker preparation still costs
|
|
126
|
+
CPU and memory; it is moved off the next invocation's critical path, not eliminated.
|
|
127
|
+
|
|
128
|
+
File changes are staged until program success. A throw before an external-mutation
|
|
129
|
+
barrier rolls them back. Shell execution flushes preceding changes; external shell
|
|
130
|
+
side effects cannot be rolled back. Stale commits fail explicitly rather than
|
|
131
|
+
silently overwriting successful concurrent changes. This is not a cross-process
|
|
132
|
+
filesystem lock.
|
|
133
|
+
|
|
134
|
+
`edit(async () => {...})` creates a nested filesystem checkpoint. It returns
|
|
135
|
+
`{ok:true,committed:true,value}` on success or `{ok:false,committed:false,error}` on
|
|
136
|
+
failure. Shell commands, overlapping/nested checkpoints, and concurrent commands
|
|
137
|
+
outside the active callback are rejected. Await the checkpoint before proceeding.
|
|
138
|
+
|
|
139
|
+
## Context, caching and failure fidelity
|
|
140
|
+
|
|
141
|
+
- Plain reads are not replaced with earlier-context references. A local cache hit
|
|
142
|
+
is not proof the model still retains an earlier result after compaction.
|
|
143
|
+
- Oversized text reads provide an exact next-line offset. A single line too large
|
|
144
|
+
for the budget fails explicitly instead of pretending it was read completely.
|
|
145
|
+
- Returned images remain image content blocks, including in arrays/objects. Images
|
|
146
|
+
not returned by the program stay out of model output. Returned images are limited
|
|
147
|
+
to 16 attachments / 20 MiB; resize or return fewer when necessary.
|
|
148
|
+
- Dense multiline string arrays can render as verbatim source blocks instead of
|
|
149
|
+
escaped string literals. Each block gives its array index and exact UTF-16 length;
|
|
150
|
+
strings and result types are unchanged. This is output framing, not source
|
|
151
|
+
compression. It is chosen only when shorter in characters than escaped output;
|
|
152
|
+
it does not guarantee lower billed tokens for every tokenizer or input.
|
|
153
|
+
- Intermediate values stay inside CodeMode unless returned or logged. Final text,
|
|
154
|
+
errors and logs are bounded with explicit truncation. Details support rendering;
|
|
155
|
+
they are not a second model-facing transcript.
|
|
156
|
+
- Source indexing/caching remains internal. Reads after mutations invalidate stale
|
|
157
|
+
state. There is no claim of provider-cache or total-task token savings.
|
|
158
|
+
|
|
159
|
+
Default limits are in `src/config/config.default.json`. Configuration loads from
|
|
160
|
+
`~/.pi/agent/supernova.json`, the configured host directory, or `PI_SUPERNOVA_CONFIG`.
|
|
161
|
+
Text limits are character budgets, not tokenizer counts. `/supernova` reports
|
|
162
|
+
programs and output characters without labelling characters as tokens.
|
|
163
|
+
|
|
164
|
+
## Security and host boundary
|
|
165
|
+
|
|
166
|
+
CodeMode executes trusted JavaScript in a terminable worker, **not a security
|
|
167
|
+
sandbox**. The four adapters constrain writes/edits to the workspace and allow
|
|
168
|
+
explicit external reads. JavaScript imports and shell commands still have process
|
|
169
|
+
privileges. Do not run untrusted programs as though these adapters isolate them.
|
|
170
|
+
|
|
171
|
+
Pi preflights the outer `supernova` call. Internal primitives do not emit ordinary
|
|
172
|
+
native `tool_call` events, so third-party guards that only recognize top-level
|
|
173
|
+
`edit` or `bash` need CodeMode-aware handling. Configured exclusions and supported
|
|
174
|
+
host-session execution safeguards remain enforced. Actual-host smoke checks are
|
|
175
|
+
not a claim that every third-party permission extension has been validated.
|
|
176
|
+
|
|
177
|
+
## Development and evidence
|
|
178
|
+
|
|
179
|
+
Implementation is grouped under `src/`; all replacement tests are under `tests/`.
|
|
180
|
+
The original 12 red acceptance tests were left unchanged. Additional strict tests
|
|
181
|
+
cover batching fidelity, image/context retention, checkpoints, mutation ordering,
|
|
182
|
+
external symlinks, deadlines, worker isolation and execution-context environment.
|
|
183
|
+
The former deleted suite has not been silently reinstated.
|
|
171
184
|
|
|
172
185
|
```bash
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
186
|
+
npm test --prefix packages/pi-supernova
|
|
187
|
+
npm run lint:supernova
|
|
188
|
+
npm run measure --prefix packages/pi-supernova
|
|
176
189
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
omp install ./pi-stack/packages/pi-supernova
|
|
190
|
+
PI_SUPERNOVA_PI_ROOT=/path/to/pi-coding-agent \
|
|
191
|
+
PI_SUPERNOVA_OMP=/path/to/omp \
|
|
192
|
+
npm run test:hosts --prefix packages/pi-supernova
|
|
181
193
|
```
|
|
182
194
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
195
|
+
The explicit host runner requires macOS network sandboxing and fails, rather than
|
|
196
|
+
skips, when prerequisites are absent. Verified locally against Pi 0.85.1 and OMP
|
|
197
|
+
18.1.11: CodeMode execution, four primitives, automatic read coalescing, checkpoints,
|
|
198
|
+
images and failed execution. Pi's actual loader/runner and TUI are exercised; OMP
|
|
199
|
+
runs in a disposable process through its actual session registry, with networking
|
|
200
|
+
denied. The Pi runner supplies a minimal tool registry, not a full provider session.
|
|
188
201
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
202
|
+
The local measurement compares identical eight-file programs with coalescing off,
|
|
203
|
+
coalescing on, and a pristine-ready worker. It reports latency percentiles,
|
|
204
|
+
observed maxima, raw samples and bridge calls. Set `SUPERNOVA_MEASURE_SAMPLES`
|
|
205
|
+
(20 to 10000; default 200) for longer runs. Maxima describe the measured sample,
|
|
206
|
+
not hard real-time guarantees.
|
|
207
|
+
It excludes model latency, provider tokens and prewarm time; it is not a universal
|
|
208
|
+
comparison against every CodeMode implementation.
|
|
195
209
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
## Limitations
|
|
199
|
-
|
|
200
|
-
- Guest JS is **unsandboxed**. Adapter path jails are not a boundary against `import("node:fs")`. The worker only contains hangs, exits, and memory, not intent.
|
|
201
|
-
- Guest error messages carry `(line:col)` on Node; Bun's engine does not expose guest-relative positions.
|
|
202
|
-
|
|
203
|
-
## Transactions and file freshness
|
|
204
|
-
|
|
205
|
-
- `bash` and mutating host tools commit pending writes before execution. Later rollback cannot undo those changes or external effects.
|
|
206
|
-
- Native commits stage replacements and backups before installation. A commit failure restores earlier replacements; a recovery failure reports retained backup paths.
|
|
207
|
-
- A nested `nova.speculate` branch cannot call external mutators. Await each branch before returning.
|
|
208
|
-
- Native reads use current disk content unless a staged write replaces it. Evidence search includes new staged files.
|
|
209
|
-
- Workspace file-list updates use filesystem watchers. Without a working watcher, external new files can take 10 seconds to appear in indexed searches.
|
|
210
|
-
|
|
211
|
-
This is a pre-1.0 package. APIs and the terminal display can change between minor releases.
|
|
210
|
+
See [the changelog](docs/CHANGELOG.md) for changes and compatibility notes.
|
|
212
211
|
|
|
213
212
|
## Research and prior art
|
|
214
213
|
|
|
215
|
-
|
|
214
|
+
These references describe internal algorithms, not additional guest commands.
|
|
215
|
+
|
|
216
|
+
The existing implementation references are retained below. Mechanisms requiring
|
|
217
|
+
an additional model call are not silently invoked by the tools.
|
|
216
218
|
|
|
217
219
|
| Work | What we use it for | Where |
|
|
218
220
|
|------|--------------------|-------|
|
|
219
|
-
| **Zero-Mem: Zero-Token Memory Operations for LLM Agents**, Xiao, Zhu, Zhang, Chen, Hong, Zhuang, Zhang, Chen, Ouyang, Ren, Huang (arXiv:2607.29377) |
|
|
220
|
-
| **Agent Zero Memory: Provenance-Aware Long-Term Memory for LLM Agents**, Zhu, Wu (arXiv:2608.29606) | Every returned unit carries provenance (path, line range, verbatim text); the L0→L1→L2 read discipline (`read(query)` → `read(path, {about})` → `read(path, offset, limit)`); the citation-lock idea that a model should only cite what it actually opened. | `evidence.js`, `outline.js`, tool guidance |
|
|
221
|
+
| **Zero-Mem: Zero-Token Memory Operations for LLM Agents**, Xiao, Zhu, Zhang, Chen, Hong, Zhuang, Zhang, Chen, Ouyang, Ren, Huang (arXiv:2607.29377) | Evidence selection: entity–context graph with co-occurrence weights (eq. 3–4), turn/window/episode hierarchy as line/span/file (eq. 5, 11), query profile and relational/local routing (eq. 6–7), lexical entity alignment and one propagation step (eq. 8–9), personalized PageRank over spans (eq. 10), per-view normalisation and ρ-weighted fusion (eq. 12–13), closure with bridges and neighbours (eq. 14), deterministic calibration (eq. 15). Top-K = 5 follows the paper's Top-5 ≈ Top-10 finding. | `src/context/evidence.js` |
|
|
222
|
+
| **Agent Zero Memory: Provenance-Aware Long-Term Memory for LLM Agents**, Zhu, Wu (arXiv:2608.29606) | Every returned unit carries provenance (path, line range, verbatim text); the L0→L1→L2 read discipline (`read(query)` → `read(path, {about})` → `read(path, offset, limit)`); the citation-lock idea that a model should only cite what it actually opened. | `src/context/evidence.js`, `src/context/outline.js`, tool guidance |
|
|
221
223
|
| **Harness-of-Harness: Multi-Day Autonomous Software Development with Continual Improvement**, Yan, Su, et al. (arXiv:2609.01481) | Progressive disclosure (index first, detail on demand) and carrying evidence forward instead of reconstructing it from code. | outline / result shaping |
|
|
222
224
|
| **Act More, Decide Less: Skill-Guided Adaptive Action Chunking for Long-Horizon LLM Agents**, Yang, Jin, Zhao, et al. (arXiv:2609.02042) | Framing: one supernova program is an action chunk (one model decision, many primitive actions, stop at the first failing one). | runtime design |
|
|
223
|
-
| **fff**, Dmitriy Kovalenko, MIT, <https://github.com/dmtrKovalenko/fff> | File search. We reimplemented fff's ranking in plain JavaScript after reading its Rust sources (`crates/fff-core/src/score.rs`, `dbs/frecency.rs`, `path_utils.rs`); the formulas and constants are fff's, the code is ours, and nothing runs out of process.
|
|
224
|
-
|
|
225
|
-
fff is © Dmitriy Kovalenko and contributors, released under the MIT License; this package is also MIT. If you install fff's own Pi extension (`@ff-labs/pi-fff`) alongside supernova, its `ffgrep`/`fffind` tools are captured and callable through `nova.call` like any other host tool.
|
|
225
|
+
| **fff**, Dmitriy Kovalenko, MIT, <https://github.com/dmtrKovalenko/fff> | File search. We reimplemented fff's ranking in plain JavaScript after reading its Rust sources (`crates/fff-core/src/score.rs`, `dbs/frecency.rs`, `path_utils.rs`); the formulas and constants are fff's, the code is ours, and nothing runs out of process. Bounded fuzzy filename hints now run automatically for unmatched bare source names, using in-memory frecency and directory distance without extra filesystem probes. The full internal search implementation also retains typo-tolerant fuzzy path matching with boundary/consecutive/case bonuses; smart-case; exact-filename +40% and filename +20% bonuses; frecency boost `base·f/100` with fff's AI-mode decay (3-day half-life, 7-day window) and modification-recency steps (30s/5m/15m/1h/4h); git-modified +15%; directory-distance penalty from the current file (−1 per hop, floor −20); definition-first result hinting; fuzzy fallback on zero literal matches; weak-match cutoff; watcher-driven index refresh. Git/mtime boosts and full indexed grep are not mandatory stages of ordinary reads. Not ported: fff's SIMD/frizbee matcher (ours is an fzf-style greedy match with backward tightening), LMDB persistence (frecency is per session), and the MCP/Neovim surfaces. | `src/context/fuzzy.js`, `src/context/repo-index.js`, `src/bridge/host-bridge.js` |
|
|
226
226
|
|
|
227
227
|
## License
|
|
228
228
|
|
|
229
|
-
MIT
|
|
229
|
+
MIT. fff is © Dmitriy Kovalenko and contributors, also MIT.
|
|
@@ -1,6 +1,59 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## [
|
|
3
|
+
## [0.3.1] - 2026-09-06
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- Preserve post-edit coordinates for patch deletions, including zero-length new ranges. After an earlier hunk inserts lines, the edit result now opens the actual deletion region rather than an unrelated earlier source window. File mutation semantics are unchanged.
|
|
8
|
+
|
|
9
|
+
### Tests
|
|
10
|
+
|
|
11
|
+
- Add a focused shifted-deletion regression and an opt-in stress runner that can target an isolated npm installation. Cover concurrent programs, 129-read batches, contended writes, cancellation after confirmed staging, immutable progress frames, source fidelity and cold lookup across 5,000 files.
|
|
12
|
+
|
|
13
|
+
## [0.3.0] - 2026-09-05
|
|
14
|
+
|
|
15
|
+
### Source operations
|
|
16
|
+
|
|
17
|
+
- Source questions now locate and open the selected file in one read, using bounded direct ripgrep search without a prerequisite index. Successful reads return raw source rather than a JSON location preview; `read({query,resolve:true})` supplies structured source/status for resolve-to-edit programs. Filename discovery remains a transient fallback; ambiguous and incomplete searches never select a file.
|
|
18
|
+
- Reuse lexical stemming for natural-language source questions. Preserve whole-file text when it fits, and exact line ranges/continuations for oversized files, including escaped structured output.
|
|
19
|
+
- Return separate post-edit windows for distant changes; correct shifted multi-edit coordinates, staged caller references, focused-read freshness, outline header numbers and clipped evidence provenance. Admit lexical evidence hits before filling the candidate cap with unrelated paths.
|
|
20
|
+
- Preserve original read expectations across write-diff reads. Revalidate mutation paths at commit and invalidate path checks after shell execution. Preserve diagnostics when hosts return text-only failure envelopes.
|
|
21
|
+
- Keep outlines and graph evidence available through explicit read options, not mandatory stages of question reads. No context deduplication or source compression is enabled.
|
|
22
|
+
|
|
23
|
+
### Automatic command integration
|
|
24
|
+
|
|
25
|
+
- Route patch edits through the same post-edit source/check/reference summary as replacements. Infer lexical enclosing declaration hints for body-only changes from the edited file, not a repository build.
|
|
26
|
+
- Search changed names together in one bounded, cancellable ripgrep call, overlay staged callers, and disclose partial/unavailable hints. Cold lookup avoids per-file JavaScript indexing; already-warm indexed scans can still be faster.
|
|
27
|
+
- Reuse fuzzy/frecency/directory ranking automatically for unmatched bare source names, without extra search processes or arbitrary selection. Cap fuzzy work and disclose incomplete hints.
|
|
28
|
+
- Report structural warnings on ordinary writes without repeating their payload. Attach fresh workspace source to shell failures/timeouts, respect command cwd and absolute locations, and exclude external symlink targets.
|
|
29
|
+
|
|
30
|
+
### Performance
|
|
31
|
+
|
|
32
|
+
- Render dense multiline string-array returns as unchanged, length-framed source when this avoids escaping overhead. Preserve values, sparse/mixed-array behavior and explicit truncation. No model-side join or source compression is required.
|
|
33
|
+
- Negotiate direct executable argv for the owned POSIX shell adapter, avoiding shell startup and repeated argument payloads in failures/timeouts. Keep quoted-shell compatibility for older/delegated executors; string commands retain shell semantics.
|
|
34
|
+
- On POSIX timeout/cancellation, skip the escalation delay only after the owned process group is proven absent. Surviving descendants still receive the existing escalation; Windows behavior is unchanged.
|
|
35
|
+
- Bound and memoize terminal width measurements, with an oracle-checked single-column chrome fast path and full Unicode fallback. Avoid rebuilding already-clean terminal text.
|
|
36
|
+
- Deliver completed results before preparing the next pristine worker; cancel scheduled preparation on shutdown. Worker isolation remains unchanged.
|
|
37
|
+
- Overlap independent replacement/backup staging while settling both before cleanup. Avoid redundant cleanup probes without relaxing conflict detection, rollback or file-mode preservation.
|
|
38
|
+
- Report configurable engine sample counts, raw latency samples, p99 and observed maxima. These are local measurements, not universal sub-millisecond or provider-latency guarantees.
|
|
39
|
+
|
|
40
|
+
### Changed
|
|
41
|
+
|
|
42
|
+
- Expose one `supernova({code})` tool on Pi and OMP. Only `read`, `edit`, `write`, and `bash` are guest commands; legacy guest aliases are removed.
|
|
43
|
+
- Coalesce independently started reads while preserving per-call budgets, ordered values and structured failures. Preserve mutation/checkpoint barriers and prepare one pristine worker for the next invocation.
|
|
44
|
+
- Fold outlines, evidence selection, multi-edits, patches and filesystem checkpoints into the four commands. Remove unrelated schema conversion from program startup.
|
|
45
|
+
- Preserve returned image blocks, self-contained repeat reads and exact line continuations. Bound error output and signal failed executions by throwing. Shell environment reflects the current execution context.
|
|
46
|
+
- Move implementation into `src/` and replace the old `test/` suite with `tests/`. The original 12 failure-first acceptance tests pass unchanged; additional strict regressions, explicit actual-host checks and local engine measurements are included.
|
|
47
|
+
|
|
48
|
+
- Cache parsed text diffs with bounded retention, avoiding repeated normalization on repaint while preserving counts, previews and changed content.
|
|
49
|
+
- Fully restart Pi/OMP after updating JavaScript sources; Pi 0.85.1 retains native ESM dependencies across `/reload`. Keep `supernova` pinned in deferred-tool setups, not the four guest commands.
|
|
50
|
+
|
|
51
|
+
### Fixed
|
|
52
|
+
|
|
53
|
+
- Partial batch reads retain successful files and label failures; explicit external reads work while writes remain workspace-scoped.
|
|
54
|
+
- Concurrent edits no longer silently lose successful changes. Stale commits and conflicting symlink aliases fail explicitly.
|
|
55
|
+
- Internal worker startup accepts stdin/eval host flags; command timeout errors retain bounded diagnostics.
|
|
56
|
+
- Internal CodeMode cards bound hidden-diff processing and coalesce progress updates without back-to-back frames.
|
|
4
57
|
|
|
5
58
|
## [0.2.0] - 2026-09-04
|
|
6
59
|
|