Repository navigation
Closed
Labels
area:coreCore runtime and shared infrastructurearea:docsDocstool:codexCodextype:refactorCode restructuring
Description
Scope
Concrete source-organization issue for splitting the runtime artifact catalog out of polylogue/artifacts/__init__.py and making artifact/proof/catalog ownership easier to audit.
Problem
polylogue/artifacts/__init__.py is a 1,072-line package-root module that defines artifact descriptors, operations, readiness surfaces, and graph-adjacent catalog data. This makes the package root load-bearing and makes it harder to tell which declarations are runtime artifacts, proof subjects, operation specs, or docs/rendering support.
Concrete split target (from comment thread)
The module already has clear internal sections. A natural split:
artifacts/
__init__.py # re-exports only, ~30 lines (intentional public API)
descriptors.py # artifact enum, artifact kinds, metadata
operations.py # operation specs, stage sequences
readiness.py # readiness checks, health surfaces
catalog.py # catalog data, graph-adjacent declarations
graph.py # (existing, keep)
Before starting
Check the public API surface that must stay stable:
rg "from polylogue\.artifacts import|from polylogue\.artifacts\." \
polylogue/ devtools/ tests/ --no-heading | sort -uAcceptance criteria
- Move runtime artifact catalog declarations out of the package root into explicit modules (descriptors, operations, readiness, catalog).
- Package root exports only intentional public API; no internal compatibility shims.
- Update proof subject, operation, scenario, and docs/rendering consumers to import from the new ownership modules.
- Add package-root budget/layering check so catalog declarations do not regrow in
__init__.py. - Generated docs/proof surfaces are regenerated from the new owners, not from compatibility re-exports.
- Topology/file-budget checks prevent a new package-root catalog from forming again.
Relationship to other issues
- Narrower than refactor(architecture): make package tree express product boundaries #634 — establishes the pattern for future package-root cleanup.
- Can land before refactor(architecture): make package tree express product boundaries #634 as a low-risk structural slice.
- No import aliases unless a public API exception is explicitly chosen (refactor(naming): normalize archive, proof, and surface vocabulary #635 policy).
Metadata
Metadata
Assignees
Labels
area:coreCore runtime and shared infrastructurearea:docsDocstool:codexCodextype:refactorCode restructuring
Activity
[-]refactor(artifacts): split runtime artifact catalog out of package root[/-][+]refactor(artifacts): move catalog declarations out of package root[/+]Sinity commentedon May 1, 2026
Source-layout guard: moving declarations out of
polylogue/artifacts/__init__.pyshould also remove package-root side effects.Suggested acceptance additions:
This is narrower than #634, but it should establish the pattern for future package-root cleanup.
Sinity commentedon May 1, 2026
Implementation anchors and acceptance additions from the 2026-05-01 follow-up audit.
Code anchors:
polylogue/artifacts/__init__.py: 1,072 lines.polylogue/artifacts/__init__.py:11-60: core artifact models/enums.polylogue/artifacts/__init__.py:63+: huge runtime artifact catalog.polylogue/artifacts/__init__.py:900-1053: artifact path declarations.polylogue/artifacts/__init__.py:1056-1072: builders and exports.docs/plans/topology-target.yaml:143-146: topology already records this package-root growth.Acceptance additions:
models.py,runtime_nodes.pyorcatalog.py,runtime_paths.py, andregistry.py; keeppolylogue.artifactsas a deliberate re-export boundary only.__init__.py.This can land before #634 as a low-risk structural slice.
Sinity commentedon May 1, 2026
Artifact layout integration from 2026-05-01 bundle
This issue remains a concrete source-organization slice under the package-boundary decision in #634/#635.
Clarifications from the integrated bundle:
__init__.pyfrom becoming a catalog bin again.This is not superseded by the already-merged
libcleanup PRs. It is still a good low-risk structural slice before or alongside the largerstorage/sqlite, proof, and devtools splits.Ref #634
Ref #635
Sinity commentedon May 2, 2026
Current state
polylogue/artifacts/__init__.pyis now 1072 lines with one sibling modulegraph.py(112 lines). It defines artifact descriptors, operations, readiness surfaces, and graph-adjacent catalog data — all in the package root.Concrete split suggestion
The module already has clear internal sections. A natural split:
The key invariant:
polylogue.artifactsimports must stay stable for external consumers. Check who imports frompolylogue.artifactsbefore deciding which symbols remain re-exported at package level.Check before starting
This will show the public API surface that must stay stable through the split.
chore: clean baseline — drop 3 dead modules, split artifacts/__init__…
Sinity commentedon May 3, 2026
Closed by #752. Verify:
wc -l polylogue/artifacts/__init__.py→ 21 lines (was 1072).chore: clean baseline — drop 3 dead modules, split artifacts/__init__…