WAPPR1 固化企微审批规则API边界
这个提交包含在:
@@ -19,7 +19,7 @@ Read only what is relevant:
|
||||
- For any Enterprise WeChat capability, Secret, callback, approval, check-in, HR assistant, or contact-directory task, read `docs/企微API能力目录.md` before planning or coding. WAPI fixes the current Secret matrix: contacts use `WECOM_CONTACT_SECRET`; workbench/OAuth/messages/HR assistant/roster/check-in/approval use `WECOM_AGENT_SECRET`; `WECOM_CHECKIN_SECRET` is only an explicit check-in override; `WECOM_HR_ASSISTANT_SECRET` is historical compatibility and not a default. Do not write runtime code that tries multiple Secrets to guess the correct one.
|
||||
- For Enterprise WeChat-first HR/attendance runtime migration, read `docs/企微优先开发路线图.md` before planning or coding. WDRG makes the roadmap authoritative for stage order; WAPI adds the runtime-first stage before deep mirror work; WRRA states that WOUA `PASS_WITH_FINDINGS` does not clear deep mirror work; WOUA-FIX has now soft-archived the 7 OA active test accounts missing in WeCom, fixed the `T0000` seed reactivation behavior, transferred the `SMOKE201` test-manager side effects, and rerun WOUA with `oaActiveMissingInWecom=0`. WCPC has rerun the capability POC with an existing active test account and reached `GO_TO_HR_MASTER_SYNC`; WHMS/WHMSLIVE has implemented, deployed, and publicly verified `wecom_hr_master_sync_v1`, with the production flag restored to `force_off` and production real-employee batch apply not approved. WMSG1 proves real app-message delivery and Deeplink return only; WAPC1 fixes the approval configuration preparation checklist before mirror work; WAPC2 adds the leave/missed-punch approval template and low-risk `sp_no` read-only POC runner. WPROC1/WPROC2 fixed the engineering process gate; WEGOV1 is the route gate, and WACP3R has now rerun the compensation-pull POC by automatically discovering OA-POC leave/missed-punch template IDs from `SMOKE002` creator. Public report `/app/artifacts/qa-flow/wecom-approval-compensation-poc-20260519T115944Z/summary.json` is `PASS_WITH_FINDINGS`: compensation pull and detail read work, with finding that callback evidence files are not persisted across deploys. WREAD1/WREAD1F have now completed real-device readability confirmation for leave and missed-punch: public report `/app/artifacts/qa-flow/wecom-approval-readability-gate-20260519T133628Z/summary.json` is `PASS_READABLE`; the user confirmed cards/lists/details are readable, reject has second confirmation, and approve is single-tap. WADM1 has completed the self-owned archive/mirror data-model design. WARCH1 has implemented and publicly verified the minimum leave/missed-punch archive slice: Prisma archive/callback/compensation/finding tables, callback DB persistence with non-200 retry on DB failure, compensation persistence behind `--persist-to-db` + `WECOM_ARCHIVE_WRITE=1`, and offline `npm run check:wecom-approval-archive`; public reports `/app/artifacts/qa-flow/wecom-approval-compensation-poc-20260519T160306Z/summary.json` and `/app/artifacts/qa-flow/wecom-approval-archive-20260519T160330Z/summary.json` are `PASS_WITH_FINDINGS`, with 2 archived histories readable and only a historical pre-WARCH1 callback gap finding. WARCH2 has now added the formal OA read-only archive API/page: `/api/wecom/approval-archive`, `/wecom-approval-archive`, and `/mobile/wecom-approval-archive` read OA DB only, do not call WeCom API or read WeCom Secrets, and enforce self/direct-report/HR-admin visibility with unmapped applicant records HR/admin-only. WROAD2+OPS is the controlled launch gate: use test accounts `SMOKE002 -> SMOKE101`, observe/admin-alert via employee_no `HYD000006` (the employee id for `wangshunli`), run daily checks for 3 days, allow only compensation archive writes to OA DB via `WECOM_ARCHIVE_WRITE=1`, and do not create WeCom templates/approvals, write WeCom, or expand real users. Day 0 public report `/app/artifacts/qa-flow/wroad2-ops-20260520-041941/summary.json` is `PASS_WITH_FINDINGS`: WeCom runtime, compensation archive persistence, offline archive read, and privacy smoke pass; findings are missing live-smoke login credentials/pending OCR subcheck and historical callback gap. It still does not implement full mirror, outing/overtime live, emergency mode, writeback, or RuleOps. WAUTO1 adds `scripts/qa/collect-wecom-controlled-trial-evidence.sh` for read-only controlled-trial evidence aggregation; it must not set `WECOM_ARCHIVE_WRITE=1`, `WECOM_CHECKIN_ARCHIVE_WRITE=1`, or `WECOM_APPROVAL_FIXTURE_WRITE=1`. WEXT1LD is the outing/overtime live-before dry-run gate and does not authorize live fixture creation. WFULLSMOKE1 adds `scripts/qa/run-three-day-full-goal-smoke.sh` as the three-day full-goal smoke controller; it may create only OA test business data marked `TEST/SMOKE/WFULL`, and must not write WeCom, create outing/overtime fixtures, enable real employees, make real payments, connect real payment providers, write ERP, or import bank statements. WPROC2 adds the executable `process gate`: before WAPC2F or other high-risk WeCom work, run `node scripts/qa/check-process-contract.mjs --baseline` and the issue-specific profile check to enforce DoR/DoD, fixed Secret source, non-self approval, live write switches, missing-config classification, and redaction boundaries. Do not start `wecom_attendance_approval_mirror_v1`, `oa_hr_emergency_mode_v1`, `wecom_recovery_writeback_v1`, or `wecom_ruleops_v1` without WROAD2-CLOSEOUT, WROAD2-BIZ1, WAPPR1, WAUTO1/WEXT1LD, WFULLSMOKE1 evidence, WEXT1-LIVE, WREAL1 question gates or explicit approval, and the next stage's own Issue CSV and acceptance gates.
|
||||
- WARCH3/WCHECK1/WEXT1 update the route after WROAD2 Day 0: WARCH3 adds `scripts/qa/run-warch3-ops-daily.sh`, `deploy/trialrun/install-warch3-ops-timer.sh`, and `npm run send:wecom-ops-alert` for 07:30 systemd巡检和脱敏企微告警;public report `/app/artifacts/qa-flow/warch3-ops-20260520-054841/summary.json` is `PASS_WITH_FINDINGS`, and WOPS1 now fixes alert noise: default recipient is `HYD000006` (the employee_no for `wangshunli`), repeated known findings are skipped via `artifacts/qa-flow/warch3-ops-alert-state.json`, and only blocked/failure/new-finding/status-worsening/force sends a message. WOPS1 public rerun `/app/artifacts/qa-flow/warch3-ops-20260520-070731/summary.json` is `PASS_WITH_FINDINGS`, and alert report `/app/artifacts/qa-flow/wecom-ops-alert-20260520T070740Z/summary.json` is `PASS_ALERT_SKIPPED_NO_FINDINGS` with `no_new_findings_or_status_worsening`. WCHECK1 adds `npm run check:wecom-checkin-summary-archive`, daily/monthly check-in summaries, and rule snapshots with `--persist-to-db` + `WECOM_CHECKIN_ARCHIVE_WRITE=1` as the only OA DB write gate; public reports `/app/artifacts/qa-flow/wecom-checkin-summary-archive-20260520T054907Z/summary.json` and `/app/artifacts/qa-flow/wecom-checkin-summary-archive-20260520T054926Z/summary.json` are `PASS_CHECKIN_ARCHIVE_READY` and `PASS_CHECKIN_ARCHIVE_OFFLINE_READY`. WEXT1 only extends approval fixtures for `--target=outing --target=overtime` dry-run; public report `/app/artifacts/qa-flow/wecom-approval-fixtures-20260520T054940Z/summary.json` is `PASS_FIXTURE_DRY_RUN_READY`. WAUTO1/WEXT1LD now add a read-only evidence aggregation script and a live-before dry-run contract; WFULLSMOKE1 adds full-domain main-path smoke orchestration across WeCom HR/attendance, OA-primary reimbursement/procurement/contract-project/payment-batch flows, mobile/WeCom entry, and ops checks. These do not create outing/overtime WeCom templates/approvals, expand real users, or implement full mirror/emergency/writeback/RuleOps. WEXT1-LIVE needs WROAD2-CLOSEOUT/WROAD2-BIZ1/WAPPR1/WAUTO1/WEXT1LD/WFULLSMOKE1, a new Issue CSV, and explicit approval; WREAL1 real users are asked only after leave, missed punch, outing, and overtime test-account evidence plus approver-rule gate and WFULLSMOKE1 are passable/explainable.
|
||||
- WROAD2-BIZ1/WAPPR1 adjust the post-WOPS1 route: during the 3-day window, add manual business smoke on test accounts without replacing WARCH3 automation. `SMOKE002` should try WeCom check-in and submit low-risk leave/missed-punch, `SMOKE101` must open details before approving, and `HYD000006` checks OA archived approval/check-in summaries. WAPPR1 treats "applicant must manually choose approver" as a blocking rule finding: test templates remain `SMOKE002 -> SMOKE101`, formal leave/missed-punch/outing/overtime templates must auto-resolve approvers from direct manager, department owner, or configured approval role, and applicant-chosen arbitrary approvers/self-approval must block WREAL1. WAUTO1 can automate evidence collection, and WFULLSMOKE1 can aggregate full-domain smoke evidence, but WAPPR1 choices A/B/C/D and real-device business actions remain manual gates. Do not start WEXT1-LIVE, WREAL1, deep mirror, emergency, writeback, or RuleOps until WROAD2-CLOSEOUT, WROAD2-BIZ1, WAPPR1, WAUTO1/WEXT1LD, WFULLSMOKE1, WEXT1-LIVE, and the relevant question gates or explicit approval are complete.
|
||||
- WROAD2-BIZ1/WAPPR1 adjust the post-WOPS1 route: during the 3-day window, add manual business smoke on test accounts without replacing WARCH3 automation. `SMOKE002` should try WeCom check-in and submit low-risk leave/missed-punch, `SMOKE101` must open details before approving, and `HYD000006` checks OA archived approval/check-in summaries. WAPPR1 treats "applicant must manually choose approver" as a blocking rule finding: test templates remain `SMOKE002 -> SMOKE101`, formal leave/missed-punch/outing/overtime templates must auto-resolve approvers from direct manager, department owner, or configured approval role, and applicant-chosen arbitrary approvers/self-approval must block WREAL1. Official WeCom APIs do not expose a read-only native-template approval-rule configuration surface: `gettemplatedetail` returns controls, `getapprovaldetail` returns actual submitted flow, and `applyevent use_template_approver=1` is a write-style check, so do not design WAPPR1 as pure API automation. WAUTO1 can automate evidence collection, and WFULLSMOKE1 can aggregate full-domain smoke evidence, but WAPPR1 choices A/B/C/D and real-device business actions remain manual gates. Do not start WEXT1-LIVE, WREAL1, deep mirror, emergency, writeback, or RuleOps until WROAD2-CLOSEOUT, WROAD2-BIZ1, WAPPR1, WAUTO1/WEXT1LD, WFULLSMOKE1, WEXT1-LIVE, and the relevant question gates or explicit approval are complete.
|
||||
- WROUTE2 locks the post-WFULLSMOKE1 route: first close out test-account evidence, then ask for WEXT1-LIVE outing+overtime test-account live POC, then ask WREAL1 with exactly 1 real employee + 1 approver/admin observer, then prioritize `wecom_attendance_approval_mirror_v1` minimum complete mirror. WTCLOSE1 adds the small-team execution rule: because the company has fewer than 10 people, WAPPR1 targets option A for leave/missed-punch/outing/overtime; formal HR/attendance approvals use one direct manager or configured approval role with admin fallback/blocking when the approver chain is missing, unavailable, invisible, unbound, or self-approval. WTCLOSE1 only authorizes WAUTO1/WFULLSMOKE1 aggregation and WEXT1-LIVE pre-dry-run; it does not authorize WeCom writes, real employees, outing/overtime fixture creation, emergency mode, writeback, or RuleOps.
|
||||
- WAPC2FLIVE supersedes the WAPC2F dry-run gap for OA-POC samples: after user approval, the runner was corrected to the official `template_name` + `property` controls create-template payload, deployed with `SYNC_ENV=0`, and the public live report `/app/artifacts/qa-flow/wecom-approval-fixtures-20260519T053400Z/summary.json` reached `PASS_FIXTURE_CREATED`; leave/missed-punch OA-POC templates and low-risk test approvals were created and retained for audit, with WAPC2 auto-rerun `PASS_APPROVAL_POC`. WCBK1 has added and deployed read-only `GET/POST /api/wecom/approval/callback`, `wecomCallbackCrypto`, `npm run check:wecom-approval-callback-poc`, and the `wecom-callback` process gate. After remote callback config was set, public report `/app/artifacts/qa-flow/wecom-approval-callback-poc-20260519T083422Z/summary.json` reached `PASS_CALLBACK_URL_VERIFIED`; after `SMOKE101` approved an existing OA-POC missed-punch test approval, `/app/artifacts/qa-flow/wecom-approval-callback-poc-20260519T092648Z/summary.json` reached `PASS_CALLBACK_EVENT_CONFIRMED` with one redacted event. WACP3/WACP3R has added and deployed `npm run check:wecom-approval-compensation-poc`, `POST /cgi-bin/oa/getapprovalinfo` read support, and automatic template discovery by `SMOKE002` creator; WREAD1 deploy reran WACP3R at `/app/artifacts/qa-flow/wecom-approval-compensation-poc-20260519T125515Z/summary.json` and then generated `/app/artifacts/qa-flow/wecom-approval-readability-gate-20260519T125532Z/summary.json` as `PAUSED_MANUAL_CONFIRMATION`. WREAD1F then fixed duplicate OA-POC template names by adding timestamp uniqueness and created fresh leave/missed-punch approvals at `/app/artifacts/qa-flow/wecom-approval-fixtures-20260519T131958Z/summary.json`; final WREAD1 manual report `/app/artifacts/qa-flow/wecom-approval-readability-gate-20260519T133628Z/summary.json` is `PASS_READABLE`. This clears leave/missed-punch readability only; mirror data model, minimum archive, emergency mode, writeback, RuleOps, and outing/overtime sample decisions remain later gates.
|
||||
- WEGOV1 changes the current WeCom route to "Enterprise WeChat owns mature HR/attendance flows; OA stores self-owned history, audit, entry, messages, and emergency fallback." Treat four domains explicitly: WeCom-owned domain is check-in, leave, missed punch, outing, overtime, leave balance, and HR assistant; OA-owned domain remains reimbursement, procurement, contracts, projects, payments, invoices, bank receipts, sensitive attachments, and operating audit; OA archive domain stores WeCom business history, full external keys, and necessary snapshots; OA emergency domain is manually enabled only when WeCom is unavailable. Do not assume a full isolated WeCom sandbox; use the controlled test domain `SMOKE002 -> SMOKE101`, `OA-POC` templates, low-risk approvals, synthetic tests, public live runners, and limited real-device confirmation. WARCH1 now supplies the minimum leave/missed-punch archive implementation, WARCH2 supplies the formal read-only history query surface, and WROAD2 supplies controlled ops daily checks. Do not start deep mirror until WROAD2-CLOSEOUT, WROAD2-BIZ1, WAPPR1, WAUTO1/WEXT1LD, WFULLSMOKE1, WEXT1-LIVE, WREAL1 question gates or explicit approval, and the mirror stage's own contract are complete.
|
||||
|
||||
在新工单中引用
屏蔽一个用户