ghost-os icon indicating copy to clipboard operation
ghost-os copied to clipboard

Agent should verify learned recipe end-to-end before saving

Open mcheemaa opened this issue 8 months ago • 0 comments

Problem

The current self-learning flow is:

  1. ghost_learn_start → user performs task
  2. ghost_learn_stop → agent gets recorded actions
  3. Agent synthesizes recipe JSON
  4. ghost_recipe_save → recipe saved

The gap: there's no verification step. The agent synthesizes a recipe from the recording and saves it blindly. If the recipe has issues (wrong selectors, missing wait conditions, incorrect action types), the user won't discover this until they try to use it later.

Suggestion

The recommended flow should be:

  1. ghost_learn_start → user performs task
  2. ghost_learn_stop → agent gets recorded actions
  3. Agent synthesizes recipe JSON
  4. Agent runs ghost_run with the synthesized recipe to verify it works end-to-end
  5. If it works → ghost_recipe_save
  6. If it fails → agent adjusts the recipe and retries

This could be:

  • Documentation: Add to the MCP server instructions that agents SHOULD test recipes before saving
  • Built-in: Add a ghost_recipe_test tool that saves temporarily, runs, and reports pass/fail
  • Prompt guidance: Update the self-learning section in the MCP instructions to include a verification step

Impact

Recipes created from learning mode would be battle-tested before they're saved, dramatically reducing broken recipes. "Learn once, verify once, run forever."

mcheemaa avatar Mar 12 '26 04:03 mcheemaa