quarry AGENTS.md

Repository instructions for Quarry, covering its AI-agent rules and its graphical user interface. The interface is a React and TypeScript web app served by a Python backend.

In plain words
What is it for?
Guiding GUI changes, building the web frontend, updating the feature matrix, and running browser tests for user-visible behavior.
Why use it?
They explain where frontend and backend changes belong, how the development loop works, and which tests document visible interface behavior. They also require the feature matrix to stay accurate.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/yiminspace/quarry/agents-md
Clone the repo
git clone --depth 1 https://github.com/yiminspace/quarry

Made for: Codex, OpenCode.

Per session 1,130 This file is loaded in full into every session.
When invoked 1,130 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01130 $0.01130
Opus 5 $0.00565 $0.00565
Sonnet 5 $0.00226 $0.00226
Haiku 4.5 $0.00113 $0.00113

Measured 2d ago against content hash 0bdd82aedaec, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

quarry AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 78 lines

How it starts

The opening of the file, as written. The whole thing — 78 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Agent rules for this repo

Guidance for AI coding agents (and humans) working on Quarry.

GUI changes (web/ frontend + src/quarry/gui.py backend)

The GUI is a React + TypeScript SPA in web/ (Vite build, zustand stores), served by the stdlib-only Python backend in src/quarry/gui.py (http.server + /api/* handlers). gui.py holds no frontend markup or JS — it only serves web/'s build output (src/quarry/web_dist/, built via npm run build from web/) under /app/, which is the default landing page (/ redirects there). Because the feature surface lives in a handful of components (web/src/*.tsx) plus the stores (web/src/store/*.ts), it is still exhaustively enumerable — and we keep it enumerated:

  1. The GUI feature matrix in TESTING.md is the source of truth for frontend coverage. Any change that adds, alters, or removes a user-visible GUI behavior must update the matching matrix row(s) in the same PR — including honest status downgrades (✅→🟡/❌) when behavior changed and the old test no longer proves it.
  2. New feature points get a browser test in tests/test_gui_browser_features.py (page fixtures come from tests/conftest.py; console errors are an autouse invariant in that module). Backend/API logic belongs in test_gui_backend.py / test_gui_api.py — do not re-test engine behavior through the browser.
  3. Design tokens are law: every visible color in web/src must reference the CSS variables defined at the top of web/src/App.css (the legacy "Slate & Copper" palette, dark default + html[data-theme=light]). Never introduce a literal color value in a component or stylesheet body. tests/test_gui_visual.py pins the tokens via getComputedStyle in both themes — extend it when styling new chrome.
  4. Run all three audits after touching web/src/ (details + state inventory in TESTING.md "Keeping the matrix honest"):
    • Existence: every interaction binding, localStorage key, and consumed /api/* endpoint maps to a matrix row (catches untested code);
    • Capability: per UI region, list what a SQL-client user would expect, diff against reality, file misses in the Design-gaps table (catches missing features — existence auditing can never see these);
    • Shared-state: when writing any store state (connStore, tabsStore, uiStore, the per-tab result snapshots, sort/selection state, …), check every reader; features sharing state need an interaction test (catches cross-feature bugs like "export uses another tab's result").
  5. When adding a UX invariant, enumerate ALL write sites of the protected state (grep, list them in the PR) and cover each — partial rollout of an invariant is how "closing a tab loses SQL" shipped.
  6. UX invariants that must never regress (each is pinned by a browser test):
    • hand-written editor SQL is never silently lost — every editor overwrite (table click / key inspect / saved query / history recall / tab close) goes through keepDraft()/pushHist() in useSqlHistory; Cmd/Ctrl+↓ restores the stash;
    • switching the env pill to prod never auto-runs the current SQL;
    • overlapping query responses are latest-wins (the per-tab startReq/isCurrentReq/endReq request-tracking guard) — a stale response must never repaint the grid;
    • the grid, status bar, and exports always reflect the active tab's result (its own snapshot in tabsStore), never another tab's;
    • column sort is numeric-aware, and a third click restores original order;
    • lists are never silently truncated (redis 400-key cap, 5000-table cap → visible notice).

Read the full file on GitHub · 78 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 78 lines · 1,130 tokens per session scan A 0bdd82aedaec

Subscribe to this mod's changes

quarry AGENTS.md is an instructions file published in the GitHub repository yiminspace/quarry (3 stars, last pushed 7d ago), licensed MIT. It adds 1,130 tokens to every session, about $0.0056 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.