Warning, /swf-monitor/CLAUDE.md is written in an unsupported language. File is not indexed.
0001 # swf-monitor — Claude Code Guidelines
0002
0003 Django web app, REST API, MCP server, PCS (Physics Configuration System), and the
0004 ePIC production-operations agent, for the ePIC streaming-workflow testbed. Part of
0005 the SWF core (coordinated branches with `swf-testbed` and `swf-common-lib`).
0006 Shared workspace rules — doc-first, git policy, environment — live in the
0007 workspace `../CLAUDE.md`. This file is the repo's doc index and the one pattern
0008 every designer/implementer should hold in mind.
0009
0010 The workspace rule "Stay Within Scope Without Stopping" is mandatory here:
0011 do not overreach beyond the requested change, and do not respond to a scope
0012 correction by stopping or discarding the requested work. Keep the valid part,
0013 remove only the unauthorized part, and continue inside the clarified boundary.
0014
0015 ## Key pattern — credentialed async action with live browser push
0016
0017 We are building a live, automated, responsive production system. The standard way
0018 to add a credentialed, slow, or hang-prone capability is the prod-ops agent
0019 pattern — not a poller, not a blocking request, and never a credential in the web
0020 tier:
0021
0022 > a new `_handle_<msg_type>` + a `run_in_background` doer (the agent holds the
0023 > Rucio / PanDA / xrootd credentials) + a completion event on `/topic/epictopic` +
0024 > an `EventSource` on the triggering page → the action fires server-side and the
0025 > result is pushed to the browser the instant it is done — internally, and (via
0026 > the swf-remote streaming proxy) to remote collaborators.
0027
0028 Worked examples: payload-log fetch and PanDA submit. Read before designing any
0029 production-ops feature: **`docs/EPICPROD_OPS_AGENT.md`** (the agent and the
0030 pattern) and **`docs/SSE_PUSH.md`** (the browser push).
0031
0032 ## Doc index (`docs/`)
0033
0034 - `EPICPROD_OPS_AGENT.md` — the credentialed ops agent; capability model + the pattern above.
0035 - `EPICPROD_OPS.md` — ops runbook (submit, monitor, logs, systemd unit, cleaner-killer).
0036 - `SSE_PUSH.md` — browser push of agent action completion (design).
0037 - `SSE_RELAY.md` — the ActiveMQ → remote SSE relay this builds on.
0038 - `PCS.md`, `PCS_DATASET_REQUEST_WORKFLOW.md`, `EPICPROD_TASK_CATALOG.md` — Physics Configuration System and the production task catalog.
0039 - `EPICPROD_QUESTIONNAIRE.md` — ingest the PWG/DSC production-request Google Form into a PCS Questionnaire entity; public browser, request linkage.
0040 - `EPICPROD_DATA_LINEAGE.md` — gather produced-dataset Rucio refs onto the catalog; reference + xrootd access.
0041 - `EPICPROD_EVGEN_INPUTS.md` — assimilate JLab Rucio EVGEN inputs onto the catalog; the request↔Rucio input matcher and its (un)match gaps.
0042 - `JEDI_INTEGRATION.md` — PCS → JEDI/PanDA submission design.
0043 - `PRODUCTION_DEPLOYMENT.md` — deploying swf-monitor.
0044 - `COMMISSIONING_RELAXATIONS.md` — alpha tag-lock/submission loosenings and exactly how to re-tighten each.
0045 - `API_REFERENCE.md`, `MCP.md` — REST and MCP surfaces.
0046
0047 ## Deploy
0048
0049 `sudo bash deploy-swf-monitor.sh branch <current infra/baseline-vNN>` — pulls from
0050 git, so commit + push first. Run it in the foreground.