From 1281f82eb463dd9bc38af0227d9b0994dc9079ec Mon Sep 17 00:00:00 2001 From: giswqs Date: Wed, 25 Nov 2026 08:05:42 -0500 Subject: [PATCH 1/3] ci,docs: tighten workflow permissions and scope filter, update docs - Match nested and case-variant .cargo paths and all .github/scripts/*.py files in the licenses job scope filter in .github/workflows/ci.yml. - Add top-level permissions: contents: read to ci-label.yml and python.yml. - Update docs/contributing.md, README.md, and docs/architecture.md to match cargo xtask ci, the full xtask command list, the path-scoped licenses/schema CI jobs, and the current workspace crates. - Replace the non-existent layer.buffer command example in docs/user-guide/workspace.md with gp.run. --- .github/workflows/ci-label.yml | 3 +++ .github/workflows/ci.yml | 7 ++++--- .github/workflows/python.yml | 3 +++ README.md | 7 ++++--- docs/architecture.md | 7 ++++--- docs/contributing.md | 15 +++++++++++---- docs/user-guide/workspace.md | 2 +- 7 files changed, 30 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci-label.yml b/.github/workflows/ci-label.yml index 834cad0c18..3a9eb5e892 100644 --- a/.github/workflows/ci-label.yml +++ b/.github/workflows/ci-label.yml @@ -9,6 +9,9 @@ on: pull_request: types: [labeled, unlabeled] +permissions: + contents: read + concurrency: group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.label.name }} cancel-in-progress: true diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 66843bab2e..aa270a658d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -172,7 +172,7 @@ jobs: echo "run=true" >> "$GITHUB_OUTPUT" exit 0 fi - if grep -qE '^(Cargo\.lock|(.*/)?Cargo\.toml|deny\.toml|about\.toml|xtask/src/(main|notices)\.rs|(.*/)?THIRD-PARTY-LICENSES\.txt|\.github/scripts/(check-cargo-sources|review-deferrals|ratchet-limits|test_[^/]+)\.py|\.github/workflows/ci\.yml|crates/map/src/color/(scientific|matplotlib)\.rs|crates/tiles/src/(symbols|style)\.rs|crates/data/src/(raster/crs|esripbf)\.rs)$|^(third-party/|\.cargo/)' <<<"$changed"; then + if grep -qE '^(Cargo\.lock|(.*/)?Cargo\.toml|deny\.toml|about\.toml|xtask/src/(main|notices)\.rs|(.*/)?THIRD-PARTY-LICENSES\.txt|\.github/scripts/[^/]+\.py|\.github/workflows/ci\.yml|crates/map/src/color/(scientific|matplotlib)\.rs|crates/tiles/src/(symbols|style)\.rs|crates/data/src/(raster/crs|esripbf)\.rs)$|^third-party/' <<<"$changed" || grep -iqE '(^|/)\.cargo(/|$)' <<<"$changed"; then echo "run=true" >> "$GITHUB_OUTPUT" else echo "No dependency, licence or notice files changed; skipping." @@ -331,8 +331,9 @@ jobs: MERGE_GROUP_REF: ${{ github.event.merge_group.head_ref }} run: python3 .github/scripts/ratchet-limits.py - # The packages whose tests this run needs, for `test` (.github/scripts/test-selection.sh). Only - # tests are narrowed: lint, the wasm build, licences and the schema check run whole every time. + # The packages whose tests this run needs, for `test` (.github/scripts/test-selection.sh). Lint + # and the wasm build run whole every time; licences and the schema check skip on pull requests + # and merge groups when none of their watched files changed. select: name: Tests to run runs-on: ubuntu-latest diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index a9f8ce846b..1174ad90d8 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -25,6 +25,9 @@ on: types: [published] workflow_dispatch: +permissions: + contents: read + # A new push to a pull request replaces its earlier run. Runs on main, by hand and for releases # are never cancelled: a merge landing mid-build must not stop the wheels being built. concurrency: diff --git a/README.md b/README.md index 858bcb1c68..5b3a48b490 100644 --- a/README.md +++ b/README.md @@ -191,16 +191,17 @@ Layered crates, each depending only on the ones below it: | L0 | `rustgis-geom` | coordinates, extents, Web Mercator, geodesic distance/area, scale | | L1 | `rustgis-data` | features and typed attributes; GeoJSON, CSV, Shapefile, KML, GPX and more; GeoPackage, GeoParquet, FlatGeobuf, LiDAR, PostGIS and MySQL providers; GDAL formats and DuckDB queries through their programs; SQL where clauses; rasters (GeoTIFF, ASCII grid, Zarr) and their coordinate systems | | L2 | `rustgis-map`, `rustgis-analysis` | layers, symbology, labeling, camera, basemaps; geoprocessing (on `geo`) | -| L2 | `rustgis-tiles` | web map tiles: XYZ/TMS/WMS, Mapbox Vector Tiles, PMTiles and MBTiles archives, MapLibre styles, the tile cache | +| L2 | `rustgis-tiles`, `rustgis-keychain` | web map tiles: XYZ/TMS/WMS, Mapbox Vector Tiles, PMTiles and MBTiles archives, MapLibre styles, the tile cache; the system's secret store | | L3 | `rustgis-render` | tiny-skia renderer, label placement, PNG export, fonts | | L3 | `rustgis-plugins` | sandboxed WebAssembly plugins and the plugin registry | | L3 | `rustgis-geolibre` | the GeoLibre tool suite as geoprocessing tools | | L4 | `rustgis-engine` | session, undo, command registry, sample project | | L5 | `rustgis-assistant` | the AI Assistant: a chat agent that acts through commands | | L6 | `rustgis-ui-egui` | the ribbon front end (swappable) | -| apps | `rustgis`, `rustgis-cli`, `rustgis-web`, `rustgis-python` | desktop, command line, browser (WebAssembly), the `rustgis` Python package | +| L7 | `rustgis-ui-touch` | the phone interface around `rustgis-ui-egui`'s map view | +| apps | `rustgis`, `rustgis-cli`, `rustgis-web`, `rustgis-python`, `rustgis-mobile` | desktop, command line, browser (WebAssembly), the `rustgis` Python package, Android and iOS | -`cargo xtask ci` runs formatting, clippy, the tests and the layering check. Contributor and +`cargo xtask ci` runs formatting, clippy, the tests, layering, test hygiene, attribution, row-use and schema checks. Contributor and agent notes: [AGENTS.md](AGENTS.md). ## Sponsor diff --git a/docs/architecture.md b/docs/architecture.md index bf89a12c48..3186df442c 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -8,14 +8,15 @@ engine scriptable and the front end swappable. | L0 | `rustgis-geom` | Coordinates, extents, Web Mercator, geodesic distance/area, scale | | L1 | `rustgis-data` | Features, typed attributes, vector and spreadsheet I/O, SQL where clauses, LiDAR, rasters and EPSG reprojection; indexed file and remote data providers; live PostGIS, MySQL/MariaDB and SQL Server providers on the desktop; optional GDAL and DuckDB programs (see [Data formats](user-guide/data-formats.md)) | | L2 | `rustgis-map`, `rustgis-analysis` | Layers, symbology, labeling, camera, basemaps and web tile layers; geoprocessing tools | -| L2 | `rustgis-tiles` | Web map tiles: XYZ/TMS/WMS raster tiles, Mapbox Vector Tiles, PMTiles and MBTiles archives and a subset of MapLibre styles; a cache that fetches in the background (worker threads natively, the browser's `fetch` on the web) | +| L2 | `rustgis-tiles`, `rustgis-keychain` | Web map tiles: XYZ/TMS/WMS raster tiles, Mapbox Vector Tiles, PMTiles and MBTiles archives and a subset of MapLibre styles; a cache that fetches in the background (worker threads natively, the browser's `fetch` on the web); the system's secret store | | L3 | `rustgis-render` | tiny-skia renderer, label placement, font discovery, map and layout export, and UI-independent GPU scene preparation | | L3 | `rustgis-geolibre` | The [GeoLibre tools](user-guide/analysis.md#geolibre-tools) as geoprocessing tools: run by the optional `geolibre` program natively, by geolibre-rust's WASI runner in the browser | | L3 | `rustgis-plugins` | [Plugins](plugins.md): sandboxed WebAssembly modules, desktop process plugins and assistant skills packages; `.rgplugin` packages and the plugin registry | | L4 | `rustgis-engine` | Session, undo, command registry, projects, sample project | | L5 | `rustgis-assistant` | The [AI Assistant](user-guide/assistant.md): provider request/response formats, conversation loop, command tools, skills and agent integration; native HTTP transport and local agent/MCP connections, with browser I/O supplied by the web app | | L6 | `rustgis-ui-egui` | Ribbon, panes, map view, dialogs and the optional wgpu map backend | -| apps | `rustgis`, `rustgis-cli`, `rustgis-web`, `rustgis-python` | Desktop app, command line, browser (WebAssembly), and the PyO3-backed `rustgis` Python package | +| L7 | `rustgis-ui-touch` | The phone interface around `rustgis-ui-egui`'s map view | +| apps | `rustgis`, `rustgis-cli`, `rustgis-web`, `rustgis-python`, `rustgis-mobile` | Desktop app, command line, browser (WebAssembly), the PyO3-backed `rustgis` Python package, and Android and iOS | | tooling | `xtask` | Workspace checks, third-party licence notices and web service-worker generation | ## Everything is a command @@ -175,7 +176,7 @@ model listing. ## Quality gates ```sh -cargo xtask ci # fmt, clippy -D warnings, tests, layering check +cargo xtask ci # fmt, clippy -D warnings, tests, layers, test-hygiene, attribution, rows, schema --check ``` `cargo xtask layers` checks that workspace dependencies point to lower layers and that crates diff --git a/docs/contributing.md b/docs/contributing.md index e4044fa502..63ddf17426 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -69,8 +69,9 @@ destroy user data. ## Developer checks `cargo xtask ci` runs `cargo fmt --all --check`, -`cargo clippy --workspace --all-targets -- -D warnings`, `cargo test --workspace -q` and -`cargo xtask layers`. The pre-commit hooks also check TOML, YAML, JSON, whitespace and large files. +`cargo clippy --workspace --all-targets -- -D warnings`, `cargo test --workspace -q`, +`cargo xtask layers`, `cargo xtask test-hygiene`, `cargo xtask attribution`, `cargo xtask rows` +and `cargo xtask schema --check`. The pre-commit hooks also check TOML, YAML, JSON, whitespace and large files. CI separately builds `rustgis-web` for `wasm32-unknown-unknown` and runs `cargo deny --locked check licenses sources` against `deny.toml`, including development dependencies. The fuzz workflow applies the same source policy using `fuzz/deny.toml`, which @@ -94,8 +95,9 @@ bug to fix, not a retry to rely on; the retries are a stopgap for tests that wai A pull request's CI runs the tests of the packages it changes and those that depend on them, as `cargo xtask changed --list` finds them. The whole workspace is tested for a push to `main`, a `ci:` label, a manual run on every platform, a change to `Cargo.lock`, `rust-toolchain*`, `.github/` -or `.config/`, and a file outside every package that nothing includes. Lint, the wasm build, the -licence check and the schema check always run whole. The `Tests pass` job fails when any other job +or `.config/`, and a file outside every package that nothing includes. Lint and the wasm build +always run whole; the licence and schema checks run on pull requests and merge groups only when +their watched files change. The `Tests pass` job fails when any other job does; it is the check to require before merging. Workflow actions are pinned to full commit SHAs with the previous version or branch in a comment. @@ -108,7 +110,12 @@ Other workspace tasks: | --- | --- | | `cargo xtask changed [--list] [base]` | Run the `cargo xtask ci` checks on only the packages your branch changes and those that depend on them: a quicker check while you work. A file outside every package that no package includes, such as `Cargo.lock`, checks the whole workspace. `--list` prints the packages without checking them | | `cargo xtask layers` | Check crate dependency direction (target-specific dependencies included) and keep UI dependencies out of lower layers; a new crate under `crates/` needs a layer in `LAYERS` | +| `cargo xtask test-hygiene` | Check tests for documented timer waits (`// test-wait:`), `#[ignore = "..."]` reasons and tautological assertions | | `cargo xtask attribution` | Check that every image and font file has a row in `ATTRIBUTION.md` (its path, a directory above it or a pattern in backticks; a bare name covers a file at the repository root) | +| `cargo xtask rows [--update]` | Check that direct `Feature` row accesses outside `rustgis-data` stay within `xtask/row-uses.txt`; `--update` writes a lower count | +| `cargo xtask memory` | Measure peak memory of representative CLI workflows against `xtask/memory-limits.txt` (Linux) | +| `cargo xtask commands` | Refresh `crates/engine/command-surface.txt` after adding, removing or renaming a registered command or parameter | +| `cargo xtask schema [--check]` | Regenerate `schema/project.schema.json` from the saved project types, or verify it is up to date (`--check`) | | `cargo xtask notices` | Regenerate the shipped `THIRD-PARTY-LICENSES.txt` files after changing dependencies, or after adding code or data from another project to `INCLUDED` in `xtask/src/notices.rs` (with its licence text in `third-party/`); requires `cargo-about` | | `cargo xtask notices --check` | Check the notices without writing them; stale notices warn in CI but block releases | | `cargo xtask web-pwa ` | Generate the service worker in a Trunk build output directory, such as `dist/web` | diff --git a/docs/user-guide/workspace.md b/docs/user-guide/workspace.md index 8240513820..7746c67782 100644 --- a/docs/user-guide/workspace.md +++ b/docs/user-guide/workspace.md @@ -134,7 +134,7 @@ lists the newest 200 that match and says how many there are; type part of a comm `export`) to filter, or tick **Failed only**. A right-click on an entry offers **Copy Parameters** and **Copy Command**, the entry as a line for -the Script pane (`layer.buffer {"distance":10}`; undo and redo as themselves). A script run offers +the Script pane (`gp.run {"tool":"buffer","params":{"input":"Cities","distance":10}}`; undo and redo as themselves). A script run offers **Copy Script** and **Open in Script Pane** instead, which puts the script in the Script pane in place of its own (Ctrl+Z, ⌘+Z on a Mac, brings that back; not while the pane runs one). Where the log cut an entry's parameters short or took secrets out of them, copying its command or its From 7afabad936a02963fc4502a5703c0d124e99f64b Mon Sep 17 00:00:00 2001 From: giswqs Date: Wed, 25 Nov 2026 08:17:10 -0500 Subject: [PATCH 2/3] ci: pass --no-renames to git diff in licenses and schema scope checks --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aa270a658d..14a088c666 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -168,7 +168,7 @@ jobs: echo "run=true" >> "$GITHUB_OUTPUT" exit 0 fi - if ! changed="$(git diff --name-only "$fork_point" HEAD 2>/dev/null)"; then + if ! changed="$(git diff --no-renames --name-only "$fork_point" HEAD 2>/dev/null)"; then echo "run=true" >> "$GITHUB_OUTPUT" exit 0 fi @@ -237,7 +237,7 @@ jobs: echo "run=true" >> "$GITHUB_OUTPUT" exit 0 fi - if ! changed="$(git diff --name-only "$fork_point" HEAD 2>/dev/null)"; then + if ! changed="$(git diff --no-renames --name-only "$fork_point" HEAD 2>/dev/null)"; then echo "run=true" >> "$GITHUB_OUTPUT" exit 0 fi From e2d4e965303db16075b970df20da8e7a97e4a441 Mon Sep 17 00:00:00 2001 From: giswqs Date: Wed, 25 Nov 2026 08:48:10 -0500 Subject: [PATCH 3/3] ci: read changed paths NUL-delimited in licenses and schema scope filters --- .github/workflows/ci.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 14a088c666..85031c59a8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -168,11 +168,13 @@ jobs: echo "run=true" >> "$GITHUB_OUTPUT" exit 0 fi - if ! changed="$(git diff --no-renames --name-only "$fork_point" HEAD 2>/dev/null)"; then + changed_file="$(mktemp)" + trap 'rm -f "$changed_file"' EXIT + if ! git diff -z --no-renames --name-only "$fork_point" HEAD >"$changed_file" 2>/dev/null; then echo "run=true" >> "$GITHUB_OUTPUT" exit 0 fi - if grep -qE '^(Cargo\.lock|(.*/)?Cargo\.toml|deny\.toml|about\.toml|xtask/src/(main|notices)\.rs|(.*/)?THIRD-PARTY-LICENSES\.txt|\.github/scripts/[^/]+\.py|\.github/workflows/ci\.yml|crates/map/src/color/(scientific|matplotlib)\.rs|crates/tiles/src/(symbols|style)\.rs|crates/data/src/(raster/crs|esripbf)\.rs)$|^third-party/' <<<"$changed" || grep -iqE '(^|/)\.cargo(/|$)' <<<"$changed"; then + if grep -zqE '^(Cargo\.lock|(.*/)?Cargo\.toml|deny\.toml|about\.toml|xtask/src/(main|notices)\.rs|(.*/)?THIRD-PARTY-LICENSES\.txt|\.github/scripts/[^/]+\.py|\.github/workflows/ci\.yml|crates/map/src/color/(scientific|matplotlib)\.rs|crates/tiles/src/(symbols|style)\.rs|crates/data/src/(raster/crs|esripbf)\.rs)$|^third-party/' "$changed_file" || grep -ziqE '(^|/)\.cargo(/|$)' "$changed_file"; then echo "run=true" >> "$GITHUB_OUTPUT" else echo "No dependency, licence or notice files changed; skipping." @@ -237,11 +239,13 @@ jobs: echo "run=true" >> "$GITHUB_OUTPUT" exit 0 fi - if ! changed="$(git diff --no-renames --name-only "$fork_point" HEAD 2>/dev/null)"; then + changed_file="$(mktemp)" + trap 'rm -f "$changed_file"' EXIT + if ! git diff -z --no-renames --name-only "$fork_point" HEAD >"$changed_file" 2>/dev/null; then echo "run=true" >> "$GITHUB_OUTPUT" exit 0 fi - if grep -qE '^(crates/(geom|data|map|analysis|tiles|render|plugins|geolibre|engine)/|schema/|Cargo\.(toml|lock)$|rust-toolchain|xtask/src/main\.rs$|\.github/workflows/ci\.yml$)' <<<"$changed"; then + if grep -zqE '^(crates/(geom|data|map|analysis|tiles|render|plugins|geolibre|engine)/|schema/|Cargo\.(toml|lock)$|rust-toolchain|xtask/src/main\.rs$|\.github/workflows/ci\.yml$)' "$changed_file"; then echo "run=true" >> "$GITHUB_OUTPUT" else echo "No schema-related files changed; skipping."