Skip to content

refactor(net): give origin follow its own options - #7724

Merged
kixelated merged 4 commits into
mainfrom
quest/m1/api-audit/resolve/follow-options
Nov 3, 2026
Merged

kixelated merged 4 commits into
mainfrom
quest/m1/api-audit/resolve/follow-options

Conversation

@kixelated

@kixelated kixelated commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Origin follow and request share RequestOptions, so their declared options type documents two different lifecycles.

Approach

Give follow its own FollowOptions on Consumer, Producer, and the borrowed Reader/Table API. Document each method's instance pin separately and regenerate the API report. Delete the completed quest and its link, sizing the now-unblocked parent quest.

Impact

  • Public TypeScript API: follow declares Origin.FollowOptions; request keeps Origin.RequestOptions. Both interfaces contain only instance?: Instance.Valid, so existing option objects and RequestOptions annotations remain assignable. No migration is required. The quest's predicted annotation break does not occur with the current shapes.
  • Wire and runtime behavior: unchanged. No follow fields dropped: instance is the only existing field and follow consumes it.

Alternatives

A shared base plus aliases was allowed by the settled plan. Two one-field interfaces keep each field's lifecycle documentation with its method's options without introducing another type. No discovery semantics change.

Validation

  • quest gate just fix: regenerated the API report and built dependent packages.
  • quest gate just ci: passed on the final head, including JavaScript checks, builds, dependent-package tests, and repository tooling checks.
  • quest check --base origin/main: 600 documents passed.
  • git diff --check origin/main...HEAD: passed.

Review

Claude Code, claude-opus-5-5, medium effort, round 2 reviewed 8b732029c6e345c6678cec97bc0fdd92b07a0455 against origin/main: no findings.

Both round 1 findings were fixed: removed the unnecessary migration entry and breaking-change classification, and reverted the test-only annotation that added no coverage. The API report records the named signature split.

Follow-ups

None. No open decisions. Inspected the published JS origin and API hunks in moq-dev/moq#7678; they do not overlap this options split.

(Written by GPT-6.1 Sol)

@kixelated kixelated changed the title JS follow takes FollowOptions refactor(net)!: give origin follow its own options Nov 3, 2026
kixelated and others added 3 commits November 3, 2026 03:07
Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
@kixelated kixelated changed the title refactor(net)!: give origin follow its own options refactor(net): give origin follow its own options Nov 3, 2026
@kixelated
kixelated marked this pull request as ready for review November 3, 2026 11:15

@kixelated kixelated left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review by review (OpenAI)

Reviewed commit: 8b73202

Separating the named option types clarifies their different lifecycles without changing the structurally compatible fields or runtime behavior. No actionable bugs found in this static review. I did not run TypeScript builds or tests.

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

A type-only split of the JS origin's resolve options; runtime and wire behavior are unchanged.

  • FollowOptions split from RequestOptions — Consumer.follow, Producer.follow, and Reader.follow now declare Origin.FollowOptions, while request keeps Origin.RequestOptions. Both are one-field interfaces (instance?: Instance.Valid), so the types stay mutually assignable and no caller annotation or object literal breaks.
  • Per-method field docs — RequestOptions.instance now documents refusing a different instance for request; FollowOptions.instance documents following one instance across gaps for follow. Both descriptions match #resolve(path, instance, announced) at js/net/src/origin.ts:2072, where the pin restricts to that instance's own routes and re-resolves when it returns (js/net/src/origin.ts:2039, js/net/src/origin.ts:2053).
  • API report regenerated — js/net/api/index.api.md records the new interface in correct alphabetical position and the three updated follow signatures.
  • Quest housekeeping — deletes the completed follow-options quest, drops its Required entry from the parent README, and sizes the parent [M]. No remaining references to the deleted file.

The mirrored Rust follow/request take a positional instance, so this JS options-object split does not imply a cross-language type that needs mirroring.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@coderabbitai

coderabbitai Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

The API adds FollowOptions with an optional instance field. Consumer.follow, Producer.follow, and Reader.follow now accept this type, while request methods continue to use RequestOptions. The follow return types are unchanged, and the Consumer.follow implementation still defaults its options to an empty object. The API audit README and task document were also updated.

Merge Risk: Minimal · up to 8b732

The option-type split preserves the existing optional instance field and aligns the public declarations. No actionable issue prevents merging after normal checks.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: giving origin follow its own options type.
Description check Passed The description directly explains the separation of FollowOptions from RequestOptions, the affected APIs, and the reported impact and validation.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files. (2 skipped: 2 unsupported.)

Finishing Touches
Simplify code
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

Biome (2.5.15)
js/net/src/origin.ts

Biome could not lint this file: configuration resulted in errors. Check the repository's Biome configuration and plugins.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4106a082-8197-4445-a2af-59c8bbc2783a
Commits

Reviewing files that changed from the base of the PR and between 801fd9a and 8b73202.

Files selected for processing: 4
  • js/net/api/index.api.md
  • js/net/src/origin.ts
  • quest/m1/api-audit/resolve/README.md
  • quest/m1/api-audit/resolve/follow-options.md
Files with no reviewable changes: 1
  • quest/m1/api-audit/resolve/follow-options.md

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

@kixelated
kixelated added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit d6d0650 Nov 3, 2026
8 checks passed
@kixelated
kixelated deleted the quest/m1/api-audit/resolve/follow-options branch November 3, 2026 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant