Recipes

Events, failures, and entry lifecycle

Connect diagnostics, centralized failures, and entry-owned resources without leaking the concrete Controller into feature code.

v0.1.0-dev.2Advancedark_navigation

Events, failures, and entry lifecycle

Record the policy pipeline

Implement NavigationEventSink and pass it to Session. Events distinguish request, redirect, Guard rejection, committed Snapshot, and unexpected failure. Store bounded identifiers and reasons; do not serialize arbitrary Destination fields without a data policy.

Centralize unexpected failures

NavigationFailureSink receives the error, stack trace, request ID, and operation. Connect it at the composition root to Ark Error Manager, Sentry, or your existing reporting boundary. Expected Guard denial remains a result, not a failure report.

Own resources for one runtime Entry

Implement NavigationLifecycleObserver:

  • didEnter creates an Entry-owned scope or resource;
  • didReconfigure updates bindings while identity survives;
  • didExit closes resources for pop, removal, migration, or Session shutdown.

Key resources by NavigationEntryId, not NavigationRouteId: the same Route can appear several times.

Keep feature dependencies narrow

Pages and application services request transitions through NavigationPort. Lifecycle and diagnostics integrations may receive Session-level concrete objects at the composition root; they should not force every feature to depend on NavigationController.

ARKTELOS

Purpose-built engineering systems for software that has to hold.