Skip to content

fix(app-status): report a configured page that is trashed or unset - #1255

Merged
Ardnived merged 7 commits into
mainfrom
claude/fix-1252-app-config-dangling-pages
Nov 24, 2026
Merged

Ardnived merged 7 commits into
mainfrom
claude/fix-1252-app-config-dangling-pages

Conversation

@Ardnived

@Ardnived Ardnived commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • The Sahaja Yoga card had nothing to open: page 6 (sahaja-yoga) had never been published. It is now published in 14 locales in production; no code was needed for that.
  • The App Status Pages report dropped any configured page it could not find (a trashed page, or a slot emptied when its page was deleted). It now keeps a failing row for each.
  • The App Configuration section reported a trashed self-realization meditation as set and published. It now fails the row and names the id it holds.
  • Joined, comment-only: the comment beside SubtleSystemNodes.slug's update: () => false described a Vimeo URL, copied from another collection.

Change outline

Flow — pagesSection.prepare

Rows are built from the configured slots rather than from the pages the query returned, so a slot with no page behind it still gets a row.

 pagesSection.prepare                              src/globals/WeMeditateAppStatus/sections/pages.ts
   getWmAppConfig(locale, depth 0)
-  find subtle-system-nodes, depth 1, select { page }   # a populate cannot exclude the trash
+  find subtle-system-nodes, depth 0, select { slug, page }
-  corePageIds = APP_REQUIRED_PAGE_FIELDS → refId
+  coreSlots = APP_PAGE_FIELDS → { id, key: field name, label: admin label }
+  nodeSlots = nodes → { id, key: node:<slug>, label: Node <slug> }
   find pages where id in allIds (trashed pages excluded by default)
-  reportForPage(id): page not found → null, row dropped
+  reportForSlot(slot)
+    page found   → id, page title, published / content-localized as before
+    page missing → id "missing:<key>", label "<slot> — page N not found" | "<slot> — not set",
+                   every check failing

Behaviour — where a missing core row links

A string id already means "link to the group's global". core-pages now names wm-app-config there, so a missing slot opens the config where it is fixed; a found page still opens the page.

 WeMeditateAppStatusSpec.groupGlobalMap            src/globals/WeMeditateAppStatus/WeMeditateAppStatus.ts
   'vibe-check-tracks': 'wm-app-config',
+  'core-pages': 'wm-app-config',

Flow — appConfigSection.prepare

A populate carries a trashed document whole, _status included, so the slot read as ready. One read per slot that excludes the trash decides the row instead.

 appConfigSection.prepare                          src/globals/WeMeditateAppStatus/sections/appConfig.ts
   getWmAppConfig(locale, depth 1)
+  find meditations / lectures where id equals the ref   # trashed rows excluded by default
-  relationship-set = refId(ref) !== null
+  relationship-set = the ref resolves to a live document
-  label = labelOf(ref) | "Not set"
+  label = labelOf(ref) | "<Noun> N not found" | "Not set"
+  id    = ref id | "missing:<field>" | "unset"

Preview

No preview surface. The change is in src/globals/WeMeditateAppStatus/, and the fixture sets no wm-app-config, so every core slot on a preview reads "not set".

Test results

  • Lean gate: ✓ lint, format, typecheck, test-suite typecheck, unit lane (292 files, 3894 tests)
  • Targeted specs: wemeditateAppStatus.int.spec.ts 27 passed; wm-app-config.int.spec.ts passed; pages.int.spec.ts 20 passed
  • The pages case fails against main's pages.ts (expected undefined to be 'Sahaja Yoga Page — page 4 not found')
  • The app-config case fails against this branch's parent (expected 8 to be 'missing:selfRealizationMeditation')
  • Build: N/A (CI and Railway)

Manual verification

  1. On production, as an API client: GET /api/globals/wm-app-config?depth=0&select[sahajaYogaPage]=true names 6, and GET /api/pages/6?depth=0&select[slug]=true&select[webUrl]=true returns 200 with webUrl: https://wemeditate.com/sahaja-yoga (checked 2026-11-23, also for shriMatajiPage 4, explorePage 93 and subtleSystemPage 5).
  2. On the preview: open the WeMeditate App Status global, Pages section. Trash a page that a subtle-system node uses and check its row reads Node <slug> — page N not found.

Notes for reviewer

  • Title shifted from the issue's. The issue's own fix was a data write, already done; this PR carries the report half.
  • The draft case was already reported. Before this PR, Pages → Core app pages showed "About Sahaja Yoga" failing Published. A trashed page was what disappeared.
  • Follow-up, not in this PR: lessons.ts reads lessons at depth 0, so intro-audio-set, meditation-set and icon-set pass when the target file or meditation is in the trash.
  • Dismissed findings:
    • A node's missing row is labelled by slug (Node pingala), not its display name (Right Channel). The label helper lives in src/components/admin/FrameEditor/utils.ts, and moving it into src/lib/subtleSystem touches admin components for an edge-case label.
    • A node's missing row still links to the pages list. The node record is in another collection, and the group links only to pages.
    • "exists relies on the query excluding trashed pages." The new case pins that: it trashes a page and asserts the row.
    • "The nodes query lacks fallbackLocale: false." subtle-system-nodes.page is not localized.
Detail

The production write (2026-11-23). Page 6 was imported on 2026-01-23 and had three versions, all drafts, in every locale. Fourteen locales hold about 9–10 KB of content each; Spanish has a title and empty content. It was published through the Local API from a checkout of the deployed commit (dd876a03), one locale at a time with publishSpecificLocale (never all locales), as the admin manager with currentProject: null. After each step, every locale's title and content were compared with the backup (key-order-insensitive), and each matched. Spanish stays a draft. The main row and its latest version were backed up first.

Why the exists check was dropped during review. It added a column that is green on every healthy row. A missing page already fails both checks, and its label says which case it is.

Why depth 0 on the nodes read. Only the id is used, so the population was wasted work — and it could not have answered the question either. Measured on this branch: at depth 1 Payload populates a trashed page whole, _status and all, so a populate never tells a live reference from a dangling one. What excludes the trash is the pages find below it, which is why the row is decided there. The same measurement is why appConfig.ts needed its own read rather than a depth change.

Closes #1252

🤖 Generated with Claude Code

Ardnived and others added 3 commits November 23, 2026 15:26
The Pages section dropped a wm-app-config slot whose page it could not find,
so a page trashed after the config named it (`required` is only checked on
save) disappeared from the report while no client could read it. Such a slot
now gets a failing row with a new `exists` check, labelled by slot name.

Refs #1252

Co-Authored-By: Claude Opus 5.5 <[email protected]>
One row shape for found and missing pages, slots labelled as the admin
labels them, the nodes read at depth 0 (a trashed node page was populated
to null and misread as unset), and a string id for a missing row so it no
longer links to a document that will not open.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…sts column

Review findings: a missing row's string id fell back to the pages list, the
always-green exists column added nothing the label and failing checks did not
say, and the row id embedded a label that a rename would change. Covers a
trashed node page too.

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

railway-app Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

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

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

@sydevs-dispatcher

sydevs-dispatcher Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

🤖 no session running

recent dispatches
  • 23:10Z address-review · attempt 1 · session · done
  • 23:10Z address-review · attempt 1 · session
  • 22:58Z review-pr · attempt 1 · session · done
  • 22:58Z review-pr · attempt 1 · session

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

@Ardnived
Ardnived enabled auto-merge November 23, 2026 22:55
@sydevs-dispatcher sydevs-dispatcher Bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 23, 2026
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Pending to Working in SYDevelopers Technical Roadmap Nov 23, 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 diff is the right size for #1252's second criterion, and the shape is right: building rows from the configured slots rather than from the query's results is what makes a dangling slot reportable at all. Nothing is smuggled and no contract surface is touched.

The one shape-level question is reach. The PR learns that a depth-1 read nulls a trashed ref, acts on it for the nodes query, and leaves appConfig.ts — same directory, same global, same getWmAppConfig — reading at depth 1 with the same mislabel.

Findings

  • should-fix — appConfig.ts's two slot rows still mislabel a trashed ref as Not set → sections/pages.ts:71
  • should-fix — Streamline: APP_REQUIRED_PAGE_FIELDS is a second export of one list, and "REQUIRED" names no subset → WeMeditateAppConfig.ts:22
  • should-fix — lib/status/types.ts:18 still scopes sentinel ids to single-row groups → sections/pages.ts:37
  • Not this PR: SubtleSystemNodes.ts:32 comments the slug access override "Vimeo URL is immutable after creation".

What was checked

Read whole on the branch: both touched globals, sections/{appConfig,shared}.ts, five lib/status/ modules, ReadinessGroup.tsx, SubtleSystemNodes.ts.

  • The outline's link claim holds: resolveLink tests typeof id === 'number' before the group's global, so a found page still opens at /admin/collections/pages/<id> and only a sentinel reaches wm-app-config (ReadinessGroup.tsx:200-209). subtle-system-pages names no global, so its sentinels fall to the pages list — dismissal accepted.
  • page?._status and richTextHasContent(undefined) both yield false, so a missing row fails every check as claimed.
  • Preview: the diff touches no fixture.surfacePaths and no fixture sets wm-app-config, so "No preview surface" holds.
  • Streamliner: 3 pieces covered, 2 kept, 1 posted.

🤖 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 23, 2026
@sydevs-dispatcher sydevs-dispatcher Bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 23, 2026
Payload populates a trashed document whole, `_status` included, so the
self-realization meditation row reported a meditation no app client can read
as set and published. A read that excludes the trash decides the row now, and
a slot nothing resolves to fails every check and names the id it holds.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjZ1gjy2a6pKJ8sukEL
`core-pages` mints one across 14 rows and `subtle-system-pages` across 12, so
the parenthetical described a rule the code no longer follows.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjZ1gjy2a6pKJ8sukEL
`APP_REQUIRED_PAGE_FIELDS` was `APP_PAGE_FIELDS.map((p) => p.name)`, and the
field factory marks every entry required, so "REQUIRED" named a subset that
does not exist. Its four call sites read `.name` instead.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjZ1gjy2a6pKJ8sukEL
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-1255 November 23, 2026 23:26 Destroyed
The comment beside `update: () => false` described a Vimeo URL, copied from
another collection. A migration seeds exactly these twelve rows and every
consumer joins on the slug, which is why it cannot be re-pointed.

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

Copy link
Copy Markdown
Contributor

Three threads addressed, all adopted. Pushed 9a1e703.

Joined, comment-only: SubtleSystemNodes.slug carried a comment about a Vimeo URL (9a1e703).

The body's "Why depth 0 on the nodes read" claimed a populate nulls a trashed target. Corrected there.

Lean gate green; wemeditateAppStatus 27, wm-app-config, pages 20 passed.

🤖 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 23, 2026
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Working to Pending in SYDevelopers Technical Roadmap Nov 23, 2026

@sydevs-dispatcher sydevs-dispatcher Bot left a comment

Copy link
Copy Markdown

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. 🤖 Written by the sydevs autonomous loop — see what this is

@Ardnived
Ardnived added this pull request to the merge queue Nov 23, 2026
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Pending to Awaiting in SYDevelopers Technical Roadmap Nov 23, 2026
Merged via the queue into main with commit 8d45a5a Nov 24, 2026
24 checks passed
@Ardnived
Ardnived deleted the claude/fix-1252-app-config-dangling-pages branch November 24, 2026 00:02
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Awaiting to Done in SYDevelopers Technical Roadmap Nov 24, 2026
sydevs-bot pushed a commit that referenced this pull request Nov 24, 2026
All three conflicts come from #1255, which reports a wm-app-config slot whose
page is trashed or unset.

- `Pages.ts`: #1255 renamed `APP_REQUIRED_PAGE_FIELDS` to `APP_PAGE_FIELDS` in
  the `appUrl` gate this branch deletes, so the branch's `isPagePlaced` clause
  stands and the import goes with it. The rename survives where it is read.
- `WeMeditateAppConfig.ts`: both exports. #1255 dropped
  `APP_REQUIRED_PAGE_FIELDS` because every slot was required, and
  `liveMeditationsReminderPage` makes the subset real again. `APP_PAGE_FIELDS`
  keeps the export #1255 gave it — the status report reads it.
- `wm-app-config.int.spec.ts`: both assertions. The Pages tab now holds a
  `pageTags` select beside the slots, so #1255's unfiltered count no longer
  matches; it is filtered to relationships and keeps its meaning. The branch's
  required-subset assertion stands beside it.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjWUDqgxsj1zo6Ki8KF
sydevs-bot pushed a commit that referenced this pull request Nov 24, 2026
#1255 fails any wm-app-config slot it cannot resolve, on the premise that
every slot is one a released build has no fallback for. This branch adds
`liveMeditationsReminderPage`, which released builds find by slug, so the
merged report turned red on a slot nobody is required to fill.

Only an unset optional slot is skipped. One naming a trashed or deleted page
still fails every check, which is the case #1255 exists for.

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

This branch was successfully deployed

No deployments
sahajcloud / SahajCloud-pr-1255 — 9a1e7035 Deployed Nov 23, 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(wm-app-config): sahajaYogaPage points at a page no client can read

3 participants