Repository navigation
OptimizationNLPModels: make imports explicit - #1409
ChrisRackauckas merged 2 commits into
Conversation
Replace blanket `using` with explicit module and name imports so `no_implicit_imports` can run without an `ei_broken` marker. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Cursor Agent <noreply@cursor.com> Agent-Harness: Cursor Agent CLI 2026.10.01-14929f9 Agent-Model: auto Agent-Session: local session, transcript at /home/crackauc/sandbox/goals/qa-hygiene/jobs/nlpm-imports/log.txt on amdci2
Those names were only local closures inside OptimizationFunction; ExplicitImports does not need them. Also trim the misleading import comments. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Cursor Agent <noreply@cursor.com> Agent-Harness: Cursor Agent CLI 2026.10.01-14929f9 Agent-Model: auto Agent-Session: local session, transcript at /home/crackauc/sandbox/goals/qa-hygiene/jobs/nlpm-imports/log.txt on amdci2
Independent review (Devin CLI 3000.11.3, model fusion-claude-opus-5-5-high-sidekick-swe-2-medium): MERGE, risk low. Full reviewVERDICT: MERGE PR: #1409 — "OptimizationNLPModels: make imports explicit" (head 6b01f1e). It changes 2 files, +8/−12. The blanket Blocking findingsNone. The test change is a removal of a Non-blocking findings
What I ranAll runs used
What I did not verify
Links
🤖 Posted by an AI agent — harness: Devin CLI 3000.11.3 (review), Claude Code 2.1.285 (posting) · model: fusion-claude-opus-5-5-high-sidekick-swe-2-medium |
OptimizationNLPModels now imports the NLPModels, ADTypes, OptimizationBase, SciMLBase, and SparseArrays module bindings and the individual names its implementation uses. The QA suite no longer marks
no_implicit_importsas broken, andOptimizationNLPModels.OptimizationProblem,NLPModelsAdaptor,build_nlpmodel_meta, and the reexported NLPModels types remain available.Round 2 (review feedback): dropped unused
cons/grad/hessimports from NLPModels (they were only local closures insideOptimizationFunction, not module-level uses) and removed the comments that claimed otherwise / pointed at callers.Verification
The QA and Core commands below ran from
lib/OptimizationNLPModels, with the Julia depot and temporary directory isolated under this job directory. Group env var confirmed intest/runtests.jlasOPTIMIZATION_TEST_GROUP.Quality Assurance | 34 1 35 1m01.1s;Testing OptimizationNLPModels tests passed.Quality Assurance | 35 35 1m05.4s;Testing OptimizationNLPModels tests passed.Core | 34 34 2m10.1s;Testing OptimizationNLPModels tests passed.julia --project=@runic -e 'using Runic; exit(Runic.main(ARGS))' -- --inplace lib/OptimizationNLPModels/src/OptimizationNLPModels.jl— exit 0 (round 2).typos lib/OptimizationNLPModels/src/OptimizationNLPModels.jl lib/OptimizationNLPModels/test/qa/qa.jl— exit 0.cons/grad/hess:check_no_implicit_importsand stale checks return ok.lib/,test/, anddocs/for qualifiedOptimizationNLPModels.xreferences. Code usesOptimizationNLPModels.OptimizationProblemandOptimizationNLPModels.NLPModelsAdaptorinlib/OptimizationNLPModels/test/core_tests.jl; docs mentionNLPModelsAdaptorandbuild_nlpmodel_meta.OptimizationProblemis imported from SciMLBase (owner) and used at the constructor return site so the binding stays live; reexport QA passes.Not verified: CI, the full Optimization.jl monorepo suite, and downstream packages.
Please ignore this draft until reviewed by @ChrisRackauckas.
Risk assessment
OptimizationNLPModels.OptimizationProblem,NLPModelsAdaptor,build_nlpmodel_meta) still resolve. Names that were only incidentally reachable asOptimizationNLPModels.xthrough the old blanketusingno longer are; nothing inlib/,test/ordocs/uses them, but downstream code spelling them that way would break.cons/grad/hessimports.Cursor Agent CLI 2026.10.01-14929f9 (model: auto); transcript: /home/crackauc/sandbox/goals/qa-hygiene/jobs/nlpm-imports/log.txt
Independent review: Devin Fusion (fusion-claude-opus-5-5-high-sidekick-swe-2-medium) rated it low, verdict MERGE: #1409 (comment)