Repository navigation
chore(contracts): re-sync copied contracts from SahajCloud - #342
Conversation
|
🤖 no session running recent dispatchesWritten by the sydevs dispatcher. Sessions never edit this comment. |
`pnpm run types:cms` added `user-choices` to `ContentIndexBlock['type']`, plus `userChoiceTypeFilters` and `userChoiceFeatured`. An exact type-equality test guards the hand-written mirror in `lib/content/blocks.ts`, so typecheck failed until it restates them. A user choice has no web route here, so every card resolved from one would drop and the grid would render nothing. `fetchContentIndexDocs` degrades before spending the read, and `QUERY_BY_TYPE` excludes that one key so a future added type still breaks the exhaustive map. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXpXkLCVv99DXJQoEs
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
A contract re-sync, and the diff is the right size for one. types/payload/payload-types.ts is byte-identical to SahajCloud main run through scripts/strip-payload-augmentation.mjs, so the no-hand-edits claim holds. Both adaptations are forced rather than chosen, and the degrade is real: cardHref answers null for an unrouted type, so a user-choices block renders nothing and contributes no ItemList rung. One shape question is worth your eye — the hand-written mirror is the only reason a pure types sync went red and needed a second commit.
Findings
should-fix— deriveContentIndexBlockFieldsfrom the generatedContentIndexBlockinstead of restating it.lib/content/blocks.ts:69, inline.consider— the body credits #1254, but #1254 addedPage.parent,Page.pathandWmWebConfig.indexPages; theuser-choicesindex type it adapts to came from a different merge. Name both producers, and #333 as the nesting consumer. No hunk to anchor.
What was checked
- Read whole:
lib/content/blocks.ts,server/content-index.ts,lib/content/blocks.test.ts, and the consumer side —blockConverters.tsx(items.length === 0rendersnull) andcontent-seo.ts. new-pieces.mjs:NONE, the generated file its only skip, so no streamliner ran and no dependency was added.- Grepped
indexPages,Page.parentandPage.path: no consumer. Correct — #333 claims all three, and liststypes:cmsas its own step, which this sync satisfies early. - Whole-file pass on both touched files. Two things held:
stripQueryParamstays hand-rolled becauseURLSearchParamswould percent-encodewhere[id][in], andblockConverters.tsx:350's dispatch comment needs no fifth case — theshortcut:atcontent-index.ts:131states it once already. - No prior review, and no question thread to second.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
`ContentIndexBlockFields` restated every stored field of the generated `ContentIndexBlock`, so each field `pnpm types:cms` adds needs a hand edit here before any reader sees it — the second commit on this PR was exactly that edit. Deriving it with `Omit` makes the two new `user-choices` filter fields and the union member arrive for free. The `shortcut:` marker named #293 as the blocker. It is not one: the generated interface is exported today, so the derivation compiles now. `blocks.test.ts`'s type equality assertion goes with it. It proved the mirror matched; the mirror is gone. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWwKkRTjDFL8ppKTVM
|
Addressed the adversarial review. Pushed 5f7d9b3. Lean gate green: lint, Adopted — Adopted — the The body also claimed the hand-written mirror and 1793 tests. Refreshed both, and noted that #293 touches the same hunk and will conflict there. No merge needed: the branch is level with 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
|
Not approved automatically: it changes more than the copied contract. It needs a person's review. 🤖 sydevs dispatcher |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
wemeditate-web | e3bf5df | Commit Preview URL Branch Preview URL |
Nov 25 2026, 07:22 PM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
wemeditate-design | 5f7d9b3 | Commit Preview URL Branch Preview URL |
Nov 25 2026, 07:38 PM |
#342 landed the same two files from the other side: it re-synced the copied payload types and, with no resolver for the new `user-choices` index type, added a stopgap that emptied the block. `types/payload/payload-types.ts` takes main's copy whole. It is the newer `pnpm types:cms` output — SahajCloud #1268 against this branch's #1259 — and carries every field this branch reads, so re-running the command here would only reproduce it. `server/content-index.ts` keeps this branch's resolver and drops main's stopgap. The two cannot both stand: the early return in `fetchContentIndexDocs` empties the read the mood resolver is built on, and `Exclude<…, 'user-choices'>` on `QUERY_BY_TYPE` refuses the entry that performs it. The stopgap's own limit — an empty index until a user choice renders — is what this branch lifts: a mood tile resolves to a meditation href, never to a card through `contentIndexCard`, so nothing drops. `lib/content/blocks.ts` keeps this branch's `interface … extends Omit<…>`. Both sides derived `ContentIndexBlockFields` from the generated block in the same commit window; only the spelling differed, and this one holds `ResolvedMood` and the two `resolved*` fields the picker attaches. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYj4chcqF9CeraaTYq
Two conflicts, both where #342's contract re-sync landed on this branch's own edits to the same declarations. lib/content/blocks.ts — `ContentIndexBlockFields` takes main's derived form, `Omit<ContentIndexBlock, 'id' | 'blockName' | 'blockType'>`. The hand-written mirror this branch still carried was a `shortcut:` waiting on the generated block type, and main has since cashed it in. The three meditation types and `resolvedLibrary` stay as this branch has them. server/content-index.ts — `QUERY_BY_TYPE` keeps main's exhaustive keying, `Exclude<…, 'user-choices'>`, so a type the next re-sync adds fails the build rather than resolving to nothing. It also keeps this branch's runtime degrade: a block's fields are cast out of a lexical tree, so `type` is whatever SahajCloud sent, and a deploy one behind the schema must render an empty region rather than 500 the page. The widened annotation on the lookup is what lets both hold at once. main's `user-choices` early return now answers `{ docs: [] }`, the shape this branch gave `fetchContentIndexDocs`. `return []` merged clean and would not have compiled. Lean gate: lint, tsc --noEmit, 176 files / 1836 tests, all green. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYRNEwHS3ELjbpZsL7
Summary
Page.parent,Page.pathandWmWebConfig.indexPages, and feat(richEditor): a user-choices content index, filtered by type and featured SahajCloud#1259 added theuser-choicescontent-index type with its two filter fields. feat(server): serve pages at nested paths with breadcrumbs #333 is the consumer of the nesting half; nothing reads it yet.types/payload/payload-types.tsis produced bypnpm run types:cmsonmain, with no hand edits.lib/content/blocks.tsnow derivesContentIndexBlockFieldsfrom the generatedContentIndexBlockinstead of mirroring its fields by hand, so the new type and both filter fields arrive without an edit here, andserver/content-index.tsleaves that type's list empty until a user choice has a web route.Test results
tsc --noEmit, 1792 tests. One test fewer thanmain: the type-equality assertion that guarded the hand-written mirror went with the mirror.Notes for reviewer
Opened by the dispatcher contract sync (
contractSyncin sydevs/claude-workflowloop-config.json), not from a ticket. A later producer merge adds its commit here while this PR is open.A
user-choicescontent-index block renders nothing today:lib/urls/document-routes.tshas no route for a user choice, so every card resolved from one would drop. The block degrades before spending the read, marked with ashortcut:line atserver/content-index.ts:131. Giving that type a real grid needs a product decision about where a user choice links to.The
shortcut:that heldContentIndexBlockFieldshand-written "until #293 lands" is gone. #293 was never the blocker — the generated interface is exported today. #293 also toucheslib/content/blocks.ts, so it will conflict in that hunk.