feat: add LF reducer stock coverage gate

This commit is contained in:
ZE-TH5-AR516 committed 2026-11-27 11:07:48 +08:00
1 parent a017c4b48c
commit f1099c84dd
6 files changed
+391 -19

No files matched your search

@@ -44,8 +44,8 @@ Stop if:
- AR51 confirmed on 2026-10-15 that the upstream API already accounts for available inventory and explicitly cancelled local inventory deduction, 95% yield adjustment and rounding to five. Follow `docs/production_quantity.md`.
- Treat the user's positive integer quantity as original demand `D`. Query each model exactly once through the controlled script with `quantity=D`, unchanged. Preserve `D` in continuation context and pass it unchanged for every newly queried candidate.
- Inventory accounting and delivery calculation belong to the upstream API. Do not calculate a local production quantity, send a reduced or inflated quantity, or issue a second production query.
- Display each model's own returned inventory coverage against original demand. A displayed inventory gap is informational and must not become a new API quantity. Missing or invalid stock means unknown coverage, never zero; do not discard valid API workdays/date solely because inventory display is unavailable.
- Inventory accounting and delivery calculation belong to the upstream API. Do not change the API query quantity or issue a second production query. The sole local quantity check is the LF stock gate below, which validates the upstream compact stock fields without recalculating AR836 delivery dates.
- Display each model's own returned inventory coverage against original demand. A displayed inventory gap is informational and must not become a new API quantity. Missing or invalid stock means unknown coverage, never zero; do not discard valid API workdays/date solely because inventory display is unavailable, except that a generated LF candidate must be removed when its mandatory stock-gate fields cannot be verified.
- Remove the obsolete partial-stock/production-quantity shortcut rejection. API failures and missing or invalid workdays/date retain existing error handling.
- Replies show original demand per model. Hide the technical explanation lines `数量传递规则`, `库存覆盖口径` and `API查询数量` in both initial and continuation replies, along with the obsolete local net-demand or production-quantity fields. New internal records preserve the actual API quantities and quantity rules for traceability; leave historical records unchanged.
@@ -126,6 +126,22 @@ Do not use temporary curl, WebFetch, or any API method outside the controlled sc
final batch explicitly states that all rule candidates have been queried.
- Missing or unsupported models count as queried positions and remain summarized
under `不可用候选`; do not silently skip them to pull later candidates forward.
- LF candidates rejected by the stock gate are not API-unavailable candidates. Omit
them entirely from the report, fastest comparison, candidate counts and
`不可用候选`, without pulling later rule positions into the current batch.
## LF Reducer Stock Gate
- Apply this gate only to generated LF candidates, identified by `(Vx)`.
- Read `现货数`、`需排产数`、`对应来福减速器编码`、`减速器实际可用量` from `data.库存信息`.
- `现货数` means the finished product's actual available quantity after AR836 has deducted valid sales-order quantities waiting for locking/reservation.
- Require `需排产数 = max(原始需求数量 - 现货数, 0)`.
- If `需排产数 = 0`, the finished-product stock covers demand and the candidate passes without reducer replenishment.
- Otherwise require a matched LF reducer code and `减速器实际可用量 >= 需排产数`.
- Missing, invalid, inconsistent or insufficient fields reject the LF candidate. Purchasing in transit, inspection stock, fixed lead time and future replenishment must not rescue it.
- Show `现货数` and `需排产数` for retained results. Show the matched LF reducer code and actual available quantity for retained LF candidates that need production.
- If `逾期待复核销售订单` is returned, show its sales-order code and request human review. Never release stock automatically.
- The original input model remains the baseline; this generated-candidate gate does not hide the user's original model.
## Unavailable Result Reasons
@@ -195,7 +211,7 @@ Use this field order for a successful Feishu report:
1. {model}({candidate type and reducer brand})
- 需求数量:{input quantity}台
- AM516预测交期:{API workdays}个工作日,最终交货日期:{API final delivery date}
- 可用库存/覆盖情况:{summary-level inventory and coverage only}
- 现货/排产情况:现货数{actual available finished goods}台;需排产数{remaining production quantity}台
- 主导因素:{main factor}
- 推荐理由:{rule-based recommendation reason}
- 差异项:{field changes formatted as `字段 原值→新值`; join multiple changes with `;`, for example `编码器 HS→HM;品牌 DZ→LF`}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.