Skip to content

fix(scripts): report the Ghostty commit in getNativeInfo - #53

Merged
ThomasK33 merged 5 commits into
mainfrom
fix/native-info-ghostty-commit
Oct 30, 2026
Merged

ThomasK33 merged 5 commits into
mainfrom
fix/native-info-ghostty-commit

Conversation

@ThomasK33

Copy link
Copy Markdown
Member

Why

The goal is that every open issue on this repo is fixed and lands on main. Issue #45: getNativeInfo() cannot tell a consumer which Ghostty commit the addon was built from. It returns ghosttyVersion: "0.1.0-dev" and no ghosttyCommit. The build script already knows the commit, so it now passes the commit to Ghostty's build as libghostty-vt version metadata. The addon already reads that metadata into ghosttyCommit.

Closes #45

What changed

  • scripts/build-libghostty-vt.sh passes -Dlib-version-string=<lib_version>+<commit> to zig build. lib_version comes from the checked-out Ghostty build.zig. The script exits 1 before zig runs when it cannot read that value. <commit> is git rev-parse HEAD after the checkout, and ghostty-source.json records the same value.
  • getNativeInfo() now returns ghosttyCommit: "83fb95624b0439ee660c2679b43b38c8b63769cd" and ghosttyVersion: "0.1.0-dev+83fb95624b0439ee660c2679b43b38c8b63769cd". The native code does not change.
  • A test in test/load.test.ts checks ghosttyCommit against ghostty-source.json. The docs and NativeInfo TSDoc describe both fields.

Scope

  • ghosttyVersion stays libghostty-vt's own version, now with the commit as build metadata. It is not the Ghostty release (1.4.0). The docs say so, and ghosttyCommit is the field that names the Ghostty source.
  • The API shape does not change. No field is renamed or added.

Tradeoffs

  • Rejected: setting -Dlib-version-string=1.4.0+<commit>. Then libghostty-vt would report a version that is not its own, and most pins are not release tags.
  • Rejected: a compile-time define in binding.gyp read from ghostty-source.json. That needs a native change and a second source of truth. The build option keeps the commit inside the static library, which is how Ghostty's own nix/libghostty-vt.nix sets it.

Blast Radius

Every build through npm run build:libghostty, CI prebuilds included, now reports the commit. The installed .pc files also show Version: 0.1.0-dev+<commit>. Nothing here reads them. A local checkout built before this change fails the new test until you rerun npm run build:libghostty && npm run build:native. The test's failure message says so.

Verification

  • Fresh npm run build:libghostty and npm run build:native, then getNativeInfo() through src/: ghosttyCommit equals commit in vendor/libghostty-vt/ghostty-source.json. Before the change, main returned {"napiVersion":10,"ghosttyVersion":"0.1.0-dev",...} with no commit.
  • Full gate passed: npm ci, build:libghostty, build:native, build, typecheck, npm test, smoke. The new test fails when ghostty-source.json names another commit and skips without that file.
  • The script exits 1 before zig runs when Ghostty's build.zig has no lib_version line, has two, or has a value with build metadata. The info-fields journey of the verify skill passed on the packed tarball.

Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: xhigh

…metadata

Change-Id: If7f5fc46e537b53ad51e8f9e835e1eabf7e0c2a0
Signed-off-by: Thomas Kosiewski <tk@coder.com>
Change-Id: I841b1a0cb9e8045476ba4b64efc251a9520d5e37
Signed-off-by: Thomas Kosiewski <tk@coder.com>
Change-Id: Id8f3288c9d7a669f6050edcf12baf0971fc0b05a
Signed-off-by: Thomas Kosiewski <tk@coder.com>
Change-Id: I4747f017191717165409d5e9e78494dca97f095c
Signed-off-by: Thomas Kosiewski <tk@coder.com>
Change-Id: If400eb84b3afd75e42ff7ddda6599d398c1b5a07
Signed-off-by: Thomas Kosiewski <tk@coder.com>
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@ThomasK33

Copy link
Copy Markdown
Member Author

@codex security review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T11:25:32.868847Z 1063deb Manual request
🔒 Security Review ✅ Completed 2026-10-30T11:26:08.064269Z 1063deb Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 1063debd83

ℹ️ 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".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: 1063debd83

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@ThomasK33
ThomasK33 merged commit 6744ec3 into main Oct 30, 2026
5 checks passed
@ThomasK33 ThomasK33 mentioned this pull request Oct 30, 2026
ThomasK33 added a commit that referenced this pull request Oct 30, 2026
## Why
Ship the fixes merged since `v0.1.0-beta.3` to npm, so downstream projects such as agent-tty can update. The consumer-visible change is #53: `getNativeInfo()` now reports the Ghostty commit the addon was built from (`ghosttyCommit`), and `ghosttyVersion` reads `0.1.0-dev+<commit>`.

## What changed
- `package.json` and `package-lock.json` go from `0.1.0-beta.3` to `0.1.0-beta.4`. The branch name matches the version, so `publish.yml` creates `v0.1.0-beta.4` after merge.
- The `release-changelog` workflow adds the CHANGELOG entry to this branch.

## Scope
- Included since beta.3: #53 (Ghostty commit in `getNativeInfo()`), #51 (7-day `min-release-age` for this repo's own npm installs, `devEngines` npm >= 11.10), #52 (verify skill scripts, not in the npm tarball), #50 (skill sync, not in the tarball).

## Blast Radius
The merge publishes `0.1.0-beta.4` to npm under the `beta` dist-tag. `latest` stays on `0.1.0-beta.0`. The tarball's `package.json` now carries `devEngines`. npm checks it only for the project it runs in, and the #51 verifier installed a packed tarball with npm 9.9.4, 10.8.2, 10.9.8 and 11.20.0 (all exit 0). `.npmrc` is not in the tarball.

## Verification
- `prepare-release-changelog.mjs` prints `should_generate=true` and `version-changed`. `resolve-npm-publish-tag.mjs` prints `beta`.
- Local gate on this branch with Node 26.12.1: results posted as a PR comment.

---
_Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
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.

getNativeInfo() does not report the pinned Ghostty version or commit

1 participant