Skip to content

fix(retired): boolean retired, stub tolerance, schema 20260925 - #42

Merged
jon-trust merged 1 commit into
mainfrom
fix/retired-boolean
Sep 25, 2026
Merged

jon-trust merged 1 commit into
mainfrom
fix/retired-boolean

Conversation

@jon-trust

Copy link
Copy Markdown
Contributor

Why

tmx is about to export retired as a JSON boolean on all five entity sections (feature_classes, threats, control_objectives, controls, actions), and the released dataset will keep retired ids as {"retired": true} stubs. Both reach tmxcaliber first:

  • The OverWatch publish gate diffs a new export against the JSON already in each customer's GitHub repo, where threats, control objectives and controls hold "false" and feature classes and actions have no key. Without a scoped comparator, every delivery would block on "false" vs false, with nothing to file.
  • ThreatModelData is how internal SDK readers (ccr_factory intake, sweep_uncaptured_drift.py) load released-dataset documents, and it indexes fields a stub does not have.

What

  • compare_retired in COMPARATORS for all five sections: absent, "false" and false read the same; a real flip is reported as the lowercase strings the change log always showed. _values_differ is untouched. rolled_out_keys needs nothing.
  • diff_threatmodels drops stubs on both sides, so a retirement reads as a removal exactly as before.
  • upgrade_to_latest_template_version drops stubs, coerces string flags to bool, and reads class_relationship with .get.
  • validate_permissions and the CLI feature-class listing accept both forms and skip stubs.
  • Schema 20260925.json (20240423.json unchanged): retired is boolean on every section, and each entity is a full record or a retiredStub via oneOf, keeping properties inline so the E136 api_details pointer still resolves. It becomes the latest by filename date.
  • Version 0.4.0.

Verification

uv run pytest: 304 passed (104 new). ruff format/check and mypy clean. uv build includes the new schema in wheel and sdist. A stubbed fixture export from the tmx branch loads through ThreatModelData without error.

Merge order

Merge this before tmx 1c61a27 is pushed: tmx installs tmxcaliber unpinned, and this comparator must be live before any boolean export reaches the gate. Tolerant of today's string output, so it is safe to merge now.

🤖 Generated with Claude Code

https://claude.ai/code/session_015rBiJvwvpEVjgvsvWTYx7X

tmx is about to export `retired` as a JSON boolean on all five entity
sections, and the released dataset will keep retired ids as
{"retired": true} stubs. Both reach tmxcaliber before anything else:

- The OverWatch publish gate diffs a new export against the JSON in each
  customer's GitHub repo, where threats, control objectives and controls
  hold "false" and feature classes and actions have no key. Without a
  scoped comparator every delivery would block on "false" vs false.
  compare_retired reads absent as live and reports a real flip as the
  lowercase strings the change log always showed. diff_threatmodels drops
  stubs on both sides, so a stub reads the same as a dropped id.
- ThreatModelData is how the internal SDK readers load released-dataset
  documents, so its single load path now drops stubs, coerces string
  flags to bool, and reads class_relationship with .get.
- validate_permissions skips a retired threat in either form, and the CLI
  feature-class listing skips stubs.
- Schema 20260925 (20240423 unchanged) declares retired boolean on every
  section and each entity as full record or retiredStub via oneOf, with
  properties kept inline so the E136 api_details pointer still resolves.
  It is picked up as the latest by filename date.

Version 0.4.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015rBiJvwvpEVjgvsvWTYx7X
@jon-trust
jon-trust merged commit 63dd046 into main Sep 25, 2026
4 checks passed
@jon-trust
jon-trust deleted the fix/retired-boolean branch September 25, 2026 01:21
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