All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Experiment resume no longer skips materially different runs.
run_idwas derived only from model alias, regime, condition and seed, so changing the case count (or the resolved model, the distributions config, or provider parameters) produced the same identifier andskip_completed=Truetreated the new experiment as already completed.
mech_gov.experiment.identity— deterministic, versioned run identity. A readablerun_labelis now separate from anidentity_sha256digest computed over a canonical, allowlisted payload (case count, regime, condition, seed, hashed model ID, semantic distributions fingerprint, provider parameters, package version). Only the full digest decides resume.LLMInterface.resume_identity_parameters()— optional hook for providers to declare adapter/deployment identity plus generation-affecting parameters. The default returnsNone, so existing custom providers remain API-compatible and are treated as non-resumable. Implemented for the bundled mock, OpenAI-compatible and Bedrock providers. SageMaker remains non-resumable because endpoint name and region do not establish an account-scoped deployment identity.- Results now include
run_label,identity_schema,identity_sha256andidentityalongside the existing fields. - Stable identity warning codes
MGI001–MGI008on themech_gov.experiment.identitylogger. Diagnostics name the fields that differ, use a pseudonymous reference for correlation, distinguish unreadable completion state, and never print raw labels, paths, or parameter values. - README section documenting resume semantics, non-resumable runs and legacy result files.
-
run_idkeeps the previous readable format for backward compatibility.identity_sha256, notrun_id, decides whether a run may be skipped. -
Runs whose identity cannot be established (no stable model ID, undeclared provider/deployment parameters, unreadable completion state, missing package version) always execute rather than risking a wrong skip.
-
Legacy records without identity metadata are read, never rewritten, and never treated as equivalent to a versioned identity.
-
The distributions configuration is loaded before the completion check, since its content participates in run identity.
-
OpenAI-compatible endpoint targets and Bedrock regions are represented only by SHA-256 fingerprints. Raw endpoint URLs, credentials and private paths are excluded. These fingerprints provide stable pseudonymous identity, not confidentiality.
-
Open-source readiness scaffolding:
- Apache 2.0
NOTICE, expandedCONTRIBUTING.md(CLA + issue/PR flow),CODE_OF_CONDUCT.md,SECURITY.md,CODEOWNERS CITATION.cffand a README citation block- Issue templates (bug, feature) and PR template
pyproject.tomltooling config (ruff, black, mypy, pytest, coverage) and real project URLs- SPDX headers on Python sources, scripts, examples and tests
- GitHub Actions workflows (third-party actions pinned to SHA digests):
ci.yml— ruff + black + mypy + pytest matrix (3.10/3.11/3.12) with Codecovcodeql.yml— CodeQL SAST (push, PR, weekly cron)dep-scan.yml—pip-audit(push, PR, daily cron)license-check.yml— SPDX header verification + dependency-license allowlist (pip-licenses)pattern-check.yml— internal-pattern scan with allowlistscorecard.yml— OpenSSF Scorecard supply-chain analysiscla.yml— CLA Assistant Litestale.yml— stale issues/PRs automationrelease.yml— versioned source archive attached to GitHub Releases
.github/dependabot.yml— monthly Python and GitHub Actions updates- README badges, attribution and Citation sections
- Apache 2.0
-
Privacy gate (R2): a pre-LLM governance primitive (
mech_gov.governance.primitives.privacy_gate) that reversibly tokenizes direct identifiers (EMAIL, PHONE, SSN, PAN, IBAN, IP) before the model is consulted, and mechanically DEFERs a case when residual identifiers exceed a configurable budget or detection fails (fail-closed). Stdlib-only, vendor- neutral, configurable viaPrivacyConfig; recordsprivacy_entities_foundandprivacy_residual_piicounts inDecisionResult.metadata(the reversible token map is never persisted). Supports a pluggablePiiRecognizer. Ships an offlineexamples/privacy_demo.py.
0.1.0 - 2026-06-12
mech_govframework: model-agnostic governance for LLM decisions in high-stakes settings- Governance regimes:
R1(text-only),R2(mechanical enforcement — hard gates, candidate freezing, argument-quality / I6Q checks, ambiguity gate, commit–reveal entropy step) andR3(adaptive) - Vendor-neutral LLM interface (
mech_gov.llm.base.LLMInterface) with a registry andmock,callable,openai_compatibleproviders plus optionalbedrock/sagemakerbackends behind an extra - Governance metrics (CDL, DIU, FVS, ESD, FSR, IPI) and task metrics (accuracy, macro-F1, MCC, deferral rate)
- Synthetic banking decision dataset generator and an experiment runner with ablation, framing/FVS and seed tests
- CLI scripts
generate_dataset.pyandrun_governance.py, plus offline examples and a mock-backed regression test suite