Repo hygiene: docs/CLI accuracy, ruff config, trace-mining fail-open, sdk tree-shaking#83
Merged
Conversation
The ts/ workspace has a single package (@sponsio/sdk); the second 'AST static scanner CLI' line described the same package as if it were a separate one. Merge into one accurate entry. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Remove the 'sponsio refresh' section: no such command exists; the refresh workflow is driven via 'sponsio prompt refresh' (already documented) and the described --since/--apply flags were never real. - Document 'sponsio onboard' (one-shot init+scan+doctor wire-up). - Document 'sponsio serve' (placeholder stub in this distribution). - Document the 'sponsio daemon' group (run/ping/status). - Document the 'sponsio cursor' group (install-hooks/guard). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Pin line-length, target-version, and the lint rule selection that CI's pinned ruff relies on, instead of inheriting version-dependent defaults. Codifies current behaviour (88-col, default E/F set) so the existing tree stays clean; broadening the rule set is left to a follow-up. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
sponsio/scoring/ was removed in bd9a80a (sto/scoring cleanup) but the repo map still listed it. No such package exists. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add "sideEffects": false so bundlers can drop the yaml/config-loading modules entirely for consumers that only use the deterministic engine (e.g. inline-contract usage on Cloudflare Workers). Complements the createRequire deferral landed in #78: that stops the eager createRequire(undefined) throw, this lets the Node-only yaml path be tree-shaken out of edge bundles rather than merely deferred. No top-level side effects exist in the published source, so this is safe. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
CodeAnalyzer.extract_trace_contracts imported TraceMiner unguarded, before the try/except that fails open on trace-loading errors. In builds that don't bundle the trace_mining extension (it's an optional extension point — see discovery/extractors/__init__.py, which already guards the same import), this raised ModuleNotFoundError and crashed 'sponsio scan --trace' / 'sponsio refresh' instead of degrading. Guard the import with try/except ImportError and emit a skip line, matching the established pattern at the package's other two call sites. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The CLI entry runs main() at module scope, so a blanket "sideEffects": false was inaccurate. Narrow it to ./dist/cli/** so the library exports stay tree-shakeable while the CLI keeps its side effect. Also corrects a stale E:->G: short-key comment in the YAML emitter. Co-Authored-By: Donald Della Pietra <Donald.della.pietra@gmail.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adopts the well-scoped cleanup commits from #82 (with attribution), leaving the larger changes out of scope.
packages/sdkline, stalescoring/entry); syncdocs/reference/cli.mdwith the real CLI surface (onboard/serve/daemon/cursornow documented).[tool.ruff]config so local lint matches CI.CodeAnalyzerimportedTraceMinerunguarded, crashingsponsio scan --tracewithModuleNotFoundErrorin builds without the optionaltrace_miningextension. Now fails open to "no contracts mined", matching the other call sites.@sponsio/sdksideEffects(narrowed to the CLI entry) so bundlers can tree-shake the Node-only YAML/config path out of edge bundles, complementing thecreateRequiredeferral in 0.2.0a3.Test plan
ruff check/ruff format --check(0.15.16): cleanpytest -q: 2337 passed, 2 skipped(cd ts/packages/sdk && npm run build && npm test): build OK, all suites passsponsio demo --scenario freeze --fast: BLOCKED as expected🤖 Generated with Claude Code