Skip to content

feat(completion): adopt politty dispatcher mode#1343

Draft
dqn wants to merge 8 commits into
mainfrom
chore/test-politty-pr-491
Draft

feat(completion): adopt politty dispatcher mode#1343
dqn wants to merge 8 commits into
mainfrom
chore/test-politty-pr-491

Conversation

@dqn
Copy link
Copy Markdown
Contributor

@dqn dqn commented Jun 6, 2026

Summary

Adopt politty dispatcher mode for SDK shell completion.

Main changes

  • Use the updated politty completion dispatcher as the default generated completion path.
  • Generate and validate a bundled zsh completion worker via politty's generate-worker helper during the SDK build.
  • Regenerate the generated completion CLI documentation.

Dispatcher behavior

  • Shell completion resolves the currently visible tailor-sdk binary at completion time.
  • This allows project-local tailor-sdk installations to provide their own completion behavior when the user's PATH points at them.
  • When tools such as mise or direnv expose a project-local tailor-sdk, completion is served by the bundled worker from that same project-local SDK package.
  • Published SDK packages include a bundled zsh worker so the first completion path can skip cache generation.

Existing users

  • Users who already load completion with eval "$(tailor-sdk completion zsh)" only need to restart or reload their shell after upgrading SDK.
  • Users who saved a generated completion file should regenerate it with the upgraded SDK so the saved script uses dispatcher mode.
  • Users who rely on mise, direnv, or another PATH manager should ensure the project-local tailor-sdk appears first on PATH in the project directory.

Verification

Item Result
Cache fallback cold path 1562.2 ms
Cache fallback warm path 29.9 ms
Bundled-worker cold path 36.1 ms
Bundled-worker warm path 20.4 ms

Notes

  • This draft uses pkg.pr temporarily until the corresponding politty release is available.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 6, 2026

🦋 Changeset detected

Latest commit: c2bb0fc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@tailor-platform/sdk Minor
@tailor-platform/create-sdk Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Jun 6, 2026

Open in StackBlitz

pnpm add https://pkg.pr.new/@tailor-platform/create-sdk@c2bb0fc
pnpm add https://pkg.pr.new/@tailor-platform/sdk@c2bb0fc

commit: c2bb0fc

@github-actions

This comment has been minimized.

@dqn dqn changed the title chore(completion): adopt politty dispatcher mode feat(completion): adopt politty dispatcher mode Jun 6, 2026
@dqn dqn removed the skip-changeset label Jun 6, 2026
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Bump the politty pkg.pr override to the PR #491 head where
generateCompletion's direct-API default returns to static, and drop the
now-redundant static-mode pin from the completion test.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 6, 2026

Code Metrics Report (packages/sdk)

main (a0d07a9) #1343 (5dda241) +/-
Coverage 66.0% 66.0% 0.0%
Code to Test Ratio 1:0.4 1:0.4 0.0
Details
  |                    | main (a0d07a9) | #1343 (5dda241) | +/-  |
  |--------------------|----------------|-----------------|------|
  | Coverage           |          66.0% |           66.0% | 0.0% |
  |   Files            |            394 |             394 |    0 |
  |   Lines            |          13517 |           13517 |    0 |
  |   Covered          |           8930 |            8930 |    0 |
  | Code to Test Ratio |          1:0.4 |           1:0.4 |  0.0 |
  |   Code             |          90255 |           90255 |    0 |
  |   Test             |          39186 |           39186 |    0 |

SDK Configure Bundle Size

main (a0d07a9) #1343 (5dda241) +/-
configure-index-size 19.37KB 19.37KB 0KB
dependency-chunks-size 34.65KB 34.65KB 0KB
total-bundle-size 54.02KB 54.02KB 0KB

Runtime Performance

main (a0d07a9) #1343 (5dda241) +/-
Generate Median 2,743ms 2,314ms -429ms
Generate Max 2,817ms 2,356ms -461ms
Apply Build Median 2,782ms 2,330ms -452ms
Apply Build Max 2,826ms 2,356ms -470ms

Type Performance (instantiations)

main (a0d07a9) #1343 (5dda241) +/-
tailordb-basic 33,963 33,963 0
tailordb-optional 3,841 3,841 0
tailordb-relation 5,921 5,921 0
tailordb-validate 2,566 2,566 0
tailordb-hooks 5,767 5,767 0
tailordb-object 12,136 12,136 0
tailordb-enum 2,462 2,462 0
resolver-basic 9,424 9,424 0
resolver-nested 26,111 26,111 0
resolver-array 18,187 18,187 0
executor-schedule 4,234 4,234 0
executor-webhook 873 873 0
executor-record 6,659 6,659 0
executor-resolver 4,369 4,369 0
executor-operation-function 868 868 0
executor-operation-gql 869 869 0
executor-operation-webhook 888 888 0
executor-operation-workflow 1,714 1,714 0

Reported by octocov

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.

2 participants