Manage daily reports by date and refresh monthly reports after deletion
This commit is contained in:
1 parent
976a4fa7b2
commit
2a54838d59
41 files changed
+2757
-89
No files matched your search
@@ -0,0 +1,76 @@
|
||||
# Task: 日报按日期覆盖、删除及月报同步
|
||||
|
||||
## Identity
|
||||
|
||||
- Task ID: 20261009-daily-lifecycle-7bc2
|
||||
- Mode: Feature
|
||||
- Branch: codex/20261009-daily-lifecycle-7bc2-daily-lifecycle
|
||||
- Worktree: /Users/chillishark/.codex/worktrees/arr-daily-lifecycle
|
||||
- Base commit: 976a4fa7b2bc445e327f412531c6ccc5e7ddc99a
|
||||
- Owner: codex
|
||||
- Status: Ready for Integration
|
||||
|
||||
## Scope
|
||||
|
||||
- User-approved daily report lifecycle: one current report per business date, successful new XML/OHIP versions replace old only after acceptance, manual deletion with monthly refresh, grouped date/history UI and consistent selected-date overview.
|
||||
|
||||
## Intent And Constraints
|
||||
|
||||
- Preserve shared business rules, immutable original/audit facts and live user decisions. Deletion retires the report while retaining source/objects and audit, with no product undo button; deleting a current day must not resurrect an older version. A fresh upload/request may generate a new version. New pending/failed input must not remove the current accepted day. No new Oracle reads or fabricated prices. Use synthetic isolated database acceptance, then safe local activation with backup and no active tasks. Prior release push authorization remains valid.
|
||||
|
||||
## Outcome
|
||||
|
||||
- Implemented business-date grouping and exact selected-date overview, with current accepted report separate from a new pending/failed version. Shared XML/OHIP rules and processor4.4.0 identity unchanged; a successful new version alone replaces the current day.
|
||||
- Added authenticated/CSRF-protected exact-job/date retirement. Serializability, day/month locks, immutable retirement receipts, current-version guard and outbox atomically remove only the requested effective version; old/pending history retirement preserves current facts. No source/object/Finance fact deletion and no automatic old-version restoration.
|
||||
- Migration022 adds append-only operator receipts and withdrawn monthly publications, partial live-snapshot uniqueness and immutable withdrawn lineage; grants are confined to known application role. Startup checks022 structure/protection, including missing index/disabled audit trigger rejection. Native XML/API simulation and OHIP owned instances now request schema022 explicitly.
|
||||
- Monthly worker rebuilds from remaining current Finance days, refuses stale cutoff/pins, consumes committed/scope-changed events, withdraws an empty month without publishing an empty workbook, and blocks pre-deletion builds from becoming current. Withdrawn publications disappear from downloads, lists and analytics; audit and artifacts remain intact.
|
||||
- Frontend offers one date row, explicit current/history/new statuses, date selection, paged history, deletion impact confirmation, safe duplicate submission and stale-response guards; preserves other-date pending work and unsaved prices. Deleted old successful versions are clearly history-only when no current day remains. Chinese/English/Thai wording and empty read-only preview updated.
|
||||
- Updated product/deployment docs with022 order, role grants, worker coupling, backed-up upgrade and rollback boundaries. Canonical project memory left unchanged in feature mode.
|
||||
- Activated loopback8875 after confirming no active acquisition/processing, graceful launchd stop and cold backup. Private launcher/config/plist now point to this owned worktree, schema008-022. Existing login and production hotel57106 routing retained. No actual daily report retired and no Oracle acquisition submitted.
|
||||
|
||||
## Verification
|
||||
|
||||
- Backend: initial33 retirement/ingestion checks passed; after adding022 startup gate, final17 retirement/PostgreSQL cases plus15 runtime composition cases passed (32 total). Covers old/new identity, pending price cancellation, busy generation, duplicate/concurrent retirement, source/fact retention, transaction rollback, day/month races and022 gate failures.
|
||||
- Monthly:31 repository/service/worker unit checks and7 real isolated PostgreSQL lifecycle cases passed. Includes delete last/middle/latest date, empty whole month, ABA snapshot republication, paused stale builders and immutable withdrawn lineage.
|
||||
- Portal:7 real isolated PostgreSQL date/history/download/analytics/read-only role cases passed. Root50 API/legacy/schema/runtime checks passed; later19 API/schema/empty-preview checks passed after preview compatibility was added. HTTP checks cover auth, CSRF, strict date/body and session actor binding.
|
||||
- Local entrypoints:19 native XML/API simulation checks passed with real owned PostgreSQL, explicitly verifying new grouped API on the new schema and restart/download/monthly behavior.
|
||||
- Frontend:105 JavaScript tests and14 UI/static/privacy tests passed after final history-only status correction. Syntax and whitespace checks passed. Independent review found and resolved old-success label ambiguity and missing local/schema022 startup gate; no remaining blocking issue reported.
|
||||
- Independent browser port8891 with synthetic data: two effective days plus one pending replacement. Deleted pending09/16 and verified old effective day stayed; deleted effective09/16 and verified list removed the day, selected09/16 overview stayed empty instead of displaying09/17, and rebuilt September month dropped from2 data rows to1. Real hotel data/services were isolated from this fixture.
|
||||
- Actual local upgrade: baseline and after-upgrade hashes/counts of all26 existing business tables match, ignoring only newly added NULL monthly.withdrawn_at.3 current daily versions,4,896 original source files, queue statuses, legacy jobs/months/monthly responses and existing pending tasks match.022 retirement table remains0 rows. Actual grouped September API returns unique09/17 and09/16 rows; pending09/15 and09/13 survive.
|
||||
- Actual browser: selected09/13 shows09/13 throughout acquisition/date overview, no borrowed rooms/duration; existing09/16 shows150 rooms, one main row and2 history records with delete controls. No business input saved, deleted or refetched. Screenshots saved privately.
|
||||
- Backup: `/Users/chillishark/Library/Application Support/ARR2.0/daily-lifecycle-backup-20261009-025721` (cold owned database, config/source/objects/queues; existing runtime excluded). Private evidence/scripts: `/Users/chillishark/Library/Application Support/ARR2.0/daily-lifecycle-validation-20261009`; captures before/after snapshots, activation, synthetic monthly deletion and live date/history screenshots. No credentials/data committed.
|
||||
- Project documentation and task-aware drift gates passed; canonical snapshot migration remains pending for a separate Integration Gate. Final JavaScript syntax and whitespace checks passed. Approved target is arr0918 `https://git.nianxx.cn/shiyuyun/ARR-2.0-0918.git`, main; pre-publication remote HEAD equals base976a4fa. Publish non-force and verify remote HEAD; store exact post-push receipt privately with activation evidence.
|
||||
|
||||
## Follow-ups
|
||||
|
||||
- Target-host deployment still requires backed-up022 migration, role grants and coordinated new Web/processing/monthly worker. Local acceptance does not claim target-host deployment or full real-report financial business reconciliation.
|
||||
- Retain this managed worktree:8875 now runs its code. Do not retire/archive it until runtime has moved to another reviewed checkout. Backup must be restored with matching schema/code/worker if an operator later needs full rollback; no rollback was needed.
|
||||
|
||||
## Promotion Candidates
|
||||
|
||||
- Targets: canonical domain business-rules/success-criteria and architecture data-flow. Proposal: daily report identity is business date with one current accepted version; replacement only on success, logical retirement with immutable facts, current-day deletion excludes that day from monthly facts, historical deletion preserves current. Evidence: explicit user approval2026-10-09, isolated PostgreSQL concurrency/withdrawal tests and browser lifecycle proof. Future impact: daily/monthly API, deployments and audit expectations. Conflict: extends existing immutable processing/audit design without changing rate/price/PM/cancellation rules; canonical September snapshot is stale. Human confirmation: product behavior already approved; apply only through a separate serialized Integration Gate.
|
||||
- Targets: canonical current-state/evidence index. Proposal: local8875 runs this checkout with processor4.4.0/schema022, existing actual data preserved, feature acceptance synthetic and actual portal read-only. Evidence: private activation/baseline/after snapshots and screenshots. Future impact: accurate maintenance/rollback/worktree lifecycle. Conflict: prior production-review checkout is no longer the live code path; primary dirty checkout remains untouched. Human confirmation: no additional decision required to promote verified environment facts, but Integration Gate remains mandatory.
|
||||
|
||||
## Concurrent Task Gate
|
||||
|
||||
- Passed: unique feature task20261009-daily-lifecycle-7bc2, codex owner, branchcodex/20261009-daily-lifecycle-7bc2-daily-lifecycle, managed worktree/Users/chillishark/.codex/worktrees/arr-daily-lifecycle, base976a4fa7b2bc445e327f412531c6ccc5e7ddc99a. start exited0 and status matched. Existing production-review task is Ready for Integration and runs the current service; its task record was inspected read-only. Its code is included in this base, no concurrent write overlap. Dirty primary checkout remains untouched.
|
||||
|
||||
## Project Context Loaded
|
||||
|
||||
Read: read-before-planning/planning-gate, own task record, memory-index, positioning, current-state, decision-index, ADR001/004/006/007, system-overview/module-map/data-flow, business-rules/success-criteria, evidence/reflection/commitments/stale indexes and prior production-review outcome.
|
||||
|
||||
- Project goal: deterministic shared XML/OHIP daily processing, accepted Finance facts and automatically updated monthly reports.
|
||||
- Current focus: business-date report identity/lifecycle, recoverable deletion and date-consistent presentation.
|
||||
- Constraints: immutable source/artifacts/audit, atomic activation and outbox, frozen manual-price replay, no invented values or new acquisition, private runtime outside Git.
|
||||
- Decisions: successful commits activate one Finance version per date; dedicated monthly worker with current-pin validation and derived scope; user now explicitly approves report retirement/monthly removal and date-grouped display.
|
||||
- Evidence/conflicts: canonical memory last integrated September18 is stale regarding October9 production hotel57106/processor4.4.0/migration021 and multi-agent consent; recent task evidence and direct user authorization govern these current facts. No canonical edits in feature mode.
|
||||
- Modules: arr_web repository/app/downloads/programmatic/UI, arr_ingestion Finance SQL/protected roles, monthly_reports snapshot/publication/outbox and local runtime migrations.
|
||||
- Unknowns: exact existing activation, monthly empty-date/month behavior and race boundaries require code inspection; no unresolved product choice blocks the authorized behavior.
|
||||
- Gate: Passed.
|
||||
|
||||
## Plan
|
||||
|
||||
1. Inspect existing date-version activation and monthly publication; establish a recoverable auditable retirement contract.
|
||||
2. Implement protected atomic day/report retirement and monthly refresh, reject unsafe stale/concurrent operations and preserve current version until replacement succeeds.
|
||||
3. Group daily list by date with accessible history/delete controls; bind overview to selected day/current published version versus pending replacement.
|
||||
4. Verify real isolated PostgreSQL daily/monthly lifecycle, race/idempotent cases, HTTP/auth and UI; safely activate local service without deleting actual reports, capture UI proof and push the reviewed code.
|
||||
Reference in new issue
Block a user