Skip to content

Replace prompt wording tests with behavioural contract tests #62

Description

@jrpbuilds

Parent

Part of #46.

Relationships

Depends on #57, #58, #59, #60 and #61.

Goal

Stop treating incidental English wording in system prompts as an API. Replace brittle phrase-presence tests with tests of the runtime contracts and agent behaviours the wording was intended to protect.

Problem

The current prompt/agent test suite contains many assertions of the form:

expect(prompt).toContain("...")

Those tests make prompt sediment difficult to remove because changing wording can fail CI even when behaviour is unchanged or better.

Scope

Audit prompt and agent tests and classify assertions into:

Keep exact/textual assertions only when wording is a real contract

Examples may include:

  • required machine-readable terminal markers;
  • exact handoff tokens that a parser consumes;
  • required include/loading invariants;
  • intentionally stable tool/role identifiers.

Replace prose-presence tests with behaviour/structure tests

Examples:

  • Todo updates happen automatically rather than the prompt saying they should;
  • invalid assignments are rejected rather than the prompt warning about overlap;
  • lifecycle gates agree with status rather than the prompt explaining transition rules;
  • dispatch payload contains assigned task/finding context rather than role prose repeating it;
  • Reviewer output preserves finding semantics rather than checking for one sentence explaining them.

Testing strategy

Prefer, in order:

  1. pure deterministic unit tests;
  2. host/tool integration tests;
  3. dispatch contract tests;
  4. focused prompt structure/size tests;
  5. model-driven behavioural scenarios where semantic behaviour cannot be tested deterministically.

Do not replace brittle string tests with equally brittle snapshots of entire prompts.

Acceptance criteria

  • Obsolete phrase-presence tests tied to v1.6 workflow prose are removed.
  • Each removed safety/workflow assertion is either covered by runtime/contract behaviour or intentionally documented as unnecessary.
  • Exact textual assertions remain only where text is genuinely machine-consumed or intentionally contractual.
  • No full-prompt snapshots are introduced as a substitute.
  • Prompt include/loading/package tests remain intact.
  • The rewritten prompt suite can evolve wording without unrelated CI churn.
  • Behavioural coverage exists for the major mechanics moved out of prompts in Enrich specops_status with workflow capabilities #48Make specialist dispatch payloads carry current-job context #56.

Out of scope

  • Final prompt budget values.
  • Full end-to-end benchmark suite.
  • Weakening machine-consumed handoff/review contracts.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions