brief.md, target Specs, comet-state.yaml and verification.md record the contents that have been confirmed and completed for the task; .comet/runtime/native/ saves the execution process on the current device and can be rebuilt when needed.
Automatic recovery mechanism
Each time the Change continues, Native will compare the repository status with the local execution record:- Find the actual branch or worktree where the Change is located;
- Read the most recent complete write of
comet-state.yaml; - Check whether the running task, test or Verifier has been interrupted;
- Rebuild the missing or expired local execution records;
- Proceed to the current stage based on the existing evidence or return to the position that requires re-verification.
Session interruption recovery
After the terminal is closed, the Agent session ends, or a process exits unexpectedly, Native will mark the still-running native tasks as interrupts and then determine which steps can be safely retried.
Revalidation caused by recovery is included in the execution of recovery, and the counts of implementation failure and continuous no progress remain unchanged. When a new Verifier is actually started, the number of Verifier attempts will increase normally.
Continue across devices
Before changing the equipment, please synchronize the following contents first- Project code;
brief.md, target Specs andcomet-state.yamlin Change;- The generated
verification.md; - When using the custom product catalog, the corresponding
.comet/config.yaml.
Workspace restoration
Native will scan the worktree registered by Git and give priority to the working directory that is bound to the Change branch. Even if you start from the main directory of the repository, the Runtime can find the actual location of the Change and allow the Agent to continue in that directory. When the current branch, worktree type, or project root does not match the Change record, the Runtime will pause the write and return to the expected directory. When the original directory still exists, the Agent will switch to the correct location. When worktree has been removed but the branch is still valid, Native can rebuild worktree. The following situations require you to confirm the workspace:- The original branch has been renamed or taken over by other work.
- There are multiple working directories that match exactly.
- The original directory and branch have been lost.
- The same “Change” status appears in different versions at two locations.
Archive transaction recovery
Archive will update the official Spec, final status and verification report in sequence, and then move the Change into the archive directory. Runtime uses transactions to record each step, so when a process exits halfway, it can resume from a completed step. When continuing with the same Archive again, Native will check the transaction and the actual file:- When the transaction is consistent with the file, proceed from the next step.
- When the Change has been archived and the workspace closure fails, retain the archived result and return to the Git recovery action.
- When both the active and archive directories exist simultaneously, retain the contents on both sides and wait for diagnosis.
- When multiple changes modify the same Spec, wait for you to determine the archiving sequence.
recoveryArgs, and then continue with the merge, push or PR process.
Verification report restoration
verification.md is a readable projection of comet-state.yaml. When the report is missing, the write is interrupted, or the version is outdated, Native will regenerate the report based on the current state.
When the report file is lost but the status and local execution records can still prove that the verification has been passed, the recovery only involves rebuilding the report. When the local execution records before archiving are also lost, Native will return “Verify” to re-obtain complete acceptance evidence.
This distinction can preserve proven results while ensuring that the Archive uses reliable evidence on current devices and current code.
Situations that require user handling
Native will pause when it automatically determines that it may cause error overwriting, duplicate side effects, or incorrect archiving. Common situations are as follows:await-user indicates that your choice is needed for the next step. blocked indicates that the current status lacks a safe advancement path. The Runtime will simultaneously return the cause, the party responsible for handling, and the actions allowed to be executed.
Status viewing and diagnosis
Normal recovery is automatically completed by Native. When you want to view the current record or troubleshoot blockages, you can run:show and status showcase the official products, work areas, acceptance progress and next steps. doctor checks migration, transaction, directory and state consistency. doctor --repair is only used in cases where the diagnostic results clearly provide repair actions.
During the recovery process, let the Runtime manage comet-state.yaml, local execution records, locks, and transactions. Continuing according to the actions returned by continuation, recoveryArgs or doctor can preserve the confirmed progress and the fault scene.
Continue reading: Task advancement and interruption recovery, Native Security Boundary , Multi-Change Parallelism and Conflict Control and Product and State .
