Skip to content

build(sdk): route npm test through scripts/test.sh (split from #165) - #170

Merged
kjgbot merged 2 commits into
mainfrom
split/pr165-sdk-tooling
Sep 5, 2026
Merged

build(sdk): route npm test through scripts/test.sh (split from #165)#170
kjgbot merged 2 commits into
mainfrom
split/pr165-sdk-tooling

Conversation

@kjgbot

@kjgbot kjgbot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

The sdk half of #165, without its CI revert. Do not merge yet — one open question below.

What this is

#165 bundled two unrelated changes. Its .github/workflows/cloud-runtime-artifact.yml hunk reverted #153, #154 and #159 together: it restored ops/cargo.sh for the kernel test step, and dropped the analyzer-skip env. That wrapper redirects RUSTUP_HOME to $HOME/.relayflows-toolchain/rustup, which on a GitHub runner is empty, so the rustup shim has nothing to choose and the step dies with rustup could not choose a version of cargo to run. The wrapper exists for a cloud sandbox, which a runner is not.

This branch carries only the sdk tooling. .github/ is byte-identical to main:

$ git diff origin/main --stat -- .github/ | wc -l
0

sdk/package.json differs from main by exactly one line (the test script), so nothing else on that file is reverted despite #165 being based on an older main.

scripts/test.sh runs the same chain the inline script did, in the same order, with set -eu supplying the fail-fast the && chain gave. CI is unaffected either way — the workflow runs the expanded chain minus test:prep, not npm test.

Open question before merge

prune-test-build.mjs deletes every .map and .d.ts under sdk/dist, recursively. sdk/package.json declares:

"types": "./dist/index.d.ts"

So running npm test leaves the package's declared type entry pointing at a file that was just deleted. Nothing in the repo breaks today — the only in-repo consumers (ops/probes/**) import .js from dist, and surface does not depend on the sdk at all — so this is latent, not live. But the next TypeScript consumer of @relayflows/sdk gets a confusing failure whose cause is "someone ran the tests".

I did not change the script, because that would alter the contributed change rather than split it. Three ways forward, your call:

  1. Prune only .map and leave .d.ts alone — smallest change, keeps the declared types intact.
  2. Keep the prune and drop the types entry from package.json, if dist types are not meant to be consumed.
  3. Merge as-is and accept the latent trap.

I would take (1): the stated motivation for pruning is propagated-tree file count in a cloud sandbox, and ops/cargo.sh's own measurements put that squarely on kernel/target/debug (4900 files) rather than on sdk/dist, so deleting the type surface buys very little.

Supersedes the sdk half of #165. #165 itself should be closed once this lands — its remaining content is the CI revert, which we do not want.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FtQSAcGDta5VH9xiZFT4sR

@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 51 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Free

Run ID: 6f29e4e6-49ef-411c-af91-36858459daa8

📥 Commits

Reviewing files that changed from the base of the PR and between 733f496 and 3e7ee75.

📒 Files selected for processing (3)
  • sdk/package.json
  • sdk/scripts/prune-test-build.mjs
  • sdk/scripts/test.sh

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Essentials by visiting https://app.coderabbit.ai/settings/billing.

Comment @coderabbitai help to get the list of available commands.

kjgbot pushed a commit that referenced this pull request Sep 5, 2026
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FtQSAcGDta5VH9xiZFT4sR

Session-Id: c228933d-4f94-4d83-9a9a-daf3c83b94f1
Split out of #165, which bundled this with a wholesale revert of the CI
workflow. The workflow half restored `ops/cargo.sh` for the kernel test
step (that wrapper redirects RUSTUP_HOME to an empty dir on a runner, so
rustup cannot choose a toolchain) and dropped the analyzer-skip env, i.e.
it reverted #153, #154 and #159 together. Only the sdk tooling is carried
here; `.github/` is byte-identical to main.

scripts/test.sh runs the same chain the inline `test` script did, in the
same order, with `set -eu` for the fail-fast the `&&` chain gave. The new
behaviour is the EXIT trap, which prunes `.map` and `.d.ts` from
sdk/dist afterward.

CI is unaffected either way: the workflow runs the expanded chain minus
test:prep, not `npm test`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FtQSAcGDta5VH9xiZFT4sR

Session-Id: c228933d-4f94-4d83-9a9a-daf3c83b94f1

Session-Id: c228933d-4f94-4d83-9a9a-daf3c83b94f1
@kjgbot
kjgbot force-pushed the split/pr165-sdk-tooling branch from a2b5ce0 to 2323b47 Compare September 5, 2026 10:57
Resolves the open question I raised on this PR rather than merging past
it. `package.json` declares `"types": "./dist/index.d.ts"`, and the
script deleted every `.d.ts` under `dist` -- so `npm test` left the
package's declared type entry pointing at a file it had just removed.

Nothing breaks today: every current in-repo consumer imports `.js` --
`ops/probes/**`, `workflows/drive.yaml:394`,
`workflows/drive-cloud.yaml:247` and
`testdata/backlog-picker.flow.yaml:18` all load `sdk/dist/*.js` -- and
`surface` does not depend on the sdk. But the next TypeScript consumer
would meet a failure whose cause is "someone ran the tests", and the
space this buys is not worth that. The file count that actually drives
the sandbox problem is `kernel/target/debug` at ~4900 files, per
ops/cargo.sh's own measurements; `dist` declarations are noise beside it.

Source maps are still pruned, which is the part with no such cost.

An earlier revision of this message claimed `ops/probes/**` were the
only consumers. The history lens showed that was false; the conclusion
was unaffected, since all of them import `.js`, but the claim was not.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FtQSAcGDta5VH9xiZFT4sR

Session-Id: c228933d-4f94-4d83-9a9a-daf3c83b94f1
@kjgbot
kjgbot force-pushed the split/pr165-sdk-tooling branch from 2323b47 to 3e7ee75 Compare September 5, 2026 11:04
@kjgbot
kjgbot merged commit 9389117 into main Sep 5, 2026
4 of 5 checks passed
@kjgbot
kjgbot deleted the split/pr165-sdk-tooling branch September 5, 2026 11:17
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