Skip to content

Accept a capability baseline and compare the manual with it weekly - #4582

Open
evanchooly wants to merge 2 commits into
audits-retire-loaderfrom
audits-capability-baseline
Open

evanchooly wants to merge 2 commits into
audits-retire-loaderfrom
audits-capability-baseline

Conversation

@evanchooly

@evanchooly evanchooly commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Step 6 of the operator-audit plan, drafted for your review as you asked. Stacked on #4581.

Problem

Capability coverage (which operators, contexts and versions the manual declares, compared with Morphia's API) was built but never ran. It needs an accepted baseline: a reviewed snapshot later runs are held to, so a lost operator or a count drop shows up. Until there is one, no MISSING_API or VERSION_ANNOTATION finding can be published.

What discovery found

At mongodb/docs e4b0c153, the commit of the example inventory, the first run was PARTIAL:

  • 14 link failures. $merge, $out, $redact and $text link to core/, tutorial/ and images/ pages outside the request. The source request now covers the whole reference/ tree and those directories.

  • 24 definitions no catalog page lists. The manual's catalog pages omit them. The discovery plan now carries reviewed decisions, each with a reason:

    • assignments (22):
      • expression pages: $serializeEJSON, $deserializeEJSON, $subtype, $unsetField, and the 8.3 array forms of $top, $bottom and $bottomN;
      • the stages $score and $scoreFusion;
      • the predicate $text;
      • 12 window-only functions the manual documents with the group directive, such as $rank, $shift and $locf.
    • omissions (2):
      • $vectorSearch's page declares its stage with the expression directive, and the stage is already in the stages catalog;
      • $options is a parameter of $regex.

    CatalogDiscovery supports both: an assignment places the definition in its context, a stale review is its own problem, and the plan validates reasons and duplicates.

Rerun with those, discovery is READY: 346 capabilities, all 8 contexts healthy, no discovery problems.

The baseline

These files go in audits/catalog/:

  • discovery-plan.json: the probe's catalog rules plus the reviews above.
  • capability-catalog.json: the 346 capabilities with their evidence.
  • coverage-plan.json:
    • every identity accepted, with today's per-context counts as minimums;
    • the core and annotations source roots;
    • explicit bindings for $push's $position, $slice and $sort to PushOptions;
    • exclusions for the positional operators $, $[] and $[<identifier>] (field-path syntax, with no factory) and for $substr (a deprecated alias of $substrBytes).

The coverage report against core's API is COMPARED: 231 typed, 41 missing, 102 unmapped and 5 excluded.

What the weekly job would file

43 issues:

  • 41 MISSING_API, all genuine gaps:
    • new server expressions ($serializeEJSON, $toObject, $hash, $sigmoid, $similarity*, $encStr*, ...);
    • Atlas Search and hybrid-search stages ($search, $searchMeta, $vectorSearch, $rankFusion, $scoreFusion, $score);
    • diagnostic stages ($queryStats and its sections, $querySettings, $listSessions, $listClusterCatalog, ...);
    • $minMaxScaler.
  • 2 VERSION_ANNOTATION: TypeExpressions.toUuid has no server-version annotation (the manual says 8.0), and Documents declares 5.1 where the manual now says 6.0.

Weekly wiring

  • audits/discover.sh: after generation, it acquires the manual at the clone's commit (audits/config/manual-baseline-sources.json with that revision), parses it with the pinned Snooty adapter, discovers under the committed plan, inventories core's API, and writes coverage.json. The summary gains a coverage section.
  • operator-discovery.yml: the docs clone widens its sparse set (all of reference/, core/, tutorial/, images/, and the source/code-examples symlink), and the job installs the pinned Python and uv. The Publish job also files the coverage findings, with the same journal.
  • documented-examples.json: gains one include ($redact's image include, now resolvable).

Update: exclusions

As you decided, the coverage plan excludes, each with its reason:

  • the Atlas Search and hybrid-search stages ($search, $searchMeta, $vectorSearch, $rankFusion, $scoreFusion, $score, $listSearchIndexes);
  • the diagnostic and administration stages ($queryStats, $querySettings, $listSessions, $listLocalSessions, $listSampledQueries, $listClusterCatalog, $shardedDataDistribution, $changeStreamSplitLargeEvent);
  • the Queryable Encryption operators ($encStr*).

That's 32 exclusions including their facets. The weekly job would now file 14 MISSING_API issues, all for new server expressions, plus the two version annotations, which are fixed in Morphia in the next PR.

Decisions for review

  • The reviews in discovery-plan.json are mine, especially treating the 12 window functions as window-only and omitting $vectorSearch's expression directive.
  • Whether to exclude Atlas Search and diagnostic stages before merging, rather than filing issues for them. I left them as findings: they're real gaps, and an exclusion is a one-line review.
  • 102 capabilities are UNKNOWN_MAPPING. Their API tags don't settle which factory builds them. They're neither filed nor counted as present until explicit bindings are reviewed. That's the next coverage work.
  • The server matrix stays at 8.2, as you decided.

Verification

  • audits/discover.sh from this branch, run locally on a clone at e4b0c153: the inventory diff is empty, and coverage is COMPARED with all contexts healthy and the same states.
  • New CapabilityBaselineTest: the plan validates, the catalog has no problems, and every expected identity, binding and exclusion is in the catalog, with minimums equal to the counts.
  • Audits suite passes under Critter, then reflection.

Self-reviewed only: the independent reviewers are out of quota until 2026-11-26.

Capability discovery over the whole reference at mongodb/docs e4b0c153
is READY with every context healthy once the discovery plan records its
reviewed assignments and omissions. The accepted catalog and a coverage
plan of today's identities and minimums, with reviewed bindings and
exclusions, form the baseline. discover.sh now acquires the manual at
the clone's commit, discovers its capabilities, inventories core's API
and writes a coverage report, and the Publish job files its missing-API
and version-annotation findings.
…rom coverage

They run only on Atlas, report on the deployment rather than query data,
or work only on encrypted fields, so the weekly job files no issue for
them. Each exclusion carries its reason; the facets of the excluded
stages are excluded with them.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant