Skip to content

schema_version enforcement reaches only 4 of ~18 command modules #189

Description

@db-tycoon-stephen

Found during review of #178 (T2-4). Filing for scoping rather than as a defect — the current behaviour is the right trade, but the coverage is narrower than "enforcement layer" implies.

Current state

The stale-version warning and the future-version gate both live in load_config(). Only four modules call it:

src/tycoon/commands/sources.py
src/tycoon/commands/sync_cmd.py
src/tycoon/commands/explore.py
src/tycoon/commands/run_all.py

Everything else still uses the import-time singleton config = TycoonConfig()doctor, db, transform, history, observability, status, start, register, semantics, profiles, fivetran, notify, schedule, setup.

Verified behaviour

Against a project with schema_version: 99 (unsupported):

command result
data sources list gated, exits 1
doctor runs to completion, rc=0, no mention
db info runs, no mention
transform build runs, no mention

And on a stale project (no schema_version), only data sources list nudges; doctor / db / transform / history / observability are all silent.

So the same project produces a hard exit from one command and normal operation from the next. doctor — the command most likely to be run when something looks wrong — is the one that says nothing.

Options

  1. Hoist the check into the Typer root callback in cli.py. Runs once per invocation, covers every command, and init --upgrade stays reachable because it doesn't route through load_config. Small and uniform.
  2. Accept it as staged and let coverage arrive with the rest of the singleton removal. T2-3: Replace config singleton in ingestion commands with load_project() injection #94 covers the ingestion commands only, so the remainder needs its own ticket either way.

Recommend (1) if enforcement is meant to be real before v0.1.11 ships; (2) is defensible if the singleton removal is close. This is a scoping call.

Related


Mirrored in Jira: PTC-114 (Subtask of PTC-84, [Rewrite M2]). Dev work continues here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: cliCLI surface + commandsarea: configtycoon.yml schema + config singletontech-debtTest infrastructure, refactors, quality work that isn't a bug or feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions