3.1 KiB
Booking source and company-report retry semantics
Metadata
- Date: 2026-08-03
- Status: Confirmed in source; live acceptance remains pending the controlled port-8766 restart
- Scope: Repeated identical Booking Excel uploads, company-report reruns and subset-source reruns
- Confidence: Fact for the current source contracts and tests; live runtime is still the stale PID 11176
- Source:
booking_ingestion/excel_review_postgres.py,company_reports/repository.py,company_reports/core.py,company_reports/publishing.pyand focused unittest suites - Last verified: 2026-08-03
Confirmed behavior
- A byte-identical
.xlsxis identified by its file SHA-256. In the real PostgreSQL review repository, if that artifact has already been activated, a repeated upload returnsBOOKING_EXCEL_SOURCE_ALREADY_ACTIVATEDand does not create another extraction batch. If the workbook has the same Booking rows but different XLSX bytes, it is a new upload and must go through review/activation again; row-level semantic deduplication is not used at upload time. - A company report can be generated again after a successful publication. The report reservation identity includes the month/period cutoff, Finance daily-version pins, Booking parse-version pins and processor/rule/schema identity. An unchanged identity reuses the complete archive/result pair; a changed identity creates a new version and retains the earlier files. Partial, corrupt or semantically conflicting publication state fails closed.
- A subset workbook is not a duplicate of its previous superset. After review is complete and the subset is activated,
booking.current_source_batchpoints to it and a report rerun reads that active Booking snapshot. Finance facts remain the report row boundary; Group Codes missing from the subset produce rows with blank Booking Room details rather than silently deleting the Finance rows. Upload alone does not switch the active source, and an open review draft blocks company-report generation until it is activated or discarded.
Runtime boundary
The current 8766 listener is still PID 11176, started on 2026-08-02 before the duplicate-publication fix. The source
contracts above are therefore the intended behavior after a controlled restart; the failed August retry is not valid live
acceptance of the fixed publisher.
User-visible reuse status
The current publication outcome contains the artifact and result metadata but no reused/publication_disposition
field. CompanyRunResult and the public company-job projection likewise expose success, version number and download URL,
not whether the publisher reused an existing archive/result pair. Consequently, after a successful retry the operator sees
成功 and a normal download link; the downloaded bytes can be the original archived file, but the page does not identify
which prior file/version was reused.
Verification
- Focused source-upload/publisher/integration unittest: 14 tests passed, 2 optional ArtifactTool integration tests skipped because the local dependency is unavailable.
- No source activation, report rerun, output repair or business-data mutation was performed.