HK-hub/AgentSkills / ax-audit
ax-audit
VerifiedAudits agentic applications for architecture and trust: tool parity, tool granularity, context injection, completion signals, approval gates, confidence cues, escape hatches, intent handshakes, memory visibility, and adaptive canvases. Produces a ship-readiness verdict plus an AX Relationship Summary. Use when reviewing agentic feature PRs or asking "is this agent-native", "AX review", "critique this AI feature", "does this earn user trust", or "audit this for AX". For traditional frontend UX use ui-audit.
rules-arch/context-no-checkpoint-resume.md
View on GitHub---
title: Long-running agent with no checkpoint/resume
slug: context-no-checkpoint-resume
category: context
defaultTier: backlog
surfaces: agent-tool-execution, agent-dashboard
agent-native-principle: Improvement Over Time
detection: hybrid
related: comm-no-completion-signal
---
## Long-running agent with no checkpoint/resume
Agent runs a multi-step task with no durability. Browser closes, network drops, session times out, all progress lost. User starts from scratch. Violates Improvement Over Time: completed work should survive interruption.
## What goes wrong
User asks the agent to refactor 15 files. Agent completes 12 over 4 minutes. Laptop sleeps. On reconnect the session is gone, with no record of what was done. Agent redoes all 15, possibly making different choices.
## Detection
**Surfaces:** agent-tool-execution, agent-dashboard
**Static signals:**
1. Find execution loops or multi-step task handlers.
2. Check whether they persist state between iterations.
3. Check whether resume/recovery logic exists.
4. Flag multi-step agents with no checkpoint writes.
**Runtime signals:** Agent runs >60s with no state persistence. Reconnect restarts from scratch.
**Concrete commands:**
```bash
rg '(for\s*\(|while\s*\(|for await)' --type=ts -A 5 src/ | rg -B 1 '(toolCall|executeStep|runTool)'
rg '(checkpoint|saveState|persistSession|saveProgress)' --type=ts src/
rg '(resume|recover|restoreSession|loadCheckpoint)' --type=ts src/
```
**False-positive guards:**
- Skip files with `// ax-audit-ignore:context-no-checkpoint-resume`.
- Skip single-step agents (no loop, single tool call).
- Skip agents reliably under 10 seconds.
- Skip test files and fixtures.
## Fix
```tsx
// before
async function refactorFiles(files: string[]) {
for (const file of files) await agent.refactor(file);
}
// after: checkpoint after each step, resume on reconnect
async function refactorFiles(sessionId: string, files: string[]) {
const cp = await loadCheckpoint(sessionId);
const done = new Set(cp?.completed ?? []);
for (const file of files) {
if (done.has(file)) continue;
await agent.refactor(file);
done.add(file);
await saveCheckpoint(sessionId, { completed: [...done], updatedAt: Date.now() });
}
}
```
## Default tier and overrides
**Defaults to:** `backlog`
| Surface | Tier |
|---|---|
| Agent tool execution | fix-this-sprint |
| Agent chat | backlog |
| Agent config | backlog |
| Agent dashboard | backlog |
## Examples
**Anti-pattern (fails):** `for (const t of tasks) await agent.execute(t)`: tab closes at task 8, all lost.
**Applied (passes):** Loop resumes from `loadCheckpoint(id)` index, calls `saveCheckpoint` after each step.
## Suppression
```tsx
// ax-audit-ignore:context-no-checkpoint-resume, sub-second operation
await agent.formatSingleFile(filePath);
```
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |