Skip to main content

Validation Rules

APS enforces consistent, machine-checkable plan structure through aps lint and aps audit. This page describes what the tooling validates and why.

What lint checks

aps lint validates APS documents for:

  • Required sections and metadata tables
  • Work item field completeness
  • ID format conformance
  • Cross-reference resolution
  • Release narrative structure
aps lint plans/ # lint entire plan tree
aps lint plans/modules/auth.aps.md # lint one file
aps lint . --json # machine-readable output

Errors cause a non-zero exit code. Warnings are informational. --strict is for toolchain-version drift: it turns a .aps/config.yml cli_version mismatch into a failing result.

Error codes

CodeScopeDescription
E001ModuleMissing ## Purpose section
E002ModuleMissing ## Work Items section
E003ModuleMissing ID/Status metadata table
E004IndexMissing ## Modules section
E005Work ItemMissing required field (Intent, Expected Outcome, or Validation)
E010IssuesMissing ## Issues section
E011IssuesMissing ## Questions section
R001ReleaseRelease file not named v<version>.md
R002ReleaseMissing release header table with Target and Status
R003ReleaseMissing ## Release Theme section
R004ReleaseMissing ## What Ships section

Warning codes

CodeScopeDescription
W001Work ItemID does not match PREFIX-NNN pattern
W002ModuleConductor references a work-item ID that resolves nowhere
W003Work ItemDependency references an ID not found in the plan tree
W004Module / IndexSection exists but is empty
W005ModuleStatus is Ready but no work items are defined
W006IndexModule listed under Conductor subsection but file is not Type: Conductor
W010IssuesIssue entry missing Status, Discovered, or Severity
W011IssuesQuestion entry missing Status, Discovered, or Priority
W012IssuesIssue ID does not match ISS-NNN format
W013IssuesQuestion ID does not match Q-NNN format
W017ModuleActive module missing or stale **Last reviewed:** field (threshold: 60 days)
W018Work ItemComplete item missing Validation in an active module
W019IndexModule link points to a non-existent file

Work item ID format

Pattern: {PREFIX}-{NNN}

✓ AUTH-001 ✓ PAY-123 ✓ CORE-001
✗ auth-001 ✗ AUTH-1 ✗ AUTH_001
  • PREFIX: 1–10 uppercase alphanumeric characters
  • NNN: 3-digit zero-padded number

Required work item fields

### AUTH-001: Title

- **Intent:** Required — what outcome this achieves
- **Expected Outcome:** Required — testable result
- **Validation:** Required — command to verify completion

Status consistency

The bash fallback/vendored orchestration commands enforce a state machine:

Draft ──→ Ready ──→ In Progress ──→ Complete
CommandTransition enforced
aps nextNone — read-only
aps startReady → In Progress (dependencies must be Complete)
aps completeIn Progress → Complete

Invalid transitions are rejected with a clear error.

Toolchain pinning

Projects pin their expected CLI version in .aps/config.yml:

cli_version: 0.4.0

aps compares the pin to the running binary and warns on mismatch. Add --strict (or APS_STRICT=1) to fail CI on drift:

aps lint --strict

Audit: plan vs reality

In the bash fallback/vendored runtime, aps audit checks whether Complete items actually pass their validation commands and whether Draft items have files that already exist:

CodeMeaning
A001Overstated — Complete item whose Validation command fails
A002Understated — Draft item whose Files already exist with content
A003Stale — Ready item in a module with no recent **Last reviewed:**
A004Broken link — index module link points to a non-existent file

CI safety: Use aps audit --no-run in pull-request jobs. Running with execution enabled executes Validation commands from plan files with full shell semantics — only run on trusted branches.

CI integration

- name: Lint APS documents
run: aps lint plans/ --strict

See the canonical workflow at anvil-plan-spec docs/ci-lint-example.yml.


Next: Document structure →