Skip to content

fix: posting retry recovery, configurable extraction URL, and integration test fix - #3

Merged
technowizard merged 2 commits into
mainfrom
fix/post-hardening-followups
Aug 1, 2026
Merged

fix: posting retry recovery, configurable extraction URL, and integration test fix#3
technowizard merged 2 commits into
mainfrom
fix/post-hardening-followups

Conversation

@technowizard

Copy link
Copy Markdown
Owner

Summary

Follow-ups to the production-hardening PR (#2). Three independent fixes addressing a posting retry gap, configurable extraction provider support, and a pre-existing integration test failure.

Changes

P1 — Posting retry recovery

  • Added retryPosting domain function for posting_failed → posting transition with actor authority and version guards
  • Modified command service post() to branch on posting_failed: finds the latest posting attempt, verifies it is failed and not permanent_rejection, reuses its idempotency key, resets to pending, and re-enqueues
  • Added findLatestPostingAttempt repository method
  • E2E posting retry scenario now completes posting and asserts ACC- reference

P1 — Configurable extraction provider

  • Extraction adapter reads EXTRACTION_API_URL from env, defaults to OpenRouter
  • Enables Google AI Studio via https://generativelanguage.googleapis.com/v1beta/openai/chat/completions
  • Documented in .env.example

P2 — Integration test fix

  • Root cause: findBusinessDuplicate found stale cases with the same deterministic invoice number (INV-2026-0001) from other test fixtures
  • Added beforeEach/afterEach cleanup targeting stale INV-2026-0001 cases and @t8.test users
  • Server suite is now fully green (236/236) for the first time

Verification

  • Server: 236/236 (was 232/233)
  • Web: 46/46
  • E2E: 6/6
  • Typecheck, build, lint, format: green

Follow-ups (outside scope)

  • Live OpenRouter / Google AI Studio verification (credentials unavailable)
  • Managed deployment verification (R2, managed PostgreSQL)

… integration test fix

- Add retryPosting domain function for posting_failed -> posting transition
  with actor authority and version guards
- Branch command service post() to reuse existing posting attempt and
  idempotency key when state is posting_failed instead of creating a new one
- Add findLatestPostingAttempt repository method ordered by createdAt desc
- Make extraction adapter API URL configurable via EXTRACTION_API_URL env,
  defaulting to OpenRouter; enables Google AI Studio OpenAI-compatible endpoint
- Fix integration test isolation: clean stale INV-2026-0001 cases before and
  after each run to prevent business-duplicate false positives from other
  fixtures; server suite is now fully green at 236/236
…ssertion

The temporary posting failure scenario now completes posting through the
worker and asserts a stable ACC- reference, proving the retry path produces
one accounting outcome.
@technowizard
technowizard merged commit 21ac501 into main Aug 1, 2026
2 checks passed
@technowizard
technowizard deleted the fix/post-hardening-followups branch August 1, 2026 05:42
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.

1 participant