Skip to content

Wire concrete observability implementations for appMachine named actions #8

Description

@coderabbitai

Background

app.machine.ts (added in #7) declares and exports typed named actions on every boot-workflow transition, following the XState v5 idiomatic pattern where the machine declares what must be observed and the caller supplies the implementation via createActor(appMachine, { actions: { … } }):

Transition Named action
booting → failed recordBootFailed
booting → title recordBootSucceeded
failed → booting recordBootRetryRequested

The type test file (tests/app-machine.types.test.ts) validates that these action names are part of the exported AppMachineAction contract.

However, no concrete implementations (logging, metrics counters, error telemetry) exist in the codebase yet. Per ADR 003 scope — a minimal machine with no adapter imports — this was intentionally deferred from #7.

Work required

  • Wire recordBootFailed, recordBootSucceeded, and recordBootRetryRequested with concrete logging/metrics implementations at the point where the actor is created.
  • Export utility hooks (e.g. createObservableAppActor) that surface boot success/failure/retry rates to the application layer, enabling maintainers to diagnose boot failures and monitor failure rates without reading source code.

Acceptance criteria

  • Concrete implementations supplied for all three named actions when the actor is created.
  • Boot failures are observable without reading source code (e.g. via logging or a metrics hook).
  • Boot success/failure/retry rates are surfaced to the application layer.
  • Existing type tests continue to pass; no new @ts-expect-error suppressions introduced.

References

/cc @leynos

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions