From 5fe52ecc9edde113a2e90cbecc1c4a5bbd0251dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Tejero=20Cantero?= Date: Tue, 6 Oct 2026 22:30:54 +0200 Subject: [PATCH] :recycle: Rename app.graph.ingest to app.graph.export MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The holder vocabulary names the persisted relation write an export, so the batch tier takes app.graph.export, its file entry point becomes export-file!, and the two on-connection helpers follow inside the namespace. print-ingest! and the srepl ingest-file-to-graph! keep their names, with their references repointed; their own renames can ride a reviewer's ask. AI-assisted-by: glm-5.3-flash Signed-off-by: Álvaro Tejero Cantero --- backend/src/app/graph/debug.clj | 2 +- backend/src/app/graph/{ingest.clj => export.clj} | 16 ++++++++-------- backend/src/app/graph/report.clj | 4 ++-- backend/src/app/http/debug.clj | 14 +++++++------- backend/src/app/srepl/main.clj | 6 +++--- ...aph_ingest_test.clj => graph_export_test.clj} | 12 ++++++------ 6 files changed, 27 insertions(+), 27 deletions(-) rename backend/src/app/graph/{ingest.clj => export.clj} (93%) rename backend/test/backend_tests/{graph_ingest_test.clj => graph_export_test.clj} (66%) diff --git a/backend/src/app/graph/debug.clj b/backend/src/app/graph/debug.clj index f5c27ef1d9..5e162ac85e 100644 --- a/backend/src/app/graph/debug.clj +++ b/backend/src/app/graph/debug.clj @@ -11,7 +11,7 @@ (`app.graph.relation-overlay`), maintained from the msgbus file-change feed by `app.graph.relation-overlay.sync` and queried in Datalog through `app.graph.relation-overlay.console`. The Ladybug engine no longer appears on - this path: it keeps the batch-export tier (`app.graph.ingest`), where + this path: it keeps the batch-export tier (`app.graph.export`), where columnar output is the point. The overlay is immutable data in an atom, so readers never lock and the sync loop is the only writer." (:require diff --git a/backend/src/app/graph/ingest.clj b/backend/src/app/graph/export.clj similarity index 93% rename from backend/src/app/graph/ingest.clj rename to backend/src/app/graph/export.clj index 84600d404c..896a57f495 100644 --- a/backend/src/app/graph/ingest.clj +++ b/backend/src/app/graph/export.clj @@ -4,7 +4,7 @@ ;; ;; Copyright (c) KALEIDOS SUBSIDIARY SL -(ns app.graph.ingest +(ns app.graph.export "Penpot file -> Ladybug graph projection." (:require [app.binfile.common :as bfc] @@ -39,7 +39,7 @@ :file-id (str file-id))) [file-id file])) -(defn- ingest-on-connection*! +(defn- export-on-connection*! [system ^Connection conn file-id ^BufferAllocator allocator {:keys [db-path skip-stats? skip-validation?] :or {skip-stats? true}}] (let [[file-id file] (fetch-file! system file-id) @@ -47,7 +47,7 @@ data (:data file)] (when-not skip-validation? (ctf/check-file-data data)) - (l/inf :hint "graph ingest" + (l/inf :hint "graph export" :file-id (str file-id) :revn (:revn file) :db-path db-path @@ -74,7 +74,7 @@ :stats (when-not skip-stats? (stats/summarize-connection conn))})))) -(defn ingest-on-connection! +(defn export-on-connection! "Project `file-id` into an already open Ladybug `conn`. Takes `:arrow-alloc`, owned by the caller. The allocator must stay open @@ -86,10 +86,10 @@ (when-not arrow-alloc (ex/raise :type :validation :code :missing-arrow-allocator - :hint "ingest-on-connection! requires :arrow-alloc; nest with-allocator! outside the connection")) - (ingest-on-connection*! system conn file-id arrow-alloc opts)) + :hint "export-on-connection! requires :arrow-alloc; nest with-allocator! outside the connection")) + (export-on-connection*! system conn file-id arrow-alloc opts)) -(defn ingest-file! +(defn export-file! [system file-id & {:keys [db-path reset-db? skip-stats? skip-validation?] :or {reset-db? true}}] (let [db-path (or db-path (ladybug/db-path-for-file (h/parse-uuid file-id)))] @@ -102,7 +102,7 @@ (fn [allocator] (ladybug/with-connection! db-path (fn [conn] - (ingest-on-connection*! system conn file-id allocator + (export-on-connection*! system conn file-id allocator {:db-path db-path :skip-stats? skip-stats? :skip-validation? skip-validation?}))))))) diff --git a/backend/src/app/graph/report.clj b/backend/src/app/graph/report.clj index 41c332013d..eb6d1ce743 100644 --- a/backend/src/app/graph/report.clj +++ b/backend/src/app/graph/report.clj @@ -30,9 +30,9 @@ (println! (kv-line table count)))) (defn print-ingest! - "Pretty-print the result map returned by `app.graph.ingest/ingest-file!`." + "Pretty-print the result map returned by `app.graph.export/export-file!`." [{:keys [file-id revn name db-path schema-version projection transforms stats]}] - (section-title "Graph ingest") + (section-title "Graph export") (println! (kv-line "File" (str name " (" file-id ")")) (kv-line "Revision" revn) (kv-line "Schema" schema-version) diff --git a/backend/src/app/http/debug.clj b/backend/src/app/http/debug.clj index 1695287127..5b9dee6bfd 100644 --- a/backend/src/app/http/debug.clj +++ b/backend/src/app/http/debug.clj @@ -396,7 +396,7 @@ ;; `app.graph.*` resolves at call time, never at the top of this namespace. ;; `app.graph.debug` (the console session tier) is a pure datascript overlay -;; and no longer touches Ladybug, but `app.graph.ingest` still projects +;; and no longer touches Ladybug, but `app.graph.export` still projects ;; through `app.graph.ladybug`, which imports `com.ladybugdb.*` and links the ;; native library into the JVM; this namespace loads on every backend boot. ;; The routes below are registered only under the `:graph` flag, so with the @@ -405,19 +405,19 @@ (defn- graph-export-file "Path of a freshly projected graph for `file-id`." [cfg file-id] - (let [ingest-file! (requiring-resolve 'app.graph.ingest/ingest-file!) - {:keys [db-path]} (ingest-file! cfg file-id :skip-stats? true)] + (let [export-file! (requiring-resolve 'app.graph.export/export-file!) + {:keys [db-path]} (export-file! cfg file-id :skip-stats? true)] (when-not (fs/exists? db-path) (ex/raise :type :internal :code :graph-file-not-found - :hint "graph database file missing after ingest" + :hint "graph database file missing after export" :file-id (str file-id) :db-path db-path)) db-path)) (defn graph-export-handler "Stream a Ladybug `.lbug` database for a file, projected afresh from the - database by `app.graph.ingest/ingest-file!` — the reproducible artifact. + database by `app.graph.export/export-file!` — the reproducible artifact. `source=session` is retired: a console session is a datascript overlay with no database file to stream, so it raises @@ -480,7 +480,7 @@ ::yres/headers {"location" "/dbg/graph"}}) (defn graph-reload-handler - "Re-ingest the currently loaded file into the in-memory graph session." + "Reload the currently loaded file into the in-memory graph session." [cfg {:keys [::session/profile-id]}] (let [session-info (requiring-resolve 'app.graph.debug/session-info) load-session! (requiring-resolve 'app.graph.debug/load-session!)] @@ -956,7 +956,7 @@ ;; With the flag on, the Ladybug native library belongs to this process, ;; so load it here. A missing or unusable library then fails the boot ;; instead of the first console request. - (require 'app.graph.debug 'app.graph.ingest)) + (require 'app.graph.debug 'app.graph.export)) [["/readyz" {:handler (partial health-handler cfg)}] dbg])) diff --git a/backend/src/app/srepl/main.clj b/backend/src/app/srepl/main.clj index 90178ab85c..c87f55681c 100644 --- a/backend/src/app/srepl/main.clj +++ b/backend/src/app/srepl/main.clj @@ -497,11 +497,11 @@ Options: - `:db-path` path or `:memory:` - `:reset-db?` delete any existing db first (default true) - - `:skip-stats?` skip post-ingest MATCH count queries (default false)" + - `:skip-stats?` skip post-export MATCH count queries (default false)" [file-id & opts] - (let [ingest-file! (requiring-resolve 'app.graph.ingest/ingest-file!) + (let [export-file! (requiring-resolve 'app.graph.export/export-file!) print-ingest! (requiring-resolve 'app.graph.report/print-ingest!) - result (apply ingest-file! sys/system file-id opts)] + result (apply export-file! sys/system file-id opts)] (print-ingest! result) result)) diff --git a/backend/test/backend_tests/graph_ingest_test.clj b/backend/test/backend_tests/graph_export_test.clj similarity index 66% rename from backend/test/backend_tests/graph_ingest_test.clj rename to backend/test/backend_tests/graph_export_test.clj index 6c1dd732d3..93e3fe3fbb 100644 --- a/backend/test/backend_tests/graph_ingest_test.clj +++ b/backend/test/backend_tests/graph_export_test.clj @@ -4,19 +4,19 @@ ;; ;; Copyright (c) KALEIDOS SUBSIDIARY SL -(ns backend-tests.graph-ingest-test - "The batch-export tier, `app.graph.ingest`, which survives the retirement of +(ns backend-tests.graph-export-test + "The batch-export tier, `app.graph.export`, which survives the retirement of the Ladybug session sync." (:require [app.common.uuid :as uuid] - [app.graph.ingest :as ingest] + [app.graph.export :as export] [clojure.test :as t])) -(t/deftest ingest-on-connection-requires-allocator - ;; The allocator must outlive the connection, so ingest cannot make its own +(t/deftest export-on-connection-requires-allocator + ;; The allocator must outlive the connection, so export cannot make its own ;; inside the call — see `app.graph.arrow/with-allocator!`. (try - (ingest/ingest-on-connection! nil nil (uuid/next)) + (export/export-on-connection! nil nil (uuid/next)) (t/is false "expected :missing-arrow-allocator") (catch clojure.lang.ExceptionInfo e (t/is (= :missing-arrow-allocator (:code (ex-data e)))))))