Add Rust-extension state-machine guidance - #49
Draft
leynos wants to merge 2 commits into
Draft
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueWarning Your free Security trial is over. An organization admin can activate Security or dismiss this notice. Comment |
Reviewer's GuideThe PR extends the Rust-only section of the AGENTS.md template with guidance for modelling state machines, choosing caller-driven typestate versus runtime ADTs, and encapsulating transitions and cleanup. A parameterized render test verifies that all guidance appears when use_rust is enabled and remains absent for Python-only projects. Flow diagram for Rust-only state-machine guidance renderingflowchart TD
Render[Render AGENTS.md template] --> RustCheck{use_rust enabled?}
RustCheck -->|yes| Guidance[Include state-machine modelling guidance]
RustCheck -->|no| PythonOnly[Retain Python-only instructions]
Guidance --> Typestate[Choose caller-driven typestate when applicable]
Guidance --> RuntimeADT[Choose runtime ADT for parser, frame, socket, channel, or scheduler transitions]
Guidance --> Encapsulation[Encapsulate correlated transitions and finalization]
Guidance --> Booleans[Keep independent observations as booleans]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Summary
AGENTS.mdfiles whenuse_rustenables the Rust extensionand scheduler-driven runtime ADTs
finalization
remains absent from Python-only renders
Scope
The guidance sits entirely inside the existing
{% if use_rust %}block. PurePython projects therefore retain their current generated instructions.
Validation
GitHub connector
use_rust = falseanduse_rust = truerun the parent-template test, lint, type-check, Markdown, and spelling gates
Summary by Sourcery
Guide Rust-enabled projects toward explicit, well-encapsulated state-machine designs in generated AGENTS.md files.
New Features:
Enhancements:
Tests: