Skip to content

docs: prose reset — STE register, legacy debris removed - #696

Merged
Ardnived merged 1 commit into
mainfrom
claude/prose-reset
Sep 5, 2026
Merged

Ardnived merged 1 commit into
mainfrom
claude/prose-reset

Conversation

@Ardnived

@Ardnived Ardnived commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Headline numbers

  • Tracked *.md repo-wide (excluding CLAUDE.md symlinks and the untouched vendored .agents/skills/payload/ skill): 770,090 → 600,797 chars (22% smaller).
  • Hot path — files loaded every session (AGENTS.md, docs/architecture.md, docs/environment.md, docs/code-style.md, .claude/workflow.json): 84,492 → 36,397 chars (57% smaller).
  • 227 files changed: 5,838 insertions(+), 9,631 deletions(-).

What was deleted

  • seed-issues-report.md — dead 2026-01-24 report naming the retired D1_ERROR term. Grepped clean, zero referrers.
  • src/migrations/README.md — its one fact folded into src/migrations/AGENTS.md before deletion. Grepped clean, zero referrers.

What was merged

DEPLOYMENT.md + RAILWAY_RUNBOOK.md split by lifecycle: DEPLOYMENT.md is how it runs today (infra, the Cache Rule trap, env vars, troubleshooting), RAILWAY_RUNBOOK.md is provision-from-scratch + disaster recovery. This resolved a direct contradiction — DEPLOYMENT.md still listed "Decommission the Cloudflare Worker + D1 / Merge PR #468" as an open TODO while RAILWAY_RUNBOOK.md already stated it was done three times. Confirmed via gh 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 a remote = true binding that doesn't exist). Cross-checked against src/migrations/AGENTS.md for 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 own FUNC_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 — stale cd sy-devs-cms (a pre-rename repo name) corrected to cd SahajCloud. Confirmed via gh pr view 468 → https://github.com/sydevs/SahajCloud.
  • Verification grep for D1/SQLite/Cloudflare Workers across .claude/agents/, seeds/wemeditate/, src/globals/, docs/mcp-setup.md (.md/.ts files, excluding data JSON) — clean, zero hits.

Mandatory AGENTS.md fixes

  • Dropped the nonexistent pnpm test:e2e from the command list (only test:smoke is e2e-shaped; .claude/settings.json still has a dead permission entry for the removed script, left untouched per its own "no prose" disposition — flagging for a follow-up).
  • Replaced the broken .claude/skills/dev-server/dev-server.sh path with the /workflow:dev-server plugin skill.
  • Fixed the broken anchor at seeds/atlas/MIGRATION_PLAN.md:103 — now correctly resolves to AGENTS.md#website-selection-rules-584 (the real heading is ### `website` selection rules (#584)).
  • Collapsed AGENTS.md's two inline restatements of the three-tier test contract into pointers to docs/rules/testing-reqs.md (the canonical home, which keeps the full rationale). Same for workflow.json's leanGate text.
  • Collapsed the PR-ship-pipeline duplication (AGENTS.md was stale, pointing at /code-review when the real step is /pr-review-toolkit:review-pr all) to a single pointer at claude-workflow's finalize-pr skill.

Traps preserved (compressed, never deleted)

  • Conflicted PR runs zero CI — docs/why.md#a-conflicted-pr-schedules-zero-ci-runs anchor and the #632/#653 incident numbers kept verbatim.
  • Cache Rule authorization-header predicate + the "add one eq term to the same rule" root-endpoint fix (DEPLOYMENT.md).
  • DB_QUERY_LOGGING (logs bound SQL params — emails, tokens, keys) and TURNSTILE_SECRET_KEY fail-closed footguns (DEPLOYMENT.md).
  • docs/rules/storage.md preview/prod asset-isolation risk.
  • payload-cli silent-exit-0 / hang escalation ladder (payload-cli SKILL.md + migrations/AGENTS.md).
  • Migration snapshot out-of-order duplicate-re-emission trap (src/migrations/AGENTS.md, migration-reviewer.md).
  • docs/rules/access.md per-locale-roles gotcha (#665, flat req.user.roles).
  • docs/rules/endpoints.md root-endpoint beforeOperation-hook gap.
  • docs/rules/email.md two-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 field locales.
  • AGENTS.md's dated PREVIEW_ADMIN_PASSWORD exception (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 full tests/, seeds/, scripts/, .claude/ hooks-and-skills, root-config, and .github/workflows sweep — 227 files total across this PR. Deleted a dead sharp import 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/.py files, every changed line's code portion (before the comment marker) is byte-identical to main. Zero functional changes anywhere in this diff.

Gates run

Gate Result
.claude/skills/pr-prep/check.sh (Tier-2 lean gate: lint + typecheck + typecheck:tests + unit) ✅ pass
pnpm lint ✅ pass
pnpm typecheck && pnpm typecheck:tests ✅ pass
Unit lane ✅ 1564/1564 pass
Targeted integration specs (events, regions, role-based-access — touched collections/access path) ✅ 79/79 pass, live Postgres
.claude/workflow.json still parses as JSON after $comment/prose edits ✅
ste-lint.py on all 40 changed .md files 118 hard violations remain (down from 169 before this finishing pass), concentrated in 5 already-dense reference docs (admin-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 methods GET/DELETE/ALTER, SQL "cascade delete", TS "type erasure", the /tokens/verify API path) or residual long sentences in those 5 dense files.
rule-delta.mjs vs main on AGENTS.md + docs/rules/*.md + migration-reviewer.md 3 directives flagged REMOVED — all 3 verified as de-bolded, not deleted: "GET /api/events/geojson always 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 run pnpm test and pnpm build at 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 in main. No actual directive was dropped.
Anchor check: seeds/atlas/MIGRATION_PLAN.md:103 → AGENTS.md#website-selection-rules-584 ✅ resolves
Stale-claim grep (D1/SQLite/Cloudflare Workers) ✅ clean
pnpm test:e2e / dev-server/dev-server.sh grep in AGENTS.md ✅ empty (removed)
Never-touch diff (payload-types.ts, both responseTypes.ts, pnpm-lock.yaml, src/migrations/*.ts, CHANGELOG.md, LICENSE) ✅ byte-identical / untouched
Changed SKILL.md frontmatter (migration-validator, payload-cli) ✅ still parses
Sequencing: PRs #692/#686/#691 ✅ resolved — #692 merged 2026-09-05 and already an ancestor of this branch; #686 and #691 closed without merging. No conflict risk remains.
securityReview trigger paths (src/plugins/access/, src/plugins/storage/, src/app/**/api/, webhook scripts) ✅ confirmed comment-only in every matching file

Known residue / follow-ups (not fixed here, flagging per the audit's own disposition)

  • .claude/settings.json still carries a dead permission entry for the removed test:e2e script — left untouched per its "pure allowlist, zero prose" disposition.
  • .env.example (not in the audit's file list, not a .md file) still has Wrangler/CLOUDFLARE_ENV D1-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.ts is now a folder, migrations live in src/migrations/ plural) — the comment was fixed, the stale glob itself is a code change out of scope here.
  • Six docs/rules/*.md files 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]

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]>
@railway-app

railway-app Bot commented Sep 5, 2026 •

Copy link
Copy Markdown

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

Service Status Web Updated
SahajCloud ✅ Success (View Logs) Sep 5, 2026 at 7:27 am UTC
1 service not affected by this PR
  • mailpit

@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-696 September 5, 2026 07:25 Destroyed
@Ardnived
Ardnived merged commit 2e1a5a3 into main Sep 5, 2026
3 checks passed
@Ardnived
Ardnived deleted the claude/prose-reset branch September 5, 2026 07:51
@github-project-automation github-project-automation Bot moved this from In progress to Done in SYDevelopers Technical Roadmap Sep 5, 2026
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]>
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

No deployments
sahajcloud / SahajCloud-pr-696 — 02062f69 Deployed Sep 5, 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.

1 participant