- 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:
2026-03-29 13:36:43 +02:00
parent 77ef79d858
commit bfb4a30ce8
4 changed files with 70 additions and 8 deletions
+32 -2
View File
@@ -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
+32 -2
View File
@@ -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