Repository navigation
fix(eve): stabilize preview builds and verification (AL-1913) #1915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
2d30e3f
fix(build): separate Eve preview artifacts from qualification
codex 5fa1739
fix(eve): enforce canonical targets and explicit full builds
codex 726a176
fix(qa): retain bounded preview smoke diagnostics safely
codex 051fa80
Merge current develop into AL-1913 preview repair
codex d76f239
fix(eve): accept validated shared-context relation identifiers
codex 17b78ce
fix(auth): diagnose preview access failures safely
codex a3cf89a
fix(auth): type preview diagnostic environment inputs explicitly
codex 1721e94
Merge branch 'develop' into fix/AL-1913-eve-preview-artifacts
cobmojo 5acfadd
Merge branch 'develop' into fix/AL-1913-eve-preview-artifacts
cursoragent File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,9 @@ | ||
| import { nextjsConfig } from "@asym/eslint-config/nextjs.mjs"; | ||
|
|
||
| export default nextjsConfig; | ||
| export default [ | ||
| ...nextjsConfig, | ||
| { | ||
| // withEve emits deployment bundles here, not authored app/runtime source. | ||
| ignores: [".eve/vercel-services/**", ".vercel/output/**"], | ||
| }, | ||
| ]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
openspec/changes/separate-eve-preview-artifacts-from-qualification/design.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # Design | ||
|
|
||
| The web build planner passes `CORE_EVE_BUILD_MODE=artifacts` to its child | ||
| commands while retaining Turbo's dependency graph. The Eve workspace build | ||
| dispatcher defaults to full compilation/prewarming and rejects unknown modes. | ||
| Explicit `build:artifacts` and `build:full` commands remain available. | ||
|
|
||
| Admin's existing `withEve` integration uses one stable `build:service` command. | ||
| That dispatcher selects artifact mode only when it executes on a hosted preview. | ||
| The SDK preserves existing generated service commands, so choosing the mode only | ||
| when generating config could carry a preview skip into a later production build. | ||
| Service execution ignores the generic web artifact variable; production and | ||
| ordinary standalone commands retain the SDK's full build. A production target | ||
| overrides a conflicting preview environment marker. | ||
|
|
||
| Turbo hashes the mode. The Eve build task does not cache provider qualification: | ||
| an artifact build or a prior successful prewarm cannot stand in for a fresh | ||
| required full build. All auth, governance, sandbox and release code is unchanged. | ||
|
|
||
| Admin's generated `.eve/vercel-services` and `.vercel/output` bundles are excluded | ||
| from authored-source linting and data-boundary scans. Regression coverage checks | ||
| the exact output paths and confirms admin app/config and Eve agent/runtime source | ||
| remain checked. Actual scanner CLI fixtures reject raw database imports in | ||
| authored admin files, neighboring `.eve`/`.vercel` files, and another app's | ||
| same-named directory; retired CRM markers in authored Eve runtime still fail. | ||
|
|
||
| Installed Eve 0.25.1 source shows that skipping prewarm still emits app and | ||
| workflow functions. Its bundled Vercel runtime refuses a missing template rather | ||
| than prewarming it on demand. An isolated SDK fixture verified generated service | ||
| output and health without credentials or network access. Actual Core validation | ||
| must additionally exercise the package dispatcher and generated service. | ||
|
|
||
| Release-Off previews are unqualified artifacts. Later full sandbox/runtime | ||
| qualification and target-bound launch evidence remain required. If governance | ||
| denies that qualification, the denial remains a blocker; this change supplies no | ||
| alternate authorization path. No API, database, migration or runtime policy | ||
| change is part of this repair. |
33 changes: 33 additions & 0 deletions
33
openspec/changes/separate-eve-preview-artifacts-from-qualification/proposal.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # Separate Eve preview artifacts from runtime qualification | ||
|
|
||
| Tracking issue: [AL-1913](https://github.com/Asymmetric-al/core/issues/1913). | ||
|
|
||
| ## Why | ||
|
|
||
| Admin preview builds traverse the Eve workspace dependency and then build the | ||
| generated `withEve` service. Both invoke sandbox prewarming, which correctly | ||
| refuses unavailable or Release-Off governance. This prevents the deployed, | ||
| Release-Off candidate required by the launch runbook from being inspected. | ||
|
|
||
| ## What changes | ||
|
|
||
| - Give generic web builds an explicit Eve artifact mode and use Eve 0.25.1's | ||
| supported `--skip-sandbox-prewarm` option for hosted preview services. | ||
| - Preserve ordinary standalone and production service builds with prewarming. | ||
| - Keep artifact mode distinct in build caching and describe its unqualified | ||
| status in the build and launch runbooks. | ||
|
|
||
| ## Scope and boundaries | ||
|
|
||
| This changes build orchestration only. It does not activate Eve, change any | ||
| governance/effect admission, authorize provisioning, supply credentials, or | ||
| qualify a preview for release. A passing preview is not sandbox or launch proof. | ||
|
|
||
| ## Capability | ||
|
|
||
| - `eve-runtime-foundation`: separate compilation from runtime qualification. | ||
|
|
||
| ## Rollback | ||
|
|
||
| Revert this focused change to restore full prewarming on web builds. The | ||
| existing fail-closed preview build failure returns; no data migration is needed. |
46 changes: 46 additions & 0 deletions
46
...e-eve-preview-artifacts-from-qualification/specs/eve-runtime-foundation/spec.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| ## ADDED Requirements | ||
|
|
||
| ### Requirement: Web Build Artifacts Are Separate From Eve Runtime Qualification | ||
|
|
||
| Generic web builds MUST compile their Eve dependency without provisioning a | ||
| sandbox. Hosted preview Eve services MUST support the same explicit artifact | ||
| mode. These outputs MUST be treated as unqualified Release-Off previews and MUST | ||
| NOT activate Eve, change effect admission, or satisfy sandbox/launch evidence. | ||
| Build caches MUST distinguish artifact mode and MUST NOT reuse a cached result | ||
| as full sandbox qualification. Ordinary standalone and production service builds | ||
| MUST retain the full SDK prewarm path and propagate its failures. | ||
| Authored-source verification MUST exclude only the SDK's exact generated service | ||
| and deployment output directories, while retaining checks on authored code and | ||
| same-named directories outside those paths. | ||
|
|
||
| #### Scenario: A Release-Off preview compiles without provisioning | ||
|
|
||
| - **GIVEN** the web preview requires Eve service output but release is off | ||
| - **WHEN** the web dependency and generated preview service are built | ||
| - **THEN** complete app/workflow artifacts are emitted without sandbox prewarm | ||
| - **AND** existing runtime governance continues to deny unauthorized effects | ||
| - **AND** a successful preview is not represented as full Eve qualification | ||
|
|
||
| #### Scenario: Full qualification remains mandatory | ||
|
|
||
| - **GIVEN** an artifact build succeeded without a qualified sandbox template | ||
| - **WHEN** a standalone full build or production service build runs | ||
| - **THEN** the normal SDK prewarm path still runs and any denial fails the build | ||
| - **AND** artifact or prior cache success cannot substitute for that qualification | ||
| - **AND** full runtime verification and target-bound launch evidence remain | ||
| required before any authorized release activation | ||
|
|
||
| #### Scenario: Generated service output is reused for another target | ||
|
|
||
| - **GIVEN** a checkout generated an Eve service during a preview build | ||
| - **WHEN** that service command executes for a production target | ||
| - **THEN** it selects full SDK qualification using the current target | ||
| - **AND** neither stale preview configuration nor an inherited web artifact | ||
| variable can skip prewarming | ||
|
|
||
| #### Scenario: Generated server bundles coexist with authored app source | ||
|
|
||
| - **GIVEN** the SDK emitted admin `.eve/vercel-services` or `.vercel/output` bundles | ||
| - **WHEN** lint and data-boundary verification run after the build | ||
| - **THEN** they exclude those generated bundles without classifying server dependencies as authored browser imports | ||
| - **AND** forbidden database imports or retired CRM references in authored source still fail verification |
13 changes: 13 additions & 0 deletions
13
openspec/changes/separate-eve-preview-artifacts-from-qualification/tasks.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| ## 1. Reproduce and specify | ||
|
|
||
| - [x] 1.1 Trace the preview failure and installed SDK build/service paths. | ||
| - [x] 1.2 Verify isolated SDK artifacts without credentials or network access. | ||
| - [x] 1.3 Add failing web-planner and preview-service regression tests. | ||
|
|
||
| ## 2. Implement and validate | ||
|
|
||
| - [x] 2.1 Add explicit artifact orchestration while retaining full qualification. | ||
| - [x] 2.2 Bind cache behavior to mode and document the qualification boundary. | ||
| - [x] 2.3 Pass focused tests, formatting, lint/typecheck and strict OpenSpec checks. | ||
| - [x] 2.4 Verify actual Core artifacts and full-build denial in isolation. | ||
| - [ ] 2.5 Complete independent review, canonical preflight and required preview CI. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| import { spawnSync } from "node:child_process"; | ||
| import { createRequire } from "node:module"; | ||
| import path from "node:path"; | ||
| import { fileURLToPath } from "node:url"; | ||
|
|
||
| const require = createRequire(import.meta.url); | ||
| const EVE_BINARY = path.join( | ||
| path.dirname(require.resolve("eve/package.json")), | ||
| "bin/eve.js", | ||
| ); | ||
| const PACKAGE_ROOT = fileURLToPath(new URL("..", import.meta.url)); | ||
|
|
||
| export function runEveBuild({ | ||
| environment = process.env, | ||
| args = [], | ||
| service = false, | ||
| spawn = spawnSync, | ||
| } = {}) { | ||
| // Generated Vercel service config can survive a later build in this checkout. | ||
| // Decide from the service's current target, never from a saved preview command | ||
| // or the artifact mode inherited from the generic web dependency build. | ||
| const hostedPreview = | ||
| environment.VERCEL === "1" && | ||
| environment.VERCEL_ENV === "preview" && | ||
| environment.VERCEL_TARGET_ENV !== "production"; | ||
|
cobmojo marked this conversation as resolved.
Resolved
|
||
| const mode = service | ||
| ? hostedPreview | ||
| ? "artifacts" | ||
| : "full" | ||
| : (environment.CORE_EVE_BUILD_MODE ?? "full"); | ||
|
cobmojo marked this conversation as resolved.
Resolved
cobmojo marked this conversation as resolved.
Resolved
|
||
| if (mode !== "full" && mode !== "artifacts") { | ||
| throw new Error("CORE_EVE_BUILD_MODE must be full or artifacts."); | ||
| } | ||
|
|
||
| const buildArgs = [EVE_BINARY, "build"]; | ||
| if (mode === "artifacts") { | ||
| console.log("Eve artifact build: sandbox qualification is still required."); | ||
| buildArgs.push("--skip-sandbox-prewarm"); | ||
| } | ||
| buildArgs.push(...args); | ||
|
coderabbitai[bot] marked this conversation as resolved.
Resolved
|
||
|
|
||
| const result = spawn(process.execPath, buildArgs, { | ||
| cwd: PACKAGE_ROOT, | ||
| env: environment, | ||
| shell: false, | ||
| stdio: "inherit", | ||
| }); | ||
| if (result.error) throw result.error; | ||
| return result.status ?? 1; | ||
| } | ||
|
|
||
| if ( | ||
| process.argv[1] && | ||
| path.resolve(process.argv[1]) === fileURLToPath(import.meta.url) | ||
| ) { | ||
| try { | ||
| const args = process.argv.slice(2); | ||
| const service = args[0] === "--service"; | ||
| if (service) args.shift(); | ||
| process.exitCode = runEveBuild({ args, service }); | ||
| } catch (error) { | ||
| console.error(error instanceof Error ? error.message : error); | ||
| process.exitCode = 1; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ | |
| "extends": ["//"], | ||
| "tasks": { | ||
| "build": { | ||
| "cache": false, | ||
| "outputs": [] | ||
| }, | ||
| "typecheck": { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.