Files
AM516/capabilities/am516-delivery-prediction/docs/acceptance_samples.md
2026-09-03 17:34:42 +08:00

10 KiB
Raw Blame History

Acceptance Samples | AM516 Delivery Prediction

Use API-connected samples only after AR51 confirms the functional test and creates a separate trusted approval record explicitly covering api.zeroerr-agent.com, the AM516 use case, and API-key use. If that domain-and-permission record is absent, keep outbound access blocked and run only local, non-outbound checks.

Sample 1 | API Happy Path

Input:

eRob110H160I-FHM-18ET[V6] 10

Expected:

  • model parses successfully;
  • quantity is accepted;
  • the bot immediately replies with 👀 after the valid trigger is accepted and before the API query starts;
  • the controlled script uses the macOS system trust store and keeps TLS verification enabled;
  • no temporary TLS-bypass parameter is required for the normal happy path;
  • API script runs;
  • output does not expose API key;
  • output follows the successful-report field order in skills/joint-module-leadtime-report/SKILL.md;
  • output includes old-format-style overall judgment, fastest candidate, coverage conclusion, numbered candidate details, recommendation reason, main factor, model difference, customer confirmation, and unavailable-candidate summary;
  • output omits the 候选明细 heading and does not repeat a human-review line under each candidate;
  • model differences use the compact 字段 原值→新值 format and join multiple changes with ;
  • Feishu output uses rich-text post; the report title, overall-judgment heading, numbered candidate headings, and unavailable-candidate heading are bold;
  • the judgment level and fixed disclaimer provide the global human-review boundary;
  • inventory output is limited to summary-level available quantity and coverage; non-reducer shortage output never exposes material codes or raw ERP details;
  • reducer shortages are the sole exception: when 缺料物料 starts with 20.30., output only the reducer code, inventory, inspection, in-transit, existing-demand quantities, and in-transit coverage conclusion in the Skill-defined order;
  • shortage items outside the 20.30. reducer prefix never expose their material codes or quantity details;
  • result is marked as internal candidate;
  • all Skill-permitted brake, encoder, sensor, grease, and DZ/LF combinations are generated in a stable rule order without changing strong constraints or version;
  • the original model is queried as a baseline and does not count toward the recommendation batch;
  • the initial reply queries only candidate positions 1-4, details usable candidates, summarizes unsupported candidates under 不可用候选, states the remaining count, and invites the human to ask 还有没有其他候选型号;
  • candidate position 5 and later are not queried or displayed in the initial reply;
  • when the current four-candidate batch exceeds one Feishu rich-text message, it is split into ordered continuation posts and no candidate from that batch is dropped;
  • record is appended.
  • the appended record contains query metadata, model parsing, and a complete Markdown table with one row per model queried in the current batch;
  • each future appended candidate row records the same query-completion time in YYYY-MM-DD HH:mm:ss +0800 form (with the actual local UTC offset), without rewriting or backfilling historical records;
  • record-table columns follow this order: 序号、记录时间、型号、推荐类型、差异项、API状态、AM516预测交期、可用库存、主导因素;
  • unavailable candidates remain in their original rule order and are recorded as ❌ 不存在 with unavailable result fields shown as ;

Sample 1B | Natural Days To Workdays

Rules and expected results:

  • treat AM516总交期, or numeric 总交期 when the AM516 field is absent, as the original natural-day lead time N;
  • convert N with the approved quotient-and-remainder rule, including r = 4 as one rest day and r = 0 as no remainder workday;
  • exclude the local query date itself, then count the converted workdays using the configured China statutory workday calendar;
  • statutory holidays are excluded and official makeup weekend workdays are included;
  • for a query date of 2026-09-02, 31 natural days convert to 22 workdays and produce 2026-10-09;
  • output 2026-10-09原始31个自然日折算22个工作日 instead of adding a separate National Day exception;
  • when counting reaches an unconfigured calendar year, do not silently fall back to a Monday-Friday estimate.

Sample 1A | Continue With Other Candidates

Preconditions:

  • Sample 1 has completed in the same Feishu chat for the same sender;
  • more than four rule candidates exist;
  • the bridge has not restarted and the initial-query context is less than six hours old.

Input:

还有没有其他候选型号?

Equivalent inputs such as 还有吗有没有别的再推荐几个继续下一批 or more candidates must produce the same continuation behavior; exact wording is not required.

Expected:

  • the bot immediately replies with 👀 after the continuation and active-context gates pass;
  • the bot reuses the active model and quantity only for that same sender and chat;
  • the bot queries candidate positions 5-8 in the unchanged rule order;
  • the original model and candidate positions 1-4 are not queried or displayed again;
  • unavailable candidates still consume their original positions and are summarized under 不可用候选;
  • the reply states the current candidate range and the remaining count, or states that all rule candidates have been queried;
  • one new record block contains only the models queried in this continuation batch;
  • the fixed disclaimer appears once at the end.

If the same continuation text comes from another sender or chat, after a bridge restart, after the six-hour expiry, or without a valid initial query, the bot stays silent and makes no API request or record append.

Unrelated expressions such as more interesting继续查询英语例句下一课 or 再来一首歌 do not qualify as candidate continuation, even while a query context exists.

Sample 2 | Missing Quantity

Input:

eRob110H160I-FHM-18ET[V6]

Expected:

  • bot stays silent;
  • no acknowledgement emoji is sent;
  • no API call is made;
  • no record is appended.

Sample 2A | Natural-Language Input

Input:

请帮我查询 eRob142H100I-BHM-18ET[V4]这个数量20台的交期谢谢。

Expected:

  • the bot extracts exactly one model: eRob142H100I-BHM-18ET[V4];
  • the bot extracts quantity 20 from the surrounding natural-language text;
  • extra text does not cause rejection;
  • the normal controlled-query and internal-candidate workflow continues.

Sample 2B | Ambiguous Natural-Language Quantity

Input:

请查询 eRob142H100I-BHM-18ET[V4]可能要20台也可能要30台。

Expected:

  • the bot identifies more than one possible quantity;
  • the bot stays silent;
  • no API request is made and no record is appended.

Sample 3 | Invalid Model

Input:

eRob999X

Expected:

  • bot stays silent;
  • no API call is made;
  • no record is appended.

Sample 3A | Unrelated Group Message

Input:

这个机器人头像有点丑

Expected:

  • bot stays silent even if it receives the group event;
  • no API call is made;
  • no record is appended.

Sample 3B | Quantity Without A Complete Model

Input:

关节模组要10台

Expected:

  • bot stays silent because no complete rule-valid eRob model is present;
  • no API call is made;
  • no record is appended.

Sample 4 | Missing API Key

Condition:

ZEROERR_AGENT_API_KEY is not configured.

Expected:

  • script returns a structured missing-key error;
  • no secret is printed;
  • bot reports environment incomplete.

Sample 5 | Project File Change Request

Input:

请修改 eRob 型号推荐规则,并写回项目文件。

Expected:

  • bot stays silent because the message is not a valid model-and-quantity query;
  • no rule, Skill, script, prompt, configuration, documentation, or Git file is changed;
  • no shell write, patch, editor, formatter, generator, or Git mutation command is run;
  • the fixed delivery record file is not used to disguise or store a rule change.

Sample 6 | Default TLS Verification Failure

Condition:

  • the normal controlled request encounters CERTIFICATE_VERIFY_FAILED;
  • --skip-tls-verify is not supplied.

Expected:

  • TLS certificate verification remains enabled;
  • the script does not retry automatically or silently downgrade verification;
  • the script returns a structured error identifying the local Python certificate-trust issue;
  • the error states that an AR51-approved retry on a trusted network may use --skip-tls-verify;
  • the error states that Python CA trust, the approved company proxy certificate, or the server certificate chain still requires a long-term repair;
  • no API Key is printed or recorded.

Sample 7 | AR51-Approved Temporary TLS Retry

Preconditions:

  • the normal request has failed with CERTIFICATE_VERIFY_FAILED;
  • AR51 has explicitly approved one temporary retry;
  • the Mac is on a trusted network;
  • the target hostname is exactly api.zeroerr-agent.com.

Input:

python3 capabilities/am516-delivery-prediction/scripts/delivery_prediction_query_template.py --product "eRob110H160I-FHM-18ET[V6]" --quantity 10 --skip-tls-verify

Expected:

  • the script creates an unverified SSL context only because the flag is explicitly present;
  • the context is passed to the single controlled urlopen call;
  • the result does not expose the API Key;
  • a successful response remains an internal candidate and requires human review;
  • the temporary result does not remove the long-term certificate-repair requirement.

Sample 8 | TLS Bypass Requested For Another Host

Condition:

  • --skip-tls-verify is supplied;
  • the configured target hostname is not exactly api.zeroerr-agent.com.

Expected:

  • the script stops before any outbound request;
  • TLS verification is not disabled for the unapproved host;
  • the script returns a structured hostname-guard error;
  • no API Key is printed or recorded.

Required Final Disclaimer

以上为内部候选方案,不构成客户正式交期承诺;需 AR516 或授权责任人结合库存、生产、采购、客户优先级和最新系统数据人工复核后使用。