Skip to content

test(id): prove source-only startup refuses without a compiler (#796 9-7) - #12524

Merged
dezren39 merged 1 commit into
mainfrom
felix/796-source-only-guard
Nov 22, 2026
Merged

dezren39 merged 1 commit into
mainfrom
felix/796-source-only-guard

Conversation

@dezren39

@dezren39 dezren39 commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Problem

#796 inventory item 9-7 — "source-only requires a configured compiler" — was the one explicitly unproven item left in the phase-9/10 verification debt. The guard exists in cmd_serve (crates/id-cli/src/commands/serve.rs: ensure!(!world_source_only || compiler.is_some(), …)), but nothing substantiated it: the existing source-only tests are parse-level (cli/tests.rs) and raw-module policy tests, and the issue's own note warns a pure-helper unit test would not substantiate whole-startup acceptance — the guard sits deep in cmd_serve, after the store and endpoint open.

Change (test-only, +103 lines in pkgs/id/tests/cli_integration.rs)

Two whole-startup tests in serve_tests, both running the real binary through the real serve path in a hermetic temp dir (--ephemeral --no-relay --no-gossip --no-mdns):

  • test_serve_source_only_without_compiler_is_refused_at_startup — the 9-7 oracle. ID_ROC_PLATFORM/ID_ROC_BIN are stripped and the working directory holds no conventional examples/roc-world, so compiler resolution finds nothing. Asserts startup exits non-zero and stderr names the guard: --world-source-only requires a configured Roc compiler and platform.
  • test_serve_source_only_with_compiler_configured_starts — the control. A minimal fabricated platform directory (platform.roc + targets/wasm32/host.wasm, all Compiler::new asks for) is passed via --roc-platform; the same startup comes up and reports its node id, with the guard message absent. The pair pins the refusal on the missing compiler, not on source-only mode itself.

No production code changed; the guard was not buggy.

Test evidence (sandbox venue; see caveat)

  • Pass-after: cargo test --test cli_integration test_serve_source_only → 2 passed, 0 failed (11.60s of test time). Manual probes of the built binary agree: refusal exits 1 in ~1.1s with the guard message on stderr; the configured control prints node: <id> and serves.
  • Fail-before: scratch worktree at the same commit with the guard's condition neutralized to true → the refusal test FAILED (120.13s): the unguarded server started and kept serving until the test's deadline killed it, and the assertion tripped on the absent guard message. Scratch removed afterwards; no git stash used.
  • rustfmt --check clean on the touched file.
  • Caveat: the full 138-test cli_integration target was not run to completion locally — the sandbox's debug-link thrash (concurrent ~1 GB links across lanes, plus two VM reboots mid-run) made the full target impractical in this seat; all 138 tests in the target compiled as part of the targeted run. Per the repo's CI-first policy, the full target is exercised by CI on main.

Refs #796 (item 9-7). Item 9-6 remains open on #796 and is not touched here.


Prove it works
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…9-7)

Whole-startup proving test for inventory item 9-7: the real binary
running the real serve path exits nonzero naming the missing Roc
compiler when --world-source-only has no compiler configured, and a
control with a minimal configured platform starts. The guard sits
deep in cmd_serve (after store and endpoint open), so only a startup
run substantiates it — parse-level and helper-level checks cannot.
@coderabbitai

coderabbitai Bot commented Nov 22, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 45 minutes.

Check out review usage here.

View limit details

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

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4a977235-303e-4e64-a1f9-6e47f703f8ea
Commits

Reviewing files that changed from the base of the PR and between 164556e and 8443dd6.

Files selected for processing: 1

  • pkgs/id/tests/cli_integration.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-22T12:16:04.800942Z 8443dd6 PR opened
ℹ️ 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.

@dezren39
dezren39 merged commit c9fbfa0 into main Nov 22, 2026
2 checks passed
@dezren39
dezren39 deleted the felix/796-source-only-guard branch November 22, 2026 12:19
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