Skip to content

chore: Setup AI agent infrastructure - #202

Draft
voidvore wants to merge 2 commits into
OpenGamingCollective:mainfrom
voidvore:feat/ai-agent-infrastructure
Draft

chore: Setup AI agent infrastructure#202
voidvore wants to merge 2 commits into
OpenGamingCollective:mainfrom
voidvore:feat/ai-agent-infrastructure

Conversation

@voidvore

@voidvore voidvore commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR introduces comprehensive AI agent support infrastructure for the asusctl project. To streamline AI-assisted development workflows across modern agentic tools (Claude, Cursor, OpenCode, Antigravity, etc.), it establishes the standard .agents/ workspace directory, sub-agents, and skill files.

Roadmap

  • Create CONTRIBUTING_AGENTS.md (Research-backed human governance guide for maintaining AGENTS.md)
  • Populate AGENTS.md
  • Add sub-agents (.agents/agents/)
  • Add skill files (.agents/skills/)

Summary by CodeRabbit

  • Documentation

    • Added an ASUSCTL contributor guide describing key project areas and where to find them.
    • Added maintainer guidance for organizing, updating, and reviewing contributor instructions, including recommendations for keeping documentation clear and efficient.
  • Chores

    • Updated repository ignore rules for agent-related configuration while preserving essential contributor documentation files.

- Add .agents/AGENTS.md: AI contributor guide with project overview and crate map
- Add .agents/CONTRIBUTING_AGENTS.md: research-backed governance guide for editing AGENTS.md
- Update .gitignore: track AGENTS.md and CONTRIBUTING_AGENTS.md, ignore rest of .agents/ and .opencode
@luytan

luytan commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: a9bc5728-80b2-4f24-8c22-18e96de03675

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds .agents documentation describing ASUSCTL project areas, contributor governance, research findings, and AI feedback procedures. Updates .gitignore to ignore agent tooling content while retaining the two documentation files.

Changes

Agent guidance and repository tracking

Layer / File(s) Summary
Contributor and governance guidance
.agents/AGENTS.md, .agents/CONTRIBUTING_AGENTS.md
Adds ASUSCTL project-area guidance and human-maintained rules for structuring, reviewing, and updating AGENTS.md.
Agent file ignore rules
.gitignore
Ignores .opencode and most .agents content while preserving AGENTS.md and CONTRIBUTING_AGENTS.md.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description includes a summary and roadmap, but it omits the required issue reference, tested hardware/environment, and verification checklist. Add the missing template sections: issue reference, tested hardware and environment details, and the verification/testing checklist.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the PR’s main change: adding AI agent infrastructure.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.agents/AGENTS.md:
- Around line 7-27: Fix the overview table in AGENTS.md so its structure is
consistent: either add a meaningful Description cell to every area row, or
remove the Description column from the header and separator. Preserve all
existing area names and locations.

In @.agents/CONTRIBUTING_AGENTS.md:
- Around line 8-20: Update the Table of Contents anchors in
CONTRIBUTING_AGENTS.md to match the generated heading IDs, including
emoji-prefixed IDs and the full “Sub-Agent Usage and Setup Guidelines” heading.
Correct all affected entries, including the anchors for Why This File Exists,
Research Findings, Contributor Conclusions, Sub-Agent Usage, and Note to
Maintainers, so markdownlint MD051 passes.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ac98ef57-6a66-4398-baca-fda4c8c6dae0

📥 Commits

Reviewing files that changed from the base of the PR and between 8733b58 and be288cb.

📒 Files selected for processing (3)
  • .agents/AGENTS.md
  • .agents/CONTRIBUTING_AGENTS.md
  • .gitignore
📜 Review details
🧰 Additional context used
🪛 LanguageTool
.agents/AGENTS.md

[uncategorized] ~27-~27: The official name of this software platform is spelled with a capital “H”.
Context: ...ackaging/| | CI/CD (GitHub Actions) |.github/` |

(GITHUB)

.agents/CONTRIBUTING_AGENTS.md

[style] ~38-~38: Consider shortening or rephrasing this to strengthen your wording.
Context: ...earch Findings > [!IMPORTANT] > Before making changes to the AGENTS.md fil...

(MAKE_CHANGES)


[grammar] ~64-~64: Use a hyphen to join words.
Context: ...le files function primarily as a context priming signal that activates structured...

(QB_NEW_EN_HYPHEN)

🪛 markdownlint-cli2 (0.23.1)
.agents/AGENTS.md

[warning] 9-9: Table column count
Expected: 3; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


[warning] 10-10: Table column count
Expected: 3; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


[warning] 11-11: Table column count
Expected: 3; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


[warning] 12-12: Table column count
Expected: 3; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


[warning] 13-13: Table column count
Expected: 3; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


[warning] 14-14: Table column count
Expected: 3; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


[warning] 15-15: Table column count
Expected: 3; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


[warning] 16-16: Table column count
Expected: 3; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


[warning] 17-17: Table column count
Expected: 3; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


[warning] 18-18: Table column count
Expected: 3; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


[warning] 19-19: Table column count
Expected: 3; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


[warning] 20-20: Table column count
Expected: 3; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


[warning] 21-21: Table column count
Expected: 3; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


[warning] 22-22: Table column count
Expected: 3; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


[warning] 23-23: Table column count
Expected: 3; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


[warning] 24-24: Table column count
Expected: 3; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


[warning] 25-25: Table column count
Expected: 3; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


[warning] 26-26: Table column count
Expected: 3; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


[warning] 27-27: Table column count
Expected: 3; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)

.agents/CONTRIBUTING_AGENTS.md

[warning] 10-10: Link fragments should be valid

(MD051, link-fragments)


[warning] 11-11: Link fragments should be valid

(MD051, link-fragments)


[warning] 16-16: Link fragments should be valid

(MD051, link-fragments)


[warning] 17-17: Link fragments should be valid

(MD051, link-fragments)


[warning] 20-20: Link fragments should be valid

(MD051, link-fragments)

🔇 Additional comments (1)
.gitignore (1)

28-33: LGTM!

Comment thread .agents/AGENTS.md Outdated
Comment on lines +7 to +27
| Area | Location | Description |
|------|----------|-------------|
| asus-shutdown | `asus-shutdown/` |
| asusctl (CLI) | `asusctl/` |
| asusd (system D-Bus daemon) | `asusd/` |
| asusd-user (user D-Bus daemon) | `asusd-user/` |
| config-traits | `config-traits/` |
| dmi-id | `dmi-id/` |
| rog-platform | `rog-platform/` |
| rog-dbus | `rog-dbus/` |
| rog-anime | `rog-anime/` |
| rog-aura | `rog-aura/` |
| rog-profiles | `rog-profiles/` |
| rog-control-center | `rog-control-center/` |
| rog-slash | `rog-slash/` |
| rog-scsi | `rog-scsi/` |
| simulators | `simulators/` |
| data (service files, udev rules) | `data/` |
| extra (icons, web assets) | `extra/` |
| distro-packaging | `distro-packaging/` |
| CI/CD (GitHub Actions) | `.github/` | No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Fix the malformed overview table.

The header declares three columns, but every data row has only two cells, so the Description column is missing. Add a description to each row or remove that column from the header and separator.

Proposed minimal fix
-| Area | Location | Description |
-|------|----------|-------------|
+| Area | Location |
+|------|----------|
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
| Area | Location | Description |
|------|----------|-------------|
| asus-shutdown | `asus-shutdown/` |
| asusctl (CLI) | `asusctl/` |
| asusd (system D-Bus daemon) | `asusd/` |
| asusd-user (user D-Bus daemon) | `asusd-user/` |
| config-traits | `config-traits/` |
| dmi-id | `dmi-id/` |
| rog-platform | `rog-platform/` |
| rog-dbus | `rog-dbus/` |
| rog-anime | `rog-anime/` |
| rog-aura | `rog-aura/` |
| rog-profiles | `rog-profiles/` |
| rog-control-center | `rog-control-center/` |
| rog-slash | `rog-slash/` |
| rog-scsi | `rog-scsi/` |
| simulators | `simulators/` |
| data (service files, udev rules) | `data/` |
| extra (icons, web assets) | `extra/` |
| distro-packaging | `distro-packaging/` |
| CI/CD (GitHub Actions) | `.github/` |
| Area | Location |
|------|----------|
| asus-shutdown | `asus-shutdown/` |
| asusctl (CLI) | `asusctl/` |
| asusd (system D-Bus daemon) | `asusd/` |
| asusd-user (user D-Bus daemon) | `asusd-user/` |
| config-traits | `config-traits/` |
| dmi-id | `dmi-id/` |
| rog-platform | `rog-platform/` |
| rog-dbus | `rog-dbus/` |
| rog-anime | `rog-anime/` |
| rog-aura | `rog-aura/` |
| rog-profiles | `rog-profiles/` |
| rog-control-center | `rog-control-center/` |
| rog-slash | `rog-slash/` |
| rog-scsi | `rog-scsi/` |
| simulators | `simulators/` |
| data (service files, udev rules) | `data/` |
| extra (icons, web assets) | `extra/` |
| distro-packaging | `distro-packaging/` |
| CI/CD (GitHub Actions) | `.github/` |
🧰 Tools
🪛 LanguageTool

[uncategorized] ~27-~27: The official name of this software platform is spelled with a capital “H”.
Context: ...ackaging/| | CI/CD (GitHub Actions) |.github/` |

(GITHUB)

🪛 markdownlint-cli2 (0.23.1)

[warning] 9-9: Table column count
Expected: 3; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


[warning] 10-10: Table column count
Expected: 3; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


[warning] 11-11: Table column count
Expected: 3; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


[warning] 12-12: Table column count
Expected: 3; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


[warning] 13-13: Table column count
Expected: 3; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


[warning] 14-14: Table column count
Expected: 3; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


[warning] 15-15: Table column count
Expected: 3; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


[warning] 16-16: Table column count
Expected: 3; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


[warning] 17-17: Table column count
Expected: 3; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


[warning] 18-18: Table column count
Expected: 3; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


[warning] 19-19: Table column count
Expected: 3; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


[warning] 20-20: Table column count
Expected: 3; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


[warning] 21-21: Table column count
Expected: 3; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


[warning] 22-22: Table column count
Expected: 3; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


[warning] 23-23: Table column count
Expected: 3; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


[warning] 24-24: Table column count
Expected: 3; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


[warning] 25-25: Table column count
Expected: 3; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


[warning] 26-26: Table column count
Expected: 3; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)


[warning] 27-27: Table column count
Expected: 3; Actual: 2; Too few cells, row will be missing data

(MD056, table-column-count)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.agents/AGENTS.md around lines 7 - 27, Fix the overview table in AGENTS.md
so its structure is consistent: either add a meaningful Description cell to
every area row, or remove the Description column from the header and separator.
Preserve all existing area names and locations.

Source: Linters/SAST tools

Comment thread .agents/CONTRIBUTING_AGENTS.md Outdated
Comment on lines +8 to +20
## 📋 Table of Contents

1. [Why This File Exists](#why-this-file-exists)
2. [Research Findings](#research-findings)
- [1. Instruction File Structure & Impact (Instructions-as-Code)](#1-instruction-file-structure--impact-instructions-as-code)
- [2. Rule Polarity & Context Priming (Guardrails vs. Guidance)](#2-rule-polarity--context-priming-guardrails-vs-guidance)
- [3. Repository Context Overhead & Minimalist Design (AGENTS.md Evaluation)](#3-repository-context-overhead--minimalist-design-agentsmd-evaluation)
- [4. Closed-Loop Review Feedback & Behavioral Rule Accumulation (Self-Improving Agents)](#4-closed-loop-review-feedback--behavioral-rule-accumulation-self-improving-agents)
3. [Contributor Conclusions](#contributor-conclusions)
- [Sub-Agent Usage](#sub-agent-usage)
- [Performance and Flow Configuration](#performance-and-flow-configuration)
- [Documentation File Method](#documentation-file-method)
4. [Note to Maintainers: AI Feedback Loop](#note-to-maintainers-ai-feedback-loop)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Fix the broken table-of-contents anchors.

These entries do not resolve to their headings. Update them to match the generated heading IDs, including the emoji-prefixed headings and the full Sub-Agent Usage and Setup Guidelines heading—for example, #-why-this-file-exists, #-research-findings, #-contributor-conclusions, #sub-agent-usage-and-setup-guidelines, and #-note-to-maintainers-ai-feedback-loop.

markdownlint reports these as MD051 link-fragment errors.

🧰 Tools
🪛 markdownlint-cli2 (0.23.1)

[warning] 10-10: Link fragments should be valid

(MD051, link-fragments)


[warning] 11-11: Link fragments should be valid

(MD051, link-fragments)


[warning] 16-16: Link fragments should be valid

(MD051, link-fragments)


[warning] 17-17: Link fragments should be valid

(MD051, link-fragments)


[warning] 20-20: Link fragments should be valid

(MD051, link-fragments)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.agents/CONTRIBUTING_AGENTS.md around lines 8 - 20, Update the Table of
Contents anchors in CONTRIBUTING_AGENTS.md to match the generated heading IDs,
including emoji-prefixed IDs and the full “Sub-Agent Usage and Setup Guidelines”
heading. Correct all affected entries, including the anchors for Why This File
Exists, Research Findings, Contributor Conclusions, Sub-Agent Usage, and Note to
Maintainers, so markdownlint MD051 passes.

Source: Linters/SAST tools

- Relocate .agents/AGENTS.md to the repo root (AGENTS.md standard)
- Populate the overview table descriptions and add a "What not to do" rule
- Fix CONTRIBUTING_AGENTS.md TOC anchors (MD051) and point AGENTS.md
  links to /AGENTS.md
- Drop the obsolete .agents/AGENTS.md negation from .gitignore
@voidvore
voidvore force-pushed the feat/ai-agent-infrastructure branch from be288cb to 846c335 Compare July 28, 2026 21:12
@scardracs

scardracs commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

If you are interested these are the rules I had set to my AI. If you think any of these can be of help feel fre to pick them up

Asusctl Repository & Agent Governance Rules

This document outlines the strict guidelines, coding standards, daemon architecture rules, safety constraints, and Git workflow policies required when working on the asusctl repository.

Important

Core Principle: Code quality, memory safety, and daemon stability ALWAYS take absolute precedence over implementation speed or temporary workarounds. Every change must be robust, production-grade, and empirical-verified.


1. Git & Workflow Guidelines

1.1. Never Bypass Git Hooks

  • Strict Enforcement: Do NOT use --no-verify or -n flags with git commit or git push.
  • Requirement: All commits and pushes must allow standard git hooks (pre-commit and pre-push) to execute and pass cleanly.

1.2. Explicit Push Authorization

  • No Auto-Push: Never execute git push without explicit, real-time user approval.
  • Single Event Scope: Approval applies strictly to that specific push event. Subsequent pushes require new, dedicated confirmation.

1.3. Clean Local Checks

Before creating any commit, the codebase must pass all local verification checks specified in Section 5.1 with zero errors and zero warnings.

Important

Every single commit must maintain flawless formatting and zero warnings across all workspace crates.

1.4. Atomic Commits & Standardized Commit Messages

  • Independently Buildable & Logical Commits: Each commit in the repository history must represent a single, self-contained, logical unit of work that is independently buildable and passes all local verification checks (Section 5.1).
  • No Trailing Fix Commits: When bringing fixes, formatting adjustments, or lint resolutions for changes introduced in a feature branch, do NOT create trailing fix commits (e.g., fix text, fix clippy). Amend or rebase the fix directly into the relevant original commit so the git history consists strictly of clean, logical feature/refactor commits.
  • Conventional Commit Standard: Commit messages must strictly follow Conventional Commits formatting (e.g., feat:, fix:, refactor:, docs:, chore:) to support automated CHANGELOG.md generation.

2. Rust Safety & Code Quality Rules

2.1. Prohibition of .unwrap()

  • No Blind Unwraps: Avoid calling .unwrap() on Option or Result types in production daemon and library code to prevent runtime panics.
  • Preferred Handling:
    • Use proper error propagation with the ? operator and RogError / custom domain errors.
    • Use pattern matching (match, if let) or safe fallback combinators (unwrap_or, unwrap_or_else, ok_or).
    • If a value is guaranteed to be present by prior invariant checks, use .expect("Clear explanation of why this cannot fail") instead of .unwrap().

2.2. Strict Control of unsafe Code

  • Default Stance: Avoid unsafe blocks whenever safe Rust abstractions or standard library utilities can achieve the same result.
  • FFI & Kernel Interactions: If an unsafe block is strictly necessary (e.g., raw C FFI calls or kernel ioctls), it must strictly follow these rules:
    1. Minimize the scope of the unsafe block to only the specific unsafe call.
    2. Mandatory Safety Documentation: Every unsafe block MUST be immediately preceded by a detailed // SAFETY: comment explaining why the invariants hold and why the operation is memory-safe and sound.

2.3. Extended Linting with cargo cranky

  • Code changes must satisfy the strict lint set configured in Cranky.toml.
  • Run cargo cranky to catch extra lints such as mutex integrity, unwanted todo! or unimplemented! macros, string allocation inefficiencies, and unhandled async locks.

2.4. Prohibition of println! in Favor of Structured Logging Macros

  • No Direct Standard Output Printing: Avoid println! or eprintln! for status, warnings, or error reporting across daemon, library, and CLI modules.
  • Standardized Logging & Error Propagation:
    • Use structured logging macros from the log crate (info!, warn!, error!, debug!, trace!).
    • Return explicit Err(...) variants or propagate errors using the ? operator instead of printing messages and swallowing failures with Ok(()).

3. Daemon & Architecture Design Patterns

3.1. Daemon Controller Pattern

  • All controller components in asusd must implement standard daemon traits where applicable:
    • GetSupported: Checks if hardware/kernel features required by the controller are available.
    • Reloadable: For controllers requiring state reload on startup or signal.
    • CtrlTask: For background task loops, logind event handling (suspend/resume/boot), and file watching.
    • ZbusAdd: For exposing controller interfaces to the D-Bus system bus via zbus.

3.2. Concurrency & Locking Safety

  • Async Mutex Usage: Controllers shared across tasks or D-Bus handlers must use async-compatible locks (e.g., Arc<Mutex<T>>).
  • Deadlock Prevention in Task Loops:
    • Avoid blocking execution in event dispatch loops.
    • Use non-blocking try_lock() inside task event callbacks (e.g., self.create_sys_event_tasks(...)) to prevent thread deadlocks when system events fire concurrently.

3.3. D-Bus Interface Standards & Backward Compatibility (zbus)

  • Implement D-Bus methods on dedicated wrapper structs (e.g., Ctrl<Name>Zbus).
  • Use Self::add_to_server_helper under standard object paths (e.g., /org/asuslinux/<Feature>).
  • Backward Compatibility: Preserve existing D-Bus signatures and object paths so external clients (rog-control-center, GNOME extensions, asusctl CLI) do not break.

3.4. Kernel & Sysfs Attribute Resilience across ASUS Laptop Models

  • Extensive ASUS Hardware Diversity: ASUS produces a vast array of laptop series (ROG Strix, Zephyrus, TUF, ZenBook, Vivobook, ProArt, Ally) with varying ACPI/WMI tables, EC registers, sysfs attributes, and kernel driver support across Linux releases.
  • No Single-Machine Invariant Assumptions: Never assume that a hardware feature, sysfs path, or ACPI WMI call present on one test machine exists or behaves identically on all ASUS laptops.
  • Dynamic Probing & Graceful Feature Degradation: Always check path availability dynamically at runtime (GetSupported, non-blocking file checks, udev enumeration). If a hardware capability is missing or unsupported on a given model, degrade gracefully (or fallback to virtual software equivalents where applicable) without crashing the daemon or emitting spurious fatal errors.
  • Strict Input/Output Parsing: Parse and validate all strings read from or written to sysfs/debugfs nodes before casting to Rust enums or numeric types.

3.5. Safe Configuration Schema & Fallbacks

  • When modifying configuration structs (in config-traits or /etc/asusd/), always provide sensible default implementations (Default trait).
  • Ensure schema updates support graceful fallback and migration so existing user configurations are never corrupted or reset silently during daemon upgrades.

4. Code Integrity & Error Handling

4.1. No Symptom Patching

  • Never swallow exceptions, return dummy fallback values, or comment out failing assertions to make tests pass.
  • Trace errors back to their root cause in hardware sysfs attributes, D-Bus messages, or async task orchestration.

4.2. Preserving Comments & Documentation

  • Preserve all existing code comments, docstrings, and architectural descriptions unless explicitly asked to modify them.
  • Document public functions, trait implementations, and D-Bus methods clearly.

5. Verification & Testing Protocol

5.1. Verification Before Completion

  • Never mark a task as complete without empirical runtime verification.
  • Always execute build and check commands:
    cargo check --all-targets
    cargo test --all
    cargo clippy --all -- -D warnings
    cargo cranky
    cargo fmt --all -- --check

5.2. Log Inspection

  • Inspect full un-truncated logs (journalctl, asusd daemon logs, or test tracebacks) before diagnosing failures or proposing fixes.

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.

3 participants