Skip to content

Feature: Add production reliability and data-readiness checks across languages - #67

Merged
alxxjohn merged 8 commits into
mainfrom
feature/production-reliability-data-readiness
Jul 27, 2026
Merged

Feature: Add production reliability and data-readiness checks across languages#67
alxxjohn merged 8 commits into
mainfrom
feature/production-reliability-data-readiness

Conversation

@alxxjohn

Copy link
Copy Markdown
Contributor

Summary

This PR adds the first production-readiness rule families to CodeGuard: Reliability and Data Correctness, plus a diff-mode
pr_summary.production_risk artifact.

The goal is to move CodeGuard beyond general code quality checks and into production-safety review: detecting outage risks,
unsafe retry behavior, missing cleanup/cancellation, data-loss patterns, idempotency gaps, dual writes, unsafe pagination,
unbounded reads, cache policy gaps, and unsafe rolling schema migrations.

This branch adds coverage across:

  • Go
  • Python
  • TypeScript
  • JavaScript
  • C++

Major changes

Reliability checks

Adds a new Reliability section with config, catalog metadata, fix templates, SDK aliases, profile/default wiring, and detector
implementations.

Implemented rule IDs include:

  • reliability.missing-timeout
  • reliability.unbounded-retry
  • reliability.retry-without-backoff
  • reliability.non-idempotent-retry
  • reliability.missing-cancellation
  • reliability.unbounded-work
  • reliability.missing-concurrency-limit
  • reliability.resource-leak
  • reliability.partial-failure-hidden
  • reliability.missing-graceful-shutdown
  • reliability.swallowed-error
  • reliability.lost-error-context
  • reliability.recoverable-panic

Coverage includes language-specific heuristics for HTTP timeout evidence, retry/backoff/idempotency patterns, unbounded async/
thread/goroutine work, cleanup/resource ownership, swallowed errors, generic exceptions/panics, and Go cancellation/shutdown
patterns.

Data Correctness checks

Adds a new Data Correctness section with config, catalog metadata, fix templates, SDK aliases, profile/default wiring, and
detector implementations.

Implemented rule IDs include:

  • data.read-modify-write-race
  • data.missing-transaction-boundary
  • data.side-effect-in-transaction
  • data.non-idempotent-consumer
  • data.missing-deduplication
  • data.unsafe-dual-write
  • data.missing-outbox-strategy
  • data.unstable-pagination
  • data.unbounded-read
  • data.exactly-once-assumption
  • data.cache-without-policy

Coverage includes transaction-boundary gaps, unsafe dual writes, missing outbox evidence, idempotency/deduplication gaps in
consumers, unstable offset pagination, unbounded reads, exactly-once assumptions, and cache writes without TTL/policy evidence.

Production risk artifact

Adds an additive diff-mode pr_summary.production_risk artifact.

It rolls up reliability, data-correctness, and unsafe schema-migration findings into deterministic PR-level risk evidence. This
does not change individual finding severity, SARIF output, GitHub annotations, or the existing text summary behavior.

Contract migration compatibility

Adds contracts.non-expand-contract-migration as the production-readiness migration signal.

The scanner now emits this alongside the existing contracts.migration-destructive finding. This preserves compatibility with
existing waivers/baselines while allowing production-risk scoring to treat non-expand/contract migrations as data-correctness
risk.

Tests and coverage

Adds broad positive and negative tests for reliability/data detectors across Go, Python, TypeScript, JavaScript, and C++.

The tests cover both risky patterns and safe patterns, including bounded HTTP calls, concurrency limits, transaction/outbox/
idempotency evidence, TTL cache writes, bounded queries, and deterministic pagination.

Docs and examples

Updates:

  • docs/checks.md
  • docs/features.md
  • docs/production.md
  • examples/codeguard.json

These now document the new reliability, data, and production_risk config surfaces and implemented behavior.

Validation

Passed:

go test ./tests/checks -run 'Test(Reliability|Data)'
go test ./internal/codeguard/checks/reliability ./internal/codeguard/checks/data ./tests/cli -run
'TestSDKRuleMetadataFor(Reliability|Data)'
go test ./tests/checks -run 'TestContracts(Migration|FullScan)'
go test ./tests/cli -run 'TestSDKRuleMetadataFor(Reliability|Data|NonExpand)'
go test ./...
make codeguard-ci
make ci

go test ./... and make ci were run with localhost access allowed for existing httptest suites.

Notes for reviewers

The new non-Go detectors are intentionally heuristic/confidence-based where full semantic proof would require framework-specific
analyzers. The tests include safe-pattern negatives to keep the first rollout from being purely noisy positive detection.

The branch keeps rollout staged through config/profile wiring rather than making every new production-readiness rule globally
blocking by default.

@alxxjohn
alxxjohn merged commit c243ead into main Jul 27, 2026
16 checks passed
alxxjohn added a commit that referenced this pull request Jul 27, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.3.0](v1.2.2...v1.3.0)
(2026-07-27)


### Features

* add abstraction quality checks
([fc5a7ec](fc5a7ec))
* add change safety diff detectors
([ebc2f80](ebc2f80))
* add change safety PR summary metrics
([5b10ecd](5b10ecd))
* add delivery governance checks
([eb1b803](eb1b803))
* add local quality precision rules
([dd75b79](dd75b79))
* add local quality precision rules
([00c493e](00c493e))
* add observability and operations checks
([3e8713c](3e8713c))
* add operability, design, and delivery governance checks
([#70](#70))
([a52199a](a52199a))
* add opt-in recommended check defaults
([1680b21](1680b21))
* add opt-in recommended check defaults
([#66](#66))
([67510e3](67510e3))
* add production readiness rule families
([d58e8eb](d58e8eb))
* Add production reliability and data-readiness checks across languages
([#67](#67))
([c243ead](c243ead))
* add refused bequest smell detection
([053cb1a](053cb1a))
* add refused bequest smell detection
([#72](#72))
([4423aa4](4423aa4))
* add structural smell quality rules
([eefd8bd](eefd8bd))
* change safety testability refactors
([#69](#69))
([9081ad3](9081ad3))
* deepen code smell and maintainability precision checks
([#71](#71))
([d554347](d554347))
* deepen reliability parity checks
([fc8d769](fc8d769))
* expand production readiness language coverage
([588bf19](588bf19))
* scaffold change safety checks
([0b313d9](0b313d9))


### Bug Fixes

* dogfood production readiness coverage
([1110f4f](1110f4f))
* restore change testability detectors
([88f6df0](88f6df0))
* satisfy strict lint for change safety
([311716c](311716c))
* satisfy strict lint for operability governance
([abc9fd1](abc9fd1))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
@alxxjohn
alxxjohn deleted the feature/production-reliability-data-readiness branch July 28, 2026 14:04
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