Two problems, and the second is why the first survived
1. The companion eager bundle is 3× its budget.
FAIL the eager bundle is the hex and its glue, not the panel (312.7 KB <= 100.0 KB)
tests/companion-bundle.spec.js asserts the always-loaded companion script stays small. It is
attached to every page in Nextcloud via \OCP\Util::addInitScript('hermiq', 'hermiq-companion'),
so this is not an app-local cost — it is 300 KB on every page load of the whole instance, for users
who never open the companion.
2. Nothing runs that check.
package.json: "check:companion-bundle": "node tests/companion-bundle.spec.js"
- it is not in
check:specs (which is what spec-validation.yml runs)
- no workflow references it at all
So the budget has been silently violated. The check is not failing in CI, because the check is not
in CI. It only surfaces if someone runs npm run build and then invokes it by hand — which is how it
was found, incidentally, while verifying an unrelated change.
Two of its four assertions currently fail; the other two pass, which is what makes the file read as
"a passing check" to anyone who glances at it.
Why wiring it in is not a one-liner
Adding check:companion-bundle to check:specs will not work as-is: spec-validation.yml installs
dependencies but never builds, and this spec reads js/hermiq-companion.js. Running it there would
fail with hermiq-companion.js not found — run npm run build first, which is a different red than
the real one and would train people to ignore it.
It needs to run in a job that has a build — or the spec needs to skip explicitly and loudly when the
bundle is absent, rather than error. A skip that cannot tell "not built" from "budget blown" is worth
nothing here.
Suggested order
- Make the spec's no-bundle case an explicit, named skip rather than a crash.
- Wire it into a job that builds.
- Then decide the budget: either bring the eager bundle back under 100 KB, or raise the number
to something true and write down why. A budget nothing enforces and everything exceeds is worse
than no budget — it reads as a guarantee.
Not fixed here
Found while verifying #606 (dropping the forked flow frontend) and deliberately left out of it: the
companion entry is src/companion.js, which does not import the registry, and the built bundle
contains zero references to anything that PR touches. It is pre-existing and unrelated.
Two problems, and the second is why the first survived
1. The companion eager bundle is 3× its budget.
tests/companion-bundle.spec.jsasserts the always-loaded companion script stays small. It isattached to every page in Nextcloud via
\OCP\Util::addInitScript('hermiq', 'hermiq-companion'),so this is not an app-local cost — it is 300 KB on every page load of the whole instance, for users
who never open the companion.
2. Nothing runs that check.
check:specs(which is whatspec-validation.ymlruns)So the budget has been silently violated. The check is not failing in CI, because the check is not
in CI. It only surfaces if someone runs
npm run buildand then invokes it by hand — which is how itwas found, incidentally, while verifying an unrelated change.
Two of its four assertions currently fail; the other two pass, which is what makes the file read as
"a passing check" to anyone who glances at it.
Why wiring it in is not a one-liner
Adding
check:companion-bundletocheck:specswill not work as-is:spec-validation.ymlinstallsdependencies but never builds, and this spec reads
js/hermiq-companion.js. Running it there wouldfail with
hermiq-companion.js not found — run npm run build first, which is a different red thanthe real one and would train people to ignore it.
It needs to run in a job that has a build — or the spec needs to skip explicitly and loudly when the
bundle is absent, rather than error. A skip that cannot tell "not built" from "budget blown" is worth
nothing here.
Suggested order
to something true and write down why. A budget nothing enforces and everything exceeds is worse
than no budget — it reads as a guarantee.
Not fixed here
Found while verifying
#606(dropping the forked flow frontend) and deliberately left out of it: thecompanion entry is
src/companion.js, which does not import the registry, and the built bundlecontains zero references to anything that PR touches. It is pre-existing and unrelated.