Release note · August 1, 2026

Imported document content is a review boundary, not a blank spot

By SybilGambleyyu · DocFence 0.3.0

A Word file can carry material that is neither ordinary paragraph text nor a visible comment: embedded OLE objects, packaged documents, ActiveX controls, and alternative-format imports. A normal text diff can quietly step around those boundaries. For a controlled handoff or CI gate, “we did not inspect it” is not a useful result.

DocFence 0.3.0 makes those surfaces explicit without turning a review tool into an Office runtime. It records bounded, privacy-safe evidence that the package contains embedded or imported content, and gives a policy author a choice: prohibit it outright, or permit a known baseline and fail a later mutation.

Two package surfaces, deliberately separate

The first surface is embedded-object state. DocFence recognizes standard OLE, package, control, and ActiveX control-binary relationship types, along with the conventional word/embeddings/ and word/activeX/ payload folders. Its public report contains aggregate relationship and part counts. Relationship targets, part paths, payload bytes, and fingerprints stay private.

The second is OOXML alternative-format import. A Word w:altChunk anchor tells Word where imported content belongs. That is not just an opaque side file: the anchor is stored document structure, and it is supposed to refer to an internal aFChunk relationship. DocFence inventories both the relationship/payload layer and direct anchors. When it encounters an anchor, it requires a matching internal standard relationship whose target resolves safely to a stored package member; malformed references fail closed.

That strictness is narrow on purpose. DocFence does not fetch an external target, decode a payload, import HTML, open an embedded file, execute a control, or claim to know what Word would render. Microsoft’s Document Inspector treats embedded files and objects as a reviewable hidden-data surface, while the Open XML SDK documents the relationship contract for w:altChunk. The useful boundary is evidence about stored state, not a fabricated safety verdict.

Policy can mean “none” or “no change”

A publishing or clean-handoff boundary can prohibit either category in the candidate:

rules:
  require_no_embedded_objects: true
  require_no_alternative_format_imports: true

Those gates emit DFP015 and DFP016. A controlled template may legitimately contain an approved payload already. For that case, the new comparison gates preserve the baseline and reject later changes:

rules:
  no_embedded_object_payload_changes: true
  no_alternative_format_import_changes: true

They emit DFP017 and DFP018. Relationship IDs are normalized before comparison, so an ID renumbering by itself stays quiet. An added second w:altChunk anchor is still visible even if it reuses an unchanged import relationship.

Evidence without content leakage

The release tests a conventional ActiveX relationship chain, OLE/package payload changes, alternative-format payload changes, malformed anchors, duplicate anchors, policy findings, and relationship-ID stability. Unique markers are placed in visible text and every added payload surface, then the JSON, Markdown, and SARIF output is checked to ensure none of them reappear.

The wheel and source distribution were independently built twice from the release commit using its SOURCE_DATE_EPOCH; both artifact pairs were byte-identical. The published release includes the wheel, source archive, and SHA-256 manifest, and the downloaded wheel was installed into a fresh environment for a final smoke test.

Use the release

python -m pip install https://github.com/SybilGambleyyu/docfence/releases/download/v0.3.0/docfence-0.3.0-py3-none-any.whl

docfence diff approved.docx candidate.docx --format markdown
docfence check approved.docx candidate.docx --policy docfence.yml --format sarif --output docfence.sarif

The complete contract is in the policy reference and threat model. DocFence is MIT-licensed and available on GitHub. For the earlier hidden-text boundary, read The style-hidden blind spot needs evidence, not guesswork.