Skip to content

fix(core): conservative shell permission fallback when tree-sitter assets cannot load - #42173

Closed
kitlangton wants to merge 1 commit into
v2from
shell-parse-fallback
Closed

kitlangton wants to merge 1 commit into
v2from
shell-parse-fallback

Conversation

@kitlangton

Copy link
Copy Markdown
Contributor

What

Keep shell execution usable when tree-sitter parser assets cannot load, such as in workerd runtimes without filesystem-backed assets. Permission analysis falls back to one conservative command resource instead of failing the scan.

How

Capture parser loading with Effect.exit. On failure, return the full command as the resource, derive the reusable save prefix from the existing token arity logic, and report no directories.

Scope

Only changes the parser-load failure path in packages/core/src/shell/parse.ts. Successful parser loading and detailed command/directory extraction are unchanged.

Testing

  • bun run test test/shell-parse.test.ts test/permission.test.ts (16 passed)
  • bun typecheck in packages/core
  • Push hook workspace typecheck (34 tasks passed)

No direct failure-path test was added because the loader is a closed module-level singleton; injecting a load failure would require production refactoring beyond this focused fallback.

@kitlangton

Copy link
Copy Markdown
Contributor Author

Superseded by #42351, which removes the Core Tree-sitter runtime and conservatively treats unsupported or uncertain shell syntax as opaque.

@kitlangton kitlangton closed this Aug 14, 2026
@kitlangton
kitlangton deleted the shell-parse-fallback branch August 14, 2026 03:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant