Skip to content

test(differential): run the native adapter against a stand-in backend (closes the 30 uncovered lines on upstream PR 70) - #319

Merged
hyperpolymath merged 1 commit into
validation/issue-23-native-dafrom
claude/pr-70-coverage-review-5wvqac
Nov 10, 2026
Merged

hyperpolymath merged 1 commit into
validation/issue-23-native-dafrom
claude/pr-70-coverage-review-5wvqac

Conversation

@hyperpolymath

@hyperpolymath hyperpolymath commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

Change and reason

Codecov reported 52.38% patch coverage on JoshuaJewell/MetaManifold-WebUI#70, with 30 lines missing. All 30 lines are in src/analysis/differential.jl. They are the adapter that turns a CompositionalDA result into result rows.

The cause is real. CompositionalDA is not in the General registry, so CI cannot install it. In CI, only the refusal path ran.

This change makes the adapter reachable in CI:

  • differential_abundance(...; native_backend=nothing) calls a module. The default is the CompositionalDA that the session loaded, or the by-name refusal when the session loaded none. Production behaviour does not change.
  • _is_composition_error translates the CompositionError of the backend in use.
  • diagnostics.native_method.package reports the name of the module that produced the numbers. A record from the stand-in says NativeDAStub, so it cannot read as a record from the package.
  • test/support/native_da_stub.jl is a stand-in with the two entry points, the column names and the verdict strings of the package. Its qvalue is not bh_adjust(pvalue), so a second BH pass is visible. Its structural rows carry NaN, as the package leaves them.
  • test/unit/test_differential_native.jl gains four testsets that run on every checkout: the seam, the ALDEx2 wiring, the ANCOM-BC wiring and the refusal order.

The comparisons against the real package stay. They still skip with a message when the package is absent.

This pull request targets the branch of upstream PR 70. A merge here updates that pull request.

Validation

Julia 1.12.5, R 4.3.3 (Ubuntu 24.04 r-base-core), all commands from the repository root.

  1. Coverage, with the same flags as CI:

    julia --project=. --code-coverage=user --compiled-modules=no test/runtests.jl differential differential_native

    Result: 1159 pass, 13 skipped, 0 fail. I compared the .cov file with git diff against the merge base with upstream main (89be534). Every instrumented line that this branch adds to src/analysis/differential.jl is covered: 52 of 52.

  2. Real package. In a scratch copy I ran Pkg.develop on hyperpolymath/CompositionalDA.jl at 9903e76 (v0.3.0) and ran the same command. Result: 1367 pass, 11 skipped, 0 fail. The two real-package testsets ran and agreed with the adapter.

  3. Full unit suite: julia --project=. -t 2 test/runtests.jl. Result: 3618 pass, 25 skipped, 1 error. The error is test_provenance.jl:479: "package 'dada2' is not installed in the R library in use". My sandbox does not have the R packages that renv.lock installs in CI. The test does not touch this change.

  4. Planted mutants. I ran 12 deliberate corruptions of the adapter, one at a time, against test/runtests.jl differential_native. The baseline passed. The suite killed 12 of 12:

    mutant result
    BH applied a second time killed (8 failures)
    estimate taken from the wrong column killed (4)
    log(10) in place of log(2) killed (3)
    structural decisions ignored killed (1 failure, 1 error)
    contrast direction reversed killed (2)
    seam bypassed (package checked in place of the backend) killed (6 failures, 2 errors)
    one retained taxon accepted killed (5)
    CompositionError not translated killed (2)
    package name hardcoded in diagnostics killed (2)
    non-finite statistic published killed (1 failure, 2 errors)
    aldex_effect taken from the wrong column killed (4)
    structural notes swapped killed (2)

    The runner is not part of this change. It counts a kill only when the suite reaches its Test Summary and reports a failure.

Not run: the integration tests, the server tests and the frontend tests. No workflow runs on this pull request: ci.yml on this branch starts only for pull requests into main. The full CI and Codecov run on the upstream pull request, so the Codecov number is not confirmed until PR 70 runs again.

Scope

  • No change to Project.toml, Manifest.toml, renv.lock, codecov.yml or any workflow.
  • The stand-in tests the wiring of the adapter. It does not test the estimators. The real-package testsets do that, where the package is installed.
  • An earlier draft of this work also proposed a patch-coverage gate, a sensitivity test and three estate workflows for the upstream repository. I left them out. They are separate decisions for the upstream owner.

Contribution checks

  • I followed CONTRIBUTING.md.
  • This branch starts at current upstream main and contains no merges from fork main. (It starts at the head of PR 70, be7792f.)
  • Every commit is signed and shows as Verified. (The managed signing identity decides this. See the commit badge.)
  • CI has run and passes. (No workflow runs here. See Validation.)
  • Existing licensing, citation and acknowledgement text is unchanged.

🤖 Generated with Claude Code

https://claude.ai/code/session_0136P7ZoTPXfxg1C85rVNx78

Codecov reported 30 uncovered lines on this branch, all in
`src/analysis/differential.jl`: the adapter that turns a CompositionalDA
result into result rows. CompositionalDA is not in the General registry, so
CI cannot install it, and only the refusal path ran.

- `differential_abundance(...; native_backend=nothing)` calls a module. The
  default is the `CompositionalDA` this session loaded, or the by-name refusal
  when it loaded none. Production behaviour is unchanged.
- `_is_composition_error` translates the `CompositionError` of the backend in
  use.
- `diagnostics.native_method.package` reports the name of the module that
  produced the numbers, so a stand-in record cannot read as a package record.

`test/support/native_da_stub.jl` has the two entry points, the column names
and the verdict strings of the package. Its `qvalue` is not
`bh_adjust(pvalue)`, so a second BH pass is visible, and its structural rows
carry NaN as the package leaves them.

`test/unit/test_differential_native.jl` gains four testsets that run on every
checkout: the seam, the ALDEx2 wiring, the ANCOM-BC wiring and the refusal
order. The comparisons against the real package stay, and still skip with a
message when the package is absent.

Measured with Julia 1.12.5, `--code-coverage=user --compiled-modules=no`,
`test/runtests.jl differential differential_native`: 1159 pass, 13 skipped;
every instrumented line this branch adds to `differential.jl` is covered
(52 of 52).

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0136P7ZoTPXfxg1C85rVNx78
@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 7cf1c31a-7c07-4e2b-bc32-d6b5161867e7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@sonarqubecloud

Copy link
Copy Markdown

@hyperpolymath
hyperpolymath marked this pull request as ready for review November 10, 2026 19:56
@hyperpolymath
hyperpolymath merged commit 1832f5c into validation/issue-23-native-da Nov 10, 2026
3 checks passed
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@hyperpolymath
hyperpolymath deleted the claude/pr-70-coverage-review-5wvqac branch November 10, 2026 19:56
hyperpolymath added a commit to metadatastician/MetaManifold-Evidence that referenced this pull request Nov 10, 2026
## What this changes

The notes for upstream
[JoshuaJewell/MetaManifold-WebUI#70](JoshuaJewell/MetaManifold-WebUI#70)
said that the two patches were never run. That is no longer true for the
first patch.

- `notes/0004-pr70-native-adapter-test-seam.patch` is now the commit
that was run and pushed: `3ed1dfb`, open as draft
[hyperpolymath/MetaManifold-WebUI#319](hyperpolymath/MetaManifold-WebUI#319).
- `notes/pr70-coverage-and-cicd.md` has a new status section at the top.
It records the measured results, the changes against the first draft,
and why PR 70 has no Codex review and no governance comment.
- `notes/README.md` marks
`0005-pr70-coverage-gates-and-estate-lanes.patch` as not applied, never
run, and stale against the new `0004`.
- The word `ponsbot` is corrected. No such fleet member exists in
gitbot-fleet or in standards. pons asinorum is a built-in row of the
Hypatia grid.

## Measured results recorded in the note

| check | result |
| --- | --- |
| patch line coverage of `src/analysis/differential.jl`, CI flags | 52
of 52 added lines covered |
| real CompositionalDA v0.3.0 developed into a scratch copy | 1367 pass,
11 skipped |
| full unit suite | 3618 pass, 25 skipped, 1 error (needs the R package
`dada2`, absent in the sandbox) |
| planted mutants | 12 of 12 killed |

## Not changed

The `0005` patch file itself. It stays as the record of the first draft.

---
_Generated by [Claude
Code](https://claude.ai/code/session_0136P7ZoTPXfxg1C85rVNx78)_

Co-authored-by: Claude <noreply@anthropic.com>
hyperpolymath added a commit to metadatastician/MetaManifold-Evidence that referenced this pull request Nov 10, 2026
…verage (#17)

## What this changes

Follow-up to
[#16](#16).
That note said the WebUI change was open as a draft. The change is now
merged, and the upstream result is known.

- `notes/pr70-coverage-and-cicd.md`:
[hyperpolymath/MetaManifold-WebUI#319](hyperpolymath/MetaManifold-WebUI#319)
is merged. The head of upstream
[JoshuaJewell/MetaManifold-WebUI#70](JoshuaJewell/MetaManifold-WebUI#70)
is `1832f5c`.
- The upstream `CI` run passed at that head.
- Codecov reports patch coverage 100% (66 of 66 lines, 0 missing; it was
33 of 63) and project coverage 75.88% (base 75.73%). Source: the public
Codecov API for PR 70, read at 2026-11-10 20:25 UTC.
- `notes/README.md`: the index row for the `0004` patch says the same.

Two files change. No patch file changes.

---
_Generated by [Claude
Code](https://claude.ai/code/session_0136P7ZoTPXfxg1C85rVNx78)_

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants