No project description provided
Project description
accountable-record-py
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
| Stage | Concern | Artifact | Main purpose |
|---|---|---|---|
s010 |
ID |
Identity artifact | Establish repository identity. |
s020 |
CT |
Contract artifact | Establish contract context. |
s030 |
SR |
Sources artifact | Validate source material declarations. |
s040 |
EL |
Elements artifact | Validate verifiable element quartets. |
s050 |
CA |
Catalog artifact | Build and reconcile the element catalog. |
s060 |
EX |
Exports artifact | Validate machine-readable export artifacts. |
s070 |
RS |
Resolution artifact | Resolve references and verify lock state. |
s080 |
RP |
Reports artifact | Render and validate generated human-readable reports. |
s090 |
VF |
Verification artifact | Verify whole-pipeline coherence. |
Stages run in increasing order. For example:
run s040runss010throughs040.run allruns 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 write-reports
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 verify-lock
uv run accountable-record --target ../accountable-record write-reports
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 --from import-linter --with-editable . lint-imports --config .github/.importlinter
# 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: 12881
LLOC: 4830
SLOC: 6981
COMMENTS: 427
MULTI: 2627
BLANK: 2443
SINGLE_COMMENTS: 830
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 RP] ok Render and validate reports.
[s090 VF] ok Verify whole-pipeline coherence.
---------
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
License
Manifest
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file accountable_record_py-0.4.2.tar.gz.
File metadata
- Download URL: accountable_record_py-0.4.2.tar.gz
- Upload date:
- Size: 211.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3bcd277231fc11ac42249dd94ec371ea06f98fde8b17216746273641d08ccfc
|
|
| MD5 |
24bdb3d3b722fcfad5f8df3dc5af8022
|
|
| BLAKE2b-256 |
60a3c172276757750d8ebc711455105b3d9fdd154cba30182ec36eedde276ca0
|
Provenance
The following attestation bundles were made for accountable_record_py-0.4.2.tar.gz:
Publisher:
release-pypi.yml on structural-explainability/accountable-record-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
accountable_record_py-0.4.2.tar.gz -
Subject digest:
a3bcd277231fc11ac42249dd94ec371ea06f98fde8b17216746273641d08ccfc - Sigstore transparency entry: 1656876639
- Sigstore integration time:
-
Permalink:
structural-explainability/accountable-record-py@c483bd093e72a49728f738408f16397a4000bf21 -
Branch / Tag:
refs/tags/v0.4.2 - Owner: https://github.com/structural-explainability
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@c483bd093e72a49728f738408f16397a4000bf21 -
Trigger Event:
push
-
Statement type:
File details
Details for the file accountable_record_py-0.4.2-py3-none-any.whl.
File metadata
- Download URL: accountable_record_py-0.4.2-py3-none-any.whl
- Upload date:
- Size: 173.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
027f657d2d2732fdf807397161e0710031476eb386bf67849f3e7c53e3a2a1e8
|
|
| MD5 |
b5c6cb6cbf94b69d056888a5c591784c
|
|
| BLAKE2b-256 |
7cd53e8b0cfbda978464674b0c853a3cfb06042b3836575d927bf761802c0ed3
|
Provenance
The following attestation bundles were made for accountable_record_py-0.4.2-py3-none-any.whl:
Publisher:
release-pypi.yml on structural-explainability/accountable-record-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
accountable_record_py-0.4.2-py3-none-any.whl -
Subject digest:
027f657d2d2732fdf807397161e0710031476eb386bf67849f3e7c53e3a2a1e8 - Sigstore transparency entry: 1656876847
- Sigstore integration time:
-
Permalink:
structural-explainability/accountable-record-py@c483bd093e72a49728f738408f16397a4000bf21 -
Branch / Tag:
refs/tags/v0.4.2 - Owner: https://github.com/structural-explainability
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@c483bd093e72a49728f738408f16397a4000bf21 -
Trigger Event:
push
-
Statement type: