Skip to main content

ashmatics-playbook-grammar

Version: 0.1.0 Last Updated: 2026-11-02

See CHANGELOG.md for version history.

The FORGE playbook interior grammar, its save and publish validators, and the content hash stamped at publish. One copy, imported at a pinned version by both services that need it: the KB runs it when Asher publishes a playbook template version, and FORGE (coreapp) runs it when it pins a copy and when a site authors its own playbook (coreapp ADR 070 D4).

Moved from coreapp with no change in behavior. Function names and error messages are coreapp's.

Install

One runtime dependency: pyyaml. Nothing here imports Azure, a database driver or Django.

The package lives in the framework repo at tools/playbook-grammar/. It has no git tags of its own; the framework's vX.Y.Z is the only tag. It is not on a package index yet. Until it is, install it from a checkout:

git clone https://gitlab.com/ashmatics/platform/ashmatics-aigov-framework.git
cd ashmatics-aigov-framework/tools/playbook-grammar
uv sync --extra dev        # or: pip install -e ".[dev]"
uv run pytest

ashmatics-aigov-tools depends on it and re-exports it as ashmatics_aigov_tools.playbook_grammar.

Use

import ashmatics_playbook_grammar as pg

pg.validate_template_document(document)          # save: raises InvalidPlaybookDocument
pg.validate_for_publish(document, base_practices,
                        playbook_class="governance",
                        lookups=my_lookups)       # publish: the CHAR reads come in lookups
pg.content_hash(document)                         # the hash stamped at publish
pg.load_grammar("1.2")                            # one grammar version, as a dict

lookups is any object with the ten methods of PublishLookups. lookups.py names the coreapp function each one stands for. It is required: there is no default that passes, because "cannot check" is not "checked".

Module What it holds Moved from (coreapp)
grammar the grammar files and their readers core/services/govflow_grammar.py, core/config/govflow/
validators save and publish validators, attr_is_shown, choice_answers_in_force, anchor patterns core/services/playbook_service.py
setup_shapes save-time shape rules for structured settings core/services/setup_lists.py
hashing content_hash core/services/playbook_service.py
lookups PublishLookups new

What stayed in coreapp: the reads behind lookups (CHAR mirror data, and constants and rules that sit in coreapp modules that import Django), and grammar_for_api with its gate titles, which read CHAR's lifecycle data.

Tests

The tests replay what coreapp's own functions returned (tests/fixtures/):

  • every published interior in coreapp's interiors-v0.25.0.json passes both validators and reproduces its published hash;
  • for the bundle and 64 broken documents, the moved functions return exactly what coreapp's returned, in the same order, and make exactly the CHAR reads coreapp made.

To re-record after a change on the coreapp side, run the recorder from coreapp's venv:

/path/to/ashmatics-coreapp/.venv/bin/python scripts/record_playbook_grammar_fixtures.py \
    --coreapp /path/to/ashmatics-coreapp

Metadata

Release files for ashmatics-playbook-grammar 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ashmatics-playbook-grammar 0.1.0
File Size Uploaded Provenance Actions
ashmatics_playbook_grammar-0.1.0.tar.gz 40.4 kB Without provenance Details for ashmatics_playbook_grammar-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ashmatics-playbook-grammar 0.1.0
File Interpreter ABI Platform Actions
ashmatics_playbook_grammar-0.1.0-py3-none-any.whl Python 3 none any Details for ashmatics_playbook_grammar-0.1.0-py3-none-any.whl

Total release size: 88.6 kB

Release files / ashmatics_playbook_grammar-0.1.0.tar.gz

Download URL ashmatics_playbook_grammar-0.1.0.tar.gz
Size 40.4 kB
Tags Source
SHA-256 checksum
How to use checksums
36675d6127f79f6b0b93f12eb22425f85e51102d5a19ac3c83eeef4eb1411c92
BLAKE2b-256 checksum
How to use checksums
1f6b7a1535b741846909c4eff3266698d791a4b54356530ef2312a05180ed8b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.13

Release files / ashmatics_playbook_grammar-0.1.0-py3-none-any.whl

Download URL ashmatics_playbook_grammar-0.1.0-py3-none-any.whl
Size 48.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
19ce6fd3c836e5c1334dc798f3b976c74fc1b54afbd60d9dd7f9cd5ade0e58ce
BLAKE2b-256 checksum
How to use checksums
125a73f77567a4f2a9ceebd9f1b775ea3af738f6f1bf2646bffdddbe343b7d19
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.13

Security for ashmatics-playbook-grammar 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page