Skip to content

feat(hydra-gates): gate 122 reports against a five-star profile on request - #879

Merged
rubenvdlinde merged 1 commit into
mainfrom
feat/gate-122-five-star-profile
Oct 30, 2026
Merged

rubenvdlinde merged 1 commit into
mainfrom
feat/gate-122-five-star-profile

Conversation

@rubenvdlinde

@rubenvdlinde rubenvdlinde commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

What

Gate 122 (check_sig_maintainability.py) gets a selectable profile for report mode:

  • four-star (default): the SIG/TUV NORD CERT Guidance for Producers v17.0 limits, unchanged.
  • five-star: half of each 4-star limit, since SIG publishes no 5-star limits. Duplication 2.8%, unit size >15/30/60 at 23.6/11.6/4.2%, McCabe >5/10/25 at 10.1/3.7/0.55%, parameters 3+/5+/7+ at 7.5/1.65/0.45%, module coupling >10/20/50 at 5.0/2.8/0.95%, component independence at least 96.9%, entanglement 0.0385.

Select it with report <app> --profile five-star, or HYDRA_GATE_SIG_PROFILE=five-star when the flag is absent (the runner passes its environment through, so a workflow can set the variable). An unknown profile exits 2. The report JSON gains profile and stars; the markdown and the census line name the profile (N of M 5-star checks met).

What does not change: the ratchet's unit bounds (NLOC > 60, McCabe > 10, 5+ parameters), the default, and the gate's advisory status.

Tests

New Profiles class in test_check_sig_maintainability.py on a fixture with 16.9% of its PHP in a unit over 30 lines (inside 4 stars, outside 5 stars):

  • five-star is half of every four-star limit, to the rounding the brief uses
  • the default is four-star and passes the fixture
  • --profile five-star misses php unit_size >30 on the same code, and carries the halved duplication, independence and entanglement limits
  • the env var selects the profile and the flag overrides it
  • an unknown profile is exit 2
  • the ratchet ignores the profile

Verified locally

  • python3 hydra-gates/scripts/lib/test_check_sig_maintainability.py: 29 tests OK
  • test_gate122_sig_maintainability_scope.sh: all arms passed, with and without HYDRA_GATE_SIG_PROFILE=five-star
  • test_gate_discarded_counts_and_empty_deltas.sh: 37 assertions, 0 failures (a first run under machine load aborted one gate-15 run before its summary; main and a rerun of this branch are both 0 failures)
  • test_gate_acceptance_matrix.sh: 263 passed, 2 failed, both from one runner run on the manifest-l10n-coverage/planted fixture that aborted before its COVERAGE line under load. Rerunning the runner on that fixture on this branch and on main gives the same result: COVERAGE printed, gate 102 FAIL as declared, gate 122 NOT APPLICABLE.

AI tools were used to write this change (Claude Code).

🤖 Generated with Claude Code

…quest

SIG publishes no 5-star limits, so the five-star profile holds a report to
half of each 4-star limit: duplication 2.8%, unit size 23.6/11.6/4.2%,
McCabe 10.1/3.7/0.55%, parameters 7.5/1.65/0.45%, module coupling
5.0/2.8/0.95%, component independence 96.9%, entanglement 0.0385.

Select it with `report --profile five-star` or HYDRA_GATE_SIG_PROFILE.
four-star stays the default, the ratchet's unit bounds do not change, and
the gate stays advisory. An unknown profile exits 2.

Assisted-by: ClaudeCode:claude-opus-5-5
@rubenvdlinde
rubenvdlinde merged commit fa6b5d0 into main Oct 30, 2026
49 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