Skip to content

Fix JSON login prompts, secure publication URLs, and restore shell completions - #126

Merged
timhanlon merged 5 commits into
devfrom
fix/cli-foundation-before-author-sync
Nov 9, 2026
Merged

timhanlon merged 5 commits into
devfrom
fix/cli-foundation-before-author-sync

Conversation

@timhanlon

Copy link
Copy Markdown
Collaborator

Problem and behavior

JSON login can prompt, completions can disappear behind suppressed Console output, and terminal write failures can report success. Publication discovery can also direct an authenticated upload to an arbitrary URL.

  • Constrain publication to the selected Registry origin, allowing HTTPS and supported local-development HTTP. Reject URL credentials/fragments and non-HTTP schemes; disable upload redirects.
  • Recognize explicit JSON Boolean values and negation. Login combines its parsed local flag with the global setting, keeping skit --json auth login noninteractive without consulting unrelated process arguments.
  • Propagate terminal callback failures as defects through the existing Renderer contract.
  • Use Effect Presenter for help/version capture, restore human/JSON completions with a new completion contract, and apply the existing stderr color policy to built-in prompts.

Only CLI files change. Author commands, watchers and authored installation remain on the separate author-sync branch. Existing contract IDs are unchanged.

Call graphs

Compared revisions: base e25928d888cf884d9e8602c0313e5b893bdbc208, final 9a2c62d3df062fafbdee46e5c8a5a55e484bef67. Condensed graphs omit formatting and transport error classification; writer/storage ownership is unchanged.

Before
Command.runWith -> Formatter callbacks capture help/version
                -> suppressed Console -> Renderer
helpDocument -> separate Formatter interception
publication discovery -> unchecked URL rewrite -> authenticated upload
login -> local JSON flag only -> prompt policy

After
Command.runWith -> execution-local Presenter event -> Renderer
completion action -> installed Completions generator -> Renderer
helpDocument -> execution-local structured Help capture
publication discovery -> destination validation -> upload, redirects disabled
login -> local flag + global JSON setting -> prompt policy

Effect retains argument validation, help construction and completion generation; Renderer retains envelopes, status lifecycle and exit presentation. No new service or general parser. The early output selector mirrors installed Boolean literals, verified against real Effect parsing, because synchronous literal predicates are internal. The explicit protocol check excludes blob:https://… URLs that can share an HTTPS origin.

Validation

Local evidence:

  • Core prerequisite build and CLI typecheck, contract generation and distribution build passed.
  • Initial implementation: 99 distinct focused tests across 12 files passed, covering publication destination/interruption/cleanup, JSON parsing, terminal failures/status, help and prompts.
  • Login follow-up: reproduced the failure through the actual command tree before fixing it. Seven focused tests across login/JSON/application passed afterward, including ten login cases with contradictory process argv. CLI rebuilt successfully.
  • 23 built-CLI smoke checks passed for human/JSON versions, help, four completion formats, invalid/repeated flags and injected callback failure; passive commands created no SKIT home. Two additional full-tree JSON login-help smokes passed after the follow-up.
  • Scoped lint passes with only accepted unstable-API warnings; formatting and whitespace checks pass.

Destination tests prove through a dummy HTTP client that rejected URLs receive no authenticated upload. Redirect coverage checks upload transport configuration and rejection response, not a live redirect server. Terminal failure coverage injects a callback error into the real executable, not a real OS EPIPE trial.

Full workspace/server suites were not run. Remote CI, deployment and live publication remain unverified.

@timhanlon timhanlon changed the title fix(cli): correct JSON login, publication destinations and completions Fix JSON login prompts, secure publication URLs, and restore shell completions Nov 9, 2026
@timhanlon
timhanlon merged commit 0066805 into dev Nov 9, 2026
10 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.

1 participant