ci: incremental API gates, housekeeping, release coverage, and review-bot LLM removal (PR2) - #590
Merged
Conversation
Coverage is a CI-owned gate (tensor4all-agent-rules docs-and-tests.md); the local pre-PR gate is attestation-based. Local llvm-cov runs are no longer required in the plan's PR validation, the design's validation contract, or AGENTS.md's deletion-PR rule. CI release-mode coverage (Task 12) and the never-lower-thresholds policy are unchanged.
- check-public-error-docs.py (ported from tenferro-rs) audits public Result APIs for concrete # Errors docs; --changed-from REV mode audits only added lines so the 392-item backlog burns down incrementally. Multiline trait scope and commented braces/semicolons are handled. - check-crate-boundaries.py allows normal tenferro-* deps only in tensorbackend plus exact temporary exception tuples (core/simplett/tcicore/ treetci); new tuples, unsanctioned crates, extra deps, stale tuples, and removed exception crates fail. Dev-dependency cycles are rejected with the full marked path (stdlib-only Cargo.toml parser; CI runner python3 is 3.10, so tomllib is not usable). - Removed the tcicore dev-dependency on tensorci: the end_to_end_chain_tci bench moved to tensorci (which already normal-depends on tcicore). - CI scripts job: fetch-depth 0, base revision resolution (PR base.sha / push event.before; missing base fails), self-tests, changed-from audit, and repository-wide boundary check. - Self-tests: 15 public-error-doc cases, 13 crate-boundary cases (all green).
- Replace both no_run doctests with runnable numerical assertions: partial_contract asserts the contracted scalar is 11.0; square_linsolve uses a two-site identity MPO with explicit index mappings and asserts residual < 1e-8 plus solution reproduces the RHS. - Remove the unused kryst dependency (workspace + treetn) and fix the stale GMRES-via-kryst claims to name tensor4all_core::krylov::gmres. - Cargo.lock is gitignored; regenerated locally. - Recorded: the plan's one-site mapped square_linsolve example does not converge in the current implementation (solution stays at init) — suspected related bug, candidate follow-up.
- square_linsolve doctest uses a zero initial guess (not the solution) so its residual and solution-reproduction assertions cannot pass via a no-op solver. - square_linsolve now rejects single-site inputs with an explicit error: the two-site sweep planner yields an empty plan on a one-node network, which previously returned the init unchanged with residual 1.0. Added test_square_linsolve_rejects_one_site_systems. - Refine worklog wording on the kryst/fence greps (live-dependency claim and recorded historical exclusions).
Delete debug.md (issue #192 debugging scratch), plan/ (14 historical planning docs outside the docs/worklogs + docs/design system; their implemented outcomes live in code, tests, rustdoc, and docs/api — no still-live undocumented constraint), coverage-local.json (machine-local llvm-cov snapshot with absolute paths), and the orphan internal/tenferro-internal-ad-linalg/tests/eager_dyn_extra.rs (outside all workspace members; no include!/path dependency references it).
Task 11 review round: production error messages referenced the deleted plan/linsolve-mpo.md. Migrated the still-live external-index rationale to docs/design/treetn-linsolve-mpo.md and the contraction API direction to docs/design/core-contraction-api.md; both diagnostics now reference them, and ProjectedState's type-level rustdoc is aligned with the implemented <ref|b> convention.
- linsolve design doc: exact local external-index precheck lives in SquareLinsolveUpdater, not validate_linsolve_inputs (which only checks topology/dimensions). - core-contraction-api doc: outer_product implementation path corrected. - ProjectedState structure bullets: conjugated reference state is the bra, RHS is the ket (matches the implementation and <ref|b> convention).
- Coverage job runs release llvm-cov (repository's normal verification mode); removes the debug-only profile env. CI-owned gate, local attestation per shared agent rules. - check-coverage.py gains --thresholds for isolated self-tests; test-check-coverage.py (5 tests) covers default/per-file/missing-file and _comment_* non-enforcement; wired into jobs.scripts. - coverage-thresholds.json adds _comment_* rationale clusters (no numeric changes) and pins the release-only dmrg deficit (72.4% vs 75) at 72 with rationale. - Local release measurement: 207/207 files pass.
The DeepSeek-backed LLM review is removed; the deterministic diff/section/rule checks (--dry-run) now run for every same-repo PR, and the maintainer waive label remains the only override. The rules-review:no-llm label machinery and DEEPSEEK secrets/vars are dropped. repository-rules-review.py keeps its local LLM capability for manual pre-PR use.
Each _comment_* cluster now states why release llvm-cov misses the path, the deterministic test/artifact that covers it, and when the exception can be removed; adds the planned _comment_hdf5 cluster and corrects the capi rationale (nextest exclusion belongs to the test job, not coverage). Also aligns the optional AGENTS.md coverage command with the release profile.
Repository rules reviewRepository rules review (928c567b922e52ea9809650cbe7bcf000d943d4f...8c4af5902b5abdde6d87d8f5a7804f3bec1d3e26) Verdict: pass Findings: - [warn] llm-skipped (External LLM Review) <unknown>: External LLM review was skipped Skipped by rules-review:no-llm label after maintainer review. |
The hosted runner measures docs/tutorial-code/src/qtt_interval_common.rs at 74.4% vs >=75 locally (long-running tutorial binaries vary by run); the tutorials are the deterministic artifact that exercises it. Pinned at 74 with a _comment_tutorial_code rationale, consistent with Task 12.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Completes Tasks 9–12 of issue #566 Phase 1 (gates and housekeeping) and
permanently removes the external LLM review from the review bot.
Task 9 — incremental public-error-doc and crate-boundary gates
scripts/check-public-error-docs.py(ported from tenferro-rs): auditspublic
ResultAPIs for concrete# Errorsdocs;--changed-from REVmode audits only added lines so the 392-item backlog burns down
incrementally. Handles multiline trait scope, commented braces/semicolons,
and multiline signature changes.
scripts/check-crate-boundaries.py: normaltenferro-*deps allowed onlyin tensorbackend plus exact temporary exception tuples (core/simplett/
tcicore/treetci); new tuples, unsanctioned crates, extra deps, stale
tuples, and removed exception crates fail. Dev-dependency cycles are
rejected with the full marked path. Stdlib-only parser (CI runner python3
is 3.10, so tomllib is unusable), including
[dependencies.x]sub-tables,target-specific tables, quoted keys, and package renames.
end_to_end_chain_tcibenchmoved to tensorci (which already depends on tcicore).
fetch-depth: 0, base-SHA resolution (PR base / push before; missingbase fails), self-tests, changed-from audit, repository-wide boundary
check. Self-tests: 15 + 13 cases.
Task 10 — runnable doctests and kryst removal
no_rundoctests replaced with runnable numericalassertions:
partial_contract(scalar = 11.0) andsquare_linsolve(two-site identity MPO with mappings, zero initial guess, residual < 1e-8
and solution reproduction).
krystdependency removed; stale "via kryst" claims now nametensor4all_core::krylov::gmres.square_linsolvenow rejects one-site systems with an explicit error(previously the two-site sweep planner silently returned the initial
guess); regression test added.
Task 11 — audited debris removal
debug.md,plan/(14 historical docs),coverage-local.json,and the orphan
internal/tenferro-internal-ad-linalgtest (outside allworkspace members, no references).
docs/design/treetn-linsolve-mpo.mdanddocs/design/core-contraction-api.md; linsolve diagnostics now point atthem.
Task 12 — release-mode coverage with documented rationale
cargo llvm-cov --release(the repository's normalverification mode); debug-only env removed.
check-coverage.pygains--thresholds;test-check-coverage.py(5cases) wired into CI.
coverage-thresholds.jsongained_comment_*rationale clusters statingwhy release llvm-cov misses each path, the covering test/artifact, and the
removal condition — no numeric thresholds changed. The only release-only
deficit (
treetn/dmrg/mod.rs, 72.4% vs 75) is pinned at 72 withrationale. Local release measurement: 207/207 files pass.
the shared agent rules (plan/design/AGENTS.md aligned; local llvm-cov no
longer required).
Review bot — external LLM review permanently removed
review_bot.ymldrops the DeepSeek-backed LLM review; the deterministic--dry-rundiff/rule checks run for every same-repo PR, therules-review:no-llmmachinery and DEEPSEEK secrets are gone, and themaintainer waive label remains the only override. The local script keeps
its optional LLM capability.
Validation (all green)
fmt, clippy
-D warnings, nextest release 2694/2694 (+10 skipped), hdf5 49,doctests 840, mdBook, cargo doc 0 errors, five Python self-tests, crate
boundary + incremental public-error-doc + repository-rules checks.
Per-task reviews
reviewer-gpt (GPT-5.6 Sol) reviewed Tasks 9, 10, 11, and the Task 12 +
review-bot round; all Blocking/Important findings fixed and re-verified.