ADR-0014: Debug fixture injection harness
- Status: Accepted
- Date: 2026-08-11
- Deciders: maintainers
- Related: tooling.md
Context
The parser and pipeline need end-to-end testing with fake bank
notifications. adb shell cmd notification post -p <package> historically
posted as a specific app, but API 35+ removed the -p flag — posts go
out as com.android.shell, which production never tracks.
Decision
Debug builds include a broadcast receiver that injects fixtures straight into the capture pipeline, bypassing the system listener:
DebugFixtureReceiver(debug source set only) listens forcom.zharif.autobudget.DEBUG_INJECT(extras:pkg,title,body,ts) and callsCapturePipeline.onNotification.ParserEnginemergesBankRuleSets.debugShellRules(12 generic rules forcom.android.shell) whenBuildConfig.DEBUG.AutoBudgetApp.onCreate(debug) auto-addscom.android.shellto tracked packages.scripts/post_fake_notifications.sh --broadcastdrives it;--duplicateproves dedupe.
None of this ships in release: BuildConfig.DEBUG gates the rules merge and
the auto-track; the receiver exists only in the debug manifest.
Consequences
- Fixtures exercise the full runtime pipeline (filter → parse → classify →
dedupe → insert) on API 35+ emulators where
-pis gone. --shell/default modes still work on older APIs or real devices where the flag works.- Debug-only surface: release APKs contain no receiver, no shell rules, and
never track
com.android.shell.
Alternatives considered
- Relying on
cmd notification post -peverywhere — rejected: broken on API 35+. - A test-only activity or instrumentation — rejected: heavier, and the receiver keeps the same single entry point as the real listener.