ds4-context-engine 0.3.3 → 0.3.4
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 +40 -5
- package/docs/ADR/059-optional-anchored-editing.md +51 -0
- package/docs/ADR/060-optional-portable-agent-tools.md +38 -0
- package/docs/ADR/README.md +2 -0
- package/docs/ANCHORED_EDITING.md +144 -0
- package/docs/ARCHITECTURE.md +38 -0
- package/docs/PORTABLE_AGENT_TOOLS.md +86 -0
- package/docs/releases/0.3.3.md +22 -2
- package/docs/releases/0.3.4.md +63 -0
- package/package.json +2 -2
- package/src/extension/adaptive-read-tool.ts +47 -0
- package/src/extension/anchored-edit-tool.ts +157 -0
- package/src/extension/anchored-edit.ts +53 -0
- package/src/extension/bash-job-tool.ts +149 -0
- package/src/extension/index.ts +18 -0
- package/src/extension/post-edit-report.ts +134 -0
- package/src/extension/runtime.ts +10 -5
- package/src/pi-adapter/version.ts +1 -1
- package/src/tools/bash-job-manager.ts +176 -0
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ bounded active context with provenance
|
|
|
16
16
|
Pi provider
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
> **Project status:**
|
|
19
|
+
> **Project status:** The coordinated `0.3.4` release adds optional anchored editing, post-edit reports, adaptive reads, adaptive artifact budgets and managed local bash jobs. All five switches default to off. It carries forward the stable 0.3 line's persistence, offline storage maintenance, dedicated compaction model and configurable transport retries. Canonical history, SQLite schema 15 and runtime contracts remain unchanged; Pi remains pinned to `0.84.3`. See the [0.3.4 release record](docs/releases/0.3.4.md) for validation and publication status.
|
|
20
20
|
|
|
21
21
|
## Why DS4
|
|
22
22
|
|
|
@@ -87,12 +87,12 @@ Install the latest stable public npm package with:
|
|
|
87
87
|
pi install npm:ds4-context-engine
|
|
88
88
|
```
|
|
89
89
|
|
|
90
|
-
The
|
|
90
|
+
The three packages (`ds4-context-engine`, `ds4-context-core`, and `ds4-context-reference-adapter`) are released together with the same exact version. Both adapters require the matching core version. See [0.3.4](docs/releases/0.3.4.md) for this release's changes and compatibility.
|
|
91
91
|
|
|
92
92
|
To dogfood the beta without replacing a global stable installation, pin the exact version in a disposable project:
|
|
93
93
|
|
|
94
94
|
```bash
|
|
95
|
-
pi install -l npm:ds4-context-engine@0.3.0-beta.
|
|
95
|
+
pi install -l npm:ds4-context-engine@0.3.0-beta.3
|
|
96
96
|
```
|
|
97
97
|
|
|
98
98
|
Follow the [0.3 beta dogfooding runbook](docs/DOGFOODING_0.3.0_BETA.md); use synthetic data and a dedicated session directory.
|
|
@@ -209,7 +209,7 @@ Valid privacy classifications are `normal`, `internal`, `sensitive` and `local-o
|
|
|
209
209
|
|
|
210
210
|
### LLM-callable tools
|
|
211
211
|
|
|
212
|
-
DS4 registers two model-callable tools:
|
|
212
|
+
DS4 registers two model-callable tools by default:
|
|
213
213
|
|
|
214
214
|
| Tool | Purpose |
|
|
215
215
|
| --- | --- |
|
|
@@ -220,6 +220,24 @@ DS4 registers two model-callable tools:
|
|
|
220
220
|
|
|
221
221
|
Canonical Pin and Memory changes append Pi custom entries and reconcile disposable SQLite projections. Project-memory source include/exclude is derived local SQLite policy and never appends a fake canonical entry. See [`docs/CONTEXT_PERSISTENCE_TOOL.md`](docs/CONTEXT_PERSISTENCE_TOOL.md).
|
|
222
222
|
|
|
223
|
+
**Optional anchored editing:** `/context config set editing.anchored true`, then
|
|
224
|
+
`/reload`, enables a same-name `edit` wrapper. Use `head[upto]tail` in `oldText` to
|
|
225
|
+
replace an inclusive range without repeating its intermediate old content. Exact
|
|
226
|
+
anchors are validated inside Pi's native mutation queue; ordinary calls and diff
|
|
227
|
+
feedback remain native. All edits in a batch containing anchors must match exactly.
|
|
228
|
+
Use per-edit `literal: true` for real marker text.
|
|
229
|
+
Disabled by default; no inference-time forcer or provider change is involved.
|
|
230
|
+
See [`docs/ANCHORED_EDITING.md`](docs/ANCHORED_EDITING.md) for semantics and limits.
|
|
231
|
+
|
|
232
|
+
**Other optional agent tools:** `editing.postEditReport` adds bounded old/new line
|
|
233
|
+
ranges and updated context; `reading.adaptive` chooses model-window-aware default
|
|
234
|
+
read limits; `artifacts.adaptiveBudget` lowers inline/excerpt caps under context
|
|
235
|
+
pressure; `jobs.enabled` exposes confirmed, session-owned local `bash_job`
|
|
236
|
+
start/status/stop/list operations. All default off and require session reload after
|
|
237
|
+
configuration changes. Jobs are a separate module, not a replacement for `bash`.
|
|
238
|
+
See [`docs/PORTABLE_AGENT_TOOLS.md`](docs/PORTABLE_AGENT_TOOLS.md) for activation,
|
|
239
|
+
limits, privacy and lifecycle behavior.
|
|
240
|
+
|
|
223
241
|
Learned-ranking feedback and local training are explicit:
|
|
224
242
|
|
|
225
243
|
```text
|
|
@@ -250,6 +268,16 @@ The following example shows the main configuration groups. Omitted values use th
|
|
|
250
268
|
"maxProjectTokens": 20000,
|
|
251
269
|
"maxSummaryTokens": 12000
|
|
252
270
|
},
|
|
271
|
+
"editing": {
|
|
272
|
+
"anchored": false,
|
|
273
|
+
"postEditReport": false
|
|
274
|
+
},
|
|
275
|
+
"reading": {
|
|
276
|
+
"adaptive": false
|
|
277
|
+
},
|
|
278
|
+
"jobs": {
|
|
279
|
+
"enabled": false
|
|
280
|
+
},
|
|
253
281
|
"retrieval": {
|
|
254
282
|
"exact": true,
|
|
255
283
|
"fts": true,
|
|
@@ -287,6 +315,7 @@ The following example shows the main configuration groups. Omitted values use th
|
|
|
287
315
|
},
|
|
288
316
|
"artifacts": {
|
|
289
317
|
"enabled": true,
|
|
318
|
+
"adaptiveBudget": false,
|
|
290
319
|
"maxInlineToolResultChars": 12000,
|
|
291
320
|
"maxArtifactBytes": 100000000,
|
|
292
321
|
"maxSearchBytes": 50000000,
|
|
@@ -477,8 +506,14 @@ scripts package and release-readiness checks
|
|
|
477
506
|
- [Roadmap 0.2.0](docs/ROADMAP_0.2.0.md)
|
|
478
507
|
- [Release process](docs/RELEASING.md)
|
|
479
508
|
- [0.2.0 release readiness](docs/RELEASE_READINESS_0.2.0.md)
|
|
509
|
+
- [0.3.4 release notes](docs/releases/0.3.4.md)
|
|
510
|
+
- [0.3.3 release notes](docs/releases/0.3.3.md)
|
|
511
|
+
- [0.3.2 release notes](docs/releases/0.3.2.md)
|
|
512
|
+
- [0.3.1 release notes](docs/releases/0.3.1.md)
|
|
513
|
+
- [0.3.0 release notes](docs/releases/0.3.0.md)
|
|
480
514
|
- [0.2.0 release notes](docs/releases/0.2.0.md)
|
|
481
515
|
- [0.2.0-rc.1 release notes](docs/releases/0.2.0-rc.1.md)
|
|
516
|
+
- [0.3.0-beta.3 prerelease notes](docs/releases/0.3.0-beta.3.md)
|
|
482
517
|
- [0.3.0-beta.2 prerelease notes](docs/releases/0.3.0-beta.2.md)
|
|
483
518
|
- [0.3.0-beta.1 prerelease notes](docs/releases/0.3.0-beta.1.md)
|
|
484
519
|
- [0.3.0-alpha.5 prerelease notes](docs/releases/0.3.0-alpha.5.md)
|
|
@@ -493,7 +528,7 @@ scripts package and release-readiness checks
|
|
|
493
528
|
|
|
494
529
|
The original M0–M13 roadmap is complete. `ds4-context-core` contains the compiled runtime-neutral implementation. M14 context-quality metrics, M15 rich symbol indexing, M16 hybrid semantic retrieval, M17 cross-session project memory, M18 learned-ranking shadow evaluation, M19's runtime adapter/conformance kit, and M20 opt-in local KV eligibility/replay are implemented on `main`. Learned active ranking remains promotion-gated, Pi reports local KV as unsupported, and static ranking/native completion stay authoritative on every failure.
|
|
495
530
|
|
|
496
|
-
The [0.2.0 roadmap](docs/ROADMAP_0.2.0.md) is complete.
|
|
531
|
+
The [0.2.0 roadmap](docs/ROADMAP_0.2.0.md) is complete. The stable 0.3 line carries forward the [context persistence tool](docs/CONTEXT_PERSISTENCE_TOOL.md), privacy-safe [compaction](docs/COMPACTION.md), bounded persisted manifests, cooperative client leases and recoverable offline maintenance. Version 0.3.4 adds opt-in [anchored editing](docs/ANCHORED_EDITING.md) and [portable agent tools](docs/PORTABLE_AGENT_TOOLS.md), without backend rewind, forced sampling or operational KV integration. Confirmation, provenance, Pi fallback and canonical/configuration/SQLite/runtime contracts remain unchanged. The [0.2 readiness record](docs/RELEASE_READINESS_0.2.0.md) remains the compatibility baseline; the lexical planner stays available as the deterministic fallback.
|
|
497
532
|
|
|
498
533
|
## Contributing
|
|
499
534
|
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# ADR 059 — Optional execution-time anchored editing
|
|
2
|
+
|
|
3
|
+
Status: Accepted
|
|
4
|
+
|
|
5
|
+
## Context
|
|
6
|
+
|
|
7
|
+
DS4's standalone agent supports `head[upto]tail` replacement and an optional
|
|
8
|
+
inference-time marker forcer. The former is portable tool semantics; the latter
|
|
9
|
+
requires backend control over generation state. Pi already provides batch edits,
|
|
10
|
+
mutation serialization, normalization, cancellation and diff feedback.
|
|
11
|
+
|
|
12
|
+
## Decision
|
|
13
|
+
|
|
14
|
+
- Add the default-off `editing.anchored` configuration key, gated by the DS4 master
|
|
15
|
+
switch and loaded through existing trusted configuration handling.
|
|
16
|
+
- Register a same-name `edit` override only when enabled and native edit is not
|
|
17
|
+
already replaced. Do not introduce an additional tool or force tool activation.
|
|
18
|
+
- Support one marker between nonempty, non-whitespace exact anchors, inclusive
|
|
19
|
+
replacement and suffix-only tail uniqueness. Add per-edit `literal: true` to
|
|
20
|
+
escape real marker text. Preserve native edit behavior without marker syntax.
|
|
21
|
+
- Expand anchors using private copies inside native `EditOperations.readFile`,
|
|
22
|
+
under Pi's own mutation queue, then delegate batch validation and writing to
|
|
23
|
+
`createEditToolDefinition`. Do not copy Pi's editing implementation or expand in
|
|
24
|
+
an unqueued `tool_call` hook.
|
|
25
|
+
- Require exact matching for all edits in a batch containing anchors: native
|
|
26
|
+
fuzzy fallback changes the whole batch's coordinate space and can relocate an
|
|
27
|
+
exact anchored span. Marker-free calls retain native fuzzy behavior.
|
|
28
|
+
- Keep native normalized ambiguity checks, even when stricter than exact anchor
|
|
29
|
+
validation. Invalid anchored edits fail closed, without a fallback to a broader
|
|
30
|
+
match. ADR 008's context-planning fallback is not permission to guess file edits.
|
|
31
|
+
- Preserve native diff results and append compact original-line range metadata.
|
|
32
|
+
Skip marker-unaware native previews until the actual result diff is available.
|
|
33
|
+
- Restore the native definition if the same extension instance later loads
|
|
34
|
+
disabled configuration; a fresh disabled load registers no editing override.
|
|
35
|
+
|
|
36
|
+
## Consequences
|
|
37
|
+
|
|
38
|
+
No provider change, Pi fork or dependency upgrade is required for execution-time
|
|
39
|
+
anchors. Only the configuration shape enters the portable core; filesystem/tool
|
|
40
|
+
integration stays in the Pi extension. Existing configuration defaults otherwise
|
|
41
|
+
remain unchanged, and the additive compatibility golden is updated.
|
|
42
|
+
|
|
43
|
+
The adapter relies on native edit reading through the supplied operations before
|
|
44
|
+
matching the provided edit array, while holding its shared queue. Tests against
|
|
45
|
+
Pi 0.84.3 pin that ordering and cancellation behavior. Dependency upgrades must
|
|
46
|
+
re-run these contracts. Other edit overrides, external editors/processes, atomic
|
|
47
|
+
writes and backend generation-state control remain outside the guarantee.
|
|
48
|
+
|
|
49
|
+
See [usage and limitations](../ANCHORED_EDITING.md). No automatic marker forcer,
|
|
50
|
+
constrained grammar, live configuration activation or measured provider savings
|
|
51
|
+
are part of this decision.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# ADR 060 — Optional portable DS4 agent improvements
|
|
2
|
+
|
|
3
|
+
Status: accepted and implemented; included in the coordinated 0.3.4 release. Backend integration remains excluded.
|
|
4
|
+
|
|
5
|
+
## Boundary
|
|
6
|
+
|
|
7
|
+
Pi remains the agent runtime and JSONL remains canonical history. These changes add optional tool behavior, not another agent loop. No inference rewind, forced sampling, native KV handles, database migration or dependency upgrade is included.
|
|
8
|
+
|
|
9
|
+
Four independently default-off switches, also gated by `enabled`:
|
|
10
|
+
|
|
11
|
+
- `editing.postEditReport`: bounded report from the actual native unified patch, including changed old/new ranges, line delta and post-edit context. Works independently of `editing.anchored`.
|
|
12
|
+
- `reading.adaptive`: choose the default `read` limit from the execution-time model window (120 / 240 / 500 lines at <=8192 / <=16384 / larger windows). Explicit limits, images, cancellation and native byte caps remain native. No shared `more` cursor.
|
|
13
|
+
- `artifacts.adaptiveBudget`: lower inline/excerpt limits according to the calibrated context budget after output/safety reserves and estimated fixed overhead. Never increase configured limits. Preserve minimum reference metadata, canonical results, provenance, privacy, atomic tool groups and normal planner fallback. This is an estimate, not a guaranteed fit or reentrant compaction trigger.
|
|
14
|
+
- `jobs.enabled`: opt-in `bash_job` module in this repository, separate from the portable core and existing `bash`. A single start/status/stop/list tool manages local jobs through Pi's public local BashOperations.
|
|
15
|
+
|
|
16
|
+
## Editing and reading
|
|
17
|
+
|
|
18
|
+
Do not take over missing or visibly overridden native tools. Restore native definitions when an already-enabled instance loads disabled configuration. Fresh disabled loads register no override. Render the real native diff; report failures must not turn a successful write into an apparent failure. Limit report regions, context and escaped text; never re-read a potentially changed file for reporting. Retain ADR 059's strict mixed-anchor batch behavior.
|
|
19
|
+
|
|
20
|
+
## Adaptive artifacts
|
|
21
|
+
|
|
22
|
+
Use provider-facing privacy-sanitized messages only, and the same calibrated model budget as the planner. Keep all configured storage/search caps. Share the available text budget among candidate results, with a metadata floor bounded by the configured maximum. Missing/invalid budget data keeps static behavior. Rebuild uses the conservative adaptive floor so artifacts from earlier small-budget contexts remain reconstructible. No policy values or canonical messages are mutated. Do not replace a result with a larger estimated result.
|
|
23
|
+
|
|
24
|
+
## Local jobs
|
|
25
|
+
|
|
26
|
+
- Require an active built-in local `bash`, no conflicting `bash_job`, explicit configuration, project trust, and local UI confirmation for every start. No UI means no start. This separate tool does not inherit other extensions' bash-only permission policies or SDK shell options.
|
|
27
|
+
- Use opaque job IDs, not arbitrary PIDs. Owner is the current session plus the originating branch entry. Status/stop/list never cross that boundary.
|
|
28
|
+
- At most 4 concurrent jobs and 16 retained records. Default timeout 300 seconds, hard maximum 3600 seconds. Cap each log at 8 MiB and stop on overflow or log-write failure.
|
|
29
|
+
- Logs are raw local files in a private temporary directory, not SQLite state. Responses contain bounded quoted head/tail excerpts and a local output path. Keep completed jobs until bounded eviction or session cleanup; explicitly report output truncation and stop reason.
|
|
30
|
+
- Cancellation while start is pending stops the new job. Once start returns, the job has an independent lifetime; cancelling status does not stop it. Stop and shutdown use native process-tree cancellation. No promise of rollback, daemon ownership or restart survival.
|
|
31
|
+
- Stop jobs and remove temporary logs on session replacement, reload and shutdown. Stop jobs made invisible by branch navigation. Compaction preserves processes and appends a bounded canonical metadata snapshot without launching another model turn; status must be refreshed before acting on old snapshots.
|
|
32
|
+
- Completion marks project indexing dirty. Never launch automatic follow-up turns.
|
|
33
|
+
|
|
34
|
+
## Verification
|
|
35
|
+
|
|
36
|
+
Cover independent opt-ins/default-off paths, legacy missing config, argument mutation, native matching and line endings, explicit read limits/images/model changes, estimated budgets/provenance/privacy/rebuild, process caps/timeouts/aborts/ownership/cleanup/compaction, and clean-consumer packaging. Linux process tests do not establish successful Windows execution; the native Pi backend owns platform-specific process handling.
|
|
37
|
+
|
|
38
|
+
Implementation validation: `npm run check` passed 78 files / 485 tests, including real local bash execution, stop and timeout. Quality comparison and persistence schema gates passed. Clean-consumer packaging passed with Pi 0.84.3 and eight real registry scenarios (core 231 files, reference adapter 7, engine 83). Packaging used a staging copy with the canonical root package manifest; pre-existing user `package.json` changes and `.serena/` were excluded. No provider-token/latency benchmark or Windows execution claim is made. That implementation validation preceded release preparation. See the [0.3.4 release record](../releases/0.3.4.md) for final release gates and publication evidence.
|
package/docs/ADR/README.md
CHANGED
|
@@ -62,5 +62,7 @@ The initial decisions from the development plan are accepted:
|
|
|
62
62
|
| 056 | Keep project-memory source exclusion as disposable derived SQLite policy | Accepted |
|
|
63
63
|
| 057 | Derive mutation provenance from the active branch and exclude model-supplied source IDs from V1 | Accepted |
|
|
64
64
|
| [058](058-bounded-manifest-storage.md) | Bound persisted manifests and defer compression to a versioned migration | Accepted |
|
|
65
|
+
| [059](059-optional-anchored-editing.md) | Opt in to anchored edit expansion inside Pi's native mutation queue | Accepted |
|
|
66
|
+
| [060](060-optional-portable-agent-tools.md) | Opt in to edit reports, adaptive reads/results and session-owned local jobs | Accepted |
|
|
65
67
|
|
|
66
68
|
Each decision will receive a dedicated record when implementation pressure introduces alternatives or consequences not already covered by the development plan.
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
# Optional anchored editing
|
|
2
|
+
|
|
3
|
+
DS4 can replace Pi's native `edit` definition with a compatible, opt-in wrapper.
|
|
4
|
+
This is execution-time editing, not a generation-time forcer. It works with any
|
|
5
|
+
provider that can call Pi tools; it does not require a custom inference backend.
|
|
6
|
+
|
|
7
|
+
## Enable or disable
|
|
8
|
+
|
|
9
|
+
Default: `editing.anchored: false`. In a trusted project:
|
|
10
|
+
|
|
11
|
+
```text
|
|
12
|
+
/context config set editing.anchored true
|
|
13
|
+
/reload
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Use `--global` on the config command to target the agent-directory configuration.
|
|
17
|
+
As with other DS4 config writes, the active session configuration is not changed
|
|
18
|
+
by `set`/`unset`; it is loaded on session startup/replacement or reload.
|
|
19
|
+
|
|
20
|
+
When updating a development checkout, rebuild the core (`npm run build:core`)
|
|
21
|
+
and fully restart Pi. Reloading extension TypeScript can retain previously loaded
|
|
22
|
+
compiled core modules. A core configuration without `editing` safely leaves this
|
|
23
|
+
feature disabled, but the updated core must be loaded to recognize the option.
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
{
|
|
27
|
+
"editing": { "anchored": true }
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
`enabled: false` also disables this override. `context.mode` still controls context
|
|
32
|
+
planning, not explicitly opted-in editing. Project configuration is ignored when
|
|
33
|
+
Pi does not trust the project; global configuration continues to apply.
|
|
34
|
+
|
|
35
|
+
On a fresh disabled load DS4 does not register `edit` at all. If an enabled
|
|
36
|
+
extension instance later loads disabled configuration, it restores Pi's native
|
|
37
|
+
edit definition, schema and guidelines. Pi has no public `unregisterTool`; a
|
|
38
|
+
reload while disabled removes DS4's registration entirely.
|
|
39
|
+
|
|
40
|
+
Registration is skipped if native `edit` is unavailable or already owned by
|
|
41
|
+
another extension/SDK tool, with a UI warning when available. DS4 does not enable
|
|
42
|
+
an inactive native edit tool. Only ownership reported by Pi can be checked: SDK
|
|
43
|
+
custom base tools labeled as built-ins cannot be distinguished through this API.
|
|
44
|
+
Do not enable this feature with other edit replacements or remote/sandbox edit
|
|
45
|
+
implementations; the registered wrapper uses local filesystem operations.
|
|
46
|
+
|
|
47
|
+
## Tool input
|
|
48
|
+
|
|
49
|
+
The tool name remains `edit`, with `path` and `edits[]`:
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"path": "src/example.ts",
|
|
54
|
+
"edits": [{
|
|
55
|
+
"oldText": "function oldImplementation() {\n[upto]\n}\n// end oldImplementation\n",
|
|
56
|
+
"newText": "function oldImplementation() {\n return improved();\n}\n// end oldImplementation\n"
|
|
57
|
+
}]
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Each anchored `oldText` must contain exactly one `[upto]` marker:
|
|
62
|
+
|
|
63
|
+
- The **head**, before the marker, must occur exactly once in the original file.
|
|
64
|
+
- The **tail**, after the marker, must occur exactly once after the end of the
|
|
65
|
+
head. The same tail occurring before the head is allowed.
|
|
66
|
+
- Both anchors must contain non-whitespace text. Spaces are significant.
|
|
67
|
+
- Newlines immediately after the marker are separators and are removed from the
|
|
68
|
+
tail needle, matching DS4's marker-line convention. Other whitespace is not
|
|
69
|
+
trimmed. Anchors may be inline; full distinctive lines are usually clearer.
|
|
70
|
+
- Replacement is **inclusive**: head, intermediate content and tail are all
|
|
71
|
+
replaced. Put anchors in `newText` if they should be retained.
|
|
72
|
+
- All edits refer to the original file, not previous replacements in the batch.
|
|
73
|
+
Overlaps (including mixed ordinary/anchored overlaps), missing or ambiguous
|
|
74
|
+
anchors and no-op batches are rejected without a write.
|
|
75
|
+
- No 64-byte/two-line threshold applies to manually supplied anchors; those DS4
|
|
76
|
+
thresholds belong to automatic marker forcing, which is not implemented here.
|
|
77
|
+
|
|
78
|
+
A marker is special only in `oldText`, never in `newText`. To match literal marker
|
|
79
|
+
text, set `literal: true` **on that edit**:
|
|
80
|
+
|
|
81
|
+
```json
|
|
82
|
+
{
|
|
83
|
+
"path": "notes.md",
|
|
84
|
+
"edits": [{ "oldText": "[upto]", "newText": "range marker", "literal": true }]
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Calls without anchored edits use native Pi matching, including its normalized
|
|
89
|
+
fuzzy fallback (also for `literal: true` edits). **Every edit in a batch containing
|
|
90
|
+
anchors must match exactly**, ordinary edits included. Pi's fuzzy fallback changes
|
|
91
|
+
the coordinate space for the entire batch and can relocate an otherwise exact
|
|
92
|
+
anchored span; mixed fuzzy batches therefore fail closed. Re-read and correct the
|
|
93
|
+
ordinary oldText, or perform the ordinary edit separately and re-read before
|
|
94
|
+
anchored edits.
|
|
95
|
+
|
|
96
|
+
Exact matching uses BOM-free, LF-normalized original content. Expanded spans then
|
|
97
|
+
pass through native batch checks, including Pi's stricter normalized-ambiguity
|
|
98
|
+
check. Thus a range can be rejected even if its literal anchors pass, when the
|
|
99
|
+
expanded text is ambiguous under Pi's normalization. Re-read and disambiguate;
|
|
100
|
+
do not silently broaden the range.
|
|
101
|
+
|
|
102
|
+
## Execution and feedback
|
|
103
|
+
|
|
104
|
+
`src/extension/anchored-edit-tool.ts` uses public Pi `createEditToolDefinition` and
|
|
105
|
+
`EditOperations`. Its per-call read operation expands anchors only after native
|
|
106
|
+
edit has entered `withFileMutationQueue`. Native edit then performs batch matching,
|
|
107
|
+
overlap checks, cancellation checks, BOM/line-ending restoration, writing and
|
|
108
|
+
diff generation. It is deliberately **not** a `tool_call` preflight expansion:
|
|
109
|
+
there is no unqueued read followed by a later queued write.
|
|
110
|
+
|
|
111
|
+
Expansion uses private argument copies: the full old span is not inserted into
|
|
112
|
+
canonical tool-call arguments or sent back as an expanded input. Native results
|
|
113
|
+
and diff/patch details remain available, plus a compact text report of anchored
|
|
114
|
+
ranges in original line numbers. Canonical result details can still contain old
|
|
115
|
+
text through native diffs; this is not an output privacy/filtering feature.
|
|
116
|
+
|
|
117
|
+
The native TUI matcher cannot preview marker syntax. Anchored calls therefore
|
|
118
|
+
skip its pre-execution preview and display the **actual native result diff** after
|
|
119
|
+
execution. Ordinary edits retain their native preview behavior.
|
|
120
|
+
|
|
121
|
+
The shared Pi queue serializes cooperating edits/writes in the same runtime,
|
|
122
|
+
including symlink aliases. It is not a cross-process file lock, transaction with
|
|
123
|
+
external editors, atomic filesystem write or rollback guarantee. Cancellation
|
|
124
|
+
retains native behavior; once a write has begun it may still complete. Existing
|
|
125
|
+
`tool_call`/`tool_result` hooks continue to see the `edit` tool, not a new tool name.
|
|
126
|
+
Hooks that interpret `oldText` themselves must understand the opt-in syntax.
|
|
127
|
+
|
|
128
|
+
## Scope and verification
|
|
129
|
+
|
|
130
|
+
The implementation targets the project's Pi **0.84.3** dependency. No dependency
|
|
131
|
+
upgrade, provider grammar, streaming interception, KV rewind or forced continuation
|
|
132
|
+
is included. The reference adapter does not implement this Pi editing capability.
|
|
133
|
+
|
|
134
|
+
Tests cover exact matching, suffix-only tail uniqueness, overlapping matches,
|
|
135
|
+
malformed markers, literal escaping, mixed batches, fuzzy-fallback compatibility,
|
|
136
|
+
BOM/CRLF/Unicode, unchanged arguments, result diffs, cancellation, queue ordering,
|
|
137
|
+
symlinks, permissions, working-directory selection and session-bound registration.
|
|
138
|
+
The package smoke check also inspects the real Pi tool registry offline with the
|
|
139
|
+
flag absent, enabled, master-disabled and enabled while native edit is inactive
|
|
140
|
+
or unavailable.
|
|
141
|
+
A deterministic large-block fixture compares serialized request bytes and verifies
|
|
142
|
+
the same output as native editing. Real-provider reliability, token usage and
|
|
143
|
+
latency improvements have **not** been measured; shorter oldText can save generated
|
|
144
|
+
text, while the opt-in tool schema/instructions also add prompt overhead.
|
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -165,6 +165,44 @@ Pin and Memory mutations resolve provenance from the active Pi branch, revalidat
|
|
|
165
165
|
|
|
166
166
|
Historical tool arguments and results are a provider-egress surface even when general privacy is disabled. A dedicated guard removes content, query, key, reason, paths and raw errors while preserving only action linkage and safe IDs/revisions. Provenance IDs and source paths are runtime-derived; the model cannot supply them in the V1 schema. Post-append failures distinguish an indeterminate append from a known canonical commit with pending projection, so callers are never encouraged to retry blindly.
|
|
167
167
|
|
|
168
|
+
## Optional anchored editing
|
|
169
|
+
|
|
170
|
+
After trusted configuration loads at `session_start`, `editing.anchored` can
|
|
171
|
+
register a same-name native `edit` wrapper (default off, also gated by `enabled`).
|
|
172
|
+
The Pi extension resolves exact `head[upto]tail` ranges inside the native edit read
|
|
173
|
+
operation, under Pi's shared file mutation queue, then delegates batch checks,
|
|
174
|
+
cancellation, BOM/EOL handling, writing and diffs to native edit. Expansion never
|
|
175
|
+
rewrites canonical tool-call arguments. Calls without anchors retain native fuzzy
|
|
176
|
+
matching; every edit in an anchored batch must match exactly to prevent native
|
|
177
|
+
fuzzy rematching from moving its ranges. Invalid anchored edits fail closed.
|
|
178
|
+
No inference-state control is involved.
|
|
179
|
+
See [anchored editing](ANCHORED_EDITING.md) and [ADR 059](ADR/059-optional-anchored-editing.md).
|
|
180
|
+
|
|
181
|
+
## Other optional portable agent tools
|
|
182
|
+
|
|
183
|
+
`editing.postEditReport` derives bounded old/new coordinates, line deltas and
|
|
184
|
+
updated context from the actual native patch, independently of anchored editing.
|
|
185
|
+
`reading.adaptive` wraps native read with execution-time model-aware default line
|
|
186
|
+
limits; explicit limits and image/byte handling stay native. Both wrappers restore
|
|
187
|
+
native definitions when disabled and do not initially claim other tool overrides.
|
|
188
|
+
|
|
189
|
+
`artifacts.adaptiveBudget` is a pure portable-core policy applied per context to
|
|
190
|
+
privacy-prepared messages. It uses the calibrated planner budget and estimated
|
|
191
|
+
fixed overhead to lower inline/excerpt caps, never raises configured limits, and
|
|
192
|
+
preserves source identities and canonical history. Rebuild uses a conservative
|
|
193
|
+
floor to reconstruct earlier adaptive references. Normal planner fallback remains
|
|
194
|
+
responsible for oversized mandatory context.
|
|
195
|
+
|
|
196
|
+
`src/tools/bash-job-manager.ts` and `src/extension/bash-job-tool.ts` form a separate
|
|
197
|
+
optional local job module. It delegates process execution/cancellation to Pi's
|
|
198
|
+
public BashOperations, limits concurrency/log storage, enforces session/branch
|
|
199
|
+
ownership and requires local confirmation for starts. Jobs survive compaction but
|
|
200
|
+
not session replacement/reload/shutdown; compaction appends bounded metadata only.
|
|
201
|
+
There is no new agent loop, SQLite state, automatic model turn or backend KV control.
|
|
202
|
+
|
|
203
|
+
All new switches are default-off and master-gated. See [portable agent tools](PORTABLE_AGENT_TOOLS.md)
|
|
204
|
+
and [ADR 060](ADR/060-optional-portable-agent-tools.md).
|
|
205
|
+
|
|
168
206
|
## Boundaries
|
|
169
207
|
|
|
170
208
|
Dependency direction is one-way:
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Optional portable agent tools
|
|
2
|
+
|
|
3
|
+
These features are separate opt-ins, also gated by the DS4 master `enabled` switch. They do not implement inference rewind, forced sampling, or native KV-cache integration. Pi remains the agent runtime.
|
|
4
|
+
|
|
5
|
+
Enable only the features you want, then reload:
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
/context config set editing.postEditReport true
|
|
9
|
+
/context config set reading.adaptive true
|
|
10
|
+
/context config set artifacts.adaptiveBudget true
|
|
11
|
+
/context config set jobs.enabled true
|
|
12
|
+
/reload
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
All four default to `false`. Configuration writes apply on the next session load, not immediately. The default target is the trusted project configuration; add `--global` for the agent-directory file. Disable with the same commands using `false`, then reload.
|
|
16
|
+
|
|
17
|
+
## Post-edit reports
|
|
18
|
+
|
|
19
|
+
`editing.postEditReport` works with native ordinary edits, independently of `editing.anchored`. Enable both to combine reports with [`[upto]` ranges](ANCHORED_EDITING.md).
|
|
20
|
+
|
|
21
|
+
After a successful edit, the tool result content and details include:
|
|
22
|
+
|
|
23
|
+
- actual old/new changed ranges from Pi's native unified patch;
|
|
24
|
+
- total line delta and cumulative shift for subsequent lines;
|
|
25
|
+
- bounded numbered context from the updated content, encoded as quoted JSON data.
|
|
26
|
+
|
|
27
|
+
Regions combine nearby changes in the same native patch hunk. Zero-length ranges identify insertion/deletion boundaries. Coordinates refer to the completed write, not future file state. Reports include at most six regions and six short context lines per region; rendered report text stays below 6000 characters. The native patch/diff remains available and the TUI continues to display the native diff. There is no separate file read after the write and no change to matching or mutation queues. If reporting fails, the successful edit result is retained rather than encouraging a duplicate write.
|
|
28
|
+
|
|
29
|
+
## Adaptive reads
|
|
30
|
+
|
|
31
|
+
`reading.adaptive` changes only the default line limit of the native `read` tool:
|
|
32
|
+
|
|
33
|
+
| Execution-time model window | Default lines |
|
|
34
|
+
| --- | ---: |
|
|
35
|
+
| <= 8192 tokens | 120 |
|
|
36
|
+
| <= 16384 tokens | 240 |
|
|
37
|
+
| larger | 500 |
|
|
38
|
+
| missing/invalid model window | native default |
|
|
39
|
+
|
|
40
|
+
Explicit positive integer `offset`/`limit` values are honored; native byte limits can still shorten a response. Images, path resolution, access errors and cancellation remain native. The model is checked on each execution, so switching models does not require reload. Arguments are copied, not rewritten in canonical tool calls.
|
|
41
|
+
|
|
42
|
+
Use the native continuation notice, e.g. `offset=121`, to read more. There is deliberately no shared `more` cursor, which could become ambiguous after concurrent reads, branching or compaction. This does not reduce the native reader's full-file I/O or memory use.
|
|
43
|
+
|
|
44
|
+
Both file overrides skip initial registration if their built-in tool is missing or visibly overridden. Disabling an already-enabled instance restores the native definition; fresh disabled loads register nothing. Compatibility is tested against the project's Pi dependency, currently `0.84.3`. Custom SDK/remote filesystem integrations are not covered by these local wrappers.
|
|
45
|
+
|
|
46
|
+
## Adaptive tool-result/artifact budget
|
|
47
|
+
|
|
48
|
+
`artifacts.adaptiveBudget` operates only where artifact offload already operates: DS4 enabled, managed context, and artifact storage enabled/available.
|
|
49
|
+
|
|
50
|
+
The per-context policy uses the same calibrated active input budget as the planner, after output reserve and safety margin. It subtracts estimated system/tool-schema overhead, other messages and non-text blocks, then shares 75% of remaining capacity among candidate text results. It can only lower `artifacts.maxInlineToolResultChars` and `artifacts.excerptChars`, never raise them. The reference-metadata floor is 1600 characters or the configured inline maximum, whichever is smaller.
|
|
51
|
+
|
|
52
|
+
This is estimated budgeting, not a tokenizer-exact fit guarantee. Irreducible metadata, errors, missing provenance or unavailable storage can still leave a context oversized. The existing planner and fallback behavior remain responsible; there is no recursive `ctx.compact()` call inside the context hook.
|
|
53
|
+
|
|
54
|
+
Canonical Pi messages stay unchanged. Only privacy-prepared provider-facing text is transformed, with the original tool identity, source IDs and non-text blocks preserved. Artifact storage/search caps and branch/privacy checks remain unchanged. Rebuild uses the conservative adaptive floor so earlier small-budget artifacts remain reconstructible; consequently it may reconstruct more small artifacts than the fixed-threshold policy. A result is not replaced with a larger estimated result.
|
|
55
|
+
|
|
56
|
+
## Managed local bash jobs
|
|
57
|
+
|
|
58
|
+
The `bash_job` tool is implemented in a separate optional module, not in the portable core. It does not replace `bash` and is not a new agent loop or a separate published package.
|
|
59
|
+
|
|
60
|
+
Examples of tool arguments:
|
|
61
|
+
|
|
62
|
+
```json
|
|
63
|
+
{"action":"start","command":"npm test","timeout":300}
|
|
64
|
+
{"action":"list"}
|
|
65
|
+
{"action":"status","id":"<returned-job-id>"}
|
|
66
|
+
{"action":"stop","id":"<returned-job-id>"}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Authorization and execution
|
|
70
|
+
|
|
71
|
+
- Requires an active built-in local `bash`, an unclaimed `bash_job` name, a trusted project, and local UI confirmation for every start. Missing UI or refused confirmation means no command starts. Tool-call arguments are revalidated, and the confirmed command/cwd/timeout are snapshotted.
|
|
72
|
+
- Executes in the current working directory using Pi's public local BashOperations. It **does not inherit** custom bash-only permission hooks, remote/sandbox behavior, SDK shell settings/command prefixes, or session-specific `PI_*` injection. It must not be used to bypass those controls. The confirmation explicitly identifies the local execution boundary.
|
|
73
|
+
- Status/stop/list use opaque IDs owned by the current session and originating branch entry, never arbitrary PIDs. Stop remains available for owned jobs even if bash is later deactivated.
|
|
74
|
+
- Four running jobs maximum; sixteen retained records maximum. Oldest completed records/logs are evicted first. Timeout defaults to 300 seconds; valid range is 1–3600 seconds.
|
|
75
|
+
|
|
76
|
+
### Output and lifecycle
|
|
77
|
+
|
|
78
|
+
Logs combine stdout/stderr in native arrival order. Each private local log is capped at 8 MiB; reaching the cap or a write error stops the job. Status returns at most 512 bytes of head plus 512 bytes of non-overlapping tail, quoted in JSON, and the local output path. For larger logs, read that path while the session remains open. `outputTruncated` also indicates omitted middle output; `status=output-limit` distinguishes a capped log. A nonzero exit code is reported, not hidden.
|
|
79
|
+
|
|
80
|
+
Successful start returns immediately; subsequent agent cancellation does not silently kill the independently running job. Cancelling a status request does not stop it. Use `stop` explicitly. Completion marks project indexing dirty but does not trigger another model turn.
|
|
81
|
+
|
|
82
|
+
Jobs survive compaction. The extension appends a bounded canonical **metadata snapshot** after compaction, without command/output text or a follow-up model request. Refresh status before acting on any old snapshot. Branch navigation stops jobs no longer visible from the new branch; ancestor-owned jobs remain visible. Session replacement, reload and graceful shutdown stop jobs and remove their logs. State is not persisted in SQLite, Memory or Pins and is not restored after restart.
|
|
83
|
+
|
|
84
|
+
Native Pi handles process-tree cancellation. There is no rollback of command side effects and no guarantee of controlling deliberately escaped daemons. Forced process termination/crashes can leave temporary logs; abrupt-exit cleanup is not guaranteed. Raw logs can contain secrets: do not publish or persist them blindly. Linux tests do not establish Windows execution success.
|
|
85
|
+
|
|
86
|
+
Architecture: [ADR 060](ADR/060-optional-portable-agent-tools.md).
|
package/docs/releases/0.3.3.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# DS4 Context Engine 0.3.3
|
|
2
2
|
|
|
3
|
-
Status:
|
|
3
|
+
Status: published 2026-09-04 as stable, printed under the npm `latest` dist-tag, tagged `v0.3.3`.
|
|
4
4
|
|
|
5
5
|
This release adds a configurable transport retry policy for compaction summary requests on top of the 0.3.2 stable candidate. It carries forward 0.3.2 without changing canonical records, SQLite schema, runtime contracts, retention limits, privacy policy, compaction validation, or fallback semantics.
|
|
6
6
|
|
|
@@ -43,7 +43,7 @@ ds4-context-reference-adapter
|
|
|
43
43
|
ds4-context-engine
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
Both adapters depend exactly on `ds4-context-core@0.3.3`. Publication uses npm's default `latest` tag for all three packages. GitHub Actions remains validation-only with OIDC and package-write permissions denied.
|
|
46
|
+
Both adapters depend exactly on `ds4-context-core@0.3.3`. Publication uses npm's default `latest` tag for all three packages: `latest` now resolves to `0.3.3` (previously `0.3.2`), `beta` remains `0.3.0-beta.3`, `alpha` remains `0.3.0-alpha.5`, and `rc` remains `0.2.0-rc.1`. GitHub Actions remains validation-only with OIDC and package-write permissions denied.
|
|
47
47
|
|
|
48
48
|
## Candidate validation
|
|
49
49
|
|
|
@@ -58,3 +58,23 @@ Local candidate verification on Node.js `26.5.1`:
|
|
|
58
58
|
- Version, exact core dependencies, package-lock entries, extension constant, and reference-adapter constant are synchronized to `0.3.3`.
|
|
59
59
|
|
|
60
60
|
Validation-only CI is recorded below with the release commit. Exact registry verification and the annotated tag are recorded after execution.
|
|
61
|
+
|
|
62
|
+
## Validation-only CI
|
|
63
|
+
|
|
64
|
+
Release commit `5d636cc` (chore(release): prepare 0.3.3); CI run `33921584110` on Node `22.19.0` and `24.x`. The first Node 22.19.0 attempt hit a one-off `upgrade-rebuild` migration test timeout (5 s default) on the shared runner; the exact same test passes locally and on the re-run, and the rerun completed `success` on both Node versions.
|
|
65
|
+
|
|
66
|
+
## Registry verification and tag
|
|
67
|
+
|
|
68
|
+
Published manually in dependency order with npm's default `latest` tag after `npm whoami` confirmed `alucard_24`:
|
|
69
|
+
|
|
70
|
+
- `ds4-context-core@0.3.3`; shasum `5db4c81a9c6a8861bf6612d499abec7fb576e411`;
|
|
71
|
+
- `ds4-context-reference-adapter@0.3.3`; shasum `7a251de9735968776d21ed16a2e10786ea2bc2ef`;
|
|
72
|
+
- `ds4-context-engine@0.3.3`; shasum `cb107f9e28d89e860b3b05118f374a9c9969b58c`.
|
|
73
|
+
|
|
74
|
+
`npm run registry:check -- 0.3.3` passed: fresh-install exact core/adapters, public core/KV exports, compiled reference conformance, packaged quality corpus, installed `ds4-context-storage` CLI shim probe, and published Pi extension startup through isolated offline RPC state. The first check attempt hit a stale npm cache ETARGET for `ds4-context-engine@0.3.3`; a direct registry query confirmed all three artifacts and dist-tags, and the retry passed.
|
|
75
|
+
|
|
76
|
+
npm dist-tags for all three packages: `latest=0.3.3`, `beta=0.3.0-beta.3`, `alpha=0.3.0-alpha.5`, `rc=0.2.0-rc.1`.
|
|
77
|
+
|
|
78
|
+
Annotated tag `v0.3.3` was pushed and the GitHub Release was created:
|
|
79
|
+
|
|
80
|
+
https://github.com/Alucard24/ds4-context-engine/releases/tag/v0.3.3
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# DS4 Context Engine 0.3.4
|
|
2
|
+
|
|
3
|
+
Status: release candidate; publication pending final validation and CI.
|
|
4
|
+
|
|
5
|
+
## Added since 0.3.3
|
|
6
|
+
|
|
7
|
+
Five independent opt-ins, all default-off and gated by the master `enabled` switch:
|
|
8
|
+
|
|
9
|
+
- **`editing.anchored`**: exact, inclusive `head[upto]tail` replacements, expanded under Pi's native mutation queue. Literal escaping, mixed-batch exactness, native cancellation/line endings and real result diffs are preserved. No generation-time marker forcing.
|
|
10
|
+
- **`editing.postEditReport`**: bounded changed-line ranges, line delta and numbered updated context derived from the actual native patch, without rereading the file. Works independently of anchored editing.
|
|
11
|
+
- **`reading.adaptive`**: execution-time model-aware default read windows of 120/240/500 lines. Explicit limits, images and native byte caps remain native.
|
|
12
|
+
- **`artifacts.adaptiveBudget`**: per-context estimated caps can only lower configured inline/excerpt limits. Privacy-prepared provider context, source provenance, non-expanding replacements and conservative artifact rebuild are covered.
|
|
13
|
+
- **`jobs.enabled`**: separate local `bash_job` start/status/stop/list tool with trusted-project and local UI confirmation for every start, session/branch ownership, bounded output/concurrency/timeouts and lifecycle cleanup. Jobs survive compaction with a metadata-only reminder, not session replacement/reload/shutdown.
|
|
14
|
+
|
|
15
|
+
See [anchored editing](../ANCHORED_EDITING.md), [portable agent tools](../PORTABLE_AGENT_TOOLS.md), [ADR 059](../ADR/059-optional-anchored-editing.md) and [ADR 060](../ADR/060-optional-portable-agent-tools.md).
|
|
16
|
+
|
|
17
|
+
## Safety and compatibility
|
|
18
|
+
|
|
19
|
+
Pi JSONL remains canonical and append-only; SQLite remains disposable/rebuildable with schema `15`. No live database intervention, provider/backend integration or Pi upgrade is part of this release.
|
|
20
|
+
|
|
21
|
+
Unchanged contracts: `ds4-context-config-v1`, `runtime-adapter-v1`, `ds4-context-persistence-tool-v1`, `ds4-context-persistence-result-v1`. Pi remains pinned to `0.84.3`; Node.js requirement remains `>=22.19.0`.
|
|
22
|
+
|
|
23
|
+
Local tool wrappers must not be combined with remote/sandbox replacements. `bash_job` does not inherit bash-only permission hooks or SDK shell settings; its confirmation explicitly identifies this boundary. Stop does not roll back shell side effects or guarantee ownership of escaped daemons. Linux execution tests do not establish Windows correctness. Adaptive budgets are estimates; real-provider token savings, latency and reliability have not been measured. No operational KV reuse, rewind, forced sampling or marker insertion is added.
|
|
24
|
+
|
|
25
|
+
## Update and enable
|
|
26
|
+
|
|
27
|
+
After publication, install the exact package and fully restart Pi to load the matching compiled core:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pi install npm:ds4-context-engine@0.3.4
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
In a trusted project, enable only the features you want:
|
|
34
|
+
|
|
35
|
+
```text
|
|
36
|
+
/context config set editing.anchored true
|
|
37
|
+
/context config set editing.postEditReport true
|
|
38
|
+
/context config set reading.adaptive true
|
|
39
|
+
/context config set artifacts.adaptiveBudget true
|
|
40
|
+
/context config set jobs.enabled true
|
|
41
|
+
/reload
|
|
42
|
+
/context config show
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Add `--global` to each `set` to target the agent-directory configuration instead of the project file. Trusted project settings take precedence. Configuration writes do not change the active session until reload/startup. Use `false` to disable. The DS4 master `enabled` switch must also be true.
|
|
46
|
+
|
|
47
|
+
## Package policy and validation
|
|
48
|
+
|
|
49
|
+
All three packages use `0.3.4`: `ds4-context-core`, `ds4-context-reference-adapter`, `ds4-context-engine`. Both adapters depend exactly on `ds4-context-core@0.3.4`. Publication is manual in that order using npm's stable `latest` tag. GitHub Actions remains validation-only, with OIDC and package-write permissions denied.
|
|
50
|
+
|
|
51
|
+
Candidate validation on Node.js `26.5.1`, from a sanitized release source with a fresh `npm ci`:
|
|
52
|
+
|
|
53
|
+
- `npm run check`: **78 files / 485 tests passed**, including native edit queue/matching regressions, independent opt-ins and real local bash execution/stop/timeout.
|
|
54
|
+
- `npm run quality:compare`: passed; frozen-corpus candidate score `0.9875` versus baseline `0.808156`.
|
|
55
|
+
- `npm run schema:context-persistence`: passed, `1266` bytes / `317` estimated tokens (limits `1500` / `320`).
|
|
56
|
+
- `npm run latency:check` against exact `ds4-context-core@0.1.2`: passed; disabled-planning p95 ratio `0.885863`, maximum `1.1`. This is not a provider latency/savings measurement.
|
|
57
|
+
- `npm run pack:check`: clean-consumer core **231 files**, reference adapter **7**, engine **84**, with eight real offline Pi registry scenarios.
|
|
58
|
+
- All three `npm pack --dry-run --json` inventories and `git diff --check` passed.
|
|
59
|
+
- Versions, exact core dependencies, lockfile and runtime version constants are synchronized. No dependency upgrade was performed.
|
|
60
|
+
|
|
61
|
+
Pre-existing local `allowScripts` additions and `.serena/` are excluded from release commits and public packages.
|
|
62
|
+
|
|
63
|
+
The initial CI run `33965143704` on candidate `4e665e3` passed Node `22.19.0`. Node `24.x` exceeded the default 5-second timeout in the existing disk-backed schema-v10 upgrade fixture (484 tests passed, one timeout). That individual correctness test now has a bounded 15-second timeout, with all assertions unchanged; no runtime/storage behavior changed. Final CI and exact registry evidence will be recorded after execution.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ds4-context-engine",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"description": "Non-destructive, provider-independent context management for Pi.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
]
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"ds4-context-core": "0.3.
|
|
65
|
+
"ds4-context-core": "0.3.4"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"@earendil-works/pi-ai": "0.84.3",
|