|
| 1 | +# Copilot Instructions for This Repository |
| 2 | + |
| 3 | +## Project scope |
| 4 | + |
| 5 | +This repository is a Python sample for consuming LSEG Machine Readable News over WebSocket connections. |
| 6 | + |
| 7 | +- `mrn_console_rtds.py` is the RTDS console example. |
| 8 | +- `mrn_console_rto_v2.py` is the RTO version 2 authentication console example. |
| 9 | +- `notebook/` contains notebook variants of the same workflows. |
| 10 | + |
| 11 | +## Working rules |
| 12 | + |
| 13 | +- Keep changes small and targeted. This repo is a sample application, not a framework. |
| 14 | +- Preserve the existing separation between RTDS and RTO flows unless the task explicitly requires combining them. |
| 15 | +- Prefer straightforward standard-library Python solutions unless the repository already depends on a package for the task. |
| 16 | +- Match the existing script style in the file you are editing. Do not reformat unrelated code. |
| 17 | + |
| 18 | +## Files to avoid editing |
| 19 | + |
| 20 | +- Do not modify files under `mrn_python/`. This directory is a checked-in virtual environment and vendored dependency tree. |
| 21 | +- Do not edit files under `mrn_python/Lib/site-packages/` to change application behavior. |
| 22 | +- Only update dependency files such as `requirements.txt` or `requirements_notebook.txt` when the task actually requires a new dependency or a version change. |
| 23 | + |
| 24 | +## Configuration and secrets |
| 25 | + |
| 26 | +- Never hardcode credentials, tokens, hostnames, or customer-specific identifiers. |
| 27 | +- For RTO version 2 configuration, follow the `.env` pattern shown in `.env.example`. |
| 28 | +- If configuration changes are needed, update `.env.example` and `README.md` together when appropriate. |
| 29 | + |
| 30 | +## Python and runtime expectations |
| 31 | + |
| 32 | +- Target Python 3.10 compatibility unless the task explicitly requires something else. |
| 33 | +- Keep console output compatible with the repository's current UTF-8 handling. |
| 34 | +- MRN payload handling depends on base64 decoding and gzip/zlib decompression. Preserve that behavior and be careful around fragment assembly logic. |
| 35 | + |
| 36 | +## Validation guidance |
| 37 | + |
| 38 | +- For changes in Python scripts, prefer narrow validation such as `python -m py_compile <file>`. |
| 39 | +- If documentation changes affect setup or execution, keep command examples consistent with `README.md`, `Dockerfile`, and the current entry scripts. |
| 40 | + |
| 41 | +## Documentation expectations |
| 42 | + |
| 43 | +- Keep README changes aligned with the actual file layout in this repo. |
| 44 | +- Use the existing terminology from the project: RTDS, RTO, MRN, fragment assembly, and WebSocket API. |
| 45 | +- When adding new instructions, prefer practical run steps over broad background material. |
0 commit comments