feat(daemon): add semantic checkpoints#965
Open
9s5bz2jvd2-lang wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
checkpointtool to LingTai daemon sessions after the exactDaemonRunDirexistsdaemon.json.latest_checkpointdaemon(check)and preserve the same tool surface after same-run compact reconstructionWhy
Long daemon runs can cross hard turn, compaction, or parent-restart boundaries without a small machine-readable statement of which semantic phase actually completed. This adds an explicit voluntary phase boundary without treating every model turn as causal progress.
Safety and scope
next_actionis advisory text only: no automatic execution, retry, message, or resumephase_status="complete"is not a run terminal state; only the existing daemon completion gate followed byfinish(status="done")can mark the run donecheckpointValidation
1. Focused offline regressions
test_checkpoint_complete_does_not_mark_run_done_or_bypass_finish— 1 passedrunning,finished_at=null, nodaemon_donefinish(done)completion signal: still non-terminal until the runner's existing completion gate accepts itdoneand event ordercheckpoint < finish tool_call < daemon_donenext_actionmarker is never createdtests/test_daemon_checkpoint.py: 29 passedpy_compile: passgit diff --check: pass2. Exact unfiltered offline daemon matrix
One pytest command ran all eight files documented in the daemon CONTRACT, with no
-k, manual exclusion, new skip, or xfail:test_daemon_tool_contract_verification_matrix_covers_native_mimoNO_MATCHon both pristine basea3f172ff571c39792ae219b76611e38feb673de4and this branch; this PR does not modify that unrelated anchored-claims rowThis is an offline fake/mock contract matrix. It is not presented as real-provider end-to-end evidence.
3. Real provider-backed multi-stage acceptance
An isolated agent imported this PR's source explicitly (no install or refresh of the running main agent), loaded no ordinary addons or external MCP registry entries, and ran a real
codex-pool / gpt-5.6-soldaemon from2026-07-16T11:30:23Zto11:31:17Z.Observed immediately after the real model completed phase 1 and called
checkpoint:daemon.json.state == "running"finished_at == nulllatest_checkpoint.phase_id == "phase-one-real"latest_checkpoint.phase_status == "complete"daemon(check).checkpointmatched the same checkpoint IDdaemon_completion.jsondid not existnext_actionasking forauto-next-action.txthad not executedThe parent harness then released phase 2. The real model continued, created the phase-2 artifact, verified the advisory marker was still absent, and explicitly called the existing daemon-common
finish(status="done"). The durable event order was:checkpoint (11:30:59Z) < phase-2 shell work < finish tool_call/result (11:31:15Z) < daemon_done (11:31:17Z)Result: 14/14 acceptance assertions passed. The completion file used the existing
lingtai.daemon_completion.v1schema withstatus="done"; the advisory marker never existed.Selected local evidence hashes (SHA-256):
22ed1263abfa537461181563b19bed854a1108a98f65b70f3c61e5b69693ea8cdaemon.json:9aa14919a7263176e1ba81b12010c021ea0a241c40b8b5850c188bcd5d5c13a42ea30414bf136365a8acee1b26768e6b1f1adec6494aa79622d5d2f5b5e13afe19b04563f9be6d875f98e2702e787882601731ed99c2a79b4f976a7a4b742a49Design archaeology
The bounded inspectable surface and explicit semantic-boundary choices were informed by #81, #263, #340, #510, #532, #624, and open #712. These references constrain the design; this PR does not claim to reopen or solve those broader issues.