Skip to content

feat(ffi): fail a census on an instance inference missed - #200

Merged
kixelated merged 2 commits into
mainfrom
quest/m1/ffi-export/inference-gate
Oct 28, 2026
Merged

kixelated merged 2 commits into
mainfrom
quest/m1/ffi-export/inference-gate

Conversation

@kixelated

@kixelated kixelated commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Closes quest/m1/ffi-export/inference-gate.md.

Problem

#188 refuses an instance inference missed as instance not inferred. That refusal is a bug in the exporter, not something the crate uses. A census exits cleanly on every refusal, though, so such a gap would sit in a report no one reads.

Approach

  • After writing its reports, --census emits an error at the item's span, with inference's note at the generic type, for each refusal carrying instance not inferred. That makes the run fail.
  • An export (--out) emits each refusal through the same function, refuse, so both modes word refusals the same way.
  • This covers every census the exporter runs: the fixtures' census in the merge gate (tests/fixtures.rs), and moq's census in the nightly job.
  • No crate reports it today, so both pass. To check that the gate fires, I temporarily inverted its match. The fixtures' census then failed with one span error per refusal; I reverted the inversion before committing.

Impact

  • rust2-ffi --census exits non-zero when inference misses an instance. Its reports are still written.

Alternatives

Follow-ups

None.

🤖 Generated with Claude Code

(written by Claude Opus 5.5)

kixelated and others added 2 commits October 28, 2026 16:22
A census reports what a crate uses, so it exits cleanly on refusals. An
`instance not inferred` refusal is a bug in the exporter's inference instead,
so the census now errors on it at the item's span, after writing its reports.
The fixtures' census in the merge gate and moq's nightly census both gate on it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title Fail CI on an instance not inferred feat(ffi): fail a census on an instance inference missed Oct 28, 2026
@kixelated
kixelated marked this pull request as ready for review October 28, 2026 23:26
@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-28T23:27:44.987086Z 5006c03 Draft marked ready
🔒 Security Review ✅ Completed 2026-10-28T23:28:36.673042Z 5006c03 Draft marked ready
ℹ️ 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: 5006c03

No actionable bugs found. The census writes its reports before emitting errors for missed instances, checks every reason across every package report, and reaches the existing diagnostic-based compilation failure path. Ordinary unsupported constructs remain report-only. Extracting refuse preserves export-mode diagnostics and span notes without duplicating the check in CI scripts; this is a focused, sensible direction.

Verification: static inspection of the collector marker, driver/error path, and census test plumbing. No builds, tests, or census runs executed. The reported inverted-predicate experiment is not a retained regression test; an automated negative-path test would better protect the exit-status/report-preservation contract.

@kixelated
kixelated merged commit c32884a into main Oct 28, 2026
1 check passed
@kixelated
kixelated deleted the quest/m1/ffi-export/inference-gate branch October 28, 2026 23:47
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