Catalog Architecture
The catalog is Flowfile's largest subsystem: namespaces, physical and virtual tables, SQL, visualizations, dashboards, notebooks, schedules, runs, artifacts, and the sharing model all live behind one facade. This page is the contributor's map — how the pieces compose, where metadata and data actually live, the resolution paths that matter, and the invariants you must not break. It pairs with Kernel Architecture and Visualizations & Graphic Walker, which own their subsystems' deep dives.
The big picture
Architecturally the catalog is two substrates and a service layer. Metadata — every namespace, table row, schedule, grant — lives in the shared SQLite catalog DB. Table data lives outside the DB as Delta directories (locally or on S3). Around those, per-domain services implement features, and everything heavy routes to neighbors: full-frame reads to the worker, user code to kernels, timed execution to the embedded scheduler.
Metadata vs data
Metadata is SQLAlchemy models in database/models.py: CatalogNamespace (two-level catalog→schema tree; level-0 rows may carry storage_uri/storage_connection_name), FlowRegistration (+ stable flow_uuid), FlowRun (with a YAML flow_snapshot), FlowSchedule + ScheduleTriggerTable, CatalogTable, CatalogTableReadLink (read-lineage), CatalogVisualization, CatalogDashboard, CatalogNotebook (metadata only — cells live on disk), GlobalArtifact (metadata only — blobs live on the kernel shared volume), engagement tables, and the polymorphic ResourceGrant layer.
Data is one Delta directory per table under storage.catalog_tables_directory (<name>_<uuid>/ with _delta_log/; legacy single .parquet files still open — delta_utils.py detects the format). A CatalogTable row points at its directory via file_path and caches schema_json, row_count, size_bytes — for optimized virtual tables file_path is NULL because there is no data on disk at all.
The S3 backend is per-catalog, not global. A level-0 namespace's storage_uri + storage_connection_name make new tables under that catalog write to object storage; existing local tables never move, and the metadata DB stays local. storage_backend.resolve_for_namespace returns a CatalogStorageTarget with two credential forms: decrypted storage_options for core's own bounded reads, and an owner-encrypted worker_interface for the worker hand-off — secrets never cross the wire in plaintext, and credentials always resolve as the catalog owner, never the calling user. FLOWFILE_CATALOG_STORAGE_URI/_CONNECTION are snapshotted onto a catalog once at creation, not read live.
Write modes and SCD2
CatalogTable.scd2_config (JSON, Scd2TableConfig in catalog_schema.py) is the single source of truth for whether a table is SCD2-tracked and what its four generated columns are named. It is written by an scd2 write (_resolve_scd2_config in flow_graph/catalog_write.py), preserved across a /refresh, and cleared by any other physical write mode. Every read-side consumer — the catalog reader's history filter, the reader's codegen, flowfile_frame's read path, and the reader UI and browser badges — reads this column and never a writer node's settings. The writer path (its own codegen and settings UI) supplies its own SCD2 settings, which core validates against the persisted config on every subsequent write (_SCD2_DRIFT_FIELDS), so write and read side can't disagree about column names. See Slowly Changing Dimensions for the user-facing mechanics.
The service layer
CatalogService (catalog/service.py) is a facade over composed sub-services, one per domain under catalog/services/: namespaces, flows, runs, engagement, schedules, tables, virtual_tables, sql, previews, visualizations, notebooks, stats. Composition is constructor injection with two deliberate quirks:
- Cyclic late-binding —
SqlServiceandVirtualTableServiceneed each other (SQL resolution resolves virtual tables; creating a query-virtual derives its schema by running SQL). The cycle is broken with.bind()calls after construction. - Facade back-binding — visualization/SQL/schedule services call back through the facade (
bind_facade(self)) so tests can monkeypatchCatalogServicemethods and have the patch take effect on internal paths.
Data access goes exclusively through CatalogRepository (protocol) / SQLAlchemyCatalogRepository. Services raise the CatalogError hierarchy (catalog/exceptions.py), never HTTPException; the router (routes/catalog.py, mounted at /catalog) is a thin adapter that maps exceptions to status codes via _CATALOG_EXCEPTION_MAP and builds a fresh repository + service per request. The router-level auth dependency accepts a JWT or the kernel's X-Internal-Token.
Access control
Authorization is the facade's job, implemented by AccessResolver (catalog/access.py) over auth/sharing.py:
- The router always injects a resolver, but it only restricts when
sharing_enabled() and not user.is_admin and not is_synthetic_principal(user). Electron/single-user mode, admins, the_internal_serviceprincipal (a caller on a desktop that signs with the internal token and names no kernel), and internal callers that constructCatalogServicewithout anaccessargument (scheduler, flow execution, tests) are unrestricted. - Resolution is own-first, then group-granted: accessible ids = rows the user owns ∪ ids granted to any of their groups, at
useormanagelevel. A use-level grant is read-only —writable_namespace_idsrequires ownership or a manage grant. - Namespace grants cascade: a grant on a catalog or schema reaches the tables, flows, visualizations, dashboards, notebooks, and artifacts inside it (one-level child expansion, memoized per request). Tree listing prunes invisible items but keeps "context-only" ancestor namespaces as breadcrumbs with redacted descriptions, and stamps every DTO with its effective access level.
The delete invariant
Every resource-delete path must call sharing.delete_grants_for_resource. SQLite reuses rowids, so a surviving grant row would silently attach itself to a future, unrelated resource. The repository does this on every delete and an ORM after_delete backstop covers session.delete — but bulk query.delete() bypasses ORM events and must clean up explicitly.
Catalogs kept elsewhere
An Iceberg REST catalog added to Flowfile's catalog (catalog/services/external_catalogs.py, routes
routes/external_catalogs.py at /catalog/external) is an ordinary level-0 catalog_namespaces row marked
kept_elsewhere, with one external_catalogs row saying how to reach it: its address, warehouse, kind of sign-in,
client id, scope and token endpoint, and the id of one secret of the owner's holding the sign-in (a bearer token,
or a small JSON of the client id and secret that shared/iceberg_utils.py::client_credentials_sign_in writes and
sign_in_properties reads; no other key can come out of it). The other catalog's top-level namespaces are level-1
rows marked the same way, so grants, the tree and search treat them as any schema; sync adds new ones, sets
gone_since on dropped ones and never deletes a row, since a grant may name it and SQLite reuses ids. Tables are
never rows: they are listed live and kept a minute per schema in the process. Nothing is saved into such a schema:
CatalogService._require_namespace_writable refuses it for every caller, and the three save paths outside the
service (catalog_helpers.require_flow_save_permitted, flow_graph/catalog_resolution._authorize_catalog_write,
routes/routes.py's catalog-writer and train-model gates) call refuse_kept_elsewhere. A grant on such a catalog
reaches its schemas in sharing.granted_resource_ids (a schema kept elsewhere holds no row that could show it). A
flow names the catalog by name (IcebergCatalogSettings.catalog), and table_ref_for_run turns it into an
IcebergTableRef holding the secret's ciphertext, after the run's grants are checked; the worker contract does not
move. A project export leaves these catalogs out (projection.namespace_manifest_data).
Virtual tables
A catalog_writer node in virtual mode registers a table that stores no data and caches no plan; every read runs its producer:
- At registration,
FlowGraph.check_flow_lazinesswalks the writer's upstream using each node's declaredlaziness(configs/node_store/nodes.py). If everything is lazy, the table is optimized (is_optimized), and the write records the Delta versions of its source tables (source_table_versions). Every write also recordspolars_plan, which the table panel shows: theprint_treedrawing (graph_tree.render_flow) of the writer and the nodes upstream of it (catalog_write._readable_plan). - Resolution opens the producer flow as it is saved, finds the
catalog_writernode whose configuredtable_namematches the table's name (that name-keying is what lets one producer flow back several virtual tables), and re-runs just that node (performance mode; on the worker when offload is enabled) to rebuild its output. That output is returned lazy (flowframe.lazy = True) — re-running the flow reconstructs the LazyFrame plan, it does not materialize or store data. For an optimized table nothing computes at all until an actual.collect()— a write, a visualization, or a catalog query — forces it; a standard one runs its eager nodes on the way. - Freshness: downstream caching fingerprints an optimized source by a sha256 of its producer's flow file plus the live versions of its recorded sources (
freshness._fingerprint_virtual_source), so a saved producer edit or an out-of-band source write invalidates readers; a standard one, or one with an unfingerprintable source, invalidates every run.
Query virtual tables (the SQL editor's "save as virtual table") store a sql_query instead of a plan. Resolution builds a pl.SQLContext, registering every referenced table and recursively resolving nested virtuals — bounded by QUERY_VIRTUAL_TABLE_RECURSION_LIMIT = 5 plus a visited-set cycle check, with per-table grant checks in restricted mode.
SQL execution
SqlService.execute_sql_query resolves every accessible table into a name map (qualified catalog.schema.table, schema.table, and bare name when unique), materializes referenced virtual tables to IPC files via the worker, then hands the whole query to the worker: a spawned child opens the Delta directories and IPC files in a pl.SQLContext, collects at most max_rows, and returns rows. Core never collects — it ships names and paths. Cloud-backed physical tables are excluded from this path with a clear error (the in-flow sql_query node has its own resolution path that handles them). "Save as flow" generates a catalog_reader-per-table → sql_query flow and registers it.
Semantic layer
A schema's semantic model (descriptions, joins, metrics, each with a review status and an append-only history) lives in a glosslayer ledger inside the catalog database. See Semantic Models for the user side.
| Piece | Where | Role |
|---|---|---|
| Ledger tables | Alembic 046_semantic_ledger.py calls glosslayer.schema.upgrade; downgrade drops every gloss_* table |
Same database and engine as the catalog, so SQLite and PostgreSQL both work |
| Host | catalog/semantic/host.py |
Builds Gloss, the glosslayer-flowfile catalog plugin and the embedded syncer once per process; rebuilt when sharing_enabled() flips, since the review policy (solo or team) comes from it |
| Model view | Gloss.model_view (glosslayer) |
A namespace's model with its review state: the accepted value and the open facts beside it, versions, review groups. The API's shapes (schemas/semantic_schema.py) are read from it, and the compiler reads the same view |
| Service | catalog/semantic/service.py |
SemanticModelService(db, user, access): read, propose, review, history, sync, export, metric query. Ledger errors become the Semantic*Error types in catalog/exceptions.py and a refused decision becomes NotAuthorizedError |
| Compiler | glosslayer.query |
Pure: a model view and a MetricQuery become SQL, the tables it reads and the metric's version. Also the dry-run of a proposed metric and which metrics depend on a join |
| Suggestions | glosslayer.rules, SemanticModelService.suggest / store_suggestions |
Pure rules for roles, joins (within the model's tables) and metrics over one aggregate query per table through the catalog SQL path; stored as proposals with source inferred:flowfile-rules, skipping what the model already holds |
| AI | ai/semantic_routes.py (POST /ai/semantic/draft, /ai/semantic/ask), ai/semantic_draft.py, ai/semantic_ask.py, prompts ai/prompts/semantic_{draft,ask}.md |
Sized for the local model: JSON mode only, one call per table of at most 16 columns, one repair round, names matched against the menu given to the model. AI words are stored through view_for(..., via="ai:<provider>/<model>"), so they queue; each draft and answer is written to the AI audit log with rows_sent_to_model: 0 |
| Router | routes/catalog_semantic.py, mounted under /catalog |
/namespaces/{id}/semantic-model with proposals, review, history, sync, export, query, query/save-as-flow, data-rules/run and data-rules/results; no trailing slashes; JWT only |
| DTOs | schemas/semantic_schema.py |
The contract the frontend mirrors |
Hooks. TableService.update_table and delete_table, NamespaceService.update_namespace and the catalog writer's table registration call host.on_table_renamed, on_table_deleted, on_namespace_renamed and on_table_written. They run after the catalog commit: on SQLite a ledger write fails with database is locked while a catalog write is uncommitted. They never run inside apply_transaction, and they log instead of raising, so a failed hook never fails a catalog change. sync() reconciles what a hook missed, and the service syncs on a model read at most once a minute. A rename cannot be recovered by a sync (it looks like a drop and an add), so a failed rename hook logs at error level. The project importer reaches no hook.
Access. host.view_for(user, access) hands glosslayer path prefixes built from host.read_rule(access). A prefix covers everything below it, so a catalog path goes into read or manage only when every schema under it is in that set. read holds the paths of the visible schemas, of the catalogs read whole and the keys of tables readable outside them; manage holds the namespaces the user owns or holds a manage grant on (a public-writable namespace does not count). Where nothing restricts the caller, the view is unrestricted. Accepting is decided by glosslayer's policy from manage: solo on a desktop, team review where sharing is on, and an AI actor never accepts.
Who can read a semantic model
The semantic model follows the catalog. Callers that nothing restricts (a desktop, an admin, internal callers) read everything. For a restricted caller host.ReadRule holds two sets of namespaces:
- Readable whole: a schema the caller owns or holds a
useormanagegrant on (a grant on a catalog reaches its schemas). The caller reads every fact of every table in it, the schema's own facts and its joins. Reads are per schema: a reader of a schema sees the facts of all its tables. - Visible as a container: a public schema the caller neither owns nor holds a grant on. The caller reads the schema's own facts (its name, description and AI instructions), its joins whose two tables they read, and the tables in it that they own or were granted, with all their facts. Nothing about its other tables is answered: they are not listed in the model, the review queue, the export, the join checks or the sync report; their subjects answer
historywith the 404 a subject of another model gets; proposing on one answers as a table that is not in the model, and a join to one as a table that is not in the catalog, whatever its columns; they never enter an AI prompt, menu or statistics query; a metric query does not follow a join to them; and the namespace tree's counts of the schema count only the tables left for the caller. A join name held by a join the caller cannot read is refused (409), and rule suggestions skip such names, since a join's subject is its schema plus its name.
A table granted on its own adds that table's facts wherever its schema is visible; when the schema itself is not visible, the schema's model answers 403 and the tree counts only that table. Catalog-level facts (the catalog's own facts and joins across schemas) are read only when every schema under the catalog is readable whole; otherwise the catalog's model lists the tables the caller reads and no catalog-level facts.
The namespace tree offers a model only where the caller has one to open: visible_summaries sets semantic_model_readable false on a namespace kept only as a granted table's breadcrumb (its model answers 403), on a public schema holding no table the caller reads (its model would be its own name and notes alone), and on a catalog none of whose schemas the caller may open. The tree's Semantic model entry and the catalog page's semantic section follow it; the routes still answer by the rule above.
glosslayer's read scope is a set of prefixes, each covering everything below it, so it cannot express "this schema's own subjects and these of its tables". A public schema's path is therefore in read, and SemanticModelService applies the rule: scope() lists only readable tables, _narrowed drops the joins and facts of the rest from every model view, and may_read(subject) is asked by the review queue, history, review decisions, metric names, the export and the sync report. Enforcing it in the ledger would need a scope entry that covers a namespace's own subjects without the datasets under it.
Who may accept in a public schema follows manage unchanged: its owner, users with a manage grant and admins. The app-managed public schemas (General > default, Unnamed Flows, Python Editor) are owned by the seeded local_user, so on a shared server only an admin accepts facts there, including facts on a user's own tables.
Queries. A metric query compiles against a snapshot of the whole catalog, so joins can cross schemas, and runs through CatalogService.execute_sql_query, the SQL path above. Each table is written as one quoted identifier holding its qualified name, the name resolve_all_queryable_tables registers. The worker computes; core never collects. A metric proposal is dry-run with a one-row limit before it is stored. save-as-flow goes through SqlService.save_sql_query_as_flow, which looks up readers in the target schema, so a query that reads another schema's table is refused there.
Join check. glosslayer.joins.check (through SemanticModelService.measure_join) measures a join before propose stores it: one aggregate statement per side (rows with a key, distinct keys) through CatalogService.execute_sql_query, to side first. Verdicts: ok (stored with the measurement as rationale), reversed and many_to_many (422 with an instruction), unchecked (empty table, no compute, unreadable table; stored). POST …/semantic-model/joins/check re-checks every join of the snapshot. Rule suggestions skip it, since they already prove uniqueness.
Data rules. A column's rules are glosslayer's checks fact (one list per column, [{"check": "between", "max": 8}, …]); the UI and Flowfile's code say "data rules" because "rules" already names Suggest and "check" the join check. catalog/semantic/data_rules.py holds what is Flowfile's: the kinds it runs (KINDS: glosslayer's not_null, unique, matches, one_of, between, length, plus formula, a Check subclass registered with glosslayer whose pass condition is simple_function_to_expr(expression); glosslayer's sql kind is refused), the check of a proposed list (check_proposed, called from propose: glosslayer.checks.validate, then the list planned and collected over an empty frame of the table's stored columns, which reads no data and refuses a rule the column's type cannot take; only a ValueError refuses, and when the check itself cannot be made, because a stored column type names no Polars type (known_polars_type; a table a kernel wrote holds Delta's names) or the check raises anything else, the list is stored with a rationale starting Not checked, which the UI turns into a notice) and the run. Rules run as Polars, never SQL: run builds one lazy single-row aggregate per table with glosslayer.checks.plan over CatalogService.stored_table_plan (gated by _require_use; local Delta, object storage through its storage target, legacy parquet; a virtual table is refused and answered as skipped), passes the catalog's stored columns as schema= so the scan's own schema is never resolved in core, and collects through bounded.single_row on the current context's backend, so core reads one row of counts. checks.run_plan retries one check at a time when the pass fails, so a rule the data refuses reports its own error; an unreachable backend raises (ComputeUnavailable, 503) and nothing is logged. SemanticModelService.run_data_rules runs accepted rules only and logs them with Gloss.record_check_results (table gloss_check_results, from migration 046) under one run id; data_rule_results answers each table's newest run, kept only for the rules accepted now. Routes: POST …/semantic-model/data-rules/run (body {table_ids?}) and GET …/data-rules/results; reading rights suffice. data_rules.run takes a ledger view and tables, no request, so a caller other than a route can use it. Not built: runs after a write, suggestions, failing-row samples, table-level rules, pruning of logged results.
Confidentiality. catalog/semantic/confidentiality.py::read_withheld(db, table_ids) withholds a column when the highest level among the live facts (accepted, proposed or stale) of the column, its semantic type and its table is confidential or restricted. It reads the ledger without the caller's scope, fails closed (every table asked about is withheld) when the ledger raises, and withholds nothing when glosslayer is not installed. It is enforced in ai/chart_profile.py, the choke point for chart and dashboard plans, in ai/dashboard_story.py::keep_private, and in the semantic draft and ask routes. Anyone adding an AI surface that reads catalog tables must ask read_withheld before any value, description or synonym of a column goes into a prompt.
Ask grounding. In ai/semantic_ask.py the model is a suggester and the code decides: ground runs ground_dimensions, ground_filters, ground_grain, choose_metric and ground_values over the model's answer. A dimension survives only if the question names it (whole words, plural and _ normalised; labels and synonyms count), a filter only if its value is in the question, a grain only if the question asks over time; a "by …" phrase naming an allowed dimension is added, one naming none sets SemanticAskOut.partial and a note, and nothing is substituted. ground_values turns known category values the question names into filters; they come from SemanticModelService.known_values (one UNION ALL through CatalogService.execute_sql_query, so the worker computes and the caller's access applies), cached 300 s per user and namespace in semantic_routes._known_values, used for matching only and never placed in the prompt. The first note of every answer is Read as: …. When extending: never loosen grounding to make a question pass, and never let a repair round substitute one dimension for another.
Provider rule of the two AI routes. The provider named in the request, else the local model if installed, else 409 with a top-level body {"error_code": "AI_NOT_SET_UP", "message", "local_available"} that the UI turns into an offer. They deliberately do not use node_codegen_routes._resolve_provider, whose no-provider path falls through to an Ollama that is usually not running. Per-task model choices live only in the browser, so the frontend sends provider/model. POST …/suggest needs no provider. Statistics reach a model only when send_data_allowed(); result rows never do.
The dependency
Every glosslayer and glosslayer_flowfile import is function-local. glosslayer and its plugin glosslayer-flowfile are both dependencies in pyproject.toml, pinned to the same minor version.
Schedules and triggers
Schedule rows live in the shared DB, and the embedded scheduler (flowfile_scheduler/engine.py) deliberately imports nothing from core — it reads mirrored models from shared/, polls every 30 s, and coordinates instances through a single-row advisory lock with a 90 s stale-takeover.
Table triggers fire through two cooperating paths:
- Push (synchronous): catalog writes call
safely_fire_table_trigger_schedules— find enabled watchers, skip any with an active run, commitlast_trigger_table_updated_atbefore spawning (that pre-commit is the double-fire guard), then spawn the run. - Poll (safety net): every tick the scheduler compares each watched table's
updated_atwith the schedule's recorded value and fires on newer. Set-triggers require all linked tables updated since the last fire.
Fired schedules execute headlessly: spawn_flow_run creates the FlowRun row and spawns a subprocess (flowfile run flow <path> --run-id <id>, or the frozen-binary equivalent), which reports completion back through shared.run_completion — again with no core import. Maintenance operations (optimize/vacuum) deliberately keep updated_at unchanged so they never masquerade as data changes and fire triggers.
Notebooks
Notebooks are the catalog's exploration console, and architecturally they're a deliberate split-identity design: the DB row is registration, the file is the content. A CatalogNotebook row carries name, namespace placement, owner, and default_kernel_id; the cells live on disk as one deterministic YAML file per notebook at <notebooks_directory>/<owner_id>/<notebook_uuid>.notebook.yaml (catalog/services/notebook_store.py). That's the same row-plus-file pattern flows use (FlowRegistration + its .yaml), and for the same reason: it's what lets Projects version notebooks in git.
The store is built for that job — atomic writes, fixed key order, multi-line cell source dumped as YAML literal blocks so diffs read like code review, and a server-derived filename (nothing user-controlled in the path). Reads degrade gracefully: a missing or torn file yields an empty notebook and a malformed cell is skipped rather than raising, so a bad git merge on a notebook file can't brick the catalog.
Three design decisions worth knowing before touching this code:
NotebookServiceowns no execution. The cell model is mixed —python/sql/markdown, with per-cellmetadata(e.g. SQLmax_rows) — and each type routes elsewhere: SQL cells to the same/catalog/sql/executeworker path as the SQL editor, Python cells to the kernel'sexecute_cellwith the fullflowfile_ctxAPI (Kernel Architecture), Markdown rendered client-side. The shipped editor currently surfaces Python and Markdown cells (notebook/types.tsCellType); SQL cells are schema-supported ahead of the UI. The notebook service only persists.default_kernel_idis a plain string, not a foreign key. It just remembers the last kernel picked for Python cells; deleting that kernel means "nothing pre-selected," never a cascade into notebook rows.- The integer
idis the public handle: it's the grant key for sharing (catalog_notebookis namespace-scoped, so catalog grants cascade to notebooks) and the frontend derives the kernel session key from it. Thenotebook_uuidexists for the on-disk filename's stability, not for addressing.
Cell editing gets Jedi-backed code intelligence from core's LSP routes (flowfile_core/lsp/) — completions run server-side against the kernel's environment, not in the browser.
Serving flows as APIs
A registered flow can be published as an HTTP data endpoint (routes/flow_api.py): the public data_router serves GET /api/data/{slug} (API-key auth), runs the flow synchronously, and returns the output of its single api_response node as JSON. Publishing and keys are managed under /flow-api (JWT); keys belong to an API consumer — a service account that can be granted several published flows (routes/api_consumers.py). A call drives the registered flow like any other run — Core builds the LazyFrame and offloads to the worker (path ⑤ in the process map).
Neighbors
- Worker — the only sanctioned reader of full table data:
catalog_reader.open_catalog_table(Delta, local or cloud) andopen_virtual_result(IPC), invoked through core'strigger_*calls; results are collected in spawned children and returned as paths/rows, never frames. Long-lived viz session children are the same pattern specialized for Graphic Walker — see Visualizations. - Kernels — on a desktop and in the Python package, write Delta directories directly in the catalog tables folder, read the resulting metadata from the Delta log without materializing, and POST it to core (
/catalog/tables/from-dataor/{id}/refresh); core stores the pre-computed metadata as-is and never scans the file. On a multi-user server a kernel reads only the tables core put in a read-only folder of its own and writes throughPOST /catalog/tables/write, where core checks access and the compute backend writes the table (Catalog tables on a multi-user server). Kernel-exchange and artifact directories must stay under the kernel shared volume — see Kernel Architecture. - Artifacts —
GlobalArtifactrows are metadata plus astorage_key; blobs live on the kernel shared volume with versioning and soft delete. - Projects — a saved version exports metadata (namespaces, table pointers, schedules, notebooks, model metadata — no data, no blobs, secrets as
${secret:NAME}placeholders) into the active git project; no catalog mutation calls into it, and status is derived from the database when asked, by comparing it with the last version. The DB remains the runtime source of truth.
Invariants
| Rule | Why |
|---|---|
| Core never collects full catalog frames — worker children own dataset memory | The core/worker contract; previews are the only bounded exception |
Every delete calls delete_grants_for_resource (bulk deletes explicitly) |
SQLite rowid reuse would re-attach stale grants |
| Serialized cloud plans are never deserialized | They embed decrypted storage credentials |
| Storage credentials resolve as the catalog owner; worker payloads stay owner-encrypted | Sharing must not leak or re-key secrets |
| Catalog storage is immutable once a physical table exists; changing it requires ownership | Prevents splitting one catalog's data across backends |
sharing_enabled() reads FLOWFILE_MODE from os.environ per call |
Import-time caching would make docker-mode untestable |
optimize/vacuum never bump updated_at |
Maintenance must not fire table triggers |
| Table names reject dots | Dots are the SQL qualification separator |
| Ledger writes only after the catalog commit | A glosslayer write during an uncommitted SQLite catalog write fails with database is locked |
Extension points
A new catalog resource type touches, in order: the model in database/models.py plus an Alembic migration (next NNN_ prefix); a ResourceSpec in sharing.RESOURCE_REGISTRY (and _NAMESPACE_SCOPED_TYPES if namespace grants should cascade to it); a sub-service under catalog/services/ wired into CatalogService.__init__; repository methods whose delete path cleans up grants; DTOs in schemas/catalog_schema.py; an exception in catalog/exceptions.py mapped in _CATALOG_EXCEPTION_MAP; router endpoints; access guards and DTO stamping; and a kind in project/kinds.py if it should be projectable.
A new schedule kind adds the schedule_type semantics and validators, a _process_* method in the scheduler's _tick, and — if push-triggered — a fan-out method in schedules.py. Keep the scheduler free of core imports; reflect any new columns via shared/models.py.
A new storage backend extends storage_backend.py (URI schemes, CatalogStorageTarget, worker payload) and mirrors the join/decrypt on the worker side in catalog_reader.py; blob artifacts implement the shared.artifact_storage.ArtifactStorageBackend ABC.