Skip to content

Four metadata blocks did not list what the policy reads - #95

Merged
kmadan merged 2 commits into
mainfrom
fix/stale-required-metrics-blocks
Aug 30, 2026
Merged

Four metadata blocks did not list what the policy reads#95
kmadan merged 2 commits into
mainfrom
fix/stale-required-metrics-blocks

Conversation

@kmadan

@kmadan kmadan commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

aicertify explain eu_ai_act reports 142 declared fields and 13 measured. The playground manifest reports 150 and 14.

Neither is wrong about its own source. The manifest unions an AST scan with the RequiredMetrics: comment block; explain reads the comment block alone. The eight fields in the difference are read by the code and were never declared in the block.

Policy Problem
transparency.rego no RequiredMetrics block at all (4 fields)
risk_management.rego no RequiredMetrics block at all (4 fields)
robustness.rego missing system.continues_to_learn_after_deployment
record_keeping.rego missing logs.sectoral_minimum_months

Verified by copying the four edited policies into AICertify's pinned submodule and re-running explain: 150 declared, 14 measured, an exact match with the manifest.

The block is part of the spec per CLAUDE.md, and it is the only field list someone reading a single policy file can see.

Worth a follow-up: the union is what hid this. A field present in either source appears in the manifest, so a comment block can rot indefinitely without any published number moving. A gate comparing the block against the AST scan would catch the next one; scripts/extract-input-fields.sh already does the extraction.

kmadan added 2 commits August 30, 2026 16:14
`aicertify explain eu_ai_act` reported 142 declared fields and 13 measured.
The playground manifest reports 150 and 14. Neither was wrong about its own
source: the manifest unions an AST scan with the metadata comment block, while
`explain` reads the comment block alone. The eight fields in the difference are
read by the code and were never declared in the block.

  transparency.rego        no RequiredMetrics block at all (4 fields)
  risk_management.rego     no RequiredMetrics block at all (4 fields)
  robustness.rego          missing system.continues_to_learn_after_deployment
  record_keeping.rego      missing logs.sectoral_minimum_months

The block is part of the spec, per CLAUDE.md, and it is the only field list a
consumer reading one file can see. Both counts now agree at 150 declared and
14 measured.

The union in the manifest is what hid this: a field present in either source
appears in the output, so a block can rot indefinitely without any published
number moving.
The blocks are a source for coverage.json, so changing them without
regenerating left the derived file behind. CI's --check mode caught it.
@kmadan
kmadan merged commit 0936496 into main Aug 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant