Commit Graph

21 Commits

Author SHA1 Message Date
Mike Kell 63a35eceeb feat(stage-16a): error logging, crash capture, and bug reporting
Closes the two findings the release committee review identified as absolute
gaps: the platform had no structured logging and no crash reporting, so runtime
errors were invisible in every environment and operators had no way to report a
defect with evidence attached.

Addresses PROJECT_STATE_AUDIT.md findings P3.4 (structured logging infrastructure)
and P3.5 (crash reporting integration), plus the "No logging infrastructure" and
"No crash reporting" architectural risks in section 3.4.

core — new observability layer (packages/core/lib/src/observability/):
- KcLogLevel: five ordered severities (debug/info/warning/error/fatal) with
  numeric severity, label, isAtLeast() threshold comparison, and fromString().
- KcLogRecord: immutable structured record (level, source, message, timestamp,
  unmodifiable context, error, stackTrace) with format(), toJson(), isFailure.
- KcRedactor: credential redaction over 14 sensitive key fragments, recursing
  through nested maps and lists. Applied to every logged context map and every
  bug report diagnostics map.
- KcLogSink contract plus three implementations: KcConsoleLogSink (silent in
  release by default), KcInMemoryLogSink (bounded ring buffer supplying bug
  report evidence), KcMultiLogSink (fan-out that tolerates a failing sink).
- KcLogger: the logging facade. Drops sub-threshold records, redacts context,
  and swallows sink exceptions so observability can never break a business
  operation. Provides forSource() for subsystem-scoped child loggers.
- KcErrorReporter: installs FlutterError.onError and
  PlatformDispatcher.instance.onError, and provides runGuarded() to wrap runApp.
  restore() resets global state so tests stay isolated.
- KcBugSeverity and KcBugReport: the report model with redacted diagnostics,
  hasFailureEvidence, toJson() for transmission, and toMarkdown() for export.
- KcBugReportSink contract plus KcInMemoryBugReportSink.
- KcBugReportService: validates input, attaches the recent log tail as evidence,
  logs the submission outcome, and returns a failure result rather than throwing
  when the tracker is unreachable.
- KcObservability: assembles logger, evidence buffer, and bug report service
  together. Building them independently is the most likely way to produce empty
  bug reports, so this bundle guarantees they share one buffer.

design_system:
- KcBugReportDialog and KcBugReportDraft: the shared operator reporting form
  with inline validation, severity selection, optional reporter identity, and an
  explicit statement that logs are attached and credentials are never included.
  Kept free of a core dependency so design_system stays dependency-free.

Application wiring (kell_web and kell_mobile):
- AppServices and MobileAppServices hold a KcObservability; all four factories
  (fake/wordpress/square/multi) stamp their environment label so reports are
  attributable to the mode that produced them.
- Both main.dart entry points install the global error handlers before the first
  frame and wrap runApp in a guarded zone, then emit a startup record capturing
  the effective environment and whether a fake-mode credential fallback occurred.
- "Report a problem" action added to the AppShell and MobileShell app bars,
  capturing the active screen (and tab index on mobile).

Documentation:
- docs/operations/release-checklist.md (new): per-environment release gates for
  Development, Test/QA, Staging, and Production. Each environment inherits the
  prior one's gates and adds its own, with build commands, functional and
  observability verification, a sign-off record, rollback triggers, and the open
  blocker register.
- master_development_brief.md: Stage 16A manifest, corrected baseline, Stage 16C
  defined for the deferred scope (retry/rate limiting, remote sink, health
  dashboard, analytics). Marked the square()/multi() factory and ID conflation
  debt items resolved (fixed in Stage 10E but still listed as open).
- build_execution_tracker.md: Stage 16A slice entry.
- PRD.md: milestone table brought current; observability added to infrastructure
  requirements. Added a scoped markdownlint-disable for MD011 because the PRD's
  "(text)[cite: n]" citation markers are indistinguishable from reversed links
  and were silently corrupted by markdownlint --fix during this review.
- mkdocs.yml and operations/index.md: register the release checklist.

Corrections made during review:
- The documented test total of 1,458 omitted feature_policy's 17 tests. The true
  grand total is 1,475; both figures are now documented with the reason.

Validation:
- 85 new tests: 56 core, 10 design_system, 10 kell_web, 9 kell_mobile.
- 1,475/1,475 passing across all 11 packages and apps.
- dart analyze --fatal-infos clean across all 11 packages and apps.
- markdownlint clean on all five modified/created documents.

Known limitations (tracked as Stage 16C):
- Logs and bug reports are held in-process only. There is no remote sink, so
  diagnostics are lost on restart and are unavailable off-device.
- Usage analytics and the per-channel integration health dashboard are not
  implemented; IntegrationHealthCheck remains a contract with no implementation.
2026-08-29 10:48:18 -04:00
Mike Kell 116255f8ac feat(stage-10F): SquareSyncStatusPanel + IntegrationsPage + MobileIntegrationsPage + squareSyncController wired into both shells 2026-07-25 16:55:46 -04:00
Mike Kell ab56c942c7 feat(stage-10E): SquareSyncController + square()/multi() factories + KcBootstrap Square validation + ID conflation fix
Stage 10E - feat/square-catalog-sync-service-controller

P1.1 AppServices.square() / multi() factories (kell_web + kell_mobile)
P1.2 SquareCatalogSyncService ID conflation fix (squareCatalogObjectId lookup)
P1.4 SquareSyncController ChangeNotifier (SyncPhase, syncAll, reset, disposal guard)
P1.5 KcBootstrap Square credential validation with fallback warning

New files:
  feature_wordpress/lib/src/application/square_sync_controller.dart
  feature_wordpress/test/square_sync_controller_test.dart (18 tests)

Modified files:
  feature_wordpress/lib/src/domain/product_draft.dart (squareCatalogObjectId field)
  feature_wordpress/lib/src/application/square_catalog_sync_service.dart (ID conflation fix)
  feature_wordpress/lib/feature_wordpress.dart (barrel export)
  kell_web/lib/composition/app_services.dart (square/multi factories)
  kell_mobile/lib/composition/mobile_app_services.dart (square/multi factories)
  kell_web/test/composition/app_services_test.dart (+23 tests)
  kell_mobile/test/composition/mobile_app_services_test.dart (+23 tests)
  docs/development/build_execution_tracker.md

Test results: 537/537 feature_wordpress, 47/47 kell_web, 49/49 kell_mobile,
              34/34 core, 167/167 feature_inventory - 834 total, 0 failures
dart analyze --fatal-infos: no issues found across all 5 packages
2026-07-25 16:26:53 -04:00
Mike Kell 0a45ecb1c0 feat(wc-catalog-expansion): Stage 9C — WooCommerce catalog expansion
- Add ProductCategory domain model (id, name, slug, parentId, count) with copyWith, equality, toString
- Add ProductImage domain model (id, url, alt, position) with copyWith, equality
- Extend ProductPublishingRepository contract: createProduct, deleteProduct, updateProductImages, getProductImages, getCategories, createCategory, updateCategory, deleteCategory
- Implement all 8 new methods in FakeProductPublishingRepository with seed categories
- Implement all 8 new methods in WordPressProductPublishingRepository
- Add WooCommerceApiClient methods: createProduct, deleteProduct, getCategories (paginated), createCategory, updateCategory, deleteCategory, getProductImages, setProductImages
- Add use cases: CreateProduct, DeleteProduct, GetCategories, CreateCategory, UpdateProductImages
- Update feature_wordpress.dart barrel exports
- Update test stubs in dashboard_controller_test.dart and product_publishing_page_test.dart
- Add 69 new tests in wc_catalog_expansion_test.dart (388 total feature_wordpress, 24 kell_web — all passing)
- Update master_development_brief.md and build_execution_tracker.md
2026-07-11 10:23:31 -04:00
Mike Kell 5df3d8beac feat(inventory): Stage 9B — WooCommerce stock/inventory sync 2026-07-11 10:00:55 -04:00
Mike Kell e92788038a feat(orders): Stage 9A - WooCommerce Orders API integration
- Extend OrderStatus with onHold, refunded, failed
- Extend OrderItem with productId, variationId, customizations
- Extend Order with paymentMethod, source, customFields
- Add OrderSource enum (online, market, manual)
- Add getOrder(id) to OrdersRepository contract and FakeOrdersRepository
- Add WooCommerceOrderMapper (WooCommerce JSON <-> Order domain)
- Add WooCommerceOrdersRepository implementing full OrdersRepository
- Add orders API methods to WooCommerceApiClient (getOrders, getOrder,
  updateOrderStatus, createOrder, addOrderNote)
- Export WooCommerceApiClient/WooCommerceApiException from feature_wordpress
- Add feature_wordpress + http dev deps to feature_orders pubspec
- 83 new tests: mapper (25), repository+API client (23), FakeRepo.getOrder (3),
  plus existing suite grows to 198/198 feature_orders
- All packages analyze clean; 847/847 total tests passing
- Update master_development_brief.md and build_execution_tracker.md
2026-07-11 09:45:36 -04:00
Mike Kell b2bec44fcb feat/orders-domain: expand orders domain with write operations and 90 tests 2026-07-10 19:04:39 -04:00
Mike Kell d36c2d1e73 feat(inventory): Stage 5A — inventory domain expansion with write actions 2026-07-10 18:33:02 -04:00
Mike Kell b69edd3e4a feat(wordpress): add category-only product edit (Stage 1B)
Validate Docs / validate-docs (push) Successful in 1m3s Details
2026-04-11 15:54:51 -04:00
Mike Kell 8d1a01581a tage 1A — Description-only product edit implemented
Validate Docs / validate-docs (push) Successful in 56s Details
2026-04-11 11:07:36 -04:00
Mike Kell ae9c1dd90c feat(feature_wordpress): add name-only product update
Publish Docs / publish-docs (push) Successful in 57s Details
2026-04-11 10:36:00 -04:00
Mike Kell 039612cb6e Update main with product publishing
Publish Docs / publish-docs (push) Successful in 1m57s Details
2026-04-05 20:03:10 -04:00
Mike Kell 129a66f0cf feat(kell-web): add runtime environment bootstrap for wordpress mode
Validate Docs / validate-docs (push) Successful in 1m5s Details
2026-04-04 15:23:38 -04:00
Mike Kell 23ea1bebe1 feat(workflows): add shared filtering search and selection persistence
Validate Docs / validate-docs (push) Successful in 1m0s Details
2026-04-04 14:59:26 -04:00
Mike Kell 0f61badba6 feat(navigation): add cross-feature workflow handoffs
Validate Docs / validate-docs (push) Successful in 1m5s Details
2026-04-04 14:42:03 -04:00
Mike Kell 00a667d19e feat(dashboard): compose live summary data across features
Validate Docs / validate-docs (push) Successful in 59s Details
2026-04-04 14:07:21 -04:00
Mike Kell e06c2d8f94 refactor(kell-web): add app-level dependency composition
Validate Docs / validate-docs (push) Successful in 1m9s Details
2026-04-04 13:38:51 -04:00
Mike Kell 6b0e16dec6 feat(kell-web): add dashboard page and reusable shell widgets
Validate Docs / validate-docs (push) Successful in 45s Details
2026-04-04 12:51:08 -04:00
Mike Kell c7c12b3b0d feat(kell-web): add shell routing and inventory vertical slice
Validate Docs / validate-docs (push) Successful in 53s Details
2026-04-04 12:41:06 -04:00
Mike Kell 417430d996 feat(flutter): add Kell Creations design system and inventory first slice
Validate Docs / validate-docs (push) Successful in 41s Details
2026-04-04 12:08:51 -04:00
Mike Kell 59548cedbd Add Flutter app and package monorepo scaffold
Publish Docs / publish-docs (push) Successful in 59s Details
2026-04-04 09:19:46 -04:00