Problem
seed-repo-template.sh ships every baseline file without its trailing newline:
_put_file writes printf '%s' "$content" where content="$(_emit_baseline …)" — command substitution strips the trailing \n.
template_stub_drift.sh _template_drift_expected_sha does the same ($(...) + printf '%s'), so the drift check expects the newline-stripped blob.
Net effect: repo-template's files (and every seeded repo's files) are not byte-identical to their standards/ source — each is off by a final \n, and ships slightly non-idiomatic (no terminating newline).
Symptom already seen
The .gitleaks.toml template-drift incident (2026-07-03): repo-template shipped .gitleaks.toml with its newline (blob 6548cdb, = canonical standards/gitleaks.toml), but the drift check expected the newline-stripped 92d4d15 → red repo-wide, admin-bypassed by #1032. Resolved by re-seeding .gitleaks.toml to the no-newline form (4ffad44c) to match the seed convention — i.e. papered over the root cause.
Proper fix
Preserve the trailing newline end-to-end:
_put_file and _template_drift_expected_sha: emit/hash printf '%s\n' "$content" (re-add the single newline the emission intends), or avoid the $() strip entirely.
- Re-seed repo-template so every baseline file becomes byte-identical to
standards/ (with the terminating \n).
Affects all baseline files, not just .gitleaks.toml. Non-blocking (drift is currently green), but worth fixing for byte-parity + POSIX text hygiene.
Refs: petry-projects/.github-private scripts/seed-repo-template.sh, scripts/template_stub_drift.sh; the #1032 / 4ffad44c incident.
Problem
seed-repo-template.shships every baseline file without its trailing newline:_put_filewritesprintf '%s' "$content"wherecontent="$(_emit_baseline …)"— command substitution strips the trailing\n.template_stub_drift.sh_template_drift_expected_shadoes the same ($(...)+printf '%s'), so the drift check expects the newline-stripped blob.Net effect: repo-template's files (and every seeded repo's files) are not byte-identical to their
standards/source — each is off by a final\n, and ships slightly non-idiomatic (no terminating newline).Symptom already seen
The
.gitleaks.tomltemplate-drift incident (2026-07-03): repo-template shipped.gitleaks.tomlwith its newline (blob6548cdb, = canonicalstandards/gitleaks.toml), but the drift check expected the newline-stripped92d4d15→ red repo-wide, admin-bypassed by #1032. Resolved by re-seeding.gitleaks.tomlto the no-newline form (4ffad44c) to match the seed convention — i.e. papered over the root cause.Proper fix
Preserve the trailing newline end-to-end:
_put_fileand_template_drift_expected_sha: emit/hashprintf '%s\n' "$content"(re-add the single newline the emission intends), or avoid the$()strip entirely.standards/(with the terminating\n).Affects all baseline files, not just
.gitleaks.toml. Non-blocking (drift is currently green), but worth fixing for byte-parity + POSIX text hygiene.Refs: petry-projects/.github-private
scripts/seed-repo-template.sh,scripts/template_stub_drift.sh; the #1032 /4ffad44cincident.