README.md · cd58150rx codemap
In this document
Checked against main through cd58150 (Oct 11, 2026); not verified production behavior.
Scope: committed main only. Untracked working-tree files (for example notifier/, ops/adk_fill_agent/,
ops/email_actions/, claude.md, RxVerify iPad.dc.html) are not described.
Everything comes from reading source and checked-in config. Unit files, plists and docs show intended config, not
what is loaded or running; deployed state needs a runtime check (cloud/RUNTIME.md,
docs/OPERATIONS.md, AGENTS.md). No Fast, SQL, MCP or remote system was
contacted. More detail: the code wiki docs/local-wiki/.
What this repository is
Pharmacy automation around the Liberty/PharmacyOne pharmacy system (SQL Server S013529 / RxqLAnsePharmacy).
Three core services and one worker command:
| Piece | Entry point | Role |
|---|---|---|
| Fast | fast/pharmacy_fast_server.py |
Loopback HTTP API on :8792. /v1/run named actions, /v1/case worker gateway, ADD-billing thread |
| Drasi (not in this repo) | /srv/rx-runtime/drasi/launch.py per cloud/runtime/rx-drasi.service |
CDC event feed that writes escript-lifecycle.ndjson |
| Launcher | launch.py |
Tails the CDC file and starts entry, then audit, then decision workers |
| Worker | launch.sh + tools.mjs + tracing/index.mjs |
One Pi run bound to one case. Every tool is one POST to /v1/case |
Around them: a scanner library used for entry (scanner/), billing runners and PharmacyOne tools on
the WS3 guest VM (ops/windows/), operator tools and Mac pollers (ops/), an
iPad/iPhone app with a Mac relay and a cloud delivery relay (ios/), cloud runtime config
(cloud/), and tests (tests/).
View diagram source
flowchart LR
subgraph Liberty["Liberty SQL Server (external)"]
SQL[(RxqLAnsePharmacy)]
end
Drasi["Drasi CDC (external code)"] -->|escript-lifecycle.ndjson| L[launch.py]
L -->|"launch.sh kind script event escript"| W["Pi worker<br/>tools.mjs + tracing/index.mjs"]
W -->|"POST /v1/case"| G[case_gateway.Cases]
L -->|"POST /v1/case owner / decision_retry / worker_retry / source_classification"| G
G -->|"core.run(action=...)"| C[pharmacy_fast_core.PharmacyFast]
G -->|"entry.propose / create"| E[entry.py + scanner/]
G -->|"bill(...) on committed ADD"| B[add_billing.Biller]
B -->|"ssh + scheduled task"| VM["WS3 guest VM<br/>native_quick_fill (default)<br/>or manual_quick_fill.py (ui)"]
C -->|liberty_conn.Session| SQL
E -->|pymssql direct| SQL
B -->|"quick_fill_billing (SQL reads)"| C
Pi2["Interactive Pi<br/>.pi/extensions/fast.ts"] -->|"POST /v1/run"| S[pharmacy_fast_server.Handler]
S --> C
S --> G
VM --> SQLPages
| Page | Answers |
|---|---|
| architecture.md | Directory map, service boundaries, data stores, external dependencies, Mac versus cloud |
| fast.md | Fast HTTP surfaces, auth, the action dispatcher, named actions, write gate, tracking our changes, SQL session |
| case-gateway.md | /v1/case: case kinds, tool allowlists, write tokens, finish rules, invariants, launcher ops |
| lifecycle.md | Launcher dispatch, entry, audit and decision lifecycle, retries, replay/requeue, Pi harness, prompts |
| scanner.md | Shared scanner logic used by entry (entry.py); the legacy scanner loop was removed Oct 11 |
| billing.md | ADD billing (native and UI runners), claim reconciliation, manual and native billing tools |
| tracing.md | LangSmith tracing boundaries, privacy projection, watch tools, observability |
| ops-runtime.md | cloud/, launchd/, ops/ tools, Mac pollers, WS3 guest tools, Mac versus cloud runtime |
| clients.md | iOS apps, Mac relay and cloud delivery relay (ios/Server); the web UIs and pilots were removed Oct 11 |
| tests.md | Test layout, which tests cover which module, how to run them |
| change-guide.md | "I want to change X": which files to read first |
| coverage.md | What was checked or excluded, doc/code contradictions, open questions |
Start here
- Where does a new prescription start? In the Drasi CDC line, which reaches
launch.pymain, thenrun_workerandlaunch.sh. See lifecycle.md. - Where are the worker's rules enforced? In
fast/case_gateway.py, in code, not prompt text. See case-gateway.md. - Where is a Fast action implemented? Start at
PharmacyFast.run, which routes topharmacy_fast_*.pymodules. See fast.md. - What happens after a worker commits ADD?
add_billing.Biller. See billing.md. - How do I answer a pharmacy-data question? Read
fast/READING.mdanddocs/domain/. This codemap is about code, not data.
Legend used on every page
| Tag | Meaning |
|---|---|
| Source | Read directly in the cited file and line |
| Inference | Reasoned from source; not stated outright |
| Legacy/disabled | Code kept, but source or docs say it is not on the current path |
| Pilot/experimental | Prototype, spike or no-submit experiment |
| Local config | Plist, unit file or env default in the repo. Says nothing about what is loaded |
| Needs runtime check | Only a live readback can settle it |
Links are relative to docs/codemap/. #L<n> anchors point at the line where the symbol is defined on main at the
SHA above. Line numbers will drift as the tree changes.