Skip to content

feat(v0.3.0): metadata namespace redesign (BREAKING)#9

Merged
willwebster5 merged 15 commits into
masterfrom
feature/v0.3.0-metadata-namespace
Apr 16, 2026
Merged

feat(v0.3.0): metadata namespace redesign (BREAKING)#9
willwebster5 merged 15 commits into
masterfrom
feature/v0.3.0-metadata-namespace

Conversation

@willwebster5
Copy link
Copy Markdown
Owner

Summary

  • New reserved top-level metadata: namespace on every resource type, stripped from API payloads and content hashes (closes the issue **dashboard apply fails: "_template_path" leaks into Humio payload (+ design Q: metadata namespace)** #7 bug class for all providers, not just dashboard).
  • metadata.maturity: validation runs universally; metadata.ads: is detection-only; third-party sub-namespaces (metadata.<any>) pass through unvalidated but guaranteed never to leak to the CrowdStrike/Humio API.
  • Hard-break rejection of pre-v0.3.0 shapes (top-level ads:, flat metadata:) with a migration pointer referencing CHANGELOG.md.

Breaking changes

  • Templates with top-level ads: or flat metadata: {created, tune_count, …} at the root now fail talonctl validate with a migration-pointer error. Users migrate by hand (mechanical rule in CHANGELOG); no talonctl migrate command ships.

Changes

  • core/metadata_validators.py (new): validate_maturity() + reject_old_shape().
  • All 7 providers call the shared validators and route their payload/hash paths through core/template_sanitizer (shipped in v0.2.1).
  • examples/resources/detection.yaml migrated to nested shape. Three other examples (lookup_file, rtr_put_file, workflow) had pre-existing validation bugs; these are fixed so the new parity test can enforce real schema compliance.

Test plan

  • pytest tests/ — 542 passed (was 491 before this branch)
  • ruff format --check src/ tests/ — clean
  • ruff check src/ tests/ — clean
  • No top-level ads: or flat metadata: remain in examples/ or src/talonctl/templates/
  • New regression tests:
    • tests/unit/test_metadata_validators.py — 30 tests for shared validators
    • tests/unit/test_old_shape_rejection.py — 14 parametrized tests locking the migration-pointer string across all 7 providers
    • tests/unit/test_examples.py — parity test validating every reference YAML
  • Live-tenant validation: talonctl plan on a v0.3.0-migrated project shows NO_CHANGE when only metadata.* fields change (requires work environment — side-project has no API access)

Plan: docs/superpowers/plans/2026-04-16-metadata-namespace-redesign-plan.md

🤖 Generated with Claude Code

- lookup_file.yaml: point to stub CSV asset (was referencing a non-existent path)
- rtr_put_file.yaml: rename source -> file_path (correct schema field) + stub XML
- workflow.yaml: replace synthetic placeholder with minimal valid trigger+actions

Surfaced by the v0.3.0 example-parity test. No metadata/ads migrations were
needed on any example except detection.yaml (Task 13).
@willwebster5 willwebster5 merged commit c943211 into master Apr 16, 2026
6 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