AI updates #6#257
Merged
Merged
Conversation
…ation strategy Retire the incumbent "a modular programming paradigm for Rust" in favor of the chosen "a language extension for Rust, with pluggable trait implementations at compile-time." - Rewrite communication-strategy/tag-lines.md around the single chosen line: word-by-word analysis, the incumbent kept only as historical background, the post-tag-line pitch funnel, and model introductions for a new audience. - Lead cgp/README.md and docs/README.md with the new tag line and introduction. - Propagate the line through selling-points, formats, worked-examples, and vocabulary (recording "pluggable" as the lead descriptor and noting that "reusable" undersells the novelty to a Rust reader), and fix the now-stale "tag-line shortlist" reference in attention-and-engagement. - Update the communication-strategy README catalog entry to match. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
This PR does two independent things at once: it moves CGP's compile-error guidance out of the standard-library diagnostic hooks and into
cargo-cgp, and it adopts a new public tag line and propagates it across the READMEs and the communication-strategy docs. Along the way it grows the compile-fail test suite and the error catalog to cover a failure mode the diagnostics change makes newly relevant. The two efforts touch different parts of the tree — a handful of core trait definitions and the docs — and share no code, but they land together because both are about how CGP explains itself to a reader, one to a developer staring at a compiler error and the other to a newcomer meeting the project for the first time.Delegating diagnostics to cargo-cgp
The core change is the removal of every
#[diagnostic::on_unimplemented]attribute from the four traits that carried one. Those attributes toldrustcwhat note to print when a bound went unsatisfied — the "you might want to implement the provider trait" hint onDelegateComponent, the "add#[cgp_provider(...)]" hint onIsProviderFor, and the "add#[derive(HasField)]" hints onHasFieldandHasFieldMut. They are now gone, and the responsibility for turning a raw trait error into an actionable message shifts tocargo-cgp, the post-processor that already resolves check failures through the trait solver. The rationale is consolidation: a hand-writtenon_unimplementedstring is a second, less capable diagnostic engine living in the library, and it competes with the richer, type-aware messagescargo-cgpcan produce from the same failure.The effect on the raw compiler output is deliberate and visible in the new test fixtures. Without the attribute,
rustcfalls back to its generic "the trait bound ... is not satisfied" wording plus therequired for ...chain, and it is that unadorned shape the new.stderrsnapshots pin. This is the anatomy the error catalog now teaches a reader (and a tool) to decode by structure rather than by a canned note.New error tests and catalog coverage
The PR adds three compile-fail fixtures under
check_components, each paired with a checked-in.stderrsnapshot, and documents the failure classes they capture. Two fixtures —higher_order_inner_dependency.rsandhigher_order_outer_dependency.rs— are a matched pair that pins how the diagnostic shape identifies which layer of a higher-order provider carries an unmet dependency: an inner-layer failure runs therequired for ...chain through both providers'IsProviderForand carries a "redundant requirement hidden" note, while an outer-layer failure stops at the outer provider and never names the inner one. The third,missing_has_field_derive.rs, pins the case where a struct has the field a getter names but is missing#[derive(HasField)]altogether, so the tell is the absence of the "but traitHasField<...>is implemented for it" landmark that a single missing field would otherwise produce.The documentation grows to match. A new catalog page,
docs/errors/checks/higher-order-provider-layer.md, is the anatomy of the higher-order failure class — what triggers it, how the inner and outer cases differ block by block, where the root cause sits, how to resolve it, and what acargo-cgp-style tool should extract. The existingcheck-trait-failure.mdgains a "when the derive is missing entirely" section for the third fixture. The new class is cross-linked from the errorsREADME, fromverbose-cascade.md, from thee0277code page, and from the debugging guide, which now notes that the chain shape already leans toward one layer before a reader reaches for#[check_providers(...)].Adopting the new tag line
The second effort settles CGP's one-line description on "A language extension for Rust, with pluggable trait implementations at compile-time," retiring the long-serving "a modular programming paradigm for Rust" and the interim "reusable, swappable trait implementations" phrasing. The reasoning is captured in a near-complete rewrite of
docs/communication-strategy/tag-lines.md, which turns what was a brainstorm of candidates into a settled decision document: it justifies the line word by word ("extension" over "a language" to stay honest, "pluggable" over "reusable" because traits are already Rust's reuse mechanism, "at compile-time" to defuse the runtime-DI misreading), lays out the high-level pitch that should follow the line, and supplies four model introductions tuned to different venues. The old "modular programming paradigm" framing is kept only as retired historical background.The new wording then propagates outward so nothing contradicts the settled line. The top-level
README.mdanddocs/README.mdlead with it;vocabulary.mdadds "pluggable trait implementations" as the chosen lead descriptor and adds "reusable" to the terms-to-avoid list; andselling-points.md,formats.md,attention-and-engagement.md, andworked-examples.mdare updated so their guidance and finished sample copy use the new line rather than the old candidates. TheREADMEcode sample is also reflowed into the multi-linedelegate_components!form, a purely cosmetic touch to the example.Impacts
The changes above ripple out in several distinct directions, listed here because they are largely independent of one another rather than steps in one argument.
cargo-cgpnow seesrustc's generic unsatisfied-bound wording without the "add#[derive(HasField)]" or "add#[cgp_provider]" notes that previously appeared inline. The guidance is not lost, but it now lives behind the post-processor rather than in the compiler output itself.cargo-cgpbecomes the intended path for good diagnostics. The library now assumes the post-processor is present to produce actionable messages, so the quality of the CGP error experience depends on it more than before. The new catalog pages double as the spec a tool follows to reconstruct those messages..stderrfiles (and the behavior of any existing ones that referenced the removed notes) capturerustc's output without theon_unimplementedtext, so they will fail if the attributes are ever reintroduced — the tests now guard the delegation decision.cargo-cgpa documented target for the "which layer is at fault" fact.tag-lines.mdis settled rather than under selection, any future change to the line has to be propagated acrossREADME,docs/README,vocabulary.md,formats.md,worked-examples.md, andattention-and-engagement.mdin the same change; the tag-lines document now states that synchronization obligation explicitly.