Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .claude/agents/change-refuter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
name: change-refuter
description: Try to refute a change or a security claim, with file:line evidence
tools: Read, Grep, Glob, Bash
---

Assume the change is wrong and look for the reason.

Look for the code path that makes the claim false, a guard that already exists upstream (grep the base commit as well), a test that would catch it, and behaviour at the edges: empty input, loopback and link-local addresses, zero, overflow, a revoked or demoted user, an offline peer, a multi-gigabyte WAL.

Return VERIFIED, REFUTED or PARTIAL per item, each with file:line evidence, then state what you could not check. Do not pad the verdicts and do not fix anything.
9 changes: 9 additions & 0 deletions .claude/agents/codebase-locator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
name: codebase-locator
description: Find the files, routes and functions relevant to a question in EarthGrid, without surveying the whole tree
tools: Grep, Glob, Read, Bash
---

Report only file paths with line numbers and one line each on why the location matters.

Search by symbol, route string, SQL table name, environment variable and error text. Prefer several narrow searches over one broad listing. Do not survey the repository, do not summarise its architecture, and do not recommend changes. If a few targeted searches find nothing, say that plainly instead of widening the search indefinitely.
15 changes: 15 additions & 0 deletions .claude/commands/deploy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
description: Build and deploy EarthGrid on nucleus, with the stop-copy-start sequence and verification
allowed-tools: Bash
---

Never copy over a running binary: the copy fails and the service restarts on the old one.

1. `cd ~/dev/EarthGrid` on nucleus and confirm HEAD (`git log --oneline -1`) is the commit you intend to ship.
2. `export PATH="$HOME/.cargo/bin:$PATH"; cd earthgrid-core; cargo build --release`
3. `cp -a ~/.cargo/bin/earthgrid ~/.cargo/bin/earthgrid.bak-<short-sha>`
4. `export XDG_RUNTIME_DIR=/run/user/$(id -u); systemctl --user stop earthgrid; sleep 2; cp target/release/earthgrid ~/.cargo/bin/earthgrid; systemctl --user start earthgrid`
5. Wait for `ss -tln | grep 8400` before judging anything. A warm restart binds in about 25 s; a cold one replays the WAL and takes 3 to 4 minutes with the main thread in D state. Do not kill it and do not reset anything.
6. Verify, and report each result: `md5sum ~/.cargo/bin/earthgrid` against the build output; `curl localhost:8400/health`; `curl -L localhost:8400/dashboard`; `curl localhost:8400/api/beacon/nodes` still listing the nodes. For a UI change, grep the deployed binary for a string the change introduced, because the assets are embedded.

The Lenovo is a second node and is deployed by hand the same way.
13 changes: 13 additions & 0 deletions .claude/commands/gate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
description: Run the EarthGrid gate - release build, tests, and a syntax check on the embedded HTML
allowed-tools: Bash
---

Run these in order from `earthgrid-core/` and stop at the first failure. Report raw output, never a summary of it.

1. `export PATH="$HOME/.cargo/bin:$PATH"; cargo build --release` - must end with 0 errors and 0 warnings.
2. `cargo test` - quote the exact `test result:` line, including ignored counts.
3. `ui.html` and `beacon.html` are `include_str!` assets, so cargo cannot see a JavaScript syntax error in them. Extract every `<script>` block from both files and run `node --check` on each.
4. If `Cargo.lock` or `Cargo.toml` changed, show the resolved version diff and confirm it is the intended change.

Finish with: the commit hash (`git rev-parse --short HEAD`), the build time, the test counts, and any failure verbatim. A failure that is described instead of quoted is not a report.
17 changes: 17 additions & 0 deletions .claude/commands/verify.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
description: Adversarially verify a change or a security claim against the current checkout
allowed-tools: Read, Grep, Glob, Bash
---

You are the second opinion. First state what you are reviewing: `git rev-parse --abbrev-ref HEAD` and `git rev-parse --short HEAD`, plus the diff (`git diff <base>..HEAD`).

Then try to refute it. For every claim return VERIFIED, REFUTED or PARTIAL with file:line evidence.

Rules:
- A summary, a commit message or a test name is not evidence. Read the code path.
- For a security claim, read the code that would have to be missing for the finding to be true, and say whether it is there.
- Check the edges: empty input, loopback addresses, zero and overflow, revoked or demoted identity, a peer that is offline.
- If the same guard already exists upstream, grep the base commit too and say so.
- End with what you could not check, explicitly. Silence about a limit reads as coverage.

Do not change anything while verifying.
14 changes: 14 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@
> Context for AI coding tools (Claude Code, Codex, Cursor, etc.)
> Read this before making any changes.

## Definition of done

A change is done only when all of these hold, and you report the evidence rather than a description of it:

- `cargo build --release` is clean, and the `cargo test` counts are quoted from the actual run.
- `ui.html` and `beacon.html` are embedded assets, so a JavaScript change there is only really checked by extracting each `<script>` block and running `node --check` on it.
- A second pass has tried to refute the change and nothing stands.
- Anything user-facing is verified on the running node, not just in the repo: for the nucleus beacon that means the MD5 of `~/.cargo/bin/earthgrid` matching the build, `/health`, `/dashboard`, and the node still present in `/api/beacon/nodes`.
- Every result states the commit hash it came from.

Slash commands for this: `/gate`, `/verify`, `/deploy`.

Reviewers, human or model, must name the branch and commit they read. A review of a stale worktree on this project produced two false critical findings, and the fix cost more than the review.

## Project Overview

EarthGrid is a **decentralized P2P network for Earth observation data**. Nodes store satellite imagery (Sentinel-2, Landsat) as content-addressed chunks and serve them via STAC API and openEO processing.
Expand Down
Loading