Skip to content

Plan ath pull openwearables for 2.2.0 - #40

Draft
mwhitham wants to merge 68 commits into
mainfrom
cursor/plan-ath-2-2-0-openwearables-f29f
Draft

mwhitham wants to merge 68 commits into
mainfrom
cursor/plan-ath-2-2-0-openwearables-f29f

Conversation

@mwhitham

@mwhitham mwhitham commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

This pull request is still the plan only. Nothing in the program has changed. D272 through D289 in this folder are proposals. They are not adopted.

The branch includes main after version 2.1.3. Version 2.1.2 adopted D227 through D253 and published migration step 6. The proposals then moved from D227 through D244 to D254 through D271. Version 2.1.3 adopted D254 through D271 and published migration step 7. The proposals moved again, to D272 through D289, in the same order. The migration this plan adds is step 8. Where a paragraph below says D227 through D244, read D272 through D289 in the same order. Where it says this plan's migration is step 6, read step 8. Where it says that migration leaves a 2.1.1 database at schema 5, read a 2.1.3 database at schema 7. The decisions file has the table.

The plan was read against version 2.1.1 at 0de71bb, the merge of pull request 44. The proposals were first numbered D198 through D215. Version 2.1.1 used D208 through D226, and D198 through D207 stay reserved for its unapproved draft. On 15 November 2026 each proposal moved to the next free number: D198 became D227, and D215 became D244. Version 2.1.2 then used D227 through D253, so D227 became D254 and D244 became D271. Version 2.1.3 then used D254 through D271, so D254 is now D272 and D271 is now D289. Reviews written before 15 November 2026 use the first numbers. Reviews written from that day until 21 November 2026 use the middle numbers. Reviews written from 21 November 2026 until 24 November 2026 use D254 through D271.

Version 2.1.1 changed how an import writes, so the plan changed with it:

  • A page is one import preview and one apply. preview_route in src/import/provider.rs reads at one database revision and never writes. ProviderPreview::apply refuses the page when the revision moved. The plan no longer counts a page inside a write transaction and rolls it back.
  • The archive goes ahead only at the revision where the safety facts were read (D237). It no longer reads them a second time under a write lock.
  • The pull hands each page to a new in-memory reader, MappedPage. The 2.1.1 MappedReader reads a file path.
  • The source rules go in src/import/provider.rs and a new src/import/binding.rs, not in src/store/write.rs. The protocol's record writes join the owner writes that store a whole source record.
  • Step 6 runs in its own transaction. At init that is on the connection Store::create opened, and on migrate it is the store's connection. It does not use Store::transaction. Foreign keys are turned off only before it starts.
  • The Open Wearables key is a third KeyAccount. Limits and timeouts use the 2.1.1 named constants. One response is at most 10 MiB, not 8 MiB.
  • A deleted source or record leaves its rows out, as D182 and D190 already say. It no longer refuses the page. It still stops the archive.

ath pull openwearables would read one user's returned health data and write it through the mapping. The first run writes nothing. --json writes nothing, including with --yes. --yes without --json applies each successful protected page. A refused page can lead to a later pull-only archive only when the database revision has not moved since the protected preview. range_complete follows the stored ranged reads only. The success sentence is printed only when those reads and the two snapshots finish, the protected writes succeeded, and every live provider is completed or not attempted. An incomplete live provider exits nonzero and names that provider. It does not by itself make the stored range incomplete. The success sentence does not say a vendor returned lifetime history.

What this pull would store

Twelve stored reads: sleep sessions with stages, workouts with zones and segments, raw and day timeseries, sleep, activity, and recovery summaries, health scores, meals, menstrual cycles, the personal record, and the current body snapshot.

Live workout reads are off unless --vendor-workouts is passed. Without it, preview and --json make no request to the connections route or to either workout route. With it, every run says first that the server may refresh and save vendor tokens, may revoke a connection, and may wait about 105 seconds on a rate limit. That includes a preview and --json. "Nothing stored" means this database only. This pull does not add its own retry, and it does not call sync or historical sync.

The pull checks that the connections list belongs to the selected user. It keeps only each provider and status, and it never stores the list. It calls only active connections, in a fixed order. A revoked or expired connection is never called. One provider's failure leaves that line incomplete, and the others still run. Live requests go one at a time, at least a second apart. The read timeout is 360 seconds, so the server's own retries can finish. A request that still times out, still gets HTTP 429 after the server's retries, or gets HTTP 401 ends that provider for the command. After a 401 the line says to reconnect the provider in Open Wearables if this repeats. Garmin is read in windows of exactly 23 hours on a fixed grid that starts at the Unix epoch, because the server measures a window in local time and splits one it sees as longer than 24 hours. Every command uses the same grid, so two commands read the same window or windows that do not overlap. Detail calls are capped at 100 per provider and 20 for Strava, whose limit the whole application shares. A stored detail is never replaced by a list-only object. Polar and Strava keep a stored detail when the new one is thinner. Garmin, Suunto, Whoop, and Oura name no detail field, so a new detail replaces the stored one, and the stored one stays in the record's history. A failed detail makes the provider incomplete and the exit nonzero. The first Garmin detail call in a command is a probe. When it answers 404 or 501, that id counts as not available, no other Garmin detail call is made, the other ids count as deferred, and Garmin stays completed. Any other error status on the probe, except 401 and 429, defers every id, and the next command probes again. A 5xx also makes Garmin incomplete. An id that got 404 or 501 is asked again after 30 days, or sooner when its list object changes. A deferred detail is counted on its own, and the next command details it first. Every returned original is stored, including a start outside --from and --to. Every object that is not written is counted by reason, and up to 20 are named. When the same Garmin id comes back in two windows, the later copy is kept and the earlier one is counted as superseded. Each Garmin original keeps its upload_window, so a later command that reads the older copy writes nothing. A copy whose window order is unknown, which only a saved file can carry, is counted as ambiguous and changes nothing.

Each vendor object is one envelope: the list object, the detail, and a detail status. It is a source report of kind original, subject vendor_workout, writer open_wearables, sensor ow1:["vendor_workout", provider]. The key is the provider plus the vendor id, as text. A Suunto detail is called at workoutKey, and the record keeps workoutId. The original is not a second workout session and not a calculation input. A workout can appear twice: once as that original and once as the stored session. The public stored workout has no vendor id, so the two records stay separate. A device id or a route inside the vendor object stays on the original and does not set device_binding. Nested samples stay inside the original. The output says the originals keep account ids, user URLs, and full routes. That choice is D244 in this folder, and it can be changed before approval. A credential-shaped value, such as Garmin's optional userAccessToken, is replaced by [withheld by ath] and counted. It no longer refuses the page. A Garmin envelope also keeps its upload_window. A vendor object with a __proto__ key, or one nested 123 levels or more, is refused alone, counted, and named. When only its detail has the problem, the clean list object is stored and the detail is marked refused.

Vendor originals have a total size bound of 256 MiB, counted in the bytes ath export writes. That is half of the 512 MiB that 2.1.1 reads in a package's main document, which holds each original at least twice. The earlier bound counted 128 MiB of compact JSON, which could export to about 525 MiB. The bound holds about 158 one-hour Polar workouts with routes and samples. Every write that adds an original's revision checks it: a pull page, ath import --mapping open-wearables, ath correct, the protocol writes, a package merge, and a native restore. A page that would pass the bound is refused, and that provider is incomplete. The database keeps each original's size, so a write measures only what it writes, and only ath check measures every original again. Every pull prints how much of the bound is used, and it warns from 80%. Export also refuses a document over the read cap, or an item that reaches 128 levels.

An owner's correction stays current until the server's data for that record changes. A pull compares the new data with the last version a pull wrote. When they are equal, nothing is written. When they differ, the pull replaces the correction, keeps the correction in the record's history, and counts it in owner_corrections_replaced. The preview says how many it would replace, and that deleting a record stops later pulls from changing it. A preview makes no detail call, so it labels that count and every vendor count estimated, and it calls the ids --yes would detail would_detail. This covers every record a pull writes.

The appendix table maps all 141 series for raw and day. Input numbers and units are kept. walking_step_length and running_stride_length convert centimetres to metres by dividing by 100. Raw heart-rate recovery uses the existing quantity hr_recovery in bpm. A finite value stays, including zero and a negative number. Other points stay positive, and temperature_deviation stays signed. The point check that gains that exception is in src/model/data.rs. packages/npm/src/schema.ts is not where the check is added. No table is rebuilt for that check. Hydration is a source report. A day row is a reporting window. Sleep sums stay on the provider date. The longest session's bounds stay on the original object. Age is calculated and has no field_basis.

A body skin-temperature amount, unit, and timestamp stay on the original object. The child is time-unknown, because the server can put a day row's period start in skin_temperature_measured_at with no field that says so. Raw and day skin-temperature series keep their own rules.

A workout with entry_source manual is a workout_session on the manual source. field_basis.value is entered_by_hand. A device_id on that object stays on the original and does not set device_binding. Name, type, start, end, distance, heart rate, elevation, zones, and segments are stored the same way as on an automatic workout. The numbers on that session do not enter the eight range calculations or provider-period-summary. workout-drift may use the session's start and end when the caller names that session. The samples in the window still exclude a manual source. query_measurements, query_series, and query_sessions in src/store/query.rs omit manual sources unless include_manual is true. The JavaScript names in packages/npm/src/database.ts call those functions. Other record listings are not that switch. This plan does not change that behavior. unknown, JSON null, and a missing entry_source stay source reports of kind unknown_workout. They are not a workout session, and they are not manual.

Device-targeted rows keep the existing receipt. A measured series row with no device id refuses the protected page. A reported series, including source: null, uses only the report sensor and does not enter that check. A measured series with source: null uses only the unattributed sensor. The archive is pull-only. A mapped file import does not build it. Privacy and JSON checks happen before either preview. Receipts, bindings, history, deletions, tombstones, and stored conflicts are read in the protected preview, at one database revision. The archive is built only at that same revision, and its apply refuses a moved revision. A change after that read stores no capsule and does not copy a deleted payload onto a new identity. An eligible page stores one capsule per series row: the resource, the response resolution, and the unchanged row. written stays false when only the archive changed. database_changed is true when that apply committed. The command still exits nonzero. Invalid ids, conflicting devices, credential hits, deleted sources, unbound history, and workout kind changes are not archived.

Each of the four page refusals names the owner's fix, or says 2.2 has none. ath correct on the source can set a new device_binding, bind history that one device wrote, or replace a malformed receipt. A changed workout kind has no fix that keeps the record: ath erase removes it, and the next pull stores the new kind.

source_report is not one of the seven measured types. Step 6 adds it to the root record check by copying records in its own transaction. Foreign keys are turned off on the store's own connection only before that transaction, and they are read back on after every exit. The two record views and the two cross-table triggers that read records are dropped before the rename and recreated unchanged. A failed init rolls step 6 back to the committed step 5 schema, and the existing cleanup removes the new file. A failed step 6 leaves a 2.1.1 database at schema 5. An older database keeps the steps that committed before step 6, and the message says so. Numberless summaries and scores are left out of calculation inputs before the numbers are decoded. Polar recovery uses 1–6. Unknown workout provenance stays unknown. The pull still requests resolution raw and resolution 1day.

Still waiting on the maintainer

  1. One number, 2.2.0. Step 6 runs on create and on migrate. Step 5 stays the published 2.1.1 migration. The receipt adds no column. The root check gains source_report. Step 6 creates source_reports and vendor_original_sizes, and rebuilds the summary and score tables so a number and its unit are omitted together. Existing rows keep their ids. The rename drops and recreates the named views and triggers (this folder's D227 and D236). An earlier review accepted a no-column migration under D152 and D184. That acceptance does not adopt these proposals.
  2. Store the returned representations in section 2. Live workout originals are this folder's D242, and the procedure is D243. Null stays null. A row the server did not return is not called provider-unavailable. The omissions are the ones with a reason (this folder's D232 and D235). A typed workout is the session in this folder's D238. The stored session and the live original stay separate, because the public stored workout has no vendor id. This folder's D244 keeps the vendor object whole, including account ids, user URLs, and full routes, and the maintainer can change that choice before approval.
  3. Decoded pages are rejected before mapping when they contain the key, the selected origin, or the selected user id. A credential-shaped value is withheld and counted instead. A raw personal-record user_id must be the selected user's UUID before it is removed. The canonical envelope does not contain that field (this folder's D229 and D244).
  4. Preview counts are estimates, and a preview does not say a snapshot was stored. A preview also does not claim to have seen a cross-page null-source conflict. Public --json applies neither preview. With --vendor-workouts, preview and --json still write nothing and say vendor requests were made. written counts protected creates and revisions across the command. database_changed counts every committed protected, archive, or archive-source change. The same device sensor keeps one source and the current match key. A second device_id does not replace or suppress the first. The receipt is the source key device_binding. Unbound device history is refused and left in place (this folder's D230 and D236).
  5. The Windows cleanup, a way to clear the Garmin key, and the maintainability notes stay out. src/import/mapping.rs gains MappedPage, the vendor_workout section, and the preservation writes. src/import/provider.rs and the new src/import/binding.rs gain the binding check, the safety snapshot, the first bind, and the device_binding refusal. src/store/encode.rs gains the sample, source-report, withdrawal, and paired-null writes, and src/calculate/range.rs gains the null filter. Ordinary writes keep foreign keys on. Live provider logic goes in src/runtime/vendor_workouts.rs, driven by one provider table (this folder's D231, D237, and D243).
  6. The live vendor read is off by default and warns before its first request. It calls only active connections and never stores the connections list. It keeps every stored detail it is allowed to keep, counts every object it does not write, and withholds credential-shaped values. The stored workout and the vendor original stay two records (this folder's D242, D243, and D244).

Three questions are still open:

  1. The Garmin detail path. The pinned server calls /wellness-api/rest/activities/{activity_id}, and this study did not find that path in Garmin's public docs. The plan probes it once per command. Only 404 and 501 mark the probed id not available, and its list object is stored whole. Any other error status, except 401 and 429, defers every id, and the next command probes again. A 5xx also makes Garmin incomplete. A real response would settle it.
  2. Which records the owner-correction rule covers. The plan covers every record a pull writes, not only vendor originals. Keeping it this broad is the recommendation. Version 2.1.1 compares a pull with the current record, so under a vendor-only rule the next pull would undo an owner's fix to a stored workout even when the server's data had not changed.
  3. Where vendor originals are stored. The plan keeps them in the main document under the 256 MiB bound. Storing them in their own package files would lift that bound, but it changes the package format.

The review at e145fa6 returned thirteen findings. D242, D243, and D244 answer them, with the matching rules in the spec's sections 1, 2, and 4 and named tests in section 7. The four-role review at d636d7a is answered by changes to D227, D230, D231, D236, D242, D243, and D244. They are listed at the top of the decisions file. Reviews of earlier heads were incorporated. None of them approves this head. It needs a fresh four-role review.

The proposal is build-history/v2.2.0/spec.md and build-history/v2.2.0/decisions.md. The study is build-history/v2.2.0/appendix/open-wearables-api.md. Open Wearables 0.11.0 is commit 183e8cc4f6de897dbd288c93d49a691f2cf721ae.

This plan pull request has no screenshots and no video. The build, if it is later approved, would carry one phone message with the screenshots inline and a video that plays in that conversation.

Open in Web Open in Cursor 

cursoragent and others added 13 commits November 6, 2026 23:41
Record the proposed command, decisions D198 through D202, and the 0.11.0 study. The maintainer has not approved a build.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
Keep D198 through D202 unadopted. State empty-type skip, decoded secret checks, estimated previews, partial-page acceptance, and the coverage choices the maintainer still has to make.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
Keep the current match key. Mapped import and pull share one binding check before any write, and a confirmed pull reports retained counts without a public JSON write.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
Keep the receipt on the source record, ignore a 2.1.0 supplied field of the same name, and say which owner operations store a whole source.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
The mapping cannot see deleted history or set the receipt through an ordinary source update, so the plan allows three store operations inside the caller's transaction.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
D203 stores day windows, series, summaries, and workout segments in this pull, and names the routes that stay out.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
D204 keeps the expanded Open Wearables data and states source, time, meaning, score, and read rules that match the pinned server.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
Day rows stay reporting windows, sleep sums stay date-scoped, and reported intake, accounts, and manual workouts use a non-measured source report.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
…the 2.2.0 plan.

The new record type needs the root check, absent scores stay out of calculations, and a refused original is archived only after the protected write rolls back.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
Step 5 drops the record views and cross-table triggers around the root rename. Archive eligibility, capsules, and command flags are one rule.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
The protected transaction records the whole-page veto before it mutates. The archive transaction reads those facts again before it writes. A failed init still uses the existing cleanup.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
D209 keeps the source as the person, with basis entered_by_hand, and leaves unknown workouts as source reports.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
cursoragent and others added 2 commits November 8, 2026 21:35
D210 through D213 keep skin-temperature time unknown, finite heart-rate recovery, the manual drift window, and provider-live workout objects.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
D214 makes those reads opt-in and keeps one provider's failure on that provider. D215 keeps each vendor object whole and refuses a token-shaped key.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
cursoragent and others added 12 commits November 16, 2026 02:28
…-openwearables-f29f

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>

# Conflicts:
#	AGENTS.md
#	build-history/README.md
The plan was read against the TypeScript program. Version 2.1.1 is the
software on main, and its migration already uses step 5. The proposed
migration is step 6. The pull, the store, and the mapping are named where
they live in the native crate.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
Version 2.1.1 used D208 through D226, so the proposals move from
D198-D215 to D227-D244 in the same order. The decisions file records
the old and new numbers.

The spec now follows the 2.1.1 import: each page is one preview and
one apply, the page reader holds the page in memory, step 6 runs in
its own transaction with foreign keys off, and limits are the 2.1.1
named constants. It also carries the vendor-workout corrections from
the review at e145fa6. Decisions D230-D237 and D242-D244, the
appendix, and the progress table are finished in later commits.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
A page is one preview_route and one ProviderPreview::apply. Timeouts and the response cap are the 2.1.1 values. The source rules go in src/import/provider.rs and a new src/import/binding.rs, and the protocol's record writes join the owner writes.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
The new migration step is step 6, and step 6 runs on the store's own connection with foreign keys off. The response cap is 10 MiB. D237 now lets the archive go ahead only at the database revision where the protected preview read the safety facts, instead of reading them again under a second write lock.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
D242 states the stored original's JSON layout, its key, its counts, the named vendor_workout mapping section, and what owner deletion and correction do. D243 checks and drops the connections list, calls only active connections, keys Suunto detail by workoutKey, never loses a stored detail, separates failed from deferred, warns on every flagged run, waits out the server's retries, budgets requests, and spells ids and starts. D244 withholds a credential-shaped value instead of refusing the page.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
The risks name the 10 MiB cap, the partial migrate of an older database, server-side effects of a live read, the shared Strava limit, the unverified Garmin detail path, owner corrections a later pull replaces, and deferred ids that stop being listed. The approval list follows the 2.1.1 code places, fixes two citations, and adds the vendor read.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
…indows.

The appendix records the connection fields and statuses, the route's parameters, the client's retries and timeout ceiling, Suunto's detail key, Whoop's and Sensorbio's single page, Strava's detailed fields and per-application limits, and the Strava tier wording. The pinned Garmin method measures a window in naive local time, so a 24-hour window can look 25 hours long on a server whose clock moves forward. The plan now sends 23-hour windows. The userAccessToken sentence now says what the pinned code shows.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
Step 0 now records the renumbering, the check against 0de71bb, and the answers to the review at e145fa6. The Garmin key removal joins the work kept out of the build.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
The appendix named local download copies (garmin_w.py, suunto_w.py) that
do not exist in the repository. Name each file by its path under
backend/app/ at 183e8cc4, and record the Whoop response key, Suunto's
one-page route, and how the client passes vendor errors through.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
install_schema and apply_steps both refuse unless one transaction reaches
SQL_SCHEMA_VERSION. Say how each check changes when steps 1 through 5
commit at schema 5, and say that a new database runs on the connection
Store::create opened, not through Store::transaction.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
cursoragent and others added 27 commits November 16, 2026 05:35
A conflicting device id, unbound history, and a malformed receipt can be
fixed with ath correct on the source. A changed workout kind has no fix
that keeps the record; ath erase removes it and the next pull stores the
new kind. Say where 2.2 has no fix, put the fix in the refusal text, and
test each one.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
The rule sets more only for a next_token that is not null. The test that
lists each provider's next-page signal now says the same.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
Before the renumbering, these lines named the newest correction as the
storage rule. That number became D237, which is now the archive timing
rule, and later decisions added more storage rules. D232 says the
specification's section 2 is the storage rule, so the lines say that.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
The appendix said D237 writes the archive capsule after a locked safety
read. Since the rework for 2.1.1, D237 writes it only at the database
revision where the safety facts were read.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
The opening of the specification said the flag's calls run on a preview,
which reads as if a preview also made detail calls. It now says a preview
and --json read the connections list and each active provider's list and
make no detail call. The help text and the examples say the same, and the
preview test checks them.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
A preview showed vendor detail counts and owner-correction counts as if
they were results, and its zero failures could read as none found. Every
vendor count and both owner-correction counts in a preview now sit under
an estimated key. The ids --yes would detail are would_detail, each
provider line prints estimated, and the preview says it made no detail
calls, in the text and in vendor_workouts.notice. A new test covers the
three-id Polar case.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
The Garmin detail path is not in Garmin's public docs. If it is missing,
the plan spent up to 100 detail calls on it in every command, and an
answer other than 404 or 501 made Garmin incomplete every time. The first
Garmin detail call is now a probe. A 400, 403, 404, 405, or 501 stops
Garmin detail for that command, the other due ids wait as deferred, and
Garmin stays completed with a line that says so. An id marked
not_available is called again only when its list object changes. A 401
on any live request stops that provider, as a 429 does, so the server
refreshes a token at most once per provider in a command. This is the
plan's stated default, and the maintainer still has to confirm it.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
The rule that a later Garmin window's copy replaces an earlier one held
only inside one command. A later command that read only an earlier
window would store the older copy again, and it would count that as a
server change that replaces an owner correction. Each Garmin envelope now
keeps its upload window. A copy whose window ends at or before the start
of the stored copy's window was uploaded first, so it is counted as
superseded and writes nothing. Comparisons leave the window out, because
windows depend on --from. A two-command fixture covers both orders.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
The bound counted 128 MiB of compact record_json. Export pretty-prints
each item and writes each original at least twice, once as the record
and once per revision. A synthetic one-hour Polar run with a route
exports at 2.05 times its compact size, so the old bound could export to
about 525 MiB, over the 512 MiB read cap. The bound is now half of that
cap, 256 MiB, counted in the bytes export writes. It holds about 158
such workouts with one revision each. The appendix records the
measurement.

ath correct, the protocol writes, a package merge and a native restore
check the bound too. Every pull prints the total used, in the text and
in --json, and warns from 80% with the remedy and its cost. The export
check also refuses an item past the 128-level nesting limit. Storing
originals in their own files is listed as an open question for the
maintainer.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
R5 and R6: a detail that timed out is failed, as one that got 429 or
401 is. Only ids still due a detail call become deferred, and an id due
no call keeps its own count. Tests cover four Polar ids with a timeout
and a sixth Strava id that stays kept.

R7: each id goes in the first group of the detail order it matches. A
too_large or refused id also has no stored detail, so the first group
now leaves it out, or the third group could never be reached.

R8: the server retries only a 429 and a 401, and the pull sees only the
last answer. A command sends 24 Strava requests in the usual case, or
25 after a token reload, and at most 84.

R9: a vendor object with a __proto__ key is refused alone as
unusable_name, and the provider stays completed. The import check would
otherwise fail that provider's page on every command.

R10: the rebind fix says that it merges two devices' history on one
source, and the source's history keeps the old binding.

R11: the file-import sentences and the corrected-original test follow
the owner-correction rule, and a vendor page's counts stay apart from
archive_committed.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
Q1: page counts come from one SQL count beside Staging::count. D228 now
says so, and says why it does not count ProviderPreview::planned: that
call copies each row's whole data_json, and a vendor page holds every
original's envelope. A test checks that both give the same numbers.

Q2: the owner-correction rule reads the revision column
record_revisions.became_known_at_basis. It does not read changed_by,
because ath grade writes the same tool actor as an import, with basis
local_write. A protocol caller can choose the basis.

Q3: the Suunto list cap is renamed MAX_SUUNTO_LIST_REQUESTS, because
only Suunto's list is paged and the cap counts requests.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
A package merge copies the package's revisions with their own bases, so
a record merged without a conflict keeps its import revisions as
imports. Only a conflict the person resolved writes a new revision with
basis package_merge. The plan said every accepted merge counted. It now
says only those resolved conflicts count as owner corrections, and the
counts name them: merge_choices_replaced is the part of
owner_corrections_replaced that were merge choices, and the line adds
"(M of them merge choices)".

Body-snapshot records rarely keep a correction, because the server
averages over a window that ends at the request and the body records'
keys have no date. The plan says so. The rule still covers every record
the open_wearables pull writes, other routes keep D182, and the
maintainer still has to confirm that scope.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
Step 0 now says which decisions this pass amends, that it adds no
decision number, and which three questions stay open for the
maintainer.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
…erlaps as ambiguous

Each Garmin window starts at a multiple of 82,800 seconds from the epoch,
and the first and last are widened to whole grid windows. Two commands
then send equal windows or windows that do not overlap. A pull's new read
of the stored window is a change. Any other overlap, which only a saved
file can carry, keeps the stored copy and counts ambiguous_window. Adds
the two-range fixture, the 12-hour --from test, and the saved-envelope
test.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
…able, and recheck after 30 days

Any other error status on the probe, except 401 and 429, defers every
due id, and the next command probes again. A 5xx also makes Garmin
incomplete. An id that got 404 or 501 keeps the answer time as
detail_checked_at and is asked again after 30 days, or sooner when its
list object changes. Ids a command does not ask keep their mark, so a
missing path does not rewrite them. Adds the 403/503 probe test and the
30-day recheck test.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
…oto__, and name refusals

A detail with a __proto__ key is refused as unusable_name, and its list
object is stored with refused_by and refused_path. The detail is asked
for again only when the list object changes, and the provider stays
completed. Each refused object and refused detail is named in
left_out.examples by provider, vendor id, reason, and key path. Extends
the Polar three-object test.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
The package puts a vendor object five levels down, and the read parses
with serde_json, which refuses 128 levels even though check_nesting
allows 128. So the pull refuses an object nested 123 levels or more as
too_deep, counts it, and names it with its depth. A deep detail keeps its
clean list object. The export check now refuses an item that reaches 128
levels. Adds the 125-level Polar test with export and read-back, and the
122 and 123 boundary.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
…es only what it writes

Step 6 creates vendor_original_sizes, one row for each original with its
current item's size and the sum of its revision items, as export writes
them. A new revision measures two items, a delete measures one, and a
merge or restore measures what it writes. The bound and the usage line
read the sum. Only ath check measures every original again, and ath
repair fixes a row that differs. Adds the test that the stored total
equals the bytes export writes.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
…e choices, Strava, and the 80% warning

The Garmin deferred count adds (not asked: detail unavailable this run)
when the probe stops Garmin. A 401 line says to reconnect the provider in
Open Wearables if this repeats. A merge choice is a conflict resolved as
imported or corrected. Strava's usual case is 21 requests. The 80%
warning says a later version may lift the bound and names no plan
question.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
The pass amends D231, D242, and D243 and adds no decision number.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
Version 2.1.2 took decision numbers D227 through D253 and migration step 6. The plan keeps those. Its proposals move to D254 through D271, and the migration it adds is step 7.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
…-openwearables-f29f

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>

# Conflicts:
#	AGENTS.md
#	build-history/README.md
Version 2.1.3 published migration step 7 and decisions D254 through D271.
The plan's migration is step 8, and its proposals are D272 through D289,
in the same order.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
Version 3.0.0 is on main. The guide and the build-history index list both that version and this plan. The plan's version number and migration step are unchanged.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants