Deepening pass: six improve-phase changes #33
Loading…
Reference in a new issue
No description provided.
Delete branch "refactor/deepening-pass"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Phase 7 of the package-architecture project — the improve loop the spec
hands off to. Six deepening changes, one per commit, fast-forwardable.
Each commit passes
task ci:qualityon its own.What changed
refactor(engine)delete the automation gateway pass-throughAutomationGraph.gatewayhad no reader at allrefactor(contract)move the workflow codec into:enginerefactor(app)construct the composition root oncemainsaid otherwiserefactor(engine)lift the workflow editing algebra out of the view modelAndroidViewModel, untested in either source settest(persistence)hold both port adapters to one conformance suiterefactor(platform)declare each device reading oncePlus a dead wildcard import that made the
ui -> platformwatch-itemtripwire unmeasurable, and the spec update recording all of it.
Numbers
sibling-imports.baselineevents -> actionsnow empty:persistence:contractmain linesAutomationGraphconstruction sites inmainTwo drifts this fixes
Both were live on
main:devicesoutput,audioSnapshotemittedit, and the audio event's hand-written payload schema denied it — so
the output picker offered the field on one path and not the other.
BuiltInEventRegistrycalled the power trigger "Power connectedchanged" while
BackgroundResourceManagercalled the same trigger"Power connection changed", depending on which screen you were on.
Deliberate contract change
The audio event's payload schema gains the
devicesproperty it wasalready carrying. Required sets are unchanged on both sides, so nothing
that validated before stops validating — the action's output schema is
now the looser event-contract one, which its own reading has always
satisfied in full.
New dependency, worth a look
Robolectric, test-only, on
:persistence. It runs the real AndroidSQLite on the JVM, which is what puts the adapters that actually ship
inside
task ci:qualityinstead of behind an emulator. Apache-2.0, doesnot ship, F-Droid unaffected — but it fetches an
android-alljar fromMaven Central on first run, so CI needs that reachable. Straightforward
to back out in favour of instrumented runs if you would rather.
Verification
task ci:qualitygreen after every commit../gradlew :app:connectedDebugAndroidTest— 68 tests, 0 failureson
macros_pixel9_api36. Required by the spec's risk register after aclass move, and this branch moves several.
to "Run completed", run persisted and shown in the Activity tab.
Follow-up filed as #32 — an automated smoke E2E so that last step stops
being hand-driven.
A device reading — audio route, network, screen, power, Do Not Disturb — was declared in five places: the snapshot function in `actions`, the action's output schema, the event's payload schema hand-written in `events` in a different notation, the receiver that built the payload, and the intent-filter wiring. Nothing held them in agreement, and two had already drifted: - `devices` was declared by the audio action and emitted by the audio snapshot, but absent from the audio event's payload schema, so the output picker offered the field on one path and not the other. - AudioRouteReceiver re-built five of the six audio fields by hand. Moves the readings into the root platform package — which both `actions` and `events` may import, and neither sibling may import the other — with the fields declared once and the action and event schemas derived from that declaration. The intent-supplied variants stay explicit rather than being optional override parameters hanging off a snapshot function. The five `events -> actions` entries leave sibling-imports.baseline, taking it from 19 to 14 and clearing that direction entirely; `events` now only reaches `scheduling` and `audio`. Contract change, deliberate: the audio event's payload schema gains the `devices` property it was always carrying. Required sets are unchanged on both sides, so nothing that validated before stops validating — the action's output schema is now the looser event-contract one, which its own reading has always satisfied in full. Adds five JVM tests asserting each event uses its reading's schema rather than a copy, so a hand-written payload schema cannot creep back.