Commit Graph
23 Commits
Author SHA1 Message Date
efitenandClaude Opus 5.5 ea69769d5f fix(account): show the login only when CoreScope announces companion linking
A CoreScope with accounts but without companion linking (v3.14) sends
userManagement.enabled and answers POST /api/auth/device-token with its
SPA page, so the card appeared and every login failed with 'HTTP 200'.
Discovery now also needs userManagement.companionLinking; without it
the card stays hidden and uploading is as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 11:41:28 +02:00
efitenandClaude Opus 5.5 270b63dc0b release: v1.19.0, CoreScope login and companion linking
Minor: the MQTT payload contract is unchanged. SW cache v54. Optional
corescopeUrl. Release notes in docs/releases/v1.19.0.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 11:12:27 +02:00
efitenandClaude Opus 5 0e72292253 fix: "Push pending now" during a slow connect left orphaned MQTT sockets (v1.18.4)
Publisher.reconnect() called mqtt.js client.reconnect() unconditionally.
mqtt.js connect() replaces this.stream without closing the previous one
(client.js:257), so a press while a CONNECT was still unanswered left the
earlier socket open. When an orphan closed, its 'close' set
client.connected = false over a live session and armed a reconnect that
orphaned that session in turn.

Field log 2026-09-19: connack timeouts on a weak mobile link, then five
presses in four seconds (12:05:54 to 12:05:57), then "connected" followed
by "offline" and "connection closed" in the same second at 12:05:58,
12:06:00, 12:06:02 and 12:06:04.

reconnect() now returns false and does nothing while an attempt is in
flight (no session, no reconnect timer armed); the Push button logs that.
Once the socket has closed it still skips the 4 s wait. Two tests run the
real mqtt.js client over a fake stream; without the guard the first fails.

Not verified: the EMQX log has no lines for this client id, so the
broker-side session takeover between the sockets was not observed.

Version, release notes and the service-worker cache bump ride along, as
AGENTS.md requires.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-19 19:54:05 +02:00
efitenandClaude Opus 5 1a98a6df8d fix: the region hold's default timers threw in the browser (v1.18.3)
holdUntilReply's default was `timers = { setTimeout, clearTimeout }`, so the
native timers were called with that object literal as `this`. Chromium rejects
that with "TypeError: Illegal invocation"; Node does not check, which is why
279 tests passed over it.

The throw lands inside askRepeater's try, after the ask has gone out, so the
20 s hold and the restore of the repeater's original contact path were both
skipped; the restore record waited in localStorage for the next connect. It
fires once per repeater per session, on the ask that applies the override.
Field log 2026-09-18: three of them, 14036f, e3d3f4 and cf7903, each on
"attempt 1 of 4".

Version, release notes and the service-worker cache bump ride along, as
AGENTS.md requires.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-18 10:57:17 +02:00
efitenandClaude Opus 5 ac9f5126be fix: end the contact-override hold when the repeater answers
A repeater saved as a contact has its stored path forced to zero-hop for the ask and put
back afterwards, and the queue waits for that round. It waited a flat 20s. In the
2026-09-14 commute log 49a98584fce5 and 72d171e63056 both answered 2s after the ask and
the queue then sat blocked 18s more each; cafe314d00e2, heard at 17:47:01, was not asked
until 17:47:14 because of it. Every answer visible across the field logs so far — 11 of
them — arrived 1–2s after its ask.

holdUntilReply resolves on whichever comes first: the matched reply for that target, or
OVERRIDE_HOLD_MS. onRegionsFrame releases the hold right after it files an answer, and a
reply that lands before the hold starts skips it. The no-reply fallback keeps its 20s:
how early a restore is safe while no answer has arrived is a firmware question, and this
only removes time after the answer is in hand.

The restore line now says which way the hold ended, "(reply in, hold ended early)" or
"(no reply in 20s)", so the next field log can confirm it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012GJuEuyG3JMrSeAGCmJ1GP
2026-09-14 18:09:15 +02:00
efitenandClaude Opus 5 7c4df3afbf release: v1.18.1
ec55d31 fixed the inverted guard in noteLinkState but changed app.js without bumping
the version or the service-worker cache, so a field log from a phone running the fix
would still have read "v1.18.0" and could not have shown whether the fix was in.
Version, cache name and release notes go together.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012GJuEuyG3JMrSeAGCmJ1GP
2026-09-14 10:20:34 +02:00
efitenandClaude Opus 5 cc710a3a11 fix: stop transmitting into a BLE link that is down
The 2026-09-13 log ends with two and a half minutes of "discover send failed: GATT
Server is disconnected" — one sweep every 30 seconds, each a write into a characteristic
that no longer exists — an "rf sample incomplete — discarded" for every sampler round,
and region asks failing the same way. None of it could reach a radio.

discoverDecision takes linkUp and reports 'link-down' ahead of every other state; the
monitor tick returns right after rendering it, the RF sampler reschedules without
sampling, and region asks stop with them. The discover clock is not advanced while down,
so the first tick after the link returns sweeps immediately instead of waiting out an
interval.

The link state is read from the browser's own device object through a new
transport.connected(), not mirrored into a flag of ours. A flag would be stale exactly
when it matters, which is the same failure shape as the duplicated default fixed in
v1.17.1 — one source per fact.

Said once in each direction rather than per tick. A log that just goes quiet is
indistinguishable from a crash, an area with nothing to hear, or a feature switched off.

Capture, queueing and uploading are untouched: receptions already in hand are still
queued and published, and the MQTT link keeps its own reconnect.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HSoyBhrLLtSqLgBMEKMiJV
2026-09-13 13:42:56 +02:00
efitenandClaude Opus 5 9a8614396b fix: the per-encounter allowance was 3, not the 4 v1.16.0 announced
Two files held a default for the same limit. src/regionsched.js set DEFAULT_MAX_ASKS = 4
and only the tests read it; src/config.js carried its own 3, and the app reads the
config. So the raise from 3 to 4 shipped in the release notes and not in the app. Nothing
failed and no test could see it — the only evidence was a field log line reading
"attempt 3 of 3 this encounter".

Fixed at the cause rather than by correcting the number: config.js now imports all five
pacing defaults from the scheduler, so there is one number per limit. A test asserts the
config's defaults ARE the scheduler's, which is the assertion that was missing.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HSoyBhrLLtSqLgBMEKMiJV
2026-09-13 02:05:03 +02:00
efitenandClaude Opus 5 7ad2f132b0 fix: leave the repeater's rate limiter to the repeater
v1.16.0 mirrored simple_repeater's anon_limiter as a rolling client-side ceiling of four
asks per 180s per target. Reading the firmware instead of this repo's notes about it
shows the copy can only do harm.

anon_limiter(4, 180) is real (examples/simple_repeater/MyMesh.cpp:880) and is shared
across every anon request type and every requester, as the notes said. What they did not
say is that RateLimiter::allow uses a FIXED window:

    if (now < _start_timestamp + _secs) { _count++; if (_count > _maximum) return false; }
    else { _start_timestamp = now; _count = 1; }

The window is anchored to the repeater's clock and starts at the first request it accepts
after an expiry, which a client cannot observe. A rolling copy is therefore wrong in both
directions, and expensively in one: it refuses asks the repeater would have answered
because its window had just reset. The request it refused most reliably was the bonus ask
v1.16.0 was built to send — the one aimed at a strong reception, which by nature does not
wait. The same source shows a denial costs nothing: _count keeps counting but
_start_timestamp does not move, so extra requests neither extend the block nor penalise
the sender.

One repeater's load is bounded by the encounter, unchanged from v1.16.0: four unanswered
asks plus at most one bonus, each at least 30s apart, no new encounter until five minutes
of silence. Five asks over at least two minutes, and on the road far fewer — 180 seconds
is about 3 km, by which time the repeater is out of range and the question does not arise.
That last point is the user's, and the field log agrees with it: every reception the
client-side window would have held off came from a node heard for minutes at a time.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HSoyBhrLLtSqLgBMEKMiJV
2026-09-12 23:59:36 +02:00
efitenandClaude Opus 5 ebbca34fcb feat: a much stronger reception buys one more ask; no signal floor
The 2026-09-12 commute answered the question v1.15's instrumentation was built to ask.

No floor. The ranges came back overlapping — answered snr -5.25 … +12 dB, silent -11 …
-0.75 dB — and two of the three answers came from asks at snr -5.25 / rssi -117 and snr
-1.75 / rssi -113. Any floor worth setting would have blocked them. The earlier reading
that looked like a clean split was drawn from the old scheduler, where silent asks were
timer asks whose signal I took from a reception minutes earlier: the number was standing
in for freshness, not for link quality, and once every ask fired on a live reception the
correlation vanished.

What the same log did show: efef79435050 spent its three asks between 21:06:50 and
21:08:08, all around -115 dBm and all unanswered, and was then heard from 21:09:37 at
-76 to -69 dBm — up to 46 dB stronger, the best receptions of the drive — with nothing
left to spend, because the encounter only ends after five minutes of silence and it kept
coming in loud. So a reception at least 6 dB better in snr than the best one this
encounter already asked on now earns exactly one extra ask, once per encounter.

The per-encounter allowance also goes 3 -> 4, as asked.

Both of those need the firmware's limiter to stop being an approximation: at most 4 asks
to one repeater in any 180s, which is what simple_repeater accepts across every
requester and type. Enforced directly now, ageing on its own clock so an encounter reset
does not clear it, and deliberately not configurable. Note it mostly does not come up on
the road — 180 seconds is about 3 km, by which time the repeater is out of range — and
the field log bears that out: the receptions it would have held off all came from nodes
heard for minutes at a time.

One interaction worth knowing: four asks 30s apart fills the 180s window, so a target
that spends the full allowance cannot take its bonus until the oldest ask ages out,
roughly half a minute. regionMaxAsks: 3 in config.json leaves that slot free instead.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HSoyBhrLLtSqLgBMEKMiJV
2026-09-12 23:52:02 +02:00
efitenandClaude Opus 5 0917e1c893 fix: connect threw maybeReplayPendingRestore is not defined
The v1.15.1 cleanup deleted a contiguous block of the dead ask path, and that block had
one function in the middle of it that belongs to neither path and is called on every
connect: the replay of a contact-path restore left behind by a session that died between
forcing a contact to zero-hop and putting it back. Restored unchanged.

v1.15.1's check — load the built page in a browser — proved the module initialised,
which was v1.15.0's fault, but it never reached the connect path: that sits behind a Web
Bluetooth pairing a desktop browser with no companion cannot complete. The check that
does catch this compares every top-level definition against the last known-good release
and looks for surviving references to each removed name. Run against v1.14.0 it now
reports none for all eleven definitions dropped since.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HSoyBhrLLtSqLgBMEKMiJV
2026-09-12 20:41:05 +02:00
efitenandClaude Opus 5 12db3a8f35 fix: v1.15.0 threw before any of its wiring ran
The app painted its shell, opened on Home instead of Settings, and no button or
navigation tab responded.

Removing the old scheduler left one line behind that read a constant no longer
imported: `const OVERRIDE_ROUND_TIMEOUT_MS = PENDING_TIMEOUT_MS` (app.js:359). Being
module-level, evaluating app.js raised a ReferenceError before the view switch and
before a single event listener was attached — the HTML rendered and nothing worked.

Deleted with it, for the same reason it was found: the rest of the old ask path, left in
place and no longer reachable. prepareAndAskRegions, askRegions, finishOverrideRound and
restoreContact all referenced removed imports or the removed pending slot; askRepeater
already does that work inline. disconnectAll also still nulled state.regions.pending; it
now clears the outstanding-tag map and the queue, which is what actually has to happen —
no reply can arrive over a transport that is gone, and a tag from one session must never
match a request from the next.

Why the checks passed: rollup reports a missing export as a warning, not an error; the
suite covers the pure modules and never evaluates app.js; and I did not load the
production bundle in a browser before releasing, though I had loaded every beta build.
This release was verified by serving dist/ and opening it: the version line is painted
by app.js, so seeing it at all is the proof the module initialised.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HSoyBhrLLtSqLgBMEKMiJV
2026-09-12 15:55:21 +02:00
efitenandClaude Opus 5 8bfadeaac8 feat: pace region discovery by what the radio hears, not by a clock
The scheduler had three limits and four drives showed each one costing answers rather
than protecting anything. All three are gone; what replaces them is bounded by the
repeater firmware's own limiter instead of by a clock of our own invention.

The shared one-ask-per-60s airtime budget. One ask, from wherever, blocked every
repeater heard in the following minute. The 2026-09-11 80 km log has a2cf63b9fd89 asked
at 18:24:55 on rssi -120 and silent, then heard at 18:25:26 on -102 — 18 dB stronger —
and skipped, because the budget had gone on the weaker reception 31 seconds earlier and
that same ask had put it into backoff.

The 5/15/30-minute per-target backoff, counted per session. A repeater asked once from a
bad spot was locked out for the rest of the drive. It is replaced by an encounter: three
unanswered asks at least 30s apart, then left alone until it has been out of earshot for
five minutes, after which the next reception is a new encounter with a fresh run. Three
asks 30s apart is 3 in any 180s window, inside simple_repeater's 4 anon requests per
180s shared across all requesters — the cap is what keeps us there, not the spacing.

The single in-flight slot. It capped the feature at three asks a minute, and at one per
session whenever a request went unanswered. Several requests can now be outstanding, so
replies are attributed on the 4-byte tag the companion echoes back and an unmatched
reply is dropped rather than guessed at: "something is pending" would file one
repeater's declared regions under another and store it as fact.

Measured, not assumed. A build without the three limits sent 15 asks and got 6 answers;
v1.14.0 on a comparable run sent 5 and got 1. That build is the one merged here (the
beta/regions-sprint commits below), with the pacing tightened from 15s/6 asks to
30s/3 asks so one repeater sees strictly less than the firmware allows one client.

Also here: every ask now carries the snr and rssi of the reception that triggered it,
into the reply or into the timeout. Four drives point at a split — every ask at snr
+1.75 dB or better was answered, every one at -1.25 dB or worse was not — that until now
had to be assembled by hand from pairs of log lines the ring buffer rolls out mid-drive.
No signal floor is applied; this is the measurement that would justify one.

Deleted rather than left behind: selectNextTarget's successors (heardAskDecision,
commitAsk, undoAsk, isTargetDue, dueDelayMs, retryBackoffFor, recordCandidate,
applyRegionsReply, pendingExpired) and monitor's regionDiscoverDue/REGION_INTERVAL_MS.
regionreq.js is framing only now; regionsched.js owns the scheduling.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HSoyBhrLLtSqLgBMEKMiJV
2026-09-12 12:59:06 +02:00
efitenandClaude Opus 5 14df2e0438 feat: ask a repeater only while it is being heard, and refund an ask that never left
Twelve minutes of the 2026-09-11 v1.13.0 log: six region requests, one answer. The one
that was answered fired on a live reception and came back in two seconds. The other five
each charged their target an attempt and dropped it into the 5/15/30-minute backoff, so
e3d3f4d7edd0 (heard directly at 12:04:54 and 12:09:32) and 6b8c65b77cf3 (12:03:53,
12:08:02, 12:10:05) could not be asked while they were demonstrably in range.

Two separate causes, both in the ask bookkeeping rather than in the framing or the reply
matcher, and each fixed at its own site.

The 60s timer fallback is removed. selectNextTarget picked from the whole session pool
with no notion of range, which at road speed is a repeater already passed: 12:04:37 to
e470a7fd67fa, last heard 5m45s earlier, and 12:05:38 to 01fa326b4758 are the two clean
examples in the log, neither answered. Since 52b7ff5 those asks also stamp the shared
one-ask-per-60s airtime budget, so a blind ask blocked the heard path for the following
minute as well as backing its target off. maybeAskHeardTarget is now the whole
scheduler, and selectNextTarget, demoted and cursor go with the fallback they served.

A BLE write that throws now costs nothing. commitAndAsk charged attempts, lastAskedAt
and the airtime budget before the write, and askRegions only logged the rejection, so a
request that never reached the radio held the pending slot for its full 20s and then
printed "no reply ... within 20s" — indistinguishable from a repeater that heard us and
stayed silent. Two of the six asks were this: 12:00:00 and 12:02:36, both immediately
after "BLE: reconnecting". commitAsk now returns a receipt and undoAsk restores it,
refusing once the send-ack has captured a tag (that request IS on the air) or once
another target holds the slot. prepareAndAskRegions gained a try/catch for the same
reason: state.transport is nulled on disconnect and askRegions dereferences it, which
rejected unobserved and wedged the slot until it timed out.

Removing the timer removes the only line that narrated the scheduler once a minute, so
heardAskDecision reports why it said no (in flight, budget, answered, backoff, with the
remaining wait) and the heard path logs that at most once a minute. Those four states
were previously indistinguishable from each other and from silence.

Known trade-off, stated in the release notes: the stationary pause stops the discover
sweep, so a parked app now depends on organic traffic to raise a candidate. A repeater
in range that transmits nothing while you are parked next to it is no longer asked.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HSoyBhrLLtSqLgBMEKMiJV
2026-09-11 12:47:02 +02:00
Erwin FitenandClaude Opus 5 f6baeb30cc docs: release v1.13.0 — region asks that land on a repeater still in range
Minor bump: one fix (the in-flight slot that a silent repeater held for the whole
session) and one backward-compatible feature (forwarders as region-discovery
candidates, with header instrumentation on how often their prefixes resolve).

Release notes per AGENTS.md, in the same commit as the version bump.
Service-worker cache bumped v40 -> v41. No MQTT contract change.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-11 09:31:40 +02:00
efitenandClaude Opus 5 00ae520eec docs: release notes live in the repo and CI assembles them (closes #12)
AGENTS.md said every tag must carry a "What's New" body, cumulative, newest first. That
rule was a human convention and it was missed on twelve tags in a row: v1.6.0 through
v1.10.3 all shipped the CI-generated changelog link, so v1.5.0 was the last release
anyone could read while region discovery, the airtime budget, the retry backoff, the
FLOOD-reply warning and the AES padding fix all landed unannounced. v1.11.3 went the same
way earlier today until it was caught by hand, which is the argument against leaving it
to whoever is paying attention.

Each release now has docs/releases/vX.Y.Z.md, written in the same commit as the version
bump, so the notes are reviewed in git rather than typed into a web form afterwards.
scripts/release-notes.mjs concatenates every file from a given tag downwards, newest
first, and the release workflow publishes that as the body. A tag whose file is missing
fails the job before the build even starts, so a release without notes cannot be
published at all. generate_release_notes is gone.

The 25 files are a split of the cumulative body that v1.12.0 already carried, so no
section was rewritten. Verified by reassembling v1.12.0 from the files and diffing it
against the published body: identical once separators and blank lines are normalised.

Ordering is the one thing an assembler can get quietly wrong, and it has a test: sorting
tags as strings puts v1.9.1 above v1.10.0 and would drop a release out of the middle of
every body. Refusing an unknown tag has a test too, because that refusal is the whole
gate.

Not done: the bodies of v1.5.0 and older are left as they are, and no release title was
changed. The workflow change is unexercised until the next tag is pushed.

Tests: 260 pass (+5).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Manrn3qdrTJFz3C4o9PPFL
2026-09-09 18:11:50 +02:00
efitenandClaude Opus 4.8 1c504956e4 docs: add v1.4.0 release notes
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 16:34:30 +02:00
efitenandClaude Opus 4.8 a58f17a5c2 fix: resume capture on heard packet after standstill auto-pause (v1.3.3)
After the 5-min standstill auto-pause, capture only resumed when a GPS
watchPosition callback reported movement. On a backgrounded / screen-off
PWA those callbacks stall, so a drive that resumed after a stop logged
nothing until the app was foregrounded — a whole drive silently lost
(reported for BE-BOC-myst, 2026-07-08 near Bree).

Wake-on-packet: a heard packet now also advances the idle gate via the new
pure captureDecision(), so movement resumes capture on the first packet
from a moved position even when the GPS callback cadence dropped. A packet
still at the parked anchor stays paused. Capture stays fully decoupled from
the network (IndexedDB queue), so this is a capture fix, not an upload one.

Bump SW cache v10→v11 for the frontend change.

Closes #9

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 16:22:07 +02:00
efiten 20409f9292 chore: stop tracking local planning docs (docs/plan.md, docs/superpowers/) 2026-06-13 21:13:51 +02:00
efitenandClaude Opus 4.8 b3826a0daa docs(plan): SP4 implementation plan — public release (runtime config.json)
Bite-sized TDD tasks: config.js loader (+tests), names.js→resolveUrl, app.js
wiring + UI genericize, config.example.json/gitignore/drop .env, deploy.sh,
package.json+GPLv3 LICENSE, AGENTS.md, README howto, build/test verify,
mandatory git-history secret scan, then gated flip to public.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13 20:55:40 +02:00
efitenandClaude Opus 4.8 33021be0e4 docs(spec): SP4 — switch config model to runtime config.json
Per review: deployment config is a runtime config.json fetched at startup (MQTT
url/account/password + optional resolveUrl), not build-time VITE_*/.env. Sysops
host the static build and drop in config.json — no source edits, no rebuild to
change config. config.json (with the publish password) is gitignored; a
config.example.json is committed. Updates the howto, AGENTS rules, and the
pre-public secret scan accordingly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13 20:47:51 +02:00
efitenandClaude Opus 4.8 23b4f885b4 docs(spec): SP4 — public release design (genericize, howto, AGENTS.md, GPLv3)
Design for making corescope-rx a public, self-hostable companion app: keep the
build-time VITE_* config model, move the one hardcoded endpoint (names.js BASE)
to VITE_RESOLVE_URL, rewrite the README with a sysop self-host howto, add
AGENTS.md + a GPLv3 LICENSE, scan git history for secrets, then flip to public.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13 20:39:41 +02:00
efitenandClaude Opus 4.8 db83810878 feat: scaffold corescope-rx capture app (BLE companion → MQTT coverage)
Protocol core implemented + unit-tested (meshpacket: path[last]/advert pubkey,
direct-only rule; frames: 0x88 snr/rssi/raw). Working skeleton for transport
(Web Bluetooth NUS), GPS, IndexedDB queue, MQTT.js publisher and field UI.
Remaining work in docs/plan.md (spikes + harden + verify).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 16:47:30 +02:00