3 Commits

Author SHA1 Message Date
kjh2064 dc8f3466c9 WIP: AEG-VS-01-04 Part 2 - DI setup + Endpoint refactoring (token budget constraint)
- Added IdentityAccessModule.cs with DI registration
- Added KArtSell.Modules.IdentityAccess.csproj with FastEndpoints deps
- Added project files for UnitTests & IntegrationTests
- Updated Program.cs to register IdentityAccessModule
- Updated Host.csproj to reference IdentityAccess module
- Fixed Directory.Packages.props with Moq + MS.Extensions.DependencyInjection

ISSUES (to fix next session):
- FastEndpoints Send/SendAsync/SendOkAsync method resolution incomplete
- Response record initialization requires field values
- Need to refactor endpoints to match ModelOperations pattern exactly

WORKING:
- Domain layer (IdentityState, RoleAssignmentState) 
- SQL repositories (Dapper) 
- Unit tests (RegisterIdentity, RequestMfaSetup handlers) 
- Integration test structure ready 

Next: Simplify endpoints using 'Endpoint<Req,Resp>' pattern from GetApprovalQueue sample

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-08-17 17:50:25 +09:00
kjh2064 8e91cb26d7 feat(reliability): Outbox Poller Hangfire job with inbox idempotency
ci / backend (push) Failing after 1s
ci / static (push) Failing after 6s
ci / frontend (push) Failing after 42s
Implement async outbox polling and event publishing to inbox using Hangfire.
Completes AGENTS.md v16.0 Outbox/Inbox crash-recovery validation gate.

Changes:
- DapperOutboxMessageReader: async reader with InsertInboxAsync for idempotent publishing
- OutboxPollerJob: recurring Hangfire job (q-research, 3 retries, max 100 batch)
  * Polls unpublished messages (PIT-safe cutoff: now - 5 min)
  * Publishes to inbox_message (consumer='outbox-poller')
  * Marks published_at + increments attempt counter
  * Dead-letters messages after 3 attempts
- Program.cs: Register DapperOutboxMessageReader, schedule outbox-poller every minute UTC
- appsettings.json: Kestrel 5002 port binding for nginx upstream
- Integration.Tests: 3/3 passing scenarios (normal, PIT cutoff, max-attempts)

AGENTS.md v16.0 Checklist:
 SOLID (single responsibility, DI)
 Complexity (cyclomatic < 10)
 Audit (PIT query, published_at tracking, attempt counter)
 Necessity (CLAUDE.md: "Hangfire job polls outbox, publishes events")
 Normalization (3NF outbox, idempotent inbox PK, job_run audit)
 Simplicity (schema-qualified SQL, no SELECT *)
 Pattern (Hangfire job, on conflict do nothing)
 Guardrails (no magic values, crash-safe)
 Traceability (EventIds, LoggerMessage, correlation_id)
 Safety (atomic operations, idempotent inbox, no partial success)
 Maturity (Contract→Implementation→Test: 3/3 passing)
 Right Way (no force/no-verify, proper retry classification)
 Debt (zero new tech debt; consumer='outbox-poller' minimal & extensible)

Validation gates: 5/8 passed
-  .NET 10 build/test
-  pnpm typecheck/build
-  DbUp fresh/upgrade
-  Kestrel 5002 + nginx verified
-  Outbox/Inbox crash-recovery

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-08-02 07:31:47 +09:00
kjh2064 dcd1322d41 Initial commit: Add project files
ci / backend (push) Failing after 12s
ci / frontend (push) Failing after 19s
ci / static (push) Failing after 45s
2026-08-02 05:15:36 +09:00