> ## Documentation Index
> Fetch the complete documentation index at: https://docs.comet.rpamis.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Change Spec or roll back mid-workflow

> Handle spec edits, unsatisfying implementation, verify failures, pre-archive rechecks, and preset upgrades without corrupting workflow state.

## First: phase is not manually edited

Do not hand-edit `phase` to force progress. Use the workflow transition that matches the evidence.

## Available transition events

Typical events include proposal approval, design approval, build completion, verify pass, verify fail, archive completion, and preset upgrade.

## Scenario 1: edit spec during build

If the spec changes during build, Comet should detect drift and decide whether the current design still applies.

## Scenario 2: implementation is wrong and you want to rebuild

Use a verify-fail or explicit rollback path. Preserve evidence, then return to build with a clear reason.

## Scenario 3: verify passed but you want another check before archive

Stay in verify and run the extra checks. Archive only after the evidence is acceptable.

## Scenario 4: hotfix or tweak grows larger

Upgrade the preset to the full workflow when the work needs design, broader verification, or spec changes.

## Scenario 5: resume finds uncommitted changes

Inspect the worktree. Do not discard changes unless the user explicitly asks.

## Rollback reference

| Need               | Route                                    |
| ------------------ | ---------------------------------------- |
| Bad implementation | verify fail -> build                     |
| Spec drift         | build or verify -> design/open as needed |
| Preset got bigger  | preset -> full workflow                  |
| Extra checks       | stay in verify                           |
