Uniform plugin contract
Facts first, then a handle, then judgment.
Every implemented plugin is supposed to expose the same interaction shape. The first reply stays compact; drill-down recovers the source leaves. The model owns interpretation unless a cited contract assigns a purely mechanical choice to the plugin.
Exact input identity
Every tool call names the track, listing or instrument, scope, time basis, requested operation, and instruction receipt. An ambiguous ticker is a failure, not a guess.
Typed information states
Known, unknown, not obtained, unavailable, conflicting, decode failure, unperformed, truncated, cancelled, and externally blocked facts stay distinct. Unknown stays unknown.
Compact first response
The first model-visible reply is targeted below 500 tokens: scope, coverage, important limitations, a stable content-bound handle, and neutral available operations.
Bounded drill-down
Ask for the handle to recover original lexemes, source leaves, formula trees, alternatives, and correction lineage. Details used only by the renderer are not model context.
No silent repair
Budgets, pagination, truncation, and cancellation are explicit. Failure never falls back to another provider, track, date, filing, or persisted namespace.
LLM owns judgment
Plugins expose facts, calculations, read-only state, and non-executing effects. Interpretation, thresholds, recommendations, authorization, and every market action stay with the user and the model.
Five context layers
Every conclusion should be traceable down the stack.
Validated identity
Track, MIC or venue, board, listing, share class, status, currency, timezone, and effective date—never just an ambiguous ticker.
Canonical observation
The source value plus as-of and retrieval time, freshness, unit, adjustment, quality, and entitlement. Unknown fields remain unknown.
Evidence and provenance
Content receipts, provider and document identifiers, source versions, hashes, correction lineage, gaps, duplicates, and conflicts.
Typed calculation
Inputs, formula or expression tree, period and filing coherence, output unit, rounding assumptions, and complete source leaves.
Decision record
A plan, scenario, thesis, replay, portfolio change, or journal entry with its assumptions and source receipts—not an executable instruction.
Canonical observation
The value travels with its caveats.
Provider-backed facts are normalized into an observation envelope. Individual tools add domain fields, but must not flatten away source control or invent unavailable metadata.
{
"track": "cn",
"identity": { "mic": "XSHG", "symbol": "600519" },
"value": { "close": "1438.00", "currency": "CNY" },
"source": "selected-provider-id",
"as_of": "2026-08-11",
"retrieved_at": "caller-clock timestamp",
"freshness": "completed_daily",
"adjustment": "explicit policy",
"quality": ["provider_observation"],
"entitlement": "declared or unknown",
"receipt": "content-bound identifier"
}Ask for the audit view
Make hidden assumptions visible before analysis.
Before answering, show the exact listing identity, track, selected provider, as-of and retrieval times, freshness, units, adjustment policy, quality labels, entitlement or rights limitations, calendar and rule versions, gaps, conflicts, and receipt identifiers. Keep unknown facts unknown.
Model content versus terminal display
Complete inputs can stay visually quiet.
CN, HK, and US daily history/OHLCV acquisition tools send every bounded exact row to the model as compact CSV, alongside the track, provider, identity, currency, adjustment, retrieval time, and receipt identifier needed to interpret it. This lets the model construct SMA, RSI, and ATR inputs without claiming that the daily values are unavailable. Compact indicator results send the latest and requested prior numbers to the model while the TUI renders a concise first line; exact receipt handles remain available without echoing the full series again. Intermediate projection is reserved for explicit full-series drill-down.
Buy-now, sell-timing, entry, exit, stop, and target questions are evidence-seeking prompts rather than permission to answer from general knowledge. Unless you explicitly ask for education only or decline fresh lookup, the agent should use the active track's read-only quote and bounded OHLCV tools, calculate relevant installed indicators, and then give a conditional scenario. Trade-plan calculations require their exact risk inputs, and order-path simulation requires an exact proposed order; neither should block ordinary market-evidence collection.
Pi shows only the first summary line while the tool result is collapsed. Expanding it reveals the CSV. The complete structured result and receipts remain in tool details for session and renderer use; details alone are not model context, so model-required values must remain in textual content.
Fetch one bounded daily OHLCV series for the active track. Confirm that the CSV rows are readable, state the exact adjustment and currency, then calculate SMA, RSI, and ATR from those rows. Do not claim the values are unavailable and do not infer unknown volume or calendar facts.
Deliberately excluded
Some information must never reach the model.
- Environment values, API tokens, secret keys, cookies, and brokerage credentials.
- Unbounded raw account exports or private documents that have not passed a reviewed import boundary.
- Write-capable broker authority, executable order instructions, or order-mutation handles.
- Facts silently borrowed from another provider, market track, date, filing, or persisted namespace.
- Unsupported certainty about rights, service level, correction coverage, completeness, or authenticity.