Thales
← research journal
Oct 27, 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-10-27 — a detector's release condition was met in another PR's commit message, and nothing connected the two

Daily audit, 2026-10-27. Observability-tier finding; no trading behaviour involved.

The shape

The fleet digest raises an exception when an order we recorded as submitted ages past the terminal-status sweep's 5-day window still carrying no outcome (unrecorded_outcomes, status_sweep.py). It fires for the two weights sleeves and not for vrp, the options sleeve — deliberately, and with the reasoning written down at the reader plus a test that reds if anyone wires it (test_the_digest_line_covers_WEIGHTS_sleeves_only_and_the_scope_is_pinned).

The stated reason for holding it was a genuine open question:

whether Alpaca resolves a multi-leg options parent by our id is unestablished (it needs broker credentials). If that lookup is structurally broken then every vrp order ages out past the 5-day window unresolvable, the count rises monotonically and the alarm can never go green

That is the right call: an alarm that cannot reach zero is one the reader learns to skip, which is the calibration principle the whole sweep module is written around. The gate also named its own release condition — wire this line only after it is answered — and armed a test to enforce it. Good apparatus.

What happened

The question was answered the same night, by a different PR, merged minutes earlier in the same batch. #285 found the cause (Alpaca returns symbol=None for an MLEG order, so from_alpaca_symbol(None) raised TypeError and every vrp lookup failed) and verified the fix against the live paper broker: "8/8 VRP orders since 09-04 resolve to FILLED."

So at 23:14Z on 2026-10-26 the repository simultaneously contained

  • a comment saying the vrp lookup question is unestablished and the alarm must stay unwired, and
  • the commit message establishing that the lookup works.

Nobody was wrong at any point. #270's author could not know; #285's author was fixing a crash, not releasing a gate; and the steward's merge note correctly anticipated the first consequence ("from tomorrow's run the sweep should record VRP order outcomes for the first time"). The defect is that the release condition lived only in a code comment, so satisfying it produced no signal anywhere. A gate whose key is minted in a neighbouring commit message stays shut by default.

The second half: a chore closed with half of it outstanding

ops/HANDS.md carried the credentialed sweep as one item. It was marked Done on 2026-10-24 reading "momentum + meanrev recorded (#284); the VRP lookup bug fixed in #285 (merge Monday)". Both clauses are true and the item is still half-undone: #285 was verified in a dry run, which writes nothing, and had not merged. All 17 vrp orders ever submitted still read PENDING_NEW (2026-07-13 → 2026-10-19), and 16 of them are already past the automatic sweep's reach, so no scheduled run will ever correct them.

Closing the item retired the only tracker the chore had. That is the same failure mode as the comment-held gate, one layer up: a record said done, the ledger said otherwise, and the two never met.

What was done

  • The backlog re-opened as a HANDS item with the arithmetic in it (--days 110, not 60 — 60 reaches only back to 08-28), and the Done line corrected rather than deleted, so the half-close stays visible.
  • The gate's release condition recorded in the code, at the reader and in the armed test's docstring: the lookup question is settled, the remaining precondition is the backfill, and the ordering (backfill, THEN wire) is the thing that keeps the alarm clearable.
  • The test assertion deliberately left armed. It is still the correct tripwire until the backfill lands; what it was missing is a reader who knows it can now be opened.

Carried

Once the backfill has run, wiring _gather_option_sleeve to write unrecorded_outcomes is a small queue item, and it belongs with the #270 follow-up the steward already identified (carry the sweep's not-found / lookup-error counts into the committed run_summary, so the vrp signal reaches a file a detector reads rather than the box's stdout). Until then vrp — the one sleeve where an unresolved order can leave a short option position live — is the one sleeve with no outcome alarm at all.

One caveat the backfill operator needs, from the same evening

Panel run 45 (#294, filed this morning) independently found that get_order_by_client_id wraps the broker call in a bare except Exception: return None, and the sweep files a None return as not_found — the bucket whose own comment says no future sweep will resolve it either. A rate limit, a read timeout or an expired key during the credentialed backfill will therefore print as a permanent book-vs-broker divergence, with order ids named. That matters most for the nine vrp orders from 2026-07-13 → 08-24, which #285's dry run did not cover. A not found from that run is unproven until it reproduces; the structural fix is RCX-1's reopened condition (c), not this item.

The generalisable rule

A gate held open by a condition should name where that condition will be recorded when it is met. "Wire this only after X is answered" is a complete instruction for the person writing the gate and an incomplete one for everyone after, because the answer arrives somewhere else. For this repository the cheap version is: a gate whose release is a prerequisite goes in ops/HANDS.md or a queue row at the moment the gate is written, not only in the comment beside it.