Skip to content

fix(cli): prime build extension contracts - #3538

Merged
kojiwakayama merged 1 commit into
mainfrom
fix/build-extension-contracts
Aug 10, 2026
Merged

fix(cli): prime build extension contracts#3538
kojiwakayama merged 1 commit into
mainfrom
fix/build-extension-contracts

Conversation

@kojiwakayama

@kojiwakayama kojiwakayama commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Related to veryfront/veryfront-issue-inbox#456: "veryfront build fails for every project since 0.1.1206: build path is the only orchestrateExtensions caller that omits primeContracts". The inbox issue identifies 0.1.1206 as first bad, introduced by 59fe62c / PR #3417, with all local veryfront build runs affected.

This fixes the build-only extension orchestration path by priming the same host-owned registries that dev/serve and eval already seed:

  • LLMProviderRegistry for the built-in OpenAI, Anthropic, and Google LLM extensions.
  • EvalReportExporterRegistry for the built-in MLflow eval report extension.

The extensions were present and activated. The missing part was the build caller's host registry contract setup, not an optional install.

Root cause

cli/shared/build-extensions.ts was the only orchestrateExtensions caller that activated built-in LLM and eval extensions without primeContracts. Those extensions correctly fail closed when their required registries are neither provided by another extension nor primed by the host.

TDD

  • Red: added a regression test in cli/shared/build-extensions.test.ts that asserts setupBuildCliExtensions primes both required contracts.
  • Green: setupBuildCliExtensions now passes fresh LLMProviderRegistry and EvalReportExporterRegistry instances into orchestration.
  • Refactor: kept the change scoped to the build extension setup and its colocated test.

Verification

  • deno test --preload=src/testing/preload.ts --no-check --allow-all cli/shared/build-extensions.test.ts passed after transplant onto origin/main (6 steps).
  • Focused 30-step regression suite passed during the TDD reproduction/fix cycle.
  • git diff --check passed.
  • deno task fmt:check passed.
  • deno task lint passed.
  • deno check cli/shared/build-extensions.ts cli/shared/build-extensions.test.ts passed.
  • deno task build:npm passed during the TDD reproduction/fix cycle.
  • Fresh packed-npm consumer build passed during the TDD reproduction/fix cycle.

Summary by CodeRabbit

  • Bug Fixes

    • Improved build extension setup by ensuring required language model and evaluation reporting capabilities are available during orchestration.
  • Tests

    • Added coverage confirming both capabilities are initialized before build orchestration begins.

veryfront build activates built-in LLM and eval report extensions even when a project does not configure providers. Those extensions validate their required registries during orchestration, so the build path must prime the same contracts that other bootstraps provide.

Constraint: Built-in provider and exporter extensions validate required contract registries during build extension orchestration

Constraint: Issue veryfront/veryfront-issue-inbox#456 identifies 0.1.1206 as first bad and 59fe62c / PR #3417 as the introducing change

Rejected: Require users to install or opt into extra extensions | the failing extensions are already activated by the build path and only need core registries

Confidence: high

Scope-risk: narrow

Related: veryfront/veryfront-issue-inbox#456

Tested: git diff --check

Tested: deno test --preload=src/testing/preload.ts --no-check --allow-all cli/shared/build-extensions.test.ts

Tested: deno task fmt:check

Tested: deno task lint

Tested: deno check cli/shared/build-extensions.ts cli/shared/build-extensions.test.ts

Tested: Pre-push hook passed formatting, lint, and typecheck before unit tests

Tested: Previously verified focused 30-step suite, deno task build:npm, and packed npm consumer build during TDD reproduction

Not-tested: Full repository unit suite did not complete; pre-push deno task test:unit failed in cli/commands/styles/command.test.ts with uncaught Unable to get CWD after 3783 passed / 28090 steps
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

setupBuildCliExtensions now primes the LLM provider and evaluation report exporter registries before orchestration. Tests verify that both contracts are available.

Changes

Build extension contracts

Layer / File(s) Summary
Registry priming and validation
cli/shared/build-extensions.ts, cli/shared/build-extensions.test.ts
setupBuildCliExtensions initializes both registries through primeContracts. Tests verify that both contracts are provided.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: kwakayama

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: priming build extension contracts in the CLI.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/build-extension-contracts

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

@kojiwakayama
kojiwakayama enabled auto-merge August 10, 2026 16:04
@kojiwakayama
kojiwakayama added this pull request to the merge queue Aug 10, 2026
Merged via the queue into main with commit bb90d94 Aug 10, 2026
31 checks passed
@kojiwakayama
kojiwakayama deleted the fix/build-extension-contracts branch August 10, 2026 16:19
kwakayama added a commit that referenced this pull request Aug 10, 2026
Ships the build fixes for veryfront-issue-inbox#456. `veryfront build` has
been broken for every project since 0.1.1206, and 5 of 7 scaffold templates
could not build at all.

- #3538 prime host contracts in the build extension path
- #3541 resolve server-side esm.sh modules with a server target
- #3542 keep optional Deno imports optional
- #3540 isolate cwd-mutating unit tests

The version is embedded in hydration-runtime.generated.ts, so a bump must be
followed by `deno task generate`; the manifests check fails otherwise.

There is no earlier version to pin to: 0.1.1205 fails the same templates with
the CSSProcessor error that #3417 was fixing.
This was referenced Aug 10, 2026
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