Skip to content

Match media suggester on modeled_environment (un-skip lab-env communities)#218

Merged
realmarcin merged 1 commit into
mainfrom
feat/suggester-modeled-environment
Jul 20, 2026
Merged

Match media suggester on modeled_environment (un-skip lab-env communities)#218
realmarcin merged 1 commit into
mainfrom
feat/suggester-modeled-environment

Conversation

@realmarcin

Copy link
Copy Markdown
Contributor

Context

Closes the loop from the "why are these skipped?" thread. The media suggester
skipped 110 communities grounded to the generic environment_term: laboratory environment. Now that 23 of them carry a real modeled_environment (#217), the
suggester matches on it too.

What

  • _community_env_community_envs: a community's match keys are its
    environment_term and every modeled_environment entry (ENVO id/label,
    deduped, order preserved).
  • The main loop matches media across all non-generic keys for a community, dedups
    by culturemech_id, and labels each suggestion group with which key it matched
    (environment_term vs modeled_environment). Communities with no ENVO env
    are silently skipped (as before); only all-generic communities count as skipped.

Effect

The 23 modeled_environment records leave the skipped bucket: skip count
110 → 87.
They yield 0 media suggestions today — CultureMech
source_environment has no groundwater/regolith/dairy/… entries yet — so this is
data-limited, not logic-limited: they'll match automatically as sibling
coverage grows. (Verified: _community_envs returns e.g. [laboratory environment, groundwater] for the Rifle aquifer record.)

Verification

  • just test247 passed (new _community_envs cases: environment_term +
    modeled_environment, dedup, non-ENVO ignored)
  • just lint — black + ruff + mypy clean
  • Real run: skipped 110 → 87; 351 exact suggestions unchanged

Remaining follow-ups

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings July 20, 2026 02:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@realmarcin
realmarcin force-pushed the feat/suggester-modeled-environment branch from b426010 to dc7ddab Compare July 20, 2026 02:24
…munities)

Closes the loop from the "why are these skipped?" thread. The media suggester now
uses a community's environment_term AND every modeled_environment entry as match
keys, so an engineered community whose environment_term is the generic "laboratory
environment" still matches media via the real habitat it models.

- _community_env -> _community_envs: returns [environment_term, *modeled_environment]
  ENVO (id,label) keys, deduped.
- main loop matches media across all non-generic keys (dedup by culturemech_id),
  labels each suggestion group with which key it matched (environment_term vs
  modeled_environment); communities with no ENVO env are silently skipped (as
  before), only all-generic communities count as skipped.

Effect: the 23 modeled_environment records drop out of the skipped bucket
(110 -> 87). They yield 0 media today (CultureMech source_environment has no
groundwater/regolith/dairy/... entries yet) — data-limited, not logic-limited;
they'll match automatically as sibling coverage grows.

tests: _community_envs (environment_term + modeled_environment, dedup, non-ENVO
ignored). 247 tests pass; lint clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@realmarcin
realmarcin force-pushed the feat/suggester-modeled-environment branch from dc7ddab to ba60357 Compare July 20, 2026 02:27
@realmarcin
realmarcin merged commit 4f9ae32 into main Jul 20, 2026
2 checks passed
@realmarcin
realmarcin deleted the feat/suggester-modeled-environment branch July 20, 2026 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants