Skip to content

fix(helm): keep the post-synth barrel edge-clean — WHM503 reads a light render-records module - #2055

Merged
lex00 merged 1 commit into
mainfrom
fix/helm-postsynth-edge-clean
Sep 1, 2026
Merged

lex00 merged 1 commit into
mainfrom
fix/helm-postsynth-edge-clean

Conversation

@lex00

@lex00 lex00 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

The break

Bumping blacklight (the hosted audit) to @intentius/*@0.53.1 crashed the worker at startup: Uncaught ReferenceError: __filename is not defined from TypeScript's own module init. Traced with esbuild's metafile: WHM503 → ../../render → the full @intentius/chant barrel → build.ts → discovery/fold-import.ts → typescript. WHM503 landed after the last blacklight bump (0.44.1), so the regression was invisible until now — the post-synth barrels are the modules #409/#428/#1621 promise are edge-clean.

Fix

  • lexicons/helm/src/render-records.ts: the HelmRender invocation ledger (HelmRenderRecord, getHelmRenderRecords, clearHelmRenderRecords, new recordHelmRender) in a module whose only import is a type. render.ts re-exports everything — public surface unchanged — and WHM503 imports the records module directly.
  • Guard extension: edge-init-safety.test.ts walked only relative imports, so the chain escaped through a package specifier. It now also asserts the transitive closure of every edge-imported barrel contains no static import of the bare @intentius/chant barrel (subpaths like @intentius/chant/lint/post-synth stay allowed — they are the deliberately edge-clean seams). With the walk mechanics, this fails on the pre-fix tree and points at render.ts.

Verification

Helm suite: 861 green. Extended guard green. Repo-wide typecheck: no regressions. Boot verified on workerd via the blacklight bump branch (wrangler dev --local + fixture audit) with this fix applied.

Unblocks blacklight#25 (which will carry the hosted-side proof).

🤖 Generated with Claude Code

…ht render-records module (#428/#1621 class)

Found bumping the hosted audit (blacklight#25) to 0.53.1: the worker
crashed at startup with "__filename is not defined". The chain:
WHM503 → ../../render → the full @intentius/chant barrel → build() →
discovery/fold-import → the TypeScript compiler, whose module init
touches __filename — fatal on workerd. The barrel the hosted service
edge-imports had silently stopped being init-safe when WHM503 landed.

- The HelmRender invocation ledger (HelmRenderRecord + get/clear +
  a new recordHelmRender) moves to lexicons/helm/src/render-records.ts,
  a module with no runtime imports. render.ts re-exports it all, so the
  lexicon's public surface is unchanged; WHM503 imports the records
  module directly.
- edge-init-safety gains the guard this class needed: the transitive
  closure of every edge-imported barrel must not statically import the
  bare @intentius/chant package barrel (subpath imports remain the
  edge-clean seams). The relative-import walk stopped at package
  specifiers, which is exactly how this escaped.

Verified: the helm suite (861) and the extended guard pass; the hosted
bundle boots on workerd with this fix applied (tested via the
blacklight bump branch).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@lex00
lex00 merged commit 5bc0699 into main Sep 1, 2026
6 checks passed
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