Skip to content

feat(action): analyze, drift, and review modes for the GitHub Action - #76

Merged
Hacks4Snacks merged 4 commits into
mainfrom
hacks4snacks/githubactionexpansion
Jul 27, 2026
Merged

feat(action): analyze, drift, and review modes for the GitHub Action#76
Hacks4Snacks merged 4 commits into
mainfrom
hacks4snacks/githubactionexpansion

Conversation

@Hacks4Snacks

Copy link
Copy Markdown
Owner

feat(action): analyze, drift, and review modes for the GitHub Action

What changed

ACT-001 — Action v1 closure. Adds rules, ruleset, suppression-file, pull,
upload-report, and report-artifact-name inputs. A missing rules or suppression path now
fails the run instead of silently falling back to the built-ins. Model globs are read one per
line, so a path containing a space is one path.

ACT-002 — Drift detection. New drift mode (off/notice/fail) reports when watched
source files changed without their threat model. Inert until drift-watched-paths is set, and
optionally keeps one idempotent PR comment up to date.

ACT-003 — Review mode. review: on diffs every threat model the PR touches against its base
revision and renders one bounded summary: new findings, trust boundary crossing changes, then
element and property changes. Full detail goes to review.json in the report artifact.

Supporting CLI work:

  • tmforge diff gained a trust boundary crossing comparison (data.crossings).
  • tmforge analysis diff <base> <head> compares two analysis documents by finding identity.

Why

Three things drove the design:

  • The structural diff could not see a change of exposure. ModelDiff ignores geometry, which
    is what keeps it quiet on re-layout — but trust boundary containment is derived from geometry.
    Verified on examples/webshop.tm7: moving one endpoint so a flow stopped crossing both
    boundaries produced the words No differences. Crossings are now compared separately and listed
    with their own budget, so a large rename sweep cannot bury them.

  • Counts cannot answer "what arrived". The findings delta matches on the stable
    {ruleId}:{diagram}:{target}:{occurrence} identity from ANA-001, so renaming an element is not a
    finding change and a suppressed finding reports as reclassified rather than resolved. A changed
    rule selection is warned about, never folded in.

  • The base analysis must see the same policy. The action analyzes the base revision at the
    model's own path
    (head content moved aside and restored, including on failure). A suppression is
    keyed by the path it was declared for, so analyzing a copy elsewhere would match no suppression
    and every suppressed finding would read as one this PR suppressed.

@Hacks4Snacks
Hacks4Snacks merged commit 29c2ca3 into main Jul 27, 2026
10 checks passed
@Hacks4Snacks
Hacks4Snacks deleted the hacks4snacks/githubactionexpansion branch July 27, 2026 18:10
This was referenced Jul 27, 2026
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.

[ACT-003] GitHub Action review mode [ACT-002] GitHub Action drift mode [ACT-001] GitHub Action v1 closure

1 participant