Skip to content

Document HIDAPI API usage contract for AI coding agents - #834

Merged
Youw merged 1 commit into
masterfrom
document-api-usage-contract
Aug 14, 2026
Merged

Document HIDAPI API usage contract for AI coding agents#834
Youw merged 1 commit into
masterfrom
document-api-usage-contract

Conversation

@Youw

@Youw Youw commented Aug 14, 2026

Copy link
Copy Markdown
Member

Adds a "HIDAPI API usage contract" section to AGENTS.md documenting the library lifecycle (hid_init first, hid_exit last and only after all devices are closed, neither ever concurrent with anything else) and the multi-threading rules from the Multi‐threading Notes wiki page, which remains the authoritative reference.

It also states explicitly that a finding whose trigger requires violating that contract — e.g. calling hid_exit() while other threads still use the API, or unsynchronized concurrent first-time initialization — is application misuse rather than a library defect, and must not be reported as a bug or "fixed" by adding synchronization. The intent is to stop AI reviewers and agents from repeatedly raising contract-violating scenarios as defects, and to keep generated example/test code within the supported usage.

Related to: #788

Assisted-by: claude-code:claude-opus-5

Add a section describing the library lifecycle and the multi-threading
rules HIDAPI expects of its callers, so AI agents review and generate
code against the intended contract instead of reporting contract
violations as library defects.

Assisted-by: claude-code:claude-opus-5
@Youw
Youw merged commit 852cc68 into master Aug 14, 2026
28 checks passed
@Youw
Youw deleted the document-api-usage-contract branch August 14, 2026 11:16
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.

1 participant