@skein-code/cli 0.3.10 → 0.3.12

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.
@@ -34,8 +34,8 @@
34
34
  ## Agent turn
35
35
 
36
36
  1. Resolve `@path` mentions inside configured workspace roots.
37
- 2. Ask the local context engine for task-relevant spans under the configured
38
- token budget.
37
+ 2. Classify the task evidence surface and ask the local context engine for
38
+ task-relevant spans under an adaptive budget capped by configuration.
39
39
  3. Combine product rules, project rules, retrieved spans, mentions, current plan,
40
40
  and conversation history.
41
41
  4. Call the model with the tools allowed by the current mode.
@@ -43,8 +43,10 @@
43
43
  6. Create a checkpoint before the first mutation in a tool batch.
44
44
  7. Execute tools, emit events, and append their grounded results to the model
45
45
  conversation.
46
- 8. Continue until the model returns a final response or the turn limit is hit.
47
- 9. Run configured verification commands after changes. The completion gate accepts
46
+ 8. Record a bounded, content-free token receipt for the model request and
47
+ persist actual provider counters separately from local estimates.
48
+ 9. Continue until the model returns a final response or the turn limit is hit.
49
+ 10. Run configured verification commands after changes. The completion gate accepts
48
50
  only current successful test, typecheck, lint, build, check, or `git diff
49
51
  --check` evidence recorded after the last mutation. An early final response
50
52
  receives one bounded recovery turn; the runtime persists `verified`,
@@ -82,13 +84,56 @@ The runner keeps the cacheable system prefix separate from mutable task state:
82
84
  2. Dynamic turn state: intent directive, current plan, working memory, compacted
83
85
  handoff, workflow instructions, activated Skills, retrieved memories, and
84
86
  current code evidence.
85
- 3. Conversation: recent user/assistant/tool messages, with old tool output
86
- replaced by structured receipts when context pressure rises.
87
+ 3. Conversation: recent user/assistant/tool messages. Every new tool result is
88
+ bounded before it enters this layer; old tool output is replaced by compact
89
+ receipts when conversation pressure later triggers compaction.
87
90
 
88
91
  This lets providers reuse stable prompt prefixes while ensuring a changed plan
89
92
  or newly retrieved file is visible on the next turn. Every retrieved or generated
90
93
  state block is marked as untrusted context and cannot authorize a tool call.
91
94
 
95
+ ## Tool output boundary
96
+
97
+ Tool output crosses three independent limits:
98
+
99
+ 1. Shell uses bounded capture and reports the stdout/stderr bytes it observed
100
+ and whether that limit omitted source bytes. After an MCP SDK call returns,
101
+ normalization applies a separate 5 MiB ceiling and preserves both ends. It
102
+ limits what reaches the runner; it does not sandbox the MCP process or bound
103
+ bytes already materialized by the transport.
104
+ 2. The runner sanitizes terminal control sequences, redacts credential-shaped
105
+ values, estimates CJK and non-CJK token cost, and derives a 1,024–8,192 token
106
+ model-visible budget from active context and remaining session headroom.
107
+ 3. If the sanitized captured result is complete and at most 5 MiB, the runner
108
+ can retain it outside the transcript. The model receives a head/tail receipt
109
+ with status, size, failure/exit/changed-file signals, hash, expiry, and a
110
+ bounded `read_tool_artifact` continuation.
111
+
112
+ Artifacts are stored beneath the active project namespace, capped at 20 MiB in
113
+ total, evicted oldest-first, and expired after seven days. File names are hashes
114
+ of validated session/tool-call identities. Reads validate the session binding,
115
+ file identity, byte count, and SHA-256; symlinks and corrupt records fail closed.
116
+ At the start of a run, expired files are pruned and persisted session receipts
117
+ are reconciled against storage before the readback tool can be exposed. Deleting
118
+ a session removes its artifact directory. Session JSON and JSONL events carry
119
+ only receipts and bounded previews, never artifact contents.
120
+
121
+ ## Token ledger and adaptive retrieval
122
+
123
+ Each model request appends a maximum-256-entry token ledger to its session. A
124
+ receipt contains only a request ID, turn, timestamp, partition counts, actual
125
+ provider counters when present, measurement source, loaded tool names, and
126
+ retrieval selection metadata. It never contains prompt text, workspace rules,
127
+ source snippets, tool schemas, arguments, results, or credentials. Legacy
128
+ sessions without provenance remain readable and are labelled `unknown` rather
129
+ than being reported as actual usage.
130
+
131
+ The local context ceiling is allocated by task shape: 2k for focused evidence,
132
+ 4k for ordinary work, 8k for cross-module or repository-wide work, and 12k only
133
+ for explicitly exhaustive multi-part work. Each receipt reports its reason and
134
+ the number of candidate, selected, overlapping, and budget-capped spans. These
135
+ are estimated provider-neutral planning values, not billing claims.
136
+
92
137
  ## Local context selection
93
138
 
94
139
  The context boundary is deliberately in-process and local:
@@ -122,6 +167,8 @@ Project-local data is kept in `.mosaic/` and ignored by default:
122
167
  - `config.json` — project overrides;
123
168
  - `index.json` — local retrieval index;
124
169
  - `sessions/` — auditable conversation and tool state;
170
+ - `tool-artifacts/` — redacted, expiring oversized tool results scoped to a
171
+ saved session;
125
172
  - `checkpoints/` — pre-mutation file snapshots and manifests.
126
173
 
127
174
  No source content is sent anywhere except the model endpoint selected by the
@@ -9,7 +9,7 @@ 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 repository version: `0.3.10`.
12
+ - Current repository version: `0.3.12`.
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).
@@ -41,8 +41,8 @@ npm audit --omit=dev
41
41
  npm run release:verify -- --output-dir artifacts/package
42
42
  ```
43
43
 
44
- The latest verified package is `skein-code-cli-0.3.10.tgz`. The verifier writes
45
- its SHA-256 to `artifacts/package/skein-code-cli-0.3.10.tgz.sha256`, and CI
44
+ The latest verified package is `skein-code-cli-0.3.12.tgz`. The verifier writes
45
+ its SHA-256 to `artifacts/package/skein-code-cli-0.3.12.tgz.sha256`, and CI
46
46
  retains the checksum beside the package metadata. The checksum is deliberately
47
47
  not copied into this packaged document because doing so would change the
48
48
  archive it describes.
@@ -50,7 +50,7 @@ archive it describes.
50
50
  The final verification included a fresh install and real PTY interaction for
51
51
  all three executable aliases, `/about`, a permission prompt, denial, and clean
52
52
  Ctrl+C exit. PTY coverage included 20, 24 ASCII, 40, 80, 120 columns and a
53
- 40x10 short-height case. The current 40-file, 403-test suite passes the full check.
53
+ 40x10 short-height case. The current 42-file, 424-test suite passes the full check.
54
54
 
55
55
  ## Recommended Order
56
56
 
@@ -78,11 +78,12 @@ Implementation notes:
78
78
  - `npm run release:verify` reproduces the package from source, installs it into
79
79
  an isolated prefix, rejects packaged local state, and exercises `skein`,
80
80
  `mosaic`, and `mosaic-code`.
81
- - The `main` branch rule requires the strict `check` status. Version 0.3.10
82
- adds durable Task Contracts for complex executable requests, binds acceptance
83
- to successful audit evidence and current verification, and gives tool
84
- failures stable classes, bounded retry budgets, repair hints, and identical-
85
- call circuit breaking. Short requests keep the smaller tool surface.
81
+ - The `main` branch rule requires the strict `check` status. Version 0.3.12
82
+ adds privacy-safe per-request token receipts, actual-versus-estimated usage
83
+ provenance, prompt partition accounting, and adaptive 2k/4k/8k/12k local
84
+ retrieval budgets. Session telemetry stores counts, tool names, selection
85
+ decisions, and discard reasons, never prompt, source, schema, argument, or
86
+ tool-result content.
86
87
  Its tag, GitHub verification, and npm publication use the same source commit.
87
88
 
88
89
  ### P1: Skein Storage Namespace And Migration
package/docs/PRODUCT.md CHANGED
@@ -71,7 +71,7 @@ Sources:
71
71
  | Context | Local BM25/path/symbol index, visible startup build/validation gate, freshness checks, token packing, multi-root, `@file` mentions |
72
72
  | Models | OpenAI, Anthropic, Gemini, OpenAI-compatible endpoints |
73
73
  | Agent | Multi-turn tool loop, task plan, evidence-gated completion, automatic verification, ask-only mode |
74
- | Tools | Read, list, search, write, patch, shell, Git, context search, task updates |
74
+ | Tools | Read, list, search, write, patch, shell, Git, context search, task updates, session-scoped oversized-result readback |
75
75
  | Trust | Workspace path boundary, allow/ask/deny policy, command rules, hooks, checkpoints |
76
76
  | Sessions | Local persistence, resume/latest, list/show/delete/export |
77
77
  | UX | Ink TUI, responsive branded welcome/workspace rail, action timeline, context telemetry, plan rail, inline permission band, interruption |
@@ -95,6 +95,12 @@ when a compatible endpoint omits token counters, clamps the provider output
95
95
  allowance to the remaining budget, and records skipped tool calls rather than
96
96
  leaving an incomplete assistant/tool message pair.
97
97
 
98
+ Tool output has a separate budget. Oversized success and failure results retain
99
+ the evidence needed to decide the next action without injecting the full log
100
+ into every following model call. Complete captured output can be paged from a
101
+ redacted, expiring, session-bound local artifact; upstream capture loss remains
102
+ explicit and is never described as recoverable.
103
+
98
104
  That makes Skein particularly strong for individual developers, regulated
99
105
  teams, self-hosted environments, and tooling groups building their own agent
100
106
  workflows.
@@ -1,7 +1,7 @@
1
1
  # Skein Product Benchmark
2
2
 
3
3
  This is a capability and workflow comparison, not a claim that products use
4
- the same models or pricing. It was reviewed on 2026-07-22 against public
4
+ the same models or pricing. It was reviewed on 2026-07-25 against public
5
5
  product documentation.
6
6
 
7
7
  ## Positioning
@@ -21,6 +21,7 @@ product surfaces.
21
21
  | Area | Mainstream signal | Skein today | Product implication |
22
22
  | --- | --- | --- | --- |
23
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
+ | Tool result economy | FastCtx argues for structured file/search tools, explicit pagination, bounded output tiers, and persistent background-job logs so the model spends fewer turns on shell mechanics. See the [FastCtx repository](https://github.com/yc-duan/fastctx) and its [LINUX DO introduction](https://linux.do/t/topic/2612425). These are design signals, not independent evidence that every model becomes more accurate. | Native tools already use closed schemas and permission/checkpoint boundaries. Oversized results now use a dynamic token budget, head/tail receipts, source-truncation telemetry, and redacted session-scoped local readback. Single-file UTF-8 reads and foreground-only shell execution remain narrower than FastCtx. | Keep FastCtx optional through MCP instead of duplicating the default kernel. Add measured read/list/search continuation and batch reading before considering persistent background jobs. |
24
25
  | 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
26
  | 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
27
  | 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. |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skein-code/cli",
3
- "version": "0.3.10",
3
+ "version": "0.3.12",
4
4
  "description": "A context-first, model-agnostic coding agent with an auditable terminal workspace.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -16,9 +16,9 @@
16
16
  },
17
17
  "skein": {
18
18
  "releaseNotes": [
19
- "Complex executable requests now use a durable Task Contract with evidence-bound acceptance criteria",
20
- "Completion stays unverified while required acceptance or final verification remains unresolved",
21
- "Structured tool failure receipts add concise repair hints, retry budgets, cancellation handling, and identical-call circuit breaking"
19
+ "Each model request records privacy-safe token partitions and actual-versus-estimated provenance",
20
+ "Local retrieval now selects focused, standard, broad, or maximum evidence budgets",
21
+ "Terminal and JSON diagnostics expose budget decisions without storing prompt or source content"
22
22
  ]
23
23
  },
24
24
  "bin": {