2 Commits
Author SHA1 Message Date
Aleksander DygońandClaude Opus 5.5 03c2ff34c2 Remove code comments and add the no-comments rule (#12604)
* Remove code comments and add the no-comments rule

Remove the comments from first-party code and configuration files:
TS/JS, JSX, CSS, SQL migrations, Swift, Kotlin, Gradle, shell,
Docker, systemd, Nix, YAML, TOML, JSONC and GritQL.

Keep only what a tool reads: license headers, shebangs, compiler
and lint directives, JSDoc types in plain .js files, generated file
headers, GritQL scope lines, the install-server.sh help text and the
openbot-boat-pre-stop marker. Vendored code, fixtures and released
schemas keep their comments.

Add the rule to AGENTS.md, and change the docs that asked for
comments. Add two i18n keys that only comments named to
RELEASED_SOURCE_KEYS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep comments that are data in strings

The benchmark task files in opencode-free-models-bench.ts tell the
model what each function must do. The sample file and HTML page in
the two stories are display content. Put their comments back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep released migrations and mobile native inputs unchanged

check:migrations compares each released migration with v0.73.0 byte
for byte, so restore src/backend/migrations. A change to a native
build input of apps/mobile makes a new runtime version, so restore
those files and the extra fingerprint sources.

List these files and the comment markers that a tool reads in
AGENTS.md. Remove the last requests for comments in
src/renderer/AGENTS.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 12:19:28 +01:00
NBandClaude Opus 5 fcd3e4c89f build(runtime): rebuild the remote desktop runtime so it starts without Homebrew (#261)
* fix(build): bundle the macOS libraries the runtime links from Homebrew

The shipped Sunshine binary loads `libminiupnpc.21.dylib`, `libssl.3.dylib` and
`libcrypto.3.dylib` by absolute `/opt/homebrew` path, so remote desktop works on
the machine that built it and on a developer's Mac and nowhere else. OpenBot
0.2.0 carries all three: a user without Homebrew, `miniupnpc` and `openssl@3`
gets a host that never produces a frame.

`bundleMacDynamicLibraries` walks the load commands transitively, copies each
non-portable library into the bundle and rewrites the commands to reach it
through `@executable_path` or `@loader_path`. It runs before signing, not after,
because rewriting a load command invalidates the signature over it, and the
libraries it copies are signed with everything else.

`verify-remote-desktop-runtime` checked presence and checksums, which every one
of these binaries passed. It now reads the load commands too and fails on any
path outside `@…`, `/usr/lib` and `/System`, so the next build cannot ship this
again quietly.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* build(runtime): count the dylib bundler as part of the build recipe

`bundleMacDynamicLibraries` decides what the macOS runtime links, so a change to
it changes the artifact -- but it arrived in a file the workflow does not watch.
Editing it would neither trigger a runtime build nor trip the guard that demands
a `recipeVersion` bump, which is how a runtime and its recipe drift apart while
every check stays green.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* build(runtime): rebuild the pinned runtime so the dylib fix reaches users

The runtime is pinned by an input digest over the recipe version, the two source
runtimes and the target lists -- deliberately not over the build script, so that
identical inputs reuse an immutable release. The Homebrew bundling fix therefore
changed nothing the digest can see: the workflow would find the existing release,
skip the build, and every packaged app would keep downloading the same binary
that loads `/opt/homebrew` by absolute path.

Bumping `recipeVersion` is how a build-process change asks for a new artifact.
The stale pin goes with it, because a pin whose digest no longer matches the
recipe is one the lock refuses to parse -- so until the workflow publishes the
new release and its pin PR lands, nothing can package the desktop app. That
window is the point: the alternative is shipping a runtime the recipe no longer
describes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* build(runtime): take the patched fast-uri the runtime build refuses to ship

Four advisories landed against fast-uri 3.0.0 - 3.1.5 -- two host confusion,
two SSRF -- and the fork's lockfile pinned 3.1.5. `npm audit --audit-level=high`
runs before anything is compiled, so both runtime builds failed in a minute and
the dylib fix had no way to reach a release.

It is a dev-only dependency of ajv, reached through the web UI's vite tooling,
so nothing in the shipped runtime ever loaded it. Bumping it rather than
narrowing the gate keeps the audit able to fail on a compromised build tool,
which is the case it is actually there for. The fork carries the bump at
cde2ca69 and the recorded patch says the same.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* ci(runtime): stop the pin job running where it cannot pin

`pinRemoteDesktopRuntime` derives the input digest from the lock it is handed and refuses a
manifest that does not match, so the job only works where the checked-out recipe is the one the
release was built from. It hardcodes `ref: main`, which holds for the push-to-main flow it was
written for and fails for the one case that needs it most: a branch that changes the recipe,
dispatched to publish before merging so `main` never carries an unpinned lock. There it throws on
"The release manifest input digest is not current" -- main's recipe is still the old one.

Gate it on main rather than teaching it to check out the branch. Pinning from a branch would have
it open a lock PR whose diff carries that whole branch, and pushing the commit onto someone's PR
branch from CI races their local work. The fold stays manual, which is what the flow already
assumed without writing down; `docs/RELEASING.md` now has the sequence.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* build(runtime): ship the licences the bundled libraries require

Copying Homebrew's miniupnpc and OpenSSL into the runtime is what makes them OpenBot's to
redistribute -- before it, they stayed on the machine that linked them and the distribution owed
nothing. The build writes two GPL licence files and no more, so the archives would have carried
three libraries whose terms ask to travel with them: miniupnpc is BSD-3-Clause, whose binary clause
is explicit about reproducing the notice, and OpenSSL 3 is Apache-2.0.

`REDISTRIBUTED_LIBRARIES` names each library allowed into the runtime and the notice it obliges,
keyed by the name before the version so a Homebrew bump from `libssl.3.dylib` does not silently drop
the entry. The licence is taken from the tree that was actually linked against, so it describes the
binary in the archive rather than whatever the formula says later.

Verification reads the shipped tree rather than a list, so a library that starts being bundled shows
up as a failure naming it instead of a release quietly missing a licence. That is also what makes the
allowlist fail closed: unlisted means the build stops.

Recipe version stays at 9. It is already above main's 8, which is what the bump guard compares, and
no release was ever published under 9's digest -- both runs were cancelled before publish and
`remote-desktop-runtime-a6e49e7a...` is still unused, so the recipe is still unshipped.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix(runtime): stop a runtime pin from deleting the provider runtimes

`native-runtime.lock.json` answers to two schemas. `agent-runtime-lock.ts` owns
`codex`, `claude` and `grok`; `native-runtime-lock.ts` declares only
`cloudflared` and `remoteDesktop`. Zod keeps what a schema names and drops the
rest, which is what you want while reading and is destructive on the way back
out -- and the pin script wrote the parsed lock straight over the file, taking
eighty lines of provider pins with it: the assets, digests and licence hashes
`src/main/provider-runtime-manager.ts` parses to bundle the CLIs.

Nothing downstream caught it. The pin written was correct, and the publish job's
guard counts the files a pin changed rather than the keys it lost, so the lock
could lose three whole sections with every check green. The job runs the script
twice -- once to open the lock PR, once inside `verify-published` before it
packages the app -- so a published runtime went through it either way.

The pin now edits the document it read and copies out everything else. It also
formats the result: `JSON.stringify` puts every array on its own lines and Biome
collapses the short ones, and the pin job commits with no hook to notice, so the
lock PR used to open with `lint` already red.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* build(runtime): pin the published Sunshine and Moonlight Web artifacts

Pins the immutable prerelease built from digest a6e49e7a, so installs take the
published archives instead of building the runtime from source.

The `pin` job could not do this itself: it checks out `main`, and this branch
changes the recipe, so the digest it would compute there is the old one and
`pinRemoteDesktopRuntime` refuses the manifest. That is the case
`docs/RELEASING.md` now covers by hand.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-07 00:38:13 +02:00