Skip to content

chore!: general maintenance — MSRV policy (ADR-T-011), dependency refresh, lint cleanup - #884

Merged
da2ce7 merged 19 commits into
torrust:developfrom
da2ce7:20260905_maintenance
Sep 8, 2026
Merged

da2ce7 merged 19 commits into
torrust:developfrom
da2ce7:20260905_maintenance

Conversation

@da2ce7

@da2ce7 da2ce7 commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

General maintenance pass over the workspace: a computed MSRV policy, a dependency refresh under it, the lint table actually enforced, and stale references repaired. No feature work; every change is argued by a diagnostic, a lock-file fact, or a reference that no longer resolved.

MSRV policy (ADR-T-011)

rust-version is now computed rather than discovered: the newest stable Rust released at least one year before the day the pin is computed, recomputed at every release and in every maintenance pass. Computed on 2026-09-05 that is 1.89 (1.89.0 shipped 2025-08-07; 1.90.0 shipped 2025-09-18 and is not yet a year old). The ADR argues the rule on the merits — predictability for distributions and pinned builds, a schedule that no longer belongs to whichever dependency publishes next, and a clean separation between the compatibility promise and dependency resolution, which the edition-2024 MSRV-aware resolver already solves from the declared floor. The MSRV job in CI reads rust-version from Cargo.toml, so the workflow is unchanged. Breaking: toolchains older than 1.89 no longer build the workspace.

Dependencies

  • Three bare 0 requirements (argon2, pbkdf2, tower-http) are narrowed to the 0.x lines the sources are written against. A bare 0 admits every breaking 0.x release; the first refresh pulled argon2 0.6, which breaks the password-verification path, and a second tower-http major that changes response behaviour for the enabled features. Both migrations are API decisions and are deliberately left out.
  • The lock is refreshed under the 1.89 floor: 166 crates updated, 21 added, 37 removed (526 → 510); no locked crate declares a rust-version above 1.89. cargo audit goes from 5 vulnerabilities and 5 warnings to 1 and 1, clearing among others RUSTSEC-2026-0141 (lettre TLS hostname verification, critical), RUSTSEC-2026-0185 (quinn-proto memory exhaustion), RUSTSEC-2026-0258 (h2) and RUSTSEC-2026-0204 (crossbeam-epoch). Remaining: RUSTSEC-2023-0071 (rsa, no fixed release) and RUSTSEC-2026-0192 (ttf-parser unmaintained).
  • futures was declared but unused and is dropped, along with the cargo-machete entry that hid it; tempfile in the entry-script package is used only by tests and becomes a dev-dependency.

Lints

  • The workspace lint groups were spelled with dashes, which current toolchains warn about eighty-one times per build; they are respelled with underscores.
  • 34 clippy diagnostics are resolved at their source across nightly and stable — none silenced by an allowance. The two unreachable arms on an infallible result in the about handlers are replaced with an empty match; the needless_range_loop loops in mudlark iterate the slices; test assertions gain messages or use assert_eq!/assert_ne! per assert_is_empty.
  • One lint level is set explicitly in the workspace table with its reason: unused_async_trait_impl, because the async on those signatures is contractual (axum's async extractor trait and the byte-cache API shape) and removing it would be an API change, not a lint fix. Five of the sites already carried the older unused_async allowance that nightly renamed out from under them.
  • Rustdoc builds with -D warnings clean; cargo fmt --check is empty.

Documentation

Stale MSRV mentions (README, crate docs, the mudlark README which still said 1.80), two relative links in ADRs that no longer resolved, the release-process and deployment references to the removed torrust-index-located-error crate, and inferable readme fields.

Verification

  • cargo +1.89.0 check --workspace --all-targets --all-features --locked: clean.
  • clippy --workspace --all-targets --all-features -D warnings on nightly (1.100) and stable (1.98): clean.
  • cargo test --workspace --all-features --no-fail-fast: 60 binaries, 1907 passed, 6 ignored; the 9 failures are the e2e torrent-upload tests that need the external imdl binary, which the CI workflows install and the verification host did not have.

Left out on purpose, each with its reason in the commit history: argon2 0.6 / password-hash 0.6 (coordinated migration of password verification), tower-http 0.7 (406 on unacceptable encodings with compression-full), the kebab-case binary-name warnings (a rename of shipped commands), the unused workspace categories field (inherit or delete both touch published metadata), the deployment workflow's incomplete publish list (release policy), and the GitHub Actions pins (dependabot's).

@da2ce7
da2ce7 requested a review from a team as a code owner September 5, 2026 16:01
Copilot AI lite review requested due to automatic review settings September 5, 2026 16:01

Copilot AI 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.

🟡 Changes recommended

Cargo.toml workspace package metadata appears to still point at the tracker project (docs/repo URLs), which is likely incorrect for torrust-index publishing metadata.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Maintenance-focused update that codifies an MSRV policy (ADR-T-011), bumps the workspace MSRV accordingly, refreshes dependencies under that floor, and applies targeted lint/test/doc cleanups across the workspace.

Changes:

  • Add ADR-T-011 and raise workspace rust-version to 1.89, updating MSRV references in docs.
  • Refresh dependency constraints + lockfile; clean up lint configuration and fix clippy findings in code/tests.
  • Repair stale documentation/workflow references (ADRs, release/deploy docs).
File summaries
File Description
tests/e2e/web/api/v1/contexts/torrent/asserts.rs Minor URL list construction cleanup in E2E helpers.
tests/e2e/web/api/v1/contexts/tag/contract.rs Improve assertion diagnostics in E2E test.
src/web/api/server/v1/contexts/about/handlers.rs Replace unreachable error arms with empty match on Infallible.
src/lib.rs Update crate docs MSRV mention to 1.89.
README.md Update README MSRV mention and link ADR-T-011.
packages/render-text-as-image/src/blend.rs Use mul_add for alpha blend computation.
packages/render-text-as-image/Cargo.toml Remove explicit readme metadata entry.
packages/mudlark/src/vtree.rs Replace range loops with slice iteration.
packages/mudlark/src/tests/rebalance.rs Add assertion messages for better failure context.
packages/mudlark/src/tests/rebalance_stress.rs Add assertion messages for better failure context.
packages/mudlark/src/tests/plan_builders.rs Replace index loops with iterator-based assertions.
packages/mudlark/src/tests/observe.rs Add assertion messages for invariant violations.
packages/mudlark/src/tests/evict.rs Add assertion messages for unexpected candidates.
packages/mudlark/src/tests/diagnostic.rs Add assertion messages for unexpected diagnostics output.
packages/mudlark/src/tests/decay.rs Add assertion message for expected non-empty extraction.
packages/mudlark/README.md Update MSRV note to inherit from workspace.
packages/mudlark/Cargo.toml Remove explicit readme metadata entry.
packages/index-entry-script/Cargo.toml Move tempfile to dev-dependencies.
packages/index-config/src/tests/info.rs Prefer assert_eq! for empty-path checks.
packages/index-config/src/lib.rs Use Result::is_ok_and for env-var presence check.
packages/index-auth-keypair/tests/keypair_generation.rs Prefer assert_ne! for non-empty string checks.
packages/index-auth-keypair/src/tests/mod.rs Prefer assert_ne! for non-empty string checks.
docs/release_process.md Remove references to removed crate from release steps.
CHANGELOG.md Record MSRV policy + raise as breaking change highlight.
Cargo.toml Bump MSRV; tighten some 0.x dependency constraints; lint table cleanup.
Cargo.lock Lockfile refresh under new MSRV floor.
adr/011-msrv-policy.md New ADR defining the computed MSRV policy.
adr/009-container-infrastructure-refactor.md Update stale reference to relocated health check path.
adr/002-ignore-non-standard-info-fields.md Fix stale relative link to source file.
.github/workflows/deployment.yaml Remove publish step for removed crate.
Review details
  • Files reviewed: 29/30 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread Cargo.toml Resolved
The workspace floor has moved three times and every move was reactive:
1.83 because the transitive tree would not build lower, 1.88 because a
single dependency wanted it. A floor discovered that way is unpredictable
in both timing and size, hands its schedule to third parties, and has to
be argued from scratch on each raise.

It also conflates two separate questions. Which toolchains the workspace
promises to support is a compatibility commitment to downstream builders.
Which dependency versions resolve is a build-time selection problem, and
since edition 2024 the MSRV-aware resolver already solves it from the
declared rust-version. A dependency wanting a newer toolchain is a reason
to select an older release of that dependency, not a reason to move the
promise.

ADR-T-011 replaces the discovered floor with a computed one: rust-version
is the newest stable Rust released at least one year before the day the
pin is computed, recomputed at every release and in every maintenance
pass. A year is the unit distributions and pinned builds plan in, the
value is derivable by anyone without consulting the maintainers, and a
toolchain that builds the workspace today keeps building it for a year.

Computed on 2026-09-05 the pin is 1.89: 1.89.0 shipped 2025-08-07, while
1.90.0 shipped 2025-09-18 and is not yet a year old.

The MSRV job already extracts rust-version from the workspace manifest
and installs that toolchain, so the raise propagates from the manifest
alone and the workflow is unchanged. Prose that named the old floor is
corrected in the same commit so the manifest and the documentation cannot
drift apart; the mudlark package README named 1.80, which the inherited
pin had already contradicted. Historical ADRs keep the numbers they
recorded, because they document what the floor was when those decisions
were taken.

BREAKING CHANGE: the minimum supported Rust version is raised from 1.85
to 1.89. Toolchains older than 1.89 no longer build the workspace.
…eases

Three requirements were written as a bare `0`. For a pre-1.0 crate that is
the widest range cargo can be given: `0` means "any 0.x", and 0.x is
precisely where the ecosystem signals breaking changes. A routine
compatible lock refresh can therefore carry such a crate across an API or
behaviour break with no manifest edit and no review. Two of the three did
exactly that on the next refresh.

argon2 and pbkdf2 are coupled. The password verification path builds a
`PasswordHash` with one crate and verifies it with the other, so both must
resolve to the same major of the underlying `password-hash` crate. argon2
0.5.3 and pbkdf2 0.12.2 share `password-hash` 0.5.0. Refreshing the lock
selected argon2 0.6.0, which moves to `password-hash` 0.6, and the
workspace stopped compiling with eight errors: `SaltString` moved to the
`phc` crate behind a new re-export path, `hash_password` lost its salt
argument in favour of `hash_password_with_salt` taking raw bytes,
`Error::Password` was renamed `PasswordInvalid`, and `Pbkdf2` no longer
satisfied the `PasswordVerifier` bound because the two crates now carry
incompatible copies of the trait. Moving argon2 forward forces pbkdf2 to
0.13 in the same change plus call-site rewrites throughout password
verification: a coordinated migration of security-sensitive code, not a
version bump. Requiring `0.5` and `0.12` states the constraint the sources
already rely on, so the resolver enforces it instead of a future refresh
rediscovering it. It also holds `blake2` at 0.10, which reaches the tree
only through argon2.

tower-http compiles unchanged on 0.7.1, but it does not behave
unchanged. This workspace enables `compression-full` and `trace`, and
0.7.0 reworked `Accept-Encoding` handling to follow RFC 9110 section
12.5.3: a request that previously fell back to identity encoding now
receives 406 Not Acceptable. The same release widened the `SizeAbove`
predicate threshold from `u16` to `u64`, dropped the implicit `tokio` and
`async-compression` features, and made `GrpcCode` and `GrpcFailureClass`
non-exhaustive. Changing what the HTTP API returns to a client is a
decision about the public interface and belongs to whoever owns that
interface; it is not something a lock refresh should decide silently.
Requiring `0.6` keeps the refresh behaviour-neutral and leaves the move to
0.7 available as its own reviewed change.

The remaining bare `0` requirements are the same hazard. Auditing them all
is a larger decision than this pass should take on its own; these three
are narrowed because each has a demonstrated consequence.
A routine `cargo update`. Cargo reports "Locking 186 packages to highest
Rust 1.89 compatible versions", so every selection is bounded by the
declared floor rather than by whatever the registry published most
recently: 166 crates updated, 21 added, 37 removed, and the tree shrinks
from 526 to 510 crates. No crate in the resulting lock declares a
rust-version above 1.89.

The refresh clears four of the five advisories the previous lock carried,
each by a selection the requirements already allowed:

- RUSTSEC-2026-0141 (critical, 9.1): TLS hostname verification disabled in
  lettre's Boring backend. lettre 0.11.21 to 0.11.23.
- RUSTSEC-2026-0185 (high, 7.5): remote memory exhaustion in quinn-proto
  through unbounded out-of-order stream reassembly. 0.11.14 to 0.11.17.
- RUSTSEC-2026-0258: h2 unbounded empty DATA frames. 0.4.14 to 0.4.19.
- RUSTSEC-2026-0204: invalid pointer dereference in the crossbeam-epoch
  pointer formatter. 0.9.18 to 0.9.20.

It clears four of the five advisory warnings too: the anyhow unsoundness
(RUSTSEC-2026-0190) leaves the tree entirely, event-listener moves past
RUSTSEC-2026-0221, and the yanked chacha20 0.10.0 and spin 0.9.8
selections are replaced.

Two findings are not actionable by a lock refresh and remain: the Marvin
timing sidechannel in rsa 0.9.10 (RUSTSEC-2023-0071), for which no fixed
release exists, and the unmaintained-crate warning for ttf-parser 0.25.1.

One direct dependency crosses a semver-significant boundary: mockall
0.14.0 to 0.15.0. Its release adds compatibility with the `auto_impl`
macro and records no other change — no breaking changes, no removals, and
the same 1.77 floor as 0.14. It is a development dependency used for test
mocks, it needs no source edit, and the workspace compiles, lints and
tests unchanged on it.
Three errors under `clippy --workspace --all-targets --all-features -D
warnings`, all from lints the current toolchain applies more widely than
the one the code was written against.

`needless_range_loop` fires twice in the V-tree intensity recomputation,
where a counting loop existed only to index the packed child intensities.
Clippy's own suggestion — iterating `&children.intensities` — would be
wrong here: the array has three slots but a structural node holds two or
three children, and the unused slot carries a default value that is not
part of the sum. Iterating `&children.intensities[..children.len()]`
drops the index while keeping the bound, and matches how the sampling
path already reads the same array.

`suboptimal_flops` fires on the source-over alpha composite. The
expression is exactly the fused form the lint asks for, and the
per-component blend two lines below already uses `mul_add`, so the
rewrite makes the alpha and colour paths consistent as well as slightly
more accurate: the fused operation rounds once instead of twice.

No behaviour changes, and nothing is silenced with an allowance.
Cargo's `unused_dependencies` manifest lint reports tempfile as unused by
the package. It is: nothing under `src/` references it, and the only use
is a test that builds a temporary SQLite directory. Declared as a normal
dependency it is a build input for every consumer of the library target
and part of what a publish would require, for no reason.

Moving it to `[dev-dependencies]` keeps the test compiling and clears the
warning, which is what the lint's own suggestion proposes.
Four references no longer point at anything, all of them consequences of
decisions already recorded.

ADR-T-002 links the torrent model with a path that leaves the repository:
from `adr/` a `../../` prefix resolves above the root, so the link has
never worked from the tree. One `../` reaches it.

ADR-T-009's context section lists the container pieces as they stood
before that refactor, including a health-check binary under `src/bin/`.
The refactor moved it into its own workspace crate, so the link is dead
while the sentence is still correct as history. The path stays as
written and the link goes, with a note that this ADR is what relocated
it; rewriting it to the new location would falsify the record.

ADR-T-004 removed the first-party `located-error` package, but two places
still expect to publish it: the release process asks the maintainer to
confirm a crates.io release for it, and the deployment workflow runs
`cargo publish` against it. That publish step cannot succeed for a
package that no longer exists in the workspace.

The touched paragraph in ADR-T-002 is reflowed to a single line; the rest
of that file keeps its existing wrapping.

Note for whoever next runs a release: removing the dead publish leaves
the workflow publishing only the root crate, which is now insufficient on
its own. The root crate gained path dependencies that crates.io requires
to be published first, and the workspace has grown several more member
crates since the workflow was written. Which of them belong on crates.io,
and in what order, is a release-policy decision rather than a stale
reference, so it is left alone here.
Twenty-three further errors surfaced once the library targets compiled
again — clippy reports per crate, so the earlier failures were masking
them. All are in test code, and none is silenced with an allowance.

Twenty-one are `assert_is_empty`. The lint's complaint is real: a bare
`assert!(x.is_empty())` prints only the failed expression, so a failing
run says a collection was non-empty without saying what was in it. Where
the value is a string, the assertion becomes a comparison against the
empty string, which is what clippy's own machine-applicable suggestion
produces. Where the value is a collection, it keeps the emptiness test
and gains a message that formats the contents, which reports strictly
more than an equality against an empty array would. The stress test binds
the result first so the message does not recompute it.

Two are `needless_range_loop` over the observation list in the plan
builder tests, where a counting loop indexed a vector that had already
been length-checked; iterating with `enumerate().take(n)` keeps the index
the assertion messages use.

One more suggestion came from the same run: an environment lookup wrote
`.ok().is_some_and(..)` where `Result::is_ok_and` says it directly.
Every build prints nine deprecation warnings per workspace member, eighty
one in total, because the lint groups in the workspace table are written
with hyphens. Cargo accepts that spelling today and warns that it "will
not work in a future edition", so the warnings are not cosmetic: left
alone, the table silently stops denying what it names, and a workspace
that believes it denies `future_incompatible` would no longer do so.

The lint names themselves are unchanged; only the separator is. The
clippy table already used the current spelling.
Cargo's `unused_dependencies` lint reports `futures` as unused by the
root crate, and it is: no source file names it. The only thing the tree
uses is `futures-util`, which is a separate direct dependency and stays.
The facade crate was pulling its whole re-export surface into the build
for nothing.

The suppression list beside it goes too. It had two entries and neither
does any work: `futures` was there to keep the unused-dependency checker
quiet about exactly the dependency now removed, and the other entry names
a package that is not a member of this workspace, so the checker never
had anything to match it against. With the dependency gone and nothing
else to suppress, the table itself is empty of purpose.
…r reached

Clippy checks a crate only once its path dependencies check, and the
first lint runs failed inside those dependencies. With them fixed the
root library was linted for the first time and reported seven errors, all
on code this branch has not touched. They are the current toolchain
applying two lints more widely than the toolchain the code was written
against, not anything the preceding commits introduced.

Two are `unreachable_code`. The about and license page services return
`Result<String, Infallible>` — deliberately, so every handler has one
shape — and `Infallible` has no values, so the handlers' error arms could
never run and their `into_response` calls were dead. Matching the
uninhabited value with an empty match keeps the arm the exhaustiveness
check requires while removing the call that cannot happen. The services
are unchanged: returning `Result` is the uniformity the handlers are
written for.

Five are `unused_async_trait_impl`, a lint that fires where the code
already carries `#[allow(clippy::unused_async)]`. That allowance records
a decision that was already taken — these signatures stay async — and the
lint has since been split, so the recorded intent no longer matches the
name being raised. The decision has not changed: `FromRequestParts` is an
async trait, and the byte-cache methods are async so callers keep one
shape whether or not an implementation awaits. Removing `async` would
change the public API, which is not a lint fix. Rather than scatter a
second allowance across five call sites, the lint's level is stated once
in the workspace table with the reason, so the table says what the
workspace actually enforces.

Three manifests also declared `readme = "README.md"`, which is the value
cargo infers when that file is present. Dropping the key changes no
metadata and clears the last of the manifest warnings that has a fix
without a rename.
The last target to become reachable was the root crate's end-to-end test
binary, which reports three errors.

One is `assert_is_empty` on the tag list. The surrounding comment
explains that the environment may hold tags from other runs, so the
assertion is deliberately "at least one" rather than an exact count —
which is exactly the case where a failure needs to show what was actually
returned. It gains a message that formats the list.

Two are `useless_format`: a `format!` whose entire body is one
already-stringlike interpolation. `to_string` says the same thing without
building a format machine, and the same function two lines above already
writes it that way.
The organisation enforces an Actions allow-list: a workflow may only
reference third-party actions at references the policy names, and the
policy names taiki-e/install-action at the exact version v2.87.2. A
floating major such as @v2 is a different reference and is not on the
list, so GitHub refuses the workflow at startup rather than at the step
that would have used it.

The refusal happens before any job is created, which is why the Rust
workflows have produced no results at all since late July: formatting,
clippy, the minimum-supported-toolchain build and the test matrix never
ran, and a pull request touching Rust showed an empty check list rather
than a failing one. Nothing in the workflows themselves was wrong, so
there was no failing step to read; the only signal was the absence of
signal.

Pinning the three workflows that install tooling through the action to
v2.87.2 brings them back onto the allow-list and restores the checks.
An exact version is in any case the safer reference for a third-party
action, since it removes the tag-repoint path by which a major-version
tag can start resolving to code that was never reviewed here.

The container and end-to-end workflows do not use the action and are
left untouched.
The end-to-end environment runs the tracker's `develop` image and hands
it a configuration through `TORRUST_TRACKER_CONFIG_TOML`. That image was
republished on 2026-09-04 carrying the tracker's configuration overhaul,
which moves the schema from 2.0.0 to 3.0.0 and rearranges the section
layout. The configurations shipped here were still written to the older
shape, so the tracker rejected them at startup.

The rejection is total rather than partial. The v3 top-level
configuration is declared with `deny_unknown_fields`, so the empty
`[tracker]` and `[auth]` tables the v2 files carried are no longer
merely inert leftovers: they are unknown keys, and their presence alone
fails deserialization before any value is read. The tracker process
therefore exits instead of listening.

That exit is what the end-to-end job actually observes. The wait helper
falls back to the plain runtime status for images that declare no health
check, and treats `running` as good enough; a container that has exited
never reaches that state, so the helper exhausts its retries and the job
fails on a timeout rather than on the configuration error that caused
it. The useful diagnostic is inside the container's log, which the
timeout path never surfaces.

Both configurations are rewritten against the schema the tracker's own
end-to-end configuration uses: `[logging]` gains the `trace_filter` and
`trace_style` pair that replaced the single `threshold`, `[metadata]`
gains the `app` and `purpose` keys the v3 files carry, the shared
`[udp_tracker_server]` section appears, and `[health_check_api]` binds
to the wildcard address so the probe is reachable from outside the
container. What is specific to this environment is carried across
unchanged: the sqlite database path, the ports the compose file
publishes, and the `info` logging level.

The admin access token stays out of both files. Shipped defaults carry
no credentials, and the environment already supplies this one through
the `HTTP_API__ACCESS_TOKENS__ADMIN` override, which every path into the
environment sets. The v3 schema defaults the access-token map when the
section is absent, so the override alone is enough and the previous
arrangement continues to hold under the new layout.

Both files now enable the UDP and the HTTP listener. Previously each
enabled only one, and in each case the wrong one: the public
configuration offered HTTP while the public index announces over UDP,
and the private configuration offered UDP while the private index
announces over HTTP. One tracker service that speaks both protocols
serves either mode, which is also what the tracker's own end-to-end
configuration does.

The driver override loses its capitalised spelling. The v3 driver is
deserialized through a lowercase-renamed enum, so `Sqlite3` is not a
recognised value and only `sqlite3` is. The end-to-end scripts already
passed the lowercase form, but the compose default and the local
environment template did not, and the latter is copied into place by the
test runner before the environment comes up.
…s nothing to do

The index whitelists every uploaded torrent unconditionally, and does so on purpose: a tracker running in a mode that ignores the whitelist today may be switched to a listed mode tomorrow, and when that happens the whitelist has to already be complete. That design makes the whitelist call a write-ahead record rather than a request whose success the upload depends on.

The tracker has since made that call answerable in a third way. Its whitelist handlers now hold the whitelist service as an option and, when the capability is switched off by configuration, return early through `disabled_by_configuration_response`, which answers `409 Conflict` with an action-status JSON body: `serde_json::to_string(&ActionStatus::Err { reason })`. `ActionStatus` is tagged on `status` and renamed to snake case, so the body reads `{"status":"err","reason":"listed capability is disabled by configuration"}`, the reason being the display form of the whitelist error for a disabled capability.

Our client mapped every status other than 200 and 500 to an unexpected-status error, so a tracker with the capability off failed the whitelist call, and the upload path rolled the torrent back out of the database. That is the wrong reading of the answer. A `409` here is not a refusal to do the work; it is the tracker saying it keeps no whitelist at all, and a record that cannot be kept anywhere is a record with nothing to write. Nothing is lost by proceeding: the tracker stored none of these calls either way, and a tracker later switched to a listed mode will need its whitelist rebuilt from the index's own records, which remain the only place the information lives.

Both whitelist methods therefore gain a `CONFLICT` arm that logs the tracker's stated reason at info level and returns success. Every other arm is untouched, so a tracker that answers 200 behaves exactly as before and the 500 path keeps its invalid-token handling; a status the tracker has never used still reaches the unexpected-status error.

The reason is read back through a small helper that deserializes only the `reason` field, which keeps it insensitive to how the status tag itself is spelled, and falls back to the raw body when the shape is not the expected JSON so that an unexpected answer stays visible in the log rather than being swallowed. That helper is covered by unit tests for the disabled-capability body, a non-JSON body, and JSON carrying no reason; the status dispatch itself has no unit harness in this crate and is exercised by the end-to-end suite.
Seven of the nine crates in this workspace take their version from
`[workspace.package]`, so they all advertise `4.0.0-develop`. Only the root
crate has ever been published; the others have never been on crates.io, so
that number was never resolved by any consumer and never entered anyone's
lock file.

A shared version costs four things here. It carries no per-crate information,
because a number that moves for an unrelated crate's changes cannot support
the claim a version makes. It couples a generic library's release cadence to
the application, so a fix cannot reach the library's consumers without an
index release they have no interest in. It overstates maturity: three majors
of compatibility history on a crate with no released API.

The fourth cost is decisive and mechanical. `cargo publish` copies the
`version` requirement that sits beside `path` into the published manifest,
because a consumer downloading from the registry has no path to resolve.
Publishing any member today would emit a requirement on
`torrust-index-cli-common 4.0.0-develop`, which does not exist on the
registry and never will. The shared number does not merely say nothing — it
makes every crate but the root unpublishable as written.

The ADR records the rule that follows: each crate declares its own version; a
published crate carries forward the release line it is developing; a crate
that inherited the shared number and was never published starts at `0.1.0`;
and a crate that already declared its own version keeps it. The regression
the third clause implies for six members is safe precisely because those
numbers were never resolvable, and `0.x` is what SemVer reserves for an
interface still free to change — which is where each of those crates actually
is. The fourth clause follows from what this decision is about: the shared
number is the thing that says nothing about the crate carrying it, and a
crate that declared its own has already said what the policy asks for.

The alternatives are recorded with the reason each loses in this workspace's
own terms: one binary, six helper crates that ship in the container image, and
two general-purpose libraries that do not depend on the index at all. The
sibling tracker project reached the same decision on the same reasoning for a
larger workspace, and is cited as such.
`[workspace.package]` no longer carries a `version`. Each crate declares its
own: the root `torrust-index` keeps `4.0.0-develop`, the release line it is
developing towards its published `3.0.0`, and the six member crates that
inherited the shared number are at `0.1.0`. `torrust-mudlark` and
`torrust-index-render-text-as-image` already declared versions of their own —
`1.0.0` and `0.1.0` — and keep them; this change moves crates off a number
that was never about them, and those two were never on it.

For the six that move the number goes down. Nothing downstream can notice.
None of them has ever been on crates.io, so no dependency requirement and no
lock file ever resolved the old number, and there is nothing on the registry
for the new ones to be compared against. What the old number did do was claim
a compatibility history that never happened; `0.x` is what SemVer reserves for
an interface still free to change, which is where each of these crates
actually is.

The sibling pins beside `path` are repinned with them. That requirement is
inert for a workspace build, which always resolves the local path, but
`cargo publish` copies it into the published manifest because a consumer
downloading from the registry has no path to resolve. Until now every member
would have published a requirement on `torrust-index-cli-common
4.0.0-develop`, a version the registry does not have and never will.

The lock file records the six member versions that moved and nothing else; the
dependency graph is unchanged, and member entries are referenced by name
alone.
Each workspace crate now carries its own version, so each has to be
publishable on its own. That needs a publishing path per crate and triggers
that keep the two release shapes apart.

`deployment-packages.yaml` publishes exactly one crate. It extracts the crate
name from a `releases/pkg/<crate-name>/v<semver>` branch, or takes it from a
`workflow_dispatch` input, refuses anything that is not a single crate name,
runs that crate's tests on nightly and stable, checks the crate declares its
own version, and publishes it under the same `deployment` environment and
registry token the application release already uses. The version check is
cheap and it guards the one action an inherited version corrupts: a crate that
still reads `version.workspace = true` would publish a manifest whose sibling
requirements name a version the registry does not have.

Its test job runs only the named crate's tests and installs no external tools.
No member crate needs any; the root crate does, and it is published by
`deployment.yaml`, which installs what its tests need.

`deployment.yaml` narrows from `releases/**/*` to `releases/v*` and keeps
publishing only `torrust-index`. The old pattern admitted every branch under
`releases/`, so pushing a package release branch would have started the
application release workflow and published the root crate — the wrong crate,
from a branch that asked for a different one. A `*` glob does not cross a `/`,
so `releases/v*` and `releases/pkg/**` cannot both match one branch.

`container.yaml` narrows the same way. Running its `Check Context` step's own
guard against `refs/heads/releases/pkg/torrust-index-config/v0.1.0` shows the
semver expression does not match, so the step takes the else branch, prints
"Not Correct Branch. Will Not Continue", sets no `continue`, `type` or
`version` output, and exits 0; both publish jobs are then skipped by their
conditions. The image is never mis-tagged. What is wasted is everything the
context job depends on: the container lint job and the debug and release image
builds run in full before anything decides there is nothing to publish.
Narrowing the trigger stops the run before it starts.
The release process described one release: the application's. With every crate
carrying its own version, most releases in this repository are now a single
crate going to crates.io, and that path had nowhere written down.

The new section gives it: the branch and tag conventions, when a crate is
published, the automated path through the packages workflow, the manual
fallback, and a worked example that starts from the state the workspace is
actually in — a configuration crate and a probe that have never been
published, where the probe cannot go out until the crates it depends on are on
the registry.

Publishing order is the part a reader most needs and the part a version number
does not show, so the section names the graph outright: which crates depend on
no sibling and can go at any time, which need the shared CLI crate first, and
which need two. `cargo publish --dry-run` is described as the check that
reports an unmet order, because it resolves sibling requirements against the
registry rather than against the workspace — which is exactly the question
being asked.

The application steps now say which version they move. Step 1, step 3 and step
9 name the root crate's `version` field, so nobody reads "change the semantic
version" as an instruction to sweep the workspace, and step 6 says the
deployment workflow publishes only that crate and expects the rest to be on
crates.io already.
The `[workspace.package]` table still advertised the tracker project. Both
`documentation` and `repository` named `torrust-tracker`: the values were
copied whole when this repository took its own name in b6cfcc3 ("various:
change name to `torrust-index`") and were never corrected afterwards, so the
workspace has pointed at another project's source and another project's
documentation ever since.

The reach is the whole workspace, not the root crate alone. All nine crates
here — the root and its eight members — publish, and every one of them
inherits `repository` from this table; the root, `torrust-mudlark` and
`torrust-index-render-text-as-image` inherit `documentation` as well. A
release would therefore stamp both wrong links onto every crates.io and
docs.rs page the workspace produces, and a reader following either one lands
on a project that carries no trace of the crate they came from.

`documentation` also takes the canonical docs.rs form for a crate,
`https://docs.rs/torrust-index/`, in place of the `crate/` interstitial the
tracker value used.
@da2ce7
da2ce7 force-pushed the 20260905_maintenance branch from a121529 to 0b9b41f Compare September 8, 2026 16:41
@josecelano josecelano self-assigned this Sep 8, 2026

@josecelano josecelano left a comment •

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.

New ADRs don't follow the repo convetions. We sholud adapt them or refactor all of them.

Pending further reviews.

@josecelano

Copy link
Copy Markdown
Member

New ADRs don't follow the repo convetions. We sholud adapt them or refactor all of them.

Pending further reviews.

Sorry, I thought this was the Torrust Tracker repo :-/

@da2ce7

da2ce7 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

ACK 0b9b41f

@da2ce7
da2ce7 merged commit d12bae7 into torrust:develop Sep 8, 2026
17 checks passed
da2ce7 added a commit to da2ce7/torrust-index that referenced this pull request Sep 20, 2026
…nomaly detector

4d37309 docs(sentinel): state when ready cells are promoted (Cameron Garnham)
553d0b7 docs(sentinel): state the upper-bound exception the code decides (Cameron Garnham)
f5e012d docs(sentinel): describe the crate root the plan now documents (Cameron Garnham)
9a09b3d docs(sentinel): state the condition of the warm-start guarantee (Cameron Garnham)
4141cf5 refactor(sentinel): export only the surface the crate supports (Cameron Garnham)
fef11a9 fix(sentinel): stamp the batch arrival at the call boundary (Cameron Garnham)
54ff4e1 docs(sentinel): state the Rust floor the workspace manifest gives (Cameron Garnham)
1b592f0 docs(sentinel): state the inflation the variance analysis derives (Cameron Garnham)
ef8bb4b docs(sentinel): state the ingest work deferred warm-up leaves in line (Cameron Garnham)
c7f6aa0 fix(sentinel): admit the domain's top only where it is a value of the domain (Cameron Garnham)
3dd2388 docs(sentinel): document the configuration warnings in the API reference (Cameron Garnham)
696b677 fix(sentinel): decide domain membership by comparison for every coordinate type (Cameron Garnham)
5ad7adc docs(sentinel): point the projection-energy proof at the section that carries it (Cameron Garnham)
8930b80 docs(sentinel): cite the specification in its qualified form everywhere (Cameron Garnham)
6f24092 fix(sentinel): decide a value's domain once before the spatial layer sees it (Cameron Garnham)
9cf4059 docs(sentinel): specify that the root is never a competitive target (Cameron Garnham)
23b453f docs(sentinel): state why a newly queued cell needs its volume (Cameron Garnham)
fade22c docs(sentinel): say what each producer of the analysis-set summary counts (Cameron Garnham)
1ba762f fix(sentinel): return a checked-out cell with the volume the graph has now (Cameron Garnham)
6596438 test(sentinel): build the failed-worker witness's starting state instead of racing for it (Cameron Garnham)
4a5c030 docs(sentinel): record the shipped noise-schedule default as done (Cameron Garnham)
521b9d3 docs(sentinel): cite the sections that specify what each line describes (Cameron Garnham)
316b98e fix(sentinel): recover from a warming worker that died (Cameron Garnham)
4abbcc1 docs(sentinel): cite the sections that specify the remaining records (Cameron Garnham)
8de2a64 docs(sentinel): specify the tie-breaks the priority ordering relies on (Cameron Garnham)
160d9fa docs(sentinel): cite the sections that replaced the retired warm-up chapter (Cameron Garnham)
47ca1a4 docs(sentinel): count the contour the way its producer does, and validate depth the way the guard does (Cameron Garnham)
47f418a docs(sentinel): state the warm-up ordering the staging area keeps (Cameron Garnham)
818265a fix(sentinel): order equal volumes ancestor-first in the batch warmer (Cameron Garnham)
e36f2c9 docs(sentinel): cite the sections that specify the remaining records (Cameron Garnham)
7c9e093 docs(sentinel): state the re-exported observation types, the report orderings and every configuration error (Cameron Garnham)
0f218ab fix(sentinel): report the model that scored the batch (Cameron Garnham)
b297e99 fix(sentinel): promote a warming ancestor before its descendant on equal volume (Cameron Garnham)
a1e6108 docs(sentinel): cite the sections that specify what the records describe (Cameron Garnham)
df285fa docs(sentinel): name batch cadence and source references (Cameron Garnham)
8333f01 fix(sentinel): decay warm-up influence with the model (Cameron Garnham)
fa57158 fix(sentinel): require a finite stability constant (Cameron Garnham)
32af3c0 fix(sentinel): report structural mutations from the spatial layer's counters (Cameron Garnham)
4a095de docs(sentinel): derive the stationarity tolerance in place (Cameron Garnham)
37cb65e fix(sentinel): report the geometry that scored each batch (Cameron Garnham)
27b3132 fix(sentinel): keep failed worker joins out of reset (Cameron Garnham)
5c8163d docs(sentinel): repair specification references and lifecycle records (Cameron Garnham)
86a950a fix(sentinel): retain coordination state by membership (Cameron Garnham)
d85d1c4 fix(sentinel): keep geometric schedules tapered at every depth (Cameron Garnham)
4bfba0e fix(sentinel): keep epsilon out of the CUSUM allowance (Cameron Garnham)
54675a1 docs(sentinel): align test and coordinate terminology (Cameron Garnham)
0ca0d2a test(sentinel): compare structural zero by representation (Cameron Garnham)
2cc2718 docs(sentinel): align lifecycle records with the implementation (Cameron Garnham)
d3ac2a8 fix(sentinel): keep failed worker joins out of drop (Cameron Garnham)
763b037 docs(sentinel): keep noise helper contracts with their functions (Cameron Garnham)
9e5fd5a fix(sentinel): report the rank that scored the batch (Cameron Garnham)
ffe0a5a fix(sentinel): count ready targets in warming health (Cameron Garnham)
2579e72 docs(sentinel): align lifecycle and API records with the shipped design (Cameron Garnham)
375f268 docs(sentinel): the clip lockout holds the baselines and lets pressure open the ceiling (Cameron Garnham)
829ad0e test(sentinel): the queued-cell witness does not depend on scheduling (Cameron Garnham)
f4534b3 docs(sentinel): qualify noise reproducibility and bit centering (Cameron Garnham)
9797d2e docs(sentinel): state the depth and dimension dependent bounds (Cameron Garnham)
6b11e94 fix(sentinel): compare the spaces represented by SVD updates (Cameron Garnham)
3d76239 fix(sentinel): reject unrepresentable noise batch allocations (Cameron Garnham)
15e33cf fix(sentinel): align full-width scoring bounds with binary prefixes (Cameron Garnham)
cb9b5b7 fix(sentinel): refresh warming classifications during selection (Cameron Garnham)
73cd48f docs(sentinel): align installation and sharing contracts (Cameron Garnham)
11fd7e8 docs(sentinel): state interval and tracing contracts (Cameron Garnham)
a71b4ca fix(sentinel): record narrow selection exclusions (Cameron Garnham)
473e736 fix(sentinel): reject overdeep analysis cells (Cameron Garnham)
f211639 test(sentinel): the determinism and readout tests check the guarantees they state (Cameron Garnham)
e8fcba8 fix(sentinel): seeding a baseline hands over the source's warmth in both directions (Cameron Garnham)
3dcbf8a fix(sentinel): report a refused warming thread rather than aborting the host (Cameron Garnham)
223d024 docs(sentinel): reproducibility is scoped to synchronous warming on a fixed build (Cameron Garnham)
6a308e0 docs(sentinel): three records name the mechanism that runs (Cameron Garnham)
894bf93 docs(sentinel): the dimension guard keeps the width it names as its minimum (Cameron Garnham)
8604d41 docs(sentinel): the dimension guard's bound and the z-score reference (Cameron Garnham)
74376e6 test(sentinel): the prefix generators refuse an out-of-range prefix in every build (Cameron Garnham)
2be99a2 fix(sentinel): refuse a coordinate width the centred-bit vector cannot hold (Cameron Garnham)
77919db fix(sentinel): refuse a depth pair whose headroom arithmetic overflows (Cameron Garnham)
129e07c docs(sentinel): interval bounds, set names and record references (Cameron Garnham)
d9d6157 test(sentinel): the spray and ordering witnesses test what they claim (Cameron Garnham)
bddc62f fix(sentinel): keep the investment count whole in the online summary (Cameron Garnham)
9e4c5b2 fix(sentinel): cap the centred-bit width and open the bit-vector constructor (Cameron Garnham)
5f32695 fix(sentinel): shut the warming thread down under the staging lock (Cameron Garnham)
fedc7ee test(sentinel): compare the collapsed projection by bit pattern (Cameron Garnham)
9d049d2 docs(sentinel): the coordinate bridge says it is open, and the dimension guard says it is in (Cameron Garnham)
15ed623 fix(sentinel): report the schedule's true maximum, fall back when the corrective SVD fails, and drop the unread round scores (Cameron Garnham)
44528f0 docs(sentinel): the reports say what the code computes (Cameron Garnham)
4a83110 fix(sentinel): count the whole contour and order the coordination reports (Cameron Garnham)
cdcff9f fix(sentinel): report the online sets and the graph's semi-internal count (Cameron Garnham)
752b75c fix(sentinel): warm by volume and prune stale coordination contexts (Cameron Garnham)
1816769 fix(sentinel): route the full-width upper bound and keep the root off the competitive set (Cameron Garnham)
b95ae96 fix(sentinel): refuse a configuration the tracker cannot run (Cameron Garnham)
5c5ed1e test(sentinel): bound the batch age by its own call rather than by a sleep (Cameron Garnham)
ca864f8 test(sentinel): compare exact-equality floats by bit pattern (Cameron Garnham)
9123835 feat(package): spectral sentinel, an online subspace anomaly detector (Cameron Garnham)

Pull request description:

  A sentinel is not a judge. It stands watch, keeps its bearings, and reports what has changed.

  That is the idea behind Spectral Sentinel. It does not decide whether a pattern is dangerous, important, or actionable. It measures structure in a stream, learns what has been ordinary so far, and returns statistical readouts when new observations depart from the learned geometry.

  The "spectral" part is literal: each selected region is modelled with low-rank subspace trackers, and a second tier models the spectrum *of* those scores across related cells. The "sentinel" part is restraint: the crate observes, scores, and reports, but policy stays with the host.

  ---

  ### Summary

  This PR adds `torrust-sentinel` to the workspace: a library crate for hierarchical online subspace anomaly detection over positionally structured observation streams. It is rebuilt as a single commit on the current `develop` (after torrust#884), so it sits on the MSRV-1.90 floor of ADR-T-011 (raised on develop after this branch was first cut, and now published by the package README) and follows the per-crate versioning of ADR-T-012.

  It is built on top of Mudlark. Mudlark provides the adaptive spatial substrate — regions that receive more observation volume earn finer resolution, quiet regions remain coarse. Spectral Sentinel uses that structure to decide where statistical trackers are worth maintaining. It selects significant V-Tree entries, closes them under G-tree ancestry so every selected cell has a complete ancestor chain back to the root, and scores incoming batches against learned subspace models at every selected scale.

  The simplest way to think about it: Mudlark decides where the stream has shape; Sentinel measures whether the recent shape still looks like what that region has learned to expect.

  The crate is deliberately policy-free. Reports carry raw measurements — four scoring axes (novelty, displacement, surprise, coherence), maturity, baselines, CUSUM drift accumulators, geometry, contour summaries, and health snapshots. They do not encode threat levels, recommended actions, or decisions. The host reads the measurements and decides what they mean.

  The core invariant is feed-forward: every input value updates Mudlark with exactly one unit of observation volume. Anomaly scores never flow back into the spatial index. That keeps spatial adaptation driven by traffic structure, not by the detector's own conclusions. Temporal policy is host-controlled: Sentinel never applies decay automatically.

  A second analysis tier — coordination trackers — runs at internal G-tree nodes whose subtrees both contribute competitive cells. It scores cross-cell *patterns* of the four axes, so a coordinated shift that no single cell would flag still surfaces in the report.

  ### Contents

  The addition is substantial, but almost entirely self-contained within `packages/sentinel`.

  - A new `torrust-sentinel` crate (`1.0.0`) with a narrow public surface exposed through flat crate-root re-exports
  - `SpectralSentinel<C, V, N>` as the generic engine, with `Sentinel128` and `Sentinel64` aliases for the common domain widths
  - `SentinelConfig`, `NoiseSchedule`, and `SvdStrategy` for host-controlled measurement parameters, with structured `ConfigError` / `ConfigErrors` / `ConfigWarning` validation rather than panics
  - Public readout types for batch, cell, coordination, contour, health, maturity, geometry, baseline, score, and analysis-set summaries — ordered deterministically by `GNodeId`
  - Analysis-set selection over Mudlark's G-V Graph: top-K competitive V-entries plus ancestor closure into the investment set
  - Per-cell subspace trackers scoring novelty, displacement, surprise, and coherence; EWMA baselines with upper-tail clipping; CUSUM drift accumulators with a separate slow EWMA
  - Hierarchical coordination trackers scoring cross-cell score patterns at G-tree internal nodes
  - Automatic synthetic noise warm-up for every newly created tracker, plus a deferred staging area and optional background warming thread so cell creation does not block the ingest hot path
  - Brand incremental SVD for subspace evolution, with a naive thin-SVD path used both as a fallback for small/numerically sensitive cases and as a debug-mode oracle
  - Optional `serde` support (off by default; pulls in `torrust-mudlark/serde`)
  - A Criterion benchmark suite (15 bench functions across 8 groups: encoding, ingest, auxiliary, convergence, scaling, temporal, analysis)
  - 21 architecture decision records covering measurement-not-opinions, the feed-forward invariant, Mudlark integration, deterministic ordering, analysis-set recomputation, automatic noise injection, scoring geometry, decay semantics, routing, degenerate-dimension guards, test budgets, warm-up convergence, visibility, cell-creation performance, Brand SVD, deferred warm-up, generic domain parameters, investment-set terminology, and the clip-pressure / mean-centred-variance EWMA refinements
  - README, public API reference, algorithm document, and implementation notes (~4.7k lines of crate-level documentation total)
  - 642 tests with all features enabled (631 in the default configuration) across crate-level tests (`src/tests/`), integration tests (`tests/`) and doc-tests, with the README compiled as a doc-test via `#[cfg(doctest)] include_str!`
  - Two pedagogy integration tests (`pedagogy.rs`, `pedagogy_advanced.rs`) written to be read end-to-end as a walkthrough of the public surface

  ### Changes outside sentinel

  - `Cargo.toml` — `packages/sentinel` added as a workspace member
  - `packages/mudlark` — unchanged: the series rides on the released Mudlark 1.1.0 that `develop` carries, whose structural mutation counters and `semi_internal_count()` accessor the report reads; the branch's own earlier cut of that feature is dropped, and no commit in the series touches the Mudlark package
  - `Cargo.lock` — 76 entries added for the dependency closure (`faer`, `rand_distr`, plus dev-only `criterion` and `tracing-subscriber`) against the lockfile `develop` refreshed under the 1.90 floor; no existing entry moves, and fifteen bare dependency lines gain a version qualifier because the closure introduces a second compatible release of `thiserror`, `thiserror-impl`, `rand_chacha` and `r-efi`
  - `AGENTS.md` — adds Sentinel's `S-` cross-reference prefix to the package table and ADR examples

  ### Manifest under ADR-T-012

  The dependency on the sibling `torrust-mudlark` pins `version = "1.1.0"` beside its `path`, because `cargo publish` writes that requirement into the published manifest and the report reads the structural mutation counters that arrive with that minor. `faer`, `tracing` and `criterion` name the 0.x line the sources are written against (0.24, 0.1, 0.8) instead of a bare `0`, for the reason torrust#884 gave for the root's requirements. `cargo publish --dry-run -p torrust-sentinel` stops at resolution because `torrust-mudlark` is not on crates.io yet; that is the publication order ADR-T-012 documents, and `torrust-mudlark` itself dry-runs cleanly.

  ### Reviewing this

  The best starting point is the public surface:

  `packages/sentinel/src/lib.rs` → `packages/sentinel/docs/api.md` → `packages/sentinel/README.md`

  From there, the main implementation path is `src/sentinel/mod.rs` for the orchestrator, `src/analysis_set.rs` for competitive selection and ancestor closure, `src/sentinel/tracker.rs` for per-cell scoring, `src/sentinel/{cusum,staging,warming_thread}.rs` for drift and warm-up, and `src/maths/` for the SVD plumbing.

  For a focused review, I would look at:

  - the public API shape and the flat crate-root re-exports
  - configuration validation, defaults, and the structured error/warning types
  - the feed-forward Mudlark integration (Δ = 1 per observation, scores never feed back)
  - report semantics, deterministic ordering, and what is and isn't part of the public surface
  - tracker warm-up, the deferred staging area, and the optional background warming thread
  - the Brand SVD fallback boundary (small `d`, narrow rank gaps) and the debug-mode oracle path
  - integration tests that assert invariants through the public API only

  The pedagogy tests are intended to be readable end-to-end; running `cargo test -p torrust-sentinel --test pedagogy -- --nocapture` produces a narrated walk through the public surface.

  ### Verification

  On the rebuilt commit: `cargo fmt --check` clean; `cargo clippy --workspace --all-targets --all-features -- -D warnings` clean under the workspace lint table; the crate's 565 tests and 15 doc-tests pass; the whole workspace passes (2,370 tests, none failed); `cargo audit` keeps the vulnerability count of `develop` (the one `rsa` advisory with no fixed release) and adds a single allowed unmaintained-crate warning, RUSTSEC-2024-0436 (`paste`, a proc-macro pulled by `faer` through `gemm`).

  ### Notes

  - Ships at `1.0.0`: the public surface documented in `docs/api.md` is covered by semver guarantees from this release onwards. A sibling crate consumes it through a `version`-beside-`path` pin, the same discipline this manifest applies to `torrust-mudlark`, so the version a consumer pins is the one the manifest declares.
  - MSRV 1.90, inherited from the workspace (ADR-T-011). Paragraphs below that report verification on 1.89.0 record runs made while the workspace floor was 1.89; the floor was raised to 1.90 on develop afterwards and this branch now sits on it.
  - No `unsafe` code; `#![forbid(unsafe_code)]` at the crate root.
  - AGPL-3.0-only, inherited from the workspace. Unlike Mudlark, no linking exception is shipped with this crate.
  - Default features: none. `serde` is opt-in.
  - The crate measures only. Interpretation and response remain external host policy.
  - Temporal policy is host-controlled: Sentinel never applies decay automatically.
  - Configuration prefers structured errors over panics.
  - Sentinel docs and ADRs use the `S-` cross-reference prefix added in this PR.

  ## Review fixes

  Since the previous head, nine commits on top of the three original ones fix every finding an automated review of the package produced and a code-level verification confirmed: the configuration validation refuses non-numbers, an unrepresentable depth-buffer headroom and a coordinate width below the tracker minimum (two additive error variants); the full-width cell owns the domain maximum and the root leaves the analysis candidates before the capacity cut; staged cells warm by their real volume and a pass with no competitive scores retires every coordination context; health and batch reports count the online sets, populate the semi-internal count from the graph (one additive `mudlark` accessor, and the headroom arithmetic in `mudlark` saturates instead of wrapping), count the whole contour and order coordination reports by depth then identifier; the geometric schedule reports its true maximum, a failed corrective factorisation reports failure so the dispatcher falls back, and the unread round scores are gone. Prose follows the code (the z-score denominator, the live-tracker figure, the open bit-source trait, the implemented dimension guard), and the one exact float equality in the invariants suite compares bit patterns. Nothing on the public surface is removed or reshaped.

  ## Second round of review fixes

  Five further commits fix every finding of a second automated review at the previous head. The warming thread's shutdown transition is made under the staging lock its wait is paired with, so a shutdown can no longer be lost between the worker reading its predicate and sleeping on it, which left the join — reached from `Drop` — waiting forever; the `u128` centred-bit conversion caps the requested width at the type's own instead of indexing past its backing array; the centred bit vector gains a validated constructor and a length accessor so an implementation of the open bridge trait outside the crate can return the value its impl must produce; the online summary reports the investment count over the whole selection, warming cells included, as its contract states. The test support's four-bit generator refuses a nibble at sixteen or above (which shifted every set bit out of the coordinate and aliased the range sixteen below), a six-bit generator carries the sprays that claim sixty-four distinct ranges, and the ordering, budget and concentration witnesses assert the documented order, the structure's own budget and a report below the root. The upper bounds of analysis entries and coordination contexts document the top-of-domain exception, the analysis set's full field is named as the investment set it is, the thread-safety plan states the `Send + Sync` the crate asserts statically, and section-mark references with no referent leave the record and the test banners. Public surface: three additive constant functions on the centred bit vector; nothing is removed or reshaped. Verified on stable 1.98 (the toolchain this repository lints and tests with), 1.89.0 and nightly.

  ## Third round of review fixes

  Four further commits fix every finding of a third automated review at the previous head. The headroom a depth pair demands was computed with one checked step and three unchecked ones around it, so a creation depth of zero beside an eviction depth at the top of the range overflowed inside the very method that promises to hand back its faults as values; the computation now lives in a helper whose every step is checked, and any overflow reports the existing structured error for a buffer too large to honour, with the widest pair a budget can clear pinned as accepted. The centred-bit vector holds at most 128 values, but the coordinate trait it is fed from is open to wider types and the only width guard compared the tracker's dimension with the coordinate's declared bits, so a 200-wide tracker over a 256-bit coordinate was admitted and fed from a 128-slot vector; the sentinel now refuses a width above the vector's ceiling with a configuration error naming the width and the maximum, and the ceiling is documented on the bit source, on the bit vector and in the crate docs. The prefix generators in the test support guarded their ranges with assertions that release builds compile out; all three sites assert unconditionally. The dimension guard's doc said widths at or below the minimum are refused where the predicate refuses only widths below it, and now names the side of the boundary that is kept; a bare section ordinal in the exponential-average module is replaced by the sense it carried. Public surface: one additive configuration-error variant; nothing is removed or reshaped. Verified on stable 1.98 (the toolchain this repository lints and tests with), 1.89.0 and nightly.

  ## Fourth round of review fixes

  Three further commits correct every finding of a fourth automated review at the previous head; all eight are documentation, and no Rust moves. The two warming modes draw from two different generators: synchronous warming drains from the sentinel's own generator, while background warming draws from a second one seeded on the worker and promotes whatever the worker has finished at each ingest, against a map the main thread is concurrently writing. Four sites promised bit-for-bit reproducibility across runs without saying which mode delivers it; each now scopes the claim to synchronous warming on a fixed build, in one identical clause, and names the background-mode interleaving as the second source of randomness that reaches the scores. Three lifecycle records described mechanisms that no longer run where they said: the cell-width rejection lives in the suffix-width filter applied at runtime rather than in configuration validation, and its effective range is stated; creation schedules noise injection rather than performing it, now that the injection itself is deferred; and the bounded per-ingest work of the deferred warm-up record is stated for the background mode it holds in, with the default mode's in-line drain named beside it. The dimension guard's record said cells at or below the minimum are excluded where the filter keeps a cell at it, and now carries the same words as the constant's own documentation. Verified on stable 1.98 and nightly, with the crate's rustdoc and doc tests, since the README is the crate's front-page documentation.

  ## Fifth round of review fixes

  Three further commits correct every finding of a fifth automated review at the previous head. Construction asked the operating system for the background warming thread and aborted the host when the request was refused, over a resource limit that has nothing to do with the configuration's correctness; the request now returns the environment's own account as a configuration error naming the setting, and it arrives alone because the thread is asked for only once validation has passed. Reset, which has no error channel, keeps the sentinel running and warms cells synchronously instead, recording the refusal as a warning: the warm-up dispatch keys on whether a thread is present rather than on the flag, so the fallback is complete and every report is produced as before. Seeding one baseline from another copied the numbers but only ever raised warmth, so a receiver seeded from a cold source stayed warm over placeholder statistics and the cold path that replaces them never ran again; warmth is now part of what is handed over, in both directions, with a witness that fails at the previous head. Three tests and their prose claimed more, or other, than the engine guarantees: the determinism test compared three lengths and a few means where it now compares whole reports figure by figure with equal bit patterns; the coordination-report ordering test asserted ascending handle where the producer sorts by depth and then handle, and both prose statements of the handle-only order are corrected with it; and the reproducibility claim at the top of the determinism suite is scoped to synchronous warming on a fixed build, which is the configuration those tests share. Public surface: one additive configuration-error variant, and the configuration-error enumeration is marked non-exhaustive ahead of first publication so a later refusal is additive too; the warming-thread handle whose signature changed is crate-internal. Verified on stable 1.98 (the whole workspace lints clean; the crate's tests pass), 1.89.0 and nightly, with the crate's rustdoc and doc tests.

  ## Rebased onto the released Mudlark

  The series is rebased onto the `develop` that merged Mudlark 1.1.0. The rebase drops the branch's own cut of the structural mutation counters and the two Mudlark hunks two Sentinel commits carried, keeps every other commit byte-identical in patch, author and order, and re-resolves the lockfile against the refreshed one: the resolver accepts the result unchanged under `--locked`, and the full bar — nightly tests with and without features, nightly and stable clippy with warnings denied, stable tests, the 1.90 check, and rustdoc with warnings denied — is green at the tip.

  ## Later rounds of review fixes

  The remaining rounds of automated review, each verified at code level before a change was made, are answered by the commits after the fifth round. The CUSUM allowance now follows the algorithm text, κσ·√v_slow, with the denominator-protection constant kept out of it; the geometric noise schedule saturates an unrepresentable exponent instead of wrapping it, so a public caller with an arbitrarily deep argument still lands on the floor; coordination contexts are retained by online competitive membership rather than by which cells happened to score in the batch, so a quiet batch no longer destroys a context that the next joint batch would have to re-warm. Every section reference in source and tests uses the qualified `§ALGO S-N` form and points at the section that carries the cited content; the clip-pressure implementation plan moved to `docs/plans/` so the ADR identifier it borrowed resolves to one record; the implementation guide describes the lazy coordination warm-up the code performs; a failed warming worker is recorded rather than allowed to take `reset()` down; the report's geometry record describes the model that produced the scores beside it; the compile-time width bound is named where a reader would look for it in the error list; and a test comment that cited a document the package never contained now derives its tolerance in place. Finally, the structural mutation counts in the contour snapshot are read from the spatial layer's own counters instead of being inferred from node and terminal deltas, an inference that a last-child eviction falsified; that is what the Mudlark minor bump carries.

  The round that followed the rebase is answered by two further commits. The first repoints every stale algorithm citation in the Sentinel records, plans and source comments at the section that now specifies the behaviour each one describes, including the three that named a chapter the document no longer has and the one requirement the algorithm never specified at all. The second orders the warm-up queue by depth before identifier at both promotion sites, so an ancestor that ties with a descendant on volume is warmed first even when arena slot reuse has handed that descendant the smaller identifier, with a witness on each path that fails without the depth comparison.

  The notes that round left on unchanged code are answered by four further commits. The first fixes a tracker report that mixed two models, publishing an energy share and a leading singular value read after the subspace had already been replaced, so that every reported model figure now describes the model that actually scored the batch. The second gives the API reference the two re-exported observation types it had never documented, states the real ordering of each report vector against the code that produces it, and extends the configuration-error table from a third of the enum to all of it. The third repoints four records at the specification sections that carry the material they cite, two of which named a section about something else and two a chapter the document no longer has. The fourth brings the batch warmer's equal-volume ordering into line with the two live drains, so an ancestor is warmed before the cells beneath it on whichever path serves the queue.

  The round after that left four notes on unchanged records, answered by five further commits. The first states the warm-up ordering the staging area actually keeps, volume then depth then the identifier with the reason each layer exists, in both the deferred-warm-up record and the investment-set record's synchronous-drain decision, so the two describe one ordering rather than two. The second makes the contour snapshot's type-level contract count what its producer counts, terminal nodes together with semi-internal ones, and replaces the configuration record's overflow-prone headroom example with the checked helper and caller the validator actually runs. The third repoints all seventeen citations of the retired chapter 18 at the sections that replaced it. The fourth gives the specification the tie-breaks its ancestor-first guarantee depends on: the priority key becomes the lexicographic triple of volume, depth and node identifier, with the reason each layer is load-bearing. The fifth repoints thirty-four further citations left pointing at sections two renumberings removed, each target verified by reading the section rather than by arithmetic on the number.

  The following round is answered by three further commits. The first recovers a sentinel whose warming worker died: a panicked background thread left its handle standing, so every later reconciliation notified a dead thread and every cell staged from then on stayed off the producing set while reports kept arriving; the worker is now reaped where it would otherwise be handed more work, the cells it was holding are rebuilt, and warming continues synchronously for the sentinel's remaining life, with a witness that fails without the detection. The second repoints fifty-six stale algorithm cross-references at the sections that actually specify what each citing line describes, after auditing all four hundred and seventeen citation sites in the package against the document's headings and bodies. The third marks the noise-schedule default's remaining-work row done, so the record stops contradicting the 450 root rounds the configuration ships.

  One further commit repairs the recovery's witness, which could not reach its own claim on a small machine: its setup now warms synchronously so every scheduled cell is online before the sentinel crosses into background warming for the strand itself, and every assertion after the strand stands exactly as it did.

  The round after that left three notes on unchanged code, answered by four further commits. A checked-out cell now returns with the volume the graph has now, so an ingest landing mid-warm-up can no longer leave the busiest cell queued at its pre-ingest importance. The analysis-set summary type says what each of its producers counts, instead of writing one producer's online scope into fields three producers fill. The three texts justifying the volume refresh now name the tie-breaks that would otherwise decide a newly queued cell, rather than a tie-break the queue no longer has. The specification states that the root is a member of the investment set by construction and never a competitive target, and the sites asserting it cite the section that now carries it.

  The next round left four notes, answered by three further commits. A coordinate's domain membership is now decided once at the ingestion boundary, so a value outside `[0, 2^N)` is counted in no total, moves no partition and reaches no tracker; before, the spatial layer and the lifetime count accumulated it while every tracker was left unaware of it, and the encoder would have presented it as the in-domain value it is congruent to. Every reference to the algorithm specification in the package now uses the qualified `§ALGO S-` form and names the section that specifies what the citing line describes, nine of them re-targeted from sections whose content is not what the text describes; two bare numbers stay as they are because they name no section that exists. The API reference's projection-energy note points at the section that proves the redundancy instead of the glossary appendix it had named since it was written.

  The round after that left one note on the new boundary and one on unchanged code, answered by two further commits. Domain membership is now decided by comparison against the domain's own bounds rather than inferred from the coordinate width: the trait that admits a coordinate type into the sentinel is public, and a signed or NaN-capable type a host writes was admitted wholesale at full width and below the origin at every width, so the predicate is now the root cell's containment test itself, and whatever ingestion admits the partition delivers for any coordinate type, witnessed over a signed type the crate does not ship. The API reference documents `SentinelConfig::warnings()` and the `ConfigWarning` variants, placed beside the errors where the contrast a reader needs, a refusal against an accepted configuration whose results may not be worth reading, is visible.

  One further commit answers the round after that. The full-width exception had asked the coordinate width whether the domain's top is a value of the domain, which is true for the integer coordinates, where the exclusive bound is unrepresentable and `domain_max` names the maximum instead, and false for every continuous or host-written type, where `domain_max` at full width is the representable exclusive bound; the boundary, the interval scan and the scoring-bound conversion now put that one question to the trait through the discriminator the conversion already carried, witnessed by ingesting exactly `2^64` on the signed test type.

  Two documentation commits follow, correcting record claims their own sources do not support. The deferred warm-up record and the specification's work-variance section had said cell creation and noise injection contribute zero cost to an observation call; under background warming the engine still recomputes the selection on every call and still allocates a tracker in line for every cell entering the investment set, so the bound now carries the ranking and closure terms and the per-entering-cell allocation term, and the zero-cost claim is narrowed to the noise injection that deferral actually removes. The mean-centred variance record's confidence-convergence bullet had credited a fourfold surprise inflation at batch size one; the record's own bias table derives an unbounded collapse there, with the bounded factors belonging to the larger batches, and the bullet now says so.

  Two commits follow. The first states the Rust floor the workspace manifest gives, so the crate's published minimum supported version and the rust-version it inherits stop giving a consumer two answers to a question that has one; the floor is the one the workspace's own version job checks and tests. The second stamps the batch arrival at the call boundary, ahead of the domain decision, so the reported observation age spans the filtering pass it previously left out and is the interval the algorithm and the report field both promise; every age assertion in the test suite is an ordering, positivity or absence claim that the earlier stamp preserves.

  Two commits follow. The first withdraws the three hidden crate-root re-exports, so the surface the stability statement covers is the surface the crate can support: a hidden attribute removes a name from the generated documentation without making it private, and each of these names could be written by a consumer who could never obtain a value of it, since its only producer is the crate-private tracker. The witness that asserted their reachability goes with them, as do the two EWMA test affordances the exports had kept public and the per-tracker report's unread depth echo; the API document now states that the root re-exports nothing hidden. The second states the condition of the warm-start guarantee in the noise-injection record: a cell whose schedule requests at least one round at its depth reaches real traffic warm, while a schedule that requests none, whether an empty explicit vector or a geometric taper whose zero floor has decayed past half a round, stages the cell straight to ready and it starts cold by configuration.

  One commit follows. It corrects the API plan's crate-root section, which still said a few support types are re-exported behind a hidden attribute: the crate root now exports nothing beyond the surface the plan's excerpt and inventory cover, and the internal types the crate-private modules contain are reachable by no path from outside the crate.

  Two documentation commits follow. The first restates the top-of-domain exception at every public interval contract the way the code decides it: the upper bound belongs to the cell only when it is the domain's last value, which happens for a coordinate type that cannot represent 2^N at its full width and names its domain maximum as the bound, while a type that can represent 2^N keeps the bound exclusive at every width; the earlier wording had credited the exception to the width alone. The second corrects the deferred warm-up record, which promised promotion at the top of each ingest call: a batch that is empty on arrival or emptied by the domain decision returns the empty report before promotion is reached, so promotion runs at the top of each call that carries observations.

ACKs for top commit:
  da2ce7:
    ACK 4d37309

Tree-SHA512: 8b8832046d6fd3047f6ebeb7ece00a1f62bf9ffee18afba11dee8f5020a6bfd508351b94a69c591bed89b3692933deb8042d9e5fc9d4749418be3e5981e0c9ee

This branch was previously deployed

1 inactive deployment
coverage — 0b9b41fb Deployed Sep 8, 2026 by da2ce7 via Generate Coverage Report #272
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.

3 participants