Skip to content

refactor(core): reorder functions and tests top-down by behavior - #1225

Merged
hakula139 merged 2 commits into
mainfrom
refactor/reorder-ox-core
Dec 6, 2026
Merged

hakula139 merged 2 commits into
mainfrom
refactor/reorder-ox-core

Conversation

@hakula139

Copy link
Copy Markdown
Member

Summary

Pure function and test reordering across crates/ox-core with zero behavior changes (27 files, +2544/-2544 lines):

  • Production code layout: ordered functions top-down from callers to callees (client.rs, tools/bash.rs, attachments.rs, compaction.rs, agent.rs, agent/turn.rs, memory.rs), moved retry/timeout constants to the top of the HTTP/retry section in client.rs, and aligned AttachmentPolicy and MemoryMode match arms with their enum declaration order.
  • Test organization: grouped test helper structs and functions at the top of each test module, grouped related tests by behavior in execution order, and placed normal cases ahead of edge and error cases across attachments.rs, compaction/tests.rs, config/loader.rs, plugin/tests.rs, prompt.rs, subagent.rs, agent/tests/{core,hooks,session,steering}.rs, client/{google.rs,tests.rs}, hooks/tests.rs, skills.rs, session/tests.rs, fs.rs, message.rs, tools/{edit,read}.rs, catalog.rs, and tests/live.rs.

Test plan

  • nix develop -c run-hooks (all hooks including rustfmt, clippy, and cspell passed)
  • cargo test -p ox-core (286 unit tests and 2 plugin_subprocess integration tests passed; 4 opt-in live tests ignored as expected)

Pure code move across crates/ox-core with zero behavior changes:
- Order production functions top-down from callers to callees and align match arms with enum declaration order.
- Group test helpers at the top of each test module and order tests by behavior in execution order, placing normal cases before edge and error cases.
@hakula139 hakula139 added refactor Behavior-preserving restructuring area: client Touches the model API client, authentication, or request wire area: agent Touches the agent turn loop, compaction, or agent events area: extensions Touches hooks, skills, packages, or MCP integration labels Dec 6, 2026
@hakula139 hakula139 self-assigned this Dec 6, 2026
@codecov

codecov Bot commented Dec 6, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.81203% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/ox-core/src/agent/turn.rs 96.77% 1 Missing ⚠️
crates/ox-core/src/client.rs 95.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@hakula139
hakula139 merged commit a99e230 into main Dec 6, 2026
7 checks passed
@hakula139
hakula139 deleted the refactor/reorder-ox-core branch December 6, 2026 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: agent Touches the agent turn loop, compaction, or agent events area: client Touches the model API client, authentication, or request wire area: extensions Touches hooks, skills, packages, or MCP integration refactor Behavior-preserving restructuring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant