Skip to content

[Wave 4] Low/info — Module sweep: Dev tooling: code, release & supply-chain guards and generators (part 2/3) #668

Open

Description

@cemililik

Wave 4 · 20 finding(s) in 20 fix package(s). Fix these whenever a pull request touches this module ("clean the module you touch").

Findings

  • CR-A17b-024 (code, Low) — The bandit gate fails only on HIGH, so unsafe deserialisation and exec (yaml.load B506, pickle B301, torch.load B614, eval B307, exec B102) pass CI with exit 0, behind 11 standing B615 warnings
    severity Low · reachability default · intent intended-but-harmful · confidence likely · independently confirmed · reproduced end to end
    Where. tools/check_bandit.py:120-158, pyproject.toml:318-327, .github/workflows/ci.yml:511-524, docs/reference/supply_chain_security.md:167-177
    Recommended fix. Fail on a fixed set of MEDIUM rule IDs (B301,B506,B614,B307,B102,B113,B306 at least), or on MEDIUM with HIGH confidence. Triage the 11 B615 sites: mark the pinned ones with a nosec B615 that gives a rationale, and either pin or record the rest, so the warning channel starts at zero. Correct the B101 comment in pyproject.toml.

  • CR-A17b-025 (code, Low) — generate_wizard_defaults.py has no argument parsing, so --check, --help and any unknown flag silently rewrite the shipped artefacts and exit 0
    severity Low · reachability default · intent intended-but-harmful · confidence likely · single reviewer · reproduced end to end
    Failure scenario. An operator or CI author runs 'python tools/generate_wizard_defaults.py --check' expecting a read-only verdict. A deliberately drifted _defaults.json is silently rewritten to the canonical content, exit 0, and the drift evidence is lost from the working tree. Reproduced: with the first header line changed to 'STALE-DRIFT', '--check' left no STALE text and exited 0. '--help' and '--bogus' do the same.
    Where. tools/generate_wizard_defaults.py:238, tools/generate_wizard_defaults.py:242, tools/check_wizard_defaults_sync.py:80
    Recommended fix. Add argparse with -h and a --check mode that compares and exits 1 on drift without writing. Reject unknown flags with exit 2. Write each artefact through a temp file plus os.replace.

  • CR-A17b-026 (code, Low) — check_no_unguarded_sys_modules_pop silently skips unreadable or undecodable files yet counts them as scanned, so a real violation in such a file exits 0
    severity Low · reachability default · intent contract-violation · confidence confirmed · single reviewer · reproduced end to end
    Failure scenario. tests/zz.py contains sys.modules.pop('torch') plus a non-UTF-8 byte, or is chmod 000. The guard prints 'OK: 239 Python file(s)...' and exits 0. The identical readable file gives FAIL and exit 1. Reproduced both ways.
    Where. tools/check_no_unguarded_sys_modules_pop.py:119, tools/check_no_unguarded_sys_modules_pop.py:161, tools/check_http_discipline.py:113, tools/check_http_discipline.py:140
    Recommended fix. Treat a read or decode failure as a finding (print the path and exit 1). Report the skipped count separately from the scanned count. Apply the same change to check_http_discipline.

  • CR-A17b-027 (code, Low) — Unhandled-exception and argparse exit codes of the A17b guards are undocumented and inconsistent with the stated 0/1 'tools/ contract'; three guards also silently accept unknown flags
    severity Low · reachability default · intent intended-but-harmful · confidence confirmed · single reviewer · reproduced end to end
    Failure scenario. CI templating passes a typo'd flag such as '--stict' to check_http_discipline.py: it is ignored and the guard exits 0. A corrupt module under forgelm/ makes check_no_mutation_artifacts exit 1 with a UnicodeDecodeError traceback that reads as a code finding.
    Where. tools/check_no_mutation_artifacts.py:68, tools/check_strict_json_writers.py:94, tools/check_wizard_defaults_sync.py:80, tools/check_no_unguarded_sys_modules_pop.py:155
    Recommended fix. Give all guards the same argparse skeleton (-h, --strict, --quiet). Catch OSError and UnicodeDecodeError per file and report them as findings with a path. Document exit 2 (usage) in the docstrings, or add a tools/ exit-code section to the error-handling standard.

  • CR-A17b-028 (code, Low) — Wizard-generated YAML is never validated against ForgeConfig in any test
    severity Low · reachability default · intent intended-but-harmful · confidence likely · independently confirmed · reproduced end to end · already tracked: KNOWN-OPEN CLI-09/CLI-12/CLI-13 (inferred) — docs/roadmap/phase-16-trust-surface-hardening.md:510-513
    Where. tools/check_wizard_defaults_sync.py, tests/test_wizard_phase22.py, site/js/wizard.js:569-888, site/js/wizard.js:829
    Recommended fix. Run a node-generated corpus of states through ForgeConfig in CI.

  • CR-A17b-029 (code, Low) — Release-record guard does not gate the tag-triggered publish
    severity Low · reachability default · intent intended-but-harmful · confidence likely · single reviewer · not reproduced (code trace) · already tracked: KNOWN-OPEN OPS-02..19 (S12) — docs/roadmap/phase-16-trust-surface-hardening.md:653-656,662-663 (C-13)
    Failure scenario. The maintainer bumps pyproject to X.Y.Z and tags without adding the CHANGELOG section or record; the guard (had it run) is green, and PyPI ships with a stale roadmap.
    Where. .github/workflows/ci.yml:3-7, .github/workflows/ci.yml:423, .github/workflows/publish.yml:9-11, tools/check_release_record_sync.py:204-208
    Recommended fix. Run check_release_record_sync.py --strict in publish.yml's build job, and cross-check that the tag equals the pyproject version and the newest CHANGELOG release.

  • CR-A17b-030 (code, Low) — Design doc pip-audit policy says 'medium / low warn'; code keeps LOW silent and fails nearly every real finding as UNKNOWN
    severity Low · reachability default · intent contract-violation · confidence likely · single reviewer · reproduced end to end
    Failure scenario. A reader expects medium or low CVEs to be warnings only, but the nightly fails on any real advisory. That is safe, but the doc is wrong.
    Where. docs/design/iso27001_soc2_alignment.md:461-463, docs/design/iso27001_soc2_alignment.md:856-858, tools/check_pip_audit.py:114-120, tools/check_pip_audit.py:558-593
    Recommended fix. Update design doc 7.1 and Q9 to match supply_chain_security.md (UNKNOWN fails closed, LOW silent).

  • CR-A17b-031 (code, Low) — Release-record guard skips the date cross-check when the releases.md record omits its date
    severity Low · reachability default · intent intended-but-harmful · confidence likely · single reviewer · reproduced end to end
    Failure scenario. CHANGELOG has '## [0.12.0] — 2026-11-01' and releases.md has '## v0.12.0 — "New"' with a body but no date. The guard prints OK and exits 0, and the release record never states a ship date.
    Where. tools/check_release_record_sync.py:915-918, tools/check_release_record_sync.py:247
    Recommended fix. Require a date on the releases.md record whenever the CHANGELOG heading has one, and freeze the existing dateless headings in an explicit exemption set like _LEGACY_DATE_MISMATCHES.

  • CR-A17b-032 (code, Low) — All nine guard defects are untested; no current test turns red on any of them
    severity Low · reachability default · intent contract-violation · confidence confirmed · independently confirmed · reproduced end to end
    Where. tests/test_check_http_discipline.py:44, tests/test_check_http_discipline.py:58, tests/test_check_http_discipline.py:60, tests/test_check_no_unguarded_sys_modules_pop.py:108
    Recommended fix. For each case add a regression test that asserts the correct behaviour (class ii) alongside the fix. Mark it xfail(strict=True) until the fix lands, so a green suite no longer implies the defect is absent. Also drop or relocate the three adjacent pins that would otherwise fight the fix: the advisory-only stale-verified_at test at test_check_pip_audit.py:828, the 'any extra file fails' semantics a…

  • CR-A17b-033 (code, Low) — Published xxh3-vs-BLAKE2b figures (~1.3x raw, ~1.05x end-to-end) are not reproduced: raw is 2.6-2.8x (xxhash 3.8.1) to 3.9-4.3x (xxhash 4.0.1), and the end-to-end benchmark cannot show a difference e…
    severity Low · reachability documented-opt-in · intent contract-violation · confidence likely · independently confirmed · reproduced end to end
    Where. tools/bench_simhash.py:172, tools/bench_simhash.py:143, forgelm/data_audit/_optional.py:13, forgelm/data_audit/_simhash.py:78
    Recommended fix. Fix the arm to toggle _optional._HAS_XXHASH and clear _simhash._token_digest. Add a high-cardinality corpus (more distinct tokens than the 10k lru_cache) and report the numpy and pure-Python paths separately. Restate the published figures with their workload, platform and xxhash version (raw about 2.7x on xxhash 3.8, about 4x on 4.0; end-to-end about 1.3x cache-cold with numpy, about 1.05x withou…

  • CR-A17b-034 (code, Low) — sys.modules-pop guard matches only three literal spellings with an exact guarded name, missing submodule keys, dynamic keys, other mutators and aliases
    severity Low · reachability default · intent intended-but-harmful · confidence likely · single reviewer · reproduced end to end
    Failure scenario. A test author writes sys.modules.pop("torch._C", None) or loops over torch.* submodules to force a fresh import. The guard reports OK and CI goes green. In the full pytest session the next torch._C import segfaults the worker, or later tests see split class identities. These are the spurious suite-wide failures the guard was added to prevent.
    Where. tools/check_no_unguarded_sys_modules_pop.py:54, tools/check_no_unguarded_sys_modules_pop.py:62 (confirmed), tools/check_no_unguarded_sys_modules_pop.py:64 (confirmed), tools/check_no_unguarded_sys_modules_pop.py:70 (confirmed)
    Recommended fix. Match (torch|numpy|...)(\.[A-Za-z0-9_.]*)? before the closing quote in all three patterns, and pin it with a test such as test_dotted_submodule_flagged for 'torch._C' and 'transformers.models.llama'. Alternatively, if submodules are meant to be out of scope, say so in the docstring and in CLAUDE.md/AGENTS.md.

  • CR-A17b-035 (code, Info) — Deprecation-target claim recognizer matches unrelated version tokens and misses some removal spellings
    severity Info · reachability default · intent intended-but-harmful · confidence confirmed · single reviewer · reproduced end to end
    Failure scenario. A docs edit adds 'Deprecated since v0.5.0; use_dora will be removed in v1.0.0.' and CI fails on v0.5.0. Or, after DEPRECATION_REMOVAL_VERSION moves to v2.0.0, a stray 'removed in v1' sentence stays.
    Where. tools/check_deprecation_targets.py:180-183, tools/check_deprecation_targets.py:312-356, tools/check_deprecation_targets.py:343
    Recommended fix. Report only the version token nearest the removal verb on its line (or the one following 'in'/''da'), and widen _VERSION_RE to accept a bare major after 'v' and the a/b/dev/post pre-release segments.

  • CR-A17b-036 (code, Info) — Skill-mirror guard compares untracked, gitignored files, so local --strict runs fail where CI passes
    severity Info · reachability default · intent intended-but-harmful · confidence likely · single reviewer · reproduced end to end
    Failure scenario. A macOS developer opens .claude/skills/add-test in Finder, and the next gauntlet run fails with 'add-test: .DS_Store exists under .claude/skills/ only'.
    Where. tools/check_skill_mirror_parity.py:293, tools/check_skill_mirror_parity.py:277
    Recommended fix. Ignore well-known OS junk (.DS_Store, Thumbs.db, *~), or list files with git ls-files when inside a git checkout.

  • CR-A17b-037 (code, Info) — generate_wizard_defaults silently drops flagged fields and renders invalid JSON for an empty defaults dict
    severity Info · reachability undocumented · intent intended-but-harmful · confidence confirmed · independently confirmed · reproduced end to end
    Failure scenario. If a future contributor flags x: List[str] = Field(default_factory=..., json_schema_extra={'wizard': True}), both the generator and the sync guard stay green while the wizard never receives the value. With no flags at all, the generator writes an unparseable _defaults.json, which _state._load_defaults would log as corrupt before falling back.
    Where. tools/generate_wizard_defaults.py:111-116 (confirmed), tools/generate_wizard_defaults.py:147, tools/generate_wizard_defaults.py:151-159 (confirmed), tools/generate_wizard_defaults.py:205-210 (confirmed)
    Recommended fix. Raise on a flagged field with default_factory (or call the factory). Key sections by dotted path, or raise on cross-class collisions. Skip list/dict containers. Guard the empty-dict render.

  • CR-A17b-038 (code, Info) — Test name and docstring claim budgets equal measured LOC, but the assertion is only an upper bound; check_module_size _parser.py carries 2 LOC of slack
    severity Info · reachability default · intent contract-violation · confidence likely · single reviewer · reproduced end to end · already tracked: CLAIMED-FIXED-STILL-PRESENT OPS-10 — docs/roadmap/phase-16-trust-surface-hardening.md:266-269 (S1 done)
    Failure scenario. A budget is raised a little above measured size alongside a feature; the test that claims to forbid padding stays green.
    Where. tests/test_check_module_size.py:201, tools/check_module_size.py:409
    Recommended fix. Assert measured == budget (or a documented tolerance) for entries without a raise note, or reword the test and docstring.

  • CR-A17b-039 (code, Info) — Non-object report roots crash the pip-audit/bandit helpers with tracebacks (or exit 1 silently on null) instead of a controlled ::error::
    severity Info · reachability undocumented · intent intended-but-harmful · confidence confirmed · single reviewer · reproduced end to end
    Where. tools/check_pip_audit.py:170-181, tools/check_pip_audit.py:473-480, tools/check_bandit.py:98-119, tools/check_pip_audit.py:172
    Recommended fix. Add explicit shape validation with ::error:: messages and tests. Bucket bandit's unrecognised severities as a failing UNKNOWN, as the pip-audit gate does.

  • CR-A17b-040 (code, Info) — check_wizard_defaults_sync imports tools.generate_wizard_defaults as a namespace package (no tools/init.py), which a regular 'tools' package elsewhere on sys.path shadows
    severity Info · reachability undocumented · intent intended-and-acceptable · confidence likely · single reviewer · reproduced (plumbing only)
    Failure scenario. A venv contains site-packages/tools/init.py. 'python tools/check_wizard_defaults_sync.py' fails with ModuleNotFoundError: No module named 'tools.generate_wizard_defaults' (traceback, exit 1). Reproduced with a stray regular package appended to sys.path.
    Where. tools/check_wizard_defaults_sync.py:29, tools/check_wizard_defaults_sync.py:32, tools/generate_wizard_defaults.py:44
    Recommended fix. Load the sibling via importlib.util.spec_from_file_location, or place the generator in the same directory import (sys.path[0] is already tools/ when run as a script, so 'import generate_wizard_defaults' works).

  • CR-A17b-041 (code, Info) — UNKNOWN no-fix error message points standalone deployers at the project's own tools/pip_audit_ignores.yaml
    severity Info · reachability default · intent contract-violation · confidence likely · single reviewer · reproduced end to end
    Failure scenario. A deployer follows the error text and reuses ForgeLM's internal torch suppressions instead of their own risk log.
    Where. tools/check_pip_audit.py:583-592
    Recommended fix. Word the message as 'an ignore file passed via --ignores (the project nightly uses tools/pip_audit_ignores.yaml)'.

  • CR-A17b-042 (code, Info) — Module-size counter drops '#'-led lines inside strings and docstrings, so compliance.py and ingestion.py are over budget under the documented metric while the guard exits 0
    severity Info · reachability default · intent intended-and-acceptable · confidence likely · independently confirmed · reproduced end to end · already tracked: CLAIMED-FIXED-STILL-PRESENT OPS-10 — docs/roadmap/phase-16-trust-surface-hardening.md:144-150 (S1 done)
    Failure scenario. A contributor adds 50 Markdown heading/rule lines (each starting with '#') to compliance.py's deployer-instructions template. The file grows 50 lines under the documented 'docstrings and strings count' metric, but the guard counts 0 more, and --strict stays green at budget 2473. Going the other way, someone 'fixes' the counter to match its docstring and CI fails at HEAD on two deferred files with no code change.
    Where. tools/check_module_size.py:494-510, tools/check_module_size.py:507, tools/check_module_size.py:497, tools/check_module_size.py:130-142
    Recommended fix. Pick one. (a) Make the counter match its docstring: use tokenize to classify comment-only lines, and fall back to the line rule on tokenize errors. Then re-baseline compliance.py (2480) and ingestion.py (2112) in one reviewed change that states the counter fix as the reason, and add a regression test with a '#'-led line inside a docstring and inside a plain string. (b) Keep the cheap rule but doc…

  • CR-A17b-043 (code, Info) — tools/check_*.py docstrings name the public surface as 0/1/2/3/4 (15 files) or 0/1/2/3/4/5 (4 files); merges into M-A05-017 as maintainer-prose sites
    severity Info · reachability unreachable · intent contract-violation · confidence likely · single reviewer · not reproduced (code trace) · already tracked: KNOWN-OPEN C31-EXIT-CODE-PROSE — docs/roadmap/phase-16-trust-surface-hardening.md:782-785
    Failure scenario. A maintainer reading a guard docstring takes 0-4 as the product contract. This has no runtime effect.
    Where. tools/check_bandit.py:15, tools/check_http_discipline.py:40, tools/check_source_path_refs.py:156, tools/check_deprecation_targets.py:85
    Recommended fix. Fold into the M-A05-017 sweep. Prefer the non-enumerating wording of check_usermanual_self_contained.py:28 so the docstrings cannot rot again.

Done when

  • Every finding above is fixed or closed with a reason (tick it here).
  • Code fixes carry a test; doc fixes update the Turkish mirror in the same PR.

Found by the October 2026 ForgeLM code and documentation review against commit cab2947. Code links point at that commit; line numbers may have moved since. Finding IDs (CR-…, DOC-…, TECH-…) are stable references for this backlog.

Activity

  1. added
    bug
    area: dev-tooling
    backlog: known
    security
    severity: low
    source: review-2026-10
    wave: 4
    on Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: dev-toolingbacklog: knownbugsecurityseverity: lowsource: review-2026-10wave: 4

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions