Skip to content
Open
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
78 changes: 78 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Jamulus — Agent Instructions

Real-time networked music jamming app. Qt/C++ qmake project. Client and server share same codebase. Entry point: `src/main.cpp`. Configure `CONFIG` flags in `Jamulus.pro`.

**Make the smallest possible change. One logical change per PR. Never mix refactoring with fixes/features.**

Priority order: Stability > Low latency / real-time safety > Backwards compatibility > Maintainability > New features. This order resolves conflicts only — new features are welcome.

---

## Build

Linux: `qmake && make` (use `qmake-qt5` on Fedora). Headless server: `qmake "CONFIG+=headless serveronly" && make`. First run: `git submodule update --init` (oboe for Android). See `COMPILING.md` for the full per-platform table.

macOS (xcode spec) use: `qmake QMAKE_APPLE_DEVICE_ARCHS=arm64 QT_ARCH=arm64 -spec macx-xcode Jamulus.pro`
(Use `x86_64` on Intel Macs; `macx-clang` to build with `make`). Then `xcodebuild build`,
and `macdeployqt ./Release/Jamulus.app` (or `./Debug/Jamulus.app`) to make it runnable.

No test suite: run a headless server, connect a client to `127.0.0.1`, exercise the change, and state in the PR what you tested.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lesson from #3861: an agent burned a full round-trip on a CI failure that turned out to be a GitHub Actions outage.

Suggested change
No test suite: run a headless server, connect a client to `127.0.0.1`, exercise the change, and state in the PR what you tested.
No test suite: run a headless server, connect a client to `127.0.0.1`, exercise the change, and state in the PR what you tested.
If CI fails, read the failing step's log before changing any code — and check https://www.githubstatus.com/ first. Closing and reopening the PR retriggers CI after an infra outage.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather just have

Suggested change
No test suite: run a headless server, connect a client to `127.0.0.1`, exercise the change, and state in the PR what you tested.
No test suite: run a headless server, connect a client to `127.0.0.1`, exercise the change, and state in the PR what you tested. If CI fails, read the failing step's log.


## Never Do

**`Never Do` rules are absolute**

- Block or slow: audio callbacks (`src/sound/`), socket handling (`src/socket.cpp`), server mixing timer (`src/server.cpp`) — stalls = audible dropouts. Preallocate buffers; keep real-time paths lock-free.
- Allocate excessive memory, do file I/O, or log excessively in real-time paths (blocks the audio thread).
- Trust any value received from a remote client — validate size and bounds on all network input (malformed input crashes).
- Edit generated files: `moc_*.cpp`, `ui_*.h`, `qrc_*.cpp`, `*.qm` — regenerate, don't hand-edit.
- Edit or reformat third-party code in `libs/` (e.g. opus, oboe, NSIS).
- Edit `ChangeLog` directly — use a `CHANGELOG:` line in the PR instead.

## Always

- Attach test evidence (logs/output) to the PR — never just assert something works.
- Say so if you did not run or verify something.

## Ask first

- Architecture changes (e.g. networking/protocol, threading, build system) — open an issue to discuss (see `CONTRIBUTING.md`).

## Qt / portability

- Minimum Qt: **5.12.2**. Qt 6 recommended (not for iOS, see below). Guard newer APIs with `#if QT_VERSION >= QT_VERSION_CHECK(...)`.
- C++11 (C++17 on Android for Oboe).
- iOS builds require Qt 5.15 or later (Qt 6 buggy on iOS).
- Preserve platform support. Don't break Android/iOS builds.
- Supported desktop: Windows 10+, macOS 10.10+, Ubuntu 20.04+/Debian 11+.
Comment thread
ann0see marked this conversation as resolved.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't find an in-repo source for macOS 10.10+ — the only 10.10 in the tree is in docs/TRANSLATING.md, and it's about GitHub Desktop's requirements. Worth confirming the floor or dropping the specific number.


## Style (C / C++ / Obj-C++)

```bash
make clang_format # run before committing (target exists only after qmake generated Makefile)
```

- **CI uses clang-format** (check `.github/workflows/coding-style-check.yml` for version).
- CI runs **shellcheck + shfmt** on `.sh` files; **pylint** (config: `.pylintrc`) on `.py` files in `tools/`.
- All new contributions: AGPL 3.0+ license header. Pre-3.12.1dev code: GPL 3.0+ (see `CONTRIBUTING.md`).
- Use `tr ( "Hello %1" ).arg ( name )` for user-facing strings — never string concatenation.

## JSON-RPC

- If RPC methods are changed, regenerate `docs/JSON-RPC.md` with `tools/generate_json_rpc_docs.py` (CI fails otherwise).
- Requires `--jsonrpcport` + `--jsonrpcsecretfile` at runtime. Binds to localhost by default.

## PR expectations

- One logical change per PR — no unrelated cleanup or reformatting of untouched code. Discuss features in an issue before implementing. See `CONTRIBUTING.md`.
- Branch names starting with `autobuild` trigger CI builds on your fork.
- Follow `.github/pull_request_template.md`. Include `CHANGELOG:` line with changelog description. For new deps/build changes, add `AUTOBUILD: Please build all targets`.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth stating which targets are in without this and which this adds. Presumably the occasional fix to actual code (not deps / build process) will need this.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could tell it to look at the workflow file.

- Builds? Tested? Smallest change possible? Self reviewed against "Priority order" above?
- Disclose AI-generated text in PRs/issues — never in code comments.

## Read when relevant

- `CONTRIBUTING.md` — process, style, licensing
- `COMPILING.md` — full build per platform, CONFIG flags table
- `docs/JAMULUS_PROTOCOL.md` — network protocol, packet IDs, ack rules
- `SECURITY.md` — security reporting
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ We’d really appreciate your support! Please ensure that you understand the fol
- Otherwise, please [post on the GitHub Discussions](https://github.com/jamulussoftware/jamulus/discussions) and say that you are planning to do some coding and explain why. Then we can discuss the specification.
- Please begin coding only after we have agreed on a specification to avoid putting a lot of effort into something that may not be accepted later.

If you work with an AI coding agent, [AGENTS.md](AGENTS.md) is its entry point into this repository. Everything in this document applies to agent-assisted contributions without exception: you remain the author, and you are expected to understand and stand behind every line you submit.


## Jamulus project/source code general principles

Expand Down
Loading