overview
tit.server.routes.overview ¶
GET /api/catalog/overview -- the project Overview page's one aggregate read.
R1 of docs/dev/DECISIONS.md ยง 2026-09-05 (Overview, batch execution and explicit viewing). The page this serves replaced the
Subjects page, and with it a request fan-out that grew with the project: one
/api/catalog/subjects/{id} per subject plus five output lists per subject
plus one analyses list per simulation, capped in the renderer at 25 subjects
(pages/results/useOutputs.ts's EAGER_SUBJECT_LIMIT) so that a larger
project silently showed no counts at all.
Everything here is a thin aggregation over :mod:tit.catalog -- discovery
rules (what makes a subject, which run directories count) stay there on top of
:class:tit.paths.PathManager and are never re-implemented, here or in TS.
Import cost: module level imports only fastapi plus this package's own
schemas; :mod:tit.catalog, :mod:tit.paths and the job manager are imported
inside the handler, so this module stays far under
dev/route_import_guard.py's 400 ms budget and does no filesystem work when
the server boots.
job_states_by_subject ¶
{subject: {job_kind: "pending" | "failed"}} from one job listing.
jobs is the manager's own newest-first list, so the first terminal
state seen for a (subject, kind) pair is the most recent one and later
(older) entries never overwrite it. An active job always wins over an older
failure: something is happening right now, which is what the column should
say.
Source code in tit/server/routes/overview.py
presence ¶
presence(on: bool, *, partial: bool = False, column: str = '', job_states: dict[str, str] | None = None) -> str
One column's :data:tit.server.schemas.PresenceState.
On disk wins: an artefact that exists is present (or partial) no
matter what a job is doing. Only an absent artefact can be pending or
failed, which is what makes the four states answer different questions
rather than three of them meaning "not there".
Source code in tit/server/routes/overview.py
build_overview ¶
Aggregate every Overview fact for the bound project. Pure over pm.
Source code in tit/server/routes/overview.py
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 | |