D2 · Embryo roles/strain + multi-embryo Operations observability#68
Closed
pskeshu wants to merge 11 commits into
Closed
D2 · Embryo roles/strain + multi-embryo Operations observability#68pskeshu wants to merge 11 commits into
pskeshu wants to merge 11 commits into
Conversation
… role scope, roster lens
Add free-form `strain: str | None` to EmbryoInfo, EmbryoState, register_embryo (create + coalesce-update), and the positions endpoint — threaded exactly like the existing `role` field. Tests in tests/test_embryo_strain.py (6/6 pass).
Add role_class field ("subject"|"reference") to EmbryoRole frozen dataclass.
Set on all existing entries: test/unassigned→subject, calibration→reference.
Add lineaging registry entry (role_class=reference, ui_color=#33cc88, icon=triangle,
detector=perception) — a distinct use even when the strain overlaps calibration.
Detector wiring is staged; strain→detector decoupling deferred to spec §4.
22 new tests in tests/test_roles_registry.py; 0 new failures in full suite.
- GET /api/roles returns REGISTRY as {roles:[{name,description,role_class,
ui_color,ui_icon,default_cadence_seconds}]}; registered in routes/__init__.py
- resolve_scope_embryos() in gently/app/orchestration/role_scope.py maps
scope.mode in {global,embryos,role} → list[embryo_id]; unknown → []
- _validate_tactics already passes scope through unmodified; role-scoped
tactics (mode='role', role in REGISTRY) confirmed to pass declare_operation_plan
- Embryo id key confirmed as 'embryo_id' (from /api/embryos/positions)
- 22 new tests: 9 route + 13 resolver/validation; 0 new failures in suite
Add a population roster lens above the tactic spine in the Operations view. Reads /api/embryos/positions (role, strain, cadence_phase) and /api/roles (ui_color, ui_icon, role_class) fetched in parallel at init and on each debounced refresh. Roster structure: - SUBJECTS section (role_class=subject, foregrounded, animated live dot) - REFERENCES section (role_class=reference, compact/muted rows) - Within each class: role groups with left-edge in real REGISTRY ui_color - Each embryo row: id · role chip · strain · cadence-phase chip · current tactic (cross-referenced from plan scope) · state Tactic spine nodes gain role-scope badges when roster context is present: → test · E01, E02, E03 (role mode, magenta from API) → all embryos (global, muted grey) → E01, E02 (explicit embryos, muted grey) Role colors come from /api/roles ui_color at runtime via inline styles (_hexToRgba helper); nothing role-specific is hardcoded in experiment.css. Backward compat: if either endpoint is empty/absent, rosterCtx = null, the lens is omitted, and the spine renders exactly as before D2. The fifth rosterCtx argument on _renderOpsTactic defaults to null so all existing callers (scenario mode etc.) are unaffected. node --check: PASS
…ryos + resolver-coupling note - timelapse_tracker.py: EMBRYO_DETECTED handler now sets emb["strain"] when "strain" key present in data (mirrors role handling); seed_from_experiment now passes strain=getattr(emb, "strain", None) in the EMBRYO_DETECTED payload — fixes strain always showing "—" in live roster. - experiment-overview.js: rename _rosterEmbyros → _rosterEmbryos (9 sites, property + local variable); add coupling note on _resolveCurrentTactic pointing to role_scope.py resolve_scope_embryos. - tests/test_embryo_strain.py: 4 new tracker tests (EMBRYO_DETECTED handler + seed_from_experiment with/without strain); all 10 pass.
Collaborator
Author
|
Superseded by #72 — the temperature + Operations/tactics suite and the new Operate (bottom-cam→SPIM) surface are consolidated onto |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sub-project D2. Reuses gently's existing
roles.REGISTRY; strain ⊥ use.strain(free-form) + roles-as-use (addslineaging+ a subject/referencerole_class) + the multi-embryo roster lens (population by class→role, real registry colors, strain shown) + role-scoped tactics.Stack: →
feature/tactics-library(G).