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.0.tar.gz (47.8 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.0-py3-none-any.whl (28.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for matrx_content_guard-0.1.0.tar.gz
Algorithm Hash digest
SHA256 50328fdda603e7261af4768d7b15950eeedab32c9b0b11c4f3d216a9c6fdf32a
MD5 4cd65bfab001099b5b642e31e1b56abb
BLAKE2b-256 a2e6a898e3e356670a549e85d155d863d32279bc4e06bf793b73d7e2931740ef

See more details on using hashes here.

Provenance

The following attestation bundles were made for matrx_content_guard-0.1.0.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.0-py3-none-any.whl.

File metadata

File hashes

Hashes for matrx_content_guard-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 95a31beb6631af10a0c667434d0773d6641537abefff3d2df9d82635e508d0e9
MD5 fc3610705579dfe0e5bad8104e78dece
BLAKE2b-256 107d766949fbf60e7a6b98e5a6e1ba17ce15aad658f2188db399b782e71d0190

See more details on using hashes here.

Provenance

The following attestation bundles were made for matrx_content_guard-0.1.0-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