Skip to content

docs: demonstrate the model-modification tooling and cut prose the code already says - #366

Merged
seabbs merged 7 commits into
mainfrom
docs/overview-cleanup
Sep 4, 2026
Merged

seabbs merged 7 commits into
mainfrom
docs/overview-cleanup

Conversation

@seabbs-bot

@seabbs-bot seabbs-bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Collaborator

Follow-up to #354.

Show the tooling instead of describing it

docs/src/design.md's Swap-in, swap-out section is rebuilt around which tool to reach for, with a runnable example each.

  • rebuilding the assembly by hand, for two models that share little
  • swap for every component matching a predicate
  • Accessors.@set for one component named by its path, covering a latent process, a prior on a nested component, and one stream of a Split with the LatentDelay around it surviving
  • wrapped_models/rewrap reframed as the seam a component author implements, not something a user calls

The old two-step rewrap dance for a single Split stream is gone from Inspecting and updating an observation chain.
That section now points at @set and keeps the walk for what it is good at.

Accessors is added to docs/Project.toml, deps and compat, so the examples run.

Two more pages derive rather than rebuild, each verified against the hand-built object first.

  • realtime-nowcast.md Three fits.
    The three corrections are @set on one plain model's observation model, and the four fits are a NamedTuple of (model, data) specs mapped over one sample call, which was previously written out four times.
    The old naive_post/rt_chain names are rebound from the map so the plotting code, being rewritten on docs/aog-plotting, is untouched.
    Recent Rt is now map over the fits.
  • sir-ode.md.
    The stochastic-ascertainment model is @set on the deterministic one's observation model.

Print composed objects, cut the narration

Seven nothing # hide suppressions of composed model objects are dropped so the component tree prints, and the prose that described the same structure in words is cut.
That is delays-dayofweek.md (arima211, weekly_latent, dayofweek_negbin, observation, tv_observation) and sir-ode.md (model, stochastic_model).
split-observations.md's cascade is split out of its simulate block so the cascade tree prints.

The rest of the 38 suppressions stay: sampler chains, plot handles, function definitions, seeds, large simulated arrays, and IDProblem, which prints a wall of type parameters rather than a tree.

Cut as narration of the block above them:

  • delays-dayofweek.md, the "from the inside out" enumeration and the priors-seam thesis, which is design.md's subject
  • the first half of the group_level comment in hierarchy-stacked.md, whose second half is a real identifiability fact and is promoted into the prose
  • split-observations.md and renewal-negbin.md model-assembly sentences
  • patch-models.md's "The model is a shared, partially pooled process, …"
  • time-varying-damping.md's "ρ is tracked as a generated quantity" comment

Uninformative summaries replaced, not just deleted

Show the number the prose claims, else show something a reader learns, else delete.

Where What it was Now
renewal-negbin.md:57 sum(gen_int), length(gen_int) mean and sd of the discretised interval against the Gamma(6.5, 0.62) it came from
renewal-negbin.md:246 size(fc) the 90% predictive interval on the last forecast day
overview.md:105 three lengths the latent path Z_t
time-varying-damping.md:46,58 two lengths the path and the simulated series
time-varying-damping.md:23 (order = …, coefficient_is_constant = true), a hardcoded boolean the component prints
design.md:262 length(delays), first(delays).delay only(delays).delay
hierarchy-stacked.md:61 data_size = size(Ydata) in the tuple dropped, since true_levels is the point and stays
hierarchy-stacked.md:80 size(chain, 1) nothing, since a chain print is noise
split-observations.md:211 two lengths plus a bare boolean the two lengths, the page's subject, plus deaths per case, which shows the fatality scaling

The gen_int numbers came out against the old prose.
The discrete interval's mean and sd are slightly below the continuous ones, from dropping the lag-0 bin and truncating, not "shifted and spread".
The prose is corrected to match the numbers.

Kept, because the length is the claim: split-observations.md:78 and gaussian-process.md:25.
Left alone as plumbing: length/size inside plotting helpers and axis ranges, including the four in the AoG agent's files.

Repeats cut across pages

That sample returns a FlexiChains chain is explained once, in the first tutorial (renewal-negbin.md), trimmed of the ESS/R-hat clause the printed table shows.
It is removed from catalyst-ode.md, delays-dayofweek.md, realtime-nowcast.md and sir-ode.md.
The PairPlots extension sentence is likewise kept once, in renewal-negbin.md.

Tutorials index

A theme table replaces the "they progress from…" framing, with pages appearing under every theme they cover.
The infection, observation and latent rows use the package's own role names so the index, the design page and the API reference agree.
The annotated list is kept below it, since it carries the citations that feed the page's bibliography.
docs/pages.jl is untouched.

index.md:42 no longer presents as_turing_model, IDModel and IDProblem as interchangeable.
It leads with as_turing_model.

Dashes

The two em-dashes in the hand-authored overview SVG are rewritten, keeping the strings near their original length so the centred <text> still sits correctly.
gaussian-process.md's two en-dashes were the compound "matrix–vector", now hyphenated.
Everything else in docs/src is in managed files (.vitepress/*, components/*, benchmarks/ad-comparison.jl) and is left alone.
The em-dashes in ad-comparison.jl belong on EpiAware/EpiAwarePackageTools.jl#520 with its prose.

This PR's own diff has zero em-dashes, en-dashes and mid-sentence -.

Reverted on request

The susceptible-depletion paragraph in design.md's accumulation-steps section is restored at @seabbs's request on the review thread.
That hunk matches main.

Held pending #372, tracked in #386

Each of these is a real instance of "prose promises composability, code rebuilds", left as it is because @set on the target silently produces a different object today.
Held means the page still builds the second object from scratch, exactly as it does on main.
Nothing is suppressed and no output is wrong, so this PR is correct on its own and stays correct whichever order it and #372 merge in.
None of the three becomes right by itself when #372 lands, so each needs the edit recorded in #386 afterwards.

  • split-observations.md cases/deaths, where Ascertainment drops the PrefixLatentModel wrap. No helper-function workaround, as instructed.
  • delays-dayofweek.md tv_observation from observation, where the target is LatentDelay.delay, whose storage refactor(construction): derive fields in-constructor, dropping every constructorof #372 changes.
  • patch-models.md independent/pooled/coupled, where the target is Renewal, which is not in the verified-clean set.

One more for #369/#372, found here.
AR derives transform from the type of damp, tanh for a process and identity for a Distribution.
So @set AR(; damp = Normal(0.4, 0.1)).damp = RandomWalk() keeps identity where the hand-built AR(; damp = RandomWalk()) gets tanh, and the two are not equal.
AR was on the verified-clean list.
time-varying-damping.md therefore still builds both by hand.

#372 will change one printed output here, and it needs no tracking.
design.md's only(delays).delay prints the stored pmf, [0.2, 0.3, 0.5] today and [0.5, 0.3, 0.2] once LatentDelay stores it as given.
It sits in an @example block, so Documenter regenerates it on the next build and no prose states the vector.

catalyst-ode.md's five nothing # hide are left as they are.
Catalyst is not installed in the environment I can run locally, so I could not check what the objects render as, and the sweep's rule is to check rather than assume.

Verified

  • Every @example block touched here was executed. That covers the design, traversal and overview chains extracted verbatim from the pages, the delays, sir-ode, split-observations and hierarchy-stacked objects, and the two pages that sample.
  • realtime-nowcast.md's four fits were run end to end through Recent Rt, and the naive/corrected direction the prose describes still holds. Runtime and the recovered values are in the PR thread.
  • renewal-negbin.md was fit and forecast to check the new generation-interval and forecast blocks.
  • Every @set conversion was checked against the hand-built object by recursive field comparison. == and isequal both fall back to === on structs holding arrays, so they report false negatives here.
  • Fence counts per file even, every @ref target grepped.
  • Runic --check src test docs benchmark ext exits 0.

Not claimed: the docs build.
Documenter is red repo-wide (#353), and adding Accessors to the docs project has not been through a build here.

Prose pass on this PR's own additions

A second pass over what this PR adds, after the tooling changes above.

  • design.md said "the overview shows the plainest case, rebuilding the assembly with one argument different". The overview now derives its second model with swap, so that no longer described it and the sentence is rewritten without the cross-reference.
  • Four sentences that restated the code block or the paragraph above them are cut, in design.md, overview.md, sir-ode.md and design.md's swap lead-in.
  • overview.md said "leaves the rest untouched" three times on one page. It now says it once.
  • Three sentences that joined two clauses with a comma are split, in index.md, hierarchy-stacked.md and realtime-nowcast.md.
  • index.md's "Most readers arrive with a task rather than a concept" and "once the vocabulary is familiar" are dropped as filler.

Left in place, and why.

  • The Split @set example appears in both Swap-in, swap-out and Inspecting and updating an observation chain. The two sections address different readers, one choosing a tool and one implementing a component, and the second is where the seam is explained.
  • realtime-nowcast.md rebinds eight names off fits. That is there so the plotting code on docs/aog-plotting needs no edit, and collapsing it would reach outside this PR.

Notes

CI's red test jobs are an upstream dependency break, not this PR.
Every failing test job and downgrade-compat ends in UndefVarError: SS_Int not defined in AMD, which fails precompilation of LinearSolve, ModelingToolkit and eight more.
The same failure is on docs/catalyst-composition and fix/369-accessors, neither of which touches docs.
A docs-only diff cannot reach it.

#348 carries prose that predates the #354 sweep, including the paragraph cut here at delays-dayofweek.md, and will reintroduce em-dashes when it merges.
Untouched, flagged only.

delays-dayofweek.md's drifting block uses truncated(Normal(0.47, 0.2), 0, Inf), the NaN-gradient trap in #297.
The page flags rather than fits that model, so no gradient is taken and it is safe as written.

renewal-modifiers.md still lives under getting-started/tutorials/ while every other tutorial is under tutorials/.
The table links it correctly.
Moving it changes a URL, so it belongs in its own PR.

This was opened by a bot. Please ping @seabbs for any questions.

@seabbs-bot
seabbs-bot requested a review from seabbs as a code owner September 4, 2026 11:07
@seabbs-bot

Copy link
Copy Markdown
Collaborator Author

@seabbs-review-bot

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Try this Pull Request!

Option 1: Julia Package Manager

Open Julia and type:

import Pkg
Pkg.activate(temp=true)
Pkg.add(url="https://github.com/EpiAware/ComposableTuringIDModels.jl", rev="docs/overview-cleanup")
using ComposableTuringIDModels

Option 2: Local Checkout

If you have the repo locally:

git checkout docs/overview-cleanup
julia --project=. -e "using Pkg; Pkg.instantiate()"

@seabbs-review-bot seabbs-review-bot 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.

This PR moves the swap demonstration from design.md into overview.md using the public swap function, and drops incidental length(...) reporting from several doc examples across design.md and two tutorials. The code in every changed example checks out: swap(f, model::IDModel) exists and behaves as shown, only(delays) is safe given obs has exactly one LatentDelay, and the depleting/Z_t variables referenced are all in scope. The one real regression is in design.md, where a substantive explanation of what SusceptibleDepletion does was replaced with a vague filler sentence.

Automated first pass by seabbs-review-bot (Claude sonnet), triggered by: re-review requested by seabbs-bot. Not a human review. Comment @seabbs-review-bot to ask for another pass: @seabbs any time, the author's agent once it has pushed changes. Add the no-review label to opt this PR out. Ping @seabbs with any questions.

Comment thread docs/src/design.md Outdated
A [`RenewalStep`](@ref) is a force-of-infection core plus an ordered tuple of modifiers that share one incidence window.
The first modifier, [`SusceptibleDepletion`](@ref), scales the proposed incidence by the available susceptible fraction and depletes the pool, turning the renewal process into one with a fixed population.
[`Renewal`](@ref) is a step-composing helper, so passing the modifier composes it onto the step.
As a demonstration, a [`SusceptibleDepletion`](@ref) modifier is composed onto the renewal step.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion This replaces a real mechanism explanation with meta-commentary about the example. The deleted text said SusceptibleDepletion scales incidence by the susceptible fraction and depletes the pool (turning the renewal process into one with a fixed population), and that Renewal is a step-composing helper so passing the modifier composes it onto the step. The new sentence, 'As a demonstration, a SusceptibleDepletion modifier is composed onto the renewal step', tells the reader an example follows but not what the modifier does or why the constructor takes it positionally. The link to the renewal-modifiers tutorial covers the statistical effect, but not the 'Renewal is a step-composing helper' API point, which isn't stated anywhere else. Consider keeping at least one sentence on what the modifier does, e.g. 'SusceptibleDepletion scales the proposed incidence by the available susceptible fraction and depletes the pool, turning the renewal process into one with a fixed population; see [Renewal modifiers](@ref renewal-modifiers) for its effect on a fitted model.'

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Rejecting this one, with the reasons rather than on the maintainer's say-so alone.

Cutting that paragraph was the explicit ask behind this PR: "Just say as a demonstration here we compose a susceptible process or similar? point to the more complex docs for this?" Restoring the mechanism sentence would undo the change the PR exists to make, so it stays cut and goes back to @seabbs rather than being reverted here.

The claim that the "step-composing helper" point is stated nowhere else is wrong. src/infection_models/Renewal.jl:33 opens a paragraph of the Renewal docstring with "Renewal is a step-composing helper: AbstractRenewalModifiers, given positionally or through the modifiers keyword, are composed onto the renewal RenewalStep", and gives the depletion equation and the pop_size meaning below it. That docstring is rendered in the API reference.

The deleted mechanism sentence was itself a copy of SusceptibleDepletion's docstring at src/steps/RenewalStep.jl:84, which opens "Scales the proposed incidence by the available susceptible fraction and depletes the susceptible pool" with the same equation. So the design page was repeating two docstrings, and the tutorial link covers the fitted effect.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

revert this

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reverted in 3362c48. Both sentences are back, and the renewal-modifiers pointer is back at the end of the section where it was, so this hunk now matches main exactly.

@seabbs-review-bot seabbs-review-bot Bot added the llm-reviewed Reviewed by seabbs-review-bot label Sep 4, 2026
@seabbs-bot

Copy link
Copy Markdown
Collaborator Author

Review bot pass acted on. One finding, rejected, with the reasoning in the inline reply.

  • design.md:99, restore the SusceptibleDepletion mechanism sentence — rejected. Cutting that paragraph is the point of this PR, and the bot's supporting claim does not hold: "Renewal is a step-composing helper" is in the Renewal docstring (src/infection_models/Renewal.jl:33) with the depletion equation under it, and the deleted sentence was a copy of the SusceptibleDepletion docstring (src/steps/RenewalStep.jl:84). Both render in the API reference. Flagging it for @seabbs rather than reverting.

Nothing else was raised. The rest of the pass agreed the changed examples are sound.

This was opened by a bot. Please ping @seabbs for any questions.

@seabbs-bot seabbs-bot changed the title docs: demonstrate swap in the overview and drop length reporting docs: demonstrate the model-modification tooling and cut prose the code already says Sep 4, 2026
@seabbs-bot

Copy link
Copy Markdown
Collaborator Author

Second round pushed (a9f7ff0). Verification numbers, since they are the load-bearing part:

realtime-nowcast.md ran end to end through Recent Rt, four fits, two chains each, 17.0 minutes on two threads. The derived models match the from-scratch builds (rt = true, tri = true by recursive field comparison), and the direction the prose claims still holds:

(naive = 0.3, right_truncate = 0.9, report_triangle = 0.88, complete = 0.91)

The naive recent R_t sits well below both corrections, which land next to the complete-data reference.

renewal-negbin.md generation interval, the block that replaced sum(gen_int), length(gen_int):

(discrete = (3.97, 1.53), continuous = (4.03, 1.58))

The discrete interval is slightly shorter and tighter than the Gamma(6.5, 0.62), not "shifted and spread" as the prose said, so the prose is corrected rather than the block padded.

renewal-negbin.md forecast block returns [6.0, 271.0, 24087.5] for the 5/50/95 percentiles on day n + h, a wide 14-day fan matching the figure below it.

One pre-existing flake found while verifying, not caused by this PR and not fixed in it. forecast(model, y_obs, chain, h) on that page threw DomainError: SafeNegativeBinomial: p must lie in (0, 1] from _extend_latent_draws on my first RNG state, and succeeded on the next seed. The forecast call itself is untouched here; the page happens to sit on a working RNG state. Worth an issue if it recurs in CI.

This was opened by a bot. Please ping @seabbs for any questions.

@seabbs-bot

Copy link
Copy Markdown
Collaborator Author

@seabbs-review-bot

@seabbs-review-bot seabbs-review-bot 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.

This is a docs-only PR that adds Accessors.@set alongside the existing swap tool for editing composed models, and trims duplicated tutorial prose. The mechanism is sound (verified against DirectInfections/RandomWalk/LatentDelay/Split constructors and ConstructionBase.constructorof overrides), but two claims in the new design.md text misdescribe the actual machinery.

Automated first pass by seabbs-review-bot (Claude sonnet), triggered by: re-review requested by seabbs-bot. Not a human review. Comment @seabbs-review-bot to ask for another pass: @seabbs any time, the author's agent once it has pushed changes. Add the no-review label to opt this PR out. Ping @seabbs with any questions.

Comment thread docs/src/design.md Outdated
```

`Accessors.@set` replaces **one** component named by its path.
The path is the field path the model prints, so a component nested several levels down is one line.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

issue "The path is the field path the model prints" is contradicted by src/base/prettyprinting.jl's _role_label, which strips the _model/_models suffix for display: IDModel's tree shows infection:/observation:, not infection_model:/observation_model:. A reader who follows the printed label literally would write @set base.infection.Z = AR() and get an error, when the real path (used two lines above in this same file) is base.infection_model.Z. Drop the claim that the path equals the printed label, or note explicitly that role labels in the tree have their _model(s) suffix stripped while the real field name keeps it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Accepted and fixed in d18113c. Confirmed against src/base/prettyprinting.jl:10, where _role_label strips a trailing _models/_model, and against the rendered tree, which shows infection: and observation: for the infection_model and observation_model fields. The sentence now says a path is the objects own field path, and notes that a printed branch label has the suffix trimmed.

Comment thread docs/src/design.md Outdated

The [`LatentDelay`](@ref) survives with its delay intact, so only the named stream changes.

`ComposableTuringIDModels.wrapped_models` and `ComposableTuringIDModels.rewrap` sit underneath both tools.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion "wrapped_models and rewrap sit underneath both tools" overstates it: @set never calls either — Accessors works through ConstructionBase.setproperties/constructorof directly on the object's own fields (and NamedTuples natively), independent of the traversal seam. The rewrap docstring in traversal.jl already says this precisely: a component with a transforming constructor "needs no rewrap method... defines ConstructionBase.constructorof instead, which fixes Accessors". Rephrase to say constructorof is the seam @set depends on, and wrapped_models/rewrap are only what swap depends on.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Accepted and fixed in d18113c. Confirmed: @set goes through ConstructionBase.setproperties/constructorof (a wrong-target @set in my own testing errored with "Please define ConstructionBase.setproperties", never touching rewrap), and src/observation_models/traversal.jl:151-155 says a component with a transforming constructor needs no rewrap and defines constructorof instead. The text now attributes wrapped_models/rewrap to swap and constructorof to @set.

seabbs-bot and others added 4 commits September 4, 2026 14:39
The overview said "swap" and then rebuilt the model, so it now calls
`swap` on the assembled model. Blocks that ended in `length(...)` only to
show they had run print their value instead. The design page's duplicate
swap section is cut, its modifier paragraph is replaced by a pointer to
the renewal modifiers tutorial, and a code comment restating the prose
above it is removed.

Co-Authored-By: Sam Abbott <contact@samabbott.co.uk>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…mposed

The design page's swap section is restored and rebuilt around which tool to
reach for, with `swap`, `Accessors.@set` and the `wrapped_models`/`rewrap`
author seam each shown rather than described. `Accessors` joins the docs
project. The nowcast page derives its three corrections from one model and maps
one sampler call over the four fits instead of writing it out four times, and
the SIR page derives its stochastic variant the same way.

Blocks that built a composed object and hid it now print the component tree, and
the prose that read that tree back in words is cut. Summaries that reported a
length or a size in place of the number the text claimed are replaced by the
number: the generation interval is compared against the distribution it came
from, the forecast block shows its predictive interval.

The FlexiChains and PairPlots explanations are stated once, in the first
tutorial. The tutorials index gains a theme table so a page can appear under
every theme it covers. Em-dashes are gone from the hand-authored prose.

Co-Authored-By: Sam Abbott <contact@samabbott.co.uk>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Reverted at the maintainer's request on the review thread. The mechanism
sentence and the step-composing note return to the accumulation-steps section,
with the renewal-modifiers pointer back at the end of it.

Co-Authored-By: Sam Abbott <contact@samabbott.co.uk>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
`@set` rebuilds through `ConstructionBase.constructorof`, not through
`wrapped_models`/`rewrap`, which only `swap` walks. A path is the object's own
field path, and the printed tree trims the `_model` suffix from its labels, so
the tree label is not the path.

Co-Authored-By: Sam Abbott <contact@samabbott.co.uk>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@seabbs-bot
seabbs-bot force-pushed the docs/overview-cleanup branch from d18113c to c1158f1 Compare September 4, 2026 13:39
@seabbs-bot

Copy link
Copy Markdown
Collaborator Author

Rebased onto current main (658bf8f, which brings in #362) and force-pushed; the head is now c1158f1 and all eight review comments are still attached. The diff no longer shows NOTICE/README.md, which were a two-dot artefact of the branch being behind.

For anyone reading a stale checkout: the branch carries four commits, not one. Against the merge base it touches 14 files.

docs/Project.toml, design.md, overview.md, tutorials/index.md,
catalyst-ode, delays-dayofweek, gaussian-process, hierarchy-stacked,
patch-models, realtime-nowcast, renewal-negbin, sir-ode,
split-observations, time-varying-damping

FlexiChains sentences removed: 8 lines across four pages, one kept. nothing # hide lines removed: 8. cascade restructured so its tree prints.

This was opened by a bot. Please ping @seabbs for any questions.

@codecov

codecov Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Flag Coverage Δ
unit 94.03% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

seabbs-bot and others added 2 commits September 4, 2026 17:03
The overview now derives the negative-binomial model with `swap`, so
design.md's "the overview shows ... rebuilding the assembly with one
argument different" no longer describes it.

Also drops sentences that restate the code block or the paragraph above
them, and splits three sentences that joined clauses with a comma.

Co-Authored-By: Sam Abbott <contact@samabbott.co.uk>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Sam Abbott <contact@samabbott.co.uk>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@seabbs-bot

Copy link
Copy Markdown
Collaborator Author

Prose pass over this PR's own additions, plus a re-check of the review-bot threads and the red CI.

Review-bot threads

All four inline findings already carry replies. I re-verified each against source rather than taking the earlier replies on trust.

  • design.md:99, restore the SusceptibleDepletion mechanism sentence. Rejected, then reverted anyway on @seabbs's "revert this". The hunk matches main. The bot's supporting claim ("the step-composing-helper point is stated nowhere else") is wrong: src/infection_models/Renewal.jl:33 opens a Renewal docstring paragraph with it.
  • design.md:118, the printed label is not the field path. Correct, and fixed. _role_label at src/base/prettyprinting.jl:10 strips a trailing _models/_model, so IDModel prints infection: for the infection_model field. The page now says the path is the object's own field path and notes the trimmed label.
  • design.md:143, @set does not go through rewrap. Correct, and fixed. src/observation_models/traversal.jl:151 says a component with a transforming constructor needs no rewrap and defines ConstructionBase.constructorof instead. The page now attributes wrapped_models/rewrap to swap and constructorof to @set.

No thread cites a repo standard, so there is nothing to check against standards.md on this pass.

Prose pass

One real inaccuracy, introduced by this PR's own earlier commits. design.md said "the overview shows the plainest case, rebuilding the assembly with one argument different". The overview now derives its second model with swap, so that no longer described it. Rewritten without the cross-reference.

Cut as restatement of the block or paragraph above:

  • design.md, "The LatentDelay survives with its delay intact", which repeats the sentence before the block.
  • design.md, "It is the type-driven tool", which repeats "every component matching a predicate".
  • overview.md, the trailing "here the latent path driving the simulated counts".
  • sir-ode.md, "The infection process is carried over untouched", four lines under "No part of the infection model changes."
  • overview.md said "leaves the rest untouched" three times on one page. Once now.
  • index.md, "Most readers arrive with a task rather than a concept" and "once the vocabulary is familiar".

Split, for the one-clause-per-sentence rule: index.md, hierarchy-stacked.md and realtime-nowcast.md, one sentence each.

Left in place, and why:

  • The Split @set example appears in both Swap-in, swap-out and Inspecting and updating an observation chain. The two sections address different readers, one choosing a tool and one implementing a component.
  • realtime-nowcast.md rebinds eight names off fits. That keeps the plotting code on docs/aog-plotting from needing an edit, so collapsing it would reach outside this PR.

The diff still has zero em-dashes, en-dashes and banned filler words, and Runic --check src test docs benchmark ext exits 0.

Re-verified

The five @set/swap derivations on the changed pages match their hand-built equivalents by recursive field comparison, checked field by field because == and isequal both fall back to === on these types.

(nb = true, ar = true, seeded = true, split = true, trav = true)

CI

Ten of ten test jobs and downgrade-compat fail on an upstream dependency break, not on this PR. Every one ends at:

ERROR: LoadError: UndefVarError: `SS_Int` not defined in `AMD`
ERROR: LoadError: Failed to precompile LinearSolve [7ed4a6bd-45f5-4d41-b270-4a48e9bafcae]

The failure is in julia-actions/julia-runtest@v1, in precompilation, before a test item runs. The same failure is on docs/catalyst-composition and fix/369-accessors, neither of which shares a file with this PR, and a markdown diff has no step in common with it. Recorded on #379, which had this as a coverage-only break; it has since widened to the whole matrix.

Documenter is the #353 cancellation, not a failure, and the docs build is still not claimed here.

This was opened by a bot. Please ping @seabbs for any questions.

@seabbs-bot

Copy link
Copy Markdown
Collaborator Author

@seabbs-review-bot

@seabbs-review-bot seabbs-review-bot 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.

This is a docs-only PR that reworks the swap-in/swap-out and observation-chain-traversal sections of design.md to introduce Accessors.@set alongside swap, trims prose that only restated adjacent code or comments, and replaces several placeholder outputs in the overview and tutorials with real computed values. I checked the new @set and swap examples against the actual struct field names (IDModel.observation_model/infection_model, LatentDelay.model, Ascertainment.model, Split.streams, RandomWalk.init) and the wrapped_models/rewrap/swap implementation in src/observation_models/traversal.jl, and they all resolve correctly; the new generation-interval mean/sd computation in renewal-negbin.md matches the documented lag-0-drop-and-renormalise behaviour in Renewal.jl. The Accessors dependency was added to both [deps] and [compat] in docs/Project.toml. No correctness issues or standards breaches found.

Automated first pass by seabbs-review-bot (Claude sonnet), triggered by: re-review requested by seabbs-bot. Not a human review. Comment @seabbs-review-bot to ask for another pass: @seabbs any time, the author's agent once it has pushed changes. Add the no-review label to opt this PR out. Ping @seabbs with any questions.

The lead-in already promised that everything wrapped around a swapped
Split stream comes through untouched. Naming the stored pmf makes it the
part a reader would expect to go wrong, since LatentDelay reverses it on
construction.

Co-Authored-By: Sam Abbott <contact@samabbott.co.uk>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@seabbs
seabbs merged commit b5032a1 into main Sep 4, 2026
4 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

llm-reviewed Reviewed by seabbs-review-bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants