@skein-code/cli 0.3.5 → 0.3.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.
@@ -14,8 +14,8 @@
14
14
  │ │
15
15
  ┌──────────────▼─────────────┐ ┌─────▼────────────────────────┐
16
16
  │ Context fabric │ │ Trust layer │
17
- ContextEngine CLI │ │ workspace boundary │
18
- local BM25/path/symbol │ │ allow / ask / deny │
17
+ local BM25/path/symbol │ │ workspace boundary │
18
+ language-aware chunks │ │ allow / ask / deny │
19
19
  │ @file resolver │ │ command policy · hooks │
20
20
  │ token-budgeted packer │ │ checkpoints · audit events │
21
21
  └──────────────┬─────────────┘ └─────┬────────────────────────┘
@@ -34,7 +34,7 @@
34
34
  ## Agent turn
35
35
 
36
36
  1. Resolve `@path` mentions inside configured workspace roots.
37
- 2. Ask the selected context engine for task-relevant spans under the configured
37
+ 2. Ask the local context engine for task-relevant spans under the configured
38
38
  token budget.
39
39
  3. Combine product rules, project rules, retrieved spans, mentions, current plan,
40
40
  and conversation history.
@@ -62,36 +62,37 @@ This lets providers reuse stable prompt prefixes while ensuring a changed plan
62
62
  or newly retrieved file is visible on the next turn. Every retrieved or generated
63
63
  state block is marked as untrusted context and cannot authorize a tool call.
64
64
 
65
- ## Context selection
65
+ ## Local context selection
66
66
 
67
- `context.engine: auto` is the recommended setting.
67
+ The context boundary is deliberately in-process and local:
68
68
 
69
69
  ```text
70
- contextengine executable healthy?
71
- / \
72
- yes no
73
- / \
74
- hybrid external retrieval local incremental index
75
- symbols + vectors + graph BM25 + path + symbol boosts
76
- \ /
77
- token-budget pack
70
+ workspace files
71
+ |
72
+ manifest + freshness checks
73
+ |
74
+ language-aware chunks + BM25/path/symbol/CJK signals
75
+ |
76
+ verified, diverse spans under token budget
77
+ |
78
+ untrusted evidence block for the model
78
79
  ```
79
80
 
80
- The fallback is intentional. A missing database, embedding endpoint, or external
81
- binary should reduce retrieval quality, not make the coding agent unusable.
81
+ Index state is persisted in the active project namespace. Search results are
82
+ revalidated against current files before packing, so a stale index reduces
83
+ recall rather than silently injecting old code.
82
84
 
83
85
  ## Storage
84
86
 
85
87
  Project-local data is kept in `.mosaic/` and ignored by default:
86
88
 
87
89
  - `config.json` — project overrides;
88
- - `index.json` — local fallback index;
90
+ - `index.json` — local retrieval index;
89
91
  - `sessions/` — auditable conversation and tool state;
90
92
  - `checkpoints/` — pre-mutation file snapshots and manifests.
91
93
 
92
94
  No source content is sent anywhere except the model endpoint selected by the
93
- user. With local-compatible model and local retrieval endpoints, the complete
94
- stack can remain self-hosted.
95
+ user. With a local-compatible model, the complete stack can remain self-hosted.
95
96
 
96
97
  Durable memory uses SQLite in WAL mode with FTS5 and bounded lexical fallback;
97
98
  it does not require a hosted vector service. Records carry scope, kind,
@@ -131,3 +132,33 @@ useful without silently accumulating guesses.
131
132
  `PATH` entries, and reports non-zero exits as failed tool results. Operations
132
133
  that can invoke transport, signing, merge, or checkout helpers also require
133
134
  shell permission.
135
+
136
+ ## Capability extension policy
137
+
138
+ Skein keeps a small built-in tool kernel: read, list, search, write, patch,
139
+ shell, Git, tasks, and working memory. Built-ins use closed input schemas,
140
+ explicit permission categories, workspace-root resolution, bounded inputs and
141
+ outputs, cancellation, checkpoints for known writes, and persisted audit
142
+ events. New built-ins must satisfy the same contract; a convenience wrapper is
143
+ not enough reason to enlarge the kernel.
144
+
145
+ Skills and workflows are the preferred plugin surface for reusable guidance.
146
+ They are data-only prompt additions, carry their source and trust state, and
147
+ cannot grant permissions or execute code by being loaded. Arbitrary in-process
148
+ JavaScript plugins are intentionally unsupported because they would share the
149
+ CLI's full filesystem, environment, and process privileges.
150
+
151
+ MCP is the interoperability boundary for external executable capabilities. It
152
+ is disabled by default, removed from untrusted project configuration, exposes
153
+ namespaced tools, treats server annotations as untrusted, and applies argument,
154
+ schema, result, server-count, timeout, and transport limits. Every MCP call
155
+ currently requires the network permission category. A configured stdio server
156
+ is still an external program with the user's operating-system privileges; cwd
157
+ and environment validation reduce accidental exposure but are not a sandbox.
158
+ Only reviewed user-owned configuration should enable one.
159
+
160
+ Before any marketplace-style plugin support, add a declarative capability
161
+ manifest, first-run review, lazy tool-schema activation, per-server permission
162
+ scopes, and an optional process sandbox. Plugin packages should compose Skills,
163
+ workflows, and MCP servers rather than load arbitrary code into the Skein
164
+ process.
@@ -9,12 +9,12 @@ one of the milestones below.
9
9
 
10
10
  - Product name: `Skein`; primary executable: `skein`.
11
11
  - Compatibility executables: `mosaic` and `mosaic-code`.
12
- - Current release: `0.3.0`.
12
+ - Current repository version: `0.3.5`.
13
13
  - Runtime requirement: Node.js `>=22.16.0` (the runtime uses unflagged
14
14
  `node:sqlite` with FTS5, and current CLI/build dependencies require this
15
15
  Node 22 baseline).
16
- - Retrieval: local BM25/path/symbol index with automatic ContextEngine-plugin
17
- detection and fallback.
16
+ - Retrieval: local BM25/path/symbol index with freshness validation and bounded
17
+ packing; no retrieval service is required.
18
18
  - Agent: provider-agnostic multi-turn runner for OpenAI, Anthropic, Gemini, and
19
19
  OpenAI-compatible endpoints; built-in tools, permissions, checkpoints,
20
20
  workflows, Skills, MCP, expert profiles, sessions, and memory are present.
@@ -47,7 +47,7 @@ archive it describes.
47
47
  The final verification included a fresh install and real PTY interaction for
48
48
  all three executable aliases, `/about`, a permission prompt, denial, and clean
49
49
  Ctrl+C exit. PTY coverage included 20, 24 ASCII, 40, 80, 120 columns and a
50
- 40x10 short-height case. The current suite contains 34 test files and 317 tests.
50
+ 40x10 short-height case. The current 35-file test suite passes the full check.
51
51
 
52
52
  ## Recommended Order
53
53
 
@@ -140,53 +140,29 @@ Implementation progress:
140
140
  concrete paths involved. `skein doctor` surfaces this as `legacyCompatibility`
141
141
  so users see the removal timeline before aliases disappear.
142
142
 
143
- ### P1: ContextEngine-Plugin Production Adapter
143
+ ### P1: Local Context Engine Reliability And Benchmarking
144
144
 
145
- Exercise the adapter against a real ContextEngine-plugin fixture, not only the
146
- local fallback. Cover capability negotiation, index progress, search/context
147
- packing, unavailable PostgreSQL/pgvector, stale indexes, multi-root workspaces,
148
- and a useful degraded-mode explanation in the TUI and headless output.
145
+ Keep retrieval local and measurable as the repository grows. The next slice
146
+ should add content hashes to index entries, a small generation-keyed query cache,
147
+ overlap-aware packing, and language adapters for common declaration styles.
149
148
 
150
149
  Definition of done:
151
150
 
152
- - `auto` selects the external engine only when its health contract is valid.
153
- - A failed external query falls back without losing the user request.
154
- - Results preserve source paths, symbols, line ranges, scores, and token caps.
155
- - An integration fixture runs in CI without requiring a developer database.
151
+ - Editing a file without changing its size cannot leave a stale hit in a prompt.
152
+ - New, deleted, renamed, binary, symlinked, and out-of-root files are covered by
153
+ regression tests.
154
+ - A benchmark reports Recall@5/10/20, MRR, stale-hit rate, useful-token ratio,
155
+ and cold/incremental/warm latency for curated multilingual queries.
156
+ - `npm run check` and `npm run test:pty` pass without a service or downloaded
157
+ model.
156
158
 
157
159
  Implementation progress:
158
160
 
159
- - `auto` now negotiates the real 0.4 CLI boundary using `--version`, required
160
- help flags, exit behavior, and strict required response fields. Capability
161
- probes are coalesced, cached for ten seconds after completion, refreshable,
162
- and recover when an executable is installed while Skein is running.
163
- - Compatible but unindexed workspaces use ContextEngine only for `index`;
164
- `search` and `context` fall back locally. Explicit `contextengine` mode makes
165
- missing, incompatible, unhealthy, and unindexed states hard failures, and
166
- `doctor` treats that explicit requirement as required.
167
- - External index progress is parsed from the current CR/ANSI human stream and
168
- finalized only after the JSON result validates. Multi-root aliases use
169
- `main`, `workspace2`, and later numbered roots; single-root directories with
170
- those literal names remain ordinary paths.
171
- - Search/context hits are schema-checked, realpath-bound, hash-checked, and
172
- compared with current file lines. A stale or invalid hit rejects the entire
173
- external response; empty auto-mode results are cross-checked locally so new
174
- files are not missed. Synthetic commit-lineage hits are reconstructed with a
175
- constrained read-only Git command. Skein ignores external `packedText` and
176
- repacks verified current-file or commit-summary bytes under its own top-K and
177
- token limits.
178
- - External processes use a private temporary working directory and a minimal
179
- `CONTEXTENGINE_*`/proxy/certificate environment. Repository `.env` files and
180
- generic chat-model credentials are not inherited. External failures and
181
- unknown index fields are redacted or stripped before reaching output.
182
- - Structured degradation now reaches the TUI, headless text/final JSON,
183
- `skein search/context`, and `doctor`; narrow TUI layouts show a separate
184
- fallback reason and remediation row.
185
- - `test/fixtures/contextengine-cli.mjs` is a faithful CLI-boundary fixture, not
186
- an embedded fake database. It covers unavailable PostgreSQL/pgvector,
187
- unindexed and malformed contracts, stale/current/empty hits, commit-lineage
188
- verification, multi-root mapping, oversized progress, credential redaction,
189
- cache recovery, and degraded channels without requiring PostgreSQL in CI.
161
+ - The public `pack/search/index/status` boundary is now a pure local façade.
162
+ - Legacy external configuration is stripped at the config schema boundary and
163
+ no external executable or database is probed by the CLI.
164
+ - Remaining work is content-hash freshness, cache invalidation, structured
165
+ chunking, and the reproducible benchmark.
190
166
 
191
167
  ### P1: Multi-Agent Scheduler And Team UX
192
168
 
@@ -284,6 +260,10 @@ Add a first-run catalog and inspection flow for bundled capabilities. Keep
284
260
  installation explicit and reviewable: show source, requested tools, filesystem
285
261
  scope, network scope, and trust state before activation. Add fixture servers and
286
262
  Skills that exercise timeout, malformed schema, disconnect, and version drift.
263
+ Introduce lazy MCP schema discovery and declarative capability manifests before
264
+ any marketplace. Do not load arbitrary plugin JavaScript in-process; package
265
+ reusable extensions as data-only Skills/workflows plus explicitly trusted MCP
266
+ servers, with an optional subprocess sandbox for stdio servers.
287
267
 
288
268
  ### P2: Memory Quality And User Control
289
269
 
@@ -323,8 +303,8 @@ deprecation window is complete.
323
303
  responsive panels.
324
304
  - `src/agent/runner.ts` — model/tool loop, context events, verification, and
325
305
  delegation boundaries.
326
- - `src/context/context-engine.ts` — external/local retrieval selection.
327
- - `src/context/local-index.ts` — offline fallback index.
306
+ - `src/context/context-engine.ts` — local retrieval façade.
307
+ - `src/context/local-index.ts` — persisted local index, scoring, and packing.
328
308
  - `src/mcp/manager.ts` — MCP lifecycle and tool registration.
329
309
  - `src/skills/catalog.ts` — Skills discovery and activation.
330
310
  - `src/memory/store.ts` and `src/tools/working-memory.ts` — durable and
package/docs/PRODUCT.md CHANGED
@@ -47,27 +47,14 @@ Sources:
47
47
  - [Sandboxing](https://geminicli.com/docs/cli/sandbox/)
48
48
  - [CLI reference](https://geminicli.com/docs/cli/cli-reference/)
49
49
 
50
- ### ContextEngine-plugin
51
-
52
- ContextEngine-plugin provides the strongest open integration path for code
53
- retrieval: PostgreSQL FTS, symbols, paths, optional pgvector embeddings, graph
54
- expansion, reranking, and token-budgeted MMR packing. Its CLI contract maps well
55
- to an agent: `index`, `search`, `context`, and `status`.
56
-
57
- Sources:
58
-
59
- - [ContextEngine-plugin](https://github.com/lixiang12345/ContextEngine-plugin)
60
- - [Architecture](https://github.com/lixiang12345/ContextEngine-plugin/blob/main/ARCHITECTURE.md)
61
- - [Comparison with Augment](https://github.com/lixiang12345/ContextEngine-plugin/blob/main/COMPARISON.md)
62
-
63
50
  ## Product principles
64
51
 
65
52
  1. **Context before tools.** Every task begins with retrieval and explicit file
66
53
  mentions are merged into the evidence packet.
67
54
  2. **Open by default.** Headless automation is a core feature, not an enterprise
68
55
  entitlement.
69
- 3. **Local first, not local only.** The built-in index works without a service;
70
- ContextEngine is selected automatically when installed.
56
+ 3. **Local by default.** Retrieval is inspectable, offline-capable, and does not
57
+ require a database, daemon, embedding download, or external executable.
71
58
  4. **Bring your own model.** OpenAI, Anthropic, Gemini, and OpenAI-compatible
72
59
  endpoints share one agent contract.
73
60
  5. **Trust is visible.** Tool intent, permission category, result, changed files,
@@ -81,7 +68,7 @@ Sources:
81
68
 
82
69
  | Surface | Capability |
83
70
  |---|---|
84
- | Context | ContextEngine adapter, built-in BM25/path/symbol index, token packing, multi-root, `@file` mentions |
71
+ | Context | Local BM25/path/symbol index, freshness checks, token packing, multi-root, `@file` mentions |
85
72
  | Models | OpenAI, Anthropic, Gemini, OpenAI-compatible endpoints |
86
73
  | Agent | Multi-turn tool loop, task plan, automatic verification, ask-only mode |
87
74
  | Tools | Read, list, search, write, patch, shell, Git, context search, task updates |
@@ -20,7 +20,7 @@ product surfaces.
20
20
 
21
21
  | Area | Mainstream signal | Skein today | Product implication |
22
22
  | --- | --- | --- | --- |
23
- | Context | Auggie automatically indexes projects and offers context-aware interactive and print modes. Its MCP Tool Search avoids loading every remote schema up front. See [Auggie overview](https://docs.augmentcode.com/cli/overview) and [integrations](https://docs.augmentcode.com/cli/integrations). | Local BM25/path/symbol retrieval plus a behavior-negotiated ContextEngine adapter, verified current-file/commit packing, empty-result cross-checks, observable fallback, progressive Skills, and hard token caps. Filesystem freshness remains `unknown` until each hit is consumed; doctor reports semantic readiness and query telemetry reports degraded channels. MCP schemas are registered eagerly. | Make MCP tool discovery lazy and measurable, and add proactive channel state to the TUI without pretending status alone proves freshness. |
23
+ | Context | Auggie automatically indexes projects and offers context-aware interactive and print modes. Its MCP Tool Search avoids loading every remote schema up front. See [Auggie overview](https://docs.augmentcode.com/cli/overview) and [integrations](https://docs.augmentcode.com/cli/integrations). | Local BM25/path/symbol retrieval with language-aware chunks, current-file freshness checks, diversity-aware token packing, progressive Skills, and hard token caps. MCP schemas are registered eagerly. | Benchmark local recall and latency by language, then make MCP tool discovery lazy and measurable. |
24
24
  | Workflow modes | Claude Code documents isolated subagents, agent teams, hooks, code intelligence, Skills, MCP, and plugins in one extension model. See [Claude Code extensions](https://code.claude.com/docs/en/features-overview). Copilot CLI exposes Plan and Autopilot modes. See [Copilot CLI](https://github.com/features/copilot/cli). | Ask and Build modes exist; Ask is read-only but does not produce a named approval-ready plan. | Add an explicit Plan mode. Keep it read-only and require approval before Build. |
25
25
  | Code intelligence | Claude Code advertises language-server-backed symbol navigation and live type errors. | Retrieval is lexical/BM25/path/symbol index based; no LSP diagnostics or rename graph. | Add an optional LSP adapter after storage and scheduler foundations. |
26
26
  | Parallel work | Claude documents isolated subagents and agent teams; Copilot CLI offers background delegation and fleet-style parallel work. | Routed multi-model councils share bounded reports, observe/guard/strict task-budget policies, reviewer acceptance/revision, and a responsive Team Cockpit. The main agent remains the only writer. | Add worktree-isolated writers, deterministic integration, and conflict/rollback UX without weakening the visible review gate. |
@@ -48,7 +48,7 @@ product surfaces.
48
48
  reviewer loop, then add cancellation propagation, deterministic integration,
49
49
  and single-writer/worktree boundaries.
50
50
  6. **P1 code intelligence:** add optional LSP diagnostics and symbol actions
51
- without making the local index or external ContextEngine mandatory.
51
+ without making the local index mandatory.
52
52
  7. **P2 trust and sharing:** first-run capability review, sandbox adapters,
53
53
  redacted review bundles, and explicit privacy/export/delete controls.
54
54
 
@@ -8,10 +8,8 @@ model:
8
8
  maxTokens: 8192
9
9
 
10
10
  context:
11
- engine: auto
12
11
  maxTokens: 12000
13
12
  topK: 12
14
- contextEngineCommand: contextengine
15
13
 
16
14
  permissions:
17
15
  read: allow
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skein-code/cli",
3
- "version": "0.3.5",
3
+ "version": "0.3.7",
4
4
  "description": "A context-first, model-agnostic coding agent with an auditable terminal workspace.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -16,8 +16,9 @@
16
16
  },
17
17
  "skein": {
18
18
  "releaseNotes": [
19
- "New ANSI Shadow \"SKEIN\" logotype gives the entry banner a real product wordmark",
20
- "Wordmark carries a subtle theme-aware gradient; narrow and ASCII terminals fall back cleanly"
19
+ "Terminal startup no longer leaks Kitty keyboard probes or wraps long model names into stray rows",
20
+ "The fresh-session summary is denser and verified across narrow, wide, and short terminal layouts",
21
+ "Prompt assembly now keeps optional orchestration guidance out of simple runs and strengthens language, user-work, and verification guardrails"
21
22
  ]
22
23
  },
23
24
  "bin": {
@@ -43,6 +44,7 @@
43
44
  "test:watch": "vitest",
44
45
  "pretest:pty": "npm run build",
45
46
  "test:pty": "sh test/pty/run-visual.sh",
47
+ "benchmark:context": "tsx scripts/benchmark-local-index.ts",
46
48
  "verify:package": "node scripts/verify-package.mjs",
47
49
  "release:verify": "npm run check && npm run verify:package --",
48
50
  "typecheck": "tsc --noEmit",