Add reusable coverage badge renderer
Dandaedre/agent-tasks/pipeline/head This commit looks good Details

This commit is contained in:
Dandaedre 2026-10-04 01:27:05 +02:00
parent 6d30c15f05
commit fb9d8f7d16
Signed by: Dandaedre
GPG Key ID: 440C6592E8A26D99
2 changed files with 391 additions and 208 deletions

270
scripts/ci-coverage-badges.sh Executable file
View File

@ -0,0 +1,270 @@
#!/bin/sh
set -eu
usage() {
cat >&2 <<'EOF'
usage: $0 <version|test|coverage> [options]
Render one deterministic SVG badge. Defaults:
version --text version --value unknown --color #007ec6
test --text tests --value passing --color #4c1
coverage --text coverage --value - --color #9f9f9f --suffix %
Options:
--text TEXT left-hand label
--value VALUE right-hand value
--color COLOR value background (#RGB or #RRGGBB)
--size PX font size, from 6 through 24 (default: 11)
--height PX badge height, from 14 through 64 (default: 20)
--label-width PX fixed label width instead of automatic sizing
--value-width PX fixed value width instead of automatic sizing
--suffix TEXT text appended to the displayed value
--output PATH output file (default: coverage/<kind>.svg)
-h, --help show this help
Examples:
./ci-coverage-badges.sh version --value 1.2.3
./ci-coverage-badges.sh test --value failing
./ci-coverage-badges.sh coverage --value 87.4
./ci-coverage-badges.sh version --text release --value rc.12 --size 12 --color '#8a2be2'
EOF
exit "${1:-2}"
}
[ "$#" -ge 1 ] || usage
kind=$1
shift
case "$kind" in
version)
text=version
value=unknown
color='#007ec6'
suffix=
output=coverage/version.svg
;;
test)
text=tests
value=passing
color=
suffix=
output=coverage/test.svg
;;
coverage)
text=coverage
value=-
color=
suffix=%
output=coverage/coverage.svg
;;
-h|--help) usage 0 ;;
*)
echo "unsupported badge kind: $kind" >&2
usage
;;
esac
font_size=11
height=20
label_width=
value_width=
color_set=false
while [ "$#" -gt 0 ]; do
option=$1
case "$option" in
--text|--value|--color|--size|--height|--label-width|--value-width|--suffix|--output)
[ "$#" -ge 2 ] || {
echo "missing value for $option" >&2
exit 2
}
option_value=$2
shift 2
case "$option" in
--text) text=$option_value ;;
--value) value=$option_value ;;
--color) color=$option_value; color_set=true ;;
--size) font_size=$option_value ;;
--height) height=$option_value ;;
--label-width) label_width=$option_value ;;
--value-width) value_width=$option_value ;;
--suffix) suffix=$option_value ;;
--output) output=$option_value ;;
esac
;;
-h|--help) usage 0 ;;
*)
echo "unknown option: $option" >&2
usage
;;
esac
done
validate_text() {
field_name=$1
field_value=$2
if ! printf '%sX\n' "$field_value" | LC_ALL=C awk '
BEGIN { valid = 1 }
NR != 1 || $0 !~ /^[ -~]+X$/ || length($0) <= 1 { valid = 0 }
END { exit(valid == 0 ? 1 : 0) }
'; then
echo "$field_name must contain printable ASCII characters: $field_value" >&2
exit 2
fi
}
validate_integer() {
field_name=$1
field_value=$2
minimum=$3
maximum=$4
case "$field_value" in
''|*[!0-9]*)
echo "$field_name must be an integer from $minimum through $maximum: $field_value" >&2
exit 2
;;
esac
if [ "$field_value" -lt "$minimum" ] || [ "$field_value" -gt "$maximum" ]; then
echo "$field_name must be an integer from $minimum through $maximum: $field_value" >&2
exit 2
fi
}
validate_text text "$text"
validate_text value "$value"
if [ -n "$suffix" ]; then
validate_text suffix "$suffix"
fi
validate_integer size "$font_size" 6 24
validate_integer height "$height" 14 64
if [ -n "$label_width" ]; then
validate_integer label-width "$label_width" 20 1000
fi
if [ -n "$value_width" ]; then
validate_integer value-width "$value_width" 20 1000
fi
case "$output" in
''|*/) echo "output must name an SVG file: $output" >&2; exit 2 ;;
esac
case "$kind" in
test)
if [ "$color_set" = false ]; then
case "$value" in
passing) color='#4c1' ;;
failing) color='#e05d44' ;;
*) color='#9f9f9f' ;;
esac
fi
;;
coverage)
if [ "$value" = '-' ]; then
[ "$color_set" = true ] || color='#9f9f9f'
else
if ! awk -v candidate="$value" 'BEGIN {
valid = candidate ~ /^[0-9]+([.][0-9]+)?$/ && candidate >= 0 && candidate <= 100
exit(valid ? 0 : 1)
}'; then
echo "coverage value must be - or a number from 0 through 100: $value" >&2
exit 2
fi
value=$(awk -v candidate="$value" 'BEGIN { printf "%.0f", candidate }')
if [ "$color_set" = false ]; then
if [ "$value" -ge 90 ]; then
color='#4c1'
elif [ "$value" -ge 70 ]; then
color='#dfb317'
else
color='#e05d44'
fi
fi
fi
;;
esac
case "$color" in
\#[0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f]|\#[0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f]) ;;
*) echo "color must be #RGB or #RRGGBB: $color" >&2; exit 2 ;;
esac
display_value=$value$suffix
if [ -z "$label_width" ]; then
label_width=$(printf '%s\\n' "$text" | awk -v size="$font_size" '{
width = int(length($0) * size * 0.64 + 14)
print (width < 35 ? 35 : width)
}')
fi
if [ -z "$value_width" ]; then
value_width=$(printf '%s\\n' "$display_value" | awk -v size="$font_size" '{
width = int(length($0) * size * 0.64 + 14)
print (width < 35 ? 35 : width)
}')
fi
badge_width=$((label_width + value_width))
label_center=$(awk -v width="$label_width" 'BEGIN { printf "%.1f", width / 2 }')
value_center=$(awk -v left="$label_width" -v width="$value_width" 'BEGIN {
printf "%.1f", left + width / 2
}')
vertical_center=$(awk -v badge_height="$height" 'BEGIN { printf "%.1f", badge_height / 2 }')
xml_escape() {
sed \
-e 's/&/\&amp;/g' \
-e 's/</\&lt;/g' \
-e 's/>/\&gt;/g' \
-e 's/"/\&quot;/g'
}
sed_replacement_escape() {
sed -e 's/[\\&|]/\\&/g'
}
escaped_text=$(printf '%s' "$text" | xml_escape | sed_replacement_escape)
escaped_value=$(printf '%s' "$display_value" | xml_escape | sed_replacement_escape)
escaped_title=$(printf '%s: %s' "$text" "$display_value" | xml_escape | sed_replacement_escape)
output_dir=${output%/*}
if [ "$output_dir" != "$output" ]; then
mkdir -p "$output_dir"
fi
temporary="${output}.tmp.$$"
trap 'rm -f "$temporary"' EXIT HUP INT TERM
sed \
-e "s/@BADGE_WIDTH@/$badge_width/g" \
-e "s/@HEIGHT@/$height/g" \
-e "s/@LABEL_WIDTH@/$label_width/g" \
-e "s/@VALUE_WIDTH@/$value_width/g" \
-e "s/@LABEL_CENTER@/$label_center/g" \
-e "s/@VALUE_CENTER@/$value_center/g" \
-e "s/@VERTICAL_CENTER@/$vertical_center/g" \
-e "s/@FONT_SIZE@/$font_size/g" \
-e "s/@COLOR@/$color/g" \
-e "s|@TITLE@|$escaped_title|g" \
-e "s|@TEXT@|$escaped_text|g" \
-e "s|@VALUE@|$escaped_value|g" \
>"$temporary" <<'EOF'
<svg xmlns="http://www.w3.org/2000/svg" width="@BADGE_WIDTH@" height="@HEIGHT@" role="img" aria-label="@TITLE@">
<title>@TITLE@</title>
<linearGradient id="s" x2="0" y2="100%">
<stop offset="0" stop-color="#fff" stop-opacity=".7"/>
<stop offset=".1" stop-color="#aaa" stop-opacity=".1"/>
<stop offset=".9" stop-opacity=".3"/>
<stop offset="1" stop-opacity=".5"/>
</linearGradient>
<clipPath id="r"><rect width="@BADGE_WIDTH@" height="@HEIGHT@" rx="3"/></clipPath>
<g clip-path="url(#r)">
<rect width="@LABEL_WIDTH@" height="@HEIGHT@" fill="#555"/>
<rect x="@LABEL_WIDTH@" width="@VALUE_WIDTH@" height="@HEIGHT@" fill="@COLOR@"/>
<rect width="@BADGE_WIDTH@" height="@HEIGHT@" fill="url(#s)"/>
</g>
<g fill="#fff" text-anchor="middle" dominant-baseline="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" font-size="@FONT_SIZE@">
<text x="@LABEL_CENTER@" y="@VERTICAL_CENTER@">@TEXT@</text>
<text x="@VALUE_CENTER@" y="@VERTICAL_CENTER@">@VALUE@</text>
</g>
</svg>
EOF
mv "$temporary" "$output"
trap - EXIT HUP INT TERM

View File

@ -1,41 +1,23 @@
<!-- Purpose: Add CI-generated version, test, and coverage badges to a repository. -->
<!-- Scope: Keep current default-branch SVG badges and publish them atomically. -->
<!-- Purpose: Generate and publish current version, test, and coverage badges through Jenkins. -->
<!-- Reference: This task uses one configurable POSIX sh renderer instead of three duplicated SVG renderers. -->
# Publish current CI badges through the assets mount
# Generate and publish current CI badges
Apply this task to one repository at a time. Read the repository's local agent
instructions, inspect its existing CI and coverage setup, preserve unrelated
work, and follow its commit policy. Do not push or publish outside CI unless the
user explicitly requests it.
Apply this task to one repository at a time. Read its local agent instructions, inspect its existing CI, package metadata, tests, coverage setup, README, Git remote, and default branch, and preserve unrelated work. Do not commit, push, start a Jenkins build, or publish outside CI unless the user explicitly requests it.
## Goal
Use the generic renderer linked under **Renderer source** below. If the repository already has `render-version-badge.sh`, `render-test-badge.sh`, or `render-coverage-badge.sh`, retain them as small compatibility wrappers when callers or tests use those interfaces; do not keep three duplicated SVG templates.
Make the default branch expose three small, current SVG badges:
## Required result
Generate exactly these mutable default-branch badges:
```text
<asset-mount>/coverage/<owner>/<project>/<default-branch>/version.svg
<asset-mount>/coverage/<owner>/<project>/<default-branch>/test.svg
<asset-mount>/coverage/<owner>/<project>/<default-branch>/coverage.svg
<asset-origin>/coverage/<owner>/<project>/<default-branch>/version.svg
<asset-origin>/coverage/<owner>/<project>/<default-branch>/test.svg
<asset-origin>/coverage/<owner>/<project>/<default-branch>/coverage.svg
coverage/version.svg
coverage/test.svg
coverage/coverage.svg
```
Discover the canonical owner, project name, default branch, asset mount, and
public asset origin from repository or CI configuration. Do not infer them only
from the local checkout directory. Keep the default-branch component stable;
these URLs describe the latest default-branch build, not an immutable commit.
Retain only the three badges as Jenkins artifacts. Do not publish or retain
commit-addressed coverage directories, HTML, JSON, LCOV, or other detailed
reports unless the repository already has a separate requirement for them.
This task is complete only when all three badges are present in the README,
generated by CI, archived by Jenkins, and copied by a default-branch build to
the resolved asset mount below `coverage/<owner>/<project>/<default-branch>/`.
When the deployment contract uses `/mnt/assets`, verify the resulting files at
these exact filesystem paths rather than merely checking a similarly named
workspace or archive directory:
Set the Jenkins publication root to `/mnt/assets/coverage`. Publish to:
```text
/mnt/assets/coverage/<owner>/<project>/<default-branch>/version.svg
@ -43,194 +25,125 @@ workspace or archive directory:
/mnt/assets/coverage/<owner>/<project>/<default-branch>/coverage.svg
```
Do not report the task as successful when only scripts or pipeline definitions
were added. A configured operation, an archived artifact, a file in the Jenkins
workspace, and a file below the publication mount are four different states;
verify each required state explicitly.
Serve them from:
## CI behavior
1. Remove or recreate the workspace `coverage/` output directory at the start
of the build so files from an earlier run cannot satisfy later checks.
2. Use the project's established test and line-coverage tools. Pin tools that
CI installs itself, and keep tool configuration in the conventional tracked
project file.
3. Enforce an honest coverage floor supported by useful behavior tests. Do not
exclude ordinary production code or distort code or tests to increase the
percentage.
4. Produce a temporary machine-readable coverage summary, extract and validate
a numeric percentage from 0 through 100, render `coverage/coverage.svg`, and
remove the summary.
5. Read the version from authoritative package or build metadata and render
`coverage/version.svg`. Do not duplicate the version in CI configuration.
6. Write a build-specific marker only after the test stage succeeds. In an
always-run cleanup action, render `coverage/test.svg` as `passing` only when
that marker exists; otherwise render it as `failing`. Remove the marker
afterward so an old workspace cannot affect a later build.
7. If coverage did not complete, render a neutral `-%` badge during cleanup.
Cleanup must run for both successful and failed builds so published status
cannot silently remain stale.
8. Before archival or publication, enumerate the selected files and require
all three expected names to be regular, nonempty, non-symlink files that
parse as XML. Fail if any is absent or if an unexpected file is selected.
9. Archive exactly the three nonempty SVG files with fingerprinting on every
branch. Do not use `allowEmptyArchive`, broad `|| true`, exception swallowing,
or another fallback that converts missing badge output into CI success.
10. Publish all three badges only from the resolved default branch. Confirm the
branch condition actually runs in the Jenkins job type in use; a branch
predicate that silently skips the real default branch is a failure. A
missing or unwritable publication mount is a CI failure, not a reason to
print a warning and continue.
11. Keep rendering and filesystem publication in small tracked scripts rather
than large Jenkins shell blocks. Use the repository's existing scripting
language when suitable; otherwise use portable POSIX `sh`.
Update the Jenkins success and failure summaries to mention tests, coverage,
badge generation, and any other gates that the pipeline actually runs.
Success output must identify the resolved publication directory. Failure output
must identify the phase and missing or rejected path without hiding the
original build error.
## Renderer contract
Render badges locally and deterministically. Do not call an external badge
service.
- The version renderer accepts only characters valid for the project's version
format, grows the value segment for long versions, and enforces a sensible
minimum width.
- The test renderer accepts only `passing` or `failing` and selects green or
red respectively.
- The coverage renderer accepts `-` or a number from 0 through 100, rounds
numeric values, and selects documented green, yellow, red, or neutral colors.
- Reject invalid input before creating or replacing output.
- Escape all text inserted into XML.
- Center labels and values horizontally with `text-anchor="middle"`. In a
20-pixel badge, center text vertically at `y="10"` with
`dominant-baseline="middle"` instead of treating `y` as a font baseline.
- When POSIX `awk` prints a conditional expression, parenthesize it, for example
`print (width < 45 ? 45 : width)`, so the expression also works with FreeBSD
awk.
## Publication contract
The publication script receives the publication root and an explicit
allow-listed set of badge names. It must:
- require an absolute publication root and validate all arguments before
changing published state;
- create only the required owner, project, and default-branch directories;
- publish only `coverage.svg`, `test.svg`, and `version.svg` below the resolved
default-branch directory;
- verify every selected source badge exists, is a regular nonempty file, and is
not a symlink;
- migrate an old default-branch symlink by unlinking the symlink itself without
deleting its target, and reject any other non-directory branch destination;
- make directories mode `0755` and badges mode `0644` so the web server can
traverse and read them even under a restrictive umask;
- copy each badge to a temporary file in its destination directory and rename
it atomically over the public file;
- after each rename, require the destination to be a regular, nonempty,
non-symlink file and compare it with the source so a partial or misdirected
copy cannot be reported as published;
- clean temporary files on ordinary failures and signals;
- quote paths and remain portable to the Jenkins worker's operating system;
- never recursively synchronize, prune, or delete the shared asset mount.
Exit nonzero with a message on standard error when validation, directory
creation, copying, permissions, renaming, or post-copy verification fails. The
message must name the operation and safe path involved. Never print a success
message before all selected badges have passed post-copy verification.
Do not automatically remove old commit-addressed directories. That is a
separate destructive migration requiring explicit authorization and exact path
verification.
## Repository updates
Place the live badges immediately below the README title, substituting the
resolved values:
```markdown
![version](<asset-origin>/coverage/<owner>/<project>/<default-branch>/version.svg)
![tests](<asset-origin>/coverage/<owner>/<project>/<default-branch>/test.svg)
![test coverage](<asset-origin>/coverage/<owner>/<project>/<default-branch>/coverage.svg)
```text
https://assets.dandaedre.com/coverage/<owner>/<project>/<default-branch>/version.svg
https://assets.dandaedre.com/coverage/<owner>/<project>/<default-branch>/test.svg
https://assets.dandaedre.com/coverage/<owner>/<project>/<default-branch>/coverage.svg
```
Editing the README is a required deliverable, not optional follow-up. After the
edit, search the rendered source and require each resolved badge URL exactly
once in an image reference. Check that no old owner, project, default branch,
filename, or asset origin remains in another badge block. A successful CI setup
without these README references does not complete this task.
Resolve the owner, canonical project name, and default branch from repository and CI configuration. Do not infer them only from the checkout directory, and preserve deliberate spellings.
Do not link them to a report that CI does not retain. Document the local
coverage command, enforced floor, version source, temporary summary, archived
files, publication path, and public URLs. Remove tracked generated badge files
and obsolete status snapshots.
Add all three public image references immediately below the README title. Generated SVG files and temporary coverage reports must remain ignored and untracked.
If this task also owns the web-server configuration, mount public assets
read-only, disable directory listing, serve SVG with a restrictive content
security policy, and revalidate or use a short cache lifetime for mutable badge
URLs. Otherwise record these as deployment requirements without expanding the
repository change into unrelated infrastructure work.
## Generic renderer contract
Install the linked script as executable `scripts/ci-coverage-badges.sh`. It renders one badge per invocation and supplies useful defaults:
```sh
scripts/ci-coverage-badges.sh version --value 1.2.3
scripts/ci-coverage-badges.sh test --value passing
scripts/ci-coverage-badges.sh coverage --value 87.4
```
Without `--output`, those commands write the appropriate file below `coverage/`. Supported customizations include `--text`, `--value`, `--color`, `--size`, `--height`, `--label-width`, `--value-width`, `--suffix`, and `--output`.
The renderer must:
- validate its kind, options, printable text, numeric bounds, dimensions, and colors before replacing output;
- escape XML-sensitive text;
- calculate neat automatic widths with POSIX `awk`, using a minimum width;
- parenthesize conditional `awk` expressions for FreeBSD awk compatibility;
- center text with `text-anchor="middle"`, `dominant-baseline="middle"`, and half the badge height;
- round numeric coverage values and select red, yellow, green, or neutral colors;
- render test values as green for `passing`, red for `failing`, and neutral for custom values unless a color is explicit;
- create parent directories when needed;
- write a temporary file and atomically rename it over the output; and
- remove temporary files on ordinary failures and signals.
Semantic compatibility wrappers must continue to reject invalid legacy input. A version wrapper accepts the project version format, a test wrapper accepts only `passing` or `failing`, and a coverage wrapper accepts only `-` or a number from 0 through 100 through the generic renderer.
## Coverage and test lifecycle
Use the project’s established coverage tool. For Rust, keep its conventional tracked configuration, use locked dependency resolution, pin any CI-installed coverage tool, and enforce an honest documented line-coverage floor without excluding ordinary production code.
At the beginning of the build, remove and recreate the ignored `coverage/` output directory so a reused Jenkins workspace cannot provide stale markers or SVGs.
After every required test stage succeeds, create:
```text
coverage/.tests-passed-${BUILD_NUMBER}
```
After coverage succeeds, extract and validate the overall percentage from a temporary machine-readable summary, render `coverage/coverage.svg`, delete the summary, and create:
```text
coverage/.coverage-ready-${BUILD_NUMBER}
```
Do not create either marker early.
## Jenkins cleanup, archival, and publication
Finalize badges in `post { cleanup { ... } }`, which runs on both successful and failed builds:
1. Render `test.svg` as `passing` only if the current build’s test marker exists; otherwise render `failing`.
2. Preserve the measured coverage badge only if the current build’s coverage-ready marker exists; otherwise render neutral `-%`.
3. Read the version from authoritative package or workspace metadata and render `version.svg`; never duplicate the version in Jenkins configuration.
4. Remove temporary reports and both build-specific markers.
5. Require exactly the three expected SVGs to be regular, nonempty, non-symlink files.
6. Archive exactly those three SVGs with fingerprinting and `allowEmptyArchive: false`.
7. On the resolved default branch only, publish all three badges.
Publication must run from cleanup rather than only from the success handler: a failed default-branch build must replace stale green status with `failing` and stale measured coverage with neutral `-%`.
Branches other than the default branch generate and archive their badges but do not modify the public default-branch files. Confirm that the Jenkins job type actually supplies the branch variable used by the predicate.
## Publication script
Keep publication in a small tracked POSIX `sh` script. Its first argument is the already-complete root `/mnt/assets/coverage`; do not append another `coverage` component before the owner.
The script must:
- require an absolute, existing, writable publication root;
- accept only the allow-listed names `coverage`, `test`, and `version`, without duplicates;
- validate every `coverage/<name>.svg` source as a regular, nonempty, non-symlink file;
- resolve the destination as `<root>/<owner>/<project>/<default-branch>/`;
- reject symlink or non-directory owner and project components;
- migrate an old default-branch symlink by unlinking the symlink itself without deleting its target;
- create directories with mode `0755`;
- copy each source to a temporary file in the destination directory, set mode `0644`, and atomically rename it;
- clean unfinished temporary files on failure or signal;
- exit nonzero on validation, copying, permissions, or rename errors; and
- never recursively synchronize, prune, or delete the shared asset mount.
## README and documentation
Place the three live public badge references directly below the README title and require each resolved URL exactly once. Remove tracked generated badges and obsolete status snapshots.
Document the exact local coverage command, enforced floor, authoritative version source, temporary summary, three archived files, publication directory, and public URLs. Update Jenkins success and failure summaries to mention tests, coverage, and badge generation accurately.
If server configuration is outside the repository, only record that public assets should be mounted read-only, directory listing disabled, SVG served with a restrictive content security policy, and mutable URLs revalidated or given a short cache lifetime.
## Verification
Before committing:
Before reporting repository implementation complete:
1. Run the repository's formatting, build/check, test, lint, and supported
toolchain gates relevant to the change.
2. Run the exact CI coverage command and confirm the enforced floor.
3. Confirm the temporary summary yields a valid percentage, is removed, and
exactly three nonempty SVGs are selected for archival.
4. Exercise normal and long versions, passing and failing test states, green,
yellow, red, and neutral coverage, and invalid input rejection.
5. Parse every rendered file as XML and rasterize representative badges to
inspect text placement.
6. Test publication with `umask 077` against a temporary absolute root. Verify
modes, atomic replacement, idempotence, and old-symlink migration without
deleting the old target.
7. Verify rejection of missing badges, relative roots, unwritable
destinations, and regular-file branch destinations.
8. Verify the README contains each resolved public badge URL exactly once and
that all three image references render directly below the title.
9. On an actual default-branch Jenkins build, confirm the generation log names
all three workspace files, the archive contains exactly those files, and the
publication stage runs rather than being skipped. Inspect the resolved
destination below `/mnt/assets` when that is the configured mount and compare
all three published files with the generated sources.
10. Request each public URL without relying on a browser cache, require an SVG
response, parse it as XML, and confirm its displayed value matches the build
that published it. A pre-existing or stale public file is not evidence that
the current operation succeeded.
11. Validate Jenkins syntax as far as local tooling permits, inspect the final
diff, commit the change, and confirm the worktree is clean.
1. Run the repository’s formatting, check/build, test, lint, and documentation gates.
2. Run the exact coverage command and confirm the enforced floor.
3. Exercise default and customized badge rendering, normal and long versions, passing and failing tests, all coverage color bands, neutral coverage, custom sizing, and XML-sensitive text.
4. Confirm invalid kinds, options, values, dimensions, and colors fail without replacing a valid output.
5. Parse every generated SVG as XML.
6. Test publication against a temporary absolute root under `umask 077`; verify modes, atomic replacement, idempotence, rejection cases, and safe old-symlink migration.
7. Confirm only the three SVG files are selected for archival.
8. Confirm each public README URL appears exactly once.
9. Inspect the final diff and report every unavailable check honestly.
## Failure reporting and handoff
Implementation is complete when the repository changes and local checks above pass. Real Jenkins publication and public URL retrieval are separate deployment checkpoints. If Jenkins, `/mnt/assets`, or the public server is unavailable, report that checkpoint as `not verified`; do not treat it as passed, invent results, or call the repository implementation a failure merely because production access is unavailable.
Never silently downgrade a required check, and never describe the operation as
successful merely because the repository changes are committed. If any badge
is not added to the README, generated, archived, copied to the configured asset
mount, or served at its public URL, tell the calling agent or user that the
badge operation failed or remains incomplete and explain why.
The final report must separately state README references, CI generation, Jenkins archival configuration, real default-branch publication, public URL retrieval, measured coverage, enforced floor, and checks actually run. Do not claim badges are live solely because repository files were changed.
The final report must give a separate status for each of these checkpoints:
## Renderer source
1. README references;
2. CI generation;
3. Jenkins archival;
4. default-branch publication to the resolved mount; and
5. public URL retrieval and content validation.
For every failed, skipped, or unavailable checkpoint, report the failing phase,
the expected safe path or URL, the observed error or evidence, and the next
action needed. Distinguish a reproducible failure from a check that could not be
performed because Jenkins, the mount, credentials, network access, or the
default branch was unavailable. Do not invent results, treat unavailable as
passed, or hide an earlier failure behind successful cleanup or badge rendering.
Report the measured coverage, enforced floor, checks run, commit ID, and the
five checkpoint statuses above. Do not claim the public badges are live until a
successful default-branch Jenkins build has generated and archived the badges,
copied all three to the resolved publication directory, and their uncached
public responses have been validated.
Use the maintained [`scripts/ci-coverage-badges.sh`](https://proxy.dandaedre.com/gitea/Dandaedre/agent-tasks/src/branch/main/scripts/ci-coverage-badges.sh) file. Copy the script into the target repository instead of copying a stale embedded snapshot from this task, retain its executable mode, and record the source revision used when reproducibility matters.