Skip to main content

No project description provided

Project description

accountable-record-py

PyPI Docs Site Repo Python 3.14 Python 3.15 Ready License

CI Docs-Deploy Pre-Release Release Links Dependabot

Python reference implementation for staged Accountable Record repository verification.

Overview

This project validates Accountable Record-compatible repositories through a staged pipeline.

The verifier can validate its own repository or a target repository passed with --target.

Target validation is internal coherence by default: the target repository declares its identity in SE_MANIFEST.toml, and the pipeline checks that the repository's metadata and derived artifacts cohere with that declaration.

Package Interface

  • The Python import package is accountable_record.
  • The Python distribution package is accountable-record-py.
  • The public command is accountable-record.

Staged Pipeline

s010_identity     repository identity
s020_contract     contract context
s030_sources      source materials
s040_elements     verifiable element declarations
s050_catalog      normalized catalog
s060_exports      machine-readable exports
s070_resolution   reference and lock resolution
s080_generated    generated artifact validation
s090_docs         documentation rendering

Stages run in increasing order. For example:

  • run s040 runs s010 through s040.
  • run all runs the full pipeline.

Architecture

A stage is a transform:

StageTransform = Callable[[PipelineState], PipelineState]

PipelineRunContext holds fixed run input, including the target repository. PipelineState is an immutable accumulator containing diagnostics and outputs from completed stages.

Identity validation is target-agnostic. SE_MANIFEST.toml is authoritative for repository identity. CITATION.cff is authoritative for contract/publication version when a version exists.

Command Reference

Show command reference

In a machine terminal

Open a machine terminal where you want the project:

git clone https://github.com/structural-explainability/accountable-record-py

cd accountable-record-py
code .

In a VS Code terminal

uv self update
uv python pin 3.14
uv sync --extra dev --extra docs --upgrade

uvx pre-commit install

git add -A
uvx pre-commit run --all-files
# repeat if changes were made
uvx pre-commit run --all-files

uv run accountable-record write-lock
uv run accountable-record verify-lock

uv run accountable-record run all

# or through a stage
uv run accountable-record run s010
uv run accountable-record run s020
uv run accountable-record run s030
uv run accountable-record run s040
uv run accountable-record run s050
uv run accountable-record run s060
uv run accountable-record run s070
uv run accountable-record run s080
uv run accountable-record run s090

# validate another repository
uv run accountable-record --target ../accountable-record write-lock
uv run accountable-record --target ../accountable-record run all

# types, tests, docs
uv run python -m pyright
uv run python -m pytest
uv run python -m zensical build

# contract checks (should be all kept, 0 broken)
uvx --with-editable . import-linter lint

# find dead code
uvx --with-editable . vulture src/accountable_record

# complexity on all (only A and B allowed)
uvx radon cc src/accountable_record -s -a

# complexity (check for any C ratings, should return nothing)
uvx radon cc src/accountable_record -s -a -n C


# maintainability on all (should be A)
uvx radon cc src/accountable_record -s

# hal
uvx radon cc src/accountable_record

# raw
uvx radon cc src/accountable_record

# raw (totals)
uvx radon raw src/accountable_record -j | uv run python -c "import json, sys; data=json.load(sys.stdin); keys=('loc','lloc','sloc','comments','multi','blank','single_comments'); totals={k:sum(file[k] for file in data.values()) for k in keys}; print('\n'.join(f'{k.upper()}: {v}' for k,v in totals.items()))"

# save progress
git add -A
git commit -m "update"
git push -u origin main

Current snapshot shows modest size and significant documentation:

LOC: 11660
LLOC: 4424
SLOC: 6192
COMMENTS: 367
MULTI: 2497
BLANK: 2241
SINGLE_COMMENTS: 730

Expected output:

> uv run accountable-record run all

[s010 ID] ok  Validate repository identity metadata.
[s020 CT] ok  Establish and validate contract context.
[s030 SR] ok  Validate repository source materials.
[s040 EL] ok  Validate verifiable element declarations.
[s050 CA] ok  Build and validate the normalized catalog.
[s060 EX] ok  Write and validate machine-readable exports.
[s070 RS] ok  Resolve references and verify lock state.
[s080 GN] ok  Validate generated artifacts.
[s090 DC] ok  Render and validate documentation.
---------
Contracts
---------

Analyzed 119 files, 213 dependencies.
-------------------------------------

Pipeline must not import stage packages KEPT
Stage 010 must not import later stages KEPT
Stage 020 must not import later stages KEPT
Stage 030 must not import later stages KEPT
Stage 040 must not import later stages KEPT
Stage 050 must not import later stages KEPT
Stage 060 must not import later stages KEPT
Stage 070 must not import later stages KEPT
Stage 080 must not import later stages KEPT

Contracts: 9 kept, 0 broken.

Citation

CITATION.cff

License

MIT

Manifest

SE_MANIFEST.toml

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

accountable_record_py-0.3.1.tar.gz (176.1 kB view details)

Uploaded Source

Built Distribution

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

accountable_record_py-0.3.1-py3-none-any.whl (158.8 kB view details)

Uploaded Python 3

File details

Details for the file accountable_record_py-0.3.1.tar.gz.

File metadata

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

File hashes

Hashes for accountable_record_py-0.3.1.tar.gz
Algorithm Hash digest
SHA256 f8dfedbbfaa6c326d53aeee83e8adaf72e1fde095cc97a19a0d4db6d476846bc
MD5 e2adda986fe4404cdcb68ce208dc6e5f
BLAKE2b-256 c2d075eca3783b8c655343d547b6e4219dea70029cd1bf0f6d704422ee15ffbf

See more details on using hashes here.

Provenance

The following attestation bundles were made for accountable_record_py-0.3.1.tar.gz:

Publisher: release-pypi.yml on structural-explainability/accountable-record-py

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

File details

Details for the file accountable_record_py-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for accountable_record_py-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 19e4c077296d0824919a30e24fce1fd4d9c3a78fb07ede93750661582ca15cc3
MD5 b283bbb7bec84059766349f4e23e58bc
BLAKE2b-256 7003681e2ead3d3ea8801d6f4864137afaad5ba491b95d3e2cc69a46e38c198f

See more details on using hashes here.

Provenance

The following attestation bundles were made for accountable_record_py-0.3.1-py3-none-any.whl:

Publisher: release-pypi.yml on structural-explainability/accountable-record-py

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