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
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Bug report
description: The collector, the gate or the agent does something wrong.
labels: [bug]
body:
- type: markdown
attributes:
value: |
Redact track titles, artists, albums, persistent IDs, device names, hostnames, addresses, paths and credentials. Do not attach a database, a capture or an environment file.
- type: dropdown
id: component
attributes:
label: Component
options: [Collector, Read-only gate, Research agent, Installation or provisioning, Documentation]
validations:
required: true
- type: textarea
id: what
attributes:
label: What happened, and what did you expect?
validations:
required: true
- type: textarea
id: evidence
attributes:
label: Smallest query, log excerpt or command that shows it
render: text
validations:
required: true
- type: input
id: versions
attributes:
label: macOS, StreamWatch revision and RateCue version
placeholder: macOS 15.5, StreamWatch 0.2.0 (abc1234), RateCue 0.2.0
validations:
required: true
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Report a vulnerability
url: https://github.com/troylefevre65/StreamWatch/security/policy
about: Report security problems privately, as the security policy describes. Do not open a public issue.
- name: RateCue
url: https://github.com/troylefevre65/RateCue/issues
about: Problems with the RateCue app itself, including what it displays, belong in the RateCue repository.
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Feature request
description: Something StreamWatch should observe, compare or report.
labels: [enhancement]
body:
- type: textarea
id: question
attributes:
label: What question about Apple Music playback or RateCue would this answer?
validations:
required: true
- type: textarea
id: evidence
attributes:
label: What would be observed, and how could the result be checked or proven wrong?
validations:
required: true
- type: checkboxes
id: boundaries
attributes:
label: Boundaries
options:
- label: It only observes. It does not control playback, write audio hardware or change preferences.
required: true
- label: It keeps track metadata and device identity in the local database.
required: true
14 changes: 14 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## Purpose

<!-- What does this change and why? -->

## Validation

- [ ] `python3 -m unittest discover -s tests` passes
- [ ] A focused test covers a changed pattern, view, gate rule or agent tool
- [ ] Nothing the agent can read or send carries track metadata, device identity, paths or credentials
- [ ] StreamWatch still only observes: no playback control, device writes or preference changes

## Not exercised on a live system

<!-- Collector, gate, agent or model-host behavior you could not run. -->
33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Changelog

Notable changes to StreamWatch. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and versions follow [Semantic Versioning](https://semver.org/).

## [0.2.0] - 2026-11-29

Works with RateCue 0.2.0 and earlier.

### Added

- `queue_prediction_metrics`: Music's own advance notice of a queue item's format, when it queues the item and when it starts buffering it, scored against the item's first decoder report. A database that predates the table is scored once from the log lines it already holds.
- The gate allows RateCue's read-only `decoder-status` command.
- The collector reads the displayed format from the explicit fields RateCue 0.2 publishes, and understands both the new (`96 kHz / 24-bit`) and the earlier (`96k / 24`) menu title.
- A license (GPL-3.0-only), a notice with attribution and dependency licenses, contribution guidelines, a code of conduct, issue and pull request templates, SPDX identifiers in every source file, and this changelog.

### Changed

- `track_formats` selects the decoder report by when it was logged, which is the audible boundary, instead of by when Music began buffering the item.
- `ratecue_*` is the last snapshot taken while the track was current.
- A decoder report with a rate and no depth is recorded as a lossy rendition. For such a play, displaying no depth is a `match` and displaying one is a `MISMATCH`.

### Fixed

- `track_formats` credited the next track's first RateCue snapshot to the track that had just ended, because it took the collector's late observation of a track change for the boundary. Over two days it reported 194 of 427 plays as unknown and 6 as mismatches, where RateCue had ended 139 of 399 plays without a depth and had published no wrong lossless depth.
- Two track starts recorded for one play: Music showing the previous track with the new position for a moment at a boundary, and a play recorded again after a collector restart.
- A same-track restart is recorded once a second poll confirms it, with the time of the first.

## [0.1.0] - 2026-11-27

First public release: the collector, the read-only SSH gate, the research agent, the three-way comparison, and best-effort sequence prediction metrics.

[0.2.0]: https://github.com/troylefevre65/StreamWatch/compare/df856e0...main
[0.1.0]: https://github.com/troylefevre65/StreamWatch/commits/df856e0
9 changes: 9 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Code of conduct

StreamWatch welcomes listeners, developers, and hardware reviewers of every background and experience level.

- Be respectful and assume good faith. Critique evidence and code, not people.
- Keep discussion on topic. Support claims about formats or hardware with reproducible observations.
- Do not harass, insult, or share anyone's private information. Playback databases, captures and agent environments are private; never post them.

The maintainer may edit or remove contributions and restrict participation that violates this code. Report concerns privately to the maintainer through the contact options on the [maintainer's GitHub profile](https://github.com/troylefevre65).
45 changes: 45 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Contributing to StreamWatch

The checks need Python 3.9 or later and nothing else: no Music subscription, model server, SSH access or audio hardware.

1. Create a topic branch: `git switch -c your-topic`.
2. Add a focused test in [`tests/test_streamwatch.py`](tests/test_streamwatch.py) when you change parsing, the comparison views, the gate, or the agent's tools. Use a captured log line as the fixture when you add or change a pattern.
3. Run the checks from the repository root:

```sh
python3 -m compileall -q llm-box mac tests
bash -n llm-box/provision.sh mac/install.sh mac/authorize-key.sh
python3 -m unittest discover -s tests -v
```

The agent's tests stub the `openai` package when it is not installed. The [workflow](.github/workflows/check.yml) runs the same commands on every push and pull request.
4. Share the change with its purpose, the test results, and anything you could not exercise on a live system.

## Code map

| Path | Responsibility |
| --- | --- |
| [`mac/collector.py`](mac/collector.py) | The always-on collector: log polling, playback observation, RateCue snapshots, device state, and the comparison views. Standard library only. |
| [`mac/readonly_gate.py`](mac/readonly_gate.py) | The forced SSH command: read-only SQL with private columns denied, and an allowlist of diagnostics. |
| [`llm-box/agent.py`](llm-box/agent.py) | The research agent: observation, leads, tools, findings, and proposal drafts. |
| [`mac/install.sh`](mac/install.sh), [`llm-box/provision.sh`](llm-box/provision.sh) | Installation on the Mac and on the model host. |
| [`tests/`](tests) | Unit tests for all of the above. |

## Boundaries that changes must keep

Read the [charter](CHARTER.md) and the [security model](SECURITY.md) first. In short:

- StreamWatch observes. Nothing in it may control playback, write audio hardware, or set RateCue or Music preferences.
- Track titles, artists, albums, persistent IDs, device names and raw snapshots stay in the local database. Anything the agent can read through the gate, and anything sent to a model, GitHub or a search engine, must be free of them. A new table, view or column needs a gate test.
- A log record, a RateCue snapshot and a device row each describe one thing. Do not present any of them, or a prediction, as ground truth.
- The agent drafts proposals. It does not file issues, open pull requests, or deploy code.

## Reporting

For a bug or a result from a live system, include the macOS version, the StreamWatch and RateCue revisions, and the smallest query or log excerpt that shows it. Redact track metadata, device identifiers, hostnames, addresses, paths and credentials. Do not commit databases, captures, proposals, logs or environment files; [`.gitignore`](.gitignore) excludes them.

Report a vulnerability privately, as [SECURITY.md](SECURITY.md) describes.

## License

StreamWatch contributions use the repository's [GPL-3.0-only license](LICENSE). Submit only work you have the right to license, and keep third-party names and notices with any material you add. See [NOTICE](NOTICE) for the RateCue and LosslessSwitcher attribution and the dependency licenses.
Loading
Loading