Skip to content

refactor(core): remove typed governance schema, generalize metadata merge (Phase 2 of #1172)#1179

Merged
christso merged 2 commits intomainfrom
feat/1172-p2-slim-core
Apr 27, 2026
Merged

refactor(core): remove typed governance schema, generalize metadata merge (Phase 2 of #1172)#1179
christso merged 2 commits intomainfrom
feat/1172-p2-slim-core

Conversation

@christso
Copy link
Copy Markdown
Collaborator

Summary

Phase 2 of #1172 — subtractive, no new code.

Removes the typed governance schema from packages/core/ (introduced in #1165) and generalises the suite-↔-case metadata merge. Governance data continues to travel through existing generic metadata: Record<string, unknown> on EvalTest and EvaluationResult.

Deleted from core:

  • GovernanceMetadataSchema, GovernanceMetadata type, and governance field from EvalMetadata in metadata.ts
  • KNOWN_GOVERNANCE_FIELDS, EU_AI_ACT_RISK_TIERS, validateGovernance, isWellFormedControlId, extractGovernanceBlock from eval-validator.ts
  • Both validateGovernance(...) call sites (suite-level and case-level lint)
  • -427 lines net, +37 lines (the generalised merge function)

Generalised:

  • mergeCaseGovernancemergeSuiteMetadataPayload: applies the same array-concat-dedup / scalar-case-wins rules to all keys under metadata, not just governance. No governance-specific branches remain.

Test updates:

  • metadata.test.ts: removed governance-specific tests; added regression for "returns undefined when only governance is present and name is absent"
  • yaml-parser-metadata.test.ts: removed suite-level suite.metadata?.governance test (governance no longer in EvalMetadata); case-level merge tests preserved and still pass
  • eval-validator.test.ts: removed governance metadata validation describe block (6 tests)

Test plan

  • bun test passes (all 1735 tests)
  • JSONL metadata.governance output byte-identical to main — dry-run UAT:
    • main: { "governance": { "schema_version": "1.0", "owasp_llm_top_10_2025": ["LLM01"], "mitre_atlas": ["AML.T0051"], "controls": ["NIST-AI-RMF-1.0:MEASURE-2.7", "EU-AI-ACT-2024:Art.55"], "risk_tier": "high", "owner": "security-team" } }
    • branch: identical
  • Pre-push hook passed: Build ✓ Typecheck ✓ Lint ✓ Test ✓ Validate eval YAML ✓

Closes #1172 (Phase 2)

christso and others added 2 commits April 27, 2026 18:52
…erge (Phase 2 of #1172)

- Delete GovernanceMetadataSchema, GovernanceMetadata type, and governance field from
  EvalMetadata — governance data travels via case-level metadata: Record<string, unknown>
- Delete KNOWN_GOVERNANCE_FIELDS, EU_AI_ACT_RISK_TIERS, validateGovernance, isWellFormedControlId,
  and extractGovernanceBlock from eval-validator; lint moves to agentv-compliance skill + CI Action
- Generalise mergeCaseGovernance → mergeSuiteMetadataPayload: same array-concat-dedup / scalar-
  case-wins rules now apply to all keys under metadata, not just governance
- JSONL metadata.governance output is byte-identical to main (verified with dry-run UAT)

Closes #1172 (Phase 2)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@christso christso merged commit 684c38f into main Apr 27, 2026
3 of 4 checks passed
@christso christso deleted the feat/1172-p2-slim-core branch April 27, 2026 17:08
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.

refactor: move governance metadata from typed core schema to agentv-compliance skill

1 participant