soturail 0.2.1 → 0.2.3

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 (45) hide show
  1. package/README.md +81 -0
  2. package/dist/cli.js +6 -1
  3. package/dist/cli.js.map +1 -1
  4. package/dist/commands/bench.d.ts +14 -3
  5. package/dist/commands/bench.js +237 -180
  6. package/dist/commands/bench.js.map +1 -1
  7. package/dist/commands/release.d.ts +3 -0
  8. package/dist/commands/release.js +59 -0
  9. package/dist/commands/release.js.map +1 -0
  10. package/dist/commands/run.js +20 -1
  11. package/dist/commands/run.js.map +1 -1
  12. package/dist/commands/self.d.ts +2 -0
  13. package/dist/commands/self.js +49 -0
  14. package/dist/commands/self.js.map +1 -0
  15. package/dist/commands/stats.d.ts +6 -0
  16. package/dist/commands/stats.js +28 -0
  17. package/dist/commands/stats.js.map +1 -1
  18. package/dist/core/config.d.ts +1 -1
  19. package/dist/core/config.js +1 -0
  20. package/dist/core/config.js.map +1 -1
  21. package/dist/core/file-scanner.js +6 -2
  22. package/dist/core/file-scanner.js.map +1 -1
  23. package/dist/core/metrics-store.d.ts +7 -0
  24. package/dist/core/metrics-store.js.map +1 -1
  25. package/dist/core/release-preflight.d.ts +22 -0
  26. package/dist/core/release-preflight.js +199 -0
  27. package/dist/core/release-preflight.js.map +1 -0
  28. package/dist/core/self-dogfood.d.ts +56 -0
  29. package/dist/core/self-dogfood.js +323 -0
  30. package/dist/core/self-dogfood.js.map +1 -0
  31. package/dist/core/version.d.ts +1 -0
  32. package/dist/core/version.js +3 -0
  33. package/dist/core/version.js.map +1 -0
  34. package/docs/benchmarking.md +4 -2
  35. package/docs/hooks/claude.md +4 -0
  36. package/docs/hooks/codex.md +11 -0
  37. package/docs/hooks/cursor.md +11 -0
  38. package/docs/hooks/gemini.md +11 -0
  39. package/docs/hooks.md +11 -0
  40. package/docs/release-checklist.md +76 -6
  41. package/docs/release-workflow.md +84 -0
  42. package/docs/skill-rail.md +28 -0
  43. package/docs/windows.md +97 -0
  44. package/docs/workflow-rail.md +26 -0
  45. package/package.json +9 -3
@@ -5,6 +5,8 @@ SotuRail v0.2.1 includes a conservative Claude Code hook template.
5
5
  ```bash
6
6
  soturail hooks install claude --dry-run
7
7
  soturail hooks install claude
8
+ soturail hooks uninstall claude
9
+ soturail hooks prompt-only claude
8
10
  ```
9
11
 
10
12
  Generated files:
@@ -19,6 +21,8 @@ The pre-tool hook inspects incoming tool payload text when Claude Code provides
19
21
 
20
22
  The hook never routes `git push` through `soturail run`.
21
23
 
24
+ Review generated settings and scripts before relying on them. SotuRail should never auto-install unreviewed third-party skills, hooks or scripts.
25
+
22
26
  ## Limitation
23
27
 
24
28
  Claude Code hook schemas may vary by installed version. SotuRail writes a conservative documented template; if your Claude Code release expects a different schema, copy the generated command into the supported hook slot manually.
@@ -3,3 +3,14 @@
3
3
  Codex prompt-only integration uses `AGENTS.md`.
4
4
 
5
5
  SotuRail does not assume private Codex host hook APIs. The fallback rules describe when to index, read progressively, run through SotuRail and avoid `git push`.
6
+
7
+ Useful commands:
8
+
9
+ ```bash
10
+ soturail hooks install codex --dry-run
11
+ soturail hooks install codex
12
+ soturail hooks uninstall codex
13
+ soturail hooks prompt-only codex
14
+ ```
15
+
16
+ Existing `AGENTS.md` content is backed up before install. Review generated prompt rules before enabling them. SotuRail should never auto-install unreviewed third-party skills, hooks or scripts.
@@ -3,3 +3,14 @@
3
3
  Cursor prompt-only integration writes `.cursor/rules/soturail.mdc` when installed.
4
4
 
5
5
  Existing files are backed up before SotuRail adds its rules.
6
+
7
+ Useful commands:
8
+
9
+ ```bash
10
+ soturail hooks install cursor --dry-run
11
+ soturail hooks install cursor
12
+ soturail hooks uninstall cursor
13
+ soturail hooks prompt-only cursor
14
+ ```
15
+
16
+ Review generated prompt rules before enabling them. SotuRail should never auto-install unreviewed third-party skills, hooks or scripts.
@@ -3,3 +3,14 @@
3
3
  Gemini prompt-only integration uses `GEMINI.md`.
4
4
 
5
5
  The generated rules keep repository scans, progressive file reads and raw log recovery visible to Gemini CLI sessions.
6
+
7
+ Useful commands:
8
+
9
+ ```bash
10
+ soturail hooks install gemini --dry-run
11
+ soturail hooks install gemini
12
+ soturail hooks uninstall gemini
13
+ soturail hooks prompt-only gemini
14
+ ```
15
+
16
+ Existing `GEMINI.md` content is backed up before install. Review generated prompt rules before enabling them. SotuRail should never auto-install unreviewed third-party skills, hooks or scripts.
package/docs/hooks.md CHANGED
@@ -6,6 +6,8 @@ SotuRail hook support is cautious. Claude gets a conservative hook template firs
6
6
  soturail hooks list
7
7
  soturail hooks doctor
8
8
  soturail hooks install claude --dry-run
9
+ soturail hooks install claude
10
+ soturail hooks uninstall claude
9
11
  soturail hooks install all --dry-run
10
12
  soturail hooks prompt-only codex
11
13
  ```
@@ -13,3 +15,12 @@ soturail hooks prompt-only codex
13
15
  Installers create backups before modifying existing files. If a host config location is uncertain, SotuRail generates prompt-only guidance instead of guessing.
14
16
 
15
17
  Claude install writes `.claude/settings.json` and hook scripts under `.claude/hooks/`. Dry-run prints every file that would change.
18
+
19
+ Always review generated hooks before enabling them. SotuRail should never auto-install unreviewed third-party skills, hooks or scripts. Prompt-only fallback remains available for every host:
20
+
21
+ ```bash
22
+ soturail hooks prompt-only claude
23
+ soturail hooks prompt-only codex
24
+ soturail hooks prompt-only gemini
25
+ soturail hooks prompt-only cursor
26
+ ```
@@ -2,12 +2,82 @@
2
2
 
3
3
  Before publishing:
4
4
 
5
+ - [ ] Confirm `npm whoami` works for the publishing account.
6
+ - [ ] Confirm npm 2FA requirements and have the authenticator ready.
5
7
  - [ ] `npm install`
6
8
  - [ ] `npm run build`
7
9
  - [ ] `npm test`
8
- - [ ] Verify `soturail --help`
9
- - [ ] Verify `soturail init` in a clean temp repo
10
- - [ ] Confirm docs mention limitations honestly
11
- - [ ] Confirm no telemetry exists
12
- - [ ] Confirm no `git push` was run automatically
13
- - [ ] Tag release manually after review
10
+ - [ ] `npm audit --omit=dev`
11
+ - [ ] `node dist/cli.js self all`
12
+ - [ ] `npm pack --dry-run`
13
+ - [ ] `npm run release:check`
14
+ - [ ] `node dist/cli.js --version` matches `package.json`.
15
+ - [ ] Confirm docs mention limitations honestly.
16
+ - [ ] Confirm no telemetry exists.
17
+ - [ ] Confirm no `git push` is routed through `soturail run`.
18
+
19
+ ## Version Sync
20
+
21
+ Check four separate release identifiers before publishing:
22
+
23
+ - npm package version: `package.json` and `package-lock.json`.
24
+ - CLI runtime version: `node dist/cli.js --version`.
25
+ - Git tag: created only when the release process calls for it.
26
+ - GitHub release: created only after npm publish succeeds.
27
+
28
+ The package version and CLI runtime version must match. `npm run build` regenerates the CLI version source from `package.json`, and `npm run release:check` verifies the built CLI before publication.
29
+
30
+ ## Audit Distinction
31
+
32
+ `npm audit` checks all dependencies, including dev dependencies used for local tests and builds.
33
+
34
+ `npm audit --omit=dev` checks runtime/public dependency risk for published package users.
35
+
36
+ Runtime audit is clean with `npm audit --omit=dev`. Remaining audit findings, if any, are development dependency findings and should be upgraded safely without `--force`.
37
+
38
+ For v0.2.x, the full audit findings are in the Vitest/Vite development test stack when present. npm's suggested fix may be a semver-major Vitest upgrade, so do not run `npm audit fix --force` blindly.
39
+
40
+ ## npm Login And 2FA
41
+
42
+ Use browser-based npm login before publishing:
43
+
44
+ ```bash
45
+ npm login --auth-type=web
46
+ npm whoami
47
+ ```
48
+
49
+ If npm requires a one-time password during publish, provide a fresh authenticator code through `NPM_CONFIG_OTP` or `--otp`. Do not commit tokens, OTPs or npm credentials.
50
+
51
+ PowerShell example:
52
+
53
+ ```powershell
54
+ $env:NPM_CONFIG_OTP="<code>"
55
+ npm run release:publish -- --version X.Y.Z
56
+ Remove-Item Env:NPM_CONFIG_OTP
57
+ ```
58
+
59
+ After npm publish succeeds, verify:
60
+
61
+ ```bash
62
+ npm view soturail version
63
+ npx --yes soturail@X.Y.Z --version
64
+ ```
65
+
66
+ Create or update the GitHub release only after those npm checks pass.
67
+
68
+ ## Windows Paste Safety
69
+
70
+ Do not paste Markdown prose or code-fence labels directly into `cmd.exe` as commands. For example, do not paste ```` ```bat ````. Copy only the command lines themselves.
71
+
72
+ See [docs/windows.md](windows.md) for CMD and PowerShell quoting notes.
73
+
74
+ ## Automation
75
+
76
+ Use:
77
+
78
+ ```bash
79
+ npm run release:check
80
+ npm run release:prepare -- --version X.Y.Z
81
+ npm run release:publish -- --version X.Y.Z
82
+ npm run release:full -- --version X.Y.Z
83
+ ```
@@ -0,0 +1,84 @@
1
+ # Release Workflow
2
+
3
+ SotuRail releases should be repeatable and evidence-backed. The release helper lives at `scripts/release.mjs`.
4
+
5
+ ## Check
6
+
7
+ ```bash
8
+ npm run release:check
9
+ ```
10
+
11
+ Runs install, build, tests, runtime audit, self-dogfooding, pack dry-run and npm version checks. It also reports whether full audit findings are development-only.
12
+
13
+ The check also verifies:
14
+
15
+ - `package.json` and `package-lock.json` version sync;
16
+ - `node dist/cli.js --version` matches the package version;
17
+ - npm pack dry-run emits the matching tarball name;
18
+ - `CHANGELOG.md` and `RELEASE_NOTES_vX.Y.Z.md` exist for the local version;
19
+ - README install instructions and `LICENSE` exist.
20
+
21
+ ## Prepare
22
+
23
+ ```bash
24
+ npm run release:prepare -- --version X.Y.Z
25
+ ```
26
+
27
+ Prepare mode:
28
+
29
+ - validates the version argument;
30
+ - updates `package.json`, `package-lock.json` and CLI version text;
31
+ - updates `CHANGELOG.md`;
32
+ - creates `RELEASE_NOTES_vX.Y.Z.md`;
33
+ - runs validation;
34
+ - commits `chore(release): prepare vX.Y.Z`;
35
+ - pushes `main`;
36
+ - never publishes to npm.
37
+
38
+ ## Publish
39
+
40
+ ```bash
41
+ npm run release:publish -- --version X.Y.Z
42
+ ```
43
+
44
+ Publish mode refuses to publish if build, tests, release preflight or runtime audit fail, if the git tree is dirty, or if the version already exists on npm.
45
+
46
+ For browser-based npm login:
47
+
48
+ ```bash
49
+ npm login --auth-type=web
50
+ npm whoami
51
+ ```
52
+
53
+ If npm asks for 2FA during publish, use a fresh authenticator code:
54
+
55
+ ```powershell
56
+ $env:NPM_CONFIG_OTP="<code>"
57
+ npm run release:publish -- --version X.Y.Z
58
+ Remove-Item Env:NPM_CONFIG_OTP
59
+ ```
60
+
61
+ ## Full
62
+
63
+ ```bash
64
+ npm run release:full -- --version X.Y.Z
65
+ ```
66
+
67
+ Full mode runs prepare, publish and then creates or updates the GitHub release using `gh` when available. If the npm version already exists, full mode skips npm publish and only creates or updates the GitHub release.
68
+
69
+ Only create or update the GitHub release after npm publish succeeds and these checks pass:
70
+
71
+ ```bash
72
+ npm view soturail version
73
+ npx --yes soturail@X.Y.Z --version
74
+ ```
75
+
76
+ Safety rules:
77
+
78
+ - Never run `npm audit fix --force`.
79
+ - Never publish if tests fail.
80
+ - Never publish if build fails.
81
+ - Never publish if runtime audit fails.
82
+ - Never publish if the requested package version already exists on npm.
83
+ - Never create a GitHub release before npm publish succeeds.
84
+ - Never hide errors.
@@ -0,0 +1,28 @@
1
+ # Skill Rail
2
+
3
+ Skill Rail is planned for v0.3.0. It is not implemented in v0.2.x.
4
+
5
+ The goal is to turn approved SotuRail specs, rules and workflows into portable, reviewable agent skills without installing untrusted marketplace content automatically.
6
+
7
+ Planned commands:
8
+
9
+ ```bash
10
+ soturail skills init <name>
11
+ soturail skills from-spec <spec-id>
12
+ soturail skills from-rules <rules-file>
13
+ soturail skills validate <path>
14
+ soturail skills export claude|codex|gemini|cursor
15
+ ```
16
+
17
+ ## Security Requirements
18
+
19
+ - No automatic marketplace install.
20
+ - Validate `SKILL.md` before use.
21
+ - Scan for prompt injection.
22
+ - Scan for destructive shell commands.
23
+ - Scan for secret exfiltration language.
24
+ - Scan for `curl`/`wget` pipe execution.
25
+ - Warn about untrusted scripts.
26
+ - Require human approval before enabling generated skills.
27
+
28
+ Skill Rail should preserve SotuRail's local-first evidence model: generated skills must cite the spec, rule or workflow that produced them.
@@ -0,0 +1,97 @@
1
+ # Windows Notes
2
+
3
+ SotuRail supports Windows through Node.js and uses cross-platform path handling internally. The main practical differences are shell quoting and how commands are pasted.
4
+
5
+ ## Install Globally
6
+
7
+ PowerShell and CMD:
8
+
9
+ ```powershell
10
+ npm install -g soturail
11
+ soturail --help
12
+ ```
13
+
14
+ ## Run With npx
15
+
16
+ ```powershell
17
+ npx soturail --help
18
+ npx soturail init
19
+ ```
20
+
21
+ ## Test a Local Tarball
22
+
23
+ From a source checkout:
24
+
25
+ ```powershell
26
+ npm run build
27
+ npm pack --dry-run
28
+ npm pack
29
+ npm install -g .\soturail-0.2.3.tgz
30
+ soturail --version
31
+ ```
32
+
33
+ If the tarball name changes, use the exact file that `npm pack` created.
34
+
35
+ ## CMD vs PowerShell
36
+
37
+ PowerShell accepts commands like:
38
+
39
+ ```powershell
40
+ node .\dist\cli.js read ".\README.md" --query "quick start"
41
+ ```
42
+
43
+ CMD uses similar quoting, but it does not understand Markdown code-fence labels. Do not paste the literal fence label:
44
+
45
+ ```text
46
+ ```bat
47
+ ```
48
+
49
+ into CMD. CMD will try to execute it and report an error.
50
+
51
+ ## Paths With Spaces
52
+
53
+ Quote paths that contain spaces:
54
+
55
+ ```powershell
56
+ soturail read "C:\Users\rafael\Documents\My Project\README.md" --query "install"
57
+ ```
58
+
59
+ ## Avoid Accidental Command Concatenation
60
+
61
+ When copying examples, keep commands on separate lines. This is wrong:
62
+
63
+ ```text
64
+ node app.jsnpx soturail --help
65
+ ```
66
+
67
+ Run them separately:
68
+
69
+ ```powershell
70
+ node app.js
71
+ npx soturail --help
72
+ ```
73
+
74
+ ## Safety
75
+
76
+ SotuRail blocks destructive command shapes through `soturail run`, including `rm -rf`, `sudo`, `del /s`, downloaded script piping and automatic `git push`.
77
+
78
+ ## Release Checks On Windows
79
+
80
+ Before publishing from Windows, run:
81
+
82
+ ```powershell
83
+ npm run build
84
+ node .\dist\cli.js --version
85
+ npm run release:check
86
+ ```
87
+
88
+ `package.json`, `package-lock.json`, `node dist/cli.js --version`, the npm tarball name, the changelog and the release notes must all agree on the same version.
89
+
90
+ Use browser-based npm login when needed:
91
+
92
+ ```powershell
93
+ npm login --auth-type=web
94
+ npm whoami
95
+ ```
96
+
97
+ Only create the GitHub release after npm publish succeeds and `npx --yes soturail@X.Y.Z --version` prints the published version.
@@ -0,0 +1,26 @@
1
+ # Workflow Rail
2
+
3
+ Workflow Rail is planned for v0.4.0. It is not implemented in v0.2.x.
4
+
5
+ The goal is to describe repeatable engineering workflows as local, auditable artifacts that can later export into Skill Rail or an MCP server.
6
+
7
+ Planned commands:
8
+
9
+ ```bash
10
+ soturail workflow new <name>
11
+ soturail workflow from-template <name>
12
+ soturail workflow validate
13
+ soturail workflow export skill
14
+ ```
15
+
16
+ ## Security Requirements
17
+
18
+ - Keep generated workflows local-first by default.
19
+ - Validate workflow files before execution or export.
20
+ - Scan for prompt injection.
21
+ - Scan for destructive shell commands.
22
+ - Scan for secret exfiltration.
23
+ - Scan for downloaded script execution such as `curl ... | sh` and `wget ... | bash`.
24
+ - Require human approval before enabling generated workflows or exported skills.
25
+
26
+ Workflow Rail should complement, not replace, the existing SotuRail rails: `soturail run`, raw log recovery, Knowledge-to-Rules, benchmarks, cache-normalized payloads and self-dogfooding reports.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "soturail",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "Local-first context rails for AI coding agents: reversible terminal compression, progressive repo reading, SDD workflows, hooks, benchmarks, memory and cache-friendly payloads.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -16,7 +16,9 @@
16
16
  "docs"
17
17
  ],
18
18
  "scripts": {
19
- "build": "tsc -p tsconfig.json",
19
+ "sync:version": "node scripts/sync-version.mjs",
20
+ "build": "npm run sync:version && tsc -p tsconfig.json",
21
+ "prepack": "npm run build",
20
22
  "test": "vitest run",
21
23
  "typecheck": "tsc -p tsconfig.json --noEmit",
22
24
  "build:native": "cargo build --manifest-path native/soturail-native/Cargo.toml --release",
@@ -27,7 +29,11 @@
27
29
  "bench": "node dist/cli.js bench run --engine ts",
28
30
  "bench:report": "node dist/cli.js bench report",
29
31
  "bench:native": "node dist/cli.js bench run --engine native",
30
- "bench:compare": "node dist/cli.js bench compare-engines"
32
+ "bench:compare": "node dist/cli.js bench compare-engines",
33
+ "release:check": "node scripts/release.mjs check",
34
+ "release:prepare": "node scripts/release.mjs prepare",
35
+ "release:publish": "node scripts/release.mjs publish",
36
+ "release:full": "node scripts/release.mjs full"
31
37
  },
32
38
  "keywords": [
33
39
  "ai-agents",