Skip to content

Detect when a file's behaviour is pinned by a contract test, and say what a change means for semver #445

Done

Description

@stackbilt-admin

Problem

core.adf treats JSON output, exit codes and generated artifacts as semver-governed contracts: breaking them needs a major bump and migration notes. Nothing tells an agent, before it edits, that a file's behaviour is pinned. For example, evidence-contracts.test.ts pins adf evidence's exit-1/exit-0 behaviour. Git and search can't answer "is this a published contract?" without knowing the repo's convention.

This is the guidepost agents most need and least expect, and it's what turns governance from a gate into help.

Proposed (additive field in the preflight answer)

"contract": { "pinned": true,
  "by": ["packages/cli/src/__tests__/integration/evidence-contracts.test.ts"],
  "surfaces": ["exit codes", "--format json"],
  "guidance": "breaking = major + migration note; additive = minor" }

First version: a file counts as pinned when it's the command implementation exercised by a test under the repo's contract-test convention (*contract* test files, or a list declared in the manifest). Repos without a convention get pinned: "unknown", never a guess.

Acceptance

  • Seed packages/cli/src/commands/adf-evidence.ts returns pinned: true with evidence-contracts.test.ts in by.
  • A file with no contract tests returns pinned: false or "unknown".

Follow-up

Diff-based charter classify (#446) reuses this detection.

Works on its own. Part of #437.

Activity

  1. added
    enhancement
    type:feature
    priority:p1
    epic:preflight
    on Nov 28, 2026
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

    enhancementepic:preflightpriority:p1type:feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions