zettelkasten.dashboard.backend.routes.tables¶
zettelkasten.dashboard.backend.routes.tables ¶
Matrix/table, schema, re-mine, and review-table routes.
Split out of the former flat routes.py; behaviour is unchanged.
BuildTableRequest ¶
Bases: BaseModel
Body for the matrix build endpoints (mirrors tables.build_matrix).
Source code in zettelkasten/dashboard/backend/routes/tables.py
RecordAttributionRequest ¶
Bases: BaseModel
Body for the blank-spine collision attribution endpoints.
Resolves ONE unattributable member surfaced in a grid's needs_attribution
bucket: decision='own' claims it as this spine's (it rejoins on rebuild),
decision='foreign' keeps it excluded. Keyed by (member_uid, dim_id).
Source code in zettelkasten/dashboard/backend/routes/tables.py
GenerateMatrixRequest ¶
Bases: BaseModel
Body for the Generate (materialize) endpoints (mirrors tables.generate_matrix).
Generate is the WRITE path: it reifies the builder's column config into a spine
and renders the matrix over it (design 260701_matrix-as-spine.md). Preview
(/table with preview=true) stays the cheap, read-only lens projection.
org_id binds the materialize identity to the OPEN matrix's org (§8.3): pass
it to resync a specific spine, or omit it to default to
organizations.org_id_for(name, table_id) — the open matrix ↔ one org
binding, never a hash of the columns. A brand-new/unbound matrix mints a new
spine; a matrix already bound to a materialized spine resyncs it in place.
Source code in zettelkasten/dashboard/backend/routes/tables.py
RowValuesRequest ¶
Bases: BaseModel
Body for the row-axis enumeration endpoints (feeds the builder wizard).
Source code in zettelkasten/dashboard/backend/routes/tables.py
DescribeMatrixRequest ¶
Bases: BaseModel
Body for the natural-language matrix-suggestion endpoint.
project / graph are OPTIONAL. When one is supplied the suggestion runs
the corpus-analysis pass (design §8.1): it reads a bounded sample of that
scope's in-scope notes and proposes BOTH dimensions (columns) and recurring
themes (row-hubs). Omitted, it degrades to the catalog-only mapping (themes
is then []), so an unscoped call still returns a valid config.
Source code in zettelkasten/dashboard/backend/routes/tables.py
RemineProposeRequest ¶
Bases: BaseModel
Body for the PROPOSE route.
intent is OPTIONAL. Empty (the default) keeps the historical
schema-driven path: classify each member spine's corpus into the shared
schema's fixed dimensions. A non-empty intent ("make a matrix for X")
switches to facet INDUCTION — the columns are induced from the owner's corpus
via :func:remine.induce_dimensions and ride back in the grid flagged
induced=True — with NO registry schema required.
depth (default 0 = OFF) opts into Stage 4 emergent DEPTH: with
depth >= 1 AND an intent (the emergent path), each induced column may
sub-cluster its classified cell notes into children. It is forwarded only
on the intent path; the schema-driven path ignores it so registry behavior is
unchanged.
Source code in zettelkasten/dashboard/backend/routes/tables.py
RemineApplyRequest ¶
Bases: BaseModel
Body for the APPLY route — the approved proposal echoed back from PROPOSE.
Source code in zettelkasten/dashboard/backend/routes/tables.py
graph_table ¶
graph_table(name: str, req: BuildTableRequest | None = None) -> dict
Build the synthesis matrix for a single source graph.
Source code in zettelkasten/dashboard/backend/routes/tables.py
project_table ¶
project_table(name: str, req: BuildTableRequest | None = None) -> dict
Build the synthesis matrix across a project's sources.
Source code in zettelkasten/dashboard/backend/routes/tables.py
graph_table_attribution ¶
graph_table_attribution(name: str, req: RecordAttributionRequest) -> dict
Record a blank-spine collision attribution for a graph-scoped matrix.
Source code in zettelkasten/dashboard/backend/routes/tables.py
project_table_attribution ¶
project_table_attribution(name: str, req: RecordAttributionRequest) -> dict
Record a blank-spine collision attribution for a project-scoped matrix.
Source code in zettelkasten/dashboard/backend/routes/tables.py
graph_table_stream ¶
graph_table_stream(name: str, req: BuildTableRequest | None = None)
Streaming twin of graph_table (SSE: stage/grid/cells/result frames).
The Generate / Regenerate path uses this so the grid renders live. Guards match the JSON route: 404 unknown source, 403 federated (read-only).
Source code in zettelkasten/dashboard/backend/routes/tables.py
project_table_stream ¶
project_table_stream(name: str, req: BuildTableRequest | None = None)
Streaming twin of project_table (SSE: stage/grid/cells/result frames).
Source code in zettelkasten/dashboard/backend/routes/tables.py
graph_table_build
async
¶
graph_table_build(name: str, req: BuildTableRequest | None = None) -> dict
Schedule a durable background matrix build for a source graph (fire-and-poll).
Declared async so scheduling never takes the single web-threadpool token —
the multi-second build runs off it in build_jobs. Guards match the stream
route: 404 unknown source, 403 federated (read-only).
Source code in zettelkasten/dashboard/backend/routes/tables.py
project_table_build
async
¶
project_table_build(name: str, req: BuildTableRequest | None = None) -> dict
Schedule a durable background matrix build across a project's sources.
Source code in zettelkasten/dashboard/backend/routes/tables.py
build_job_active
async
¶
build_job_active(kind: str = Query(...), review: str = Query(...), id: str = Query(default='')) -> dict
The in-flight job_id for (kind, review, id) (reconnect), else null.
kind is matrix or outline; id is the table_id (matrix) or
outline_id (outline) — the second half of the job's dedup key.
Source code in zettelkasten/dashboard/backend/routes/tables.py
build_job
async
¶
The durable job record for job_id (404 if unknown).
Shape: {job_id, kind, key, status, stage, progress?, partial, result?,
error?, created_at, updated_at} where status is
pending/running/done/error and partial carries live
grid / cells / synthesis (matrix) or markdown (outline).
Source code in zettelkasten/dashboard/backend/routes/tables.py
graph_table_generate
async
¶
graph_table_generate(name: str, req: GenerateMatrixRequest | None = None) -> dict
Generate (materialize) a single source graph's matrix into a spine.
The write twin of graph_table: reifies the builder's columns into a spine
and renders over it. Routed through the background build worker (returns a
job_id to poll) so the multi-second materialize never occupies the single
web token and serializes against every other spine writer for the review.
Declared async so scheduling never takes that token. Guards match the
spine lifecycle routes — 404 unknown source, 403 federated / writes disabled.
Source code in zettelkasten/dashboard/backend/routes/tables.py
project_table_generate
async
¶
project_table_generate(name: str, req: GenerateMatrixRequest | None = None) -> dict
Generate (materialize) a project's matrix into a spine and render over it.
Source code in zettelkasten/dashboard/backend/routes/tables.py
graph_table_row_values ¶
graph_table_row_values(name: str, req: RowValuesRequest | None = None) -> dict
Auto-list the candidate row values for an axis over a single source graph.
Source code in zettelkasten/dashboard/backend/routes/tables.py
project_table_row_values ¶
project_table_row_values(name: str, req: RowValuesRequest | None = None) -> dict
Auto-list the candidate row values for an axis over a project's corpus.
Source code in zettelkasten/dashboard/backend/routes/tables.py
table_suggest_columns ¶
Propose typed columns from extraction schemas, note types, and CCC slots.
Source code in zettelkasten/dashboard/backend/routes/tables.py
table_suggest_from_description ¶
table_suggest_from_description(req: DescribeMatrixRequest) -> dict
Agent-map a plain-English comparison request to a {row_axis, columns, themes} config.
Deterministic-first: the agent prefers grounded catalog columns (schema
dimensions / note types / CCC slots / note fields) and only falls back to
free-text prompt columns when nothing fits. When a project / graph
scope is supplied it additionally reads the corpus and proposes themes
(recurring source groupings → row-hubs). Returns a config the builder can load
directly; an empty / unparseable request degrades to the source axis.
Source code in zettelkasten/dashboard/backend/routes/tables.py
review_tables ¶
review_tables(name: str, meta: bool = False, drift: bool = False, table_id: str = Query(default='')) -> dict
List the persisted matrices for a review — or one view's drift badge.
meta=false (default) returns the FULL grids — retained for the bulk Excel
export, which walks every view's rows. meta=true returns METADATA ONLY
(id, title, columns, row axis, synthesis, lifecycle, counts — no per-cell
rows): the always-polled matrices dropdown only needs each view's shape,
so it uses this lighter listing and never ships every review's full grids.
The active grid is loaded on demand separately (the cost-free peek).
drift=true (with table_id) is the LAZY drift/unrouted badge lens: it
returns ONLY the {unrouted, unrouted_ids, attached, stale} cue for that one
view (tables.count_unrouted), NOT a tables list. This is what moves the
two full-corpus walks the badge needs OFF the grid-load critical path — the
grid renders from the peek immediately and the frontend fetches this after it
paints. A query flag (rather than a second route) keeps the mounted
(method, path) set — and the route-manifest snapshot — unchanged.
Source code in zettelkasten/dashboard/backend/routes/tables.py
project_schemas ¶
List a project's schema-grouped matrix entries (shared by >= 2 spines).
graph_schemas ¶
List a graph's schema-grouped matrix entries (shared by >= 2 spines).
project_spine_group_matrix ¶
The ephemeral comparison matrix for one of a project's shared schemas.
graph_spine_group_matrix ¶
The ephemeral comparison matrix for one of a graph's shared schemas.
project_schema_overlay ¶
The ephemeral hub + branch edges for a project's shared schema (GraphView).
graph_schema_overlay ¶
The ephemeral hub + branch edges for a graph's shared schema (GraphView).
project_nested_spines ¶
The multi-tier nested-spine composition across a project's spines.
graph_nested_spines ¶
project_schema_remine ¶
project_schema_remine(name: str, fingerprint: str, req: RemineProposeRequest = RemineProposeRequest()) -> dict
PROPOSE re-mining for a project's shared schema (READ-ONLY classify).
Source code in zettelkasten/dashboard/backend/routes/tables.py
graph_schema_remine ¶
graph_schema_remine(name: str, fingerprint: str, req: RemineProposeRequest = RemineProposeRequest()) -> dict
PROPOSE re-mining for a graph's shared schema (READ-ONLY classify).
Source code in zettelkasten/dashboard/backend/routes/tables.py
project_schema_remine_apply
async
¶
project_schema_remine_apply(name: str, fingerprint: str, req: RemineApplyRequest) -> dict
APPLY an approved project re-mine proposal (writes spine-member edges).
Source code in zettelkasten/dashboard/backend/routes/tables.py
graph_schema_remine_apply
async
¶
graph_schema_remine_apply(name: str, fingerprint: str, req: RemineApplyRequest) -> dict
APPLY an approved graph re-mine proposal (writes spine-member edges).
Source code in zettelkasten/dashboard/backend/routes/tables.py
review_table_synthesis ¶
On-demand AI one-line synthesis for a single matrix column.
Source code in zettelkasten/dashboard/backend/routes/tables.py
rename_review_table ¶
Rename a persisted matrix view (display title only; table_id stays stable).
Source code in zettelkasten/dashboard/backend/routes/tables.py
delete_review_table ¶
Delete a persisted matrix from a review.