From bfb4a30ce8b35fe592c5fb314b9179ab6cd18253 Mon Sep 17 00:00:00 2001 From: Stefan Date: Sun, 29 Mar 2026 13:36:43 +0200 Subject: [PATCH] - 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 --- AGENTS.md | 6 +++-- docs/DEFINITION_OF_DONE.md | 4 +-- scripts/Reconcile-ProjectStandards.ps1 | 34 ++++++++++++++++++++++++-- scripts/reconcile-project-standards.sh | 34 ++++++++++++++++++++++++-- 4 files changed, 70 insertions(+), 8 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 6d49371..da4e36e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -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. 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) ### 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. - New functionality includes new tests. - Bug fixes include at least one regression test. -- Minimum code coverage is 80% (statements, measured with `go test -cover`). 1. Functional documentation - Implemented functionality is documented. @@ -58,7 +61,6 @@ The Definition of Done defines the minimum quality bar for every completed chang ### Review Checklist (Quick) - [ ] Change is implemented and meets acceptance criteria. - [ ] Tests were added/updated and pass. -- [ ] Code coverage is at least 80%. - [ ] Functionality is documented. - [ ] Documentation is in English. - [ ] Documentation is located under `docs/` (except `README.md` and `AGENTS.md`). diff --git a/docs/DEFINITION_OF_DONE.md b/docs/DEFINITION_OF_DONE.md index 9d85002..e425c44 100644 --- a/docs/DEFINITION_OF_DONE.md +++ b/docs/DEFINITION_OF_DONE.md @@ -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. - New functionality includes new tests. - 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 - 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. - [ ] Tests were added/updated and pass. -- [ ] Code coverage is at least 80%. +- [ ] Automated test coverage is at least 80%. - [ ] Functionality is documented. - [ ] Documentation is in English. - [ ] Documentation is located under `docs/` (except `README.md` and `AGENTS.md`). diff --git a/scripts/Reconcile-ProjectStandards.ps1 b/scripts/Reconcile-ProjectStandards.ps1 index 63ee8f9..afce0ec 100644 --- a/scripts/Reconcile-ProjectStandards.ps1 +++ b/scripts/Reconcile-ProjectStandards.ps1 @@ -63,6 +63,34 @@ function Ensure-FileFromTemplate { 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 { param([switch]$OnlyCheck) @@ -81,19 +109,21 @@ function Invoke-ReconcileOnce { $repoPath = $repo.FullName $agentsTarget = Join-Path $repoPath 'AGENTS.md' $dodTarget = Join-Path (Join-Path $repoPath 'docs') 'DEFINITION_OF_DONE.md' + $gitIgnoreTarget = Join-Path $repoPath '.gitignore' $summary.scanned++ $agentsState = Ensure-FileFromTemplate -Template $agentsTemplate -Target $agentsTarget -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++ Write-Host "UPDATED: $repoPath" continue } - if ($agentsState -eq 'drift' -or $dodState -eq 'drift') { + if ($agentsState -eq 'drift' -or $dodState -eq 'drift' -or $gitIgnoreState -eq 'drift') { $summary.drift++ Write-Host "DRIFT: $repoPath" continue diff --git a/scripts/reconcile-project-standards.sh b/scripts/reconcile-project-standards.sh index 0d280e6..3c93b13 100644 --- a/scripts/reconcile-project-standards.sh +++ b/scripts/reconcile-project-standards.sh @@ -116,6 +116,34 @@ ensure_file() { 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() { scanned=0 updated=0 @@ -131,17 +159,19 @@ run_once() { agents_target="$repo/AGENTS.md" dod_target="$repo/docs/DEFINITION_OF_DONE.md" + gitignore_target="$repo/.gitignore" agents_state=$(ensure_file "$AGENTS_TEMPLATE" "$agents_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)) echo "UPDATED: $repo" continue fi - if [ "$agents_state" = "drift" ] || [ "$dod_state" = "drift" ]; then + if [ "$agents_state" = "drift" ] || [ "$dod_state" = "drift" ] || [ "$gitignore_state" = "drift" ]; then drift=$((drift + 1)) echo "DRIFT: $repo" continue