Skip to content

[sync-review] Fix upstream manifest-synced paths blocking stranske/Pension-Data#899 #3448

Description

@stranske

Why

Consumer sync PR stranske/Pension-Data#899 (also stranske/Manager-Mosaic#23) carries an unresolved CodeRabbit thread on tools/discover_model_catalog.py. bool is a subclass of int, so a malformed catalog value such as created_at: true passes isinstance(value, (int, float)) in _parse_timestamp, becomes a 1970 timestamp, and catalog_diff can hide a genuinely new model as historical.

Scope

Fix timestamp parsing in tools/discover_model_catalog.py at the Workflows upstream source so the next maint-68 sync regeneration outdates the consumer review thread.

Non-Goals

  • Changing consumer PRs directly; the fix lands in Workflows main and propagates via sync.
  • Altering catalog selection policy beyond rejecting non-numeric boolean timestamps.

Tasks

  • In tools/discover_model_catalog.py, update _parse_timestamp to reject bool values before the numeric branch (e.g. isinstance(value, bool) guard or type(value) is int check).
  • Add test_parse_timestamp_rejects_bool_created_at to tests/tools/test_discover_model_catalog.py proving created_at: true in a GitHub Models payload is ignored and does not produce a 1970 CatalogModel.
  • Run ./scripts/sync_templates.sh if the consumer template copy of tools/discover_model_catalog.py is manifest-synced.

Acceptance Criteria

  • pytest tests/tools/test_discover_model_catalog.py -q passes, including the new bool-rejection test.
  • Deliberate-break gate: remove the bool guard in _parse_timestamp → the new test must FAIL → revert.

Implementation Notes

Review thread: stranske/Pension-Data#899 on tools/discover_model_catalog.py. Upstream source verified at tools/discover_model_catalog.py:48-58 in this repository.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions