Files
LWLT-AIBOT/.project-docs/30-worklog/tasks/20260915-dispatch-readiness-01a0858b.md
T
2026-09-15 11:34:59 +08:00

6.2 KiB

ERP list readiness and late dispatch results

Scope and gate

  • Feature task; main thread only, no subagents. Branch main, sole worktree /Users/andy/IdeaProjects/LWLT-AIBOT, base 0282c30a2aa66435a193b96b17c0022420d881b3.
  • Existing .idea/ is unrelated and preserved. Untracked release ZIP 0.5.183 is the known previous delivery and will be preserved byte-for-byte if archived. Overlap: Clear. No other worktree or overlapping source changes.
  • User asks to fix the diagnosed list-readiness and dispatch-result discrepancy. Local source/tests/release work only; no ERP access/write, task replay, deployment, restart, extension reload or external sending.

Evidence and plan

  • User-supplied records prove the same execution was accepted near the platform's four-second acknowledgement timeout, then stopped at erp_resolution with native_list_search_not_ready. Platform retained dispatch uncertainty until maintenance expiry. Exact missing page condition and cause of acknowledgement delay were not recorded.
  • Reacquire the current main-frame document while waiting for the expected list page; preserve complete-page/native-loader/search-button prerequisites and native search request verification. Add value-free readiness diagnostics. Do not retry business writes.
  • Allow authenticated same-task/execution/connection late results to resolve only dispatch-origin uncertainty when explicit read-only resolution failure proves no write. Preserve completed/cancelled/post-write uncertainty guards, including old timed-out dispatch tasks. Prevent provisional dispatch timeouts from replacing already-observed plugin progress.
  • Read stored plugin results while dispatch-origin uncertainty is pending; do not invoke ERP reconciliation or execute/re-dispatch tasks. Validate delay, missing/stale/wrong pages, outcome ordering, evidence conflicts and owner/execution boundaries.
  • Synchronize extension version, platform minimum, mapping, release ZIP/manifest and local verification evidence. Run required repository/type/control-plane/legacy/build checks. Production acceptance remains separate.

Results

  • Native list readiness now reacquires the current main-frame document at each sample, waits for the same expected path plus complete document/native loader/enabled attached search button, and reports value-free missing conditions, elapsed time, sample count and document replacements. Search consumers use the returned current document; replacement during native Ajax search stops before using stale results. Existing exact-request/HTTP completion verification remains. Worker output distinguishes readiness from not-found/login suggestions.
  • Platform acceptance timeout is 10 seconds (previously four). Existing pending dispatch tasks read only stored plugin results; late progress does not reset them to executable/running. Expired dispatch tasks offer manual “读取插件已保存结果” instead of invoking the plugin's incompatible post-write reconciliation operation. Genuine post-write uncertainty retains its manual boundary. API rejection preserves platform uncertainty instead of replacing it with an unaccepted local result.
  • Service ingestion may close only dispatch-origin uncertainty (including maintenance-expired dispatch records) using the same task/execution/original connection and complete erp_readonly_resolution page proof with no root/page/preflight write or save evidence. Other terminal states, bare flags, contradictory receipts/requests, changed connection/execution/actor and real post-write uncertainty remain blocked. A provisional timeout cannot overwrite already-observed plugin progress. Accepted late failure carries reconciled/no-write facts; an exact duplicate is idempotent and changed terminal results remain immutable. No execution/replay path is added.
  • Regression evidence: both same-path Document replacement scenarios fail against the pre-change committed adapter with native_list_search_not_ready and pass against the current adapter. 32 new tests cover native readiness/result handling, five-second acceptance, true timeout without redispatch, local-only result sync, original-context constraints, transaction commit/rollback, outcome ordering and duplicate ingestion.
  • Full checks: control plane 239/239, legacy 402/402 (641 tests total), TypeScript check and build PASS. Legacy HTTP boundary tests required local loopback-listening permission; the first sandboxed run was blocked by EPERM for those two tests, then the full rerun passed. Clean isolated-source repository checks 10/10 PASS. Original worktree remains 8/10 only because of preserved pre-existing .idea/, .DS_Store and ignored historical log residue.
  • Extension 0.5.184, platform minimum, lifecycle mapping, version assertions, active gate, README, versioned ZIP and release manifest synchronized. All 20 packaged files match source byte-for-byte. Original 0.5.183 ZIP and manifest preserved unchanged in the dated release archive. No input/Skill/DOCX/parser/database migration changes.
  • Main-thread read-only final review: PASS. No subagent review claimed. Tests ran from a byte-verified source copy excluding non-example .env before reads; no ERP access, task mutation/replay, deployment, service restart, extension reload, external message, commit or push occurred.
  • Immutable validation summary. Production requires updating platform/service and the same installed extension to 0.5.184, retaining its local records; old tasks can sync only if original connection/execution evidence is retained. The exact missing readiness condition in the user's historical run remains unobserved; new diagnostics distinguish it.

Promotion candidates

  • Preserve the distinction between provisional dispatch uncertainty and witnessed ERP writes. Only correlated explicit read-only failure evidence closes the former; no retry or blanket terminal-state override. Target: canonical execution lifecycle documentation after integration acceptance.
  • Document readiness must refer to the current Document identity, not merely a URL retained by an old iframe document. Target: canonical browser-adapter guidance after integration. Current live failure's specific missing condition still requires runtime diagnostics.