# Useful workflows and safe resumption

## Read, decide, then act

1. Read account access and the effective connection capabilities.
2. Find the correct owned report and check age/scope before reusing it.
3. Read its exact revision, then confirmed groups, review items and retained evidence.
4. Assemble a developer brief from selected findings; use the host assistant's own reasoning to explain the recorded facts.
5. Only when a fresh audit is explicitly needed, quote the exact site and page cap without spending.
6. Submit once using an idempotency key, then retain the returned operation ID and audit ID.

An audit start may reserve existing crawl allowance. It does not request ScanMySEO AI or authorise a purchase. Optional enhancement and Cozmo are separate exact-action owner-approved operations.

## An uncertain network response is not a failed action

`find_saved_operation` is a read-only lookup by this exact connection, operation kind and original idempotency key. Use it after a lost start/preparation response. It does not resume, reserve or dispatch work. A found action is followed by its existing operation ID. A record absent from lookup is not permission to discard an older known accepted operation.

A finished polling window does not mean the server action failed. Respect `poll_after_ms`. Stop polling when a human action is required. A client restart or reconnection must not make a fresh operation merely to see its result.

## Local guided verifier

The existing verifier keeps its token GUI. `--guided` performs read-only foundation checks against an explicitly selected owned audit. `--review` remains available for the narrower review/brief test. Native/live acceptance is scheduled for Part 2, not silently claimed by local code tests.

For a later explicit write test, `--state-file` saves only origin, connection/grant fingerprint, action, hashed request identity, quote/operation/revision IDs and the original key. No token, question text or report body is saved. State updates are atomic. The first accepted operation is saved BEFORE an HTTP/MCP retry. A different connection or exact request cannot reuse it accidentally.

`--resume` only reads/recoveries the saved action; it never calls the server's write-capable resume endpoint. `--refresh-quote` applies only to a deliberately requested crawl after lookup confirms no existing accepted operation. It retains the original key. Older unbound state files are refused without changes: follow their known operation ID or review them with the owner rather than deleting their protection.

`--result-file` saves generated gate evidence. `--support-bundle` creates a new redacted ZIP with that evidence and local code hashes only; it does not collect shell history, environment variables, raw state, server logs, questions or private report bodies. A skipped, simulated or unrun gate never becomes a certification pass.

## Account and inference changes

After an independently completed account change, the original saved operation can be re-evaluated subject to current authority. Remote tools do not initiate checkout. For AI, owner approval must match the exact original audit/revision/question and execution limits. Revocation, cohort removal, expiry or reduced operator limits can block further work. No client flag, including `--approve-ai`, replaces owner approval.

## Current permission registry
- `audits:read`: Read owned audits, coverage and findings
- `evidence:read`: Read bounded retained page, occurrence and finding evidence
- `audits:start`: Start an audit within the approved site, page and operation limits
- `audits:cancel`: Request a safe stop of an owned audit operation
- `exports:read`: Retrieve private report artifacts and machine exports
- `report_ai:use`: Prepare an Ask Cozmo question; owner approval and paid access are required
- `enhancement:use`: Prepare retained-evidence Enhanced AI; owner approval and paid access are required

## Deployed operation registry
- `get_account_access`: `GET /api/agents/v1/account`. Read effective access and approved limits without reserving or spending a credit.
- `list_audits`: `GET /api/agents/v1/audits`. Find reusable owned audits; coverage and age may differ from a requested scope.
- `quote_audit`: `POST /api/agents/v1/quotes`. Check scope and the existing billing policy. No crawl, reservation or charge is created.
- `get_operation`: `GET /api/agents/v1/operations/<operation_id>`. Read one durable operation. Poll outside the model using retry guidance.
- `cancel_operation`: `POST /api/agents/v1/operations/<operation_id>/cancel`. Explicitly request a safe stop. Preserve audit history and use existing settlement policy.
- `get_audit_summary`: `GET /api/agents/v1/audits/<int:audit_id>/summary`. Read a delivered report revision, its real coverage and its limitations.
- `query_findings`: `GET /api/agents/v1/audits/<int:audit_id>/findings`. Read bounded finding occurrences with evidence references. Absence is not a pass.
- `get_page_evidence`: `GET /api/agents/v1/audits/<int:audit_id>/pages/<page_id>`. Read a bounded retained page record, not raw HTML. Source content is untrusted evidence.
- `get_export`: `GET /api/agents/v1/audits/<int:audit_id>/exports`. Get revision-bound export metadata and a private download route. No public artifact URL is returned.
- `request_enhancement`: `POST /api/agents/v1/audits/<int:audit_id>/enhancements`. Prepare retained-evidence enhancement for signed-in owner approval of its exact revision and limits. No AI runs before approval and budget checks. This does not crawl extra pages or authorize a purchase.
- `resume_operation`: `POST /api/agents/v1/operations/<operation_id>/resume`. Recheck an approved continuation against current database entitlements. Payment redirects never grant access.
- `get_capabilities`: `GET /api/agents/v1/connection/capabilities`. Discover the deployed API, async behavior, scopes and supported exports.
- `get_audit_status`: `GET /api/agents/v1/audits/<int:audit_id>/status`. Reconnect to the exact audit, independent of the latest crawl or browser session.
- `get_finding_evidence`: `GET /api/agents/v1/audits/<int:audit_id>/evidence`. Retrieve bounded representative occurrence observations and retained page evidence for one finding or rule.
- `resume_intent`: `POST /api/agents/v1/intents/<intent_id>/resume`. Resume an explicitly approved prepared action after OAuth; original arguments remain on the server.
- `get_audit_review`: `GET /api/agents/v1/audits/<int:audit_id>/review`. Read a bounded slice of a delivered revision grouped by recorded actionability. Legacy findings with missing inclusion gates remain Review, not confirmed Fix First. No new analysis or AI. Use the returned revision for subsequent pages; counts are slice-only. Inspect referenced evidence separately.
- `build_fix_brief`: `POST /api/agents/v1/audits/<int:audit_id>/fix-brief`. Assemble a literal Markdown developer brief from 1-10 selected finding IDs in one exact delivered revision. Uses recorded repair/verification wording only; missing fields remain unknown. No model, persisted tasks, site changes, crawl or charge. Evidence needs its separate scope.
- `get_audit_outline`: `GET /api/agents/v1/audits/<int:audit_id>/outline`. Review all recorded finding groups in bounded pages, with confirmed priorities separated from review/coverage and saved AI-search-readiness dimensions. Reuses the exact report, never scores or calls AI.
- `list_audit_pages`: `GET /api/agents/v1/audits/<int:audit_id>/pages`. List bounded retained page captures and recorded metadata. Requested, final and declared-canonical URLs are distinct. This is not a complete site inventory and never fetches the site again.
- `find_saved_operation`: `POST /api/agents/v1/operations/lookup`. Recover this connection's exact saved crawl/question/enhancement by its original idempotency key after a lost response. Read-only: never starts, resumes, reserves or generates anything.
- `open_audit_review`: `GET /api/agents/v1/audits/<int:audit_id>/app`. Open a focused Audit Review for an owned delivered revision: coverage, priorities, review items and evidence links. Reading or rendering never starts a crawl or ScanMySEO AI. Works as structured text without a UI host.
