Repository navigation
feat(tools): a linter of the problems (T3 of #449) - #467
Merged
Merged
Conversation
`julia --project tools/lint/problems.jl [problem…]` checks, for every problem, what the template of `ext/README.md` asks: the description and a status for each model file, the outline and sources of the description, `:parameter_info`, and in each model file the method and its keywords, the draft warning, `parameters_data`, `_initial_guess`, the parameters it reads (all used, all of the problem), no bound written in the code; and that every parameter is read somewhere. Its report says what it checks (✅/❌), what other tools check (☑️) and what is left to check by hand (ℹ️). `test_lint` runs it on the collection (no failure allowed) and on an example problem, one defect per check. The checks of the descriptions and of `:parameter_info` move from `test_consistency` into it. Refs #449 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What the linter reported, the problems unchanged: - brachistochrone: the bounds of u and tf are read from the parameters (`u_min`, `u_max` now ±1.57, the values the models used; `tf_l`, `tf_u` added). - balanced_field: `α_min` (now 0), `v_min` (now 1), `h_min` and `tf_min` (added) bound the models; `v_max`, never read, removed. - mountain_car (`tf_start`) and space_shuttle (`α_s`, `β_s`): only the initial guess of the metadata reads them, the models no longer do; space_shuttle's `α_t0`, used nowhere, removed. - ModelingToolkit chain and jackson: `t0` no longer read. The reference files of the three problems whose default parameters changed are written again by tools/references/update.jl, from the cron runs 44015064560 (JuMP), 44235205662 (OptimalControl), 44455617205 (OptimalControlScalarized) and 42387115100 (robustness): same values. Refs #449 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… and description hold Refs #449 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the pull request Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3 of 4 tasks
16 of 53 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #449 (T3). Conventions: ct-conventions v0.14.0, ct-agents v0.5.0.
Summary
A deterministic linter of the problems, for whoever adds one (an agent, later, in particular): what every problem must have, checked the same way for every problem, and a report that says what it checks, what other tools check and what is left to check by hand.
tools/lint/ProblemLint.jl,julia --project tools/lint/problems.jl [--verbose] [problems]: a Markdown report in the style ofrelease.jl audit; exits 1 on a failure.:parameter_info(exactly the parameters, a meaning each); in each model file the method and its keywords, the draft warning,parameters_data,_initial_guess,_problem, the parameters it reads (all used, all of the problem), no bound written in the code; every parameter read by a model or by the metadata.test/suite/core/test_lint.jl: the collection has no failure, and an example problem with one injected defect per check. The checks oftest_consistency.jlit replaces are removed (outline, sources, parameter info, status ↔ file).brachistochrone(u_min,u_max,tf_l,tf_u),balanced_field(v_min,α_min,h_min,tf_min;v_maxunused, removed), the defaults being the values used so far;mountain_cartf_start,space_shuttleα_s,β_s(and the parameterα_t0), ModelingToolkitchainandjacksont0;balanced_field,brachistochrone,space_shuttleregenerated bytools/references/update.jl(values unchanged).AGENTS.md: adding a problem followsext/README.md, lints before testing, and pastes the ℹ️ checklist in the pull request.ext/README.md: a "Lint it" step.Left from T3:
bryson_denhamJuMP componentsx1/x2(separate PR), MOD4 inOptimalControlModels.jl/JuMPModels.jland thecart_pendulumcomment (maintainer's call). Next: a generator of the skeleton of a new problem, whose output passes this linter.Test plan
julia --project tools/lint/problems.jl: 22 problems, 1057 checks, no failure.core: 1262 passed.brachistochrone,balanced_field,mountain_car,space_shuttle: 1266 passed.chain,jackson: passed.🤖 Generated with Claude Code