修复变更、增加筛选条件

This commit is contained in:
andy committed 2026-09-11 21:22:14 +08:00
1 parent 712ec51d68
commit e06afc8c33
137 files changed
+35872 -275

No files matched your search

@@ -0,0 +1,36 @@
# Unified arrangement update commands
## Scope and gate
- Feature continuation on `main`, worktree `/Users/andy/IdeaProjects/LWLT-AIBOT`, base `712ec51d68608e1278c066d23dc25fea0a6280ee`; one worktree, all source changes belong to this conversation's completed hotel-update work. Preserve those changes and unrelated `.idea`/`.DS_Store`. Overlap: Clear.
- User approved suffix `变更` for the remaining arrangement commands and explicitly states dates identify the original arrangement only.
- Implement guide, vehicle, transport and other/filing updates; guide selects the team's unique existing guide, other actions select one existing row by the original business date/range. New resource/supplier, quantity and explicitly supplied optional fields are replacement values. Missing/multiple targets block; no automatic row choice or creation.
- Local code, migration files, tests and release artifacts only. No ERP access/write, production migration, restart, deployment or external sending. Main-thread work; no subagents without user consent.
## Result
- Completed local implementation and artifacts: extension `0.5.175`, Program parser `v1.0.9`, input contract/DOCX `0.5.129`.
- Added Program-only guide/vehicle/transport/other update routes with separate authorization. The original creation command plus “变更” selects the new route. Other aliases include “安排其他变更” and “安排备案变更”.
- Guide: team must have a single existing native guide at slot 0. Replacement updates guide-linked phone/grade/coordinator and optional remark. Vehicle: original start/end dates identify one existing row. Transport/other: original business date identifies one existing row. Hotel dated update is retained and gains optional remark.
- Dates are selectors only for these new command formats. Replacement resource/supplier uses native candidate linkage. Optional quantity/remark/filing keys preserve old values when omitted, including an existing other row's empty/zero quantity. Optional filing date verifies the original filing date; it never changes it. Old generic hotel “目标变更” behavior remains compatible.
- Matching zero/multiple records, stale IDs, confirmed/paid/audited/realized states and native callbacks changing dates or other rows block before saving. Fresh requery checks new values and preserved identity. Success receipts use replacement values.
- Added migration `024_arrangement_update_routes` to extend both route CHECK constraints. Service startup now requires this version. Migration runner records it in the configured schema; migration contains no automatic permission grants.
- Built ZIP, verified all 20 entries byte for byte, rebuilt DOCX and visually checked all 15 pages. Prior 0.5.174/0.5.128 artifacts and their manifest were hash-verified and archived under `archive/releases/2026-09-11/`.
## Validation
- `node --run check` and `node --run build`: PASS.
- `node --run test:control-plane`: 221/221 PASS.
- `node --run test:legacy`: 302/302 PASS in exact-byte validation copy; original worktree 300/302, with only the same two pre-existing IDE/OS residue checks failing.
- `node --run check:repo`: original worktree 8/10 due only to preserved `.idea` and `.DS_Store`; exact-byte copy 10/10 PASS.
- New browser fixtures exercise all four actions, index 0/1/10 where applicable, missing/multiple targets, rejected date changes, original ID/date/payment/audit/realized guards, native other-row mutations, partial filing merge and omitted values. Existing hotel regression passes.
- Main-thread final review: PASS for local scope. No subagent was started because repository instructions require explicit user consent. No production database migration or ERP write acceptance performed.
- Evidence: [validation and release checks](../../../archive/evidence/2026-09-11/20260911-arrangement-update-unified-01a0858b/README.md).
## Deployment handoff
1. Deploy updated server code with `DATABASE_SCHEMA=liansyn_prod` and the existing migration-first startup flow; ensure migration `024_arrangement_update_routes` is recorded by the migration runner.
2. Install extension `0.5.175` on the employee cloud browser and refresh the platform/ERP pages.
3. Administrator explicitly grants the four new update routes to the intended employees; existing create permissions do not imply update permissions.
4. Validate one intended original record per action in ERP. Guide slot 0 only; dates must match a unique persisted row. This release has no claimed production write evidence.
## Promotion candidates
- Machine registry now has 23 routes grouped into 19 operator catalog scenarios, with four new hard Program-only update permissions.
- Date-selected arrangement replacement semantics and partial filing preservation as above.
- Canonical project memory remains unchanged; promote after acceptance through the Integration workflow.
@@ -0,0 +1,30 @@
# Hotel replacement by dated arrangement
## Scope and gate
- Feature task; branch `main`, worktree `/Users/andy/IdeaProjects/LWLT-AIBOT`, base `712ec51d68608e1278c066d23dc25fea0a6280ee`.
- Existing `.idea/` and `.DS_Store` files are preserved; no overlapping source changes and no other local worktrees. Overlap: Clear. The previous extension ZIP was verified against its release hash and preserved byte-for-byte in `archive/releases/2026-09-11/` together with DOCX 0.5.127 and the previous manifest.
- User requests `安排酒店变更` with group, check-in/check-out dates, hotel search and room count. Dates identify the existing hotel arrangement; hotel search and count supply replacement values. Ambiguous rows must stop before saving.
- Local implementation and verification only; no ERP writes, service restart, deployment or external sending.
- Work is performed in the main thread under the repository's no-subagent-without-consent rule.
## Progress
- Completed Program alias `安排酒店变更`, conditional input validation, parse/execution contracts and date-selected existing hotel replacement. Original check-in/check-out dates select exactly one persisted row; the new hotel keyword and room count are replacement values.
- The extension freezes the original native row ID and snapshot, resolves the new hotel from ERP candidates, and uses that row's native SelectBox mapping for hotel/room type and linked fields. It preserves original dates, status, remark and other rows and verifies the same row ID/new hotel fields after saving.
- Zero/multiple date matches, stale row identity, confirmed status, payment/audit state, missing controls, unresolved resources and unexpected cross-row changes block before saving. Existing hotel candidate matching behavior remains unchanged; legacy end-date/room-count updates remain supported.
- Success replies now use changed hotel/count values instead of the original snapshot. This also corrects legacy departure-date update replies.
- Synchronized extension 0.5.174, platform minimum version, mapping, tests, ZIP and release manifest; Program parser 1.0.8 and input contract/DOCX 0.5.128. Existing AI Skill packages remain unchanged; the new format is documented for Program parsing.
- Rebuilt the operator DOCX with the repository builder and reviewed all 13 final rendered pages. No production operation was executed.
## Validation
- `node --run check`: PASS; `node --run build`: PASS.
- `node --run test:control-plane`: 215/215 PASS, including parsing and successful replacement reply coverage.
- `node --run test:legacy`: 294/294 PASS; `node --run check:repo`: 10/10 PASS in an exact source/release validation copy excluding pre-existing `.idea`/`.DS_Store`, secrets and generated dependencies; node_modules linked from the workspace. All 2471 copied file hashes matched the workspace before evidence was recorded. Original workspace hygiene checks detect the preserved IDE/OS residue; these unrelated files were not removed or waived in tests.
- New browser tests cover native target slots 0/1/10, date ambiguity/no match, ID/payment/audit/status guards, changed other rows and record identity/date preservation. These use local ERP DOM/native-callback fixtures; they are not production ERP acceptance evidence.
- ZIP: all 20 files match source bytes exactly, including README; version and manifest SHA-256 verified. DOCX/source/builder hashes match the manifest. `git diff --check`: PASS.
- Main-thread read-only final review: PASS for the implemented local scope. No subagent review was used under the no-subagent-without-consent rule.
- Evidence: [local verification](../../../archive/evidence/2026-09-11/20260911-hotel-update-selection-01a0858b/README.md).
## Promotion candidates
- Accept the Program date-selected hotel replacement format after production acceptance. Dates identify the original record; hotel search/count are new values. Only one matching unconfirmed/unarranged unpaid/unaudited record is eligible.
- Deploy the rebuilt control-plane image and extension 0.5.174 together, refresh platform/ERP pages, then submit a new task for acceptance. No database migration is introduced. Prior failed tasks do not become successful automatically.
- Production acceptance remains pending user deployment/test. Canonical `.project-docs` memory remains unchanged in Feature mode.
@@ -0,0 +1,23 @@
# Optional transport ticket description
## Scope and gate
- Feature continuation on `main`, worktree `/Users/andy/IdeaProjects/LWLT-AIBOT`, base `712ec51d68608e1278c066d23dc25fea0a6280ee`; one worktree. Existing source changes belong to earlier arrangement work in this conversation. Preserve all of them and unrelated IDE/OS residue. Overlap: Clear.
- User requests optional 车票说明 for transport and a programmer-facing explanation. Support creation and update; original transport dates remain original-record selectors.
- Main-thread implementation only per the user's no-subagent-without-consent rule. Local source, tests and deliverables only; no production deployment, ERP writes or external sending.
## Plan
1. Add filter-only `arrangement.ticket_description` to Program routes, parser and both contracts; retain compatibility behavior of the older item input.
2. Filter the same native candidate by supplier query and ticket description, require uniqueness when provided, recheck before mutation. Omission preserves existing native first-match behavior.
3. Test parser, validators, matching and original-row preservation. Synchronize extension release, mapping and operator Markdown/DOCX.
## Validation and result
- Completed: extension `0.5.177`, parser `v1.0.11`, operator DOCX/input contract `0.5.131`.
- Optional 车票说明 (alias 车票说明搜索) maps to `arrangement.ticket_description` on transport create/update. It filters the native description on the same supplier candidate; explicit input requires uniqueness and is rechecked at resource preflight and immediately before native selection. No fallback may discard it. Old item compatibility and omitted-filter first-match behavior are preserved.
- Both contracts and platform/plugin validators enforce nonempty text, transport-only create/update scope; original-date selectors and linked `item` remain distinct. Regression includes missing/ambiguous resources, altered candidate data, native selection ID drift, original record ambiguity and preservation of dates/IDs/other rows.
- `node --run check` and `node --run build`: PASS. `test:control-plane`: 223/223. `test:legacy`: 313/313 and `check:repo`: 10/10 in source-identical validation copy. Original worktree has only two known IDE/OS hygiene failures (311/313 and 8/10); unrelated files retained.
- ZIP 20 entries byte-exact with source; prior ZIP/DOCX hash-verified on archive. Rebuilt DOCX, all 15 pages visually inspected; layout/package parts preserved except intended body and title-version metadata.
- Main-thread final review: PASS for local scope. No real ERP write/deployment. Update both service and extension; no new migration beyond existing 024 baseline.
- Evidence: [validation](../../../archive/evidence/2026-09-11/20260911-ticket-description-filter-01a0858b/README.md).
## Promotion candidates
- Ticket description narrows the replacement resource; it neither edits the linked description directly nor selects the original arrangement.
@@ -0,0 +1,23 @@
# Optional vehicle type filter
## Scope and gate
- Feature continuation on `main`, worktree `/Users/andy/IdeaProjects/LWLT-AIBOT`, base `712ec51d68608e1278c066d23dc25fea0a6280ee`; one worktree. Existing source changes and artifacts are this conversation's completed arrangement updates. Preserve them and unrelated IDE/OS files. Overlap: Clear.
- User requests optional 用车类型 on vehicle creation and update. Both supplier query and type must match one native ERP candidate; no fallback that drops type. Original dates remain update selectors, never replacement dates.
- Main-thread implementation only, following the user's no-subagent-without-consent rule. No deployment, database operations, ERP access/save, restart or external sending.
## Plan
1. Add a filter-only `arrangement.vehicle_type` field to the Program parser and both operation contracts.
2. Apply it in candidate resolution and native selection, preserving unique candidate and original-record checks.
3. Cover create/update, omitted filter, mismatches and ambiguity. Update instruction source/DOCX and synchronized extension release.
## Validation and result
- Completed: Program parser `v1.0.10`, extension `0.5.176`, operator DOCX/input contract `0.5.130`.
- Optional 用车类型 (alias 车型) maps to filter-only `arrangement.vehicle_type` on both create and update; original update date selection is unchanged. Same candidate must satisfy supplier search and normalized type substring, with numeric boundary protection. No unique match means no mutation; omitted field keeps existing behavior.
- Both schemas and platform/plugin validators enforce scope/type; resource preflight and native update selection recheck uniqueness, candidate ID and complete native description before mutation. Tests cover create/update, omitted/invalid filter, mismatched supplier/type, duplicate candidates, numeric false positives, original-date preservation and candidate changes between resolution and write.
- `node --run check` and `node --run build`: PASS. `test:control-plane`: 222/222 PASS. `test:legacy`: 307/307 PASS in source-identical validation copy. `check:repo`: 10/10 in copy; 8/10 in original solely due to preserved .idea/.DS_Store. No source failures remain.
- ZIP 20 entries checked byte for byte; old release hash-verified before/after archive. DOCX rebuilt, all 15 pages visually inspected; only body and title-version metadata changed, layout parts preserved.
- Main-thread final review: PASS for local scope. No production deployment or real ERP save validation. No new migration or permissions for this field; migration 024 from the previous feature remains required.
- Evidence: [local validation](../../../archive/evidence/2026-09-11/20260911-vehicle-type-filter-01a0858b/README.md).
## Promotion candidates
- Optional vehicle type narrows replacement resource selection; it does not directly write a vehicle description or identify an original arrangement.