Skip to content

Commit e3abe92

Browse files
krokokobgagent
andauthored
chore(project): quality improvements (#242)
* chore(docs): update review pr command * chore(quality): add coverage enforcement and check drifts * fix(project): fix build and implement reviewer feedback --------- Co-authored-by: bgagent <bgagent@noreply.github.com>
1 parent 80bf1f8 commit e3abe92

14 files changed

Lines changed: 292 additions & 7 deletions

File tree

.abca/commands/review_pr.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,24 @@ Then apply principal-architect judgment over the diff:
7878
- **Routing** — Changes should land in the right package per the AGENTS.md routing table
7979
(agent runtime in `agent/`, API/Lambdas in `cdk/`, CLI in `cli/`).
8080

81+
**Human review heuristics (non-automatable)** — After automated agents, apply these four
82+
dimensions. They are where agent output often looks plausible but isn't. Flag blocking issues when
83+
a dimension is clearly violated:
84+
85+
- **Proportionality** — Does complexity match the problem? (new abstraction/factory/"engine"
86+
for a one-off → AI002/AI003; files >800 lines — is size essential or accreted?)
87+
- **Coherence** — Does it belong here? Same concept = same term across the repo? Parallel
88+
structure with real substance, not copy-paste boilerplate (AI006)?
89+
- **Clarity** — Do names communicate intent? Does error handling surface failures or hide
90+
them behind plausible defaults (AI004)? Magic values that should live in
91+
`contracts/constants.json` (AI007)?
92+
- **Appropriateness** — Maintainable by this team? Integration code verified against *real*
93+
API behavior, not only self-written mocks (AI001)? Tests assert what code *should* do,
94+
not merely what it *does* (AI005)?
95+
96+
Include a **Human heuristics** subsection in Stage 5 output: one bullet per dimension
97+
(pass or concern with `file:line` when applicable).
98+
8199
### Stage 4: Documentation — Did We Update It Where Needed?
82100

83101
Documentation drift is a blocking concern on this repo. Check:
@@ -112,5 +130,7 @@ Summarize as a principal architect would in a PR review. Structure the output:
112130
7. **Review agents run** — List each plugin/agent you invoked (Stage 3) and, for any in-scope
113131
agent you omitted, the one-line reason. This section is required — its absence means the
114132
mandatory plugin step was skipped.
133+
8. **Human heuristics** — Proportionality, Coherence, Clarity, Appropriateness (pass or concern
134+
per dimension; cite `file:line` when not pass).
115135

116136
Be specific and actionable. Prefer concrete diffs over vague advice.

.github/workflows/build.yml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.gitignore

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.pre-commit-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,14 @@ repos:
8787
files: ^(contracts/constants\.json$|agent/src/policy\.py$|cdk/src/handlers/shared/types\.ts$|cdk/src/constructs/blueprint\.ts$|scripts/check-constants-sync\.ts$)
8888
stages: [pre-commit]
8989

90+
- id: coverage-thresholds-sync
91+
name: coverage threshold drift (contracts/coverage-thresholds.json)
92+
entry: bash -lc 'cd "$(git rev-parse --show-toplevel)" && mise run check:coverage-thresholds-sync'
93+
language: system
94+
pass_filenames: false
95+
files: ^(contracts/coverage-thresholds\.json$|cdk/package\.json$|cli/package\.json$|agent/(pyproject\.toml|mise\.toml)$|scripts/check-coverage-thresholds-sync\.ts$)
96+
stages: [pre-commit]
97+
9098
- id: monorepo-security-pre-push
9199
name: security scans (pre-push)
92100
entry: bash -lc 'cd "$(git rev-parse --show-toplevel)" && mise run hooks:pre-push:security'

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ Rules:
5454
- The PR title and description become the squash commit message, so keep them accurate throughout the review.
5555
- The CI workflow runs `mise run install` then `mise run build` (compile + lint + test + synth + security scans for all packages).
5656
- Iterate on review feedback by pushing new commits to the same branch. Maintainers squash-merge when approved.
57+
- For structured reviews (human or agent), use the [`review_pr` command](https://github.com/aws-samples/sample-autonomous-cloud-coding-agents/blob/main/.abca/commands/review_pr.md) — including the **human review heuristics** (Proportionality, Coherence, Clarity, Appropriateness) for smell dimensions automation cannot catch.
5758

5859
### PR checklist
5960

agent/mise.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ description = "Type check with ty"
4141
run = "uv run ty check"
4242

4343
[tasks.test]
44-
description = "Run tests with pytest"
45-
run = "uv run pytest"
44+
description = "Run tests with pytest (coverage floor enforced; use `uv run pytest --no-cov` for focused runs)"
45+
run = "uv run pytest --cov=src --cov-branch --cov-fail-under=72 --cov-report=term-missing:skip-covered --cov-report=lcov:coverage/lcov.info --cov-report=json:coverage/coverage.json"
4646

4747
# SECURITY
4848

agent/pyproject.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ dev = [
5353
"ty",
5454
"pytest",
5555
"pygments==2.20.0",
56+
"pytest-cov==7.1.0",
5657
]
5758

5859
[tool.ruff]
@@ -87,6 +88,17 @@ ignore = [
8788
testpaths = ["tests"]
8889
pythonpath = ["src"]
8990

91+
[tool.coverage.run]
92+
branch = true
93+
source = ["src"]
94+
relative_files = true
95+
96+
[tool.coverage.report]
97+
fail_under = 72
98+
precision = 2
99+
show_missing = true
100+
skip_covered = true
101+
90102
[tool.ty.environment]
91103
python-version = "3.13"
92104
extra-paths = ["src"]

0 commit comments

Comments
 (0)