Skip to content

Preserve datetime search instants and add history-backed projection repair - #914

Merged
rmcdaniel merged 11 commits into
mainfrom
fix/898-search-datetime-instants
Oct 23, 2026
Merged

rmcdaniel merged 11 commits into
mainfrom
fix/898-search-datetime-instants

Conversation

@rmcdaniel

@rmcdaniel rmcdaniel commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Datetime search attributes currently write an offset's wall time into a timezone-free column, while datetime SQL bindings also discard microseconds. Preserve the original instant by using the existing UTC/microsecond formatter for storage, hydration and embedded predicates.

Add an explicit one-run repair command, workflow:v2:repair-search-datetimes. It previews by default and requires --apply to write. Repair uses the latest retained typed upsert, checks its logical command sequence against the current projection, locks and validates the complete selection before writing, and updates the summary in the same storage transaction. Pruned, missing, stale or ambiguous evidence is refused. History, business commands, tasks and leases remain unchanged. The recovery guide explains backups, namespace/key selection, uncertain storage outcomes and repeat verification.

Validation:

  • Before the storage/predicate correction: 61 component cases / 90 assertions, ten expected failures. Corrected component: 61 / 105 pass.
  • Actual SQLite and PostgreSQL constructed table round trips: all three original offset/precision failures reproduced; the two corrected source classes pass all 16 checks per case and backend.
  • Final migrated-table and repair selection: 21 tests / 130 assertions pass with warnings treated as failures, covering both offset signs and local-day boundaries, preview/apply/repeat, stale evidence, namespace/pruned refusals and transactional rollback.
  • Full PHPStan source/tests and focused ECS pass. Previous missing-command, fixture/style and Redis setup observations remain separate.
  • Fresh exact-head repository CI is required. Local results do not qualify a published package, the separate Server visibility-query path or an installed HTTP consumer.

Refs #898. No schema, native/shared/frozen or wire change. Prospective Workflow 2.12.0 metadata includes the additive operator command. Package/image publication, actual Server consumers and customer-visible repair acceptance remain required before closing the issue.

Current qualified local source: e707666. The revised repair and complete cold-history consumer selection passes 92 tests / 3,711 assertions, with warnings fatal. The migrated-table/repair selection independently passes 21 / 130 on PostgreSQL 17.11 and 21 / 130 on MySQL 8.0.46; those are backend repeats, not additional unique cases. Full PHPStan and focused ECS pass. The new immutable recovery fixture grows replay evidence from 70 to 71 without weakening its guard. Full three-way official counterfactual validation passes against the unchanged base: existing evidence passes, the new history-backed recovery case passes on the implementation and fails on the prior source. The replay guard is unchanged. Local interpreter/mount/cache-ownership setup errors remain separate unsuccessful attempts. The first db050 source gate failed because that corpus fixture was missing, and remains failed. Four earlier valid Sonar maintainability findings received focused selection/application and date-validation refactors; the fresh analyzer now reports zero OPEN/CONFIRMED findings and the unchanged quality gate passes.

No package or image is published by these results. Normal final-head CI, compatible release metadata, normal installation, actual Server HTTP consumers and the explicit historical repair acceptance remain open.

Final metadata candidate: 6e53b06 prepares the compatible 2.12.0 minor because it adds a public operator command. Only composer product-train, changelog heading and the command-version documentation differ from tested e707666; runtime and test source are byte-identical. Fresh exact-head CI is required. No tag or package publication exists yet. The separate Server predicate source merged as3f448d3099848d6d8ec5971432bd8b60f26dfec3 after all thirteen applicable candidate checks plus one intended skip; independent main checks and image delivery remain separate.

@rmcdaniel rmcdaniel changed the title Preserve UTC instants in datetime search attributes Preserve datetime search instants and add history-backed projection repair Oct 23, 2026
@sonarqubecloud

Copy link
Copy Markdown

@rmcdaniel
rmcdaniel marked this pull request as ready for review October 23, 2026 15:38
@rmcdaniel
rmcdaniel merged commit b3bbfdb into main Oct 23, 2026
23 checks passed
@rmcdaniel
rmcdaniel deleted the fix/898-search-datetime-instants branch October 23, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants