Remove what nothing uses, and wire up what only looked wired - #38
Merged
DorwardTech merged 1 commit intoAug 3, 2026
Merged
Conversation
## Livewire There are no Livewire components. Not one — no component classes, no `@livewire(...)`, no `<livewire:...>`, and the `app/Livewire` directory Tailwind was told to scan has never existed. What the app actually uses is plain Alpine: the sidebar's collapsible groups and the arcade dashboard's 5-second poll. Alpine was arriving inside Livewire's bundle, which is why this had gone unnoticed — and why removing the package is not just a composer edit. app.js now imports alpinejs directly, which it can because alpinejs was already a declared dependency. That takes an admin page from ~250KB of Livewire JS plus a 42KB app.js down to one 46KB request. The Dockerfile no longer copies livewire.js out of vendor into public/, and the layout no longer hand-rolls the <script> tag that a comment in it explains was working around ERR_HTTP2_PROTOCOL_ERROR through Cloudflare — a problem that stops existing along with the bundle. Verified rather than assumed: `npm ci` and `npm run build` both run clean, the built bundle exposes window.Alpine and Alpine's directive machinery, and the Tailwind CSS output is byte-identical apart from losing `.static` — which was never used in any markup and only existed because the word "static" appeared in the prose of the comment now deleted. ## Dead files - `stubs/nwidart-stubs/` — 70 tracked files. config/modules.php points its stub path at `vendor/nwidart/laravel-modules`, and has `enabled => false` anyway. Nothing has ever read this directory. - `resources/js/bootstrap.js` and the `axios` dependency. The global it set is used nowhere; the one AJAX call in the app uses `fetch`. - `concurrently` — no script invokes it. - `database/factories/UserFactory.php` and User's `HasFactory`. Nothing calls `User::factory()`; tests build users with `User::query()->create()`. Both lockfiles were regenerated so `composer install` and `npm ci` still match: the composer.lock diff is exactly the two packages and the content hash, with no other version moved. ## Settings that were documented but inert Three env keys had nothing reading them, which is worse than absent — someone setting them would reasonably expect an effect: - `BCRYPT_ROUNDS` — phpunit.xml has set it to 4 since the suite was written, but with no hashing config published Laravel fell back to its own default of 12, so every Hash::make() in a test did 256x the asked-for work. Now config/hashing.php reads it. - `ZONE3_2FA_WINDOW` — .env.example documents it; config/google2fa.php had `'window' => 1` as a literal. Now it reads the key. - `ZONE3_BACKUP_RETENTION_DAYS` — read with `env()` inside BackupDatabaseCommand, which returns null once the entrypoint has run `config:cache`, so the configured retention was silently ignored in production and every run pruned at the hardcoded 30. Moved into config/zone3.php, the same rule config/crm.php already documents. Deleted outright, because they cannot be wired to anything: `BROADCAST_CONNECTION` (no broadcasting config, no broadcasting), `VITE_APP_NAME` (unreferenced in any JS), and `ZONE3_IP_ALLOWLIST_ENABLED` — that flag lives in app_settings, where the admin UI and `zone3:ip-allowlist` both read and write it, so an env key would only compete with the source of truth. Every key left in .env.example is now read by a config file. ## Docs that had gone stale The README listed Livewire in the stack table and told module authors their Livewire components register at boot. The arcade module's troubleshooting named "Livewire's bundle failed to load" as the most likely cause of a frozen dashboard; it now names the symptom that actually distinguishes an Alpine failure. ## Kept on purpose `docker-compose.local.yml` (the README documents it as the local overlay), `DatabaseSeeder` (the standard `db:seed` target, and it calls ModuleSeeder), the Cowork import command and parser (the migration may not have been run yet), and the framework config files with no direct `config()` reads — the framework and its packages read those themselves. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014E51bA27LnFMK7v4YigZY1
DorwardTech
marked this pull request as ready for review
August 3, 2026 00:44
DorwardTech
merged commit Aug 3, 2026
65bfd62
into
claude/zone3-darwin-internal-tool-YQKKN
2 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Net −1,900 lines. Two kinds of finding: things nothing references, and settings that were documented but inert — which is the worse category, because someone setting them would reasonably expect an effect.
Livewire is not used
There are no Livewire components. Not one: no component classes, no
@livewire(...), no<livewire:...>, and theapp/Livewiredirectory Tailwind was told to scan has never existed.What the app actually uses is plain Alpine — the sidebar's collapsible groups and the arcade dashboard's 5-second poll. Alpine was arriving inside Livewire's bundle, which is both why this went unnoticed and why removing the package isn't just a composer edit.
resources/js/app.jsnow importsalpinejsdirectly, which it can becausealpinejswas already a declared dependency.The Dockerfile no longer copies
livewire.jsout of vendor intopublic/, and the layout no longer hand-rolls the<script>tag whose own comment explains it was working aroundERR_HTTP2_PROTOCOL_ERRORthrough Cloudflare for that 250KB bundle — a problem that stops existing along with the bundle.Verified, not assumed (npm works in this environment even though composer's dist downloads don't):
npm ciandnpm run buildboth run clean from the regenerated lockfilewindow.Alpineplus Alpine's directive machinery (_x_dataStack,_x_effects,directive,magic,cloak,transition).static— which no markup uses, and which only existed because the word "static" appeared in the prose of the comment this PR deletesThere's a guard test for the Alpine import, because that dependency is invisible from PHP and fails silently: drop the import and every
x-datastops working with no error and no other failing test.Dead files
stubs/nwidart-stubs/(70 files)config/modules.phppoints its stub path atvendor/nwidart/laravel-modules, and hasenabled => falseregardless. Nothing has ever read this directory.resources/js/bootstrap.js+axiosfetch.concurrentlydatabase/factories/UserFactory.php+HasFactoryUser::factory(); tests build users withUser::query()->create().Both lockfiles were regenerated so
composer installandnpm cistill match — thecomposer.lockdiff is exactly the two packages and the content hash, with no other version moved.Settings that were documented but inert
Three env keys had nothing reading them. All three are now wired rather than deleted, because each names something a real person might want to change:
BCRYPT_ROUNDS—phpunit.xmlhas set it to 4 since the suite was written, but with no hashing config published Laravel fell back to its own default of 12, so everyHash::make()in a test did 256× the asked-for work.config/hashing.phpnow reads it.ZONE3_2FA_WINDOW—.env.exampledocuments it;config/google2fa.phphad'window' => 1as a literal.ZONE3_BACKUP_RETENTION_DAYS— read withenv()insideBackupDatabaseCommand, which returns null once the entrypoint has runconfig:cache. So the configured retention was silently ignored in production and every run pruned at the hardcoded 30. Moved intoconfig/zone3.php— the same ruleconfig/crm.phpalready documents at length.Deleted outright, because they can't be wired to anything:
BROADCAST_CONNECTION(no broadcasting config, no broadcasting),VITE_APP_NAME(unreferenced in any JS), andZONE3_IP_ALLOWLIST_ENABLED— that flag lives inapp_settings, where the admin UI andzone3:ip-allowlistboth read and write it, so an env key would only compete with the source of truth.Every key left in
.env.exampleis now read by a config file, and there's a check in the PR description's place: I ran that as a loop over the file.Docs that had gone stale
The README listed Livewire in the stack table and told module authors their Livewire components register at boot. The arcade module's troubleshooting named "Livewire's bundle failed to load" as the likeliest cause of a frozen dashboard; it now names the symptom that actually distinguishes an Alpine failure — sidebar groups dead too.
What I looked at and deliberately kept
docker-compose.local.yml— the README documents it as the local dev overlay.DatabaseSeeder— one line, but it's the standarddb:seedtarget and it callsModuleSeeder.ImportCoworkStateCommand/CoworkStateParser— the Cowork migration may not have been run yet. Say the word once it has and they can go.config()reads (auth,cache,filesystems,logging,mail,queue,session,fortify,google2fa) — the framework and its packages read those themselves.Tests
6 new, all repo scans, because there's nothing to assert at runtime — the browser is where a missing Alpine would break. They cover the import, the
alpinejsdependency, that the two views still justify it, that no Livewire reference survives in the layout / Dockerfile / composer.json, and that the inline[x-cloak]rule (never Livewire's to provide) is still there.vendor/can't be installed in this environment (codeload.github.comis blocked by the proxy), so CI is the verification for the PHP side. The front-end changes are verified locally as described above.Generated by Claude Code