Active Fedference follows the explicit API retirement inventory and schema contracts below. Domain spellings marked retired in the retirement inventory are rejected; canonical numerical behavior and historical serialized readers are retained.
- Top-level aggregation functions keep their current return behavior:
log_linear_poolreturns an array;robust_aggregateandvariational_aggregatereturnAggregationResult. AggregationConfigplusaggregate_resultis the canonical rich interface.AggregationResult.as_dict()andsolver_statusadd finite JSON diagnostics without changing existing function return types. Status is exactlynominal,converged_with_fallback,not_converged, ornot_converged_with_fallbackaccording to convergence and fallback presence.AgentPosterior,LabeledAggregationRequest,LabeledAggregationResult, andaggregate_labeledare the strict labeled application surface. Request/result schemas are version1.0; semantic hashes include expanded default weights but not JSON formatting. The result retains labels and normalized rows without inferring a decision or scientific interpretation.share_round_result,FederationServer.run_round_result,run_multiprocess_round_result, andrun_socket_round_resultpropagate the canonicalAggregationResult. Frozen results copy stored arrays and mark them read-only. Additional surface retirements follow their assigned migration gates in the retirement inventory.inspect_socket_replayreturnsReplayValidationResultwith stable integrity/solverReplayFindingvalues.validate_socket_replayremains the integrity-only Boolean adapter. Recorded configuration is the default; explicit tuning values assert equality rather than replacing it.RuntimeProvenance,SourceProvenance,runtime_provenance, andcollect_source_provenanceexpose installed runtime/source identity without retaining machine-local installation URLs or inventing source revisions.CalibrationEpisode.local_posteriorsis the canonical calibration input; the retiredbeliefsalias is rejected.CalibrationResultbinds its selected configuration, candidate declarations/scores, episode IDs/content hashes/world families, and primary estimand in a self-verifying canonical digest. A malformed or tampered frozen selection fails closed.- Canonical aggregation vocabulary is
local_posteriors,base_weights,raw_effective_weights, andnormalized_effective_weights; belief/weight spellings listed as retired in the API retirement inventory are rejected.shared_posteriors,global_posterior,site_factor, andloss_by_stateare the corresponding canonical names in sharing, cavity, and generalized-Bayes APIs. fedference.federation.ReplayGuardremains the in-memory compatibility guard.PersistentReplayGuardis the additive restart-durable local option; its SQLiteuser_versionis validated and unknown versions fail closed. Neither class is a multi-host security claim.ExperimentSpec,DatasetSpec, andRunReceiptare versioned research evidence contracts. Their serializedschema_versionis independent of the package version. Receipt schema 1.2 requires runtime provenance; exact legacy schema-1.1 fields remain readable and round-trip with unavailable provenance represented explicitly.ApplicationReceiptschema 1.0 is distinct from a research receipt. It binds exactly canonicalrequest.jsonandresult.json, runtime/source provenance, semantic/configuration hashes, timestamps, and solver health. Completed execution does not imply nominal health, scientific validity, or a decision.- The installed
fedferencecommand exposesaggregate,list,run,benchmark,verify, andreplay.verify --require-nominal-solveris application-only.replay --jsonexposes structured findings and--require-nominal-solvercan strengthen its numerical-health exit policy. - The installed CLI's stable public facade is
fedference_cli.main; the internal_parser,_commands, and_supportmodules are responsibility boundaries rather than public API. Callers use typed domain/evidence APIs instead of importing private CLI helpers. - Torch is optional through the
bnnextra. The defaultfedferenceimport remains NumPy/SciPy-only.fedference.__version__exactly reflects the installedactive_fedferencedistribution, andpy.typeddeclares inline typing to installed consumers. publication.identifiers.manuscript_pdf_filenameis the canonical version-and-DOI-bound top-level manuscript filename helper; clean-checkout and release tooling use it instead of embedding a historical release name.- Publication identity has two valid states: an
X.Y.Z.devNdevelopment build has no DOI or release date, while a finalX.Y.Zbuild has both and requirespaper.dateto exactly matchpublication.date_released. Package and manuscript versions must match. Historical version-named PDFs remain tracked; a development state does not require a new PDF, while a final state requires the exact version/DOI-derived file.
Experimental comparators, theory witnesses, recovery fixtures, and planned registry runners may evolve while their roadmap item remains open. Their documentation must say when they are outside the stable dispatch.
The resolved owner decisions in the retirement inventory authorize the current breaking API migrations. Each assigned migration must update active callers and guidance, preserve scientific controls and numerical meaning, and pass its verification gates before its surface is removed. This authorization does not permit silently reinterpreting serialized fields or rewriting historical evidence. Release authorization remains separate.
Outside that resolved inventory, API and schema changes require an explicit migration plan. Additive fields, methods, experiments, profiles, and schema versions must keep their documented semantics.
The v1.1 shape correction is the one intentional fail-closed compatibility change: an externally supplied categorical PMF or weight must already be one- dimensional. Row matrices, column matrices, and higher-rank tensors are no longer flattened implicitly. Valid lists, one-dimensional NumPy arrays, and an outer iterable yielding valid row vectors continue to work. Callers with a known singleton dimension must remove it explicitly and assert the resulting shape before entering the library.
The report-schema migration used by this review is explicit: robustness_sweep
is schema 2.0 and uses d_equivalent plus headline tie, mean-difference, and
worst-rate disclosure fields; robust_influence_weights is schema 2.0 and
uses normalized_effective_weights; the heuristic-characterization report is
schema 2.0 and binds scoped no-go metadata; the review-grid report is schema
1.1. Its schema-1.0 predecessor is retained only as historical evidence and
is not accepted by the current reader. Readers fail closed on unsupported
declared versions. The legacy cohens_d
report field and agent_weights output key may be read only as compatibility
data while their deprecation path remains documented. The federation wire key
agent_weights is intentionally retained and is not silently reinterpreted; a
wire migration requires a versioned envelope change.
from fedference import AggregationConfig, aggregate_result
local_posteriors = [[0.70, 0.20, 0.10], [0.60, 0.30, 0.10]]
# Raw coefficients are log-pooling exponents; they are not normalized first.
base_weights = [0.75, 0.25]
config = AggregationConfig(method="robust", robustness=1.5)
result = aggregate_result(
local_posteriors,
config=config,
base_weights=base_weights,
)
influence = result.normalized_effective_weights
raw = result.raw_effective_weightsScaling every raw base_weights coefficient can change consensus concentration;
only normalized_effective_weights is a normalized diagnostic. Process and
loopback convenience adapters currently use uniform base weights. The executable
interface comparison and transport examples are in
examples/README.md.
Use local_posteriors and base_weights for numerical inputs, and
normalized_effective_weights for relative-influence diagnostics.
aggregate_result selects method and solver controls through AggregationConfig;
its per-call base_weights retain their raw exponent semantics.
Future deprecations outside the resolved retirement inventory require:
- a migration note with old and new examples;
- a runtime warning for at least one minor release;
- parity tests during the warning period; and
- removal no earlier than the next allowed release boundary.
Serialized schemas fail closed on missing, wrong-typed, unsupported-version,
digest-mismatched, or non-standard non-finite JSON data (NaN / Infinity).
Supported schema versions may carry additive fields so older readers can remain
forward-compatible; a versioned reader must reject an unsupported declared
version and must not guess how to coerce or reinterpret its fields. Required
fields remain explicit at the write boundary.
CLI write commands require an explicit empty --output-dir and never overwrite
the committed reviewer snapshot. fedference aggregate validates request,
provenance requirements, and destination safety before creating its output and
atomically writes request, result, then receipt. Smoke and pilot profiles may test mechanics or
select budgets, but only a locked confirmatory profile can enter a citable
evidence pack. Negative scientific outcomes are compatible with release;
malformed reports, failed controls, stale receipts, or provenance mismatches are
not.
Benchmark reports record solver-health counts (*_fallback_predictions,
*_nonconverged_predictions, and *_max_iterations) separately from
predictive estimands. Receipts summarize affected dataset/seed/method cells,
without treating prediction rows or nested seeds as independent replications.
Development receipts may record a dirty tree and still verify their exact
config/output bytes. Application verification reports artifact integrity and
source equivalence as separate levels; source equivalence is checked only when
requested and available. Research publication verification uses fedference verify --require-clean-git; the recorded and live full commit, clean tree
state, and uv.lock digest must then match. An application or research receipt
never establishes scientific validity by itself.