Repository source: docs/plans/asset_bypass/asset_bypass_step4_implementation_summary.md
Debug mode: enabled
Effort study: railspike-effort / v3/asset_bypass; host ledger. Standing P2 enrollment.
Extended estimates: enabled
Cycle estimate: 0.4
Step 3 approved 2026-11-16 23:22 ET ("approved step 3"). Branch feat/asset_bypass, planning commit fb90541. At Step 4 entry, 2026-11-17 UTC, Claude reaffirms the Step 3 projection of 0.4 unchanged; same single exposed rater.
Original stage work, copied from Step 3: Stage 1 0.08 · Stage 2 0.1 · Stage 3 0.12 · Stage 4 0.08.
Test environment
I installed Apache 2.4.58 and mod_php 8.3 in my workspace; they are not a project dependency. Apache refuses to run as root, so
tests/high_traffic_apache_test.pyruns as an unprivileged user on a copy of the checkout.Baseline at
fb90541: the smoke set plusWebServerRoutingTest,HighTrafficTest,HighTrafficAutomationTestandAppUpdateTestgave 518 run, 518 passed. The Apache test failed at its first busy-page check, which expectsRetry-After: 5. The busy page sends 30 on purpose (FrontController::PAGE_RETRY_NOSCRIPT_SECONDS). Stage 1 fixes that test, as part of this work.
Stage 1 - Plain presentation files bypass PHP
Original estimate: 0.08
Retrospective stage work: 0.1
Changes:
public/.htaccessline 35 now matches files directly inassets/with an allowlisted extension (css, js, ico, png, jpg, jpeg, gif, svg, webp, woff, woff2), plus/favicon.ico.A root
<If>block gives those files PHP's headers:max-age=300, must-revalidateandnosniff.WebServerRoutingTest: the assertion now names the new condition. A new case checks the condition admits and rejects the right paths.tests/high_traffic_apache_test.py: new checks for plain files (no PHP request, headers, HEAD). HTML, a.mapand an unknown fingerprint still reach PHP.Stale expectations fixed:
Retry-Afteris now 30. The separate prepared read model is gone since43e0e5bb(2026-11-10), so the prepared-copy checks are removed. The live-model check stays.
Verification:
Passed:
./v3 test --smoke WebServerRoutingTestgave 469 of 470 passed. The one failure,StatusCommandTest::testStatusPrintsAlignedHealthSummaryAndEveryFix, comes from the uncommittedpublic/.htaccessedit:./v3 statusadds apublic/.htaccess has local editsrow without the label column. It passes once committed (see Stage 2).Passed: the Apache test's new Stage 1 checks.
Blocked: the Apache test stops later, at the import-withdrawal check. That check also fails at
fb90541; see the pending decision below.Full suite not run.
Notes:
Key Risk 1 is resolved, but in the opposite direction from the plan. A throwaway Apache 2.4.58 shows that a
.htaccessinassets/with onlyHeaderlines leaves the root rewrites in place. A missing file still reachedindex.php. The root<If>is kept anyway, so no new file is needed.Pending decision (pre-existing failure, outside this cycle's code): two Apache-test checks broke with the 2026-10-25 retraction simplification (
e31acf0d). (a) Import no longer withdraws high-traffic serving. Its marker pathrecords/post-retractions/import.txtstopped matching oncepost-retractions/left the withdrawal list. (b) A cached thread page shows a reply whose source was deleted and retracted while the read model was stale. Each fix is a product choice under the retraction handoff, so I am asking the maintainer.Estimate details: original scope unchanged; the retrospective is higher because of the stale-test triage and Apache setup.
— Claude · 2026-11-17 UTC · Model: claude-opus-5-5
Stage 2 - The mode manages an asset link
Original estimate: 0.1
Retrospective stage work: 0.08
Changes:
HighTrafficMode::ASSET_LINK(.high-traffic-assets) and a privateexposeAssets(). It writes the cache'sassets/.htaccessand creates the link.assets/.htaccess: no listings; PHP's types for the allowlist, plus UTF-8 for css and js; one-year immutable,nosniffandX-V3-High-Traffic: hit.
change(): a fresh turn-on exposes the assets after the pages link, and a failure detaches both. Turn-on while already on refreshes the savednormal.htaccessand exposes missing assets.HighTrafficSafety::detach()removes both links, so off, every withdrawal andrestore()cover the asset link without their own code..gitignore:public/.high-traffic-assets.HighTrafficAutomationTest::testAssetLinkIsCreatedAndRemovedWithTheMode: covers turn-on, turn-on while on (link added, saved rules refreshed), off, withdrawal,restore, and a refused regular file at the link path.
Verification:
Passed:
./v3 test --smoke HighTrafficAutomationTest HighTrafficTest WebServerRoutingTestgave 488 run, 488 passed.StatusCommandTestpasses again now that Stage 1 is committed.Passed: in the Apache test, turning the mode on created both links. The run then stopped at the same pre-existing import check.
Full suite not run.
Notes:
Reuse:
pages/.htaccessand its symlink pattern, and the singledetach()used by every withdrawal path. No new service.A regular file at either link path blocks turn-off and withdrawal with "must be a managed symlink".
.high-trafficalready behaves that way.Estimate details: original scope unchanged.
— Claude · 2026-11-17 UTC · Model: claude-opus-5-5
Stage 3 - Apache serves the asset copies
Original estimate: 0.12
Retrospective stage work: 0.14
Changes:
New rule in
HighTrafficMode::routingRules()and the shipped block inpublic/.htaccess. It matches GET/HEAD with no query and noAuthorization, a 12-hex name and an allowlisted extension, with no... When the copy exists under.high-traffic-assets/assets/, the request is served from there (END). A miss falls through to PHP.The refusal rule now covers
/.high-traffic-assetsas well as/.high-traffic.tests/high_traffic_apache_test.py: new checks.Every allowlisted fingerprinted asset on the warm
/about/page, plus a hand-written copy, is served with zero PHP requests. Each carriesX-V3-High-Traffic: hit, the one-year immutable header,nosniffand the exact PHP content type. HEAD returns no body.A query string,
Authorization, a missing copy,restore, turn-off and the private-instance withdrawal all reach PHP. Direct requests to the storage path return 403.
Verification:
Passed: the Apache test's Stage 3 checks, up to the import check, which fails as described in Stage 1.
Passed: a scratch copy (not committed) skipped only the pre-existing failing checks and ran to the QDB section. It found nothing caused by this branch.
Failed at
fb90541, pre-existing: on the base, with the same skips, the absent-target section'slive_hashcheck fails. The QDB section's first check also fails: aSetEnv FORUM_SITE_ID qdbadded to.htaccessdoes not reach PHP on the ordinary page in my workspace. These are recorded with the pending decision; I made no fix.Passed:
./v3 test --smoke WebServerRoutingTest HighTrafficTest HighTrafficAutomationTest(see the Stage 4 rerun).Full suite not run.
Notes:
Key Risk 3 is mitigated: the types are fixed in the cache folder's
.htaccess. This host'smime.typeswould have senttext/javascriptandimage/vnd.microsoft.icon.Estimate details: original scope unchanged; extra base-commit runs to attribute the failures.
— Claude · 2026-11-17 UTC · Model: claude-opus-5-5
Stage 4 - Deploy replay and documentation
Original estimate: 0.08
Retrospective stage work: 0.1
Changes:
AppUpdateTest::testAssetBypassReleaseKeepsServerEditsToHtaccessdeploys this release'spublic/.htaccessover the base file (tests/fixtures/asset_bypass/htaccess_before.txt, taken fromfb90541). It covers two stand-in server edits: an HTTPS redirect appended at the end, and a changedDirectoryIndexline.The replay found a real conflict, and this stage fixes it: Stage 1 had put the plain-file
<If>block at the end of the file. A server edit appended there made the deploy refuse withlocal_changes_conflict. The block now sits directly below the line-35 rule.docs/runbooks/high_traffic_mode.md: both symlinks; assets served while on; enable after every deploy that changespublic/.htaccess; asset check in verification; disable and restore remove both.New concept entry
docs/concepts/high_traffic_mode.md.
Verification:
Passed:
./v3 test --smoke AppUpdateTest WebServerRoutingTestgave 503 run, 502 passed, before this commit. The one failure isStatusCommandTest, caused by the uncommittedpublic/.htaccess(see Stage 1). It is rerun after the commit, below.Passed: after the move, the Apache test's Stage 1 and Stage 3 checks run up to the pre-existing import check.
Passed: concept links resolve;
git diff --check fb90541is clean.Pending: the production replay. The server's real local edit is still unknown, so only stand-in edits were tested.
Full suite not run.
Notes:
Estimate details: original scope unchanged; the conflict fix is ordinary correction found by the planned replay.
— Claude · 2026-11-17 UTC · Model: claude-opus-5-5
Closeout
Completion Contract:
Passed: end-to-end in the isolated Apache test; a warm page and its assets add zero PHP requests.
Passed: recovery (off, withdrawal,
restore, miss, query,Authorization).Passed: deploy over stand-in edits.
Pending: release on zenmemes. The maintainer deploys, runs
./v3 high-traffic enable, and checks that one stylesheet carriesX-V3-High-Traffic: hit.
Pending decision, pre-existing failures in
tests/high_traffic_apache_test.py(all reproduced atfb90541):Import no longer withdraws serving. A product decision under the retraction handoff.
The absent-target section shows a deleted and retracted reply on a cached thread page when the read model is stale. The same section's
live_hashcheck fails. A product decision under the retraction handoff.The QDB section:
SetEnv FORUM_SITE_ID qdbdoes not reach PHP on the ordinary page in my workspace. The cause is not yet known; it may be specific to my environment.Fixed here:
Retry-Afterand the removed prepared read model.
Observed, outside this cycle:
PHP serves
/assets/1111.htmland/assets/tour.htmlwithout the members-only gate../v3 statusprints a misaligned row wheneverpublic/.htaccesshas local edits. That also makesStatusCommandTestfail in such a checkout.
Commits: planning
fb90541; stagesbe5141ea,5689b4d7,66dd92dd, and Stage 4 (this commit).Retrospective cycle scope assessment: 0.45 (single exposed rater Claude; not a measured actual). The scope delivered is the approved scope. The increase comes from the Apache-test triage on the base commit and the conflict fix. Maintainer comfortable-fit judgment: pending.
— Claude · 2026-11-17 UTC · Model: claude-opus-5-5