Skip to content

fix(sdk): resolve home via platform APIs - #24

Merged
samzong merged 1 commit into
mainfrom
fix/cross-platform-home
Aug 4, 2026
Merged

fix(sdk): resolve home via platform APIs#24
samzong merged 1 commit into
mainfrom
fix/cross-platform-home

Conversation

@samzong

@samzong samzong commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Resolve default home via os.homedir() in TypeScript and HOME/USERPROFILE fallback in Rust so user-scope host paths work on Windows without HOME.
  • Aligns with existing Go (os.UserHomeDir) and Python (Path.home) defaults; golden cases still inject home and stay unchanged.

Scope Check

  • Stays within the v0.1 bundled-skill installer boundary.
  • Does not add marketplace, registry, remote install, script execution, GUI, MCP server, or agent runtime behavior.
  • Updates golden cases for observable installer behavior changes.
  • Regenerates host constants after spec/hosts.json changes.

Verification

  • make check

Considered and deferred

  • testdata/cases [BOT-SCOPE]: Default-home / Windows USERPROFILE path is not covered by golden cases; fixtures inject home explicitly and adding cases is outside this commit's file set.
  • rust/src/lib.rs:1471 [BOT-NIT]: HOME/USERPROFILE env fallback is shallower than Go os.UserHomeDir (go/kitup.go:1262) and Python Path.home (python/src/kitup/hosts.py:64); Rust std has no home API and a new crate is out of scope.
  • ts/src/index.ts:419 [BOT-NIT]: os.homedir() can throw when home is unresolvable vs previous empty-string fallback; empty home previously produced wrong ~/ expansion, so throw is acceptable platform behavior.

Use os.homedir() in TypeScript and HOME/USERPROFILE fallback in Rust so
host path expansion works on Windows without relying on HOME alone.

## Considered and deferred

- testdata/cases [BOT-SCOPE]: Default-home / Windows USERPROFILE path is not covered by golden cases; fixtures inject home explicitly and adding cases is outside this commit's file set.
- rust/src/lib.rs:1471 [BOT-NIT]: HOME/USERPROFILE env fallback is shallower than Go os.UserHomeDir (go/kitup.go:1262) and Python Path.home (python/src/kitup/hosts.py:64); Rust std has no home API and a new crate is out of scope.
- ts/src/index.ts:419 [BOT-NIT]: os.homedir() can throw when home is unresolvable vs previous empty-string fallback; empty home previously produced wrong ~/ expansion, so throw is acceptable platform behavior.

Signed-off-by: samzong <samzong.lu@gmail.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7a966ec353

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread ts/src/index.ts
@samzong
samzong merged commit d2368ea into main Aug 4, 2026
22 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