diff --git a/.github/workflows/radial-rate.yml b/.github/workflows/radial-rate.yml new file mode 100644 index 000000000..fa1a9abe5 --- /dev/null +++ b/.github/workflows/radial-rate.yml @@ -0,0 +1,38 @@ +name: Microscopic radial-rate checks + +'on': + pull_request: + paths: + - 'frontiers/radial_rate_20260930/**' + - '.github/workflows/radial-rate.yml' + workflow_dispatch: + +permissions: + contents: read + +jobs: + exact-and-source: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 + with: + persist-credentials: false + fetch-depth: 0 + - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 + with: + python-version: '3.11.16' + - name: Fetch exact public source objects + run: | + set -euo pipefail + git fetch --no-tags origin 80059a97cd8eb32d1a17a0ad9cb22cb2a0d7b337 + git fetch --no-tags origin 382c0f9ff2281f43651ddbdf2e9b36dd52e2c6bf + git fetch --no-tags origin 7a1cb09a9d58d179393e6d29146252f714b9c9bf + - name: Verify sources, packet and both Python modes + env: + PYTHONDONTWRITEBYTECODE: '1' + GIT_NO_REPLACE_OBJECTS: '1' + run: | + set -euo pipefail + python -B -S frontiers/radial_rate_20260930/verify.py + git diff --exit-code diff --git a/frontiers/radial_rate_20260930/MANIFEST.json b/frontiers/radial_rate_20260930/MANIFEST.json new file mode 100644 index 000000000..b06df6fa3 --- /dev/null +++ b/frontiers/radial_rate_20260930/MANIFEST.json @@ -0,0 +1,73 @@ +{ + "schema": 1, + "scientific_effect": "NONE", + "review_status": "NONAUTHOR_REVIEW_OPEN", + "files": [ + { + "path": "PLAN.md", + "bytes": 1772, + "sha256": "3a436b2f58a3b79bcb5471474d94fff7c07f5f4dce838525fed117cbb5d446db", + "git_blob": "db61274a4ce7f2e9e6c4b75303a285230f44d5db" + }, + { + "path": "PROOF.md", + "bytes": 15755, + "sha256": "a3693664900e23e1e763d88a0b5609936a6f31d844cbe6f18c7d0379b94ba710", + "git_blob": "65f24b1f9a7b80522a2ee059f5f6877c9f970f0d" + }, + { + "path": "README.md", + "bytes": 3186, + "sha256": "b31b309916639ce111f28f4c81fea061a62ac777c6a9f241185bcfd0f59655b8", + "git_blob": "cc0e2f5a45c76aa60a3782002321f0c47d0f3b17" + }, + { + "path": "RECONNAISSANCE.md", + "bytes": 2002, + "sha256": "54118b87d9a0dbe78ed9f2162ad413d1a9bfc1c1122c53855274b300751ede2b", + "git_blob": "3eb935b8d3fa2c10e8220c71c5243488beb25e31" + }, + { + "path": "RESULTS.json", + "bytes": 438, + "sha256": "c9cdb842befa92b8e26eb02831a1d20838cc75465f1db7840eba1c0eb1c70b4f", + "git_blob": "c7494046e449f30a6346572b2760cca6c1c62afb" + }, + { + "path": "SOURCES.json", + "bytes": 1396, + "sha256": "22b3064a278faff1d915dfb658e9d7e41ec5c4ee69f31e944d47a699a82f8a07", + "git_blob": "37f3dc7b5583bf2f4f0a8d1bb1fd5bd39ff12838" + }, + { + "path": "VALIDATION.md", + "bytes": 2898, + "sha256": "b14b2fb0576c7c7fd1a03baf3d7f479d901f186d0ef0a49dac5156805908409d", + "git_blob": "5a4a11b112723aaf9a67c1aeaafa3a216e5f17e8" + }, + { + "path": "rate.py", + "bytes": 6344, + "sha256": "e96be67c1703780dcd48113fa55809d98b87f0e498da132b162c9640d300577e", + "git_blob": "d213a2762e10a07f3290f9ae1b4dd9f8f73e5667" + }, + { + "path": "test_rate.py", + "bytes": 7286, + "sha256": "f2a096b91de1978dbaa6c1301ac1013d454cadcf96aa705fb66df3c43f53324f", + "git_blob": "4074549e593ad0f02f6931c6df211e25a02d84ea" + }, + { + "path": "test_verify.py", + "bytes": 5792, + "sha256": "1e8f2790b5861b520463ab1d44b87c29dd43ba46b652c46992889ecd001bd4c7", + "git_blob": "258288f8efa9039782432daf6dde77e2b594ef39" + }, + { + "path": "verify.py", + "bytes": 5169, + "sha256": "7f7006a1f3ba74964a00023dd418624612980e19f8e40a3506245ae43966119c", + "git_blob": "d5789cbe7b94b6243b55a62491ecd19bdeb9cbe0" + } + ] +} diff --git a/frontiers/radial_rate_20260930/PLAN.md b/frontiers/radial_rate_20260930/PLAN.md new file mode 100644 index 000000000..db61274a4 --- /dev/null +++ b/frontiers/radial_rate_20260930/PLAN.md @@ -0,0 +1,29 @@ +# Inverse-radius expansion: execution plan + +Goal: derive quantitative radius-tail and mark-law results from the exact R11 +integral of the already-formed limiting microscopic POINT intensity. The original +Gaussian-field limit r->0 is taken first. No whole-cluster maximum or finite-r +rate is to be inferred. + +Design: reciprocal radius z=1/Z makes the physical cutoff an interval with +explicit endpoints. Map it to [-1,1], prove a smooth even integrated function of +1/t using Gaussian derivative domination, and compute its first two coefficients. +Deduce radial and fixed latent-mark total-variation rates, keeping the sign- +retaining law separate. Preserve the complete original anisotropic covariance, +Haar factors and full normalizer. No original source or peer branch is edited. + +Execution: isolated new runtime directory and new additive GitHub branch. +Dylan's repeated autonomy instruction authorizes foreground work; no timers or +background agents are restarted. No subagent tool is available here. + +1. Read source R11-R13, exact Gaussian/spectral interface and current peer claims. +2. Write and observe failing tests for exact shape integrals and endpoint series. +3. Implement standard-library rational controls; test both signs and parity. +4. Write complete domination and coefficient proof, plus all scope exclusions. +5. Verify exact historical source identities, packet inventory and both Python + modes; include hostile Git fixtures and semantic mutants. +6. Publish a new source-bound candidate and request nonauthor analytic review. + +Separate supporting task: bounded nonauthor review of PR173 Route C; accept the +conditional count implication and repair its inadmissible fixed-R substitution +by a diagonal argument. No graph execution or parent revalidation. diff --git a/frontiers/radial_rate_20260930/PROOF.md b/frontiers/radial_rate_20260930/PROOF.md new file mode 100644 index 000000000..65f24b1f9 --- /dev/null +++ b/frontiers/radial_rate_20260930/PROOF.md @@ -0,0 +1,334 @@ +# Smooth inverse-radius expansion and sharp rates for microscopic extreme marks + +Object: OA-RADIAL-RATE-20260930-v1. Author: OpenAI / GPT-6 Astra Pro. +Disposition: AUTHOR-SIDE CONDITIONAL PROOF CANDIDATE; NONAUTHOR REVIEW OPEN. +Scientific effect NONE. No parent proof, register, Boolean, prize, or earlier +review is changed. This conversation authored SC/P and contributed to the +related cluster line; no independent revalidation of those premises is implied. + +## 1. Exact object and scope + +Fix d>=2, L>0, b real, k>0 and an orthonormal frame, under the original model +and full endpoint normalizer. This paper concerns the ALREADY-FORMED limiting +microscopic POINT intensity of [R]. First the original field radius r tends to +zero; only then does the microscopic distance threshold t tend to infinity. +No finite-r convergence rate is proved. Whole-cluster maximum selection and +its moving tie boundaries are not consumed or treated here. + +Exact source identities are in SOURCES.json. [R] is PR166 RADIAL_TAIL.md at +80059a97cd8eb32d1a17a0ad9cb22cb2a0d7b337, blob0f14417ef7038b9c6f50e4b01e393a58b7b5e3a4: +R7-R13 supply the root-resolved integral, Gaussian domination and positive leading +coefficient. [SC] is PR162 PROOF.md at382c0f9ff2281f43651ddbdf2e9b36dd52e2c6bf, +blob16c56821b52fd76b0be791622b9c3809eafde75a: the nondegenerate raw Gaussian contact +jet, orthogonal spectral convention and finite nonempty microscopic measure. +[P] is imports/lifetime_parent_20260925/UNIFORM_MATRIX_CAP_AND_LIFETIME.md at +7a1cb09a9d58d179393e6d29146252f714b9c9bf, blobdfed3b8d318a3ab1950957f393307733a4bef3f2: +only the exact periodized covariance and contact conditioning, used in Section7. +Neither PR169's whole-cluster candidate, its companion-ratio addendum, nor any +numerical coefficient note is a premise. Source reviews are not reviews here. + +Use [R]'s variables lambda=(a,h,O,xi), with ordered positive hard curvatures h, +normalized Haar O, and remaining cubic entries xi. Put + + A=a/(12k), gamma=sqrt(1+A^2), + beta0=a^2/(12k), c0=a^3/(144k^2), + A0=O diag(0,-h) O^T, + H(h)=product h_j^3 product_(i0 on S. + +For y=1/Z define + + g_lambda,u,v(y)=G_lambda(beta0+k b0 y^2, + c0+(a b0/4)y^2+2k(v-b0u)y^3). (2) + +[R, R11] says exactly that the tail F(t)=integral sum_i 1{|z_i|>t}dM is + + F(t)=K0 integral_(S,lambda) Q H + integral_R |Z|^-12 g(1/Z) + 1{(u-AZ)^2+Z^2>t^2}dZ du dv d lambda. (3) + +The multiplicity of roots is already correct in this formula. No extra factor +for a double cluster, pin density, or endpoint normalizer is introduced. + +## 2. A fixed-domain smooth even representation + +**Theorem 1.** There is a smooth even function C(delta), defined for +|delta|<2/3 and with every fixed derivative bounded on |delta|<=1/3, such that + + F(t)=t^-11 C(1/t), t>=3. (4) + +Smoothness also holds in L1 for the underlying UNSIGNED shape/parameter measures. +The claim is C-infinity, not analyticity or convergence of an infinite Taylor +series. Consequently for every fixed N>=0 there are finite coefficients C_(2j) +with + + F(t)=sum_(j=0..N) C_(2j) t^(-11-2j)+O_N(t^(-13-2N)), + -F'(t)=sum_(j=0..N)(11+2j)C_(2j)t^(-12-2j) + +O_N(t^(-14-2N)). (5) + +C_(0)>0 is [R]'s C_star. Constants are at the fixed source parameters; no growing +dimension, volume, vanishing-gap, or parameter-uniform claim is made. + +**Proof.** The reciprocal substitution in (3) gives |Z|^-12 dZ=|y|^10 dy on +both signs. For t>|u| the physical radius condition is + + (t^2-u^2)y^2+2uAy-gamma^2<0. + +Set delta=1/t and y=delta w. Its two endpoints in w are + + w_plus/minus(delta)=m(delta) +/- d(delta), + m(delta)=-uA delta/(1-u^2 delta^2), + d(delta)=sqrt(gamma^2-u^2 delta^2)/(1-u^2 delta^2). (6) + +Thus (4) holds with + + J_delta(u,v,lambda)=d(delta) integral_(-1)^1 + [m(delta)+d(delta)x]^10 + g(delta[m(delta)+d(delta)x]) dx, + C(delta)=K0 integral Q H J_delta du dv d lambda. (7) + +There is no moving integration boundary left. On |delta|<=delta0<2/3 the +denominator is uniformly positive and the square-root radicand is bounded +below by a positive constant, since |u|<=3/2 and gamma>=1. Each fixed derivative +of m,d is bounded by a polynomial in1+|a| with constants depending on delta0,k. + +For every fixed j the nondegenerate Gaussian contact density satisfies + + sup_(beta,c) |partial_(beta,c)^j G_lambda(beta,c)| + <= C_j exp[-c_j(|h|^2+a^2+|xi|^2)] (8) + +uniformly in O. Indeed each derivative is a polynomial times the same Gaussian; +absorb that polynomial into a weaker Gaussian exponent and then discard beta,c +from its quadratic lower bound. A bounded mean changes the constants only. +Uniform tensor norm equivalence under O supplies the displayed retained variables. +No inverse hard eigenvalue is used. This is an elementary derivative extension +of [R]'s raw Gaussian bound, not an extra stochastic assumption. + +The chain rule in (7), for any fixed number of delta derivatives, now gives an +integrable majorant of the form + + C Q H (1+|a|)^M exp[-c(|h|^2+a^2+|xi|^2)], (9) + +on the bounded shape domain and x in[-1,1]. The actual shifted beta,c values +may be large: (8) is a supremum over them, not an invalid compactness assumption. +This proves differentiation under all integrals and smoothness in L1 as well +as for the total mass. The exact identities m(-delta)=-m(delta), +d(-delta)=d(delta), followed by x->-x, show J_(-delta)=J_delta. This cancellation +holds even when g(y) is not even; its cubic y^3 term is retained. + +Taylor's theorem with the integrated derivative bounds proves (5), including +its differentiated remainder. It is NOT obtained by formally differentiating +an unspecified big-O estimate. C(0) is the positive source coefficient. QED. + +## 3. Explicit second coefficient + +Write C_0=C_(0), C_2=C_(2), to distinguish coefficients from their tail powers11,13. +Set the differential operator acting on G_lambda at fixed a,h,O,xi + + D_a=k partial_beta+(a/4)partial_c. + +The pointwise density has expansion g(y)=G0+g2 y^2+g3 y^3+O(y^4), with + + g2=b0 D_a G0. (10) + +There is no linear y term. Expanding the exact endpoints, or differentiating +(7), gives + + j0=(2/11)gamma^11 G0, + j2=u^2 gamma^9(1+12A^2)G0+(2/13)b0 gamma^13 D_a G0, + J_delta=j0+j2 delta^2+O_L1(delta^4). (11) + +For the geometric part, write w_+=gamma-uA delta+ +[u^2 gamma-u^2/(2gamma)]delta^2+O(delta^3), with the corresponding reflected +negative endpoint. Then (w_+^11-w_-^11)/11 equals +2gamma^11/11+u^2 gamma^9(1+12A^2)delta^2+O(delta^4). +The g2 term contributes2g2 gamma^13 delta^2/13. The odd g3 term first contributes +at order delta^4 after the two physical sides are summed; it is not dropped +from the all-order argument. + +The necessary exact shape integrals are + + I=integral_S Q=246528/35, + U2=integral_S u^2 Q=240192/35, + B=integral_S b0 Q=-428544/7=3I-12U2, + Uabs=integral_S |u|Q=5898627/880. (12) + +They follow by integrating the polynomial Q in v and then on the strips cut +at u=-1/2 and u=0. The companion computes them in exact Fraction arithmetic. +In particular + + C_0=K0*(2I/11) integral H gamma^11 G0 d lambda, + C_2=K0 integral H [U2 gamma^9(1+12A^2)G0 + +(2B/13)gamma^13 D_a G0]d lambda. (13) + +Both integrals are finite by (8). C_0>0. No general sign or nonzero assertion +for C_2 is made in arbitrary dimension/frame; Section7 supplies an exact +noncancellation result at a narrower source scope. No numerical evaluation of +either Gaussian integral is claimed. + +## 4. Rates for the radial ratio and unsigned marks + +Let P_t be point-INTENSITY sampling conditioned on physical radius R>t. Define +q=R/t>=1 and retain Y=(u,v,lambda), but FORGET sign Z. These are the root-resolved +latent coordinates of [R], not a configuration-uniform selection. Define the +finite measures with densities + + dmu0=K0 Q H j0 dY, dmu2=K0 Q H j2 dY, + c=C_2/C_0. (14) + +mu0 has mass C_0 and mu2 mass C_2. The joint law of (q,Y) has the L1 expansion + + dP_t(q,Y)=11q^-12 dq dmu0(Y)/C_0 + +t^-2 [13q^-14 dq dmu2(Y)/C_0 + -11c q^-12 dq dmu0(Y)/C_0]+O_L1(t^-4). (15) + +In particular its total-variation distance to the stated independent limiting +product is O(t^-2). Projection to Y, or to the downward height +eta=u+1/2+v/6, retains this rate. This supplies an O(t^-2) TV rate for the +intensity-selected height law H_eta/I in [R, H1-H2]. No spatial-configuration +TV claim is made: the map to actual positions depends on t. + +Proof: for fixed Y, the radius tail density is t^-11 K0 QH J_(1/t). +Differentiate the smooth expression already justified in Section2; at tq its +radial density times t equals + +t^-11 K0 QH q^-12[11J_(1/(tq))+(1/(tq))J'_(1/(tq))]. + +Divide by F(t)=t^-11 C(1/t) and use the L1 Taylor estimates. The remainder is +bounded after integration by a constant times t^-4 q^-12, integrable on q>=1. +This proves (15) without differentiating a merely pointwise asymptotic. QED. + +Let Pareto_11 have density11q^-12 on q>=1. For the scalar radial ratio, (15) gives + + p_t(q)=11q^-12[1+c t^-2((13/11)q^-2-1)]+O_L1(t^-4). + +**Sharp scalar coefficient:** + + dTV(Law_(P_t)(R/t),Pareto_11) + =kappa |c| t^-2+O(t^-4), + kappa=(2/13)(11/13)^(11/2). (16) + +The same leading coefficient holds for the supremum distance of their CDFs. +The correction changes sign only at q0=sqrt(13/11). Its positive integral is +q0^-11-q0^-13=kappa; its total integral is zero. Half its L1 norm is therefore +kappa, proving (16). The uniform CDF remainder follows from the L1 remainder; +the maximum of q^-11(1-q^-2) is also kappa. If C_2=0 the stated error is O(t^-4), +not an unjustified claim of a nonzero second-order term. + +As another quantitative consequence, uniformly over q>=1, + + F(tq)/F(t)=q^-11[1+c t^-2(q^-2-1)]+O(t^-4 q^-11). (17) + +This is a source-specific second-order regular-variation statement. Generic +second-order tail theory is not claimed novel. + +## 5. Retaining the sign has a different, strictly slower sharp rate + +The cancellation in Section2 used both signs. Keep epsilon=sign Z and the +same Y. The two half integrals are exactly + + J_delta,epsilon=integral_0^(d+epsilon m) w^10 g(epsilon delta w)dw, + J_delta,epsilon=j0/2+epsilon h1 delta+O_L1(delta^2), + h1=-uA gamma^10 G0. (18) + +The linear term comes from the physical cutoff shift m. g'(0)=0, so no density +term cancels it. Applying the differentiated density argument to each half yields + + dTV(Law_(P_t)(epsilon,R/t,Y), + UniformSign x Pareto_11 x mu0/C_0) + =B_sign t^-1+O(t^-2), + B_sign=(K0/C_0) Uabs integral H |A|gamma^10 G0 d lambda>0. (19) + +Indeed the first signed correction has density +12 epsilon h1 q^-13 K0 QH/C_0; its half-L1 norm, summed over the two signs and +integrated over q, is the displayed B_sign because integral_1^infinity12q^-13dq=1. +Finiteness follows from (8); strict positivity follows from the full positive +Gaussian density on open sets with a!=0 and positive hard spectrum. The gauge +convention for O is exactly that in [R]; (19) is a result for those retained +latent variables, not a statement that a sign alone has a nonzero marginal bias. +Marginalizing can cancel a correction, and specifically forgetting epsilon +cancels this one. Thus signed and unsigned rates must not be conflated. + +## 6. A finite part for the critical eleventh moment + +Let M11(t)=integral sum_i min(R_i,t)^11 dM. The prior theorem gave its leading +logarithm. There is now a finite constant L11 such that + + M11(t)=11 C_0 log t+L11-(11/2)C_2 t^-2+O(t^-4). (20) + +One exact definition is + + L11=11 integral_0^1 x^10 F(x)dx + +11 integral_1^infinity[x^10 F(x)-C_0/x]dx. + +The first integral is finite by finite total point mass. The second converges +by (5) at N=1. Tonelli gives M11(t)=11 integral_0^t x^10 F(x)dx; subtracting +its limiting finite part and integrating the controlled remainder proves (20). +No numerical value for L11 is asserted. This is again after the r limit only. + +## 7. Exact positive second correction in the aligned planar periodic model + +**Theorem 2.** In d=2, with the axial coordinate aligned with one of the lattice +axes of [P]'s EXACT periodized kernel, C_2>0 for every fixed L,k>0 and b real. +Consequently the radial TV and CDF errors in (16) are genuinely Theta(t^-2), +with the positive coefficient in (16); not merely an upper bound. + +Proof: [P]'s kernel factors as K_L(x,z)=k_L(x)k_L(z). Let m2,m4,m6 be the even +spectral moments of the one-dimensional variance-one factor; m2>0 and the full +positive lattice spectrum gives m4-m2^2>0 and m6-m4^2/m2>0. At contact condition +on (f,fx,fxx,fxxx,fz,fxz)=(b,0,0,12k,0,0). + +Even-total-order jets and odd-total-order jets are independent. For the odd +soft cubic jets (a,beta,c)=(fxxz,fxzz,fzzz), separability and reflection in each +axis give a centered DIAGONAL conditional Gaussian with variances + + va=vbeta=m2(m4-m2^2), vc=m6-m4^2/m2. (21) + +For transparency: Cov(beta,(fx,fxxx))=(-m2^2,m2 m4) is -m2 times the first row +of Cov(fx,fxxx), so its conditional mean is -m2 fx=0 even though fxxx=12k. +a and c correlate only with fz in that odd conditioning block, with covariances +-m2^2 and -m4; their raw covariance m2 m4 is removed by that regression. Their +conditional covariance with beta vanishes by coordinate reflection. The diagonal +variances follow by subtracting these rank-one regressions. The even soft +curvature has its own strictly positive conditional density at zero and merely +multiplies this cubic Gaussian by a positive b-dependent scalar. + +Therefore on the cusp + + D_a G0=-[a^2/(12vbeta)+a^4/(576k^2 vc)]G0<=0. (22) + +In (13), U2>0, B<0 and G0>0. The geometric term is strictly positive and the +second term is nonnegative. Thus C_2>0, without replacing finite L by a continuum +covariance or numerically approximating a lattice sum. The same common even +b-dependent factor cancels from c=C_2/C_0 and B_sign at this planar aligned +scope. We do not extend this diagonal regression or noncancellation assertion +to arbitrary rotations or d>=3 without a separate argument. QED. + +## 8. Verification and review boundary + +A: reciprocal physical cutoff, fixed-domain map, C-infinity L1 Gaussian derivative +domination, exact parity and differentiated all-order asymptotic expansion. +B: j0/j2 coefficients, all four exact shape integrals, signed/unsigned TV and CDF +constants, finite-part moment, and aligned planar regression/noncancellation. + +The stdlib companion checks shape integrals, formal endpoint equations, exact +Taylor coefficients, cancellation and signed bias, independent scalar controls +and deliberately false variants. These are finite checks, not a formal proof +of any Gaussian input or differentiation under an infinite-dimensional integral. +No Lean formalization, global status change, coefficient enclosure or self-merge. + +No rate for r->0, no uniform simultaneous t(r)->infinity statement, no claim +about the remote singleton population, no convergence rate for whole-cluster +maximum selectors across ties, and no spatial independence/elder pairing is +added by this packet. Sign-forgetting is part of (15), not an optional omission. diff --git a/frontiers/radial_rate_20260930/README.md b/frontiers/radial_rate_20260930/README.md new file mode 100644 index 000000000..cc0e2f5a4 --- /dev/null +++ b/frontiers/radial_rate_20260930/README.md @@ -0,0 +1,61 @@ +# Microscopic radial rates and an even inverse-radius expansion + +OpenAI / GPT-6 Astra Pro. Source-bound conditional candidate; nonauthor review +OPEN. Scientific effect NONE. No self-merge or parent/status/graph modification. + +The earlier point-intensity result F(t)~C0 t^-11 is sharpened here to a smooth +even expansion in delta=1/t, with controlled derivatives to every fixed order. +The original field limit r->0 is taken FIRST. This is not a rate for that limit. + +Main manuscript PROOF.md: +- F(t)=C0 t^-11+C2 t^-13+O(t^-15), with an explicit finite Gaussian-derivative + formula for C2 and all-even fixed-order extensions. +- The radial ratio's Pareto(11) TV error has coefficient + (2/13)(11/13)^(11/2)|C2/C0| t^-2+O(t^-4). +- The unsigned shape/parameter/radial joint law has an L1 second-order expansion; + its height marginal consequently converges in TV at O(t^-2). +- RETAINING sign Z gives a strictly positive first-order joint TV coefficient, + Bsign t^-1+O(t^-2). Forgetting sign cancels that term. +- The capped eleventh moment has a finite renormalized limit and an explicit + t^-2 correction, not merely a leading logarithm. +- For the exact aligned PLANAR periodized kernel, Gaussian separability proves + C2>0 at every fixed L,k>0 and b real. Thus the radial error is genuinely + Theta(t^-2) at that narrower scope. No isotropic replacement is used. + +No numerical Gaussian coefficient, finite-r spatial moment/rate, simultaneous +radius limit, whole-cluster maximum rate, spatial TV convergence or independence +between pin pairs is asserted. All-rate statements concern the root-resolved +POINT measure. The parent whole-cluster and elder-geometry lanes are untouched. + +## Replay + +From a full checkout with the three pinned historical source objects: + + python -B -S frontiers/radial_rate_20260930/verify.py + +Standalone download: + + python -B -S verify.py --local-only + +The latter reports source_pins_checked=false. Real local Git fixtures test +custody behavior, not the actual project sources. The full workflow verifies +all source identities and the flat packet before replaying both Python modes, +deterministic results and eight semantic negative controls. No third-party +Python library is required by the shipped scripts. + +Forty local tests passed in each normal/optimized mode at author validation. +They include exact shape integrals, endpoint identities, signed/unsigned formal +series, a high-precision scalar diagnostic, planar Gaussian Schur complements, +and real Git replacement/noncommit/path/inventory attacks. Tests do not prove +the Gaussian domination, differentiation, or the new probability limits. + +## Review requests + +A: Sections2-3, exact physical-cutoff inversion, fixed-domain representation, +C-infinity L1 domination, parity, derivatives and explicit second coefficient. +B: Sections4-7, normalized joint/radial TV rates, signed first-order bias, finite +critical-moment part and exact planar regression/noncancellation. + +The author is exposed to SC/P and related source packets. New reviews must state +that exposure and bind the exact mathematical bytes; existing source verdicts +or green workflows are not automatic acceptance of these new deductions. diff --git a/frontiers/radial_rate_20260930/RECONNAISSANCE.md b/frontiers/radial_rate_20260930/RECONNAISSANCE.md new file mode 100644 index 000000000..3eb935b8d --- /dev/null +++ b/frontiers/radial_rate_20260930/RECONNAISSANCE.md @@ -0,0 +1,33 @@ +# Narrow primary-source reconnaissance — 30 September 2026 UTC + +Exact searches actually executed: +1. second order regular variation Pareto approximation total variation Hall class tail expansion paper +2. site.arxiv.org Palm theory extremes anchored tail processes Planinic 2104.03810 + +Primary records consulted: +- Hrvoje Planinic, Palm theory for extremes of stationary regularly varying time + series and random fields, arXiv:2104.03810v2 (14 March2023). + https://arxiv.org/abs/2104.03810 + Direct abstract/metadata open succeeded. It distinguishes typical exceedances + from typical clusters; no generic sampling/Palm principle is claimed new here. +- Second-order regular variation, convolution and the central limit theorem, + Stochastic Processes and their Applications69(2),139-159(1997), + DOI10.1016/S0304-4149(97)00042-2. + https://www.sciencedirect.com/science/article/pii/S0304414997000422 + The search response supplied the abstract describing second-order tail theory. + Direct open returned403. No full-text/theorem-level audit is claimed. +- L. de Haan and L. Peng, Rates of Convergence for Bivariate Extremes, + Journal of Multivariate Analysis61(2),195-230(1997), DOI10.1006/jmva.1997.1669. + https://doi.org/10.1006/jmva.1997.1669 + Search abstract states rates in total variation and uniform metrics under a + second-order regular-variation condition. Direct open returned403. + +This new packet derives its particular inverse-radius expansion from exact +GitHub source R11, not by importing an unchecked second-order tail theorem. +Generic second-order regular variation and metric convergence rates are prior +frameworks. No exhaustive novelty, priority, or absence claim is made. + +Consensus was not invoked in this pass: the user requested GitHub/Superpowers, +and prior actual repeated attempts had returned the quota error. No changed +quota status is asserted. All external access depth above is limited to the +actual returned abstracts/metadata. No PDF or full paper was inspected. diff --git a/frontiers/radial_rate_20260930/RESULTS.json b/frontiers/radial_rate_20260930/RESULTS.json new file mode 100644 index 000000000..c7494046e --- /dev/null +++ b/frontiers/radial_rate_20260930/RESULTS.json @@ -0,0 +1,21 @@ +{ + "mathematical_acceptance": false, + "passed": true, + "scientific_effect": "NONE", + "scope": "finite rational coefficient and parity controls only", + "series_cases": 12, + "shape_integrals": { + "ABS_U": "5898627/880", + "B": "-428544/7", + "I": "246528/35", + "U2": "240192/35" + }, + "signed_joint_rate": 1, + "tail_exponents": [ + 11, + 13, + 15 + ], + "tv_crossing_squared": "13/11", + "unsigned_radial_rate": 2 +} diff --git a/frontiers/radial_rate_20260930/SOURCES.json b/frontiers/radial_rate_20260930/SOURCES.json new file mode 100644 index 000000000..37f3dc7b5 --- /dev/null +++ b/frontiers/radial_rate_20260930/SOURCES.json @@ -0,0 +1,33 @@ +{ + "schema": 1, + "scientific_effect": "NONE", + "sources": [ + { + "id": "R", + "commit": "80059a97cd8eb32d1a17a0ad9cb22cb2a0d7b337", + "path": "frontiers/two_scale_cluster_geometry_20260929/RADIAL_TAIL.md", + "bytes": 12533, + "sha256": "250897858c8b314c0ff85ec1860a725efacfdae0ff7409fced4cadf7bfb85973", + "git_blob": "0f14417ef7038b9c6f50e4b01e393a58b7b5e3a4", + "use": "R7-R13 exact point-intensity integral/majorant; H1-H2 limiting height law." + }, + { + "id": "SC", + "commit": "382c0f9ff2281f43651ddbdf2e9b36dd52e2c6bf", + "path": "frontiers/spectral_cluster_closure_20260929/PROOF.md", + "bytes": 25006, + "sha256": "e971b2cbe50a8a06b47c1219191201e0d1037c9adac23e5e3b7d2051bb70c2eb", + "git_blob": "16c56821b52fd76b0be791622b9c3809eafde75a", + "use": "Raw nondegenerate contact Gaussian, orthogonal spectral conventions, finite microscopic measure. Author exposure." + }, + { + "id": "P", + "commit": "7a1cb09a9d58d179393e6d29146252f714b9c9bf", + "path": "imports/lifetime_parent_20260925/UNIFORM_MATRIX_CAP_AND_LIFETIME.md", + "bytes": 40261, + "sha256": "9350ad6eaba6626b93c3dedeef9e2ff816e5cdf1c8318e85fb27499141c84bc7", + "git_blob": "dfed3b8d318a3ab1950957f393307733a4bef3f2", + "use": "Exact product-periodized covariance and contact pin vector; no new parent acceptance." + } + ] +} diff --git a/frontiers/radial_rate_20260930/VALIDATION.md b/frontiers/radial_rate_20260930/VALIDATION.md new file mode 100644 index 000000000..5a4a11b11 --- /dev/null +++ b/frontiers/radial_rate_20260930/VALIDATION.md @@ -0,0 +1,45 @@ +# Author validation and limits + +The initial eight-test mathematics scaffold returned seven failing assertions +(the zero odd-series test already passed on the zero scaffold). After exact +implementation all eight passed. Expanded mathematics tests total21. + +The nineteen-test custody scaffold returned25 failing assertions including +subtests. The implemented verifier passed all19. It rejects changed identities, +missing/duplicate/unexpected source IDs, unsafe or missing paths, noncommit tree +and tag objects, Git symlinks, replacement refs, and altered packet inventories. +The replacement fixture verifies that ordinary Git reads really see the forged +bytes before confirming that the protected verifier still authenticates only +the actual original source. This is a test fixture, not observed source tampering. + +Complete local result:40 tests PASS in each normal and optimized Python mode; +12 exact formal-series parameter cases; eight explicit semantic mutants rejected +with rc1 in each mode; unknown mutant rc2; deterministic baseline equal to +RESULTS.json. The source/packet verifier checks its inventory before and after +execution. No temporary output is placed in the packet during replay. + +Exact controls cover all four shape integrals, formal physical-cutoff equations, +odd-term cancellation, the signed first-order term, the density multiplier13, +the TV crossing at sqrt(13/11), and exact planar Schur regressions. A Decimal +scalar diagnostic checks the constant-density endpoint remainder at three +thresholds; it is a finite diagnostic, not a Gaussian coefficient enclosure. +Exploratory SymPy integration reproduced the shape constants, but SymPy is not +a shipped dependency or a substitute for the analytic derivation. + +Local runtime Python3.13.5, Git2.47.3. The workflow requests Python3.11.16, as in +the actual upstream workflows. All shipped syntax uses standard-library3.11 +features. The local raw.githubusercontent.com request failed with DNS resolution +error, so no complete upstream checkout was obtained. Local-only replay states +source_pins_checked=false. The real three-source authentication remains a +HOSTED requirement, not inferred from local Git fixtures or manifest strings. +No hosted pass is anticipated in this author-time record. + +The full Gaussian derivative domination and L1 smoothness are written analytic +obligations. There is no Lean formalization of this new packet. No numerical +value of C0,C2,Bsign or the critical-moment finite part is evaluated. The retained +sign and the order r->0 before t->infinity are load-bearing qualifications. + +Peer support actually delivered: native review5360751376 accepts PR173 §3 Route C +at its conditional count-estimate scope and requests an explicit diagonal repair +of the alternate fixed-R/moving-cutoff reading. It does not authorize graph +execution or count as an independent review of this conversation's source proofs. diff --git a/frontiers/radial_rate_20260930/rate.py b/frontiers/radial_rate_20260930/rate.py new file mode 100644 index 000000000..d213a2762 --- /dev/null +++ b/frontiers/radial_rate_20260930/rate.py @@ -0,0 +1,170 @@ +"""Exact finite controls for the inverse-radius asymptotic candidate. + +Standard library only. Series calculations are formal algebra, not authentication +of Gaussian premises or a proof of domination/total-variation convergence. +""" +import argparse +from fractions import Fraction as F +import json +from math import comb + +MUTANTS=('omit-shift','omit-density-term','drop-a-shear','odd-term-survives', + 'unsigned-is-signed','wrong-b-integral','wrong-density-factor','wrong-tv-root') + + +def rational(x): + if type(x) not in (int,F): raise TypeError('exact int/Fraction required') + return F(x) + + +def add(a,b): + out=dict(a) + for i,x in b.items():out[i]=out.get(i,F(0))+x + return {i:x for i,x in out.items() if x} + + +def scale(a,c): return {i:x*c for i,x in a.items() if x*c} + + +def mul(a,b): + out={} + for i,x in a.items(): + for j,y in b.items():out[i+j]=out.get(i+j,F(0))+x*y + return {i:x for i,x in out.items() if x} + + +def power(a,n): + out={0:F(1)} + for _ in range(n):out=mul(out,a) + return out + + +def integral(a,lo,hi): + return sum((x*(hi**(i+1)-lo**(i+1))/F(i+1) for i,x in a.items()),F(0)) + + +def shape_integrals(): + b={0:F(3),2:F(-12)};u={1:F(1)};hi={0:F(3),1:F(-6)} + # Q=(4v^2-b^2)(b-4uv); dictionary index is v power. + Q={3:scale(u,-16),2:scale(b,4),1:scale(mul(u,power(b,2)),4),0:scale(power(b,3),-1)} + ans={key:F(0) for key in ('I','U2','B','ABS_U')} + for lo_u,hi_u,sgn_b,sgn_u in ((F(-3,2),F(-1,2),-1,-1),(F(-1,2),F(0),1,-1),(F(0),F(1,2),1,1)): + low=scale(b,F(sgn_b,2));vint={} + for j,c in Q.items(): + difference=add(power(hi,j+1),scale(power(low,j+1),-1)) + vint=add(vint,scale(mul(c,difference),F(1,j+1))) + for key,weight in [('I',{0:F(1)}),('U2',{2:F(1)}),('B',b),('ABS_U',{1:F(sgn_u)})]: + ans[key]+=integral(mul(vint,weight),lo_u,hi_u) + return ans + + +def smul(a,b,n): + out=[F(0)]*(n+1) + for i,x in enumerate(a[:n+1]): + for j,y in enumerate(b[:n+1-i]):out[i+j]+=x*y + return out + + +def spow(a,m,n): + out=[F(1)]+[F(0)]*n + for _ in range(m):out=smul(out,a,n) + return out + + +def endpoints(u,A,g,n): + u,A,g=map(rational,(u,A,g)) + if type(n) is not int or not 0<=n<=12: raise ValueError('series order 0..12 required') + if g<=0 or g*g!=1+A*A: raise ValueError('positive exact gamma^2=1+A^2 required') + inv=[F(0)]*(n+1);root=[F(0)]*(n+1) + binom=F(1) + for j in range(n//2+1): + inv[2*j]=u**(2*j) + if j:binom*= (F(1,2)-(j-1))/j + root[2*j]=g*binom*(-u*u/(g*g))**j + d=smul(inv,root,n) + m=[F(0)]+[-u*A*x for x in inv[:n]] + plus=[x+y for x,y in zip(m,d)];minus=[x-y for x,y in zip(m,d)] + return plus,minus + + +def validate_phi(phi,n): + if not isinstance(phi,dict) or any(type(j) is not int or j<0 for j in phi): + raise ValueError('nonnegative polynomial orders required') + return {j:rational(x) for j,x in phi.items() if j<=n} + + +def tail_series(u,A,g,phi,n): + plus,minus=endpoints(u,A,g,n);phi=validate_phi(phi,n) + out=[F(0)]*(n+1) + for j,c in phi.items(): + p=spow(plus,11+j,n-j);m=spow(minus,11+j,n-j) + for i in range(n-j+1):out[i+j]+=c*(p[i]-m[i])/F(11+j) + return out + + +def half_series(u,A,g,phi,n,sign): + if type(sign) is not int or sign not in (-1,1): raise ValueError('sign must be +/-1') + plus,minus=endpoints(u,A,g,n);phi=validate_phi(phi,n) + endpoint=plus if sign==1 else [-x for x in minus] + out=[F(0)]*(n+1) + for j,c in phi.items(): + p=spow(endpoint,11+j,n-j) + for i in range(n-j+1):out[i+j]+=c*sign**j*p[i]/F(11+j) + return out + + +def density_series(coeffs):return [(11+j)*x for j,x in enumerate(coeffs)] + + +def predicted_second(u,A,g,phi0,phi2): + return u*u*g**9*(1+12*A*A)*phi0+F(2,13)*g**13*phi2 + + +def check(mutant=None): + vals=shape_integrals() + expected={'I':F(246528,35),'U2':F(240192,35),'B':F(-428544,7),'ABS_U':F(5898627,880)} + if mutant=='wrong-b-integral': vals['B']=-vals['B'] + if vals!=expected: raise ValueError('shape integral mismatch') + cases=0 + for u in (F(-5,4),F(-3,4),F(-1,4),F(1,4)): + for p in (F(-1,2),F(0),F(1,3)): + A=2*p/(1-p*p);g=(1+p*p)/(1-p*p) + phi={0:F(2),2:F(-3),3:F(5),4:F(7)} + got=tail_series(u,A,g,phi,6) + if got[0]!=2*g**11*phi[0]/11:raise ValueError('leading coefficient') + guess=predicted_second(u,A,g,phi[0],phi[2]) + if mutant=='omit-shift':guess-=10*u*u*A*A*g**9*phi[0] + if mutant=='omit-density-term':guess-=F(2,13)*g**13*phi[2] + if mutant=='drop-a-shear':guess=predicted_second(u,F(0),F(1),phi[0],phi[2]) + if got[2]!=guess:raise ValueError('second coefficient mismatch') + odd=[got[i] for i in (1,3,5)] + if mutant=='odd-term-survives':odd[0]=1 + if any(odd):raise ValueError('odd inverse powers do not cancel') + hplus=half_series(u,A,g,phi,6,1);hminus=half_series(u,A,g,phi,6,-1) + if [a+b for a,b in zip(hplus,hminus)]!=got:raise ValueError('half sum') + h1=-u*A*g**10*phi[0] + if mutant=='unsigned-is-signed':h1=F(0) + if hplus[1]!=h1:raise ValueError('signed first-order bias') + den=density_series(got) + expected_den=13*got[2] + if mutant=='wrong-density-factor':expected_den=11*got[2] + if den[2]!=expected_den:raise ValueError('radial density coefficient') + cases+=1 + crossing2=F(13,11) if mutant!='wrong-tv-root' else F(11,13) + if F(13,11)/crossing2!=1:raise ValueError('TV crossing root') + return {'passed':True,'mathematical_acceptance':False,'scientific_effect':'NONE', + 'scope':'finite rational coefficient and parity controls only', + 'shape_integrals':{k:str(v) for k,v in expected.items()}, + 'series_cases':cases,'tail_exponents':[11,13,15], + 'unsigned_radial_rate':2,'signed_joint_rate':1,'tv_crossing_squared':str(crossing2)} + + +def main(): + parser=argparse.ArgumentParser(description=__doc__);parser.add_argument('--mutant',choices=MUTANTS) + args=parser.parse_args() + try:result=check(args.mutant) + except ValueError as exc: + print(json.dumps({'passed':False,'error':str(exc)},sort_keys=True));raise SystemExit(1) + print(json.dumps(result,sort_keys=True,indent=2)) + +if __name__=='__main__':main() diff --git a/frontiers/radial_rate_20260930/test_rate.py b/frontiers/radial_rate_20260930/test_rate.py new file mode 100644 index 000000000..4074549e5 --- /dev/null +++ b/frontiers/radial_rate_20260930/test_rate.py @@ -0,0 +1,137 @@ +from fractions import Fraction as F +import unittest +import rate + +class InitialTests(unittest.TestCase): + def test_shape_mass(self): self.assertEqual(rate.shape_integrals()['I'],F(246528,35)) + def test_shape_u2(self): self.assertEqual(rate.shape_integrals()['U2'],F(240192,35)) + def test_shape_b(self): self.assertEqual(rate.shape_integrals()['B'],F(-428544,7)) + def test_shape_abs_u(self): self.assertEqual(rate.shape_integrals()['ABS_U'],F(5898627,880)) + def test_leading_boundary(self): + c=rate.tail_series(F(-3,4),F(3,4),F(5,4),{0:F(1)},4) + self.assertEqual(c[0],2*F(5,4)**11/11) + def test_second_boundary(self): + u,A,g=F(-3,4),F(3,4),F(5,4) + c=rate.tail_series(u,A,g,{0:F(1),2:F(2)},4) + self.assertEqual(c[2],u*u*g**9*(1+12*A*A)+F(4,13)*g**13) + def test_even_series(self): + c=rate.tail_series(F(-3,4),F(3,4),F(5,4),{0:F(1),2:F(2),3:F(7)},6) + self.assertEqual([c[i] for i in (1,3,5)],[0,0,0]) + def test_signed_first_coefficient(self): + u,A,g=F(-3,4),F(3,4),F(5,4) + c=rate.half_series(u,A,g,{0:F(1),2:F(2),3:F(7)},4,1) + self.assertEqual(c[1],-u*A*g**10) + + +class ExtendedTests(unittest.TestCase): + def test_endpoint_equation(self): + for u in (F(-5,4),F(-1,2),F(1,4)): + for p in (F(-1,2),F(0),F(1,3)): + A=2*p/(1-p*p);g=(1+p*p)/(1-p*p);n=8 + for B in rate.endpoints(u,A,g,n): + square=rate.smul(B,B,n) + for j in range(n+1): + value=square[j]-(u*u*square[j-2] if j>=2 else 0) + value+=2*u*A*B[j-1] if j>=1 else 0 + value-=g*g if j==0 else 0 + self.assertEqual(value,0) + def test_general_polynomial_parity(self): + phi={0:F(1),1:F(3),2:F(-5),3:F(7),4:F(2),5:F(-1)} + got=rate.tail_series(F(-4,3),F(3,4),F(5,4),phi,10) + self.assertTrue(all(got[j]==0 for j in (1,3,5,7,9))) + def test_half_reflection(self): + u,A,g=F(-3,4),F(3,4),F(5,4);phi={0:F(2),2:F(-3),3:F(5)} + plus=rate.half_series(u,A,g,phi,8,1);minus=rate.half_series(u,A,g,phi,8,-1) + self.assertEqual(minus,[x*(-1)**j for j,x in enumerate(plus)]) + def test_cubic_density_term_first_enters_at_four(self): + args=F(-3,4),F(3,4),F(5,4) + x=rate.tail_series(*args,{0:F(1)},6);y=rate.tail_series(*args,{0:F(1),3:F(5)},6) + self.assertEqual(x[:4],y[:4]);self.assertNotEqual(x[4],y[4]) + def test_shear_zero_removes_first_signed_bias(self): + got=rate.half_series(F(-3,4),F(0),F(1),{0:F(1),2:F(3),3:F(5)},6,1) + self.assertEqual(got[1],0);self.assertNotEqual(got[3],0) + def test_density_multiplier(self): + coeff=[F(2),0,F(3),0,F(5)] + self.assertEqual(rate.density_series(coeff),[F(22),0,F(39),0,F(75)]) + def test_b_integral_relation(self): + c=rate.shape_integrals();self.assertEqual(c['B'],3*c['I']-12*c['U2']) + def test_constant_density_decimal_remainder(self): + from decimal import Decimal,localcontext + with localcontext() as ctx: + ctx.prec=70;D=Decimal;u=D('-0.75');A=D('0.75');g=D('1.25') + c0=2*g**11/11;c2=u*u*g**9*(1+12*A*A) + vals=[] + for t in (D(40),D(80),D(160)): + delta=1/t;disc=(g*g-u*u*delta*delta).sqrt();den=1-u*u*delta*delta + bp=(-u*A*delta+disc)/den;bm=(-u*A*delta-disc)/den + J=(bp**11-bm**11)/11 + vals.append(abs((J-c0-c2*delta*delta)/delta**4)) + self.assertTrue(all(x0 for x in expected)) + def test_second_correction_positive_in_aligned_case(self): + vals=rate.shape_integrals() + for a in (F(0),F(1),F(-3)): + for k in (F(1,2),F(1),F(2)): + vbeta,vc=F(2),F(6);da=-(a*a/(12*vbeta)+a**4/(576*k*k*vc)) + self.assertGreater(vals['U2'],0) + self.assertGreaterEqual(vals['B']*da,0) + +if __name__=='__main__':unittest.main() diff --git a/frontiers/radial_rate_20260930/test_verify.py b/frontiers/radial_rate_20260930/test_verify.py new file mode 100644 index 000000000..258288f8e --- /dev/null +++ b/frontiers/radial_rate_20260930/test_verify.py @@ -0,0 +1,102 @@ +"""Custody regressions on real local Git objects, never on invented upstream data.""" +import copy +import hashlib +import json +import os +from pathlib import Path +import subprocess +import tempfile +import unittest +import verify as v + + +def entry(path,data,**kw): + return dict(path=path,bytes=len(data),sha256=hashlib.sha256(data).hexdigest(), + git_blob=hashlib.sha1(b'blob '+str(len(data)).encode()+b'\0'+data).hexdigest(),**kw) + +class SourceTests(unittest.TestCase): + def setUp(self): + t=tempfile.TemporaryDirectory();self.addCleanup(t.cleanup);self.repo=Path(t.name) + self.root=self.repo/'frontiers'/'packet';self.root.mkdir(parents=True) + self.git('init','-q');self.data=b'fixture\n' + for name in ('R','SC','P'):(self.repo/(name+'.md')).write_bytes(self.data) + self.git('add','R.md','SC.md','P.md');self.git('commit','-qm','fixture') + self.commit=self.git('rev-parse','HEAD').decode().strip() + self.es=[entry(x+'.md',self.data,id=x,commit=self.commit) for x in ('R','SC','P')];self.write() + def git(self,*args): + env=os.environ.copy();env.pop('GIT_NO_REPLACE_OBJECTS',None) + return subprocess.run(['git','-c','user.name=Fixture','-c','user.email=fixture@example.invalid',*args], + cwd=self.repo,env=env,check=True,capture_output=True,timeout=15).stdout + def write(self,es=None): + (self.root/'SOURCES.json').write_text(json.dumps({'sources':self.es if es is None else es})) + def test_valid_nested(self):self.assertEqual(v.sources(self.root),3) + def test_identity_fields(self): + for k,val in (('bytes',0),('bytes',True),('sha256','0'*64),('git_blob','0'*40)): + es=copy.deepcopy(self.es);es[0][k]=val;self.write(es) + with self.subTest(k=k,val=val),self.assertRaises(ValueError):v.sources(self.root) + def test_missing_and_duplicate_inventory(self): + for es in ([],self.es[:-1],self.es+[self.es[0]]): + self.write(es) + with self.assertRaises(ValueError):v.sources(self.root) + def test_wrong_id(self): + es=copy.deepcopy(self.es);es[0]['id']='X';self.write(es) + with self.assertRaises(ValueError):v.sources(self.root) + def test_unsafe_paths(self): + for p in ('../R.md','/R.md','./R.md','x//R.md','x/../R.md',''): + es=copy.deepcopy(self.es);es[0]['path']=p;self.write(es) + with self.subTest(path=p),self.assertRaises(ValueError):v.sources(self.root) + def test_missing_file(self): + es=copy.deepcopy(self.es);es[0]['path']='missing.md';self.write(es) + with self.assertRaises(ValueError):v.sources(self.root) + def test_noncommit_tree(self): + es=copy.deepcopy(self.es);es[0]['commit']=self.git('rev-parse','HEAD^{tree}').decode().strip();self.write(es) + with self.assertRaises(ValueError):v.sources(self.root) + def test_annotated_tag(self): + self.git('tag','-a','tag','-m','tag');es=copy.deepcopy(self.es) + es[0]['commit']=self.git('rev-parse','tag').decode().strip();self.write(es) + with self.assertRaises(ValueError):v.sources(self.root) + def test_missing_commit(self): + es=copy.deepcopy(self.es);es[0]['commit']='0'*40;self.write(es) + with self.assertRaises(ValueError):v.sources(self.root) + def test_leaf_symlink(self): + (self.repo/'R.md').unlink();(self.repo/'R.md').symlink_to('SC.md');self.git('add','R.md');self.git('commit','-qm','link') + es=copy.deepcopy(self.es);es[0]['commit']=self.git('rev-parse','HEAD').decode().strip();self.write(es) + with self.assertRaises(ValueError):v.sources(self.root) + def test_replacements_disabled(self): + changed=b'forged bytes\n';(self.repo/'R.md').write_bytes(changed);self.git('add','R.md');self.git('commit','-qm','changed') + newer=self.git('rev-parse','HEAD').decode().strip();self.git('replace',self.commit,newer) + self.assertEqual(self.git('show',self.commit+':R.md'),changed) + self.assertEqual(v.sources(self.root),3) + es=copy.deepcopy(self.es);es[0].update(entry('R.md',changed));self.write(es) + with self.assertRaises(ValueError):v.sources(self.root) + +class PacketTests(unittest.TestCase): + def setUp(self): + t=tempfile.TemporaryDirectory();self.addCleanup(t.cleanup);self.root=Path(t.name);self.data=b'payload\n' + (self.root/'proof.md').write_bytes(self.data) + self.entries=[entry('proof.md',self.data)];self.write() + def write(self): (self.root/'MANIFEST.json').write_text(json.dumps({'files':self.entries})) + def test_valid(self):self.assertEqual(v.inventory(self.root),1) + def test_changed(self): + (self.root/'proof.md').write_bytes(b'changed') + with self.assertRaises(ValueError):v.inventory(self.root) + def test_extra(self): + (self.root/'extra').write_bytes(b'x') + with self.assertRaises(ValueError):v.inventory(self.root) + def test_missing(self): + (self.root/'proof.md').unlink() + with self.assertRaises(ValueError):v.inventory(self.root) + def test_duplicate(self): + self.entries+=self.entries;self.write() + with self.assertRaises(ValueError):v.inventory(self.root) + def test_symlink_payload(self): + (self.root/'proof.md').unlink();(self.root/'proof.md').symlink_to('MANIFEST.json') + with self.assertRaises(ValueError):v.inventory(self.root) + def test_symlink_manifest(self): + p=self.root/'MANIFEST.json';p.rename(self.root/'real');p.symlink_to('real') + with self.assertRaises(ValueError):v.inventory(self.root) + def test_json_duplicate(self): + p=self.root/'MANIFEST.json';p.write_text('{"files":[],"files":[]}') + with self.assertRaises(ValueError):v.inventory(self.root) + +if __name__=='__main__':unittest.main() diff --git a/frontiers/radial_rate_20260930/verify.py b/frontiers/radial_rate_20260930/verify.py new file mode 100644 index 000000000..d5789cbe7 --- /dev/null +++ b/frontiers/radial_rate_20260930/verify.py @@ -0,0 +1,104 @@ +"""Exact packet replay; --local-only does not authenticate upstream Git sources.""" +import argparse +import hashlib +import json +import os +from pathlib import Path, PurePosixPath +import re +import subprocess +import sys + +IDS={'R','SC','P'} +MUTANTS=('omit-shift','omit-density-term','drop-a-shear','odd-term-survives', + 'unsigned-is-signed','wrong-b-integral','wrong-density-factor','wrong-tv-root') + + +def read_json(path): + if path.is_symlink() or not path.is_file():raise ValueError('regular JSON file required') + def unique(pairs): + ans={} + for k,v in pairs: + if k in ans:raise ValueError('duplicate JSON key') + ans[k]=v + return ans + ans=json.loads(path.read_text(encoding='utf-8'),object_pairs_hook=unique) + if not isinstance(ans,dict):raise ValueError('JSON object required') + return ans + + +def path_parts(path): + if not isinstance(path,str) or not path:raise ValueError('nonempty path required') + p=PurePosixPath(path) + if p.is_absolute() or str(p)!=path or any(x in ('.','..') or not re.fullmatch('[A-Za-z0-9_.-]+',x) for x in p.parts): + raise ValueError('unsafe path') + return p.parts + + +def identity(data,e): + blob=hashlib.sha1(b'blob '+str(len(data)).encode()+b'\0'+data).hexdigest() + if type(e['bytes']) is not int or len(data)!=e['bytes'] or hashlib.sha256(data).hexdigest()!=e['sha256'] or blob!=e['git_blob']: + raise ValueError('identity mismatch: '+e['path']) + + +def git(root,*args): + run=subprocess.run(['git','--no-replace-objects',*args],cwd=root, + env=dict(os.environ,GIT_NO_REPLACE_OBJECTS='1'),capture_output=True,timeout=45) + if run.returncode:raise ValueError('Git object read failed: '+run.stderr.decode(errors='replace')[:200]) + return run.stdout + + +def sources(root): + es=read_json(root/'SOURCES.json')['sources'] + if not isinstance(es,list) or len(es)!=len(IDS) or {e['id'] for e in es}!=IDS: + raise ValueError('missing, duplicate or unexpected source IDs') + seen=set() + for e in es: + parts=path_parts(e['path']);commit=e['commit'] + if not isinstance(commit,str) or not re.fullmatch('[0-9a-f]{40}',commit):raise ValueError('exact commit required') + pair=(commit,e['path']) + if pair in seen:raise ValueError('duplicate source binding') + seen.add(pair) + if git(root,'cat-file','-t',commit).strip()!=b'commit':raise ValueError('not a commit object') + for j in range(1,len(parts)+1): + prefix='/'.join(parts[:j]);records=git(root,'ls-tree','--full-tree','-z',commit,'--',prefix).split(b'\0') + records=[x for x in records if x] + if len(records)!=1:raise ValueError('missing or ambiguous source path') + meta,name=records[0].split(b'\t',1);mode,kind,blob=meta.decode().split() + if name.decode()!=prefix:raise ValueError('path mismatch') + if j