Skip to main content

Unit testing for business documents — validate structured Markdown docs against a configurable audit standard.

Project description

docassert

Unit testing for business documents. Validate structured Markdown documents (charters, BRDs, PRDs, risk registers, …) against a configurable audit standard: deterministic structural checks that gate a merge, plus optional AI-graded semantic checks that advise. Requirements trace end to end, and project status is derived from the documents rather than self-reported.

docassert is the reference implementation of PMO as Code — a vendor-neutral standard for running a PMO from version-controlled, declarative files.

Install

pip install "docassert @ git+https://github.com/c4g-john/docassert"   # PyPI release coming
# with the AI advisory extra:
pip install "docassert[ai] @ git+https://github.com/c4g-john/docassert"

Quickstart

docassert init                        # scaffold criteria/schema/profiles/templates into your repo
docassert validate documents/**/*.md  # unit-test your documents
docassert consistency                 # cross-document traceability + profile completeness
docassert status --index              # derived RAG per project
docassert pages --out _site           # a portfolio dashboard + a page per project

Config resolves local override → packaged default: docassert ships sensible defaults, and your repo's own criteria/ (or schema/, profiles/, consistency.yaml) wins when present. docassert init copies the defaults in so you can customize them.

Commands

Command What it does
docassert validate <globs> Validate documents against their kind's criteria. Exit code = number of blocking failures.
docassert consistency Cross-document checks: referential integrity, coverage, required links, profile completeness.
docassert rtm [--project ID] Requirements traceability matrix (Markdown or CSV).
docassert status [--project ID] [--index] Derived project status (md / json / html).
docassert pages --out DIR Build the portfolio site (index + a page per project).
docassert projects [--out] [--check] Generate / verify the project registry.
docassert init [DIR] Scaffold the default config into a repo.

Document kinds

Twenty kinds, each a templates/<kind>.template.md + schema/<kind>.schema.json

  • criteria/<kind>.criteria.yaml trio: project, charter, business-case, brd, prd, frnfr, user-story, test-cases, adr, risk-register, raci-stakeholder, qa-test-plan, data-migration-plan, release-cutover-plan, rollback-plan, hypercare-plan, runbook, status-report, post-implementation-review, benefits-realization. Adding a kind is adding a trio — no code for the common cases.

Two tiers of checks

  • Structural — deterministic, blocking. Required fields and sections, measurable success criteria, risks with owner + mitigation, resolving references, unique ids. Plain Python, reliable enough to gate a merge.
  • Semantic — AI-graded, advisory. Scored via the Anthropic API and posted to the PR — never blocking. Set ANTHROPIC_API_KEY to enable; skipped otherwise.

Development

python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytest
ruff check .

This repo ships example documents/ (four sample projects) that the test suite validates against.

The reference deployment

pmo-as-code-pipeline is a living example — sample projects, the gate on every pull request, and a published dashboard at c4g-john.github.io/pmo-as-code-pipeline. The standard's site is c4g-john.github.io/pmo-as-code.

License

Apache-2.0 — see LICENSE and NOTICE. © 2026 C4G Enterprises Inc.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

docassert-0.1.0.tar.gz (56.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

docassert-0.1.0-py3-none-any.whl (78.8 kB view details)

Uploaded Python 3

File details

Details for the file docassert-0.1.0.tar.gz.

File metadata

  • Download URL: docassert-0.1.0.tar.gz
  • Upload date:
  • Size: 56.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for docassert-0.1.0.tar.gz
Algorithm Hash digest
SHA256 21186089153d096c477d09054419d7a21f81ccd2823ad9df7747a5d1a0ce078f
MD5 f543b2069e4f857dd2245518bffa2b51
BLAKE2b-256 92e62854d76093a76768be1ee0b88e4c82985c33cb5354b18c8da579b618412b

See more details on using hashes here.

Provenance

The following attestation bundles were made for docassert-0.1.0.tar.gz:

Publisher: release.yml on c4g-john/docassert

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file docassert-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: docassert-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 78.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for docassert-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bb81f28bfb7f2f5cbb7d23c67032e70687178e6c143b24a2312485fc013dceea
MD5 9d788d363ac556f4921b017df529918c
BLAKE2b-256 878475ad6754f71c8af7c3dd9ce729bcc205dd2e9afc202670d80b41cfcd79fe

See more details on using hashes here.

Provenance

The following attestation bundles were made for docassert-0.1.0-py3-none-any.whl:

Publisher: release.yml on c4g-john/docassert

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page