diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 91c4ce3..b6e8f87 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -165,6 +165,11 @@ jobs: mix deps.get mix compile mix sbom.cyclonedx --only prod --format json --output "../dist/kotiko-server-$VERSION.cdx.json" --force + # The VEX document (OSPS-VM-04.02): dependency vulnerabilities that don't affect Kotiko. + - name: VEX document + env: + VERSION: ${{ steps.version.outputs.version }} + run: cp vex/kotiko.openvex.json "dist/kotiko-$VERSION.openvex.json" - name: Checksums working-directory: dist run: | diff --git a/CHANGELOG.md b/CHANGELOG.md index 22fd278..d0f648a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,19 @@ Conventional Commits by release-please. - The dashboard's Add words sheet no longer shows a stray "null" beside "Learning" when you read one language. +- With your words kept in this browser, the dashboard's Recently deleted now shows a word as + soon as you delete it, here or from the popup, and drops it when you restore it or press + Undo, without reloading the page. +- On the dashboard, moving a word to another language with M or Move to… no longer loses + your place: the keyboard focus stays on that word in the list, on the next word if it + left the list, or on the inspector's Move button. Choosing from any of the dashboard's + menus now returns focus to the button that opened it. +- In the popup's language picker, pressing Enter in the search box now picks the first + language it lists, as the dashboard's picker does. +- The warnings about a server address that starts with http://, in the extension and when + the server starts, now say what actually travels unencrypted: your words and the server's + answers. Your access key never does; Kotiko signs each request with it instead of sending + it. ## [1.0.1](https://github.com/ScriptKittyOS/kotiko/compare/v1.0.0...v1.0.1) (2026-10-08) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 465c1ba..4389277 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,6 +12,12 @@ The roadmap is in [`slices/`](slices/README.md): one folder per piece of work, e To help: pick a slice, comment on its issue so others know, and open a pull request. +**New here?** Start with an issue labelled +[good first issue](https://github.com/ScriptKittyOS/kotiko/labels/good%20first%20issue): small, +self-contained tasks, some needing no code at all (a translation, a name checked in Anki). +[help wanted](https://github.com/ScriptKittyOS/kotiko/labels/help%20wanted) lists the tasks +where outside help matters most. + ## Setup You need Elixir 1.15 or newer and Node 22. diff --git a/SECURITY.md b/SECURITY.md index 8cbf692..94b0127 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,7 +2,7 @@ ## Supported versions -Only the latest release gets security fixes: from 1.0.0 on (the first store release, still pending), the latest 1.x. Release candidates (`vX.Y.Z-rc.N` pre-releases, for review) and versions older than 1.0.0 get none. +Only the latest release gets security fixes: from 1.0.0 on, the latest 1.x. Release candidates (`vX.Y.Z-rc.N` pre-releases, for review) and versions older than 1.0.0 get none. ## Reporting a vulnerability diff --git a/docs/best-practices.md b/docs/best-practices.md index b77ea7d..b40a5a6 100644 --- a/docs/best-practices.md +++ b/docs/best-practices.md @@ -1,6 +1,7 @@ # OpenSSF Best Practices answers -Last reviewed: 2026-10-06. +Last reviewed: 2026-10-06; the answers about releases and tags updated 2026-12-05, after +v1.0.0 and v1.0.1. Kotiko's answers to the [OpenSSF Best Practices badge](https://www.bestpractices.dev) criteria, kept in the repository so the claims sit next to the code that backs them. The @@ -48,12 +49,12 @@ request, then on the form. The plan behind it is slice |---|---|---|---|---| | MUST | 40 | 0 | 3 | 43 | | SHOULD | 10 | 0 | 0 | 10 | -| SUGGESTED | 12 | 1 | 1 | 14 | -| **All** | **62** | **1** | **4** | **67** | +| SUGGESTED | 13 | 0 | 1 | 14 | +| **All** | **63** | **0** | **4** | **67** | Passing needs every MUST met or N/A, every SHOULD met or explained, and every SUGGESTED -answered. Every MUST and SHOULD is met or N/A today. The one unmet SUGGESTED criterion -(`version_tags`: no release tagged yet) doesn't block passing. +answered. Every criterion is met or N/A today; the last unmet one, `version_tags`, is met +since the signed tags of v1.0.0 and v1.0.1. What has to happen for the badge, and to keep it, and who does it: @@ -62,7 +63,6 @@ What has to happen for the badge, and to keep it, and who does it: | Fill the entry at from the tables below | All | Maintainer | | Merge pull request #9 (patches shell-quote and postcss-selector-parser in development tools) before pasting the `vulnerabilities_critical_fixed` answer, which names it as done | `vulnerabilities_critical_fixed` | Maintainer | | Resolve or rule out the node-forge advisory (GHSA-86w9-cpqp-85rv, development-only through web-ext, no patched version) before 2026-11-02, 60 days after it was published | `vulnerabilities_fixed_60_days` | Lead maintainer | -| Add the release signing key to `.github/allowed_signers` (it lists none yet), merge release pull request #7 and tag `v1.0.0` | `version_tags` (SUGGESTED) | Maintainer | | When kotiko.org goes live, turn on "Enforce HTTPS" for it in GitHub Pages; the README's guide links point there | `sites_https`, `documentation_basics` | Maintainer | ## Passing: Basics @@ -70,7 +70,7 @@ What has to happen for the badge, and to keep it, and who does it: | Criterion | Level | Status | Answer | Evidence | Needs | |---|---|---|---|---|---| | `description_good` | MUST | Met | The README's first paragraph says what Kotiko does: learn a word in any language and Kotiko slips it into the web pages you already read, in whatever language you read them. https://github.com/ScriptKittyOS/kotiko#readme | `README.md:16-19`; repository description (`gh api repos/ScriptKittyOS/kotiko`) | – | -| `interact` | MUST | Met | Obtain: the README's Install section (https://github.com/ScriptKittyOS/kotiko#install); until the store listings and first release exist, the extension is loaded from the repository's extension folder (steps: https://github.com/ScriptKittyOS/kotiko/blob/main/site/src/content/docs/install.mdx). Feedback: issue forms for bugs, ideas, broken sites and wrong words (https://github.com/ScriptKittyOS/kotiko/issues/new/choose), questions in GitHub Discussions (https://github.com/ScriptKittyOS/kotiko/discussions), security reports per SECURITY.md. Contribute: https://github.com/ScriptKittyOS/kotiko/blob/main/CONTRIBUTING.md | `README.md:54-64`, `README.md:93-98`; `site/src/content/docs/install.mdx:48-107`; `.github/ISSUE_TEMPLATE/bug.yml`, `feature.yml`, `site-broken.yml`, `wrong-word.yml`, `config.yml:1-8`; `CONTRIBUTING.md:13` | – | +| `interact` | MUST | Met | Obtain: the README's Install section (https://github.com/ScriptKittyOS/kotiko#install): the Chrome Web Store (https://chromewebstore.google.com/detail/jfojipbehhhidilcpjoidchcbjldjoai) and Firefox Add-ons (https://addons.mozilla.org/firefox/addon/kotiko/) listings, or by hand from the latest release (https://github.com/ScriptKittyOS/kotiko/releases) or the repository's extension folder (steps: https://github.com/ScriptKittyOS/kotiko/blob/main/site/src/content/docs/install.mdx). Feedback: issue forms for bugs, ideas, broken sites and wrong words (https://github.com/ScriptKittyOS/kotiko/issues/new/choose), questions in GitHub Discussions (https://github.com/ScriptKittyOS/kotiko/discussions), security reports per SECURITY.md. Contribute: https://github.com/ScriptKittyOS/kotiko/blob/main/CONTRIBUTING.md | `README.md:54-64`, `README.md:93-98`; `site/src/content/docs/install.mdx:48-107`; `.github/ISSUE_TEMPLATE/bug.yml`, `feature.yml`, `site-broken.yml`, `wrong-word.yml`, `config.yml:1-8`; `CONTRIBUTING.md:13` | – | | `contribution` | MUST [URL] | Met | Contributions are GitHub pull requests: pick a slice or issue, comment on it, open a pull request; maintainers review every pull request and CI must pass before it merges. https://github.com/ScriptKittyOS/kotiko/blob/main/CONTRIBUTING.md | `CONTRIBUTING.md:13`, `CONTRIBUTING.md:65-70`; ruleset "main: pull requests with passing CI" (`gh api repos/ScriptKittyOS/kotiko/rulesets/24531669`) | – | | `contribution_requirements` | SHOULD [URL] | Met | CONTRIBUTING.md states what an acceptable contribution needs: the rules that protect users (text-only DOM, no runtime npm code in the extension, no user text or secrets in logs, no secrets in the repository, no network in tests), automated tests with every behaviour change and a regression test with every fix, Conventional Commits, SPDX headers, and the coding standards in docs/CODING_STANDARDS.md, which CI checks. https://github.com/ScriptKittyOS/kotiko/blob/main/CONTRIBUTING.md and https://github.com/ScriptKittyOS/kotiko/blob/main/docs/CODING_STANDARDS.md | `CONTRIBUTING.md:38-97`; `docs/CODING_STANDARDS.md` | – | | `floss_license` | MUST | Met | The code is licensed under Apache-2.0; two bundled data files also carry the MIT and Unicode-3.0 licenses of their sources. The name, logo, icons and illustrations are trademarks under separate terms (LICENSES/LicenseRef-KotikoBrand.txt), not part of the code license. | `LICENSE`; `README.md:100-104`; `REUSE.toml:17-33` | – | @@ -78,7 +78,7 @@ What has to happen for the badge, and to keep it, and who does it: | `license_location` | MUST [URL] | Met | https://github.com/ScriptKittyOS/kotiko/blob/main/LICENSE (plus LICENSES/ and REUSE.toml for per-file licensing). | `LICENSE`; `LICENSES/`; `REUSE.toml`; CI runs `reuse lint` (`.github/workflows/ci.yml:143`) | – | | `documentation_basics` | MUST [N/A J] | Met | The user guides are in the repository: installing, getting started, adding words, languages, backing up and deleting data, troubleshooting, running and updating the optional server, and the Telegram bot (https://github.com/ScriptKittyOS/kotiko/tree/main/site/src/content/docs). Using it securely: the server listens on localhost only by default, the remote-access guide explains the plain-HTTP risk of other addresses, and docs/security/requirements.md says what is and isn't protected (https://github.com/ScriptKittyOS/kotiko/blob/main/docs/security/requirements.md). | `site/src/content/docs/` (`install.mdx`, `start.md`, `use/`, `help/index.md`, `server/`); `site/src/content/docs/server/remote-access.md:6-15`; `docs/security/requirements.md:81-82`; `README.md:54-91` | The same pages will be published at kotiko.org (slice 44) | | `documentation_interface` | MUST [N/A J] | Met | The server's HTTP API (every route, field, limit, status code and error) and every setting are documented in https://github.com/ScriptKittyOS/kotiko/tree/main/docs/reference ; a test fails when a route or setting is missing from them. The Telegram bot's commands and the extension's screens are described in the user guides in site/src/content/docs; the word record and the export file are specified as JSON schemas in spec/. | `docs/reference/http-api.md`; `docs/reference/configuration.md`; `server/test/kotiko/docs_test.exs:47-86`; `site/src/content/docs/server/telegram.md:24-30`; `spec/word.schema.json`; `spec/export.schema.json` | – | -| `sites_https` | MUST | Met | The project's sites are on GitHub, which serves only HTTPS: the repository, issues, discussions and releases at https://github.com/ScriptKittyOS/kotiko . The documentation site planned at kotiko.org isn't live yet. Store packages will come over HTTPS from the Chrome Web Store and addons.mozilla.org. | `curl` of the repository, issues and discussions URLs: 200 over HTTPS (2026-10-06); `kotiko.org` doesn't resolve yet | Enforce HTTPS on kotiko.org when it goes live | +| `sites_https` | MUST | Met | The project's sites are on GitHub, which serves only HTTPS: the repository, issues, discussions and releases at https://github.com/ScriptKittyOS/kotiko . The documentation site https://kotiko.org/ is HTTPS only: plain HTTP redirects to it, with HTTP Strict Transport Security. Store packages come over HTTPS from the Chrome Web Store and addons.mozilla.org. | `curl` of the repository, issues and discussions URLs: 200 over HTTPS (2026-10-06); `curl -sI http://kotiko.org/`: 301 to https://kotiko.org/, and `https://kotiko.org/`: 200 with strict-transport-security max-age=31536000 (2026-12-05) | – | | `discussion` | MUST | Met | GitHub Issues, pull requests and GitHub Discussions: searchable, addressable by URL, open to anyone with a free account, no proprietary client needed. https://github.com/ScriptKittyOS/kotiko/discussions | `gh api repos/ScriptKittyOS/kotiko`: `has_issues` and `has_discussions` true; `.github/ISSUE_TEMPLATE/config.yml:3-5` | – | | `english` | SHOULD | Met | All project documentation, issue forms and code comments are in English; reports in English are welcome. | `README.md`; `CONTRIBUTING.md`; `.github/ISSUE_TEMPLATE/` | – | | `maintained` | MUST | Met | Actively developed: commits on every day from 2026-10-01 to 2026-10-06, and pull requests merged on the public repository since it opened. https://github.com/ScriptKittyOS/kotiko/commits/main | `git log --format=%ad --date=short` (134 commits, 2026-10-01 to 2026-10-06); `gh pr list --state all`: #1 to #9 on 2026-10-06, 7 merged | – | @@ -91,9 +91,9 @@ What has to happen for the badge, and to keep it, and who does it: | `repo_track` | MUST | Met | git records every change with its author and date. https://github.com/ScriptKittyOS/kotiko/commits/main | `git log` | – | | `repo_interim` | MUST | Met | Every change to main goes through a pull request (a ruleset requires pull requests and eight passing CI checks), and the full history with its interim commits is public, not only releases. https://github.com/ScriptKittyOS/kotiko/pulls?q=is%3Apr | `git log --merges` (44 merges); ruleset 24531669 | – | | `repo_distributed` | SUGGESTED | Met | git, hosted on GitHub: https://github.com/ScriptKittyOS/kotiko | – | – | -| `version_unique` | MUST | Met | Each release has its own SemVer version (0.1.0, 0.2.0, next 1.0.0), kept identical in the server, the extension manifest and the release manifest; CI fails if they differ. | `server/mix.exs:11`; `extension/manifest.json:5`; `.release-please-manifest.json`; `node scripts/check-versions.mjs`: all 0.2.0, exit 0 (CI job "versions and licenses", `.github/workflows/ci.yml:131`) | – | +| `version_unique` | MUST | Met | Each release has its own SemVer version (0.1.0 and 0.2.0 privately, then 1.0.0 and 1.0.1), kept identical in the server, the extension manifest and the release manifest; CI fails if they differ. | `server/mix.exs:11`; `extension/manifest.json:5`; `.release-please-manifest.json`; `node scripts/check-versions.mjs`: all 1.0.1, exit 0 (2026-12-05) (CI job "versions and licenses", `.github/workflows/ci.yml:131`) | – | | `version_semver` | SUGGESTED | Met | Semantic Versioning; release-please derives versions from Conventional Commits. | `CHANGELOG.md:209,217`; `release-please-config.json`; `.release-please-manifest.json` | – | -| `version_tags` | SUGGESTED | Unmet | No release has been tagged in this repository yet. From the first public release (v1.0.0) every release gets a signed vX.Y.Z tag, which the release pipeline verifies before it builds anything, and a ruleset lets only admins create, move or delete release tags. | `git ls-remote --tags origin` is empty; `gh release list` is empty; ruleset "release tags: only admins create, move or delete"; `.github/workflows/release.yml` | Maintainer adds the signing key to `.github/allowed_signers`, merges release PR #7 and tags `v1.0.0` | +| `version_tags` | SUGGESTED | Met | Every release has a signed vX.Y.Z tag (v1.0.0 and v1.0.1, and v1.0.0-rc.1 to rc.4 for the release candidates), which the release pipeline verifies before it builds anything. Tag rulesets let only the release manager create release tags and keep every tag from being moved or deleted (organization admins can bypass them). https://github.com/ScriptKittyOS/kotiko/tags | `git ls-remote --tags origin`: v1.0.0-rc.1 to rc.4, v1.0.0, v1.0.1 (2026-12-05); `gh release list`: the same releases; rulesets "release tags: only the release manager creates them" and "tags are permanent"; `.github/workflows/release.yml` | – | | `release_notes` | MUST [URL] [N/A J] | Met | Human-readable release notes for every release, written for users, not a git log: https://github.com/ScriptKittyOS/kotiko/blob/main/CHANGELOG.md | `CHANGELOG.md:1-219`; `scripts/release-notes.mjs` (notes for each GitHub release) | – | | `release_notes_vulns` | MUST [N/A J] | N/A | No publicly known vulnerability (with a CVE or similar) has been fixed in a release. The one security fix so far (0.2.0, an authentication bypass found by our own review, never public) is still named in the 0.2.0 notes. Future notes list every advisory and CVE (SECURITY.md, What happens after you report, step 6). | `CHANGELOG.md:214-215`; `SECURITY.md:37-38`; `gh api repos/ScriptKittyOS/kotiko/security-advisories`: none | – | @@ -179,7 +179,7 @@ earned, and gold once silver is; the answers can be entered before that. | `code_of_conduct` | MUST [URL] | Met | Contributor Covenant 2.1, in the standard location: https://github.com/ScriptKittyOS/kotiko/blob/main/CODE_OF_CONDUCT.md . Reports go to security@scriptkittyos.com; GitHub lists it in the repository's community profile. | `CODE_OF_CONDUCT.md:1,39,73`; `gh api repos/ScriptKittyOS/kotiko/community/profile` lists `code_of_conduct_file` | – | | `roles_responsibilities` | MUST [URL] | Met | GOVERNANCE.md defines each role and the tasks it must perform: lead maintainer, maintainer (reviews and merges, weekly triage with a first response within 7 days, approves releases, enforces the code of conduct), release manager, security response lead, an optional steward, locale reviewer and contributor (https://github.com/ScriptKittyOS/kotiko/blob/main/GOVERNANCE.md#roles). MAINTAINERS.md says who holds which role today: the lead maintainer, Ayla Croft (@HackTuah), holds the lead, release manager and security response roles, and @minitru is a maintainer; the maintainers are exactly the repository's collaborators with the Maintain role, and .github/CODEOWNERS names them (https://github.com/ScriptKittyOS/kotiko/blob/main/MAINTAINERS.md). | `GOVERNANCE.md` "Roles"; `MAINTAINERS.md`; `.github/CODEOWNERS`; `gh api repos/ScriptKittyOS/kotiko/collaborators` | – | | `access_continuity` | MUST [URL] | Met | GOVERNANCE.md has a Continuity section: if any one maintainer becomes unavailable the other holds the access to triage and close issues, review and merge pull requests, and publish a release (a release tag signed with their own key); nothing in the ordinary workflow requires a specific individual. Kotiko has two maintainers, both repository collaborators, and the organization enforces two-factor authentication for everyone with access. The exceptions (organization administration, the domains, the security mailbox, the store publisher accounts) are named, and the continuity plan lists how each is handed over. https://github.com/ScriptKittyOS/kotiko/blob/main/GOVERNANCE.md#continuity | `GOVERNANCE.md` "Continuity"; `MAINTAINERS.md` (two active maintainers); `docs/governance/continuity.md`; `gh api repos/ScriptKittyOS/kotiko/collaborators`: HackTuah admin, minitru maintain; `gh api orgs/ScriptKittyOS`: two_factor_requirement_enabled true | – | -| `bus_factor` | SHOULD [URL] | Unmet | Kotiko has two maintainers since 2026-10-06, but every commit so far was written by the lead maintainer, so the bus factor is still 1 in practice. We are working on it: the architecture, the assurance case and the coding standards are written down, every planned piece of work in slices/ is a buildable spec, and GOVERNANCE.md says how the maintainers continue without any one of them. https://github.com/ScriptKittyOS/kotiko/blob/main/docs/governance/continuity.md#bus-factor | `git shortlog -sne HEAD`: one author; `MAINTAINERS.md`; `GOVERNANCE.md` "Continuity" | The second maintainer contributing code and reviews regularly | +| `bus_factor` | SHOULD [URL] | Unmet | Kotiko has two maintainers since 2026-10-06. The second has since written and merged dependency and test work (12 commits by 2026-12-05, against 221 from the lead maintainer's account), but most of the code still comes from one account, so the bus factor is still 1 in practice. We are working on it: the architecture, the assurance case and the coding standards are written down, every planned piece of work in slices/ is a buildable spec, and GOVERNANCE.md says how the maintainers continue without any one of them. https://github.com/ScriptKittyOS/kotiko/blob/main/docs/governance/continuity.md#bus-factor | `git log --since=2025-12-05 --no-merges --format=%an origin/main | sort | uniq -c` (2026-12-05): Ayla Croft 221, minitru 12, bots 15; `MAINTAINERS.md`; `GOVERNANCE.md` "Continuity" | The second maintainer contributing code and reviews regularly | | `documentation_roadmap` | MUST [URL] | Met | ROADMAP.md covers the year through October 2027: what comes now (the first public release, in four phases), in the six months after it, and later, plus what Kotiko will not do (no paid tier or hosted accounts, no bundled word packs, no telemetry, no bundler in the extension). The lead maintainer reviews it every quarter and at each minor release. https://github.com/ScriptKittyOS/kotiko/blob/main/ROADMAP.md | `ROADMAP.md:3,9-90` | – | | `documentation_architecture` | MUST [URL] [N/A J] | Met | docs/ARCHITECTURE.md describes the code on main: the two parts (the browser extension and the optional Elixir server) and their components, the shared spec, where data is kept, the main flows, trust boundaries and external dependencies. https://github.com/ScriptKittyOS/kotiko/blob/main/docs/ARCHITECTURE.md | `docs/ARCHITECTURE.md:1-8` and sections at lines 10, 55, 167, 204, 231, 246, 284 | – | | `documentation_security` | MUST [URL] | Met | docs/security/requirements.md says what users can and cannot expect from Kotiko's security, for the server, the extension and both, and lists what is planned but not yet true. https://github.com/ScriptKittyOS/kotiko/blob/main/docs/security/requirements.md | `docs/security/requirements.md:13,72,93` | – | @@ -236,12 +236,12 @@ earned, and gold once silver is; the answers can be entered before that. | `crypto_weaknesses` | MUST [J] | Met | No default security mechanism depends on a weak algorithm or mode: there is no SHA-1, MD4, MD5, RC4, DES, ECB or disabled certificate check in Kotiko's code. SHA-256 is used where a hash is needed (lookup cache keys, the PKCE challenge), and TLS is left to Erlang/OTP and the browser. | `grep -rniE` for verify_none, sha1, sha-1, md5, rc4, :des, ecb, insecure, rejectUnauthorized over `server/lib server/config extension` (*.ex, *.exs, *.js): no match (2026-10-06); `server/lib/kotiko/llm/cache.ex:26,47`; `extension/lib/pkce.js:36` | – | | `crypto_algorithm_agility` | SHOULD [J] | Met | Kotiko fixes no cipher itself: TLS versions and cipher suites are negotiated by Erlang/OTP and the browser, which support several (AES-GCM, ChaCha20-Poly1305) and change with their updates. The only algorithm Kotiko names is SHA-256, for internal cache keys and for the PKCE S256 method that the OAuth standard defines. | `grep -rn` for versions:, :tlsv, ssl: in `server/lib server/config`: no match; `server/lib/kotiko/llm/cache.ex:26,47`; `extension/lib/pkce.js:36` | – | | `crypto_credential_agility` | MUST [J] | Met | Credentials are kept apart from the code and the other settings, and each can be replaced without changing either: every server secret (API_TOKEN, LLM_API_KEY, TELEGRAM_BOT_TOKEN, TRANSCRIBE_API_KEY) can be given as NAME_FILE=/path, the Docker secrets and systemd credentials convention, so a key is replaced by replacing a file and restarting. The API token can also be rotated with mix kotiko.token --rotate. Documented at https://github.com/ScriptKittyOS/kotiko/blob/main/docs/reference/configuration.md | `server/lib/kotiko/config.ex` `read_secret_files/2`; `server/test/kotiko/config_test.exs`; `docs/reference/configuration.md` "Secrets in files" | – | -| `crypto_used_network` | SHOULD [J] | Met | Kotiko's own outbound traffic uses HTTPS by default: model providers, OpenRouter, Telegram and Wiktionary. The server listens on 127.0.0.1 by default, so its plain-HTTP API doesn't leave the computer unless the owner sets BIND to another address; then the server logs a warning at start (daily for a public address), and the extension warns under the address field when the token would cross a network unencrypted. A plain-HTTP model endpoint (such as a local Ollama) is used only when the user enters one. | `server/lib/kotiko/config.ex:19`; `docs/security/assurance-case.md:29`; `extension/lib/url.js:85-99`; `docs/reference/configuration.md` (LLM_URL default `https://openrouter.ai/api/v1`) | – | +| `crypto_used_network` | SHOULD [J] | Met | Kotiko's own outbound traffic uses HTTPS by default: model providers, OpenRouter, Telegram and Wiktionary. The server listens on 127.0.0.1 by default, so its plain-HTTP API doesn't leave the computer unless the owner sets BIND to another address; then the server logs a warning at start (daily for a public address), and the extension warns under the address field when words would cross a network unencrypted (the token never does: requests are signed with it). A plain-HTTP model endpoint (such as a local Ollama) is used only when the user enters one. | `server/lib/kotiko/config.ex:19`; `docs/security/assurance-case.md:29`; `extension/lib/url.js:98-112`; `docs/reference/configuration.md` (LLM_URL default `https://openrouter.ai/api/v1`) | – | | `crypto_tls12` | SHOULD [J] | Met | TLS comes from Erlang/OTP (26 and newer, which offer TLS 1.2 and 1.3 by default) for the server's outbound requests and from the browser for the extension. Kotiko never sets or lowers the TLS version. | `.github/workflows/ci.yml:46-47` (OTP 26.2 and 28.1); `grep -rn` for versions:, :tlsv, ssl: in `server/lib server/config`: no match | – | | `crypto_certificate_verification` | MUST [J] | Met | The server makes HTTPS requests with Req (Mint over Erlang/OTP ssl), which verifies the certificate chain and host name by default; Kotiko's code sets no verify option anywhere. The extension's requests go through the browser, which always verifies certificates. | `grep -rniE` for verify_none and rejectUnauthorized over `server/lib server/config extension`: no match; `server/lib/kotiko/llm/client.ex:41` (only a connect timeout is set) | – | | `crypto_verification_private` | MUST [J] | Met | Certificate verification happens in the TLS handshake, before any HTTP request is sent, so the Authorization header and API keys are sent only after the certificate is verified. Kotiko uses no cookies. | As for crypto_certificate_verification; `docs/security/assurance-case.md:131` (token in a header, never a cookie) | – | -| `signed_releases` | MUST [J] [N/A J] | N/A | No release has been published yet, so there is nothing to sign today. The pipeline for the first one (v1.0.0) is in place and signs everything it publishes: the release manager signs the tag with their own SSH or GPG key; the workflow refuses a tag not signed by a key listed in .github/allowed_signers on main, builds the zips reproducibly, and publishes them with SHA256SUMS, a CycloneDX SBOM and Sigstore build-provenance attestations (keyless, so no signing key is stored on GitHub). How users verify: https://github.com/ScriptKittyOS/kotiko/blob/main/docs/verify.md | `.github/workflows/release.yml:2-17,50-75,140-165`; `.github/allowed_signers:13-14` (no key yet); `git tag -l` empty; `gh release list` empty; `docs/verify.md:11-52` | Answer Met with the first release (v1.0.0) | -| `version_tags_signed` | SUGGESTED [J] | Unmet | No version tag exists yet. From v1.0.0 on, every release tag is signed by the release manager and verified by the release workflow against .github/allowed_signers before anything is built. | `git tag -l` empty; `.github/workflows/release.yml:50-75` | Maintainer: as for signed_releases | +| `signed_releases` | MUST [J] [N/A J] | Met | Every release is signed: the release manager signs the tag with their own SSH key, listed in .github/allowed_signers; the workflow refuses a tag not signed by a key listed there on main, builds the zips reproducibly, and publishes them with SHA256SUMS, a CycloneDX SBOM and Sigstore build-provenance attestations (keyless, so no signing key is stored on GitHub). v1.0.0 and v1.0.1 were published this way. How users verify: https://github.com/ScriptKittyOS/kotiko/blob/main/docs/verify.md | `.github/workflows/release.yml:2-17,50-75,140-165`; `.github/allowed_signers:14-15`; `git -c gpg.ssh.allowedSignersFile=.github/allowed_signers verify-tag v1.0.1`: Good "git" signature (2026-12-05); `gh release view v1.0.1`: both zips, the SBOM and SHA256SUMS; `gh api repos/ScriptKittyOS/kotiko/attestations/sha256:`: one attestation; `docs/verify.md:11-52` | – | +| `version_tags_signed` | SUGGESTED [J] | Met | Every release tag (v1.0.0, v1.0.1 and the release candidates) is signed by the release manager and verified by the release workflow against .github/allowed_signers before anything is built. | `git -c gpg.ssh.allowedSignersFile=.github/allowed_signers verify-tag v1.0.0` and `v1.0.1`: Good "git" signature (2026-12-05); `.github/workflows/release.yml:50-75` | – | | `input_validation` | MUST [J] [N/A J] | Met | Every input from an untrusted source is checked against what is allowed, and refused otherwise: HTTP requests (Host allowlist, exactly one Bearer token, JSON only within size caps, then per-field rules such as text length, canonical language tags, UUID request ids, statuses from a fixed list and limits in range); model answers (the shared word spec: required fields, canonical tags, a script check, length and count caps); server answers in the extension; backup files (format, version, every word re-checked); the server address the user types; and every setting at start. The full table: https://github.com/ScriptKittyOS/kotiko/blob/main/docs/security/assurance-case.md#6-inputs-and-how-each-is-validated | `docs/security/assurance-case.md:141-157`; `server/lib/kotiko/router.ex:20-21`; `extension/lib/backup.js:22-29,88-178`; `extension/lib/url.js:52-82` | – | | `hardening` | SHOULD [J] [N/A J] | Met | Extension pages run under an explicit content security policy (script-src 'self'; object-src 'self') with no inline scripts, and ESLint forbids HTML string sinks (innerHTML, outerHTML, insertAdjacentHTML) so a bug can't turn word data into markup. The server checks the Host header against an allowlist before anything else (against DNS rebinding), caps request bodies, sends no CORS headers, marks answers no-store, binds to loopback by default, compares tokens in constant time, and filters secrets out of logs. Planned: X-Content-Type-Options and similar headers on server responses, and a sandboxed systemd unit. Evidence: https://github.com/ScriptKittyOS/kotiko/blob/main/extension/manifest.json and https://github.com/ScriptKittyOS/kotiko/blob/main/docs/security/assurance-case.md | `extension/manifest.json:46`; `eslint.config.js:10-13,45-49`; `server/lib/kotiko/router.ex:11,20-21,33,214`; `docs/security/assurance-case.md:30,34` | – | | `assurance_case` | MUST [URL] | Met | docs/security/assurance-case.md: the top claim and its sub-claims mapped to arguments and evidence, the threat model (assets, attackers and what each can reach), the trust boundaries (diagram and table), how each secure design principle is applied, the CWE Top 25 and OWASP Top 10 weaknesses that apply and how each is countered, every input and how it is validated, and the residual risks. https://github.com/ScriptKittyOS/kotiko/blob/main/docs/security/assurance-case.md | `docs/security/assurance-case.md:14-41` (claims), `43-66` (threat model), `68-100` (trust boundaries), `102-117` (principles), `119-139` (weaknesses), `141-157` (inputs), `159-183` (residual risks) | Agent: fix the stale lines listed under documentation_current | @@ -258,7 +258,7 @@ earned, and gold once silver is; the answers can be entered before that. | Criterion | Level | Status | Answer | Evidence | Needs | |---|---|---|---|---|---| | `achieve_silver` | MUST | Met | Kotiko earned the silver badge on 2026-10-06: https://www.bestpractices.dev/projects/15259 | bestpractices.dev entry 15259 (silver 100 %) | – | -| `bus_factor` | MUST [URL] | Unmet | Kotiko has two maintainers since 2026-10-06, but every commit so far was written by the lead maintainer, so the bus factor is still 1 in practice. We are working on it: the architecture, the assurance case and the coding standards are written down, every planned piece of work in slices/ is a buildable spec, and GOVERNANCE.md says how the maintainers continue without any one of them. https://github.com/ScriptKittyOS/kotiko/blob/main/docs/governance/continuity.md#bus-factor | `git shortlog -sne HEAD`: one author; `MAINTAINERS.md`; `GOVERNANCE.md` "Continuity" | The second maintainer contributing code and reviews regularly | +| `bus_factor` | MUST [URL] | Unmet | Kotiko has two maintainers since 2026-10-06. The second has since written and merged dependency and test work (12 commits by 2026-12-05, against 221 from the lead maintainer's account), but most of the code still comes from one account, so the bus factor is still 1 in practice. We are working on it: the architecture, the assurance case and the coding standards are written down, every planned piece of work in slices/ is a buildable spec, and GOVERNANCE.md says how the maintainers continue without any one of them. https://github.com/ScriptKittyOS/kotiko/blob/main/docs/governance/continuity.md#bus-factor | `git log --since=2025-12-05 --no-merges --format=%an origin/main | sort | uniq -c` (2026-12-05): Ayla Croft 221, minitru 12, bots 15; `MAINTAINERS.md`; `GOVERNANCE.md` "Continuity" | The second maintainer contributing code and reviews regularly | | `contributors_unassociated` | MUST [URL] | Unmet | Not yet. All significant contributions in the past year come from one person. Issues, Discussions and translations are open to everyone, and small tasks will be labelled for newcomers. | `git shortlog -sne HEAD`: 134 commits, one person; `gh api repos/ScriptKittyOS/kotiko/contributors` gives HackTuah only | Maintainer: recruit; two unassociated significant contributors in a year | | `copyright_per_file` | MUST [J] | Met | Every source code file (Elixir, JavaScript, shell, CSS, HTML, Astro, workflow YAML) starts with SPDX-FileCopyrightText: 2026 ScriptKittyOS and the Kotiko contributors. Files that can't carry a comment (JSON, images), plus Markdown, test fixture pages and two formatter configs, get the same statement through REUSE.toml, following the REUSE specification, and reuse lint runs on every pull request as a required check. | Header check over 352 tracked code files (`git ls-files` *.ex *.exs *.js *.mjs *.sh *.css *.html *.astro *.ts *.mdx): all carry SPDX headers except `server/.formatter.exs`, `server/priv/repo/migrations/.formatter.exs`, `site/src/content/docs/index.mdx` and 24 `test/fixtures/pages/*.html`, all covered by `REUSE.toml:4`; `.github/workflows/ci.yml:141` (`pipx run reuse lint`, required check "versions and licenses") | Agent (optional): put in-file headers on the three non-fixture files too | | `license_per_file` | MUST [J] | Met | Every source code file carries an SPDX license identifier comment for Apache-2.0 near the top (another SPDX identifier where third-party data says so). Files that can't carry a comment (JSON, images), plus Markdown, test fixture pages and two formatter configs, get it through REUSE.toml, and reuse lint runs on every pull request as a required check. | As for copyright_per_file; `pipx run reuse lint` locally: every file has copyright and license information; its only complaint was invalid expressions inside `server/cover/*.html`, a coverage report that was untracked at the time (not in git, since removed) | As for copyright_per_file | @@ -268,7 +268,7 @@ earned, and gold once silver is; the answers can be entered before that. | Criterion | Level | Status | Answer | Evidence | Needs | |---|---|---|---|---|---| | `repo_distributed` | MUST [J] | Met | git, hosted on GitHub: https://github.com/ScriptKittyOS/kotiko | `.git`; `gh repo view ScriptKittyOS/kotiko` | – | -| `small_tasks` | MUST [URL] | Unmet | Not yet. The good first issue and help wanted labels exist, but no issue carries them yet. Small tasks will be filed with those labels and linked from CONTRIBUTING.md. | `gh label list` (good first issue, help wanted present); `gh issue list --state all` empty | Maintainer: file a few labelled issues (an agent can draft them). Agent: link the label search from CONTRIBUTING.md. Then answer Met with https://github.com/ScriptKittyOS/kotiko/labels/good%20first%20issue | +| `small_tasks` | MUST [URL] | Met | Small tasks for newcomers carry the good first issue label (help wanted where outside help matters most), and CONTRIBUTING.md points new contributors to them. The first three, filed 2026-12-05: SPDX headers for the last three files that rely on REUSE.toml (#79), the Anki note-type name in more Anki languages (#80) and the missing Spanish strings (#81). https://github.com/ScriptKittyOS/kotiko/labels/good%20first%20issue | `gh issue list --label "good first issue"`: #79, #80, #81; `CONTRIBUTING.md` "New here?" | Keep a few open: file a new one when one is taken | | `require_2FA` | MUST [J] | Met | The ScriptKittyOS GitHub organization requires two-factor authentication for every member, so nobody can push to the repository, change its settings or read private vulnerability reports without it. GOVERNANCE.md requires it for store accounts too. | `gh api orgs/ScriptKittyOS` gives `two_factor_requirement_enabled: true`; `gh api repos/ScriptKittyOS/kotiko/collaborators`: HackTuah (admin) only; `GOVERNANCE.md:51-54` | – | | `secure_2FA` | SHOULD [J] | Met | GOVERNANCE.md requires maintainers (and a steward, if one is named) to protect their GitHub and store accounts with a passkey, a security key or an authenticator app, not SMS. | `GOVERNANCE.md:51-54` | Maintainer confirms their own GitHub 2FA is a passkey, key or TOTP app, not SMS (not visible to the agent) | @@ -277,7 +277,7 @@ earned, and gold once silver is; the answers can be entered before that. | Criterion | Level | Status | Answer | Evidence | Needs | |---|---|---|---|---|---| | `code_review_standards` | MUST [URL] [N/A J] | Met | docs/CODE_REVIEW.md documents how code review is done and what is required: CI's required checks pass first; a reviewer who isn't the author reads the whole diff and approves or requests changes line by line; every review thread is resolved before merging; and a checklist of what must be true (does what it says and matches its spec, tested with a regression test for each fix, trust boundaries and input validation hold, no HTML from data, privacy inventory updated, dependencies within the license and dependency policy, no English or single-language assumption, accessibility and size budgets, docs and changelog, DCO sign-off), plus the standard of evidence for any claim. CONTRIBUTING.md links it. https://github.com/ScriptKittyOS/kotiko/blob/main/docs/CODE_REVIEW.md | `docs/CODE_REVIEW.md`; `CONTRIBUTING.md` "Commits and pull requests"; ruleset 24531669 (`required_review_thread_resolution: true`) | – | -| `two_person_review` | MUST [J] | Unmet | Not yet. Kotiko has a second maintainer since 2026-10-06, but the merged pull requests so far were checked by their author and CI only. The next steps are reviews by the second maintainer, then an approving review required on main for every change. | `gh pr list --state all --json reviews`; ruleset 24531669 `required_approving_review_count: 0` | Maintainers: review each other's pull requests, then set the main ruleset to 1 required approval | +| `two_person_review` | MUST [J] | Unmet | Not yet. Kotiko has a second maintainer since 2026-10-06, who now merges dependency updates, but most merged pull requests (41 of 59 by 2026-12-05) were opened and merged by the same account, with CI as the only check. The next steps are reviews by the second maintainer, then an approving review required on main for every change. | `gh pr list --state all --json reviews`; ruleset 24531669 `required_approving_review_count: 0` | Maintainers: review each other's pull requests, then set the main ruleset to 1 required approval | | `build_reproducible` | MUST [URL] [N/A J] | Met | The extension zips, the only built release files, are reproducible by anyone: the build uses entries sorted by path, the commit's timestamp, fixed permissions and a pinned pure-JavaScript deflate, so the bytes don't depend on the machine or time zone. The release workflow builds twice and compares, and docs/reproducible-builds.md shows how to rebuild a release from its tag and check it against the published SHA256SUMS. The server is released as source. https://github.com/ScriptKittyOS/kotiko/blob/main/docs/reproducible-builds.md | `docs/reproducible-builds.md:1-57`; `.github/workflows/release.yml:111-118`; two local builds on 2026-10-06 gave identical SHA-256 | Once v1.0.0 exists, have someone outside the project rebuild it and compare (slice 53 section 7.5) | | `test_invocation` | MUST [URL] | Met | npm test (Node's built-in test runner) for the extension and mix test for the server, the standard commands of each ecosystem; npm run e2e runs the Playwright end-to-end tests. https://github.com/ScriptKittyOS/kotiko/blob/main/CONTRIBUTING.md#setup | `package.json:10-11`; `CONTRIBUTING.md:19-30` | – | | `test_continuous_integration` | MUST [URL] | Met | Every change reaches main through a short-lived pull request, and GitHub Actions runs every test suite, the linters and the audits on each pull request and each push to main; main requires 8 checks to pass. https://github.com/ScriptKittyOS/kotiko/actions/workflows/ci.yml | `.github/workflows/ci.yml:5-8`; ruleset 24531669; `gh run list --workflow ci.yml` | – | @@ -288,10 +288,10 @@ earned, and gold once silver is; the answers can be entered before that. | Criterion | Level | Status | Answer | Evidence | Needs | |---|---|---|---|---|---| -| `crypto_used_network` | MUST [J] | Met | Kotiko's own outbound traffic uses HTTPS by default: model providers, OpenRouter, Telegram and Wiktionary. The server listens on 127.0.0.1 by default, so its plain-HTTP API doesn't leave the computer unless the owner sets BIND to another address; then the server logs a warning at start (daily for a public address), and the extension warns under the address field when the token would cross a network unencrypted. A plain-HTTP model endpoint (such as a local Ollama) is used only when the user enters one. | `server/lib/kotiko/config.ex:19`; `docs/security/assurance-case.md:29`; `extension/lib/url.js:85-99`; `docs/reference/configuration.md` (LLM_URL default `https://openrouter.ai/api/v1`) | – | +| `crypto_used_network` | MUST [J] | Met | Kotiko's own outbound traffic uses HTTPS by default: model providers, OpenRouter, Telegram and Wiktionary. The server listens on 127.0.0.1 by default, so its plain-HTTP API doesn't leave the computer unless the owner sets BIND to another address; then the server logs a warning at start (daily for a public address), and the extension warns under the address field when words would cross a network unencrypted (the token never does: requests are signed with it). A plain-HTTP model endpoint (such as a local Ollama) is used only when the user enters one. | `server/lib/kotiko/config.ex:19`; `docs/security/assurance-case.md:29`; `extension/lib/url.js:98-112`; `docs/reference/configuration.md` (LLM_URL default `https://openrouter.ai/api/v1`) | – | | `crypto_tls12` | MUST [J] | Met | TLS comes from Erlang/OTP (26 and newer, which offer TLS 1.2 and 1.3 by default) for the server's outbound requests and from the browser for the extension. Kotiko never sets or lowers the TLS version. | `.github/workflows/ci.yml:46-47` (OTP 26.2 and 28.1); `grep -rn` for versions:, :tlsv, ssl: in `server/lib server/config`: no match | – | | `hardened_site` | MUST [URL] | Met | The project website https://kotiko.org/ is served through Cloudflare with HTTP Strict Transport Security (max-age one year), a Content Security Policy (only the site's own files; a stricter one on /connect/; frame-ancestors 'none'), X-Frame-Options: DENY, X-Content-Type-Options: nosniff and Referrer-Policy: no-referrer, over TLS 1.2 or later with Full (strict) TLS to the origin, and it loads nothing from other hosts. The repository and its release downloads are served by GitHub with the same kinds of headers. | `curl -sI https://kotiko.org/` and `/privacy/`, `/connect/` (2026-10-07): strict-transport-security max-age=31536000, content-security-policy, x-frame-options: DENY, x-content-type-options: nosniff, referrer-policy: no-referrer; a Chromium load of 6 pages plus a search makes no request to another host (security review C-10, reviewers E and F); `slices/44-docs-site/SPEC.md:447-451` | – | -| `security_review` | MUST [J] | Unmet | Not yet as gold requires. A line-by-line adversarial review with probes of the extension and the server (2026-10-01, docs/research/06-adversarial-qa.md) found and fixed an authentication bypass and other issues, but it predates the written security requirements. A pre-release review by three independent reviewers against the security requirements and trust boundaries is planned before the first store release; its report will be published in docs/security. | `docs/research/06-adversarial-qa.md:1-20`; `scripts/check-security-gate.mjs:5-15` (expects `docs/security/review-.md` with a closed gate); `ls docs/security` (no review report) | Slice 54 review (maintainer runs it; report in `docs/security/review-v1.0.0.md`) | +| `security_review` | MUST [J] | Met | A security review of v1.0.0 was performed from 2026-10-06 to 2026-10-07 (slice 54) and is published: https://github.com/ScriptKittyOS/kotiko/blob/main/docs/security/review-v1.0.0.md . Three reviewers attacked v1.0.0-rc.1 independently from three starting points (a hostile web page or model answer; a network neighbour, another local account or a Telegram stranger; the supply chain and the release), each covering all nine threat areas and reading the code against the written security requirements (docs/security/requirements.md) and the trust boundaries of the assurance case (docs/security/assurance-case.md). Three more reviewers confirmed the fixes, with bypass attempts, on rc.2 to rc.4. Every claim needed a proof that the lead reran. Every medium finding was fixed with a regression test; the low and informational ones are fixed or accepted risks with an issue. The gate closed on rc.4, before the release. The reviewers and the lead were AI agents (Claude), each in a fresh context and its own checkout of the tag; the maintainer is the final reader, as the report says. | `docs/security/review-v1.0.0.md:1-60` (scope, candidates, reviewers, `Gate: closed 2026-10-07`); its findings tables and the reviewers' reports in its appendix; `scripts/check-security-gate.mjs` (the release's store jobs refuse a release without a closed review) | Next review within five years, or before a major change to a trust boundary | | `hardening` | MUST [URL] [N/A J] | Met | Extension pages run under an explicit content security policy (script-src 'self'; object-src 'self') with no inline scripts, and ESLint forbids HTML string sinks (innerHTML, outerHTML, insertAdjacentHTML) so a bug can't turn word data into markup. The server checks the Host header against an allowlist before anything else (against DNS rebinding), caps request bodies, sends no CORS headers, marks answers no-store, binds to loopback by default, compares tokens in constant time, and filters secrets out of logs. Planned: X-Content-Type-Options and similar headers on server responses, and a sandboxed systemd unit. Evidence: https://github.com/ScriptKittyOS/kotiko/blob/main/extension/manifest.json and https://github.com/ScriptKittyOS/kotiko/blob/main/docs/security/assurance-case.md | `extension/manifest.json:46`; `eslint.config.js:10-13,45-49`; `server/lib/kotiko/router.ex:11,20-21,33,214`; `docs/security/assurance-case.md:30,34` | – | ## Gold: Analysis @@ -307,7 +307,7 @@ The OpenSSF Baseline controls (OSPS Baseline 2026-08-28: 24 at level 1, 19 at le level 3), checked on 2026-10-06 against `main` at 320c948 and the repository's live settings (read-only GitHub API calls). Every control is a MUST; N/A needs a justification. -No public release exists yet (git tag is empty; gh release list is empty). The CHANGELOG's 0.1.0 and 0.2.0 were private versions of the personal tool, never tagged or distributed; the first public release is v1.0.0. Release controls are marked Met only where the release workflow mechanically enforces them (a release cannot be produced without the property), and N/A where the property depends on future work. +The first public release, v1.0.0, and v1.0.1 came out on 2026-10-08, after the release candidates v1.0.0-rc.1 to rc.4 (git tag; gh release list). The CHANGELOG's 0.1.0 and 0.2.0 were private versions of the personal tool, never tagged or distributed. Release controls are marked Met only where the release workflow mechanically enforces them (a release cannot be produced without the property), and N/A where the property depends on future work. ## Baseline 1: General @@ -329,7 +329,7 @@ No public release exists yet (git tag is empty; gh release list is empty). The C | `osps_le_02_01` | MUST [N/A J] | Met | The source code is licensed under Apache-2.0, an OSI-approved license (a few generated data files are additionally under MIT or Unicode-3.0, both OSI-approved). https://github.com/ScriptKittyOS/kotiko/blob/main/LICENSE | LICENSE; gh repo view licenseInfo apache-2.0; REUSE.toml:1-30; CI job "versions and licenses" runs reuse lint (ci.yml:141) | – | | `osps_le_02_02` | MUST [N/A J] | Met | The released extension zips are built from the Apache-2.0 code in extension/ and carry LICENSE, NOTICE and LICENSES/; the server is released as Apache-2.0 source. The only exception is the Kotiko name, logo and icon artwork, which are trademarks (LICENSES/LicenseRef-KotikoBrand.txt), not software. | scripts/build-extension.mjs:34-35, 206-209; docs/verify.md:61-68; REUSE.toml (brand and extension/*.png annotation) | Judgment call: a strict reader may object that the icons in the zips are not under a free license | | `osps_le_03_01` | MUST [N/A J] | Met | The license is in the LICENSE file at the repository root, with every license used in LICENSES/ and per-file terms in REUSE.toml. https://github.com/ScriptKittyOS/kotiko/blob/main/LICENSE | LICENSE; LICENSES/ (Apache-2.0.txt, MIT.txt, Unicode-3.0.txt, LicenseRef-KotikoBrand.txt) | – | -| `osps_le_03_02` | MUST [N/A J] | Met | The release build copies LICENSE, NOTICE and the LICENSES/ directory into every extension zip, and the server is released as source that contains them. No release has been published yet; the build script does this for every release. | scripts/build-extension.mjs:34-35, 206-209; docs/verify.md:61-68 | – | +| `osps_le_03_02` | MUST [N/A J] | Met | The release build copies LICENSE, NOTICE and the LICENSES/ directory into every extension zip, and the server is released as source that contains them. The build script does this for every release, v1.0.0 and v1.0.1 included. | scripts/build-extension.mjs:34-35, 206-209; docs/verify.md:61-68 | – | | `osps_qa_01_01` | MUST [N/A J] | Met | The repository is public at a static URL: https://github.com/ScriptKittyOS/kotiko | gh repo view: visibility PUBLIC, isPrivate false | – | | `osps_qa_01_02` | MUST [N/A J] | Met | Git on GitHub keeps the full public history of every change with its author and date, and every change to main arrives through a public pull request. https://github.com/ScriptKittyOS/kotiko/commits/main | git rev-list --count HEAD: 134; git log --format with author and date; ruleset 24531669 (pull_request, non_fast_forward) | – | | `osps_qa_02_01` | MUST [N/A J] | Met | Direct dependencies are listed in server/mix.exs (Hex, locked in server/mix.lock), package.json (development tools, locked in package-lock.json) and site/package.json (docs site, locked in site/package-lock.json). The extension has no npm runtime dependencies. | server/mix.exs:32-45; package.json:15; site/package.json; CONTRIBUTING.md:42-43 | – | @@ -343,10 +343,10 @@ No public release exists yet (git tag is empty; gh release list is empty). The C | Criterion | Level | Status | Answer | Evidence | Needs | |---|---|---|---|---|---| | `osps_ac_04_01` | MUST [N/A J] | Met | The repository's and organization's default GITHUB_TOKEN permission is read-only, and every workflow also declares top-level permissions (contents: read, or none). | gh api repos/ScriptKittyOS/kotiko/actions/permissions/workflow: default_workflow_permissions "read"; same for orgs/ScriptKittyOS; ci.yml:10-11; release.yml:26; store-status.yml:15; site.yml:46-47; eval.yml:25-26 | – | -| `osps_br_02_01` | MUST [N/A J] | Met | Every release gets a unique Semantic Versioning identifier (vX.Y.Z, or vX.Y.Z-rc.N for candidates). The release workflow refuses a tag that is not in that form, not signed by a listed maintainer key, not on main, or whose version differs from the extension manifest, server/mix.exs and the release manifest; only the maintainers can push tags, and a tag ruleset makes every tag permanent (no moving or deleting). No release has been published yet; the first is v1.0.0. | scripts/verify-tag.sh:5-16, 48-80; .github/workflows/release.yml:50-75; scripts/check-versions.mjs; ruleset 24531685 "tags are permanent" (update, deletion and force push blocked, no bypass) | – | +| `osps_br_02_01` | MUST [N/A J] | Met | Every release gets a unique Semantic Versioning identifier (vX.Y.Z, or vX.Y.Z-rc.N for candidates). The release workflow refuses a tag that is not in that form, not signed by a listed maintainer key, not on main, or whose version differs from the extension manifest, server/mix.exs and the release manifest; only the maintainers can push tags, and a tag ruleset makes every tag permanent (no moving or deleting). Releases so far: v1.0.0 and v1.0.1, after the candidates v1.0.0-rc.1 to rc.4. | scripts/verify-tag.sh:5-16, 48-80; .github/workflows/release.yml:50-75; scripts/check-versions.mjs; ruleset 24531685 "tags are permanent" (update, deletion and force push blocked; organization admins can bypass it, gh api 2026-12-05) | – | | `osps_br_04_01` | MUST [N/A J] | Met | Each release's notes are its CHANGELOG.md section, written for users, plus install and verification steps; the release job fails if the version has no CHANGELOG section, and tagging is refused while entries remain under Unreleased. Security fixes are listed in a Security part of the notes with advisory, CVE, severity and credit. https://github.com/ScriptKittyOS/kotiko/blob/main/CHANGELOG.md | scripts/release-notes.mjs:52-75, 116-129; release.yml:185-200; SECURITY.md:37-38; docs/stores.md:185-197 (checklist); CHANGELOG.md:209-215 | – | | `osps_br_05_01` | MUST [N/A J] | Met | Builds take dependencies only through each ecosystem's standard tools with committed lockfiles: mix deps.get with server/mix.lock, and npm ci with package-lock.json (npm ci --ignore-scripts in jobs that hold store credentials). GitHub Actions are pinned by commit SHA. | .github/workflows/release.yml:107, 125, 269, 331; ci.yml:66, 85; server/mix.lock; package-lock.json | – | -| `osps_br_06_01` | MUST [N/A J] | Met | Each release carries SHA256SUMS listing the SHA-256 of every file, and every file including SHA256SUMS gets a Sigstore-signed SLSA build provenance attestation (actions/attest); the GitHub release is created only after attestation succeeds. Release tags must be signed by a maintainer key. No release has been published yet. | .github/workflows/release.yml:128-132, 140-165, 167-168; docs/verify.md:31-49 | The release manager's key must be added to .github/allowed_signers (empty today) before any release can be tagged (maintainer) | +| `osps_br_06_01` | MUST [N/A J] | Met | Each release carries SHA256SUMS listing the SHA-256 of every file, and every file including SHA256SUMS gets a Sigstore-signed SLSA build provenance attestation (actions/attest); the GitHub release is created only after attestation succeeds. Release tags must be signed by a maintainer key. v1.0.0 and v1.0.1 were published this way. | .github/workflows/release.yml:128-132, 140-165, 167-168; docs/verify.md:31-49 | The release manager's key must be added to .github/allowed_signers (empty today) before any release can be tagged (maintainer) | | `osps_do_06_01` | MUST [N/A J] | Met | docs/ARCHITECTURE.md section 6 lists the runtime services and libraries, how they are obtained (Hex and npm with committed lockfiles that pin exact versions; Actions pinned by SHA) and how they are tracked (weekly Dependabot updates for Mix, npm and Actions, mix hex.audit and mix deps.audit on every pull request, an SBOM with each release). Selection rule: the extension ships no npm runtime code and the server keeps a small set of libraries. https://github.com/ScriptKittyOS/kotiko/blob/main/docs/ARCHITECTURE.md#6-external-dependencies | docs/ARCHITECTURE.md:246-282; CONTRIBUTING.md:42-43; .github/dependabot.yml | Selection criteria are thin and section 6 still calls the SBOM "planned": add a short "choosing a dependency" paragraph and fix the SBOM line (agent) | | `osps_do_07_01` | MUST [N/A J] | Met | CONTRIBUTING.md "Setup" lists the requirements (Elixir 1.15 or newer, Node 22) and the build and test commands for the server and extension; the developer setup page covers the docs site; docs/reproducible-builds.md shows how to build the release zips. https://github.com/ScriptKittyOS/kotiko/blob/main/CONTRIBUTING.md#setup | CONTRIBUTING.md:15-36; site/src/content/docs/contribute/setup.md; docs/reproducible-builds.md:7-27 | – | | `osps_gv_01_01` | MUST [N/A J] | Met | MAINTAINERS.md lists everyone with access to sensitive resources (admin on the repository, merge and release rights, the release environment and organization ownership): the lead maintainer, Ayla Croft (@HackTuah), and the maintainer @minitru, and states that the maintainers are exactly the repository's collaborators with the Maintain role (the lead maintainer is admin). https://github.com/ScriptKittyOS/kotiko/blob/main/MAINTAINERS.md | `MAINTAINERS.md`; `gh api repos/ScriptKittyOS/kotiko/collaborators`: HackTuah admin, minitru maintain; `gh api 'orgs/ScriptKittyOS/members?role=admin'`: HackTuah only | – | @@ -368,20 +368,20 @@ No public release exists yet (git tag is empty; gh release list is empty). The C |---|---|---|---|---|---| | `osps_ac_04_02` | MUST [N/A J] | Met | Every workflow sets top-level permissions to contents: read or none, and each job asks only for what it needs: release-please writes the release branch and pull request, attest gets id-token and attestations write, the GitHub release job writes contents, the store-status job writes contents to edit release notes, Pages deploy gets pages and id-token; all other jobs read only. | .github/workflows/release.yml:26, 36-39, 53-54, 81-82, 144-147, 170-173, 224-225, 237-238, 303-304; ci.yml:10-11; site.yml:46-47, 60-61, 104-106; store-status.yml:15, 25-26, 55-56; eval.yml:25-26 | – | | `osps_br_01_04` | MUST [N/A J] | Met | The only workflow with collaborator inputs is the manual evaluation run: its inputs are passed as environment variables and quoted, never expanded into the script, and the script's parser rejects unknown options, converts the budget to a number, accepts only known case sets, and uses model names only as JSON values and, with slashes and colons replaced, as file names. The release and store-status manual runs take no inputs. | .github/workflows/eval.yml:9-43; spec/eval/run-eval.mjs:55-60, 310, 380-412; release.yml:24; store-status.yml:13 | Optional hardening: validate the three inputs against explicit patterns in the workflow (agent) | -| `osps_br_02_02` | MUST [N/A J] | Met | Every release file carries the version in its name (kotiko-chrome-X.Y.Z.zip, kotiko-firefox-X.Y.Z.zip, kotiko-server-X.Y.Z.cdx.json) and is attached to the release vX.Y.Z; SHA256SUMS and each file's attestation record the tag they were built from. No release has been published yet. | scripts/build-extension.mjs:9; .github/workflows/release.yml:115, 127, 160-163, 200; docs/verify.md:44-49 | – | +| `osps_br_02_02` | MUST [N/A J] | Met | Every release file carries the version in its name (kotiko-chrome-X.Y.Z.zip, kotiko-firefox-X.Y.Z.zip, kotiko-server-X.Y.Z.cdx.json) and is attached to the release vX.Y.Z; SHA256SUMS and each file's attestation record the tag they were built from; for example kotiko-chrome-1.0.1.zip on the release v1.0.1. | scripts/build-extension.mjs:9; .github/workflows/release.yml:115, 127, 160-163, 200; docs/verify.md:44-49 | – | | `osps_br_07_02` | MUST [N/A J] | Met | docs/stores.md "Secrets" is the policy: every credential belongs to the organization's accounts, not a person's; each is stored only as a GitHub environment secret (release, store-status, eval) with the narrowest scope available, release secrets reachable only from v* tags after maintainer approval; workflows never print them; rotation at least yearly and whenever someone with access leaves, by organization owners, with the steps. Secrets never go in the repository (CONTRIBUTING.md). https://github.com/ScriptKittyOS/kotiko/blob/main/docs/stores.md#secrets | docs/stores.md:96-106, 122-147; CONTRIBUTING.md:45-49 | The release, store-status and eval environments don't exist yet (gh api .../environments: total_count 0); create them as docs/stores.md says before the first release (maintainer) | | `osps_do_03_01` | MUST [N/A J] | Met | docs/verify.md explains how to check a release's integrity and authenticity: the commands (sha256sum -c SHA256SUMS, gh attestation verify for each file, git verify-tag) and the expected output for each; docs/reproducible-builds.md shows how to rebuild the zips byte for byte. https://github.com/ScriptKittyOS/kotiko/blob/main/docs/verify.md | docs/verify.md:1-59; docs/reproducible-builds.md:7-27 | – | | `osps_do_03_02` | MUST [N/A J] | Met | docs/verify.md gives the expected identities: the Sigstore attestation must come from the workflow ScriptKittyOS/kotiko/.github/workflows/release.yml at refs/tags/vX.Y.Z (gh attestation verify with signer-workflow and source-ref), and the tag must be signed by a release manager key listed in .github/allowed_signers and MAINTAINERS.md, cross-checked against the maintainer's GitHub profile keys. https://github.com/ScriptKittyOS/kotiko/blob/main/docs/verify.md | docs/verify.md:11-29, 44-49 | Before v1.0.0: put the release key in .github/allowed_signers (empty today) and its fingerprint in MAINTAINERS.md, whose line 16 still says tags are not signed (maintainer adds the key; agent fixes the wording) | -| `osps_do_04_01` | MUST [N/A J] | N/A | No release has been made yet; the first public release will be v1.0.0. SECURITY.md already states that only the latest minor release gets security fixes; a fuller support statement (what support each release gets and for how long) will be published before that release. | git tag: empty; gh release list: empty; docs/stores.md:10-15; SECURITY.md:3-5 | Add a Support section (scope: bug and security fixes on the latest minor; duration: until the next minor; extension and server compatibility window; where to get help) and drop "before 1.0" wording (agent) | +| `osps_do_04_01` | MUST [N/A J] | Unmet | Releases exist now (v1.0.0 and v1.0.1, 2026-10-08). SECURITY.md states that only the latest release gets security fixes, but the fuller support statement planned before the first release (what support each release gets and for how long) isn't published yet. | git tag and gh release list: v1.0.0-rc.1 to rc.4, v1.0.0, v1.0.1 (2026-12-05); docs/stores.md:8-17; SECURITY.md:3-5 | Add a Support section (scope: bug and security fixes on the latest minor; duration: until the next minor; extension and server compatibility window; where to get help) and drop "before 1.0" wording (agent) | | `osps_do_05_01` | MUST [N/A J] | Met | SECURITY.md "Supported versions": only the latest minor release gets security fixes, so a version stops receiving security updates as soon as a newer minor version is released. https://github.com/ScriptKittyOS/kotiko/blob/main/SECURITY.md#supported-versions | SECURITY.md:3-5; docs/security/requirements.md:69-70 | Update the sentence "Kotiko is before 1.0" at v1.0.0 (agent) | | `osps_gv_04_01` | MUST [N/A J] | Met | GOVERNANCE.md: escalated access (maintainer, which carries merge and release rights) is given after landing changes through the ordinary review process and reviewing someone else's pull request, on a maintainer's proposal (the second maintainer joined by the lead maintainer's invitation, which GOVERNANCE.md states); either way it is recorded by a reviewed pull request to MAINTAINERS.md, and the person is added as a repository collaborator with the Maintain role. Access is removed the day someone steps down or goes inactive. https://github.com/ScriptKittyOS/kotiko/blob/main/GOVERNANCE.md | `GOVERNANCE.md` "How decisions are made" 5 and 6; `MAINTAINERS.md` | – | -| `osps_qa_02_02` | MUST [N/A J] | Met | Every release includes a CycloneDX SBOM of the server's production dependencies (kotiko-server-X.Y.Z.cdx.json), generated at build time by the sbom Mix tool and attested with the other files. The extension zips are uncompiled first-party source with no third-party code. No release has been published yet. | .github/workflows/release.yml:119-127; server/mix.exs:44; docs/verify.md:61-68 | – | +| `osps_qa_02_02` | MUST [N/A J] | Met | Every release includes a CycloneDX SBOM of the server's production dependencies (kotiko-server-X.Y.Z.cdx.json), generated at build time by the sbom Mix tool and attested with the other files. The extension zips are uncompiled first-party source with no third-party code. v1.0.0 and v1.0.1 include it (kotiko-server-1.0.1.cdx.json). | .github/workflows/release.yml:119-127; server/mix.exs:44; docs/verify.md:61-68 | – | | `osps_qa_04_02` | MUST [N/A J] | N/A | Kotiko is a single repository; there are no subproject repositories in a release. | Repository layout: extension/, server/, spec/, site/ | – | | `osps_qa_06_02` | MUST [N/A J] | Met | CONTRIBUTING.md "Setup" and "Tests" and the developer setup page explain how to run each suite locally (mix test; npm test for unit, DOM and background tests; npm run e2e for end-to-end; the site's own tests), what each covers, and that CI runs them on every pull request and on main, listed in .github/workflows/ci.yml. https://github.com/ScriptKittyOS/kotiko/blob/main/CONTRIBUTING.md#tests | CONTRIBUTING.md:15-36, 55-63; site/src/content/docs/contribute/setup.md:25-66 | – | | `osps_qa_06_03` | MUST [N/A J] | Met | CONTRIBUTING.md "Tests": every pull request that adds or changes behaviour adds or updates automated tests in the same pull request, major new functionality is not merged without tests, and every bug fix adds a regression test that fails without the fix. https://github.com/ScriptKittyOS/kotiko/blob/main/CONTRIBUTING.md#tests | CONTRIBUTING.md:55-63; .github/pull_request_template.md | – | | `osps_qa_07_01` | MUST [N/A J] | Unmet | Kotiko has one maintainer, so the main ruleset requires a pull request with passing CI but zero approvals; a non-author approval cannot be required until there is a second maintainer. Required review will be turned on when a second maintainer joins. | gh api repos/ScriptKittyOS/kotiko/rulesets/24531669: required_approving_review_count 0; MAINTAINERS.md:12-16; docs/PUBLIC_CHECKLIST.md:15-16 | A second maintainer, then set required approvals to 1 in the main ruleset (maintainer) | | `osps_sa_03_02` | MUST [N/A J] | Met | docs/security/assurance-case.md sections 2 and 3 are the threat model and attack surface analysis: the assets, each attacker (malicious page, injected script, network attacker, bad model answer, unlisted Telegram user, local user, compromised dependency or Action, malicious pull request), what each can reach, every trust boundary with its control and evidence, and the residual risks. https://github.com/ScriptKittyOS/kotiko/blob/main/docs/security/assurance-case.md#2-threat-model | docs/security/assurance-case.md:43-101, 159-184 | – | -| `osps_vm_04_02` | MUST [N/A J] | Unmet | Kotiko does not yet publish a VEX document. Known example: node-forge (a development-only dependency of web-ext, with no patched version) does not affect the released software, but this is not yet recorded in VEX form. | No VEX file in the repository (no *.vex*, openvex or vex/ found); gh api .../dependabot/alerts?state=open: node-forge (high, no fix, development), shell-quote (critical, development), postcss-selector-parser (medium, site, development) | Add an OpenVEX document (for example vex/kotiko.openvex.json) with node-forge and any other not-affected findings, a policy line on keeping it current, and attach it to releases (agent) | +| `osps_vm_04_02` | MUST [N/A J] | Met | Kotiko publishes a VEX document (OpenVEX 0.2.0), vex/kotiko.openvex.json, and every release carries it as kotiko-X.Y.Z.openvex.json, checksummed and attested with the other release files. A dependency vulnerability that doesn't affect Kotiko is accepted only with an osv-scanner.toml entry and a not_affected statement with its justification in the VEX document, in the same reviewed pull request; a unit test fails when an accepted finding has no statement. Today nothing is accepted (the earlier node-forge finding left with web-ext's update; the picomatch advisory was withdrawn), so it has no statements. https://github.com/ScriptKittyOS/kotiko/blob/main/vex/kotiko.openvex.json | `vex/kotiko.openvex.json`; `test/unit/vex.test.mjs`; `.github/workflows/release.yml` ("VEX document" step, before "Checksums"); `docs/security/dependency-and-static-analysis-policy.md` "Accepting a finding that can't be exploited"; `osv-scanner.toml` (no `[[IgnoredVulns]]`) | – | | `osps_vm_05_01` | MUST [N/A J] | Met | The dependency and static analysis policy sets the thresholds for dependency findings: what blocks a merge or a release by severity, deadlines to fix (critical 7 days and high 30, for runtime and dev-only alike; medium 60 days for runtime and 90 for dev-only), how an unreachable finding is accepted (osv-scanner.toml with a reason and an expiry date), and which dependency licenses are allowed (following the Apache Software Foundation's categories). https://github.com/ScriptKittyOS/kotiko/blob/main/docs/security/dependency-and-static-analysis-policy.md | `docs/security/dependency-and-static-analysis-policy.md`; `osv-scanner.toml` | – | | `osps_vm_05_02` | MUST [N/A J] | Met | The release workflow runs the dependency scan before it builds anything: the build job needs the dependency-scan job (OSV-Scanner over every lockfile) to succeed, so a release can't be built while a known vulnerability is open and not accepted in osv-scanner.toml. The policy states the rule: https://github.com/ScriptKittyOS/kotiko/blob/main/docs/security/dependency-and-static-analysis-policy.md | `.github/workflows/release.yml` jobs `dependency-scan` and `build` (`needs`, `result == 'success'`); `.github/workflows/dependency-scan.yml` | – | | `osps_vm_05_03` | MUST [N/A J] | Met | OSV-Scanner checks all three lockfiles (package-lock.json, site/package-lock.json, server/mix.lock) for known vulnerabilities and malicious packages on every pull request, every push to main and weekly; it is a required check on main, so a change can't merge with an open finding. mix deps.audit and mix hex.audit also run, and Dependabot alerts are on. https://github.com/ScriptKittyOS/kotiko/blob/main/docs/security/dependency-and-static-analysis-policy.md | `.github/workflows/dependency-scan.yml`; ruleset 24531669 requires `osv-scanner`; `.github/workflows/ci.yml` (`mix deps.audit`, `mix hex.audit`) | – | diff --git a/docs/reference/configuration.md b/docs/reference/configuration.md index 5cb1dbb..7080434 100644 --- a/docs/reference/configuration.md +++ b/docs/reference/configuration.md @@ -68,8 +68,10 @@ The address the server listens on. - Example: your Tailscale address, to use the extension on another computer. - At start, the server logs who can reach it. For a local network address, `0.0.0.0` or a public address, that line is a warning: the server speaks plain HTTP, so anyone on the way - can read the token. Use Tailscale or put HTTPS in front (README, "Browse on another - machine"). Tailscale addresses (100.64.0.0/10) get an informational line. + can read your words and the server's answers (not the token: the extension signs each + request with it, though a `Bearer` token sent with `curl` would show). Use Tailscale or put + HTTPS in front ([Using the server from another machine](https://kotiko.org/server/remote-access/)). + Tailscale addresses (100.64.0.0/10) get an informational line. - Wrong: a name that doesn't resolve stops the server. ### `ALLOWED_HOSTS` diff --git a/docs/security/dependency-and-static-analysis-policy.md b/docs/security/dependency-and-static-analysis-policy.md index 6385dd6..eea260e 100644 --- a/docs/security/dependency-and-static-analysis-policy.md +++ b/docs/security/dependency-and-static-analysis-policy.md @@ -114,7 +114,10 @@ check reads it: with the advisory `id`, a `reason` (why it isn't exploitable, with evidence, and what we are waiting for), and an `ignoreUntil` date at most 30 days ahead for critical or high and 90 days for the rest. After that date the scan fails again, and renewing it is a new - review. Remove the entry once the dependency is updated. `mix deps.audit` has no skip + review. The same pull request adds a `not_affected` statement, with its justification, to + the VEX document [`vex/kotiko.openvex.json`](../../vex/kotiko.openvex.json), which every + release carries as `kotiko-X.Y.Z.openvex.json` (`test/unit/vex.test.mjs` fails without + it). Remove both once the dependency is updated. `mix deps.audit` has no skip list: the same advisory goes in its `--ignore-advisory-ids` in `ci.yml`, under a comment with the same reason and date. - **Sobelow**: a `# sobelow_skip ["Check.Name"]` comment directly above the function, under diff --git a/docs/security/requirements.md b/docs/security/requirements.md index 3930e53..ab90d4b 100644 --- a/docs/security/requirements.md +++ b/docs/security/requirements.md @@ -40,7 +40,7 @@ Kotiko has two parts: the browser extension, and an optional server you run your - **It listens only on your computer** unless you change `BIND`, on both loopback addresses (`127.0.0.1` and `::1`), so no other account on the computer can listen on the one a browser tries for `localhost` and receive your token. When you change `BIND`, it - says at startup who can now reach it, and warns when your token would cross a network in plain + says at startup who can now reach it, and warns when your words would cross a network in plain HTTP (repeating that warning daily when the address is reachable from the internet). - **It answers only to names it knows**, so a web page can't reach it by pointing its own domain at your computer (DNS rebinding). Unknown names get `421`. You add names with @@ -107,8 +107,10 @@ Kotiko has two parts: the browser extension, and an optional server you run your your words wherever they like; so the server refuses to start in a folder others can write in, when one of its files is a link, or when the folder or one of its files belongs to another account. -- **Privacy on a network if you use plain HTTP** to a server on another machine. The token - and your words travel unencrypted. Use Tailscale or HTTPS through a reverse proxy. +- **Privacy on a network if you use plain HTTP** to a server on another machine. Your words + and the server's answers travel unencrypted. The token doesn't: the extension signs each + request with it instead of sending it (a `Bearer` token you send yourself, as with `curl`, + does travel). Use Tailscale or HTTPS through a reverse proxy. - **Privacy from the model provider you chose.** Lookups go to it under its terms. - **That pages can't tell Kotiko changed their text.** A page's own scripts can see swapped words. diff --git a/docs/stores.md b/docs/stores.md index 3ac6699..7364cbf 100644 --- a/docs/stores.md +++ b/docs/stores.md @@ -7,16 +7,14 @@ The pipeline is [slice 30](../slices/30-release-pipeline/SPEC.md); the workflow ## Versions -The first public release is **v1.0.0** (DECISIONS 2026-10-05). 0.2.0 was the last version of -the personal tool, so `main` keeps saying 0.2.0 until 1.0.0 is released; the work since is -under `## Unreleased` in the CHANGELOG. `release-please-config.json` pins the next release -with `"release-as": "1.0.0"`, so the release PR proposes 1.0.0 whatever the commits say. -Before launch, builds for slice 54's review are release candidates on the release PR's head: -`v1.0.0-rc.1`, `v1.0.0-rc.2`, and so on (below). The stores get `v1.0.0` only. - -**After v1.0.0 ships, remove `"release-as"`** (one line, in the PR that follows the -release); from then on release-please picks the version from the commits: `fix` gives -1.0.1, `feat` 1.1.0, a breaking change 2.0.0. +The first public release was **v1.0.0** (DECISIONS 2026-10-05), on 2026-10-08, with v1.0.1 +the same day; 0.2.0 was the last version of the personal tool, and nothing was released in +between. Before launch, builds for slice 54's review were release candidates on the release +PR's head, `v1.0.0-rc.1` to `v1.0.0-rc.4` (below); candidates never go to the stores. +`release-please-config.json` pinned the first release with `"release-as": "1.0.0"`; the pin +was removed once it shipped, so release-please now picks the version from the commits: `fix` +gives the next patch (after 1.0.1, 1.0.2), `feat` the next minor (1.1.0), a breaking change +2.0.0. Work not yet released is under `## Unreleased` in the CHANGELOG. ## How a release happens diff --git a/docs/verify.md b/docs/verify.md index 212cff6..c28b04c 100644 --- a/docs/verify.md +++ b/docs/verify.md @@ -2,7 +2,8 @@ Each release on GitHub has the two extension zips (the exact files the release workflow uploads to the Chrome Web Store and Firefox Add-ons; [section 3](#3-the-store-versions) says -what the stores add), the server's SBOM (`kotiko-server-X.Y.Z.cdx.json`) and +what the stores add), the server's SBOM (`kotiko-server-X.Y.Z.cdx.json`), the VEX document +(`kotiko-X.Y.Z.openvex.json`: dependency vulnerabilities that don't affect Kotiko, and why) and `SHA256SUMS`. These steps check that what you downloaded was built by this repository's release workflow from a tag a maintainer signed. Replace `1.0.0` with the version you have. @@ -11,8 +12,8 @@ You need `git`, `sha256sum` (macOS: `shasum -a 256`) and the [GitHub CLI](https: ## 1. The tag -The release manager signs each tag with their own key, listed in `.github/allowed_signers` -(SSH) or `.github/release-keys.asc` (GPG), and in [MAINTAINERS.md](../MAINTAINERS.md). +The release manager signs each tag with their own SSH key, listed in `.github/allowed_signers` +and in [MAINTAINERS.md](../MAINTAINERS.md). ```sh git clone https://github.com/ScriptKittyOS/kotiko.git && cd kotiko @@ -20,9 +21,11 @@ git fetch --tags git -c gpg.ssh.allowedSignersFile=.github/allowed_signers verify-tag v1.0.0 ``` -The output starts with `Good "git" signature for `. For a GPG-signed tag, import -the release keys first: `gpg --import .github/release-keys.asc`, then `git verify-tag v1.0.0` -shows "Good signature". +The output starts with `Good "git" signature for `. Every release so far is +signed with an SSH key. The release workflow would also accept a GPG key from +`.github/release-keys.asc`, but no release key is GPG, so that file doesn't exist; if one is +ever added, import it first (`gpg --import .github/release-keys.asc`) and `git verify-tag +v1.0.0` shows "Good signature". Then check that the signed tag carries this tag's name. The signature covers the tag object, not the name you fetched it under, so a release candidate's signed object could be pushed diff --git a/extension/_locales/en/messages.json b/extension/_locales/en/messages.json index f380cd2..50afdf0 100644 --- a/extension/_locales/en/messages.json +++ b/extension/_locales/en/messages.json @@ -4953,8 +4953,8 @@ "description": "Warning under the address of a lookup service (\"Another service\", Ollama, LM Studio) in Settings and on the welcome page, when the address uses http:// and isn't on this computer or a Tailscale network. Lookups still work. Keep http:// and https:// as they are." }, "server_url_unencrypted": { - "message": "This address starts with http://, so your access key travels unencrypted. If anyone else shares this network, use an https:// address (for example with tailscale serve).", - "description": "Warning under the server address field when the address uses http:// and isn't on this computer or a Tailscale network. The connection still works. Keep http://, https:// and \"tailscale serve\" as they are." + "message": "This address starts with http://, so your words and your server's answers travel unencrypted (your access key itself is never sent). If anyone else shares this network, use an https:// address (for example with tailscale serve).", + "description": "Warning under the server address field when the address uses http:// and isn't on this computer or a Tailscale network. The connection still works. Kotiko signs each request with the access key instead of sending it, so only the words and the server's answers are readable on the network. Keep http://, https:// and \"tailscale serve\" as they are." }, "error_address_changed": { "message": "Where Kotiko sends your words was changed outside its settings, so it sent nothing there. Open Settings, check your word lookups and server address, and save them again.", diff --git a/extension/background.js b/extension/background.js index 60ed3db..b5fab2f 100644 --- a/extension/background.js +++ b/extension/background.js @@ -978,8 +978,11 @@ const refresh = globalThis.KotikoRefreshJob.createRefreshJob({ now, }); -// Every committed write updates the pages' list once, 100 ms later. -getStore().then((store) => store.onCommit((info) => projector.schedule({ by: info?.by ?? null }))).catch(() => {}); +// Every committed write updates the pages' list once, 100 ms later. Writes that can delete +// or restore a word say so, for the dashboard's Recently deleted (tombstones live in the +// store, so no storage key changes with them). +const TOMBSTONE_WRITES = new Set(["remove", "restore", "import", "undo-import"]); +getStore().then((store) => store.onCommit((info) => projector.schedule({ by: info?.by ?? null, deleted: TOMBSTONE_WRITES.has(info?.reason) }))).catch(() => {}); // ── moving words between this browser and a server (slice 11 section 6) ──────────── diff --git a/extension/dashboard.js b/extension/dashboard.js index d6b42f6..59ece91 100644 --- a/extension/dashboard.js +++ b/extension/dashboard.js @@ -289,12 +289,18 @@ return loading; } + // Reloads can overlap (a delete, then Undo right away): only the newest answer counts. + let deletedSeq = 0; async function loadDeleted() { + const seq = ++deletedSeq; + let entries; try { - state.deleted = await source.deleted(); + entries = await source.deleted(); } catch { - state.deleted = []; + entries = []; } + if (seq !== deletedSeq) return; + state.deleted = entries; rebuildDeleted(); if (isDeletedView()) { resort(); @@ -446,6 +452,7 @@ restored.push(res.word); } else problem ??= res; }); + deletedSeq++; // a reload already under way may have read the list before the restore state.deleted = state.deleted.filter((e) => !recordIds.includes(e.id) || !restored.some((w) => w.id === e.id)); rebuildDeleted(); rebuild(); @@ -1134,13 +1141,41 @@ function moveMenu(anchor, ids) { const current = new Set(ids.map((id) => state.byId.get(id)?.lang)); const langs = M.shelf(state.groups, { languageName: (l) => languageName(l), uiLocale: I18n.locale() }).map((e) => e.lang).filter((l) => !(current.size === 1 && current.has(l))); + const recordIds = ids.flatMap((id) => state.byId.get(id)?.records.map((r) => r.id) ?? []); + // Where focus goes once a language is chosen (27 §3, WCAG 2.4.3): back to the + // inspector's Move button it came from, else the list, on the moved word's row while + // it's listed (else the row now in its place). After the move re-renders, again, unless + // the learner has gone elsewhere meanwhile. + const fromInspector = !!anchor.closest?.("#inspector"); + const refocus = () => { + const back = fromInspector && state.open ? $("inspector").querySelector(".insp-move") : null; + if (back) back.focus(); + else focusListOn(recordIds); + }; + const move = async (lang) => { + const done = moveGroups(ids, lang); + const settle = () => [document.body, $("grid"), null].includes(document.activeElement) && refocus(); + settle(); + await done; + settle(); + }; openMenu(anchor, [ - ...langs.map((l) => ({ label: languageName(l), lang: l, run: () => moveGroups(ids, l) })), + ...langs.map((l) => ({ label: languageName(l), lang: l, run: () => move(l) })), { label: t("dash_move_elsewhere"), run: async () => { const lang = await pickLanguage({ title: t("dash_move_title"), exclude: current }); - if (lang) moveGroups(ids, lang); + if (lang) move(lang); } }, - ]); + ], { focus: refocus }); + } + + // Focus on the list, its active row on the word holding one of `recordIds` while it's + // listed; else the active row stays where it was (the next word, once one has left). + function focusListOn(recordIds) { + const i = state.view.findIndex((id) => groupById(id)?.records.some((r) => recordIds.includes(r.id))); + if (i >= 0) state.active = i; + if (state.view.length) scrollToActive(); + renderWindow(false); + $("grid").focus({ preventScroll: true }); } // --------------------------------------------------------------------------------- @@ -1925,7 +1960,9 @@ // --------------------------------------------------------------------------------- // Menus, dialogs and the language picker (27 §3 patterns). - function openMenu(anchor, items, { radio = false } = {}) { + // Choosing an item closes the menu and puts focus back on what opened it, as Esc does, or + // where `focus()` puts it, before the item runs (WCAG 2.4.3). + function openMenu(anchor, items, { radio = false, focus = () => anchor.focus() } = {}) { closeMenus(); const menu = el("div", { class: "menu", role: "menu" }); const buttons = items.map((it) => el("button", { @@ -1936,6 +1973,7 @@ tabindex: "-1", onclick: () => { closeMenus(); + focus(); it.run(); }, }, radio ? el("span", { class: "menu-check", "aria-hidden": "true" }, it.checked ? icon("check", 16) : null) : null, el("span", { lang: it.lang ?? null }, it.label))); diff --git a/extension/lib/projection.js b/extension/lib/projection.js index b693373..6d839a6 100644 --- a/extension/lib/projection.js +++ b/extension/lib/projection.js @@ -6,11 +6,13 @@ // to storage.local in one `set`. Only swappable words (active), only for the learner's // current bases, in the compact shape the matcher and the word card read today: forms as // the texts of enabled forms, newest first, and the optional fields left out when empty. +// `wordsVersion.deleted` is true when one of the writes deleted or restored a word, so an +// open dashboard reloads its Recently deleted list (kept in the store, not in storage). // No DOM, so it runs in the background (globalThis.KotikoProjection) and in Node tests. // // KotikoProjection.project(records, bases) -> [compact word] // const p = KotikoProjection.createProjector({ list, storage, bases, enabled, debounceMs }); -// p.schedule({by: clientId}); await p.flush(); +// p.schedule({by: clientId, deleted}); await p.flush(); (() => { const SWAP = new Set(["active", "well_known"]); const OPTIONAL = ["romanization", "note", "native_vocalized", "pronunciation", "pronunciation_careful", "pronunciation_source", "sense"]; @@ -44,15 +46,19 @@ // Who caused the writes since the last projection: one page's client id, or null // (several writers, the popup, the background). The dashboard ignores its own echoes. let by; + // Whether a write since the last projection deleted or restored a word. + let deleted = false; - async function write(writer) { + async function write(writer, tombstones) { if (!(await enabled())) return false; const items = async (get) => { const b = await bases(get); const words = project(await list(), b); const prev = (await get({ wordsVersion: null })).wordsVersion; n = Math.max(n, typeof prev?.n === "number" ? prev.n : 0) + 1; - return { words, baseLangs: b, wordsVersion: { n, at: now(), by: writer ?? null } }; + const version = { n, at: now(), by: writer ?? null }; + if (tombstones) version.deleted = true; + return { words, baseLangs: b, wordsVersion: version }; }; // The bases are read and the list for them written in one step where the storage // can (the background's trusted copy, `update`): a change of bases while the store's @@ -66,9 +72,11 @@ timer = null; const done = waiters; const writer = by; + const tombstones = deleted; waiters = []; by = undefined; - running = running.then(() => write(writer)).then( + deleted = false; + running = running.then(() => write(writer, tombstones)).then( (r) => done.forEach((w) => w.resolve(r)), (e) => { onError(e); @@ -80,15 +88,17 @@ return { // Coalesces writes: one projection 100 ms after the last change. - schedule({ by: writer = null } = {}) { + schedule({ by: writer = null, deleted: d = false } = {}) { by = by === undefined || by === writer ? writer : null; + deleted ||= d === true; if (timer) clearTimer(timer); timer = setTimer(run, debounceMs); return new Promise((resolve) => waiters.push({ resolve })); }, // Writes now (tests, mode switches); resolves once written. - flush({ by: writer = null } = {}) { + flush({ by: writer = null, deleted: d = false } = {}) { by = by === undefined || by === writer ? writer : null; + deleted ||= d === true; if (timer) clearTimer(timer); const p = new Promise((resolve) => waiters.push({ resolve })); run(); diff --git a/extension/lib/url.js b/extension/lib/url.js index 0396eea..96a207a 100644 --- a/extension/lib/url.js +++ b/extension/lib/url.js @@ -9,7 +9,7 @@ // -> { ok: true, url: "http://192.168.1.5:4747" } // normalizeServerUrl("http://user:pw@host") // -> { ok: false, code: "server_address_invalid", hint: "..." } -// sendsInClear("http://192.168.1.5:4747") -> true (the token would cross the network unencrypted) +// sendsInClear("http://192.168.1.5:4747") -> true (words would cross the network unencrypted) // pinLoopback("http://localhost:11434/v1") -> "http://127.0.0.1:11434/v1" // // Plain-http `localhost` always becomes 127.0.0.1 (slice 54, B-01). Browsers resolve the @@ -95,10 +95,11 @@ return { ok: true, url: pinLoopback(`${u.protocol}//${u.host}${path}`) }; } - // An address whose requests (and the token in them) cross a network unencrypted: plain - // http:// to anywhere but this computer (127.0.0.0/8, ::1, localhost) or a Tailscale - // address (100.64.0.0/10, fd7a:115c:a1e0::/48, *.ts.net), whose traffic WireGuard - // encrypts (slice 28 §5). The address still works; the settings say so under the field. + // An address whose requests and answers (the words in them; never the token, which only + // signs them) cross a network unencrypted: plain http:// to anywhere but this computer + // (127.0.0.0/8, ::1, localhost) or a Tailscale address (100.64.0.0/10, + // fd7a:115c:a1e0::/48, *.ts.net), whose traffic WireGuard encrypts (slice 28 §5). The + // address still works; the settings say so under the field. function sendsInClear(input) { const n = normalizeServerUrl(input); if (!n.ok) return false; diff --git a/extension/lib/word-source.js b/extension/lib/word-source.js index 0a8babb..ad577d2 100644 --- a/extension/lib/word-source.js +++ b/extension/lib/word-source.js @@ -100,7 +100,9 @@ const keys = changedKeys(changes.words.oldValue, changes.words.newValue); if (keys.size && !explainedByOwn(keys)) emit("sync"); } - if (changes.recentlyDeleted) emit("deleted"); + // Server mode keeps Recently deleted in storage; local mode keeps tombstones in its + // store, and the pages' list update says when one was written (lib/projection.js). + if (changes.recentlyDeleted || changes.wordsVersion?.newValue?.deleted === true) emit("deleted"); } return { diff --git a/extension/popup-more.js b/extension/popup-more.js index 353a8a2..be1e261 100644 --- a/extension/popup-more.js +++ b/extension/popup-more.js @@ -50,14 +50,23 @@ const rest = q ? (await allLanguages()).filter((o) => !first.includes(o.lang) && match(o)).slice(0, 30) : []; const shown = [...mine.filter(match), ...rest]; list.replaceChildren(...(shown.length ? shown.map(option) : [el("li", { class: "picker-none" }, t("lang_none"))])); + return shown; }; - search.addEventListener("input", show); + let listed = show(); + search.addEventListener("input", () => (listed = show())); + // Enter picks the first language listed, as the dashboard's picker does (not while + // an input method is still composing the text). + search.addEventListener("keydown", async (e) => { + if (e.key !== "Enter" || e.isComposing) return; + e.preventDefault(); + const [top] = await listed; + if (top && dialog.isConnected) done(top.lang); + }); dialog.addEventListener("cancel", (e) => (e.preventDefault(), done(null))); // Esc closes it from the search field too (there, the browser would only clear the text). dialog.addEventListener("keydown", (e) => e.key === "Escape" && (e.preventDefault(), done(null))); dialog.addEventListener("click", (e) => e.target === dialog && done(null)); document.body.append(dialog); - show(); dialog.showModal?.(); search.focus(); }); diff --git a/server/lib/kotiko/exposure.ex b/server/lib/kotiko/exposure.ex index a15a3a0..b7cd7da 100644 --- a/server/lib/kotiko/exposure.ex +++ b/server/lib/kotiko/exposure.ex @@ -4,11 +4,13 @@ defmodule Kotiko.Exposure do @moduledoc """ Who can reach the server, judged from the address it listens on (BIND), so startup can - say plainly whether the token crosses a network in cleartext. + say plainly whether words cross a network in cleartext. The extension never sends the + token (it signs each request with it, `Kotiko-HMAC v2`), so over plain HTTP what others + can read is the words and the server's answers. """ import Bitwise - @advice "Use Tailscale or HTTPS: see \"Browse on another machine\" in the README." + @advice "Use Tailscale or HTTPS: see https://kotiko.org/server/remote-access/" @doc """ Returns `{level, class, message}`: level `:info` or `:warning`, class one of @@ -26,17 +28,18 @@ defmodule Kotiko.Exposure do :lan -> {:warning, :lan, "Listening on your local network over plain HTTP (#{url}). Anyone on this " <> - "network can see your token in transit. #{@advice}"} + "network can read your words and the server's answers in transit. #{@advice}"} :all -> {:warning, :all, "Listening on every network interface over plain HTTP (#{url}). Anyone who can " <> - "reach this computer can see your token in transit. #{@advice}"} + "reach this computer can read your words and the server's answers in transit. " <> + @advice} :public -> {:warning, :public, "This address is reachable from the internet over plain HTTP (#{url}). Anyone " <> - "along the way can see your token. #{@advice}"} + "along the way can read your words and the server's answers. #{@advice}"} end end diff --git a/server/test/kotiko/exposure_test.exs b/server/test/kotiko/exposure_test.exs index 7975af1..fbf9daa 100644 --- a/server/test/kotiko/exposure_test.exs +++ b/server/test/kotiko/exposure_test.exs @@ -33,7 +33,13 @@ defmodule Kotiko.ExposureTest do Exposure.classify(unquote(Macro.escape(ip)), "http://x:4747") assert message =~ "http://x:4747" - if unquote(level) == :warning, do: assert(message =~ "plain HTTP") + + if unquote(level) == :warning do + assert message =~ "plain HTTP" + # Requests are signed, never carry the token (SCR-844 F6): the words are what shows. + assert message =~ "your words and the server's answers" + refute message =~ "token" + end end end diff --git a/site/src/content/docs/server/remote-access.md b/site/src/content/docs/server/remote-access.md index 8785401..60b919e 100644 --- a/site/src/content/docs/server/remote-access.md +++ b/site/src/content/docs/server/remote-access.md @@ -11,8 +11,9 @@ with a server at home: 2. Restart the server. 3. In Kotiko's **Settings**, **Your Kotiko server**, use `http://:4747`. -Tailscale encrypts the traffic. On a plain local network the access key travels unencrypted, -and the server warns about that when it starts. +Tailscale encrypts the traffic. On a plain local network your words and the server's answers +travel unencrypted, and the server warns about that when it starts. The access key itself is +never sent: Kotiko signs each request with it. ## Names and proxies diff --git a/slices/11-local-first-mode/SPEC.md b/slices/11-local-first-mode/SPEC.md index 30938af..4611bae 100644 --- a/slices/11-local-first-mode/SPEC.md +++ b/slices/11-local-first-mode/SPEC.md @@ -533,8 +533,9 @@ server's fake model.* `words`, `baseLangs` and `wordsVersion`. Forms are projected as the texts of enabled forms (what today's matcher reads; slice 14 can switch to the flags). `wordsVersion` keeps slice 21's `{at, by}` and adds the integer `n`, so the dashboard still ignores its own - echoes. 5,000 words: about 1 ms to build, 14 ms to build and write (`npm run perf`, - budgets 30 and 50 ms). + echoes, and `deleted: true` when a delete, restore or import was among the writes, so an + open dashboard reloads Recently deleted (SCR-844). 5,000 words: about 1 ms to build, + 14 ms to build and write (`npm run perf`, budgets 30 and 50 ms). - `spec/providers.json` (eight presets; copied into `extension/spec/` and `KOTIKO_SPEC`), `extension/lib/llm/catalog.js` (the twin of `Kotiko.LLM.Catalog`'s filter, order and health) and `extension/lib/llm/client.js`: cache, quota gate (`/key`, estimated between diff --git a/slices/21-dashboard/SPEC.md b/slices/21-dashboard/SPEC.md index 84e57bc..f46816f 100644 --- a/slices/21-dashboard/SPEC.md +++ b/slices/21-dashboard/SPEC.md @@ -630,6 +630,10 @@ changed. background records words deleted from extension pages in `storage.local.recentlyDeleted` (30 days, at most 5,000) and the view reads that. Words deleted on Telegram or another device don't appear there until [39](../39-multi-device-sync/SPEC.md)'s change feed. + With words in this browser (slice 11) the view reads the store's own tombstones, which no + storage key mirrors: the projection's `wordsVersion` carries `deleted: true` when its + writes deleted, restored or imported words, and the open view reloads on it, its own + deletes and Undo included (SCR-844). - **Selection and bulk** (§6): click, Shift+click, Ctrl/Cmd+click, checkboxes on hover and on every row once something is checked, Ctrl/Cmd+A; the floating bar with Pause, Resume, Move to…, Delete (Restore in Recently deleted), each undoable. 500 words delete in one @@ -637,7 +641,10 @@ changed. - **Keyboard** (§12) when focus is in the list: arrows, Home/End, Page Up/Down, Enter, Space, Shift+arrows, Ctrl/Cmd+A, Delete/Backspace, P, M, N, Esc (inspector, then selection, then search), Ctrl/Cmd+Z, ? (a dialog listing them), / from anywhere. The - search field has focus when the page opens, so finding a word is one step. + search field has focus when the page opens, so finding a word is one step. Choosing a + menu item puts focus back on what opened the menu, as Esc does; after Move to…, focus + is on the list with the moved word's row active while it's listed, else the row now in + its place, or back on the inspector's Move when it came from there (SCR-844). - **The refresh line** (§3) from `GET /api/v1/jobs/pronunciation-refresh`, polled every 15 s while the page is visible and the job isn't done; Pause and Resume post the action; the visible numbers follow the job and the `role="status"` copy is announced at most once diff --git a/slices/24-add-flow-safety/SPEC.md b/slices/24-add-flow-safety/SPEC.md index f784817..eed2ecc 100644 --- a/slices/24-add-flow-safety/SPEC.md +++ b/slices/24-add-flow-safety/SPEC.md @@ -435,7 +435,8 @@ Built 2026-10-05 (§§6-9): - **Wrong language (§6).** The language on a created line is a chip. It opens the picker: the learner's languages first, then every language in `spec/languages.json` by name, - own name or code. `jobs.relang {id, key, lang}` makes a new job with that hint + own name or code; Enter in its search box picks the first one listed, as the + dashboard's picker does (SCR-844). `jobs.relang {id, key, lang}` makes a new job with that hint (`replaces: {id, key}`). Once it's done, the old word is undone and its job marked `replacedBy`, so the popup shows only the new line. Undoing the new word brings the old one back. diff --git a/test/bg/local-mode.test.mjs b/test/bg/local-mode.test.mjs index 2f43933..be76362 100644 --- a/test/bg/local-mode.test.mjs +++ b/test/bg/local-mode.test.mjs @@ -296,6 +296,28 @@ describe("a fresh install keeps words in this browser (slice 11)", () => { assert.equal((await bg.send({ type: "job.refresh" })).state, "paused", "a provider: no longer waiting for one"); }); + test("a delete or restore anywhere tells an open dashboard to reload Recently deleted (SCR-844 F2)", async () => { + const bg = loadBackground({ local: { baseLangs: ["en"] } }); + await bg.k.ready(); + const save = (native, gloss) => bg.send({ type: "words.save", words: [{ lang: "ru", native, base_lang: "en", gloss }], clientId: "dash-1" }); + const cat = (await save("кошка", "cat")).results[0].word.id; + const dog = (await save("собака", "dog")).results[0].word.id; + await bg.until(() => bg.store.wordsVersion?.n >= 1 && bg.store.words?.length === 2); + assert.equal(bg.store.wordsVersion.deleted, undefined, "adding a word leaves the tombstones alone"); + // Each change event the dashboard would see, in order. + const versions = []; + bg.fake.chrome.storage.onChanged.addListener((changes, area) => area === "local" && changes.wordsVersion && versions.push(changes.wordsVersion.newValue)); + const tombstones = async (fn, by) => { + versions.length = 0; + await fn(); + return bg.until(() => versions.find((v) => typeof v.n === "number" && v.by === by)).then((v) => v.deleted === true); + }; + assert.equal(await tombstones(() => bg.send({ type: "words.write", ops: [{ op: "delete", id: cat }], clientId: "dash-1" }), "dash-1"), true, "the dashboard's own delete"); + assert.equal(await tombstones(() => bg.send({ type: "words.write", ops: [{ op: "restore", id: cat }], clientId: "dash-1" }), "dash-1"), true, "its Undo"); + assert.equal(await tombstones(() => bg.send({ type: "remove", id: dog }, POPUP), null), true, "the popup's Undo of an add"); + assert.equal(await tombstones(() => bg.send({ type: "words.write", ops: [{ op: "patch", id: cat, patch: { note: "x" } }], clientId: "dash-1" }), "dash-1"), false, "an edit"); + }); + test("the provider's errors become slice 25 codes on the job, and quota waits until the reset", async () => { srv.reset(); const bg = loadBackground({ local: { baseLangs: ["en"], wordsHome: "local" } }); diff --git a/test/dom/popup.test.mjs b/test/dom/popup.test.mjs index a0b94b4..abb8a29 100644 --- a/test/dom/popup.test.mjs +++ b/test/dom/popup.test.mjs @@ -923,6 +923,26 @@ describe("the add box's language controls (24 §6-§9)", () => { assert.equal(p.$(".picker"), null, "closed"); }); + test("the picker takes Enter: the first language it lists, even typed before the list has loaded (SCR-844 F4)", async () => { + const p = await openPopup({ local: { ...CONNECTED, words: WORDS, addJobs: [created()] } }); + p.$('#jobs [data-action="relang"]').click(); + await p.settle(); + const search = p.$(".picker input[type=search]"); + const enter = () => search.dispatchEvent(new p.win.KeyboardEvent("keydown", { key: "Enter", bubbles: true, cancelable: true })); + search.value = "zzqx"; + search.dispatchEvent(new p.win.Event("input")); + enter(); + await p.settle(); + assert.ok(p.$(".picker"), "nothing listed: Enter does nothing"); + search.value = "ital"; + search.dispatchEvent(new p.win.Event("input")); + enter(); + await p.settle(); + for (let i = 0; i < 20 && p.$(".picker"); i++) await sleep(10); + assert.equal(p.$(".picker"), null, "closed"); + assert.equal(p.fake.calls.sendMessage.find((m) => m.type === "jobs.relang")?.lang, "it"); + }); + test("a job re-added in another language gives way to the new one", async () => { const p = await openPopup({ local: { ...CONNECTED, words: WORDS, addJobs: [created({ replacedBy: "x" })] } }); assert.equal(p.$('#jobs [data-kind="word"]'), null); diff --git a/test/e2e/dashboard.spec.mjs b/test/e2e/dashboard.spec.mjs index 7fdd93c..5c1bedd 100644 --- a/test/e2e/dashboard.spec.mjs +++ b/test/e2e/dashboard.spec.mjs @@ -86,6 +86,67 @@ test("delete in two steps with Undo, then restore from Recently deleted", async await expect(row(dash, "犬")).toHaveCount(1); }); +// SCR-844 F3 (WCAG 2.4.3): choosing a language in the Move menu puts focus back where the +// learner was, never on the page itself. +test("after Move, focus stays on the moved word's row, the next row once it leaves, or the inspector's Move", async ({ context, server, popup, extensionId }) => { + await server.control({ words: [...WORDS, { id: 5, lang: "ru", language: "Russian", native: "кот", romanization: "kot", english: "cat", forms: ["cat"], note: null }] }); + const p = await popup.connect(server.kotikoUrl, server.token); + const dash = await openFromPopup(context, p); + const grid = dash.locator("#grid"); + const active = () => dash.evaluate(() => document.getElementById(document.getElementById("grid").getAttribute("aria-activedescendant") ?? "")?.querySelector(".w-native")?.textContent ?? null); + const langOf = async (native) => (await server.state()).v1.find((w) => w.native === native).lang; + // M on the active row, then a language by its first letter and Enter: keyboard only. + const moveTo = async (letter) => { + await dash.keyboard.press("m"); + await expect(dash.locator("#layer .menu")).toBeVisible(); + await dash.keyboard.press(letter); + await dash.keyboard.press("Enter"); + await expect(dash.locator("#layer .menu")).toHaveCount(0); + }; + + // Still listed, moved through Other language…'s picker: focus on the list, the moved + // word's row active. + await grid.focus(); + await dash.keyboard.press("Home"); + while ((await active()) !== "犬") await dash.keyboard.press("ArrowDown"); + const word = "犬"; + await moveTo("o"); + await expect(dash.locator(".lang-picker")).toBeVisible(); + await dash.keyboard.type("Korean"); + await dash.keyboard.press("Enter"); + await expect.poll(() => langOf(word)).toBe("ko"); + await expect(grid).toBeFocused(); + await expect.poll(active).toBe(word); + + // Gone from a list showing one language: focus on the list, the next word active. + await dash.goto(`chrome-extension://${extensionId}/dashboard.html#words?lang=ru`); + await expect(dash.locator("#app")).toHaveAttribute("data-ready", "true"); + await expect(dash.locator(".wrow")).toHaveCount(2); + await grid.focus(); + await dash.keyboard.press("Home"); + const first = await active(); + const second = first === "дом" ? "кот" : "дом"; + await moveTo("k"); + await expect.poll(() => langOf(first)).toBe("ko"); + await expect(dash.locator(".wrow")).toHaveCount(1); + await expect(grid).toBeFocused(); + await expect.poll(active).toBe(second); + + // From the inspector's Move: back on that button. + await row(dash, second).click(); + await dash.locator("#inspector .insp-move").click(); + await expect(dash.locator("#layer .menu")).toBeVisible(); + await dash.keyboard.press("a"); + await dash.keyboard.press("Enter"); + await expect.poll(() => langOf(second)).toBe("ar"); + await expect(dash.locator("#inspector .insp-move")).toBeFocused(); + + // Any menu: choosing an item puts focus back on what opened it, as Esc does. + await dash.locator('[data-filter="status"]').click(); + await dash.getByRole("menuitemradio", { name: "Paused", exact: true }).click(); + await expect(dash.locator('[data-filter="status"]')).toBeFocused(); +}); + test("a word added in the popup appears in the open dashboard without a reload", async ({ context, server, popup }) => { await server.control({ words: WORDS }); const p = await popup.connect(server.kotikoUrl, server.token); diff --git a/test/e2e/local.spec.mjs b/test/e2e/local.spec.mjs index 9639374..ba77e8a 100644 --- a/test/e2e/local.spec.mjs +++ b/test/e2e/local.spec.mjs @@ -112,6 +112,37 @@ test("with no provider at all, 'word = meaning' adds and swaps with no network r await expect(page.locator("#p1")).toHaveText(P1); }); +// SCR-844 F2: words in this browser keep their tombstones in its own store, where no +// storage change announces them; the open dashboard's Recently deleted follows anyway. +test("an open dashboard's Recently deleted follows deletes and restores without a reload", async ({ context, extensionId, popup }) => { + await popup.add("дом = house"); + const line = await popup.add("кот = cat"); + const dash = await context.newPage(); + await dash.goto(`chrome-extension://${extensionId}/dashboard.html`); + await expect(dash.locator("#app")).toHaveAttribute("data-ready", "true"); + const row = (native) => dash.locator(".wrow", { has: dash.locator(".w-native", { hasText: native }) }); + await expect(row("дом")).toHaveCount(1); + + // Deleted on the dashboard itself, then shown under Recently deleted. + await row("дом").click(); + await dash.keyboard.press("Delete"); + await expect(row("дом")).toHaveCount(0); + await dash.locator('[data-filter="status"]').click(); + await dash.getByRole("menuitemradio", { name: "Recently deleted" }).click(); + await expect(row("дом")).toHaveCount(1); + + // Ctrl+Z brings it back, and it leaves Recently deleted. + await dash.locator("#grid").focus(); + await dash.keyboard.press("Control+z"); + await expect(row("дом")).toHaveCount(0); + await expect.poll(() => dash.evaluate(() => chrome.runtime.sendMessage({ type: "words.list" }).then((r) => r.words.map((w) => w.native).sort()))).toEqual(["дом", "кот"]); + + // Removed in the popup (its Undo of the add) while the dashboard stays open. + await line.locator('[data-action="undo"]').click(); + await expect(line).toHaveText(/^Removed кот/); + await expect(row("кот")).toHaveCount(1); +}); + // Slice 24 §7: with no lookups at all, a word that needs one waits; "Add it yourself" saves // it from a small form, with the language from the picker (a real here). test("Add it yourself: the form in the line, the language picker, saved with no lookup", async ({ server, popup }) => { @@ -134,6 +165,29 @@ test("Add it yourself: the form in the line, the language picker, saved with no expect((await server.state()).log).toEqual([], "no request from the extension"); }); +// SCR-844 F4: Enter in the picker's search box picks the first language it lists, as the +// dashboard's picker does; with nothing listed it does nothing. +test("the popup's language picker: Enter picks the first match", async ({ popup }) => { + const line = await popup.add("gatto"); + await line.locator('[data-action="manual"]').click(); + const form = line.locator("form.manual-form"); + const language = form.locator('[data-action="language"]'); + await language.click(); + const picker = (await popup.page()).locator("dialog.picker"); + const search = picker.locator("input[type=search]"); + await expect(search).toBeFocused(); + await search.pressSequentially("zzqx"); + await expect(picker.locator(".picker-none")).toBeVisible(); + await search.press("Enter"); + await expect(picker).toBeVisible(); + await search.fill(""); + await search.pressSequentially("ital"); + await search.press("Enter"); + await expect(picker).toHaveCount(0); + await expect(language).toHaveText("Italian"); + await expect(language).toBeFocused(); +}); + test("closing the popup during a lookup still saves the word; reopening shows the result", async ({ context, extensionId, server, popup }) => { await setUpLookups(context, extensionId, server.llmUrl); await server.control({ llmDelayMs: 1500 }); diff --git a/test/e2e/privacy.spec.mjs b/test/e2e/privacy.spec.mjs index 1ac614d..ae2c109 100644 --- a/test/e2e/privacy.spec.mjs +++ b/test/e2e/privacy.spec.mjs @@ -244,7 +244,7 @@ test("the bundled privacy policy opens from the settings and renders as text", a expect(await policy.locator("#policy").getAttribute("lang")).toBe("en"); }); -test("the server address warns when the access key would cross a network unencrypted", async ({ context, extensionId, popup }) => { +test("the server address warns when words would cross a network unencrypted", async ({ context, extensionId, popup }) => { const dash = await context.newPage(); await dash.goto(`chrome-extension://${extensionId}/dashboard.html#settings/connection`); const field = dash.locator("#serverUrl"); @@ -253,7 +253,8 @@ test("the server address warns when the access key would cross a network unencry await expect(warn).toBeHidden(); await field.fill("http://192.168.1.5:4747"); await expect(warn).toBeVisible(); - await expect(warn).toContainText("http://"); + // Requests are signed (Kotiko-HMAC v2): the words travel in the clear, never the key (SCR-844 F6). + await expect(warn).toHaveText("This address starts with http://, so your words and your server's answers travel unencrypted (your access key itself is never sent). If anyone else shares this network, use an https:// address (for example with tailscale serve)."); await field.fill("http://100.101.102.103:4747"); await expect(warn).toBeHidden(); await field.fill("https://home.example"); diff --git a/test/unit/local-store.test.mjs b/test/unit/local-store.test.mjs index 7bbea71..7f04b31 100644 --- a/test/unit/local-store.test.mjs +++ b/test/unit/local-store.test.mjs @@ -170,6 +170,18 @@ describe("the projection for content scripts", () => { assert.equal(fake.store.local.wordsVersion.n, 2); assert.equal(fake.store.local.wordsVersion.by, "dash-1"); }); + + test("the projector says when a write deleted or restored a word, once (the dashboard's Recently deleted)", async () => { + const fake = createFakeChrome(); + const p = L.Projection.createProjector({ list: async () => [rec("a")], storage: fake.chrome.storage.local, bases: async () => ["en"], debounceMs: 20 }); + await p.flush(); + assert.equal("deleted" in fake.store.local.wordsVersion, false, "an edit says nothing about tombstones"); + p.schedule({ deleted: true }); + await p.schedule(); + assert.equal(fake.store.local.wordsVersion.deleted, true, "coalesced with a later write, the delete still counts"); + await p.flush(); + assert.equal("deleted" in fake.store.local.wordsVersion, false, "and only for the projection it was part of"); + }); }); describe("the add queue", () => { diff --git a/test/unit/release-tags.test.mjs b/test/unit/release-tags.test.mjs index 33e2ae3..7e23e6a 100644 --- a/test/unit/release-tags.test.mjs +++ b/test/unit/release-tags.test.mjs @@ -9,7 +9,7 @@ import { test, before, after } from "node:test"; import assert from "node:assert/strict"; import { execFileSync, spawnSync } from "node:child_process"; -import { copyFileSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs"; +import { copyFileSync, existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs"; import { tmpdir } from "node:os"; import { dirname, join } from "node:path"; import { fileURLToPath } from "node:url"; @@ -260,3 +260,30 @@ test("a signed candidate's tag object under a release's name is refused", () => assert.doesNotMatch(r.stdout, /prerelease=false/); assert.match(r.stderr, /signed as v9\.9\.9-rc\.1, not v9\.9\.9/); }); + +// SCR-844 F8: the release docs say what the repository holds. Once a version is out (the +// manifest at 1.0.0 or later) and a signing key is listed, no doc may still say there is no +// release, no tag or no key, and the verify guide may not send people to a key file that +// isn't there. +test("the release docs match the repository: a version out, a signing key listed", () => { + const read = (p) => readFileSync(join(ROOT, p), "utf8"); + const version = JSON.parse(read(".release-please-manifest.json"))["."]; + const keys = read(".github/allowed_signers").split("\n").filter((l) => l.trim() && !l.startsWith("#")); + assert.ok(Number(version.split(".")[0]) >= 1, `released: ${version}`); + assert.ok(keys.length >= 1, "a key in .github/allowed_signers"); + const stale = [ + /no (?:public )?release (?:has been|exists)/i, + /no version tag exists/i, + /git tag(?: -l`?)?:? (?:is )?empty/i, + /gh release list`?:? (?:is )?empty/i, + /lists none yet|no key yet/i, + /keeps saying 0\.2\.0/, + ]; + for (const doc of ["docs/best-practices.md", "docs/stores.md", "docs/verify.md", "SECURITY.md"]) { + for (const re of stale) assert.doesNotMatch(read(doc), re, doc); + } + if (!existsSync(join(ROOT, ".github/release-keys.asc"))) { + assert.doesNotMatch(read("docs/verify.md"), /listed in `\.github\/allowed_signers`\s+\(SSH\) or `\.github\/release-keys\.asc`/); + assert.match(read("docs/verify.md"), /no release key is GPG, so that file doesn't exist/); + } +}); diff --git a/test/unit/vex.test.mjs b/test/unit/vex.test.mjs new file mode 100644 index 0000000..c3029e2 --- /dev/null +++ b/test/unit/vex.test.mjs @@ -0,0 +1,83 @@ +// SPDX-FileCopyrightText: 2026 ScriptKittyOS and the Kotiko contributors +// SPDX-License-Identifier: Apache-2.0 + +// vex/kotiko.openvex.json is Kotiko's VEX document (OpenSSF Baseline OSPS-VM-04.02): every +// vulnerability reported in a dependency that doesn't affect Kotiko is stated there. A +// finding accepted in osv-scanner.toml is exactly that, so each one needs a `not_affected` +// statement with a justification, and the document must stay valid OpenVEX. The release +// workflow attaches it to every release as kotiko-X.Y.Z.openvex.json. +import { test } from "node:test"; +import assert from "node:assert/strict"; +import fs from "node:fs"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; + +const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../.."); +const vex = JSON.parse(fs.readFileSync(path.join(ROOT, "vex/kotiko.openvex.json"), "utf8")); + +// The ids of osv-scanner.toml's [[IgnoredVulns]] entries (comments skipped). +export function acceptedIds(toml) { + const ids = []; + let inEntry = false; + for (const raw of toml.split("\n")) { + const line = raw.replace(/#.*$/, "").trim(); + if (!line) continue; + if (line.startsWith("[")) inEntry = line === "[[IgnoredVulns]]"; + else if (inEntry) { + const m = /^id\s*=\s*"([^"]+)"$/.exec(line); + if (m) ids.push(m[1]); + } + } + return ids; +} + +const JUSTIFICATIONS = new Set([ + "component_not_present", + "vulnerable_code_not_present", + "vulnerable_code_not_in_execute_path", + "vulnerable_code_cannot_be_controlled_by_adversary", + "inline_mitigations_already_exist", +]); + +test("the VEX document is OpenVEX 0.2.0 with the fields every document needs", () => { + assert.equal(vex["@context"], "https://openvex.dev/ns/v0.2.0"); + for (const k of ["@id", "author", "timestamp"]) assert.ok(typeof vex[k] === "string" && vex[k], `${k} is set`); + assert.ok(!Number.isNaN(Date.parse(vex.timestamp)), "timestamp is a date"); + assert.ok(Number.isInteger(vex.version) && vex.version >= 1, "version is a positive integer"); + assert.ok(Array.isArray(vex.statements), "statements is a list"); + for (const s of vex.statements) { + assert.ok(s.vulnerability?.name, "each statement names its vulnerability"); + assert.ok(Array.isArray(s.products) && s.products.length, `${s.vulnerability?.name}: names the products`); + assert.ok(["not_affected", "affected", "fixed", "under_investigation"].includes(s.status), `${s.vulnerability.name}: a known status`); + if (s.status === "not_affected") { + assert.ok(JUSTIFICATIONS.has(s.justification) || s.impact_statement, `${s.vulnerability.name}: not_affected needs a justification or impact statement`); + } + } +}); + +test("every finding accepted in osv-scanner.toml is stated not_affected in the VEX document", () => { + const accepted = acceptedIds(fs.readFileSync(path.join(ROOT, "osv-scanner.toml"), "utf8")); + const notAffected = new Set( + vex.statements + .filter((s) => s.status === "not_affected") + .flatMap((s) => [s.vulnerability.name, ...(s.vulnerability.aliases ?? [])]), + ); + for (const id of accepted) { + assert.ok(notAffected.has(id), `${id} is accepted in osv-scanner.toml but has no not_affected statement in vex/kotiko.openvex.json`); + } +}); + +test("acceptedIds reads only [[IgnoredVulns]] ids, not comments or other tables", () => { + const toml = [ + "# [[IgnoredVulns]]", + '# id = "GHSA-comm-ente-dout"', + "[[IgnoredVulns]]", + 'id = "GHSA-aaaa-bbbb-cccc" # high', + "ignoreUntil = 2026-12-17", + "[[PackageOverrides]]", + 'id = "not-a-vuln"', + "[[IgnoredVulns]]", + 'id = "GO-2026-0001"', + ].join("\n"); + assert.deepEqual(acceptedIds(toml), ["GHSA-aaaa-bbbb-cccc", "GO-2026-0001"]); +}); diff --git a/test/unit/word-source.test.mjs b/test/unit/word-source.test.mjs index b3f3917..6f85a39 100644 --- a/test/unit/word-source.test.mjs +++ b/test/unit/word-source.test.mjs @@ -90,6 +90,17 @@ describe("the server source", () => { assert.equal(seen.length, 3); }); + test("local mode: a pages' list update that deleted or restored a word reloads Recently deleted, our own included", async () => { + const { src, onChanged } = source(() => ({})); + const seen = []; + src.subscribe(({ reason }) => seen.push(reason)); + // Local mode keeps tombstones in IndexedDB: no `recentlyDeleted` change ever comes. + onChanged.dispatch({ wordsVersion: { newValue: { n: 4, at: 1, by: "me", deleted: true } } }, "local"); + onChanged.dispatch({ wordsVersion: { newValue: { n: 5, at: 2, by: null, deleted: true } } }, "local"); + onChanged.dispatch({ wordsVersion: { newValue: { n: 6, at: 3, by: "me" } } }, "local"); + assert.deepEqual(seen, ["deleted", "version", "deleted"]); + }); + test("changedKeys compares the pages' list by language and spelling", () => { const a = [{ lang: "ru", native: "Дом", english: "house" }, { lang: "ar", native: "بيت", english: "house" }]; const b = [{ lang: "ru", native: "дом", english: "home" }, { lang: "ar", native: "بيت", english: "house" }, { lang: "ja", native: "猫" }]; diff --git a/vex/kotiko.openvex.json b/vex/kotiko.openvex.json new file mode 100644 index 0000000..dc5856d --- /dev/null +++ b/vex/kotiko.openvex.json @@ -0,0 +1,10 @@ +{ + "@context": "https://openvex.dev/ns/v0.2.0", + "@id": "https://github.com/ScriptKittyOS/kotiko/blob/main/vex/kotiko.openvex.json", + "author": "ScriptKittyOS and the Kotiko contributors ", + "role": "Project maintainers", + "timestamp": "2026-12-05T00:00:00Z", + "version": 1, + "tooling": "Hand-written; kept in step with osv-scanner.toml by test/unit/vex.test.mjs", + "statements": [] +}