Skip to content

[config] decompose config.py to stay within 300-line guideline #179

@dgenio

Description

@dgenio

Context\n\nconfig.py is currently 310 lines — 10 over the ≤300-line module guideline (the only exempt modules are types.py, envelope.py, and __main__.py, per AGENTS.md).\n\nThis was flagged in a review comment on PR #178 (feat(config): add RoutingConfig and ProfileConfig with named presets).\n\nThe file will grow further when ContextPolicy serialisation is added (a planned follow-up from PR #178, since ContextPolicy contains enum-keyed dicts not currently serialisable).\n\n## Suggested decomposition\n\nMove RoutingConfig + ProfileConfig + _ROUTING_PRESETS into a new src/contextweaver/profiles.py module, keeping ContextBudget, ContextPolicy, and ScoringConfig in config.py.\n\nRe-export from config.py and __init__.py so the public API is unchanged.\n\n## Acceptance criteria\n\n- [ ] config.py ≤ 300 lines after move\n- [ ] ProfileConfig, RoutingConfig still importable from contextweaver and contextweaver.config\n- [ ] make ci passes (all 6 targets)\n- [ ] AGENTS.md module map updated to reflect the new file\n- [ ] CHANGELOG.md updated under ## [Unreleased]\n\n## References\n\n- PR #178 — adds RoutingConfig and ProfileConfig; overage flagged in review\n- AGENTS.md — module size guideline (≤300 lines, §Coding Style)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/contextContext engine: manager, pipeline, firewallcomplexity/simpleStraightforward change, minimal riskenhancementNew feature or requestpriority/lowLower priority — scale & validation

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions