Task: Add executable task result verification to haih-agent core

Add executable task result verification to haih-agent core

16.09.2026haih agent

Port the approach with reproducible verification scripts to the core: the agent must be able to use them as a definition of done and execute them independently after making changes.

Context

Related to the Open Graph markup task cmu41yoku0f87qw0qub13wo6h.

In that task, a terminal TypeScript script for checking HTML markup was written first. It captured the initial state of the page, was then passed to the AI agent along with the task requirements, and after implementation, the same script was used to confirm a successful result.

Practical pattern:

reproduce β†’ implement β†’ verify

This approach should be elevated from a project-specific level into the haih-agent core.

Implementation Reference

As an example, look at the commit in HappyBaby:

e664496d8500751a13727b

It is necessary to examine what exactly was added around the verification scenario and extract the generalizable part into the agent core.

Requirements

Add the ability to work with executable task result verification to the core mechanics:

  • a task can contain or generate a verification script/command;
  • the agent must treat this verification as the actual definition of done;
  • before making changes, it is desirable to be able to run the verification and capture a baseline/failing state, if applicable;
  • after implementation, the agent must independently run the same verification;
  • a task must not be considered completed solely based on the agent's text report if an executable verification is available;
  • the final report must include the actual verification command and its execution result;
  • if the verification fails, the agent must continue the correction loop rather than shifting the initial verification onto a human.

Example Scenario

For Open Graph, there was a command like:

npx tsx scripts/check-page-image/index.ts "http://localhost:3000/catalog/product.html"

Before changes:

HTTP: 200

βœ— og:title: missing
βœ— og:description: missing
βœ— og:image: missing
βœ— og:url: missing
βœ— og:type: missing

RESULT: invalid or incomplete

After implementation:

HTTP: 200

βœ“ og:title: Small-sized playground Ship
βœ“ og:description: Size 3.48 x 1.78 x 2.32 m.
βœ“ og:image: http://localhost:3000/images/resized/middle/images/img.jpg
βœ“ og:url: http://localhost:3000/catalog/product.html
βœ“ og:type: product

RESULT: OK

Expected Result

What is needed is not Open Graph-specific logic, but a universal core mechanism for a scenario where a task has a machine-executable result verification.

Desired agent loop:

1. Receive the task
2. Find/create a reproducible verification
3. Execute it and understand the initial state
4. Implement the change
5. Independently repeat the verification
6. On error, continue fixing
7. Complete the task only after a successful verification or an explicitly documented reason why verification is impossible

Definition of Done

  • The core has generalized support for executable task result verification.
  • The verification is run automatically by the agent after implementation, if available.
  • Unsuccessful verification does not lead to a false done.
  • The verification result is included in the final report/worklog.
  • The solution is not tied to a specific HappyBaby project or Open Graph.
  • Tests for successful and failing scenarios have been added.
  • Commit e664496d8500751a13727b has been studied and used as a practical reference, but the core implementation remains universal.