feat(sp33): resubmit CLI: skipped files don't audit or count as uploads

Finishes the in-tree was_skipped draft: size-matched remote files no
longer emit clearhouse.submitted events or increment uploaded, and the
periodic reconnect now triggers only after real uploads.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Nora
2026-07-04 20:29:13 -06:00
parent 27bca33b09
commit 6bda5005c1
+7 -4
View File
@@ -674,6 +674,7 @@ def resubmit_rejected_claims(
attempts = 0
ok = False
was_skipped = False
while attempts < 3:
attempts += 1
if ssh is None:
@@ -691,7 +692,7 @@ def resubmit_rejected_claims(
rs = sftp.stat(remote_path) # type: ignore[union-attr]
if rs.st_size == local_size:
skipped += 1
ok = True
was_skipped = True
break
except IOError:
pass # not on remote yet
@@ -710,12 +711,14 @@ def resubmit_rejected_claims(
)
continue
if not ok:
if not ok and not was_skipped:
failed += 1
continue
# Audit (best-effort; if the DB is unavailable we still keep
# the file on the wire).
# Audit + reconnect cadence apply only to real uploads.
if not was_skipped:
# Audit (best-effort; if the DB is unavailable we still
# keep the file on the wire).
try:
with db_mod.SessionLocal()() as session:
append_event(session, AuditEvent(