soturail 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +69 -0
- package/dist/cli.js +3 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/bench.d.ts +14 -3
- package/dist/commands/bench.js +237 -180
- package/dist/commands/bench.js.map +1 -1
- package/dist/commands/run.js +20 -1
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/self.d.ts +2 -0
- package/dist/commands/self.js +49 -0
- package/dist/commands/self.js.map +1 -0
- package/dist/commands/stats.d.ts +6 -0
- package/dist/commands/stats.js +28 -0
- package/dist/commands/stats.js.map +1 -1
- package/dist/core/config.d.ts +1 -1
- package/dist/core/config.js +1 -0
- package/dist/core/config.js.map +1 -1
- package/dist/core/file-scanner.js +6 -2
- package/dist/core/file-scanner.js.map +1 -1
- package/dist/core/metrics-store.d.ts +7 -0
- package/dist/core/metrics-store.js.map +1 -1
- package/dist/core/self-dogfood.d.ts +56 -0
- package/dist/core/self-dogfood.js +323 -0
- package/dist/core/self-dogfood.js.map +1 -0
- package/docs/benchmarking.md +4 -2
- package/docs/hooks/claude.md +4 -0
- package/docs/hooks/codex.md +11 -0
- package/docs/hooks/cursor.md +11 -0
- package/docs/hooks/gemini.md +11 -0
- package/docs/hooks.md +11 -0
- package/docs/release-checklist.md +36 -6
- package/docs/release-workflow.md +54 -0
- package/docs/skill-rail.md +28 -0
- package/docs/windows.md +76 -0
- package/docs/workflow-rail.md +26 -0
- package/package.json +7 -2
package/README.md
CHANGED
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
[](tsconfig.json)
|
|
9
9
|
[](LICENSE)
|
|
10
10
|
[](https://github.com/Soturine/soturail/actions/workflows/ci.yml)
|
|
11
|
+
[](https://www.npmjs.com/package/soturail)
|
|
12
|
+
[](https://www.npmjs.com/package/soturail)
|
|
11
13
|
[](docs/security-model.md)
|
|
12
14
|
[](docs/prompt-caching.md)
|
|
13
15
|
|
|
@@ -24,6 +26,37 @@ It wraps a repository and terminal session with reversible evidence rails: heuri
|
|
|
24
26
|
|
|
25
27
|
v0.2.x is early but functional. TypeScript mode is stable for local usage. Native Rust mode is optional and focused on hot paths. Benchmarks are local and reproducible. External comparisons are optional and user-provided.
|
|
26
28
|
|
|
29
|
+
## Built With SotuRail
|
|
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.
|
|
32
|
+
|
|
33
|
+
## Self-Dogfooding
|
|
34
|
+
|
|
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
|
|
43
|
+
```
|
|
44
|
+
|
|
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.
|
|
46
|
+
|
|
47
|
+
## Release Workflow
|
|
48
|
+
|
|
49
|
+
Release automation is local-first and conservative:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npm run release:check
|
|
53
|
+
npm run release:prepare -- --version X.Y.Z
|
|
54
|
+
npm run release:publish -- --version X.Y.Z
|
|
55
|
+
npm run release:full -- --version X.Y.Z
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
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).
|
|
59
|
+
|
|
27
60
|
## 2. Why SotuRail Exists
|
|
28
61
|
|
|
29
62
|
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.
|
|
@@ -51,6 +84,22 @@ SotuRail aims to unify these ideas into one local-first workflow: reversible raw
|
|
|
51
84
|
|
|
52
85
|
## 5. Installation
|
|
53
86
|
|
|
87
|
+
Use directly with npx:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
npx soturail --help
|
|
91
|
+
npx soturail@0.2.2 --help
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Install globally:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
npm install -g soturail
|
|
98
|
+
soturail --help
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
For local development from source:
|
|
102
|
+
|
|
54
103
|
```bash
|
|
55
104
|
npm install
|
|
56
105
|
npm run build
|
|
@@ -65,6 +114,8 @@ npm run build:native # optional, requires cargo
|
|
|
65
114
|
npm run build:all # TypeScript + native, requires cargo
|
|
66
115
|
```
|
|
67
116
|
|
|
117
|
+
npm package: https://www.npmjs.com/package/soturail
|
|
118
|
+
|
|
68
119
|
## Native Performance Path
|
|
69
120
|
|
|
70
121
|
TypeScript remains the public CLI, orchestration, docs and npm distribution layer. Rust handles optional hot paths where streaming, low overhead and binary execution matter:
|
|
@@ -132,6 +183,10 @@ soturail bench compare-optional --tool squeez
|
|
|
132
183
|
- 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.
|
|
133
184
|
- Native performance compares Rust and TypeScript only when `soturail-native` is built locally.
|
|
134
185
|
|
|
186
|
+
## Honest Metrics
|
|
187
|
+
|
|
188
|
+
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.
|
|
189
|
+
|
|
135
190
|
## 9. Agent Hooks
|
|
136
191
|
|
|
137
192
|
SotuRail provides cautious hook scaffolding and prompt-only fallbacks:
|
|
@@ -145,6 +200,8 @@ soturail hooks prompt-only codex
|
|
|
145
200
|
|
|
146
201
|
Host APIs vary, so SotuRail never writes guessed config without showing the target and creating backups for existing files.
|
|
147
202
|
|
|
203
|
+
Review generated hooks before enabling them. SotuRail should never auto-install unreviewed third-party skills, hooks or scripts.
|
|
204
|
+
|
|
148
205
|
## 10. Agent Response Compression
|
|
149
206
|
|
|
150
207
|
SotuRail includes Caveman-like output compression as inspiration, implemented independently with professional modes:
|
|
@@ -192,6 +249,18 @@ SotuRail reports estimated cache stability only. It never claims real provider c
|
|
|
192
249
|
|
|
193
250
|
Raw logs may contain secrets because they preserve real terminal output. Treat `.soturail/raw/` as local evidence, not public artifact material.
|
|
194
251
|
|
|
252
|
+
## Windows Notes
|
|
253
|
+
|
|
254
|
+
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.
|
|
255
|
+
|
|
256
|
+
## Road To Skill Rail
|
|
257
|
+
|
|
258
|
+
Skill Rail and Workflow Rail are planned, not implemented in v0.2.2. See [docs/skill-rail.md](docs/skill-rail.md) and [docs/workflow-rail.md](docs/workflow-rail.md) for the security-first roadmap.
|
|
259
|
+
|
|
260
|
+
## Comparison Philosophy
|
|
261
|
+
|
|
262
|
+
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.
|
|
263
|
+
|
|
195
264
|
## 14. Roadmap
|
|
196
265
|
|
|
197
266
|
See [ROADMAP.md](ROADMAP.md). v0.3.0 focuses on deeper native paths, MCP, hardened PDF extraction, semantic memory approval, Tree-sitter repo maps and optional local embeddings.
|
package/dist/cli.js
CHANGED
|
@@ -16,6 +16,7 @@ import { registerNativeCommand } from "./commands/native.js";
|
|
|
16
16
|
import { registerReadCommand } from "./commands/read.js";
|
|
17
17
|
import { registerRunCommand } from "./commands/run.js";
|
|
18
18
|
import { registerRulesCommand } from "./commands/rules.js";
|
|
19
|
+
import { registerSelfCommand } from "./commands/self.js";
|
|
19
20
|
import { registerSpecCommand } from "./commands/spec.js";
|
|
20
21
|
import { registerStatsCommand } from "./commands/stats.js";
|
|
21
22
|
export function buildProgram() {
|
|
@@ -23,7 +24,7 @@ export function buildProgram() {
|
|
|
23
24
|
program
|
|
24
25
|
.name("soturail")
|
|
25
26
|
.description("Local-first Context OS rails for AI coding agents.")
|
|
26
|
-
.version("0.2.
|
|
27
|
+
.version("0.2.2")
|
|
27
28
|
.showHelpAfterError();
|
|
28
29
|
registerInitCommand(program);
|
|
29
30
|
registerIndexCommand(program);
|
|
@@ -39,6 +40,7 @@ export function buildProgram() {
|
|
|
39
40
|
registerMemoryCommand(program);
|
|
40
41
|
registerNativeCommand(program);
|
|
41
42
|
registerRulesCommand(program);
|
|
43
|
+
registerSelfCommand(program);
|
|
42
44
|
registerDoctorCommand(program);
|
|
43
45
|
registerStatsCommand(program);
|
|
44
46
|
return program;
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,mBAAmB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AqB,CAAC,OAAO,CAAC,CAAC;IAC/B,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAC9B,mBAAmB,CAAC,OAAO,CAAC,CAAC;IAC7B,qBAAqB,CAAC,OAAO,CAAC,CAAC;IAC/B,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAE9B,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,WAAW,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACnD,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,WAAW,EAAE,CAAC;IACrE,YAAY,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;QAC/D,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,mBAAmB,OAAO,IAAI,CAAC,CAAC;QACrD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/commands/bench.d.ts
CHANGED
|
@@ -4,28 +4,39 @@ interface BenchOptions {
|
|
|
4
4
|
engine?: ReducerEngine;
|
|
5
5
|
tool?: string;
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
export type BenchmarkCategory = "terminal_compression" | "agent_response_compression" | "knowledge_structuring" | "cache_stability" | "native_engine";
|
|
8
|
+
export interface BenchResult {
|
|
9
|
+
case_id: string;
|
|
8
10
|
name: string;
|
|
9
|
-
category:
|
|
11
|
+
category: BenchmarkCategory;
|
|
10
12
|
engine: string;
|
|
11
13
|
raw_bytes: number;
|
|
12
14
|
reduced_bytes: number;
|
|
15
|
+
raw_tokens: number;
|
|
16
|
+
reduced_tokens: number;
|
|
17
|
+
reduction_percent: number | null;
|
|
13
18
|
estimated_raw_tokens: number;
|
|
14
19
|
estimated_reduced_tokens: number;
|
|
15
20
|
compression_ratio_percent: number | null;
|
|
21
|
+
runtime_ms: number;
|
|
16
22
|
wall_time_ms: number;
|
|
23
|
+
quality_passed: boolean;
|
|
24
|
+
preserved_errors_count: number;
|
|
25
|
+
preserved_paths_count: number;
|
|
26
|
+
preserved_commands_count: number;
|
|
17
27
|
preserved_error_lines_count: number;
|
|
18
28
|
preserved_file_paths_count: number;
|
|
19
29
|
raw_id: string | null;
|
|
20
30
|
raw_sha256: string;
|
|
21
31
|
reduced_sha256: string;
|
|
22
|
-
|
|
32
|
+
notes: string;
|
|
23
33
|
details: Record<string, unknown>;
|
|
24
34
|
}
|
|
25
35
|
export declare function prepareBenchmarks(root?: string): Promise<string>;
|
|
26
36
|
export declare function runBenchmarks(options?: BenchOptions, root?: string): Promise<BenchResult[]>;
|
|
27
37
|
export declare function compareEngines(root?: string): Promise<string>;
|
|
28
38
|
export declare function reportBenchmarks(root?: string): Promise<string>;
|
|
39
|
+
export declare function summarizeBenchmarkResults(results: BenchResult[]): string;
|
|
29
40
|
export declare function compareOptional(tool: string, root?: string): Promise<string>;
|
|
30
41
|
export declare function registerBenchCommand(program: Command): void;
|
|
31
42
|
export {};
|