fix(experiments): bind native claims to observed source evidence

Check derived view identities against all earlier producer references. Grade DOS load-image claims only from completed, referenced producer responses, including their actual target and entry identity. Focused synthetic negative transcripts and original real transcript regrades verify the boundary without model reruns.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
This commit is contained in:
N0zoM1z0
2026-10-12 15:49:34 +00:00
co-authored by factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
parent aada535dea
commit 0667f7cb7c
4 changed files with 205 additions and 11 deletions
@@ -154,6 +154,11 @@ parent ID, while `retained_views` holds its item, coverage, limitations and unkn
DOS load-image facts retain their source ID and must match the selected carrier
digest before their entry address can be used; a stale result closes the session
without querying a procedure.
Derived view IDs are checked against every prior producer reference as well as
other derived views. DOS model grades require the actual completed load-image
response and its reported source ID; status, digest, entry and supplied metadata
are checked against that observation. Missing, failed or unreferenced responses
cannot establish load-image verification.
The comparator preserves both runs' reference maps and compares the facts. Existing
`entry`/`entry-and-main` answers keep their ID arrays. Historical SDK receipts above
retain their original pre-review representation; no replies or measurements were
@@ -4,11 +4,17 @@ import { isDeepStrictEqual } from "node:util";
export const NATIVE_ARTIFACTS = ["jq", "sharex.exe", "freedos.edlin.exe"];
const normalized = (value) => value.normalized_result;
const retainedEntryViews = async (call, info, inputSha, ToolFailure) => {
const retainedEntryViews = async (
call,
info,
inputSha,
ToolFailure,
sourceEvidenceIds,
) => {
const n = normalized(info);
const retainedViews = [];
const retainedViewEvidence = [];
const observedEvidenceIds = new Set([info.evidence_id]);
const observedEvidenceIds = new Set([info.evidence_id, ...sourceEvidenceIds]);
let nativeSummaryOutcome, summaryEvidenceId;
for (const facet of ["procedure", "pseudocode", "callers", "callees"]) {
const selected = await call("inspect_analysis_view", {
@@ -175,7 +181,10 @@ export const measureNativeEntry = async ({
const n = normalized(info);
const selected =
values["native-question"] === "entry-views"
? await retainedEntryViews(call, info, inputSha, ToolFailure)
? await retainedEntryViews(call, info, inputSha, ToolFailure, [
containing.evidence_id,
...(loadImageEvidenceId === undefined ? [] : [loadImageEvidenceId]),
])
: {};
const { main, mainEvidenceIds = [] } =
values["native-question"] === "entry-and-main"
@@ -216,15 +216,27 @@ def main():
check('procedure.body_ranges', procedure.get('body_ranges', body.get('ranges', body.get('ranges_inclusive'))), expected['body']['ranges'])
check('procedure.total_bytes', procedure.get('total_bytes', body.get('total_bytes')), expected['body']['total_bytes'])
if 'load_image' in reference:
load = reference['load_image']
sources = [source for source in producer_results.get('inspect_native_load_image', [])
if isinstance(source, dict)
and source.get('operation') == 'inspect_native_load_image'
and isinstance(source.get('evidence_id'), str)
and source.get('evidence_id') in reported_ids
and isinstance(source.get('normalized_result'), dict)]
checks['load_image_source_observed_and_referenced'] = bool(sources)
load = sources[-1]['normalized_result'] if sources else {}
entry = load.get('entry')
entry = entry if isinstance(entry, dict) else {}
check('load_image.target_sha256', load.get('target_sha256'), reference['artifact_sha256'])
check('load_image.source_status', load.get('status'), reference['load_image']['status'])
check('load_image.source_entry', entry.get('linear_address'), reference['entry_address'])
status = answer.get('load_image_status')
check('load_image_status', status.get('status') if isinstance(status, dict) else status, load['status'])
check('load_image_status', status.get('status') if isinstance(status, dict) else status, load.get('status'))
if isinstance(status, dict):
for key in ['format', 'load_segment', 'header_bytes', 'module_bytes', 'overlay_bytes']:
if key in status:
check('load_image.' + key, status[key], load[key])
check('load_image.' + key, status[key], load.get(key))
if 'entry_linear_address' in status:
check('load_image.entry_linear_address', status['entry_linear_address'], load['entry']['linear_address'])
check('load_image.entry_linear_address', status['entry_linear_address'], entry.get('linear_address'))
calls = summary['completed_mcp_calls']
checks['default_analysis_not_disabled'] = all(not call['arguments'].get('skip_auto_analysis', False) for call in calls if call['tool'] == 'open_binary')
checks['session_close_completed'] = any(call['tool'] == 'close_binary' and call['status'] == 'completed' for call in calls)