Skip to content

fix(verify-libghostty-vt-node): refuse supplied libghostty-vt, check the addon hash, stop on failed writes - #52

Merged
ThomasK33 merged 7 commits into
mainfrom
fix/verify-skill-script-hardening
Oct 30, 2026
Merged

ThomasK33 merged 7 commits into
mainfrom
fix/verify-skill-script-hardening

Conversation

@ThomasK33

@ThomasK33 ThomasK33 commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Why

The user goal is that every open issue on this repo is fixed and landed on main. Issue #27 lists three gaps in the verify-libghostty-vt-node skill scripts. Each one lets an agent get a verdict for a build or a journey other than the one it launched or submitted.

What changed

  • launch.sh builds and links only vendor/libghostty-vt. It exits 2 when LIBGHOSTTY_VT_PREFIX, LIBGHOSTTY_VT_INCLUDE_DIR, LIBGHOSTTY_VT_STATIC_LIB, or LIBGHOSTTY_VT_LIB is set. It also takes no RUN_ROOT argument now: it always makes a new one with mktemp under TMPDIR, and it refuses a TMPDIR that another account can change.
  • doctor.sh hashes the addon that node-gyp-build picks. It fails when the hash differs from addonSha256 in instance.json.
  • drive.sh exits 2 before node runs when it cannot write the journey file, its evidence copy, or command.txt.

Scope

Tradeoffs

  • Supplied libghostty-vt artifacts: no workflow in SKILL.md or features/ uses them. Using them would mean recording a library that launch did not build and protecting an external prefix from the rebuild. Refusing them is simpler, as the issue suggests.
  • Named RUN_ROOT: it needed checks on a path that the caller picks or creates, and those checks drew new findings in each review round of chore: add the verify-libghostty-vt-node driving skill #25. Now only TMPDIR gets the ownership check, and the build already writes compiler temp files there, so the check protects the build too. TMPDIR still picks the parent directory.

Blast Radius

Only agents that run this skill see a change. An agent that passes a RUN_ROOT path or sets a supplied-library variable now gets exit 2 and a message that names the fix. The package, its tests, and CI do not use these scripts.

Verification

  • On main, each gap reproduced. doctor.sh exited 0 with a corrupted addon. drive.sh ran a stale read-only journey file instead of the submitted one and exited 0. launch.sh rebuilt libghostty-vt for a supplied INCLUDE_DIR plus STATIC_LIB, and failed with exit 1 on a read-only supplied prefix.
  • On this branch, launch.sh exits 2 for each supplied variable, a RUN_ROOT argument, a TMPDIR inside the checkout, and a TMPDIR that group or others can write (directly, through an ancestor, or through a symlink), and creates nothing. doctor.sh exits 1 for a swapped addon (a stripped copy that still loads) and for a corrupted one, and exits 0 after a restore. drive.sh exits 2 without running node for an unwritable journey file and for a failed command.txt write.
  • The skill end to end per SKILL.md on this branch, with TMPDIR under a sticky 1777 directory: launch, doctor.sh exit 0, 18 of 18 feature journeys exit 0, doctor.sh exit 0, cleanup.sh exit 0.
  • The full gate passed on the final head (exit 0 each): npm ci, npm run build:libghostty, npm run build:native, npm run build, npm run typecheck, npm test (86 of 86 after the merge of main), npm run smoke. After the merge of main, the 18 journeys include the updated info-fields check of ghosttyCommit.

Closes #27


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

…anged

doctor.sh now hashes the addon that node-gyp-build picks and fails when it differs from addonSha256 in instance.json, so a rebuilt, swapped, or corrupted addon no longer passes as the launched one.

Change-Id: Ic83ef034aa939858a9ae72cfe2ebf27bb102a001
Signed-off-by: Thomas Kosiewski <tk@coder.com>
drive.sh exits 2 before node runs when it cannot write the journey file, its evidence copy, or command.txt. Before, node could run a stale or partial journey and report its exit code as the verdict.

Change-Id: Id057e453363d5b5fbe001323f0333ce7c4f4c987
Signed-off-by: Thomas Kosiewski <tk@coder.com>
…ch.sh

launch.sh now builds and links only vendor/libghostty-vt and exits 2 when LIBGHOSTTY_VT_PREFIX, LIBGHOSTTY_VT_INCLUDE_DIR, LIBGHOSTTY_VT_STATIC_LIB, or LIBGHOSTTY_VT_LIB is set. It also takes no RUN_ROOT argument: it always makes one with mktemp under TMPDIR, which removes the custom-root ownership checks.

Refs #27

Change-Id: If7fb8dd7beeedf47b80f3846512a0e86ec3baa52
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:48:58.162564Z 0c17ba5 Manual request
🔒 Security Review ✅ Completed 2026-10-30T11:50:10.984004Z 0c17ba5 Manual request

Security findings

Advisory findings (1)

ℹ️ 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 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: d6c2d4853a

ℹ️ 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 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 Security Review

Here are some automated security review suggestions for this pull request.

Reviewed commit: d6c2d4853a

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

…can change

launch.sh makes RUN_ROOT under TMPDIR, and the compiler writes temp files there. It now exits 2 when TMPDIR or a directory above it is owned by another account (root excepted) or writable by group or others without the sticky bit, and it exports the checked physical path to the build.

Change-Id: I87777d4111860cd4da47ce3b7b049cab3c4b7c27
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

Copy link
Copy Markdown

🛡️ Codex Security Review

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

Reviewed commit: 3ff2f3b05d

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.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 3ff2f3b05d

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

… compgen

launch.sh checked the variables with compgen, which a bash built without programmable completion lacks, and '|| true' hid that failure. It now tests each variable name directly.

Change-Id: Ib6bdafdfd826ab72e46a072db98c07d6f3a4c707
Signed-off-by: Thomas Kosiewski <tk@coder.com>
…unch advice

launch.sh takes no RUN_ROOT argument, so the STALE and checkout-changed messages now say to run launch.sh again.

Change-Id: I4f2063338fc2fefbd7a979a6ee9633e07c35ad66
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

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 0c17ba5a80

ℹ️ 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: 0c17ba5a80

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.

…pt-hardening

Change-Id: I277b7984cb0ecc84219a8548211a22253e73163b
Signed-off-by: Thomas Kosiewski <tk@coder.com>
@ThomasK33
ThomasK33 merged commit 6066c22 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.

verify-libghostty-vt-node skill: three deferred script fixes from PR 25 review

1 participant