feat(resource): implement 6-level execution environment precedence chain #1065

Merged
hamza.khyari merged 1 commits from feature/m5-exec-env-precedence into master 2026-03-31 16:22:47 +00:00
Member

Summary

Implements the spec's 6-level execution environment precedence chain (lines 19324-19386).

Precedence Levels

  1. Plan override (priority=override)
  2. Project override (priority=override)
  3. Nearest-ancestor devcontainer (auto-discovered)
  4. Plan fallback (priority=fallback)
  5. Project fallback (priority=fallback)
  6. Host default

Changes

  • New resolve_with_precedence() on ExecutionEnvironmentResolver
  • Added execution_env_priority field to ContextConfig
  • has_devcontainer() helper
  • Legacy resolve() preserved for backward compat
  • 13 new Behave scenarios

ISSUES CLOSED: #877

## Summary Implements the spec's 6-level execution environment precedence chain (lines 19324-19386). ## Precedence Levels 1. Plan override (priority=override) 2. Project override (priority=override) 3. Nearest-ancestor devcontainer (auto-discovered) 4. Plan fallback (priority=fallback) 5. Project fallback (priority=fallback) 6. Host default ## Changes - New `resolve_with_precedence()` on `ExecutionEnvironmentResolver` - Added `execution_env_priority` field to `ContextConfig` - `has_devcontainer()` helper - Legacy `resolve()` preserved for backward compat - 13 new Behave scenarios ISSUES CLOSED: #877
freemo requested review from freemo 2026-03-19 05:21:28 +00:00
freemo requested review from CoreRasurae 2026-03-19 05:21:28 +00:00
freemo added this to the v3.6.0 milestone 2026-03-19 05:28:06 +00:00
hamza.khyari self-assigned this 2026-03-19 12:55:03 +00:00
hamza.khyari modified the milestone from v3.6.0 to v3.5.0 2026-03-19 12:55:32 +00:00
Owner

Planning review (Day 42):

  • Missing Type/ label: No Type/ label is set. Based on the title prefix feat(resource), this should have Type/Feature.
  • Merge conflict: This PR is currently not mergeable. Please rebase or resolve conflicts.

Otherwise looks good: milestone set (v3.5.0), closes #877, 2 reviewers assigned (freemo + CoreRasurae).

**Planning review (Day 42):** - **Missing Type/ label**: No `Type/` label is set. Based on the title prefix `feat(resource)`, this should have `Type/Feature`. - **Merge conflict**: This PR is currently not mergeable. Please rebase or resolve conflicts. Otherwise looks good: milestone set (v3.5.0), closes #877, 2 reviewers assigned (freemo + CoreRasurae).
freemo added the
Priority
Medium
State
In Review
Type
Feature
labels 2026-03-23 03:33:51 +00:00
Owner

Day 43 Review — Rebase Required

This PR has merge conflicts with master and cannot be merged in its current state. This is one of 9 Hamza PRs in the resource/LSP domain (v3.5.0-v3.6.0) that all have conflicts. These PRs likely share a common dependency chain and should be rebased sequentially.

@hamza.khyari: Please rebase onto current master. If multiple PRs depend on each other, start with the base PR in the chain and work upward.

Rebase priority: HIGH — these PRs represent significant feature work that is blocked by merge conflicts. Every day they remain conflicted is a day they cannot be reviewed or merged.

**Day 43 Review — Rebase Required** This PR has merge conflicts with `master` and cannot be merged in its current state. This is one of 9 Hamza PRs in the resource/LSP domain (v3.5.0-v3.6.0) that all have conflicts. These PRs likely share a common dependency chain and should be rebased sequentially. @hamza.khyari: Please rebase onto current `master`. If multiple PRs depend on each other, start with the base PR in the chain and work upward. **Rebase priority**: HIGH — these PRs represent significant feature work that is blocked by merge conflicts. Every day they remain conflicted is a day they cannot be reviewed or merged.
hamza.khyari removed the
Priority
Medium
label 2026-03-23 13:36:00 +00:00
freemo approved these changes 2026-03-27 17:13:02 +00:00
Dismissed
freemo left a comment
Owner

Review: feat(resource): implement 6-level execution environment precedence chain

Approved. Clean, backward-compatible upgrade.

Minor Suggestions

  • ContextConfig.execution_env_priority is str | None — consider using ExecutionEnvPriority | None for stronger type safety.
  • Invalid execution_env_priority values silently become FALLBACK via _parse_priority(). Consider Pydantic validation at the model level.

What's Good

  • Backward compatible: old resolve() preserved, new API is resolve_with_precedence().
  • Clear 6-level priority chain with good docstrings.
  • Resilient parsing with FALLBACK default.
  • 13 BDD scenarios covering every precedence level.
  • CHANGELOG entry with spec line references.
## Review: feat(resource): implement 6-level execution environment precedence chain **Approved.** Clean, backward-compatible upgrade. ### Minor Suggestions - `ContextConfig.execution_env_priority` is `str | None` — consider using `ExecutionEnvPriority | None` for stronger type safety. - Invalid `execution_env_priority` values silently become `FALLBACK` via `_parse_priority()`. Consider Pydantic validation at the model level. ### What's Good - Backward compatible: old `resolve()` preserved, new API is `resolve_with_precedence()`. - Clear 6-level priority chain with good docstrings. - Resilient parsing with `FALLBACK` default. - 13 BDD scenarios covering every precedence level. - CHANGELOG entry with spec line references.
hamza.khyari force-pushed feature/m5-exec-env-precedence from d207fe62ad to 377875573d 2026-03-31 11:15:47 +00:00 Compare
hamza.khyari dismissed freemo's review 2026-03-31 11:15:47 +00:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

hamza.khyari force-pushed feature/m5-exec-env-precedence from 377875573d to 59e048e8f5 2026-03-31 11:27:41 +00:00 Compare
hamza.khyari force-pushed feature/m5-exec-env-precedence from 59e048e8f5 to 10e4e80892 2026-03-31 14:17:38 +00:00 Compare
hamza.khyari force-pushed feature/m5-exec-env-precedence from 10e4e80892 to 0ed1954006 2026-03-31 14:43:33 +00:00 Compare
hamza.khyari force-pushed feature/m5-exec-env-precedence from 0ed1954006 to ba49dd8523 2026-03-31 15:30:33 +00:00 Compare
hamza.khyari force-pushed feature/m5-exec-env-precedence from ba49dd8523 to 5e96b4bf80 2026-03-31 16:02:01 +00:00 Compare
hamza.khyari scheduled this pull request to auto merge when all checks succeed 2026-03-31 16:02:25 +00:00
hamza.khyari merged commit dd3b0286e5 into master 2026-03-31 16:22:47 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: cleveragents/cleveragents-core#1065