Skip to content

docs(guides): keep intent and gotchas, point at code for the rest - #1235

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

Ardnived merged 6 commits into
mainfrom
claude/docs-intent-pilot

Conversation

@Ardnived

@Ardnived Ardnived commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Pilot of an intent-only rule for guides, tried on SahajCloud's nested AGENTS.md files. The shared rule is landing in claude-workflow in a sibling PR. This PR is the evidence for it.

The rule

Each sentence in a guide gets three questions:

  1. Would a refactor that keeps behaviour the same change it? Then it is mechanism (lists of symbols, constants, file listings, retold API surfaces). Delete it, or move it beside the code.
  2. Would fixing a bug or adding an edge case change it? Then it is a list of conditions. Replace it with a pointer to the code or spec that holds it.
  3. Would only a change in the system's purpose change it? That covers intent, invariants, ownership, contracts, gotchas and how to run things. Keep it.

Nothing was deleted from any of these: a ⚠ line, a command, a cross-repo sync pointer, a #NNN attached to a statement that stays, or a value a check reads out of prose — tests/unit/perf-figures-pinned.spec.ts asserts the "78 s" lane figure in four docs, which is why the root guide is unchanged here. The shared rule had no such entry; sydevs/claude-workflow#289 adds it.

Result

The 11 changed guides drop from 22,005 words to 16,836 (−23%), or +349 / −801 lines (wc -w against main). The other 16 guides were read and left alone, because they are almost all gotchas.

The table in scripts/AGENTS.md had already drifted: it was missing 5 of the scripts in scripts/ (generate-live-preview-keypair, generate-logo-pngs, generate-status-config, preview-manager-emails, standalone-postbuild). That kind of drift is what this rule removes.

Guide Removed / moved Kept Rule question
scripts/ (2,048 → 724 words) The table of every script: what each does, its flags, its pure "half" Conventions. The production-safe boot rule, promoted to its own section. Every ⚠ warning, grouped by script 1 (the inventory), 2 (exit-code lists → railway-preview-status.ts)
src/ (27.6 KB → 13.8 KB) The file-by-file inventory of src/lib/. The plugin list. The list of atlas endpoints. Barrel name lists. Explanations already in each module's own header (env barrel, runQueueSoon, transcripts, url, stateMachine API) Layout table. Organization rules. One-consumer test and its traps. The #633 / #760 barrel story that code points here for. The login/, stateMachine/ and Sentry ⚠ lines. The five src/lib notes no single file can say: richEditor, antiSpam, atomicWrites, stateMachine, submissions 1
src/jobs/ Schedule times, concurrency numbers, step-by-step job descriptions. Cron ticks, except the default safety net an ⚠ above turns on. A duplicate of the CleanupCollections paragraph from src/AGENTS.md. Two overlapping submission entries merged into one All three top ⚠ blocks, and every per-job ⚠ and its reason. The dryRun review that schemaUtils.ts points to 1, 2
seeds/lib/ (279 → 58 lines) The BaseImporter API walkthrough: overrides, lifecycle table, method lists, Logger / FileUtils / CLI snippets, upload format. That class carries 45 doc comments Translation-slot rule. The two-tier error handling. All the preload traps (trashed rows, locale, one cache, 'all') 1
seeds/ The "Available scripts" table, replaced by pnpm seed --help, plus the checklist step that kept the table in sync. Locale lists. Batch-size constants. The fields of the pagination block. A second copy of the env-var / sign-in instructions. A sample summary output. The copied importer template, now a pointer to two real importers Every ⚠ warning and translation property. Sign-in flow (one copy). The new-script checklist 1, 2
src/plugins/sentry/ The list of 12 handler tag values Everything else 2
src/components/admin/WorkflowButtons/ A retelling of the stateMachine API, and its list of consumers The guard rule 1
src/collections/, Meditations/, FrameEditor/, src/fields/ One count or history aside each: "19 locales", "replaced useLivePreviewAuto", "one consumer today" — 1, 2

Inbound pointers were checked: git grep for src/AGENTS.md, scripts/AGENTS.md and src/jobs/AGENTS.md from code, specs, docs/ and DEPLOYMENT.md. Every section they name still exists. No guide was deleted, and every CLAUDE.md symlink is untouched.

Review round 1

origin/main merged in clean (329d3c6). Each finding from the adversarial review got its own commit:

  • ff44dfb — src/jobs/queues.ts drives default every five minutes from :01, as the class import's safety net, so the ⚠ claiming nothing drives it was false. The warning is corrected, the cron clause is back, and the stale comment in tests/unit/job-schedules.spec.ts that repeated the claim is fixed too.
  • 11ddb1c — seeds/lib/AGENTS.md names filterMeditationsByLocale again. Rule 2 trades a list of conditions for a pointer at the code, and that cut had taken the pointer with the list.
  • 9f5c0df — seeds/AGENTS.md now says where production's wm-web-translations locale set lives, since feat(seeds): draft the website's wording in nine more languages #1213 took the only file that recorded it. The count is not restored: nine is a number nothing checks, and the database is the record.

Least-sure calls

  1. Some breadcrumbs went with their statements. In src/AGENTS.md the atlas endpoint list carried #650, #1072 and #1055, and seeds/ had "feat(translations): rewrite the Sahaj Atlas schema by widget view, seed all ten locales, and gate availableLocales on them #706 and feat(translations): rewrite the WeMeditate Web schema by page, seed and publish English, and gate availableLocales on it #707 replaced generateExampleData". The breadcrumb rule protects a pointer on a statement that stays. When the whole statement was inventory or history, I let its number go.
  2. src/lib/ notes are cut to five folders. For each of the others I confirmed the module's own header already says the same thing (grep on its key phrase) before cutting it. Reviewers may still want a short "what's in src/lib" index for orientation. The rule says no.
  3. The src/fixture/ id-block table is kept, though it reads like an inventory. Nothing in code assigns blocks, so the table is the only allocation record, not a copy of one.
  4. A possible contradiction in src/jobs/ — settled in review round 1. importEvents does not rely on runQueueSoon alone, so the ⚠ was the wrong half of the contradiction, not the cron clause.
  5. The seeds/ template code block became a pointer to seeds/translations/import.ts and seeds/file-transcripts/import.ts. Anyone who liked copy-paste scaffolding loses it.

Docs, plus one stale comment in tests/unit/job-schedules.spec.ts. No product code. The lean gate passes: lint, format, both typechecks, 3,841 unit tests.

🤖 Generated with Claude Code

Pilot of the intent-only documentation rule on SahajCloud's nested
AGENTS.md guides. A sentence stays only if it would change when the
system's purpose changes; mechanism (symbol inventories, constants, file
listings, retold API surfaces) is deleted, and condition lists become a
pointer to the code or spec that holds them. Every ⚠ line, #NNN
breadcrumb on a kept statement, command and sync pointer is kept.

The scripts/ inventory table was already missing five of the 34 scripts,
which is the drift this removes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@railway-app

railway-app Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

🚅 Deployed to the SahajCloud-pr-1235 environment in sahajcloud

Service Status Web Updated
SahajCloud ✅ Success (View Logs) Web Nov 20, 2026 at 10:36 pm UTC
1 service not affected by this PR
  • mailpit

@sydevs-bot

sydevs-bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

🤖 no session running
CI fix 1

recent dispatches
  • 22:26Z address-review · attempt 1 · session · done
  • 22:26Z address-review · attempt 1 · session
  • 22:17Z review-pr · attempt 1 · session · done
  • 22:17Z review-pr · attempt 1 · session
  • 16:41Z fix-ci · 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
perf-figures-pinned.spec.ts asserts AGENTS.md quotes the whole-lane figure, so
the copy cannot drift silently.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-1235 November 20, 2026 01:25 Destroyed
@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 fix-ci 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 rule is right and the cuts disciplined. All five ⚠ lines in src/AGENTS.md survive, the #633 / #770 / #760 barrel story stays whole, and the scripts/ production-boot section reads better than the table it replaces. Least-sure call 2 holds: both env/ module headers carry the deep-import why in full. Three things to settle, one a live defect this diff worsens.

Findings

  • should-fix — src/jobs/AGENTS.md:67 removed the true half of a contradiction and left the false one. src/jobs/queues.ts:47-57 drives default every five minutes from :01, so the dropped "five-minute cron" clause was right and the ⚠ at line 7 is wrong, as is tests/unit/job-schedules.spec.ts:316. Least-sure call 4 answered: importEvents does not rely on runQueueSoon alone. Fix the warning here.
  • should-fix — the Result section describes the first commit, not the branch. 4343b94 restored the "78 s" aside in the root AGENTS.md, because tests/unit/perf-figures-pinned.spec.ts asserts that figure in four docs. Root is unchanged, so it is 11 guides, +343 / −799 lines, and the Root row and word totals are wrong. The rule's never-delete list also needs a value a check reads out of prose.
  • should-fix — seeds/lib/AGENTS.md:41 drops the hook name its condition pointed at.
  • consider — seeds/AGENTS.md:152 drops the one surviving record of which locales production holds.

What was checked

Diff read whole. ⚠ lines counted both sides: 5 → 5 in src/AGENTS.md, none lost. Grepped the branch for #633, #770, #760 and client-bundle-safety — present. The seeds/ env-var cut is a true duplicate: the sign-in flow and redeem-signin-link.ts survive at seeds/AGENTS.md:30-66. Read queues.ts, job-schedules.spec.ts, perf-figures-pinned.spec.ts and both env/ headers. No ticket: judged against the body.

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


Generated by Claude Code

Comment thread src/jobs/AGENTS.md Resolved
Comment thread seeds/lib/AGENTS.md Resolved
Comment thread seeds/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
`src/jobs/queues.ts` gives `default` an `autoRun` entry — `cron:
'1-59/5 * * * *'`, the class import's safety net — so the ⚠ claiming
nothing drives it was false, and `job-schedules.spec.ts` repeated the
claim in its own comment. The cut clause was the true half of that
contradiction, so it comes back with the queue named.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjXNwNcni76oUbfdjWM
Rule 2 trades a list of conditions for a pointer at the code, and this
cut took the pointer with the list: a reader had nothing to grep for.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjXNwNcni76oUbfdjWM
#1213 took the `wm-web-locales` script and its data files, so no file
here records which locales that global holds. Restoring the count would
restate a number nothing checks; the note names the authoritative source
instead, and warns off `LOCALES`, which is the supported set.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjXNwNcni76oUbfdjWM
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-1235 November 20, 2026 22:33 Destroyed
@sydevs-bot

Copy link
Copy Markdown
Contributor

Three review threads addressed, one commit each, pushed to 9f5c0df. origin/main merged in clean (329d3c6).

  • ff44dfb — queues.ts drives default every five minutes from :01, so the ⚠ claiming nothing does was the false half. Warning fixed, cron clause restored, and job-schedules.spec.ts:316 repeated the claim, so that went too.
  • 11ddb1c — seeds/lib/AGENTS.md names filterMeditationsByLocale again.
  • 9f5c0df — adopted, not as written: the nine-locale count stays out, since nothing checks it. The note names the database as the record.

Review body finding 2: the Result section described the first commit. It now reads 11 guides, 22,005 → 16,836 words, +349 / −801 lines. The never-delete list gains "a value a check reads out of prose", for the "78 s" perf-figures-pinned.spec.ts asserts.

Lean gate green.

🤖 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 moved this from Working to Pending 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.

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 Pending to Awaiting in SYDevelopers Technical Roadmap Nov 20, 2026
@Ardnived
Ardnived merged commit 1633a8a into main Nov 20, 2026
64 of 77 checks passed
@Ardnived
Ardnived deleted the claude/docs-intent-pilot branch November 20, 2026 22:53
@sydevs-bot sydevs-bot moved this from Awaiting to Done in SYDevelopers Technical Roadmap Nov 20, 2026
sydevs-bot pushed a commit that referenced this pull request Nov 20, 2026
One conflict, `scripts/AGENTS.md`. #1235 deleted the operator inventory
table this branch edited one row of, replacing it with intent-only prose
under "Warnings by script". Resolved to main's rewrite.

Nothing of this branch's intent is lost. The row's false clause — a bare
`Success` means base-environment misconfiguration — is gone because the
sentence carrying it is gone, and main's replacement bullet asserts no
cause at all, pointing at `railway-preview-status.ts` and #661 instead.
Re-adding the runbook pointer would restore detail #1235 deliberately
moved out of these guides. The two-cause statement still lives in the
five surfaces this branch changes that main did not touch.

The `<details>` note in the PR body about that row's 62-character
padding is moot: the table it padded no longer exists.

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

This branch was successfully deployed

No deployments
sahajcloud / SahajCloud-pr-1235 — 9f5c0dfd Deployed Nov 20, 2026 by railway-app[bot]
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