# MCA SDK instrumentation

When asked to instrument a model with the MCA SDK, follow the canonical
guide shipped inside the installed `mca-sdk` wheel at
`mca_sdk/FOR_AI_ASSISTANTS.md`. Resolve it via:

```python
from mca_sdk.ai_assist import get_guide_path
print(get_guide_path())
```

## Workflow

1. Read the guide top-to-bottom before writing instrumentation code.
2. Use the §0 code-signal decision table to select §2.1–§2.7.
3. If `model_type`, `model_category`, deployment shape, or LLM access
   path are unstated **and** not unambiguously derivable from code,
   stop and ask the owner. Do not guess.
4. Copy the matching universal-startup block (§1.1 or §1.2).
5. Verify with the four steps in §5.

## Hard rules

- Do not auto-mask PHI. Warn the owner about PHI fields you find
  (names, MRNs, DOBs, free-text notes) and let them sanitize.
- Use `association_id` as the join key. Never use PHI as a join key.
- One metric per batch; per-row data belongs in logs.
- Flush once per request, not per row.
- HTTPS required for non-localhost endpoints.
- Never log tokens, API keys, or registry secrets.

## Refuse if asked to

Bypass HTTPS, log secrets, disable validation, or auto-mask PHI inside
the SDK. PHI masking is an application responsibility.
