# Shell menu audit — one item at a time
Profit language finally spoke Jim’s numbers
# Shell menu audit — one item at a time
**Purpose.** Jim and Buddy review every menu item in the bash consoles before changing scripts. No bulk deletes. Each entry gets a verdict; we agree, then move to the next.
**Rules**
1. Add **one main-menu item** per review pass (submenus get their own pass later).
2. Verdict must be one of: **KEEP** | **REDUNDANT** | **INVALID** | **BROKEN** | **DEFER**.
3. **REDUNDANT** = another menu item or script already does this job.
4. **INVALID** = wrong port, wrong tree, obsolete workflow, or contradicts `5.4.md`.
5. **BROKEN** = invokes a missing path or known-failing target today.
6. Do not edit `.sh` files from this document until Jim says **engage** on that item.
**Port spine (reference)**
| Port | Role |
|------|------|
| 1488 | Trader live |
| 1489 | Trader training |
| 1491 | MikeCamera training API |
| 1492 | MikeCamera Gradio (default) |
| 1493 | MikeCamera live API |
| 1494 | MikeCamera live Gradio (intended) |
| 1495 | Trader Watch |
| 1496 | Cycle summary |
**Audit queue (scripts — not started until Sergeant main menu is done)**
1. `sergeant_mike_unit_updated.sh` — **in progress** (MikeCamera primary console)
2. `learning_menu_sergeant.sh` (MikeCamera)
3. `corporal_trainer.sh`
4. `trader_mike/training_sergeant.sh`
5. `trader_mike/sergeant_mike_unit_training.sh`
6. `trader_mike/learning_menu.sh`
7. `trader_mike/learning_menu_sergeant.sh`
**Jim’s prior guess:** ~40% of items across all menus may be REDUNDANT or INVALID.
---
## Source: `sergeant_mike_unit_updated.sh` — main menu
Script: `mikecamera/mikecamera/sergeant_mike_unit_updated.sh`
Last menu read: 2026-05-21 (lines ~1037–1070).
---
### Item 0 — `Build Total Vocab.json`
| Field | Value |
|-------|--------|
| **Menu label** | `0) Build Total Vocab.json (preload training batch vocab before option 1)` |
| **Handler** | `build_total_vocab` → `prepare_total_vocab.py` on `mike_camera_model/` |
| **What it does** | Interactive rebuild of `vocab.json`: optional QA prompts ingest, training text path, writes vocab under model dir before deploy/load |
| **Typical use** | Cold start or deliberate vocab reset **before** option 1 deploy — predates per-step vocab growth on Sergeant |
| **Overlaps with** | Per-step `_grow_standby_vocab_from_pending` during HTTP training (`5.4` § 2026-04-09); Sugar / `learning_mike` OOV growth at train time |
| **Still needed?** | **Rarely** for day-to-day training once growth-on is healthy; still useful for intentional full rebuild or disaster recovery |
| **Risk if removed** | Lose explicit “reset vocab from corpus files” path without using tire_fire or manual Python |
| **Verdict** | **DEFER** → lean **KEEP** as advanced/rare ops, but **demote** in menu (not top line 0) after Jim confirms he never uses cold rebuild |
| **Buddy notes** | Not INVALID or BROKEN if `prepare_total_vocab.py` exists. Not REDUNDANT with daily training, but overlaps philosophically with runtime growth. Jim: do you still run this, or has per-step growth replaced it entirely? |
**Review status:** ☐ Jim confirmed ☐ Verdict locked
**Next item when ready:** **1) Deploy Sergeant Mike (1491)**
---
*Add the next section only after Item 0 is reviewed together.*
---
## Step 8 dialog (Trader 1488 ↔ MikeCamera 1491) — **implemented 2026-05-21**
**Flow** (`trader_mike/step8_mikecamera_dialog.py`):
1. Trader Mike — cycle analysis (prompt one; from summary)
2. MikeCamera `/query`
3. Trader Mike `/query`
4. MikeCamera `/query`
5. Trader Mike `/query` — ends with **Good bye.**
6. MikeCamera `/query` — ends with **good bye.**
Config: `localmike.cycle_summary` → `dialog_trader_farewell`, `dialog_camera_farewell`, mid/farewell instruction keys.
Backups: `bak_files/step8_mikecamera_dialog.py.bak-20260521-six-turn`, `config_backups/trader_mike_config.bak-20260521-six-turn-dialog.json`
# Good morning edge — Ten Thousand Backups, Five Point Nine, and the Dictionary That Refused to Shrink
Good morning, Buddy.
Jim asked for the backlog first, then the ledger, then the chapter. The covenant held: read **`5.4.md`**, backup before edit, name what broke before touching swap paths that still breathe.
**The queue had been cloning itself.** Step 2A sanity meant well — every rewrite of **`strategy_swap_queue.json`** left a timestamped twin. Ten thousand ghosts in **`trader_mike/`**, each whispering the same empty pairs. The fix was not drama: delete the graveyard, teach **`solana_test_trader.py`** to pass **`--no-backup`** on the next pass so the discipline stays quiet. Jim does not need another filesystem archaeology season.
**Profit language finally spoke Jim’s numbers.** For a morning we flirted with micro-scalp — **0.052** take, bots rumored near **0.06** — then Jim drew the real line: **just under six percent up, just over three down**. In **`localmike_crypto_controller`**, those config fields are **percent points against entry**, not hidden decimals. **`take_profit_percent: 5.9`**. **`stop_loss_percent: 3.1`**. **`force_sell_loss_percent: 3.2`** so the cycle’s forced seller does not fire at a tenth of a percent while the guardrail waits for three. Trailing at **`min_take_profit_percent: 5.5`** — close enough to taste the target without selling the move at birth. Restart **1488** when the JSON changes; logs should say **`profit guardrail`** with honest arithmetic.
**Mike’s mouth had been lying about his throat.** **`and and and`** — the old function-word prison from **§ 2026-04-07**, but the autopsy this week was fresher: vocab near **one hundred six thousand** names, embedding rows **one hundred five nine nineteen**, a **348-token drift** where the dictionary outran the weights. We stopped growing the model to appease a bloated **`vocab.json`**. **`mike_tokenizer_align.py`** — **`prepare_tokenizer_for_inference`**, clamp IDs to the table that actually exists. **`mikecamera.py`** loads march-style; Sergeant writes **`vocab_size`** back into **`tokenizer_config.json`** on save so the next instance does not amnesia the span. Someone tried **`prepare_total_vocab.py --from-scratch`** — eight thousand tokens, mass **`<|unk|>`**, Jim said no. Restored from **`vocab.json.bak-20260528-105018-before-vocab-rebuild`**. **`prebuild_max_vocab_size: 300000`** so the cap stops strangling the living dictionary. Alignment at load is not training; training still owes the missing rows.
**Two sevens, two doors — now written in stone.** Monitor pane **7** splits; **`mikecamera.py --text-only`** eats chunks locally and Jim says it is **working well**. Sergeant **7** drills HTTP into **1491**/**1493** for symbiotic checkpoints and Step 8. The table lives at the top of **`5.4.md`** so the next Buddy does not send book training down the chunk highway by mistake.
**Still open — the honest queue.** Cycle **fifty**/**hundred** boundary: **Step 8b** save, **Step 8c TIRES** only after **`sync_trader_from_mike_before_merge`** proves the rows match — never another buried merge with garbage tails. Step 3 smoke. **`shell_menu_audit.md`** past Item zero. Camera: AVFoundation saw **zero** devices; backup exists, fix does not. Public RPC may handshake-timeout at Step zero — Jim calls it weather, not logic; no retry crusade without proof. Weekend backlog still lists retrieval triggers, training KV fantasy, **1494** collisions, **`PUMP` evidence — not retired because we fixed one week of fires.
**TIRES geometry lesson still sacred.** SLERP is innocent when vocab is guilty. Tabula rasa liftoff on **1493** at **~863** tokens was the breath Jim wanted. Do not merge mismatched rows and call it symbiosis.
# Good night edge — The Two Cents and the Embedding Row
Jim opened on silence where swaps ought to have been: queue empty since morning, Mike returning prose where digits were owed, SOL reading zero while the wallet still held four-point-something native. The covenant stood: read **`5.4.md`** and the dated novelettes before touching live bark.
**Pipeline, not panic — `trader_mike/` only.** **`swap_on_solananet_usd.py`**: native **SOL** uses **`get_balance()`**, not SPL **`get_token_balance()`** — the same truth legacy **`swap_on_solananet.py`** already knew. Bank-loan buys had been failing with **0 SOL** on the balance line.
**`query_mike_for_swaps.py`**: sell eligibility follows **`min_sell_usd`** alone — not **`max(default_swap_amount_usd, min_sell)`**. Swap size **`min(position_value, default_swap)`**. Step 2 gets **NUMBERS ONLY** prompts; **`mike_batch_swap: false`**; **`step2_max_tokens: 128`**. Force-sell shares the floor.
**Jim tuned cents by feel.** Five cents, then ten, then back to **one cent** — dust will not trade behind a dime wall. **`skip_analysis_position_value_below`** and **`dust_liquidation_min_usd`** still want alignment at four cents beside the sell floor; the ledger records the homework.
**Two errors on 1488, one file.** **`localmike_inference.py`**: (1) **`index out of range`** when mint strings tokenized above embedding rows — clamp **`input_ids`** and each sampled token before **`forward()`**; (2) **`probability tensor … inf/nan`** when **`top_k: 4`** emptied the sampling pool — floor temperature, cap **`top_k`**, **`argmax`** fallback when **`multinomial`** would choke. Backup **`bak_files/localmike_inference.py.bak-20260520-gen-errors`**.
**Port map unchanged:** **1488** live, **1491** Step 8 dialog, **1493** MikeCamera training. Expert consensus tools already restored — **`experts_first_when_suggested: true`**, Mike override gated off.
Restart **1488** after inference edits. Restart Trader after config. Narrow diffs; **`cp`** before confession.
Good night, Jim.


