Skip to content

chore(contracts): re-sync copied contracts from SahajCloud - #342

Merged
sydevs-dispatcher[bot] merged 4 commits into
mainfrom
claude/chore-sync-contracts
Nov 25, 2026
Merged

sydevs-dispatcher[bot] merged 4 commits into
mainfrom
claude/chore-sync-contracts

Conversation

@sydevs-dispatcher

@sydevs-dispatcher sydevs-dispatcher Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Test results

  • Lean gate green locally: lint, tsc --noEmit, 1792 tests. One test fewer than main: the type-equality assertion that guarded the hand-written mirror went with the mirror.
  • CI runs on this PR, and the adversarial review then reads it.

Notes for reviewer

Opened by the dispatcher contract sync (contractSync in sydevs/claude-workflow loop-config.json), not from a ticket. A later producer merge adds its commit here while this PR is open.

A user-choices content-index block renders nothing today: lib/urls/document-routes.ts has no route for a user choice, so every card resolved from one would drop. The block degrades before spending the read, marked with a shortcut: line at server/content-index.ts:131. Giving that type a real grid needs a product decision about where a user choice links to.

The shortcut: that held ContentIndexBlockFields hand-written "until #293 lands" is gone. #293 was never the blocker — the generated interface is exported today. #293 also touches lib/content/blocks.ts, so it will conflict in that hunk.

@sydevs-dispatcher

sydevs-dispatcher Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 no session running
CI fix 1

recent dispatches
  • 19:32Z address-review · attempt 1 · session · done
  • 19:32Z address-review · attempt 1 · session
  • 19:24Z review-pr · attempt 1 · session · done
  • 19:24Z review-pr · attempt 1 · session
  • 19:17Z fix-ci · attempt 1 · session · done

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

@sydevs-dispatcher sydevs-dispatcher Bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 25, 2026
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Pending to Working in SYDevelopers Technical Roadmap Nov 25, 2026
`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 sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 25, 2026
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Working to Pending in SYDevelopers Technical Roadmap Nov 25, 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 25, 2026
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Pending to Working in SYDevelopers Technical Roadmap Nov 25, 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

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 — derive ContentIndexBlockFields from the generated ContentIndexBlock instead of restating it. lib/content/blocks.ts:69, inline.
  • consider — the body credits #1254, but #1254 added Page.parent, Page.path and WmWebConfig.indexPages; the user-choices index 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 === 0 renders null) and content-seo.ts.
  • new-pieces.mjs: NONE, the generated file its only skip, so no streamliner ran and no dependency was added.
  • Grepped indexPages, Page.parent and Page.path: no consumer. Correct — #333 claims all three, and lists types:cms as its own step, which this sync satisfies early.
  • Whole-file pass on both touched files. Two things held: stripQueryParam stays hand-rolled because URLSearchParams would percent-encode where[id][in], and blockConverters.tsx:350's dispatch comment needs no fifth case — the shortcut: at content-index.ts:131 states 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

Comment thread lib/content/blocks.ts Resolved
@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 25, 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 25, 2026
`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
@sydevs-bot

Copy link
Copy Markdown
Contributor

Addressed the adversarial review. Pushed 5f7d9b3. Lean gate green: lint, tsc --noEmit, 1792 tests.

Adopted — should-fix: derive ContentIndexBlockFields. It is now Omit<ContentIndexBlock, 'id' | 'blockName' | 'blockType'> plus the two resolved lists. The shortcut: naming #293 and the type-equality test both went with the mirror. Thread resolved.

Adopted — the consider on the body's provenance. It credited #1254 alone; the diff carries sydevs/SahajCloud#1254 (Page.parent, Page.path, WmWebConfig.indexPages) and sydevs/SahajCloud#1259 (the user-choices index type). Both are named now, with #333 as the nesting consumer. Confirmed against git log origin/main in the SahajCloud checkout.

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 origin/main.

🤖 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 25, 2026
@sydevs-dispatcher
sydevs-dispatcher Bot marked this pull request as ready for review November 25, 2026 19:39
@sydevs-dispatcher
sydevs-dispatcher Bot requested a review from Ardnived November 25, 2026 19:39
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Working to Awaiting in SYDevelopers Technical Roadmap Nov 25, 2026
@sydevs-dispatcher

Copy link
Copy Markdown
Contributor Author

Not approved automatically: it changes more than the copied contract. It needs a person's review.

🤖 sydevs dispatcher

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

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

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

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

@sydevs-dispatcher
sydevs-dispatcher Bot added this pull request to the merge queue Nov 25, 2026
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Awaiting to Pending in SYDevelopers Technical Roadmap Nov 25, 2026
Merged via the queue into main with commit 80154b8 Nov 25, 2026
21 checks passed
@sydevs-dispatcher
sydevs-dispatcher Bot deleted the claude/chore-sync-contracts branch November 25, 2026 20:26
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Pending to Done in SYDevelopers Technical Roadmap Nov 25, 2026
sydevs-bot pushed a commit that referenced this pull request Nov 25, 2026
#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
sydevs-bot pushed a commit that referenced this pull request Nov 25, 2026
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
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.

3 participants