CI / CI configuration security checks (pull_request) Successful in 2s
CI / Capabilities and shell quality (pull_request) Successful in 15s
CI / Python tests and compilation (pull_request) Successful in 36s
CI / QMD unit tests (pull_request) Successful in 7s
CI / Build and inspect generated packages (pull_request) Successful in 16s
CI / Bash integration and installation guards (pull_request) Failing after 51s
CI / PowerShell tests on Ubuntu (pull_request) Failing after 1m45s
CI / Installed client configuration smoke tests (pull_request) Canceled after 1m24s
- Resolve contradictions: authorization is never a skipped "boundary check"; one browser token policy (BFF/HttpOnly cookies first, RFC 10017); one sanitizer-bypass rule; Angular responses are unknown until validated. - Add security rules for AI/LLM integration and Java XXE, concrete crypto and password-hashing parameters, and RFC 8725 JWT validation. - Update version-dependent guidance after checking official sources: Angular 22, TypeScript 6/7, Node 24+, .NET 10/C# 14, JDK 21-25, Spring Boot 4; add a Spring Boot and Spring Security topic. - Give every rule a unique level-1 title and scope line, keep language security files to language specifics, and fix routing for inbound vs outbound HTTP, XML parsing, and WPF/Angular parent rules. - Validate rule structure and routing in validate-config.py, with tests. - Fix CI issues found by a local run: shellcheck directive order, pinned ruff rule set, Invoke-Python test mock, CRLF-tolerant package checks, Windows-only credential test, and refreshed prompt-budget baselines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1.7 KiB
1.7 KiB
C# Architecture and APIs
Apply these rules when designing public APIs, service boundaries, or application architecture.
- Give APIs explicit, strongly typed contracts. On trusted internal paths, do not repeat format or argument validation the boundary already performed. Authorization, resource ownership, and tenant scoping are never "already done": enforce them at the operation that accesses the data.
- Separate request models from persistence and domain models. Bind only fields the caller may set, and project only fields the caller may read.
- Authenticate and authorize before accessing protected resources. Keep the decision close to the protected operation, enforce resource ownership and tenant scope in the data access path, not only in the UI or route layer, and fail closed when identity, ownership, or policy evaluation is unavailable.
- Use explicit, bounded pagination for potentially large collections.
- Treat EF Core
DbContextas a short-lived, non-thread-safe unit of work: scoped per request in web apps, created throughIDbContextFactory<T>per operation in desktop apps and background services, never shared across threads or held as a singleton. UseAsNoTrackingfor read-only queries, and useFromSqlorFromSqlInterpolatedinstead of concatenating intoFromSqlRaw. - Keep application, domain, and infrastructure concerns separate. Avoid cross-layer coupling and service-locator patterns.
- Use dependency injection when substitution or lifecycle management is needed. Keep dependencies explicit and avoid excessive constructor dependencies.
- Preserve established project and public API conventions unless a concrete compatibility or correctness issue requires a change.