Skip to content

Add rule_id field to review-verdict findings for auditable convention-pack traceability #571

Description

@jflowers

Problem

Convention packs define machine-referenceable rule IDs (CS-NNN, AP-NNN, SC-NNN, TC-NNN, DR-NNN) with RFC-2119 severity levels. Divisor review personas are prompt-instructed to cite these rule IDs when reporting findings. However, the review-verdict schema (schemas/review-verdict/v1.0.0.schema.json) has no rule_id field on findings — only severity, category, description, file, and line.

This means whether a finding actually traces back to a documented rule depends on the model following the prompt instruction, not on structural enforcement. An auditor cannot programmatically answer "which convention-pack rule triggered this finding?" without parsing natural-language text.

Current state

  • Convention packs define rules with explicit IDs and severity levels (e.g., CS-003 [MUST])
  • severity.md is structurally grounded — alwaysDeployedPacks in scaffold.go:478 ensures it is always co-deployed; Divisor personas mark it as MUST-load
  • Findings in the review-verdict schema capture severity and category but NOT a rule ID reference
  • Severity is consistent and auditable. Rule traceability is not.

Proposed change

Add an optional rule_id field to the finding object in schemas/review-verdict/v1.0.0.schema.json:

"rule_id": {
  "type": "string",
  "pattern": "^[A-Z]{2,3}-[0-9]{3}$",
  "description": "Convention pack rule identifier (e.g., CS-003, AP-012, SC-001)"
}

The field should be optional (not in required) to allow findings that are not convention-pack-grounded (e.g., project-specific observations). But when a finding IS grounded in a convention-pack rule, the schema should capture that link structurally.

Benefits

  1. Auditable traceability: programmatically trace any finding to the documented rule that motivated it
  2. Rule effectiveness measurement: which rules generate the most findings? which are never triggered? (feeds Build-to-Delete methodology)
  3. Cross-reviewer consistency: verify that different Divisor personas cite the same rule for the same pattern
  4. Convention-pack evolution: data-driven decisions about which rules to add, modify, or remove

Related

Activity

  1. added
    enhancement
    on Sep 1, 2026
  2. jflowers commented on Nov 2, 2026

    @jflowers
    ContributorAuthor

    Triage Summary

    The Divisor review panel classifies this issue as VALID — enhancement (objective), by a 5/5 persona majority (adversary, architect, curator, guard, and sre; all dispatched runs succeeded, none dissented).

    Verified against the repository

    • schemas/review-verdict/v1.0.0.schema.json defines findings with exactly severity, category, description, file, and line, and sets additionalProperties: false — the schema structurally rejects a rule reference today, so the described gap is real, not merely an omission. The finding shape in schemas/review-verdict/v2.0.0.schema.json is identical.
    • A repository-wide search for rule_id / ruleId returns zero matches across schemas/, Go, and TypeScript sources — no existing field, no in-flight implementation, and no duplicate proposal.
    • Convention packs ship two-letter-prefix, three-digit rule IDs (CS, AP, SC, TC, DR, CP, CI, VB, TD, BA, PR, FA, FT, MP, DE, RV, TA, CR), so the proposed pattern ^[A-Z]{2,3}-[0-9]{3}$ matches every deployed rule ID with headroom for a future three-letter prefix.
    • alwaysDeployedPacks includes severity in internal/scaffold/scaffold.go (the cited line 478 has drifted to ~785 as the file grew; the mechanism claim is accurate). Severity is structurally grounded; rule traceability is prompt-only — the asymmetry the issue identifies.
    • The proposal completes documented design intent: specs/005-the-divisor-architecture research R3 designed rule IDs so findings can cite them for traceability and trend analysis, and the Constitution's Observable Quality principle calls for machine-verifiable provenance in artifacts.

    Recommendations for implementation

    1. Target the canonical schema version. The registry now also carries schemas/review-verdict/v2.0.0.schema.json (canonical since 2026-10-01; its shared $defs/finding covers both persona_verdicts[].findings and unresolved_findings). An additive minor version (v2.x) through the versioned-directory registry fits the upgrade path better than editing the historical v1.0.0 file, because additionalProperties: false means validators pinned to older schemas reject artifacts carrying the new field.
    2. Carry the field through the producer chain. The submit_review_findings validation contract, the dispatch finalize payload, and the persona output prompt contracts must accept rule_id in the same change, or the field exists in the schema but is never populated.
    3. Keep the field optional. A required rule_id on LLM-generated findings invites fabricated citations for findings with no rule basis; optionality keeps the grounded subset honest and makes absence itself an auditable signal.

    Next steps

    Route this through a spec workflow — the change touches the schema registry, the dispatch pipeline contracts, and persona prompts, which fits the OpenSpec tactical tier. The enhancement label is already applied to this issue.

    This triage was performed by the Divisor review panel.

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

    enhancement

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions