Repository navigation
feat(hydra-gates): gate 122 holds changed units to the SIG 4-star bounds - #871
Merged
Merged
Conversation
SIG rates maintainability from risk profiles per language. Our phpmd runs at its own defaults with baselines, so a green phpmd is not a green SIG profile: openregister keeps 16.5% of its PHP in units over 60 lines against a limit of 8.3%. With a delta base the gate ratchets: a unit the change adds or makes worse fails above NLOC 60, McCabe 10 or 4 parameters, and so does a new duplicated fragment of 6+ lines. Findings on untouched or unworsened units are inherited. Without a base it writes the full SIG risk profile (unit size, complexity, interfacing, duplication, module coupling, component independence, entanglement inputs) as sig-profile.json and sig-profile.md, report-only. lizard 1.24.3 and jscpd 4.0.5 are pinned and installed into the tool cache. PHP parameters are counted from the unique $names, Python self and cls are not parameters, and a file lizard raises on is listed as not measured. Scope follows Sigrid's default excludes plus sigrid.yaml. Ships as a warning; HYDRA_GATE_SIG_MAINTAINABILITY_BLOCKING=1 blocks.
… lines jscpd matches tokens and skips comments, so a fragment it reports can span a docblock and match its first and last line only in part. Replayed on openregister #5008 that read as a 13-line clone holding five equal code lines. SIG counts code lines repeated literally modulo whitespace, so both fragments' code lines are now paired in order and a clone needs six equal ones, in the ratchet and in the report.
jscpd reports clones pairwise and needs 30 tokens, so on openregister's PHP its literally equal lines came to 2.7% of code, where windows of six equal code lines come to 8.8%. The report now measures duplication the way SIG defines it, every later copy of six code lines equal modulo whitespace, and keeps jscpd's figure beside it as duplication_jscpd. The ratchet still uses jscpd's clones.
Contributor
Author
|
Related: nightly wiring in #872, skill file in ConductionNL/hydra#759. |
This was referenced Oct 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Gate 122,
sig-maintainability, measures what the Software Improvement Group (SIG) rates: unit size, McCabe complexity, parameters and duplication, per language. It runs on PHP, JavaScript, TypeScript, Vue and Python.sig-profile.jsonandsig-profile.md: unit size, complexity, interfacing, duplication, module coupling, component independence and the two entanglement inputs. Report-only, it passes with a census line.It ships as a warning, like every new gate.
HYDRA_GATE_SIG_MAINTAINABILITY_BLOCKING=1makes it block.Why
Our phpmd runs at its own defaults with baselines, so a green phpmd is not a green SIG profile. On 2026-10-29 openregister kept 16.5% of its PHP in units over 60 lines, against a limit of 8.3%. SIG will assess openregister, opencatalogi, integriq, filinq and anonymiq.
How it measures
~/.cache/hydra-gates/tools(or$HYDRA_GATE_TOOLS_DIR). Any other version is refused.HYDRA_GATE_SIG_NO_INSTALL=1forbids the install.$names, because lizard keeps only the last one. Pythonselfandclsdo not count.src/components/LtiPlatformDetails.vueis one.js/andl10n/, plus asigrid.yamlat the root if there is one.Verified
python3 scripts/lib/test_check_sig_maintainability.py: 23 tests, exit 0. Mutation-checked: breaking the worse-than-base rule, the clone threshold, the clone line filter, the report's line-window duplication, the PHP parameter fix or the Pythonselfrule each turns a test red.bash scripts/lib/test_gate122_sig_maintainability_scope.sh: 6 arms through the real runner (warning, blocking switch, census line, report mode, not applicable, missing tool), exit 0.test-hydra-gates-bin.sh,test_gate_acceptance_matrix.sh,test_gate_errexit_discipline.sh,test_gate_numbers_unique.sh: exit 0. Inrun-helper-suites.shlocally,test_check_connections_declaration.jsfails because Ajv is not installed on this machine, which has nothing to do with this change. ShellCheck at warning level on the runner and the new suite: exit 0.HEAD~5..HEADnamesAuditTrailMapper::findAllgrowing from NLOC 117 to 121 and McCabe 20 to 21 (#5005), and lists 21 inherited findings. Took 177 s, mostly jscpd over the PHP corpus.Notes for review
quality.yml. The skill file is a separate PR in hydra.🤖 Generated with Claude Code