One write belongs to one change
Project initialization installs one Comet workflow Rule per platform and only onecomet-hook-router.mjs on platforms with Hook support. The Router reads .comet/config.yaml and .comet/current-change.json, then sends one atomic multi-file write to at most one workflow Guard.
Native and Classic Guards remain independent:
- Native checks only Shape, Build, Verify, Archive, and Native paths;
- Classic checks its five phases and OpenSpec/Superpowers paths;
- invalid, stale, or ambiguous selection causes potential writes to fail closed;
- explicitly recognized read-only tools do not trigger a write Guard.
Why verification evidence becomes stale
The Runtime binds verification conclusions to:- the brief and complete target specifications;
- project artifacts in the implementation scope;
- Acceptance IDs and an immutable report snapshot;
- the current change revision; and
- an optional built-in check receipt.
next. Run it to retreat to Build, generate a new scope, and verify again. Reconfirm with the user only when the brief/spec contract hash also changed; preserve the existing approval when only the project snapshot or implementation changed. Drift in a report, receipt, or another bound Archive fact uses the same retreat protocol. Never delete findings, edit evidence refs, or reuse the old pass.
The Native Runtime invokes Git only in Git projects to create a bounded Git-aware snapshot. comet native check is a separate built-in bounded read-only text-hygiene scan. It invokes no Git, shell, test command, external Skill, or other external process and does not replace project tests.
Baselines and schema migration
A new change must obtain a complete baseline before committing state. A Git snapshot includes only tracked and non-ignored untracked files, treats each submodule/gitlink as one atomic entry, and excludes ignored caches and contents of unregistered nested repositories from the project-owned set. An incomplete current snapshot never turns a missing path into a deletion. For a change already using the v3 schema, a missing or incomplete baseline is not an automatic doctor repair. Rebuilding from current files would erase historical differences since creation. Restore the original baseline from a trusted backup, or preserve the brief/specifications and implementation facts while creating a new change. Explicit v1/v2 schema migration is the sole cutover exception. Before any state write,doctor --repair captures a complete baseline at the migration timepoint. An incomplete capture leaves the old state unchanged. Post-migration evidence proves only changes after the cutover and cannot inherit an old scope or pass. An old Verify/Archive change retreats to Build to establish fresh v3 evidence.
Autonomous repair does not loop forever
A Verify failure returns to Build. The Runtime builds a failure signature from categories, check IDs, the contract, and implementation scope:- the third identical signature on the same scope becomes a manual stop;
- a real implementation-scope change opens a new repair episode;
- one no-progress override is available and is bound to the current signature;
- one episode records at most 12 failures.
Concurrent specification conflicts
Several Native changes may exist in parallel, but safety for the same canonical specification has a precise boundary. Archive compares thebase_hash frozen by the Runtime in Shape with the current canonical hash. A mismatch stops instead of applying last-write-wins.
Recovery is:
- read the latest canonical specification;
- rewrite the change’s complete target specification;
- run
comet native spec rebase <change> --summary <text>; - repeat Build and Verify; and
- run the two-step Archive again.
Transaction and lock recovery
Phase transitions, checkpoints, Archive, and root moves have explicit journals or recovery protocols. Ordinary writes never take over a stale lock on their own. Onlydoctor --repair can do so after proving the local owner no longer exists, lock identity is unchanged, and no conflicting transaction exists.
- ordinary phase transitions can only continue;
- Archive and root moves can roll back only while the journal is still reversible;
- after Archive’s final marker, only exactly-once continuation is allowed;
- Doctor never rewrites a user’s brief, specifications, verification report, or project source.
Ambient Resume
comet resume-probe is read-only. It resolves the default workflow from .comet/config.yaml, then inspects only that side:
Damaged configuration or workflow state makes the probe stop with a reason instead of scanning another directory and guessing.
ambient_resume: false disables automatic probing for ordinary requests; an explicit /comet call still works.

