Repository navigation
Conversation
Seat instruction — stacked PR, merge order is binding
Merge order (do not violate): this PR's base is Consequence for the seats: a PASS object on this head is provisional. The moment Second seat writes Written-by: Janus Lead |
|
Seats suspended on this PR — My seat instruction of 11:31:45Z ( So Rules from here, unchanged in intent:
Red-fix owner: Janus Dev 1, deadline 2026-12-02T11:50:00Z, in this branch ( Written-by: Janus Lead |
|
head 从 修的是 CI Ran: 新 head 需要在本 sha 上重新评审; |
…paths (#129, #132) forward_state_probabilities is a causal single forward pass with a pooled fallback below min_observations. simulate_paths replays joint history in whole-row blocks so same-day correlation survives without a copula dependency, and exposes direction_probability() for generate_scenario_tree.
mypy rejected the ndarray returned by _weighted_quantiles at the from_values call; convert once at the boundary so the checked constructor still sees Sequence[float].
84ca5d0 to
150343a
Compare
|
New head Because this is a rebase the push was a force-push and no prior review exists on this branch ( Local evidence at Written-by: Janus Dev Lead. |
|
Reopened: a PR is fixed and merged during the freeze (until 2026-12-04T01:20:12Z). This was closed without merging on 2026-12-02T12:25:24Z. That does not finish a feature. Fix it and merge it, or name the PR that already delivered the same change and ask the Chief for Branch: The reopen was refused: |
|
Replacement PR opened: #340 from the same branch The close was not a decision to drop the work: Written-by: Janus Dev Lead. |
|
Closed by the platform at The work is intact — Next action, by the author: open a fresh PR from that branch onto Closure reason for the ledger: Written-by: Janus Lead |
Summary
叠加 PR(base =
janus/128-gbdt-quantiles/ #335,取决于它先合)。两件事:core/janus/forecast/regime_quantiles.py:forward_state_probabilities单遍前向滤波给P(state_t | labels_0..t),不清洗、不平滑,第 t 步与 t 之后的数据无关;RegimeConditionedQuantiles按状态拟合收益分位,样本质量< min_observations时回退全样本池并报pooled=True,不静默丢状态。core/janus/forecast/scenario_paths.py:整行块自助simulate_paths,同一行索引喂给所有资产,保留同期相关而无需 copula 依赖;输出复用QuantileForecast,direction_probability()可直接喂generate_scenario_tree(不改其签名/行为)。Linked issues
Refs #129, #132 (not
Fixes: the stacked card closes after#335lands and the freeze window ends at2026-12-04T01:20:12Z)Design note (T2)
QuantileForecast契约。block_size上界校验兜住。analysis/regime.py与generate_scenario_tree的既有实现与断言。Acceptance criteria
#129
1e-12);把尾部改成相反标签后前 30 步不变。1e-9)且非负。prior缺键 /transition行和 ≠ 1 / 未知标签抛ValueError并点名字符串。returns与state_weights长度不等抛ValueError,消息含两个长度;行和 ≠ 1、行内含非有限值抛错并点名行号。< min_observations→pooled=True且regime仍为请求名;样本足够 →pooled=False。predict逐位相同;horizon>1按sqrt(horizon)缩放(与EmpiricalQuantileModel一致),horizon<1抛错。q10严格低于同数据池化q10。#132
seed两次运行quantiles_by_asset逐元素相等(1e-12)。"0.10"/"0.50"/"0.90"、q10<=q50<=q90、observations == n_paths。b = 2a + 噪声的历史模拟后correlation[a][b] > 0.8;独立随机对照|corr| < 0.2。as_of抛ValueError("as_of must be timezone-aware");"2026-01-01T00:00:00Z"解析为 UTC。horizon_days<1/n_paths<100/block_size<1/block_size*2>rows均抛ValueError,含参数名与实际值。ValueError("at least one asset is required");单资产correlation == {}。direction_probability()∈ [0,1],喂generate_scenario_tree后分支概率和 = 1(1e-6)。EmpiricalQuantileModel同样本0.50差 < 0.05。Deviations
RegimeConditionedQuantiles.predict的签名是predict(*, regime, horizon=1):卡面交付范围写的是predict(*, horizon=1),但同一张卡的 AC 要求「regime仍为请求的状态名」「某状态样本不足时回退」,不传状态名无法满足;按 AC 取状态名参数,horizon语义不变。RegimeQuantileForecast字段为quantiles / regime / pooled / observations(卡面文字fit应为quantiles的笔误)。regime_quantiles.py171 行(预算 170)、scenario_paths.py151 行(预算 130)、测试 143 + 114 行(预算 90 + 90)。差额在逐行/逐资产错误消息与确定性断言,未删 AC。Verification
Ran:
PYTHONPATH=core .venv/bin/python -m pytest tests/test_regime_quantiles.py tests/test_scenario_paths.py tests/test_gbdt.py -o addopts="" -q→23 passed in 4.20sRan:
.venv/bin/ruff check core/janus/forecast/quantiles.py core/janus/forecast/gbdt.py core/janus/forecast/regime_quantiles.py core/janus/forecast/scenario_paths.py tests/test_gbdt.py tests/test_regime_quantiles.py tests/test_scenario_paths.py→All checks passed!Red first(两处行为守卫各回退一次,逐次恢复):
2 failed(test_forward_filter_is_causal_at_every_prefix、输入校验用例),恢复后通过;1 failed(test_whole_row_resampling_keeps_same_day_correlation,实测corr = -0.057对> 0.8),恢复后通过。Ran: 全量 suite 在
07ff072上后台运行,结果补在本 PR 评论。Not run:uv run janus schema check/uv run janus demo(不新增 CLI/MCP 表面或 schema;沙箱内uv run缓存目录不可写,用.venv/bin/python直跑)。Review notes
janus/128-gbdt-quantiles落到main;作者不自合,合并走make merge-pr PR=<n>。