[Tracker] Maintainer roadmap review: grounding policy surface, loader health, loop split, channel recipe, connector bring-up

Author: he-yufengCreated Sep 28, 2026Updated Sep 28, 2026

Maintainer roadmap review, late September 2026

I spent a pass over the whole tree as a maintainer this week: module sizes, test shape, CI lanes, the last two weeks of merges (50 fix vs 5 feat, so this is where the effort actually goes), the open issue list, and the safety-critical surfaces. This is the state of the project plus what I think we should do next, in priority order. Numbers are from main at 0244ecea. Discussion welcome on any item; nothing here is frozen.

What is in good shape (so we don't touch it)

  • Live safety chain. The order gate is fail-closed end to end (mandate, expiry, halt flag, account binding, quote-derived notional cap, audit event per decision, no silent retries), and the test floor around it is real: 12 dedicated suites for mandate enforcement, halt, kill-switch, audit redaction, and account binding. We should keep the rule that no live-order path merges without one of those suites going red-first.
  • Backtest accounting. After the caliber work this month (#1233, #1311, #1317), short-side PnL, splits/dividends restatement, and mixed-caliber frames are all covered by regression tests, and served frames carry their price-adjustment caliber so a basket that mixes calibers warns instead of silently miscomputing.
  • Docs and tests hygiene. 944 source files against 730 test files, eight TODO markers in the whole tree, and both Python versions green in CI. That is unusually clean for a project moving this fast.

What the merge log is telling us

The last two weeks are fifty fixes to five features, and the same directories keep coming up. That is the roadmap input.

1. Grounding: from per-rule patches to a policy surface

agent/src/agent/grounding/ (evidence, figures, identity, policies, release) is the most-edited area in the tree right now, and policies.py grows one regex or role rule per incident. That model does not converge: every new failure mode lands as another patch, and the interactions between rules are getting hard to reason about (the localized-number handling fixes in #1588 and #1584 are the same root repeating).

Proposal: promote the grounding checks to a declared policy surface, one entry per check with an explicit severity (block / warn / log), a fixture pair (pass + fail), and a name that shows up in the run card. The verifier walks the registry instead of the current ad-hoc call graph. That turns "add a rule" into "add a row", gives us a changelog of what the verifier enforces, and makes the Trust Layer story (#1613, landed in #1618) inspectable instead of implicit.

2. Data loaders: health monitoring, not just correctness fixes

Three of the recent loader bugs share one shape: the source drifted or died and we found out from a user. The northbound net-flow feed went dead in August 2024 and we shipped empty envelopes until #1481; baostock's client has no read timeout (#1492, fix in #1615); the A-share qfq caliber needed a conversion layer (#1541, #1551 in review).

Proposal: a scheduled loader-health lane (weekly, not per-commit) that hits each live source with one canary query and records shape-of-answer checks, plus a per-loader contract test that pins the fields we depend on. The loaders already have a uniform registry, so this is one harness, not N bespoke jobs. When a source drifts, we want a failed health lane before a user files the issue.

3. Agent loop decomposition

agent/src/agent/loop.py is 3,468 lines and one of the most-touched files. It currently owns tool dispatch, grounding hooks, streaming, compaction triggers, and provenance recording all at once. The recent fixes in it (#1599, #1601) were each small but required reading a lot of unrelated state.

Proposal: split along the seams that already exist informally (tool-call lifecycle, streaming/events, grounding plumbing) into modules under agent/src/agent/, keeping loop.py as the orchestrator. No behavior change; each extraction lands with the existing suites going green. This is prep work for the channels growth below, because every new channel currently deepens the loop's coupling.

4. Channels: one guided recipe instead of N one-offs

Three open issues ask for new IM channels (Feishu #1614 and friends), and channelsui (36 files) keeps growing per-channel config code. Proposal: one channel-authoring contract with a guided Web UI recipe (schema-driven, like the Feishu ask), so a new channel is a manifest plus tests rather than bespoke UI work. This month's channel fixes (#1544's secret-masking hints, #1476's duplicate-reply suppression) each had to be made per-channel; the shared rules belong in the contract.

5. Broker connectors: an explicit bring-up checklist

The broker tracker (#1367) already lists what a new broker needs. Two additions from this month's evidence: a connector capability matrix in the docs (which read tools, quote paths, and order types each connector actually has, generated from the manifest rather than hand-maintained), and an options-ordering story (#1435) that reuses the mandate quantitative caps rather than a parallel gate.

Explicitly not now

  • No second cache/consensus layer for the grounding ledger; the current one is not the bottleneck, the rule sprawl is.
  • No rewrite of the factors library (477 files). It is large but stable, and the churn is elsewhere.

How to help

Each numbered item starts as its own issue before code (this tracker stays the index). 1 and 2 are the ones I would most like review on before I start, since both touch contracts other code depends on. If you are hitting a grounding or loader failure mode that is not listed here, file it with a repro and it will land in one of these two buckets.