Skip to content

0.6.0: make-it-loud round 2 + dogfood fixes (PR 1 of 2)#94

Merged
heyoub merged 16 commits into
mainfrom
feat/0.6.0-make-it-loud-round-2
Jul 2, 2026
Merged

0.6.0: make-it-loud round 2 + dogfood fixes (PR 1 of 2)#94
heyoub merged 16 commits into
mainfrom
feat/0.6.0-make-it-loud-round-2

Conversation

@heyoub

@heyoub heyoub commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

0.6.0 — "make-it-loud, round 2" · PR 1 of 2 (the Front-Door Cut follows as PR 2, before the tag/cut).

A second dogfooding pass: every fix turns a silent degradation into a loud diagnostic through the existing Diagnostics.warnOnce channel, unifies the Vite boundary-discovery seam, and adds vector WGSL uniforms so the WebGPU cast reaches GLSL parity. No engine-shape breaks; the one type widening is additive-shaped.

Findings closed (all dogfood-sourced)

  • A2 / B1 — @czap/vite: the @quantize transform resolves boundary names via the same module-graph discovery as the manifest; an unknown @quantize <name> is now a hard error (not a lightningcss "Unknown at rule"); a manifest-covered-but-empty boundary warns (manifest-boundary-empty-outputs) instead of silently serving empty CSS.
  • B3 / B4 — @czap/audit: czap audit --consumer skips the internal structure pass entirely (was ~437 info findings on a consumer app); czap audit --findings streams parseable NDJSON to stdout.
  • B5 — @czap/astro: COOP/COEP are consumer-overridable and coep is configurable (landed on main pre-branch, b5379bb2; included here for the ledger).
  • B6 — @czap/quantizer: outputChanges surfaces glsl/wgsl output tables alongside css.
  • B7 — @czap/astro: client directives (client:stream/llm/gpu/wasm/graph) boot on plain elements, not only framework islands, via a DIRECTIVE_ATTRIBUTE_REGISTRY-derived scanner; a bare data-czap-boundary warns instead of silently doing nothing. See ADR-0028.
  • B8 — @czap/compiler + @czap/astro: vector WGSL uniforms (vec2/vec3/vec4), a declaration-derived uniform-buffer layout, and a wgsl-uniform-buffer-full overflow warning. u_resolution is a real vec2<f32>; closes the GLSL/WGSL parity gap. See ADR-0029.
  • B9 — @czap/astro: driveUniformFromSignal continuous-signal tracking on the SharedArrayBuffer worker path is pinned by a non-vacuous gate.
  • Release prep + v0.1.1 ship — catch main up #2@czap/edge: EdgeTier.tierDataAttributesMap / EdgeHostResolution.htmlAttributesMap — the spreadable data-czap-* map form, built from the CAP_AXES registry.

Docs

  • CHANGELOG [0.6.0] entry + a retroactive [0.4.0] shader-SRI Breaking/migration note (B2 — a breaking change that shipped in 0.4.0 undocumented).
  • ADR-0028 (registry-derived directive scanner), ADR-0029 (declaration-derived WGSL uniform layout).

Release mechanics

  • Lockstep version bump: all 25 packages 0.5.0 → 0.6.0 + create-liteship template refs.
  • api-surface snapshot regenerated; semver gate green at 0.6.0.
  • This PR does not tag/publish. The cut waits until PR 2 of 2 (Front-Door Cut) merges.

Test plan

Local-safe suite green: build, typecheck ×3, lint, check-invariants, full Vitest 7064 passed / 7 skipped. The 7 skips are the wasm-absent-local parity tests — CI builds the wasm and runs them. build:wasm is intentionally not run locally (it's the pre-publish step); CI / the gauntlet exercises it.

🤖 Generated with Claude Code

https://claude.ai/code/session_014wkz4TzwswnSCMVWQAngSd

Summary by CodeRabbit

  • New Features

    • Client directives can now activate on plain elements more reliably, and several runtime directives are now available through a shared boot path.
    • WGSL uniforms now support scalar and vector values, improving shader state handling.
  • Bug Fixes

    • Added clearer warnings for empty boundary outputs and undeclared directive usage.
    • Improved boundary and WGSL data handling so values round-trip more consistently.
  • Documentation

    • Updated the changelog and setup docs to reflect the latest behavior and release version.

Greptile Summary

This PR ("make-it-loud round 2") delivers a second dogfooding pass: silent runtime degradations are replaced with Diagnostics.warnOnce diagnostics, the Vite boundary-discovery seam is unified, and WGSL uniforms gain vec2/vec3/vec4 scalar/vector support to close the GLSL parity gap. All 25 packages are bumped 0.5.0 → 0.6.0.

  • Directive boot refactor (B7/ADR-0028): directive-bound.ts is extracted as a dependency-free leaf so each client-directive runtime can call bootDirectiveEntry without dragging the scanner's code-split LOADERS graph into its bundle; a DIRECTIVE_ATTRIBUTE_REGISTRY-derived scanner adds plain-element implicit boot and data-czap-boundary-without-marker warnings.
  • WGSL vector uniforms (B8/ADR-0029): WGSLUniformValue = number | WGSLUniformVector propagates through the compiler, boundary payload, wgpu runtime, and worker change-tracker; parseWgslCastValue in boundary-manifest.ts handles vecNf(...) / vec<N><f32>(...) CSS-authored constructor syntax and drops malformed values loudly.
  • Vite/audit/edge diagnostics (A2/B3/B4/Release prep + v0.1.1 ship — catch main up #2): unknown @quantize boundaries throw ValidationError; consumer audit skips the 437-finding structure pass; --findings streams NDJSON to stdout; EdgeTier.tierDataAttributesMap exposes a spreadable data-czap-* attribute map.

Confidence Score: 5/5

Safe to merge. All changed paths are covered by new tests; the 7064-pass suite is green with only pre-existing wasm-absent-local skips.

Every changed subsystem has dedicated unit, integration, or property tests: directive boot idempotence, vec2/vec3/vec4 round-trip through the compiler and wgpu buffer, malformed @WGSL vector rejection, consumer audit mode, NDJSON findings output, and edge attribute map. The WGSL buffer widening (32→64 bytes) is validated by the updated overflow test. The directive-bound.ts extraction is a pure dependency restructuring with no semantic change to the bound-marker protocol. No removal of existing guards; only additive changes and loud-on-error replacements of previously-silent paths.

No files require special attention. The parseWgslCastValue regex path in packages/vite/src/boundary-manifest.ts handles the most novel parsing logic and is covered by the @WGSL parses the generic vec2(...) form integration test.

Important Files Changed

Filename Overview
packages/astro/src/runtime/directive-bound.ts New dependency-free leaf module — exports DirectiveName, DirectiveEntry, bootDirectiveEntry, markDirectiveBound, boundNames, unmarkBound. Clean split; the ADR-0028 bundle-splitting motivation is well-documented.
packages/astro/src/runtime/directive-boot.ts Scanner refactored to use the registry-derived directiveSelector, adds warnExplicitOnlyDirectiveAttributes for bare data-czap-boundary without a marker, and replaces the pre-mark pattern with the shared bootDirectiveEntry idempotence guard. Collision detection is now marker-based.
packages/astro/src/runtime/slots.ts Introduces DIRECTIVE_ATTRIBUTE_REGISTRY and DIRECTIVE_MARKER_ATTRIBUTE; derives REINIT_SELECTOR from the registry (adds data-czap-graph, which was previously missing). implicitDirectiveSelectors drives the plain-element boot selectors.
packages/compiler/src/wgsl.ts New WGSLUniformVector/WGSLUniformValue types; inferStableWGSLType promotes to the widest vecN seen across all states; compile() accepts scalar/vector value maps. Type widening is additive and fully tested.
packages/vite/src/boundary-manifest.ts Extracts collectBoundaryDefinitionsFromScan / collectBoundaryDefinitions for sharing with the Vite transform. Adds wgslCastState + parseWgslCastValue for vector uniform parsing with loud-on-malformed semantics.
packages/vite/src/transform-css.ts Adds boundaryDefinitions?: BoundaryDefinitionMap to TransformCssContext; when provided, an unknown @quantize boundary name throws ValidationError immediately instead of silently falling through to convention-based resolution.
packages/astro/src/runtime/wgpu.ts Buffer widened 32→64 bytes; WgslUniformValue replaces number throughout; apply() handles scalar-in-vector-slot via component-wrap. The u_resolution is now a typed [w, h] as const.
packages/astro/src/runtime/gpu.ts Adds gpuStarted WeakSet to guard the onDetectReady upgrade path against double-canvas from a forced boot racing an earlier deferred activation. gpuDirective clears the bound mark before bootDirectiveEntry for forced boots.
packages/edge/src/edge-tier.ts Adds tierDataAttributesMap (spreadable object form) derived from the same CAP_AXES registry loop used by tierDataAttributes; the string form now serializes from the map so the two forms stay in lock-step.
packages/audit/src/index.ts Consumer audit mode (packageRoots present) now skips runStructureAudit entirely and returns a stub skippedConsumerStructureAudit result, eliminating ~437 info findings on consumer apps.
packages/cli/src/commands/audit.ts Adds --findings NDJSON output path: receipt JSON goes to stderr, each finding as a separate JSON line to stdout; wantPretty defaults to false when --findings is active to prevent duplicate output in a TTY.
packages/cloudflare/src/middleware.ts Adds warnEmptyManifestOutputs to loudly warn when a manifest-covered boundary has no servable CSS (previously Cloudflare would silently serve an empty stylesheet).

Comments Outside Diff (8)

  1. packages/cli/src/commands/audit.ts, line 93-113 (link)

    P2 Double stderr output when --findings + TTY

    When opts.findings is true and process.stderr.isTTY is truthy (interactive terminal, no explicit --pretty=false), wantPretty resolves to true. The code then writes the full receipt JSON to stderr at line 94 (which embeds every finding as JSON), and a second time as formatted text lines at 108–113. A user running czap audit --findings in their terminal will see each finding appear twice on stderr — once buried in the receipt blob, once in the human-readable lines — with the machine-readable stdout being the only clean channel.

    Consider defaulting wantPretty to false when opts.findings is set (or guarding the line 94 receipt write behind !wantPretty) so the two output modes don't overlap.

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: packages/cli/src/commands/audit.ts
    Line: 93-113
    
    Comment:
    **Double stderr output when `--findings` + TTY**
    
    When `opts.findings` is `true` and `process.stderr.isTTY` is truthy (interactive terminal, no explicit `--pretty=false`), `wantPretty` resolves to `true`. The code then writes the full receipt JSON to stderr at line 94 (which embeds every finding as JSON), and a second time as formatted text lines at 108–113. A user running `czap audit --findings` in their terminal will see each finding appear twice on stderr — once buried in the receipt blob, once in the human-readable lines — with the machine-readable stdout being the only clean channel.
    
    Consider defaulting `wantPretty` to `false` when `opts.findings` is set (or guarding the line 94 receipt write behind `!wantPretty`) so the two output modes don't overlap.
    
    How can I resolve this? If you propose a fix, please make it concise.
  2. packages/astro/src/runtime/directive-boot.ts, line 84-93 (link)

    P2 Hardcoded directive names in warning message

    The message for directive-attribute-requires-marker hardcodes "satellite" or "worker" as the fix suggestion. This comes from the registry-derived logic correctly covering data-czap-boundary for both directives, but if a third directive ever adopts data-czap-boundary with implicitBoot: false, the message would still say "satellite or worker" while the fix might also include the new directive name. Generating the suggestion text from the registry entry — e.g. by joining the directive keys whose data-czap-boundary entry has implicitBoot: false — would keep the message self-maintaining.

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: packages/astro/src/runtime/directive-boot.ts
    Line: 84-93
    
    Comment:
    **Hardcoded directive names in warning message**
    
    The message for `directive-attribute-requires-marker` hardcodes `"satellite" or "worker"` as the fix suggestion. This comes from the registry-derived logic correctly covering `data-czap-boundary` for both directives, but if a third directive ever adopts `data-czap-boundary` with `implicitBoot: false`, the message would still say "satellite or worker" while the fix might also include the new directive name. Generating the suggestion text from the registry entry — e.g. by joining the directive keys whose `data-czap-boundary` entry has `implicitBoot: false` — would keep the message self-maintaining.
    
    How can I resolve this? If you propose a fix, please make it concise.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

  3. General comment

    P1 @quantize transform does not resolve manifest-discovered nested boundary modules

    • Bug
      • The claimed contract says @quantize transform resolves boundary names through the same discovery as the manifest. In the head run, a boundary exported from src/lib/boundaries.ts should be discovered by the project scan and compiled, but the transform hard-errors: boundary "layout" referenced in @quantize not found. This leaves valid manifest-covered boundaries unusable in CSS transforms.
    • Cause
      • packages/vite/src/transform-css.ts:298-305 treats absence from ctx.boundaryDefinitions as a hard error. The supplied boundaryDefinitions are produced by collectBoundaryDefinitions, which only collects files matching boundaries.ts / *.boundaries.ts; the transform therefore still rejects a boundary that the intended manifest/module-graph discovery contract should accept.
    • Fix
      • Make the transform's boundaryDefinitions source exactly match manifest discovery for supported boundary modules, including nested project boundary modules, or fall back to the manifest entry before throwing. Add a regression test that exports layout from a nested boundary module, verifies collectBoundaryManifest contains it, and verifies plugin.transform compiles @quantize layout to container CSS.

    T-Rex Ran code and verified through T-Rex

  4. General comment

    P1 Empty manifest-covered boundary does not emit manifest-boundary-empty-outputs warning

    • Bug
      • The claimed contract says a manifest-covered boundary with empty output emits Diagnostics.warnOnce code manifest-boundary-empty-outputs. In the head run, collectBoundaryManifest returned the expected empty entry (outputs: [], outputsByTier: {}), but the captured diagnostics array was empty.
    • Cause
      • packages/vite/src/boundary-manifest.ts:614-621 constructs empty entries with { outputs: [], outputsByTier: {} } when no states exist, but does not emit the claimed Diagnostics.warnOnce diagnostic for that condition.
    • Fix
      • When adding a manifest entry without compiled states/outputs, call Diagnostics.warnOnce with source czap/vite.boundary-manifest (or the existing source constant), code manifest-boundary-empty-outputs, and a message identifying the boundary/export and explaining that no @quantize output was generated. Ensure warn-once keys include the boundary/source so duplicate loads do not spam.

    T-Rex Ran code and verified through T-Rex

  5. General comment

    P1 czap audit --findings emits one receipt JSON object instead of finding NDJSON records

    • Bug
      • The claimed contract says czap audit --findings streams parseable NDJSON to stdout. Runtime evidence on head shows stdout contains one audit receipt JSON object with metadata and a nested findings array. This is not an NDJSON findings stream: consumers expecting one finding object per line cannot process it incrementally and must parse the whole receipt.
    • Cause
      • In packages/cli/src/commands/audit.ts, the command always builds receipt and calls emit(receipt) at line 93. The opts.findings flag only causes findings to be included in the payload earlier; it does not switch stdout emission to per-finding NDJSON records.
    • Fix
      • When opts.findings is true, write each payload.findings entry as JSON.stringify(finding) + ' ' to stdout instead of emitting the aggregate receipt, and keep any human summary on stderr.

    T-Rex Ran code and verified through T-Rex

  6. General comment

    P1 WGSL compiler emits vector uniform arrays as scalar f32 fields

    • Bug
      • Compiling states with vec2/vec3/vec4 uniform values on head produces declarations like offset: f32, normal: f32, color: f32, and u_resolution: f32. This violates the claimed contract that vector WGSL uniforms are supported and that u_resolution is emitted as a real vec2/vec2f uniform.
    • Cause
      • In packages/compiler/src/wgsl.ts, the head implementation still types WGSL state values as Record<string, number>, stores fieldValues as number[], and passes potentially array-valued entries into scalar-only inferStableWGSLType. The scalar inference at lines 100-102 treats arrays as non-integer values and returns f32, so all vector-valued fields collapse to scalar f32 in the struct declaration.
    • Fix
      • Restore/implement a WGSLUniformValue union for scalar and readonly vec2/vec3/vec4 arrays, collect WGSLUniformValue[], and update inferStableWGSLType to detect array lengths and return vec2f/vec3f/vec4f before scalar promotion. Ensure dispatch/index exports use the same scalar/vector contract.

    T-Rex Ran code and verified through T-Rex

  7. General comment

    P1 Manifest-covered empty boundary still produces no manifest-boundary-empty-outputs diagnostic

    • Bug
      • The PR claim says a manifest-covered-but-empty boundary should emit Diagnostics.warnOnce with code manifest-boundary-empty-outputs instead of silently serving empty CSS. In the head runtime scenario, the project exported a viewport boundary but had no @quantize output for it. collectBoundaryManifest returned a manifest entry with outputs: [] and outputsByTier: {}, but diagnostics was []. This is unchanged from base for this contract.
    • Cause
      • packages/vite/src/boundary-manifest.ts still constructs empty manifest entries without warning when states is absent: the manifest entry uses the fallback { outputs: [], outputsByTier: {} } path without calling Diagnostics.warnOnce for code manifest-boundary-empty-outputs.
    • Fix
      • In collectBoundaryManifest, when a boundary definition is included in the manifest but no states/outputs are produced, call Diagnostics.warnOnce with source czap/vite.boundary-manifest and code manifest-boundary-empty-outputs before returning the empty outputs entry, or otherwise ensure the Vite manifest path emits that diagnostic at the same point it detects the empty output set.

    T-Rex Ran code and verified through T-Rex

  8. General comment

    P1 Missing manifest-boundary-empty-outputs warning for empty manifest-covered boundary

    • Bug
      • On head, a boundary discovered by collectBoundaryManifest with outputs: [] is silently skipped during build asset generation. The runtime artifact shows BUILD_START warnings=[] emitted=[] even though the manifest entry is covered and has no outputs. The claimed contract says this should warn once with manifest-boundary-empty-outputs.
    • Cause
      • In packages/vite/src/plugin.ts, ensureBoundaryAssets still uses if (entry.outputs.length === 0) continue; without emitting any diagnostic before skipping the entry.
    • Fix
      • Emit a one-time warning before continuing when a manifest entry has zero outputs, including the promised manifest-boundary-empty-outputs diagnostic code/message, and ensure it is only emitted once per boundary/build as intended.

    T-Rex Ran code and verified through T-Rex

Reviews (7): Last reviewed commit: "fix(astro): warn for a bare boundary pay..." | Re-trigger Greptile

heyoub and others added 10 commits July 1, 2026 10:47
edge.htmlAttributes is a pre-serialized string with no clean Astro spread, so
consumers hand-write the root `data-czap-*` attrs and silently miss any new
CapAxis. Add the structured, spreadable form:

- `EdgeTier.tierDataAttributesMap(result)` → `Record<`data-czap-${CapAxis}`,
  string>`, built by iterating the canonical CAP_AXES registry so a new axis
  appears automatically. `tierDataAttributes` (string) is now serialized FROM
  the map, so the two forms can never drift.
- `EdgeHostResolution.htmlAttributesMap` on the host-adapter result (mirrored in
  _spine/edge.d.ts). Astro: `<html {...resolution.htmlAttributesMap}>`.

Gated: edge-tier.test.ts pins map == one key per CAP_AXES axis AND that the
string form serializes EXACTLY the map (add an axis to one without the other and
it reds).

NOTE: new public export → the api-surface semver gate requires a minor bump
(@czap/edge 0.5.0 → 0.6.0). Version bump + snapshot/docs regen intentionally
deferred to the release decision.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KxU3Y8XueHqfteVGA4KdEh
@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough
📝 Walkthrough
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the 0.6.0 release-focused dogfood fixes and matches the main changes in this PR.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ 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 feat/0.6.0-make-it-loud-round-2

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

@blacksmith-sh

This comment has been minimized.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 66080ddc51

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +111 to +112
markBound(element, name);
init(load, opts, element);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Skip already-bound directive entries

When the scanner boots an implicit plain-element attribute before Astro invokes the same custom directive entry (for example after a view-transition swap or any delayed island hydration), this entry point still initializes the runtime even though the shared data-czap-directive-bound guard is already set. The stream/LLM/worker/GPU initializers are not idempotent, so that ordering can open duplicate EventSource, worker, or shader sessions for one element; the Astro entry path should return when the element is already bound for name before calling init.

Useful? React with 👍 / 👎.

Comment thread packages/vite/src/boundary-manifest.ts Outdated
// Accept CSS-authored vector component lists (`1 2`, `1, 2`) and WGSL-style
// constructors (`vec2f(1, 2)`) without treating the constructor's `2/3/4` as a
// component. GLSL stays scalar-only above.
const componentSource = trimmed.replace(/\bvec[234][fiu]?\s*\(/gi, '(');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Parse generic WGSL constructors correctly

When an @wgsl value is authored with valid WGSL constructor syntax such as vec2<f32>(1, 2), this regex does not strip the generic type prefix, so the numeric scan also captures the 2 from vec2 and 32 from f32 and turns the value into [2, 32, 1, 2]. That makes the compiler infer a vec4f field and emit incorrect state bindings, causing shaders that expect the intended vec2<f32> uniform to fail validation or sample the wrong data.

Useful? React with 👍 / 👎.

Comment thread packages/cli/src/commands/audit.ts Outdated

@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: 5

🧹 Nitpick comments (3)
packages/astro/src/runtime/directive-boot.ts (1)

98-114: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

bootDirectiveEntry has no unmark-on-failure symmetry with scanAndBootDirectives.

markBound runs before init, but unlike the activation loop below (which unmarks on failure specifically "so a later re-scan (astro:after-swap) can retry after a transient chunk-load error"), this shared helper has no equivalent safety net. Any future directive entry whose init callback lets an error propagate (sync throw or unhandled rejection) will leave the element permanently marked bound with no retry path.

Consider wrapping init so failures unmark the element, mirroring the existing pattern:

♻️ Proposed fix
 export function bootDirectiveEntry(
   name: DirectiveName,
   load: () => Promise<unknown>,
   opts: Record<string, unknown>,
   element: HTMLElement,
   init: (load: () => Promise<unknown>, opts: Record<string, unknown>, element: HTMLElement) => void,
 ): void {
   markBound(element, name);
-  init(load, opts, element);
+  try {
+    init(load, opts, element);
+  } catch (error) {
+    unmarkBound(element, name);
+    throw error;
+  }
 }
🤖 Prompt for 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.

In `@packages/astro/src/runtime/directive-boot.ts` around lines 98 - 114,
`bootDirectiveEntry` marks the element as bound before calling `init`, but it
does not restore the unbound state if initialization fails, unlike
`scanAndBootDirectives` which unmarks on error. Update `bootDirectiveEntry` to
wrap the `init` call in failure handling so any sync throw or rejected async
initialization removes the bound mark for the given `name` on `element`,
preserving retry behavior for later scans. Keep the fix localized to the
`bootDirectiveEntry`/`markDirectiveBound` flow and mirror the existing
unmark-on-failure pattern used by the directive scanner.
tests/unit/edge/kv-cache.test.ts (1)

302-327: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider adding a negative-path test.

This test only covers valid scalar/vec2/vec3/vec4 shapes. asWGSLUniformValue in kv-cache.ts also rejects malformed vectors (wrong length, NaN, mixed types) by dropping the field — a test exercising that path would guard the validation logic against regressions.

🤖 Prompt for 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.

In `@tests/unit/edge/kv-cache.test.ts` around lines 302 - 327, Add a negative-path
unit test around the KV cache WGSL rehydrate flow to cover malformed vector
bindings, not just valid vec2/vec3/vec4 values. Use the existing test area in
kv-cache.test.ts and exercise the validation path in asWGSLUniformValue from
kv-cache.ts with cases like wrong-length arrays, NaN, or mixed-type vectors.
Assert that invalid fields are dropped/omitted after putCompiledOutputs and
getCompiledOutputs, so the rehydration behavior stays protected against
regressions.
packages/cli/src/commands/audit.ts (1)

86-100: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Receipt line duplicates the entire findings array already streamed to stdout.

When opts.findings is set, payload.findings is included in receipt (via ...payload), so JSON.stringify(receipt) written to stderr embeds the full findings array a second time, in addition to the NDJSON lines on stdout. This doubles output size for large audits and undermines the summary/stream separation the feature is meant to provide.

♻️ Proposed fix: strip findings from the stderr summary line
   if (opts.findings) {
-    process.stderr.write(JSON.stringify(receipt) + '\n');
-    for (const finding of payload.findings ?? []) {
+    const { findings: streamedFindings, ...summaryReceipt } = receipt as AuditReceipt & {
+      findings?: readonly AuditFinding[];
+    };
+    process.stderr.write(JSON.stringify(summaryReceipt) + '\n');
+    for (const finding of streamedFindings ?? []) {
       process.stdout.write(JSON.stringify(finding) + '\n');
     }
   } else {
     emit(receipt);
   }
🤖 Prompt for 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.

In `@packages/cli/src/commands/audit.ts` around lines 86 - 100, The audit summary
written in the audit command duplicates the full findings array because
`receipt` is built from `...payload` and then serialized when `opts.findings` is
enabled. Update the `audit` command flow to exclude `findings` from the stderr
`receipt` object (or otherwise strip it before `JSON.stringify(receipt)`) while
still streaming each finding individually to stdout in the `payload.findings`
loop.
🤖 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 `@CHANGELOG.md`:
- Around line 29-34: The changelog bullet in the update note misstates the
registry mapping for data-czap-boundary by describing it as a worker/GPU
payload, while the actual directive mapping is different. Update the wording in
the changelog entry that references DIRECTIVE_ATTRIBUTE_REGISTRY and the
scannable attribute behavior so data-czap-boundary is described only as
satellite/worker, and keep GPU associated with its own data-czap-shader-src
attribute.

In `@docs/api/edge/src/variables/EdgeTier.md`:
- Around line 67-99: The docs for tierDataAttributesMap currently describe a
mutable Record, but the exported API is readonly, so update the generated
markdown in EdgeTier.md to match the actual contract. In the
tierDataAttributesMap section, adjust the return type and any prose/examples
tied to mutability so they reflect Readonly<Record<string, string>> (or the
equivalent readonly mapped shape used by EdgeTier.tierDataAttributesMap),
keeping the docs consistent with the declaration.

In `@packages/astro/src/runtime/wasm.ts`:
- Around line 89-96: The wasmDirective callback is invoking runtimeLoad()
without handling its returned promise, which can lead to an unhandled rejection
if the directive load fails. Update the wasmDirective/bootDirectiveEntry
callback to explicitly handle the Promise from runtimeLoad, matching the
existing fire-and-forget pattern used for loadWasmRuntime(runtimeEl) (for
example, by discarding it intentionally and ensuring any rejection is caught).
Keep the fix localized to wasmDirective and its runtimeLoad call site.

In `@packages/vite/src/boundary-manifest.ts`:
- Around line 247-268: parseWgslCastValue and wgslVector currently accept
malformed `@wgsl` vector literals silently, which can narrow or drop authored
values without any diagnostic. Update the WGSL cast parsing path in
boundary-manifest to validate the parsed component count against the authored
vec2/vec3/vec4 constructor shape, and route any mismatch or unparseable vector
value through Diagnostics.warnOnce instead of returning a misleading
scalar/vector or undefined. Use parseWgslCastValue, wgslVector, and the existing
Diagnostics warning patterns in this file to keep malformed WGSL uniform values
from degrading silently.

In `@packages/vite/src/plugin.ts`:
- Around line 26-31: Both ensureBoundaryDefinitions() and
ensureBoundaryManifest() are independently calling scanProject(projectRoot),
which duplicates the same filesystem walk when a project uses both boundary
caches. Update the boundary caching flow in plugin.ts so the scan result from
scanProject is shared between ensureBoundaryDefinitions() and
ensureBoundaryManifest(), ideally by caching the scanned project data once and
reusing it in collectBoundaryDefinitions and collectBoundaryManifest.

---

Nitpick comments:
In `@packages/astro/src/runtime/directive-boot.ts`:
- Around line 98-114: `bootDirectiveEntry` marks the element as bound before
calling `init`, but it does not restore the unbound state if initialization
fails, unlike `scanAndBootDirectives` which unmarks on error. Update
`bootDirectiveEntry` to wrap the `init` call in failure handling so any sync
throw or rejected async initialization removes the bound mark for the given
`name` on `element`, preserving retry behavior for later scans. Keep the fix
localized to the `bootDirectiveEntry`/`markDirectiveBound` flow and mirror the
existing unmark-on-failure pattern used by the directive scanner.

In `@packages/cli/src/commands/audit.ts`:
- Around line 86-100: The audit summary written in the audit command duplicates
the full findings array because `receipt` is built from `...payload` and then
serialized when `opts.findings` is enabled. Update the `audit` command flow to
exclude `findings` from the stderr `receipt` object (or otherwise strip it
before `JSON.stringify(receipt)`) while still streaming each finding
individually to stdout in the `payload.findings` loop.

In `@tests/unit/edge/kv-cache.test.ts`:
- Around line 302-327: Add a negative-path unit test around the KV cache WGSL
rehydrate flow to cover malformed vector bindings, not just valid vec2/vec3/vec4
values. Use the existing test area in kv-cache.test.ts and exercise the
validation path in asWGSLUniformValue from kv-cache.ts with cases like
wrong-length arrays, NaN, or mixed-type vectors. Assert that invalid fields are
dropped/omitted after putCompiledOutputs and getCompiledOutputs, so the
rehydration behavior stays protected against regressions.
🪄 Autofix (Beta)

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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5eca8fbc-8048-4e26-b853-0401184f04f6

📥 Commits

Reviewing files that changed from the base of the PR and between 80f9682 and 66080dd.

📒 Files selected for processing (120)
  • ASTRO-RUNTIME-MODEL.md
  • CHANGELOG.md
  • GETTING-STARTED.md
  • docs/adr/0028-plain-element-directive-scanner.md
  • docs/adr/0029-wgsl-uniform-buffer-layout.md
  • docs/adr/README.md
  • docs/api/astro/src/functions/resolveInitialStateFallback.md
  • docs/api/astro/src/functions/satelliteAttrs.md
  • docs/api/astro/src/interfaces/SatelliteProps.md
  • docs/api/audit/src/functions/runAuditPasses.md
  • docs/api/cloudflare/src/functions/cloudflareMiddleware.md
  • docs/api/compiler/src/README.md
  • docs/api/compiler/src/interfaces/WGSLBinding.md
  • docs/api/compiler/src/interfaces/WGSLCompileResult.md
  • docs/api/compiler/src/interfaces/WGSLStruct.md
  • docs/api/compiler/src/type-aliases/CompilerDef.md
  • docs/api/compiler/src/type-aliases/WGSLStates.md
  • docs/api/compiler/src/type-aliases/WGSLUniformValue.md
  • docs/api/compiler/src/type-aliases/WGSLUniformVector.md
  • docs/api/compiler/src/variables/WGSLCompiler.md
  • docs/api/edge/src/functions/createBoundaryCache.md
  • docs/api/edge/src/functions/createEdgeHostAdapter.md
  • docs/api/edge/src/interfaces/BoundaryCache.md
  • docs/api/edge/src/interfaces/EdgeHostAdapter.md
  • docs/api/edge/src/interfaces/EdgeHostResolution.md
  • docs/api/edge/src/namespaces/EdgeHostAdapter/type-aliases/BoundaryConfig.md
  • docs/api/edge/src/namespaces/EdgeHostAdapter/type-aliases/BoundaryResolution.md
  • docs/api/edge/src/namespaces/EdgeHostAdapter/type-aliases/CacheStatus.md
  • docs/api/edge/src/namespaces/EdgeHostAdapter/type-aliases/CacheTags.md
  • docs/api/edge/src/namespaces/EdgeHostAdapter/type-aliases/CompileContext.md
  • docs/api/edge/src/namespaces/EdgeHostAdapter/type-aliases/Config.md
  • docs/api/edge/src/namespaces/EdgeHostAdapter/type-aliases/Context.md
  • docs/api/edge/src/namespaces/EdgeHostAdapter/type-aliases/Resolution.md
  • docs/api/edge/src/namespaces/EdgeTier/type-aliases/Result.md
  • docs/api/edge/src/variables/EdgeHostAdapter.md
  • docs/api/edge/src/variables/EdgeTier.md
  • docs/api/edge/src/variables/KVCache.md
  • docs/api/vite/src/functions/collectBoundaryManifest.md
  • docs/api/vite/src/functions/plugin.md
  • docs/api/vite/src/functions/serializeBoundaryOutput.md
  • docs/api/vite/src/interfaces/CollectBoundaryManifestOptions.md
  • docs/api/vite/src/interfaces/PluginConfig.md
  • package.json
  • packages/_spine/compiler.d.ts
  • packages/_spine/edge.d.ts
  • packages/_spine/package.json
  • packages/assets/package.json
  • packages/astro/package.json
  • packages/astro/src/Satellite.astro
  • packages/astro/src/Satellite.ts
  • packages/astro/src/client-directives/gpu.ts
  • packages/astro/src/client-directives/graph.ts
  • packages/astro/src/client-directives/llm.ts
  • packages/astro/src/client-directives/satellite.ts
  • packages/astro/src/client-directives/stream.ts
  • packages/astro/src/client-directives/svg.ts
  • packages/astro/src/client-directives/wasm.ts
  • packages/astro/src/client-directives/worker.ts
  • packages/astro/src/runtime/boundary.ts
  • packages/astro/src/runtime/directive-boot.ts
  • packages/astro/src/runtime/gpu.ts
  • packages/astro/src/runtime/graph-directive.ts
  • packages/astro/src/runtime/inspector-panels.ts
  • packages/astro/src/runtime/llm.ts
  • packages/astro/src/runtime/satellite.ts
  • packages/astro/src/runtime/slots.ts
  • packages/astro/src/runtime/stream.ts
  • packages/astro/src/runtime/svg.ts
  • packages/astro/src/runtime/wasm.ts
  • packages/astro/src/runtime/wgpu.ts
  • packages/astro/src/runtime/worker.ts
  • packages/audit/package.json
  • packages/audit/src/index.ts
  • packages/canonical/package.json
  • packages/cli/package.json
  • packages/cli/src/commands/audit.ts
  • packages/cloudflare/package.json
  • packages/cloudflare/src/middleware.ts
  • packages/command/package.json
  • packages/compiler/package.json
  • packages/compiler/src/dispatch.ts
  • packages/compiler/src/index.ts
  • packages/compiler/src/wgsl.ts
  • packages/core/package.json
  • packages/create-liteship/package.json
  • packages/create-liteship/templates/default/package.json
  • packages/detect/package.json
  • packages/edge/package.json
  • packages/edge/src/edge-tier.ts
  • packages/edge/src/host-adapter.ts
  • packages/edge/src/kv-cache.ts
  • packages/error/package.json
  • packages/gauntlet/package.json
  • packages/genui/package.json
  • packages/liteship/package.json
  • packages/mcp-server/package.json
  • packages/quantizer/package.json
  • packages/remotion/package.json
  • packages/scene/package.json
  • packages/stage/package.json
  • packages/vite/package.json
  • packages/vite/src/boundary-manifest.ts
  • packages/vite/src/plugin.ts
  • packages/vite/src/transform-css.ts
  • packages/web/package.json
  • packages/worker/package.json
  • tests/fixtures/api-surface-snapshot.json
  • tests/integration/wgsl-cast.test.ts
  • tests/property/quantizer-output-changes.prop.test.ts
  • tests/unit/astro/astro-directive-branches.test.ts
  • tests/unit/astro/directive-boot-scanner.test.ts
  • tests/unit/astro/wgpu-runtime.test.ts
  • tests/unit/cloudflare/middleware.test.ts
  • tests/unit/compiler/wgsl-compiler.test.ts
  • tests/unit/devops/audit-command.test.ts
  • tests/unit/devops/audit-consumer-mode.test.ts
  • tests/unit/edge/edge-tier.test.ts
  • tests/unit/edge/kv-cache.test.ts
  • tests/unit/vite/boundary-manifest.test.ts
  • tests/unit/vite/vite-runtime.test.ts

Comment thread CHANGELOG.md
Comment on lines +29 to +34
- **`@czap/astro` — directives boot on plain elements.** `client:stream` /
`client:llm` / `client:gpu` / `client:wasm` / `client:graph` now activate on
plain elements, not only framework islands, via a scanner whose selectors derive
from `DIRECTIVE_ATTRIBUTE_REGISTRY` (a new directive is scannable by construction).
A bare `data-czap-boundary` — also a worker/GPU payload — stays explicit and
warns once when found bare instead of silently doing nothing. See ADR-0028.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Changelog claim doesn't match the registry it describes.

This bullet states data-czap-boundary is "also a worker/GPU payload," but DIRECTIVE_ATTRIBUTE_REGISTRY in packages/astro/src/runtime/slots.ts maps data-czap-boundary only to satellite and worker (both implicitBoot: false); gpu uses a distinct data-czap-shader-src attribute (implicitBoot: true). The "GPU" reference here is inaccurate and could mislead consumers about which directive owns which attribute.

✏️ Suggested wording fix
-  A bare `data-czap-boundary` — also a worker/GPU payload — stays explicit and
-  warns once when found bare instead of silently doing nothing. See ADR-0028.
+  A bare `data-czap-boundary` — also a worker payload — stays explicit and
+  warns once when found bare instead of silently doing nothing. See ADR-0028.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- **`@czap/astro` — directives boot on plain elements.** `client:stream` /
`client:llm` / `client:gpu` / `client:wasm` / `client:graph` now activate on
plain elements, not only framework islands, via a scanner whose selectors derive
from `DIRECTIVE_ATTRIBUTE_REGISTRY` (a new directive is scannable by construction).
A bare `data-czap-boundary` — also a worker/GPU payload — stays explicit and
warns once when found bare instead of silently doing nothing. See ADR-0028.
- **`@czap/astro` — directives boot on plain elements.** `client:stream` /
`client:llm` / `client:gpu` / `client:wasm` / `client:graph` now activate on
plain elements, not only framework islands, via a scanner whose selectors derive
from `DIRECTIVE_ATTRIBUTE_REGISTRY` (a new directive is scannable by construction).
A bare `data-czap-boundary` — also a worker payload — stays explicit and
warns once when found bare instead of silently doing nothing. See ADR-0028.
🤖 Prompt for 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.

In `@CHANGELOG.md` around lines 29 - 34, The changelog bullet in the update note
misstates the registry mapping for data-czap-boundary by describing it as a
worker/GPU payload, while the actual directive mapping is different. Update the
wording in the changelog entry that references DIRECTIVE_ATTRIBUTE_REGISTRY and
the scannable attribute behavior so data-czap-boundary is described only as
satellite/worker, and keep GPU associated with its own data-czap-shader-src
attribute.

Comment on lines +67 to +99
### tierDataAttributesMap

> **tierDataAttributesMap**: (`result`) => `Record`\<`` `data-czap-${CapAxis}` ``, `string`\>

Structured, spreadable `data-czap-*` map for the root HTML element (auto-includes every CAP_AXES axis).

Structured `data-czap-*` attribute map for the root `<html>` element — the
spreadable form of [tierDataAttributes](#tierdataattributes).

Keyed by the FULL attribute name (`data-czap-<axis>`), built by iterating the
canonical CAP_AXES registry, so a newly-added capability axis appears
automatically. A consumer that spreads this map (`<html {...map}>`) can never
silently MISS an axis the way a hand-written attribute list does — the whole
point of exposing it alongside the pre-serialized string.

#### Parameters

##### result

[`EdgeTierResult`](../interfaces/EdgeTierResult.md)

#### Returns

`Record`\<`` `data-czap-${CapAxis}` ``, `string`\>

#### Example

```ts
// Astro: <html {...EdgeTier.tierDataAttributesMap(result)}>
tierDataAttributesMap(result)
// => { 'data-czap-tier': 'reactive', 'data-czap-motion': 'animations', 'data-czap-design': 'enhanced' }
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Keep the new map docs aligned with the readonly contract.

tierDataAttributesMap is still rendered here as a mutable Record, but the exported declaration is Readonly<Record<string, string>>. That mismatch advertises mutability that callers don't actually get.

🧰 Tools
🪛 LanguageTool

[grammar] ~67-~67: Ensure spelling is correct
Context: ..." data-czap-design="enhanced"' ``` ### tierDataAttributesMap > tierDataAttributesMap: (result) => `...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)


[style] ~78-~78: Consider using “who” when you are referring to a person instead of an object.
Context: ... axis appears automatically. A consumer that spreads this map (<html {...map}>) ca...

(THAT_WHO)

🤖 Prompt for 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.

In `@docs/api/edge/src/variables/EdgeTier.md` around lines 67 - 99, The docs for
tierDataAttributesMap currently describe a mutable Record, but the exported API
is readonly, so update the generated markdown in EdgeTier.md to match the actual
contract. In the tierDataAttributesMap section, adjust the return type and any
prose/examples tied to mutability so they reflect Readonly<Record<string,
string>> (or the equivalent readonly mapped shape used by
EdgeTier.tierDataAttributesMap), keeping the docs consistent with the
declaration.

Comment on lines +89 to +96

/** Astro client directive entry that marks the host before starting the WASM runtime. */
export const wasmDirective = (load: () => Promise<unknown>, opts: Record<string, unknown>, el: HTMLElement): void => {
bootDirectiveEntry('wasm', load, opts, el, (runtimeLoad, _runtimeOpts, runtimeEl) => {
void loadWasmRuntime(runtimeEl);
runtimeLoad();
});
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Unhandled promise from runtimeLoad().

loadWasmRuntime(runtimeEl) is explicitly marked void (it self-catches internally), but runtimeLoad() — typed () => Promise<unknown> — is called bare with no void/await/catch. If the real directive load implementation ever rejects (chunk-load failure, etc.), this becomes an unhandled rejection.

🩹 Proposed fix
   bootDirectiveEntry('wasm', load, opts, el, (runtimeLoad, _runtimeOpts, runtimeEl) => {
     void loadWasmRuntime(runtimeEl);
-    runtimeLoad();
+    void runtimeLoad();
   });
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/** Astro client directive entry that marks the host before starting the WASM runtime. */
export const wasmDirective = (load: () => Promise<unknown>, opts: Record<string, unknown>, el: HTMLElement): void => {
bootDirectiveEntry('wasm', load, opts, el, (runtimeLoad, _runtimeOpts, runtimeEl) => {
void loadWasmRuntime(runtimeEl);
runtimeLoad();
});
};
/** Astro client directive entry that marks the host before starting the WASM runtime. */
export const wasmDirective = (load: () => Promise<unknown>, opts: Record<string, unknown>, el: HTMLElement): void => {
bootDirectiveEntry('wasm', load, opts, el, (runtimeLoad, _runtimeOpts, runtimeEl) => {
void loadWasmRuntime(runtimeEl);
void runtimeLoad();
});
};
🤖 Prompt for 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.

In `@packages/astro/src/runtime/wasm.ts` around lines 89 - 96, The wasmDirective
callback is invoking runtimeLoad() without handling its returned promise, which
can lead to an unhandled rejection if the directive load fails. Update the
wasmDirective/bootDirectiveEntry callback to explicitly handle the Promise from
runtimeLoad, matching the existing fire-and-forget pattern used for
loadWasmRuntime(runtimeEl) (for example, by discarding it intentionally and
ensuring any rejection is caught). Keep the fix localized to wasmDirective and
its runtimeLoad call site.

Comment thread packages/vite/src/boundary-manifest.ts
Comment on lines +26 to +31
import {
collectBoundaryDefinitions,
collectBoundaryManifest,
serializeBoundaryOutput,
type BoundaryDefinitionMap,
} from './boundary-manifest.js';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 Performance & Scalability | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
rg -n -B3 -A15 'export async function collectBoundaryManifest' packages/vite/src/boundary-manifest.ts
rg -n -B3 -A15 'export async function collectBoundaryDefinitions' packages/vite/src/boundary-manifest.ts
rg -n 'scanProject\(' packages/vite/src/boundary-manifest.ts

Repository: freebatteryfactory/LiteShip

Length of output: 2130


🏁 Script executed:

#!/bin/bash
sed -n '180,240p' packages/vite/src/plugin.ts
sed -n '240,320p' packages/vite/src/plugin.ts
sed -n '480,540p' packages/vite/src/boundary-manifest.ts

Repository: freebatteryfactory/LiteShip

Length of output: 8084


Share the boundary scan between these caches. In packages/vite/src/plugin.ts, ensureBoundaryDefinitions() and ensureBoundaryManifest() each call scanProject(projectRoot), so a project that hits both the CSS @quantize path and virtual:czap/boundaries will walk the tree twice. Reusing one scan result would remove the duplicate filesystem pass.

🤖 Prompt for 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.

In `@packages/vite/src/plugin.ts` around lines 26 - 31, Both
ensureBoundaryDefinitions() and ensureBoundaryManifest() are independently
calling scanProject(projectRoot), which duplicates the same filesystem walk when
a project uses both boundary caches. Update the boundary caching flow in
plugin.ts so the scan result from scanProject is shared between
ensureBoundaryDefinitions() and ensureBoundaryManifest(), ideally by caching the
scanned project data once and reusing it in collectBoundaryDefinitions and
collectBoundaryManifest.

… single-chunk

Commit 6 routed each client-directive runtime through `bootDirectiveEntry` from
`directive-boot.ts`, whose `LOADERS` dynamic-import all 8 directives. That dragged
code-splitting into `runtime/stream.ts`'s graph, so the e2e stream lib-bundle split
into 22 chunks; the single-file e2e server served only the entry chunk, its static
imports of the sibling chunks 404'd in the browser, the module never executed, and
`window.__streamPromise` stayed undefined -- failing `stream.e2e` on truth-linux and
all three browser-e2e jobs, invisible to the local (non-browser) run.

Extract the bound-marker primitives (`boundNames` / `markBound` / `unmarkBound` /
`markDirectiveBound` / `bootDirectiveEntry`) into a dependency-free leaf
`directive-bound.ts`. The 8 runtime directives import from the leaf;
`directive-boot.ts` (the scanner) keeps `LOADERS` and re-exports the primitives for
back-compat. Behavior is unchanged.

Also make the e2e server fail LOUD if a lib bundle ever code-splits again -- naming
the entry, the chunk count, and the fix -- instead of silently serving a broken chunk.

Verified locally: stream-bundle rebuilt 22 -> 1 chunk; typecheck/lint/format green;
tests/unit/astro 504 passed; build green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014wkz4TzwswnSCMVWQAngSd

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 90cb9543c6

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/cloudflare/src/middleware.ts Outdated
}

function warnEmptyManifestOutputs(boundary: string, entry: BoundaryManifestEntry): void {
if (entry.outputs.length > 0 || Object.keys(entry.outputsByTier).length > 0) return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Warn when pooled outputs still serialize to empty CSS

When a boundary has an @quantize block that only emits non-CSS casts (for example @wgsl/@glsl/@aria) or otherwise compiles to no CSS, collectBoundaryManifest still produces a non-empty outputs pool and outputsByTier entries whose CSS fields serialize to ''. This early return suppresses the new diagnostic, and resolveBoundaryOutputs treats that precompiled object as a hit, so Cloudflare serves an empty stylesheet with no warning or compile fallback. The guard needs to check whether any selected output actually has servable CSS, not just whether the pool/indexes exist.

Useful? React with 👍 / 👎.

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

🧹 Nitpick comments (1)
packages/astro/src/runtime/directive-bound.ts (1)

48-51: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove the redundant markDirectiveBound wrapper

packages/astro/src/runtime/directive-bound.ts only forwards to markBound, and the repo has no internal call sites beyond a re-export from packages/astro/src/runtime/directive-boot.ts. If the alias isn’t needed for the public API, drop the wrapper and export markBound directly to keep the leaf API minimal.

🤖 Prompt for 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.

In `@packages/astro/src/runtime/directive-bound.ts` around lines 48 - 51, The
markDirectiveBound wrapper is redundant because it only forwards to markBound
and has no internal call sites beyond the directive-boot re-export. Remove the
markDirectiveBound function from directive-bound.ts and update the runtime
export surface to expose markBound directly, keeping the existing
DirectiveName/HTMLElement binding behavior intact.
🤖 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.

Nitpick comments:
In `@packages/astro/src/runtime/directive-bound.ts`:
- Around line 48-51: The markDirectiveBound wrapper is redundant because it only
forwards to markBound and has no internal call sites beyond the directive-boot
re-export. Remove the markDirectiveBound function from directive-bound.ts and
update the runtime export surface to expose markBound directly, keeping the
existing DirectiveName/HTMLElement binding behavior intact.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c420d8ef-39e3-44e1-a8e2-e69f0c47de5b

📥 Commits

Reviewing files that changed from the base of the PR and between 66080dd and 90cb954.

📒 Files selected for processing (11)
  • packages/astro/src/runtime/directive-boot.ts
  • packages/astro/src/runtime/directive-bound.ts
  • packages/astro/src/runtime/gpu.ts
  • packages/astro/src/runtime/graph-directive.ts
  • packages/astro/src/runtime/llm.ts
  • packages/astro/src/runtime/satellite.ts
  • packages/astro/src/runtime/stream.ts
  • packages/astro/src/runtime/svg.ts
  • packages/astro/src/runtime/wasm.ts
  • packages/astro/src/runtime/worker.ts
  • tests/e2e/server.ts
🚧 Files skipped from review as they are similar to previous changes (9)
  • packages/astro/src/runtime/wasm.ts
  • packages/astro/src/runtime/gpu.ts
  • packages/astro/src/runtime/satellite.ts
  • packages/astro/src/runtime/stream.ts
  • packages/astro/src/runtime/svg.ts
  • packages/astro/src/runtime/llm.ts
  • packages/astro/src/runtime/graph-directive.ts
  • packages/astro/src/runtime/worker.ts
  • packages/astro/src/runtime/directive-boot.ts

…t, empty-CSS warn, +3)

Batch-fix the real findings from the CodeRabbit / Greptile / Codex review of PR #94:

- vite (Major): parse the generic `vec2<f32>(...)` WGSL constructor correctly --
  strip the whole `<...>` before the numeric scan (it was capturing `f32`'s `32`,
  turning `vec2<f32>(1,2)` into a `vec4f`) and validate the component count against
  the declared vecN, warning + dropping a malformed vector instead of shipping a
  silently-wrong offset. Upholds ADR-0029's own guarantee.
- astro (P2): make `bootDirectiveEntry` idempotent + collision-aware. The plain-element
  scanner and Astro's island hydration both route through it; without the guard, an
  island that also carries the directive's implicit attribute was booted twice
  (duplicate EventSource / worker / shader). Collision detection moves here from the
  scanner so it fires for both boot paths; the scanner drops its now-redundant pre-mark.
- cloudflare (P2): warn when a manifest boundary's pool serializes to no SERVABLE CSS
  (an @quantize block emitting only @wgsl/@glsl/@aria), not just when the pool is empty.
- cli (P2): default `audit --pretty` off under `--findings`, so the per-finding lines
  don't duplicate the receipt JSON / NDJSON stream on a TTY.
- edge: `tierDataAttributesMap` returns `Readonly<...>` to match the spine contract.
- astro: `void` the bare `runtimeLoad()` in `wasmDirective` (unhandled-rejection guard).
- docs: correct "worker/GPU" -> "satellite/worker" for `data-czap-boundary` in the
  CHANGELOG + ADR-0028 (the registry maps it to satellite + worker); regenerate docs/api.

Deferred to its own change: sharing `scanProject` between the two boundary caches --
an HMR-sensitive signature/cache refactor for a marginal (one-scan-at-startup) win,
not a safe pre-merge bang-out.

Regression guards: WGSL generic/malformed parse test; `bootDirectiveEntry` idempotence
+ collision unit tests; the gpu shader-fetch test now uses a fresh host (re-booting the
same element is correctly a no-op now).

Verified: typecheck x3 / lint / format / build / check-invariants green;
vite / cloudflare / edge / astro / cli / meta slices green; docs:check green;
the e2e stream lib-bundle stays a single chunk.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014wkz4TzwswnSCMVWQAngSd

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 096a08f79d

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +134 to +135
if (hasDirectiveMarker(element) || hasImplicitDirectiveAttribute(element)) {
continue;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Warn for boundary payloads even with implicit peers

When an element has data-czap-boundary plus an implicit directive attribute such as data-czap-shader-src, but no data-czap-directive="satellite"/"worker", this guard suppresses the explicit-only boundary diagnostic because hasImplicitDirectiveAttribute is true. The scanner then boots only the GPU directive; no satellite/worker evaluator runs to call applyBoundaryState, so boundary state and @wgsl/@glsl uniform updates remain inert without the warning expected for explicit-only boundary payloads.

Useful? React with 👍 / 👎.

… not in bootDirectiveEntry

The previous commit moved collision detection into `bootDirectiveEntry`, but a directive
whose own tier/capability gate no-ops (e.g. `client:gpu` at a low tier) never reaches
`bootDirectiveEntry` -- so a "two directives on one element" collision went undetected.
The browser test `astro-directive-boot > ...warn about the collision (client:gpu +
satellite trap)` regressed (truth-linux `coverage:browser` + all three browser jobs).

Detect collision at the scanner instead, MARKER-based: if an element carries a marker
for two enabled directives, warn -- independent of whether either directive actually
boots. `bootDirectiveEntry` keeps ONLY the idempotence guard (the double-boot fix); the
scanner no longer pre-marks (the entry owns marking), and its unmark-on-failure still
enables retry.

Verified: typecheck x3 / lint / format / build green; tests/unit/astro 506 + meta 611
green; new scanner-collision (marker-based, gate-independent) + bootDirectiveEntry
idempotence unit tests; the e2e stream lib-bundle stays a single chunk.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014wkz4TzwswnSCMVWQAngSd

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2074b9cdda

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

element: HTMLElement,
init: (load: () => Promise<unknown>, opts: Record<string, unknown>, element: HTMLElement) => void,
): void {
if (boundNames(element).has(name)) return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve forced GPU hydrations after scanner wins

When the plain-element scanner sees data-czap-shader-src before Astro hydrates the same island, it calls this entry with empty opts and marks gpu bound; on static/styled provisional tiers initGPUDirective only registers the detect-ready retry. If Astro then invokes client:gpu={{ force: true }}, this guard returns before gpuDirective can read opts.value, so the documented force escape hatch is ignored exactly on low/headless tiers where it is needed. Consider allowing a forced GPU call to upgrade a prior scanner no-op rather than treating every prior bind as final.

Useful? React with 👍 / 👎.

Comment on lines +299 to +300
if (ctx.boundaryDefinitions && !discovered) {
throw ValidationError(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep per-file boundary resolution for external CSS

When a transformed CSS file lives outside the project scan (for example a linked package or node_modules, which scanProject skips) and keeps its boundaries.ts beside the stylesheet, ctx.boundaryDefinitions is still present but lacks that local export. This throws before the existing resolvePrimitive(..., id, ...) fallback below can search from the CSS file's directory, so package-authored @quantize blocks that previously resolved locally now hard-fail unless the app re-exports every boundary at the project root.

Useful? React with 👍 / 👎.

Comment on lines +272 to +273
const componentSource = ctor ? ctor[2]! : trimmed;
const parts = [...componentSource.matchAll(/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi)]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Require a numeric-list grammar before scanning WGSL strings

When the value is neither a finite scalar nor a recognized vecN constructor, this falls back to scanning the entire raw string for numbers. That makes invalid/non-numeric WGSL values with digits such as 10px, var(--scale-2), or calc(100% - 1px) compile as scalar/vector uniforms instead of being dropped or warned, which can add unintended fields and change the inferred struct layout; only scan a bare numeric component list, not arbitrary text.

Useful? React with 👍 / 👎.

…review)

Two real findings on this PR's own new code, from the bot re-review:

- vite: `parseWgslCastValue` now requires a pure numeric-list grammar on the
  non-constructor path, so arbitrary text with stray digits (`10px`,
  `calc(100% - 1px)`, `var(--scale-2)`) is dropped-and-warned instead of scanning
  its digits into a false scalar/vector uniform (and silently changing the struct
  layout).
- astro: the directive idempotence guard was swallowing the documented
  `client:gpu={{ force: true }}` escape hatch when the plain-element scanner had
  already bound gpu at a provisional tier (a scanner no-op that only defers to
  detect-ready). A forced boot now clears that prior bind and re-enters;
  `initGPUDirective` is re-entry-safe (its detect-ready upgrade path re-runs it).

Regression guards: `@wgsl 10px` is dropped + warned; gpu force boots after a prior
scanner bind (both non-vacuous). Verified: typecheck x3 / lint / format green;
tests/unit/astro 507 + vite boundary-manifest green; docs/api regenerated,
docs:check clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014wkz4TzwswnSCMVWQAngSd

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c25de8ff69

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +671 to +673
if (forced) {
unmarkBound(el, 'gpu');
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Cancel pending GPU retry before forced re-entry

When the scanner reaches this element first on a provisional static/styled tier, initGPUDirective has already registered an onDetectReady retry before returning. If Astro then hydrates the same host with client:gpu={{ force: true }} (or data-czap-gpu-force) before detection settles, this unmarks and starts the shader immediately, but the earlier detect-ready callback is still armed and will call initGPUDirective(... force: true) again once the tier upgrades, creating a second canvas/render loop for the same element. The forced path needs to cancel or make the pending retry observe that a real GPU runtime has already started instead of just clearing the bound marker.

Useful? React with 👍 / 👎.

…dy retry fires

Follow-up to the force-hatch fix. When the scanner bails at a provisional tier it arms
an onDetectReady retry; a subsequent forced boot starts the shader immediately, but the
armed retry would append a SECOND canvas / render loop once the tier upgrades. Track
started shaders OFF the DOM in a WeakSet and skip the retry when the host already
started. Regression test extended: a tier upgrade after a forced boot yields exactly
one canvas.

Verified: typecheck x3 / lint / format green; tests/unit/astro 507; docs:check clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014wkz4TzwswnSCMVWQAngSd

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 207b202535

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

// generic (`vec2<f32>(...)`) form, capturing the DECLARED arity and the argument
// list. The generic `<...>` must be stripped whole, or its digits (`f32` -> 32)
// leak into the component scan and mis-shape the vector.
const ctor = /^vec([234])(?:[fiu]|<[^>]*>)?\s*\(([^)]*)\)$/i.exec(trimmed);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject non-f32 WGSL vector constructors

When an @wgsl value uses valid integer/unsigned constructor syntax such as vec2i(1, 2) or vec2<u32>(1, 2), this regex accepts it but only keeps the numeric components; the compiler later infers every array-valued uniform as vecNf, losing the declared scalar kind. That makes the generated preamble expose a float vector field for an integer vector authoring form, so shaders that use the uniform in integer contexts can fail WGSL validation or read the wrong type. Restrict this parser to the f32 forms it can actually represent, or carry the vector element type through compilation.

Useful? React with 👍 / 👎.

…ing implicit peer

warnExplicitOnlyDirectiveAttributes suppressed the data-czap-boundary marker warning
whenever ANY implicit directive attribute was present -- but an implicit peer like
data-czap-shader-src (gpu) does NOT evaluate the boundary (only satellite/worker do).
So a bare boundary sitting next to a gpu shader booted the shader, left the boundary
inert, and stayed silent. Suppress only on an explicit directive marker.

Verified: typecheck x3 / lint / format green; tests/unit/astro 508; docs:check clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014wkz4TzwswnSCMVWQAngSd

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5a9df11bd1

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +94 to +96
process.stderr.write(JSON.stringify(receipt) + '\n');
for (const finding of payload.findings ?? []) {
process.stdout.write(JSON.stringify(finding) + '\n');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep the audit receipt on stdout

When czap audit --findings is used by CI or a pipe like jq, this branch moves the documented command receipt to stderr and leaves stdout as zero-or-more individual finding objects (empty stdout on a clean run). packages/cli/README.md and receipts.ts both define the CLI contract as one JSON receipt on stdout, with --findings adding detail to that receipt, so machine consumers will stop seeing the summary/status line exactly when they opt into findings.

Useful? React with 👍 / 👎.

@heyoub heyoub merged commit 2ab628c into main Jul 2, 2026
11 checks passed
heyoub added a commit that referenced this pull request Jul 2, 2026
…t, empty-CSS warn, +3)

Batch-fix the real findings from the CodeRabbit / Greptile / Codex review of PR #94:

- vite (Major): parse the generic `vec2<f32>(...)` WGSL constructor correctly --
  strip the whole `<...>` before the numeric scan (it was capturing `f32`'s `32`,
  turning `vec2<f32>(1,2)` into a `vec4f`) and validate the component count against
  the declared vecN, warning + dropping a malformed vector instead of shipping a
  silently-wrong offset. Upholds ADR-0029's own guarantee.
- astro (P2): make `bootDirectiveEntry` idempotent + collision-aware. The plain-element
  scanner and Astro's island hydration both route through it; without the guard, an
  island that also carries the directive's implicit attribute was booted twice
  (duplicate EventSource / worker / shader). Collision detection moves here from the
  scanner so it fires for both boot paths; the scanner drops its now-redundant pre-mark.
- cloudflare (P2): warn when a manifest boundary's pool serializes to no SERVABLE CSS
  (an @quantize block emitting only @wgsl/@glsl/@aria), not just when the pool is empty.
- cli (P2): default `audit --pretty` off under `--findings`, so the per-finding lines
  don't duplicate the receipt JSON / NDJSON stream on a TTY.
- edge: `tierDataAttributesMap` returns `Readonly<...>` to match the spine contract.
- astro: `void` the bare `runtimeLoad()` in `wasmDirective` (unhandled-rejection guard).
- docs: correct "worker/GPU" -> "satellite/worker" for `data-czap-boundary` in the
  CHANGELOG + ADR-0028 (the registry maps it to satellite + worker); regenerate docs/api.

Deferred to its own change: sharing `scanProject` between the two boundary caches --
an HMR-sensitive signature/cache refactor for a marginal (one-scan-at-startup) win,
not a safe pre-merge bang-out.

Regression guards: WGSL generic/malformed parse test; `bootDirectiveEntry` idempotence
+ collision unit tests; the gpu shader-fetch test now uses a fresh host (re-booting the
same element is correctly a no-op now).

Verified: typecheck x3 / lint / format / build / check-invariants green;
vite / cloudflare / edge / astro / cli / meta slices green; docs:check green;
the e2e stream lib-bundle stays a single chunk.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014wkz4TzwswnSCMVWQAngSd
heyoub added a commit that referenced this pull request Jul 2, 2026
…review)

Two real findings on this PR's own new code, from the bot re-review:

- vite: `parseWgslCastValue` now requires a pure numeric-list grammar on the
  non-constructor path, so arbitrary text with stray digits (`10px`,
  `calc(100% - 1px)`, `var(--scale-2)`) is dropped-and-warned instead of scanning
  its digits into a false scalar/vector uniform (and silently changing the struct
  layout).
- astro: the directive idempotence guard was swallowing the documented
  `client:gpu={{ force: true }}` escape hatch when the plain-element scanner had
  already bound gpu at a provisional tier (a scanner no-op that only defers to
  detect-ready). A forced boot now clears that prior bind and re-enters;
  `initGPUDirective` is re-entry-safe (its detect-ready upgrade path re-runs it).

Regression guards: `@wgsl 10px` is dropped + warned; gpu force boots after a prior
scanner bind (both non-vacuous). Verified: typecheck x3 / lint / format green;
tests/unit/astro 507 + vite boundary-manifest green; docs/api regenerated,
docs:check clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014wkz4TzwswnSCMVWQAngSd
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