8000 Investigate and fix packages/base tests that fail on some hosts (xxd and locale dependencies) (#57) by simon-inkie · Pull Request #62 · simon-inkie/inkie-deck · GitHub
[go: up one dir, main page]

Skip to content

Investigate and fix packages/base tests that fail on some hosts (xxd and locale dependencies) (#57) - #62

Merged
simon-inkie merged 5 commits into
mainfrom
57-host-independent-base-tests
Oct 11, 2026
Merged

simon-inkie merged 5 commits into
mainfrom
57-host-independent-base-tests

Conversation

@simon-inkie
Copy link
Copy Markdown
Owner

Requested by Simon · project thread

Fixes #57

What was wrong

Four host dependencies made packages/base tests fail on hosts that differ from CI:

  1. inbox.test.sh called xxd, which is not installed everywhere.
  2. inbox-push.test.sh built fixtures with $'\uXXXX'. Outside a UTF-8 locale bash emits ?, so ten gate cases saw garbage panes.
  3. bin/pane-idle matched spinner glyphs with a multibyte bracket class. Under LC_ALL=C that matches single bytes and misses the spinner. This is a runtime fault, not only a test one: a cron or supervisor run could type into a busy pane.
  4. create-agent.test.ts put node's install directory on PATH for the "no runtime" case. Where a global claude sits beside node, the test found it.

What changed

  • xxd -p becomes od -An -v -tx1 (POSIX).
  • Fixture \uXXXX escapes become UTF-8 byte escapes.
  • pane-idle spinner class becomes a literal alternation.
  • The test PATH exposes node through a node-only symlink directory.
  • packages/base/README.md no longer lists xxd as a prerequisite. No tool is newly required, so INSTALL.md is unchanged.
  • SPEC at .specs/57-host-independent-base-tests/SPEC.md.

No test was weakened, skipped or deleted.

How verified

cd packages/base && env -i HOME=$HOME PATH=$PATH LC_ALL=C npx vitest run, on a host with no xxd and a claude beside node:

failed passed
before 4 42
after 0 46

The four before: create-agent no-runtime, shell-suites inbox.test.sh, inbox-push.test.sh (10 inner cases), pane-idle.test.sh (1 inner case). Also run on the committed tree: pnpm typecheck, pnpm test (110 files, 2227 passed, 11 skipped), check:boundaries, check:leaks, check:licence, check:lib-version, check:dashes.

Not verified

  • A real WSL host and the CI image. This sandbox stands in for a stripped host.
  • check:leaks:messages reports findings, which come from existing history; this commit carries no session link.
  • rig/ still installs and checks xxd; harmless, left as a follow-up.

🤖 Generated with Claude Code

https://claude.ai/code/session_017yJZi4v5U7ruTtPSDy5ki3


Generated by Claude Code

Drop xxd for od, use UTF-8 byte escapes in fixtures, match spinner glyphs
byte-wise in pane-idle, and keep node's bin dir off the no-runtime PATH.

Signed-off-by: Claude <noreply@anthropic.com>
@simon-inkie simon-inkie self-assigned this Oct 11, 2026
Signed-off-by: Claude <noreply@anthropic.com>
@simon-inkie
Copy link
Copy Markdown
Owner Author

Review: merge after fixes

  • Major packages/base/bin/pane-idle, pane_ctx_pct (around line 343): the change replaces grep -E with grep -P. BSD grep on macOS has no -P, so on a Mac the command errors, the function returns nothing, and the high-context guard that depends on it silently stops working. Linux-only tests cannot catch this. Please express the match with grep -E (or awk/sed) so it stays portable, and add a test that fails if -P is reintroduced.

The xxd to od change, the explicit byte escapes and the PATH isolation in the tests are good: they remove host dependencies without weakening any assertion. No private material.

Signed-off-by: Claude <noreply@anthropic.com>
Signed-off-by: Claude <noreply@anthropic.com>
@simon-inkie
Copy link
Copy Markdown
Owner Author

Re-review of 2e1e27a and a9b6a13: fixed, good to merge. grep -P is gone from pane-idle (awk for the context percentage, grep -qE for the spinner), and the static guard fails if a PCRE grep comes back. Nit, not blocking: the SPEC line edited in a9b6a13 now ends in a double colon. Checks green.

Signed-off-by: Claude <noreply@anthropic.com>
@simon-inkie
Copy link
Copy Markdown
Owner Author

Merge note: this PR and #63 conflict (both edit pane-idle, create-agent.test.ts, inbox-push.test.sh, inbox.test.sh, pane-idle.test.sh). Plan is to merge this one first, then #63 rebases onto main.

@simon-inkie
simon-inkie merged commit f2ad08d into main Oct 11, 2026
4 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.

Investigate and fix packages/base tests that fail on some hosts (xxd and locale dependencies)

2 participants

0