Audit pass: full-corpus evidence, full-gate mutation, 3-way metamorphic, recomputable causal, bundle attestation
1 (artifact bundle): ci_reports writes evidence/MANIFEST.tsv (content hash+len of every evidence file); attestation verifies completeness+integrity; merge-gates requires the bundle. 2 (every leaf full evidence): run_all_to streams a full trace+delta record for EVERY leaf (base 'b' and perturbation 'p'), not a sample. 3 (attestation completeness): attestation enforces a leaf<->trace bijection (traces == leaves and covered set == leaf set), not just consistency. 4 (collapse derives from full traces): trace_feature_row single-sourced into collapse_analysis; attestation recomputes each collapse row from the retained full trace and requires bit-exact match. 5 (mutants through full gates): evaluate_mutants runs each mutant through engine_acceptance over 128 generated cases (trace/equivalence/domain/ metamorphic/causal), replacing the 64-input local predicates. 6 (trace+delta+future): metamorphic enforces consumed->trace per-case plus consumed-aggregate delta (>=0.65) and future (>=0.80) rates. 7 (recomputable causal): per-edge intervention records written to evidence/causal_evidence.tsv; attestation RE-EXECUTES each from its seed and recomputes base_dv/alt_dv. 8 (no string/comment proof): removed web_assets JS-substring test and the tautological string assert in ci_reports. Verified at fast scale end-to-end: 6600/6600 traces reconstructed, leaf bijection, 1600/1600 causal records recomputed, 600/600 collapse rows derived, bundle intact. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -21,7 +21,46 @@
|
||||
pub mod linalg;
|
||||
|
||||
use linalg::{ols_r2, pca_scores, Mat};
|
||||
use world_model::NUM_DOMAINS;
|
||||
use trace_model::ExecutionTrace;
|
||||
use world_model::{WorldDelta, NUM_DOMAINS};
|
||||
|
||||
/// The single definition of a trace feature row. The collapse corpus is built
|
||||
/// from these rows; an attestor recomputes the same row from the retained FULL
|
||||
/// trace and delta and checks equality, which is how the summary is proven to
|
||||
/// derive from the full trace. Layout per domain block (`BLOCK_W`):
|
||||
/// `[infl_out, infl_in, flow_out, flow_in, read, write, temporal, obs_delta,
|
||||
/// hid_delta]`, then globals `[causal_rank, edge_count, touched, divergence]`.
|
||||
pub fn trace_feature_row(trace: &ExecutionTrace, delta: &WorldDelta) -> Vec<f64> {
|
||||
let infl = trace.causal_graph.influence_matrix();
|
||||
let mut flow = [[0.0f64; NUM_DOMAINS]; NUM_DOMAINS];
|
||||
for &(a, b, bits) in &trace.information_flow.edges {
|
||||
flow[a as usize % NUM_DOMAINS][b as usize % NUM_DOMAINS] += bits as f64;
|
||||
}
|
||||
let mut temporal = [0.0f64; NUM_DOMAINS];
|
||||
for &(_s, _off, d) in &trace.temporal_graph.edges {
|
||||
temporal[d as usize % NUM_DOMAINS] += 1.0;
|
||||
}
|
||||
let mut row = Vec::with_capacity(FEATURE_W);
|
||||
for d in 0..NUM_DOMAINS {
|
||||
let infl_out: f64 = (0..NUM_DOMAINS).map(|j| infl[d][j]).sum();
|
||||
let infl_in: f64 = (0..NUM_DOMAINS).map(|i| infl[i][d]).sum();
|
||||
let flow_out: f64 = (0..NUM_DOMAINS).map(|j| flow[d][j]).sum();
|
||||
let flow_in: f64 = (0..NUM_DOMAINS).map(|i| flow[i][d]).sum();
|
||||
let read = trace.read_graph.access_count[d] as f64;
|
||||
let write = trace.write_graph.access_count[d] as f64;
|
||||
let temp = temporal[d];
|
||||
let obs_delta: f64 = delta.domain_deltas[d].observed.iter().map(|&v| (v as f64).abs()).sum();
|
||||
let hid_delta: f64 = delta.domain_deltas[d].hidden.iter().map(|&v| (v as f64).abs()).sum();
|
||||
row.extend_from_slice(&[
|
||||
infl_out, infl_in, flow_out, flow_in, read, write, temp, obs_delta, hid_delta,
|
||||
]);
|
||||
}
|
||||
row.push(trace.causal_rank() as f64);
|
||||
row.push(trace.causal_edge_count() as f64);
|
||||
row.push(trace.touched_domain_count() as f64);
|
||||
row.push(trace.context_divergence());
|
||||
row
|
||||
}
|
||||
|
||||
/// Width of one per-domain feature block in a trace feature row.
|
||||
/// `[infl_out, infl_in, flow_out, flow_in, read, write, temporal, obs_delta, hid_delta]`
|
||||
|
||||
Reference in New Issue
Block a user