feat(conversion): establish provider-neutral Office adapter contract - #306
feat(conversion): establish provider-neutral Office adapter contract#306seonghobae wants to merge 220 commits into
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
|
Objective
Advance issue #5 with a provider-neutral, fail-closed Office conversion contract before selecting or embedding a production Office runtime. Protected
mainstill ships validated PDF passthrough plus a fail-closed non-PDF conversion boundary; this Draft does not claim production Office transformed-format support.Fresh exact state — 2026-08-11
Directly revalidated on exact source head
42ee91b5d1d94f209218616bb79e34fa955dcf4fagainst protectedmain55d7ae8647208e301f282350f076eeddaba61d11:31487721202: success;93766851131: checked out exact head42ee91b5d1d94f209218616bb79e34fa955dcf4f, ranmvn -B --no-transfer-progress verify, 676 tests, 0 failures, 0 errors, 0 skips, all JaCoCo coverage checks met, public Javadocs passed,BUILD SUCCESS;93766851040: success;93766851189: success;31487721176: success;31487721175: success;31487721183: success;The exact Maven log still emits the known duplicate Commons Logging warning; that separate issue #320 already has a current-base repair in PR #340 and is not duplicated here.
Latest test-first remediation — reject VBA project active content
RED
Test-only head
2abf9aa05dfdc1776fdf74ac71d9825212c465d9addedOfficeSourceMacroPolicyTest.adapterRejectsVbaProjectBeforeProvider. Exact-head CI31477021105checked out that revision and failed with exactly one intentional regression: the DOCX fixture containingword/vbaProject.binreached the provider instead of failing closed. Security Scan, SAST and fuzz were otherwise successful on that RED head.GREEN
Current exact head
42ee91b5d1d94f209218616bb79e34fa955dcf4frejects a ZIP-package entry whose final path segment isvbaProject.bin(case-insensitive) during the already-bounded central-directory preflight, before provider invocation. The regression now passes with controlledMALFORMED_INPUT/source Office package contains prohibited active content, and the provider call count remains zero. Full exact-headmvn verify, coverage, Javadocs, merge compatibility, Security Scan, SAST and fuzz are GREEN.Microsoft's Open XML macro specifications identify the VBA Project as the macro-bearing package part with content type
application/vnd.ms-office.vbaProjectand the VBA-project relationship type. This slice deliberately rejects the known VBA project part before any untrusted Office runtime receives the package; it does not claim complete OOXML active-content relationship/content-type validation.Current pre-provider package boundary
ZIP-family Office candidates currently require standard single-disk EOCD/central-directory framing; present bounded records; matching local-header signatures and entry names; no ZIP64/split-disk sentinel framing; no encrypted entries; matching compression method; only Stored (
0) or Deflate (8); internally consistent Stored/Deflate size metadata; matching data-descriptor/CRC/size authority where applicable; compressed payload bounded before the central directory; duplicate-entry rejection; safe relative entry paths; and rejection of VBA project parts before provider invocation.ODF candidates (
odt,ods,odp) additionally require:META-INF/manifest.xml;META-INF/entry outside the manifest plus the current bounded signature-name allowance;mimetypeexists: first local ZIP entry, Stored, no local-header extra field, and byte-equal to the declared ODF media type;manifest:manifestroot validation and exactmanifest:version="1.4";/media-type consistency when the package mimetype contract is present;Passing these checks is intentionally not complete OOXML/ODF/OLE/archive-expansion/macro/embedded-object/malware/fidelity qualification.
Standards authority
The implementation uses only bounded facts that are directly testable at Clearfolio's pre-provider trust boundary. It does not claim complete schema or macro-enabled-format conformance.
Post-provider and remaining qualification
A provider result is accepted only when tenant/job/generation/source-format/adapter/policy/correlation/source-digest binding matches, output stays within byte/page ceilings, and a non-empty unencrypted PDF passes active-content/action policy. Safe internal
GoToand valid absolutehttp/https/mailtouser URI actions are preserved; malformed/relative/unsafe schemes, prohibited or unknown actions, unsafe/AA, JavaScript/embedded-file/catalog-associated-file paths and unsafe chains fail closed without dereferencing external hyperlinks.This PR still does not select/embed an Office runtime. Production process ownership remains outside the Clearfolio API-container trust boundary; in-process/container-local
LocalOfficeManagerremains rejected. Before any transformed-format production support claim the repository still needs deeper OOXML/ODF/legacy-container relationship and content-type qualification, archive expansion limits, broader macro/OLE/embedded-object/external-resource policy, sandboxed sidecar or authenticated remote runtime, process/queue/transport/cancellation limits, malware/quarantine, exact runtime license/SBOM/provenance, realistic authorized Korean/English Office fidelity corpus, resource/crash/restart/readiness evidence, fresh review and live repository protection.A successful adapter call, package check or Office-process exit is never a supported-format or fidelity oracle.
Merge gate
Keep Draft. Continue only bounded issue-#5 qualification while this branch lease is stable. Before integration, reconcile the unique Office-contract delta onto the current protected baseline without losing newer protected-main semantics, regenerate exact-head/base-sensitive gates and realistic fidelity/sandbox evidence, and obtain any qualifying independent approval required by live repository policy.