From b9243220a4037ba706d955ee4102b669c9c1c39d Mon Sep 17 00:00:00 2001 From: rgxdev Date: Tue, 24 Nov 2026 23:00:20 +0100 Subject: [PATCH 1/5] docs(contributing): add orientation, a done checklist and pull request guidance AGENTS.md gains a start-here path, a map of where code lives, the doc to read per area, a checklist to walk before a change is done, and sections on pull requests and documentation. CONTRIBUTING.md lists ways to help besides new code and asks for one problem and observed evidence per pull request. The pull request template and the bug form follow: the form asks for the client instead of assuming macOS. The structure follows the agent guide of pingdotgg/t3code (MIT); the text is written for Tarn. No hard rule or guideline changes. Signed-off-by: rgxdev --- .github/ISSUE_TEMPLATE/bug.yml | 17 ++++- .github/pull_request_template.md | 11 ++- AGENTS.md | 112 +++++++++++++++++++++++++++++++ CONTRIBUTING.md | 22 ++++++ 4 files changed, 159 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index fccd1c51..725534c7 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -27,10 +27,23 @@ body: label: Tarn version or commit validations: required: true + - type: dropdown + id: client + attributes: + label: Client + options: + - macOS + - Windows + - Linux + - iOS + - Android + validations: + required: true - type: input - id: macos + id: os attributes: - label: macOS version + label: Operating system version + placeholder: macOS 15.3, Windows 11 24H2, Fedora 43, iOS 18.2, Android 15 validations: required: true - type: textarea diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 5a03d21d..df8fda35 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,9 +1,18 @@ Closes # -## What changed +## Problem + + + +## Change + + ## How it was tested + + Checks run, and checks not run (and why): Clients covered (the others get a `docs/port-backlog.md` entry): diff --git a/AGENTS.md b/AGENTS.md index 5fdf56f6..0112fc03 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -15,6 +15,64 @@ Shared by every client: `crates/browser-core`, `crates/engine` (platform-neutral `crates/shield`, `crates/store`, `crates/sync`, `nsh-shared`. Contract and rules: `docs/shared-core.md`. +## Start here + +For people and agents alike. **You** make the change; **the person** is the human who answers for +it; **maintainers** are the people in `MAINTAINERS.md`; a **user** is someone browsing with Tarn. + +1. Find the code in "Where code lives" and read the doc for its area ("Read first, by area"). +2. Put the logic in a shared crate, then wire the clients you can build ("Workflow for a feature"). +3. Walk "Before you call it done". +4. Run the checks of the workspaces you touched ("Checks"); CI runs the rest. +5. Open the pull request as "Pull requests" describes. + +Most of this file describes defaults: do it differently when the change needs it and say so in +the pull request, where a maintainer decides. What nobody skips is short: the required checks, the +sign-off, one maintainer's approval, the contribution terms in `CONTRIBUTING.md` and the hard +rules under "Rules for AI agents". + +## Where code lives + +| Path | What it holds | +|---|---| +| `crates/browser-core` | Platform-neutral browser state, decisions and persistence; every client calls it | +| `crates/engine` | The web view contract over WebKit and Chromium, and the platform-neutral page policies | +| `crates/shield` | Content blocking, filter lists and protection levels | +| `crates/store` | SQLite persistence for profiles, history, bookmarks and settings | +| `crates/app`, `crates/ui` | The macOS and Windows shell on GPUI, with its theme, icons and controls | +| `crates/platform` | macOS and Windows services: XPC, credentials, memory pressure, the updater | +| `crates/import` | Reads cookies, history and bookmarks from other browsers | +| `crates/devkit` | Developer tools: JSON viewer, responsive preview, localhost helpers | +| `crates/ai`, `crates/cli-bridge` | AI providers and the sandboxed bridge to a local AI CLI | +| `crates/sync` | Encrypted sync file format and merge core | +| `crates/app-dll`, `crates/chromium-helper` | The Windows DLL and the macOS helper process that embedded Chromium (CEF) needs | +| `crates/filter-bundle` | Build tool for the signed filter bundles Shield ships with | +| `nsh-shared` | Theme, icons and controls shared by Linux and mobile | +| `linux/` | The Linux shell; `linux/src/webview` binds WebKitGTK | +| `mobile/app`, `mobile/ios`, `mobile/android` | The shared mobile shell and each platform's engine hooks | +| `fuzz/` | Fuzz targets and their seeds | +| `scripts/`, `packaging/`, `.github/workflows/` | CI, packaging and release automation; protected paths (guideline 7) | + +## Read first, by area + +Read the matching doc before you change code in that area; review holds the change to it. + +| Area | Read first | +|---|---| +| Shared logic, a web view operation or event | `docs/shared-core.md` | +| Who and what acts on Tarn, its outside interfaces | `docs/architecture.md` | +| Web content, imports, filter lists, AI, extensions, updates, sync | `docs/threat-model.md` | +| A request the browser itself makes | `PRIVACY.md` | +| Cryptography | `docs/cryptography.md` | +| Filter lists and their signed bundle | `docs/filter-lists.md` | +| Themes | `docs/themes.md` | +| Windows | `docs/windows-plan.md` | +| Linux and the Native Shell clients | `docs/nsh-plan.md` | +| iOS and Android | `docs/mobile-plan.md` | +| Release, signing, update feeds | `docs/release.md` | +| A feature some clients still lack | `docs/port-backlog.md` | +| A vulnerability | `SECURITY.md` | + ## Rules 1. **Every feature lands on every client.** A feature, UI change or UX change is done only when @@ -54,6 +112,25 @@ Shared by every client: `crates/browser-core`, `crates/engine` (platform-neutral 4. Run the checks below for every client you can build; all must pass in CI. 5. One commit may cover all clients for one feature; keep unrelated changes out. +## Before you call it done + +The most common defect is a change that works on the path you tried and is missing beside it. +Walk this list and say in the pull request which entries applied: + +- **Clients.** All five have it, or the missing ones have a `docs/port-backlog.md` entry. +- **Engines.** On macOS it works on WebKit and on Chromium; a web view operation or event reaches + every implementation (rule 6). +- **Entry points.** Menu, command palette, shortcut and settings on desktop, the matching control + or gesture on touch. Fixing one is not fixing the feature. +- **Modes.** Decide what it does in every profile, in a private space and at each Shield level, + Lockdown included. +- **Way back.** Every state a user can enter has a visible way out (open and close, on and off). +- **Core.** Logic a second client would write again sits in a shared crate (rule 2). +- **Trust boundaries.** If it touches one, the threat-model row is named (guideline 6). +- **Changelog.** What users see or what protects them has its entry (`CONTRIBUTING.md`, + "Changelog"). +- **Docs.** Existing text the change makes wrong is corrected ("Documentation"). + ## Partial ports A change may land on some clients only: when the person says so (for example macOS only, or macOS @@ -90,6 +167,41 @@ CI (`.github/workflows/ci.yml`) runs these jobs; a feature is not done while any Run the checks of the workspaces you can build; you do not need every platform's toolchain, CI covers the rest. +While you iterate, run the narrowest check (`cargo test -p `, +`cargo clippy -p `) and the full row once before the pull request. To try a change in the +app, start it on throwaway data (hard rule 12): + +```sh +TARN_DATA_DIR="$(mktemp -d)" cargo run -p app +``` + +## Pull requests + +- An agent opens or updates one only when the person asks (hard rule 5). +- The title is a Conventional Commit in plain language that says what changes for the user: + `fix(release): sign the Android sideload APK so it installs`. +- The body states the problem in a sentence or two, then how the change solves it, in the + sections of `.github/pull_request_template.md`. +- One problem per pull request, with everything that fix needs across core, clients, tests and + docs. Cleanup, refactors and a second fix go in their own. +- Show that it works: how you checked and what you observed. "Tests pass" alone is not evidence. + A UI change comes with before and after screenshots, motion or timing with a short recording, + attached to the pull request. + +## Documentation + +Most code changes need no documentation change; code, types and tests already record how it works. + +- `docs/` holds what the code cannot show: contracts, trust boundaries and their mitigations, real + platform gaps, decisions with their reasons, and runbooks. Before adding a paragraph, ask what a + maintainer would get wrong without it. +- Do not list fields, constants or files, narrate control flow or append a summary of your change: + what can drift will. +- When a documented decision or constraint changes, rewrite the affected text in place. A + mitigation, a status or a rule stays unless the change is about exactly that (hard rule 7). +- A reason that belongs to one place in the code is a short comment there, not a doc. +- What users see goes into `CHANGELOG.md`, and into `README.md` where it lists the feature. + ## Rules for AI agents These apply to every AI agent or AI-assisted tool that reads, changes, reviews or proposes code diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 07bd9142..90e53910 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,6 +16,22 @@ default: if you do it differently, say so in the pull request and a maintainer d `docs/port-backlog.md` entry for the others (`AGENTS.md`, "Partial ports"). - You do not need every toolchain below: set up the clients you work on, CI runs the rest. +## Ways to help + +Code is one way; these help as much and need less setup: + +- **Port a feature.** Every entry in [`docs/port-backlog.md`](docs/port-backlog.md) names the + shared API to call, the client that already has it and what each remaining client needs. The + logic is in the shared crates, so a port is wiring. +- **Test an open pull request** on a client its author could not build, and comment with what you + saw. +- **Confirm or narrow a bug.** Say which client and version you reproduced it on, or that it no + longer happens on the latest release. +- **Point out duplicates** with a link to the original issue or pull request. + +Search the open issues and pull requests before you start. Testing or reviewing an existing pull +request helps more than opening a second one for the same problem. + ## Prerequisites - For macOS: macOS 14 or later with Xcode (or its command line tools). @@ -162,6 +178,12 @@ issue. Run the **Issues** workflow by hand to count right away. ## Pull requests +Solve one problem per pull request and include everything that fix needs across the shared crates, +the clients, tests and docs; cleanup, refactors and a second fix go in their own. Say how you +checked the change and what you observed: "tests pass" alone is not evidence. A UI change comes +with before and after screenshots, motion or timing with a short recording, attached to the pull +request. + Every pull request to `main` needs every CI check green, every review conversation resolved (CodeRabbit's included) and the approval of a Code Owner who did not author it: `@Quavon-dev/tarn-maintainer`, and `@Quavon-dev/maintainers` for the protected paths. A commit From d307a90a4a3f928a2e34ef37c236ab705e79a05f Mon Sep 17 00:00:00 2001 From: rgxdev Date: Tue, 24 Nov 2026 23:03:22 +0100 Subject: [PATCH 2/5] docs(agents): make the guide specific to Tarn and list rule exceptions AGENTS.md now opens with what Tarn does not give up, and gains the commands to run each client on throwaway data, the test and trace environment variables, which changes CI skips, and the conventions review holds a change to: line width, the separate workspaces and their lockfiles, where unsafe may live, where tests go, comments, lints and prose. Hard rules 7 and 13 keep their wording; their exceptions are split into one list item each so each condition can be read and checked on its own. CONTRIBUTING.md points to the new sections and to good first issues. Signed-off-by: rgxdev --- AGENTS.md | 162 ++++++++++++++++++++++++++++++++++-------------- CONTRIBUTING.md | 5 +- 2 files changed, 121 insertions(+), 46 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 0112fc03..ee12e8e5 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,5 +1,17 @@ # Agent guide +Tarn is an open-source, keyboard-first browser with built-in tracker and ad blocking, written in +Rust. What it does not give up: + +1. **Private by default.** No telemetry, accounts or crash upload. Every request the browser makes + on its own is listed in `PRIVACY.md`, and that list does not grow by accident. +2. **The same protection everywhere.** Shield levels, page isolation and private-session cleanup + hold on all five clients, or the change is not done. +3. **Five clients, one core.** State, decisions and policy are written once in the shared crates; + a shell renders and forwards input. +4. **Keyboard first.** On desktop a new action gets a shortcut or a command palette entry. +5. **Little code.** The smallest change that is correct on every client beats the clever one. + Tarn ships on five clients. macOS is the lead client; a feature, UI change or UX change is meant to reach all of them, in the same change where that is possible. @@ -22,9 +34,10 @@ it; **maintainers** are the people in `MAINTAINERS.md`; a **user** is someone br 1. Find the code in "Where code lives" and read the doc for its area ("Read first, by area"). 2. Put the logic in a shared crate, then wire the clients you can build ("Workflow for a feature"). -3. Walk "Before you call it done". -4. Run the checks of the workspaces you touched ("Checks"); CI runs the rest. -5. Open the pull request as "Pull requests" describes. +3. Follow "Conventions" and try the change in a running client ("Running Tarn"). +4. Walk "Before you call it done". +5. Run the checks of the workspaces you touched ("Checks"); CI runs the rest. +6. Open the pull request as "Pull requests" describes. Most of this file describes defaults: do it differently when the change needs it and say so in the pull request, where a maintainer decides. What nobody skips is short: the required checks, the @@ -168,12 +181,57 @@ Run the checks of the workspaces you can build; you do not need every platform's covers the rest. While you iterate, run the narrowest check (`cargo test -p `, -`cargo clippy -p `) and the full row once before the pull request. To try a change in the -app, start it on throwaway data (hard rule 12): +`cargo clippy -p `) and the full row once before the pull request. -```sh -TARN_DATA_DIR="$(mktemp -d)" cargo run -p app -``` +CI skips the build jobs for a change that touches only Markdown, `docs/`, `evidence/`, the issue +forms, the licence files, `CODEOWNERS` or `.editorconfig` (`scripts/ci-changes.sh`). +`docs/themes.md` and `docs/vex.json` are not skipped: `browser-core`'s tests read the first, a +check reads the second. + +## Running Tarn + +Always on throwaway data (hard rule 12); the person's profile is in use while you work. + +| Client | Command | +|---|---| +| macOS | `TARN_DATA_DIR="$(mktemp -d)" cargo run -p app` (add `-- ` to open a page) | +| macOS with Chromium | the same with `--features chromium`, after `scripts/fetch-cef.sh` and `scripts/fetch-ninja.sh` | +| Windows (Git Bash) | `export CEF_PATH="$(cygpath -w "$(scripts/fetch-cef.sh windows64)")"`, then as macOS | +| Linux | `docker build -t tarn-linux-fedora -f linux/docker/fedora.Dockerfile linux/docker`, then `linux/scripts/cargo.sh test --locked && linux/scripts/test-display.sh`; no Linux desktop needed (`linux/README.md`) | +| iOS simulator | `cd mobile/app && nsh package --target ios-simulator` | +| Android | `mobile/android/build.sh` for a debug APK (`mobile/android/README.md`) | + +A debug build reads `TARN_TEST_FILTER_KEY` and `TARN_TEST_CATALOG_KEY`, which replace the +filter-list and extension-catalog signing keys so a test can install what it signed itself. A +release build ignores both and must keep doing so (hard rule 7). `TARN_STARTUP_TRACE=1` and +`TARN_FRAME_TRACE=1` print timings to stderr; compare them before and after a change to startup, +rendering or tab switching (`README.md`, "Development"). + +## Conventions + +- **Format.** `rustfmt.toml` sets a line width of 160; run `cargo fmt --all` in each workspace + you touched. +- **Workspaces.** Root, `linux/`, `mobile/`, `nsh-shared/` and `fuzz/` are separate Cargo + workspaces, each with its own `Cargo.lock`, and `linux/` and `mobile/` build the shared crates. + A dependency change in a shared crate therefore changes several lockfiles: update each, then + run `scripts/third-party-licenses.sh` and `cargo deny check` (guideline 8). +- **`unsafe`.** Only in `crates/engine` and `crates/platform`, plus the one export in + `crates/app-dll`; every other crate is `#![forbid(unsafe_code)]`. Each block carries a + `// SAFETY:` comment with its invariant; `undocumented_unsafe_blocks` is denied (hard rule 9). + The shell reaches the platform through `engine` and `platform`, never through its own FFI. +- **Platform code.** `crates/app` compiles for macOS and Windows: a macOS-only item has a + `#[cfg(windows)]` counterpart of the same name and signature (rule 4). +- **Tests.** Logic is tested where it lives, as unit tests in the shared crate. The protections + have integration tests in `crates/app/tests` (`blocking`, `egress`, `lockdown`, `redirects`, + `referrer`, `tls_policy`): a change near one keeps its test meaning what it meant (hard rule 2). + Linux has display tests under Xvfb (`linux/scripts/display-tests.sh`); parsers of untrusted + input (filter lists, bundles, themes, imported profiles, reader and page scripts) have fuzz + targets in `fuzz/fuzz_targets`. +- **Comments.** A comment states what the code cannot: a constraint, the reason for a workaround, + an invariant. No narration, no commented-out code. +- **Lints.** Fix the cause. `#[allow(...)]` and `#[expect(...)]` are not a fix (hard rule 2). +- **Prose.** Docs use British spelling (licence, behaviour, colour) and say what is true now; a + plan doc marks what is not built yet as such (rule 7). ## Pull requests @@ -186,7 +244,9 @@ TARN_DATA_DIR="$(mktemp -d)" cargo run -p app docs. Cleanup, refactors and a second fix go in their own. - Show that it works: how you checked and what you observed. "Tests pass" alone is not evidence. A UI change comes with before and after screenshots, motion or timing with a short recording, - attached to the pull request. + attached to the pull request. Screenshots that record a client's verified state go in its + `evidence/` directory (`linux/`, `mobile/`, `mobile/ios/`, `mobile/android/`), nowhere else in + the tree (hard rule 19). ## Documentation @@ -315,33 +375,42 @@ Security and privacy that skips one, and do not otherwise make a mitigation in `docs/threat-model.md` weaker or remove a mitigation, a status or a rule from the docs. Validate untrusted input where it enters. A security fix or a change to a protection lands on every client ("Rules", rule 8). - Exception, decided by the maintainers: releases and nightly builds are signed in CI (Developer - ID, notarisation, the update key and the Android sideload APK key), in the `release-signing` - and `nightly-signing` environments as `docs/threat-model.md` S4 describes, in place of keeping - signing keys off CI. Pass the Android sideload key only to the dedicated signing job, which - runs no build code and verifies the APK against the pinned signing certificate - before uploading it. A release may also start on GitHub (`start-release.yml`): its `sign` job - creates the `v*` tag with the update app once a maintainer has approved its `release-signing` - deployment, in place of a maintainer's signed tag. Mobile store signing and uploads may run in - protected store-publishing environments, separately from builds, after release checksum and - provenance verification. Store credentials never reach build jobs, pull requests or nightly builds. - Exception for local agent control (threat model S22): desktop Tarn may expose one local-only - IPC listener per running data directory for agent control. It is off by default, opens only - after the user opts in, and accepts connections only from the same OS user account. Each - connection needs explicit approval in Tarn before receiving browser data or controlling a - tab. By default it uses a dedicated throwaway profile at Strict with per-site approval. Two - further modes are allowed, each off by default behind its own setting that only the user can - switch in Tarn: the agent opens its own tabs in a profile the user picks, with that profile's - cookies and logins, or it controls tabs the user already has open. In these modes each site - needs the user's approval in Tarn and the approved list starts empty for every session; the - profile's Shield level applies and is never lowered for the agent; private-space tabs stay - out of reach; every tab the agent controls shows a visible indicator with a one-click stop; a - form submission, a payment or a filled secret field needs the user's confirmation; and the - agent gets no access to saved passwords, passkeys or autofill. Turning the setting off closes - the listener and ends the session, including cleanup of the throwaway profile; in the other - modes it releases every tab and leaves the user's data as it was. This exception permits no - TCP listener, local HTTP API, remote-debugging port, page-to-shell bridge or new outbound - request by the shell. + + Exceptions, decided by the maintainers. Each permits exactly what it says: + + - **Signing in CI.** Releases and nightly builds are signed in CI (Developer ID, notarisation, + the update key and the Android sideload APK key), in the `release-signing` and + `nightly-signing` environments as `docs/threat-model.md` S4 describes, in place of keeping + signing keys off CI. Pass the Android sideload key only to the dedicated signing job, which + runs no build code and verifies the APK against the pinned signing certificate before + uploading it. + - **A release started on GitHub** (`start-release.yml`). Its `sign` job creates the `v*` tag + with the update app once a maintainer has approved its `release-signing` deployment, in place + of a maintainer's signed tag. + - **Store publishing.** Mobile store signing and uploads may run in protected store-publishing + environments, separately from builds, after release checksum and provenance verification. + Store credentials never reach build jobs, pull requests or nightly builds. + - **Local agent control** (threat model S22). Desktop Tarn may expose one local-only IPC + listener per running data directory for agent control, under all of these conditions: + - It is off by default, opens only after the user opts in, and accepts connections only from + the same OS user account. + - Each connection needs explicit approval in Tarn before receiving browser data or + controlling a tab. + - By default it uses a dedicated throwaway profile at Strict with per-site approval. + - Two further modes are allowed, each off by default behind its own setting that only the + user can switch in Tarn: the agent opens its own tabs in a profile the user picks, with + that profile's cookies and logins, or it controls tabs the user already has open. + - In these two modes each site needs the user's approval in Tarn and the approved list starts + empty for every session; the profile's Shield level applies and is never lowered for the + agent; private-space tabs stay out of reach; every tab the agent controls shows a visible + indicator with a one-click stop; a form submission, a payment or a filled secret field + needs the user's confirmation; and the agent gets no access to saved passwords, passkeys or + autofill. + - Turning the setting off closes the listener and ends the session, including cleanup of the + throwaway profile; in the other modes it releases every tab and leaves the user's data as + it was. + - It permits no TCP listener, local HTTP API, remote-debugging port, page-to-shell bridge or + new outbound request by the shell. 8. **No new or changed connections.** Do not add a request the shell makes, or change the receiver, content or frequency of one listed in `PRIVACY.md` ("Connections the browser itself makes"). No telemetry, analytics, accounts or crash upload. Exception, decided by the @@ -362,15 +431,18 @@ The person's machine 13. **No access to credentials or private data.** Never read, print, copy or send credentials, tokens, Keychain items, SSH or signing keys, `.env` files or browser profiles. Do not read other files outside the repository unless the task needs them. - Exception: when the person explicitly requests store-publishing setup, create and transfer - the required credentials directly to protected publishing environments without printing them, - committing them or retaining working copies. Do not inspect unrelated credentials. - When the person explicitly requests Android sideload signing setup, create a dedicated key, - transfer its credentials directly to `release-signing` and `nightly-signing`, and place a - recoverable, encrypted backup in offline storage designated by the person. Pass passwords - through standard input or the environment, never as command arguments. Do not print or commit - the credentials, retain temporary working copies or inspect unrelated credentials. The public - certificate fingerprint may be shared and pinned in the workflow and `SECURITY.md`. + + Exceptions, only when the person explicitly requests the setup named: + + - **Store-publishing setup.** Create and transfer the required credentials directly to + protected publishing environments without printing them, committing them or retaining + working copies. Do not inspect unrelated credentials. + - **Android sideload signing setup.** Create a dedicated key, transfer its credentials + directly to `release-signing` and `nightly-signing`, and place a recoverable, encrypted + backup in offline storage designated by the person. Pass passwords through standard input + or the environment, never as command arguments. Do not print or commit the credentials, + retain temporary working copies or inspect unrelated credentials. The public certificate + fingerprint may be shared and pinned in the workflow and `SECURITY.md`. 14. **No release actions.** Do not run `scripts/notarize.sh`, `scripts/dmg.sh`, `scripts/appcast.sh`, `scripts/windows-feed.sh` or `scripts/publish-release.sh`, create or move tags, or start a release, nightly or signing workflow. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 90e53910..519048ca 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -20,6 +20,7 @@ default: if you do it differently, say so in the pull request and a maintainer d Code is one way; these help as much and need less setup: +- **Pick a [good first issue](https://github.com/Quavon-dev/tarn-browser/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22).** - **Port a feature.** Every entry in [`docs/port-backlog.md`](docs/port-backlog.md) names the shared API to call, the client that already has it and what each remaining client needs. The logic is in the shared crates, so a port is wiring. @@ -56,7 +57,9 @@ cargo test --locked # root workspace tests ``` `linux/`, `mobile/` and `nsh-shared/` are separate Cargo workspaces; run their checks in their own -directory. +directory. The commands for every client, the test environment variables and the code conventions +are in [`AGENTS.md`](AGENTS.md) ("Running Tarn", "Conventions"); where each crate fits is in +"Where code lives". ## Checks From 7e735baf6d8891f9a8c573d3768e2a431439f4da Mon Sep 17 00:00:00 2001 From: rgxdev Date: Tue, 24 Nov 2026 23:08:13 +0100 Subject: [PATCH 3/5] docs(agents): add the private-by-default rule and close the client gap rule Rule 9: a feature that sends data off the device, contacts a new party, carries data across sites, profiles or apps, or keeps more about the user is off until the user turns it on; a protection is on by default. A feature that reveals nothing new may be on by default, with the reason given in the pull request. The default is set in the shared crates so every client agrees. Rule 1 now ends every client with the feature, a port backlog entry or a documented gap. The done checklist, CONTRIBUTING.md, the pull request template and the review bot's instructions follow, and the bot's comment rule now matches the one in AGENTS.md. Signed-off-by: rgxdev --- .coderabbit.yaml | 2 +- .github/pull_request_template.md | 4 +++- AGENTS.md | 34 +++++++++++++++++++++++--------- CONTRIBUTING.md | 5 ++++- 4 files changed, 33 insertions(+), 12 deletions(-) diff --git a/.coderabbit.yaml b/.coderabbit.yaml index bbcf3a10..fffbfe59 100644 --- a/.coderabbit.yaml +++ b/.coderabbit.yaml @@ -11,7 +11,7 @@ reviews: path_instructions: - path: "**/*" instructions: | - Repo rules (AGENTS.md): no code comments except `// SAFETY:` on unsafe blocks; a new dependency needs a reason in the pull request, no git dependencies; no new or changed connections the browser makes on its own (PRIVACY.md), no telemetry; never lower a Shield level, weaken Lockdown, add a page-to-shell bridge, bypass TLS errors, skip private-session cleanup, widen an allowlist or loosen validation, signature or hash checks (docs/threat-model.md). Logic belongs in the shared crates, not in a shell; a feature should land on macOS, Windows, Linux, iOS and Android; clients left out need a docs/port-backlog.md entry, and security changes land on all. + Repo rules (AGENTS.md): no code comments unless the code cannot show it (a constraint, a workaround's reason, an invariant), and `// SAFETY:` on every unsafe block; a new dependency needs a reason in the pull request, no git dependencies; no new or changed connections the browser makes on its own (PRIVACY.md), no telemetry; never lower a Shield level, weaken Lockdown, add a page-to-shell bridge, bypass TLS errors, skip private-session cleanup, widen an allowlist or loosen validation, signature or hash checks (docs/threat-model.md). Logic belongs in the shared crates, not in a shell; a feature should land on macOS, Windows, Linux, iOS and Android; clients left out need a docs/port-backlog.md entry or, where the platform cannot support it, a documented gap in the client's plan doc, and security changes land on all. Private by default (rule 9): flag a new feature that is on by default while it sends data off the device, contacts a new party, shares data across sites, profiles or apps, or stores more about the user; flag a protection that is off by default. - path: "**/*.rs" instructions: "Every `unsafe` block or impl must carry a `// SAFETY:` comment stating the invariant that makes it sound (threat model S21). Flag any `unsafe` in a crate with `#![forbid(unsafe_code)]` and any removal of that attribute." - path: "crates/shield/**" diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index df8fda35..77e92ec4 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -15,7 +15,9 @@ UI changes: before and after screenshots, a short recording for motion or timing Checks run, and checks not run (and why): -Clients covered (the others get a `docs/port-backlog.md` entry): +Clients covered (each other one has a `docs/port-backlog.md` entry, or a documented gap in its plan doc): + +New setting or behaviour: its default, and why (`AGENTS.md`, rule 9): Protected paths (`.github/CODEOWNERS`), dependencies, pins or checks changed, and why: diff --git a/AGENTS.md b/AGENTS.md index ee12e8e5..ca1e6be1 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -4,7 +4,8 @@ Tarn is an open-source, keyboard-first browser with built-in tracker and ad bloc Rust. What it does not give up: 1. **Private by default.** No telemetry, accounts or crash upload. Every request the browser makes - on its own is listed in `PRIVACY.md`, and that list does not grow by accident. + on its own is listed in `PRIVACY.md`, and that list does not grow by accident. What could + reveal something about the user is off until they turn it on (rule 9). 2. **The same protection everywhere.** Shield levels, page isolation and private-session cleanup hold on all five clients, or the change is not done. 3. **Five clients, one core.** State, decisions and policy are written once in the shared crates; @@ -56,8 +57,8 @@ rules under "Rules for AI agents". | `crates/platform` | macOS and Windows services: XPC, credentials, memory pressure, the updater | | `crates/import` | Reads cookies, history and bookmarks from other browsers | | `crates/devkit` | Developer tools: JSON viewer, responsive preview, localhost helpers | -| `crates/ai`, `crates/cli-bridge` | AI providers and the sandboxed bridge to a local AI CLI | -| `crates/sync` | Encrypted sync file format and merge core | +| `crates/ai`, `crates/cli-bridge` | AI providers for the assistant (off until the user enables AI), and a sandboxed bridge to a local AI CLI that no client builds in | +| `crates/sync` | Encrypted sync file format and merge core; no client builds it in | | `crates/app-dll`, `crates/chromium-helper` | The Windows DLL and the macOS helper process that embedded Chromium (CEF) needs | | `crates/filter-bundle` | Build tool for the signed filter bundles Shield ships with | | `nsh-shared` | Theme, icons and controls shared by Linux and mobile | @@ -91,7 +92,9 @@ Read the matching doc before you change code in that area; review holds the chan 1. **Every feature lands on every client.** A feature, UI change or UX change is done only when macOS, Windows, Linux, iOS and Android all have it. Port it to every client you can build rather than asking whether to. Clients you cannot build, or that the person leaves out, go to - the port backlog (see "Partial ports"); the change is welcome without them. + the port backlog (see "Partial ports"); the change is welcome without them. A client that + cannot have it at all gets its gap documented (rule 7). Every client ends with the feature, a + backlog entry or a documented gap. 2. **Core first, least code.** Put state, decisions, parsing, policy and persistence in `browser-core`, `engine`, `shield` or `store`, never in a shell. A shell only renders the core's state and forwards input. If logic would be written twice, it belongs in the core. Move existing @@ -113,6 +116,15 @@ Read the matching doc before you change code in that area; review holds the chan `docs/nsh-plan.md`) with the reason. "Not done yet" is not a gap. 8. **Security is identical everywhere.** Shield levels, page isolation (no page-to-shell bridge), private-session cleanup and the mitigations in `docs/threat-model.md` hold on every client. +9. **Private by default.** A feature is off until the user turns it on when it sends anything off + the device, contacts a party Tarn did not contact before, carries data across sites, profiles + or apps, or keeps more about the user than Tarn kept before. Where it is switched on, it says + what leaves the device and to whom. A protection is the reverse: on by default, and the user + may switch it off. A feature that reveals nothing new and that users expect to work may be on + by default; say in the pull request why that is better for them. When in doubt, off. The + default is set once in the shared crates (`browser-core`, `store`), so it is the same on + every client, + and a request the browser makes on its own still needs its row in `PRIVACY.md` (hard rule 8). ## Workflow for a feature @@ -130,11 +142,14 @@ Read the matching doc before you change code in that area; review holds the chan The most common defect is a change that works on the path you tried and is missing beside it. Walk this list and say in the pull request which entries applied: -- **Clients.** All five have it, or the missing ones have a `docs/port-backlog.md` entry. +- **Clients.** All five have it. Each one that does not has a `docs/port-backlog.md` entry (not + ported yet) or a documented gap in its plan doc (cannot be done there, with the reason). - **Engines.** On macOS it works on WebKit and on Chromium; a web view operation or event reaches every implementation (rule 6). - **Entry points.** Menu, command palette, shortcut and settings on desktop, the matching control or gesture on touch. Fixing one is not fixing the feature. +- **Default.** A new setting or behaviour has the default rule 9 asks for, the same on every + client, and the pull request says which and why. - **Modes.** Decide what it does in every profile, in a private space and at each Shield level, Lockdown included. - **Way back.** Every state a user can enter has a visible way out (open and close, on and off). @@ -217,8 +232,9 @@ rendering or tab switching (`README.md`, "Development"). run `scripts/third-party-licenses.sh` and `cargo deny check` (guideline 8). - **`unsafe`.** Only in `crates/engine` and `crates/platform`, plus the one export in `crates/app-dll`; every other crate is `#![forbid(unsafe_code)]`. Each block carries a - `// SAFETY:` comment with its invariant; `undocumented_unsafe_blocks` is denied (hard rule 9). - The shell reaches the platform through `engine` and `platform`, never through its own FFI. + `// SAFETY:` comment with its invariant, which the root and `mobile/` workspaces enforce by + denying `undocumented_unsafe_blocks` (hard rule 9). + `crates/app` reaches the platform through `engine` and `platform`, never through its own FFI. - **Platform code.** `crates/app` compiles for macOS and Windows: a macOS-only item has a `#[cfg(windows)]` counterpart of the same name and signature (rule 4). - **Tests.** Logic is tested where it lives, as unit tests in the shared crate. The protections @@ -227,8 +243,8 @@ rendering or tab switching (`README.md`, "Development"). Linux has display tests under Xvfb (`linux/scripts/display-tests.sh`); parsers of untrusted input (filter lists, bundles, themes, imported profiles, reader and page scripts) have fuzz targets in `fuzz/fuzz_targets`. -- **Comments.** A comment states what the code cannot: a constraint, the reason for a workaround, - an invariant. No narration, no commented-out code. +- **Comments.** Default to none. Write one only for what the code cannot show: a constraint, the + reason for a workaround, an invariant. No narration, no commented-out code. - **Lints.** Fix the cause. `#[allow(...)]` and `#[expect(...)]` are not a fix (hard rule 2). - **Prose.** Docs use British spelling (licence, behaviour, colour) and say what is true now; a plan doc marks what is not built yet as such (rule 7). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 519048ca..88a26edc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,7 +13,10 @@ default: if you do it differently, say so in the pull request and a maintainer d - For a feature or a large change, open an issue first so you learn whether it is wanted before you spend the work. - Build the clients you can. A change that reaches one client is welcome with a - `docs/port-backlog.md` entry for the others (`AGENTS.md`, "Partial ports"). + `docs/port-backlog.md` entry for the others (`AGENTS.md`, "Partial ports"); a client that + cannot support it gets the gap and its reason in its plan doc. +- Privacy comes first: anything that sends data off the device or keeps more about the user is + off until the user turns it on, and protections are on by default (`AGENTS.md`, rule 9). - You do not need every toolchain below: set up the clients you work on, CI runs the rest. ## Ways to help From 17395ea10f796a401716e2123a1ca818a28d2b1b Mon Sep 17 00:00:00 2001 From: rgxdev Date: Tue, 24 Nov 2026 23:08:17 +0100 Subject: [PATCH 4/5] docs: correct stale statements about the assistant, unsafe and Windows checks docs/architecture.md and the ai crate's description still said no client uses the AI crate; the assistant is in every client, off until the user enables AI. README.md said unsafe would reach crates/platform later and left the Windows row out of its checks table. Signed-off-by: rgxdev --- README.md | 4 +++- crates/ai/Cargo.toml | 2 +- docs/architecture.md | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 65f9d31b..ab6e0184 100644 --- a/README.md +++ b/README.md @@ -406,9 +406,11 @@ Checks per workspace (each runs in its own directory; CI runs all of them): | `mobile/` | same, plus `cargo clippy --target aarch64-apple-ios-sim --all-targets --locked -- -D warnings` | | `linux/` | same, plus `linux/scripts/display-tests.sh` | | Android build | `mobile/android/build.sh` | +| Windows (Git Bash, MSVC) | `export CEF_PATH="$(cygpath -w "$(scripts/fetch-cef.sh windows64)")"; cargo clippy --workspace --all-targets --locked -- -D warnings && cargo test --workspace --locked` | `cargo deny check` runs where a workspace has a `deny.toml`. `unsafe` code is allowed only in -`crates/engine` (and later `crates/platform`); every other crate is `#![forbid(unsafe_code)]`. +`crates/engine` and `crates/platform`, plus one export in `crates/app-dll`; every other crate is +`#![forbid(unsafe_code)]`. Start with a [good first issue](https://github.com/Quavon-dev/tarn-browser/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) and read [`CONTRIBUTING.md`](CONTRIBUTING.md); AI-assisted contributions follow [`AGENTS.md`](AGENTS.md). All of Tarn's code, packaging and release automation live in this diff --git a/crates/ai/Cargo.toml b/crates/ai/Cargo.toml index 89f092ff..9e58f034 100644 --- a/crates/ai/Cargo.toml +++ b/crates/ai/Cargo.toml @@ -3,7 +3,7 @@ name = "ai" version.workspace = true edition.workspace = true license.workspace = true -description = "Experimental AI providers (Claude API, Claude CLI, Ollama) for page summaries and tab grouping; not wired into the app." +description = "AI providers (Claude API, Claude CLI, Ollama) for Tarn's assistant, page summaries and tab grouping." repository.workspace = true publish.workspace = true diff --git a/docs/architecture.md b/docs/architecture.md index 5f03b2fb..0f12b766 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -15,7 +15,7 @@ and the web view contract in `shared-core.md`. | Engine bindings: the web view contract over each platform's engine | `crates/engine` (WebKit, Chromium/CEF), `linux/src/webview` (WebKitGTK), `mobile/ios` (WKWebView), `mobile/android` (Android System WebView) | every client | | Platform services: updater, XPC | `crates/platform` | macOS, Windows | | Import from other browsers | `crates/import` | macOS | -| AI integration and its CLI helper | `crates/ai`, `crates/cli-bridge` | `ai` is linked by `linux/` and `mobile/android`; no client UI uses it yet | +| AI integration and its CLI helper | `crates/ai`, `crates/cli-bridge` | `ai`: every client (the assistant, off until the user enables AI); `cli-bridge` is not built into any client | | Sync file format | `crates/sync` | not built into any client | | Release and filter-list pipelines | `.github/workflows/`, `crates/filter-bundle` | GitHub Actions | @@ -33,7 +33,7 @@ and the web view contract in `shared-core.md`. | Other browsers' profiles | Untrusted data | Read on the user's request by the importer (bookmarks, history, cookies) | S27 | | GitHub release pipeline (maintainers, CI) | Trusted, gated by review and signing | Builds, signs and publishes releases, update feeds and filter bundles | S4, S13, S20 | | Update and filter-list sources | Untrusted transport, signed content | Serve the Sparkle feed, the Windows feed and the filter bundle over HTTPS; the app accepts them only with a valid signature | S4, S20 | -| AI provider (Anthropic, or a local Ollama) | Untrusted output | Planned, not built into any client: would receive only the page content the user sends | S2, S3, S17 | +| AI provider (Anthropic, or a local Ollama) | Untrusted output | Receives only what the user sends once AI is enabled: the question, the earlier turns of that chat and what the user attached (`PRIVACY.md`, "AI request") | S2, S3, S17 | | Operating system and engine vendors | Trusted platform | Supply WebKit, WebKitGTK, Android System WebView and the OS; Tarn bundles only Chromium (CEF) | "Who patches what" | | Local programs | Untrusted | Nothing to connect to: no listening socket, debugging port or local API | S22 | From 39306a0dbcd4224d4cfa20a49c6776ad997b91d9 Mon Sep 17 00:00:00 2001 From: rgxdev Date: Tue, 24 Nov 2026 23:13:14 +0100 Subject: [PATCH 5/5] docs(agents): correct commands, engine and unsafe statements found in review The Windows engine is Chromium (CEF), not WebView2. The Chromium run row now gives the Ninja, PATH and CEF_PATH steps CI uses, and the Linux row starts the app instead of only testing it. unsafe is described per workspace: the mobile platform bindings use it, linux and nsh-shared forbid it through workspace lints. sync is no longer listed as shared by every client, since none builds it in. Rule 9 applies to new features and names the PRIVACY.md rows as the baseline, because the update check and search are on by default today. Signed-off-by: rgxdev --- AGENTS.md | 52 +++++++++++++++++++++++--------------------- README.md | 7 +++--- docs/port-backlog.md | 2 +- 3 files changed, 32 insertions(+), 29 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index ca1e6be1..8e7d64ac 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -4,13 +4,14 @@ Tarn is an open-source, keyboard-first browser with built-in tracker and ad bloc Rust. What it does not give up: 1. **Private by default.** No telemetry, accounts or crash upload. Every request the browser makes - on its own is listed in `PRIVACY.md`, and that list does not grow by accident. What could - reveal something about the user is off until they turn it on (rule 9). + on its own is listed in `PRIVACY.md`, and that list does not grow by accident. What a new + feature could reveal about the user is off until they turn it on (rule 9). 2. **The same protection everywhere.** Shield levels, page isolation and private-session cleanup hold on all five clients, or the change is not done. 3. **Five clients, one core.** State, decisions and policy are written once in the shared crates; a shell renders and forwards input. -4. **Keyboard first.** On desktop a new action gets a shortcut or a command palette entry. +4. **Keyboard first.** On desktop a new action is reachable from the keyboard: through the + command palette, and through a shortcut where it is used often. 5. **Little code.** The smallest change that is correct on every client beats the clever one. Tarn ships on five clients. macOS is the lead client; a feature, UI change or UX change is meant @@ -19,13 +20,13 @@ to reach all of them, in the same change where that is possible. | Client | Shell | Engine | Code | |---|---|---|---| | macOS (lead) | GPUI | WebKit / Chromium | `crates/app`, `crates/engine`, `crates/platform` | -| Windows | GPUI (same as macOS) | WebView2 | `crates/app`, `crates/engine` behind `#[cfg(windows)]` — `docs/windows-plan.md` | +| Windows | GPUI (same as macOS) | Chromium (CEF) | `crates/app`; `crates/engine` and `crates/platform` behind `#[cfg(windows)]`; `crates/app-dll` — `docs/windows-plan.md` | | Linux | NSH | WebKitGTK | `linux/` | | iOS | NSH | WKWebView | `mobile/app`, `mobile/ios` | | Android | NSH | Android WebView | `mobile/app`, `mobile/android` | Shared by every client: `crates/browser-core`, `crates/engine` (platform-neutral modules), -`crates/shield`, `crates/store`, `crates/sync`, `nsh-shared`. Contract and rules: +`crates/shield`, `crates/store`, `crates/ai`; `nsh-shared` by Linux, iOS and Android. Contract and rules: `docs/shared-core.md`. ## Start here @@ -116,15 +117,16 @@ Read the matching doc before you change code in that area; review holds the chan `docs/nsh-plan.md`) with the reason. "Not done yet" is not a gap. 8. **Security is identical everywhere.** Shield levels, page isolation (no page-to-shell bridge), private-session cleanup and the mitigations in `docs/threat-model.md` hold on every client. -9. **Private by default.** A feature is off until the user turns it on when it sends anything off - the device, contacts a party Tarn did not contact before, carries data across sites, profiles - or apps, or keeps more about the user than Tarn kept before. Where it is switched on, it says +9. **Private by default.** A new feature is off until the user turns it on when it sends anything + off the device, contacts a party Tarn did not contact before, carries data across sites, + profiles or apps, or keeps more about the user than Tarn kept before. What Tarn does today is + the baseline: the rows in `PRIVACY.md`, which a change may shrink but not widen. Where it is switched on, it says what leaves the device and to whom. A protection is the reverse: on by default, and the user may switch it off. A feature that reveals nothing new and that users expect to work may be on by default; say in the pull request why that is better for them. When in doubt, off. The default is set once in the shared crates (`browser-core`, `store`), so it is the same on - every client, - and a request the browser makes on its own still needs its row in `PRIVACY.md` (hard rule 8). + every client, and a request the browser makes on its own still needs its row in `PRIVACY.md` + (hard rule 8). ## Workflow for a feature @@ -142,10 +144,10 @@ Read the matching doc before you change code in that area; review holds the chan The most common defect is a change that works on the path you tried and is missing beside it. Walk this list and say in the pull request which entries applied: -- **Clients.** All five have it. Each one that does not has a `docs/port-backlog.md` entry (not - ported yet) or a documented gap in its plan doc (cannot be done there, with the reason). -- **Engines.** On macOS it works on WebKit and on Chromium; a web view operation or event reaches - every implementation (rule 6). +- **Clients.** Every client has it, a `docs/port-backlog.md` entry (not ported yet) or a + documented gap in its plan doc (cannot be done there, with the reason), as rule 1 asks. +- **Engines.** On macOS it works on WebKit and on Chromium, which is the only engine on Windows; + a web view operation or event reaches every implementation (rule 6). - **Entry points.** Menu, command palette, shortcut and settings on desktop, the matching control or gesture on touch. Fixing one is not fixing the feature. - **Default.** A new setting or behaviour has the default rule 9 asks for, the same on every @@ -210,9 +212,9 @@ Always on throwaway data (hard rule 12); the person's profile is in use while yo | Client | Command | |---|---| | macOS | `TARN_DATA_DIR="$(mktemp -d)" cargo run -p app` (add `-- ` to open a page) | -| macOS with Chromium | the same with `--features chromium`, after `scripts/fetch-cef.sh` and `scripts/fetch-ninja.sh` | +| macOS with Chromium | `scripts/fetch-ninja.sh ` and `export PATH=":$PATH"` once, then `CEF_PATH="$(scripts/fetch-cef.sh)" TARN_DATA_DIR="$(mktemp -d)" cargo run -p app --features chromium` | | Windows (Git Bash) | `export CEF_PATH="$(cygpath -w "$(scripts/fetch-cef.sh windows64)")"`, then as macOS | -| Linux | `docker build -t tarn-linux-fedora -f linux/docker/fedora.Dockerfile linux/docker`, then `linux/scripts/cargo.sh test --locked && linux/scripts/test-display.sh`; no Linux desktop needed (`linux/README.md`) | +| Linux | `docker build -t tarn-linux-fedora -f linux/docker/fedora.Dockerfile linux/docker` once, then `linux/scripts/env.sh && linux/scripts/app.sh` starts the app under Xvfb with a test server; no Linux desktop needed (`linux/README.md`) | | iOS simulator | `cd mobile/app && nsh package --target ios-simulator` | | Android | `mobile/android/build.sh` for a debug APK (`mobile/android/README.md`) | @@ -230,22 +232,22 @@ rendering or tab switching (`README.md`, "Development"). workspaces, each with its own `Cargo.lock`, and `linux/` and `mobile/` build the shared crates. A dependency change in a shared crate therefore changes several lockfiles: update each, then run `scripts/third-party-licenses.sh` and `cargo deny check` (guideline 8). -- **`unsafe`.** Only in `crates/engine` and `crates/platform`, plus the one export in - `crates/app-dll`; every other crate is `#![forbid(unsafe_code)]`. Each block carries a - `// SAFETY:` comment with its invariant, which the root and `mobile/` workspaces enforce by - denying `undocumented_unsafe_blocks` (hard rule 9). - `crates/app` reaches the platform through `engine` and `platform`, never through its own FFI. -- **Platform code.** `crates/app` compiles for macOS and Windows: a macOS-only item has a - `#[cfg(windows)]` counterpart of the same name and signature (rule 4). +- **`unsafe`.** In the root workspace only in `crates/engine` and `crates/platform`, plus the one + export in `crates/app-dll`; every other crate there is `#![forbid(unsafe_code)]`. `linux/` and + `nsh-shared/` forbid it through their workspace lints. The `mobile/` workspace allows it for its platform + bindings (`mobile/ios`, `mobile/android/rust`). Each block carries a `// SAFETY:` comment + with its invariant, which the root and `mobile/` workspaces enforce by denying + `undocumented_unsafe_blocks` (hard rule 9). `crates/app` reaches the platform through `engine` + and `platform`, never through its own FFI. - **Tests.** Logic is tested where it lives, as unit tests in the shared crate. The protections have integration tests in `crates/app/tests` (`blocking`, `egress`, `lockdown`, `redirects`, `referrer`, `tls_policy`): a change near one keeps its test meaning what it meant (hard rule 2). - Linux has display tests under Xvfb (`linux/scripts/display-tests.sh`); parsers of untrusted + Linux has display tests under Xvfb (`linux/scripts/display-tests.sh`, which + `linux/scripts/test-display.sh` runs in the Fedora container); parsers of untrusted input (filter lists, bundles, themes, imported profiles, reader and page scripts) have fuzz targets in `fuzz/fuzz_targets`. - **Comments.** Default to none. Write one only for what the code cannot show: a constraint, the reason for a workaround, an invariant. No narration, no commented-out code. -- **Lints.** Fix the cause. `#[allow(...)]` and `#[expect(...)]` are not a fix (hard rule 2). - **Prose.** Docs use British spelling (licence, behaviour, colour) and say what is true now; a plan doc marks what is not built yet as such (rule 7). diff --git a/README.md b/README.md index ab6e0184..ba2051ec 100644 --- a/README.md +++ b/README.md @@ -188,7 +188,7 @@ macOS is the lead client; every feature is meant to reach all five. | **Android** | Native Shell | System WebView | Android 9 or later | Shared by all of them: `browser-core` (state and decisions), `engine`, `shield` (blocking and -policy), `store` and `sync`. Contract: [`docs/shared-core.md`](docs/shared-core.md); security +policy), `store` and `ai`. Contract: [`docs/shared-core.md`](docs/shared-core.md); security model and per-platform differences: [`docs/threat-model.md`](docs/threat-model.md). ## Build and run @@ -409,8 +409,9 @@ Checks per workspace (each runs in its own directory; CI runs all of them): | Windows (Git Bash, MSVC) | `export CEF_PATH="$(cygpath -w "$(scripts/fetch-cef.sh windows64)")"; cargo clippy --workspace --all-targets --locked -- -D warnings && cargo test --workspace --locked` | `cargo deny check` runs where a workspace has a `deny.toml`. `unsafe` code is allowed only in -`crates/engine` and `crates/platform`, plus one export in `crates/app-dll`; every other crate is -`#![forbid(unsafe_code)]`. +`crates/engine` and `crates/platform`, plus one export in `crates/app-dll`, and in the platform +bindings `mobile/ios` and `mobile/android/rust`; the other root crates, `linux/` and `nsh-shared/` +forbid it. Start with a [good first issue](https://github.com/Quavon-dev/tarn-browser/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) and read [`CONTRIBUTING.md`](CONTRIBUTING.md); AI-assisted contributions follow [`AGENTS.md`](AGENTS.md). All of Tarn's code, packaging and release automation live in this diff --git a/docs/port-backlog.md b/docs/port-backlog.md index da4ef17e..cd49a57b 100644 --- a/docs/port-backlog.md +++ b/docs/port-backlog.md @@ -13,7 +13,7 @@ Shared API: . Reference: . - [ ] macOS — -- [ ] Windows — +- [ ] Windows — - [ ] Linux — - [ ] iOS — - [ ] Android —