-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
area/contextContext engine: manager, pipeline, firewallContext engine: manager, pipeline, firewallcomplexity/averageStandard effort, moderate familiarity neededStandard effort, moderate familiarity neededenhancementNew feature or requestNew feature or request
Description
Problem
src/contextweaver/context/manager.py is currently 786 lines (765 on main), well over the project's ≤ 300 lines per module guideline (AGENTS.md coding style). manager.py is not in the exempt list (types.py, envelope.py, __main__.py).
This was flagged during review of #147 (logging integration), which added +21 lines. The debt is pre-existing — not caused by #147.
Proposal
Extract the ingestion helpers into a new src/contextweaver/context/ingest.py module:
ingest()method logicingest_tool_result()and its sync variantingest_tool_result_sync()- Related private helpers used only by ingestion
ContextManager would retain the public ingest() / ingest_tool_result() methods as thin delegating wrappers, keeping the API surface unchanged.
Expected impact
manager.pyline count reduced significantly (ingestion code is ~150+ lines including docstrings)ingest.pystays well under 300 lines- No public API changes —
ContextManagerremains the single entry point
Constraints
- Must preserve
ContextManageras the public API — callers should not need to import fromcontext/ingest.py - Must follow
context/path conventions: async-first with_syncwrappers - Must not break the 8-stage pipeline ordering or firewall invariants
- Update
AGENTS.mdmodule map if a new file is added
References
AGENTS.mdcoding style: "≤ 300 lines per module"- PR feat: add Python logging integration with structured events #147 review comment flagging the line count
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area/contextContext engine: manager, pipeline, firewallContext engine: manager, pipeline, firewallcomplexity/averageStandard effort, moderate familiarity neededStandard effort, moderate familiarity neededenhancementNew feature or requestNew feature or request