Guard rules · 24 rules

These rules help teams make fewer mistakes — each one really runs at build time.

Generated by the build; matches what actually runs. · 2026-10-10T01:08:01.331Z

DomainBlocksHowFailure output
Layering and dependency directionapp layer importing infra.mapper directlyArchitecture assertionBuild fails and names the file and line
Dependency directionA handler returning an app-layer type, creating a reverse dependencyArchitecture assertionBuild fails
Banned patterns@Autowired field injection / controller reaching straight to MapperBanned-pattern assertionBuild fails and names the class
Banned patternsSystem.out / new Date() / domain referencing Spring WebBanned-pattern assertionBuild fails and names the class
Contract consistencyRegistered endpoint count not matching the real countConsistency testBuild fails and prints the difference
Permission-code consistencyReferencing an unregistered permission-code constantConsistency testBuild fails and lists every reference
Permission-code consistencyA permission-code literal appearing in codeRepository-wide scanBuild fails and lists file and line
Deny-by-default authorizationA new endpoint without an auth annotationStartup guardStartup fails; anonymous access returns a fixed error code
Data accessHand-written XML query missing the soft-delete conditionSQL assertionTest fails and prints the real SQL
Transaction boundary@Transactional appearing in the repository layerArchitecture assertionBuild fails and names the method
Migration scriptsModifying an already applied migrationChangeset checkBuild fails and names the script
Reproducible buildsCommitting unformatted codeCommit hook plus CIThe commit is rejected
Layering and dependency directiondomain layer depending on an app-layer DTOArchitecture assertionBuild fails and names the file and line
Dependency directioncommon layer referencing a business module backArchitecture assertionBuild fails and names the file and line
Banned patternsnew Thread and self-built thread poolsBanned-pattern assertionBuild fails and names the class
Contract consistencyError-code ranges not matching the registryConsistency testBuild fails and prints the difference
Data accessAn unannotated field entering a query conditionCondition allowlistThe condition is dropped and a warning is raised
Data accessUnescaped wildcards in a fuzzy searchAutomatic escaping by the frameworkNo error; injection-style matching is impossible
Data accessPagination without a stable sort causing jitter across pagesSort allowlist plus fallback sortNo error; row order stays stable
Migration scriptsA new changeset whose sequence goes backwards or repeatsChangeset checkBuild fails and names the script
Logging and maskingPhone numbers or passwords in clear text in logsSerialization maskingNo error; the output is already masked
ObservabilityAsync entry points losing the traceIdExecutor propagationNo error; all five entry points read the same value
Reproducible buildsA dependency without a locked versionVersion catalog lockBuild fails
Reproducible buildsMissing test skeleton leaving generated code unable to buildGenerator ships testsBuild fails

Domain

Layering and dependency direction

2 rules

Dependency direction

2 rules

Banned patterns

3 rules

Contract consistency

2 rules

Permission-code consistency

2 rules

Deny-by-default authorization

1 rules

Data access

4 rules

Transaction boundary

1 rules

Migration scripts

2 rules

Reproducible builds

3 rules

Logging and masking

1 rules

Observability

1 rules

By the way: code that fails the architecture check cannot be merged.