Skip to content

feat(creative): P2 journey - DitherForge/Kromacut/SindriCAD readers, Prepare and export check (draft, depends on #140) - #141

Closed
DVOpenLabs wants to merge 10 commits into
mainfrom
feat/p2-creative-journey
Closed

DVOpenLabs wants to merge 10 commits into
mainfrom
feat/p2-creative-journey

Conversation

@DVOpenLabs

@DVOpenLabs DVOpenLabs commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

Draft for review. Depends on #140; do not merge before it. Sol's unresolved BLOCK on #140 (passport export output-directory race, R4-F1) is inherited and still open; the maintainer's draft-only exception for #140 does not extend to this PR. Merge and release are not authorized.

What

P2 creative journey on top of #140: inspect -> Prepare -> exported project for creative-tool 3MFs.

  • Readers for DitherForge (MIT, rtwfroody/ditherforge @4d3552a), Kromacut (vycdev/Kromacut @9487475) and SindriCAD (MakerViking/sindricad @8b2e9dc), written from the exporters' file formats. No AGPL/GPL code or samples were copied. Synthetic fixtures only; provenance in backend/tests/fixtures/creative/PROVENANCE.md.
  • ImageMap and Lumina are manual-only identity readers (explicit format choice; nothing is inferred from a generic ZIP).
  • /creative/formats, /creative/inspect (refactored), /creative/prepare; Prepare uses service.convert(..., "preserve") and verifies the exported archive (kept/changed/dropped/added parts by name and SHA-256, paint counts, settings delta). The original is never modified. Responses carry the file name and a generic location label, never a full path.
  • Desktop: format chooser and Prepare panel; synthetic-data screenshots in docs/internal/screens/creative/.
  • Unsupported or ambiguous inputs get an actionable explanation instead of a guess.

Prepare fix for Kromacut and DitherForge (latest commits)

Earlier drafts of this PR said Prepare refused both tools' files. Cause found by running Prepare and reading the pinned exporters:

  • Kromacut writes its colour layers as mesh objects in the root model and builds an assembly from components without p:path (valid 3MF Core). multipart.validate_archive only looked for mesh objects in p:path files and refused with "reference an object that no file defines". The validator now also counts mesh objects the root model defines, keeps root and file object types in separate namespaces, and refuses a root object that contains another object or has a mesh with no triangles. This is a shared structure check (Prepare, Doctor, Ready Now, Model Connect, CLI), so it applies to any file, not only Kromacut.
  • DitherForge's Bambu-path export (outer object 2, component objectid 1, part id 1) now prepares. Its generic-path export writes <part id="1"> under a component with objectid 2 or more, which the unchanged "part ids match component ids" rule refuses. No producer exemption was added; such a file is inspect-only, the format table carries prepare_limits, and the chooser shows it. Whether Orca loads that shape is not established.
  • Prepare drops Metadata/plate_*.json (stale slice cache, existing behaviour); the DitherForge Bambu screenshot shows it as dropped.

Review

Reviewed artifacts are tied to their commits; earlier approvals do not cover later bytes.

  • 1e6fdfe (artifact 9c1d7c4e, shared with the P8 PR): Opus APPROVE-WITH-NOTES, Sol APPROVE-WITH-NOTES. Notes N1, N2 fixed in 1e6fdfe.
  • d48d568 (artifact 9aed9197): Opus APPROVE-WITH-NOTES (O-R5-F1..F7), Sol BLOCK (SOL-R4-F1 type namespaces, SOL-R4-F2 nested objects).
  • a3b52e8 (artifact 7839271c): Opus APPROVE-WITH-NOTES, Sol BLOCK SOL-R5-F1 (HIGH: one assembly mixing a root and a file component of the same id hid a type mismatch).
  • 8273e14 (artifact b76f2cea, current head): Opus APPROVE-WITH-NOTES, Sol APPROVE-WITH-NOTES. SOL-R5-F1, SOL-R4-F1 and SOL-R4-F2 closed. The validator now refuses that mixed shape instead of guessing.
    Opus F1 (two stale chooser screenshots recaptured) and F2 (wording test) from the earlier round are fixed in d48d568.
    Carried, not fixed (all pre-existing, documented in CREATIVE_COMPAT.md): the p:path file scan has no nested-object or unclosed-object handling and counts <triangles> as geometry (Opus O-R6-F1 / Sol R6-N1, MEDIUM); object ids and types are pooled across referenced files, not checked per file (Opus O-R7-F1, MEDIUM); duplicate root object ids are not refused (O-R7-F2); the nested guard matches the text <object, so a comment containing it is refused (fails closed); the mixed-namespace refusal fires even when no part carries a subtype (fail-closed); no /creative/prepare test for the mixed refusal (covered by construction through eligibility.structure_problems).

Evidence labels

fixture-tested only; all archives synthetic, built from exporter source. Python 3.14 locally: full backend run on 8273e14: 5304 passed, 51 skipped, 0 failed (an earlier run at a3b52e8 had one contract-test failure for the new prepare_limits key, fixed there); vitest 1490; tsc clean; source independence 0 violations. Python 3.13 confirmation is CI's. No genuine generator export, Snapmaker Orca load, slicer or printer was involved.

Known gaps

🤖 Generated with Claude Code

DVOpenLabs and others added 3 commits November 1, 2026 09:15
… formats, and Prepare with export verification

Readers written from the exporters' documented output shape (read on 2026-11-01; formats only, no AGPL/GPL code or samples copied). Explicit supported-format table with manual-only ImageMap and Lumina. POST /creative/prepare writes a new file through the existing Prepare path, never next to the original, and verifies the export (kept/changed/dropped/added parts) and that the original is unchanged. DitherForge and Kromacut synthetic files are refused by the existing structure check; reported, not relaxed. Fixture-tested only.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…rding and docs from review

Prepare now returns the output file name and a generic location label only. Export bucket headings show totals and say when a list is capped. Restores the narrowed network wording, aligns the 400 text with the UI label, says what a manual-only format choice means, reconciles the DitherForge provenance and distinct screenshots.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…N2 (path-leak test can fail on Windows)

N1 chooser no longer says 'detected automatically' next to a manual-choice refusal.
N2 inspect route test uses assert_no_local_path (JSON-escaped and slash forms).
Verified: creative+journey+ext_routes backend, vitest 1488, tsc clean (py3.14).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 1, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

DVOpenLabs and others added 5 commits November 1, 2026 15:55
…DitherForge's generic export is inspect-only

Kromacut writes its colour layers as mesh objects in the root model and builds its assembly from components
without p:path, which 3MF Core allows. multipart.validate_archive only looked for mesh objects in p:path files,
so Prepare refused every Kromacut file with "reference an object that no file defines". It now also counts mesh
objects the root model defines: a component without p:path needs a root mesh object, one with p:path still needs
one in that file. A root object with a mesh but no triangles is refused.

DitherForge's generic-path exporter writes part id 1 under a component with objectid 2 or more (also for a single
mesh). The check that part ids match component ids is unchanged and has no producer exemption, so that shape stays
refused. The format table now carries prepare_limits and the chooser shows them. The Bambu-path export (outer
object 2, component objectid 1, part id 1) is accepted and prepared.

Evidence is fixture-tested: all archives are synthetic, built from bambu.go, export3mf.go and export3mf.ts at the
commits in PROVENANCE.md. No genuine export was available.

Verified: backend 5299 passed, 51 skipped (Python 3.14); vitest 1490 passed; tsc clean; source independence 0
violations. New tests cover input, inspection, Prepare and exported archive for Kromacut and the DitherForge Bambu
path, the unchanged generic-path refusal, and four validator negatives.

Screenshots: the two stale format-chooser images were recaptured with the conditional wording (N1), and three new
journey screens were added; kromacut-prepare-refused.png is replaced by kromacut-prepare-result.png. Captured with
capture.mjs against the parent 1e6fdfe plus the source changes in this commit; later edits were tests and docs only.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…efuses nested root objects

Review of d48d568 found two holes in the new root-model scan. Root and p:path-file objects shared one id-to-type
map, so a root mesh with the same id could hide a real role mismatch in a file or cause a false refusal. The type
check now resolves each part through its own component: a component without p:path uses root types, otherwise file
types. The root scan also credited a mesh nested inside an object to the outer object; 3MF Core does not nest
objects, so a root object that contains another object is now refused and not counted as geometry.

Tests: two collision regressions, a nested-object validator test and a Prepare test that refuses it and writes
nothing; all four fail against d48d568's validator. The namespace test now scans a real external file, the
assembly-reference test uses the assembly's real id, and the exported archive is re-validated. The formats contract
test allows the optional prepare_limits key. CREATIVE_COMPAT.md no longer says the p:path check is per file (ids
are pooled across the referenced files, as before).

Correction to d48d568: its message quoted the backend full run (5299 passed) from before prepare_limits was added to
the format table, which broke test_supported_formats_contract. This commit fixes that test. Full backend run on this
tree: 5302 passed, 1 failed (that test, since fixed), 51 skipped, Python 3.14; creative tests re-run after the fix:
84 passed. Source independence 0 violations.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…e root model and a file

Round-5 review of a3b52e8 found that namespace selection was per numeric id: one assembly with a pathless and a
pathed component of the same id made every matching part resolve through root types, which hid a type mismatch in
the file. A part record names a number, not a namespace, so Studio cannot tell which component it describes. The
validator now refuses that shape ("referenced both from the root model and from a file") instead of guessing, which
makes the per-component type resolution unambiguous.

Test: the reviewer's scenario as a regression; it fails without the change. CREATIVE_COMPAT.md states the refusal and
that the p:path file scan did not receive the nested-object and unclosed-object handling the root scan has (carried,
older behaviour).

Verified: full backend run on this tree 5304 passed, 51 skipped, 0 failed (Python 3.14); creative and multipart
subsets re-run after the change: 117 passed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…onent references by (file, id)

The validator's p:path file scan lacked the nested-object and unclosed-object handling the
root scan had, counted an empty <triangles> container as geometry, ignored duplicate ids and
pooled object ids and types across files. One shared scan (_scan_objects) now reads the root
model and every p:path file, references resolve by (file, id), repeated ids, non-numeric ids,
truncated object tags and components without an objectid are refused, and tag text inside
an XML comment is ignored. The root/file same-id refusal is kept; several files that
disagree on an id's type in one assembly are refused too.

Verified: 13 of 27 new tests fail on the previous implementation (the rest pin valid shapes);
full backend 5331 passed, 51 skipped; source independence 0 violations. Synthetic fixtures only;
no genuine export, Orca run or hardware.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… effective object types; refuse unreadable object tags

Sol R7-F1: a commented-out component reached the root component reader and refused a valid archive.
Sol R7-F2: an omitted type (3MF default model) disagreed with an explicit model across files.
Opus O-R7-F1: an object whose id is not the first attribute was never scanned.

Verified: new regressions fail on 2cfcf94 source (3 of 4 checked); full backend 5336 passed, 51 skipped;
source independence 0 violations. Synthetic fixtures only.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Base automatically changed from feat/portfolio-integration to main November 14, 2026 18:00
DVOpenLabs added a commit that referenced this pull request Nov 14, 2026
feat: integrated Phase 2 build - Creative/Prepare (#141), cross-track recovery (#142), Lumina (#139+#143), Recovery/Passport slice
@DVOpenLabs

Copy link
Copy Markdown
Owner Author

Landed on main via #144 (merge 15a2ac3) / #140. Verified: merging this head into main produces a tree identical to main, so nothing here is lost. Branch preserved.

@DVOpenLabs DVOpenLabs closed this Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant