A-Share Quant Research Agent: Announcement Sentiment Factors and Report Verification

    This article describes how an A-share quantitative research workflow can be rebuilt as a reproducible agent system. It covers a deterministic compute layer and a constrained reporting layer, a seven-node pipeline, six persisted tables, dual-channel announcement sentiment factors, a fact whitelist with numeric checks, and an honest negative result under a fixed sample and evaluation setup.

    1. Problem Definition: From a Research Bundle to a Runnable System

    In A-share quantitative research—A-shares being shares of mainland China companies listed on domestic exchanges—announcement text, market data, factor calculation, model training, backtest evaluation, and research-report generation are often scattered across scripts, spreadsheets, and manual notes. A study may appear to run during research, yet become hard to reproduce, explain, or hand off. Three problems show up repeatedly. First, data definitions and sample splits are not fixed, so another run changes the result. Second, model metrics and backtest net values are not stored in one place, so it is difficult to answer whether a given factor actually contributed. Third, reports written by a large language model may read fluently while citing numbers that did not come from the actual calculation and cannot be traced or checked.

    The goal here is not a more complex model. It is to rebuild an A-share quant research bundle as an agent system that can run, be verified, and be reproduced. The system must answer four questions: how to engineer the research workflow; whether the announcement sentiment factor changed strategy net value over the sample period; how to make LLM-generated reports traceable and checkable; and how to report a negative result honestly. Around those questions, the system uses a dual mode of rules and a large language model, a seven-node orchestration, six persisted tables, a fact whitelist, and numeric validation. Checks are placed inside the engineering flow rather than left to a manual review after the report is written.

    The experimental conclusions apply only to the given dataset, the fixed sample split, and the given evaluation definition. They are not a general judgment about announcement sentiment factors in other market regimes, other stock universes, or other holding periods.

    2. Overall Architecture: Rules for Determinism, an LLM for Expression

    The system has two layers: a compute layer and an expression layer. The compute layer handles data ingestion, cleaning, factor construction, sample splitting, model training, backtest evaluation, and fact-table generation. It must be deterministic, testable, and repeatable. The expression layer turns fact tables into a research report. It may use a rule template or a large language model, but every number must come from the fact whitelist.

    Rule mode is suited to stable output: fixed templates, fixed metrics, and fixed sections. It is controllable and regression-testable, but the language is uniform. LLM mode is suited to explanation and synthesis: it can write more natural paragraphs from the fact tables, but it must stay inside the fact whitelist and numeric checks. The two modes are not alternatives in parallel. They form a fallback relationship. If LLM generation fails, numeric checks fail, or required facts are missing, the system falls back to the rule template so a report can still be delivered.

    Orchestration uses a directed graph of task dependencies. Each node has explicit inputs, outputs, failure handling, and validation rules. Nodes pass structured state only; they do not read one another’s internal variables. That supports single-node tests, contract tests, and end-to-end regression. At deployment time, the compute layer can run in a general-purpose container or batch job. Data and fact tables can sit in a general relational store. Logs and monitoring use ordinary logging and alerting. The design is not tied to a specific vendor.

    3. Seven-Node Orchestration: Verifiable Steps

    The seven nodes are:

    1. Ingestion. Read announcement metadata, market data, and the base stock universe. Record the data version, time range, and row counts. Checks include primary-key uniqueness, date coverage, and a missing-rate threshold.
    2. Announcement cleaning. Drop items with no body, duplicates, and clearly irrelevant announcements. Normalize announcement type and time fields. Write a cleaning log with filter reasons and counts.
    3. Factor construction. Build the announcement sentiment factor and control factors. Sentiment comes from two channels: a rule lexicon and an LLM judgment, each kept with a confidence score and a source flag. Controls include generic variables such as size, volatility, and momentum.
    4. Sample split. Build train, validation, and backtest indexes from a fixed time range and a fixed random seed, and save the split table. Every model evaluation must reference that table so the sample is not re-split on each run.
    5. Model training. Use a gradient-boosted tree as the primary model. Emit feature importance, cross-validation metrics, and a model version. Before training, run a feature-leakage check so factors use only information available at announcement publication time.
    6. Backtest evaluation. Compute net value under unified fees, holding period, and rebalance rules. Store daily net value, turnover, drawdown, and ablation results.
    7. Report generation. Read the fact whitelist and call either the rule template or the LLM. After generation, extract numbers and recompute them against the facts. On failure, retry or fall back.

    A structured configuration can be abstracted as:

    1. nodes:
    2. - ingest
    3. - clean
    4. - build_factor
    5. - split_sample
    6. - train_model
    7. - backtest
    8. - generate_report
    9. guards:
    10. schema_contract: strict
    11. fact_whitelist: enabled
    12. numeric_check: strict
    13. fallback: rule_template

    The value of the seven nodes is that research steps become a state machine. Each node can be rerun alone, and a run can resume from a failed node. The backtest and report nodes are not black boxes; they depend on fact tables written by earlier nodes.

    4. Six Persisted Tables: Every Claim Returns to Data

    The system stores six kinds of tables: a raw announcement table, a factor wide table, a sample-split table, a model-metric table, a backtest net-value table, and a report fact table. The raw announcement table holds announcement metadata and cleaning flags. The factor wide table holds stock, date, factor value, factor source, and confidence. The sample-split table records whether each sample row is train, validation, or backtest. The model-metric table stores per-fold AUC, IC, feature importance, and model version. The backtest net-value table stores daily net value, benchmark net value, turnover, and drawdown. The report fact table stores the key-value facts a report is allowed to cite, such as sample row counts, AUC, IC, net value, and ablation difference counts.

    The point of these tables is not merely that they are saved. The report may cite only the fact table. The report node does not query the raw wide tables directly, and the language model is not allowed to compute numbers on its own. Each whitelist key has a type, precision, source table, and generation time. Examples include five_fold_mean_auc=0.5024, mean_ic=0.0086, final_nav=0.8456, ablation_diff_rows=254, and ablation_diff_value=0.0. If the report must say whether net value changed after the sentiment factor was removed, it may cite only the ablation facts. The model may not infer that from context.

    An illustrative fact-table layout:

    1. fact_key fact_value source_table precision
    2. five_fold_mean_auc 0.5024 model_metric 4
    3. mean_ic 0.0086 model_metric 4
    4. final_nav 0.8456 backtest_nav 4
    5. ablation_diff_rows 254 backtest_nav 0
    6. ablation_diff_value 0.0 backtest_nav 2

    5. Announcement Sentiment: Rule and LLM Channels

    The announcement sentiment factor is not a simple count of bullish or bearish words. The system uses two channels. The rule channel applies a domain lexicon, negation words, intensity words, and announcement-type rules, and produces an interpretable score. The LLM channel classifies the announcement summary and returns a category, a confidence score, and an evidence span. Both results are stored, then a fusion rule produces the final factor value. Source flags are kept so later ablation and error analysis remain possible.

    To prevent future-information leakage, factor construction treats announcement publication time as the availability timestamp. Returns are measured from the next tradable timestamp. Special cases such as suspensions, duplicate announcements, and corrections are flagged in cleaning and handled by unified rules in the backtest. After factors are built, distribution checks cover coverage, the share of extreme values, stability of daily means, and rank correlation between the factor and subsequent returns.

    6. Fact Whitelist and Numeric Checks: Claims Must Be Recomputable

    Report generation has four steps. Load the whitelist from the fact table. Generate a draft with the rule template or the LLM. Extract every number, percentage, date, and metric name from the draft. Compare each item with the fact table. Rounding to the declared precision is allowed; unsourced numbers are not. If validation fails, the system records the reason and retries once. If the retry still fails, it falls back to the rule template.

    Pseudocode:

    1. facts = load_fact_whitelist()
    2. draft = generate_by_template_or_llm(facts)
    3. for claim in extract_numeric_claims(draft):
    4. if not exists_in_whitelist(claim.key):
    5. fail("unknown fact")
    6. if not match_precision(claim.value, facts[claim.key]):
    7. fail("numeric mismatch")
    8. if failed:
    9. draft = render_rule_template(facts)

    Numeric checks also include semantic-direction checks. For example, when AUC is near 0.5, the report must not say the model has significant discriminative power. When net value is below 1, it must not say the strategy earned a positive return. Thresholds are bound to wording templates so LLM polishing does not overstate weak results.

    7. Results: A Negative Result Is Still a Deliverable

    Under the fixed sample and fixed split, the system reports a five-fold mean AUC of 0.5024, an IC of 0.0086, and a final net value of 0.8456. AUC near 0.5 means that, under the current features and label definition, discrimination is close to random. IC near zero means the rank correlation between the announcement sentiment factor and future returns is very weak. Net value below 1 means the given backtest definition did not produce a positive return. In an ablation that removes the announcement sentiment factor, the row-by-row net-value difference across 254 rows is 0.0. Over this sample period, the sentiment factor did not change strategy net value.

    That result should not be packaged as “the factor works, but the market is complex.” A stricter statement is: under the current dataset, sample split, holding period, and transaction-cost assumptions, the announcement sentiment factor showed no observable incremental contribution. The negative result still has value. It supplies a baseline and warns later work not to publish only successes. It exercises ablation and row-level net-value comparison. It also shows why the report system must be constrained by numeric checks; otherwise a weak result is easily rewritten as a strong conclusion.

    8. Implementation Checklist and Limits

    Keep these checks in place: snapshots of data version and row counts; a sample-split table generated once and versioned; model metrics and backtest net values stored by run ID; a fact whitelist written only by compute nodes; a report node that only reads the fact table; an audit trail whenever numeric checks fail; and a rule template that remains available. LLM calls should go through a compatibility abstraction so business code is not bound to one provider, with structured output constraints and a retry cap.

    The limits are equally explicit. This work covers only the given dataset and split. It does not show how the factor behaves in other stock universes, announcement types, or holding periods. AUC and IC near random do not prove that announcement text contains no information; the metric definition, label window, or fusion method may simply be a poor match. Net-value results depend on fees, slippage, and rebalance rules. Later work should extend out-of-sample tests, run stratified ablations, inspect heterogeneity by announcement type, and add more fact keys to the whitelist. The boundary of the conclusion should stay fixed: the system can run, reports can be traced, and numbers can be checked. Whether the factor is useful must be decided by the data.