# Form Workflows

## Validation workflow

1. Discover refs
2. Run negative matrix cases
3. Assert field-level and summary errors
4. Run positive submission path
5. Re-snapshot after each submit branch

## Multi-step workflow

1. Validate each step in isolation
2. Preserve and verify carried values
3. Validate final confirmation state and IDs

## Dynamic requirement workflow

1. Trigger conditional sections (toggles/selectors)
2. Re-snapshot and discover newly required fields
3. Validate requiredness transitions and submit gating
4. Verify hidden fields are not submitted unexpectedly

## File upload workflow

Use deterministic upload surfaces instead of opening an OS file chooser.

```text
opendevbrowser_upload sessionId="<session-id>" ref="<file-input-ref>" files=["<absolute-file-path>"]
opendevbrowser upload --session-id <session-id> --ref <file-input-ref> --files <absolute-file-path>
```

1. Validate accepted type/size constraints
2. Upload invalid files with `opendevbrowser_upload` and assert the rejection path
3. Upload a valid file with `opendevbrowser_upload` and correlate server response
4. Confirm upload state survives step transitions

## Challenge checkpoint workflow

1. Detect challenge state
2. If the environment exposes a deterministic slider/test gate, complete it with low-level pointer controls and re-snapshot
3. Otherwise pause and annotate a manual checkpoint
4. Resume after completion from a refreshed snapshot
5. Continue assertions from refreshed snapshot
6. Stop and escalate after repeated challenge loops
