-
Notifications
You must be signed in to change notification settings - Fork 0
Architecture Lifecycle
emrecanozturk edited this page Jul 16, 2026
·
1 revision
IntentFlow features move through a predictable lifecycle.
Start with behavior, not files.
Ask:
- What can the feature be doing?
- What can the user ask for?
- What can the outside world return?
- What side effects are needed?
- What screens can be opened?
- What does the parent need to know?
- What must always be true?
Write the contract as Kotlin types, and in AI mode as a manifest.
The contract should answer:
- state names
- intent names
- event names
- effect names
- route names
- output names
- invariant statements
- acceptance traces
The reducer turns signals into next behavior.
It can:
- return next state
- request effects
- emit outputs
- emit routes
- request cancellation
It cannot:
- call a service directly
- read persistent storage
- mutate global state
- push screens directly
- call UI APIs
Effect handlers execute side work and return events.
Common effect handler dependencies:
- API clients
- repositories
- keychain wrappers
- analytics clients
- permission services
- clocks
- file systems
Projection converts state into UI state.
Example mapping:
| Feature State | UI Projection |
|---|---|
.idle |
form enabled, no spinner |
.validating |
form disabled, spinner visible |
.failed(message) |
error label visible, retry enabled |
.authenticated |
success state |
Jetpack Compose and Android Views should:
- render projected state
- send intents
- observe store snapshots
- hand routes to a router
- hand outputs to a parent
They should not own workflow transitions.
Write tests for:
- pure reducer traces
- cancellation decisions
- effect-to-event loops
- route output
- parent output
- manifest validation
- generator smoke output
Before release-facing changes:
./scripts/check.shCI verifies:
- Kotlin package tests
- generator smoke
- manifest validation
- demo app build
- documentation build
- CodeQL scanning
A good IntentFlow feature has:
- a clear finite state list
- effects that are named after product work
- routes and outputs that are visible
- tests that read like acceptance traces
- UI that can be replaced without changing workflow behavior
IntentFlow for Android is a workflow-first, AI-ready architecture proposal. Start from behavior, keep reducers pure, keep effects explicit, and let UI adapt to the workflow.