Repository navigation
Description
[Governance] Decide whether Anti-Debt subcategory must be schema-constrained to taxonomy values
Problem
stack/agents/anti-debt/schemas/debt-finding.schema.json requires subcategory and describes it as:
"Sous-catégorie normalisée (cf. taxonomy)"
but constrains it only as:
{
"type": "string"
}stack/agents/anti-debt/taxonomy/debt-categories.yaml defines normalized subcategories and explicitly says each subcategory should be deterministic/semi-deterministic, actionable, and non-overlapping.
This means a producer can currently emit an arbitrary subcategory string and still satisfy the JSON Schema.
Important non-problem
Do not frame observability and ai_agent as proven schema/taxonomy drift.
The taxonomy explicitly marks them as planned V2+ extensions, while the JSON schema already allows the category names. That appears intentionally forward-compatible unless another contract proves otherwise.
The governance question is specifically the unconstrained subcategory field.
Concrete failure scenario
A scanner emits:
{
"category": "architecture",
"subcategory": "random_new_arch_smell"
}The finding can pass schema validation even though the taxonomy never defined that normalized value.
Downstream scoring, grouping, reporting, deduplication, or policy code can then receive a value it did not know existed.
Investigation questions
- Is the taxonomy intended to be normative for valid
subcategoryvalues? - Or is
subcategoryintentionally extensible for future/third-party scanners? - If extensible, what contract prevents arbitrary low-quality vocabulary fragmentation?
- If normative, should validation derive allowed
(category, subcategory)pairs from the taxonomy rather than duplicating them manually in JSON Schema? - How should future V2+ categories be activated without creating two sources of truth?
Acceptance criteria
- Document whether
subcategoryis intentionally open or taxonomy-constrained. - If intentionally open, document the extension contract and how consumers must handle unknown values.
- If taxonomy-constrained, implement one-source validation without manually maintaining a second independent enum.
- Add deterministic tests for the chosen contract.
- Preserve the intentional V2+ status of
observability/ai_agentunless separately changed.
Out of scope
- Adding Implementation Economy smells to Anti-Debt.
- Activating
observabilityorai_agent. - Redesigning the Critic.
- Adding a second taxonomy.
Activity
docs(governance): reconcile architectural-change enforcement with pub…
Rwanbt commentedon Sep 12, 2026
Post-release audit triage (v2.2.1 scope review).
Verified still valid: the schema constrains
subcategoryonly asstringwhiletaxonomy/debt-categories.yamldefines the normalized vocabulary. Theobservability/ai_agentnote in the issue is accurate - not drift.Deliberately NOT implemented in v2.2.1: constraining the field is a contract decision (extensible third-party scanners vs one-source validation), not a same-class defect as the P1 source-of-truth fixes. The acceptance criteria require choosing and documenting that contract first; doing it in a corrective release would change the Anti-Debt producer contract without the decision the issue itself asks for.
Kept tracked as research, with the issue's own scope unchanged.