Skip to content

fix(capsules): report engine divergence before baseline shape - #251

Merged
johnny4young merged 1 commit into
mainfrom
fix/capsule-engine-blocker-first
Oct 14, 2026
Merged

johnny4young merged 1 commit into
mainfrom
fix/capsule-engine-blocker-first

Conversation

@johnny4young

Copy link
Copy Markdown
Owner

Summary

lingua capsule verify refuses Python, Go and web Ruby recordings because their app engine (Pyodide, Go WASM, Ruby WASM) differs from the CLI runtime. But the baseline-shape checks ran first, and a real recording from the app always carries per-line results and rich outputs. So every real Python capsule was refused as unsupported-baseline-output ("cannot supply a complete successful stdout/stderr baseline"), and the actual reason never appeared.

Found while preparing the 1.6.0 announcement: a Python capsule exported from production app.linguacode.dev 1.6.0 (print("sum =", total)) never showed the engine message.

This PR checks engine divergence first in capsuleStrictVerificationRefusal. The regression-suite export dialog uses the same function, so it now shows its existing engine message instead of the generic "incomplete" one.

  • Verdict and exit code are unchanged: inconclusive, exit 6. Only reason / detail change for these recordings.
  • Browser preview keeps its current position and exit 3; reordering it would change its exit code and is a separate decision.

Validation

  • Live, against the real production capsule (appVersion 1.6.0, python, web):
    • branch build dist/cli/lingua.cjs → error[engine-divergent-baseline], exit 6 (JSON reason: "engine-divergent-baseline");
    • published @linguacode/cli@1.6.0 → error[unsupported-baseline-output], exit 6;
    • the JavaScript example capsule still passes with exit 0.
  • New CLI test (real-shaped Python web recording with line results, and with a failed status) and new dialog test; both fail without the fix.
  • tsc --noEmit, typecheck:tests, lint, check:i18n, check:i18n:copy, changelog:check; tests/cli, tests/shared, tests/components/CapsuleList, tests/renderer: 151 files, 2421 tests passed.
  • The dialog change is covered by its component test only. It sits behind the Pro capsule browser and needs Python recordings that dev:web cannot run, and no copy changed.

- A real Python, Go or web Ruby recording carries per-line results, so capsule verify refused it as unsupported-baseline-output and never named the actual reason: its engine differs from the CLI runtime, so no baseline shape could make it comparable.
- Check engine divergence first in capsuleStrictVerificationRefusal; the regression-suite export dialog shares the function and now shows its engine message for these recordings.
- The verdict and exit code are unchanged (inconclusive, exit 6); only the reported reason changes. Browser preview keeps its position and exit 3.
- Cover a real-shaped Python web recording, with line results and with a failed status, in the CLI and dialog tests.

Changelog: none
@johnny4young
johnny4young merged commit 30775dd into main Oct 14, 2026
13 checks passed
@johnny4young
johnny4young deleted the fix/capsule-engine-blocker-first branch October 14, 2026 17:16
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