Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
155 commits
Select commit Hold shift + click to select a range
c71fd45
refactor(turn): integrate complete source and governed settlement wit…
loopx-agent Nov 4, 2026
3c0d9de
test(turn): qualify complete source callers and context recovery
loopx-agent Nov 4, 2026
eb3730d
docs(turn): retain complete source migration evidence and qualificati…
loopx-agent Nov 4, 2026
e6db9c0
test(context): read complete Goal and recovery through actual CLI views
loopx-agent Nov 4, 2026
d539d4c
docs(turn): record main integration and original workload cost limits
loopx-agent Nov 4, 2026
4d0213f
perf(context): narrow selected-source and settled-record transport
loopx-agent Nov 4, 2026
a8d8a29
test(context): preserve selected reader and settlement recovery parity
loopx-agent Nov 4, 2026
413aef3
docs(context): record current main cost and inherited recovery holds
loopx-agent Nov 4, 2026
88e9ace
fix(quota): preserve planning-only Turn recovery
loopx-agent Nov 4, 2026
4f5f040
test(quota): follow managed claim readiness and guard lineage
loopx-agent Nov 4, 2026
366474f
docs(quota): reconcile recovery diagnosis and full-task costs
loopx-agent Nov 4, 2026
cf1a81d
perf(context): reuse published native quota captures
loopx-agent Nov 4, 2026
22ab81b
test(context): check native source reuse and reader recovery
loopx-agent Nov 4, 2026
93962d4
docs(context): record native capture IO qualification
loopx-agent Nov 4, 2026
66ab233
fix(settlement): omit repeated Run values from settled control reads
loopx-agent Nov 4, 2026
616fc10
test(settlement): cover receipt-only reads through the native CLI
loopx-agent Nov 4, 2026
64fbf76
docs(c1): qualify settled readback transport against main
loopx-agent Nov 4, 2026
6b59aba
Merge current main for C1 Host integration
loopx-agent Nov 5, 2026
65db6a5
fix(codex): hand off the captured ready contract and claim reference
loopx-agent Nov 4, 2026
a728330
fix(codex): retain the native work contract after lease preparation
loopx-agent Nov 5, 2026
f161435
docs(c1): qualify native ready handoff and full hard-lease caller costs
loopx-agent Nov 5, 2026
84a366d
fix(control-plane): preserve executable read obligations in current s…
loopx-agent Nov 5, 2026
aa38afc
docs(controller): qualify read-rule convergence and runner budget cause
loopx-agent Nov 5, 2026
fbe24a6
Merge remote-tracking branch 'origin/main' into codex/c1-initial-read…
loopx-agent Nov 5, 2026
b3b3b23
docs(controller): record current-main source and wheel qualification
loopx-agent Nov 5, 2026
d1ed715
docs: qualify current C1 against latest quota baseline
loopx-agent Nov 5, 2026
d72bec9
Merge current main for C1 consumer recovery qualification
loopx-agent Nov 5, 2026
dd3496b
fix(turn): validate supplied complete sources on journal resume
loopx-agent Nov 5, 2026
62619a9
Merge current main for C1 recovery integration
loopx-agent Nov 5, 2026
83a102d
test(turn): qualify recovery from the producing workspace
loopx-agent Nov 5, 2026
1bc0e76
Merge branch 'main' of https://github.com/loopx-project/loopx into co…
loopx-agent Nov 5, 2026
7460f04
fix(benchmark): bind native preflight reads to the original capture
loopx-agent Nov 5, 2026
090d414
Merge commit '03d6ab2864a54e86ab4f97854854d0e4acd7dd48' into codex/c1…
loopx-agent Nov 5, 2026
4ff3290
Merge main’s quota reader and pin recovery for signed progressive views
loopx-agent Nov 5, 2026
e0763d1
Bind prepared context delivery to the lifecycle event session
loopx-agent Nov 5, 2026
a04f17e
Merge branch 'codex/hook-ready-event-session' into codex/c1-initial-r…
loopx-agent Nov 5, 2026
32d73ac
Verify immutable preflight sources through the native reader
loopx-agent Nov 5, 2026
df31798
Integrate current main into controller decision composition
loopx-agent Nov 5, 2026
0e8a77e
fix: restore file deltas carrying the current unread index
loopx-agent Nov 5, 2026
70e0150
Merge branch 'codex/unread-index-delta-recovery' into codex/c1-initia…
loopx-agent Nov 5, 2026
4b1753e
Merge branch 'codex/native-capture-read-reuse-1105' into codex/c1-ini…
loopx-agent Nov 5, 2026
5ffe979
Merge remote-tracking branch 'origin/main' into codex/c1-initial-read…
loopx-agent Nov 5, 2026
59285ad
Merge current main into controller decision composition
loopx-agent Nov 5, 2026
ec61436
Qualify full packet decisions and native model-visible terminal receipts
loopx-agent Nov 5, 2026
5f1ad05
Integrate main inline output qualification and consumer opt-in
loopx-agent Nov 5, 2026
8dc7411
Read capability reentry from the model-visible CLI channel in portfol…
loopx-agent Nov 5, 2026
59be3f1
Verify capability repair from the capture read by the scripted model
loopx-agent Nov 5, 2026
699f2f0
Deliver the explicit Todo binding route on the first context read
loopx-agent Nov 5, 2026
1bb694a
Distinguish suggested candidates from required binding in the tool actor
loopx-agent Nov 5, 2026
d646c12
Merge commit '8a48e346dc' into codex/c1-initial-reader-20261103T062012Z
loopx-agent Nov 5, 2026
89c8c0b
Keep the shared native steward fixture compatible with direct recover…
loopx-agent Nov 5, 2026
4678d44
Merge remote-tracking branch 'origin/main' into codex/c1-initial-read…
loopx-agent Nov 5, 2026
688b682
Merge commit 'acc00f5451' into codex/c1-initial-reader-20261103T062012Z
loopx-agent Nov 5, 2026
0fb3e08
Keep benchmark selection on the exact presented guard view
loopx-agent Nov 5, 2026
1665159
Reuse prepared Codex read guidance in benchmark checkpoint prompts
loopx-agent Nov 5, 2026
f36ccee
Merge remote-tracking branch 'origin/main' into codex/c1-initial-read…
loopx-agent Nov 5, 2026
8b34d36
Merge remote-tracking branch 'origin/main' into codex/c1-initial-read…
loopx-agent Nov 5, 2026
da33caa
Prove progressive benchmark choices from receiver-visible pages
loopx-agent Nov 5, 2026
4a743de
Merge commit 'f1b6a7a37' into codex/c1-initial-reader-20261103T062012Z
loopx-agent Nov 5, 2026
a8d4212
Validate progressive replan against its published reader contract
loopx-agent Nov 5, 2026
a102781
Isolate the user skill directory for native context comparisons
loopx-agent Nov 5, 2026
3f543c9
Check inline opt-out and immutable checkpoint recovery on the real CLI
loopx-agent Nov 5, 2026
a0bb99e
Reject ambiguous acceptance owners during replan readback
loopx-agent Nov 5, 2026
fa12087
Scope the quota display request to the facts it reads
loopx-agent Nov 5, 2026
f0fab3c
Verify captured vision audits and share them in one display request
loopx-agent Nov 5, 2026
a585c61
Leave an already-shared acceptance owner in the original capture
loopx-agent Nov 5, 2026
dd69b89
Check the unchanged writeback contract when audit authoring is absent
loopx-agent Nov 5, 2026
9607ae4
Refuse substituted nonregular Turn observations before reading
loopx-agent Nov 5, 2026
05d5cad
Pin native ready delivery to the guard that proved the claim
loopx-agent Nov 5, 2026
a78ed2e
Drop shadowed duplicates from settlement coverage
loopx-agent Nov 5, 2026
25a5600
Merge commit '3c7e0935fd6697291c5c432e5267816b4a667cfa' into codex/c1…
loopx-agent Nov 5, 2026
d701a55
Verify native claim readiness with the original writer receipt
loopx-agent Nov 5, 2026
5d77a90
fix(quota): preserve verified source and successor identity on staged…
loopx-agent Nov 5, 2026
594fd46
fix(context): deliver the current replan basis on its first read
loopx-agent Nov 5, 2026
6748107
refactor(context): reuse the quota action vocabulary for staged review
loopx-agent Nov 5, 2026
fdc81b0
Merge remote-tracking branch 'origin/main' into codex/c1-initial-read…
loopx-agent Nov 5, 2026
62a2052
fix(context): apply progressive recovery to saved complete turns
loopx-agent Nov 5, 2026
a1315d0
Integrate main staged selection and capture validation in C1
loopx-agent Nov 5, 2026
42b03f1
Integrate main field-level first reads with C1 prepared navigation
loopx-agent Nov 5, 2026
78b60e5
Share the main field-reuse transaction and verify the complete C1 sel…
loopx-agent Nov 5, 2026
b869938
Verify C1 recovery through its emitted CLI and pinned capture digest
loopx-agent Nov 5, 2026
6d170a1
Integrate the verified kernel request type from the main field-reuse PR
loopx-agent Nov 5, 2026
b97e70f
Share typed observation descriptors with C1
loopx-agent Nov 5, 2026
4654470
Narrow the request cache owner before retaining Todo context
loopx-agent Nov 5, 2026
179b03e
Integrate main native retry recovery into C1
loopx-agent Nov 5, 2026
e75add6
Merge main 817dd2461a into the C1 work-contract proposal
loopx-agent Nov 5, 2026
1bf6fd6
Integrate main account recovery fixes without changing C1 Core
loopx-agent Nov 5, 2026
a82b1c2
fix(context): preserve async reader handles in code-mode guidance
loopx-agent Nov 5, 2026
cc2a9bc
Integrate current main with the C1 work contract
loopx-agent Nov 6, 2026
9d0350b
Fix strict native thread matching in exhausted answer review
loopx-agent Nov 6, 2026
8047e2f
Integrate main service-handoff repair into C1
loopx-agent Nov 6, 2026
576ece3
Integrate main pending-work recovery into C1
loopx-agent Nov 6, 2026
3a4f6f6
fix: reuse observed outcomes delivered through complete parents
loopx-agent Nov 6, 2026
00fffbf
test: cover omitted saved-context activation and identity checks
loopx-agent Nov 6, 2026
6f00db1
Integrate main independent Delta and RFC layout into C1
loopx-agent Nov 6, 2026
9e1a8e0
Record matched quota costs and packaged context qualification
loopx-agent Nov 6, 2026
339f01e
Converge C1 on main native first-read producers and readers
loopx-agent Nov 6, 2026
04a619f
Qualify main first-read convergence and retain cost counterevidence
loopx-agent Nov 6, 2026
b38ab15
Merge main into C1 while preserving complete context recovery
loopx-agent Nov 6, 2026
f68f5d0
test(context): follow returned cursors in native batch qualification
loopx-agent Nov 6, 2026
b90e711
Merge latest main Chat observation changes into C1
loopx-agent Nov 6, 2026
b561663
test(context): preserve static replay qualification outside batch str…
loopx-agent Nov 6, 2026
493b90f
docs(context): record current-main incremental cost and recovery qual…
loopx-agent Nov 6, 2026
2f1c910
Merge current main into C1 while retaining complete-source recovery t…
loopx-agent Nov 6, 2026
dde48f0
fix(context): reuse unchanged criteria across progressive first reads
loopx-agent Nov 6, 2026
7a9f06a
docs(context): record hierarchical reuse costs and native qualification
loopx-agent Nov 6, 2026
7e52f3a
Merge main 910ff3bca5 report review and benchmark fixes into C1
loopx-agent Nov 6, 2026
b46f3f9
docs(context): distinguish late-main integration from frozen cost cohort
loopx-agent Nov 6, 2026
185a1dd
Merge commit 'd0985c35aa3d05fd5de964e719aaf69f45d72535' into codex/c1…
loopx-agent Nov 6, 2026
69f7374
Merge independently proposed replan authoring owner into C1
loopx-agent Nov 6, 2026
49a621c
Merge current main and composed authoring projection into C1
loopx-agent Nov 6, 2026
2fe9852
Merge current main into C1 before transport boundary repair
loopx-agent Nov 6, 2026
8241335
refactor(turn): keep source transport below driver imports
loopx-agent Nov 6, 2026
c37bd8d
docs: record qualified C1 import boundary and main adoption
loopx-agent Nov 6, 2026
c6d7d0a
Merge main 3a0c9608cc into C1 progressive read repair
loopx-agent Nov 6, 2026
e99a03b
fix: scope thin heartbeat reads to current dependencies
loopx-agent Nov 6, 2026
8e65f88
fix: qualify complete-contract consumers from installed packages
loopx-agent Nov 6, 2026
42c72ca
docs: reconcile C1 read scope and consumer qualification
loopx-agent Nov 6, 2026
f6005d1
Merge main into C1 before Turn lifecycle extraction
loopx-agent Nov 6, 2026
c42ba31
fix(turn): retain recorded acceptance index compatibility
loopx-agent Nov 6, 2026
b17ba5f
test(quota): opt in to local usage-cycle qualification
loopx-agent Nov 6, 2026
40ce1ff
Merge latest main recovery into C1
loopx-agent Nov 6, 2026
ef506ff
fix(testing): qualify complete Turn sources before actor calls
loopx-agent Nov 6, 2026
f66f04c
fix(chat): acquire selected native Task lease before delivery guard
loopx-agent Nov 6, 2026
a706379
docs(c1): record complete-source and native ordering qualification
loopx-agent Nov 6, 2026
da6779c
test(control-plane): retire remaining normal v0 task writers
loopx-agent Nov 6, 2026
5091fb8
Merge latest main into C1 for installed native qualification
loopx-agent Nov 6, 2026
84473d2
docs(control-plane): qualify installed native lifecycle
loopx-agent Nov 6, 2026
d80b386
Merge main native summary fix before Goal read qualification
loopx-agent Nov 6, 2026
c0020f4
fix: preserve scoped Goal reads and acceptance audit triggers
loopx-agent Nov 7, 2026
193801b
docs: record scoped Goal and installed capture qualification
loopx-agent Nov 7, 2026
3736048
fix: retain producer-bound heartbeat Turn identities
loopx-agent Nov 7, 2026
c3c1f86
docs: qualify bound heartbeat identity and output repair
loopx-agent Nov 7, 2026
18e2b69
fix(turn): retain modern Host execution boundaries
loopx-agent Nov 7, 2026
c4ea4c3
docs: clarify complete Turn consumer qualification
loopx-agent Nov 7, 2026
d4839d4
Merge main into C1 and retain native result recovery
loopx-agent Nov 7, 2026
8e0a479
fix(context): show one ready settlement recipe in C1
loopx-agent Nov 7, 2026
97cc1e0
perf(lark): avoid decoding idle App feedback history (#8241)
loopx-agent Nov 7, 2026
8231ee2
fix(chat): recover admitted project continuation before result review…
loopx-agent Nov 7, 2026
582a574
Integrate current main before research efficiency qualification
loopx-agent Nov 7, 2026
fa8ebbf
Integrate C1 shared work contract for benchmark qualification
loopx-agent Nov 7, 2026
d0a9311
test(benchmark): explicitly exercise native context-off handoff
loopx-agent Nov 7, 2026
c103345
feat(benchmark): observe aggregate memory in local work probes
loopx-agent Nov 7, 2026
10bd0ef
feat(explore): ground work choices in paired goal outcomes
loopx-agent Nov 7, 2026
fc21937
Reuse the prepared quota capture in native benchmark wakes
loopx-agent Nov 7, 2026
45d788b
Exercise resumed benchmark settlement from its delivered contract
loopx-agent Nov 7, 2026
9bb1eb5
Exercise the real progressive context default in CLI fixtures
loopx-agent Nov 7, 2026
947ae98
feat(benchmark): opt in to local probes from SForge heartbeat
loopx-agent Nov 7, 2026
1930ffe
Merge paired goal outcome guidance into benchmark integration (#8250)
huangruiteng Nov 7, 2026
3216cfe
fix(benchmark): preserve command results and scope sampled PSS
loopx-agent Nov 7, 2026
a9b40b4
Merge revised sampled memory probe base
loopx-agent Nov 7, 2026
66cffb6
fix(benchmark): run the staged probe independently of task imports
loopx-agent Nov 7, 2026
ad7d931
Merge native benchmark committed-capture adoption (#8251)
huangruiteng Nov 7, 2026
5754db1
Merge candidate-bound process-group observations into benchmark integ…
huangruiteng Nov 7, 2026
be1e72c
Merge opt-in native local-probe installation into benchmark integration
huangruiteng Nov 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions benchmark/edgebench/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ def main(argv=None):
help="Opt-in short heartbeat context with same-invocation full captures")
parser.add_argument("--context-delivery", choices=("off", "on"),
help="Native Codex context delivery: on by default for heartbeat workers; pass off to disable")
parser.add_argument("--execution-observation", choices=("local_probe",),
help="Optional local execution probe for heartbeat workers")
parser.add_argument("--native-child-limit", type=int,
help="Explicit native child capacity and optional task delegation authorization, shared across study arms; omitted preserves existing behavior")
parser.add_argument("--provider-request-admission", action="store_true",
Expand Down Expand Up @@ -227,6 +229,8 @@ def main(argv=None):
args.context_delivery = Execution(mode="heartbeat" if args.worker.startswith("heartbeat-") else "plain").context_delivery
if args.context_delivery != "off" and not args.worker.startswith("heartbeat-"):
parser.error("--context-delivery requires a heartbeat worker")
if args.execution_observation is not None and not args.worker.startswith("heartbeat-"):
parser.error("--execution-observation requires a heartbeat worker")
if args.provider_request_admission:
if not args.worker.startswith("heartbeat-"):
parser.error("--provider-request-admission requires a heartbeat worker")
Expand Down Expand Up @@ -409,6 +413,8 @@ def main(argv=None):
task_entry=args.task_entry,
turn_envelope=args.turn_envelope,
context_delivery=args.context_delivery,
**({"execution_observation": args.execution_observation}
if args.execution_observation is not None else {}),
**({"provider_request_admission": True} if args.provider_request_admission else {}),
native_goal_continue=args.native_goal_continue,
replan_after_turns=args.replan_after_turns,
Expand Down Expand Up @@ -485,6 +491,8 @@ def main(argv=None):
"sforge_source": active_source_receipt(),
**turn_envelope_receipt(explicit=args.turn_envelope),
**({"context_delivery": "on"} if args.context_delivery != "off" else {}),
**({"execution_observation": args.execution_observation}
if args.execution_observation is not None else {}),
**({"provider_request_admission": "on"} if args.provider_request_admission else {}),
**({"native_goal_continue": True} if args.native_goal_continue else {}),
"task_sha256": hashlib.sha256(task_file.read_bytes()).hexdigest(),
Expand Down
46 changes: 46 additions & 0 deletions benchmark/runtime/EXECUTION_OBSERVATIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ merely to produce an attachment. Configuration and readback invoke neither a
probe nor a model. Runtime receipts record the selected producer, which does
not attest execution, adoption or improvement.

The native SForge runner accepts the same producer with
`--execution-observation local_probe` on a heartbeat worker. It forwards the
selection to the shared installer and records it in both runner and worker
receipts. The wrapper uses isolated Python to execute the staged probe source
while keeping the task working directory for candidate paths. The installer
checks the wrapper's `--help` once as the worker user before model entry.
An unavailable wrapper fails setup for an explicitly selected producer.
The observation runs only when a worker invokes it.

Choose the settlement plan's ordinary `command_template` for in-flight progress
without new decision evidence. Use `semantic_closeout_command_template` for new
evidence from this admitted work, a route change or Todo completion; bind the
Expand Down Expand Up @@ -126,6 +135,25 @@ Malformed optional diagnostics preserve reliable host measurements and retain
a bounded diagnostic-error receipt. Evidence paths must be fresh; raw output
stays local. The probe neither submits nor accesses hidden evaluation.

When simultaneous memory could change a candidate choice, run the complete
representative workload with the same probe and pass
`--memory-limit-bytes <applicable-reference-limit>`. On Linux the producer
estimates group proportional set size by reading one PID at a time. It skips
samples with unstable membership. A stable group can move retained memory
between PID reads, so the sampled sum can overstate simultaneous occupancy.
The adjacent `.memory.json` binds that estimate and reference to the exact
candidate and input revision. The main observation cites its digest only after
a successful write. Missing samples stay unknown. A sidecar failure preserves
the original process result. Processes in other groups and peaks between samples
are outside coverage, and PSS accounting differs from a container limit.

When this estimate could change a choice, check actual overlap independently
and record the supported next comparison in the existing Yardstick decision.
Keep the best authoritative evidence, reuse the matching incumbent observation,
and compare a lower-footprint mechanism on the same complete workload where
overlap matters. The estimate alone supplies no limit verdict or selected
action. A native timeout alone supplies no memory observation.

The adjacent `.candidate.json` preserves selected relative paths and hashes.
`candidate_sha256` hashes the sorted JSON file manifest, not native archive
container bytes. Pins cover only declared files at the probe boundaries, not
Expand Down Expand Up @@ -189,6 +217,24 @@ Stop、原预算和真实阻塞继续有效,不为填满时长制造任务。
变化拒绝归因;文件清单哈希不是原生归档哈希,只覆盖明确选择的文件及探针
边界,不覆盖传递依赖或独立写入者,结果仍须证明对应实际评测快照和输入版本。

SForge heartbeat worker 可显式传入 `--execution-observation local_probe`,
沿用共享安装路径,并在 runner 和 worker 回执中记录选择。入口以隔离 Python
执行已部署的探针源码,候选路径仍相对于任务工作目录。安装时用 worker 身份
核对一次 `--help`。该入口不可用时在模型进入前报告安装失败。测量只在
worker 自己调用探针时发生。

当并行内存占用会影响候选选择时,用同一入口执行完整代表性工作集并传入
`--memory-limit-bytes <参考上限>`。Linux 逐 PID 读取 PSS,组成员变化或数据
不完整时跳过该次采样。组成员稳定时,内存仍可能在两次读取之间转移,累加值
可能高于真实同时占用。相邻 `.memory.json` 将估计和参考值绑定到候选及输入
版本。写入成功才把其摘要记入原观测,写入失败仍保留原进程结果。组外进程和
采样间峰值未覆盖,PSS 与容器内存限额的统计口径有差异。

这项估计会影响选择时,独立核对真实同时占用,再通过原 Yardstick 写入有证据
的下一比较。保留最好的权威结果,复用同口径 incumbent 测量;确有并行保留
影响时,把下一次有界试验用于同一完整工作集上的较低占用机制。估计本身不产生
超限判定或自动选择。只有超时回执时,内存保持未知。

当前授权工作实际产生或取得新的决策证据后,才进入相应工作段的检查点。旧反馈读回、
记账和没有新增信息的确定性重复验证只是上下文,应先用于推进原任务。使用当前
settlement plan 的 `durable_writeback.semantic_closeout_command_template`,
Expand Down
36 changes: 17 additions & 19 deletions benchmark/runtime/checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,26 +229,32 @@ def capture_before_replan(env: dict[str, str], receipt: dict[str, Any], body: st
"--runtime-root", env["LOOPX_RUNTIME_ROOT"], "quota", "should-run",
"--goal-id", env["LOOPX_GOAL_ID"], "--agent-id", env["LOOPX_AGENT_ID"],
"--runtime-profile", "generic_cli", "--turn-instance-id", receipt["turn_id"],
"--available-capability", "shell", "--available-capability", "filesystem_write",
"--decision-output-root", str(capture_root)]
"--available-capability", "shell", "--available-capability", "filesystem_write"]
native_context = env.get("LOOPX_CONTEXT_DELIVERY") == "on" and bool(env.get("LOOPX_CODEX_CONTEXT_DIR"))
if native_context:
# Capture the complete Goal now, but let the actual native tool select
# full/delta after SessionStart. Do not consume or invalidate continuity
# while the Host is preparing a checkpoint outside the model session.
command += ["--context-delivery", "on", "--codex-context-dir", env["LOOPX_CODEX_CONTEXT_DIR"],
# The native reader selects full/delta after SessionStart. Ask the
# existing preparation route for the committed capture reference now.
capture_directory = capture_root / "decision-original"
command += ["--decision-output-dir", str(capture_directory), "--prepared-capture-reference",
"--context-delivery", "on", "--codex-context-dir", env["LOOPX_CODEX_CONTEXT_DIR"],
"--defer-context-presentation"]
else:
command += ["--decision-output-root", str(capture_root)]
guard_run = subprocess.run(command, cwd=env["LOOPX_PROJECT"], env=env, capture_output=True,
text=True, timeout=120, check=True)
projected = json.loads(guard_run.stdout)
captures = list(capture_root.glob("decision-*/decision.json"))
if len(captures) != 1:
raise ValueError("checkpoint requires exactly one captured original quota decision; do not replay the guard")
raw_guard = captures[0].read_bytes()
source_path = captures[0]
raw_guard = source_path.read_bytes()
guard_digest = hashlib.sha256(raw_guard).hexdigest() if native_context else None
guard = json.loads(raw_guard)
if (not isinstance(guard, dict) or guard.get("ok") is not True or
not isinstance(projected, dict) or projected.get("ok") is not True):
raise ValueError("checkpoint requires a successful original quota guard")
if native_context and projected.get("capture_sha256") != guard_digest:
raise ValueError("checkpoint prepared capture differs from the original guard; do not replay the guard")
# A previous preflight on this wake may already have allowed model work,
# even if its optional attempt marker (or final receipt) could not be saved.
# Such reentry can verify an existing point, but cannot capture a later one.
Expand All @@ -258,23 +264,15 @@ def capture_before_replan(env: dict[str, str], receipt: dict[str, Any], body: st
if native_context:
from .context_delivery import preflight_context_instruction

# A repeated preflight can replace wake-level paths. Bind both native
# read commands to the exact CLI view of this particular guard.
view_bytes = guard_run.stdout.encode("utf-8")
source_path = captures[0]
if view_bytes != raw_guard:
source_path = capture_root / "checkpoint-start-view.json"
with source_path.open("xb") as stream:
os.fchmod(stream.fileno(), 0o600)
stream.write(view_bytes)
reading = preflight_context_instruction(env, source_path,
hashlib.sha256(view_bytes).hexdigest(), receipt["turn_id"], guide_in_host=guide_in_host)
assert guard_digest is not None
reading = preflight_context_instruction(env, source_path, guard_digest,
receipt["turn_id"], guide_in_host=guide_in_host)
else:
view_path = guard_path.with_name("checkpoint-start-view.json")
view_path.write_text(guard_run.stdout, encoding="utf-8")
view_path.chmod(0o600)
reading = (f"Read the complete CLI view at {view_path} before work, then follow its interaction_contract "
"and the next step in the replan review when present. ")
"and replan review/writeback reads when present. ")
preloaded_body = ("Host checkpoint preflight has already executed this wake's original quota guard once. "
+ reading +
"Do not repeat the initial guard below; use its selection or recovery command when required.\n\n" + body)
Expand Down
21 changes: 16 additions & 5 deletions benchmark/runtime/harbor.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,11 +370,22 @@ async def install(self, environment: BaseEnvironment) -> None:
if doctor_payload.get("ok") is not True:
raise RuntimeError(f"LoopX doctor failed: {doctor_payload}")
if self.execution_observation is not None:
wrapper = (f"#!/bin/sh\nexec env PYTHONPATH={shlex.quote(_SRC)} "
f"{_PYTHON}/bin/python3 -m benchmark.runtime.research_probe \"$@\"\n")
await self.exec_as_agent(environment,
command=f"printf %s {shlex.quote(wrapper)} > {_PROFILE}/bin/loopx-research-probe; "
f"chmod 0755 {_PROFILE}/bin/loopx-research-probe", env=self._profile_env())
entrypoint = f"{_SRC}/benchmark/runtime/research_probe.py"
# Keep the task cwd for candidate paths without importing the
# probe or its dependencies from that cwd or user site.
bootstrap = (
"import runpy\nimport sys\n"
f"sys.path.insert(0, {_SRC!r})\n"
f"runpy.run_path({entrypoint!r}, run_name='__main__')\n"
)
launcher = shlex.join([f"{_PYTHON}/bin/python3", "-I", "-c", bootstrap])
wrapper = f"#!/bin/sh\nexec {launcher} \"$@\"\n"
probe = shlex.quote(f"{_PROFILE}/bin/loopx-research-probe")
installed = await self.exec_as_agent(environment, env=self._profile_env(), timeout_sec=30,
command=f"test ! -L {probe} && printf %s {shlex.quote(wrapper)} > {probe} && "
f"chmod 0755 {probe} && {probe} --help")
if installed.return_code or "--candidate-file" not in (installed.stdout or ""):
raise RuntimeError("Local execution probe is unavailable to the benchmark worker")

receipt = {
"loopx_commit": actual_commit,
Expand Down
Loading
Loading