[3.0] Document two ways working code looks broken to an agent - #9670
Merged
Sesquipedalian merged 1 commit intoSep 10, 2026
Merged
Conversation
Both of these produced a confident, wrong conclusion recently, and neither
leaves any trace that the reading was unsafe.
A grep does not prove something is dead, because SMF reaches functions,
sub-templates and CSS classes under names it assembles at runtime.
Theme::loadSubTemplate('init') calls template_init(), and searching for
template_init finds only a comment.
On Windows the bind mount into the web container propagates an edit after a
lag, and until it does the container serves the old file with nothing to say
so. A page requested straight after an edit can show the previous behaviour,
which reads as the edit having no effect.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
Sesquipedalian
approved these changes
Sep 10, 2026
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.
Description
Two traps in this repository and its dev environment produce a confident wrong conclusion rather than an obviously wrong one, and neither leaves any sign that the reading was unsafe. Both cost me a full investigation into a bug that did not exist, so they seem worth writing down where the next agent will read them.
A grep does not prove something is dead
SMF reaches functions, sub-templates and CSS classes under names it assembles at runtime, so the literal never appears in the source:
Theme::loadSubTemplate('init')callstemplate_init()— this is how every theme initialises itself.Theme::loadTemplate($name)callstemplate_{$name}_init().BBCodeParserbuilds.bbc_standard_quoteas'bbc_' . ($quote_alt ? 'alternate' : 'standard') . '_quote'.Grep for
template_initand you get a single comment. That reads exactly like proof of dead code, and I acted on it: I had a branch open to "fix" the fact thattemplate_init()is never called, and the wholetemplate_init()block —has_dark_mode,theme_variants,page_index— was inert. It is not.loadSubTemplate('init', 'ignore')at the end ofloadTemplatesAndLangFiles()calls it on every request, and dark mode works.Added to Things that bite in this codebase.
The Windows bind mount serves stale files
### Running the forumcurrently says the checkout is bind-mounted "so edits are live with no rebuild", which is true but reads as immediate. On Docker Desktop for Windows it is not: a changed file reaches the container after a lag of seconds, sometimes longer, and until it does the container serves the previous version silently.So a page requested straight after an edit can show the old behaviour — indistinguishable from the edit not working. In one session it made the above look like a real bug, and later made a
git stashappear never to have been applied.The note says to poll until the change actually appears before measuring, and records that neither the SMF cache nor opcache is the cause, since those are the first two things you would check and both are dead ends:
$cache_enableis 0 (as.docker/use-engine.shalso notes) and opcache runs withrevalidate_freq = 0.Added to Running the forum.
Notes
Documentation only — no code changes.
Both #9617 and #9659 also touch
AGENTS.md, in other sections. Whichever lands first, I will rebase the others.Issues References (Fixes|Related|Closes)
None.
🤖 Generated with Claude Code