Skip to content

Prevent requirement and test accretion from proof-of-wording incentives #38

Description

@ncrmro

Problem

The current specification and review workflow can reward more normative clauses, more test bodies, and more parameter cases without producing proportionally more evidence about product behavior.

Panopticon provides a concrete case study. A read-only audit found approximately 761 active requirements across 64 specification files. The audit's proposed consolidation retains the externally observable and security-sensitive contracts while reducing the normative corpus to roughly 400 requirements, primarily by merging artificial splits and cross-spec duplicates. Its test suite grew from 683 to 3,277 collected executions; an estimated 500–1,050 executions appear removable after the requirements are cleaned up.

These are advisory estimates, not deletion quotas. They demonstrate the incentive problem:

  • one evidence obligation per normative item encourages one-test-per-MUST duplication;
  • requiring rejected counterexamples for every conjunct and boundary term encourages Cartesian products over inputs that reach the same behavior;
  • requirements about documentation, tests, CI, verdicts, or test helpers create prose pins and tests of test machinery;
  • whole-file or shared-helper evidence hashes turn harmless edits into mass verdict invalidation;
  • duplicated security rules across specifications produce duplicated evidence rather than one canonical invariant;
  • requirements that prescribe an implementation mechanism obscure the observable outcome that actually matters.

This is not an argument against RFC 2119 language, adversarial review, security inventories, or agent-facing prompt contracts. It is an argument that the workflow currently rewards quantity and literal proof of wording more strongly than discriminating behavioral evidence.

Downstream case study and cleanup: Unsupervisedcom/panopticon-next#7

Reproducible evidence snapshots

These links intentionally identify commits rather than moving branches so a future reviewer or agent can inspect the same artifacts and reproduce or challenge the audit:

The counts and classifications in this issue describe those snapshots. Later changes SHOULD be compared against them rather than assuming the numbers still describe a moving default branch.

Prior art: GitHub Spec Kit

GitHub's Spec Kit offers useful requirement-authoring guidance that 2119 should preserve and sharpen:

That guidance is better than treating every normative phrase as an independent proof obligation, but it is not sufficient by itself. “Each requirement must be testable” can still be misread as “each requirement must have its own test,” while broad prompts to identify all edge cases can still reward speculative negative-space enumeration. The symmetric review probe proposed below adds the missing discriminator: evidence must fail when behavior is removed and survive legitimate changes that preserve meaning.

Distinguish three concerns

  1. Keyword misuse: MUST is used for editorial choices, exact prose, repository layout, test construction, or implementation mechanisms that are not interoperability or harm-prevention contracts.
  2. Workflow incentives: per-item evidence, exhaustive boundary-term counterexamples, and broad evidence hashes make requirement and test accretion a rational way to obtain a pass.
  3. Repository-specific cleanup: repositories still own their duplicated requirements and low-value tests. The tool should change the incentives, not automatically delete evidence.

Proposed direction

1. Make the counterexample obligation symmetric

The reviewer SHOULD name:

  • one concrete implementation change that violates the requirement and that the evidence would detect; and
  • one legitimate change—such as paraphrasing, renaming, reformatting, adding a sibling item, or reorganizing files—that does not violate the requirement and therefore MUST NOT fail the evidence.

A test that breaks only because wording or organization changed is a tripwire, not behavioral evidence. This generalizes the falsifiability work in #30 without requiring a counterexample for every word in a requirement.

2. Count shared evidence, not test bodies

  • One test MUST be allowed to cover multiple requirement IDs.
  • Reviewers MUST NOT request a new test when existing evidence already rejects the relevant counterexample; they SHOULD request an additional annotation or explicit cross-reference.
  • A requirement MUST NOT receive credit merely because it has a uniquely named test.

3. Separate product requirements from verification notes

Normative product requirements SHOULD describe observable behavior or a genuine delivered contract.

Test strategy, CI commands, minimum subject counts, review procedure, migration bookkeeping, and tool-version adoption SHOULD live in verification or maintenance notes unless they are themselves an externally supported interface.

Agent-facing text MAY be normative when it is delivered through a product surface and materially controls agent behavior. The contract SHOULD state the instruction or outcome that must survive; it SHOULD NOT pin an entire paragraph, heading order, or unrelated prose.

4. Narrow verdict invalidation

Verdict identity SHOULD be scoped narrowly enough that harmless fixture, helper, documentation, rename, or formatting changes do not invalidate unrelated evidence. This complements #27. The design MUST preserve detection of shared mocks or helpers that can genuinely neutralize evidence.

5. Use judgment rather than another metric gate

Hard limits on executions per requirement, prose-test ratios, branch counts, or matrix sizes would create another compliance game. The tool MAY report these as review prompts or trends, but they SHOULD NOT become pass/fail proxies for test value.

Reviewer questions

For each requirement/evidence relationship, the review packet SHOULD ask:

  1. What public or delivered surface exposes the required behavior?
  2. What plausible implementation change would violate it, and would this evidence fail?
  3. What legitimate non-violating change would leave the evidence green?
  4. Does existing evidence already cover the same counterexample?
  5. Do parameter values exercise meaningfully different behavior, or merely different spellings of the same branch?
  6. Is the requirement an outcome, or is it prescribing documentation, tests, CI, or implementation structure?

Anti-patterns to call out explicitly

  • exact equality or substring assertions against specifications, general documentation, comments, or docstrings;
  • repository-file, generated-string, or test-module digest pins used as behavioral evidence;
  • frozen inventory literals where the inventory could be derived from the running product;
  • Cartesian products whose dimensions do not interact in production behavior;
  • new test files named for review rounds or gaps rather than product behavior;
  • unit tests for test-only helpers created solely to satisfy the evidence gate;
  • a skipped end-to-end test surrounded by always-running tests of its scaffolding;
  • duplicated tests attached to split or renamed requirements.

Important exceptions

Acceptance criteria

  • Review instructions MUST include both a violating-change probe and a legitimate-change survival probe.
  • Review instructions MUST permit one evidence body to cover multiple requirements and MUST discourage duplicate bodies added only for traceability.
  • Author guidance MUST distinguish behavioral requirements, delivered-text contracts, and non-normative verification notes.
  • The reviewer MUST reject evidence whose only value is pinning irrelevant wording, layout, hashes, or implementation organization.
  • The reviewer MUST consider whether large parameter sets exercise distinct behavior rather than demand exhaustive cases from universal wording alone.
  • Verdict invalidation scope MUST be documented, including the tradeoff between helper integrity and unrelated hash churn.
  • Existing calibration examples MUST cover both false rigor and legitimate exceptions: prose tripwire, redundant matrix, derived security inventory, delivered agent instruction, and distinct malformed shapes.
  • Rollout MUST begin as reviewer-guidance changes and observational reporting; it MUST NOT automatically delete or invalidate repository tests.

Evaluate without creating another target to game

Observe these as trends, not gates:

  • verdict invalidations after changes that did not alter requirement meaning;
  • review rounds per requirement;
  • tests added versus existing tests cross-referenced when specifications change;
  • time required for documentation-only changes to reach green;
  • mutation detection of full matrices versus representative subsets;
  • requirements covered only by tests skipped in default CI.

Related upstream work

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions