feat(auth): add Scalar-safe CLI authentication - #35
feat(auth): add Scalar-safe CLI authentication#35Stephanie (stephanieatdedalus) wants to merge 40 commits into
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Shengming Liang (LiangShengming)
left a comment
There was a problem hiding this comment.
blocking: the published CLI replaces Scalar’s generated runtime with a 771-line copied runtime, so the new boundary check proves only that certain paths are untouched—not that Scalar runtime updates reach the executable.
package.json:6-17 points the published binary and package entry point at src/custom; src/custom/program.ts:4 imports ./runtime.js; and src/custom/runtime.ts:1-771 is a derived copy of src/cli/runtime.ts with a relatively small patch. A future Scalar build will update src/cli/runtime.ts, but the published CLI will continue executing the copied runtime without a merge conflict or drift signal.
That is contrary to the maintenance model Scalar documents: customization belongs on scalar-next, where its three-way merge carries edits to generated files across regeneration. Scalar recommends separate helpers where possible, but copying and bypassing the complete generated runtime turns visible merge maintenance into silent divergence: https://scalar.com/products/sdk-generator/custom-code
Please keep the Dedalus-owned entry point and src/custom/auth/**, but delete the copied runtime and have the custom program use Scalar’s createProgram and runtime types from src/cli/runtime.ts. If formatError, stdin/WebSocket handling, or another missing extension requires a runtime change, make the smallest reviewed patch to the generated runtime on scalar-next—or upstream a narrow extension hook—and add a regeneration test proving the patch survives fresh Scalar output. The thin custom entry point is a sound seam; owning a second full runtime is not.
|
Published CLI That means scalar:check passes, but future Scalar runtime fixes will update a runtime the published CLI no longer uses. Proposal: |
|
Addressed in
Verification: 119 tests passing, typecheck passing, package check passing, and all PR checks green. Ready for re-review. |
Summary
Adds the complete CLI authentication integration for ENG-743, including Clerk OAuth with PKCE, secure credential persistence, session refresh and logout, authenticated generated commands, safe output and errors, and HTTP/WebSocket transport coverage.
The published CLI now uses a Dedalus-owned entry point under
src/custom. Scalar-owned SDK, runtime, command assembly, and generated entry points remain untouched. A CI boundary check prevents future custom commits from modifying those implementation files.Scalar workflow
scalar-nextsrc/customand new handwritten integration filesscalar-generatednpm run scalar:checkTest plan
npm run scalar:checknpm run typechecknpm test— 118 passingnpm run pack:checkLinear issue
Ref ENG-743