Skip to content

feat: success path tail/head strategies for learned patterns #57

@randomm

Description

@randomm

Task Description

Currently, the success path in pattern TOML only supports pattern (regex) + summary (template). The failure path supports tail, head, grep, and between strategies with configurable line counts.

For some commands, agents want to see the last N lines of successful output (e.g., test summary, coverage summary) rather than a single regex extraction. There is no mechanism for this on the success path.

Proposed Design

Allow success section to use the same strategies as failure:

[success]
strategy = "tail"
lines = 10

This would show the last 10 lines of output on success, which is useful for:

  • Test runners (summary at the bottom)
  • Coverage tools (summary at the bottom)
  • Build tools (artifact paths at the bottom)

Quality Gates (Non-Negotiable)

  • TDD: Write tests before implementation
  • Coverage: 80%+ test coverage for new code
  • Linting: All code passes project linting rules
  • Local Verification: All tests pass locally

Acceptance Criteria

  • Success section supports strategy field (tail, head, grep)
  • Existing regex+summary patterns continue to work unchanged
  • Tests verify both old and new success formats

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions