Skip to content

quest: plan a CARGO_MANIFEST_DIR check and a safe Path representation - #9841

Draft
kixelated wants to merge 1 commit into
mainfrom
quest-plan/safe-path-and-manifest-dir
Draft

kixelated wants to merge 1 commit into
mainfrom
quest-plan/safe-path-and-manifest-dir

Conversation

@kixelated

Copy link
Copy Markdown
Collaborator

Problem

Two follow-ups from kixel-ai/rust2 need quests in moq's tree:

  • kixel-ai/rust2#1060 found that test code using env!("CARGO_MANIFEST_DIR") bakes the checkout path into the build, so every new worktree misses mbx's cache (685G to 216G instructions for a second worktree's test build once fixed). moq-dev/moq#9779 already converted every site under rs/, but nothing stops a new one.
  • kixel-ai/rust2#1071: rust2-lean can't translate moq_net::Path's unsafe inline storage, so it carries a hand-written Lean model. rs/moq-net/verify/README.md also says 656 Agda-checked route-algebra results where the generators write 649.

Approach

  • quest/m1/manifest-dir-check.md [XS]: a forbid line in sh/text.sh against env!("CARGO_MANIFEST_DIR") in rs/. It joins m1 because it's an additive check and nothing is broken now.
  • quest/m3/safe-path.md [M]: store Path without unsafe, measuring the cost against moq's benches first, plus the verify README count fix. It joins m3 because a named consumer, rust2-lean's lean-router quest, waits on it.

Decisions

The maintainer was away and pre-approved planning these headless, so each decision below takes my recommendation. Please review.

Maintainer, 2026-11-27 (in kixel-ai/rust2):

  • CARGO_MANIFEST_DIR: ✅ keep the run-time reads, with a check against new env!("CARGO_MANIFEST_DIR") (rejected: no check; drop).
  • Path: ✅ plan replacing Path's unsafe storage with a safe representation (rejected: keep the Lean model indefinitely). ✅ Fold the 656-to-649 fix into that quest (rejected: its own quest; drop).

/quest-plan, headless:

  • Quest 1 scope: ✅ the check alone (rejected: re-converting sites). perf(check): a local check cross-lints only crates that name a platform and skips rustdoc #9779 already converted all of them, so the code needs no more changes.
  • Check mechanism: ✅ a forbid in sh/text.sh, which just check and the queue already run (rejected: clippy disallowed-macros, which would also ban env!("CARGO_PKG_VERSION"); a custom lint).
  • Check scope: ✅ every .rs under rs/, lines with include! allowed for cell.rs's compile_fail doctests (rejected: test code only, which a grep can't separate reliably).
  • Interop clients: ✅ stay outside the scan (rejected: having interop.sh pass them their script directory). The harness runs them as plain binaries, where cargo sets no run-time variable.
  • Quest 1 milestone: ✅ m1 (rejected: m0/ci, since nothing is broken now; m4).
  • Path representation: ✅ try Static plus Shared (Arc<str>) alone first (rejected: a checked inline form first, which validates UTF-8 on every read and needs new rust2-lean models; smol_str/compact_str, which carry their own unsafe).
  • Measurement: ✅ compare benches/path.rs allocations, just bench-fanout origin/main, and the moq-net origin/announce/retirement benches against main. End-to-end rows decide, with an A/A run of each bench as the noise bar. If the Shared-only form moves an end-to-end row beyond that noise, try the checked inline form and take the cheaper one. If both move rows, don't land; ask the maintainer (rejected: a fixed regression budget).
  • arrayvec builders: ✅ kept unless rust2-lean's census reaches them (rejected: removing them up front at an allocation per long path).
  • verify README: ✅ drop the duplicated count and point at route-algebra/README.md, which holds the 329 + 320 breakdown (rejected: change 656 to 649, which drifts again).
  • Quest 2 milestone: ✅ m3 (rejected: m1, since nothing is blocked and rust2-lean carries its model meanwhile; m4, since a consumer waits).

Impact

None. This PR only adds quests.

Alternatives

Fixing the verify README in this PR. Not taken, because the maintainer chose to fold the fix into the Path quest.

Follow-ups

  • Overlap: moq-dev/moq#9800 (delete moq-pattern) edits rs/moq-net/src/path/. Whichever of it and the Path quest's PR lands second rebases.

Validation

  • quest check: 575 documents ok.
  • just ci passed locally on 5e42514.

Models

Size: S
Implementer: Claude Code, claude-opus-5-5, unknown

(Written by Claude Opus 5.5)

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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