Skip to content

feat(extensions): add local text-to-diagram rendering API - #5009

Closed
tang-vu wants to merge 3 commits into
Osmantic:public-betafrom
tang-vu:feat/beta-local-diagram-rendering-20260914
Closed

tang-vu wants to merge 3 commits into
Osmantic:public-betafrom
tang-vu:feat/beta-local-diagram-rendering-20260914

Conversation

@tang-vu

@tang-vu tang-vu commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Ready for independent review (2026-09-15). Candidate f4d9a0dc3bd0b0ee0ac81f0c6cc2e6db0a3c8673 has a successful GitHub check rollup and no base-branch conflict at this review snapshot. This supersedes earlier draft-status wording only. All validation gaps, migration requirements, live gates and independent human review requirements below remain in force; this is not a merge-ready approval.

Why this matters

Documents, scripts and local agents can render text diagrams without sending their source to a public rendering endpoint. Add an optional Kroki service through the existing catalog/install lifecycle, with concrete local API examples and an API-service dashboard label.

Contract

  • Pin upstream yuzutech/kroki:0.32.1@sha256:6980bfb218b48b74ea14b888d9c7e8c032d1cb6325f3292277abdf62483abd9d, inspecting the exact Java server, PlantUML implementation and Dockerfile. Run UID/GID 1001, read-only root, no host data mounts, temporary scratch, dropped capabilities and loopback 7829 -> 8000.
  • Explicit secure mode/PlantUML sandbox, 1 MiB main-server request limit (KROKI_BODY_LIMIT, not the companion-only similarly named setting), five-second native-command and twenty-second Java-conversion limits, 2 CPU/1.5 GB memory. Preserve image logging options by setting the heap through JAVA_TOOL_OPTIONS.
  • Includes the main image's native renderers; optional Mermaid/BPMN/Excalidraw/diagrams.net companions are not started or advertised as working. No automatic remote fallback. Health performs a bounded GET, because this exact server registers GET /health and returns 404 to HEAD.
  • Handoff: manifest/recipe -> catalog -> installed Compose -> HTTP health and explicitly configured client -> saved output. The service is stateless: keep diagram source/output externally, and roll back the image without a data migration.
  • Full canonical catalog regeneration also restores the already tracked disabled pixel-inference metadata without activating it.

Overlap check

Searched open/closed PRs for Kroki, diagram rendering and the new production recipe paths; no Kroki PR exists. #4924 is an interactive draw.io editor, whereas this is a text-to-image API for automation. #1613 covers generic headless metadata; this recipe follows the current dashboard API-service mechanism. #5003 adds a different LanguageTool API ID to the same set, and combined integration must retain both. Shared catalog/README additions remain independently installable services.

Validation

  • Exact-image Linux amd64: 2 passed (24-live-get-health, 217.01 seconds of pytest). Actual health/version, Graphviz SVG with Unicode, compressed-source GET, PNG signature/dimensions, PlantUML SVG, malformed input 400, oversized request 413, and repeated container recreation.
  • A controlled HTTP source is first fetched successfully from inside the container. Rendering a PlantUML include then makes no request to that reachable source. Neither the remote canary nor a mounted local canary appears in the rendered SVG. This tests actual secure-mode behavior (includes are stripped), not an unreachable-server false positive. Fixtures are cleaned up.
  • Initial live test caught HEAD /health returning 404; corrected the recipe to GET before publication. No success is claimed for that failed run.
  • Dashboard full-page tests: 16 passed; lint 0 errors / 598 baseline warnings; production build passed. 36 manifests, scoped hooks and git diff --check passed.
  • Full local make gate still reproduces the root/WSL no-sudo Docker baseline failure, covered by existing fix(installer): honor unavailable sudo in Docker fallback #3158. Added path-filtered CI runs the real render test; no full local gate pass is claimed.

Review and limits

Awaiting independent recipe review and CI. Image advertises amd64/arm64; live evidence covers only Linux amd64 under WSL. No native Windows/macOS/ARM, real editor integration, large/concurrent workload, optional companion or every bundled renderer was tested. These controls are not a general sandbox guarantee; upstream supplies no API authentication, so remote use needs an operator-managed protected path and trusted clients.

Final candidate f4d9a0dc3bd0b0ee0ac81f0c6cc2e6db0a3c8673: 33 successful CI checks, 4 conditionally skipped; no pending or failed checks.

Batch integration receipt

This is one of 30 independently branched public-beta PRs. The published synthetic integration head is 61f4c6fccc81bea697f4941683fefb5089ba77f4, built from baseline d49ad4bbc760be319de7f4c9b9a93b1f18fe3922 in this reproducible order:

#4946 → #4948 → #4951 → #4954 → #4972 → #4960 → #4961 → #4957 → #4964 → #4967 → #4968 → #4971 → #4975 → #4976 → #4984 → #4982 → #4990 → #4988 → #4989 → #4997 → #5003 → #5006 → #5007 → #5009 → #5012 → #5011 → #5013 → #5014 → #5020 → #5021

Reconciliation preserved all 146 files owned by a single PR byte-for-byte against their exact candidate heads. The eight shared paths preserve both CLI STT/TTS commands and help, every added Makefile test, both environment schema additions and all Extensions UI behavior. LanguageTool and Kroki both remain headless API entries. Canonical regeneration yields 76 catalog entries and 47 library manifests; all README rows are retained. Shared-file changes need these additive resolutions when merged independently.

Combined validation: 2,852 API tests passed / 1 skipped; 1,082 UI tests passed; 47 manifests passed; all 12 added Makefile commands passed; 12 catalog boundary tests passed / 12 opt-in runtime tests skipped in this combined run. Individual exact-image results remain documented above. UI lint/build, scoped secret hooks, diff checks, four platform smoke tests and installer simulation passed. Compose plans for NVIDIA/AMD/Apple each contain 20 services and no duplicate published bindings across the core plus 12 new recipes; this is static plan evidence, not simultaneous startup or GPU inference.

The first unrestricted UI run timed out in two tests under concurrent load; the complete rerun used --maxWorkers=2 with unchanged assertions and timeouts and passed. ESLint reports zero errors and 603 warnings, including the existing JSX usage-detection pattern. Full local make gate still fails the no-sudo Docker baseline covered by #3158. BATS records 416 passed / 5 failed on this root/WSL host (platform detection, root preflight and a 15 GiB versus 20 GiB free-space expectation). Neither full local gate nor BATS is described as green.

This integration receipt supplements each PR's own regression and does not waive its independent review, live hardware/browser/upgrade gates or rollback requirements. The PRs remain drafts; none was merged upstream.

This was referenced Sep 14, 2026
root added 2 commits September 17, 2026 11:10
# Conflicts:
#	ods/extensions/services/dashboard/src/pages/Extensions.jsx
The kroki manifest exposes KROKI_API_PORT as a user-settable port
override, but the key was missing from .env.schema.json, so
validate-env rejected the documented setting as unknown.
@tang-vu
tang-vu force-pushed the feat/beta-local-diagram-rendering-20260914 branch from a31e1b1 to b05aea0 Compare September 17, 2026 14:05
@Lightheartdevs

Copy link
Copy Markdown
Collaborator

Thanks for this contribution. public-beta was promoted into main on 2026-09-24 and no longer receives changes, so we're closing pull requests that target it. This isn't a judgment on the change itself. If it's still needed, please rebase onto main and open a focused PR. See #7253 for details and the contribution policy.

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.

2 participants