Thales
← research journal
Nov 13, 2026raw markdown ↗

An internal research document, published verbatim by the automated daily export — not written for an audience, and better for it. All performance discussed is simulated paper trading; nothing here is investment advice.

2026-11-13: the robo sleeve — spec and pre-registration

Decision (owner, 2026-11-13): build a robo sleeve and watch it through next year. "sounds good, lets plan this out and build a robo sleeve and see how it performs next year."

What it is. A sleeve that owns the market through three index funds at fixed weights, rebalances by rule, and harvests tax losses by rule. It makes no prediction and claims no edge. Its job is to deliver the return of its mix, cheaply and without mistakes.

Why. The momentum diagnosis of the same day (2026-11-13_why_the_momentum_picks_lost.md) found the stock picks carried a bet about six times the size of their paper edge: about 1.6 points a year over the average stock, inside swings of about 10. A robo starts from the other end. It holds the market by default, and anything else has to earn its place.

Every number below was fixed on 2026-11-13, before any history of this mix was run and before the sleeve has a single live day. The values are enforced by keystones (config_guard.ROBO_KEYSTONES against config/robo.yaml); this memo explains them. If the two ever disagree, the keystones win.

1. What it holds

Asset classTargetFundSwap partner (for tax-loss harvesting)
US stocks60%VTIITOT
International stocks30%VXUSIXUS
Treasury bills10%SGOVnone (not harvested)
  • The stock split is roughly the world's own: the US is a little under two-thirds of global market value. Owning both needs no forecast about which will do better.
  • The partners track the same market through a different index provider, so a swap keeps the exposure and is not a purchase of the same security.
  • 0.5% of the account stays in cash so that a buy can never borrow.
  • Tilt slots: none. A signal may be added as a small tilt only by a dated amendment, after a pre-registered test shows it beats this sleeve's own mix. Nothing qualifies today.

2. The daily rule

One run each trading day. Every decision uses the broker's own numbers (positions, cash, quotes), so the trading path downloads no prices.

  1. Check the account. If it holds anything that is not one of the five funds above, submit nothing and stop. A human sorts it out. If the market is closed, record the day and trade nothing: an order sent after the close cannot be confirmed before the next step depends on it.

  2. Harvest. If a stock fund is down 3% or more against what was paid for it, sell all of it and buy its partner with the proceeds. The fund just sold is locked for 30 days: nothing may buy it until day 31. A swap is skipped while the partner is itself locked, and it is both legs or neither: no sale if the purchase cannot be priced or would be refused by the safety gate.

  3. Rebalance. If any class has drifted outside its band, trade every class back to target.

    ClassTargetBand
    US stocks60%55% to 65%
    International stocks30%25% to 35%
    Treasury bills10%7.5% to 12.5%

    The band is 5 points or a quarter of the target, whichever is smaller. A cash balance more than 0.25% of the account below zero also triggers a rebalance.

  4. Sweep cash. Otherwise, once idle cash (dividends, mostly) reaches 1% of the account, buy the classes that are under target, in proportion to how far under they are. Buying is the only way the sweep moves the weights, so it never realizes a gain.

  5. Otherwise do nothing. Most days end here.

Sells go first, and a buy is paid for only by cash on hand plus the proceeds of sells the broker has confirmed filled. Every order passes the same fail-closed safety gate as every other sleeve, and the gate is asked about the whole day's trade before any part of it is sent (§6).

3. What it never does

  • No leverage, no shorting, no options.
  • No market timing: there is no volatility target, no trend filter and no drawdown kill switch. Selling after a fall is the mistake this design exists to prevent. The safety gate still halts on a broker fault, a wrong account, a one-day loss over 10% or a runaway order count.
  • No tuning. The mix, bands and thresholds change only by a dated owner amendment, and an amendment restarts the clock.

4. How it is judged

Against its own mix, not against SPY. The yardstick is the three funds at 60/30/10, rebalanced daily, dividends included, no costs. SPY is shown alongside for context only: this sleeve holds foreign stocks and Treasury bills, so it will differ from SPY in both directions, sometimes by several points a year, and that difference is the design, not a result.

Pre-registered checks — an interim read at 126 live trading days and the first full read at 252:

CheckPasses when
Return fidelitySleeve return is within 0.75 points a year of the yardstick
Stays in its bandsNo class starts more than 2 runs in a row outside its band
Stays investedIdle cash averages under 2% of the account
Trades littleRebalancing turnover is under 50% of the account a year (first purchase and like-for-like swaps excluded)
Wash-sale ruleZero buys of a locked fund
OperationsZero safety halts caused by the sleeve itself

Reported without a pass mark, because the market decides them: losses harvested, their estimated tax value, and the gap to SPY.

A failed check is an operations defect to fix through the queue. It does not change the mix.

Not a criterion, deliberately: beating SPY, or any return target.

5. Tax-loss harvesting, honestly

  • On a paper account there is no tax, so the harvest ledger is a simulation of what a taxable account would have banked. Each harvest records the loss and an estimated value at the pinned rates (24% short-term, 15% long-term, from the December memo's §9), using the older, lower rate whenever the position is more than a year old.
  • Harvesting defers tax more than it removes it: the replacement fund has a lower cost, so a later sale has a larger gain.
  • The sleeve cannot see other accounts. In real life a purchase of the same fund elsewhere inside the 30 days (a retirement account, a spouse's account) would undo the loss.
  • v1 harvests whole positions, not individual purchase lots. It is simple, it cannot be gamed by lot ordering, and on an account with no deposits it gives up little.
  • Only those whole-position swaps are counted as harvested. A rebalancing sale can also realize a loss; it is not claimed, and it sets no lock.

6. What changes in the platform

  • A third contract, policy. Momentum and the control are weights (rank stocks, pick the top ones); the options sleeve is order_intent. A fixed mix is neither: it has no signal to rank, so it has no Strategy class and no backtest gate. Its rules are pure functions (execution/robo_policy.py) called by a thin daily wrapper (execution/robo_daily.py). The same functions drive a day-by-day simulator, so the tested rule and the live rule are one piece of code.
  • Fleet law is unchanged. Every order goes through pipeline.execute_orders and the safety gate.
  • The order things happen in is part of the design. A sound rule can still go wrong between its sale and its purchase, so the wrapper fixes the sequence:
    1. One safety verdict on sells and buys together, before anything is sent (pipeline.preflight). The gate rightly never blocks an all-sell batch on a crash day, so a swap sent as "sells, then buys" would sell and then have its buys halted. Asked about the whole trade, a halt submits nothing.
    2. The wash-sale lock is written to disk before the sale, and is also rebuilt from the order log on every run. A killed job or a lost state file cannot forget one.
    3. Sells are confirmed filled before any buy is sent. A sell that has not confirmed pays for nothing, takes its own swap's purchase with it, and claims no loss.
    4. If the purchase leg is still stopped after the sells filled (the broker failing between two calls seconds apart), the run retries once, then says so plainly (sold_not_rebought) and reds. The next run buys the partner fund.
  • Its own safety limits. A three-fund book legitimately holds 60% in one fund, so the per-fund cap is 70% and the order cap 70% of the account, with at most 12 orders a run. All keystone-pinned.

7. Build plan

StepWhatState
1This spec, the pinned config and its keystonesthis PR
2The rules, the simulator and the daily wrapper, with teststhis PR
3A history of the pinned rule, for expectations only (no value moves afterwards)this PR, after the pins are committed
4The checks evaluator (thales --sleeve robo policy-checks) and the yardstick in the digest and on the sitebefore activation
5Activationafter the December gate is read

Until step 5 the sleeve is built but not registered: it is absent from sleeves.SLEEVES, so the fleet status, the Friday digest, the public site and the daily jobs do not know it exists. Its config pins the broker account as UNASSIGNED, so the safety gate would refuse any real account.

8. Activation (owner-gated)

Alpaca gives three paper accounts and all three are in use. The robo takes the negative control's account once the December gate has been read (the 126th clean day is about 2026-12-10). The control has answered its question, and by its own covenant it can never be promoted.

  1. Retire the control: registry entry, config, workflow and its place in the PC's daily sequence. Its committed state stays as the record.
  2. Sell every position in that account, as ordinary sell orders through the safety gate (fleet law: the broker's close-all call bypasses the gate and is not used). This is a trading action and waits for the owner's word.
  3. Point the robo at the account: the credentials under the robo's own names on the PC, the real account id in place of UNASSIGNED, the clock's start date, the registry entry, the backup workflow, the public-site entry and a row in NORTHSTAR §6 for the first read.
  4. First run buys the mix. The clock starts that day.

The fleet cap stays at three sleeves.

9. Changes after the code review of the same day

An independent cold review of the first draft, before any live day, found seven defects, all in the seams between the sale, the purchase and the state write. The rule's values did not change.

FoundNow
On a 10% down day a swap's sells went in and its buys were halted, leaving the account in cash at the bottomOne safety verdict on the whole trade first; a halt submits nothing
A fund was sold when its partner could not be pricedA swap is both legs or neither
The lock was written after the sale, and a missing state file read as "no locks"Lock written before the sale and rebuilt from the order log
A sell that was accepted but not filled still paid for a purchase and claimed a lossSells are confirmed filled first; orders go only while the market is open
The dry-run preview showed nothing for funds not yet heldThe preview prices every policy fund
Three tests asserted less than their names claimedRewritten, with a control test; 35 guards each removed in turn and each caught
A false "buys scaled" warning on half of first runsCompared to the cent

Three smaller corrections came from the same review. The bands are now centred on the targets exactly as the table in §2 reads (the draft centred them 0.3 points lower, on the target less the cash reserve). Rebalancing done on a harvest day is counted as rebalancing, so the turnover check sees it. A position of unknown age is estimated at the lower long-term rate, as §5 says.

10. Out of scope

  • Real money. The config has no go_live section, so thales go-live-gate refuses the sleeve. Putting real money in is a separate owner decision with its own registration.
  • Deposits and withdrawals, lot-level harvesting, direct indexing (owning the stocks themselves so losses can be harvested one stock at a time), and a mix that changes with age or goals. Each is a later, dated amendment.

11. Activation as it happened (2026-11-13, appended; nothing above was edited)

The owner asked the same evening to turn the robo on rather than wait for December. What §8 planned and what was done differ in three places:

  • A new account, not the control's. The owner created a new paper account, PA3NWBKBS, with $10,000 (verified through the API before the pin: active, empty, all five funds tradable and fractionable). The fleet cap stays at three operating sleeves because the control was retired.
  • The control was retired and its account deleted by the owner, so §8 step 2 (selling its positions through the safety gate) did not happen: the account closed with its 228 positions in it, which on paper moves no market. Its last broker record (account, positions, Alpaca's daily balance history) was saved while the deletion propagated; Alpaca refused the order and activity history before it could be read, and the sleeve's own committed logs already hold every order it submitted and every daily mark. A retired sleeve stays registered with phase retired so its record stays readable; nothing runs it.
  • The clock starts 2026-11-16, the first trading day after activation, pinned before any live data. The interim read falls at 126 trading days (about 2027-05-18) and the full read at 252 (about 2027-11-16), both in NORTHSTAR §6.

Everything else in §8 step 3 was done: credentials under the robo's own names on the Mac, the PC and GitHub; the real account id; the registry entry; the PC's morning sequence (vrp → momentum → robo); the backup workflow; and a digest section that shows the mix against its targets and bands, the last decision and the harvest ledger. Two pieces are deferred: the public-site page (the site renders a fixed set of sleeves and kinds, so it needs its own change) and the checks evaluator with the yardstick (§7 step 4), both before the interim read.