Skip to content

Commit 6a45d59

Browse files
rbuergiclaude
andcommitted
fix(ci): the reusable lanes land a module's static web assets, not only its DLLs
`node-repo-gate.yml` and `node-repo-publish-bake.yml` composed every external module into `/ext/<Name>/` with `cp -R meshweaver/modules/.` and nothing else. A module bundle carries its static web assets separately, under `meshweaver/moduleassets/` (`NuGetPackageWriter.ModuleAssetFolder`), keeping their MODULE-RELATIVE path — which is exactly the shape `ModuleLandingService` writes beside the entry assembly and `MeshModuleStaticAssetExtensions` serves at `_content/<Name>/…`. So a module landed this way LOADED PERFECTLY and then 404'd every asset it ships, announced in one LogDebug line. Both lanes now copy `meshweaver/moduleassets/.` into the same module directory — module-relative, not `wwwroot`-specific, so a second asset root would ride too — and assert PER FILE that what the bundle ships is what the directory holds, failing closed with both numbers. Each run prints its denominator (`N composed, M carrying static web assets, K asset file(s) landed`), because an uncounted zero was what let this ride: 24 of 30 real modules legitimately ship none. `.github/scripts/test-module-asset-landing.py` EXECUTES the fix rather than asserting about it. It extracts BOTH lanes' step by `id:` (a copy would pass while the real thing rots), reads the verdict off the landed bytes' sha256, reads the bundle layout out of `NuGetPackageWriter` in src/ so a rename reds the harness, and carries two falsification arms per lane that MUTATE the real step: the pre-fix body must fail the positive case, and removing only the `cp` must trip the lane's own fail-closed check. Measured against the 30 real module bundles of MeshWeaver.Plugins run 34086016940: 6 carry assets, 294 asset files shipped, 294 landed byte-identical with the fix — and 0 of 294 landed pre-fix, at exit code 0. Closes #3514. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent b75f501 commit 6a45d59

7 files changed

Lines changed: 756 additions & 3 deletions

File tree

‎.github/scripts/test-module-asset-landing.py‎

Lines changed: 438 additions & 0 deletions
Large diffs are not rendered by default.

‎.github/workflows/dotnet-test.yml‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2103,6 +2103,17 @@ jobs:
21032103
- name: "Execute publish-bake-bundles.sh with two publishers on one prefix"
21042104
run: python3 .github/scripts/test-publish-bake-overlap.py
21052105

2106+
# The gate and publish-bake lanes compose every external module into /ext/<Name>/ for the
2107+
# tester container, and until #3514 they copied `meshweaver/modules/` alone — leaving a module
2108+
# that LOADS and then 404s every static asset it ships (`meshweaver/moduleassets/`), announced
2109+
# in one LogDebug line. Latent here (the bake is mesh-free, the gate runs no browser) and fine
2110+
# in production, so nothing could catch it: MeshWeaver.Education, which copied the block into a
2111+
# browser-driven mesh e2e, rendered a bare Code card where the workbench belongs for three days.
2112+
# This EXTRACTS both lanes' step by `id:` and executes it against real bundle shapes, reading
2113+
# the verdict off the landed bytes — with two arms that mutate the real step and must go RED.
2114+
- name: "Execute the lanes' external-module landing against real bundle shapes"
2115+
run: python3 .github/scripts/test-module-asset-landing.py
2116+
21062117
# carry-forward-bundles.sh is the other half of that publication and had NO CI execution at
21072118
# all: it runs only inside a node repo's publish lane, so the first execution of an edit was a
21082119
# production publish. Its self-test covers the shrink refusals it has always owed and the

‎.github/workflows/node-repo-gate.yml‎

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,11 @@ jobs:
843843
# once, while bumping their pins past #2276: 17 packages failed to install in one run.
844844
# Every failure below is RED and NAMED, because a gate that quietly ran without a module it
845845
# needed is worse than one that did not run at all.
846+
# `id:` is load-bearing: test-module-asset-landing.py EXTRACTS this step's shell by id and
847+
# executes it against synthetic bundles. A copy of the block in the harness would pass while
848+
# the real thing rots, so the harness fails RED if this id disappears.
846849
- name: "External modules: assemble what the gate must compose"
850+
id: ext-modules
847851
if: inputs.module-artifacts != '' || inputs.registry-modules != ''
848852
env:
849853
REGISTRY_MODULES: ${{ inputs.registry-modules }}
@@ -894,6 +898,9 @@ jobs:
894898
fi
895899
shopt -s nullglob
896900
MODULE_ARGS=""
901+
MODULE_COUNT=0
902+
ASSET_MODULES=0
903+
ASSET_FILES=0
897904
for b in "$BUNDLES"/*.nupkg "$BUNDLES"/*.zip; do
898905
u="${RUNNER_TEMP:-/tmp}/unpack-$(basename "$b")"; rm -rf "$u"; mkdir -p "$u"
899906
unzip -o -q "$b" -d "$u"
@@ -907,10 +914,39 @@ jobs:
907914
test -f "$u/meshweaver/modules/$name.dll" || { echo "::error::$(basename "$b"): meshweaver/modules/$name.dll is missing from the bundle"; exit 1; }
908915
mkdir -p "$EXT/$name"
909916
cp -R "$u"/meshweaver/modules/. "$EXT/$name/"
917+
# 🚨 A module bundle carries its STATIC WEB ASSETS separately from the flat closure,
918+
# under `meshweaver/moduleassets/` (NuGetPackageWriter.ModuleAssetFolder), and they keep
919+
# their MODULE-RELATIVE path — `wwwroot/x.js`, `wwwroot/_content/<Dep>/y.css`. That is
920+
# the shape ModuleLandingService writes verbatim beside the entry assembly, and it is
921+
# the shape MeshModuleStaticAssetExtensions then serves at `_content/<Name>/…` off
922+
# `<module folder>/wwwroot`. Copying only `meshweaver/modules/` therefore lands a module
923+
# that LOADS PERFECTLY and 404s every asset it ships, saying so in ONE Debug line —
924+
# which is why it survived: MeshWeaver.Education's mesh e2e rendered a bare Code node
925+
# card where the workbench belongs for three days after MeshWeaver.Plugins#1268 moved
926+
# the collaboration views into MeshWeaver.Markdown.Collaboration (MeshWeaver#3514).
927+
assets=0
928+
if [ -d "$u/meshweaver/moduleassets" ]; then
929+
cp -R "$u"/meshweaver/moduleassets/. "$EXT/$name/"
930+
# Fail CLOSED, per file, against a DENOMINATOR: what the bundle ships is the
931+
# expectation, what the module folder holds is the measurement. A landing that copied
932+
# nothing must go RED here rather than report a green zero — an uncounted zero is
933+
# exactly what let the gap above ride for three days.
934+
( cd "$u/meshweaver/moduleassets" && find . -type f ) | sed 's|^\./||' > "${u}.shipped-assets"
935+
assets=$(wc -l < "${u}.shipped-assets" | tr -d ' ')
936+
missing=0
937+
while IFS= read -r rel; do
938+
[ -f "$EXT/$name/$rel" ] || { echo "::error::$name: shipped static asset '$rel' did not land at /ext/$name/$rel"; missing=$((missing + 1)); }
939+
done < "${u}.shipped-assets"
940+
[ "$missing" -eq 0 ] || { echo "::error::$(basename "$b"): $missing of $assets shipped static asset(s) are missing from /ext/$name — a browser rendering against this mesh would 404 them"; exit 1; }
941+
[ "$assets" -eq 0 ] || ASSET_MODULES=$((ASSET_MODULES + 1))
942+
fi
943+
ASSET_FILES=$((ASSET_FILES + assets))
944+
MODULE_COUNT=$((MODULE_COUNT + 1))
910945
MODULE_ARGS="$MODULE_ARGS --module /ext/$name/$name.dll"
911-
echo "external module composed: $name ($(basename "$b"))"
946+
echo "external module composed: $name ($(basename "$b")) — $assets static asset file(s)"
912947
done
913948
[ -n "$MODULE_ARGS" ] || { echo "::error::external modules were requested but none were assembled — the artifact pattern matched nothing and no registry bundle was fetched."; exit 1; }
949+
echo "external modules: $MODULE_COUNT composed, $ASSET_MODULES of them carrying static web assets, $ASSET_FILES asset file(s) landed under /ext/<module>/wwwroot"
914950
echo "EXT_MODULES_DIR=$EXT" >> "$GITHUB_ENV"
915951
echo "EXT_MODULE_ARGS=$MODULE_ARGS" >> "$GITHUB_ENV"
916952
- name: Import + compile + render + run tests for each node repo

‎.github/workflows/node-repo-publish-bake.yml‎

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,11 @@ jobs:
899899
# NodeType binds must be handed in explicitly. Every failure here is RED and NAMED — a bake
900900
# that quietly ran without a module it needed blames the CONTENT (CS0246), which is exactly
901901
# the misdiagnosis that froze the fleet on 2026-08-28.
902+
# `id:` is load-bearing: test-module-asset-landing.py EXTRACTS this step's shell by id and
903+
# executes it against synthetic bundles. A copy of the block in the harness would pass while
904+
# the real thing rots, so the harness fails RED if this id disappears.
902905
- name: "External modules: assemble what the compile surface must compose"
906+
id: ext-modules
903907
if: inputs.module-artifacts != '' || inputs.registry-modules != ''
904908
env:
905909
REGISTRY_MODULES: ${{ inputs.registry-modules }}
@@ -934,6 +938,9 @@ jobs:
934938
fi
935939
shopt -s nullglob
936940
MODULE_ARGS=""
941+
MODULE_COUNT=0
942+
ASSET_MODULES=0
943+
ASSET_FILES=0
937944
for b in "$BUNDLES"/*.nupkg "$BUNDLES"/*.zip; do
938945
u="${RUNNER_TEMP:-/tmp}/unpack-$(basename "$b")"; rm -rf "$u"; mkdir -p "$u"
939946
unzip -o -q "$b" -d "$u"
@@ -947,8 +954,36 @@ jobs:
947954
test -f "$u/meshweaver/modules/$name.dll" || { echo "::error::$(basename "$b"): meshweaver/modules/$name.dll is missing from the bundle"; exit 1; }
948955
mkdir -p "$EXT/$name"
949956
cp -R "$u"/meshweaver/modules/. "$EXT/$name/"
957+
# 🚨 A module bundle carries its STATIC WEB ASSETS separately from the flat closure,
958+
# under `meshweaver/moduleassets/` (NuGetPackageWriter.ModuleAssetFolder), and they keep
959+
# their MODULE-RELATIVE path — `wwwroot/x.js`, `wwwroot/_content/<Dep>/y.css`. That is
960+
# the shape ModuleLandingService writes verbatim beside the entry assembly, and it is
961+
# the shape MeshModuleStaticAssetExtensions then serves at `_content/<Name>/…` off
962+
# `<module folder>/wwwroot`. Copying only `meshweaver/modules/` therefore lands a module
963+
# that LOADS PERFECTLY and 404s every asset it ships, saying so in ONE Debug line —
964+
# which is why it survived: MeshWeaver.Education's mesh e2e rendered a bare Code node
965+
# card where the workbench belongs for three days after MeshWeaver.Plugins#1268 moved
966+
# the collaboration views into MeshWeaver.Markdown.Collaboration (MeshWeaver#3514).
967+
assets=0
968+
if [ -d "$u/meshweaver/moduleassets" ]; then
969+
cp -R "$u"/meshweaver/moduleassets/. "$EXT/$name/"
970+
# Fail CLOSED, per file, against a DENOMINATOR: what the bundle ships is the
971+
# expectation, what the module folder holds is the measurement. A landing that copied
972+
# nothing must go RED here rather than report a green zero — an uncounted zero is
973+
# exactly what let the gap above ride for three days.
974+
( cd "$u/meshweaver/moduleassets" && find . -type f ) | sed 's|^\./||' > "${u}.shipped-assets"
975+
assets=$(wc -l < "${u}.shipped-assets" | tr -d ' ')
976+
missing=0
977+
while IFS= read -r rel; do
978+
[ -f "$EXT/$name/$rel" ] || { echo "::error::$name: shipped static asset '$rel' did not land at /ext/$name/$rel"; missing=$((missing + 1)); }
979+
done < "${u}.shipped-assets"
980+
[ "$missing" -eq 0 ] || { echo "::error::$(basename "$b"): $missing of $assets shipped static asset(s) are missing from /ext/$name — a browser rendering against this mesh would 404 them"; exit 1; }
981+
[ "$assets" -eq 0 ] || ASSET_MODULES=$((ASSET_MODULES + 1))
982+
fi
983+
ASSET_FILES=$((ASSET_FILES + assets))
984+
MODULE_COUNT=$((MODULE_COUNT + 1))
950985
MODULE_ARGS="$MODULE_ARGS --module /ext/$name/$name.dll"
951-
echo "external module composed: $name ($(basename "$b"))"
986+
echo "external module composed: $name ($(basename "$b")) — $assets static asset file(s)"
952987
# 🚨 The bytes this bake composes are the bytes its publication SEALS (modules/<pkg>.module.nupkg,
953988
# MeshWeaver#2698): a consumer pinned to this identity composes exactly these, never the
954989
# registry's. Keyed by PACKAGE id, which is what a consumer asks for (registry-modules).
@@ -967,6 +1002,7 @@ jobs:
9671002
echo "sealing $name as module package '$pkg'"
9681003
done
9691004
[ -n "$MODULE_ARGS" ] || { echo "::error::external modules were requested but none were assembled — the artifact pattern matched nothing and no registry bundle was fetched."; exit 1; }
1005+
echo "external modules: $MODULE_COUNT composed, $ASSET_MODULES of them carrying static web assets, $ASSET_FILES asset file(s) landed under /ext/<module>/wwwroot"
9701006
echo "EXT_MODULES_DIR=$EXT" >> "$GITHUB_ENV"
9711007
echo "EXT_MODULE_ARGS=$MODULE_ARGS" >> "$GITHUB_ENV"
9721008
echo "SEAL_MODULES_DIR=${RUNNER_TEMP:-/tmp}/seal-modules" >> "$GITHUB_ENV"

0 commit comments

Comments
 (0)