Skip to content

fix: the framework version is a call, so a compiled binary boots - #60

Merged
sebyx07 merged 3 commits into
mainfrom
fix/lazy-framework-version
Aug 12, 2026
Merged

fix: the framework version is a call, so a compiled binary boots#60
sebyx07 merged 3 commits into
mainfrom
fix/lazy-framework-version

Conversation

@sebyx07

@sebyx07 sebyx07 commented Aug 12, 2026

Copy link
Copy Markdown
Contributor
  • BREAKING — FRAMEWORK_VERSIONframeworkVersion(), DEFAULT_SERVER_INFOdefaultServerInfo(), CLI_VERSIONcliVersion(). Read at module scope, the version resolved before main in every process that imported the package, so x build --target binary shipped an artifact that threw ENOENT … '/$bunfs/package.json' at import. A constant holding the result is the same read, one import away — which is why all three go.
  • Resolution is manifest → ULTIMATE_FRAMEWORK_VERSION build define → throw. A missing manifest is the only absence a single-file executable makes legitimate; a manifest that exists and declares no semver is still a broken publish, still X_INVARIANT, define or no define. x build --target binary passes the define.
  • Both halves now run the artifact, which is why the gap lasted two releases. packages/core/e2e/version.e2e.test.ts compiles a real executable with the define and without; packages/cli/e2e/registry-boot.e2e.test.ts compiles the command registry, boots it, and then compiles the module-scope read too and asserts that binary dies before booting — fix and defect both executable.
  • @ultimat3/cli declares @ultimat3/schema, which error-catalog.ts has always imported and the workspace only hoisted. Known-gap prose narrowed to what is still unproven: booting is not serving, and no scaffolded app has been compiled and run from a bare VM.

Gate: bun run verify 12/17 (5 honest skips: job, eval, drift, contract-diff, budgets); reference-app gate 10/17, 7 pinned — both baselines unchanged.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Summary by CodeRabbit

  • New Features

    • Added lazy, cached version resolution for the framework, CLI, and server metadata.
    • Binary builds now receive the framework version at compile time and can boot without package metadata.
  • Breaking Changes

    • Replaced version constants with getter functions: frameworkVersion(), cliVersion(), and defaultServerInfo().
  • Bug Fixes

    • Fixed binary startup failures caused by import-time version loading.
    • Added the required schema dependency for CLI builds.
  • Documentation

    • Updated build, deployment, roadmap, and known-gap documentation to reflect successful binary startup and remaining deployment limitations.

sebyx07 and others added 2 commits August 12, 2026 09:31
- `FRAMEWORK_VERSION` → `frameworkVersion()` (BREAKING): resolved at
  module scope, the read ran before `main` in every process, so
  `x build --target binary` shipped an artifact that threw at import.
- Resolution is manifest → `ULTIMATE_FRAMEWORK_VERSION` build define →
  throw. A manifest that exists and declares no semver still throws
  `X_INVARIANT`; only a missing one falls through to the define.
- `x build --target binary` passes the define; `/$bunfs` has no manifest.
- `DEFAULT_SERVER_INFO` → `defaultServerInfo()` (BREAKING): a constant
  holding the result is the module-scope read again, one import away.
- New e2e compiles a real executable and runs it, with and without the
  define — the gap lasted two releases because nothing ran the artifact.
- Known-gap rows narrowed to what is still unproven: booting is not
  serving, and no scaffolded app has been run from a bare VM.

Co-Authored-By: Claude <noreply@anthropic.com>
- `CLI_VERSION` → `cliVersion()` (BREAKING): the same module-scope read
  `frameworkVersion()` was made lazy to fix, one file over. `index.ts`
  re-exports `registry.ts`, so importing `@ultimat3/cli` for `runRole`
  alone — a compiled `apps/web/server.ts` — died on
  `ENOENT … '/$bunfs/package.json'` before the first role started.
- `createVersionCommand` takes a resolver, so `COMMANDS` can be built at
  module scope without the read `x version` alone needs.
- New `packages/cli/e2e/registry-boot.e2e.test.ts` compiles the registry
  into an executable and runs it, and compiles the module-scope read too
  and asserts it dies before booting — fix and defect both executable.
- `@ultimat3/cli` declares `@ultimat3/schema`, which `error-catalog.ts`
  has always imported; tsconfig references it like every other dependent.

Co-Authored-By: Claude <noreply@anthropic.com>
@sebyx07 sebyx07 added the claudetm Created by Claude Task Master label Aug 12, 2026
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 46 minutes

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).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 5bf0912b-9d51-4a98-965e-bf31a6e0b3bf

📥 Commits

Reviewing files that changed from the base of the PR and between d7641a5 and c091512.

📒 Files selected for processing (10)
  • CHANGELOG.md
  • docs/idea/17-scale-ladder.md
  • packages/cli/e2e/registry-boot.e2e.test.ts
  • packages/cli/src/version-loader.test.ts
  • packages/cli/src/version-loader.ts
  • packages/core/e2e/version.e2e.test.ts
  • packages/core/src/version.test.ts
  • packages/core/src/version.ts
  • wiki/CLI-Reference.md
  • wiki/Tutorial-05-Deploy-Free.md
📝 Walkthrough

Walkthrough

The change replaces eager version constants with cached getter functions. Core version resolution now uses package manifests or a build-time define. CLI binary builds inject the define, and MCP metadata uses lazy resolution. Executable tests and documentation cover the new behavior.

Changes

Version resolution and binary boot

Layer / File(s) Summary
Core version resolution
packages/core/src/version.ts, packages/core/src/index.ts, packages/core/src/version.test.ts, packages/core/e2e/version.e2e.test.ts
frameworkVersion() lazily caches version data. resolveVersion() prefers the manifest and falls back to ULTIMATE_FRAMEWORK_VERSION. Invalid or missing sources produce UltimateError.
CLI registry and binary build wiring
packages/cli/src/cmd-build.ts, packages/cli/src/cmd-build.test.ts, packages/cli/src/registry.ts, packages/cli/src/cmd-help.ts, packages/cli/src/index.ts, packages/cli/e2e/registry-boot.e2e.test.ts, packages/cli/package.json, packages/cli/tsconfig.json
The CLI uses lazy cliVersion() loading. Binary arguments include the framework version define. Registry boot tests compare lazy and eager version loading.
Consumer API migration
packages/mcp/src/*, scripts/new-package.ts, packages/cli/src/workspace-checks.ts
MCP server metadata and generated package manifests call the new version providers. Removed version constants are no longer referenced.
Documented binary behavior
README.md, CHANGELOG.md, CLAUDE.md, docs/idea/*, wiki/*
Documentation records successful binary startup, the required build define, invariant failures without the define, and the remaining VM-serving limitation.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Mergeability Score: 🟡 Moderate · up to d7641

Compiled CLI binaries may still fail when users run --version because the CLI version lookup lacks the build-time fallback, causing an invariant error instead of returning the version. This bounded default-command correctness issue should be fixed or explicitly accepted before merging.

Sequence Diagram(s)

sequenceDiagram
  participant x_build
  participant binaryArgs
  participant Bun
  participant frameworkVersion
  x_build->>binaryArgs: Create binary build arguments
  binaryArgs->>frameworkVersion: Resolve framework version
  frameworkVersion-->>binaryArgs: Return cached version
  binaryArgs->>Bun: Compile with ULTIMATE_FRAMEWORK_VERSION
Loading

Possibly related PRs

  • developerz-ai/ultimate#23: Both changes update framework version resolution and its CLI and MCP consumers. This change replaces eager constants with lazy getters and build-time fallback.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 78.57% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the lazy framework version change and its primary outcome: compiled binaries boot successfully.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/lazy-framework-version

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

@coderabbitai coderabbitai 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.

Actionable comments posted: 6

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/idea/17-scale-ladder.md`:
- Line 49: Update the target summary in the scale-ladder documentation to
describe static as emitting deployable files for a CDN or object store, not as a
process that starts. Keep the existing binary and bare-VM claims unchanged, and
distinguish static artifact generation from executable startup.

In `@packages/cli/e2e/registry-boot.e2e.test.ts`:
- Around line 48-63: Update the compiled-binary CLI loader and its binaryArgs()
version defines so cliVersion() receives the same fallback define used by
frameworkVersion(). Ensure the createVersionCommand(cliVersion) path returns the
defined CLI version instead of reading the unavailable manifest, without
changing cmd-help.ts.

In `@packages/core/e2e/version.e2e.test.ts`:
- Around line 37-49: Update both compileAndRun helpers in
packages/core/e2e/version.e2e.test.ts lines 37-49 and
packages/cli/e2e/registry-boot.e2e.test.ts lines 30-35 to drain build.stderr
alongside build.exited, then pass the captured diagnostic as the assertion
message while checking the exit code is zero. Alternatively, extract a shared
helper, but ensure both sites receive the same stderr-aware assertion behavior.

In `@packages/core/src/version.test.ts`:
- Around line 33-34: Update the caching test around frameworkVersion() to spy on
the filesystem read via the fs module binding, call frameworkVersion() twice,
and assert the underlying read occurs only once. Ensure version.ts performs the
read through the observable fs binding so the spy can detect repeated reads,
while preserving the existing cached string behavior.

In `@packages/core/src/version.ts`:
- Around line 61-65: Update the UltimateError construction in the version
validation path so the explanatory text is included in cause, while fix contains
only the runnable command “x build --target binary”. Preserve the existing
command text so the version-related e2e and unit assertions continue to pass.

In `@wiki/Tutorial-05-Deploy-Free.md`:
- Line 153: Update the deployment tutorial text around the x build command to
avoid hardcoding framework version 1.2.0; state that x build injects the
installed framework version via ULTIMATE_FRAMEWORK_VERSION, or use a version
placeholder consistent with the create-ultimate@1.1.0 context.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 35715e89-13a7-4864-98db-f8177a1cb95d

📥 Commits

Reviewing files that changed from the base of the PR and between 61bac48 and d7641a5.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock, !**/bun.lock
📒 Files selected for processing (29)
  • CHANGELOG.md
  • CLAUDE.md
  • README.md
  • docs/idea/12-build-deploy.md
  • docs/idea/14-roadmap.md
  • docs/idea/17-scale-ladder.md
  • packages/cli/e2e/registry-boot.e2e.test.ts
  • packages/cli/package.json
  • packages/cli/src/cmd-build.test.ts
  • packages/cli/src/cmd-build.ts
  • packages/cli/src/cmd-help.ts
  • packages/cli/src/index.ts
  • packages/cli/src/registry.ts
  • packages/cli/src/version-loader.test.ts
  • packages/cli/src/workspace-checks.ts
  • packages/cli/tsconfig.json
  • packages/core/e2e/version.e2e.test.ts
  • packages/core/src/index.ts
  • packages/core/src/version.test.ts
  • packages/core/src/version.ts
  • packages/mcp/src/dev-host.ts
  • packages/mcp/src/index.ts
  • packages/mcp/src/server.ts
  • packages/mcp/src/wire.ts
  • scripts/new-package.ts
  • wiki/CLI-Reference.md
  • wiki/Deployment.md
  • wiki/Known-Gaps.md
  • wiki/Tutorial-05-Deploy-Free.md

Comment thread docs/idea/17-scale-ladder.md Outdated
Comment thread packages/cli/e2e/registry-boot.e2e.test.ts Outdated
Comment thread packages/core/e2e/version.e2e.test.ts Outdated
Comment thread packages/core/src/version.test.ts Outdated
Comment thread packages/core/src/version.ts
Comment thread wiki/Tutorial-05-Deploy-Free.md Outdated
- version-loader.ts goes through resolveVersion with the same
  ULTIMATE_FRAMEWORK_VERSION define x build already passes, so
  `x --version` inside a compiled binary answers instead of
  throwing X_INVARIANT for a version the build knew
- version.ts: fix: is a runnable command only; the prose moved
  into cause (axiom 4)
- version.test.ts: the caching test watches the read that does
  not happen, not two equal strings — it can now fail
- both compileAndRun helpers drain build.stderr and pass it as
  the assertion message; a broken compile reports a diagnostic
- new e2e: the registry compiled WITH the define reports it
- docs: static emits files, it does not start; the tutorial no
  longer hardcodes 1.2.0

Co-Authored-By: Claude <noreply@anthropic.com>
@sebyx07
sebyx07 merged commit 467cb45 into main Aug 12, 2026
5 checks passed
@sebyx07
sebyx07 deleted the fix/lazy-framework-version branch August 12, 2026 23:29
@developerz-ai

developerz-ai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Released in v1.7.1 🎉

🤖 Posted by developerz.ai — the maintainer agent, not a human.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claudetm Created by Claude Task Master

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant