Skip to content

refactor(agentic): generalize agentic predictors via DomainConfig#1

Merged
ethancjackson merged 3 commits into
mainfrom
generalize-agentic-predictors
Jul 16, 2026
Merged

refactor(agentic): generalize agentic predictors via DomainConfig#1
ethancjackson merged 3 commits into
mainfrom
generalize-agentic-predictors

Conversation

@ethancjackson

Copy link
Copy Markdown
Collaborator

Fork-side landing of upstream PR VectorInstitute#170 (CI-green there; full description and invariant verification in that PR). This fork is the home of the workshop-paper + live-evaluation work; the generalization merges here first and is promoted upstream after the bootcamp build phase.

🤖 Generated with Claude Code

ethancjackson and others added 3 commits July 15, 2026 20:33
Pin the behaviour the domain-agnostic refactor must preserve:

- AdaptiveSkillStore save/load/render/backup contract and the
  confirmation_threshold store parameter (shared-lib test with a minimal
  concrete state).
- WtiStrategyState.build_markdown() renders the committed
  wti-strategy-trained artifact byte-identically (snapshot), plus the
  default oil skill name/title.
- The five strategy mutation tools' evidence governance: observation/
  hypothesis lifecycle, the graduation threshold guard, and the
  narrative-update rationale requirement.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ainConfig

Promote the shared agentic engine so a new target series can be configured
without touching oil code, and drive the oil prompts/config from a single
`DomainConfig`. Pure refactor: no new features, no study driver.

Promoted to aieng/forecasting/methods/agentic/:
- strategy_state.py: generic `StrategyState` (+ Observation/Hypothesis/
  CalibrationCorrection/VersionEntry). Markdown title, default skill name, and
  frontmatter description are ClassVar params. Oil `WtiStrategyState` becomes a
  thin subclass pinning the WTI strings — committed SKILL.md renders identically.
- adaptive_skill_tools.py: `build_skill_tools(strategy_dir, state_type, ...)`
  generic over any StrategyState subclass. No import-time singletons. Oil
  skill_tools.py delegates and re-exports the sub-models; STORE/WTI_SKILL_TOOLS
  removed (unused outside docstrings).
- history.py: `compress_history` (was analyst_agent/agent.py); oil re-exports it.
- outputs.py: generic `ScenarioCard` / `ScenarioAgentForecastOutput` with the
  scenario-card numeric fields parameterized via `scenario_card_template_extra`.
  Oil `tasks.py` subclasses them, preserving `wti_range_60d`/`point_estimate_60d`
  and modality="discrete".
- domain.py: `DomainConfig` (identity, data/target, context-retrieval, strategy
  skill, skill dirs, vol-regime bands, tool bounds) plus render_* instruction
  templates and `build_analyst_config` / `build_adaptive_config`.

Oil implementation:
- energy_oil_forecasting/domain.py defines `OIL_DOMAIN`.
- analyst/adaptive/starter agent instructions now render from OIL_DOMAIN; the
  `build_wti_*` factories are thin delegating wrappers. Rendered oil prompts are
  byte-identical to the originals (verified against captured goldens).

Curriculum: `_vol_regime` vol bands extracted to a `bands` parameter with the
15/30/50 thresholds as `DEFAULT_VOL_REGIME_BANDS`.

Invariants held: oil agent.name / predictor_id strings unchanged; committed skill
artifacts render identically; nb05/nb06 import surfaces resolve. Regenerated the
concierge catalog/artifacts to index the new modules. __init__ re-exports the
promoted names; old oil import paths preserved.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
New PYSEC-2026 advisories against the locked versions fail CI's pip-audit
step on every branch (main last passed 2026-07-07, before publication).
Full test suite re-verified after the bump: 489 passed, 7 skipped.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ethancjackson
ethancjackson merged commit 447e3c2 into main Jul 16, 2026
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