|
| 1 | +# Sandbox — Pre-Release & Experimental Code |
| 2 | + |
| 3 | +This directory is the home for experimental features, prototypes, algorithm explorations, and hardware integration tests that are not yet ready for production. If you're trying something new, this is where it lives until it's validated and promoted. |
| 4 | + |
| 5 | +## Why Sandbox Exists |
| 6 | + |
| 7 | +Instead of creating a new repo for every experiment — which leads to orphaned repos, inconsistent naming, and invisible work — we keep pre-release code in the platform repos, where it belongs. This makes experiments discoverable, reviewable, and easy to promote when they're ready. |
| 8 | + |
| 9 | +## Rules |
| 10 | + |
| 11 | +### 1. Isolation |
| 12 | + |
| 13 | +Sandbox code is **never imported by production code**. The main build system explicitly excludes this directory. No production module may reference anything in `sandbox/`. |
| 14 | + |
| 15 | +If your experiment depends on production code, import the installed package (e.g., `import openlifu`, `#include` from installed headers). Never use relative paths back into `src/` or `Core/`. |
| 16 | + |
| 17 | +### 2. Self-Contained |
| 18 | + |
| 19 | +Each experiment is a standalone folder. It must include everything someone needs to understand and run it: its own README, dependencies, sample data (or instructions to get it), and run instructions. Assume the next person has never seen your code. |
| 20 | + |
| 21 | +### 3. Ownership |
| 22 | + |
| 23 | +Every experiment folder **must** have a `README.md` with the following header: |
| 24 | + |
| 25 | +```markdown |
| 26 | +# [Experiment Name] |
| 27 | + |
| 28 | +| Field | Value | |
| 29 | +|-------|-------| |
| 30 | +| **Status** | `prototype` / `testing` / `validating` / `archived` | |
| 31 | +| **Owner** | [Your name] | |
| 32 | +| **Created** | [Date] | |
| 33 | +| **Target graduation** | [Quarter/date or "exploratory"] | |
| 34 | + |
| 35 | +## Description |
| 36 | + |
| 37 | +[One paragraph: what this is, what problem it solves, why it matters.] |
| 38 | +``` |
| 39 | + |
| 40 | +### 4. Status Definitions |
| 41 | + |
| 42 | +| Status | Meaning | What happens next | |
| 43 | +|--------|---------|-------------------| |
| 44 | +| `prototype` | Early exploration, proof-of-concept. May not run cleanly. | Continue development or archive. | |
| 45 | +| `testing` | Core functionality works. Being tested against real data or hardware. | Move to validation or archive. | |
| 46 | +| `validating` | Feature-complete and under review for production promotion. | Open a graduation PR or archive. | |
| 47 | +| `archived` | Experiment concluded — either graduated or abandoned. | Move to `_archived/` with a reason. | |
| 48 | + |
| 49 | +### 5. Graduation Path |
| 50 | + |
| 51 | +When an experiment is ready for production: |
| 52 | + |
| 53 | +1. Open a PR that moves the code from `sandbox/[experiment]/` into the appropriate production directory (`src/`, `Core/Src/`, `processing/`, `Modules/`, etc.) |
| 54 | +2. Add corresponding tests |
| 55 | +3. Remove the sandbox folder in the same PR |
| 56 | +4. Reference the original sandbox README in the PR description for context |
| 57 | +5. Get a code review from someone who didn't write the experiment |
| 58 | + |
| 59 | +The PR is the gate — sandbox code doesn't sneak into production. It gets a proper review, tests, and documentation before it graduates. |
| 60 | + |
| 61 | +### 6. Archival |
| 62 | + |
| 63 | +Experiments that don't graduate get moved to `sandbox/_archived/` with an updated README: |
| 64 | + |
| 65 | +```markdown |
| 66 | +| **Status** | `archived` | |
| 67 | +| **Archived** | [Date] | |
| 68 | +| **Reason** | [Why — e.g., "approach superseded by X", "hardware target canceled", "merged into production as Y"] | |
| 69 | +``` |
| 70 | + |
| 71 | +Archived experiments are kept for historical reference. They may contain useful ideas, data, or lessons even if the code itself didn't ship. |
| 72 | + |
| 73 | +### 7. CI Treatment |
| 74 | + |
| 75 | +CI runs a **separate, lightweight job** on `sandbox/` — linting, type checking, and basic syntax validation where applicable. Sandbox CI failures are **visible but non-blocking**: they do not gate merges to `main` or production releases. |
| 76 | + |
| 77 | +This keeps quality visible without penalizing experimentation. |
| 78 | + |
| 79 | +### 8. No New Repos for Experiments |
| 80 | + |
| 81 | +If it's a prototype, an algorithm experiment, a new sensor integration, or a hardware test script — it goes here. New repositories are created only for genuinely new standalone components: a new firmware target for a new MCU, a new PCB design, or a new standalone tool with its own release cycle. |
| 82 | + |
| 83 | +When in doubt, start in a sandbox. You can always extract to a new repo later if it grows into something that justifies its own lifecycle. |
| 84 | + |
| 85 | +## Directory Layout |
| 86 | + |
| 87 | +``` |
| 88 | +sandbox/ |
| 89 | +├── README.md # This file |
| 90 | +├── [experiment-name]/ # One folder per experiment |
| 91 | +│ ├── README.md # Status, owner, description (required) |
| 92 | +│ ├── [code, data, configs] # Whatever the experiment needs |
| 93 | +│ └── ... |
| 94 | +└── _archived/ # Concluded experiments (kept for reference) |
| 95 | + └── [old-experiment]/ |
| 96 | + └── README.md # Must include archive reason |
| 97 | +``` |
| 98 | + |
| 99 | +### Naming Conventions |
| 100 | + |
| 101 | +- Folder names: **lowercase-with-hyphens** (e.g., `multi-element-beamforming`, `speckle-contrast-v2`) |
| 102 | +- Be descriptive: `new-algo` is bad, `real-time-dcs-classification` is good |
| 103 | +- Prefix with the component area if it helps: `ui-3d-overlay`, `fw-power-sequencing` |
| 104 | + |
| 105 | +## Questions? |
| 106 | + |
| 107 | +If you're unsure whether something belongs in a sandbox, a new repo, or a feature branch, ask in the team channel or open a discussion. The goal is to keep experiments visible and the org clean — not to create bureaucracy. |
0 commit comments