Repository navigation
feat(net): name the origin read side as Origin.Reader - #7557
Conversation
Quest-Claim: 0e4872dce27cec9a
Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
# Conflicts: # js/watch/src/broadcast.ts
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…solve/watch-origin # Conflicts: # quest/m1/api-audit/resolve/README.md
Quest-Claim: 8cf0618e79b5c4f0
…-origin' into quest/m1/api-audit/origin-reader # Conflicts: # quest/m1/api-audit/route/handle.md
Origin.Table extends Origin.Reader and Origin.Consumer implements it, so @moq/watch's Player and Broadcast take Origin.Reader instead of a Pick list, and the stats demo reads through it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review.
|
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: 7bec1e1.
No actionable bugs found. Naming the existing read-side shape as Origin.Reader is a proportionate simplification: Table extends it, Consumer implements it, and watch borrows only the capabilities it uses without gaining lifecycle ownership. The table/consumer/structural-origin tests cover the intended widening; publishing inputs remain on Table. The additive API has no wire change.
Verification: static inspection of the diff and relevant origin, player, broadcast, and export code only. I did not run tests, builds, or independently verify the reported gate results.
(Written by OpenAI)
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Origin.Readerintroduced —js/net/src/origin.tsgains an exportedReaderinterface with the five read members (closed,discovery,request,follow,announced);Tableis re-declared asinterface Table extends Reader, keeping onlycreateBroadcast/requests, andConsumeris markedimplements Reader.@moq/watchwidens to the read side —PlayerInput.originandBroadcastInput.originnow takeGetter<Origin.Reader | undefined>, and the local helper/map signatures inbroadcast.tsfollow; the localPick<...>alias is removed.- Read-only demo helper —
demo/web/src/stats.ts'ssubscribeNodetakesNet.Origin.Reader. Writers (Connection.Pool.origin,@moq/publish) stay onOrigin.Table, which is correct. - Tests + API reports —
broadcast.test.tsusesowner.consume();player.test.tsadds atest.eachovertable/consumer/structuralorigins asserting the borrowed handle does not close the owner. Bothapi/*.api.mdfiles regenerated. - Quest bookkeeping —
origin-reader.mdandresolve/watch-origin.mddeleted with their list entries, plus theroute/handle.mdRelated link.
I verified bunx tsc --noEmit is clean in js/net and js/watch, the new player.test.ts cases pass (5/5), there are no dangling links to the deleted quest files, and the only remaining Origin.Table sites are publishing/lending paths. The docs reference chain (Reader.closed → Consumer.closed → Producer.closed) is chained but accurate.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
TypeScript prints the observed-attribute union in literal-creation order, which shifts with the origin types checked before it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Problem
@moq/watch's origin inputs repeat a
Pick<Origin.Consumer, "closed" | "discovery" | "request" | "follow" | "announced">list (from moq-dev/moq#7251), and @moq/net has no name for "an origin you can only read".Approach
Origin.Reader:closed,discovery,request,follow,announced.Origin.Tablenow extends it (addingcreateBroadcast,requests), andOrigin.Consumerdeclaresimplements Reader, so both stay checked against the one definition.BroadcastInput.originandPlayerInput.origintakeGetter<Origin.Reader | undefined>; the localOriginalias inbroadcast.tsis gone.subscribeNodeonly reads, so it takesOrigin.Readertoo.@moq/publishandConnection.Pool.originkeepOrigin.Table, since they publish or lend publishing.quest/m1/api-audit/origin-reader.mdand itsRequiredentry in the api-audit epic.moq-dev/moq#7251 has merged, and
mainis merged in here, so the diff now holds only this PR's changes. The merge conflicted injs/net/src/origin.ts,js/watch/src/{broadcast,player}.ts, andjs/watch/api/index.api.md. Each conflict was #7251'sPicklist or alias against this branch'sOrigin.Reader, and was resolved toOrigin.Reader.js/watch/api/element.api.mdis regenerated. TypeScript prints the element's observed-attribute union in the order it creates the literal types, and that order shifts with the origin types it checks first. #7251 reordered the union, and this change restores the earlier order. The element itself is unchanged.Impact
Origin.Reader;Origin.Tablenow extends it with the same members as before. @moq/watch's origin inputs read asOrigin.Readerinstead of thePicklist (same shape). Additive; nothing migrates.Validation
quest gate nix develop --command just checkon556d6752b3: passed.quest check --base origin/main: passed.Choices made without asking
Origin.Reader; left writers onOrigin.Table.Reader.closed's doc points atConsumer.closedinstead ofProducer.closed; both describe the same promise.PlayerInput.originnamesOrigin.Readerdirectly instead of fix(watch): accept structural read-side origins #7251'sBroadcastInput["origin"]indirection, soplayer.tsno longer importsBroadcastInput.Review
Codex
quest review(gpt-6.1-sol, medium effort), round 1 on556d6752b36917a4a9185548e314569404381e48againstorigin/main(a546cac082): no findings.Online reviews posted on the earlier head
7bec1e1e7f(OpenAI review, Pullfrog) reported no issues. CodeRabbit was rate-limited.Follow-ups
element.api.mdshows here). Sorting union members when the reports are normalized would remove that churn.(Written by Claude Opus 5.5)
🤖 Generated with Claude Code