Skip to content

tech-debt: normalize ~196 inline datetime.now(utc).isoformat() call sites onto utc_timestamp() (style sweep) #12726

Description

@mrveiss

Part of the #12645 fork-convergence drive — tracked SEPARATELY because it is a large style-normalization sweep, not a fork-convergence collapse.

C1 — inline datetime.now(timezone.utc).isoformat() → utc_timestamp()

  • Canonical: autobot_shared/time_utils.py:49 (utc_timestamp() is literally datetime.now(timezone.utc).isoformat()).
  • Scope: ~196 files across autobot-backend/ and autobot-slm-backend/ use the inline expression instead of the shared helper (e.g. phase_progression_manager.py, takeover_manager.py, diagnostics.py, auth_middleware.py, slm/agent/agent.py, monitoring/performance_monitor.py, …).
  • These are inline expressions, not forked helper copies, so this is a maintainability/consistency sweep, not a duplicate-behavior collapse. Behavior is identical (the helper is the same expression).

Why separate / lower priority

  • Large blast radius (~196 files) → must be done as its own dedicated, chunked multi-PR sweep with careful diff review, not lumped into the small mechanical batches.
  • Zero behavior change, so purely a consistency win — lower priority than genuine duplication.

Suggested approach (if pursued)

  • AST/libcst codemod (not regex) to replace the exact inline call, add the import, verify no shadowing; split by top-level package into reviewable PRs; startup-import-smoke + unit tests per chunk.

Decision needed

Owner: pursue this sweep now, defer, or WONTFIX (accept inline usage as acceptable)?

Activity

  1. github-actions commented on Jul 27, 2026

    @github-actions
    Contributor

    PR #12834 (merged to Dev_new_gui) references this issue with a close keyword.

    tech-debt: normalize inline datetime.now(utc).isoformat() onto utc_timestamp() (#12726)

    If this issue is fully resolved, close it manually. If work remains, no action is needed.

  2. mrveiss commented on Jul 27, 2026

    @mrveiss
    OwnerAuthor

    Fixed in PR #12834 — squash-merged to Dev_new_gui as 7d78b33d8c3839c986b0af145cca254f2dfa6afa.

    Inline datetime.now(timezone.utc).isoformat() call sites are normalized onto the shared utc_timestamp() helper from autobot_shared.time_utils, so timestamp formatting has one definition instead of being re-derived per module.

    All required checks green before merge: Unit & Integration Tests, code-quality, smoke-test, startup-import-smoke, hardened-smoke-test, "No open blocks-merge issues reference this PR".

    Note: authz-and-selection shows CANCELLED on the final SHA — a casualty of the close/reopen needed to re-trigger checks after the branch refresh left the head commit with zero CI (tracked in #12823). It is not a required check and was green on the prior SHA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions