Architectural Constraint Enforcement Layer for AI-Generated Code
Linters catch style issues, SonarQube catches bugs, but zero tools enforce architectural constraints on AI-generated code. Developers report that AI output is syntactically perfect but architecturally wrong: duplicating caching layers, ignoring existing systems, violating GDPR patterns. A dev.to commenter nailed it: 'Most teams have CI that checks if code works but zero tooling that checks if code makes sense architecturally.'
The insight from the HN thread is that this should be DECLARATIVE, not analytical. Let architects write rules like 'all database access goes through the repository layer' or 'no direct HTTP calls outside the gateway service.' The tool then checks every PR against the ruleset. Think of it as ArchUnit but polyglot, CI-native, and with an LLM that can understand intent, not just import paths.
landscape (4 existing solutions)
Existing tools operate at the syntax/pattern level (Semgrep), the code smell level (SonarQube), or the evolutionary coupling level (CodeScene). None operate at the architectural constraint level: 'this system uses Service X for caching, do not introduce a competing cache.' The gap is a declarative constraint language that encodes architectural decisions and runs in CI.