Skip to content

fix(validation): preserve representable recovery metrics - #488

Draft
seonghobae wants to merge 855 commits into
fix/central-hourly-admission-contractfrom
fix/validation-bias-overflow-safe-mean
Draft

fix(validation): preserve representable recovery metrics#488
seonghobae wants to merge 855 commits into
fix/central-hourly-admission-contractfrom
fix/validation-bias-overflow-safe-mean

Conversation

@seonghobae

@seonghobae seonghobae commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Validation Evidence authority

#488 is the owner-correct Validation Evidence landing vehicle stacked on prerequisite #492@794ba9e6dda9f043aa499920fdf609b81b075d7e; protected release authority remains main@a243f18da4a4ca8a8d068c39922537f1f8ed6ad0. Current exact head is 520df488fd86ba48008af8ee5a2e112b4587fc22. The PR remains Draft/open/mergeable. No force update, destructive rebase, self-approval, gate weakening, coverage exclusion, mutable sibling dependency, copied provider routing, or copied generalized psychometric owner logic is used.

Current production route

Public validation_core::bias_standard_error attempts the checked O(n) neutral-zero exact proof for every n >= 3 with exactly represented finite residuals. The O(n²) pairwise reference is bounded to n <= 16 and is used only when the O(n) proof refuses. For n > 16, O(n) proof refusal delegates directly to the established bias implementation without quadratic pair allocation. n=2 retains its direct identity. Reusable generalized/static psychometric arithmetic remains fast-mlsirm-owned.

Resolved numerical lineage

The 64-bit production pointer-width contract is explicit; the former denominator-width branch was removed only after the successful u128 perfect-square proof made it impossible on that domain. docs/research/validation-bias-standard-error-seed-distance-bound.md owns the strict <3 adjacent-binary64 seed-distance theorem, and source applies exactly three exact corrections. The former correction-exhaustion terminal state was removed causally rather than excluded from coverage.

docs/research/validation-bias-dispersion-positivity-bound.md owns the exact-real general-path bound for every admitted n >= 3. Canonical translation contributes an exact zero and a maximum-magnitude normalized value x with 1 <= |x| < 2; the pairwise identity yields D = n Σy² - (Σy)² >= n x²/2 >= n/2. This does not yet prove the implemented floating result positive because square rounding, both compensated sums, usize -> f64, n*Q, and the final FMA must be bounded together.

Resource-admission and metric-cardinality boundary

docs/research/validation-bias-production-resource-admission.md records the owner split without changing production arithmetic. analysis_engine owns MAX_EVIDENCE_UNITS = 100_000 and rejects larger in-memory AnalysisCorpus values, but analysis_engine has no current validation_core dependency and AnalysisEvidenceUnit carries evidence identity/time/membership metadata rather than a truth/recovered numerical pair. There is therefore no current typed/versioned proof that one admitted evidence unit corresponds to one bias-SE sample, or that every supported product bias_standard_error call came through AnalysisCorpus.

Consequently 100_000 is not copied into validation_core, is not treated as a public-library sample cutoff, and is not used to delete either remaining fail-closed branch. A future buyer path must state and enforce the evidence-to-metric cardinality mapping before an Analysis Run population bound can narrow a bias-SE resource or forward-error proof.

The known helper false-zero source-domain witness still uses n = 2^54 = 18,014,398,509,481,984, minimum-subnormal q = 2^-1074, and M = 2^-1021. Its normalized SE is 2^-54; exact restoration is q/2, and ties-to-even produces represented zero. For scale only, 2^54 is about 1.8014398509481984e11 times 100_000, but that ratio is not admission evidence because evidence-unit cardinality is not metric-sample cardinality. Independently, materializing only the two public f64 input slices at n=2^54 requires 2^58 bytes = 288,230,376,151,711,744 bytes = 256 PiB before working storage. The branch is real; a giant fixture is not realistic product acceptance.

The next owner-correct step is to version the supported buyer call path and its cardinality contract, then derive product-bounded numerical/resource evidence without redefining the public library source domain.

Exact-head verification

Exact head 520df488fd86ba48008af8ee5a2e112b4587fc22 is documentation-only relative to 3b5d07b2e438edef9c529317d9dd09bd53451a92; the compare contains only docs/research/validation-bias-production-resource-admission.md and no production source or coverage-classifier input change.

Fresh exact-head workflows are terminal:

  • Documentation Quality 34573224170: GREEN.
  • Bias SE Exact-Proof Budget 34573224257: GREEN.
  • Rust Foundation 34573224268: RED only in Production line and branch coverage job 103179819615.
  • Live PostgreSQL 103179819441: GREEN.
  • Format/lint/test/rustdoc/dependency policy 103179819679: GREEN.
  • Repository/Python contracts + SBOM/provenance 103179819783: GREEN.

Fresh immutable artifacts for this exact head are:

  • line coverage artifact 10188730908, GitHub Actions archive digest sha256:f6c560819690274ad205baf77ec46089835d5563e7bbcb3d2f941fb532e63ff0;
  • branch coverage artifact 10188776666, GitHub Actions archive digest sha256:34006fb155957e34a86385cd9975340fa24bdb1950874c07e9d001e0070a1088.

The current line artifact has the same 42,005 source/line DA keys as predecessor 3b5d07b... and the same two zero-count records, bias.rs:69 and bias.rs:592. Because the exact-head delta is documentation-only and authored-line classifier inputs are unchanged, the product authored-source authority remains 12,344/12,346.

The current branch artifact has the same unique source-site set and the same covered/uncovered arm status as predecessor 3b5d07b...; only execution counts changed at 27 already-covered sites. The checked-in unique-site/per-arm-max fold remains 4,450/4,452, with missing TRUE outcomes at bias.rs (68,8)-(68,29) (0,12) and (591,8)-(591,35) (0,32). Raw LLVM/instrumented totals are not the product authored-source denominator.

Exact-head CodeRabbit review was retried after the earlier transient rate limit and completed on 520df488... with no findings in the requested resource/cardinality scope. The reviewer independently confirmed that the change is documentation-only, does not alter validation_core arithmetic/admission/fail-closed guards, does not reinterpret MAX_EVIDENCE_UNITS = 100_000 as a bias-SE sample-count contract, and leaves the n=2^54 false-zero witness and translated-dispersion floating-proof obligation intact. This is review evidence only, not numerical or scientific acceptance. Formal submitted reviews remain historical COMMENTED; current unresolved inline review threads are zero, so there is still no qualifying current-head approval.

Remaining numerical/resource obligations

  • bias.rs:68-69: scientifically/source-domain reachable but resource-extreme. Preserve the guard. Close product acceptance through an owner-correct bounded representation/resource/cardinality contract; do not add a giant fixture, arbitrary library cutoff, suppression, or denominator trick.
  • bias.rs:591-592: exact-real separation is D >= n/2; floating positivity remains unresolved. Remove the guard only after an implementation-matched absolute forward-error proof over the actual admitted metric-population domain or after a compact caller-valid counterexample becomes a deterministic regression.

Foundation / release boundary

#492 remains intentionally Draft at 794ba9e6dda9f043aa499920fdf609b81b075d7e. .github#2038 and contextual-orchestrator #1023/#1083 own the released orchestrator/free Actions gateway/auth/provenance path. TEPP must not copy unpublished provider routing/credentials/model selection or consume mutable contextual-orchestrator source as production authority.

Before protected merge, require one exact protected-ready head with owned-production 100% authored line+branch coverage, current Rust/security/documentation/review gates, code-current TRACEABILITY/product-technical-gap authority, normal foundation landing, immutable released dependency contracts, rollback/recovery/release evidence where applicable, and qualifying independent current-head review.

@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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.

@seonghobae seonghobae changed the title fix(validation): preserve representable extreme bias fix(validation): preserve representable recovery metrics Sep 3, 2026
seonghobae added a commit that referenced this pull request Sep 4, 2026
Non-force restack of PR #488 onto protected main after #490. Preserves the complete Validation Evidence lineage while inheriting the centralized hourly-development workflow unchanged.
seonghobae added a commit that referenced this pull request Sep 6, 2026
Refresh the checked-in operator register after the #488 root-cause rustdoc audit. Preserve protected-main and owner boundaries, distinguish hosted RED from proactive source-audit repair, and keep current exact-head queued checks from being promoted to GREEN.

Signed-off-by: Seongho Bae <me@seonghobae.me>
@seonghobae
seonghobae changed the base branch from main to fix/central-hourly-admission-contract September 7, 2026 02:28
@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

head='a063bd238ce838ea28e40e14151aeed8ea05cc2a'
bias='crates/validation_core/src/bias.rs'
numeric='crates/validation_core/src/numeric.rs'
bias_se='crates/validation_core/src/bias_se.rs'

echo '== Exact revision =='
git show -s --format='head=%H%nparents=%P%nsubject=%s' "$head"

echo '== Symbol maps =='
ast-grep outline "$bias" --items all --type function,impl,struct,enum
ast-grep outline "$numeric" --items all --type function,impl,struct,enum
ast-grep outline "$bias_se" --items all --type function,impl,struct,enum

echo '== bias.rs translated route and dispersion predicate =='
git show "${head}:${bias}" | nl -ba | sed -n '1,240p'
git show "${head}:${bias}" | nl -ba | sed -n '360,820p'

echo '== numeric.rs accumulator and ordering implementation =='
git show "${head}:${numeric}" | nl -ba | sed -n '1,290p'

echo '== Exact route helpers and callers =='
git grep -n -C 18 -E \
  '\b(canonical_exact_translated_residuals|exact_translated_residual_standard_error|scaled_standard_error|standard_error_from_deviations|deterministic_compensated_sum|dispersion_numerator|exact_two_level_rational_scale|exact_three_level|bias_standard_error)\s*\(' \
  "$head" -- crates/validation_core/src/bias.rs crates/validation_core/src/bias_se.rs crates/validation_core/src/numeric.rs

echo '== Tests that exercise translated or generic bias standard-error paths =='
git ls-tree -r --name-only "$head" -- crates/validation_core/tests crates/validation_core/src |
  grep -Ei '(bias.*(translated|dispersion|standard.error|three.level|two.level|large|false.zero)|translated.*bias)' |
  sort |
  while IFS= read -r file; do
    echo "----- $file -----"
    git show "${head}:${file}" | nl -ba
  done

echo '== Target/count/admission checks =='
git grep -n -C 10 -E \
  '(usize::BITS|len\(\)|isize::MAX|u64::MAX|try_reserve|with_capacity|sample_count)' \
  "$head" -- crates/validation_core/src/bias.rs crates/validation_core/src/bias_se.rs crates/validation_core/src/numeric.rs crates/validation_core/src/lib.rs

Length of output: 2573


The first inspection stopped at an unsupported ast-grep type. I will rerun it with compatible commands.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

The prior response to comment 5628092414 stopped before the requested numerical analysis because the symbol-outline command used an unsupported ast-grep type. Please rerun the same exact-head a063bd238ce838ea28e40e14151aeed8ea05cc2a line-591 reachability task without that outline command; plain git show/rg/small independent arithmetic scripts are sufficient. Return only a proof/counterexample conclusion tied to the actual canonical-anchor, normalization, sorted-Neumaier and FMA computation order. The same restrictions remain: no coverage suppression, giant fixture, arbitrary sample cutoff, fail-closed weakening, or LLM-as-authority claim.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

head='a063bd238ce838ea28e40e14151aeed8ea05cc2a'
bias='crates/validation_core/src/bias.rs'
numeric='crates/validation_core/src/numeric.rs'
bias_se='crates/validation_core/src/bias_se.rs'

echo '== Exact revision =='
git show -s --format='head=%H%nparents=%P%nsubject=%s' "$head"

echo '== bias.rs: translated route, moment calculation, and public route =='
git show "${head}:${bias}" | nl -ba | sed -n '1,220p'
git show "${head}:${bias}" | nl -ba | sed -n '360,820p'

echo '== numeric.rs: ordering and compensated accumulator =='
git show "${head}:${numeric}" | nl -ba | sed -n '1,300p'

echo '== bias_se.rs: exact-proof route and its refusal conditions =='
git show "${head}:${bias_se}" | nl -ba | sed -n '330,490p'

echo '== Relevant definitions and call sites =='
git grep -n -C 14 -E \
  '\b(canonical_exact_translated_residuals|exact_translated_residual_standard_error|scaled_standard_error|standard_error_from_deviations|deterministic_compensated_sum|dispersion_numerator|exact_two_level_rational_scale|exact_three_level|bias_standard_error)\s*\(' \
  "$head" -- "$bias" "$numeric" "$bias_se" || true

echo '== Relevant contracts and tests =='
git ls-tree -r --name-only "$head" -- crates/validation_core/tests |
  grep -Ei '(bias.*(translated|dispersion|standard.error|three.level|two.level|large|false.zero)|translated.*bias)' |
  sort |
  while IFS= read -r file; do
    echo "----- $file -----"
    git show "${head}:${file}" | nl -ba
  done

echo '== Exact computation-order fragments =='
git show "${head}:${bias}" | nl -ba |
  rg -n -C 18 \
  'canonical_exact_translated_residuals|deterministic_compensated_sum|mul_add|dispersion_numerator|scale|translation|two_level|three_level' || true
git show "${head}:${numeric}" | nl -ba |
  rg -n -C 18 'deterministic_compensated_sum|total_cmp|sort|correction|mul_add' || true

Length of output: 130162


🏁 Script executed:

#!/bin/bash
set -euo pipefail

head='a063bd238ce838ea28e40e14151aeed8ea05cc2a'

echo '== Exact translation helper =='
git show "${head}:crates/validation_core/src/bias.rs" | nl -ba | sed -n '405,615p'

echo '== Public route before exact translation =='
git show "${head}:crates/validation_core/src/bias.rs" | nl -ba | sed -n '700,760p'

echo '== Exact neutral-zero proof entry and refusal path =='
git show "${head}:crates/validation_core/src/bias_se.rs" | nl -ba | sed -n '340,450p'

echo '== Accumulator implementation only =='
git show "${head}:crates/validation_core/src/numeric.rs" | nl -ba | sed -n '1,55p'

echo '== Small exact binary64 state search for canonical three-level patterns =='
python3 - <<'PY'
import math
import struct

def bits(x):
    return struct.unpack(">Q", struct.pack(">d", x))[0]

def neumaier(values):
    values = sorted(values)
    total = 0.0
    correction = 0.0
    for value in values:
        nxt = total + value
        if abs(total) >= abs(value):
            correction += (total - nxt) + value
        else:
            correction += (value - nxt) + total
        total = nxt
    return total + correction, total, correction

# Search materializable prefixes for a pattern that can enter the generic
# three-level route after canonical translation: [-a, 0, b repeated].
# This search is evidence only. It prints every nonpositive fused result.
for a in [2.0**-k for k in range(1, 25)] + [0.5, 0.75, 1.0]:
    for b in [0.5, 0.75, 1.0, 1.25]:
        if not (0.0 < a < 2.0 and 0.0 < b < 2.0):
            continue
        for count in [4, 8, 16, 32, 128, 1024, 8192, 65536, 1_000_000]:
            values = [-a, 0.0] + [b] * (count - 2)
            s, st, sc = neumaier(values)
            q, qt, qc = neumaier([x*x for x in values])
            d = math.fma(-s, s, float(count) * q) if hasattr(math, "fma") else float(count)*q-s*s
            if d <= 0.0:
                print("nonpositive", a, b, count, bits(s), bits(q), bits(d), st, sc, qt, qc)
                raise SystemExit
print("No nonpositive fused result in the materializable pattern search.")

# Print the large-N state transition facts for exact unit repeated terms.
# At 2^53, ties-to-even makes further +1 additions leave each component
# unchanged. This validates the saturation premise used in the prior candidate.
print("float(2^53 + 1) == 2^53:", float(2**53 + 1) == float(2**53))
print("float(2^54 + 1) == 2^54:", float(2**54 + 1) == float(2**54))
PY

Length of output: 23778


@seonghobae I cannot establish either required result for exact head a063bd238ce838ea28e40e14151aeed8ea05cc2a.

I found no valid compressed counterexample for crates/validation_core/src/bias.rs Line 591.

I also cannot prove that the true outcome is unreachable on the complete supported 64-bit caller domain.

The source confirms these facts:

  • translated_residuals_from_anchor rejects an anchor when any high delta, low delta, or recombined delta has subtraction roundoff.
  • canonical_exact_translated_residuals selects a valid anchor with minimum maximum translated magnitude.
  • The generic path normalizes with an exact power-of-two scale.
  • The generic path rejects any nonzero translated value that normalizes to zero.
  • deterministic_compensated_sum sorts by f64::total_cmp and uses a two-component Neumaier accumulator.
  • The first moment and second moment accumulate independently.
  • (-normalized_sum).mul_add(normalized_sum, scaled_square_sum) performs one fused final subtraction. It cannot restore mass that either accumulator lost before the FMA.

The prior n = 2^55 family remains falsified. Canonical translation selects the 0.5 anchor. Normalization then produces [-1, 0, +1, …, +1]. The sorted Neumaier accumulators return:

[
\texttt{normalized_sum} = 2^{54},
\qquad
\texttt{normalized_square_sum} = 2^{54}.
]

The FMA therefore produces:

[
2^{55}\cdot2^{54} - (2^{54})^2 = 2^{108} > 0.
]

The small three-level pattern search found no nonpositive fused result. This does not prove the result for all admitted usize counts or all represented translated geometries.

A complete unreachability proof needs a bound that relates the two independently rounded Neumaier results to the exact first and second moments strongly enough to preserve strict positivity of:

[
nQ-S^2
]

after the actual accumulation and FMA order. The inspected code does not provide that bound. The current evidence also does not provide a source-domain counterexample that survives exact translation, canonical-anchor selection, normalization, and the preceding exact two-level and three-level paths.

The fail-closed guard at Line 591 should remain.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Exact-head review request for 71c42ddd2c4087b027f977192fe2d7f87b24d931. Please focus on docs/research/validation-bias-se-normal-seed-derivation.md against the actual crates/validation_core/src/bias_se.rs contract: verify the binary64 cast/division/sqrt/power-of-two-scaling preconditions, the normal/subnormal spacing argument, the strict <3 representable-step bound, and the conclusion that the current four-pass correction loop's terminal None is unreachable under those stated preconditions. Please flag any source path where the derivation's preconditions are not enforced. Do not treat the derivation as resolving the separate bias.rs translated-dispersion or resource-extreme false-zero obligations.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo='ContextualWisdomLab/TEPP'
head='71c42ddd2c4087b027f977192fe2d7f87b24d931'
doc='docs/research/validation-bias-se-normal-seed-derivation.md'
src='crates/validation_core/src/bias_se.rs'
parent="$(git show -s --format=%P "$head" | awk '{print $1}')"

echo '== Exact revision =='
git show -s --format='head=%H%nparents=%P%nsubject=%s%ncommit_date=%cI' "$head"
git rev-parse HEAD

echo '== Changed paths and focused delta =='
git diff --name-status "$parent" "$head"
git diff --find-renames --unified=100 "$parent" "$head" -- "$doc" "$src"

echo '== Complete derivation =='
git show "${head}:${doc}" | nl -ba

echo '== Rounder and exact comparison helpers =='
git show "${head}:${src}" | nl -ba | sed -n '150,335p'

echo '== Caller, admission bounds, and public route =='
git show "${head}:${src}" | nl -ba | sed -n '335,500p'

echo '== All rounder call sites and relevant guards =='
git grep -n -C 20 -E \
  '\b(correctly_rounded_scaled_sqrt_ratio|exact_pair_distance_standard_error|exact_power_of_two|compare_scaled_ratio_to_dyadic_square|neighbor_is_closer)\s*\(|denominator.*(1_u128 << 53|2\^53)|unit_exponent|candidate.*is_finite' \
  "$head" -- "$src" 'crates/validation_core/src/*.rs' 'crates/validation_core/tests/*.rs' || true

echo '== Relevant boundary and derivation tests =='
git ls-tree -r --name-only "$head" -- crates/validation_core/tests crates/validation_core/src docs/research |
  rg '(bias.*(round|sqrt|ratio|dyadic|midpoint|subnormal|overflow|boundary)|normal-seed-derivation)' |
  sort |
  while IFS= read -r file; do
    echo "----- $file -----"
    git show "${head}:${file}" | nl -ba
  done

echo '== Exact-head check state =='
gh api "repos/${repo}/commits/${head}/check-runs?per_page=100" \
  --jq '.check_runs[] | {name,status,conclusion,details_url,completed_at}' || true

Length of output: 2736


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo='ContextualWisdomLab/TEPP'
head='71c42ddd2c4087b027f977192fe2d7f87b24d931'
doc='docs/research/validation-bias-standard-error-seed-distance-bound.md'
src='crates/validation_core/src/bias_se.rs'
parent='a063bd238ce838ea28e40e14151aeed8ea05cc2a'

echo '== Exact documentation delta =='
git diff --find-renames --unified=120 "$parent" "$head" -- "$doc" \
  CHANGELOG.d/validation-bias-standard-error-seed-distance-bound.md

echo '== Complete derivation =='
git show "${head}:${doc}" | nl -ba

echo '== Exact rounder and comparison implementation =='
git show "${head}:${src}" | nl -ba | sed -n '150,335p'

echo '== Exact caller and route implementation =='
git show "${head}:${src}" | nl -ba | sed -n '335,500p'

echo '== Relevant source predicates and call contexts =='
git grep -n -C 18 -E \
  '\b(correctly_rounded_scaled_sqrt_ratio|exact_pair_distance_standard_error|exact_power_of_two|compare_scaled_ratio_to_dyadic_square|neighbor_is_closer)\s*\(|denominator.*(1_u128 << 53|2\^53)|unit_exponent|candidate.*is_finite|candidate == 0\.0' \
  "$head" -- crates/validation_core/src crates/validation_core/tests || true

echo '== Tests covering rounder endpoints and correction behavior =='
git ls-tree -r --name-only "$head" -- crates/validation_core |
  rg '(bias.*(round|sqrt|ratio|dyadic|midpoint|subnormal|overflow|boundary|standard.error))' |
  sort |
  while IFS= read -r file; do
    echo "----- $file -----"
    git show "${head}:${file}" | nl -ba
  done

echo '== Current exact-head checks =='
gh api "repos/${repo}/commits/${head}/check-runs?per_page=100" \
  --jq '.check_runs[] | {name,status,conclusion,details_url,completed_at}' || true

Length of output: 119545


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo='ContextualWisdomLab/TEPP'
head='71c42ddd2c4087b027f977192fe2d7f87b24d931'
doc='docs/research/validation-bias-standard-error-seed-distance-bound.md'
src='crates/validation_core/src/bias_se.rs'

echo '== Derivation =='
git show "${head}:${doc}" | nl -ba

echo '== Source Lines 150-335 =='
git show "${head}:${src}" | nl -ba | sed -n '150,335p'

echo '== Source Lines 335-455 =='
git show "${head}:${src}" | nl -ba | sed -n '335,455p'

echo '== Exact named symbol locations =='
git show "${head}:${src}" | nl -ba | rg \
  'fn (correctly_rounded_scaled_sqrt_ratio|compare_scaled_ratio_to_dyadic_square|neighbor_is_closer|exact_power_of_two|exact_pair_distance_standard_error|exact_neutral_zero_linear_pair_square_sum)|pub fn bias_standard_error'

echo '== Failed coverage job conclusion =='
gh run view 34557236172 --repo "$repo" --log-failed 2>&1 | \
  rg -n -i -C 4 \
  'error|fail|coverage|bias_se\.rs:307|bias\.rs:(68|69|591|592)|authored|branch|line' \
  | tail -n 400 || true

Length of output: 28879


@seonghobae Review complete for exact head 71c42ddd2c4087b027f977192fe2d7f87b24d931.

I found no finding in the requested scope.

The requested path is not present at this head. The added derivation is docs/research/validation-bias-standard-error-seed-distance-bound.md. It matches the stated scope.

  • correctly_rounded_scaled_sqrt_ratio enforces the derivation preconditions.

    • Line 242 rejects zero numerator, zero denominator, and denominator > 2^53.
    • Line 245 accepts only an exactly represented power-of-two unit from exact_power_of_two.
    • Line 252 rejects a non-finite or non-positive post-restoration candidate.
    • The caller at Lines 430-452 rejects a zero exact pair numerator before invoking the rounder and constructs the denominator with checked arithmetic.
  • The binary64 rounding model in the derivation is consistent with the seed expression at Line 251.

    • denominator as f64 is exact under the Line 242 bound.
    • A positive u128 numerator converts to a finite nearest binary64 seed.
    • The unscaled ratio is in [2^-53, 2^128), so its division and square root are normal.
    • exact_power_of_two admits only exponents from -1074 through 1023.
  • The normal-spacing argument is sufficient.

    • With (u = 2^{-53}), the three pre-restoration roundings give (\alpha = 2u + u^2).
    • This gives a seed error of less than (2 + u < 3) local spacings.
    • After the final correctly-rounded target interval is included, the discrete seed-to-result distance is at most two adjacent binary64 values. A three-value separation is excluded.
  • The subnormal argument is also sufficient.

    • Near the normal/subnormal boundary, the pre-restoration displacement is less than about one minimum-subnormal quantum.
    • Power-of-two restoration contributes at most one-half quantum.
    • Final target rounding contributes at most one-half quantum.
    • The total is strictly below three quanta. Therefore, the candidate and correctly rounded positive result differ by at most two adjacent binary64 values.
  • The loop behavior matches the derivation.

    • Lines 259-265 compare the candidate square with the exact scaled rational target.
    • Lines 283-291 compare the exact adjacent midpoint.
    • Lines 293-305 either return the correct result or move exactly one adjacent value toward it.
    • If the initial distance is at most two, two advancing passes and one decision pass suffice. The current four passes remain conservative.
  • The boundary cases remain fail closed.

    • A zero restoration is rejected at Line 252.
    • A downward move from the minimum positive subnormal is rejected at Lines 275-277.
    • An upward move that requires infinity is rejected at Lines 272-281.
    • These are explicit lower and upper boundary refusals. They do not reach the terminal None at Line 307.

Therefore, Line 307 is unreachable as correction-loop exhaustion when the documented preconditions hold and the exact target has a positive finite correctly rounded result. Keeping the terminal None remains appropriate as defense against a future violation of those conditions.

The derivation correctly limits its claim. It does not resolve the separate bias.rs translated-dispersion predicate or the resource-extreme helper false-zero path.

Exact-head format, lint, test, rustdoc, dependency-policy, repository-contract, PostgreSQL, governance, and release resource-evidence checks are GREEN. Production coverage is RED at 12,341/12,344 authored lines and 4,450/4,452 branch arms.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

Correction to the review request above: the exact file added at 71c42ddd2c4087b027f977192fe2d7f87b24d931 is docs/research/validation-bias-standard-error-seed-distance-bound.md (not the misnamed path in the prior comment). Please review that file against crates/validation_core/src/bias_se.rs.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review exact head 5d801fdb8245fb8b7a109f23553f882b1a277d75 only. Focus on the Validation Evidence numerical change in crates/validation_core/src/bias_se.rs and its repository-owned derivation in docs/research/validation-bias-standard-error-seed-distance-bound.md.

The intended causal repair is narrow: the prior four-pass loop ended in a scientifically unreachable production None under the already-documented <3 adjacent-binary64 seed-distance theorem. The new helper performs one exact square/midpoint correction that either keeps the candidate or advances exactly one adjacent value; three fixed applications are bounded and idempotent once correctly rounded. Please verify that this preserves roundTiesToEven, normal/subnormal and max-finite refusal boundaries, does not turn the floating seed into numerical authority, and does not widen the admitted numerator/denominator/unit contract. Also flag any flaw in the power-of-two-boundary argument or any new line/branch coverage obligation introduced by the refactor. Do not treat predecessor checks or coverage artifacts as current-head evidence.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo='ContextualWisdomLab/TEPP'
head='5d801fdb8245fb8b7a109f23553f882b1a277d75'
src='crates/validation_core/src/bias_se.rs'
doc='docs/research/validation-bias-standard-error-seed-distance-bound.md'
parent="$(git show -s --format=%P "$head" | awk '{print $1}')"

echo '== Exact revision =='
git show -s --format='head=%H%nparents=%P%nsubject=%s%ncommit_date=%cI' "$head"
echo '== Checkout revision =='
git rev-parse HEAD

echo '== Parent-to-head changed paths =='
git diff --name-status "$parent" "$head"

echo '== Focused production and derivation diff =='
git diff --find-renames --unified=140 "$parent" "$head" -- \
  "$src" \
  "$doc" \
  'crates/validation_core/tests/*.rs' \
  'CHANGELOG.d/*.md'

echo '== Current derivation =='
git show "${head}:${doc}" | nl -ba

echo '== Current rounder, correction helper, and exact comparison helpers =='
git show "${head}:${src}" | nl -ba | sed -n '140,345p'

echo '== Current caller, admission checks, and public route =='
git show "${head}:${src}" | nl -ba | sed -n '345,500p'

echo '== Exact relevant symbol locations and call contexts =='
git grep -n -C 20 -E \
  '\b(correctly_rounded_scaled_sqrt_ratio|correct_|neighbor_is_closer|adjacent_midpoint|compare_scaled_ratio_to_dyadic_square|exact_power_of_two|exact_pair_distance_standard_error)\s*\(' \
  "$head" -- crates/validation_core/src crates/validation_core/tests || true

echo '== Changed and related test sources =='
git diff --name-only "$parent" "$head" -- 'crates/validation_core/tests/*.rs' |
while IFS= read -r file; do
  echo "----- ${file} -----"
  git show "${head}:${file}" | nl -ba
done
git ls-tree -r --name-only "$head" -- crates/validation_core/tests crates/validation_core/src |
  rg '(bias.*(round|sqrt|ratio|dyadic|midpoint|subnormal|overflow|boundary|standard.error))' |
  sort |
  while IFS= read -r file; do
    echo "----- ${file} -----"
    git show "${head}:${file}" | nl -ba
  done

echo '== Exact-head check runs only =='
gh api "repos/${repo}/commits/${head}/check-runs?per_page=100" \
  --jq '.check_runs[] | {name,status,conclusion,details_url,completed_at}' || true

echo '== Exact-head combined status only =='
gh api "repos/${repo}/commits/${head}/status" \
  --jq '{state, statuses:[.statuses[]|{context,state,target_url,updated_at}]}' || true

Length of output: 120369


🏁 Script executed:

#!/bin/bash
set -euo pipefail

head='5d801fdb8245fb8b7a109f23553f882b1a277d75'
parent="$(git show -s --format=%P "$head" | awk '{print $1}')"
src='crates/validation_core/src/bias_se.rs'
doc='docs/research/validation-bias-standard-error-seed-distance-bound.md'
log='/tmp/coderabbit-shell-logs/shell-output-0tWITz'

echo '== Focused-section index from prior log =='
rg -n '^== (Exact revision|Parent-to-head changed paths|Focused production and derivation diff|Current derivation|Current rounder|Current caller|Exact relevant symbol|Changed and related)' "$log" || true

echo '== Direct parent-to-head changed files =='
git diff --name-status "$parent" "$head"

echo '== Complete focused diff =='
git diff --find-renames --unified=180 "$parent" "$head" -- \
  "$src" "$doc" 'crates/validation_core/tests/*.rs' 'CHANGELOG.d/*.md'

echo '== Exact relevant source, compact range =='
git show "${head}:${src}" | nl -ba | sed -n '185,335p'

echo '== Exact rounder caller preconditions =='
git show "${head}:${src}" | nl -ba | sed -n '400,465p'

echo '== Exact derivation, compact range =='
git show "${head}:${doc}" | nl -ba | sed -n '1,260p'

echo '== Named correction-related definitions =='
git show "${head}:${src}" | nl -ba | rg -n -C 12 \
  'fn (correctly_rounded_scaled_sqrt_ratio|correct_|neighbor_is_closer|adjacent_midpoint|compare_scaled_ratio_to_dyadic_square|exact_power_of_two)'

echo '== Tests added or changed by this exact commit =='
git diff --name-only "$parent" "$head" -- 'crates/validation_core/tests/*.rs' |
while IFS= read -r file; do
  echo "----- ${file} -----"
  git show "${head}:${file}" | nl -ba
done

echo '== Branches in changed production hunk =='
git diff --unified=0 "$parent" "$head" -- "$src" |
rg -n -C 4 '^\+.*\b(if|else|match|return|then_some|ok_or|&&|\|\|)\b|^\-.*\b(if|else|match|return|then_some|ok_or|&&|\|\|)\b' || true

Length of output: 40934


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo='ContextualWisdomLab/TEPP'
head='5d801fdb8245fb8b7a109f23553f882b1a277d75'
src='crates/validation_core/src/bias_se.rs'
doc='docs/research/validation-bias-standard-error-seed-distance-bound.md'

echo '== Recent first-parent ancestry at the requested head =='
git log --first-parent --format='%H %P %s' -n 12 "$head"

echo '== Commit that introduced the current correction helper =='
introducer="$(git log --format='%H' -S'fn correct_scaled_sqrt_ratio_candidate(' "$head" -- "$src" | head -n 1)"
printf 'introducer=%s\n' "$introducer"
if [ -n "$introducer" ]; then
  introducer_parent="$(git show -s --format=%P "$introducer" | awk '{print $1}')"
  git show -s --format='commit=%H%nparent=%P%nsubject=%s' "$introducer"
  git diff --name-status "$introducer_parent" "$introducer"
  git diff --find-renames --unified=100 "$introducer_parent" "$introducer" -- \
    "$src" 'crates/validation_core/tests/*.rs' "$doc"
fi

echo '== Current helper control-flow and all callers =='
git show "${head}:${src}" | nl -ba | sed -n '225,330p'
git grep -n -C 18 \
  'correct_scaled_sqrt_ratio_candidate(' "$head" -- crates/validation_core/src crates/validation_core/tests || true

echo '== Exact arithmetic checks for published boundary constants =='
python3 - <<'PY'
from fractions import Fraction

u = Fraction(1, 2**53)
alpha = 2*u + u*u
eta = Fraction(1, 2**1074)
m = 2**52 * eta

print("alpha =", alpha)
print("alpha == 2^-52 + 2^-106:", alpha == Fraction(1, 2**52) + Fraction(1, 2**106))
print("alpha*(2^52+2) =", alpha * (2**52 + 2))
print("alpha*(2^52+2) < 1.000000000000002:", alpha * (2**52 + 2) < Fraction(1000000000000002, 10**15))
print("subnormal total in eta units < 3:",
      alpha * (2**52 + 2) + 1 < 3)
print("normal interior coarse distance in smaller local ulps < 3:",
      alpha * 2**53 + Fraction(1, 2) < 3)

# At an exact normal power-of-two B, let h be the lower spacing.
# The upper spacing is 2h. The relative envelope times B/h equals alpha*2^52.
# This records the strict bound before final correct rounding.
print("power-boundary seed displacement in lower-spacing units < 2:",
      alpha * 2**52 < 2)
print("power-boundary seed displacement in upper-spacing units < 1:",
      alpha * 2**51 < 1)
PY

echo '== Exact-head checks now =='
gh api "repos/${repo}/commits/${head}/check-runs?per_page=100" \
  --jq '.check_runs[] | {name,status,conclusion,details_url,completed_at}' || true

Length of output: 33271


@seonghobae Review complete for exact head 5d801fdb8245fb8b7a109f23553f882b1a277d75.

I found no finding in the requested scope.

The numerical refactor was introduced by parent commit cea2d9e39b87644263bba29be2c524caea3e943d. The direct 5d801f... delta updates only docs/research/validation-bias-standard-error-seed-distance-bound.md. The document now correctly binds the derivation to the current three-application correction structure.

  • correct_scaled_sqrt_ratio_candidate does not use the floating seed as acceptance authority. It compares the candidate square and adjacent midpoint square against the exact scaled rational target through Wide256.
  • The helper preserves roundTiesToEven. On an exact midpoint, it advances only when candidate.to_bits() & 1 == 1. Adjacent positive binary64 values have opposite low-bit parity. This selects the even result for both upward and downward corrections.
  • The lower boundary remains fail closed. If the target is below the minimum positive subnormal and correction would move downward from bit pattern 1, the helper returns None.
  • The upper boundary remains fail closed. If correction would advance from f64::MAX to infinity, neighbor.is_finite() fails and the helper returns None.
  • The initial restoration boundary remains fail closed. correctly_rounded_scaled_sqrt_ratio rejects a non-finite or non-positive seed before correction.
  • The numerator, denominator, and unit contract is unchanged. The function still requires numerator > 0, 0 < denominator <= 2^53, and a representable power-of-two unit from exact_power_of_two.

The derivation supports the fixed bound.

  • It gives alpha = 2^-52 + 2^-106 for the unscaled relative seed error.
  • The normal interior bound is strictly below three local spacing units after the final rounding interval is included.
  • At a normal power-of-two boundary, the seed displacement is strictly below two lower-spacing units and strictly below one upper-spacing unit. The asymmetric predecessor interval does not permit a three-neighbor separation.
  • At the normal/subnormal boundary, the documented bound plus restoration rounding and final target rounding remains strictly below three subnormal quanta.
  • Therefore, the initial seed is fewer than three represented neighbors from the correctly rounded finite result. At most two applications advance. The third application is idempotent.

The refactor removes the former correction-exhaustion path. It introduces no new numerical admission branch. It retains the existing exact-comparison, lower-boundary, and upper-boundary branch obligations in the extracted helper. The exact-head Production line and branch coverage job is still in progress, so coverage completion is not yet verified.

Exact-head repository contracts, governance, Live PostgreSQL, and release resource-evidence checks are GREEN. The exact-head format, lint, test, rustdoc, dependency-policy job is also still in progress.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Exact-head review scope: bae124c21183ca0905305b8a9c4840d69bd77c19 only. Please verify the new docs/research/validation-bias-dispersion-positivity-bound.md derivation, especially D >= n x² / 2 >= n / 2, its stated preconditions, and that it does not overclaim floating-path positivity or authorize removal of the dispersion_numerator <= 0.0 fail-closed guard. Also verify the Higham/Ogita/Rump references are used as research anchors rather than silently imported as a theorem for TEPP's specific sorted compensated implementation.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo='ContextualWisdomLab/TEPP'
head='bae124c21183ca0905305b8a9c4840d69bd77c19'
doc='docs/research/validation-bias-dispersion-positivity-bound.md'
bias='crates/validation_core/src/bias.rs'
parent="$(git show -s --format=%P "$head" | awk '{print $1}')"

echo '== Exact revision =='
git show -s --format='head=%H%nparents=%P%nsubject=%s%ncommit_date=%cI' "$head"
echo '== Direct changed paths =='
git diff --name-status "$parent" "$head"
echo '== Exact document delta =='
git diff --find-renames --unified=160 "$parent" "$head" -- "$doc"
echo '== Complete exact document =='
git show "${head}:${doc}" | nl -ba
echo '== Production translation, normalization, moments, and guard =='
git show "${head}:${bias}" | nl -ba | sed -n '400,630p'
echo '== Public routing into translated path =='
git show "${head}:${bias}" | nl -ba | sed -n '690,785p'
echo '== Exact relevant source locations =='
git grep -n -C 14 -E \
  '\b(canonical_exact_translated_residuals|translated_residuals_from_anchor|deterministic_compensated_sum|dispersion_numerator|mul_add|exact_two_level_rational_scale|exact_three_level|exact_translated_residual_standard_error)\b' \
  "$head" -- "$bias" crates/validation_core/src/numeric.rs || true
echo '== Reference and claim language in document =='
git show "${head}:${doc}" | nl -ba | rg -n -i -C 5 \
  'Higham|Ogita|Rump|Oishi|theorem|proof|round|float|floating|guard|remove|nonpositive|positiv|D[[:space:]]*=|n[[:space:]]*/[[:space:]]*2|canonical|precondition|assum' || true
echo '== Exact-head check runs =='
gh api "repos/${repo}/commits/${head}/check-runs?per_page=100" \
  --jq '.check_runs[] | {name,status,conclusion,details_url,completed_at}' || true

Length of output: 98406


@seonghobae I found one documentation-scope finding at exact head bae124c21183ca0905305b8a9c4840d69bd77c19.

  • docs/research/validation-bias-dispersion-positivity-bound.md Line 14 limits the exact-real theorem to n >= 4.
  • crates/validation_core/src/bias.rs Lines 554-563 show that an n = 3 translated sample can continue into the general moment path when exact_three_level_standard_error returns None.
  • Therefore, the note does not cover all inputs that can reach dispersion_numerator <= 0.0 at Line 591, despite Line 5 describing the remaining general translated-path obligation.

The stated pair argument also works for n = 3. There is one pair (0, x) and one remaining value z. The selected terms give:

[
D \ge x^2 + \frac{x^2}{2}
= \frac{3x^2}{2}
\ge \frac{3}{2}.
]

Change the theorem precondition from n >= 4 to n >= 3. This preserves the proof and aligns the note with the production route. It does not change production arithmetic or the fail-closed guard.

I found no other finding in the requested scope.

  • The derivation correctly uses canonical translation to obtain an exact zero. It uses the leading-binade power-of-two scale to establish (1 \le |x| < 2).
  • The selected pairs are disjoint. The identity and the bound (D \ge n x^2 / 2 \ge n / 2) are correct on the corrected n >= 3 domain.
  • Lines 53-64 explicitly limit the result to exact-real dispersion. They identify the actual rounded square, separate compensated sums, usize -> f64 conversion, n * Q, and final FMA stages.
  • Lines 78-83 do not authorize removal of dispersion_numerator <= 0.0. They require either an implementation-matched forward-error bound or a compact caller-valid counterexample.
  • Lines 66-74 correctly present Higham, Ogita, Rump, and Oishi as research anchors. The note explicitly rejects importing their results as a theorem for this specific sorted Neumaier implementation.

Exact-head verification remains incomplete. The format/lint/test/rustdoc/dependency-policy, production coverage, and repository/Python coverage jobs are queued. Governance, Live PostgreSQL, and release resource-evidence checks are successful.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Exact-head review scope: 3b5d07b2e438edef9c529317d9dd09bd53451a92 only. Please verify the repaired docs/research/validation-bias-dispersion-positivity-bound.md scope now covers every admitted general translated-path n >= 3, including n=3 after exact_three_level_standard_error declines admission; verify D >= n x² / 2 >= n / 2 from the exact-zero anchor and maximum normalized x; and confirm the note still does not overclaim floating-path positivity or authorize removal of dispersion_numerator <= 0.0. Treat Higham/Ogita/Rump only as research anchors unless an implementation-matched derivation is present.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo='ContextualWisdomLab/TEPP'
head='3b5d07b2e438edef9c529317d9dd09bd53451a92'
doc='docs/research/validation-bias-dispersion-positivity-bound.md'
bias='crates/validation_core/src/bias.rs'
parent="$(git show -s --format=%P "$head" | awk '{print $1}')"

echo '== Exact revision =='
git show -s --format='head=%H%nparents=%P%nsubject=%s%ncommit_date=%cI' "$head"
echo '== Checked-out revision =='
git rev-parse HEAD

echo '== Direct changed paths and document delta =='
git diff --name-status "$parent" "$head"
git diff --find-renames --unified=180 "$parent" "$head" -- "$doc"

echo '== Complete document at exact head =='
git show "${head}:${doc}" | nl -ba

echo '== Production translated route, shortcuts, normalization, and guard =='
git show "${head}:${bias}" | nl -ba | sed -n '400,635p'

echo '== Public route into the translated path =='
git show "${head}:${bias}" | nl -ba | sed -n '690,790p'

echo '== Relevant production definitions and call contexts =='
git grep -n -C 16 -E \
  '\b(canonical_exact_translated_residuals|translated_residuals_from_anchor|exact_three_level_standard_error|exact_two_level_rational_scale|deterministic_compensated_sum|dispersion_numerator|mul_add|exact_translated_residual_standard_error)\s*\(' \
  "$head" -- "$bias" crates/validation_core/src/numeric.rs crates/validation_core/src/bias_se.rs || true

echo '== Document claim and reference language =='
git show "${head}:${doc}" | nl -ba | rg -n -i -C 6 \
  'n[[:space:]]*(>=|>|<=|=)[[:space:]]*[0-9]+|D[[:space:]]*=|n[[:space:]]*/[[:space:]]*2|canonical|exact.real|float|floating|round|guard|remove|Higham|Ogita|Rump|Oishi|theorem|precondition|admission' || true

echo '== Exact-head check runs =='
gh api "repos/${repo}/commits/${head}/check-runs?per_page=100" \
  --jq '.check_runs[] | {name,status,conclusion,details_url,completed_at}' || true

Length of output: 118932


@seonghobae Review complete for exact head 3b5d07b2e438edef9c529317d9dd09bd53451a92.

I found no finding in the requested scope.

  • This commit changes only docs/research/validation-bias-dispersion-positivity-bound.md.
  • The note now states n >= 3 at Line 14.
  • The scope matches the production route. At Lines 554-563 of crates/validation_core/src/bias.rs, an n = 3 translated sample continues to the general moment path when exact_three_level_standard_error returns None.

The exact-real bound is correct for the stated domain.

  • Canonical translation provides an exact zero.

  • The nonconstant general path has a maximum-magnitude normalized value x.

  • Power-of-two normalization gives (1 \le |x| < 2).

  • The pair (0, x) contributes (x^2).

  • For each of the remaining (n-2) values z, the distinct pair terms satisfy:

    [
    z^2 + (z-x)^2 \ge \frac{x^2}{2}.
    ]

  • The selected pair terms are disjoint. The remaining pair-square terms are nonnegative.

  • Therefore:

    [
    D \ge x^2 + (n-2)\frac{x^2}{2}
    = \frac{n x^2}{2}
    \ge \frac{n}{2}.
    ]

For n = 3, this gives (D \ge 3x^2/2 \ge 3/2). The derivation covers the three-observation fallback correctly.

The note does not overclaim floating-path positivity.

  • Lines 55-64 identify the separate square rounding, compensated first and second moments, usize -> f64 conversion, n * Q rounding, and final FMA.
  • Lines 78-83 retain dispersion_numerator <= 0.0 as a required fail-closed guard.
  • The note permits source changes only after an implementation-matched forward-error proof or a compact caller-valid counterexample.

Higham, Ogita, Rump, and Oishi remain research anchors. Line 68 explicitly rejects importing their results as a theorem for this specific sorted Neumaier implementation without an algorithm-matched derivation.

Exact-head verification is incomplete. Repository contracts/Python coverage, release resource evidence, and governance checks are GREEN. Rust quality, production coverage, and Live PostgreSQL checks are still queued.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Exact-head scope: 252831bfaad2c7dc5abf207461ffcdc4c35e3cc5, especially new docs/research/validation-bias-production-resource-admission.md. Please verify that it (1) does not turn analysis_engine::MAX_EVIDENCE_UNITS = 100_000 into a public validation_core cutoff, (2) preserves the source-domain reachability of the n=2^54 false-zero guard, (3) keeps the translated-dispersion floating proof unresolved, and (4) does not claim predecessor CI/coverage as current-head landing evidence.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo='ContextualWisdomLab/TEPP'
head='252831bfaad2c7dc5abf207461ffcdc4c35e3cc5'
doc='docs/research/validation-bias-production-resource-admission.md'
parent="$(git show -s --format=%P "$head" | awk '{print $1}')"

echo '== Exact revision =='
git show -s --format='head=%H%nparents=%P%nsubject=%s%ncommit_date=%cI' "$head"
echo '== Checked-out revision =='
git rev-parse HEAD

echo '== Direct changed paths and focused diff =='
git diff --name-status "$parent" "$head"
git diff --find-renames --unified=160 "$parent" "$head" -- \
  "$doc" \
  'CHANGELOG.d/*.md' \
  'docs/research/*.md' \
  'crates/analysis_engine/**/*.rs' \
  'crates/validation_core/**/*.rs'

echo '== Resource-admission document =='
git show "${head}:${doc}" | nl -ba

echo '== MAX_EVIDENCE_UNITS definition and AnalysisCorpus admission =='
git grep -n -C 16 -E \
  '\bMAX_EVIDENCE_UNITS\b|\bAnalysisCorpus::new\b|\bLimitExceeded\b' \
  "$head" -- 'crates/**/*.rs' || true

echo '== validation_core public bias-SE routing and remaining guards =='
git show "${head}:crates/validation_core/src/bias.rs" | nl -ba | sed -n '1,180p'
git show "${head}:crates/validation_core/src/bias.rs" | nl -ba | sed -n '400,635p'
git show "${head}:crates/validation_core/src/bias.rs" | nl -ba | sed -n '690,790p'
git show "${head}:crates/validation_core/src/bias_se.rs" | nl -ba | sed -n '340,470p'

echo '== Cross-references: cutoff, resource witness, translated dispersion, and CI evidence =='
git grep -n -C 8 -E \
  'MAX_EVIDENCE_UNITS|100_000|2\^54|18,014,398,509,481,984|false.zero|dispersion_numerator|floating.*positiv|coverage|predecessor|current.head|exact.head|landing evidence' \
  "$head" -- "$doc" 'docs/research/*.md' 'CHANGELOG.d/*.md' 'crates/**/*.rs' || true

echo '== Exact-head check runs and combined status =='
gh api "repos/${repo}/commits/${head}/check-runs?per_page=100" \
  --jq '.check_runs[] | {name,status,conclusion,details_url,completed_at}' || true
gh api "repos/${repo}/commits/${head}/status" \
  --jq '{state, statuses:[.statuses[] | {context,state,target_url,updated_at}]}' || true

Length of output: 202452


@seonghobae Review complete for exact head 252831bfaad2c7dc5abf207461ffcdc4c35e3cc5.

I found no finding in the requested scope.

  • docs/research/validation-bias-production-resource-admission.md keeps analysis_engine::MAX_EVIDENCE_UNITS = 100_000 at the Analysis Run application boundary. Line 18 explicitly states that validation_core must not copy this value, treat it as a public-library domain restriction, or use it to remove numerical refusals.

  • The document preserves the source-domain reachability of the helper false-zero guard. Lines 24-31 retain the n = 2^54, q = 2^-1074, and M = 2^-1021 construction. It identifies the exact restored value as q/2, which rounds to represented zero under round-to-nearest, ties-to-even. Line 39 correctly keeps the guard as numerical safety.

  • The document distinguishes source-domain reachability from realistic product materialization. Lines 33-37 quantify the two public input slices as 2^58 bytes, or 256 PiB, before working storage. This does not convert the guard into an unreachable branch or request a giant test fixture.

  • The translated-dispersion obligation remains unresolved. Lines 43-51 state the exact-real margin D >= n/2, but identify the separate floating operations that still require an implementation-matched forward-error proof or a compact caller-valid counterexample. The document retains dispersion_numerator <= 0.0 as a required fail-closed guard.

  • A product-bounded proof remains conditional on an explicit supported buyer call trace. Line 49 allows use of n <= 100_000 only after that trace proves the Analysis Run admission rule applies to every supported product execution. It does not redefine the public validation_core source domain.

  • The direct scope is documentation and ownership boundary definition. It does not change production arithmetic, coverage configuration, or admission code.

Current-head landing evidence is incomplete. At inspection time, the exact-head format, lint, test, rustdoc, dependency-policy, production coverage, repository/Python, Live PostgreSQL, release-resource, and governance workflows were queued. The successful combined-status contexts do not replace these required exact-head workflows. Predecessor CI and coverage artifacts therefore remain lineage only, not current-head acceptance evidence.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Current exact head is now ef48e1c9314b1e6978e7cea16011e8515d12af6f; the only delta from 252831b... is the terminal newline in docs/research/validation-bias-production-resource-admission.md. Please review this exact head under the same scope: owner separation of Analysis Run resource admission vs public Validation Evidence numerical domain, preservation of the real n=2^54 false-zero reachability, and no premature acceptance of translated-dispersion floating positivity.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo='ContextualWisdomLab/TEPP'
head='ef48e1c9314b1e6978e7cea16011e8515d12af6f'
parent='252831bfaad2c7dc5abf207461ffcdc4c35e3cc5'
doc='docs/research/validation-bias-production-resource-admission.md'

echo '== Exact revisions =='
git show -s --format='head=%H%nparents=%P%nsubject=%s%ncommit_date=%cI' "$head"
git show -s --format='parent=%H%nsubject=%s' "$parent"
echo '== Working revision =='
git rev-parse HEAD

echo '== Exact parent-to-head change =='
git diff --name-status "$parent" "$head"
git diff --numstat "$parent" "$head"
git diff --check "$parent" "$head"
git diff --word-diff=porcelain "$parent" "$head" -- "$doc"

echo '== Byte-level terminal-newline check =='
python3 - <<'PY'
import subprocess
head = 'ef48e1c9314b1e6978e7cea16011e8515d12af6f'
parent = '252831bfaad2c7dc5abf207461ffcdc4c35e3cc5'
path = 'docs/research/validation-bias-production-resource-admission.md'
for rev in (parent, head):
    data = subprocess.check_output(['git', 'show', f'{rev}:{path}'])
    print(f'{rev}: bytes={len(data)} terminal_newline={data.endswith(bytes([10]))}')
print('content_equal_after_stripping_one_terminal_newline=',
      subprocess.check_output(['git','show',f'{parent}:{path}']).rstrip(bytes([10])) ==
      subprocess.check_output(['git','show',f'{head}:{path}']).rstrip(bytes([10])))
PY

echo '== Current resource-admission document =='
git show "${head}:${doc}" | nl -ba

echo '== Analysis Run admission definition =='
git grep -n -C 14 -E \
  '\bMAX_EVIDENCE_UNITS\b|\bAnalysisCorpus::new\b|\bLimitExceeded\b' \
  "$head" -- 'crates/**/*.rs' || true

echo '== Validation Evidence public route and remaining guards =='
git show "${head}:crates/validation_core/src/bias.rs" | nl -ba | sed -n '1,185p'
git show "${head}:crates/validation_core/src/bias.rs" | nl -ba | sed -n '400,635p'
git show "${head}:crates/validation_core/src/bias.rs" | nl -ba | sed -n '690,790p'
git show "${head}:crates/validation_core/src/bias_se.rs" | nl -ba | sed -n '340,470p'

echo '== Exact-head relevant cross-references =='
git grep -n -C 8 -E \
  'MAX_EVIDENCE_UNITS|100_000|2\^54|18,014,398,509,481,984|2\^58|256 PiB|false.zero|dispersion_numerator|floating.*positiv|implementation.matched|caller trace|public.library' \
  "$head" -- "$doc" 'docs/research/*.md' 'crates/**/*.rs' || true

echo '== Exact-head workflows only =='
gh api "repos/${repo}/commits/${head}/check-runs?per_page=100" \
  --jq '.check_runs[] | {name,status,conclusion,details_url,completed_at}' || true
gh api "repos/${repo}/commits/${head}/status" \
  --jq '{state, statuses:[.statuses[] | {context,state,target_url,updated_at}]}' || true

Length of output: 203111


@seonghobae Review complete for exact head ef48e1c9314b1e6978e7cea16011e8515d12af6f.

I found no finding in the requested scope.

The delta from 252831bfaad2c7dc5abf207461ffcdc4c35e3cc5 is documentation-only. It repairs the terminal newline in docs/research/validation-bias-production-resource-admission.md. It does not change production source, coverage inputs, or numerical routing.

  • analysis_engine::MAX_EVIDENCE_UNITS = 100_000 remains owned by Analysis Run. AnalysisCorpus::new rejects a larger in-memory corpus with AnalysisEngineError::LimitExceeded.
  • The document correctly states that validation_core has no typed, versioned admission contract proving every supported bias_standard_error call passed through AnalysisCorpus.
  • Therefore, the document does not convert 100_000 into a public validation_core sample limit. It does not authorize removal of either numerical refusal.

The document preserves the helper false-zero reachability result.

  • It retains the source-domain construction with n = 2^54, q = 2^-1074, and M = 2^-1021.
  • Its normalized standard error is 2^-54.
  • Restoring by M yields the exact value q/2, which roundTiesToEven maps to represented zero.
  • crates/validation_core/src/bias.rs Line 68 through Line 69 still rejects this false zero with ValidationError::InvalidInput.
  • The 256 PiB minimum input-slice requirement limits realistic product materialization. It does not make the public source-domain branch unreachable.

The translated-dispersion obligation remains unresolved.

  • The document keeps the exact-real bound D >= n / 2 for the admitted general translated path.
  • It separately identifies rounding of squares, both sorted compensated sums, usize -> f64, n * Q, and the final FMA.
  • crates/validation_core/src/bias.rs Line 591 through Line 592 still preserves the fail-closed dispersion_numerator <= 0.0 refusal.
  • The document allows a change only after an implementation-matched forward-error proof or a compact caller-valid counterexample. A future buyer call trace can bound product evidence. It cannot redefine the public library domain.

Current-head landing verification is incomplete. The exact-head format, lint, test, rustdoc, dependency-policy, production coverage, repository/Python coverage, PostgreSQL, release-resource, and governance workflows are queued. The successful Devin Review and CodeRabbit status contexts do not replace those workflows.

You are interacting with an AI system.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Exact current head: 520df488fd86ba48008af8ee5a2e112b4587fc22. Please review the documentation-only resource/cardinality repair, focusing on whether the note correctly distinguishes analysis_engine::MAX_EVIDENCE_UNITS from the sample count n consumed by validation_core::bias_standard_error, given that analysis_engine has no current validation_core dependency and AnalysisEvidenceUnit is evidence metadata rather than a truth/recovered metric pair. Verify that the n=2^54 false-zero witness remains source-domain reachable, that the 2^54 / 100_000 ratio is scale context only rather than admission proof, and that dispersion_numerator <= 0.0 remains unresolved pending implementation-matched floating proof or compact counterexample.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Rate Limit Exceeded

@seonghobae have exceeded the limit for the number of chat messages per hour. Please wait 6 minutes and 10 seconds before sending another message.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please retry the exact-current review on 520df488fd86ba48008af8ee5a2e112b4587fc22 after the earlier rate-limit response. Scope only the documentation-only resource/cardinality repair: verify that analysis_engine::MAX_EVIDENCE_UNITS = 100_000 is not being misrepresented as the sample count accepted by validation_core::bias_standard_error, that the n=2^54 false-zero witness remains source-domain reachable rather than a realistic fixture, and that dispersion_numerator <= 0.0 remains unresolved pending an implementation-matched floating bound or compact caller-valid counterexample. Do not infer scientific acceptance from the review.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo='ContextualWisdomLab/TEPP'
head='520df488fd86ba48008af8ee5a2e112b4587fc22'
parent='3b5d07b2e438edef9c529317d9dd09bd53451a92'
doc='docs/research/validation-bias-production-resource-admission.md'

echo '== Exact revision =='
git show -s --format='head=%H%nparents=%P%nsubject=%s%ncommit_date=%cI' "$head"
echo '== Checked-out revision =='
git rev-parse HEAD

echo '== Exact delta from stated predecessor =='
git diff --name-status "$parent" "$head"
git diff --find-renames --unified=180 "$parent" "$head" -- \
  "$doc" \
  'crates/analysis_engine/**/*.rs' \
  'crates/validation_core/**/*.rs' \
  'CHANGELOG.d/*.md' \
  '.github/**/*.yml' \
  '.github/**/*.yaml'

echo '== Resource/cardinality note at exact head =='
git show "${head}:${doc}" | nl -ba

echo '== Analysis Run admission and AnalysisEvidenceUnit definitions =='
git grep -n -C 18 -E \
  '\bMAX_EVIDENCE_UNITS\b|\bstruct AnalysisCorpus\b|\bimpl AnalysisCorpus\b|\bfn new\s*\(|\bAnalysisEvidenceUnit\b|\bLimitExceeded\b' \
  "$head" -- 'crates/analysis_engine/**/*.rs' || true

echo '== validation_core public route and false-zero / dispersion guards =='
git show "${head}:crates/validation_core/src/bias.rs" | nl -ba | sed -n '1,185p'
git show "${head}:crates/validation_core/src/bias.rs" | nl -ba | sed -n '400,635p'
git show "${head}:crates/validation_core/src/bias.rs" | nl -ba | sed -n '690,790p'
git show "${head}:crates/validation_core/src/bias_se.rs" | nl -ba | sed -n '340,470p'

echo '== Dependency-direction evidence =='
for file in Cargo.toml crates/analysis_engine/Cargo.toml crates/validation_core/Cargo.toml; do
  if git cat-file -e "${head}:${file}" 2>/dev/null; then
    echo "----- ${file} -----"
    git show "${head}:${file}" | nl -ba
  fi
done

echo '== Relevant statement cross-check =='
git grep -n -C 8 -E \
  'MAX_EVIDENCE_UNITS|100_000|2\^54|18,014,398,509,481,984|2\^58|256 PiB|false.zero|dispersion_numerator|floating.*positiv|implementation.matched|compact.*counterexample|cardinality|truth|recovered|public.library' \
  "$head" -- \
  "$doc" \
  'crates/analysis_engine/**/*.rs' \
  'crates/validation_core/**/*.rs' || true

echo '== Exact-head checks only =='
gh api "repos/${repo}/commits/${head}/check-runs?per_page=100" \
  --jq '.check_runs[] | {name,status,conclusion,details_url,completed_at}' || true
gh api "repos/${repo}/commits/${head}/status" \
  --jq '{state, statuses:[.statuses[] | {context,state,target_url,updated_at}]}' || true

Length of output: 202993


@seonghobae Review complete for exact head 520df488fd86ba48008af8ee5a2e112b4587fc22.

I found no findings in the requested scope.

  • The change is documentation-only. It does not change validation_core arithmetic, admission logic, or fail-closed guards.

  • docs/research/validation-bias-production-resource-admission.md correctly keeps analysis_engine::MAX_EVIDENCE_UNITS = 100_000 at the Analysis Run boundary. The note states that analysis_engine has no validation_core dependency. It also states that AnalysisEvidenceUnit contains identity, time, availability, and membership metadata, not a truth/recovered metric pair.

  • The note correctly concludes that an evidence-unit count is not yet a proven bound on the n passed to validation_core::bias_standard_error. It requires a typed, versioned buyer-path contract and an evidence-to-metric cardinality mapping before a product bound can use 100_000. It does not copy that value into validation_core or treat it as a public-library cutoff.

  • The n = 2^54 helper false-zero witness remains source-domain reachable. The note preserves the q = 2^-1074 and M = 2^-1021 construction. Its normalized standard error is 2^-54. Restoring it produces q/2, which rounds to represented zero under round-to-nearest, ties-to-even. The guard therefore protects a positive estimand from a false zero.

  • The 2^54 / 100_000 ratio is scale context only. Line 35 explicitly states that it is not admission proof. The note separately identifies the 256 PiB minimum size of the two public input slices. This size makes the witness unsuitable as a realistic allocation fixture. It does not make the branch unreachable.

  • The translated-dispersion obligation remains unresolved. The note preserves the exact-real lower bound D >= n / 2. It separately requires an implementation-matched floating-point bound that covers normalized-square rounding, both sorted compensated sums, usize -> f64, n * Q, and the final FMA. A compact caller-valid counterexample remains an alternative closure path. The dispersion_numerator <= 0.0 refusal remains required.

This review does not establish scientific acceptance or release acceptance. The exact-head Production line and branch coverage check failed. The other listed exact-head checks succeeded.

You are interacting with an AI system.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant