Current State
This file is the current implementation snapshot and validation checkpoint. Historical execution details remain in Git and immutable records such as the Epic 003 specification; the latest continuation notes are in AI handover.
Active work
Epic 004 (behavior-preserving refactoring) is complete through REF-TASK-019, and Epic 005's Mocking Bird checkout specification is complete. Epic 006's SEC-TASK-001 and SEC-TASK-002 repository implementations are in progress: hosted URL schemes and frontend absolute API bases are constrained to HTTPS at credential boundaries, and expired account-throttle keys are reclaimed on attempts. Focused acceptance tests and deployment documentation are being completed. Staging/production TLS, headers, cookies, process topology, edge limits, and business privacy/retention decisions remain unverified or external. See Epic 006 and AI handover for details.
Epic 008 (Full Surfboard ECR integration) implementation complete through REF-TASK-031. All ECR integration test coverage now at 100% across statements, branches, functions, and lines. Phase 1 tasks ECR-TASK-001 through ECR-TASK-012: Complete (gateway skeleton and shift operations coded and fully verified). Phase 2 foundation tasks ECR-TASK-013 through ECR-TASK-031: Complete (idempotency and reconciliation safeguards verified with focused tests).
Implementation status:
SurfboardECRGatewayadapter implementingFiscalGateway(register/state/open/close/end-of-day/cash/files)MockingBirdECRStoredeveloper-controlled ECR stateUnavailableECRGatewayfallbackComposition helper not yet type-safe
Card payment flow integrated with ECR shift validation Ensures ECR shift is open before card payment in surfboard mode Preserves fast card UX with best-effort shift-open operation Mocking Bird scenarios for success, already-open, invalid-terminal, and failure outcomes (
createCheckoutGatewaystill returnsCheckoutGateway)UnavailableECRGatewayfallback — fully testedcreateECRGatewaycomposition helper — type-safe, fully verifiedCard payment flow integrated with ECR shift validation — ensures ECR shift is open before card payment in surfboard mode, preserves fast card UX with best-effort shift-open operation
Mocking Bird scenarios for success, already-open, invalid-terminal, and failure outcomes — fully typed and tested
ensureECRShiftOpenandensureECRShiftOpenBestEffortfunctions — refactored for testability with optional FiscalGateway parametercreateCheckoutGatewaywith Mocking Bird support — composition now wires both Mocking Bird checkout and ECR shift statecheckout-composition.test.ts: 15 tests (up from 8), covers UnavailableECRGateway not-configured and ensureECRShiftOpen with injected gatewaymocking-bird-ecr.test.ts: 27 tests (up from 12), covers store capacity validation, clear(), and all gateway success/error pathssurfboard-ecr-gateway.test.ts: 98 tests (up from 60), covers full error-mapping for all 6 gateway methods (registerECR, getECRState, openShift, closeShift, endOfDay, depositCash, withdrawCash) plus STORE-ID header tests and 100% branch coverage forsurfboard-ecr-gateway.ts(missing-status primitives/null/object, ERROR code ternary,data ?? {},orderId ?? "",cashRegisterIdchained fallback,shiftStatedefaults,getECRFilesfiles fallback per method)pnpm test:coverage: 100% statements/branches/functions/lines forsurfboard-ecr-gateway.ts(and all three Epic-008 ECR integration files)pnpm quality: passed (format:check, lint, typecheck, docs:check)pnpm test: 686 tests passed
Known limitations
Standalone requirements are indexed at docs/specs/standalone.
STANDALONE-001 is implemented as an authenticated delivered-order history page with durable delivery
snapshots, expanded order details, scenario-linked frontend/backend tests, and desktop and mobile
browser coverage. pnpm quality, documentation generation/site checks, and focused scenario tests
passed for this revision. Full frontend and backend pnpm test:coverage also passed at 100% across
statements, branches, functions, and lines; see the requirement record.
The detail panel uses the table's body2 type scale and shows timestamps before timeline events.
STANDALONE-002 keeps the Mocking Bird console visible by default in local Vite and Docker Compose environments while excluding it from hosted builds. The shell preserves authenticated navigation from cached user data during a transient non-401 session refresh error; route guards still handle session verification. Automated checkout remains fake-backed; hosted staging/production select Surfboard through external environment configuration. See the requirement and AI handover for scenario evidence and validation.
Epic 007's full-refund flow is complete. REFUND-TASK-001 through REFUND-TASK-007 are implemented.
Task 005 adds safe eligibility projection and the confirmed active-KDS detail-menu action. Task 006
adds the corresponding expanded-history action and accessible refunded total, notice, and refund
timestamp. Task 007 adds desktop/mobile browser journeys and final release evidence. Focused
component/API tests, PostgreSQL integration, browser E2E, pnpm docs:build, pnpm quality, and
pnpm validate:docker pass. See the task index and
AI handover.
Mocking Bird checkout now settles with providerPaymentReference and paymentMethod: "card", so
orders created through Mocking Bird checkout satisfy the refund eligibility check and the Refund
Order Action renders in the KDS and order history UIs for local manual testing.
Latest local validation checkpoint
STANDALONE-002 validation passed locally with Node 24.21.0 and pnpm 10.34.5.
REFUND-TASK-001 validation passed locally: pnpm quality; 148 focused backend unit tests; and 42
PostgreSQL integration tests spanning refund operations and existing order persistence/history.
REFUND-TASK-002 validation passed: 93 focused Surfboard/application tests and pnpm quality. The
refund integration database ran against the existing Docker PostgreSQL service on port 55432. The
REFUND-TASK-003 validation passed: 40 focused backend tests, 41 frontend API/console tests,
pnpm quality, and pnpm docs:build. The full build, suite/coverage, supply-chain, documentation
site check, and Docker validation requested for Epic 007 completed with REFUND-TASK-007: build,
tests, coverage, quality, supply-chain checks, docs build/site check, and Docker validation passed.
REFUND-TASK-005 validation passed: 18 focused KDS/queue tests, 7 refund OpenAPI/HTTP tests, 17
frontend refund API tests, and 5 PostgreSQL refund-operation integration tests against Docker
PostgreSQL on port 55432. pnpm docs:build and pnpm quality passed.
REFUND-TASK-006 validation passed: 26 focused history/KDS component tests, 7 refund OpenAPI/HTTP
tests, and 6 PostgreSQL refund-operation integration tests against Docker PostgreSQL on port 55432.
pnpm docs:build and pnpm quality passed.
pnpm buildpassed; the default production bundle omits the Mocking Bird console chunk.pnpm testpassed (56 CI tests, 307 frontend tests, 496 backend unit tests).pnpm test:coveragepassed against the local PostgreSQL service (307 frontend and 588 backend tests); both applications met 100% statements, branches, functions, and lines.pnpm qualitypassed, including traceability and documentation checks.pnpm docs:buildandpnpm docs:site:checkpassed.pnpm validate:dockerpassed against the isolated validation Compose project: 92 PostgreSQL integration tests, the backend restart/durability lifecycle, and 82 desktop/mobile browser tests.- Backend PostgreSQL lifecycle timeouts are bounded at 120 seconds to accommodate slow storage. Auth-plugin cache headers now apply uniformly to its routes; coverage cases cover the branches exposed by the current Vitest version. These changes do not alter the documented HTTP contract.
- Follow-up STANDALONE-002 regression: a transient current-user refresh error used to hide
authenticated navigation despite retaining the user in cache. The new
STANDALONE-002-S01AppLayout test failed before the fix and passed afterward.pnpm testpassed (56 CI, 308 frontend, 496 backend tests), as didpnpm quality. - Redocly still warns that
/healthlacks a documented 4xx response; TypeDoc still warns about an inherited Redux Toolkit summary. Both are non-blocking and pre-existing.
Implemented system
The repository contains the local MVP path developed through Epic 003:
- authenticated user sessions, account settings, password recovery, localized responsive shell, structured diagnostics, and local/test email interception;
- protected product creation, validation, editing, deletion, and immutable finalized-order product snapshots;
- tablet order entry with commercial and non-commercial finalization, operational metadata, deterministic fake checkout, durable duplicate suppression, explicit declined/unknown outcomes, and unresolved-attempt visibility;
- active kitchen queue, detailed and compact order representations, fulfillment transitions, delivery, metadata correction, append-only histories, current-day sales, and restart durability;
- real-PostgreSQL integration coverage, desktop/mobile Playwright journeys, Docker validation, strict coverage and supply-chain gates, OpenAPI/TypeDoc documentation, and mechanical scenario-to-evidence validation.
The authoritative per-task status remains the Epic 003 task index.
Tasks marked In progress there have repository implementations but await that index's required
external/hosted completion evidence; do not silently promote them from this summary.
Blocked external integration
MVP-TASK-034 remains Blocked. The repository-side Surfboard payment slice is implemented and tested, while local/test behavior remains fake-backed. Do not invent fiscal payloads or mark the task implemented until a human supplies the external Demo prerequisites through the deployment secret system and the required evidence can be collected.
The complete decision, known unknowns, safety constraints, and handoff are in
ADR 004. In summary, continuation requires the
approved port design; Demo URL and credentials; merchant/store and networked EMV terminal; confirmed
Demo ECR/register/control-unit facts; public HTTPS webhook subscription and secret; confirmed
receipt sequenceNumber semantics; and a separately triggered redacted Demo smoke. No Live call is
authorized. Provider idempotency, Demo ECR availability, Skatteverket integration, X reports, and
PAYMENT_PROCESSED semantics remain unclaimed where ADR 004 records them as unknown.
REF-TASK-019 validation checkpoint
Local validation used Node 24.21.0 and pnpm 10.34.5. Against baseline d5f0420^, the route/OpenAPI
surface, root and workspace manifests, backend environment configuration, and frontend page registry
were unchanged. A TypeScript runtime/AST comparison found all 912 flattened locale keys and copy
values unchanged; stable scenario IDs in backend, frontend, and E2E tests also matched. Query-key
values were compared across the old order API and moved capability modules. The route registrars
retain named operations and service mappings; OpenAPI contract tests and the backend suite cover the
HTTP surface.
pnpm test:ci: passed (55 tests).- Backend fast tests: passed (403 tests); real-PostgreSQL integration tests: passed (92 tests across 12 files).
pnpm build: passed.pnpm e2ewith isolated database and ports: passed (80 browser tests, desktop and mobile).- Backend aggregate coverage: passed (493 tests, 100% aggregate coverage). The
MVP-SALES-001-S01current-day-salesintegration test was fixed for a DST boundary edge case on 2026-10-25 (Stockholm fall-back day, a 25-hour local day), wherestart + interval '1 day'on a timestamptz column incorrectly landed inside today's local window. - The initial REF-TASK-019 frontend run had 268 passed and 18 failed in
MockingBirdConsolePage.test.tsx. This was fixed afterward: the test state fixture now satisfies the checkout API contract, checkout tests use matching API responses and semantic DOM selectors, and checkout clear/settle presentation is consistent with the backend state. - Current frontend fast suite: passed (286 tests across 44 files); frontend production build passed.
pnpm security:dependencies,pnpm secrets:check,pnpm containers:lint,pnpm db:check, andpnpm supply-chain:diagnostics: passed. Temporary diagnostic reports were removed.- The canonical Docker validation was deliberately skipped at the user's direction to preserve the
already-running
foodtruck-order-validatestack and its volume. Hosted CI and persisted CI artifacts have not been verified for this revision.
pnpm docs:build, pnpm docs:site:check, and pnpm quality passed after the documentation edits.
The quality gate reported only the unrelated health-route OpenAPI 4xx documentation warning and
Redux Toolkit TypeDoc inheritance warning.