Skip to content

[3.0] Document two ways working code looks broken to an agent - #9670

Merged
Sesquipedalian merged 1 commit into
SimpleMachines:release-3.0from
albertlast:3.0/agents-md-false-negatives
Sep 10, 2026
Merged

[3.0] Document two ways working code looks broken to an agent#9670
Sesquipedalian merged 1 commit into
SimpleMachines:release-3.0from
albertlast:3.0/agents-md-false-negatives

Conversation

@albertlast

Copy link
Copy Markdown
Collaborator

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') calls template_init() — this is how every theme initialises itself.
  • Theme::loadTemplate($name) calls template_{$name}_init().
  • BBCodeParser builds .bbc_standard_quote as 'bbc_' . ($quote_alt ? 'alternate' : 'standard') . '_quote'.

Grep for template_init and 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 that template_init() is never called, and the whole template_init() block — has_dark_mode, theme_variants, page_index — was inert. It is not. loadSubTemplate('init', 'ignore') at the end of loadTemplatesAndLangFiles() 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 forum currently 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 stash appear 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_enable is 0 (as .docker/use-engine.sh also notes) and opcache runs with revalidate_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

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
Sesquipedalian merged commit 8d125a4 into SimpleMachines:release-3.0 Sep 10, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants