Skip to content

recover: restore pre-rewind local-first work - #35

Merged
abdulsaheel merged 1 commit into
mainfrom
feat/ble-connector-sync
Jul 2, 2026
Merged

recover: restore pre-rewind local-first work#35
abdulsaheel merged 1 commit into
mainfrom
feat/ble-connector-sync

Conversation

@abdulsaheel

Copy link
Copy Markdown
Collaborator

Restore uncommitted work reverted by an editor rewind, recovered from Claude Code file-history snapshots (pre-15:23 versions). Verified: edge analyze 0 errors + 103 tests pass; analytics 258 tests pass; protocol analyze clean.

Deltas over HEAD: unified BLE connector + offload-frame pipeline (ble_engine), compute_jobs durable derive queue (db), DeriveScheduler ingest/derive decoupling, derivation_engine, local_repository_impl, background_sync, backend_client.

Restore uncommitted work reverted by an editor rewind, recovered from
Claude Code file-history snapshots (pre-15:23 versions). Verified:
edge analyze 0 errors + 103 tests pass; analytics 258 tests pass;
protocol analyze clean.

Deltas over HEAD: unified BLE connector + offload-frame pipeline
(ble_engine), compute_jobs durable derive queue (db), DeriveScheduler
ingest/derive decoupling, derivation_engine, local_repository_impl,
background_sync, backend_client.
@abdulsaheel
abdulsaheel merged commit e0aac06 into main Jul 2, 2026
@abdulsaheel
abdulsaheel deleted the feat/ble-connector-sync branch July 2, 2026 18:14
abdulsaheel added a commit that referenced this pull request Aug 7, 2026
Five conflicted files, all reconciled to keep BOTH sides' intent rather than
picking a winner.

kAlgoVersion / changelog. Both branches wrote a v55 and a v56 with different
content: main's are the nap + strain work (#204), this branch's are the step
and movement-minute rebuild. Main's stay as history; this branch's three
entries are renumbered 55/56/57 -> 57/58/59 and the constant becomes 59.
Strict monotonicity is load-bearing, not cosmetic -- the derive gate matches
algo_version EXACTLY while the read seam serves MAX(algo_version), so a version
that goes backwards writes rows nobody reads and re-derives forever.

Note: git had silently DROPPED this branch's v57 entry (the absent-steps
tier/labelling follow-up) when resolving the overlapping tail toward main. It
is restored here as v59; the code it documents was never lost, only its
changelog.

Analytics pin. Neither side was right: HEAD had #35's PR-BRANCH head (38a8636,
never on main) and main had the older #38 merge (c3a30be). Now 1fb34dce =
analytics main @ #35 merge, which carries all three hops this release needs --
#38 (nap detector), #39 (the awake-HR baseline P0 that shipped inside #38), and
#35 (the sibling half of THIS branch). Verified against the SHA: absent
`dailyStepEstimate`, present `dailyActiveMinutes`.

Health export delete list. The two intents compose rather than conflict, so
`_rewriteTypes` is now `healthDeleteTypes(isApplePlatform:)` MINUS STEPS:
  * main's helper drops the sleep types and HEART_RATE on Android, where the
    native SleepSessionRecord writer and the minute-HR batch own their cleanup;
  * STEPS comes off on top, because nothing writes steps any more -- deleting a
    type we never write would run on every re-export of the not-yet-finalized
    tail forever, and a false `delete()` flips `success`, so it could stall a
    day's export cursor permanently. The historical fabricated samples are
    handled once by `_purgeLegacyStepsIfNeeded`, outside success accounting.
Also kept main's Android sleep-session write alongside this branch's one-shot
purge, and kept this branch's removal of the steps EXPORT (writing our derived
copy back would double-count against the phone's own HealthKit pedometer rows,
which we now read).

healthSyncNow. Composed: the export runs through main's single-flight guard,
and the phone-steps sync stays gated on `phoneStepsEnabled`.

flutter analyze clean; full suite 1324 passing, 0 failing.
DropTabl added a commit to DropTabl/edge that referenced this pull request Aug 26, 2026
…ntics; flag the pending OpenStrap#35 repin

Three follow-ups on the bootstrap review:

A Memfault chunk is real inbound traffic on the link, so it now advances
_lastRx like every other notification — a strap volunteering crash data
must not look silent to the staleness fuse and get its link bounced.

New regression test for the SET_CLOCK result split the contract implies:
a FAILURE result inside a non-null response object still satisfies
readiness (only a null result fails, one write,
no resend) — but the strap did NOT take the write, so the phone-suspect
history deferral computed off the pre-correction reading stays live;
clearing it is reserved for an accepted correction.

The protocol pin stays at 4ce8f02 (OpenStrap#33's tree, whose parser still nulls
any non-1 hello revision — under the mandatory hello that means a future
revision bump cannot connect). OpenStrap/protocol#35 lifts that gate; the
pending repin is now documented at BOTH pin locations — pubspec.yaml's
ref and kProtocolPin in derivation_engine.dart — with the rule that every
pin location moves together to the main merge commit (the pin-equality
test fails a partial repin) and the kAlgoVersion no-bump reasoning to
re-verify against the actual merge diff.
DropTabl added a commit to DropTabl/edge that referenced this pull request Aug 26, 2026
…ision gate is gone

All three pin locations move together to protocol main @ 6664854, the
OpenStrap/protocol#35 merge commit. The old pin's parser returned null
for any hello body whose revision byte was not 1; under this branch's
mandatory-hello bootstrap that made a future firmware revision bump
unable to connect. OpenStrap#35 records the byte instead of gating on it.

NO kAlgoVersion bump, verified against the full 4ce8f02..6664854 diff:
OpenStrap#35's one code change widens which HELLO bodies PARSE (hello feeds
connection identity/state, not the derivation pipeline); OpenStrap#34, also in
the hop, only ADDS files (oura + generic-HRS wire formats nothing here
imports); the rest is comment rewording. No decoder for a persisted
record moves, so no stored number can.
DropTabl added a commit to DropTabl/edge that referenced this pull request Aug 26, 2026
…ntics; flag the pending OpenStrap#35 repin

Three follow-ups on the bootstrap review:

A Memfault chunk is real inbound traffic on the link, so it now advances
_lastRx like every other notification — a strap volunteering crash data
must not look silent to the staleness fuse and get its link bounced.

New regression test for the SET_CLOCK result split the contract implies:
a FAILURE result inside a non-null response object still satisfies
readiness (only a null result fails, one write,
no resend) — but the strap did NOT take the write, so the phone-suspect
history deferral computed off the pre-correction reading stays live;
clearing it is reserved for an accepted correction.

The protocol pin stays at 4ce8f02 (OpenStrap#33's tree, whose parser still nulls
any non-1 hello revision — under the mandatory hello that means a future
revision bump cannot connect). OpenStrap/protocol#35 lifts that gate; the
pending repin is now documented at BOTH pin locations — pubspec.yaml's
ref and kProtocolPin in derivation_engine.dart — with the rule that every
pin location moves together to the main merge commit (the pin-equality
test fails a partial repin) and the kAlgoVersion no-bump reasoning to
re-verify against the actual merge diff.
DropTabl added a commit to DropTabl/edge that referenced this pull request Aug 26, 2026
…ision gate is gone

All three pin locations move together to protocol main @ 6664854, the
OpenStrap/protocol#35 merge commit. The old pin's parser returned null
for any hello body whose revision byte was not 1; under this branch's
mandatory-hello bootstrap that made a future firmware revision bump
unable to connect. OpenStrap#35 records the byte instead of gating on it.

NO kAlgoVersion bump, verified against the full 4ce8f02..6664854 diff:
connection identity/state, not the derivation pipeline); OpenStrap#34, also in
the hop, only ADDS files (oura + generic-HRS wire formats nothing here
imports); the rest is comment rewording. No decoder for a persisted
record moves, so no stored number can.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant