Skip to content

feat(ffi): export moq's owned Path - #144

Merged
kixelated merged 5 commits into
mainfrom
quest/m1/ffi-export/paths
Oct 28, 2026
Merged

kixelated merged 5 commits into
mainfrom
quest/m1/ffi-export/paths

Conversation

@kixelated

@kixelated kixelated commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

moq's bindings can't build, join, strip, or resolve paths through the C ABI: Path and Relative borrowed, so the exporter refused them. moq-dev/moq#6843 makes them owned. Finishes quest/m1/ffi-export/paths.md.

Approach

Bump the shared moq pin to moq-dev/moq@c764ace (the merge of #6843) and follow it in the FFI config and C test.

  • ts/justfile: moq_rev 88448d9 -> c764ace (96 moq commits). Shared with rust2-ts; its blockers landed first in #158 (vec_view) and #159 (str::from_utf8).
  • ffi/moq/ffi.toml: drops AsPath, Path::{new,borrow,strip_prefix}, path::Relative::{new,borrow}; adds Path::from_static (the only path refusal left, a &'static str borrow). The rest follows the bump: moq-tokio's connect::{Token,EmptyToken,Tokens::set} moved to moq-net's auth (now refused there along with Dial), track::Querying became track::Resolving, and transport::StatsUnavailable and quic::driver::Connection::authenticated are gone. Each crate's exclude list matches the census's suggested config, apart from moq-tokio's Backoff getters, excluded for a name clash rather than a refusal.
  • ffi/moq/moq.c: absolute and join are fallible now; the test builds paths with moq_path_new, strips with moq_path_strip_prefix, and resolves a moq_relative_new("../bob").

FFI census, before and after

Crate Types Methods and fields Traits Constants
moq-net 119/33 -> 121/35 517/34 -> 519/34 1/14 -> 1/13 5/3 -> 6/3
moq-tokio 61/36 -> 60/34 219/86 -> 219/84
moq-mux 110/35 -> 111/35 395/61 -> 399/61
hang 4/0 -> 3/0

Exported/refused. moq-pattern and moq-clock are unchanged. moq-net's path refusals went from six to one (Path::from_static); Path::parts stays refused for its std::iter::Filter return, unrelated to lifetimes.

TS census at c764ace

just ts census runs clean: moq-net 8,406 refusals, model 2,997, kio 317 (with main at the merge). No checked-in expectation tracks these counts (the quest figures are dated snapshots), so ts/moq/*.toml is unchanged.

Impact

C names moq's bindings get: moq_path_new, moq_path_strip_prefix, moq_relative_new are new. moq_path_join now takes a moq_path and returns a moq_path_too_long error; moq_origin_{producer,consumer}_absolute now return a moq_error. No MIGRATE.md: neither tool's API changed.

Alternatives

  • A separate moq pin for ffi/: unblocks the exporter alone, but two pins drift. Rejected; the TS fixes landed first instead.

Follow-ups

  • The nightly toolchain's recursion_depth_exceeding_limit future-compat lint fires on Send checks in moq-net, moq-tokio, and the generated moq_ffi during just ffi moq (a warning today, a hard error later).

Checks

  • just ts moq, just ts census, just ffi moq at c764ace: ok.
  • just check, just test: ok. quest check --base origin/main: ok.
  • Not run: just ffi bench (needs the bench shell; ffi/moq/bench uses no paths).

🤖 Generated with Claude Code

(Written by Claude Opus 5.5)

kixelated and others added 2 commits October 27, 2026 19:35
Bump the moq pin to moq-dev/moq@c764ace, past moq-dev/moq#6843, which drops
Path's and Relative's lifetimes. Path::new, strip_prefix, and Relative::new
now export, AsPath and the borrow methods are gone, and only
Path::from_static's 'static borrow is refused. moq.c builds, joins, strips,
and resolves paths from C.

The exclude list follows the rest of the bump: moq-tokio's tokens moved to
moq-net's auth module, track::Querying became Resolving, and
StatsUnavailable and Connection::authenticated are gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated marked this pull request as ready for review October 28, 2026 11:40
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 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-28T12:17:40.228689Z 0aff9a0 New commits
🔒 Security Review ✅ Completed 2026-10-28T12:19:34.243469Z 0aff9a0 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.

@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: 5192337

No actionable bugs found in the changed pin/configuration and C path exercise. The owned Path/Relative signatures at the pinned revision match the new constructors, fallible joins/absolute paths, optional prefix stripping, and handle cleanup. Keeping a shared MoQ pin is simpler than introducing a separate FFI revision; the exclusions remain explicit about unsupported borrowed APIs.

Verification limits: static inspection of the changed files, build recipes, and pinned path implementation only. I did not run generation, C/TS builds, tests, or benchmarks, and did not exhaustively audit every intervening upstream commit.

@kixelated

Copy link
Copy Markdown
Collaborator Author

Landing summary: merged main three times (all conflict-free, last with #165); just ts moq, just ts census, just ffi moq, just check, just test pass at c764ace. No census expectations needed updating (none are checked in). Codex reviewed head 0aff9a0 with no findings; CI passed. #164 landed after and touches only TS test fixtures, so it isn't merged in here. Squash-merging as authorized.

(Written by Claude Opus 5.5)

@kixelated
kixelated merged commit fd312a9 into main Oct 28, 2026
1 check passed
@kixelated
kixelated deleted the quest/m1/ffi-export/paths branch October 28, 2026 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant