soturail 0.4.0 → 0.6.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.
Files changed (150) hide show
  1. package/LICENSE +15 -21
  2. package/README.md +277 -155
  3. package/dist/cli.js +10 -0
  4. package/dist/cli.js.map +1 -1
  5. package/dist/commands/agents.js +39 -5
  6. package/dist/commands/agents.js.map +1 -1
  7. package/dist/commands/context.js +66 -2
  8. package/dist/commands/context.js.map +1 -1
  9. package/dist/commands/eval.d.ts +2 -0
  10. package/dist/commands/eval.js +25 -0
  11. package/dist/commands/eval.js.map +1 -0
  12. package/dist/commands/format.js +14 -4
  13. package/dist/commands/format.js.map +1 -1
  14. package/dist/commands/fs.d.ts +2 -0
  15. package/dist/commands/fs.js +19 -0
  16. package/dist/commands/fs.js.map +1 -0
  17. package/dist/commands/harness.d.ts +2 -0
  18. package/dist/commands/harness.js +35 -0
  19. package/dist/commands/harness.js.map +1 -0
  20. package/dist/commands/init.js +194 -4
  21. package/dist/commands/init.js.map +1 -1
  22. package/dist/commands/mcp.js +6 -1
  23. package/dist/commands/mcp.js.map +1 -1
  24. package/dist/commands/memory.js +40 -0
  25. package/dist/commands/memory.js.map +1 -1
  26. package/dist/commands/native.js +4 -0
  27. package/dist/commands/native.js.map +1 -1
  28. package/dist/commands/policy.d.ts +2 -0
  29. package/dist/commands/policy.js +25 -0
  30. package/dist/commands/policy.js.map +1 -0
  31. package/dist/commands/release.js +5 -3
  32. package/dist/commands/release.js.map +1 -1
  33. package/dist/commands/run.js +15 -3
  34. package/dist/commands/run.js.map +1 -1
  35. package/dist/commands/skills.js +15 -0
  36. package/dist/commands/skills.js.map +1 -1
  37. package/dist/commands/validate.d.ts +2 -0
  38. package/dist/commands/validate.js +13 -0
  39. package/dist/commands/validate.js.map +1 -0
  40. package/dist/commands/workflow.js +26 -2
  41. package/dist/commands/workflow.js.map +1 -1
  42. package/dist/core/agent-docs-hygiene.d.ts +3 -0
  43. package/dist/core/agent-docs-hygiene.js +83 -0
  44. package/dist/core/agent-docs-hygiene.js.map +1 -0
  45. package/dist/core/agent-exporter.d.ts +3 -1
  46. package/dist/core/agent-exporter.js +143 -15
  47. package/dist/core/agent-exporter.js.map +1 -1
  48. package/dist/core/agent-profile.d.ts +1 -1
  49. package/dist/core/agent-registry.js +60 -0
  50. package/dist/core/agent-registry.js.map +1 -1
  51. package/dist/core/agent-runtime.d.ts +57 -0
  52. package/dist/core/agent-runtime.js +371 -0
  53. package/dist/core/agent-runtime.js.map +1 -0
  54. package/dist/core/config.d.ts +15 -0
  55. package/dist/core/config.js +30 -0
  56. package/dist/core/config.js.map +1 -1
  57. package/dist/core/context-intelligence.d.ts +47 -0
  58. package/dist/core/context-intelligence.js +283 -0
  59. package/dist/core/context-intelligence.js.map +1 -0
  60. package/dist/core/diagram-validator.d.ts +10 -0
  61. package/dist/core/diagram-validator.js +53 -0
  62. package/dist/core/diagram-validator.js.map +1 -0
  63. package/dist/core/evaluation-suite.d.ts +28 -0
  64. package/dist/core/evaluation-suite.js +333 -0
  65. package/dist/core/evaluation-suite.js.map +1 -0
  66. package/dist/core/evidence-pack.d.ts +4 -0
  67. package/dist/core/evidence-pack.js +89 -0
  68. package/dist/core/evidence-pack.js.map +1 -0
  69. package/dist/core/format-compare.d.ts +12 -0
  70. package/dist/core/format-compare.js +68 -0
  71. package/dist/core/format-compare.js.map +1 -0
  72. package/dist/core/fs-evidence.d.ts +25 -0
  73. package/dist/core/fs-evidence.js +96 -0
  74. package/dist/core/fs-evidence.js.map +1 -0
  75. package/dist/core/harness-rail.d.ts +34 -0
  76. package/dist/core/harness-rail.js +124 -0
  77. package/dist/core/harness-rail.js.map +1 -0
  78. package/dist/core/json-validator.d.ts +24 -0
  79. package/dist/core/json-validator.js +138 -0
  80. package/dist/core/json-validator.js.map +1 -0
  81. package/dist/core/mcp-exposure.d.ts +20 -0
  82. package/dist/core/mcp-exposure.js +48 -0
  83. package/dist/core/mcp-exposure.js.map +1 -0
  84. package/dist/core/memory-rail.d.ts +37 -0
  85. package/dist/core/memory-rail.js +142 -0
  86. package/dist/core/memory-rail.js.map +1 -0
  87. package/dist/core/policy-rail.d.ts +27 -0
  88. package/dist/core/policy-rail.js +102 -0
  89. package/dist/core/policy-rail.js.map +1 -0
  90. package/dist/core/rail-utils.d.ts +10 -0
  91. package/dist/core/rail-utils.js +58 -0
  92. package/dist/core/rail-utils.js.map +1 -0
  93. package/dist/core/release-preflight.js +8 -0
  94. package/dist/core/release-preflight.js.map +1 -1
  95. package/dist/core/run-workspace.d.ts +38 -0
  96. package/dist/core/run-workspace.js +108 -0
  97. package/dist/core/run-workspace.js.map +1 -0
  98. package/dist/core/skill-routing.d.ts +2 -0
  99. package/dist/core/skill-routing.js +51 -0
  100. package/dist/core/skill-routing.js.map +1 -0
  101. package/dist/core/version.d.ts +1 -1
  102. package/dist/core/version.js +1 -1
  103. package/dist/core/workflow-store.d.ts +7 -0
  104. package/dist/core/workflow-store.js +50 -3
  105. package/dist/core/workflow-store.js.map +1 -1
  106. package/docs/agent-docs-hygiene.md +175 -0
  107. package/docs/agents.md +204 -3
  108. package/docs/benchmarking.md +213 -2
  109. package/docs/comparisons.md +196 -12
  110. package/docs/context-intelligence.md +127 -0
  111. package/docs/context-packs.md +239 -1
  112. package/docs/deep-agents-patterns.md +188 -0
  113. package/docs/diagram-rail.md +200 -0
  114. package/docs/ecosystem-influences.md +435 -0
  115. package/docs/evaluation-suite.md +196 -0
  116. package/docs/filesystem-evidence-rail.md +119 -0
  117. package/docs/future-rails-index.md +209 -0
  118. package/docs/harness-rail.md +166 -0
  119. package/docs/hooks/claude.md +1 -1
  120. package/docs/hooks/mcp.md +1 -1
  121. package/docs/licensing-strategy.md +135 -0
  122. package/docs/mcp.md +98 -0
  123. package/docs/memory-rail.md +189 -0
  124. package/docs/metrics.md +137 -2
  125. package/docs/migration-v0.5.md +89 -0
  126. package/docs/mvp.md +1 -1
  127. package/docs/policy-rail.md +184 -0
  128. package/docs/release-workflow.md +3 -2
  129. package/docs/roadmap-agent-runtime-addendum.md +304 -0
  130. package/docs/roadmap-harness-diagram-payload-addendum.md +300 -0
  131. package/docs/rules.md +56 -0
  132. package/docs/security-model.md +56 -0
  133. package/docs/skill-rail.md +57 -0
  134. package/docs/spec-driven-workflow.md +51 -0
  135. package/docs/structured-payload-rail.md +251 -0
  136. package/docs/tutorial-antigravity.md +20 -0
  137. package/docs/tutorial-claude-code.md +23 -0
  138. package/docs/tutorial-codex.md +22 -0
  139. package/docs/tutorial-context-formats.md +28 -0
  140. package/docs/tutorial-cursor.md +23 -0
  141. package/docs/tutorial-deep-agents-role-packs.md +24 -0
  142. package/docs/tutorial-diagram-spec.md +26 -0
  143. package/docs/tutorial-gemini-cli.md +21 -0
  144. package/docs/tutorial-harness-workflow.md +25 -0
  145. package/docs/usage.md +5 -3
  146. package/docs/windows.md +17 -1
  147. package/docs/workflow-rail.md +173 -1
  148. package/examples/agents/README.md +13 -0
  149. package/examples/agents/antigravity.md +1 -1
  150. package/package.json +2 -2
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  [![Node.js >=20](https://img.shields.io/badge/node-%3E%3D20-3c873a)](package.json)
8
8
  [![TypeScript](https://img.shields.io/badge/TypeScript-strict-3178c6)](tsconfig.json)
9
- [![MIT License](https://img.shields.io/badge/license-MIT-blue)](LICENSE)
9
+ [![License: Reserved Rights](https://img.shields.io/badge/license-reserved--rights-red)](LICENSE)
10
10
  [![CI](https://github.com/Soturine/soturail/actions/workflows/ci.yml/badge.svg)](https://github.com/Soturine/soturail/actions/workflows/ci.yml)
11
11
  [![npm version](https://img.shields.io/npm/v/soturail.svg)](https://www.npmjs.com/package/soturail)
12
12
  [![npm downloads](https://img.shields.io/npm/dm/soturail.svg)](https://www.npmjs.com/package/soturail)
@@ -18,100 +18,186 @@ SotuRail — trilhos locais de contexto para agentes de IA.
18
18
 
19
19
  ## 1. What Is SotuRail?
20
20
 
21
- SotuRail is a local-first Context OS for AI coding agents such as Claude Code, Codex CLI, Gemini CLI, Cursor and similar tools.
21
+ SotuRail is a local-first Context OS for AI coding agents such as Claude Code, Codex CLI, Gemini CLI, Cursor, Antigravity-style hosts and similar tools.
22
22
 
23
- It wraps a repository and terminal session with reversible evidence rails: heuristic repo maps, progressive file reading, safe command execution, raw log recovery, reducers, prompt-cache-friendly blocks, Spec-Driven Development artifacts, local memory, hooks, benchmarks and rules extraction.
23
+ It wraps a repository and terminal session with reversible evidence rails: heuristic repo maps, progressive file reading, safe command execution, raw log recovery, reducers, prompt-cache-friendly blocks, Spec-Driven Development artifacts, local memory, hooks, benchmarks, rules extraction, context packs, agent exports and workflow records.
24
24
 
25
- ## Project Status
25
+ SotuRail is not the agent, not a Claude-only harness, not a Mermaid-only workflow tool and not a heavy production gateway. It is the local rail layer that helps agents work with better context, safer logs, smaller prompts, approved memory, structured payloads, diagrams, policies and auditable workflows.
26
26
 
27
- v0.4.0 is early but functional. TypeScript mode is stable for local usage. Native Rust mode is optional and focused on hot paths. Skill Rail, MCP, context packs, agent exports and Workflow Rail are local-first and benchmarkable. External comparisons are optional and user-provided.
27
+ ## Project Status
28
28
 
29
- ## Built With SotuRail
29
+ v0.6.1 is the Agent UX Polish and Full Local Evaluation Suite milestone. TypeScript mode is stable for local usage. Native Rust mode remains optional and focused on hot paths. Skill Rail, MCP, context packs, agent exports, Workflow Rail, Memory Rail, Context Intelligence, Policy Rail, evidence seeds, the host-aware Agent Runtime Adapter and the local evaluation suite are local-first and benchmarkable. External comparisons are optional and user-provided.
30
30
 
31
- SotuRail now dogfoods itself for release-oriented development. `soturail self all` runs repository checks, indexing, build, tests, benchmarks and a local Markdown report through SotuRail's own rails.
31
+ The next product direction is staged: v0.7.0 deepens Workflow Rail, Harness Rail and Diagram Rail without turning SotuRail into an autonomous agent runtime. See [ROADMAP.md](ROADMAP.md) and [docs/future-rails-index.md](docs/future-rails-index.md).
32
32
 
33
- ## Self-Dogfooding
33
+ ## v0.5.x MVP Rails
34
34
 
35
35
  ```bash
36
- soturail self doctor
37
- soturail self index
38
- soturail self build
39
- soturail self test
40
- soturail self bench
41
- soturail self report
42
- soturail self all
36
+ soturail memory remember "Decision: keep MCP read-oriented by default" --tag architecture
37
+ soturail memory recall "MCP safety" --limit 5
38
+ soturail context select --query "prepare npm release"
39
+ soturail context budget --target claude --explain
40
+ soturail context pack --role reviewer
41
+ soturail harness contract init
42
+ soturail policy doctor
43
+ soturail fs snapshot
44
+ soturail mcp exposure
45
+ soturail run workspace new "Try v0.5.x rails"
46
+ soturail native doctor
47
+ soturail validate json package.json --strict
48
+ soturail format compare README.md
43
49
  ```
44
50
 
45
- Reports are written to `.soturail/reports/self-dogfood.md` with stable project context first and dynamic raw IDs, command status and benchmark data later.
51
+ These rails write local JSON, JSONL and Markdown under `.soturail/`. They do not create cloud resources, background agents, global config writes or arbitrary MCP shell execution.
46
52
 
47
- ## Release Workflow
53
+ ## v0.6.0 Agent Runtime Adapter
48
54
 
49
- Release automation is local-first and conservative:
55
+ ```bash
56
+ soturail agents capabilities
57
+ soturail agents capabilities --json
58
+ soturail agents status
59
+ soturail agents status --json
60
+ soturail agents doctor --verbose
61
+ soturail agents install --agent claude --dry-run
62
+ soturail agents install --agent cursor --dry-run
63
+ soturail agents install --agent gemini --dry-run
64
+ soturail agents export --agent deepagents
65
+ soturail agents export --agent deepagents-js
66
+ ```
67
+
68
+ The adapter is host-aware but conservative. It reports real, experimental, prompt-only and planned surfaces for Claude Code, Codex, Gemini CLI, Cursor, Antigravity, Generic, OpenCode/Amp/Kiro-style hosts and Deep Agents-style targets. Dry-run installs show planned file writes, backups, context references, payload recommendations and policy warnings before anything changes.
69
+
70
+ ## v0.6.1 Evaluation Suite
50
71
 
51
72
  ```bash
52
- npm run release:check
53
- npm run release:publish -- X.Y.Z
54
- npm run release:github -- X.Y.Z
55
- npm run release:full -- X.Y.Z --publish-npm --github-release
73
+ soturail eval list
74
+ soturail eval run
75
+ soturail eval report
56
76
  ```
57
77
 
58
- The release commands accept a positional version, `--target-version X.Y.Z`, or the backward-compatible `--version X.Y.Z` option. The release script never runs `npm audit fix --force`, never publishes when build/tests/runtime audit fail and never creates a GitHub release before npm publish succeeds. See [docs/release-workflow.md](docs/release-workflow.md).
78
+ The evaluation suite is deterministic and local. It checks memory recall, context selection, reducers, routing, role packs, agent-doc hygiene, offload/restore, payload formats, strict JSON validation, evidence packs, harness scenarios and Diagram Rail validation seeds. Reports are written to `.soturail/eval/latest.json` and `.soturail/eval/latest.md`.
59
79
 
60
- Release verification installs the packed `.tgz` into a clean temporary project and executes `node_modules/soturail/dist/cli.js` directly to avoid npm cache or global CLI false positives.
80
+ Token savings alone are not treated as success. The suite checks whether important files, commands, errors, policy decisions and recovery pointers survive compression and selection. See [docs/evaluation-suite.md](docs/evaluation-suite.md).
61
81
 
62
- ## Release Reliability
82
+ ## Why SotuRail Exists
63
83
 
64
- SotuRail includes a release preflight check to prevent stale package metadata, broken npm CLI binaries, missing release notes, and changelog/version mismatches.
84
+ AI coding agents often receive too much unstable context: full files, noisy test logs, repeated terminal output and long conversational summaries. SotuRail is designed to unify those workflows into one independent local-first tool without sending telemetry or inventing provider metrics.
65
85
 
66
- ```bash
67
- npm run build
68
- npm test
69
- npm run release:check
70
- npm pack --dry-run
86
+ The long-term product direction is simple:
87
+
88
+ ```txt
89
+ SotuRail does not replace Claude, Codex, Gemini, Cursor or other agents.
90
+ SotuRail prepares the local context, memory, logs, diagrams, policies, payload formats and reports those agents need.
71
91
  ```
72
92
 
73
- ## 2. Why SotuRail Exists
93
+ ## Where It Fits
74
94
 
75
- AI coding agents often receive too much unstable context: full files, noisy test logs, repeated terminal output and long conversational summaries. SotuRail is designed to unify those workflows into one independent local-first tool without sending telemetry or inventing provider metrics.
95
+ Useful mental model:
96
+
97
+ ```txt
98
+ Hermes-like systems: agent brain and execution loop.
99
+ Deep Agents-style systems: batteries-included harness with sub-agents, tools, filesystem, memory and approvals.
100
+ Claude Code Harness-style systems: disciplined setup/plan/work/review/release loops with guardrails and evidence.
101
+ MDDD-style systems: Mermaid/.spec.md visual contracts before implementation.
102
+ Plano-like systems: gateway, router and production data plane.
103
+ SotuRail: local Context OS for context, memory, reducers, policy, logs, workflows, diagrams, payload formats and reports.
104
+ ```
105
+
106
+ A newer mental model from the v0.5 planning cycle:
107
+
108
+ ```txt
109
+ Dense-agent setup: every task gets every instruction, file and rule.
110
+ SotuRail setup: route the task to the right local context expert, memory, role pack, rule set, payload format, diagram and workflow evidence.
111
+ ```
112
+
113
+ SotuRail absorbs patterns from the context-engineering ecosystem without vendoring or copying adjacent projects. It stays small, local-first, npm-friendly and safe-by-default. Research notes and product ideas live in [docs/ecosystem-influences.md](docs/ecosystem-influences.md), [docs/comparisons.md](docs/comparisons.md), [docs/deep-agents-patterns.md](docs/deep-agents-patterns.md), [docs/future-rails-index.md](docs/future-rails-index.md), [docs/harness-rail.md](docs/harness-rail.md), [docs/policy-rail.md](docs/policy-rail.md), [docs/diagram-rail.md](docs/diagram-rail.md), [docs/structured-payload-rail.md](docs/structured-payload-rail.md) and [docs/agent-docs-hygiene.md](docs/agent-docs-hygiene.md).
114
+
115
+ ## Built With SotuRail
116
+
117
+ SotuRail dogfoods itself for release-oriented development. `soturail self all` runs repository checks, indexing, build, tests, benchmarks and a local Markdown report through SotuRail's own rails.
118
+
119
+ ```bash
120
+ soturail self doctor
121
+ soturail self index
122
+ soturail self build
123
+ soturail self test
124
+ soturail self bench
125
+ soturail self report
126
+ soturail self all
127
+ ```
128
+
129
+ Reports are written to `.soturail/reports/self-dogfood.md` with stable project context first and dynamic raw IDs, command status and benchmark data later.
76
130
 
77
- ## 3. Key Features
131
+ ## Key Features
78
132
 
79
133
  - Heuristic Repo Map with cross-platform ignore handling.
80
134
  - Progressive reader for large files with reversible collapsed ranges.
81
135
  - Safe tee-stream runner with raw log preservation.
82
136
  - Git, test, npm, TypeScript, Docker, ESLint, Java/Maven/Gradle, build, JSON and generic terminal reducers.
83
- - Optional Rust native reducer and runner hot paths with TypeScript fallback.
84
137
  - Cross-call and block-level dedupe for repeated command output.
138
+ - Optional Rust native reducer and runner hot paths with TypeScript fallback.
85
139
  - Reproducible local benchmark suite.
86
140
  - Agent response compression modes.
87
141
  - Knowledge-to-Rules ingestion and validators.
88
142
  - Prompt-only and hook-style agent integrations.
143
+ - Agent exports for Claude, Codex, Gemini, Cursor, Antigravity and generic hosts.
144
+ - MCP-compatible local stdio server and config helpers.
145
+ - Workflow Rail for local task records and optional worktree planning.
146
+ - Memory Rail with explicit local records, recall, capture and consolidation.
147
+ - Context Intelligence with selection, pruning, budget reports, offload/restore and role packs.
148
+ - Harness, Policy, Filesystem Evidence and Run Workspace seeds.
149
+ - MCP exposure reports and skill routing seeds.
150
+ - Agent docs hygiene checks for short root instruction files.
89
151
  - SDD specs, approved memory and cache block normalization.
90
152
  - Honest local metrics.
91
153
 
92
- ## 4. How It Differs Conceptually
154
+ ## Planned Next Features
155
+
156
+ The next roadmap stage strengthens Workflow Rail, Harness Rail and Diagram Rail:
157
+
158
+ - Workflow templates for idea, PRD, tasks, TDD, review and release.
159
+ - Deeper Harness Rail guidance for repeated agent failures.
160
+ - Diagram Rail commands for `.spec.md` visual contracts and workflow diagrams.
161
+ - Release/workflow evidence reports that connect tests, build, audit, pack, raw IDs and policy decisions.
162
+ - Trace and Report Rails: local records of commands, raw IDs, context packs, memory recall, diagrams, policy decisions and workflow state.
163
+ - Future local UI/report mode: HTML reports first, Mermaid rendering and MCP Apps/AG-UI-style event surfaces later.
93
164
 
94
- SotuRail is an independent implementation. It may be conceptually adjacent to terminal reducers, host hook systems, Spec-Driven Development kits and memory tools, but it does not depend on RTK, Squeez, Spec Kit, Caveman, MemPalace or proprietary workflows.
165
+ ## Future Rails Documentation
95
166
 
96
- SotuRail aims to unify these ideas into one local-first workflow: reversible raw logs, safety policy, benchmarks, prompt cache ordering, specs, memory, hooks and rules.
167
+ Future planning is split across focused docs so the roadmap does not become the only source of truth:
97
168
 
98
- ## 5. Installation
169
+ - [Future Rails Index](docs/future-rails-index.md)
170
+ - [Harness Rail](docs/harness-rail.md)
171
+ - [Policy Rail](docs/policy-rail.md)
172
+ - [Diagram Rail](docs/diagram-rail.md)
173
+ - [Structured Payload Rail](docs/structured-payload-rail.md)
174
+ - [Agent Docs Hygiene](docs/agent-docs-hygiene.md)
175
+ - [Evaluation Suite](docs/evaluation-suite.md)
176
+ - [Roadmap Addendum](docs/roadmap-harness-diagram-payload-addendum.md)
177
+
178
+ ## Installation
99
179
 
100
180
  Use directly with npx:
101
181
 
102
182
  ```bash
103
183
  npx soturail --help
104
- npx soturail@0.4.0 --help
184
+ npx soturail@latest --help
105
185
  ```
106
186
 
107
187
  Install globally:
108
188
 
109
189
  ```bash
110
- npm install -g soturail@0.4.0
190
+ npm install -g soturail
111
191
  soturail --help
112
192
  soturail --version
113
193
  ```
114
194
 
195
+ When v0.6.1 is published, install that exact version with:
196
+
197
+ ```bash
198
+ npm install -g soturail@0.6.1
199
+ ```
200
+
115
201
  For local development from source:
116
202
 
117
203
  ```bash
@@ -130,30 +216,19 @@ npm run build:all # TypeScript + native, requires cargo
130
216
 
131
217
  npm package: https://www.npmjs.com/package/soturail
132
218
 
133
- ## Native Performance Path
134
-
135
- TypeScript remains the public CLI, orchestration, docs and npm distribution layer. Rust handles optional hot paths where streaming, low overhead and binary execution matter:
136
-
137
- - native terminal reducers;
138
- - native JSON/tool payload reducer;
139
- - native tee-stream runner with raw log and summary sidecar support.
140
-
141
- SotuRail does not claim native speedups unless local benchmark results show them for your machine.
142
-
143
- ## 6. Quick Start
219
+ ## Quick Start
144
220
 
145
221
  ```bash
146
222
  soturail init
147
223
  soturail index
148
224
  soturail read README.md --query "quick start"
149
- soturail context pack --target generic
225
+ soturail context pack --target all
150
226
  soturail agents doctor
151
227
  soturail agents export --agent all
152
228
  soturail mcp smoke
153
229
  soturail workflow new "Try SotuRail"
154
230
  soturail skills init demo-skill
155
231
  soturail skills validate
156
- soturail mcp doctor
157
232
  soturail run npm test
158
233
  soturail expand <raw_id>
159
234
  soturail stats
@@ -161,7 +236,39 @@ soturail stats
161
236
 
162
237
  For an installed clean-folder walkthrough, see [docs/first-real-workflow.md](docs/first-real-workflow.md).
163
238
 
164
- ## 7. Commands
239
+ ## First Clean Project Flow
240
+
241
+ ```bash
242
+ soturail init
243
+ soturail memory doctor
244
+ soturail context budget --explain
245
+ soturail context pack --role planner
246
+ soturail harness doctor
247
+ soturail policy doctor
248
+ soturail run workspace new "Try SotuRail"
249
+ soturail context pack --target all
250
+ soturail agents doctor
251
+ soturail agents export --agent all
252
+ soturail mcp smoke
253
+ soturail workflow new "Try SotuRail"
254
+ soturail workflow list
255
+ ```
256
+
257
+ `soturail init` scaffolds agent, MCP, context pack, hook, skill and workflow examples without overwriting user-edited files.
258
+
259
+ ## Agent Setup Tutorials
260
+
261
+ - [Claude Code](docs/tutorial-claude-code.md)
262
+ - [Codex](docs/tutorial-codex.md)
263
+ - [Gemini CLI](docs/tutorial-gemini-cli.md)
264
+ - [Cursor](docs/tutorial-cursor.md)
265
+ - [Antigravity prompt-only](docs/tutorial-antigravity.md)
266
+ - [Deep Agents-style role packs](docs/tutorial-deep-agents-role-packs.md)
267
+ - [Harness workflow](docs/tutorial-harness-workflow.md)
268
+ - [Diagram specs](docs/tutorial-diagram-spec.md)
269
+ - [Context formats](docs/tutorial-context-formats.md)
270
+
271
+ ## Commands
165
272
 
166
273
  ```bash
167
274
  soturail init
@@ -177,80 +284,56 @@ soturail bench prepare
177
284
  soturail bench run --engine ts
178
285
  soturail hooks list
179
286
  soturail agents list
287
+ soturail agents doctor
180
288
  soturail agents export --agent all
181
289
  soturail mcp smoke
182
290
  soturail mcp config --agent generic
183
291
  soturail context pack --target all
292
+ soturail context pack --role planner
293
+ soturail context select --query "release checklist"
294
+ soturail context budget --explain
184
295
  soturail workflow list
296
+ soturail workflow show <id>
297
+ soturail workflow close <id>
298
+ soturail run workspace show <run-id>
185
299
  soturail format README.md --mode concise
300
+ soturail format compare README.md
301
+ soturail validate json package.json --strict
186
302
  soturail ingest README.md --type docs
187
303
  soturail rules check
188
304
  soturail skills init demo-skill
189
305
  soturail skills validate
190
306
  soturail skills export --target claude
191
- soturail context pack --target generic
192
- soturail mcp doctor
193
307
  soturail spec status
194
308
  soturail memory propose "decision"
195
309
  soturail doctor cache
196
310
  ```
197
311
 
198
- ## 8. Benchmarks
199
-
200
- SotuRail includes deterministic local fixtures for terminal compression, agent response compression, JSON/tool payload compression, Knowledge-to-Rules structuring and native performance readiness.
201
-
202
- ```bash
203
- npm run build
204
- soturail bench prepare
205
- soturail bench run --engine ts
206
- soturail bench report
207
- ```
208
-
209
- The latest report is written to [benchmarks/reports/latest.md](benchmarks/reports/latest.md). External comparisons are optional and user-provided only:
210
-
211
- ```bash
212
- soturail bench compare-optional --tool rtk
213
- soturail bench compare-optional --tool squeez
214
- ```
215
-
216
- ### Benchmark Interpretation
217
-
218
- - Terminal compression measures how reducers shrink logs while preserving errors, paths and recovery links.
219
- - Dedupe cases measure conservative block reuse and report `dedupe_tokens_saved`, metadata overhead and net savings.
220
- - Agent response compression measures deterministic formatting modes.
221
- - JSON/tool payload compression preserves relevant primitive values while collapsing repetitive structure.
222
- - Knowledge-to-Rules is reusable structuring, not pure compression; structured rules can be larger than a tiny source document because they add citations and validator metadata.
223
- - Native performance compares Rust and TypeScript only when `soturail-native` is built locally.
224
-
225
- ## Honest Metrics
226
-
227
- Local token counts are deterministic estimates. SotuRail reports raw payload tokens, reduced payload tokens, metadata overhead and net estimated tokens. For tiny outputs, compression may be ineffective once recovery metadata is included; SotuRail says that directly while preserving raw recovery paths.
228
-
229
- ## Reducers And Dedupe
230
-
231
- v0.3.2 adds stronger reducers for common developer commands including `npm install`, `npm test`, Vitest, `tsc`, `git diff`, `git status`, Docker logs, ESLint, Vite/Next build output and Java/Maven/Gradle failures. Reducers preserve errors, warnings, file paths, line/column references, stack traces, security warnings and the raw recovery hint.
312
+ ## Release Workflow
232
313
 
233
- Block-level dedupe is conservative by default. It can replace repeated safe blocks with references such as `[deduped block: ...]`, while preserving error blocks and current failure context. Similar-output dedupe is experimental and opt-in:
314
+ Release automation is local-first and conservative:
234
315
 
235
316
  ```bash
236
- soturail run --similar-dedupe conservative npm test
237
- soturail dedupe stats
317
+ npm run release:check
318
+ npm run release:publish -- X.Y.Z
319
+ npm run release:github -- X.Y.Z
320
+ npm run release:full -- X.Y.Z --publish-npm --github-release
238
321
  ```
239
322
 
240
- ## 9. Agent Hooks
323
+ The release commands accept a positional version, `--target-version X.Y.Z`, or the backward-compatible `--version X.Y.Z` option. The release script never runs `npm audit fix --force`, never publishes when build/tests/runtime audit fail and never creates a GitHub release before npm publish succeeds. See [docs/release-workflow.md](docs/release-workflow.md).
241
324
 
242
- SotuRail provides cautious hook scaffolding and prompt-only fallbacks:
325
+ Release verification installs the packed `.tgz` into a clean temporary project and executes `node_modules/soturail/dist/cli.js` directly to avoid npm cache or global CLI false positives.
243
326
 
244
327
  ```bash
245
- soturail hooks list
246
- soturail hooks doctor
247
- soturail hooks install claude --dry-run
248
- soturail hooks prompt-only codex
328
+ npm run build
329
+ npm test
330
+ npm run release:check
331
+ npm pack --dry-run
249
332
  ```
250
333
 
251
334
  ## Agent Integrations
252
335
 
253
- SotuRail v0.4.0 adds reviewed agent integration profiles for Claude, Codex, Gemini, Cursor, Antigravity and generic agents.
336
+ SotuRail provides reviewed agent integration profiles for Claude, Codex, Gemini, Cursor, Antigravity and generic agents.
254
337
 
255
338
  ```bash
256
339
  soturail agents list
@@ -262,6 +345,31 @@ soturail agents install --agent cursor --mode rules --dry-run
262
345
 
263
346
  Exports live under `.soturail/exports/agents/`. Install commands are dry-run-first, backup-first and project-local by default. SotuRail does not auto-enable arbitrary shell execution or unknown global host configs.
264
347
 
348
+ ## MCP And Context Packs
349
+
350
+ SotuRail exposes local context through a minimal MCP-compatible stdio server and cache-friendly context packs.
351
+
352
+ ```bash
353
+ soturail mcp doctor
354
+ soturail mcp manifest
355
+ soturail mcp serve --transport stdio
356
+ soturail mcp smoke
357
+ soturail context pack --target claude
358
+ soturail context pack --target codex
359
+ soturail context pack --target gemini
360
+ soturail context pack --target cursor
361
+ soturail context pack --target antigravity
362
+ soturail context pack --target generic
363
+ soturail context pack --target all
364
+ soturail context explain
365
+ ```
366
+
367
+ MCP does not expose arbitrary shell execution. Raw log expansion redacts probable secrets unless raw output is explicitly requested.
368
+
369
+ Context packs are written to `.soturail/context/<target>-context.md`. JSON-RPC examples live under [examples/mcp](examples/mcp).
370
+
371
+ Role packs, structured payload validation and offload flows are tracked in [docs/context-packs.md](docs/context-packs.md), [docs/structured-payload-rail.md](docs/structured-payload-rail.md) and [docs/deep-agents-patterns.md](docs/deep-agents-patterns.md).
372
+
265
373
  ## Workflow Rail
266
374
 
267
375
  Workflow Rail stores local task state under `.soturail/workflows/` and can optionally plan Git worktree isolation.
@@ -269,26 +377,15 @@ Workflow Rail stores local task state under `.soturail/workflows/` and can optio
269
377
  ```bash
270
378
  soturail workflow new "Implement feature"
271
379
  soturail workflow list
380
+ soturail workflow show <id>
381
+ soturail workflow close <id>
272
382
  soturail workflow start <id> --worktree --dry-run
273
383
  soturail workflow verify <id>
274
384
  ```
275
385
 
276
386
  SotuRail does not push, merge or delete worktrees automatically.
277
387
 
278
- ## MCP Config Helpers
279
-
280
- ```bash
281
- soturail mcp config --agent claude
282
- soturail mcp config --agent cursor
283
- soturail mcp config --agent generic
284
- soturail mcp smoke
285
- ```
286
-
287
- MCP remains local stdio and does not expose arbitrary shell execution by default.
288
-
289
- Host APIs vary, so SotuRail never writes guessed config without showing the target and creating backups for existing files.
290
-
291
- Review generated hooks before enabling them. SotuRail should never auto-install unreviewed third-party skills, hooks or scripts.
388
+ Future role-phase workflows, harness-style phases and diagram-driven workflows are tracked in [docs/workflow-rail.md](docs/workflow-rail.md), [docs/harness-rail.md](docs/harness-rail.md) and [docs/diagram-rail.md](docs/diagram-rail.md).
292
389
 
293
390
  ## Skill Rail
294
391
 
@@ -302,47 +399,39 @@ soturail skills export --target claude
302
399
  soturail skills pack --format markdown
303
400
  ```
304
401
 
305
- Exports are written under `.soturail/exports/skills/` and should be reviewed before enabling in an agent host.
402
+ Exports are written under `.soturail/exports/skills/` and should be reviewed before enabling in an agent host. Examples live under [examples/skills](examples/skills).
306
403
 
307
- Examples live under [examples/skills](examples/skills).
404
+ Future task/role-aware skill routing is tracked in [docs/skill-rail.md](docs/skill-rail.md).
308
405
 
309
- ## MCP And Context Packs
406
+ ## Reducers And Dedupe
310
407
 
311
- SotuRail exposes local context through a minimal MCP-compatible stdio server and cache-friendly context packs.
408
+ v0.3.2 added stronger reducers for common developer commands including `npm install`, `npm test`, Vitest, `tsc`, `git diff`, `git status`, Docker logs, ESLint, Vite/Next build output and Java/Maven/Gradle failures. Reducers preserve errors, warnings, file paths, line/column references, stack traces, security warnings and the raw recovery hint.
409
+
410
+ Block-level dedupe is conservative by default. It can replace repeated safe blocks with references such as `[deduped block: ...]`, while preserving error blocks and current failure context. Similar-output dedupe is experimental and opt-in:
312
411
 
313
412
  ```bash
314
- soturail mcp doctor
315
- soturail mcp manifest
316
- soturail mcp serve --transport stdio
317
- soturail context pack --target claude
318
- soturail context pack --target codex
319
- soturail context pack --target gemini
320
- soturail context pack --target cursor
321
- soturail context pack --target antigravity
322
- soturail context pack --target generic
323
- soturail context pack --target all
324
- soturail context explain
413
+ soturail run --similar-dedupe conservative npm test
414
+ soturail dedupe stats
325
415
  ```
326
416
 
327
- MCP does not expose arbitrary shell execution. Raw log expansion redacts probable secrets unless raw output is explicitly requested.
417
+ ## Benchmarks And Honest Metrics
328
418
 
329
- Context packs are written to `.soturail/context/<target>-context.md`. JSON-RPC examples live under [examples/mcp](examples/mcp).
419
+ SotuRail includes deterministic local fixtures for terminal compression, agent response compression, JSON/tool payload compression, Knowledge-to-Rules structuring, dedupe and native performance readiness.
330
420
 
331
- ## 10. Agent Response Compression
421
+ ```bash
422
+ npm run build
423
+ soturail bench prepare
424
+ soturail bench run --engine ts
425
+ soturail bench report
426
+ ```
332
427
 
333
- SotuRail includes Caveman-like output compression as inspiration, implemented independently with professional modes:
428
+ The latest report is written to [benchmarks/reports/latest.md](benchmarks/reports/latest.md). External comparisons are optional and user-provided only.
334
429
 
335
- - `normal`
336
- - `concise`
337
- - `ultra`
338
- - `review`
339
- - `commit`
340
- - `debug`
341
- - `docs`
430
+ Local token counts are deterministic estimates. SotuRail reports raw payload tokens, reduced payload tokens, metadata overhead and net estimated tokens. For tiny outputs, compression may be ineffective once recovery metadata is included; SotuRail says that directly while preserving raw recovery paths.
342
431
 
343
- It preserves fenced code blocks, shell commands, file paths, line numbers, security warnings and failure details using deterministic reducers. See [docs/response-compression.md](docs/response-compression.md).
432
+ Future benchmarks will also cover context quality, role-pack quality, diagram validation, evidence-pack completeness and format quality for Markdown vs tagged vs JSON vs compact payloads.
344
433
 
345
- ## 11. Knowledge-to-Rules Engine
434
+ ## Knowledge-to-Rules Engine
346
435
 
347
436
  SotuRail can ingest Markdown, TXT, JSON and YAML into structured YAML/JSON rules, checklists, citations and simple validators.
348
437
 
@@ -353,9 +442,9 @@ soturail rules check
353
442
  soturail rules export --format yaml
354
443
  ```
355
444
 
356
- This makes heavy docs smaller, reusable and auditable without inventing rules that do not appear in the source. See [docs/knowledge-to-rules.md](docs/knowledge-to-rules.md).
445
+ This makes heavy docs smaller, reusable and auditable without inventing rules that do not appear in the source. See [docs/knowledge-to-rules.md](docs/knowledge-to-rules.md), [docs/rules.md](docs/rules.md) and [docs/policy-rail.md](docs/policy-rail.md).
357
446
 
358
- ## 12. Prompt Caching Design
447
+ ## Prompt Caching Design
359
448
 
360
449
  Stable blocks are ordered before dynamic data:
361
450
 
@@ -369,32 +458,65 @@ Stable blocks are ordered before dynamic data:
369
458
 
370
459
  SotuRail reports estimated cache stability only. It never claims real provider cache hits unless imported metadata exists.
371
460
 
372
- ## 13. Security Model
461
+ ## Native Performance Path
462
+
463
+ TypeScript remains the public CLI, orchestration, docs and npm distribution layer. Rust handles optional hot paths where streaming, low overhead and binary execution matter:
464
+
465
+ - native terminal reducers;
466
+ - native JSON/tool payload reducer;
467
+ - native tee-stream runner with raw log and summary sidecar support.
468
+
469
+ SotuRail does not claim native speedups unless local benchmark results show them for your machine.
470
+
471
+ ## Security Model
373
472
 
374
473
  `soturail run` blocks dangerous patterns by default, including `rm -rf`, `sudo`, `format`, `dd if=`, `curl | sh`, `del /s` and `git push`.
375
474
 
376
475
  Raw logs may contain secrets because they preserve real terminal output. Treat `.soturail/raw/` as local evidence, not public artifact material. `soturail expand <raw_id>` redacts probable secrets by default; use `--allow-raw --yes` only when you intentionally need exact raw output.
377
476
 
477
+ Policy queue, auth guidance and MCP exposure reports are tracked in [docs/policy-rail.md](docs/policy-rail.md) and [docs/security-model.md](docs/security-model.md).
478
+
479
+ ## Migration
480
+
481
+ Moving from v0.4.x to v0.5.x keeps the agent export, MCP and Workflow Rail commands, then adds local `.soturail/` folders for Memory, Context Intelligence, Harness, Policy, Filesystem Evidence and Run Workspace seeds. See [docs/migration-v0.5.md](docs/migration-v0.5.md).
482
+
378
483
  ## Windows Notes
379
484
 
380
485
  Windows users should see [docs/windows.md](docs/windows.md) for CMD vs PowerShell quoting, global install, `npx`, local tarball testing and common paste mistakes such as copying Markdown code-fence labels into CMD.
381
486
 
382
- ## Road To Agent And Workflow Rails
487
+ ## Comparison Philosophy
383
488
 
384
- Skill Rail shipped in v0.3.0. Agent integrations and Workflow Rail ship in v0.4.0; see [docs/agents.md](docs/agents.md) and [docs/workflow-rail.md](docs/workflow-rail.md).
489
+ SotuRail is inspired by the broader context-engineering ecosystem, including terminal reducers, agent response compression, spec-driven workflows, local memory, rules extraction, hooks, benchmarks, skill registries, agent memory, harness workflows, Mermaid diagram-driven development, structured prompt payloads and gateway/observability ideas. SotuRail does not vendor or depend on those projects. It aims to unify similar ideas into one local-first workflow while keeping benchmarks honest. See [docs/comparisons.md](docs/comparisons.md), [docs/ecosystem-influences.md](docs/ecosystem-influences.md), [docs/deep-agents-patterns.md](docs/deep-agents-patterns.md) and [docs/future-rails-index.md](docs/future-rails-index.md).
385
490
 
386
- ## Comparison Philosophy
491
+ ## Roadmap
387
492
 
388
- SotuRail is inspired by the broader context-engineering ecosystem, including terminal reducers, agent response compression, spec-driven workflows, local memory, rules extraction, hooks, benchmarks and skill registries. SotuRail does not vendor or depend on those projects. It aims to unify similar ideas into one local-first workflow while keeping benchmarks honest. See [docs/comparisons.md](docs/comparisons.md).
493
+ See [ROADMAP.md](ROADMAP.md).
389
494
 
390
- ## 14. Roadmap
495
+ Near-term direction:
391
496
 
392
- See [ROADMAP.md](ROADMAP.md). v0.4.0 focuses on real agent integrations and Workflow Rail; later releases target native performance, hardened knowledge ingestion, semantic memory and a stable API.
497
+ ```txt
498
+ v0.5.0 Memory Rail + Context Intelligence + Role Packs + Harness/Policy seeds + reliability
499
+ v0.5.1 Memory/context polish + Structured Payload Rail + Agent Docs Hygiene + Diagram docs
500
+ v0.5.2 CI stabilization + lightweight quality fixtures + roadmap realignment
501
+ v0.6.0 Real agent runtime integration + host capability matrix + host-aware payload/policy docs
502
+ v0.6.1 Agent UX polish + full evaluation suite
503
+ v0.7.0 Workflow Rail 2.0 + Harness Rail + Diagram Rail + .spec.md visual contracts
504
+ v0.8.0 Knowledge Rail and Project Brain with specs, diagrams and recurring failures
505
+ v0.9.0 Native Engine Real
506
+ v0.10.0 Local reports, traces, Mermaid rendering and dashboard
507
+ v1.0.0 Stable Context OS
508
+ ```
393
509
 
394
- ## 15. Contributing
510
+ ## Contributing
395
511
 
396
512
  See [CONTRIBUTING.md](CONTRIBUTING.md). Reducers, hooks and rules should include tests, safety notes and benchmark impact when relevant.
397
513
 
398
- ## 16. License
514
+ ## License Status
515
+
516
+ SotuRail is not currently licensed as open source for the current repository state or future versions.
517
+
518
+ All rights are reserved unless a later LICENSE file or written agreement explicitly grants permissions. This repository may be public for portfolio, planning, research, documentation and evaluation visibility, but broad copying, redistribution, sublicensing, commercial use or derivative works are not granted by default.
519
+
520
+ Important: older SotuRail versions or copies that were explicitly released under MIT remain governed by the MIT terms that applied to those specific versions at the time of release.
399
521
 
400
- MIT © Rafael Ryan Ramos de Souza
522
+ See [docs/licensing-strategy.md](docs/licensing-strategy.md).