Skip to content

feat: run help, usage errors, init, skills, clean and rules list/show in sqb without Python - #1166

Closed
kvlonge wants to merge 6 commits into
mainfrom
feat/python-free-commands
Closed

kvlonge wants to merge 6 commits into
mainfrom
feat/python-free-commands

Conversation

@kvlonge

@kvlonge kvlonge commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Why

Every sqb invocation except --version and warm compile replays started Python, even help, usage errors and commands that need no Python. Starting it costs about 0.1 s before any output.

Changes

  • sqb parses arguments natively and prints help, version and usage errors itself, with Python's int(), terminal width and colour rules. A --vars value or a non-text argument still goes to Python.
  • clean, a bare sqb, skills, init and rules list|show run in sqb. The decision is made before any side effect, from the arguments and cheap project facts. Python runs instead for --debug, sinks or event exporters, a project file Python would reject, custom rules, rule options, PYTHONPATH/PYTHONHOME, or when the installed package cannot be found. A failure before the command writes anything also reruns in Python with the same arguments, so Python reports it.
  • Observed native commands write the same compute log capture and skill freshness notice as Python. Ctrl+C ends sqb by SIGINT, as it ends Python; a closed stdout gives Python's status, message and capture.
  • Project scaffolding and the rule listing text are shared by both paths. The Python CLI entry point still serves every command, so its handlers stay as thin adapters.
  • Recall does not record native commands, the same policy as launcher replays. The docs say so.

Verification

  • Parity E2E over 27 argument lines (help, usage errors, version, clean, skills, init, rules): stdout, stderr, exit code and compute log files match the Python CLI byte for byte, and Python never starts. Further tests cover fallbacks to Python, Ctrl+C and stdout without a reader.
  • Rust unit tests; init, skills, rules and Recall E2E/integration suites; clippy -D warnings, fmt, fensu, ruff, ty, boundary, layering and docs-skill checks.
  • Same machine, 5 runs each, median instructions:u / wall: --help 381M/97 ms → 14.6M/11 ms; usage error 381M/96 ms → 13.8M/12 ms; rules list 566M/177 ms → 21.8M/43 ms.

@kvlonge
kvlonge enabled auto-merge (squash) October 19, 2026 21:16
@kvlonge

kvlonge commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favour of one combined PR (H2 + fensu 0.27 + SharedMergeTree on top of the merged deadlock fix) so these share a single CI run; the branch is being fixed for an interaction between H2's broken-pipe parity tests and the merged changes.

@kvlonge kvlonge closed this Oct 19, 2026
auto-merge was automatically disabled October 19, 2026 23:21

Pull request was closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant