Skip to content

Research: expand hook lifecycle to support v1 worker–evaluator dialogue and v2 mechanical lints #19

@samkeen

Description

@samkeen

Why

Today's hook surface is narrow: tilth/hooks/ has pre_tool and post_edit, wired through a hand-rolled tools/__init__.py:dispatch(). The contract is "success silent, failures verbose — to the agent" (see docs/deep-dives/).

This issue is the research artifact for whether the hook surface should grow into a more general lifecycle system — no code changes proposed here.

The motivation is two upcoming workstreams:

  1. v1 worker–evaluator dialogue (proposals/v1-worker-evaluator-dialogue.md) introduces several natural new lifecycle points:
    • pre_submit_case — schema-validate the worker's structured case
    • pre_evaluator — assemble the ledger excerpt, gate on validator pass
    • post_evaluator — append the verdict to the per-task ledger, emit evaluator_verdict event
    • pre_halt — check halt eligibility (≥3 similar rejections, or work_arounds claims a seed contradiction)
  2. v2 richer mechanical checks — Tilth's analog of OpenAI's custom lints inject remediation into agent context. That pattern is exactly "policy at well-defined event points" — which is what a lifecycle is for.

The question to answer

Does the v1+v2 set of new seams cluster into a general lifecycle system worth formalizing (event names, registry, ordering, error propagation), or is each one-off enough that ad-hoc wiring in dispatch()-style helpers stays simpler?

Premature lifecycle is its own complexity sink. The defensible answer is probably "not v1 — formalize alongside v2 custom lints, once we've actually shipped the seams and can see whether they cluster."

Scope of this issue

  • Survey the v1 + v2 new event points.
  • Sketch what a general lifecycle would look like (event taxonomy, registry, contract).
  • Decide whether to formalize now, alongside v2, or never.

What this is not

  • Not an implementation issue. No tilth/hooks/ changes proposed here.
  • Not a competing design to the v1 dialogue. The v1 sketch ships on the existing narrow hook surface.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions