Skip to content

[Governance] Decide whether Anti-Debt subcategory must be schema-constrained to taxonomy values #40

Open

Description

@Rwanbt

[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 subcategory values?
  • Or is subcategory intentionally 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 subcategory is 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_agent unless separately changed.

Out of scope

  • Adding Implementation Economy smells to Anti-Debt.
  • Activating observability or ai_agent.
  • Redesigning the Critic.
  • Adding a second taxonomy.

Activity

  1. added
    type:research
    on Sep 12, 2026
  2. Rwanbt commented on Sep 12, 2026

    @Rwanbt
    OwnerAuthor

    Post-release audit triage (v2.2.1 scope review).

    Verified still valid: the schema constrains subcategory only as string while taxonomy/debt-categories.yaml defines the normalized vocabulary. The observability / ai_agent note 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.

  3. added
    priority:P3
    on Sep 12, 2026
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

    priority:P3type:research

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions