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.1.tar.gz (51.0 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.1-py3-none-any.whl (30.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: matrx_content_guard-0.1.1.tar.gz
  • Upload date:
  • Size: 51.0 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.1.tar.gz
Algorithm Hash digest
SHA256 04b47333b07af1f114a286f5c27a95d94cc3a7d6f3a6497404590c75fa507229
MD5 cafdb0cb0aa88ed2352d40134b803ef1
BLAKE2b-256 a2764ace8bff58f636aaaf9b2965d7148d8f9e79917301491420964a681b3151

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for matrx_content_guard-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 50f71223e3b4d488a701a8a69df050e4ddb6684ec0cef0029bb738087cfdc768
MD5 bc840eeed97b839c57bc5c1c233698f9
BLAKE2b-256 dc7f2e94af53523b679b1cd67bcba2934981ff0a1f62dcc4e5012c972f20e69e

See more details on using hashes here.

Provenance

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