- add build artifacts/report rule (.build) to AGENTS

- set DoD minimum automated test coverage to 80%
- extend reconcile scripts (ps1/sh) to ensure .gitignore contains .build/
- sync repository standards files to latest template
This commit is contained in:
Stefan Goppelt 2026-03-29 13:36:43 +02:00
parent 77ef79d858
commit bfb4a30ce8
4 changed files with 70 additions and 8 deletions

View File

@ -21,6 +21,10 @@ All project documentation files must be stored under `docs/`, except `README.md`
3. Prefer table-driven tests where they improve readability. 3. Prefer table-driven tests where they improve readability.
4. Run relevant tests locally before finishing changes. 4. Run relevant tests locally before finishing changes.
## Build Artifacts and Reports
1. Builder logs and generated reports must be created under `.build/`.
2. The `.build/` directory must be excluded from version control via `.gitignore`.
## Definition of Done (DoD) ## Definition of Done (DoD)
### Purpose ### Purpose
@ -31,7 +35,6 @@ The Definition of Done defines the minimum quality bar for every completed chang
- Every code change is covered by tests where applicable. - Every code change is covered by tests where applicable.
- New functionality includes new tests. - New functionality includes new tests.
- Bug fixes include at least one regression test. - Bug fixes include at least one regression test.
- Minimum code coverage is 80% (statements, measured with `go test -cover`).
1. Functional documentation 1. Functional documentation
- Implemented functionality is documented. - Implemented functionality is documented.
@ -58,7 +61,6 @@ The Definition of Done defines the minimum quality bar for every completed chang
### Review Checklist (Quick) ### Review Checklist (Quick)
- [ ] Change is implemented and meets acceptance criteria. - [ ] Change is implemented and meets acceptance criteria.
- [ ] Tests were added/updated and pass. - [ ] Tests were added/updated and pass.
- [ ] Code coverage is at least 80%.
- [ ] Functionality is documented. - [ ] Functionality is documented.
- [ ] Documentation is in English. - [ ] Documentation is in English.
- [ ] Documentation is located under `docs/` (except `README.md` and `AGENTS.md`). - [ ] Documentation is located under `docs/` (except `README.md` and `AGENTS.md`).

View File

@ -10,7 +10,7 @@ This Definition of Done defines the minimum quality bar for every completed chan
- Every code change is covered by tests where applicable. - Every code change is covered by tests where applicable.
- New functionality includes new tests. - New functionality includes new tests.
- Bug fixes include at least one regression test. - Bug fixes include at least one regression test.
- Minimum code coverage is 80% (statements, measured with `go test -cover`). - Automated test coverage is at least 80%.
1. Functional documentation 1. Functional documentation
- Implemented functionality is documented. - Implemented functionality is documented.
@ -39,7 +39,7 @@ This Definition of Done defines the minimum quality bar for every completed chan
- [ ] Change is implemented and meets acceptance criteria. - [ ] Change is implemented and meets acceptance criteria.
- [ ] Tests were added/updated and pass. - [ ] Tests were added/updated and pass.
- [ ] Code coverage is at least 80%. - [ ] Automated test coverage is at least 80%.
- [ ] Functionality is documented. - [ ] Functionality is documented.
- [ ] Documentation is in English. - [ ] Documentation is in English.
- [ ] Documentation is located under `docs/` (except `README.md` and `AGENTS.md`). - [ ] Documentation is located under `docs/` (except `README.md` and `AGENTS.md`).

View File

@ -63,6 +63,34 @@ function Ensure-FileFromTemplate {
return 'updated' return 'updated'
} }
function Ensure-GitIgnoreBuildEntry {
param(
[string]$GitIgnorePath,
[switch]$OnlyCheck
)
if (-not (Test-Path -Path $GitIgnorePath -PathType Leaf)) {
if ($OnlyCheck) {
return 'drift'
}
Set-Content -Path $GitIgnorePath -Value '.build/'
return 'updated'
}
$lines = Get-Content -Path $GitIgnorePath
if ($lines -contains '.build/') {
return 'ok'
}
if ($OnlyCheck) {
return 'drift'
}
Add-Content -Path $GitIgnorePath -Value '.build/'
return 'updated'
}
function Invoke-ReconcileOnce { function Invoke-ReconcileOnce {
param([switch]$OnlyCheck) param([switch]$OnlyCheck)
@ -81,19 +109,21 @@ function Invoke-ReconcileOnce {
$repoPath = $repo.FullName $repoPath = $repo.FullName
$agentsTarget = Join-Path $repoPath 'AGENTS.md' $agentsTarget = Join-Path $repoPath 'AGENTS.md'
$dodTarget = Join-Path (Join-Path $repoPath 'docs') 'DEFINITION_OF_DONE.md' $dodTarget = Join-Path (Join-Path $repoPath 'docs') 'DEFINITION_OF_DONE.md'
$gitIgnoreTarget = Join-Path $repoPath '.gitignore'
$summary.scanned++ $summary.scanned++
$agentsState = Ensure-FileFromTemplate -Template $agentsTemplate -Target $agentsTarget -OnlyCheck:$OnlyCheck $agentsState = Ensure-FileFromTemplate -Template $agentsTemplate -Target $agentsTarget -OnlyCheck:$OnlyCheck
$dodState = Ensure-FileFromTemplate -Template $dodTemplate -Target $dodTarget -OnlyCheck:$OnlyCheck $dodState = Ensure-FileFromTemplate -Template $dodTemplate -Target $dodTarget -OnlyCheck:$OnlyCheck
$gitIgnoreState = Ensure-GitIgnoreBuildEntry -GitIgnorePath $gitIgnoreTarget -OnlyCheck:$OnlyCheck
if ($agentsState -eq 'updated' -or $dodState -eq 'updated') { if ($agentsState -eq 'updated' -or $dodState -eq 'updated' -or $gitIgnoreState -eq 'updated') {
$summary.updated++ $summary.updated++
Write-Host "UPDATED: $repoPath" Write-Host "UPDATED: $repoPath"
continue continue
} }
if ($agentsState -eq 'drift' -or $dodState -eq 'drift') { if ($agentsState -eq 'drift' -or $dodState -eq 'drift' -or $gitIgnoreState -eq 'drift') {
$summary.drift++ $summary.drift++
Write-Host "DRIFT: $repoPath" Write-Host "DRIFT: $repoPath"
continue continue

View File

@ -116,6 +116,34 @@ ensure_file() {
printf "%s" "updated" printf "%s" "updated"
} }
ensure_gitignore_build_entry() {
gitignore_path=$1
if [ ! -f "$gitignore_path" ]; then
if [ "$CHECK_ONLY" -eq 1 ]; then
printf "%s" "drift"
return 0
fi
printf '%s\n' '.build/' > "$gitignore_path"
printf "%s" "updated"
return 0
fi
if grep -Fqx '.build/' "$gitignore_path"; then
printf "%s" "ok"
return 0
fi
if [ "$CHECK_ONLY" -eq 1 ]; then
printf "%s" "drift"
return 0
fi
printf '\n%s\n' '.build/' >> "$gitignore_path"
printf "%s" "updated"
}
run_once() { run_once() {
scanned=0 scanned=0
updated=0 updated=0
@ -131,17 +159,19 @@ run_once() {
agents_target="$repo/AGENTS.md" agents_target="$repo/AGENTS.md"
dod_target="$repo/docs/DEFINITION_OF_DONE.md" dod_target="$repo/docs/DEFINITION_OF_DONE.md"
gitignore_target="$repo/.gitignore"
agents_state=$(ensure_file "$AGENTS_TEMPLATE" "$agents_target") agents_state=$(ensure_file "$AGENTS_TEMPLATE" "$agents_target")
dod_state=$(ensure_file "$DOD_TEMPLATE" "$dod_target") dod_state=$(ensure_file "$DOD_TEMPLATE" "$dod_target")
gitignore_state=$(ensure_gitignore_build_entry "$gitignore_target")
if [ "$agents_state" = "updated" ] || [ "$dod_state" = "updated" ]; then if [ "$agents_state" = "updated" ] || [ "$dod_state" = "updated" ] || [ "$gitignore_state" = "updated" ]; then
updated=$((updated + 1)) updated=$((updated + 1))
echo "UPDATED: $repo" echo "UPDATED: $repo"
continue continue
fi fi
if [ "$agents_state" = "drift" ] || [ "$dod_state" = "drift" ]; then if [ "$agents_state" = "drift" ] || [ "$dod_state" = "drift" ] || [ "$gitignore_state" = "drift" ]; then
drift=$((drift + 1)) drift=$((drift + 1))
echo "DRIFT: $repo" echo "DRIFT: $repo"
continue continue