You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -272,6 +285,7 @@ System runtime updated and stabilized:
272
285
- improved dependency management
273
286
274
287
Effect:
288
+
275
289
- modernized execution environment
276
290
- reduced technical debt
277
291
- better deployment consistency
@@ -286,10 +300,12 @@ New UI introduced for:
286
300
- notifications module
287
301
288
302
Additionally:
303
+
289
304
- legacy views simplified
290
305
- frontend structure partially cleaned up
291
306
292
307
Effect:
308
+
293
309
- improved usability for operational users
294
310
- more consistent interaction patterns
295
311
- groundwork for future SPA/BFF architecture
@@ -306,6 +322,7 @@ Delivery process improved with:
306
322
- structured runtime environments
307
323
308
324
Effect:
325
+
309
326
- repeatable deployments
310
327
- better control over releases
311
328
- preparation for scalable environments
@@ -325,14 +342,259 @@ This log will be extended with future phases.
325
342
326
343
---
327
344
345
+
## Phase: 2026-03 / 2026-05
346
+
347
+
### 1. From modules to contract boundaries
348
+
349
+
After the first phase of organizing selected modules, modernization moved toward a broader contract-driven architecture.
350
+
351
+
More areas of the system are no longer just folders or modules inside the monolith. Selected domains now have their own APIs, read models, ports, adapters, background processes, and intermediate layers for new consumers.
352
+
353
+
In practice, this means new system elements can use explicit contracts instead of directly referring to older legacy models, controllers, or tables.
354
+
355
+
Effect:
356
+
357
+
- stronger separation of responsibilities
358
+
- greater readiness of selected modules for extraction
359
+
- ability to connect new consumers such as Core API, MCP, and AI without bypassing domain boundaries
360
+
- stronger foundation for future extraction into microservices
361
+
362
+
---
363
+
364
+
### 2. Activities module and append-only audit log
365
+
366
+
The `activities` area was extracted as a dedicated read module with the `activities/v1` API.
367
+
368
+
Implemented elements:
369
+
370
+
- activity list
371
+
- activity details
372
+
- filters endpoint
373
+
- read model
374
+
- mapping of legacy payloads into explicit DTOs
375
+
- access limiting based on seller context
376
+
- moving operational history reads behind the module boundary
377
+
378
+
Activity storage was then refactored toward append-only behavior.
379
+
380
+
Instead of treating operation history as regular mutable records, the system started using a model based on event-like writes and a current-state projection (`activities_current`).
381
+
382
+
Effect:
383
+
384
+
- the activity log became a safer audit trail
385
+
- activity updates and deletes were blocked
386
+
- legacy data is normalized behind the module layer
387
+
- the area is prepared for further use by APIs, AI, and future services
388
+
389
+
---
390
+
391
+
### 3. Orders module and external order synchronization
392
+
393
+
A new `orders` boundary was created to organize synchronization and read access for external orders.
394
+
395
+
Implemented elements:
396
+
397
+
- append-only order synchronization foundation
398
+
- external provider port
399
+
- sync run tracking
400
+
- raw payload storage for external systems
401
+
- order and order-item snapshots
402
+
- external references
403
+
- current-state read models
404
+
- internal `orders/v1` API
405
+
- read-only boundary in `comers-core-api`
406
+
- MCP tools for orders
407
+
- dedicated external orders synchronization job in the legacy runtime
408
+
409
+
The eBay integration was especially important here, with movement toward the Sell Fulfillment API and support for shipping-deadline data.
410
+
411
+
Effect:
412
+
413
+
- external orders have a more durable and auditable data model
414
+
- synchronization no longer relies only on a single fetch of the latest records
415
+
- shipping and urgency data can be used by APIs and AI
416
+
- the `orders` module became one of the most important candidates for further extraction
417
+
418
+
---
419
+
420
+
### 4. Messages evolution: AI-assisted translation and replies
421
+
422
+
The `messages` module was extended from synchronization and thread handling toward a multilingual, AI-assisted communication center.
423
+
424
+
Implemented elements:
425
+
426
+
- translation of individual threads
427
+
- translation of thread lists
428
+
- translation of message titles and content
429
+
- persisted user translation-language preference
430
+
- background translation worker
431
+
- integration with `comers-ai-gateway`
432
+
- reply composer context endpoint
433
+
- suggested reply draft based on thread context
434
+
- improving and composing replies based on an operator draft
435
+
- translating replies into the customer’s target language
436
+
- keeping the final send-reply flow as a separate explicit action
437
+
438
+
AI was not connected directly to the view layer or database. Translation and reply generation pass through use cases, adapters, and the capability gateway.
439
+
440
+
Effect:
441
+
442
+
- operators can handle customer messages in multiple languages
443
+
- AI helps prepare replies without replacing the explicit sending process
444
+
- translations can run as background work
445
+
- customer communication became one of the first real AI-assisted operational areas in Comers
446
+
447
+
---
448
+
449
+
### 5. Notifications extended to Core API and MCP
450
+
451
+
The `notifications` module already existed in the previous modernization phase.
452
+
453
+
In this phase, it was extended through integration with the Core API layer and MCP tools.
454
+
455
+
Implemented elements:
456
+
457
+
- notifications facade in `comers-core-api`
458
+
- MCP tools for listing notifications
459
+
- notification detail reads
460
+
- marking notifications as read
461
+
- archiving notifications
462
+
- bulk operations
463
+
- propagation of trusted user context (`X-Internal-User-Id`)
464
+
465
+
Effect:
466
+
467
+
- notifications can be handled by the AI assistant without direct access to legacy
468
+
- operations are executed in the context of a specific user
469
+
- the existing module gained new types of consumers
470
+
471
+
---
472
+
473
+
### 6. AI layer: ChatKit, MCP, Core API, and Gateway
474
+
475
+
The system gained its first real operational AI support layer.
476
+
477
+
Implemented elements:
478
+
479
+
-`comers-ai-webapp`
480
+
-`comers-ai-bff`
481
+
-`comers-ai-chatkit`
482
+
-`comers-ai-mcp`
483
+
-`comers-ai-gateway`
484
+
- local ChatKit runtime
485
+
- conversation thread history
486
+
- response streaming
487
+
- MCP tools for messages, notifications, and orders
488
+
- MCP integration with `comers-core-api`
489
+
- capability gateway for AI operations
490
+
491
+
The AI assistant can now use selected system data and actions through explicit domain tools.
492
+
493
+
It can, among other things:
494
+
495
+
- read message lists and details
496
+
- read notifications
497
+
- read order information
498
+
- use activity-log data
499
+
- mark messages and notifications as read
500
+
- archive messages and notifications
501
+
- support preparation of customer replies
502
+
503
+
A key architectural decision is that AI does not bypass application boundaries.
504
+
505
+
Execution is based on contracts:
506
+
507
+
AI / ChatKit
508
+
→ MCP
509
+
→ Core API
510
+
→ internal legacy APIs and modules
511
+
512
+
Effect:
513
+
514
+
- AI operates as a controlled system consumer
515
+
- tools are limited to explicitly exposed capabilities
516
+
- sensitive operations are performed in user context
517
+
- a foundation was created for further agentic operations without destabilizing legacy
518
+
519
+
---
520
+
521
+
### 7. AI Gateway and capability contracts
522
+
523
+
`comers-ai-gateway` was introduced as an internal capability layer for AI operations.
524
+
525
+
Implemented capabilities:
526
+
527
+
-`translate.v1`
528
+
-`compose_reply.v1`
529
+
530
+
The gateway is responsible for:
531
+
532
+
- hiding AI provider integration details
533
+
- enforcing response structure
534
+
- supporting OpenAI Responses API
535
+
- persistent operations for translations
536
+
- idempotent operation creation
537
+
- operation-status reads
538
+
- background polling through a dedicated runtime container
539
+
540
+
Effect:
541
+
542
+
- the application does not depend directly on the raw AI provider API
543
+
- long-running translation operations can be handled outside the UI request-response path
544
+
- AI capabilities have their own contracts and can evolve independently
545
+
- the gateway became the place for future controlled AI capabilities
546
+
547
+
---
548
+
549
+
### 8. Runtime and infrastructure repository separation
550
+
551
+
Runtime was separated more clearly from application code.
552
+
553
+
Created or organized repositories:
554
+
555
+
-`comers-infra-ai`
556
+
-`comers-infra-legacy`
557
+
558
+
`comers-infra-ai` covers runtime for:
559
+
560
+
- AI webapp
561
+
- BFF
562
+
- MCP
563
+
- AI gateway
564
+
- gateway poller
565
+
- ChatKit runtime
566
+
567
+
`comers-infra-legacy` covers the legacy runtime as a set of containers:
568
+
569
+
- application
570
+
- web
571
+
- cyclic jobs
572
+
- external order synchronization
573
+
- message thread synchronization
574
+
- message translation worker
575
+
576
+
Effect:
577
+
578
+
- application repositories are no longer the primary place for production runtime definitions
579
+
- background processes became explicitly described runtime units
580
+
- deployment, configuration, and service responsibilities are easier to manage
581
+
- the architecture is more ready for further containerization and service extraction
582
+
583
+
---
584
+
328
585
## Future Phases
329
586
330
587
Planned areas of further transformation:
331
588
332
-
- extraction of selected modules into services
333
-
- further isolation of integrations
334
-
- replacement of legacy job model with event-driven architecture
335
-
- deeper separation of frontend (SPA/BFF)
589
+
- further extraction of selected modules into independent services
590
+
- development of `comers-core-api` as a stable contract layer
591
+
- expansion of MCP with additional domain tools
592
+
- further strengthening of trusted user context for AI-executed operations
593
+
- development of `comers-ai-gateway` with additional capabilities
594
+
- further separation of marketplace and shipping integrations
595
+
- replacement of part of the legacy job model with event-driven architecture
596
+
- deeper separation of frontend (SPA / BFF)
597
+
- gradual movement of additional areas into independent runtimes
0 commit comments