Refusal messages taught the old API - #768
Closed
0-jake-0 wants to merge 1 commit into
Closed
Conversation
The refusal text is the teaching surface — the one thing a user reads at
the moment they are confused — and it was written before both `quoted!` and
`#[op(emit_cfg)]` landed, so it taught neither.
It recommended the manual two-step `func!` + `.with_src(..)` form rather
than `quoted!`, said nothing about declaring captures (the case most likely
to have caused the refusal), and advised recording data configs — which
concrete ones now do themselves, so following it would send a reader to fix
something that is not broken.
Now:
- node 2 (Map): `map`'s closure was not quoted, so the engine erased it.
Write `quoted!(<upstream> => map(..))` — or, if it captures, declare
what it captures: `map([threshold] move |v| ..)`.
Every closure a generated graph contains has to be quoted, because the
engine erases closures and no traversal can recover one. Data configs
mostly look after themselves — only `fold`/`scan` seeds, whose type is
generic, still need `.with_cfg(&seed)`.
The op's own build name is interpolated, so the suggestion names the method
the user actually called rather than a generic `map`.
Test assertions updated to match, and the unit test now also asserts the
footer does *not* carry blanket `with_cfg` advice — the specific way it was
wrong, pinned so it cannot drift back.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X4eojqRWBJ6uK5v5JDzmkd
This was referenced Aug 8, 2026
Contributor
Author
|
Superseded by #769, which squashes this whole stack (#759–#768) onto The corrected refusal messages are carried forward. Closing to keep the queue readable; no content is being dropped. Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #767 → #766 → #765 → #764 → #763 → #762 → #761 → #760 → #759.
What this changes
The refusal text is the teaching surface — the one thing a user reads at the moment they're confused — and it was written before both
quoted!(#765) and#[op(emit_cfg)](#767) landed, so it taught neither.It recommended the manual two-step
func!+.with_src(..)form rather thanquoted!, said nothing about declaring captures (the case most likely to have caused the refusal), and advised recording data configs — which concrete ones now do themselves, so following it would send a reader to fix something that isn't broken.Now:
The op's own build name is interpolated, so the suggestion names the method the user actually called rather than a generic
map.How it was verified
cargo fmt --allcargo lint✅ —cargo lint-allnot run (--all-featuresneeds CMake ≥3.30 for aeron and protoc for etcd; documented prerequisites, unrelated to this diff).--all-featuresblocked as above. Full default suite plus the broad feature set — green. Doctests green.Assertions updated across three tests. The unit test now also asserts the footer does not carry blanket
with_cfgadvice — the specific way it was wrong, pinned so it can't drift back.Notes for the reviewer — and a finding that outranks this PR
While writing this I tested something I'd asserted earlier without checking, and I was wrong about it.
quoted!'s=>syntax buys nothing.I'd justified the
=>form on the grounds that a proc macro loses verbatim source. That part holds. But I never checked whether a concreteQuotedFn<F>parameter preserves closure inference — themap_q(func!(..))shape. Measured:.map(|i| i*2)— no quotationquoted!(ticks => map(|i| i*2))Fn is not general enough.map_q(func!(|i: &u64| i*2))Both quotation forms need the annotation equally —
func!binds the closure with no expected type in sight, soquoted!inherits the same HRTB failure. So the=>grammar costs chainability and buys nothing over a_qmethod twin.#[op(fluent)]already generates the fluent method, so generating a_qtwin is a derive flag plus one trait-declaration line per closure-config op — mechanical, and it would letfunc!be the only vocabulary:That deprecates
quoted!— which #765 and #766 introduce. I have not built it, because it invalidates two open PRs in this stack and that's a call for the repo owner, not something to do unilaterally on top of nine unreviewed layers.Stack: eleven PRs, none reviewed, ten chained on #759.
Generated by Claude Code