Orion Delivery — Branch #3: chore/archive-cleanup¶
To: Katja CC: Vesper, Atlas From: Orion Date: 2026-04-18
One-line¶
Move seven superseded source files into Archive/, pin the audit-exclusion contract in Archive/README.md, gitignore sandbox cruft. One commit, all renames preserved (100% similarity), 0 behavior change, 0 regressions.
Commit¶
Base: local-katja-main @ 88d0995 (Branch #2 merge)
Branch: chore/archive-cleanup
Head: d0c174e
d0c174e—chore(archive-cleanup): move stale source + backup files to Archive/9 files, 48 insertions(+), 0 deletions(-). Seven pure renames (100% similarity — git preserves blame/log history), one newArchive/README.md(42 lines), one.gitignoremodification (6 lines added).
What moves¶
neo_engine/main_loop_Old.py -> Archive/neo_engine/main_loop_Old.py
neo_engine/strategy_engine_old.py -> Archive/neo_engine/strategy_engine_old.py
neo_simulator/fill_model.bak.py -> Archive/neo_simulator/fill_model.bak.py
neo_simulator/simulated_ledger.bak.py -> Archive/neo_simulator/simulated_ledger.bak.py
neo_simulator/simulation_runner.bak.py -> Archive/neo_simulator/simulation_runner.bak.py
NEO Back up/config.example.yaml -> Archive/NEO Back up/config.example.yaml
NEO Back up/main_loop.py -> Archive/NEO Back up/main_loop.py
Grep --exclude-dir=Archive across the post-rename tree returns zero live imports or test references for any of the seven files. Moves are behavior-neutral.
What stays (judgment call)¶
tests/test_main_loop_old.py stays in tests/. The filename is misleading — it imports from the current neo_engine.main_loop and exercises live code paths (19 active tests). Moving it to Archive/ would silently delete coverage. A cosmetic rename (e.g., test_main_loop_paper_seeding.py to match its actual concern) is a candidate for a future branch, deliberately out of scope here to keep this diff behavior-neutral.
The 19 failures already present on this file are the pre-existing OrderSizeConfig.__init__() missing max_size_pct_of_portfolio schema drift noted in the Branch #2 memo. I re-verified identical pass/fail counts on both local-katja-main and chore/archive-cleanup — this branch introduces nothing.
Archive contract (pinned in Archive/README.md)¶
- No live import references files under
Archive/. - No test exercises files under
Archive/. - Grep-based audits MUST use
--exclude-dir=Archive(or equivalent) — hits insideArchive/are historical and do not reflect current behavior. - Use
git mvwhen adding toArchive/, so blame/log history is preserved.
This is the explicit documentation the Pre-Phase-7.3 Audit asked for (Item 6).
New .gitignore patterns¶
*.db.bak.* (timestamped DB backups)
*.db.corrupted_* (quarantined corrupt DBs)
.fuse_hidden* (Linux FUSE tmp cruft)
<MagicMock *> (stray files from mock-object str() in tests)
Verified via git check-ignore that each pattern absorbs its targets in the current tree. The 40+ untracked <MagicMock ...> files and 3 .fuse_hidden* files in my sandbox are now invisible to git status.
Test results¶
Focused suite (everything Branch #2 tracked):
tests/test_summarize_paper_run_overlay_baseline.py PASS (5/5)
tests/test_flag_034_display_overlay.py PASS (5/5)
tests/test_halt_reason_lifecycle.py PASS (4/4)
tests/test_inventory_manager.py PASS
tests/test_anchor_error_stat.py PASS
tests/test_flag_033_startup_integrity.py PASS
tests/test_write_synthetic_initial_basis.py PASS
68 passed, 0 new failures.
Pre-existing failures on local-katja-main (reconfirmed, not this branch): tests/test_main_loop_old.py (19) and tests/test_run_paper_session.py (4) — same OrderSizeConfig config schema drift flagged in the Branch #2 memo. Candidates for FLAG-016 / a future reconciliation branch.
Run it on your box¶
From the VS Code terminal at the repo root, in order:
# 1. Copy the patch from the workspace into the repo's patch dir
Copy-Item "C:\Claude Homebase Neo\02 Projects\NEO Trading Engine\patches-archive-cleanup\*.patch" "patches-archive-cleanup\" -Force -Recurse
# 2. Make sure you're on local-katja-main and up to date locally
git checkout local-katja-main
git status # should be clean
# 3. Cut the branch and apply
git checkout -b chore/archive-cleanup
git am patches-archive-cleanup\0001-chore-archive-cleanup-move-stale-source-backup-files.patch
# 4. Verify
git log --oneline -3
git diff HEAD~1 HEAD --stat
python -m pytest tests/test_summarize_paper_run_overlay_baseline.py tests/test_flag_034_display_overlay.py tests/test_halt_reason_lifecycle.py -v
# 5. Merge when Vesper approves
git checkout local-katja-main
git merge --no-ff chore/archive-cleanup -m "Merge branch 'chore/archive-cleanup' into local-katja-main"
Step 4's git diff --stat should show exactly: 9 files changed, 48 insertions(+) with seven rename entries. If anything differs, stop and ping me.
Review surface¶
8 KB single-commit patch. Most of the bytes are Archive/README.md (42 lines) and the .gitignore diff. The seven renames register as similarity index 100% — byte-identical, zero content changed.
What to verify (Vesper):
- Rename integrity — run
git log --follow -- Archive/neo_engine/main_loop_Old.py(or any of the other six) on the merged branch; should trace history back through the rename to the original authoring commit. - No live imports broken —
grep -rn --include='*.py' --exclude-dir=Archive -E '(main_loop_Old|strategy_engine_old|fill_model\.bak|simulated_ledger\.bak|simulation_runner\.bak)' .should return empty. Archive/README.mdcontract — read it, confirm the four rules (no imports / no tests / grep-exclude / git mv to add) match what you expect the team to follow going forward.
Nothing else should need scrutiny.
Open question for Atlas¶
None. This is mechanical hygiene cleanly delivered by the audit plan.
Open question for Vesper¶
One — flag if the cosmetic rename of tests/test_main_loop_old.py should become its own branch now, or get bundled into a later cleanup pass. My default is "later" (it touches only display, not code), but defer to you.
What's next¶
Per the 7-branch plan:
- Branch #4:
fix/flag-029-async-pin-and-orphan - Branch #5:
audit/config-wiring-pass(incl.clob_switch_threshold_bpspromotion) - Branch #6:
feat/distance-to-touch-diagnostic(PRIMARY Phase 7.3 metric) - Branch #7:
fix/wal-checkpoint-hardening(paper shakedown before live) - S40 before Phase 7.3
I'll hold for your go-ahead before cutting Branch #4.
— Orion
Attachments¶
patches-archive-cleanup/0001-chore-archive-cleanup-move-stale-source-backup-files.patch