Skip to content

docs(cli): failure-diagnosis playbook in generated .verfix/INSTRUCTIONS.md #61

Closed

Description

@jyotir-aditya

Problem

Verfix's captured evidence is only useful if the agent knows it exists and knows the next question to ask. Today .verfix/INSTRUCTIONS.md (generated by cli/src/agents-md.ts → generateAgentsSection()) documents the schema, workflow, and failure table — but not a diagnosis procedure. Agents that hit a failure with an unclear cause fall back to re-running flows and grepping raw artifacts.

We can't enumerate every failure cause, but we can teach a reliable process that works for any cause.

Proposal

Add a short "Diagnosing a failure" playbook to generateAgentsSection():

  1. Read the failure's fix_hint, findings[], and page_state facts in the JSON output — often the answer is already there.
  2. Still unclear → verfix show <id> --timeline --last 30 --output json to see what happened around the failure (steps/console/network interleaved).
  3. Selector-related → verfix show <id> --dom '<selector>' to check the failure-time DOM; also check page_state for open dialogs/overlays.
  4. Suspected app error → verfix show <id> --console / --network for full untruncated logs.
  5. Only after the evidence points at app code should the agent read/change project source (and the source-guard rules still apply).

Keep it in the full reference (.verfix/INSTRUCTIONS.md), not the AGENTS.md stub — per the repo rule the stub stays minimal. A one-line pointer in the stub's existing text is enough if it fits naturally.

Depends on

This documents features from: failure-time facts, show --timeline, show --dom, and the analyzer pipeline. Write it last, matching what actually shipped — don't document flags that don't exist yet.

Acceptance criteria

  • Playbook section in generateAgentsSection() covering the escalation ladder above
  • Examples stay generic (no hardcoded flow names — repo rule in CLAUDE.md)
  • Verified by running npx ts-node src/index.ts init in a clean directory and reading the generated .verfix/INSTRUCTIONS.md

Activity

  1. added
    documentation
    enhancement
    on Jul 9, 2026
  2. jyotir-aditya commented on Jul 11, 2026

    @jyotir-aditya
    ContributorAuthor

    Shipped in #85: a Diagnosing-a-failure escalation ladder in the generated .verfix/INSTRUCTIONS.md — read fix_hint/findings/page_state first, then show --timeline, then show --dom + open_dialogs, then show --console/--network, and only then touch project source. Documents the shipped surface only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions