You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
code-metrics: audit-duplication.sh silently falls back on a non-integer duplication.rollup_depth #4127
agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.status: readyTriaged, unblocked, and fully specified; eligible to pick up.
plugins/code-metrics/skills/audit-duplication/scripts/audit-duplication.sh reads duplication.rollup_depth from the resolved config through an integer reader. A value that is not a plain integer, such as 2.0, "2", or two, falls back to the default depth with no message, so a consumer who mistyped the key sees a depth-2 rollup and nothing that says why. This was a SUGGESTION from the fresh-context code review of #4111 and was left as is there to keep that PR to its plan.
Proposed fix
Treat a non-integer rollup_depth the way the skill treats a malformed cap: say so. Two acceptable shapes, pick one:
Exit 2 with duplication.rollup_depth must be an integer (got ...), matching how the config resolver rejects other malformed keys.
Accept an integer-valued float or a quoted integer, reject everything else with the message above.
Add a case to audit-duplication.test.sh for the rejected value and, if the second shape is chosen, one for 2.0 being accepted. reference/config.md's duplication.rollup_depth row should state the accepted forms; scripts/check-code-metrics-config-reference.py gates that file against config-defaults.json, so no new key is involved.
Acceptance
A non-integer rollup_depth produces a message naming the key and the value instead of a silent default.
audit-duplication.test.sh covers it; the code-metrics changelog carries the entry and the plugin version bumps.
Type: Bug Summary: Make a non-integer duplication.rollup_depth configuration value fail loudly instead of silently falling back to the default rollup depth.
Current behavior:
The duplication audit's configuration reader accepts duplication.rollup_depth only when the resolved value is a plain integer. Any other value, including a numeric string, a float, or a non-numeric word, silently falls back to the default depth of 2 with no message printed anywhere, so a consumer who mistypes the key or its value gets a working but unexplained depth-2 rollup with no indication anything was wrong.
Desired behavior: Defaulted decision: exit with an error naming the key and the value (matching how the same command already rejects other malformed configuration keys). Maintainer-vetoable alternative: accept an integer-valued float or a quoted integer as valid input in addition to a plain integer, and reject only genuinely non-integer values with the same error.
When duplication.rollup_depth resolves to a value that is not a plain integer, the audit-duplication command exits with status 2 and prints a message naming the key (duplication.rollup_depth) and the offending value. A value that is a valid integer continues to work exactly as before, including the existing default of 2 when the key is absent entirely.
Key interfaces:
The configuration resolver's integer-reading helper used for duplication.rollup_depth (the same pattern used for the other duplication.* numeric keys) — gains a reject-with-message path instead of a silent fallback
The audit-duplication command's exit code 2 — reused for this malformed-value case, consistent with its other usage-error exits
The duplication.rollup_depth row in the configuration reference documentation — states the accepted forms
Acceptance criteria:
Running the duplication audit with duplication.rollup_depth set to a non-integer value (for example a non-numeric string) exits with status 2 and a message naming both duplication.rollup_depth and the rejected value.
Running the duplication audit with duplication.rollup_depth absent from configuration still succeeds using the default depth of 2, unchanged.
Running the duplication audit with duplication.rollup_depth set to a valid integer still succeeds and the rollup uses that depth, unchanged.
The configuration reference documentation's duplication.rollup_depth row states the accepted value forms.
The code-metrics plugin's changelog carries an entry for this fix and the plugin version is bumped.
Out of scope:
Changing the accepted-forms decision for any other duplication.* or scope.* configuration key
Any change to how the JSON output represents per-directory rollup rows
Accepting integer-valued floats or quoted integers as valid input (the declined alternative)
agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.status: readyTriaged, unblocked, and fully specified; eligible to pick up.
Activity
feat(code-metrics): clone classes, explicit caps, registry cluster li…
kyle-sexton commentedon Sep 23, 2026
This was generated by AI during triage.
Decision defaulted: shape 1 (exit 2 naming the key/value, matching other malformed-key handling) — veto before merge
kyle-sexton commentedon Sep 23, 2026
This was generated by AI during triage.
Agent Brief
Type: Bug
Summary: Make a non-integer duplication.rollup_depth configuration value fail loudly instead of silently falling back to the default rollup depth.
Current behavior:
The duplication audit's configuration reader accepts
duplication.rollup_depthonly when the resolved value is a plain integer. Any other value, including a numeric string, a float, or a non-numeric word, silently falls back to the default depth of 2 with no message printed anywhere, so a consumer who mistypes the key or its value gets a working but unexplained depth-2 rollup with no indication anything was wrong.Desired behavior:
Defaulted decision: exit with an error naming the key and the value (matching how the same command already rejects other malformed configuration keys). Maintainer-vetoable alternative: accept an integer-valued float or a quoted integer as valid input in addition to a plain integer, and reject only genuinely non-integer values with the same error.
When
duplication.rollup_depthresolves to a value that is not a plain integer, the audit-duplication command exits with status 2 and prints a message naming the key (duplication.rollup_depth) and the offending value. A value that is a valid integer continues to work exactly as before, including the existing default of 2 when the key is absent entirely.Key interfaces:
duplication.rollup_depth(the same pattern used for the otherduplication.*numeric keys) — gains a reject-with-message path instead of a silent fallbackduplication.rollup_depthrow in the configuration reference documentation — states the accepted formsAcceptance criteria:
duplication.rollup_depthset to a non-integer value (for example a non-numeric string) exits with status 2 and a message naming bothduplication.rollup_depthand the rejected value.duplication.rollup_depthabsent from configuration still succeeds using the default depth of 2, unchanged.duplication.rollup_depthset to a valid integer still succeeds and the rollup uses that depth, unchanged.duplication.rollup_depthrow states the accepted value forms.Out of scope:
duplication.*orscope.*configuration keyfix(code-metrics): refuse a non-integer duplication.rollup_depth (#4387)