Repository navigation
Closed
Labels
area:devtoolsDevtools and repo control-plane toolingarea:schemaSchematheme:verifiabilitySchema-native proof and evidence architecturetype:refactorCode restructuring
Description
Scope
Composite issue for replacing repo-control manifest and schema package hand-validation with typed Pydantic models.
Problem
Polylogue's repo-control manifests and schema package catalogs are central to verification, but their validation is currently mostly handwritten:
devtools/verify_manifests.pyimplements manual YAML shape walkers for lint escalation, suppressions, assurance domains, and coverage gaps;schemas/packages.pyuses dataclasses with customto_dict()/from_dict()and local coercion helpers for lists, ints, string-int maps, provider values, and JSON documents;- manifest validation and schema package loading therefore have parallel local parsing behavior instead of one typed contract.
Manifest inventory (17 YAML manifests under docs/plans/)
| File | Current validation | Priority |
|---|---|---|
layering.yaml |
verify_layering.py |
High — core architectural rule |
topology-target.yaml |
verify_topology.py |
High — placement rules |
file-size-budgets.yaml |
verify_file_budgets.py |
Medium |
test-ownership.yaml |
verify_test_ownership.py |
Medium |
lint-escalation.yaml |
verify_manifests.py |
Medium |
suppressions.yaml |
verify_suppressions.py |
Medium |
assurance-domains.yaml |
verify_manifests.py |
High — proof routing |
coverage-manifests/* |
verify_manifests.py |
High — #590 depends on these |
migrations.yaml |
verify_migrations.py |
Low |
Implementation order
- Create typed Pydantic models for the coverage-gap families first (
assurance-domains.yaml,evidence-freshness.yaml,oracle-quality.yaml,scenario-coverage.yaml,test-quality-coverage.yaml) — fix(verification): make coverage declarations executable contracts #590 needs typed lifecycle fields. - Type the schema package catalog (
schemas/packages.py) — replace dataclassto_dict()/from_dict()with Pydanticmodel_dump(mode="json"). - Type the remaining manifest families, retiring one hand-validator per manifest family.
Design constraints
- Use Pydantic
BaseModel/TypeAdapteras the single loader for docs/plans manifests, proof coverage manifest subjects, rendered docs, andverify-manifests. - Extra fields forbidden by default unless a specific manifest model declares an extension map.
- Coverage-gap lifecycle fields added by fix(verification): make coverage declarations executable contracts #590 are part of the typed coverage manifest model.
- Schema package serialization uses
model_dump(mode="json"); normal loading andverify-schema-roundtripexercise the same models, not parallel hand-written conversion. verify-manifests --jsonemits structured errors with manifest path, JSON pointer, field, expected type, actual value, and owning manifest family.- Avoid preserving current forgiving coercions by accident. Numeric/string-map/provider coercions should become typed validators with focused tests, not silent best-effort conversion.
Acceptance criteria
- Manifest families under
docs/plans/*.yamlhave typed Pydantic models or TypeAdapter contracts. verify-manifestsreports validation errors from those typed contracts and no longer carries one-off mapping/list/string checks for each manifest family.- Coverage-gap lifecycle fields added by fix(verification): make coverage declarations executable contracts #590 are part of the typed coverage manifest model.
- Schema package manifests/catalogs are Pydantic models with strict or intentionally documented
extrabehavior. - Schema package serialization uses
model_dump(mode="json"); normal loading andverify-schema-roundtripexercise the same models. - JSON schemas for repo-control manifest families can be emitted for editors/bots or generated into docs if useful.
Relationship to #601
#629 owns typed package/manifest loading; #601 owns corpus/runtime validation. Do not create a second schema-package parser in #601.
Metadata
Metadata
Assignees
Labels
area:devtoolsDevtools and repo control-plane toolingarea:schemaSchematheme:verifiabilitySchema-native proof and evidence architecturetype:refactorCode restructuring
Activity
Sinity commentedon May 1, 2026
Additional scope from the compactness audit: this should explicitly distinguish two Pydantic conversions.
devtools/verify_manifests.pyraw YAML walking with typed models/TypeAdapter validation for docs/plans manifests, including coverage-gap lifecycle fields once those are added.schemas/packages.pydataclassto_dict()/from_dict()helpers and custom coercion (_string_list,_int_value,_string_int_dict, provider coercion, JSON-document coercion) with Pydantic models andmodel_dump(mode="json").The second part matters because
verify-schema-roundtripshould test the same typed loading machinery used by normal schema package loading, not a parallel hand-written conversion layer.Ref #578
[-]refactor(manifests): use typed Pydantic models for plan and schema catalogs[/-][+]refactor(manifests): type repo-control manifests and schema catalogs[/+]Sinity commentedon May 1, 2026
Typed-model guard: when replacing manifest/catalog hand-validation with Pydantic, avoid preserving the current forgiving coercions by accident.
Acceptance should define the
extraand coercion policy per manifest family:verify-manifestsand normal loading use.The goal is one authoritative typed contract. A Pydantic wrapper around the same ad hoc permissive parsing would not materially improve the current state.
Sinity commentedon May 1, 2026
Implementation anchors and acceptance additions from the 2026-05-01 follow-up audit.
Replacement targets:
devtools/verify_manifests.py:15-24:load_manifest()returns raw YAML mappings.devtools/verify_manifests.py:130-158: coverage gap shape validation only checks a small set of prose fields.polylogue/schemas/packages.py:46-83,:86-140,:155-193: dataclass schema package/catalog models plus ad hoc coercion helpers.devtools/verify_schema_roundtrip.py:36-68: current roundtrip is structural: packageto_dict()/from_dict(), schema loadability, root type.Acceptance additions:
BaseModel/TypeAdapteras the single loader for docs/plans manifests, proof coverage manifest subjects, rendered docs, andverify-manifests.verify-manifests --jsonemits structured errors with manifest path, JSON pointer, field, expected type, actual value, and owning manifest family.model_dump(mode='json')and the same loader in normal runtime, docs generation, andverify-schema-roundtrip.Relationship to #601: #629 owns typed package/manifest loading; #601 owns corpus/runtime validation. Do not create a second schema-package parser in #601.
Sinity commentedon May 1, 2026
Manifest typing decision from 2026-05-01 bundle
Typed manifests/schema package catalogs are accepted, but should not create another parallel parsing stack.
Acceptance refinements:
verify-schema-roundtripand runtime schema package loading.Ref #590
Ref #601
Sinity commentedon May 2, 2026
Manifest inventory
17 YAML manifests under
docs/plans/:layering.yamlverify_layering.pytopology-target.yamlverify_topology.pyfile-size-budgets.yamlverify_file_budgets.pytest-ownership.yamlverify_test_ownership.pylint-escalation.yamlverify_manifests.pysuppressions.yamlverify_suppressions.pyassurance-domains.yamlverify_manifests.pycoverage-manifests/*verify_manifests.pymigrations.yamlverify_migrations.pyImplementation order
The highest-leverage starting point is the manifest families that
verify_manifests.pyalready validates with hand-rolled YAML walkers — those are the ones where typed models immediately eliminate fragile manual checks.Suggested order:
polylogue/proof/coverage_manifests.py(orschemas/manifests/) with Pydantic models for the coverage-gap families first —assurance-domains.yaml,evidence-freshness.yaml,oracle-quality.yaml,scenario-coverage.yaml,test-quality-coverage.yaml— because fix(verification): make coverage declarations executable contracts #590 needs typed lifecycle fieldsschemas/packages.py) — replace dataclassto_dict()/from_dict()with Pydanticmodel_dump(mode="json")Already-typed manifests
Check
docs/plans/topology-target.yaml—devtools/verify_topology.pymay already use Pydantic for this one (it was added during the topology projection work). If so, use it as the reference pattern.feat(verification): typed Pydantic manifests, anti-vacuity breaker ru…
Sinity commentedon May 3, 2026
Closed by #755. All 17 YAML manifests have Pydantic v2 models with
extra='forbid'.validate_manifest()dispatch validates by manifest type.devtools verify-manifestsruns typed validation.feat(verification): typed Pydantic manifests, anti-vacuity breaker ru…