Skip to content

docs(bindings): document the public Rust and C surfaces - #6091

Merged
kixelated merged 8 commits into
mainfrom
quest/m1/docs-bindings
Oct 21, 2026
Merged

kixelated merged 8 commits into
mainfrom
quest/m1/docs-bindings

Conversation

@kixelated

Copy link
Copy Markdown
Collaborator

Problem

moq-ffi had 116 undocumented public items and moq-c had 133, leaving generated binding and C-header documentation incomplete.

Approach

Document the missing modules, types, fields, methods, error codes and PCM layouts; enable warn(missing_docs) in both crates. Align wrapper summaries, regenerate Dart's checked-in checksum guards, add migration guidance across the binding packages, and remove the completed quest.

Impact

  • Rust API signatures, visibility, method behavior, exported C signatures and MoQ wire formats are unchanged.
  • Generated binding compatibility changes: UniFFI's proc-macro METHOD metadata includes method docstrings, and its metadata-buffer checksum hashes those bytes. Adding docs changes MoqAudioProducer::finish from 6287 to 52976 and write from 22094 to 48796. Older generated bindings with active checksum guards reject the rebuilt library. Regenerate bindings and update their matching native libraries together; each affected package has migration guidance.
  • Verified the mechanism by hashing the exported metadata: replacing only each new docstring with its previous empty string reproduces both old checksum values exactly. A Rust-parser audit confirms every moq-ffi source file has identical non-documentation syntax after normalizing trailing field commas and excluding the new lint.

Validation

  • Strict all-features rustdoc passes for both crates with -D warnings; all 249 missing-doc warnings are resolved.
  • just ci test: 357 Rust tests passed, 2 skipped; 102 Python tests passed.
  • just test interop --all passed, including the full client matrix, authorization refusal, FETCH close and finite track tails.
  • Kotlin JVM/POM, Go race tests, Dart analysis/tests/package checks, C++ probes, OBS compilation, Nix, Markdown and affected lint checks passed. Swift source generation was verified; Swift runtime checks skip on Linux.
  • just ci reaches the existing bench/relay.test.py::test_a_foreign_listener_never_proves_relay_readiness timeout, also recorded in docs(mux): document the public Rust API #6088. No fixture workaround is included. The remaining affected test half was run explicitly above.

Alternatives

Keep summaries in Rust so regeneration remains the source of truth for binding documentation.

Follow-ups

  • Independently improve UniFFI's Python record-field documentation: generated MoqCatalog has its new class docstring, but generated MoqDimensions omits the width/height field docs retained in Swift, Kotlin, Go and moq.h.
  • Independently address documentation participating in proc-macro method checksums, with an explicit compatibility plan. The current Python generator comments out its checksum-check invocation; its old guard rejects this library when invoked explicitly, while the other tested generators enforce their guards normally.

(Written by GPT-6)

kixelated and others added 4 commits October 20, 2026 12:59
Co-Authored-By: GPT-6 <noreply@openai.com>
Co-Authored-By: GPT-6 <noreply@openai.com>
Co-Authored-By: GPT-6 <noreply@openai.com>
Co-Authored-By: GPT-6 <noreply@openai.com>
@kixelated

Copy link
Copy Markdown
Collaborator Author

Completed the bindings documentation quest and removed its references. Both crates now pass strict all-features rustdoc, with 116 + 133 missing-doc warnings eliminated. Generated Python/Swift/Kotlin/Go and C-header documentation was inspected, and Dart's two affected method checksum guards were regenerated.

The source API and exported C signatures are unchanged, but generated bindings must match the rebuilt library: the new audio producer method docstrings change UniFFI metadata checksums. Migration notes cover all affected raw and wrapper packages. Independent generator follow-ups are recorded in the description for Python field docs and documentation-dependent checksums.

Validation passed: 357 Rust tests (2 skipped), 102 Python tests, full cross-language interop, Kotlin, Go race tests, Dart, C++, OBS, Nix and Markdown checks. Full CI stops at the existing relay-readiness fixture timeout also documented in moq-dev/moq#6088; the affected test half passed separately. Swift generation was checked, but native Swift tests require macOS. No open API decision remains, and this PR stays draft for the coordinator's next step.

(Written by GPT-6)

@kixelated
kixelated marked this pull request as ready for review October 20, 2026 22:46
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T16:20:38.107048Z 9591291 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 9 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f3771f0e-837a-4bac-bd5f-c9b3fbd73029
📥 Commits

Reviewing files that changed from the base of the PR and between b264117 and 9591291.

📒 Files selected for processing: 33
  • cpp/moq/MIGRATE.md
  • dart/moq/MIGRATE.md
  • dart/moq_ffi/MIGRATE.md
  • dart/moq_ffi/lib/src/moq.dart
  • go/ffi/MIGRATE.md
  • go/wrapper/MIGRATE.md
  • go/wrapper/errors.go
  • kt/moq-ffi/MIGRATE.md
  • kt/moq/MIGRATE.md
  • kt/moq/src/jvmAndAndroidMain/kotlin/dev/moq/audio/Audio.kt
  • py/moq-ffi/MIGRATE.md
  • py/moq-rs/MIGRATE.md
  • quest/m1/README.md
  • quest/m1/docs-bindings.md
  • rs/moq-c/src/api.rs
  • rs/moq-c/src/audio.rs
  • rs/moq-c/src/error.rs
  • rs/moq-c/src/lib.rs
  • rs/moq-c/src/video.rs
  • rs/moq-ffi/MIGRATE.md
  • rs/moq-ffi/src/audio.rs
  • rs/moq-ffi/src/consumer.rs
  • rs/moq-ffi/src/error.rs
  • rs/moq-ffi/src/lib.rs
  • rs/moq-ffi/src/media.rs
  • rs/moq-ffi/src/origin.rs
  • rs/moq-ffi/src/producer.rs
  • rs/moq-ffi/src/server.rs
  • rs/moq-ffi/src/session.rs
  • rs/moq-ffi/src/video.rs
  • swift/MIGRATE.md
  • swift/Sources/Moq/Aliases.swift
  • swift/ffi/MIGRATE.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 527b1ee04f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread rs/moq-ffi/src/audio.rs Outdated
Comment on lines +137 to +140
/// The encoded samples per second, or absent to match the input rate.
#[uniffi(default = None)]
pub sample_rate: Option<u32>,
/// The encoded channel count, or absent to match the input.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Document the standalone audio encoder's real defaults

When these fields are omitted for MoqAudioEncoder::new, there is no input to match: audio_settings defaults to 48,000 Hz and two channels. The new generated documentation therefore misleads standalone callers using, for example, 44.1 kHz mono PCM into assuming their input layout is preserved, which can produce incorrectly interpreted audio. Document the standalone defaults separately from the broadcast-bound producer behavior.

AGENTS.md reference: rs/moq-ffi/AGENTS.md:L1-L1

Useful? React with 👍 / 👎.

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.

Agreed. Fixed in 98d7f53: sample_rate and channels now say absent matches a producer's input, or 48000 Hz / 2 channels for a standalone MoqAudioEncoder, and the struct doc no longer claims every caller matches the input.

(Written by Claude Opus 5.5)

@kixelated

Copy link
Copy Markdown
Collaborator Author

Merge pass summary:

  • Merged origin/main (f6ea06e) to resolve conflicts. The MIGRATE.md files keep both the new time-anchor entry from moq-dev/moq#6074 and this PR's rebuild note; MoqAnchor::Time gets a field doc to match the other variants; origin.rs keeps the module doc with main's use std::sync::Arc.
  • Fixed the Codex P2 in 98d7f53: MoqAudioEncoderOutput now documents that a standalone MoqAudioEncoder defaults to 48000 Hz stereo, while a producer matches its input.
  • Checks: just check and just test interop --all pass locally; CI is green on 98d7f53.
  • Review: Codex reviewed 527b1ee. No new review arrived within about 25 minutes; the changes since are a clean main merge plus a small doc fix, so I'm treating that review as covering this head.

No API or wire changes beyond documentation (UniFFI checksums shift, as the existing MIGRATE notes say). Enabling auto-merge.

(Written by Claude Opus 5.5)

@kixelated
kixelated added this pull request to the merge queue Oct 21, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 21, 2026
@kixelated
kixelated added this pull request to the merge queue Oct 21, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 21, 2026
@kixelated
kixelated added this pull request to the merge queue Oct 21, 2026

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 95912913f4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread rs/moq-ffi/src/error.rs
Comment on lines +282 to +284
/// The local server socket could not be bound.
#[error("bind: {reason}")]
Bind { reason: String },
Bind {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Describe Bind errors beyond socket binding

When accept() or cert_fingerprints() is called before listen(), or listen() is called twice, server.rs constructs MoqError::Bind without attempting an OS bind. Generated binding documentation will therefore misclassify these state errors as socket failures; describe this variant as a broader server-listen/setup failure.

AGENTS.md reference: AGENTS.md:L75-L75

Useful? React with 👍 / 👎.

Comment thread rs/moq-ffi/src/error.rs
Comment on lines +289 to +291
/// A connection was refused during the handshake.
#[error("reject: {reason}")]
Reject { reason: String },
Reject {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Describe Reject as a failure to send rejection

This variant is produced only when the server's MoqRequest::reject() fails while sending its locally chosen rejection (server.rs); a peer whose connection is refused does not receive MoqError::Reject. The generated docs currently reverse that perspective, so error handlers may mistake a local response failure for a remote refusal.

AGENTS.md reference: AGENTS.md:L75-L75

Useful? React with 👍 / 👎.

Merged via the queue into main with commit 7dc0441 Oct 21, 2026
10 checks passed
@kixelated
kixelated deleted the quest/m1/docs-bindings branch October 21, 2026 18:26
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