Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/2026-12-03-model-cycles-diagnostics-log.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Members who share diagnostics now also share their Model:Cycles' own log (its load, overloads and freezes) while Your Model:Cycles is open, with the checksum and size of the firmware set it runs, as the Analog Rytm MKII's already does. The diagnostics text and privacy page say so; sharing stays as it was for everyone who already shares.
2 changes: 1 addition & 1 deletion docs/APP_DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ Diagnostics need optional, versioned consent: a verified member's, or a visitor'

The automatic **Help us find bugs** invitation waits for the member's first successful compatible Octatrack USB connection (`ready` with `canSubmit` identity), then any open installation or other dialog. Opening a configuration, signing in or downloading a base does not trigger it. The observed connection is scoped to the current member for this visit; existing member/consent-version dismissal and saved choices suppress repeats. Share and Not now carry equal weight. The gate also asks once after a failure (`diagnostics-reask.ts`), and the install guide ends with `DiagnosticsGuideStep`. Account → Diagnostics remains available to eligible members without USB, and the explicit development preview uses no real connection or consent writes.

Accept only disclosed numeric USB readings, fixed event/result codes, hashes, package sizes and public module IDs/catalogue versions. Browser events (`browser_error`, `unhandled_rejection`) contain only a generated event ID, event, fixed `browser` phase, the site area (the route's first word mapped to a fixed list, never the address) and the error type (one of `DIAGNOSTIC_ERROR_KINDS`, never the message). While a unit is connected and idle, the collector reads the live meters (LOAD) with the status every 30 s: `load` carries the mean and peak of the readings since the last one: every ten readings, before a sync starts and after it ends, at a disconnect and when the page closes (so a short connection isn't lost), or at once when the CPU reaches 90 % (at most every ten minutes); `unresponsive` says once when two reads fail (`usb`) or the UI tick stands still between reads (`ui`). `device_log` carries the unit's own log (`sdk/machines/octatrack/elekloader/diag.c`: five-minute load records and incidents with what the unit was doing), read over LOG at the first idle moment of a connection and every ten minutes. An Analog Rytm MKII's log comes from its page with `machine` and `set` instead of hashes (`reportDeviceLog`). Only records newer than the last stored for that log are sent, with ids derived from them; the log's nonce stays in the browser. `build_failed` contains the event ID and event plus a fixed build kind (`octatrack-firmware`, `octatrack-base`, `elekloader`), phase (`preparing`, `composing`, `packing`, `verifying`, `building`) and error category (`input`, `selection`, `build`, `cancelled`, `unknown`). Site events must not inherit USB module or package fields. Never collect raw error messages, stacks, URLs, paths, filenames, firmware, audio, samples, project contents, set names, device serials or memory/crash dumps. A new field or purpose requires revisiting the disclosure and consent version before collection.
Accept only disclosed numeric USB readings, fixed event/result codes, hashes, package sizes and public module IDs/catalogue versions. Browser events (`browser_error`, `unhandled_rejection`) contain only a generated event ID, event, fixed `browser` phase, the site area (the route's first word mapped to a fixed list, never the address) and the error type (one of `DIAGNOSTIC_ERROR_KINDS`, never the message). While a unit is connected and idle, the collector reads the live meters (LOAD) with the status every 30 s: `load` carries the mean and peak of the readings since the last one: every ten readings, before a sync starts and after it ends, at a disconnect and when the page closes (so a short connection isn't lost), or at once when the CPU reaches 90 % (at most every ten minutes); `unresponsive` says once when two reads fail (`usb`) or the UI tick stands still between reads (`ui`). `device_log` carries the unit's own log (`sdk/machines/octatrack/elekloader/diag.c`: five-minute load records and incidents with what the unit was doing), read over LOG at a connection's first idle moment and every ten minutes. A Rytm's or Model:Cycles' log comes from its page with `machine` and `set` instead of hashes (`reportDeviceLog`). Only records newer than the last stored for that log are sent, with ids derived from them; the log's nonce stays in the browser. `build_failed` contains the event ID and event plus a fixed build kind (`octatrack-firmware`, `octatrack-base`, `elekloader`), phase (`preparing`, `composing`, `packing`, `verifying`, `building`) and error category (`input`, `selection`, `build`, `cancelled`, `unknown`). Site events must not inherit USB module or package fields. Never collect raw error messages, stacks, URLs, paths, filenames, firmware, audio, samples, project contents, set names, device serials or memory/crash dumps. A new field or purpose requires revisiting the disclosure and consent version before collection.

Bind collection to both the captured bearer session and the authenticated `accountId` returned with consent. Ignore late replies after account changes or collector remounts. Site events have no history or replay; drop failures from operations started before consent or under a previous account. An older enable request must not overwrite a later withdrawal, including across tabs. Consent lasts 90 days and survives a new consent text, which never asks members again; records last 30 days, the latest 1,000 per account. Stop sharing blocks collection at once; confirmed withdrawal deletes records. Keep the local block if that request fails. Account deletion removes consent and records; losing beta access does not. Hourly cleanup enforces expiry and removes records for unverified or suspended accounts; account exports include retained records, and private review remains limited to the account owner and site administrators.

Expand Down
10 changes: 5 additions & 5 deletions scripts/diagnostics-pull.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -357,15 +357,15 @@ export function reportsByMember(issues) {
return found
}

/** Another machine's log (members' `machines`), in its own units: on the Analog Rytm MKII (diag.h) a freeze's `a` counts
* audio blocks of 32 frames at 48 kHz, a hot spell's the half-second looks, BASE's the set identity; its log starts again
* at every boot. */
const MACHINE_NAMES = { 'analog-rytm-mkii': 'Analog Rytm MKII' }
/** Another machine's log (members' `machines`), in its own units: on the Analog Rytm MKII and the Model:Cycles (diag.h) a
* freeze's `a` counts audio blocks of 32 frames at 48 kHz, a hot spell's the half-second looks, BASE's the set identity;
* its log starts again at every boot. The Model:Cycles' records leave `playing` at 0: it is not said. */
const MACHINE_NAMES = { 'analog-rytm-mkii': 'Analog Rytm MKII', 'model-cycles': 'Model:Cycles' }
export function machineLines(member) {
return Object.entries(member.machines ?? {}).flatMap(([machine, unit]) => {
const loads = [...unit.loads.values()], incidents = [...unit.incidents.values()].filter(r => r.kind !== 'start').sort((a, b) => a.epoch - b.epoch || a.seq - b.seq)
const rytmIncident = r => `${r.kind}` + (r.kind === 'freeze' ? ` ${(r.a * 32 / 48000).toFixed(1)} s` : r.kind === 'hot' ? ` (${r.a} half-seconds at 90 %+)` : r.kind === 'base' ? ` set ${r.a.toString(16).padStart(8, '0')}` : '')
+ (r.kind === 'base' ? '' : `, cpu ${percent(r.cpu)}, ${r.playing ? 'playing' : 'stopped'}, keys ${r.keys.filter(k => k !== 255).map(k => k.toString(16)).join(' ') || '-'}`)
+ (r.kind === 'base' ? '' : `, cpu ${percent(r.cpu)}${machine === 'model-cycles' ? '' : r.playing ? ', playing' : ', stopped'}, keys ${r.keys.filter(k => k !== 255).map(k => k.toString(16)).join(' ') || '-'}`)
return [` ${MACHINE_NAMES[machine] ?? machine}'s log` + (unit.set ? ` (set ${unit.set.crc.toString(16).padStart(8, '0')}, ${unit.set.bytes} bytes)` : '')
+ (loads.length ? `: ${loads.length} five-minute records, CPU peak ${percent(Math.max(...loads.map(r => r.cpu[1])))}, mean ${percent(loads.reduce((sum, r) => sum + r.cpu[0], 0) / loads.length)}` : ': no load records'),
...incidents.slice(-12).map(r => ` ${machine}: #${r.seq} +${Math.floor(r.second / 60)}m${r.second % 60}s ` + rytmIncident(r))]
Expand Down
7 changes: 7 additions & 0 deletions scripts/diagnostics-pull.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ describe('diagnostics pull', () => {
expect(text).toContain(' analog-rytm-mkii: #4 +1m30s freeze 5.0 s, cpu 58.5%, stopped, keys 31')
expect(text).not.toContain('unit: ')
})
it('lists a Model:Cycles log apart, without a playing state its records do not keep', () => {
const record = (seq, kind, a) => ({ seq, boot: 1, second: 90, kind, a, cpu: 740, dsp1to4: 0, dsp5to8: 0, machines: Array(24).fill(0), fx: Array(16).fill(0), keys: [...Array(15).fill(255), 0x12], screen: 0, tempo24: 0, playing: false })
const cycles = { event: 'device_log', phase: 'ready', machine: 'model-cycles', set: { crc: 0xf2fe7324, bytes: 5764 } }
const text = summary({ events: [entry(1, 'cycler', { ...cycles, id: 'm', log: { loads: [], incidents: [record(1, 'start', 0), record(3, 'freeze', 7500)] } })], counts: [] })
expect(text).toContain(" Model:Cycles's log (set f2fe7324, 5764 bytes): no load records")
expect(text).toContain(' model-cycles: #3 +1m30s freeze 5.0 s, cpu 74.0%, keys 12')
})
it('shows how a disconnected trial ended in Problems', () => {
const event = entry(1, 'tester', { event: 'sync_failed', phase: 'trial', error: 'disconnected', step: 'trial', reconnect: 'closed' })
expect(summary({ events: [event], counts: [] }).split('Problems (')[1]).toContain('error=disconnected step=trial reconnect=closed')
Expand Down
Loading
Loading