feat(bcda): the BCDA manager — a Streamlit app and stack bcda CLI over the client, store, loader, connector and crosswalk
Some checks failed
CI / lint (push) Successful in 48s
CI / notebooks-smoke (push) Successful in 1m46s
Infra CI / zotero (push) Successful in 15s
Infra CI / llm (push) Successful in 1m4s
Infra CI / notebooks (pull_request) Successful in 55s
Infra CI / docs (pull_request) Successful in 17s
Infra CI / api (pull_request) Successful in 14s
Infra CI / llm (pull_request) Successful in 20s
CI / test (push) Failing after 2m26s
Infra CI / notebooks (push) Successful in 52s
Infra CI / api (push) Successful in 1m14s
Infra CI / docs (push) Successful in 1m45s
Infra CI / mc (push) Failing after 42s
CI / lint (pull_request) Successful in 27s
CI / notebooks-smoke (pull_request) Successful in 1m41s
CI / test (pull_request) Failing after 2m20s
Infra CI / zotero (pull_request) Successful in 21s
Infra CI / mc (pull_request) Failing after 32s
Package Supply Chain / pkg-supply-chain (push) Successful in 2m3s

bcda.ui mirrors the surface of the CMS server (CMSgov/bcda-app, vendored
under dev/vendor): /_version, /_health, metadata, /auth/token,
attribution_status, $export on Group/all · Group/runout · Patient with
_type / _since / _typeFilter, job history, status, cancel and /data
download — plus the local side: the Store's job and file history,
flatten + load into bcda.*, the connector into input_layer.*, the
replica for browsing, the v3 data dictionary and CCLF crosswalk, and the
vendored-upstream manifest with an on-demand drift check.

bcda.ui.service has no Streamlit in it: every operation takes a
Connection / Client / Store, so `stack bcda preflight|auth|jobs|export|
adopt|cancel|store|load|vendor` reuse it verbatim and tests hand in
httpx.MockTransport clients and temp stores. Connections are the four
public sandbox entities, BCDA_CLIENT_ID/SECRET from the environment, or
custom (sandbox or production, v3 or v2). bcda.ui.runner runs exports,
adoption, loads and drift checks on daemon threads in a process-level
registry that survives Streamlit reruns, captures the bcda.* log lines
of each run's own thread, and flips state last so readers never see a
finished run with an incomplete log; a st.fragment panel shows runs
live. Exports default to one job per type with cancel retries (the only
shape that survives the shared sandbox's sweeps); the _typeFilter
builder composes System-Type, outcome and service-date; completed jobs
under 24 h are offered for adopt, in-progress ones for cancel. Data
pages read the read-only replica only.

`stack bcda ui` launches streamlit on src/bcda/ui/app.py; streamlit is
added to the bcda extra. CLI reference pages regenerated (the generator
renumbers sidebar positions, hence the touched pages).

Tests: service, runner, every page through AppTest (buttons, forms,
error paths), the app shell, and the CLI — new modules at 100% line
coverage.

refs #1139
This commit is contained in:
kert
2026-10-25 14:08:04 -04:00
parent 52ebad29cd
commit eb1b574c04
128 changed files with 3303 additions and 132 deletions

View File

@@ -1,6 +1,6 @@
---
title: stack api serve
sidebar_position: 66
sidebar_position: 77
---
# `stack api serve`

View File

@@ -1,6 +1,6 @@
---
title: stack api
sidebar_position: 65
sidebar_position: 76
---
# `stack api`

View File

@@ -0,0 +1,23 @@
---
title: stack bcda adopt
sidebar_position: 15
---
# `stack bcda adopt`
```
Usage: stack bcda adopt [OPTIONS] JOB_ID
Download a completed job this store did not start.
╭─ Arguments ──────────────────────────────────────────────────────────────────╮
│ * job_id TEXT Server job id (see `stack bcda jobs`). [required] │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --preset TEXT Public sandbox entity when BCDA_CLIENT_ID is unset. │
│ [default: Large Model Entity] │
│ --type -t TEXT Resource type(s) the job holds, for the store │
│ record. │
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────╯
```

View File

@@ -0,0 +1,18 @@
---
title: stack bcda auth
sidebar_position: 12
---
# `stack bcda auth`
```
Usage: stack bcda auth [OPTIONS]
Issue a token and show attribution status.
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --preset TEXT Public sandbox entity when BCDA_CLIENT_ID is unset. │
│ [default: Large Model Entity] │
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────╯
```

View File

@@ -0,0 +1,21 @@
---
title: stack bcda cancel
sidebar_position: 16
---
# `stack bcda cancel`
```
Usage: stack bcda cancel [OPTIONS] JOB_ID
Cancel an in-progress job.
╭─ Arguments ──────────────────────────────────────────────────────────────────╮
│ * job_id TEXT Server job id. [required] │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --preset TEXT Public sandbox entity when BCDA_CLIENT_ID is unset. │
│ [default: Large Model Entity] │
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────╯
```

View File

@@ -0,0 +1,40 @@
---
title: stack bcda export
sidebar_position: 14
---
# `stack bcda export`
```
Usage: stack bcda export [OPTIONS]
Run an export through the store (blocks until downloaded).
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --preset TEXT Public sandbox entity when │
│ BCDA_CLIENT_ID is unset. │
│ [default: Large Model Entity] │
│ --type -t TEXT Resource type(s); default all │
│ three. │
│ --endpoint TEXT Group/all, Group/runout or │
│ Patient. │
│ [default: Group/all] │
│ --since TEXT FHIR instant, e.g. │
│ 2026-01-01T00:00:00+00:00 │
│ --system-type TEXT _typeFilter System-Type │
│ tag(s). │
│ --outcome TEXT _typeFilter outcome: partial │
│ or complete. │
│ --service-date-from TEXT _typeFilter service-date > │
│ YYYY-MM-DD. │
│ --per-type --one-job One job per type (survives │
│ sandbox sweeps). │
│ [default: per-type] │
│ --cancel-retries INTEGER Restarts after server-side │
│ cancellation. │
│ [default: 6] │
│ --poll-interval FLOAT Seconds between status polls. │
│ [default: 15.0] │
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────╯
```

View File

@@ -0,0 +1,19 @@
---
title: stack bcda jobs
sidebar_position: 13
---
# `stack bcda jobs`
```
Usage: stack bcda jobs [OPTIONS]
Server job history for the entity (shared on the sandbox).
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --preset TEXT Public sandbox entity when BCDA_CLIENT_ID is unset. │
│ [default: Large Model Entity] │
│ --limit INTEGER Newest N jobs. [default: 25] │
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────╯
```

View File

@@ -0,0 +1,20 @@
---
title: stack bcda load
sidebar_position: 18
---
# `stack bcda load`
```
Usage: stack bcda load [OPTIONS]
Flatten + load the newest export per type, run the connector, publish the
replica.
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --pipeline --no-pipeline Run the connector into input_layer.* │
│ [default: pipeline] │
│ --skip-flatten Reuse existing Parquet. │
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────╯
```

View File

@@ -0,0 +1,18 @@
---
title: stack bcda preflight
sidebar_position: 11
---
# `stack bcda preflight`
```
Usage: stack bcda preflight [OPTIONS]
/_version, /_health and metadata — no token needed.
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --preset TEXT Public sandbox entity when BCDA_CLIENT_ID is unset. │
│ [default: Large Model Entity] │
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────╯
```

View File

@@ -0,0 +1,16 @@
---
title: stack bcda store
sidebar_position: 17
---
# `stack bcda store`
```
Usage: stack bcda store [OPTIONS]
Local store: jobs, files, bytes.
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────╯
```

20
docs/docs/cli/bcda-ui.md Normal file
View File

@@ -0,0 +1,20 @@
---
title: stack bcda ui
sidebar_position: 10
---
# `stack bcda ui`
```
Usage: stack bcda ui [OPTIONS]
Launch the BCDA manager (Streamlit).
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --port INTEGER Port for the Streamlit server. │
│ [default: 8501] │
│ --headless --no-headless Do not open a browser. │
│ [default: headless] │
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────╯
```

View File

@@ -0,0 +1,18 @@
---
title: stack bcda vendor
sidebar_position: 19
---
# `stack bcda vendor`
```
Usage: stack bcda vendor [OPTIONS]
Vendored upstream (CMSgov/bcda-app, bcda.cms.gov): manifest, verification,
drift.
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --check Also query GitHub / bcda.cms.gov for drift. │
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────╯
```

30
docs/docs/cli/bcda.md Normal file
View File

@@ -0,0 +1,30 @@
---
title: stack bcda
sidebar_position: 9
---
# `stack bcda`
```
Usage: stack bcda [OPTIONS] COMMAND [ARGS]...
BCDA client and manager (exports, store, load, UI).
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────╮
│ ui Launch the BCDA manager (Streamlit). │
│ preflight /_version, /_health and metadata — no token needed. │
│ auth Issue a token and show attribution status. │
│ jobs Server job history for the entity (shared on the sandbox). │
│ export Run an export through the store (blocks until downloaded). │
│ adopt Download a completed job this store did not start. │
│ cancel Cancel an in-progress job. │
│ store Local store: jobs, files, bytes. │
│ load Flatten + load the newest export per type, run the connector, │
│ publish the replica. │
│ vendor Vendored upstream (CMSgov/bcda-app, bcda.cms.gov): manifest, │
│ verification, drift. │
╰──────────────────────────────────────────────────────────────────────────────╯
```

View File

@@ -1,6 +1,6 @@
---
title: stack bib attach-iom
sidebar_position: 21
sidebar_position: 32
---
# `stack bib attach-iom`

View File

@@ -1,6 +1,6 @@
---
title: stack bib attach-oig
sidebar_position: 26
sidebar_position: 37
---
# `stack bib attach-oig`

View File

@@ -1,6 +1,6 @@
---
title: stack bib backfill-comments
sidebar_position: 19
sidebar_position: 30
---
# `stack bib backfill-comments`

View File

@@ -1,6 +1,6 @@
---
title: stack bib cfr-jump
sidebar_position: 31
sidebar_position: 42
---
# `stack bib cfr-jump`

View File

@@ -1,6 +1,6 @@
---
title: stack bib code-tags
sidebar_position: 32
sidebar_position: 43
---
# `stack bib code-tags`

View File

@@ -1,6 +1,6 @@
---
title: stack bib discover-pfs-rules
sidebar_position: 15
sidebar_position: 26
---
# `stack bib discover-pfs-rules`

View File

@@ -1,6 +1,6 @@
---
title: stack bib fetch-docket-comments
sidebar_position: 16
sidebar_position: 27
---
# `stack bib fetch-docket-comments`

View File

@@ -1,6 +1,6 @@
---
title: stack bib fetch-pfs-comments
sidebar_position: 17
sidebar_position: 28
---
# `stack bib fetch-pfs-comments`

View File

@@ -1,6 +1,6 @@
---
title: stack bib fr-grab
sidebar_position: 29
sidebar_position: 40
---
# `stack bib fr-grab`

View File

@@ -1,6 +1,6 @@
---
title: stack bib fr-jump
sidebar_position: 30
sidebar_position: 41
---
# `stack bib fr-jump`

View File

@@ -1,6 +1,6 @@
---
title: stack bib import-zotero
sidebar_position: 23
sidebar_position: 34
---
# `stack bib import-zotero`

View File

@@ -1,6 +1,6 @@
---
title: stack bib ingest-iom
sidebar_position: 20
sidebar_position: 31
---
# `stack bib ingest-iom`

View File

@@ -1,6 +1,6 @@
---
title: stack bib ingest-mail
sidebar_position: 18
sidebar_position: 29
---
# `stack bib ingest-mail`

View File

@@ -1,6 +1,6 @@
---
title: stack bib ingest-oig
sidebar_position: 25
sidebar_position: 36
---
# `stack bib ingest-oig`

View File

@@ -1,6 +1,6 @@
---
title: stack bib query
sidebar_position: 14
sidebar_position: 25
---
# `stack bib query`

View File

@@ -1,6 +1,6 @@
---
title: stack bib refresh-iom
sidebar_position: 28
sidebar_position: 39
---
# `stack bib refresh-iom`

View File

@@ -1,6 +1,6 @@
---
title: stack bib refresh-oig
sidebar_position: 27
sidebar_position: 38
---
# `stack bib refresh-oig`

View File

@@ -1,6 +1,6 @@
---
title: stack bib sync-zotero
sidebar_position: 24
sidebar_position: 35
---
# `stack bib sync-zotero`

View File

@@ -1,6 +1,6 @@
---
title: stack bib sync
sidebar_position: 12
sidebar_position: 23
---
# `stack bib sync`

View File

@@ -1,6 +1,6 @@
---
title: stack bib tag
sidebar_position: 13
sidebar_position: 24
---
# `stack bib tag`

View File

@@ -1,6 +1,6 @@
---
title: stack bib watch-iom
sidebar_position: 22
sidebar_position: 33
---
# `stack bib watch-iom`

View File

@@ -1,6 +1,6 @@
---
title: stack bib
sidebar_position: 11
sidebar_position: 22
---
# `stack bib`

View File

@@ -1,6 +1,6 @@
---
title: stack bls ces
sidebar_position: 35
sidebar_position: 46
---
# `stack bls ces`

View File

@@ -1,6 +1,6 @@
---
title: stack bls oews
sidebar_position: 34
sidebar_position: 45
---
# `stack bls oews`

View File

@@ -1,6 +1,6 @@
---
title: stack bls
sidebar_position: 33
sidebar_position: 44
---
# `stack bls`

View File

@@ -1,6 +1,6 @@
---
title: stack comments dockets
sidebar_position: 40
sidebar_position: 51
---
# `stack comments dockets`

View File

@@ -1,6 +1,6 @@
---
title: stack comments extract-ocr
sidebar_position: 38
sidebar_position: 49
---
# `stack comments extract-ocr`

View File

@@ -1,6 +1,6 @@
---
title: stack comments extract
sidebar_position: 37
sidebar_position: 48
---
# `stack comments extract`

View File

@@ -1,6 +1,6 @@
---
title: stack comments seal
sidebar_position: 41
sidebar_position: 52
---
# `stack comments seal`

View File

@@ -1,6 +1,6 @@
---
title: stack comments stats
sidebar_position: 39
sidebar_position: 50
---
# `stack comments stats`

View File

@@ -1,6 +1,6 @@
---
title: stack comments unseal
sidebar_position: 42
sidebar_position: 53
---
# `stack comments unseal`

View File

@@ -1,6 +1,6 @@
---
title: stack comments
sidebar_position: 36
sidebar_position: 47
---
# `stack comments`

View File

@@ -1,6 +1,6 @@
---
title: stack db comment
sidebar_position: 59
sidebar_position: 70
---
# `stack db comment`

View File

@@ -1,6 +1,6 @@
---
title: stack db inspect
sidebar_position: 60
sidebar_position: 71
---
# `stack db inspect`

View File

@@ -1,6 +1,6 @@
---
title: stack db
sidebar_position: 58
sidebar_position: 69
---
# `stack db`

View File

@@ -1,6 +1,6 @@
---
title: stack docs build
sidebar_position: 62
sidebar_position: 73
---
# `stack docs build`

View File

@@ -1,6 +1,6 @@
---
title: stack docs generate
sidebar_position: 64
sidebar_position: 75
---
# `stack docs generate`

View File

@@ -1,6 +1,6 @@
---
title: stack docs serve
sidebar_position: 63
sidebar_position: 74
---
# `stack docs serve`

View File

@@ -1,6 +1,6 @@
---
title: stack docs
sidebar_position: 61
sidebar_position: 72
---
# `stack docs`

View File

@@ -1,6 +1,6 @@
---
title: stack generate models
sidebar_position: 10
sidebar_position: 21
---
# `stack generate models`

View File

@@ -1,6 +1,6 @@
---
title: stack generate
sidebar_position: 9
sidebar_position: 20
---
# `stack generate`

View File

@@ -1,6 +1,6 @@
---
title: stack lake deploy
sidebar_position: 44
sidebar_position: 55
---
# `stack lake deploy`

View File

@@ -1,6 +1,6 @@
---
title: stack lake load
sidebar_position: 45
sidebar_position: 56
---
# `stack lake load`

View File

@@ -1,6 +1,6 @@
---
title: stack lake parity
sidebar_position: 47
sidebar_position: 58
---
# `stack lake parity`

View File

@@ -1,6 +1,6 @@
---
title: stack lake validate
sidebar_position: 46
sidebar_position: 57
---
# `stack lake validate`

View File

@@ -1,6 +1,6 @@
---
title: stack lake
sidebar_position: 43
sidebar_position: 54
---
# `stack lake`

View File

@@ -1,6 +1,6 @@
---
title: stack llm eval-tags
sidebar_position: 55
sidebar_position: 66
---
# `stack llm eval-tags`

View File

@@ -1,6 +1,6 @@
---
title: stack llm hosts
sidebar_position: 51
sidebar_position: 62
---
# `stack llm hosts`

View File

@@ -1,6 +1,6 @@
---
title: stack llm index
sidebar_position: 49
sidebar_position: 60
---
# `stack llm index`

View File

@@ -1,6 +1,6 @@
---
title: stack llm prune-rules
sidebar_position: 56
sidebar_position: 67
---
# `stack llm prune-rules`

View File

@@ -1,6 +1,6 @@
---
title: stack llm restamp
sidebar_position: 50
sidebar_position: 61
---
# `stack llm restamp`

View File

@@ -1,6 +1,6 @@
---
title: stack llm serve
sidebar_position: 52
sidebar_position: 63
---
# `stack llm serve`

View File

@@ -1,6 +1,6 @@
---
title: stack llm stamp-themes
sidebar_position: 57
sidebar_position: 68
---
# `stack llm stamp-themes`

View File

@@ -1,6 +1,6 @@
---
title: stack llm tag
sidebar_position: 54
sidebar_position: 65
---
# `stack llm tag`

View File

@@ -1,6 +1,6 @@
---
title: stack llm vocab
sidebar_position: 53
sidebar_position: 64
---
# `stack llm vocab`

View File

@@ -1,6 +1,6 @@
---
title: stack llm
sidebar_position: 48
sidebar_position: 59
---
# `stack llm`

View File

@@ -1,6 +1,6 @@
---
title: stack mail attach-smarthost
sidebar_position: 107
sidebar_position: 118
---
# `stack mail attach-smarthost`

View File

@@ -1,6 +1,6 @@
---
title: stack mail dkim-export
sidebar_position: 106
sidebar_position: 117
---
# `stack mail dkim-export`

View File

@@ -1,6 +1,6 @@
---
title: stack mail dns
sidebar_position: 105
sidebar_position: 116
---
# `stack mail dns`

View File

@@ -1,6 +1,6 @@
---
title: stack mail down
sidebar_position: 103
sidebar_position: 114
---
# `stack mail down`

View File

@@ -1,6 +1,6 @@
---
title: stack mail provision
sidebar_position: 101
sidebar_position: 112
---
# `stack mail provision`

View File

@@ -1,6 +1,6 @@
---
title: stack mail rotate-creds
sidebar_position: 108
sidebar_position: 119
---
# `stack mail rotate-creds`

View File

@@ -1,6 +1,6 @@
---
title: stack mail seed-mailboxes
sidebar_position: 109
sidebar_position: 120
---
# `stack mail seed-mailboxes`

View File

@@ -1,6 +1,6 @@
---
title: stack mail status
sidebar_position: 104
sidebar_position: 115
---
# `stack mail status`

View File

@@ -1,6 +1,6 @@
---
title: stack mail up
sidebar_position: 102
sidebar_position: 113
---
# `stack mail up`

View File

@@ -1,6 +1,6 @@
---
title: stack mail wire-git
sidebar_position: 110
sidebar_position: 121
---
# `stack mail wire-git`

View File

@@ -1,6 +1,6 @@
---
title: stack mail
sidebar_position: 100
sidebar_position: 111
---
# `stack mail`

View File

@@ -1,6 +1,6 @@
---
title: stack perf show
sidebar_position: 68
sidebar_position: 79
---
# `stack perf show`

View File

@@ -1,6 +1,6 @@
---
title: stack perf
sidebar_position: 67
sidebar_position: 78
---
# `stack perf`

View File

@@ -1,6 +1,6 @@
---
title: stack pfs cpt-ingest
sidebar_position: 82
sidebar_position: 93
---
# `stack pfs cpt-ingest`

View File

@@ -1,6 +1,6 @@
---
title: stack pfs elements
sidebar_position: 74
sidebar_position: 85
---
# `stack pfs elements`

View File

@@ -1,6 +1,6 @@
---
title: stack pfs exposure
sidebar_position: 79
sidebar_position: 90
---
# `stack pfs exposure`

View File

@@ -1,6 +1,6 @@
---
title: stack pfs families
sidebar_position: 76
sidebar_position: 87
---
# `stack pfs families`

View File

@@ -1,6 +1,6 @@
---
title: stack pfs guidance
sidebar_position: 77
sidebar_position: 88
---
# `stack pfs guidance`

View File

@@ -1,6 +1,6 @@
---
title: stack pfs lineage
sidebar_position: 75
sidebar_position: 86
---
# `stack pfs lineage`

View File

@@ -1,6 +1,6 @@
---
title: stack pfs reaction
sidebar_position: 78
sidebar_position: 89
---
# `stack pfs reaction`

View File

@@ -1,6 +1,6 @@
---
title: stack pfs review
sidebar_position: 81
sidebar_position: 92
---
# `stack pfs review`

View File

@@ -1,6 +1,6 @@
---
title: stack pfs utilization
sidebar_position: 80
sidebar_position: 91
---
# `stack pfs utilization`

View File

@@ -1,6 +1,6 @@
---
title: stack pfs
sidebar_position: 73
sidebar_position: 84
---
# `stack pfs`

View File

@@ -1,6 +1,6 @@
---
title: stack prisma eligible
sidebar_position: 94
sidebar_position: 105
---
# `stack prisma eligible`

View File

@@ -1,6 +1,6 @@
---
title: stack prisma export
sidebar_position: 91
sidebar_position: 102
---
# `stack prisma export`

View File

@@ -1,6 +1,6 @@
---
title: stack prisma extract
sidebar_position: 95
sidebar_position: 106
---
# `stack prisma extract`

View File

@@ -1,6 +1,6 @@
---
title: stack prisma fetch
sidebar_position: 97
sidebar_position: 108
---
# `stack prisma fetch`

View File

@@ -1,6 +1,6 @@
---
title: stack prisma flow
sidebar_position: 96
sidebar_position: 107
---
# `stack prisma flow`

View File

@@ -1,6 +1,6 @@
---
title: stack prisma init
sidebar_position: 90
sidebar_position: 101
---
# `stack prisma init`

View File

@@ -1,6 +1,6 @@
---
title: stack prisma ping-llm
sidebar_position: 92
sidebar_position: 103
---
# `stack prisma ping-llm`

View File

@@ -1,6 +1,6 @@
---
title: stack prisma run
sidebar_position: 98
sidebar_position: 109
---
# `stack prisma run`

Some files were not shown because too many files have changed in this diff Show More