Skip to content

docs(guides): name the function a trap's ⚠ sits in, never its line - #94

Merged
Ardnived merged 6 commits into
mainfrom
claude/docs-intent
Nov 20, 2026
Merged

Ardnived merged 6 commits into
mainfrom
claude/docs-intent

Conversation

@Ardnived

@Ardnived Ardnived commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Trap pointers name the function a ⚠ sits in, never its line. Line numbers made AGENTS.md the most-edited guide in the org.
  • Drops narrated history and values copied from code. Follows claude-workflow#284 (the rule) and SahajCloud#1235 (the pilot).
  • Also fixes README.md, which called the browser lane "local only" while AGENTS.md, one click away, says it runs in CI.

Change outline

The rule (claude-workflow/docs/documentation.md), per sentence

  1. Would a behaviour-preserving refactor change it? Mechanism — delete it, or point at the code.
  2. Would a bug fix or new edge case change it? A condition list — point at the code or test that holds it.
  3. Would only a change of purpose change it? Keep it.

Why this guide, measured

AGENTS.md changed in 30 of the last 55 commits on main (10 weeks). 98 of the 372 lines those commits touched carried a file:line pointer, which moves whenever code above it does. At least 6 already pointed at the wrong line: tests/run.php:143 (blank; the ⚠ is at 145), :387 and :409 (at 389 and 411), tests/render.mjs:401 (at 405), tests/bootstrap.php:42 (at 63), includes/diagnostics.php:296 (the end of the previous check; the ⚠ is at 302).

Root AGENTS.md

Section Removed Moved to a pointer Kept Test failed
Who uses it the list of the three settings, and the settings bullet itself — principle 4 holds all of it eight lines below — the design drivers 2
Traps, preamble "where a line number is given" — "the ⚠ there carries the story", plus why there are no line numbers 1
Traps 1, 5, 7–28 38 file:line pointers → the function (or file) whose ⚠ carries the story, by full path every trap and every ⚠ statement 1
Trap 3 "placement now matters, though it did not before", "correct only for the old fixed-overlay map", the transform-ancestor history, how the sizing script measures → ⚠ on the hook list and the two print functions the rule, the three prints, the wp_trim_excerpt() trap 1 / history
Trap 4 "which is why the Atlas page had no header before #170" — the rule and its SahajAtlasWeb#170 breadcrumb history
Trap 18 the five bare-view segments, a copy the trap itself says never to keep → two examples the rule 2
Trap 28 "Before that, such a page printed nothing…" — the rule history
Traps 25, Sitemaps "check 6" (a number that shifts when a check is added) → "the sitemap-discovery check", sahaj_atlas_check_sitemap_discovery() everything else 1
Testing the version floor everywhere it was copied, shard count, 8-minute cell timeout, the zip lane's retold assertions → Requires at least and Requires PHP in the plugin header, browser.yml, tests/zip.mjs every lane, command, verdict and trap 1 / 2
Conventions "SahajCloud's install guide will name the file once SahajCloud#1058 lands" — it merged → the Install tab's steps.ts the permanent-link warning, with SahajCloud#1058 stale status

Principles, Decisions, Where the truth lives: untouched.

tests/AGENTS.md

Removed Moved to a pointer Test failed
6 file:line pointers (4 of them stale) → file, or the named helper in tests/run.php / check() in tests/render.mjs 1
When the browser lane runs in CI — a copy of the root guide's Browser row → root guide 2 (duplicate)
"2 shards" → browser.yml 1
"the fleet's 7.4 floor" → the plugin header, via the root guide. The --php 7.4 flag stays: it quotes what those two commands pass 1

README.md

One line. The quickstart block called pnpm test:browser "local only" and sent the reader to AGENTS.md, which says it runs in CI on a PR touching a file that shapes the embed. What actually gates it locally is the SAHAJ_ATLAS_TEST_KEY secret, so the comment now says that.

Net

+82 / −73 lines across three files. Words by wc -w: root 3,381 → 3,357, tests 637 → 616. This PR does not shrink the guide. It removes what made every code edit also touch it: a function name survives an edit above it, and a line number does not.

Preview

No preview surface — guides only.

Test results

  • Lean gate: not run — the diff is three Markdown files, and no test or script reads their text (grep of tests/, .github/ and package.json: only package.sh and .distignore name the files, to exclude them from the zip).
  • Every function the guides now name exists exactly once in the repo (git grep "function <name>"), and every one carries a ⚠ in its body or in the docblock above it. Two did not on the first push, and both were the defect this PR exists to remove: trap 15 named sahaj_atlas_is_local_url(), a docblock-only guard, and trap 21 named schedule(), whose nearest ⚠ is trap 22's. They now name sahaj_atlas_sitemap_rows() and start(). Every function-and-file pair in both guides was re-checked by script after the fix, each suspect read by hand.
  • CLAUDE.md symlinks untouched. Inbound section references (embed.php "Traps already paid for", i18n.sh principle 2, docs/implementation-plan.md's section names) still resolve; trap numbering is unchanged.

Notes for reviewer

  • Breadcrumbs removed: one — the second #170 in trap 4, removed with the history clause it closed. SahajAtlasWeb#170 stays in the same trap.
  • Doubts:
    • Pointers now name a function, but where one function holds several ⚠s the reader scans it rather than landing on a line.
    • The floor now lives only in the plugin header. A reader who wants the numbers opens sahaj-atlas.php; readme.txt repeats them because wordpress.org requires those fields.
    • Trap 3 lost its "this used to be different" framing; a reader who remembers the fixed-overlay map gets no bridge.
  • Not the same defect: the ⚠s in includes/diagnostics.php still say "check 7". That number is not a fragile pointer there — every check's docblock opens Check N — …, so the file defines its own numbering. The guide could not, which is why "check 6" had to go.

🤖 Generated with Claude Code

The root AGENTS.md changed in 30 of the last 55 commits on main. 98 of the 372
lines those commits touched carried a file:line pointer, which moves whenever
code above it does — and at least 6 of them already pointed at the wrong line. A
function name survives the edit.

Also drops history and copied values: the narrated before/after in trap 3,
the shard count, a timeout, the version floor in two table rows, a copy of
the bare-view segment list in trap 18, and a status line about
SahajCloud#1058, which has merged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sydevs-bot

sydevs-bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

🤖 no session running

recent dispatches
  • 22:28Z address-review · attempt 1 · session · done
  • 22:28Z address-review · attempt 1 · session
  • 22:18Z review-pr · attempt 1 · session · done
  • 22:18Z review-pr · attempt 1 · session
  • 16:39Z review-pr · attempt 3 · session · timed out

Written by the sydevs dispatcher. Sessions never edit this comment.

@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 20, 2026
@sydevs-bot sydevs-bot moved this from Pending to Working in SYDevelopers Technical Roadmap Nov 20, 2026
@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 20, 2026
@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Nov 20, 2026
@sydevs-bot

Copy link
Copy Markdown
Contributor

The session for review-pr did not finish after 3 attempts. I have stopped retrying. A mention (@sydevs-bot) or a push from you starts me again.

🤖 sydevs dispatcher

@sydevs-bot sydevs-bot moved this from Working to Awaiting in SYDevelopers Technical Roadmap Nov 20, 2026
@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 20, 2026
@sydevs-bot sydevs-bot moved this from Awaiting to Working in SYDevelopers Technical Roadmap Nov 20, 2026

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧐 Adversarial review

The mechanism is right and the PR is the size of its own claim: a function name survives an edit above it, a line number does not. I checked all 30 new pointers against the source on this branch. 28 resolve to a ⚠ in or directly above the named function. Two do not, and both are the defect this PR exists to remove, so the body's "I checked the ⚠ sits in or directly above it" needs correcting with them. Nothing is smuggled in — two guides, no code, no new section.

The untouched prose holds, and I would keep it. Principles' survey counts and Decisions' owner-dated values have no home in the code, and Testing's three failed-assertion incidents are what make an agent do that step.

Findings

  • should-fix — trap 15 names sahaj_atlas_is_local_url(), which carries no ⚠ (line 130).
  • should-fix — trap 21 names schedule(); trap 21's ⚠ is in start() (line 156).
  • should-fix — README.md:171 calls the browser lane "local only" and sends the reader to AGENTS.md, which this PR leaves saying it runs in CI. A stale doc on a docs PR belongs here, not out of scope.
  • consider — the PHP and WordPress floor is now pointed at and copied (line 240).
  • consider — the "Who uses it" bullet restates principle 4 (line 29).

What was checked

  • Every function the guides name exists exactly once (git grep "function <name>" on the branch).
  • Each named function read for its ⚠: includes/{embed,seo,sitemap,routing,page,diagnostics,shortcode}.php, sahaj-atlas.php, assets/atlas-page.js, modules/sahaj-atlas/sahaj-atlas.php, tests/{run.php,render.mjs}.
  • Where the old pointer sat above the function, no intervening function in any file.
  • InstallGuide/steps.ts exists in SahajCloud and names the permanent zip link. SahajAtlasWeb is outside this session's scope, so its pointers are unchecked.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

Comment thread AGENTS.md Resolved
Comment thread AGENTS.md Resolved
Comment thread AGENTS.md Resolved
Comment thread AGENTS.md Resolved
@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Nov 20, 2026
`sahaj_atlas_is_local_url()` carries only a docblock. The `⚠` for trap 15's
sitemap half sits in `sahaj_atlas_sitemap_rows()`, above the guard call it
explains, and `includes/seo.php`'s own `⚠` already names that function as the
holder. The preamble promises the named function's `⚠` carries the story.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVmKiRPKJAyG9UKNye
`schedule()` is a rAF queue with no `⚠` of its own, and the `⚠` above it
carries trap 22's story. Trap 21's `⚠` is on `start()`: an optimiser plugin
that hoists the file into `<head>` runs it before `document.body` exists, and
the missed observer attach is silent.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVmKiRPKJAyG9UKNye
The Testing section both named the header fields and restated their values, so
a raise had two places to miss. `tests/AGENTS.md` kept a third. The `--php 7.4`
flag stays: it quotes what those two commands pass, and the trap is about that
flag diverging from the CLI's own 8.3 default.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVmKiRPKJAyG9UKNye
"Who uses it" said a setting costs and deferred to principle 4 for the count.
Principle 4 sits eight lines below, says the same, and names the three. A
cross-reference inside one file is the copy it was meant to remove.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVmKiRPKJAyG9UKNye
It runs in CI on a pull request that touches a file shaping the embed, which
is what AGENTS.md says two clicks away. What actually gates it locally is the
`SAHAJ_ATLAS_TEST_KEY` secret.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVmKiRPKJAyG9UKNye
@sydevs-bot

Copy link
Copy Markdown
Contributor

All five review points adopted. Five commits, 6f083f3..dcd88ee. Nothing rebutted, nothing asked.

Point Commit
Trap 15 names a docblock-only guard a0131ba — now sahaj_atlas_sitemap_rows()
Trap 21 names schedule() 0164252 — now start()
The floor is pointed at and copied 9bfcfea — value dropped in both guides
The bullet restates principle 4 9205b3a — deleted
Review body: README.md:171 calls the browser lane "local only" dcd88ee

The body's claim that every pointer's ⚠ was checked is corrected: it now names the two that were wrong. Every pointer re-checked by script after the fix.

Lean gate not run — three Markdown files, and nothing reads their text. Branch was level with main.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 20, 2026

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved for Ardnived, who wrote it: GitHub refuses an author's own approval. CI is green and the automated review has run. Enable auto-merge when you want it merged: the queue tests it against its base. 🤖 Written by the sydevs autonomous loop — see what this is

@sydevs-bot sydevs-bot moved this from Working to Pending in SYDevelopers Technical Roadmap Nov 20, 2026
@sydevs-bot sydevs-bot moved this from Pending to Awaiting in SYDevelopers Technical Roadmap Nov 20, 2026
@Ardnived
Ardnived merged commit 506bd3c into main Nov 20, 2026
74 of 81 checks passed
@Ardnived
Ardnived deleted the claude/docs-intent branch November 20, 2026 22:38
@sydevs-bot sydevs-bot moved this from Awaiting to Done in SYDevelopers Technical Roadmap Nov 20, 2026
@Ardnived Ardnived mentioned this pull request Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants