Repository navigation
feat(hydra-gates): gate 123 holds listed files at the 5-star unit bounds - #913
Merged
Merged
Conversation
…and its levers The report now carries `rating`: a continuous 0.5 to 5.5 estimate per check (Alves, Correia and Visser 2011, eq. 1), per property and language, per property across languages (weighted by code), per sub-characteristic and overall. SIG publishes no power-mean exponent for the 2026 model, so the overall rating is reported under p = 1 and p = -1 as a range. Levers: per property and language, the overall gain from fixing the next 1,000 exposed lines worst band first, and the lines needed to raise the property by 0.5. A lever is sure when it ranks in the top 3 under both exponents. Report rows now also carry the lines above each bound. Component independence and entanglement get assumed 3 and 2 star caps for the estimate only; their discrete check still reads <4 below 4 stars. Assisted-by: ClaudeCode:claude-opus-5-5
An app may list files in .sig/five-star-files.txt (repo-relative paths, one per line, # comments allowed). Gate 123 then fails when a unit in a listed file exceeds NLOC 15, McCabe 5 or 2 parameters, or when the file holds a duplicated block of 6+ code lines. Units come from gate 122's lizard reader, clones from gate 122's 6-line windows, now shared through dup_windows(). - Clone windows leave out use/namespace/import lines and comment-only end markers such as }//end name(); everything else still counts. - Parameter rule exemptions, detected from the source: constructors that only wire dependencies (promoted, assigned, or forwarded to the parent), and PHP methods that implement an interface method in the class's implements chain (repo interfaces, parents, vendor via composer maps). - Diff mode (a base) judges listed files the change touches or adds to the list; full mode judges all. A listed file that is gone fails, and so does removing a path while its file exists. - Vue/JS/TS findings are warnings while the pinned lizard is 1.25.0 or older (terryyin/lizard#549); the runner reports them as WARNING. - The gate applies when either .github/sig-floor.json or the list exists. Assisted-by: ClaudeCode:claude-opus-5-5
In .vue, .js and .ts files the clone windows of gate 123's five-star file
floor now also leave out SFC block tags (<template>, <script setup>,
</style> and the like) and the `export default {` line with the `}` that
closes it. Import lines were already left out. Component lists, lifecycle
bodies and template markup still count.
Assisted-by: ClaudeCode:claude-opus-5-5
A public controller method named as a route target in appinfo/routes.php is exempt from the parameter rule when every parameter is a path parameter of that one route. Size, complexity and clones still apply. Detection reads routes.php: commented-out routes do not count, `Settings\Foo#bar` targets resolve into the Controller subfolder, and `resources` entries name no method. PHP comment stripping now keeps string contents, so a `//` or `#` inside a string no longer cuts the line. Assisted-by: ClaudeCode:claude-opus-5-5
Gate 122's 6-line windows no longer cross a block boundary in a .vue file. Template, script, style and custom blocks are separate pieces, and the tag lines belong to none. The share's denominator keeps every code line. The five-star file floor shares dup_windows() and follows the same rule; the boundaries are read from the file's lines because the floor's code lines leave the tags out. This is an assumption until a real Sigrid scan confirms it. The report (markdown and an `assumptions` list in the JSON) and sig-scores.mdx say so. The jscpd cross-check figure does not apply it. Assisted-by: ClaudeCode:claude-opus-5-5
Assisted-by: ClaudeCode:claude-opus-5-5
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.
Stacks on #911 (
feat/sig-rating-estimate). Review or merge #911 first; until then this diff also shows its commits.What it adds
An app can list files in
.sig/five-star-files.txt: repo-relative paths, one per line,#comments allowed. Gate 123 holds each listed file at the 5-star unit bounds.dup_windows().use,namespaceand import lines, plus comment-only end markers such as}//end name(). In.vue,.jsand.tsfiles they also skip SFC block tags and theexport default {line with its closing}. Every other line counts.implementschain. The chain covers parents, abstract parents, repo interfaces and vendor interfaces found through composer's autoload maps.appinfo/routes.php, when every parameter is a path parameter of that one route..vue,.jsand.tsfiles are warnings while the pinned lizard is 1.25.0 or older (JS/TS: a < comparison in an object property value is read as generic type parameters and merges the following functions terryyin/lizard#549). The runner then reports gate 123 as WARNING.sig-scores.mdxsay so. On openregister at a0c6f629e, Vue duplication goes from 11.61% (2 stars) to 9.40% (3 stars)..github/sig-floor.jsonor the list exists. Without either it stays NOT APPLICABLE.check_sig_floor.py write .re-records the app-level floor at current values. It adds checks the tree meets and never drops a floored one; a test now covers the raise direction too.Verified locally
test_sig_file_floor.py: 49 tests. Pass and fail fixtures per rule, all three exemptions, the clone-line exclusions, missing and unlisted files, diff vs full mode, and the Vue warning with a newer lizard pin.test_gate123_sig_floor_scope.sh: new arms 5 (FAIL on a listed PHP file) and 6 (WARNING on a listed Vue file).test_check_sig_floor.py(35),test_check_sig_maintainability.py(67, 10 new for the Vue pieces),test_gate122_sig_maintainability_scope.sh.🤖 Generated with Claude Code