@@ -19,6 +19,35 @@ Pychron is a long-lived scientific application with mixed concerns:
1919
2020Favor conservative, low-regression changes over broad rewrites.
2121
22+ Repo Map
23+ ========
24+
25+ Start with the user-facing subsystem and only expand outward as needed.
26+
27+ - application/bootstrap and plugin wiring:
28+ - ` launchers/ `
29+ - ` pychron/applications `
30+ - ` pychron/envisage `
31+ - experiment execution and scripting:
32+ - ` pychron/experiment `
33+ - ` pychron/pyscripts `
34+ - data reduction, processing, and pipeline work:
35+ - ` pychron/pipeline `
36+ - ` pychron/processing `
37+ - DVC and repository-backed persistence:
38+ - ` pychron/dvc `
39+ - hardware, instruments, and control surfaces:
40+ - ` pychron/hardware `
41+ - ` pychron/lasers `
42+ - ` pychron/extraction_line `
43+ - ` pychron/spectrometer `
44+ - ` pychron/furnace `
45+ - shared foundations used across many subsystems:
46+ - ` pychron/core `
47+ - ` pychron/database `
48+ - ` pychron/paths.py `
49+ - ` pychron/globals.py `
50+
2251Working Rules
2352=============
2453
@@ -28,28 +57,69 @@ Working Rules
2857- Expect the repo to contain legacy modules, experimental files, and partial
2958 migrations; patch the active path you are changing instead of trying to
3059 normalize the whole tree in one pass.
60+ - If a subsystem repeatedly needs specialized guidance, add a nested
61+ ` AGENTS.md ` in that directory instead of overloading the root file. Only do
62+ this when the local conventions are stable and materially different from the
63+ repo-wide defaults.
3164
3265Code Changes
3366============
3467
3568- Prefer focused edits over opportunistic refactors.
69+ - Add type annotations to any function you touch. If a full signature annotation
70+ would force broader churn, annotate the parameters and return value needed for
71+ the current edit and keep the rest of the change scoped.
72+ - When debugging a bug or regression, add targeted instrumentation early to
73+ confirm control flow, state transitions, inputs, and external responses before
74+ attempting speculative fixes.
3675- When replacing debug ` print() ` calls in runtime code, use the repo's existing
3776 logging style:
3877 - ` Loggable ` subclasses use ` self.debug(...) ` , ` self.warning(...) ` , etc.
3978 - other modules typically use ` new_logger(...) ` or a local logger
79+ - Prefer narrow, hypothesis-driven instrumentation near the suspected failure
80+ boundary first: UI actions, task/plugin entrypoints, hardware I/O, experiment
81+ state changes, and DVC/database calls.
82+ - Remove temporary instrumentation before finishing unless it provides ongoing
83+ operational value. Do not broaden a debugging task into repo-wide logging
84+ cleanup or leave noisy logs in hot paths without justification.
4085- Preserve ` if __name__ == "__main__": ` demo blocks unless the task is to remove
4186 them. Do not treat demo code as runtime code.
4287- Keep imports modern in active Qt code. Avoid reintroducing ` PySide ` ,
4388 ` traitsui.qt4 ` , or ` pyface.ui.qt4 ` in touched files.
4489- Use ASCII unless the file already requires other characters.
4590
91+ Triage Workflow
92+ ===============
93+
94+ - Identify the user-facing subsystem first, then trace inward to the smallest
95+ active module that implements the behavior.
96+ - Check for nearby tests before editing. Prefer colocated tests under
97+ ` pychron/*/tests ` , ` test/ ` , or a subsystem-specific test package before
98+ reaching for broad suites.
99+ - Favor the path already exercised by launchers, plugins, tasks, or currently
100+ referenced docs. Do not normalize parallel legacy code paths unless the task
101+ explicitly requires it.
102+ - Use documentation to disambiguate architecture, startup flow, or workflow
103+ expectations, but do not widen the implementation scope just because related
104+ docs exist.
105+ - When adding a nested ` AGENTS.md ` , keep it limited to local setup, testing,
106+ or architectural traps. Do not duplicate root policies unless the local file
107+ is intentionally narrowing them for that subtree.
108+
46109Testing
47110=======
48111
49112- Run the narrowest useful verification for the files you touched.
50113- Good default checks:
51114 - ` python -m py_compile <files> `
52115 - ` python -m unittest <module> `
116+ - Testing heuristics for this repo:
117+ - prefer module-level or package-level checks before full-suite runs
118+ - search for colocated tests under ` pychron/*/tests ` before using aggregate
119+ runners such as ` pychron/test_suite.py `
120+ - if a change touches Qt, Traits, hardware, or external services, say what is
121+ unavailable and fall back to source-level verification when runtime checks
122+ are not feasible
53123- If a subsystem depends on Qt, Traits, or hardware services that are unavailable,
54124 say so explicitly and fall back to source-level verification.
55125
@@ -59,6 +129,11 @@ Docs And Workflow
59129- Keep ` README.md ` high signal. It should explain what the repo is, where docs
60130 live, and how development works now.
61131- Prefer documenting branch/release policy in ` docs/dev_guide/ ` .
132+ - Useful orientation documents:
133+ - ` README.md `
134+ - ` docs/dev_guide/index.rst `
135+ - ` docs/dev_guide/running_pychron.rst `
136+ - ` docs/dev_guide/git_workflow.rst `
62137- When release workflow changes, keep these files aligned:
63138 - ` docs/dev_guide/git_workflow.rst `
64139 - ` docs/dev_guide/repository_settings.rst `
0 commit comments