Skip to content

feat!: apply the built-in taxon allowlist to every fullmap build - #153

Merged
SkyeAv merged 2 commits into
mainfrom
allowlist-default
Sep 14, 2026
Merged

SkyeAv merged 2 commits into
mainfrom
allowlist-default

Conversation

@SkyeAv

@SkyeAv SkyeAv commented Sep 14, 2026

Copy link
Copy Markdown
Owner

The 18.1.0 top-100 experimental-taxon filter is no longer opt-in: tablassert build-fullmap applies the checked-in src/tablassert/data/experimental_taxa.yaml allowlist unconditionally, and --taxon-allowlist is removed. Every database the command installs — prebuilt extract, source build, or reused file — now carries the matching META.taxon_allowlist identity.

Always-on filter

  • CLI: build_fullmap loads the built-in list on every invocation and passes it to fetch_prebuilt_fullmap and build_fullmap_pipeline; parsing --taxon-allowlist / --no-taxon-allowlist now fails as an unknown option (lock test in tests/test_cover_cli.py).
  • Identity-gated reuse: a database already present at --output is reused only when its recorded identity equals the one the built-in list would record (src/tablassert/cli.py::fullmap_matches_allowlist); an unfiltered or unreadable leftover warns and falls through to rebuild instead of being trusted as-is.
  • Lower-level seams unchanged: build_fullmap_pipeline, fetch_prebuilt_fullmap, and Rust build_fullmap_db keep taxon_allowlist=None as an explicitly-unfiltered option; only the CLI is unconditional.

Rust identity contract

  • Prebuilt requirement: rs.extract_prebuilt_fullmap gained taxon_allowlist; extract_validate_rename checks the extracted primary's recorded identity BEFORE any rename, so a published unfiltered archive can never land — it surfaces as the existing PrebuiltFullmapUnavailable fallback to a filtered source build, with expected/recorded identities named in the message.
  • Shared encoding: allowlist_set normalizes the ID list once for the build path, the extract requirement, and both probes, so the recorded identity and the compared identity cannot drift (non-positive IDs are ignored everywhere).
  • New pyfunctions: taxon_allowlist_identity(ids) and fullmap_taxon_allowlist_identity(db) (best-effort None for absent/foreign/outdated/unreadable files — a rebuild trigger, not an error); registered in rust/src/lib.rs and typed in src/tablassert/rs.pyi.

Design

  • The prebuilt download path is kept, not deleted: archives published per Tablassert version are built by that version's own defaults, and the identity check is the tripwire when they are not. Accepted caveat: until a filtered archive is published for a version, the default invocation downloads that version's unfiltered archive once, fails the check, then performs the full BABEL download + build (documented in docs/fullmap.md).
  • Deferred: the reuse gate checks only the primary's identity; a matching primary with deleted sibling shards still short-circuits (pre-existing blind spot, unchanged).

Tests and documentation

  • Coverage: real-seam Python tests (unfiltered archive rejected end-to-end, matching filtered archive installed and lookup-equal, reuse probe against real databases, flag-removal parser lock, allowlist threading through every seam) and three Rust integration tests (unfiltered rejected, differently-filtered rejected, matching installed with order/duplicate-insensitive identity); build_golden pins that both probes agree with the recorded META.
  • Documentation: docs/cli.md (flag row and example removed, always-on prose, identity-gated reuse), docs/fullmap.md (build-command block, reuse-path bullets, meta table row), CHANGELOG.md (Unreleased, BREAKING), experimental_taxa.yaml header.

Testing

  • uv run pytest → 1338 passed, 43 skipped
  • uv run pyright → 0 errors, 0 warnings
  • uv run ruff check . and uv run ruff format --check . → passed
  • cargo test --manifest-path rust/Cargo.toml → 112 + 11 + 17 passed, 0 failed
  • cargo clippy --all-targets -- -D warnings → passed
  • cargo fmt --check → passed

The 18.1.0 top-100 experimental-taxon filter is no longer opt-in: `tablassert build-fullmap` applies the checked-in `src/tablassert/data/experimental_taxa.yaml` allowlist unconditionally, and `--taxon-allowlist` is removed. Every database the command installs — prebuilt extract, source build, or reused file — now carries the matching `META.taxon_allowlist` identity.

### Always-on filter
- **CLI:** `build_fullmap` loads the built-in list on every invocation and passes it to `fetch_prebuilt_fullmap` and `build_fullmap_pipeline`; parsing `--taxon-allowlist` / `--no-taxon-allowlist` now fails as an unknown option (lock test in `tests/test_cover_cli.py`).
- **Identity-gated reuse:** a database already present at `--output` is reused only when its recorded identity equals the one the built-in list would record (`src/tablassert/cli.py::fullmap_matches_allowlist`); an unfiltered or unreadable leftover warns and falls through to rebuild instead of being trusted as-is.
- **Lower-level seams unchanged:** `build_fullmap_pipeline`, `fetch_prebuilt_fullmap`, and Rust `build_fullmap_db` keep `taxon_allowlist=None` as an explicitly-unfiltered option; only the CLI is unconditional.

### Rust identity contract
- **Prebuilt requirement:** `rs.extract_prebuilt_fullmap` gained `taxon_allowlist`; `extract_validate_rename` checks the extracted primary's recorded identity BEFORE any rename, so a published unfiltered archive can never land — it surfaces as the existing `PrebuiltFullmapUnavailable` fallback to a filtered source build, with expected/recorded identities named in the message.
- **Shared encoding:** `allowlist_set` normalizes the ID list once for the build path, the extract requirement, and both probes, so the recorded identity and the compared identity cannot drift (non-positive IDs are ignored everywhere).
- **New pyfunctions:** `taxon_allowlist_identity(ids)` and `fullmap_taxon_allowlist_identity(db)` (best-effort `None` for absent/foreign/outdated/unreadable files — a rebuild trigger, not an error); registered in `rust/src/lib.rs` and typed in `src/tablassert/rs.pyi`.

### Design
- The prebuilt download path is kept, not deleted: archives published per Tablassert version are built by that version's own defaults, and the identity check is the tripwire when they are not. Accepted caveat: until a filtered archive is published for a version, the default invocation downloads that version's unfiltered archive once, fails the check, then performs the full BABEL download + build (documented in `docs/fullmap.md`).
- **Deferred:** the reuse gate checks only the primary's identity; a matching primary with deleted sibling shards still short-circuits (pre-existing blind spot, unchanged).

### Tests and documentation
- **Coverage:** real-seam Python tests (unfiltered archive rejected end-to-end, matching filtered archive installed and lookup-equal, reuse probe against real databases, flag-removal parser lock, allowlist threading through every seam) and three Rust integration tests (unfiltered rejected, differently-filtered rejected, matching installed with order/duplicate-insensitive identity); `build_golden` pins that both probes agree with the recorded META.
- **Documentation:** `docs/cli.md` (flag row and example removed, always-on prose, identity-gated reuse), `docs/fullmap.md` (build-command block, reuse-path bullets, `meta` table row), `CHANGELOG.md` (Unreleased, BREAKING), `experimental_taxa.yaml` header.

### Testing
- `uv run pytest` → 1338 passed, 43 skipped
- `uv run pyright` → 0 errors, 0 warnings
- `uv run ruff check .` and `uv run ruff format --check .` → passed
- `cargo test --manifest-path rust/Cargo.toml` → 112 + 11 + 17 passed, 0 failed
- `cargo clippy --all-targets -- -D warnings` → passed
- `cargo fmt --check` → passed
@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 3f0f302d-67fa-4753-b816-bc43abbc4fab


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

Comment @coderabbitai help to get the list of available commands.

@SkyeAv
SkyeAv merged commit bd65c2b into main Sep 14, 2026
5 checks passed
SkyeAv added a commit that referenced this pull request Sep 15, 2026
Cut 19.0.0 and bump the package version in pyproject.toml, CITATION.cff,
and uv.lock.

Major: five breaking changes ship. The `tablassert` console command now
requires the optional `[cli]` extra, since `cyclopts` and `rich` left the
base install (#187). Level-one normalization redefines fullmap keys as
cleaned Unicode-lowercase, Porter2-normalized, byte-ordered token sets and
moves the database to schema v6, so every schema-v5 fullmap is rejected and
must be rebuilt (#171, #172, #174, #175, #176). `build-fullmap --aria2c`
is gone -- aria2c is used automatically whenever the `[aria2]` extra is
installed (#178) -- and `--taxon-allowlist` is gone because the built-in
top-100 experimental-taxon allowlist now applies to every build, guarding
both reuse paths by `META.taxon_allowlist` identity (#153). Logging now
requires the `[log]` extra and is fully disabled without it (#152).

Features: `tablassert.net` is a new stdlib-only transient/permanent
classification and retry seam shared by the agent and the BABEL downloader
(#163, #164), with one bounded jittered retry layer across the inner agent,
reflexion, and judge (#167) and machine-readable `error_code` values on
skipped checkpoint records (#166). `build-kg` gained an automatic ephemeral
shared-prefix TCode cache keyed by content-addressed XXH64 op digests
(#155-#159, #161). The `--distill` corpus became schema-uniform v2 with a
sibling `outcomes.ndjson`, a deterministic `RewardConfig`-tunable reward,
and the new zero-dependency `tablassert distill-weigh` command (#180-#183).
`CLASS_FIELD_OVERRIDES` grants the DAKP sparse qualifier stack on the pinned
association classes (#188).

Fixes: `distill-export` partitions its corpus by content and unions the
schema across record files, so a mixed v1/v2 directory no longer CastErrors
or silently stringifies a column (#184); BABEL retry warnings survive the
loguru sink; PMC downloads are idempotent, atomic, and bounded-parallel
(#165); reflexion and judge prompts are hard-bounded (#168).

Changelog:
- versioned the Unreleased section as 19.0.0 - 2026-09-15
- merged three duplicate `### Added` blocks into one
- moved the two `BREAKING:` entries from `### Changed` into
  `### Breaking Changes` and added a `**Migration:**` note to all five
- added PR links to all 17 entries, which carried none
- added the missing entries: the distill v2 corpus/reward/distill-weigh
  stack (#180-#183), the distill-export schema-drift fix (#184), the
  TCode run-cache detail (#155-#161), and the README badge removal (#154)

Docs: none needed here. Every shipped doc change landed with its own PR,
and the docs source-of-truth gate passes against the bumped tree.

Testing:
- make check -> exit 0
- uv run ruff check . -> All checks passed!
- uv run pyright -> 0 errors, 0 warnings, 0 informations
- uv run pytest -> 1622 passed, 52 skipped
- cargo test --manifest-path rust/Cargo.toml -> 156 passed, 0 failed
- cargo clippy --all-targets -- -D warnings -> clean
- uv lock --check -> resolved 169 packages, lock current
- uv run mkdocs build --strict -> exit 0
- docs SSOT + CLI coverage after the changelog edit -> 204 passed
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