Repository navigation
docs: prose reset — STE register, legacy debris removed - #696
Merged
Merged
Conversation
Rewrites every in-scope prose file (67 of 69 flagged by the audit) into strict Simplified Technical English and retires D1/Cloudflare Workers-era debris three months after the Postgres/Railway migration. Tracked *.md (excluding CLAUDE.md symlinks and the vendored .agents/skills/payload/ skill, left untouched pending ownership confirmation) drops from 770,090 to 600,797 chars (22%). The five hot-path files auto-imported every session (AGENTS.md, docs/architecture.md, docs/environment.md, docs/code-style.md, .claude/workflow.json) drop from 84,492 to 36,397 chars (57%). Deleted (dead, zero referrers, grepped clean): seed-issues-report.md, src/migrations/README.md (its one fact folded into src/migrations/AGENTS.md). Merged: DEPLOYMENT.md + RAILWAY_RUNBOOK.md split by lifecycle (how it runs today vs. provision-from-scratch/disaster-recovery), resolving their D1-decommission contradiction — PR #468 (merged 2026-06-08) confirms the Worker is gone, so the stale "Remaining (gated)" TODOs are removed, not reworded. Legacy debris fixed (D1/SQLite/Cloudflare-Workers-as-current retired): migration-reviewer.md's whole persona rewritten for Postgres/Drizzle, seeds/wemeditate/AGENTS.md's Dual-Database table corrected to Postgres, src/globals/AGENTS.md's json_array() rationale corrected to Postgres's real FUNC_MAX_ARGS=100 limit, docs/mcp-setup.md's cloudflare-docs row drops Workers/D1. grep for D1|SQLite|Cloudflare Workers across .claude/agents/, seeds/wemeditate/, src/globals/, docs/mcp-setup.md is clean. README.md's stale `cd sy-devs-cms` corrected to `cd SahajCloud`. Mandatory AGENTS.md fixes applied: dropped the nonexistent `pnpm test:e2e`, replaced the broken dev-server.sh path with the `/workflow:dev-server` skill, fixed the seeds/atlas/MIGRATION_PLAN.md:103 anchor (now resolves to `AGENTS.md#website-selection-rules-584`), collapsed duplicate PR-workflow/test-tier prose into single pointers to testing-reqs.md and the finalize-pr skill. Traps preserved (compressed, never deleted): the conflicted-PR "zero CI" diagnostic with its docs/why.md anchor and #632/#653 numbers; the Cache Rule authorization-header predicate and root-endpoint fix; DB_QUERY_LOGGING and TURNSTILE_SECRET_KEY footguns; storage.md's preview/prod asset-isolation risk; the payload-cli silent-exit/hang ladder; the migration snapshot out-of-order duplicate-re-emission trap; access.md's per-locale-roles gotcha (#665); endpoints.md's root-endpoint hook gap; email.md's two- token-URL-shapes bug; seeds/atlas/AGENTS.md's silent-rollback-on-trashed- relation trap; the never-name-a-global-field-locales rule. The 2026-08-27 dated Admin Access exception is kept (still current). Comment sweep: rewrote comments to STE in every file the audit flagged as touched (route.ts's mandatory dead-comment deletions, r2NativeAdapter.ts, Icon.tsx, scalarPlugin.ts, env/server.ts, localizedRolesAuth.ts, plus the full tests/seeds/scripts/.claude/root-config/.github sweep — 227 files total). Verified comment-only: every changed line in every .ts/.tsx/.mjs/ .cjs/.sh/.py file has an identical code portion before its comment marker; zero functional changes. Deleted a dead `sharp` import and several doc- duplicating/obvious comments (e.g. vitest.setup.ts's two narrate-the- obvious lines). Verification run as finisher: pnpm lint, typecheck, typecheck:tests, and the full unit lane (1564 tests) all pass, plus targeted integration specs for every touched collection/access path (events, regions, role-based- access — 79 tests, live Postgres). ste-lint.py run on all 40 changed .md files: hard violations cut from 169 to 118, concentrated in five already- dense reference docs (admin-ui/api-clients/email/endpoints/openapi/ storage.md) where the prior compression pass already prioritized fidelity over the linter's raw sentence-length cap; remaining flags are verified domain terms (Railway's "Health Check", Zod's "Validate", literal HTTP methods GET/DELETE, SQL "cascade delete", TS "type erasure") or residue in those five files. rule-delta.mjs vs main on AGENTS.md/docs/rules/*.md/ migration-reviewer.md: 3 directives flagged REMOVED, all three verified as de-bolded (not deleted) — "GET /api/events/geojson always excluded, no opt-out" (api-clients.md) and the two CPU parallel-test-run rules (testing-reqs.md) all still present as plain bullets/cells, content identical. 1 flagged ADDED is the same pass-by-reference comment rule gaining full-sentence bold (previously invisible to the tool since only "Do not" was bold). Sequencing: PRs #692 (UNKNOWN), #686 (BLOCKED, not CONFLICTING), #691 (CLEAN) show no current CONFLICTING/DIRTY state, so this PR is not blocked today, though #692/#691 touch overlapping files and should land or be watched. securityReview trigger paths (access/, storage/, api routes, webhook scripts) all confirmed comment-only. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
🚅 Deployed to the SahajCloud-pr-696 environment in sahajcloud
1 service not affected by this PR
|
railway-app
Bot
temporarily deployed
to
sahajcloud / SahajCloud-pr-696
September 5, 2026 07:25
Destroyed
sydevs-bot
added a commit
that referenced
this pull request
Sep 5, 2026
…rs (#699) * docs(claude): correct the tests/ layout and what `pnpm test` covers `AGENTS.md`'s Project Structure listed `tests/{int,e2e,utils}/`. The real set is `tests/{unit,int,e2e,files,setup,utils}/`. The omission that mattered is `tests/unit/`: it is the Tier-1 lane the same file recommends at line 49 and `docs/rules/testing-reqs.md` puts first, holding 120 of the repo's specs. A reader following the layout sentence would not know where a unit spec goes. The command list also called `pnpm test` "the full suite". It is `test:unit && test:int` and never runs the smoke lane, which the next line lists separately and CI runs as its own step. "Full" invited the reading that `pnpm test` covers everything. Ticket #683 also reported `pnpm test:e2e` in the command list. The prose reset in #696 removed it before this change, so nothing here does. The remaining contradiction with `tests/AGENTS.md:425` is gone with it, and every `pnpm` command AGENTS.md names now resolves in `package.json`. Closes #683 Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TeQ6RP2Bop3arGF1jWAfTP * docs: sync the README's tests/ layout with AGENTS.md `README.md` carried the same stale `tests/{int,e2e,utils}/` list. Left alone it would contradict the sentence this branch just corrected, which is the state the ticket was filed about. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TeQ6RP2Bop3arGF1jWAfTP * docs(claude): link tests/AGENTS.md instead of copying its directory list The review thread on `AGENTS.md:119` is right about the root cause. #683 happened because the root guide kept its own copy of the tests layout and drifted from it. Correcting the copy and glossing each directory leaves the same drift surface, one entry wider. The sentence also sent the reader to `src/AGENTS.md` "for the layout" while naming the tests tree, and that guide documents `src/` only. Both guides are now named for what each actually covers. `README.md` carried the same list, so it gets the same treatment. This changes how #683's third verification check reads: the documented directory set no longer exists to compare against `ls -d tests/*/`. That is the point — not stating the set is the durable form of not misstating it. Flagged in the PR body for the reviewer. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01A6p13bPyPaiysoorzsPDcK --------- Co-authored-by: Claude <[email protected]>
1 of 12 tasks
Ardnived
pushed a commit
that referenced
this pull request
Nov 5, 2026
`AGENTS.md`'s Project Structure listed `tests/{int,e2e,utils}/`. The real
set is `tests/{unit,int,e2e,files,setup,utils}/`. The omission that mattered
is `tests/unit/`: it is the Tier-1 lane the same file recommends at line 49
and `docs/rules/testing-reqs.md` puts first, holding 120 of the repo's specs.
A reader following the layout sentence would not know where a unit spec goes.
The command list also called `pnpm test` "the full suite". It is
`test:unit && test:int` and never runs the smoke lane, which the next line
lists separately and CI runs as its own step. "Full" invited the reading
that `pnpm test` covers everything.
Ticket #683 also reported `pnpm test:e2e` in the command list. The prose
reset in #696 removed it before this change, so nothing here does. The
remaining contradiction with `tests/AGENTS.md:425` is gone with it, and
every `pnpm` command AGENTS.md names now resolves in `package.json`.
Closes #683
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TeQ6RP2Bop3arGF1jWAfTP
This branch was successfully deployed
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.
Headline numbers
*.mdrepo-wide (excludingCLAUDE.mdsymlinks and the untouched vendored.agents/skills/payload/skill): 770,090 → 600,797 chars (22% smaller).AGENTS.md,docs/architecture.md,docs/environment.md,docs/code-style.md,.claude/workflow.json): 84,492 → 36,397 chars (57% smaller).What was deleted
seed-issues-report.md— dead 2026-01-24 report naming the retiredD1_ERRORterm. Grepped clean, zero referrers.src/migrations/README.md— its one fact folded intosrc/migrations/AGENTS.mdbefore deletion. Grepped clean, zero referrers.What was merged
DEPLOYMENT.md+RAILWAY_RUNBOOK.mdsplit by lifecycle:DEPLOYMENT.mdis how it runs today (infra, the Cache Rule trap, env vars, troubleshooting),RAILWAY_RUNBOOK.mdis provision-from-scratch + disaster recovery. This resolved a direct contradiction —DEPLOYMENT.mdstill listed "Decommission the Cloudflare Worker + D1 / Merge PR #468" as an open TODO whileRAILWAY_RUNBOOK.mdalready stated it was done three times. Confirmed viagh pr view 468: merged 2026-06-08. All stale TODOs removed, not reworded. Cross-links between the two files (#environment-variables,#edge-cache-cloudflare-cache-rule,#troubleshooting,#disaster-recovery--rollback) verified to resolve against the final heading text.Legacy debris fixed (D1/Cloudflare Workers retired, three months on Postgres/Railway)
migration-reviewer.md— whole subagent persona rewritten for Postgres/Drizzle (was giving wrong advice: claimed "Cloudflare D1 (SQLite)" as the current DB, described D1 FK-cascade order, referenced aremote = truebinding that doesn't exist). Cross-checked againstsrc/migrations/AGENTS.mdfor consistent trap naming (the out-of-order snapshot trap) and backup cadence (Railway automated daily/weekly/monthly).seeds/wemeditate/AGENTS.md— Dual-Database table corrected from "SQLite/D1 (Target - Payload)" to Postgres.src/globals/AGENTS.md—json_array()argument-limit rationale corrected: it's Postgres's ownFUNC_MAX_ARGS(default 100), not a D1/SQLite constraint. The underlying 100-arg limit was real, just misattributed.docs/mcp-setup.md— cloudflare-docs MCP row drops the stale "Workers / D1" coverage claim, keeps R2/Stream/Images.README.md— stalecd sy-devs-cms(a pre-rename repo name) corrected tocd SahajCloud. Confirmed viagh pr view 468→https://github.com/sydevs/SahajCloud.D1/SQLite/Cloudflare Workersacross.claude/agents/,seeds/wemeditate/,src/globals/,docs/mcp-setup.md(.md/.tsfiles, excluding data JSON) — clean, zero hits.Mandatory AGENTS.md fixes
pnpm test:e2efrom the command list (onlytest:smokeis e2e-shaped;.claude/settings.jsonstill has a dead permission entry for the removed script, left untouched per its own "no prose" disposition — flagging for a follow-up)..claude/skills/dev-server/dev-server.shpath with the/workflow:dev-serverplugin skill.seeds/atlas/MIGRATION_PLAN.md:103— now correctly resolves toAGENTS.md#website-selection-rules-584(the real heading is### `website` selection rules (#584)).docs/rules/testing-reqs.md(the canonical home, which keeps the full rationale). Same forworkflow.json'sleanGatetext./code-reviewwhen the real step is/pr-review-toolkit:review-pr all) to a single pointer at claude-workflow'sfinalize-prskill.Traps preserved (compressed, never deleted)
docs/why.md#a-conflicted-pr-schedules-zero-ci-runsanchor and the#632/#653incident numbers kept verbatim.eqterm to the same rule" root-endpoint fix (DEPLOYMENT.md).DB_QUERY_LOGGING(logs bound SQL params — emails, tokens, keys) andTURNSTILE_SECRET_KEYfail-closed footguns (DEPLOYMENT.md).docs/rules/storage.mdpreview/prod asset-isolation risk.payload-cliSKILL.md +migrations/AGENTS.md).src/migrations/AGENTS.md,migration-reviewer.md).docs/rules/access.mdper-locale-roles gotcha (#665, flatreq.user.roles).docs/rules/endpoints.mdroot-endpointbeforeOperation-hook gap.docs/rules/email.mdtwo-token-URL-shapes silent-failure bug.seeds/atlas/AGENTS.md— Payload's silent rollback on a trashed relation target.src/globals/AGENTS.md— never name a global's fieldlocales.PREVIEW_ADMIN_PASSWORDexception (cuts off "before 2026-08-27") — today is 2026-09-05, still current, kept rather than deleted.Comment sweep
Rewrote comments to STE across every file the audit flagged, including all four mandatory dead-comment deletions (
route.ts,r2NativeAdapter.ts,Icon.tsx,scalarPlugin.ts) and the named rationale files (env/server.ts,localizedRolesAuth.ts), plus the fulltests/,seeds/,scripts/,.claude/hooks-and-skills, root-config, and.github/workflowssweep — 227 files total across this PR. Deleted a deadsharpimport and several doc-duplicating/obvious comments (e.g.vitest.setup.ts's two narrate-the-obvious lines).Verified comment-only, repo-wide: for every one of the 177 changed
.ts/.tsx/.mjs/.cjs/.sh/.pyfiles, every changed line's code portion (before the comment marker) is byte-identical tomain. Zero functional changes anywhere in this diff.Gates run
.claude/skills/pr-prep/check.sh(Tier-2 lean gate: lint + typecheck + typecheck:tests + unit)pnpm lintpnpm typecheck&&pnpm typecheck:testsevents,regions,role-based-access— touched collections/access path).claude/workflow.jsonstill parses as JSON after$comment/prose editsste-lint.pyon all 40 changed.mdfilesadmin-ui/api-clients/email/endpoints/openapi/storage.md) where the earlier compression pass already prioritized fidelity over the linter's raw sentence-length cap. Remaining flags are verified either genuine domain terms the linter's synonym heuristic can't distinguish (Railway's "Health Check" feature name, Zod's "Validate", literal HTTP methodsGET/DELETE/ALTER, SQL "cascade delete", TS "type erasure", the/tokens/verifyAPI path) or residual long sentences in those 5 dense files.rule-delta.mjsvsmainonAGENTS.md+docs/rules/*.md+migration-reviewer.mdGET /api/events/geojsonalways excluded, no opt-out" (api-clients.md:174) and both CPU parallel-test-run rules (testing-reqs.md's "Never run more than one test command at the same time" / "Never runpnpm testandpnpm buildat the same time") are all still present verbatim in substance, just as plain bullets/table cells instead of full-sentence bold — the tool only sees bold imperatives by design. 1 directive flagged ADDED is the same pre-existing pass-by-reference comment rule (storage.md) gaining full-sentence bold; it was previously invisible to the tool since only "Do not" was bold inmain. No actual directive was dropped.seeds/atlas/MIGRATION_PLAN.md:103→AGENTS.md#website-selection-rules-584D1/SQLite/Cloudflare Workers)pnpm test:e2e/dev-server/dev-server.shgrep in AGENTS.mdpayload-types.ts, bothresponseTypes.ts,pnpm-lock.yaml,src/migrations/*.ts,CHANGELOG.md,LICENSE)SKILL.mdfrontmatter (migration-validator, payload-cli)#692/#686/#691#692merged 2026-09-05 and already an ancestor of this branch;#686and#691closed without merging. No conflict risk remains.src/plugins/access/,src/plugins/storage/,src/app/**/api/, webhook scripts)Known residue / follow-ups (not fixed here, flagging per the audit's own disposition)
.claude/settings.jsonstill carries a dead permission entry for the removedtest:e2escript — left untouched per its "pure allowlist, zero prose" disposition..env.example(not in the audit's file list, not a.mdfile) still has Wrangler/CLOUDFLARE_ENVD1-era section headers — flagged by an earlier partition, out of scope for this prose-only pass.eslint.config.mjs's "Logger and migration overrides" comment now accurately describes a glob that matches zero files (logger.tsis now a folder, migrations live insrc/migrations/plural) — the comment was fixed, the stale glob itself is a code change out of scope here.docs/rules/*.mdfiles landed above their target char counts (admin-ui,api-clients,email,endpoints,openapi,storage) — all load-bearing security/wire-contract reference docs where further cuts would remove real facts rather than compress wording.Co-Authored-By: Claude Opus 5 (1M context) [email protected]