Skip to main content

Deterministic HTML/CSS/JS content validation + patch/diff editing engine for the Matrx CMS agent-authoring layer

Project description

matrx-content-guard

Deterministic HTML/CSS/JS content validation + patch/diff editing for the Matrx CMS agent-authoring layer. Pure Python, no DB access, no tool-framework imports — every agent mutation to html_pages / client_* content flows through this library before it's written.

See CONTRACT.md for the full typed API and FEATURE.md for the durable design notes (parser choice, permissive-first policy rationale, byte- preservation guarantee).

from matrx_content_guard import validate_content, apply_patch, SearchReplacePatch, SearchReplaceHunk

report = validate_content("<script>alert(1)</script>", "html_page_document")
report.blocked  # False — inline script is a supported feature; only genuinely dangerous constructs block.

result = apply_patch(
    "<h1>Hello</h1>",
    SearchReplacePatch(hunks=[SearchReplaceHunk(search="Hello", replace="Hi")]),
)
result.result  # "<h1>Hi</h1>"

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

matrx_content_guard-0.1.3.tar.gz (50.9 kB view details)

Uploaded Source

Built Distribution

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

matrx_content_guard-0.1.3-py3-none-any.whl (30.2 kB view details)

Uploaded Python 3

File details

Details for the file matrx_content_guard-0.1.3.tar.gz.

File metadata

  • Download URL: matrx_content_guard-0.1.3.tar.gz
  • Upload date:
  • Size: 50.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for matrx_content_guard-0.1.3.tar.gz
Algorithm Hash digest
SHA256 073aaab6907208793f9ee8739c4390f9c0b3caccb4b691cf2464c194501b29c7
MD5 379c3ea965379160f136154205261cdb
BLAKE2b-256 2eab8c3be06e18ce9a6090b1f8043777967505e4045ccd548e8554afdd80236a

See more details on using hashes here.

Provenance

The following attestation bundles were made for matrx_content_guard-0.1.3.tar.gz:

Publisher: publish-package.yml on AI-Matrix-Engine/aidream

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

File details

Details for the file matrx_content_guard-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for matrx_content_guard-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1bb9dc1195c59c8981182fdb9b9c66a16e6dd7ddb9014c13d285a00075d6bc56
MD5 b07dfcf1140f538d2b1eba996f21efb8
BLAKE2b-256 7bd40472995ed4e13904cfba6db543adfd8d8c12ba240c31ffe6ed1ac81c1594

See more details on using hashes here.

Provenance

The following attestation bundles were made for matrx_content_guard-0.1.3-py3-none-any.whl:

Publisher: publish-package.yml on AI-Matrix-Engine/aidream

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