Skip to content

Parse runnable shim specs as YAML - #3708

Merged
rsteube merged 2 commits into
carapace-sh:masterfrom
snowyukitty:fix/shim-runnable-detection
Oct 25, 2026
Merged

rsteube merged 2 commits into
carapace-sh:masterfrom
snowyukitty:fix/shim-runnable-detection

Conversation

@snowyukitty

Copy link
Copy Markdown
Contributor

Fixes #2901

Summary

  • parse shim specs as YAML instead of scanning raw lines
  • require a direct run key on the document's mapping root
  • cover scalar text, nesting, malformed YAML, non-mapping roots, and read failures

Validation

  • go test -count=1 -v ./cmd/carapace/cmd/shim
  • go generate ./cmd/...
  • go install -v -tags force_all ./cmd/carapace
  • staticcheck ./cmd/carapace/cmd/shim
  • gofmt -d -s cmd/carapace/cmd/shim/shim.go cmd/carapace/cmd/shim/shim_test.go
  • git diff --check

go test -count=1 -v ./cmd/... also ran. Its two existing invoke-completion tests fail because the sandbox's carapace resolves to ./carapace; the same failures were reproduced from an exact-base git archive control. The shim package and all other reported command packages pass.

snowyukitty and others added 2 commits August 15, 2026 17:25
The YAML-based runnable check parses every spec in full, which paid
noticeable cost on large or numerous specs at shell startup. A SIMD
substring guard skips the parse for specs that cannot contain a run
key at all, and the per-spec update loop now runs on a bounded worker
pool so bulk changes no longer block startup serially. Benchmarks on
the man-page spec corpus document the remaining scanline-vs-YAML
tradeoff for future changes.

Assisted-by: Crush:z-ai/glm-5.3-flash
@rsteube
rsteube merged commit 47642fd into carapace-sh:master Oct 25, 2026
8 checks passed
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.

shim: runnable detection

3 participants