soturail 0.4.1 → 0.7.0

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 (165) hide show
  1. package/LICENSE +15 -21
  2. package/README.md +292 -157
  3. package/dist/cli.js +12 -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/diagram.d.ts +2 -0
  10. package/dist/commands/diagram.js +24 -0
  11. package/dist/commands/diagram.js.map +1 -0
  12. package/dist/commands/eval.d.ts +2 -0
  13. package/dist/commands/eval.js +25 -0
  14. package/dist/commands/eval.js.map +1 -0
  15. package/dist/commands/format.js +14 -4
  16. package/dist/commands/format.js.map +1 -1
  17. package/dist/commands/fs.d.ts +2 -0
  18. package/dist/commands/fs.js +19 -0
  19. package/dist/commands/fs.js.map +1 -0
  20. package/dist/commands/harness.d.ts +2 -0
  21. package/dist/commands/harness.js +35 -0
  22. package/dist/commands/harness.js.map +1 -0
  23. package/dist/commands/mcp.js +5 -0
  24. package/dist/commands/mcp.js.map +1 -1
  25. package/dist/commands/memory.js +40 -0
  26. package/dist/commands/memory.js.map +1 -1
  27. package/dist/commands/native.js +4 -0
  28. package/dist/commands/native.js.map +1 -1
  29. package/dist/commands/policy.d.ts +2 -0
  30. package/dist/commands/policy.js +25 -0
  31. package/dist/commands/policy.js.map +1 -0
  32. package/dist/commands/release.js +9 -2
  33. package/dist/commands/release.js.map +1 -1
  34. package/dist/commands/run.js +15 -3
  35. package/dist/commands/run.js.map +1 -1
  36. package/dist/commands/skills.js +15 -0
  37. package/dist/commands/skills.js.map +1 -1
  38. package/dist/commands/validate.d.ts +2 -0
  39. package/dist/commands/validate.js +13 -0
  40. package/dist/commands/validate.js.map +1 -0
  41. package/dist/commands/workflow.js +35 -5
  42. package/dist/commands/workflow.js.map +1 -1
  43. package/dist/core/agent-docs-hygiene.d.ts +3 -0
  44. package/dist/core/agent-docs-hygiene.js +83 -0
  45. package/dist/core/agent-docs-hygiene.js.map +1 -0
  46. package/dist/core/agent-exporter.d.ts +3 -1
  47. package/dist/core/agent-exporter.js +136 -12
  48. package/dist/core/agent-exporter.js.map +1 -1
  49. package/dist/core/agent-profile.d.ts +1 -1
  50. package/dist/core/agent-registry.js +60 -0
  51. package/dist/core/agent-registry.js.map +1 -1
  52. package/dist/core/agent-runtime.d.ts +57 -0
  53. package/dist/core/agent-runtime.js +371 -0
  54. package/dist/core/agent-runtime.js.map +1 -0
  55. package/dist/core/config.d.ts +20 -0
  56. package/dist/core/config.js +39 -2
  57. package/dist/core/config.js.map +1 -1
  58. package/dist/core/context-intelligence.d.ts +47 -0
  59. package/dist/core/context-intelligence.js +283 -0
  60. package/dist/core/context-intelligence.js.map +1 -0
  61. package/dist/core/diagram-rail.d.ts +31 -0
  62. package/dist/core/diagram-rail.js +235 -0
  63. package/dist/core/diagram-rail.js.map +1 -0
  64. package/dist/core/diagram-validator.d.ts +10 -0
  65. package/dist/core/diagram-validator.js +53 -0
  66. package/dist/core/diagram-validator.js.map +1 -0
  67. package/dist/core/evaluation-suite.d.ts +28 -0
  68. package/dist/core/evaluation-suite.js +333 -0
  69. package/dist/core/evaluation-suite.js.map +1 -0
  70. package/dist/core/evidence-pack.d.ts +4 -0
  71. package/dist/core/evidence-pack.js +139 -0
  72. package/dist/core/evidence-pack.js.map +1 -0
  73. package/dist/core/format-compare.d.ts +12 -0
  74. package/dist/core/format-compare.js +68 -0
  75. package/dist/core/format-compare.js.map +1 -0
  76. package/dist/core/fs-evidence.d.ts +25 -0
  77. package/dist/core/fs-evidence.js +96 -0
  78. package/dist/core/fs-evidence.js.map +1 -0
  79. package/dist/core/harness-rail.d.ts +34 -0
  80. package/dist/core/harness-rail.js +158 -0
  81. package/dist/core/harness-rail.js.map +1 -0
  82. package/dist/core/json-validator.d.ts +24 -0
  83. package/dist/core/json-validator.js +138 -0
  84. package/dist/core/json-validator.js.map +1 -0
  85. package/dist/core/mcp-exposure.d.ts +20 -0
  86. package/dist/core/mcp-exposure.js +48 -0
  87. package/dist/core/mcp-exposure.js.map +1 -0
  88. package/dist/core/memory-rail.d.ts +37 -0
  89. package/dist/core/memory-rail.js +142 -0
  90. package/dist/core/memory-rail.js.map +1 -0
  91. package/dist/core/policy-rail.d.ts +27 -0
  92. package/dist/core/policy-rail.js +102 -0
  93. package/dist/core/policy-rail.js.map +1 -0
  94. package/dist/core/rail-utils.d.ts +10 -0
  95. package/dist/core/rail-utils.js +58 -0
  96. package/dist/core/rail-utils.js.map +1 -0
  97. package/dist/core/release-preflight.js +1 -1
  98. package/dist/core/release-preflight.js.map +1 -1
  99. package/dist/core/run-workspace.d.ts +38 -0
  100. package/dist/core/run-workspace.js +108 -0
  101. package/dist/core/run-workspace.js.map +1 -0
  102. package/dist/core/skill-routing.d.ts +2 -0
  103. package/dist/core/skill-routing.js +51 -0
  104. package/dist/core/skill-routing.js.map +1 -0
  105. package/dist/core/version.d.ts +1 -1
  106. package/dist/core/version.js +1 -1
  107. package/dist/core/workflow-store.d.ts +68 -0
  108. package/dist/core/workflow-store.js +360 -6
  109. package/dist/core/workflow-store.js.map +1 -1
  110. package/docs/agent-docs-hygiene.md +175 -0
  111. package/docs/agents.md +190 -2
  112. package/docs/benchmarking.md +213 -2
  113. package/docs/comparisons.md +195 -11
  114. package/docs/context-intelligence.md +127 -0
  115. package/docs/context-packs.md +237 -1
  116. package/docs/deep-agents-patterns.md +188 -0
  117. package/docs/diagram-rail.md +125 -0
  118. package/docs/ecosystem-influences.md +435 -0
  119. package/docs/evaluation-suite.md +196 -0
  120. package/docs/filesystem-evidence-rail.md +119 -0
  121. package/docs/future-rails-index.md +209 -0
  122. package/docs/harness-rail.md +117 -0
  123. package/docs/licensing-strategy.md +135 -0
  124. package/docs/mcp.md +96 -0
  125. package/docs/memory-rail.md +189 -0
  126. package/docs/metrics.md +136 -1
  127. package/docs/migration-v0.5.md +89 -0
  128. package/docs/policy-rail.md +184 -0
  129. package/docs/release-checklist.md +14 -0
  130. package/docs/release-workflow.md +34 -1
  131. package/docs/releases/README.md +27 -0
  132. package/docs/releases/RELEASE_NOTES_v0.2.1.md +19 -0
  133. package/docs/releases/RELEASE_NOTES_v0.2.2.md +48 -0
  134. package/docs/releases/RELEASE_NOTES_v0.2.3.md +36 -0
  135. package/docs/releases/RELEASE_NOTES_v0.3.0.md +42 -0
  136. package/docs/releases/RELEASE_NOTES_v0.3.1.md +37 -0
  137. package/docs/releases/RELEASE_NOTES_v0.3.2.md +33 -0
  138. package/docs/releases/RELEASE_NOTES_v0.3.3.md +31 -0
  139. package/docs/releases/RELEASE_NOTES_v0.4.0.md +35 -0
  140. package/docs/releases/RELEASE_NOTES_v0.4.1.md +37 -0
  141. package/docs/releases/RELEASE_NOTES_v0.5.0.md +21 -0
  142. package/docs/releases/RELEASE_NOTES_v0.5.1.md +19 -0
  143. package/docs/releases/RELEASE_NOTES_v0.5.2.md +27 -0
  144. package/docs/releases/RELEASE_NOTES_v0.6.0.md +33 -0
  145. package/docs/releases/RELEASE_NOTES_v0.6.1.md +37 -0
  146. package/docs/releases/RELEASE_NOTES_v0.7.0.md +33 -0
  147. package/docs/roadmap-agent-runtime-addendum.md +304 -0
  148. package/docs/roadmap-harness-diagram-payload-addendum.md +300 -0
  149. package/docs/rules.md +56 -0
  150. package/docs/security-model.md +56 -0
  151. package/docs/skill-rail.md +57 -0
  152. package/docs/spec-driven-workflow.md +49 -9
  153. package/docs/structured-payload-rail.md +251 -0
  154. package/docs/tutorial-antigravity.md +20 -0
  155. package/docs/tutorial-claude-code.md +23 -0
  156. package/docs/tutorial-codex.md +22 -0
  157. package/docs/tutorial-context-formats.md +28 -0
  158. package/docs/tutorial-cursor.md +23 -0
  159. package/docs/tutorial-deep-agents-role-packs.md +24 -0
  160. package/docs/tutorial-diagram-spec.md +26 -0
  161. package/docs/tutorial-gemini-cli.md +21 -0
  162. package/docs/tutorial-harness-workflow.md +25 -0
  163. package/docs/workflow-rail.md +98 -14
  164. package/examples/agents/README.md +13 -0
  165. 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,207 @@ 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.1 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.7.0 is the Workflow Rail 2.0, Harness Rail and Diagram Rail 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 packs, the host-aware Agent Runtime Adapter, Diagram Rail 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.8.0 adds Knowledge Rail and Project Brain 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
48
-
49
- Release automation is local-first and conservative:
53
+ ## v0.6.0 Agent Runtime Adapter
50
54
 
51
55
  ```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
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
56
66
  ```
57
67
 
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).
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.
59
69
 
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.
70
+ ## v0.6.1 Evaluation Suite
71
+
72
+ ```bash
73
+ soturail eval list
74
+ soturail eval run
75
+ soturail eval report
76
+ ```
77
+
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`.
61
79
 
62
- ## Release Reliability
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).
63
81
 
64
- SotuRail includes a release preflight check to prevent stale package metadata, broken npm CLI binaries, missing release notes, and changelog/version mismatches.
82
+ ## v0.7.0 Workflow, Harness And Diagram Rails
65
83
 
66
84
  ```bash
67
- npm run build
68
- npm test
69
- npm run release:check
70
- npm pack --dry-run
85
+ soturail workflow setup
86
+ soturail workflow plan "Implement feature"
87
+ soturail workflow work --note "Implemented the first slice"
88
+ soturail workflow review --all
89
+ soturail workflow verify
90
+ soturail workflow evidence <id>
91
+ soturail workflow diagram <id>
92
+
93
+ soturail diagram init
94
+ soturail diagram new "Feature flow"
95
+ soturail diagram audit docs/diagrams/feature-flow.md
96
+ soturail diagram validate
97
+ soturail diagram from-workflow <id>
71
98
  ```
72
99
 
73
- ## 2. Why SotuRail Exists
100
+ Workflow Rail 2.0 writes local plan/work/review/verify artifacts under `.soturail/workflows/`. Harness Rail connects repeated failures and acceptance contracts to verification and evidence. Diagram Rail writes text-based Mermaid diagrams and `.spec.md` visual contracts under `docs/diagrams/` and `.soturail/diagrams/`.
101
+
102
+ Release notes now live under `docs/releases/`, and release evidence points to `docs/releases/RELEASE_NOTES_vX.Y.Z.md`.
103
+
104
+ ## Why SotuRail Exists
74
105
 
75
106
  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.
76
107
 
77
- ## 3. Key Features
108
+ The long-term product direction is simple:
109
+
110
+ ```txt
111
+ SotuRail does not replace Claude, Codex, Gemini, Cursor or other agents.
112
+ SotuRail prepares the local context, memory, logs, diagrams, policies, payload formats and reports those agents need.
113
+ ```
114
+
115
+ ## Where It Fits
116
+
117
+ Useful mental model:
118
+
119
+ ```txt
120
+ Hermes-like systems: agent brain and execution loop.
121
+ Deep Agents-style systems: batteries-included harness with sub-agents, tools, filesystem, memory and approvals.
122
+ Claude Code Harness-style systems: disciplined setup/plan/work/review/release loops with guardrails and evidence.
123
+ MDDD-style systems: Mermaid/.spec.md visual contracts before implementation.
124
+ Plano-like systems: gateway, router and production data plane.
125
+ SotuRail: local Context OS for context, memory, reducers, policy, logs, workflows, diagrams, payload formats and reports.
126
+ ```
127
+
128
+ A newer mental model from the v0.5 planning cycle:
129
+
130
+ ```txt
131
+ Dense-agent setup: every task gets every instruction, file and rule.
132
+ SotuRail setup: route the task to the right local context expert, memory, role pack, rule set, payload format, diagram and workflow evidence.
133
+ ```
134
+
135
+ 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).
136
+
137
+ ## Built With SotuRail
138
+
139
+ 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.
140
+
141
+ ```bash
142
+ soturail self doctor
143
+ soturail self index
144
+ soturail self build
145
+ soturail self test
146
+ soturail self bench
147
+ soturail self report
148
+ soturail self all
149
+ ```
150
+
151
+ Reports are written to `.soturail/reports/self-dogfood.md` with stable project context first and dynamic raw IDs, command status and benchmark data later.
152
+
153
+ ## Key Features
78
154
 
79
155
  - Heuristic Repo Map with cross-platform ignore handling.
80
156
  - Progressive reader for large files with reversible collapsed ranges.
81
157
  - Safe tee-stream runner with raw log preservation.
82
158
  - 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
159
  - Cross-call and block-level dedupe for repeated command output.
160
+ - Optional Rust native reducer and runner hot paths with TypeScript fallback.
85
161
  - Reproducible local benchmark suite.
86
162
  - Agent response compression modes.
87
163
  - Knowledge-to-Rules ingestion and validators.
88
164
  - Prompt-only and hook-style agent integrations.
165
+ - Agent exports for Claude, Codex, Gemini, Cursor, Antigravity and generic hosts.
166
+ - MCP-compatible local stdio server and config helpers.
167
+ - Workflow Rail for local task records, phase evidence and optional worktree planning.
168
+ - Memory Rail with explicit local records, recall, capture and consolidation.
169
+ - Context Intelligence with selection, pruning, budget reports, offload/restore and role packs.
170
+ - Harness, Policy, Filesystem Evidence, Diagram and Run Workspace rails.
171
+ - MCP exposure reports and skill routing seeds.
172
+ - Agent docs hygiene checks for short root instruction files.
89
173
  - SDD specs, approved memory and cache block normalization.
90
174
  - Honest local metrics.
91
175
 
92
- ## 4. How It Differs Conceptually
176
+ ## Planned Next Features
177
+
178
+ The next roadmap stage moves toward Knowledge Rail and Project Brain:
179
+
180
+ - architecture decisions and recurring bug patterns from local docs and workflow evidence;
181
+ - stale evidence detection across richer project graphs;
182
+ - safer knowledge-to-rules extraction;
183
+ - project profiles for agents;
184
+ - future local UI/report mode: HTML reports first, Mermaid rendering and MCP Apps/AG-UI-style event surfaces later.
93
185
 
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.
186
+ ## Future Rails Documentation
95
187
 
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.
188
+ Future planning is split across focused docs so the roadmap does not become the only source of truth:
97
189
 
98
- ## 5. Installation
190
+ - [Future Rails Index](docs/future-rails-index.md)
191
+ - [Harness Rail](docs/harness-rail.md)
192
+ - [Policy Rail](docs/policy-rail.md)
193
+ - [Diagram Rail](docs/diagram-rail.md)
194
+ - [Structured Payload Rail](docs/structured-payload-rail.md)
195
+ - [Agent Docs Hygiene](docs/agent-docs-hygiene.md)
196
+ - [Evaluation Suite](docs/evaluation-suite.md)
197
+ - [Roadmap Addendum](docs/roadmap-harness-diagram-payload-addendum.md)
198
+
199
+ ## Installation
99
200
 
100
201
  Use directly with npx:
101
202
 
102
203
  ```bash
103
204
  npx soturail --help
104
- npx soturail@0.4.1 --help
205
+ npx soturail@latest --help
105
206
  ```
106
207
 
107
208
  Install globally:
108
209
 
109
210
  ```bash
110
- npm install -g soturail@0.4.1
211
+ npm install -g soturail
111
212
  soturail --help
112
213
  soturail --version
113
214
  ```
114
215
 
216
+ When v0.6.1 is published, install that exact version with:
217
+
218
+ ```bash
219
+ npm install -g soturail@0.6.1
220
+ ```
221
+
115
222
  For local development from source:
116
223
 
117
224
  ```bash
@@ -130,30 +237,19 @@ npm run build:all # TypeScript + native, requires cargo
130
237
 
131
238
  npm package: https://www.npmjs.com/package/soturail
132
239
 
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
240
+ ## Quick Start
144
241
 
145
242
  ```bash
146
243
  soturail init
147
244
  soturail index
148
245
  soturail read README.md --query "quick start"
149
- soturail context pack --target generic
246
+ soturail context pack --target all
150
247
  soturail agents doctor
151
248
  soturail agents export --agent all
152
249
  soturail mcp smoke
153
250
  soturail workflow new "Try SotuRail"
154
251
  soturail skills init demo-skill
155
252
  soturail skills validate
156
- soturail mcp doctor
157
253
  soturail run npm test
158
254
  soturail expand <raw_id>
159
255
  soturail stats
@@ -161,10 +257,16 @@ soturail stats
161
257
 
162
258
  For an installed clean-folder walkthrough, see [docs/first-real-workflow.md](docs/first-real-workflow.md).
163
259
 
164
- ## First clean project flow
260
+ ## First Clean Project Flow
165
261
 
166
262
  ```bash
167
263
  soturail init
264
+ soturail memory doctor
265
+ soturail context budget --explain
266
+ soturail context pack --role planner
267
+ soturail harness doctor
268
+ soturail policy doctor
269
+ soturail run workspace new "Try SotuRail"
168
270
  soturail context pack --target all
169
271
  soturail agents doctor
170
272
  soturail agents export --agent all
@@ -175,7 +277,19 @@ soturail workflow list
175
277
 
176
278
  `soturail init` scaffolds agent, MCP, context pack, hook, skill and workflow examples without overwriting user-edited files.
177
279
 
178
- ## 7. Commands
280
+ ## Agent Setup Tutorials
281
+
282
+ - [Claude Code](docs/tutorial-claude-code.md)
283
+ - [Codex](docs/tutorial-codex.md)
284
+ - [Gemini CLI](docs/tutorial-gemini-cli.md)
285
+ - [Cursor](docs/tutorial-cursor.md)
286
+ - [Antigravity prompt-only](docs/tutorial-antigravity.md)
287
+ - [Deep Agents-style role packs](docs/tutorial-deep-agents-role-packs.md)
288
+ - [Harness workflow](docs/tutorial-harness-workflow.md)
289
+ - [Diagram specs](docs/tutorial-diagram-spec.md)
290
+ - [Context formats](docs/tutorial-context-formats.md)
291
+
292
+ ## Commands
179
293
 
180
294
  ```bash
181
295
  soturail init
@@ -191,80 +305,56 @@ soturail bench prepare
191
305
  soturail bench run --engine ts
192
306
  soturail hooks list
193
307
  soturail agents list
308
+ soturail agents doctor
194
309
  soturail agents export --agent all
195
310
  soturail mcp smoke
196
311
  soturail mcp config --agent generic
197
312
  soturail context pack --target all
313
+ soturail context pack --role planner
314
+ soturail context select --query "release checklist"
315
+ soturail context budget --explain
198
316
  soturail workflow list
317
+ soturail workflow show <id>
318
+ soturail workflow close <id>
319
+ soturail run workspace show <run-id>
199
320
  soturail format README.md --mode concise
321
+ soturail format compare README.md
322
+ soturail validate json package.json --strict
200
323
  soturail ingest README.md --type docs
201
324
  soturail rules check
202
325
  soturail skills init demo-skill
203
326
  soturail skills validate
204
327
  soturail skills export --target claude
205
- soturail context pack --target generic
206
- soturail mcp doctor
207
328
  soturail spec status
208
329
  soturail memory propose "decision"
209
330
  soturail doctor cache
210
331
  ```
211
332
 
212
- ## 8. Benchmarks
213
-
214
- SotuRail includes deterministic local fixtures for terminal compression, agent response compression, JSON/tool payload compression, Knowledge-to-Rules structuring and native performance readiness.
215
-
216
- ```bash
217
- npm run build
218
- soturail bench prepare
219
- soturail bench run --engine ts
220
- soturail bench report
221
- ```
222
-
223
- The latest report is written to [benchmarks/reports/latest.md](benchmarks/reports/latest.md). External comparisons are optional and user-provided only:
224
-
225
- ```bash
226
- soturail bench compare-optional --tool rtk
227
- soturail bench compare-optional --tool squeez
228
- ```
229
-
230
- ### Benchmark Interpretation
231
-
232
- - Terminal compression measures how reducers shrink logs while preserving errors, paths and recovery links.
233
- - Dedupe cases measure conservative block reuse and report `dedupe_tokens_saved`, metadata overhead and net savings.
234
- - Agent response compression measures deterministic formatting modes.
235
- - JSON/tool payload compression preserves relevant primitive values while collapsing repetitive structure.
236
- - 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.
237
- - Native performance compares Rust and TypeScript only when `soturail-native` is built locally.
238
-
239
- ## Honest Metrics
240
-
241
- 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.
242
-
243
- ## Reducers And Dedupe
244
-
245
- 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.
333
+ ## Release Workflow
246
334
 
247
- 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:
335
+ Release automation is local-first and conservative:
248
336
 
249
337
  ```bash
250
- soturail run --similar-dedupe conservative npm test
251
- soturail dedupe stats
338
+ npm run release:check
339
+ npm run release:publish -- X.Y.Z
340
+ npm run release:github -- X.Y.Z
341
+ npm run release:full -- X.Y.Z --publish-npm --github-release
252
342
  ```
253
343
 
254
- ## 9. Agent Hooks
344
+ 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).
255
345
 
256
- SotuRail provides cautious hook scaffolding and prompt-only fallbacks:
346
+ 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.
257
347
 
258
348
  ```bash
259
- soturail hooks list
260
- soturail hooks doctor
261
- soturail hooks install claude --dry-run
262
- soturail hooks prompt-only codex
349
+ npm run build
350
+ npm test
351
+ npm run release:check
352
+ npm pack --dry-run
263
353
  ```
264
354
 
265
355
  ## Agent Integrations
266
356
 
267
- SotuRail adds reviewed agent integration profiles for Claude, Codex, Gemini, Cursor, Antigravity and generic agents.
357
+ SotuRail provides reviewed agent integration profiles for Claude, Codex, Gemini, Cursor, Antigravity and generic agents.
268
358
 
269
359
  ```bash
270
360
  soturail agents list
@@ -276,33 +366,53 @@ soturail agents install --agent cursor --mode rules --dry-run
276
366
 
277
367
  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.
278
368
 
279
- ## Workflow Rail
369
+ ## MCP And Context Packs
280
370
 
281
- Workflow Rail stores local task state under `.soturail/workflows/` and can optionally plan Git worktree isolation.
371
+ SotuRail exposes local context through a minimal MCP-compatible stdio server and cache-friendly context packs.
282
372
 
283
373
  ```bash
284
- soturail workflow new "Implement feature"
285
- soturail workflow list
286
- soturail workflow start <id> --worktree --dry-run
287
- soturail workflow verify <id>
374
+ soturail mcp doctor
375
+ soturail mcp manifest
376
+ soturail mcp serve --transport stdio
377
+ soturail mcp smoke
378
+ soturail context pack --target claude
379
+ soturail context pack --target codex
380
+ soturail context pack --target gemini
381
+ soturail context pack --target cursor
382
+ soturail context pack --target antigravity
383
+ soturail context pack --target generic
384
+ soturail context pack --target all
385
+ soturail context explain
288
386
  ```
289
387
 
290
- SotuRail does not push, merge or delete worktrees automatically.
388
+ MCP does not expose arbitrary shell execution. Raw log expansion redacts probable secrets unless raw output is explicitly requested.
389
+
390
+ Context packs are written to `.soturail/context/<target>-context.md`. JSON-RPC examples live under [examples/mcp](examples/mcp).
391
+
392
+ 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).
291
393
 
292
- ## MCP Config Helpers
394
+ ## Workflow Rail
395
+
396
+ Workflow Rail stores local task state under `.soturail/workflows/` and can optionally plan Git worktree isolation. v0.7.0 adds phase artifacts for setup, plan, work, review, verify and evidence.
293
397
 
294
398
  ```bash
295
- soturail mcp config --agent claude
296
- soturail mcp config --agent cursor
297
- soturail mcp config --agent generic
298
- soturail mcp smoke
399
+ soturail workflow setup
400
+ soturail workflow plan "Implement feature"
401
+ soturail workflow work --note "Progress note"
402
+ soturail workflow review --all
403
+ soturail workflow verify
404
+ soturail workflow evidence <id>
405
+ soturail workflow diagram <id>
406
+ soturail workflow new "Implement feature"
407
+ soturail workflow list
408
+ soturail workflow show <id>
409
+ soturail workflow close <id>
410
+ soturail workflow start <id> --worktree --dry-run
299
411
  ```
300
412
 
301
- MCP remains local stdio and does not expose arbitrary shell execution by default.
302
-
303
- Host APIs vary, so SotuRail never writes guessed config without showing the target and creating backups for existing files.
413
+ SotuRail does not push, merge or delete worktrees automatically.
304
414
 
305
- Review generated hooks before enabling them. SotuRail should never auto-install unreviewed third-party skills, hooks or scripts.
415
+ Harness-style phases and diagram-driven workflows are documented 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).
306
416
 
307
417
  ## Skill Rail
308
418
 
@@ -316,47 +426,39 @@ soturail skills export --target claude
316
426
  soturail skills pack --format markdown
317
427
  ```
318
428
 
319
- Exports are written under `.soturail/exports/skills/` and should be reviewed before enabling in an agent host.
429
+ Exports are written under `.soturail/exports/skills/` and should be reviewed before enabling in an agent host. Examples live under [examples/skills](examples/skills).
320
430
 
321
- Examples live under [examples/skills](examples/skills).
431
+ Future task/role-aware skill routing is tracked in [docs/skill-rail.md](docs/skill-rail.md).
322
432
 
323
- ## MCP And Context Packs
433
+ ## Reducers And Dedupe
324
434
 
325
- SotuRail exposes local context through a minimal MCP-compatible stdio server and cache-friendly context packs.
435
+ 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.
436
+
437
+ 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:
326
438
 
327
439
  ```bash
328
- soturail mcp doctor
329
- soturail mcp manifest
330
- soturail mcp serve --transport stdio
331
- soturail context pack --target claude
332
- soturail context pack --target codex
333
- soturail context pack --target gemini
334
- soturail context pack --target cursor
335
- soturail context pack --target antigravity
336
- soturail context pack --target generic
337
- soturail context pack --target all
338
- soturail context explain
440
+ soturail run --similar-dedupe conservative npm test
441
+ soturail dedupe stats
339
442
  ```
340
443
 
341
- MCP does not expose arbitrary shell execution. Raw log expansion redacts probable secrets unless raw output is explicitly requested.
444
+ ## Benchmarks And Honest Metrics
342
445
 
343
- Context packs are written to `.soturail/context/<target>-context.md`. JSON-RPC examples live under [examples/mcp](examples/mcp).
446
+ SotuRail includes deterministic local fixtures for terminal compression, agent response compression, JSON/tool payload compression, Knowledge-to-Rules structuring, dedupe and native performance readiness.
344
447
 
345
- ## 10. Agent Response Compression
448
+ ```bash
449
+ npm run build
450
+ soturail bench prepare
451
+ soturail bench run --engine ts
452
+ soturail bench report
453
+ ```
346
454
 
347
- SotuRail includes Caveman-like output compression as inspiration, implemented independently with professional modes:
455
+ The latest report is written to [benchmarks/reports/latest.md](benchmarks/reports/latest.md). External comparisons are optional and user-provided only.
348
456
 
349
- - `normal`
350
- - `concise`
351
- - `ultra`
352
- - `review`
353
- - `commit`
354
- - `debug`
355
- - `docs`
457
+ 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.
356
458
 
357
- 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).
459
+ 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.
358
460
 
359
- ## 11. Knowledge-to-Rules Engine
461
+ ## Knowledge-to-Rules Engine
360
462
 
361
463
  SotuRail can ingest Markdown, TXT, JSON and YAML into structured YAML/JSON rules, checklists, citations and simple validators.
362
464
 
@@ -367,9 +469,9 @@ soturail rules check
367
469
  soturail rules export --format yaml
368
470
  ```
369
471
 
370
- 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).
472
+ 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).
371
473
 
372
- ## 12. Prompt Caching Design
474
+ ## Prompt Caching Design
373
475
 
374
476
  Stable blocks are ordered before dynamic data:
375
477
 
@@ -383,32 +485,65 @@ Stable blocks are ordered before dynamic data:
383
485
 
384
486
  SotuRail reports estimated cache stability only. It never claims real provider cache hits unless imported metadata exists.
385
487
 
386
- ## 13. Security Model
488
+ ## Native Performance Path
489
+
490
+ TypeScript remains the public CLI, orchestration, docs and npm distribution layer. Rust handles optional hot paths where streaming, low overhead and binary execution matter:
491
+
492
+ - native terminal reducers;
493
+ - native JSON/tool payload reducer;
494
+ - native tee-stream runner with raw log and summary sidecar support.
495
+
496
+ SotuRail does not claim native speedups unless local benchmark results show them for your machine.
497
+
498
+ ## Security Model
387
499
 
388
500
  `soturail run` blocks dangerous patterns by default, including `rm -rf`, `sudo`, `format`, `dd if=`, `curl | sh`, `del /s` and `git push`.
389
501
 
390
502
  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.
391
503
 
504
+ 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).
505
+
506
+ ## Migration
507
+
508
+ 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).
509
+
392
510
  ## Windows Notes
393
511
 
394
512
  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.
395
513
 
396
- ## Road To Agent And Workflow Rails
514
+ ## Comparison Philosophy
397
515
 
398
- Skill Rail, agent integrations and Workflow Rail are documented in [docs/skill-rail.md](docs/skill-rail.md), [docs/agents.md](docs/agents.md) and [docs/workflow-rail.md](docs/workflow-rail.md).
516
+ 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).
399
517
 
400
- ## Comparison Philosophy
518
+ ## Roadmap
401
519
 
402
- 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).
520
+ See [ROADMAP.md](ROADMAP.md).
403
521
 
404
- ## 14. Roadmap
522
+ Near-term direction:
405
523
 
406
- See [ROADMAP.md](ROADMAP.md). v0.4.1 focuses on scaffold and UX polish; later releases target native performance, hardened knowledge ingestion, semantic memory and a stable API.
524
+ ```txt
525
+ v0.5.0 Memory Rail + Context Intelligence + Role Packs + Harness/Policy seeds + reliability
526
+ v0.5.1 Memory/context polish + Structured Payload Rail + Agent Docs Hygiene + Diagram docs
527
+ v0.5.2 CI stabilization + lightweight quality fixtures + roadmap realignment
528
+ v0.6.0 Real agent runtime integration + host capability matrix + host-aware payload/policy docs
529
+ v0.6.1 Agent UX polish + full evaluation suite
530
+ v0.7.0 Workflow Rail 2.0 + Harness Rail + Diagram Rail + .spec.md visual contracts
531
+ v0.8.0 Knowledge Rail and Project Brain with specs, diagrams and recurring failures
532
+ v0.9.0 Native Engine Real
533
+ v0.10.0 Local reports, traces, Mermaid rendering and dashboard
534
+ v1.0.0 Stable Context OS
535
+ ```
407
536
 
408
- ## 15. Contributing
537
+ ## Contributing
409
538
 
410
539
  See [CONTRIBUTING.md](CONTRIBUTING.md). Reducers, hooks and rules should include tests, safety notes and benchmark impact when relevant.
411
540
 
412
- ## 16. License
541
+ ## License Status
542
+
543
+ SotuRail is not currently licensed as open source for the current repository state or future versions.
544
+
545
+ 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.
546
+
547
+ 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.
413
548
 
414
- MIT © Rafael Ryan Ramos de Souza
549
+ See [docs/licensing-strategy.md](docs/licensing-strategy.md).