Repository navigation
docs(agents): adopt the fleet's narrowed design-principles directives (zackees/ci.yml#163) #280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,12 +56,24 @@ Do not pipe pytest through `| tail -N` if you want streaming output; it buffers | |
|
|
||
| - Lint command: `bash lint`. | ||
| - Test command: `bash test` or targeted subsets above. | ||
| - Prefer native Rust implementations and fail-loud behavior over silent Python fallbacks. | ||
| - Prefer native Rust implementations; fail-loud behavior is Design principle 6 below. | ||
| - Do not add backwards-compat hacks for code paths that no longer exist. | ||
| - For deterministic in-product render checks, use `fastled <sketch> --test` | ||
| with the `--test-*` screenshot, interval, log, and timeout flags. This uses | ||
| the shipped Tauri viewer and exits automatically; no browser harness is needed. | ||
|
|
||
| ## Design principles (fleet directives, zackees/ci.yml#163) | ||
|
|
||
| Agent and review guidance from zackees/ci.yml `docs/policy-rust.md` ("Design principles, narrowed"). Not enforced by ci-lint; no rule ID. | ||
|
|
||
| 1. **Search before you add.** Before adding a resolver, detector, predicate, guard or path helper, `rg` for an existing one. Reuse it, or say in the PR why it does not fit. | ||
| 2. **Conflicting implementations get a research issue, not an inline winner.** If the same concept is implemented more than once with observably different behaviour and fixing it needs a design decision, file `research: N conflicting implementations of X -- which is canonical?` listing every copy (`file:line`) and what the difference does to real input; cross-reference it and carry on with your task. Copies that behave identically are a refactor, not an issue. | ||
| 3. **Keep behaviour changes and refactors apart.** Separate commits, preferably separate PRs, never one mixed diff. | ||
| 4. **Refactor first only when you would grow a giant function.** If a fix would add more than 50 lines to a function already over 200 lines, extract first in a separate behaviour-preserving change with characterization tests written first (RED -> GREEN). Otherwise fix it where it belongs; no unrequested restructures. | ||
| 5. **Function and file size follow the complexity ratchet (`RUST-018`).** Until it is wired into this workspace's `Cargo.toml`, new functions stay under clippy's `too_many_lines` (100) and `cognitive_complexity` (25). A function carrying an `#[expect]` must not grow; delete the `expect` once it is back under. Never split a file with `include!` fragments to dodge a length ceiling. Before splitting a hot file, check `git branch -a --contains` for in-flight branches -- a split is a rename and conflicts destructively. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use a path-aware branch comparison instead of
Suggested edit
This correction targets the command contract stated in the directive.
|
||
| 6. **Fail fast, and delete before you abstract.** Reject invalid input at the boundary with a typed error; never fall back silently to a degraded path (that includes silent Python fallbacks for Rust-owned paths). Prefer deleting code to adding a layer. No new trait until there are two real implementations (a test double does not count). | ||
| 7. **Existing boundaries beat generic DRY.** Platform modules, Dylint-enforced layering (`dylints/ban_std_pathbuf`), crate boundaries and documented deliberate copies win over removing duplication. Do not copy code across a crate boundary to get around it -- say the boundary hurts. An undocumented copy is a finding under 2; a documented one is not. | ||
|
|
||
| ## Common Gotchas | ||
|
|
||
| - The installed `fastled` CLI on PATH may be a Python compatibility shim or stale script; the bundled native binary is `fastled[.exe]`. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the stale fail-loud reference from the native-Rust convention.
The PR objective says that the native-Rust convention no longer includes the fail-loud preference. This line still includes it. Keep the native-Rust preference here and leave the separate boundary rule in Design principle 6.
Suggested edit
The PR objective explicitly states that the fail-loud preference was removed from the native-Rust convention.
Committable suggestion