Skip to content

Harden MollyGraph smoke and relation cleanup#1

Merged
brianmeyer merged 2 commits into
mainfrom
codex/mollygraph-shipping-cleanup
May 17, 2026
Merged

Harden MollyGraph smoke and relation cleanup#1
brianmeyer merged 2 commits into
mainfrom
codex/mollygraph-shipping-cleanup

Conversation

@brianmeyer
Copy link
Copy Markdown
Owner

Summary

  • add fixture/no-download production smoke mode plus explicit real-model/download controls
  • guard GLiNER2 loads with cache/download and memory checks, and keep heavy enrichment out of the default path
  • suppress unsupported REPORTS_TO fan-out for simple employment statements with regression coverage
  • update runtime docs/env examples for the memory-aware model flow

Verification

  • service/.venv/bin/python -m pytest -q
  • service/.venv/bin/python scripts/production_smoke.py --json
  • git diff --check

Linear

Closes REC-183, REC-184, REC-185, REC-190, REC-191, REC-210.
REC-201 remains backlog for separate training-state hardening.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ff5ade1bf6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +130 to +132
cached = try_to_load_from_cache(model_ref, "model.safetensors")
if isinstance(cached, str) and Path(cached).exists():
return
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Enforce no-download mode for full model snapshot

When MOLLYGRAPH_ALLOW_MODEL_DOWNLOADS=0, this check treats the model as "offline-ready" if only model.safetensors is cached, but GLiNER2.from_pretrained(model_ref) is still called without any offline/local-only guard. On a clean machine with partial cache, GLiNER2 can still need other Hub files (e.g. config/tokenizer), so the runtime either performs network downloads despite the flag or fails unexpectedly in offline environments.

Useful? React with 👍 / 👎.


if real_models:
if not allow_model_downloads:
env.setdefault("MOLLYGRAPH_ALLOW_MODEL_DOWNLOADS", "0")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Make --real-models default truly disable downloads

Using env.setdefault("MOLLYGRAPH_ALLOW_MODEL_DOWNLOADS", "0") means --real-models does not actually enforce the default no-download behavior when the parent shell already exports MOLLYGRAPH_ALLOW_MODEL_DOWNLOADS=1. In that case, downloads stay enabled even without --allow-model-downloads, so the CLI flag semantics are inconsistent and can bypass the intended safety default.

Useful? React with 👍 / 👎.

@brianmeyer brianmeyer merged commit 5cd39ba into main May 17, 2026
4 checks passed
@brianmeyer brianmeyer deleted the codex/mollygraph-shipping-cleanup branch May 17, 2026 15:58
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