feat: implement issue #1296 — Standards sweep reuses a same-date sync branch as-is — a narrower second run opens a PR carrying the first run's commits

DO
12d ago
+142-5

Problem

Standards sweep reuses a same-date sync branch as-is — a narrower second run opens a PR carrying the first run's commits

From the issue: sd_deploy_files_via_pr (scripts/lib/standards-deploy.sh, step 4) names the sync branch standards-sync/workflows-<UTC date> and, when that branch already exists, reuses it as-is ("reuse it if a prior run already created it"). It then PUTs the current run's files on top. Nothing checks that the branch still descends cleanly from the default branch, or that what is already on it belongs to this run.

Risk

Low — changes automation shell logic under scripts/, covered by shellcheck (--severity=warning) and the bats suite.

Test plan

Tests added/updated: test/scripts/lib/standards-deploy.bats. Verification: bash scripts/dev-lead-lint.sh (shellcheck --severity=warning) ran pre-commit; the bats suite runs in CI.

Rollback

Revert this PR. No non-revertible side effects (no tags, migrations, or external state).

Monitoring

This PR's Lint (shellcheck) and bats checks show pass/fail; watch subsequent dev-lead / pr-review runs for behavioral regressions.

Closes #1296