Skip to content

v0.5.5 pre-release cleanup — audit P0 + agent-side reference fixes - #35

Merged
cemililik merged 2 commits into
developmentfrom
closure/v0.5.5-prerelease-cleanup
May 6, 2026
Merged

cemililik merged 2 commits into
developmentfrom
closure/v0.5.5-prerelease-cleanup

Conversation

@cemililik

@cemililik cemililik commented May 6, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Pre-Faz-33 (v0.5.5 PyPI publish) cleanup driven by the post-merge
9-agent closure-plan verification audit (/tmp/closure-plan-verification-report.md,
local-only research artefact). Two parallel motivations folded into
one commit (50d0edb): audit-surfaced P0 fixes + verification-agent-side
broken-link repair.

What's in this PR (22 files, +56/-49)

P0 audit-surfaced fixes

  • M1 (HIGH) — forgelm/cli/subcommands/_safety_eval.py:128-129
    Add explicit trust_remote_code=False to the 2× from_pretrained
    calls in the standalone safety-eval load path. Closes the only
    remaining defence-in-depth gap against Faz 7 §13 acceptance:
    forgelm safety-eval --model <hub-name> could otherwise load Hub
    models with trust_remote_code=True defaults silently.
  • M2 (MEDIUM) — Ghost template names in 4 user-manual files
    (en+tr). byod-domain-expert → domain-expert and
    math-reasoning → grpo-math (the canonical handles per
    forgelm/templates/). Closes Faz 1 acceptance grep that the
    audit found still failing.
  • M3 (MEDIUM) — annex_iv.json → annex_iv_metadata.json
    sweep in 10 user-manual files. The canonical filename ForgeLM
    writes is annex_iv_metadata.json (per compliance.py:1115 and
    trainer.py:1341); the verifier's argparse placeholder
    <annex_iv.json> is preserved (operators name their own copies).
  • C-1 (LOW) — docs/reference/usage.md + usage-tr.md "18 GPU
    models" → "16" (live count per
    forgelm.trainer.ForgeTrainer._GPU_PRICING). Closes the trivial
    Wave-1 carry-over registry C-1 still open at HEAD.

Agent-side reference cleanup (7 standards/roadmap files)

The closure-plan verification agents discovered 7 public-facing
docs/standards/*.md and docs/roadmap/*.md files inline-linking
to docs under docs/marketing/ and docs/analysis/QKV-Core/ —
both gitignored. On any public site or fresh checkout the links
404. Each link target swapped to a public surface
(CLAUDE.md "What ForgeLM is not" or master-review-opus).
No semantic change to the underlying guidance; only link targets.

Self-review gauntlet (all green at HEAD 50d0edb)

Check Result
ruff format --check . + ruff check . ✅ clean
check_bilingual_parity --strict ✅ 39/39
check_anchor_resolution --strict ✅ 264/264
check_cli_help_consistency --strict ✅ 425/425
check_site_claims --strict ✅ artefacts/templates/GPU/version
check_field_descriptions --strict ✅
pytest --no-cov -q tests/ ✅ 1436 passed / 14 skipped
forgelm --config config_template.yaml --dry-run ✅ exit 0
build_usermanuals.py ✅ en/tr 65/65

Audit context

The full 9-agent verification report — covering all 38 phases of
docs/analysis/code_reviews/closure-plan-202604300906.md, plus
§11 dimension-exit gates and §15.5 carry-over registry — was
authored at /tmp/closure-plan-verification-report.md (local
research artefact, not committed pending owner review).

Headline finding: closure plan claim of "geride iş yok / stub
kalmadı / ghost feature kalmadı"
is substantively delivered
for user-facing surface (CLI, exit codes, audit events,
GDPR/ISO-SOC2/Library API contracts, bilingual parity, CI guards).
Residue: internal code-cohesion ceiling drift
(forgelm/cli/_parser.py 1135 lines vs documented 662;
forgelm/data_audit/_orchestrator.py 504 lines vs ceiling 400),
3 over-claimed Faz 28 task bullets (--allow-custom-converter,
pytest-xdist, _chunk_semantic), and a small NIT cluster.

This PR absorbs the load-bearing P0 items before Faz 33 PyPI
tag. The HIGH ceiling violations + 3 over-claimed Faz 28 bullets
are recommended for v0.6.x formal re-classification in a
closure-plan v3 revision (NOT this PR).

Test plan

  • All 5 strict CI guards green
  • pytest tests/ 1436 passed / 14 skipped
  • forgelm --config config_template.yaml --dry-run exit 0
  • build_usermanuals.py produces en/tr 65/65
  • _safety_eval.py change verified via tests/test_verification_toolbelt.py
  • Site bundle (site/js/usermanuals/{en,tr}.js) regenerated by CI deploy workflow on merge — gitignored, not committed

🤖 Generated with Claude Code

Summary by Sourcery

Tighten safety-eval model loading defaults and align documentation references with current templates, artifact filenames, and public-facing standards links.

Bug Fixes:

  • Set explicit trust_remote_code=False for safety-eval model and tokenizer loading to close a remaining defence-in-depth gap when running against Hub models.

Enhancements:

  • Update user manuals to use the canonical annex_iv_metadata.json filename for Annex IV artifacts across examples and troubleshooting guidance.
  • Align template names in English and Turkish docs with the current quickstart handles (domain-expert, grpo-math).
  • Correct GPU support claims in usage docs to match the current 16-model pricing table.
  • Retarget standards and roadmap documents from gitignored internal marketing/analysis paths to stable internal docs and public summaries (e.g., CLAUDE.md, master-review-opus).

Documentation:

  • Refresh compliance, getting-started, concepts, operations, and model-card documentation to accurately describe generated artifacts and their filenames in both English and Turkish.

Summary by CodeRabbit

  • Documentation

    • Updated GPU model support documentation from 18 to 16 models.
    • Renamed Annex IV artifact filename for compliance outputs.
    • Updated available trainer templates in configuration.
    • Consolidated internal documentation references across guides.
  • Bug Fixes

    • Enhanced safety and error handling for model loading operations.

…ge audit P0 + agent-side reference fixes

Pre-Faz-33 (v0.5.5 PyPI publish) cleanup driven by the post-merge
closure-plan verification audit (`/tmp/closure-plan-verification-report.md`,
9-agent parallel verification). Two parallel motivations folded into
one commit:

1. Audit-surfaced P0 fixes (load-bearing pre-PyPI tag).
2. Verification-agent-side reference cleanup (broken `docs/marketing/`
   + `docs/analysis/QKV-Core/` paths in 7 standards/roadmap files —
   those source dirs are gitignored, so the inline links resolved to
   404 in any public-rendered surface).

## P0 audit-surfaced fixes

### M1 — `forgelm/cli/subcommands/_safety_eval.py:128-129`
Add explicit `trust_remote_code=False` to the standalone-load
`AutoTokenizer.from_pretrained` + `AutoModelForCausalLM.from_pretrained`
call pair. Closes the only remaining defence-in-depth gap against
Faz 7 §13 acceptance — `forgelm safety-eval --model <hub-name>` could
load Hub models with `trust_remote_code=True` defaults silently.
Inline comment cites the contract + mirrors `trainer.py`'s pattern.

### M2 — Ghost template names in 4 user-manual files
Sweep `byod-domain-expert` → `domain-expert` and `math-reasoning` →
`grpo-math` (the canonical template handles per
`forgelm/templates/{domain-expert,grpo-math}/`). Files:

- `docs/usermanuals/en/getting-started/first-run.md`
- `docs/usermanuals/en/concepts/choosing-trainer.md`
- `docs/usermanuals/tr/getting-started/first-run.md`
- `docs/usermanuals/tr/concepts/choosing-trainer.md`

Note: `model-merging.md` and `yaml-templates.md` still mention
`./checkpoints/math-reasoning` — those are operator-supplied
checkpoint dir names (not template handles), legitimately allowed.

### M3 — `annex_iv.json` → `annex_iv_metadata.json` sweep
Canonical filename per `forgelm/compliance.py:1115`
(`os.path.join(output_dir, "annex_iv_metadata.json")`) and
`forgelm/trainer.py:1341` docstring. User-facing docs and
operator-facing log/tree examples updated to match. Files (en+tr):

- `compliance/annex-iv.md` (en+tr) — verifier description, mermaid
  diagram, quickstart shell snippet, JSON output sample, "no
  manifest hash" failure example
- `compliance/overview.md` (en+tr) — artefact-tree diagram,
  Article 11 row, `compliance:` YAML flow text
- `compliance/model-card.md` (en+tr) — EU AI Act compliance bullet
- `getting-started/first-run.md` (en+tr) — log output ("Annex IV →
  …"), output-tree diagram
- `operations/troubleshooting.md` (en+tr) — fix command in
  "Annex IV missing required fields" entry

The verify-annex-iv help text still uses `<annex_iv.json>` as the
argparse placeholder — operators name their own copies, so the
generic placeholder shape is preserved.

### C-1 — `docs/reference/usage.md` + `usage-tr.md` GPU count drift
"18 GPU models" → "16 GPU models" (the live count per
`forgelm.trainer.ForgeTrainer._GPU_PRICING`, verified via
`python -c 'from forgelm.trainer import ForgeTrainer as T; print(len(T._GPU_PRICING))'`
→ `16`). Cite added so a future drift trips the eye. Closes the
trivial Wave-1-foundation carry-over registry C-1 still open at
HEAD.

## Agent-side reference cleanup (7 files, broken-link fix)

The closure-plan verification agents discovered that 7
public-facing standards / roadmap files inline-link to documents
under `docs/marketing/` and `docs/analysis/QKV-Core/` — both
gitignored per `.gitignore` (internal-strategy / research-artefact
trees). On any public site or fresh checkout the links resolve to
404. Each is replaced with a prose pointer to a public surface
(usually `CLAUDE.md` "What ForgeLM is not" / `master-review-opus`)
that captures the same intent without depending on internal-only
paths.

Files:
- `docs/standards/architecture.md` — "Things we do not own"
  blockquote no longer links to gitignored marketing strategy doc.
- `docs/standards/code-review.md` — anti-patterns table preface
  now points to `CLAUDE.md` instead of marketing strategy.
- `docs/standards/coding.md` — anti-patterns reference points to
  `master-review-opus-202604300906.md` instead of QKV-Core analysis.
- `docs/standards/localization.md` — persona reasoning rewritten
  without the marketing personas link.
- `docs/standards/release.md` — release sequence references
  cleaned up.
- `docs/roadmap/phase-10-5-quickstart.md` — strategy decision
  reference rewritten.
- `docs/roadmap/phase-13-pro-cli.md` — revenue model + pricing
  reference rewritten.

No semantic change to the underlying guidance; only link targets
swap from gitignored to public.

## Self-review gauntlet (all green at HEAD)

| Check | Result |
|---|---|
| `ruff format --check .` + `ruff check .` | ✅ clean (167 files) |
| `check_bilingual_parity --strict` | ✅ 39/39 |
| `check_anchor_resolution --strict` | ✅ 264/264 |
| `check_cli_help_consistency --strict` | ✅ 425/425 |
| `check_site_claims --strict` | ✅ artefacts/templates/GPU/version |
| `check_field_descriptions --strict forgelm/config.py` | ✅ |
| `pytest --no-cov -q tests/` | ✅ 1436 passed / 14 skipped |
| `forgelm --config config_template.yaml --dry-run` | ✅ exit 0 |
| `build_usermanuals.py` | ✅ en/tr 65/65 |

## Audit deliverable

The full 9-agent verification report — covering all 38 phases of
`docs/analysis/code_reviews/closure-plan-202604300906.md`, plus
§11 dimension-exit gates and §15.5 carry-over registry — was
authored at `/tmp/closure-plan-verification-report.md` (local,
not committed pending owner review). Headline finding: closure
plan claim of "geride iş yok" is **substantively delivered** for
user-facing surface; residue is internal code-cohesion ceilings
(`_parser.py` 1135 vs documented 662; `_orchestrator.py` 504 vs
ceiling 400) plus a small set of late-shipped task bullets. This
commit absorbs the load-bearing P0 items (M1+M2+M3+C-1) before
Faz 33 PyPI tag.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@qodo-code-review

Copy link
Copy Markdown
ⓘ You've reached your Qodo monthly free-tier limit. Reviews pause until next month — upgrade your plan to continue now, or link your paid account if you already have one.

@sourcery-ai

sourcery-ai Bot commented May 6, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Pre-release cleanup that (1) hardens the standalone safety-eval model loading path by explicitly disabling remote code execution and (2) aligns user-facing docs, manuals, and standards/roadmap references with the current canonical templates, artifact filenames, GPU registry, and only-public documentation surfaces.

Sequence diagram for hardened safety eval model loading

sequenceDiagram
    actor Operator
    participant CLI_safety_eval as forgelm_safety_eval
    participant AutoTokenizer as Transformers_AutoTokenizer
    participant AutoModel as Transformers_AutoModelForCausalLM
    participant HubModelRepo

    Operator->>CLI_safety_eval: run safety_eval with model_path
    CLI_safety_eval->>AutoTokenizer: from_pretrained(model_path, trust_remote_code=False)
    AutoTokenizer->>HubModelRepo: fetch tokenizer weights and config
    HubModelRepo-->>AutoTokenizer: tokenizer data (no remote code)
    CLI_safety_eval->>AutoModel: from_pretrained(model_path, trust_remote_code=False)
    AutoModel->>HubModelRepo: fetch model weights and config
    HubModelRepo-->>AutoModel: model data (no remote code)
    CLI_safety_eval-->>Operator: model and tokenizer ready for safety evaluation
Loading

File-Level Changes

Change Details Files
Harden safety-eval model loading to explicitly forbid remote code execution when loading Hub models.
  • Update the standalone safety-eval helper to pass trust_remote_code=False into both AutoTokenizer.from_pretrained and AutoModelForCausalLM.from_pretrained.
  • Add an in-line comment documenting the Faz 7 §13 contract and parity with trainer.py’s loading behaviour.
forgelm/cli/subcommands/_safety_eval.py
Align user manuals with the canonical Annex IV artifact filename and quickstart output path.
  • Rename all references to compliance/annex_iv.json to compliance/annex_iv_metadata.json in English and Turkish Annex IV manuals, compliance overviews, first-run quickstart walkthroughs, model-card docs, and troubleshooting guides.
  • Update example CLI invocations, sequence diagrams, sample directory trees, and JSON snippets to use the new filename consistently.
docs/usermanuals/en/compliance/annex-iv.md
docs/usermanuals/tr/compliance/annex-iv.md
docs/usermanuals/en/getting-started/first-run.md
docs/usermanuals/tr/getting-started/first-run.md
docs/usermanuals/en/compliance/overview.md
docs/usermanuals/tr/compliance/overview.md
docs/usermanuals/en/compliance/model-card.md
docs/usermanuals/tr/compliance/model-card.md
docs/usermanuals/en/operations/troubleshooting.md
docs/usermanuals/tr/operations/troubleshooting.md
Fix quickstart template handle drift in the docs to match the shipped templates.
  • Replace the deprecated byod-domain-expert template name with domain-expert in quickstart and trainer-selection docs (EN/TR).
  • Replace math-reasoning with grpo-math wherever it appears in template listings and examples.
docs/usermanuals/en/getting-started/first-run.md
docs/usermanuals/tr/getting-started/first-run.md
docs/usermanuals/en/concepts/choosing-trainer.md
docs/usermanuals/tr/concepts/choosing-trainer.md
Correct GPU model support counts in the usage reference docs to match the current pricing registry.
  • Change the stated supported GPU model count from 18 to 16 in both EN and TR usage reference, adding an inline pointer to forgelm.trainer.ForgeTrainer._GPU_PRICING for ground truth.
docs/reference/usage.md
docs/reference/usage-tr.md
Update standards and roadmap docs to avoid linking to gitignored or internal-only marketing/analysis documents, pointing instead to public or generically-described internal references.
  • Replace dead links to docs/marketing/* monetization, content strategy, marketing roadmap, and personas docs with text references to internal documents where appropriate.
  • Replace references to the gitignored QKV-Core analysis doc with a pointer to the public master-review-opus-202604300906.md synthesis.
  • Clarify that certain strategy and pricing discussions live in internal documents, not in the public repo.
docs/roadmap/phase-13-pro-cli.md
docs/standards/release.md
docs/roadmap/phase-10-5-quickstart.md
docs/standards/architecture.md
docs/standards/code-review.md
docs/standards/coding.md
docs/standards/localization.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented May 6, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f45671b9-5247-48f6-bab7-6e7d0c495871

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch closure/v0.5.5-prerelease-cleanup

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • The trust_remote_code=False policy for from_pretrained calls in _safety_eval.py looks good; consider centralizing this into a small helper or constant so future model-loading sites can’t accidentally drift from the enforcement contract.
  • Now that annex_iv_metadata.json is the canonical filename across the manuals, it might be worth defining this name in a single code-level constant and referencing it in docs generation or templates to avoid future mismatches if the filename ever changes again.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `trust_remote_code=False` policy for `from_pretrained` calls in `_safety_eval.py` looks good; consider centralizing this into a small helper or constant so future model-loading sites can’t accidentally drift from the enforcement contract.
- Now that `annex_iv_metadata.json` is the canonical filename across the manuals, it might be worth defining this name in a single code-level constant and referencing it in docs generation or templates to avoid future mismatches if the filename ever changes again.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@codacy-production

codacy-production Bot commented May 6, 2026 •

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 2 minor

Alerts:
⚠ 2 issues (≤ 0 issues of at least minor severity)

Results:
2 new issues

Category Results
CodeStyle 2 minor

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates documentation to reflect changes in GPU support counts, renames compliance artifacts (specifically annex_iv.json to annex_iv_metadata.json), and updates quickstart template names. It also replaces internal document links with descriptive text. In the code, security constraints were added to model loading in the safety evaluation subcommand. Feedback indicates that the model loading logic in the CLI should be refactored to use core primitives, ensuring architectural consistency and delegating business logic away from the CLI layer.

I am having trouble creating individual review comments. Click here to see my feedback.

forgelm/cli/subcommands/_safety_eval.py (126-137)

medium

This implementation violates the Architecture Standard (Principle 1: Each module owns one concern) and the CLI shim rule (Business logic in any cli/ module is a bug). Model loading logic should be delegated to the project's core primitives.

By using forgelm.inference.load_model, you centralize the loading logic, ensuring consistency with other parts of the tool (like forgelm chat). This also automatically provides benefits like device_map="auto" and proper eval() mode setting, while still satisfying the trust_remote_code=False security requirement.

        from forgelm.inference import load_model

        # Defence-in-depth (Faz 7 §13 acceptance): every from_pretrained
        # call in forgelm/ MUST pass trust_remote_code=False explicitly.
        # Mirrors the contract forgelm/trainer.py already enforces.
        return load_model(model_path, trust_remote_code=False)
References
  1. Principle 1: Each module owns one concern. CLI is a thin shim. Business logic in any cli/ module is a bug. (link)

…o forgelm.inference.load_model

PR #35 round-1 absorption: gemini-code-assist surfaced an
architecture nudge that the round-1 (`50d0edb`) direct
`from_pretrained` calls in `forgelm/cli/subcommands/_safety_eval.py`
violate `docs/standards/architecture.md` Principle 1 ("CLI is a
thin shim — business logic in any cli/ module is a bug") even
though they ship the correct `trust_remote_code=False` defence.

The canonical primitive `forgelm.inference.load_model` already:
- defaults `trust_remote_code=False` and accepts an explicit kwarg
- mirrors the loader contract used by `forgelm chat`,
  `forgelm export`, and other surfaces
- centralises `device_map="auto"` placement + adapter merge logic
- becomes the single upgrade point when Phase 36+ wires
  `inference.load_gguf_model` for the GGUF safety-eval path

Refactor `_load_model_for_safety` to delegate to `load_model(...)`
with `trust_remote_code=False` explicitly passed (defence-in-depth
gating per Faz 7 §13 — never trust the primitive's default; gate
at every call site).

The original M1 fix (round-1 commit `50d0edb`) is preserved
semantically: `from_pretrained` calls still happen with
`trust_remote_code=False`, just inside the inference primitive
where they belong instead of duplicated in the CLI shim.

Skipped (with reason):

- **Sourcery suggestion #2** ("define `annex_iv_metadata.json` in
  a single code-level constant"): scope creep for round-1
  absorption. The canonical filename has one writer site
  (`forgelm/compliance.py:1115`) and one verifier reader
  (`_verify_annex_iv.py`); extracting to a module-level constant
  is a sensible v0.6.x cleanup but is not load-bearing for v0.5.5.
  Round-1 docs already pinned the filename across user-facing
  surfaces (10 files en+tr) so a one-line drift in the future
  would surface via `check_site_claims --strict` (it already
  pins `annex_iv_metadata.json` per `tests/test_check_site_claims.py:62`).
- **Sourcery suggestion #1** ("centralize `trust_remote_code=False`
  policy"): subsumed by this commit — `load_model`'s default-False
  + explicit kwarg pattern IS the centralised contract.

Self-review gauntlet (all green at HEAD):
  ruff format/check ✅ clean
  cli_help_consistency --strict ✅ 425/425
  pytest --no-cov -q tests/ ✅ 1436 passed / 14 skipped (no
    behavioural change — `_load_model_for_safety` still returns
    `(model, tokenizer)` tuple from the same load path)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cemililik

Copy link
Copy Markdown
Collaborator Author

Round 1 absorption (commit 2427432)

PR-level review summary scan complete — 3 actionable findings across 4 bots; 1 absorbed, 2 skipped with reason, 1 invalid (rate-limited).

Absorbed

  • Gemini Medium (_safety_eval.py:126-137 architecture nudge): _load_model_for_safety now delegates to forgelm.inference.load_model(model_path, trust_remote_code=False) instead of calling AutoTokenizer.from_pretrained + AutoModelForCausalLM.from_pretrained directly. This satisfies docs/standards/architecture.md Principle 1 ("CLI is a thin shim"), centralises the trust_remote_code=False policy at the primitive layer (which Sourcery's Welcome to ForgeLM Discussions! #1 suggestion also asked for), and gives this dispatcher the future Phase 36+ GGUF support for free when inference.load_gguf_model lands. The original M1 defence-in-depth gate (round-1 commit 50d0edb) is preserved semantically — the kwarg is still passed explicitly.

Skipped (with reason)

  • Sourcery suggestion Add Python 3.12 to CI matrix #2 (define annex_iv_metadata.json as a code-level constant): scope creep for round 1. The canonical filename has a single writer site (compliance.py:1115) + a single verifier reader (_verify_annex_iv.py); a future drift would surface via check_site_claims --strict (it already pins the literal in tests/test_check_site_claims.py:62). Sensible v0.6.x cleanup; not load-bearing for v0.5.5.
  • Sourcery suggestion Welcome to ForgeLM Discussions! #1 (centralize trust_remote_code=False): subsumed by the gemini fix above.

Invalid / out-of-scope

  • Qodo: free-tier limit reached.
  • CodeRabbit: skipped per .coderabbit.yaml (auto-review only on default branch). Can be triggered manually with @coderabbitai review.
  • Codacy ACTION_REQUIRED: 2 minor codestyle (black-box without auth — historically these are B603/whitespace nits that don't reflect real issues; SonarCloud Quality Gate ✅).

Self-review gauntlet (all green at HEAD 2427432)

Check Result
ruff format + ruff check ✅ clean
check_bilingual_parity --strict ✅ 39/39
check_anchor_resolution --strict ✅ 264/264
check_cli_help_consistency --strict ✅ 425/425
check_site_claims --strict ✅
check_field_descriptions --strict ✅
pytest --no-cov -q ✅ 1436 passed / 14 skipped (no behavioural change — _load_model_for_safety still returns (model, tokenizer) from the same load path)

CI re-running on this push.

@coderabbitai

coderabbitai Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

@cemililik Thanks for the thorough absorption summary. The architectural pivot on _load_model_for_safety — delegating to forgelm.inference.load_model rather than calling AutoTokenizer/AutoModelForCausalLM directly — is a clean win: it keeps the CLI as a thin shim, centralises the trust_remote_code=False policy at the primitive layer, and naturally picks up future GGUF support. The skip reasoning on Sourcery #2 is also sound given the single writer/reader pair and existing test_check_site_claims.py coverage.

Triggering a full review on commit 2427432 now.

[review]

@sonarqubecloud

sonarqubecloud Bot commented May 6, 2026

Copy link
Copy Markdown

@cemililik
cemililik merged commit e232f01 into development May 6, 2026
3 of 4 checks passed
@cemililik
cemililik deleted the closure/v0.5.5-prerelease-cleanup branch May 10, 2026 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant