Skip to content

docs(admin-ui): the frames rule names a publishAt field that is gone - #905

Merged
sydevs-bot merged 3 commits into
mainfrom
claude/docs-901-frames-gate
Oct 10, 2026
Merged

sydevs-bot merged 3 commits into
mainfrom
claude/docs-901-frames-gate

Conversation

@sydevs-bot

Copy link
Copy Markdown
Contributor

Summary

Change outline

Contract — docs/rules/admin-ui.md § Frame editor

The paragraph is a path-scoped rule loading on every src/components/admin/**/*.tsx read, so each line here is an instruction to the next session that edits the frame editor. One rule per line:

-timestamps are non-negative integers, rounded on save
+timestamps are non-negative and finite; stored as given, rounded by `afterRead`
-no duplicate timestamps
+duplicate timestamps are allowed, and one frame may appear at several times
-at least one frame is required when audio exists, on update
+at least one frame is required on update, whatever the audio
-frames are required to set `publishAt`
+(gone — the update-only rule above is what refuses a publish)
+whole numbers, no duplicates and the 1-hour cap are `validateTimestamp`'s, editor-side only
-helpers: formatTime, parseTime, validateTimestamp, getCategoryLabel
+helpers: formatTime, parseTime, validateTimestamp, getFrameDisplayLabel

Contract — seeds/wemeditate/AGENTS.md § Pages

-`*_translations.published_at` → `pages.publishAt`  | Date
+`*_translations.published_at` → `pages._status`    | A flag, not a date. Any locale's value publishes `en`; other locales are written as drafts

Preview

Documentation only — the diff touches no runtime surface, so there is nothing in the PR preview to open.

Test results

  • Lean gate: ✓ .claude/skills/pr-prep/check.sh — lint, typecheck (src), typecheck (tests), 2293 unit tests in 175 files
  • Targeted specs: tests/int/meditationFrames.int.spec.ts — 24 passed
  • Build: N/A

Manual verification

  1. git grep -n publishAt returns nothing outside tests/int/available-locales.int.spec.ts, where the hits are the local helper publishAtlasLocale. The ticket's grep -rn 'publishAt' docs/ src/ would not have shown those — a repo-wide grep does, so match on a word boundary if you re-run it.
  2. git grep -n getCategoryLabel returns nothing.
  3. Each rewritten claim is asserted by an existing spec: meditationFrames.int.spec.ts:236 ("allows duplicate timestamps"), :254 (one frame at two times), :88 (negative timestamps filtered, not refused), :432 (publish refused without frames).

Notes for reviewer

The ticket's premise did not hold, and that is most of this diff. It scoped the fix to the publishAt clause and recorded the rest of the sentence as correct. Four of the remaining claims disagreed with the code, each in the same direction — attributing an editor-side rule to the collection. validateTimestamp is imported only by FrameListManager, so none of its three rules has ever applied to a write that did not come through the editor. I rewrote the sentence to separate the two layers rather than patch the one clause, which is what acceptance criterion 2 asks for.

getCategoryLabel, cited in that same sentence, exists nowhere — a sixth instance of #867's class, sitting beside the fifth. It was renamed getFrameDisplayLabel; the call sites still assign it to a categoryLabel local, which is what makes the rename legible.

The ticket's grep missed a second publishAt. seeds/wemeditate/AGENTS.md:58 mapped it as a Pages field. Same removed field, same class, one line, and inside prAllowlistGlobs — so it is fixed here rather than filed.

Filed, not fixed: #904. Correcting that mapping row meant reading the importer, which decides one publish state from every locale's published_at and applies it to en, then publishes no other locale (updateLocales passes publishSpecificLocale with no _status, which this repo's own seeds/AGENTS.md says leaves the locale a draft). A page live only in French upstream imports as English-published. That is a behaviour change across four updateLocales callers and may be intended, so it wants a decision rather than a drive-by.

Detail

On the guard the ticket asks about. The ticket proposes deciding here whether to build what #867 declined, rather than meet a sixth instance of this class. #867's guard (tests/unit/doc-citations.spec.ts) resolves cited paths. publishAt and getCategoryLabel are identifiers, which it cannot see. So the question is whether an identifier guard is viable.

Measured, not estimated. Over the 36 in-scope docs, taking every backticked lowerCamelCase token outside a fenced block:

Anchor Identifiers Absent from it
src/ only 480 73
all first-party code and config (1042 files: src, tests, seeds, scripts, root configs, .github/) 480 32

Of the 32 survivors, two are the defects this PR fixes. The rest are correct prose naming something that is not ours to own: Payload internals (deleteByID, appendNonTrashedFilter, replaceWithDraftIfAvailable, reduceFieldsToValues, commitTransaction, and eight more under docs/rules/access.md), Next.js route config (generateStaticParams, dynamicParams, fetchCache, preferredRegion), Vitest (setupFiles), JSON Schema (anyOf), Node (unhandledRejection), a workflow.json key (worktreeSetup), and one deliberate historical reference two lines above the sentence this PR fixes (useLivePreviewAuto, naming what previewTargetField replaced).

So the obvious shape is not worth building: roughly one real finding per thirty rows, and suppressing the rest needs exactly the allowlist #867 refused. A narrower resolver — per-doc scope, or a real symbol table — is a different and much larger piece of work than the path guard was, and it would still have to classify "names a third-party API" against "names ours".

What is cheap and does help is #867's own third follow-up, still unbuilt: .claude/hooks/unit-test.mjs gates the Tier-1 lane on src/** and tests/unit/**, so editing a .md — the only act that can break a citation — fires nothing today. Adding .md to that matcher makes the existing path guard run when it can actually catch something, at ~1.5s. It closes nothing for identifiers, and I have not done it here: it is a .claude/ write, which this run cannot make.

Review. No pr-review-toolkit on this account (ListPlugins → empty), so the pass was /code-review high plus /simplify. It raised one finding — that my first version of the published_at row ("Presence publishes that locale") misstated the importer — which held up against BaseImporter.ts:1084-1096 and is fixed in its own commit. comment-lint.mjs --base origin/main reports 0 changed files, since the diff adds no code comments.

No security review. securityReview.triggerPattern from .claude/workflow.json matches neither changed path.

No line numbers in the new prose. docs/rules/code-comments.md forbids pointing at a moving target, and the surrounding section already names src/components/admin/FrameEditor/, so the rewrite cites the validator and the hooks by name instead.

Closes #901

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

🤖 Generated with Claude Code

https://claude.ai/code/session_017RanUBFbuBJmZkJ1YLyPfm


Generated by Claude Code

claude added 2 commits October 9, 2026 22:50
`publishAt` was replaced by Payload drafts in #124 and exists nowhere in
`src/`. The frames paragraph is a path-scoped rule loading on every
`src/components/admin/**/*.tsx` read, so the claim was injected into
sessions editing the code it describes.

The ticket scoped this to that one clause and recorded the rest of the
sentence as correct. It was not. Four of its claims disagreed with the
code, all in the same direction: they credited the collection with gates
that only the editor applies.

- Duplicate timestamps are allowed at the collection level.
  `meditationFrames.int.spec.ts` asserts it outright ("allows duplicate
  timestamps"), and so is one frame repeated at several times.
- Timestamps are not stored as integers. Any finite non-negative number
  persists; `afterRead` rounds on read, not `beforeChange` on save.
- A negative timestamp is dropped silently by the normalizer, not
  refused with an error.
- "when audio exists" has no counterpart in the validator, which reads
  only the frame count.

So the paragraph now separates the two layers instead of merging them:
the collection errors once, on update, which is what refuses a publish
with no frames; the whole-number, no-duplicate and one-hour rules are
`validateTimestamp`'s, in the editor alone.

Two further stale names, both the same class:

- `getCategoryLabel` is cited in that sentence and exists nowhere. It
  was renamed `getFrameDisplayLabel` — the call sites still assign it to
  a `categoryLabel` local.
- `seeds/wemeditate/AGENTS.md` mapped `published_at` to
  `pages.publishAt`. The importer reads it as a boolean and writes
  `_status` per locale; the date itself is never stored. The ticket's
  grep covered `docs/` and `src/`, so it could not see this one.

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

The first version of this row claimed presence of `published_at`
publishes that locale. It does not. `updateLocales` passes
`publishSpecificLocale` with no `_status` in `data`, and this repo's own
`seeds/AGENTS.md` records that such a write lands with the locale still
`draft`. The base write sets `_status` from `translations.some(...)` at
`locale: 'en'`, so any locale's flag publishes English and no other
locale is ever published.

Whether the importer should behave that way is filed separately; this
row now says what it does.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017RanUBFbuBJmZkJ1YLyPfm
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-905 October 9, 2026 23:00 Destroyed
@railway-app

railway-app Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

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

Service Status Web Updated
SahajCloud ✅ Success (View Logs) Web Oct 10, 2026 at 2:00 am UTC
1 service not affected by this PR
  • mailpit

@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Adversarial review skipped: 2 file(s), 4 changed line(s), under review.skipWhen. Say @sydevs-bot review to force one.

🤖 sydevs dispatcher

@sydevs-bot
sydevs-bot added this pull request to the merge queue Oct 10, 2026
Merged via the queue into main with commit 9c851ce Oct 10, 2026
16 checks passed
@sydevs-bot
sydevs-bot deleted the claude/docs-901-frames-gate branch October 10, 2026 17:25

This branch was successfully deployed

No deployments
sahajcloud / SahajCloud-pr-905 — 530b7740 Deployed Oct 10, 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.

fix(seeds): the page import publishes en from any locale's published_at docs(admin-ui): the frames rule names a publishAt field that is gone

3 participants