Skip to content

docs: restore macro-free worked problems on functional-api.md (E7) - #938

Merged
ocots merged 1 commit into
mainfrom
docs/functional-api-problems
Sep 1, 2026
Merged

docs: restore macro-free worked problems on functional-api.md (E7)#938
ocots merged 1 commit into
mainfrom
docs/functional-api-problems

Conversation

@ocots

@ocots ocots commented Sep 1, 2026

Copy link
Copy Markdown
Member

What

Campaign phase E7 — resolves the one content regression the E6 attic audit (.reports/campaign/N-attics-audit.md, finding F1 / recommendation R2) found: the documentation rewrite kept only the energy double integrator worked in functional (macro-free) form, while the other core gallery problems survived in @def form only. docs/attic/manual-macro-free.md was their only macro-free home, and it is slated for deletion in E6.

Changes

  • docs/src/modelling/functional-api.md — "A worked example…" becomes ## Worked problems with seven ### subsections in gallery order: energy (full treatment kept), time, control-free, control-and-variable, turnpike, singular, state-constraint. Each new one: setup block → side-by-side @def / functional model (responsive-columns-40-60, per the Phase-J decision against code-group tabs) → one solve + objective/variable check → links to its examples/* page and the gallery. turnpike is included beyond the audit's six for gallery parity (it post-dates the attic; it is the purest scalar-convention demo). State-constraint uses a nonlinear :path constraint to match its example page (the attic used a box :state bound).
  • docs/src-literate/guided-tour.jl — its functional block used u[1] / 0.5*u[1]^2 and a !!! warning claiming callbacks are "always vector-valued", contradicting functional-api.md §"Shapes in callbacks" and the "1-D is a scalar" rule. Fixed to bare scalars; warning rewritten.
  • docs/src/modelling/without-control.md — one sentence pointing at the new side-by-side control-free problem.

No change to the public API, Project.toml, or make.jl.

Verification

julia --project=. docs/make.jl builds clean locally:

  • all seven subsections' @example blocks execute; the printed objective: macro = …, functional = … pairs are identical for every problem (energy 6, time 2, control-free λ≈0.496, control+variable 0.0387, turnpike 0.375, singular 1.150, state-constraint 7.692).
  • guided tour regenerated and built.
  • the only "cannot resolve" errors are the six pre-existing @extref items (Plots.plot(::CTModels…) ×4, CTBase.Strategies.parameter ×2), unchanged from main and in the tolerated warnonly classes. No new unresolved @ref.

This unblocks E6 (delete docs/attic/, close the cahier). Audit items F3 (get_strategy_registry double mention) and F4 (193/203 symbol count) are deferred to the E6 §12 walk.

🤖 Generated with Claude Code

The doc rewrite left only the energy double integrator worked in
functional (macro-free) form; the other core gallery problems existed in
@def form only. This restores them, as the E6 attic audit (F1/R2)
recommended.

- functional-api.md: "A worked example" -> "Worked problems", seven ###
  subsections in gallery order (energy, time, control-free,
  control-and-variable, turnpike, singular, state-constraint). Each 2-7:
  setup block, side-by-side @def/functional model, one solve + objective
  check, links to the examples/* page and the gallery. All seven solve to
  identical objectives in both forms.
- guided-tour.jl: the functional block used u[1] / 0.5*u[1]^2 and a
  warning claiming callbacks are "always vector-valued", contradicting
  functional-api.md and the "1-D is a scalar" rule. Fixed to bare
  scalars; warning rewritten.
- without-control.md: point at the new side-by-side control-free problem.

Docs build verified clean locally: all @example blocks execute, only the
six pre-existing @extref errors remain.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@ocots
ocots merged commit b334907 into main Sep 1, 2026
3 checks passed
@ocots
ocots deleted the docs/functional-api-problems branch September 1, 2026 22:20
ocots added a commit that referenced this pull request Sep 2, 2026
The attic (24 pre-v2.1 pages) was kept only for harvesting by the
rewritten site. The attic audit (campaign phase N) confirmed coverage is
~1:1 and E7 (#938) closed the one content regression it found (F1), so
the directory is now dead weight. Nothing in `docs/src/` or `docs/make.jl`
references it; the full docs build is unchanged (exit 0, only the six
pre-existing @extref items in the tolerated warnonly classes).

Also folds in audit finding F3: `solve/choosing-a-method.md` named
`OptimalControl.get_strategy_registry()`, which `99-api-coverage.md` §12
says must not be documented — rephrased to "internal and not re-exported".

The cahier §12 acceptance walk and F4 (the stale 193 symbol count in
`99-api-coverage.md`) are deferred to a dedicated follow-up PR.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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