Contracts

A contract is plain Markdown with YAML frontmatter -- PitWay validates it, it doesn't generate its content:

---
schema_version: 1
id: M999
title: Greeter module
status: draft
requirement: null
confirmed_at: null
verification_approved_hash: null
acceptance_criteria:
  - id: AC001
    text: greet() returns a friendly string.
verification:
  - id: CT001
    criterion: AC001
    type: command
    command: npm test
---

# Contract

## Objective

Add a small greeter module.

## Change Log

- Initial milestone contract.

The id you write is a placeholder -- milestone-add assigns the real next sequential id (e.g. M001).

Machine-authoritative vs. prose

The YAML frontmatter (acceptance criteria, verification checks, status, verification_approved_hash) is machine-authoritative. The Markdown body holds prose and an append-only Change Log -- every amendment is a new entry, never an edit to a prior one.

The execution boundary

A contract is never silently expanded. A discovered conflict during task work stops work, proposes a contract change as a new Change Log entry, and waits for developer approval -- pitway milestone-confirm --amend re-approves an amended contract and its verification plan.

Confirmation

pitway milestone-confirm <id> freezes the contract, hash-approves its verification commands (see Verification), and creates the milestone's baseline Git commit. It only ever runs after explicit developer sign-off in conversation.