Skip to content

fix: preserve assumptions in threat-model JSON - #367

Open
rksharma-owg wants to merge 1 commit into
OWASP:masterfrom
rksharma-owg:codex/fix-assumption-json
Open

rksharma-owg wants to merge 1 commit into
OWASP:masterfrom
rksharma-owg:codex/fix-assumption-json

Conversation

@rksharma-owg

Copy link
Copy Markdown

JSON export reduced assumptions to their names. Reloading a model with element assumptions failed validation, while model-wide assumptions lost descriptions and excluded threat IDs. Resolved excluded findings also exported the assumption's exclusion set as a string.

This registers Assumption with the existing structured serializer and uses it for embedded assumptions. Four regression cases cover model-wide and element assumptions, including whether a threat remains excluded after exporting, importing and resolving a model. The README documents the corrected export shape.

Compatibility: exported assumptions now contain name, description and exclude, rather than a name string. The existing importer accepts these objects, and legacy model-wide string inputs remain supported. Consumers that expect exported assumptions to be strings will need to accept objects.

Validation for a941c70b917a0075297887a3b851fa8869894a8b, against 381dea05c58055ba218e632510dd3a327d2bf215:

  • Local macOS / Python 3.14: baseline 251 passed; all four new cases failed on baseline; patched suite 255 passed. Scoped Black/Ruff, diff checks and source/wheel builds passed.
  • Fork preflight: Ubuntu / Python 3.11–3.14 each passed 251 baseline tests, demonstrated the four expected regression failures, and passed 255 patched tests. Scoped formatting/lint and distribution builds passed on every runtime.
  • Equivalent Python CodeQL analysis using v4 actions reported zero findings on both baseline and patch. The upstream workflow uses v1 actions; fork CI configuration is separate from this contribution.
  • Secret-dependent optional CodeSee was not run in the fork. Upstream PR checks remain to run.

Newly discovered during local investigation; no existing issue or competing fix found.

@rksharma-owg
rksharma-owg requested a review from izar as a code owner October 11, 2026 17:48
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