Skip to content

Type the Hub as Python Under the Code-Keyed Gate Contract #1913

Closed

Description

@ptr727

Problem

The python.directories.declared contract from #1800 makes tracked .py files, rather than a config file, what types a repository as Python. The audit now reports a DEFECT for a repository that carries .py files without the python type. The hub is one of them: its registry entry is typed source-only and docs, while it tracks Python under scripts/, spec/, host-setup/, and .github/actions/.

The hub's shape doesn't fit the contract as written, either. Its root pyproject.toml is lint-only tool config, and its unittest suite lives in scripts/tests/, not in a tests/ directory beside that pyproject.toml. So declaring . in python-directories would fail the new "declared directory has no tests/" check. Today its suite runs from its own .github/actions/validate hook under coverage, is reported, and is not uploaded to Codecov.

Options

  • Type the hub python, lint-only, and move or mirror its suite so the validator's lint-only leg reaches it, which also brings Codecov upload. The cost is that the hook's extra self-tests (spec/audit.py --selftest and others) still need the hook.
  • Let a lint-only directory name its test start directory, for example a tests override per directory. This makes the input richer than a list of paths, and the registry mirror would have to carry it too.
  • Accept the hub's DEFECT as a recorded divergence in spec/divergences.json, since the hub gates its Python through its own hook.

Recommendation: the first, unless moving scripts/tests breaks hub-fetch-run.py consumers or path assumptions in the tests themselves.

Activity

  1. added
    decision
    on Sep 27, 2026
  2. ptr727 commented on Sep 27, 2026

    @ptr727
    OwnerAuthor

    Decided by the maintainer on 2026-09-27: type the hub python with the lint-only profile, declare . in its python-directories input and registry pythonDirectories, and move scripts/tests to a root tests/. The shared validator then runs the suite under coverage and uploads it like any adopter's. The validate hook keeps the extra self-tests (spec/audit.py --selftest and the others) that aren't a unittest suite.

    Since this issue was filed, the Python-without-type finding became a suppressible discovery advisory (#1914 and later), so 'DEFECT' in the body above now reads as 'advisory'. Suppressing it was the alternative, and it was declined, since the hub would then exempt itself from its own rule.

  3. removed
    decision
    on Sep 27, 2026
  4. added a commit that references this issue on Sep 27, 2026
    0aa86c3
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions