From 6522f40ab7971eb0e7ae5e23216894431b9b5953 Mon Sep 17 00:00:00 2001 From: LoopX Agent <337587101+loopx-agent@users.noreply.github.com> Date: Fri, 6 Nov 2026 15:07:03 +0800 Subject: [PATCH 1/3] feat(research): preserve selection when importing native usage versions Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com> --- .../research-usage-real-captures.json | 300 ++++++++++++++---- docs/reference/trajectory-assessment.md | 7 + .../trajectory_assessment_store.py | 4 +- loopx/cli_commands/benchmark_trajectory.py | 3 + .../test_trajectory_assessment_store.py | 41 ++- 5 files changed, 287 insertions(+), 68 deletions(-) diff --git a/apps/presentation/dashboard/src/data/fixtures/research-usage-real-captures.json b/apps/presentation/dashboard/src/data/fixtures/research-usage-real-captures.json index 3fc90bb8bb..b5e5b3dfd9 100644 --- a/apps/presentation/dashboard/src/data/fixtures/research-usage-real-captures.json +++ b/apps/presentation/dashboard/src/data/fixtures/research-usage-real-captures.json @@ -1,6 +1,6 @@ { "schema_version": "research_usage_display_fixture_v1", - "boundary": "Frozen display projections of four registered first-nine-hour solver captures. No raw prompts, tool arguments, trajectories, scoring internals or billing data. Descriptive observations, not live execution, matched-study qualification or causal benefit.", + "boundary": "Frozen native HTTP readbacks of four registered successor versions of first-nine-hour solver captures. The original owner registered these exact IDs and preserved its existing default. This fixture selects four captures for display; it does not reproduce the entire live catalog. No raw prompts, tool arguments, trajectories, scoring internals or billing data. Descriptive observations, not matched-study qualification or causal benefit.", "methods": { "request_counters": "codex_request_reconciliation_v1", "command_association": "codex_ordered_loopx_requests_v1", @@ -9,30 +9,30 @@ "lineage": [ { "original_pack_id": "68e433daa1b2f13318f683164004afc799e604fc4fdc7e0ba1cb1bc7e2c24307", - "candidate_pack_id": "691b0e483bdfb23ba3076ee69053008662de2bc04bee6c18f8af657c95704f71", + "registered_pack_id": "b62f232a035b5e4a2638d6d263d19c6d9855714152182ff6c529e8080a09a0eb", "source_sha256": "78a399ae364790c30481e448276c9dddb57b00ee1ddc61300110d45673243be8" }, { "original_pack_id": "247d226ac836938e63281ced05ad04c4e5326883e81a2ea6846aa4f48c0086dc", - "candidate_pack_id": "7402d72472caa8c3f956643ceeead684691a36d3ae5f0d7438cfb11b838a841f", + "registered_pack_id": "7da33d179fdfecbeed503422e375beaae2f26972d3f510dec2a4681a14b85397", "source_sha256": "a6a0acf70df5dde067ee06de20a5c3f28fde9f245714b2dfca206cfe5e7e0e25" }, { "original_pack_id": "c3e4fb9bfd4f00360d96ba06f0a606d86ee0caa30ec4778144d7fb9cd5f8a469", - "candidate_pack_id": "9dd0a7e3457f190f19140db65fdc2e79c341bd12d84daa2d20bada99ebdece78", + "registered_pack_id": "50431e7827df714d18c26bba99e0eebcfd9a08025fe08b7dadc03d16b7a70b73", "source_sha256": "c94b4715cf57c45b9a680bb803c79601f0424eb9b166cf63ee38044fa26ce37f" }, { "original_pack_id": "e36bf9c8c69f798822272755892ce040bf425fd248a1c241db4b2515265a2c87", - "candidate_pack_id": "0879d189427e61688e2ff28b0ffd5949f149f62f2297a2f39ca3cc5335bcb709", + "registered_pack_id": "03d6ae56a332acc6496683268124ed41cd9c7746d404ddb6729874ab4d7bdd4a", "source_sha256": "00c024cd300a8521a8246410c6459c75610b217b6a1317314a4796ac086ab2e1" } ], "packs": [ { "ok": true, - "pack_id": "691b0e483bdfb23ba3076ee69053008662de2bc04bee6c18f8af657c95704f71", - "title": "Codec · context-on · 前 9 小时控制开销", + "pack_id": "b62f232a035b5e4a2638d6d263d19c6d9855714152182ff6c529e8080a09a0eb", + "title": "Codec · context-on · 前 9 小时控制开销 · 请求关联", "scope": { "goal_id": "benchmark-goal", "case_id": "Codec", @@ -2051,12 +2051,53 @@ ], "job": null, "result": null, - "applicability": "current" + "applicability": "current", + "continuation": { + "base_analysis_key": "0172207e4029bbe2df136fd0baa500d0dba8e388038056f33e370f8e8ae724f7", + "base_scope": { + "goal_id": "benchmark-goal", + "case_id": "Codec", + "run_id": "codec-sol-xhigh-03-explore-on-fourarm-r12-a2", + "revision": "b2b95bb60725ea9d43a1308947bc34de33ff6946", + "window": "First 9 hours from solver start, native receipt time [start,end), all captured responses." + }, + "current_scope": { + "goal_id": "benchmark-goal", + "case_id": "Codec", + "run_id": "codec-sol-xhigh-03-explore-on-fourarm-r12-a2", + "revision": "b2b95bb60725ea9d43a1308947bc34de33ff6946", + "window": "First 9 hours from solver start, native receipt time [start,end), all captured responses." + }, + "sources": { + "added": [], + "revised": [], + "removed": [] + }, + "episodes": { + "added": [], + "revised": [], + "removed": [] + }, + "can_reuse": false, + "configuration_changed": false, + "objective_changed": false, + "reassessed_episode_ids": [ + "observed-control" + ], + "new_pair_count": 0, + "removed_pair_count": 0, + "compared_pair_count": null, + "verdict_changes": [], + "base_pack_id": "68e433daa1b2f13318f683164004afc799e604fc4fdc7e0ba1cb1bc7e2c24307", + "base_title": "Codec · context-on · 前 9 小时控制开销", + "base_available": false, + "base_episode_count": 1 + } }, { "ok": true, - "pack_id": "7402d72472caa8c3f956643ceeead684691a36d3ae5f0d7438cfb11b838a841f", - "title": "Codec · context-off · 前 9 小时控制开销", + "pack_id": "7da33d179fdfecbeed503422e375beaae2f26972d3f510dec2a4681a14b85397", + "title": "Codec · context-off · 前 9 小时控制开销 · 请求关联", "scope": { "goal_id": "benchmark-goal", "case_id": "Codec", @@ -3021,12 +3062,53 @@ ], "job": null, "result": null, - "applicability": "current" + "applicability": "current", + "continuation": { + "base_analysis_key": "2e3a1001ffa8e893a0a77b08f12dd5e487b4ea31bf4ba253c7c045134e085483", + "base_scope": { + "goal_id": "benchmark-goal", + "case_id": "Codec", + "run_id": "codec-sol-xhigh-03-explore-off-fourarm-r12-a2", + "revision": "b2b95bb60725ea9d43a1308947bc34de33ff6946", + "window": "First 9 hours from solver start, native receipt time [start,end), all captured responses." + }, + "current_scope": { + "goal_id": "benchmark-goal", + "case_id": "Codec", + "run_id": "codec-sol-xhigh-03-explore-off-fourarm-r12-a2", + "revision": "b2b95bb60725ea9d43a1308947bc34de33ff6946", + "window": "First 9 hours from solver start, native receipt time [start,end), all captured responses." + }, + "sources": { + "added": [], + "revised": [], + "removed": [] + }, + "episodes": { + "added": [], + "revised": [], + "removed": [] + }, + "can_reuse": false, + "configuration_changed": false, + "objective_changed": false, + "reassessed_episode_ids": [ + "observed-control" + ], + "new_pair_count": 0, + "removed_pair_count": 0, + "compared_pair_count": null, + "verdict_changes": [], + "base_pack_id": "247d226ac836938e63281ced05ad04c4e5326883e81a2ea6846aa4f48c0086dc", + "base_title": "Codec · context-off · 前 9 小时控制开销", + "base_available": false, + "base_episode_count": 1 + } }, { "ok": true, - "pack_id": "9dd0a7e3457f190f19140db65fdc2e79c341bd12d84daa2d20bada99ebdece78", - "title": "Grid · context-on · 前 9 小时控制开销", + "pack_id": "50431e7827df714d18c26bba99e0eebcfd9a08025fe08b7dadc03d16b7a70b73", + "title": "Grid · context-on · 前 9 小时控制开销 · 请求关联", "scope": { "goal_id": "benchmark-goal", "case_id": "Grid", @@ -4594,12 +4676,53 @@ ], "job": null, "result": null, - "applicability": "current" + "applicability": "current", + "continuation": { + "base_analysis_key": "17799648ca9ed556072036467c282a917e91e43bb6e48e0e2cac2c91d0d3ff5f", + "base_scope": { + "goal_id": "benchmark-goal", + "case_id": "Grid", + "run_id": "grid-sol-xhigh-stride-context-on-20261104-18h-r10-auth01", + "revision": "603a75e5f197a0c2cf2cd575fbdfc168a8c6be7b", + "window": "First 9 hours from solver start, native receipt time [start,end), all captured responses." + }, + "current_scope": { + "goal_id": "benchmark-goal", + "case_id": "Grid", + "run_id": "grid-sol-xhigh-stride-context-on-20261104-18h-r10-auth01", + "revision": "603a75e5f197a0c2cf2cd575fbdfc168a8c6be7b", + "window": "First 9 hours from solver start, native receipt time [start,end), all captured responses." + }, + "sources": { + "added": [], + "revised": [], + "removed": [] + }, + "episodes": { + "added": [], + "revised": [], + "removed": [] + }, + "can_reuse": false, + "configuration_changed": false, + "objective_changed": false, + "reassessed_episode_ids": [ + "observed-control" + ], + "new_pair_count": 0, + "removed_pair_count": 0, + "compared_pair_count": null, + "verdict_changes": [], + "base_pack_id": "c3e4fb9bfd4f00360d96ba06f0a606d86ee0caa30ec4778144d7fb9cd5f8a469", + "base_title": "Grid · context-on · 前 9 小时控制开销", + "base_available": false, + "base_episode_count": 1 + } }, { "ok": true, - "pack_id": "0879d189427e61688e2ff28b0ffd5949f149f62f2297a2f39ca3cc5335bcb709", - "title": "Grid · context-off · 前 9 小时控制开销", + "pack_id": "03d6ae56a332acc6496683268124ed41cd9c7746d404ddb6729874ab4d7bdd4a", + "title": "Grid · context-off · 前 9 小时控制开销 · 请求关联", "scope": { "goal_id": "benchmark-goal", "case_id": "Grid", @@ -5117,12 +5240,53 @@ ], "job": null, "result": null, - "applicability": "current" + "applicability": "current", + "continuation": { + "base_analysis_key": "7418b7d7b9adad1a9d68e08a79973874a73151e6408a6913010f4c78fe71826e", + "base_scope": { + "goal_id": "benchmark-goal", + "case_id": "Grid", + "run_id": "grid-sol-xhigh-stride-context-off-20261104-18h-r10-auth01", + "revision": "603a75e5f197a0c2cf2cd575fbdfc168a8c6be7b", + "window": "First 9 hours from solver start, native receipt time [start,end), all captured responses." + }, + "current_scope": { + "goal_id": "benchmark-goal", + "case_id": "Grid", + "run_id": "grid-sol-xhigh-stride-context-off-20261104-18h-r10-auth01", + "revision": "603a75e5f197a0c2cf2cd575fbdfc168a8c6be7b", + "window": "First 9 hours from solver start, native receipt time [start,end), all captured responses." + }, + "sources": { + "added": [], + "revised": [], + "removed": [] + }, + "episodes": { + "added": [], + "revised": [], + "removed": [] + }, + "can_reuse": false, + "configuration_changed": false, + "objective_changed": false, + "reassessed_episode_ids": [ + "observed-control" + ], + "new_pair_count": 0, + "removed_pair_count": 0, + "compared_pair_count": null, + "verdict_changes": [], + "base_pack_id": "e36bf9c8c69f798822272755892ce040bf425fd248a1c241db4b2515265a2c87", + "base_title": "Grid · context-off · 前 9 小时控制开销", + "base_available": false, + "base_episode_count": 1 + } } ], "readback_identities": { "original": { - "691b0e483bdfb23ba3076ee69053008662de2bc04bee6c18f8af657c95704f71": { + "b62f232a035b5e4a2638d6d263d19c6d9855714152182ff6c529e8080a09a0eb": { "analysis_key": "0172207e4029bbe2df136fd0baa500d0dba8e388038056f33e370f8e8ae724f7", "method_version": "research-episodes-synthesis-v2", "config": { @@ -5137,7 +5301,7 @@ "reason_code": null, "applicability": "current" }, - "7402d72472caa8c3f956643ceeead684691a36d3ae5f0d7438cfb11b838a841f": { + "7da33d179fdfecbeed503422e375beaae2f26972d3f510dec2a4681a14b85397": { "analysis_key": "2e3a1001ffa8e893a0a77b08f12dd5e487b4ea31bf4ba253c7c045134e085483", "method_version": "research-episodes-synthesis-v2", "config": { @@ -5152,7 +5316,7 @@ "reason_code": null, "applicability": "current" }, - "9dd0a7e3457f190f19140db65fdc2e79c341bd12d84daa2d20bada99ebdece78": { + "50431e7827df714d18c26bba99e0eebcfd9a08025fe08b7dadc03d16b7a70b73": { "analysis_key": "17799648ca9ed556072036467c282a917e91e43bb6e48e0e2cac2c91d0d3ff5f", "method_version": "research-episodes-synthesis-v2", "config": { @@ -5167,7 +5331,7 @@ "reason_code": null, "applicability": "current" }, - "0879d189427e61688e2ff28b0ffd5949f149f62f2297a2f39ca3cc5335bcb709": { + "03d6ae56a332acc6496683268124ed41cd9c7746d404ddb6729874ab4d7bdd4a": { "analysis_key": "7418b7d7b9adad1a9d68e08a79973874a73151e6408a6913010f4c78fe71826e", "method_version": "research-episodes-synthesis-v2", "config": { @@ -5184,7 +5348,7 @@ } }, "zh": { - "691b0e483bdfb23ba3076ee69053008662de2bc04bee6c18f8af657c95704f71": { + "b62f232a035b5e4a2638d6d263d19c6d9855714152182ff6c529e8080a09a0eb": { "analysis_key": "dc82b17cbc9f0032414998510e322cbdbd00f36dfcbc59e6f51fc0c4d1a3b61c", "method_version": "research-episodes-synthesis-v2", "config": { @@ -5200,7 +5364,7 @@ "reason_code": null, "applicability": "current" }, - "7402d72472caa8c3f956643ceeead684691a36d3ae5f0d7438cfb11b838a841f": { + "7da33d179fdfecbeed503422e375beaae2f26972d3f510dec2a4681a14b85397": { "analysis_key": "10819e336b9fd9cd0fcd7db5897caa2d2586c766f918df412218b6c231c5240f", "method_version": "research-episodes-synthesis-v2", "config": { @@ -5216,7 +5380,7 @@ "reason_code": null, "applicability": "current" }, - "9dd0a7e3457f190f19140db65fdc2e79c341bd12d84daa2d20bada99ebdece78": { + "50431e7827df714d18c26bba99e0eebcfd9a08025fe08b7dadc03d16b7a70b73": { "analysis_key": "4392e2af58152e176f9849a5bc4cdbbfb11ff12fa5a146f4dd4f3c6d8788708a", "method_version": "research-episodes-synthesis-v2", "config": { @@ -5232,7 +5396,7 @@ "reason_code": null, "applicability": "current" }, - "0879d189427e61688e2ff28b0ffd5949f149f62f2297a2f39ca3cc5335bcb709": { + "03d6ae56a332acc6496683268124ed41cd9c7746d404ddb6729874ab4d7bdd4a": { "analysis_key": "e30ecaab927a3bca4fb3e2c42c1f444907022e14a0f8b078d058835a212b7391", "method_version": "research-episodes-synthesis-v2", "config": { @@ -5250,7 +5414,7 @@ } }, "en": { - "691b0e483bdfb23ba3076ee69053008662de2bc04bee6c18f8af657c95704f71": { + "b62f232a035b5e4a2638d6d263d19c6d9855714152182ff6c529e8080a09a0eb": { "analysis_key": "e8163948fa0876d8a9be623c2d7a9de1c81785745b016f3b86281d90b28de486", "method_version": "research-episodes-synthesis-v2", "config": { @@ -5266,7 +5430,7 @@ "reason_code": null, "applicability": "current" }, - "7402d72472caa8c3f956643ceeead684691a36d3ae5f0d7438cfb11b838a841f": { + "7da33d179fdfecbeed503422e375beaae2f26972d3f510dec2a4681a14b85397": { "analysis_key": "f91b908be05fe07f96dac887ae6fd53438c61e76af2f5d6bb199fa2cd20fb500", "method_version": "research-episodes-synthesis-v2", "config": { @@ -5282,7 +5446,7 @@ "reason_code": null, "applicability": "current" }, - "9dd0a7e3457f190f19140db65fdc2e79c341bd12d84daa2d20bada99ebdece78": { + "50431e7827df714d18c26bba99e0eebcfd9a08025fe08b7dadc03d16b7a70b73": { "analysis_key": "3c80c648fed4881d30820900fab4cc34ab052d99dccc7d6d0505cf99eb60dbd7", "method_version": "research-episodes-synthesis-v2", "config": { @@ -5298,7 +5462,7 @@ "reason_code": null, "applicability": "current" }, - "0879d189427e61688e2ff28b0ffd5949f149f62f2297a2f39ca3cc5335bcb709": { + "03d6ae56a332acc6496683268124ed41cd9c7746d404ddb6729874ab4d7bdd4a": { "analysis_key": "551bfe777e1c9da60a6a384daf0792e9d19c335a68b8e3e8508a31c3a20f1a18", "method_version": "research-episodes-synthesis-v2", "config": { @@ -5317,17 +5481,17 @@ } }, "owner_goal_id": "edgebench-research-20261004", - "default_pack_id": "0879d189427e61688e2ff28b0ffd5949f149f62f2297a2f39ca3cc5335bcb709", + "default_pack_id": "03d6ae56a332acc6496683268124ed41cd9c7746d404ddb6729874ab4d7bdd4a", "comparisons": { - "691b0e483bdfb23ba3076ee69053008662de2bc04bee6c18f8af657c95704f71:7402d72472caa8c3f956643ceeead684691a36d3ae5f0d7438cfb11b838a841f": { + "b62f232a035b5e4a2638d6d263d19c6d9855714152182ff6c529e8080a09a0eb:7da33d179fdfecbeed503422e375beaae2f26972d3f510dec2a4681a14b85397": { "ok": true, "comparison": { "method": "trajectory_usage_comparison_v1", "status": "observed", "qualification": "descriptive_only", "left": { - "pack_id": "691b0e483bdfb23ba3076ee69053008662de2bc04bee6c18f8af657c95704f71", - "title": "Codec · context-on · 前 9 小时控制开销", + "pack_id": "b62f232a035b5e4a2638d6d263d19c6d9855714152182ff6c529e8080a09a0eb", + "title": "Codec · context-on · 前 9 小时控制开销 · 请求关联", "total": { "input": 184098417, "cached": 180875264, @@ -5376,8 +5540,8 @@ } }, "right": { - "pack_id": "7402d72472caa8c3f956643ceeead684691a36d3ae5f0d7438cfb11b838a841f", - "title": "Codec · context-off · 前 9 小时控制开销", + "pack_id": "7da33d179fdfecbeed503422e375beaae2f26972d3f510dec2a4681a14b85397", + "title": "Codec · context-off · 前 9 小时控制开销 · 请求关联", "total": { "input": 95917713, "cached": 94701952, @@ -5433,10 +5597,11 @@ "input_tokens": null, "input_percentage_points": null, "command_input": 4796570, - "command_percentage_points": -0.1718845900336559, "command_cached": 3388032, "command_uncached": 1408538, - "command_output": 4699 + "command_output": 4699, + "command_percentage_points": -0.1718845900336559, + "command_uncached_percentage_points": 39.01105566635043 }, "input_share_down_absolute_up": null, "command_share_down_absolute_up": true, @@ -5444,7 +5609,7 @@ "command_method_comparable": true } }, - "691b0e483bdfb23ba3076ee69053008662de2bc04bee6c18f8af657c95704f71:9dd0a7e3457f190f19140db65fdc2e79c341bd12d84daa2d20bada99ebdece78": { + "b62f232a035b5e4a2638d6d263d19c6d9855714152182ff6c529e8080a09a0eb:50431e7827df714d18c26bba99e0eebcfd9a08025fe08b7dadc03d16b7a70b73": { "ok": true, "comparison": { "method": "trajectory_usage_comparison_v1", @@ -5452,7 +5617,7 @@ "reason": "capture_scope_mismatch" } }, - "691b0e483bdfb23ba3076ee69053008662de2bc04bee6c18f8af657c95704f71:0879d189427e61688e2ff28b0ffd5949f149f62f2297a2f39ca3cc5335bcb709": { + "b62f232a035b5e4a2638d6d263d19c6d9855714152182ff6c529e8080a09a0eb:03d6ae56a332acc6496683268124ed41cd9c7746d404ddb6729874ab4d7bdd4a": { "ok": true, "comparison": { "method": "trajectory_usage_comparison_v1", @@ -5460,15 +5625,15 @@ "reason": "capture_scope_mismatch" } }, - "7402d72472caa8c3f956643ceeead684691a36d3ae5f0d7438cfb11b838a841f:691b0e483bdfb23ba3076ee69053008662de2bc04bee6c18f8af657c95704f71": { + "7da33d179fdfecbeed503422e375beaae2f26972d3f510dec2a4681a14b85397:b62f232a035b5e4a2638d6d263d19c6d9855714152182ff6c529e8080a09a0eb": { "ok": true, "comparison": { "method": "trajectory_usage_comparison_v1", "status": "observed", "qualification": "descriptive_only", "left": { - "pack_id": "7402d72472caa8c3f956643ceeead684691a36d3ae5f0d7438cfb11b838a841f", - "title": "Codec · context-off · 前 9 小时控制开销", + "pack_id": "7da33d179fdfecbeed503422e375beaae2f26972d3f510dec2a4681a14b85397", + "title": "Codec · context-off · 前 9 小时控制开销 · 请求关联", "total": { "input": 95917713, "cached": 94701952, @@ -5517,8 +5682,8 @@ } }, "right": { - "pack_id": "691b0e483bdfb23ba3076ee69053008662de2bc04bee6c18f8af657c95704f71", - "title": "Codec · context-on · 前 9 小时控制开销", + "pack_id": "b62f232a035b5e4a2638d6d263d19c6d9855714152182ff6c529e8080a09a0eb", + "title": "Codec · context-on · 前 9 小时控制开销 · 请求关联", "total": { "input": 184098417, "cached": 180875264, @@ -5574,10 +5739,11 @@ "input_tokens": null, "input_percentage_points": null, "command_input": -4796570, - "command_percentage_points": 0.1718845900336559, "command_cached": -3388032, "command_uncached": -1408538, - "command_output": -4699 + "command_output": -4699, + "command_percentage_points": 0.1718845900336559, + "command_uncached_percentage_points": -39.01105566635043 }, "input_share_down_absolute_up": null, "command_share_down_absolute_up": false, @@ -5585,7 +5751,7 @@ "command_method_comparable": true } }, - "7402d72472caa8c3f956643ceeead684691a36d3ae5f0d7438cfb11b838a841f:9dd0a7e3457f190f19140db65fdc2e79c341bd12d84daa2d20bada99ebdece78": { + "7da33d179fdfecbeed503422e375beaae2f26972d3f510dec2a4681a14b85397:50431e7827df714d18c26bba99e0eebcfd9a08025fe08b7dadc03d16b7a70b73": { "ok": true, "comparison": { "method": "trajectory_usage_comparison_v1", @@ -5593,7 +5759,7 @@ "reason": "capture_scope_mismatch" } }, - "7402d72472caa8c3f956643ceeead684691a36d3ae5f0d7438cfb11b838a841f:0879d189427e61688e2ff28b0ffd5949f149f62f2297a2f39ca3cc5335bcb709": { + "7da33d179fdfecbeed503422e375beaae2f26972d3f510dec2a4681a14b85397:03d6ae56a332acc6496683268124ed41cd9c7746d404ddb6729874ab4d7bdd4a": { "ok": true, "comparison": { "method": "trajectory_usage_comparison_v1", @@ -5601,7 +5767,7 @@ "reason": "capture_scope_mismatch" } }, - "9dd0a7e3457f190f19140db65fdc2e79c341bd12d84daa2d20bada99ebdece78:691b0e483bdfb23ba3076ee69053008662de2bc04bee6c18f8af657c95704f71": { + "50431e7827df714d18c26bba99e0eebcfd9a08025fe08b7dadc03d16b7a70b73:b62f232a035b5e4a2638d6d263d19c6d9855714152182ff6c529e8080a09a0eb": { "ok": true, "comparison": { "method": "trajectory_usage_comparison_v1", @@ -5609,7 +5775,7 @@ "reason": "capture_scope_mismatch" } }, - "9dd0a7e3457f190f19140db65fdc2e79c341bd12d84daa2d20bada99ebdece78:7402d72472caa8c3f956643ceeead684691a36d3ae5f0d7438cfb11b838a841f": { + "50431e7827df714d18c26bba99e0eebcfd9a08025fe08b7dadc03d16b7a70b73:7da33d179fdfecbeed503422e375beaae2f26972d3f510dec2a4681a14b85397": { "ok": true, "comparison": { "method": "trajectory_usage_comparison_v1", @@ -5617,15 +5783,15 @@ "reason": "capture_scope_mismatch" } }, - "9dd0a7e3457f190f19140db65fdc2e79c341bd12d84daa2d20bada99ebdece78:0879d189427e61688e2ff28b0ffd5949f149f62f2297a2f39ca3cc5335bcb709": { + "50431e7827df714d18c26bba99e0eebcfd9a08025fe08b7dadc03d16b7a70b73:03d6ae56a332acc6496683268124ed41cd9c7746d404ddb6729874ab4d7bdd4a": { "ok": true, "comparison": { "method": "trajectory_usage_comparison_v1", "status": "observed", "qualification": "descriptive_only", "left": { - "pack_id": "9dd0a7e3457f190f19140db65fdc2e79c341bd12d84daa2d20bada99ebdece78", - "title": "Grid · context-on · 前 9 小时控制开销", + "pack_id": "50431e7827df714d18c26bba99e0eebcfd9a08025fe08b7dadc03d16b7a70b73", + "title": "Grid · context-on · 前 9 小时控制开销 · 请求关联", "total": { "input": 142056707, "cached": 140057984, @@ -5674,8 +5840,8 @@ } }, "right": { - "pack_id": "0879d189427e61688e2ff28b0ffd5949f149f62f2297a2f39ca3cc5335bcb709", - "title": "Grid · context-off · 前 9 小时控制开销", + "pack_id": "03d6ae56a332acc6496683268124ed41cd9c7746d404ddb6729874ab4d7bdd4a", + "title": "Grid · context-off · 前 9 小时控制开销 · 请求关联", "total": { "input": 162277188, "cached": 160540672, @@ -5731,10 +5897,11 @@ "input_tokens": null, "input_percentage_points": null, "command_input": 10385582, - "command_percentage_points": 7.34362753891773, "command_cached": 9950208, "command_uncached": 435374, - "command_output": 32218 + "command_output": 32218, + "command_percentage_points": 7.34362753891773, + "command_uncached_percentage_points": 21.69406044164581 }, "input_share_down_absolute_up": null, "command_share_down_absolute_up": false, @@ -5742,7 +5909,7 @@ "command_method_comparable": true } }, - "0879d189427e61688e2ff28b0ffd5949f149f62f2297a2f39ca3cc5335bcb709:691b0e483bdfb23ba3076ee69053008662de2bc04bee6c18f8af657c95704f71": { + "03d6ae56a332acc6496683268124ed41cd9c7746d404ddb6729874ab4d7bdd4a:b62f232a035b5e4a2638d6d263d19c6d9855714152182ff6c529e8080a09a0eb": { "ok": true, "comparison": { "method": "trajectory_usage_comparison_v1", @@ -5750,7 +5917,7 @@ "reason": "capture_scope_mismatch" } }, - "0879d189427e61688e2ff28b0ffd5949f149f62f2297a2f39ca3cc5335bcb709:7402d72472caa8c3f956643ceeead684691a36d3ae5f0d7438cfb11b838a841f": { + "03d6ae56a332acc6496683268124ed41cd9c7746d404ddb6729874ab4d7bdd4a:7da33d179fdfecbeed503422e375beaae2f26972d3f510dec2a4681a14b85397": { "ok": true, "comparison": { "method": "trajectory_usage_comparison_v1", @@ -5758,15 +5925,15 @@ "reason": "capture_scope_mismatch" } }, - "0879d189427e61688e2ff28b0ffd5949f149f62f2297a2f39ca3cc5335bcb709:9dd0a7e3457f190f19140db65fdc2e79c341bd12d84daa2d20bada99ebdece78": { + "03d6ae56a332acc6496683268124ed41cd9c7746d404ddb6729874ab4d7bdd4a:50431e7827df714d18c26bba99e0eebcfd9a08025fe08b7dadc03d16b7a70b73": { "ok": true, "comparison": { "method": "trajectory_usage_comparison_v1", "status": "observed", "qualification": "descriptive_only", "left": { - "pack_id": "0879d189427e61688e2ff28b0ffd5949f149f62f2297a2f39ca3cc5335bcb709", - "title": "Grid · context-off · 前 9 小时控制开销", + "pack_id": "03d6ae56a332acc6496683268124ed41cd9c7746d404ddb6729874ab4d7bdd4a", + "title": "Grid · context-off · 前 9 小时控制开销 · 请求关联", "total": { "input": 162277188, "cached": 160540672, @@ -5815,8 +5982,8 @@ } }, "right": { - "pack_id": "9dd0a7e3457f190f19140db65fdc2e79c341bd12d84daa2d20bada99ebdece78", - "title": "Grid · context-on · 前 9 小时控制开销", + "pack_id": "50431e7827df714d18c26bba99e0eebcfd9a08025fe08b7dadc03d16b7a70b73", + "title": "Grid · context-on · 前 9 小时控制开销 · 请求关联", "total": { "input": 142056707, "cached": 140057984, @@ -5872,10 +6039,11 @@ "input_tokens": null, "input_percentage_points": null, "command_input": -10385582, - "command_percentage_points": -7.34362753891773, "command_cached": -9950208, "command_uncached": -435374, - "command_output": -32218 + "command_output": -32218, + "command_percentage_points": -7.34362753891773, + "command_uncached_percentage_points": -21.69406044164581 }, "input_share_down_absolute_up": null, "command_share_down_absolute_up": false, diff --git a/docs/reference/trajectory-assessment.md b/docs/reference/trajectory-assessment.md index 0ea192b850..c9121dd3f0 100644 --- a/docs/reference/trajectory-assessment.md +++ b/docs/reference/trajectory-assessment.md @@ -477,6 +477,13 @@ This records an immutable version link; it neither appends to the original source nor starts a model. The Agent prepares this link with the input, rather than asking the reader to enter internal identifiers. +Use `--preserve-default` when importing another captured version for comparison +without changing the Goal's current selection. It retains the existing default; +the first registered capture still becomes the default. Omitting the option +keeps the existing select-on-registration behavior. New counter reductions need +their own registered identity and base link; a frozen preview does not establish +that its capture is available from the live owner. + The existing Goal analysis action becomes **Continue analysis**. Its inline version summary identifies added, corrected and removed sources/episodes, previous and current coverage, and changed judgments after completion. Previous diff --git a/loopx/capabilities/benchmark_toolkit/trajectory_assessment_store.py b/loopx/capabilities/benchmark_toolkit/trajectory_assessment_store.py index bb167bce64..bac350b082 100644 --- a/loopx/capabilities/benchmark_toolkit/trajectory_assessment_store.py +++ b/loopx/capabilities/benchmark_toolkit/trajectory_assessment_store.py @@ -381,6 +381,7 @@ def register_pack( loopx_input_json: str | None = None, native_outcomes_json: str | None = None, base_pack_id: str | None = None, + select_default: bool = True, ) -> dict: """Trusted operator only; no HTTP/renderer path-registration endpoint.""" if not title.strip(): @@ -454,7 +455,8 @@ def register_pack( path.chmod(0o600) if pack_id not in index["pack_ids"]: index["pack_ids"].append(pack_id) - index["default_pack_id"] = pack_id + if select_default or index["default_pack_id"] is None: + index["default_pack_id"] = pack_id _write(owner / "packs.json", index) return {"ok": True, **_summary(record, None)} diff --git a/loopx/cli_commands/benchmark_trajectory.py b/loopx/cli_commands/benchmark_trajectory.py index 7f35c6f261..6a11dd053e 100644 --- a/loopx/cli_commands/benchmark_trajectory.py +++ b/loopx/cli_commands/benchmark_trajectory.py @@ -34,6 +34,8 @@ def register_benchmark_trajectory_commands(subparsers, add_format) -> None: register.add_argument("--source-root", type=Path, required=True) register.add_argument("--title", required=True) register.add_argument("--base-pack-id", help="Existing frozen pack in this owner Goal and original case/run; links a successor without running analysis.") + register.add_argument("--preserve-default", action="store_true", + help="Keep the existing default capture when registering another version; the first capture still becomes default.") register.add_argument( "--usage-jsonl", help="Optional complete Codex session capture, relative to source-root; read-only cost facts, not model input.", @@ -109,6 +111,7 @@ def _handle_benchmark_trajectory_command( loopx_input_json=args.loopx_input_json, native_outcomes_json=args.native_outcomes_json, base_pack_id=args.base_pack_id, + select_default=not args.preserve_default, ) if args.benchmark_command == "trajectory-pack-register" else discover(**scope) diff --git a/tests/capabilities/test_trajectory_assessment_store.py b/tests/capabilities/test_trajectory_assessment_store.py index 10b81eb0c9..3be6937b96 100644 --- a/tests/capabilities/test_trajectory_assessment_store.py +++ b/tests/capabilities/test_trajectory_assessment_store.py @@ -315,6 +315,44 @@ def test_continuation_does_not_cross_owner_run_or_revoked_source(pack, tmp_path) assert result["status"] == "succeeded" and not result["reused"] +def test_display_usage_captures_bind_registered_successor_versions(): + from pathlib import Path + + from loopx.capabilities.benchmark_toolkit.trajectory_assessment_store import _pack_id + + fixture = Path(__file__).resolve().parents[2] / "apps/presentation/dashboard/src/data/fixtures/research-usage-real-captures.json" + data = json.loads(fixture.read_text()) + lineage = {row["registered_pack_id"]: row for row in data["lineage"]} + for captured in data["packs"]: + source = lineage[captured["pack_id"]] + assert captured["continuation"]["base_pack_id"] == source["original_pack_id"] + usage = {key: value for key, value in captured["solver_usage"].items() + if key not in {"applicability", "reason_code"}} + assert usage["artifact_sha256"] == source["source_sha256"] + record = {"owner_goal_id": data["owner_goal_id"], "title": captured["title"], + "analysis_key": captured["analysis_key"], "solver_usage": usage, + "base_pack_id": source["original_pack_id"]} + assert _pack_id(data["owner_goal_id"], record) == captured["pack_id"] + + +def test_registration_can_preserve_the_current_selection(pack): + scope, _, original, input_path, sources, _ = pack + args = dict(**scope, input_path=input_path, source_root=sources, + title="Another captured version", base_pack_id=original["pack_id"]) + alternate = register_pack(**args, select_default=False) + catalog = discover(**scope) + assert catalog["default_pack_id"] == original["pack_id"] + assert {p["pack_id"] for p in catalog["packs"]} == {original["pack_id"], alternate["pack_id"]} + assert inspect_pack(**scope, pack_id=alternate["pack_id"])["job"] is None + # Selection is not part of frozen evidence identity; legacy callers still + # select their registration without mutating either captured version. + assert register_pack(**args)["pack_id"] == alternate["pack_id"] + assert discover(**scope)["default_pack_id"] == alternate["pack_id"] + empty = {**scope, "runtime_root": scope["runtime_root"] / "empty"} + first = register_pack(**{**args, **empty, "base_pack_id": None}, select_default=False) + assert discover(**empty)["default_pack_id"] == first["pack_id"] + + def test_native_results_register_through_real_cli_and_read_without_analysis(pack, tmp_path): scope, _, original, input_path, sources, _ = pack native = { @@ -335,9 +373,10 @@ def test_native_results_register_through_real_cli_and_read_without_analysis(pack "--runtime-root", str(scope["runtime_root"]), "--format", "json", "benchmark", "trajectory-pack-register", "--goal-id", scope["owner_goal_id"], "--input-json", str(input_path), "--source-root", str(sources), "--title", "Native outcome window", "--native-outcomes-json", native_path.name, - "--base-pack-id", original["pack_id"]], + "--base-pack-id", original["pack_id"], "--preserve-default"], capture_output=True, text=True, check=True) registered = json.loads(result.stdout) + assert discover(**scope)["default_pack_id"] == original["pack_id"] assert registered["analysis_key"] == original["analysis_key"] assert "native_outcomes" not in original assert registered["native_outcomes"]["projection"]["initial"]["value"] == 2 From 630bdf3324dcdc698f10adc61a1d262afe46396d Mon Sep 17 00:00:00 2001 From: LoopX Agent <337587101+loopx-agent@users.noreply.github.com> Date: Sat, 7 Nov 2026 00:49:25 +0800 Subject: [PATCH 2/3] test(research): bind usage lineage to registered captures Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com> --- tests/control_plane_ts/trajectory_usage_comparison.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/control_plane_ts/trajectory_usage_comparison.test.ts b/tests/control_plane_ts/trajectory_usage_comparison.test.ts index a8b17e0944..cea4c504eb 100644 --- a/tests/control_plane_ts/trajectory_usage_comparison.test.ts +++ b/tests/control_plane_ts/trajectory_usage_comparison.test.ts @@ -142,7 +142,7 @@ test('four real native prefixes retain the Bench owner counts, missing text attr assert.equal(grid.left.input.unattributed_requests, 818); assert.equal(grid.right.input.unattributed_requests, 956); for (let i=0; i Date: Sat, 7 Nov 2026 04:14:30 +0800 Subject: [PATCH 3/3] test: retain lost-response injection without unused assignment Reuse the narrow fixture cleanup already proposed in #8193 so required lint can qualify the research proposal. The committed operation and subsequent injected timeout retain their order. Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com> --- tests/control_plane/test_goal_create_completion.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/control_plane/test_goal_create_completion.py b/tests/control_plane/test_goal_create_completion.py index c03bb20600..18a0af6e7a 100644 --- a/tests/control_plane/test_goal_create_completion.py +++ b/tests/control_plane/test_goal_create_completion.py @@ -181,7 +181,7 @@ def test_managed_creation_retains_requirements_before_one_host_dispatch(environm original = getattr(target, method) def lose_response(*args, **kwargs): - result = original(*args, **kwargs) + original(*args, **kwargs) raise TimeoutError("Committed creation response was lost") monkeypatch.setattr(target, method, lose_response)