Skip to content

Investigate: is the import topology declared, enforced, and is the declaration itself checked? #60

Description

@Polichinel

What to check

Whether this repository's internal import topology is declared and enforced, and — the sharper question — whether anything that is declared is itself checked, rather than only being the thing the code is checked against.

Measured across all views_platform repos on 2026-08-18: 4 of 18 carry import cycles, 7 have some form of import-enforcement test, and only 1 has a declared topology contract.

This repo: 2 subpackages · 0 cycles · enforcement test: none

My assessment

Likely in order on imports; the declared-list question is the live one.

Two subpackages, zero cycles. Too small for a topology contract.

But this repo is built on declared dispatch — the 2026-02 ontology-liberation post-mortem replaced prefix inference with four canonical dispatch dicts (REGRESSION_POINT_METRIC_FUNCTIONS and siblings) and the lesson recorded was "the config is the contract." That makes it the most likely place on the platform for C-351's shape to bite.

Suggestions

  1. Ask C-351 of the four dispatch dicts. Does anything assert that every metric named in config exists in exactly one dict? That the four are disjoint? That a metric in a dict is reachable from some valid config?
  2. If evaluate() validates config against the dicts but nothing validates the dicts, that is precisely the shape.
  3. Skip the import contract — two packages.

For examples / inspiration

  • views-datafactory #457/#458test_the_declared_graph_is_acyclic and test_every_package_on_disk_is_declared. Two assertions in an existing file. No new dependency, no graph library, no new module. The insight is worth stealing verbatim: an assertion about conformance standing in for an assertion about the property.
  • views-frames pyproject.toml [tool.importlinter] — two layers contracts, | between siblings meaning independent (that is what prevents a cycle; : permits one), each recording the direction the code already has. Note the comment explaining why the contract and tests/test_import_enforcement.py deliberately overlap.

Investigative issue filed by Claude Opus 5 at Simon's request, after a census of import structure across all views_platform repos. Nothing was changed 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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions