Skip to content

refactor(b09): drop bound-cycle STRATEGY_RUNTIME module fallback - #361

Merged
Pigbibi merged 1 commit into
mainfrom
codex/b09-pr3-no-module-fallback
Oct 9, 2026
Merged

Pigbibi merged 1 commit into
mainfrom
codex/b09-pr3-no-module-fallback

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

B09 PR-3 (after #360): while a RunContext is bound, cycle code must not fall back to module STRATEGY_RUNTIME. Tests poison the module to prove no leakage.

Changes

  • resolve_strategy_runtime: bound → require ctx.strategy_runtime (fail-closed if missing); unbound → module/fallback still allowed for patches.
  • _activate_execution_strategy_runtime: when bound, mount on context only — does not rewrite module STRATEGY_RUNTIME (pool knobs still refresh).
  • Unbound activate still updates module for build_live_runtime / test compat.
  • Tests: poison-module isolation, activate-while-bound no module leak, unbound compat preserved.

Explicitly unchanged (B04)

  • No runtime_support.py changes (submission / owner / runtime_call_client untouched).
  • No LB-HK / Firstrade / QRS Environments / secrets / Cloud Run.
  • ContextVar retained (no signature explosion this PR).

Verification

.venv/bin/python -m unittest tests.test_run_context -v
.venv/bin/python -m unittest \
  tests.test_state_service \
  tests.test_trend_pool_loading \
  tests.test_cycle_service \
  tests.test_runtime_support \
  tests.test_cycle_replay_runtime \
  tests.test_strategy_runtime \
  tests.test_notify_i18n \
  -v

Local: 15 + 133 green.

Author: Pigbibi. No CloudAgent.

PR-3: while a RunContext is bound, resolve_strategy_runtime requires
ctx.strategy_runtime and never consults module STRATEGY_RUNTIME.
Activate during a bound cycle mounts on context only (no module leak);
unbound activate still updates the module for compat. Tests poison the
module during cycles to prove isolation. B04 submission/owner untouched.
@Pigbibi
Pigbibi merged commit b5226b8 into main Oct 9, 2026
1 check passed
@Pigbibi
Pigbibi deleted the codex/b09-pr3-no-module-fallback branch October 9, 2026 10:01
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.

1 participant