|
| 1 | +# AGENTS.md Line‑by‑Line Audit (2025‑09‑17) |
| 2 | + |
| 3 | +This audit maps each claim in AGENTS.md to concrete code, files, or behaviors in the repository. Status values: |
| 4 | +- VERIFIED — implemented and matched |
| 5 | +- PARTIAL — implemented with gaps noted |
| 6 | +- DRIFT — statement differs from current code; delta called out |
| 7 | +- MISSING — planned or stated but not present |
| 8 | + |
| 9 | +References use clickable file paths with single start lines per CLI rules. |
| 10 | + |
| 11 | +## Identity & Scope |
| 12 | +- Name “Faxbot” and “faxbot‑mcp” only — VERIFIED |
| 13 | + - Evidence: api/admin_ui/src/App.tsx:321, sdks/node/README.md:22, sdks/python/README.md:22 |
| 14 | + - No “OpenFax”/“twilio‑fax” in code. Note: api/CHANGELOG.md mentions rename only (contextual). |
| 15 | +- Production/PHI intent — VERIFIED (controls present) |
| 16 | + - HTTPS enforcement, HMAC verification, auth, no secret logging in UI; see api/app/config.py:71, api/app/main.py:2321, api/admin_ui/src/components/JobsList.tsx:262 |
| 17 | + |
| 18 | +## Architecture (v3 Plugins + Backends) |
| 19 | +- v3 plugin runtime + config store — VERIFIED |
| 20 | + - Runtime: api/app/plugins/http_provider.py:51, api/app/plugins/http_provider.py:218 |
| 21 | + - Config store: api/app/plugins/config_store.py:24 |
| 22 | + - Endpoints (feature‑gated): /plugins, /plugins/{id}/config, /plugin‑registry |
| 23 | + - api/app/main.py:3203, api/app/main.py:3210, api/app/main.py:3337 |
| 24 | + - Config path env: api/app/config.py:161 (FAXBOT_CONFIG_PATH) |
| 25 | +- Multiple backends via plugins/providers — VERIFIED |
| 26 | + - Phaxio: api/app/phaxio_service.py:1, cloud flow in main send path api/app/main.py:2038 |
| 27 | + - Sinch: api/app/sinch_service.py:1, api/app/main.py:2045 |
| 28 | + - SignalWire (preview): api/app/signalwire_service.py:1, callback api/app/main.py:3351 |
| 29 | + - SIP/Asterisk: AMI originate api/app/ami.py:1, api/app/main.py:2108 |
| 30 | + - FreeSWITCH (preview): originate helpers api/app/freeswitch_service.py:1, result hook api/app/main.py:3406 |
| 31 | +- AI integration (MCP Node + Python) — VERIFIED |
| 32 | + - Node stdio/http/sse/ws: node_mcp/src/servers/stdio.js:3, node_mcp/src/servers/http.js:15, node_mcp/src/servers/sse.js:7, node_mcp/src/servers/ws.js:7 |
| 33 | + - Python stdio/SSE: python_mcp/stdio_server.py:1, python_mcp/server.py:1 |
| 34 | + - Notes about legacy: no api/mcp_*.js present — VERIFIED by absence |
| 35 | +- SDKs (Node + Python) with identical API — VERIFIED (v1.1.0) |
| 36 | + - Versions: sdks/node/package.json:3, sdks/python/setup.py:18 |
| 37 | + - API surface: sdks/node/index.js:27, sdks/python/faxbot/__init__.py:30 |
| 38 | + - OpenAPI source at /openapi.json via FastAPI: api/app/main.py:45 |
| 39 | + |
| 40 | +## Admin Console First (GUI Mandate) |
| 41 | +- All capabilities operable via Admin Console — PARTIAL |
| 42 | + - Send, Jobs, Inbound, Settings, Keys, Diagnostics, Logs — present: api/admin_ui/src/App.tsx:367 |
| 43 | + - Scripts & Tests (backend‑aware) — present but missing Sinch/SignalWire/FreeSWITCH helpers (see below) |
| 44 | + - Admin Actions (allowlisted checks) — present: api/app/main.py:1279, api/admin_ui/src/components/ScriptsTests.tsx:281 |
| 45 | +- Contextual help + docs links use docs base — VERIFIED |
| 46 | + - Admin config exposes docs base: api/app/main.py:502, api/app/main.py:517 |
| 47 | + - UI consumes docs_base: api/admin_ui/src/App.tsx:452 |
| 48 | +- Backend isolation in UI — PARTIAL |
| 49 | + - Scripts & Tests and Diagnostics show backend‑specific info: api/admin_ui/src/components/ScriptsTests.tsx:269, api/admin_ui/src/components/Diagnostics.tsx:553 |
| 50 | + - Missing helper cards for Sinch/SignalWire/FreeSWITCH (see TODO) |
| 51 | +- Mobile‑first polish — PARTIAL |
| 52 | + - Responsive tabs/breakpoints: api/admin_ui/src/App.tsx:351 |
| 53 | + - Some components still need compact copy and spacing review (UX polish task) |
| 54 | + |
| 55 | +## v3 UI Additions |
| 56 | +- Plugins tab (feature‑gated) — VERIFIED |
| 57 | + - UI gating: api/admin_ui/src/App.tsx:447 |
| 58 | + - Server gating: api/app/main.py:3339 |
| 59 | +- Curated registry search — VERIFIED |
| 60 | + - Endpoint: /plugin‑registry: api/app/main.py:3337 |
| 61 | +- Contextual help per provider — PARTIAL |
| 62 | + - Present in PluginConfigDialog: api/admin_ui/src/components/PluginConfigDialog.tsx:56, 79, 97 |
| 63 | +- Scripts & Tests + Terminal — VERIFIED/PARTIAL |
| 64 | + - Terminal present: api/admin_ui/src/components/Terminal.tsx:17; WS: api/app/main.py:3442 |
| 65 | + - Scripts & Tests present but helper coverage incomplete (no Sinch/SignalWire/FreeSWITCH cards): api/admin_ui/src/components/ScriptsTests.tsx:250 |
| 66 | + |
| 67 | +## Acceptance Criteria (per screen) |
| 68 | +- Inline explanations and a docs link — PARTIAL |
| 69 | + - Many components include captions/tooltips; ensure each field follows through (spot‑check OK) |
| 70 | +- Validation and helpful errors — PARTIAL |
| 71 | + - API returns structured HTTP errors; some UI flows surface messages (e.g., Diagnostics), but missing targeted remediation links in Jobs detail |
| 72 | +- Jobs failures surface troubleshooting links — MISSING |
| 73 | + - JobsList modal lacks backend‑specific remediation links: api/admin_ui/src/components/JobsList.tsx:274 |
| 74 | + |
| 75 | +## Provider Backends |
| 76 | +- Phaxio (Cloud) — VERIFIED |
| 77 | + - Env: AGENTS matches config keys; settings: api/app/config.py:64–76 |
| 78 | + - Send path uses PDF URL token: api/app/main.py:2376, api/app/main.py:2260 |
| 79 | + - HMAC callback verification: api/app/main.py:2319 |
| 80 | +- SIP/Asterisk (Self‑Hosted) — VERIFIED |
| 81 | + - AMI config envs: api/app/config.py:51–55 |
| 82 | + - TIFF conversion for SIP: api/app/main.py:2064 |
| 83 | + - Internal inbound endpoint with secret: api/app/main.py:2747 |
| 84 | +- Sinch Fax v3 — VERIFIED (send; inbound present) |
| 85 | + - Settings: api/app/config.py:77–83, inbound auth: api/app/config.py:129–131 |
| 86 | + - Inbound handler: api/app/main.py:2955 |
| 87 | +- SignalWire (Cloud, preview) — VERIFIED (callback path) |
| 88 | + - Service: api/app/signalwire_service.py:1; callback: api/app/main.py:3351 |
| 89 | +- FreeSWITCH (Self‑Hosted, preview) — VERIFIED (result hook) |
| 90 | + - FS service helpers: api/app/freeswitch_service.py:1; result hook: api/app/main.py:3406 |
| 91 | + |
| 92 | +## MCP Integration |
| 93 | +- Transports listed and implemented — VERIFIED |
| 94 | + - Node stdio/http/sse/ws refs above; Python stdio/SSE refs above |
| 95 | +- Limits: HTTP JSON 16 MB — VERIFIED: node_mcp/src/servers/http.js:15 |
| 96 | +- Stdio preferred for filePath — POLICY documented; acceptable |
| 97 | + |
| 98 | +## SDKs |
| 99 | +- Identical error mapping and health check — VERIFIED |
| 100 | + - Node: sdks/node/index.js:27 |
| 101 | + - Python: sdks/python/faxbot/__init__.py:30 |
| 102 | +- Version 1.1.0 — VERIFIED |
| 103 | + |
| 104 | +## Auth & API Keys |
| 105 | +- Multi‑key auth with fbk_live_* tokens — VERIFIED |
| 106 | + - Create/list/delete/rotate: api/app/main.py:2142, 2155, 2161, 2174 |
| 107 | + - Scope enforcement: api/app/main.py:447–470, 2653–2671 |
| 108 | +- Set REQUIRE_API_KEY for prod; bootstrap via env API_KEY — VERIFIED: api/app/config.py:45, api/app/main.py:420 |
| 109 | + |
| 110 | +## HIPAA vs Non‑HIPAA Config |
| 111 | +- Strict settings available (HTTPS, HMAC, audit logs) — VERIFIED |
| 112 | + - Enforce HTTPS flag: api/app/config.py:46, used in health/diagnostics: api/app/main.py:1614 |
| 113 | + - Audit hooks present: api/app/audit.py:1; audit_event usages across main |
| 114 | +- Relaxed dev profile — VERIFIED via defaults (require_api_key optional, OAuth optional) |
| 115 | + |
| 116 | +## Inbound Receiving |
| 117 | +- Enable with INBOUND_ENABLED — VERIFIED: api/app/config.py:117 |
| 118 | +- Endpoints: list/get/pdf — VERIFIED: api/app/main.py:2673, 2693, 2704 |
| 119 | +- Cloud callbacks: Phaxio+Sinch — VERIFIED: api/app/main.py:2826, 2955 |
| 120 | +- Storage backends local|s3 (SSE‑KMS) — VERIFIED: api/app/storage.py:54–60 |
| 121 | +- Retention/TTL defaults — VERIFIED: api/app/config.py:125, 142–143 |
| 122 | +- Idempotency on (provider_sid, event_type) — VERIFIED: api/app/db.py:98 |
| 123 | +- UI coverage for inbound — PARTIAL |
| 124 | + - Inbound.tsx present; needs full PHI warnings/KMS hints review: api/admin_ui/src/components/Inbound.tsx:1 |
| 125 | + |
| 126 | +## Key API Endpoints & Workflows |
| 127 | +- Core endpoints — VERIFIED |
| 128 | + - /fax send: api/app/main.py:1970; /fax/{id}: api/app/main.py:2133; /fax/{id}/pdf tokenized: api/app/main.py:2260 |
| 129 | + - /phaxio‑callback: api/app/main.py:2315; /health: api/app/main.py:296 |
| 130 | +- Admin Console surface (must‑haves) — PARTIAL |
| 131 | + - Settings/Diagnostics/Jobs/Keys/Inbound/Plugins present; ensure every field has helper text + docs link consistently (spot‑check OK) |
| 132 | + |
| 133 | +## Plugins (v3) |
| 134 | +- Feature flags — VERIFIED: api/app/config.py:160–162; server checks: api/app/main.py:3339 |
| 135 | +- HTTP manifest runtime — VERIFIED: api/app/plugins/http_provider.py:105 |
| 136 | +- Admin endpoints validate/install manifests — VERIFIED: api/app/main.py:1086, 1112 |
| 137 | +- Security defaults (HIPAA) — PARTIAL |
| 138 | + - Allowed domains/timeouts implemented in runtime; redaction policy is TODO |
| 139 | + |
| 140 | +## Security Architecture |
| 141 | +- Threat model addressed by controls — VERIFIED/PARTIAL |
| 142 | + - No PHI in UI logs; UI masks numbers (JobsList) — VERIFIED: api/admin_ui/src/components/JobsList.tsx:262 |
| 143 | +- Webhook verification — VERIFIED where supported (Phaxio HMAC; Sinch Basic only): api/app/main.py |
| 144 | + - Local‑only Admin UI gate — VERIFIED: api/app/main.py:158–175 |
| 145 | + - Terminal WS auth (env key or DB admin key) — VERIFIED: api/app/main.py:3445–3466 |
| 146 | + - Note: Terminal WS itself is not IP‑restricted; guidance remains to keep Admin local only |
| 147 | + |
| 148 | +## Testing Strategy & Validation |
| 149 | +- Backend matrix present in docs — VERIFIED: docs/V3_PHASE_STATUS.md:19, docs/API_TESTS.md:1 |
| 150 | +- API tests exist for core + Phaxio — VERIFIED: api/tests/test_api.py:1, api/tests/test_phaxio.py:1 |
| 151 | +- MISSING tests for Admin Actions and Terminal WS (see TODO) |
| 152 | + |
| 153 | +## Deployment Considerations |
| 154 | +- Docker compose services/ports — VERIFIED: docker-compose.yml:3 |
| 155 | +- Production guidance mirrors docs — VERIFIED: docs/DEPLOYMENT.md:1 |
| 156 | + |
| 157 | +## Admin Console: Terminal |
| 158 | +- UI component + WS endpoint — VERIFIED: api/admin_ui/src/components/Terminal.tsx:17; api/app/main.py:3442 |
| 159 | +- Local‑only and auth gating — VERIFIED/PARTIAL (UI gate is local‑only; WS relies on admin key) |
| 160 | +- Docs page exists — VERIFIED: docs/TERMINAL.md:1 |
| 161 | + |
| 162 | +## Admin Console: Scripts & Tests |
| 163 | +- Backend‑aware quick actions — PARTIAL |
| 164 | + - Present for Phaxio and SIP; MISSING for Sinch/SignalWire/FreeSWITCH: api/admin_ui/src/components/ScriptsTests.tsx:250 |
| 165 | +- Container checks allowlist — VERIFIED: api/app/main.py:1279; UI: api/admin_ui/src/components/ScriptsTests.tsx:281 |
| 166 | +- Concurrency lock between cards — VERIFIED: per‑card busy flags: api/admin_ui/src/components/ScriptsTests.tsx:55–57 |
| 167 | + |
| 168 | +## Docs & Linking |
| 169 | +- Jekyll docs for scripts/tests and MCP — VERIFIED: docs/scripts-and-tests.md:9, docs/NODE_MCP_SCRIPTS.md:11 |
| 170 | +- All links derive from DOCS_BASE_URL in UI — VERIFIED: api/app/main.py:517; ui usage: api/admin_ui/src/App.tsx:452 |
| 171 | +- Remove Plugin Builder references from docs — VERIFIED (no mentions in docs search) |
| 172 | + |
| 173 | +## Common Pitfalls |
| 174 | +- Avoid backend mixing in UI/docs — PARTIAL (helpers still missing for some backends; mixing not observed) |
| 175 | + |
| 176 | +## Final Reminders vs Code |
| 177 | +- Phaxio implementation complete — VERIFIED |
| 178 | +- AMI must not be public — VERIFIED guidance in docker-compose.yml:39, docs/DEPLOYMENT.md:1 |
| 179 | +- OAuth optional for non‑PHI — VERIFIED: api/app/config.py:151 |
| 180 | + |
| 181 | +--- |
| 182 | + |
| 183 | +## Notable Gaps (added to TODO.md) |
| 184 | +- Scripts & Tests: add Sinch, SignalWire, FreeSWITCH helper cards and backend‑specific guidance in UI. |
| 185 | +- Jobs detail: add backend‑aware troubleshooting links and docs anchors for failed jobs. |
| 186 | +- Tests: add coverage for /admin/actions and /admin/terminal WS auth/behavior. |
| 187 | +- Redaction policy for manifest providers (response/request snippets) to avoid secret leakage in Admin UI. |
| 188 | +- Minor: Replace onKeyPress in App login with onKeyDown for broader browser compatibility. |
| 189 | +- Optional: Add explicit local‑network guardrails note in Terminal UI and surface ENABLE_LOCAL_ADMIN state. |
| 190 | + |
| 191 | +## Out‑of‑Repo Notes |
| 192 | +- Vendor admin demo (faxbot.net) parity validated separately; not present in this repo. Ensure nav grouping, Scripts & Tests, Terminal seeding, and Plugins demo mirror current Admin Console. |
0 commit comments