Skip to content

feat(ffi): export kio's clock as moq_clock_* - #390

Merged
kixelated merged 13 commits into
mainfrom
quest/m1/ffi-export/crates
Nov 4, 2026
Merged

kixelated merged 13 commits into
mainfrom
quest/m1/ffi-export/crates

Conversation

@kixelated

@kixelated kixelated commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

The exporter pinned moq apart from just ts, at 30f25c04, since past moq-dev/moq#7032 moq-tokio's Send check overflowed the recursion limit just ffi moq denies. moq's main passes that check again, and has since moved moq-clock into kio::clock (moq-dev/moq#7027), so rs/moq-clock is gone.

Approach

  • One moq pin for just ts and just ffi: the model fixture's moq-net rev, now moq's main at ffcb7cd9, which just ts reads and ffi/justfile reads from it with just --evaluate. ffi still checks it out in its own clone, as fix(ffi): check out ffi's moq pin apart from ts's #423 keeps them apart.

  • The model fixture follows the pin: its snapshot is regenerated and its differential test passes. moq-net no longer depends on uuid, so the fixture's wasm32 uuid dependency goes.

  • just ffi standin exports kio's clock in moq-clock's place, so its items are moq_clock_*.

  • ffi/moq/ffi.toml follows just ffi census and the export over the 697 moq commits the pin moves: new refusals excluded, excludes that now name nothing dropped, and Pattern::captures exported.

  • Only the renames the pin forces, each keeping the old name's form where one existed:

    • moq-clock's two renames move to kio: clock::wall is moq_clock_now_wall and clock::interval is moq_clock_interval_every.
    • moq-mux's media Clock held moq_clock, which kio's clock now owns, so it is moq_mux_clock.
    • auth::RequestKind is moq_request_kind, beside auth::Request::kind.
    • hang::Catalog::media is moq_hang_catalog_to_media (and _extra_, _ext_ per instance), beside its field media.

    Every rename is a gap the configless naming quest, C names and crates with no config, removes.

  • The moq programs in all seven languages follow moq's API: JSON writes take a broadcast-clock timestamp on a timed track (feat!: JSON writes take a broadcast-clock timestamp in every binding moq#7691), path::Error, and origin::Consumer::request. The bench's moq-c.c passes moq-c's moq_timestamp, and ts/bench/moq.ts passes a group's sequence as the bigint moq's TypeScript now takes (feat(net)!: carry group IDs past 2^53 as bigint moq#7681).

  • Finishes quest/m1/ffi-export/crates.md and quest/m1/ffi-export/recursion-limit.md, and deletes both. At ffcb7cd9, just ffi moq builds the export with -D recursion_depth_exceeding_limit.

Impact

  • C names of moq's export: moq_now is moq_clock_now (C++ moq::clock_now, Kotlin, Swift, Dart clockNow, Go ClockNow, Python clock_now), and each of moq-clock's items moves under moq_clock_. moq-mux's Clock is moq_mux_clock, auth::RequestKind is moq_request_kind, and hang::Catalog::media is moq_hang_catalog_to_media. moq's upstream API changes follow.
  • just ffi's default moq revision is just ts's.
  • No change to the exporter's own API.

Alternatives

  • Keep the pin in a file both justfiles import: one more file for one value.
  • Export from ts/target/moq itself: fix(ffi): check out ffi's moq pin apart from ts's #423 moved ffi off it so neither recipe touches the other's checkout.
  • Exclude Catalog::media instead of renaming it per instance: drops a method that maps.

Follow-ups

  • A rename of a generic type's method by the generic path names every instance's alike, so Catalog::media needs one rename per instance. The configless naming quest removes renames altogether.

Decisions

From the maintainer, 2026-11-04: the exporter becomes configless in names.md, so this PR keeps only the renames the pin forces and makes no other naming choice. The question of moq-mux's Clock C name is dropped: moq_mux_clock stands until that rule replaces it. The earlier split-pin question cleared once #397 moved TypeScript to moq's main (hold).

Review

Round 1: quest review, Codex gpt-6.1-sol at medium effort, on head 9d954422: no findings. Head 5b17e0b4 adds only a merge of main (#598's quest files), whose one conflict keeps this PR's deletion of crates.md.

just ci, just ffi moq, and just ts moq pass on 9d954422; just check passes on 5b17e0b4. Earlier, on this pin, just ts census, just ffi bench, and just ts bench passed.

🤖 Generated with Claude Code

@kixelated kixelated changed the title moq-clock's C names once it moves into kio feat(ffi): export kio's clock as moq_clock_* Nov 1, 2026
@kixelated

Copy link
Copy Markdown
Collaborator Author

Maintainer decision, 2026-11-01: hold this PR until rust2 has one moq pin again, once TypeScript can move to moq's main (quest ts-moq-pin).

(written by Claude Opus 5.5)

kixelated and others added 5 commits November 4, 2026 02:43
…-limit

# Conflicts:
#	ffi/MIGRATE.md
#	ffi/justfile
#	quest/m1/ffi-export/recursion-limit.md
#	ts/justfile
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kixelated and others added 5 commits November 4, 2026 10:03
@kixelated
kixelated marked this pull request as ready for review November 4, 2026 19:07
@pullfrog

pullfrog Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

This run was cancelled before it finished.

Pullfrog  | View workflow run | via Pullfrog

@kixelated
kixelated added this pull request to the merge queue Nov 4, 2026
@coderabbitai

coderabbitai Bot commented Nov 4, 2026

Copy link
Copy Markdown

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 2 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

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: 4b06ac56-fc9f-458a-858a-94e186486c4e
Commits

Reviewing files that changed from the base of the PR and between ea287c2 and 5b17e0b.

Files ignored due to path filters: 1
  • ts/fixtures/model/Cargo.lock is excluded by !**/*.lock
Files selected for processing: 18
  • ffi/justfile
  • ffi/moq/bench/moq-c.c
  • ffi/moq/ffi.toml
  • ffi/moq/moq.c
  • ffi/moq/moq.cpp
  • ffi/moq/moq.dart
  • ffi/moq/moq.go
  • ffi/moq/moq.kt
  • ffi/moq/moq.py
  • ffi/moq/moq.swift
  • quest/m1/ffi-export/README.md
  • quest/m1/ffi-export/crates.md
  • quest/m1/ffi-export/recursion-limit.md
  • ts/bench/moq.ts
  • ts/fixtures/model/Cargo.toml
  • ts/fixtures/model/expected/harness.ts
  • ts/fixtures/model/expected/moq_net/model/time.ts
  • ts/justfile
  • 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

Merged via the queue into main with commit f3d653b Nov 4, 2026
7 of 8 checks passed
@kixelated
kixelated deleted the quest/m1/ffi-export/crates branch November 4, 2026 19:20
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