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