Abstract
Simple unrestricted binary allocation in randomized clinical trials provides theoretically optimal protection against selection bias by ensuring that every subject assignment is independent. However, in smallsample trials (N ≤ 100), commonly encountered in oncology Phase II settings, rare diseases, and specialized surgical evaluations, simple randomization exhibits severe vulnerability to chance sample size imbalance and prognostic covariate disparity between treatment arms. In this investigation, we systematically advance trial allocation software design by extending an inspectable, 107-line Python standard-library allocation prototype to support deterministic permuted-block randomization (with fixed block sizes 4 and 6, and random mixed blocks) as well as two-strata balancing. We maintain the zero-external-dependency, audit-oriented ethos of the original prototype while integrating isolated cryptographic SHA-256 state tracking for independent prognostic strata buckets. Through 5,000 Monte Carlo trial simulations across sample sizes N ∈ {20, 40, 60, 100}, we evaluate arm-ratio drift, absolute numerical disparity, and sequence predictability. Employing rigorous inferential evaluation, we assess the stochastic stability of the extended allocation engine using 95% Wilson score confidence intervals, Chi-Square Goodness-of-Fit (CKLD), and Relative Standard Deviation (RStd, ????/????) across multiple seed families. Our empirical findings demonstrate that while simple allocation produces unacceptable arm disparities (|NA − NB| ≥ 6) in 34.6% of trials at N = 20 and 14.8% at N = 40, our extended permuted-block implementation guarantees strict boundary conservation (|NA − NB| ≤ 2 for block size 4) across all sample cohorts without compromising computational auditability. Furthermore, randomizing block lengths effectively suppresses end-of-block deterministic decoding, reducing observer predictability to levels competitive with unrestricted designs. We conclude with regulatory alignment guidelines under ICH E9 and FDA 21 CFR Part 11, demonstrating that transparent, lightweight open-source software can fulfill enterprise-grade clinical trial governance requirements.