Skip to main content

Zenzic

ci-status zenzic-audit zenzic-score REUSE 3.x compliant PyPI Version Downloads Python Versions License

Deterministic Document Integrity Engine and SAST for Markdown/MDX graphs.
Tiered code governance, frozen security contracts, and RE2-backed deterministic scanning.


โšก Try it now โ€” Zero Installation

Analyzing documentation graphs? Run instant security and topological analysis using uv:

uvx zenzic check all ./your-folder

Zenzic identifies your engine via its configuration files or defaults to Standalone Mode when analyzing documentation graphs โ€” providing immediate SAST protection for links, credentials, and graph integrity.


๐Ÿš€ Quick Start

pip install zenzic
cd my-docs-repo
zenzic init       # Establish the workspace boundary (creates .zenzic.toml)
zenzic check all  # Analyze documentation graphs in current directory

๐Ÿง  Key Capabilities

1. Security Scanning (SAST)

  • Z2xx Rules: Hardened Static Application Security Testing for documentation graphs.
  • Credential Leaks (Z201): Hardcoded tokens, API keys, and secret patterns detected before reaching PRs.
  • Path Traversal Guard (Z202 / Z203): Non-suppressible filesystem boundary security checks; fatal exit codes (exits 2/3) survive fail-on-error: false.

2. Graph Topology Analysis

  • Virtual Site Map (VSM): Comprehensive $O(N)$ topological modeling of documentation graphs.
  • Cross-File Link Resolution: Validates anchor boundaries and cross-document dependencies.
  • Orphan Pages & Dead Navigation: Flags unlinked graph nodes, missing directory indices, and unreachable content.

3. Deterministic CI/CD Enforcement

  • Zero-DBT Quality Gate: Bit-for-bit identical findings across all execution environments.
  • Frozen Contracts: FROZEN_CODES, NON_SUPPRESSIBLE_CODES, and standardized SARIF output.
  • Inspect-First Workflow: Query live code semantics with zenzic inspect codes.

๐Ÿ“– Full docs โ†’ ยท ๐Ÿ… Badges ยท ๐Ÿ”„ CI/CD guide


โš™๏ธ Commands Overview

Command Purpose
zenzic init Scaffold workspace configuration (.zenzic.toml)
zenzic check all [PATH] Full documentation audit โ€” links, credentials, orphans
zenzic score [--fail-under N] [--stamp] Compute the Documentation Quality Score (0โ€“100)
zenzic diff [--base PATH] Detect debt regression against a saved baseline
zenzic guard scan [PATH] Defense-in-Depth credential pre-gate (fatal on security findings: exit 2)
zenzic inspect codes Query live error-code semantics and suppressibility

๐Ÿš€ CI/CD Ready: Use the Official Zenzic Action to run Zenzic in GitHub Actions โ€” findings surface directly in Code Scanning, PR annotations, and the Security tab.

- uses: PythonWoods/zenzic-action@v2
  with:
    format: sarif
    upload-sarif: "true"

๐Ÿ“Š Headless Data Pipeline (SARIF Output)

Zenzic Core is headless and emits standardized SARIF (Static Analysis Results Interchange Format) JSON, ensuring seamless integration with modern CI dashboards and scanning services:

{
  "$schema": "https://json.schemastore.org/sarif-2.1.0.json",
  "version": "2.1.0",
  "runs": [
    {
      "tool": {
        "driver": {
          "name": "zenzic",
          "version": "0.24.3",
          "rules": [
            {
              "id": "Z101",
              "name": "BrokenLink",
              "shortDescription": { "text": "Broken documentation link" }
            }
          ]
        }
      },
      "results": [
        {
          "ruleId": "Z101",
          "level": "error",
          "message": { "text": "Broken documentation link โ€” ./setup.md#prerequisites" },
          "locations": [
            {
              "physicalLocation": {
                "artifactLocation": { "uri": "docs/getting-started.md" },
                "region": { "startLine": 23 }
              }
            }
          ]
        }
      ]
    }
  ]
}

๐Ÿ”Œ Multi-Engine Support

Engine Adapter Highlights
MkDocs MkDocsAdapter i18n suffix + folder modes, fallback_to_default
Zensical ZensicalAdapter Transparent Proxy bridges mkdocs.yml
Any folder StandaloneAdapter File integrity checks โ€” orphan detection disabled without a nav contract

See the Adapter API for the plugin interface. Third-party adapters install via the zenzic.adapters entry-point group.


๐Ÿ“ IDE Integration

Zenzic provides a Language Server Protocol (LSP) backend via the zenzic lsp command, bringing real-time structural analysis and error reporting directly into your editor.

Note: The official VS Code extension is currently in Private Beta and will be released to the Microsoft Marketplace soon.


โš™๏ธ Configuration

Zero-config by default. See the Configuration Guide for the full .zenzic.toml schema and pyproject.toml embedding.

zenzic init        # Generate .zenzic.toml with auto-detected values

๐Ÿ”„ CI/CD Integration

- uses: PythonWoods/zenzic-action@v2
  with:
    format: sarif
    upload-sarif: "true"

For zero-install uvx integration and regression gates, see the CI/CD guide.


๐Ÿงฉ Ecosystem & CI Integration

Responsibility Matrix: Core vs Action

Zenzic Core is radically unaware of any CI platform. It produces portable, self-contained artefacts (SARIF, JSON, text) via a stable exit-code contract. Platform-specific behaviour โ€” GitHub Annotations, Code Scanning upload, PR decoration โ€” is the sole responsibility of the Zenzic Action.

Concern Zenzic Core Zenzic Action
Link validation (Z1xx) โœ… โ€”
Credential scanner (Z2xx) โœ… โ€”
Topology / orphan detection (Z3xxโ€“Z6xx) โœ… โ€”
SARIF / JSON / text output โœ… โ€”
Exit-code contract (0 / 1 / 2 / 3) โœ… enforced
GitHub Annotations (::error::) โ€” โœ…
Code Scanning SARIF upload โ€” โœ…
PR inline diff annotations โ€” โœ…
DQS regression blocking (zenzic diff) โ€” โœ…
Sovereign nightly audit (--audit) โ€” โœ…
GitLab / Bitbucket / other CI adapters โ€” future adapters

Design law (ADR-075): logic that maps Zenzic output to a CI platform's native format must live in the Adapter, never in the Core. Exit codes 2 and 3 propagate unchanged through every adapter โ€” they are never remapped or suppressed.


๐Ÿ›ก๏ธ Why Zenzic?

Determinism

Every Zenzic run is a pure function of its inputs. Given the same repository state and .zenzic.toml, the output โ€” finding codes, severity levels, exit code, SARIF structure โ€” is bit-for-bit identical across machines, platforms, and time. There are no probabilistic judgements, no sampling, and no network-dependent results injected into the analysis path.

Property Guarantee
Same inputs โ†’ same output โœ… Always
RE2-backed regex engine โœ… No backtracking, no catastrophic matching
Frozen finding codes โœ… FROZEN_CODES set; never renamed or silently retired
Reproducible CI artefacts โœ… Identical SARIF across runner OS and time

Documentation Security

Zenzic treats documentation as a security surface, not just a quality metric. The tiered code model enforces a hard boundary between quality findings (suppressible, exit 1) and security findings (non-suppressible, exit 2 / 3):

  • Z201 โ€” Credential Scanner: hardcoded tokens, API keys, and secret patterns detected before they reach a PR.
  • Z202 / Z203 โ€” Path Traversal Guard: filesystem boundary violations caught at the scan boundary โ€” fail-on-error: false has zero effect.
  • Suppression CAP: a configurable ceiling on the total number of active zenzic:ignore suppressions. Exceeding it blocks the build, preventing systematic suppression debt from accumulating silently.

Zero Hallucinations

Zenzic reports only what is statically verifiable in the repository at scan time. It never:

  • infers intent or "probable" correctness from surrounding context,
  • approximates link validity without a deterministic check,
  • emits a finding it cannot reproduce on a re-run with identical inputs.

This makes every Zenzic finding a falsifiable, reproducible fact โ€” suitable as audit evidence, not just developer feedback.


๐Ÿ“ฆ Installation

๐Ÿ—๏ธ Monorepo Architecture: Zenzic contains its own documentation portal. To develop locally, install the documentation toolchain with uv sync --extra docs.

# Zero-install, one-shot audit (recommended for CI and exploration)
uvx zenzic check all ./docs

# Global CLI tool
uv tool install zenzic

# Pinned dev dependency
uv add --dev zenzic

# pip
pip install zenzic

Upgrading Zenzic

If you installed Zenzic globally via uv, you must explicitly request an upgrade to fetch the latest deterministic engine:

uv tool upgrade zenzic

To run a specific version ephemerally without altering your global environment:

uvx zenzic@0.24.3 check all

๐Ÿ“– Documentation

Area URL Audience
๐Ÿ‘ค User Guide zenzic.dev Install, configure, CI/CD, finding codes
๐Ÿ”ง Developer Portal zenzic.dev/developers Adapters, ADRs, CLI architecture, mutation testing
๐Ÿ›ก๏ธ Security Engineering Ledger ยท SECURITY.md Security reviewer

๐Ÿค Contributing

  1. Open an issue to discuss the change.
  2. Read the Contributing Guide.
  3. Every PR must pass just verify and include SPDX headers on new files.

See also: Code of Conduct ยท Security Policy

๐Ÿ“Ž Citing

A CITATION.cff is present at the root. Click "Cite this repository" on GitHub for APA or BibTeX output.

๐Ÿ“„ License

Apache-2.0 โ€” see LICENSE.

This project strictly adheres to Semantic Versioning.


PythonWoods

Engineered with precision by PythonWoods in Italy ๐Ÿ‡ฎ๐Ÿ‡น
"Building the Standard for Technical Document Integrity."

Documentation ยท GitHub ยท Blog

Download files

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

Source Distribution

zenzic-0.24.3.tar.gz (1.8 MB view details)

Uploaded Source

Built Distribution

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

zenzic-0.24.3-py3-none-any.whl (359.9 kB view details)

Uploaded Python 3

File details

Details for the file zenzic-0.24.3.tar.gz.

File metadata

  • Download URL: zenzic-0.24.3.tar.gz
  • Upload date:
  • Size: 1.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"25.10","id":"questing","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for zenzic-0.24.3.tar.gz
Algorithm Hash digest
SHA256 03875c0fa33005e9616d74be571261e9ec56381b605c12f2abd910d21217ffca
MD5 292c410afda8e535abf6fef72bf0b279
BLAKE2b-256 1540f0b26b312021342f975b46a253e120d01bac7903adc3dc0e4416f43e06e6

See more details on using hashes here.

File details

Details for the file zenzic-0.24.3-py3-none-any.whl.

File metadata

  • Download URL: zenzic-0.24.3-py3-none-any.whl
  • Upload date:
  • Size: 359.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"25.10","id":"questing","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for zenzic-0.24.3-py3-none-any.whl
Algorithm Hash digest
SHA256 579239a562b284f53d86dab4606bd0a618491e3b0ec5de0e609054882a404b08
MD5 57f59b79ca12177062fa8057c39abcbf
BLAKE2b-256 63d4aa11aebeaab1c641c3b5c12d44901d3057cd2d0b4e2b2a83177a612c4ac2

See more details on using hashes here.

Release history Release notifications | RSS feed

Supported by

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