Skip to content

Typed task adapters to replace regex task-fact extraction #1

Description

@SurefireStudios

Problem

The semantic contract lint reads the task text for an order id, a recipient, a "send" instruction and prior refund ids using regular expressions tuned to the three PhantomBench templates (packages/benchmark/src/validate/). It is honest about what it checks, but it is the single most domain-specific piece of the system, and it is the first thing that breaks on a new task shape.

Proposal

Introduce a TaskAdapter interface that turns a task instruction plus a domain schema into typed task facts ({ orderIds, recipients, monetaryAmounts, prohibitedTargets, ... }), with the refund-operations adapter as the first implementation. The lint consumes facts, never raw text.

Done when

  • The existing lint behaviour is preserved on all 24 fixtures (pnpm benchmark:validate, pnpm benchmark:validate-hard).
  • A second adapter can be registered without touching the lint.
  • An ADR under docs/decisions/ records the interface.

See docs/limitations.md, "Known weaknesses in the implementation".

Activity

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

    assertion-dslThe assertion language and the deterministic verifierneeds-designNeeds a written design or ADR before coderoadmapOn the roadmap in docs/roadmap.md

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions