Skip to content

fix: replace hardcoded keyword matching with LLM-driven classification#107

Merged
DeveshParagiri merged 1 commit intomainfrom
fix/llm-driven-classifications
Feb 17, 2026
Merged

fix: replace hardcoded keyword matching with LLM-driven classification#107
DeveshParagiri merged 1 commit intomainfrom
fix/llm-driven-classifications

Conversation

@DeveshParagiri
Copy link
Collaborator

Summary

Replaces hardcoded keyword matching with LLM-driven classification at spec/scenario creation time.

All three changes move classification to spec/scenario creation time, eliminating runtime keyword heuristics.

Files Changed

  • extropy/core/models/population.py - Added agent_focus_mode to SpecMeta/SufficiencyResult, display_format to AttributeSpec
  • extropy/population/sampler/core.py - Simplified _get_agent_focus_mode to read enum directly
  • extropy/population/spec_builder/sufficiency.py - Added agent_focus_mode to LLM schema
  • extropy/population/spec_builder/selector.py - Added display_format to LLM schema
  • extropy/population/spec_builder/hydrators/*.py - Pass through display_format
  • extropy/population/spec_builder/binder.py - Accept agent_focus_mode, include display_format
  • extropy/simulation/persona.py - Use display_format for time/currency/percentage rendering
  • extropy/population/persona/renderer.py - Accept display_format_map parameter
  • extropy/scenario/outcomes.py - Added option_friction to LLM schema

Test Plan

  • All 822 tests pass
  • test_agent_focus.py updated for new approach

Fixes #99, #100, #101

Fixes #99, #100, #101

- agent_focus_mode: LLM sets enum during sufficiency check instead of
  runtime keyword parsing (#100)
- display_format: LLM classifies time/currency/percentage during attribute
  selection, used in persona rendering (#101)
- option_friction: LLM generates friction scores for outcome options
  during scenario creation (#99)

All three changes move classification to spec/scenario creation time,
eliminating runtime keyword heuristics.
@DeveshParagiri DeveshParagiri merged commit dbb4126 into main Feb 17, 2026
4 checks passed
@DeveshParagiri DeveshParagiri deleted the fix/llm-driven-classifications branch February 17, 2026 19:39
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.

Fragile keyword matching in _position_action_friction() for outcome friction estimation

1 participant