Background
While setting up the bandit/vulture pre-commit hooks (see commit f2cd0ffe), an initial pass of LLM-driven code readers found a batch of real semantic bugs that the deterministic static analyzers (ruff F/B, bandit low/low, vulture confidence 80) do not catch - they are all correctness issues that depend on understanding intent, not on patterns ruff or bandit check.
They should be triaged and either fixed or explicitly marked as "works as intended" with a short comment. Until then they remain latent bugs.
Findings
State / threshold logic
Early exit / fall-through
Regex / parsing
Wrong identifier / variable
Argparse / parameter wiring
Acceptance criteria
Each item is either fixed with a short test or smoke check, or closed with a # the framework actually handles this because ... comment plus the rationale. A # nosec equivalent for semantic issues would be a plain # noqa: with a sentence explaining why the static reader was wrong.
Context
The lib-side findings (shell pipeline fd leak, human.py negative-number handling, cache.py timestamp off-by-one, url.py dead ternary) are tracked separately on Linuxfabrik/lib.
Background
While setting up the bandit/vulture pre-commit hooks (see commit
f2cd0ffe), an initial pass of LLM-driven code readers found a batch of real semantic bugs that the deterministic static analyzers (ruff F/B, bandit low/low, vulture confidence 80) do not catch - they are all correctness issues that depend on understanding intent, not on patterns ruff or bandit check.They should be triaged and either fixed or explicitly marked as "works as intended" with a short comment. Until then they remain latent bugs.
Findings
State / threshold logic
wildfly-memory-usage:189-state += lib.base.get_worst(used_state, state)instead ofstate = .... Adding state integers corrupts the accumulation (e.g.STATE_WARN + STATE_WARN = 2reads asSTATE_CRIT,STATE_WARN + STATE_CRIT = 3is outside the valid range)wildfly-memory-usage:250- same patternstarface-java-memory-usage:197,246- same patternwildfly-non-xa-datasource-stats:224- callslib.base.get_state(active_pct, ...)when the threshold at that point is supposed to checkmax_used_pctwildfly-xa-datasource-stats:224- samenetwork-connections:178- function returnsSTATE_OKeven when earlier branches set a WARN/CRIT state, discarding the calculated valuemysql-sorts:168-stateis reassigned from a localsort_stateinstead of combined viaget_worst()with the accumulated valuematomo-reporting:202-statevariable is never updated before thelib.base.oao()call whenargs.METRICis provided, so warn/crit thresholds are never evaluatedstarface-channel-status:73,111---warning/--criticalare strings (type=strwithout conversion) butlib.base.get_state(used_percent, args.WARN, args.CRIT)later expects numeric valuesEarly exit / fall-through
tuned-profile:85-88- firstoao()call is followed by unconditional code that always calls a secondoao(), overwriting the first stateupdates:117-132- same shape (check if still present after the f-string syntax fix in commit f2cd0ff)crypto-policy:85-90- unreachable code afteroao()ntp-ntpd:136-143- multiple earlyoao()calls with a path that becomes dead code depending on earlier branchesxml:201-204-result = r[0].textis assigned inside atrythat exits on exception, but the value is never usedRegex / parsing
keycloak-version:172- regexr'n (.*)'contains a literalnprefix that does not match the actual/version.txtformatopenvpn-version:135- regexr'N (\d+\.\d+\.\d+)'contains a literalNprefixaxenita-stats:271- string slice[start:end]whereend = axenita_ver.find('-'); when the hyphen is missing,findreturns-1and the slice silently becomes empty instead of raising or falling backWrong identifier / variable
redis-status:382- perfdata uses the loop variablekeysfrom afor key, value in result.items():loop, so it only reports the last database's key countvalkey-status:377- same patternmysql-table-locks:145- denominator in the "locks waited" message usesTable_locks_immediatetwice instead ofTable_locks_immediate + Table_locks_waitedhin-status:149-cnt_incidentsis hardcoded to1whenever incidents exist, instead oflen(incidents)openstack-swift-stat:257- quota existence check looks upx-account-bytes-used(usage header) instead ofx-account-meta-quota-bytes(quota header)qts-temperatures:165-173- perfdata forsystempreceivesCPUTempWarnT/CPUTempErrTthresholds and perfdata forcputempreceivesSysTempWarnT/SysTempErrTthresholds - the two are swappedphp-fpm-ping:144-146- perfdata value is thestateinteger (0/1/2/3) instead of the ping response timephp-status:196- log line built with'{key} = {value}, '(plain string, not an f-string) so placeholders are emitted literallyntp-w32tm:173- appended state label hardcodesSTATE_WARNeven when the state may beSTATE_CRITArgparse / parameter wiring
sap-open-concur-com:111-choices=services.append('All')-list.append()returnsNone, sochoices=Nonedisables argparse validation entirelygrafana-version:119-122-get_installed_version()treatslib.shell.shell_exec()result as if the outer tuple unpacking already happened (misinterprets the(success, result)contract)icinga-topflap-services:279- SELECT queries a table name that does not match theCREATE TABLEearlier in the plugininfomaniak-events:210-ended_at - started_atevaluates even whenended_at is None, producing aTypeErrornextcloud-security-scan:197-abs((scan_date - today).days)always measures absolute distance, so the trigger fires for any scan date (past or future) regardless of directionfortios-network-io:392-lib.base.oao()is called and then followed by another unconditionaloao()that always overwrites the firstAcceptance criteria
Each item is either fixed with a short test or smoke check, or closed with a
# the framework actually handles this because ...comment plus the rationale. A# nosecequivalent for semantic issues would be a plain# noqa:with a sentence explaining why the static reader was wrong.Context
The lib-side findings (shell pipeline fd leak, human.py negative-number handling, cache.py timestamp off-by-one, url.py dead ternary) are tracked separately on Linuxfabrik/lib.