Rust and C/C++ IDE. Tauri 2 + React 19 shell; clangd, rust-analyzer and lldb-dap do the real work.
- Scope: Rust + C/C++ only, CLion parity on the daily loop. Never a general editor.
- CLion is the reference for both UI and features — reverse-engineer it with the
reaMCP tools when the target behaviour is unclear, instead of guessing; screenshots live in the gitignoreddocs/reference/. - Plan is
docs/plans/001-clion-parity.md— parity matrix, slices, estimates, non-goals; read before feature work. - Non-goals stay non-goals: profiler, remote, embedded, DB, Docker, AI, plugin API, other languages.
- Toolchains are detected, never bundled — probe
PATHthenxcrun --find; GUI launch carries launchd's PATH. - A PATH-only probe misses Homebrew and cargo binaries — a Dock-launched app sees
/usr/bin:/bin:/usr/sbin:/sbin;src-tauri/src/format/tool_search.rstherefore searchesPATHfirst, then/opt/homebrew/bin,/usr/local/binand$HOME/.cargo/bin, andtaplo 0.10.0at/opt/homebrew/bin/taplois only reachable that way. - Machine paths: rustup shims
/opt/homebrew/opt/rustup/bin;lldb-dapandclang-formatonly viaxcrun;cmakeandninjaexist at/opt/homebrew/bin(Homebrew), which a GUI launch does not see onPATH. - No
cargo runas a debug launch — build first, passlldb-dapthe binary from cargo JSON. - Rust module is
build_task.rs, neverbuild.rs(Cargo's build script). src/only,@/*maps to./src/*; no root-levellib/.- Logic is
src/lib, rendering issrc/ui— the feature directory name is kept on both sides (lib/editor/theme.ts,ui/editor/Editor.tsx);@/for cross-tree imports, relative only inside one directory; consts insrc/lib/consts. - No file over 200 lines —
scripts/check-file-size.tsruns as the gate's first step and fails on a new offender or on a stale entry indocs/refactor/oversized.txt, which may only shrink. - Split Rust by module directories (
foo.rs→foo/mod.rs+mod bar;+pub use), solib.rsneeds no edit; neverinclude!("partN.rs"), which keeps one scope and is not a module split at all (measured 2026-10-23: 195 compile errors). - Stylesheets split with
bun scripts/split-css.ts <file>— section files under<name>/plus an@importindex, so cascade order survives. - A new stylesheet is named for what it styles (
run-log.css), never numbered — the existing1-root.css…20-menubar.cssare legacy and keep their names;styles.cssorder is what decides the cascade, not the filename. - Starter file contents live in
src-tauri/src/new_project/templates.rs, and inserted snippets insrc/lib/consts/generate.ts— a template is content the user reads and judges, and inline in aformat!it cannot be asserted whole, edited in one place, or found by search (2026-11-09: the C++ starter, the Rust library and both.gitignorefiles were string literals insidecreate_project). - Gates:
bun checkfor types,bun fmt --checkfor formatting,biome lintfor lint,bun testfor frontend units,bun run gatebefore a commit — hard tabs 4 wide, print width 100; warnings fail, so leave zero. - A
biome lintfailure can hide its error past the diagnostic cutoff — the output shows warnings and a bare "Found 1 error"; rerunbunx biome lint --max-diagnostics=500 --reporter=json <path>and read theseverity: "error"entry (2026-11-09: a test helper namedescapetrippednoShadowRestrictedNames). - A component test that needs a DOM sets up its own window —
@/test/domregisters once per process, so a new file importing it starved three neighbour dialog tests ofdocument;src/test/render.tsxadds only what is missing and deletes only what it added (2026-11-09). fireEvent.inputreaches React'sonInput, never itsonChange, in this harness — a field a DOM test types into listens withonInput(src/ui/structure/StructurePalette.tsx);fireEvent.changeis inert too, so neither is a substitute.bun run gateruns two lanes at once and reports milliseconds — the frontend checks and the cargo chain are independent, and inside a lane the steps stay sequential because cargo holds the target directory lock;cargo check --all-targetsis deliberately absent because clippy typechecks every target and then lints it, so re-adding the check pass buys a second compile and nothing else (2026-11-09: 10.65s to 5.62s on one crate rebuild).- The gate runs the tests with
cargo-nextestwhen it is installed and falls back tocargo test— same suite, its own parallel runner and no doc-test compile (6.99s to 4.95s);ci.ymlinstalls it so the fallback is not the path that ships. - Tests are Cargo and GoogleTest in one dock —
list_testsreturnsTestDiscovery(items, the gtest program asked, one note per source that failed); a gtest list comes only from a.quarry/launch.jsonpreset naming a program, never a guessed path. - A Cargo test list is built per binary, never from cargo's
Running …headers (2026-11-14) — cargo prints those headers on unbuffered stderr while thename: testlines go to buffered stdout, so any merged-stream attribution labels an integration case with whichever binary the interleave put first (measured:tests/parity.rsshown undersrc/lib.rs);cargo test --no-run --message-format=jsongives each target'ssrc_pathandexecutable, and each binary is listed on its own. - A gtest case is discovered with
<program> --gtest_list_testsunder a 20 s kill and run as--gtest_filter=Suite.Casethrough the same capture path as Cargo — the C++ gutter places markers fromTEST/TEST_F/TYPED_TESTlines, matched by suite and case. scripts/unstyled-classes.tsis a gate step and scans everysrc/uitsx — it reads template holes, ternary branches and comparison operands are excluded, so a class with no rule fails the gate; new rules go in a stylesheet named for what it styles and a sheet over 200 lines is split withbun scripts/split-css.ts, since the file-size step covers CSS too (2026-11-09: it had been reading one debugger subtree and one quoted literal, and 63 classes had no rule).- C/C++ formatting always expands every brace pair —
clang-formatgets the nearest.clang-formatplusAllowShort*: Never|None|false, so a one-line body never survives a format. - Config files are languages of their own —
src/lib/editor/languages.tsmaps TOML/JSON/YAML by extension and the names with no revealing one (Cargo.lock,Cargo.toml.orig,Gopkg.lock,Pipfile,poetry.lock,uv.lock,.cargo/config), and its singlelanguageNameForPathtable also feeds the status-bar label so the two cannot drift; CLion ships the same split as bundledtoml/json/yamlplugins. - Which extensions are Rust or C++ lives only in
src/lib/consts/extensions.ts—fileKind,editor/languages,lsp/served,lsp/rootSignalsandgenerate/modelall import it; the same list used to exist five times, and.hxxwas known to one copy only, so a header was classified as C++ yet not served or highlighted. - Format dispatch is per language, never silent — JSON is formatted in the frontend keeping the file's indent and trailing newline and leaves invalid text untouched, TOML needs a detected
taplo/taplo-clior saysno formatter for .toml: install taplo-cli, YAML names the gap, and Rust/C++ keep the server and clang-format paths. bun fmtis the formatter, configured inbunfig.toml[fmt](useTabs,tabWidth = 4,printWidth = 100) — Biome no longer formats; it lints only, sobiome checkwould flag tab/width drift the formatter owns.bun fmtalso formats Markdown, this file included — it rewrites*emphasis*to_emphasis_, so an AGENTS.md edit that skipsbun fmtfails CI on that commit and on every later one until fixed; run it after editing this file.- No
typescriptdependency:bun checkis the type checker andvite buildtranspiles; verified by removing the package and passing both (2026-10-22). bunonly — never npm;bun run buildkeepsrun(built-in subcommand).- Full-document LSP sync only; revisit only on a measured stall.
- CLion 2026.2's C++ engine is
radler, not the old Java cidr highlighter — colour keys areOCHighlightingKeys(53 inintellij.cidr.psi.base.jar), labels inplugins/clion-radler/lib/modules/intellij.clion.radler.core.jar!/messages/RadBundle.properties(color.*), defaults in that jar'scolorSchemes/OC*.xml; grep those, never chaseCidrHighlighter. - A jar is deflated, so
rgover it or a class name finds nothing, and REA opens an archive but refusessearch_stringsontarget_kind: archive— extract withunzipfirst, then grep the extracted class constant pools orjavap -v. - clangd reports a static member as
variable+static+classScope, neverproperty, and answersautowithenum+deduced—semanticTokens.test.tspins those measured shapes, so a colour on the wrong token fails the suite. - One DAP session per project root, but one LSP session per server kind — rust-analyzer starts only when the root has a
Cargo.toml, clangd only for acompile_commands.json,CMakeLists.txtor a C/C++ source, and both run together when both are present;rootSignals.tsprobes bounded (depth 4, 64 dirs, skippingtarget/node_modules/.git/build/out). - Every language-server session is keyed
{kind}::{root}— therootparameter of everylsp_*command carries that id, so a request built from a bare project root answers "unknown session" and is swallowed by atry/catch, which reads as a dead feature. - A feature guard means a running session serves the file —
servedByRunningServer(path, running)andsessionForPath(...)insrc/lib/lsp/served.ts; an extension-only check sends a.cfile to a rust-only project's clangd session and reports an error for it. - Distant LSP features read the session from
src/lib/lsp/context.ts— the shell publishes root plus running set viasetLspContext, andsessionForContext(path)answers without drilling props through Outline, Goto, breadcrumb, problem actions; thelsp_*wrappers throwexpects a session id, got a pathin dev so a missed call site is loud. - A server only receives files it serves —
src/lib/lsp/served.tsholds one extension table per server (rust-analyzer.rs; clangd.c .h .cc .cpp .cxx .hh .hpp), and an unserved path is never opened, changed or closed; without that gate rust-analyzer was handedCargo.toml,Cargo.lockand.gitignore, and the status chip claimed coverage it did not have. - The clangd hand-off configures the profile the build was given —
start_lspcarries the window's effective profile, a tree configured for another one is reconfigured once and reported once, and a multi-config tree is never asked for aCMAKE_BUILD_TYPE(its cache is empty, so asking would reconfigure every start). - PATH-mutating Rust tests share one lock in
src-tauri/src/test_support.rs— the helper used to be copied per test module, so each copy held its ownOnceLockand two modules mutated the process-widePATHat once; a resolve test failed only when a new PATH-reading test changed the schedule. - Never publish a crate named
quarry— usequarry-app,quarry-lsp,quarry-dap; frontend@jyz/quarry-*. - MIT. Zed is GPL-3.0: read its debugger code for patterns, copy nothing.
.gitignorecarries.DS_Storeat the top level.lldb-dapis Xcode's LLVM 21.0.0;readMemory,disassembleand data breakpoints work — measured indocs/spikes/dap.md.- A CMake project needs
-DCMAKE_BUILD_TYPEat configure time or it has no debug info — a single-config generator ignores--configat build time, so the binary is built without-g, lldb resolves no breakpoint, and the debugger looks broken;scripts/dap-cpp-probe.tsbuilds one project both ways and asserts only the configured one stops. - Never rewrite a
CMakeCache.txtthe product did not write (2026-11-14) — the parity probe configures CLion-shaped fixture trees itself, so an-U CMAKE_BUILD_TYPEor any cache edit makes opening the project look like a reconfigure and fails thegenerator: Xcode/Ninja Multi-Configrows; report what the cache says and let the next configure own it. - Editor popups are bounded by the editor pane, not the window —
tooltips({ tooltipSpace })inextensionsBehaviour.tsgives CodeMirror the scroller's rect viatooltipSpace()(src/lib/editor/tooltipSpace.ts), so a caret near the pane's bottom flips the hover above it instead of dropping it over the panels below; a pane shorter than 200px falls back to the window so a popup is never hidden. - Rail buttons are toggles over one region each — Explorer and Source control pick the left column's view (
railCollapsed+gitOpen), light only while that column shows that view, and a second click hides the column; a dock button selects its tab and expands the dock, and a second click collapses it; tool windows that need a project are disabled without one. - A native menu accelerator owns its chord before the webview sees it, so an in-app binding on the same chord never runs;
SHORTCUT_GROUPSmarks those rowsmenu: trueandsrc/ui/app/shortcuts.test.tspins them againstsrc-tauri/src/menu/mod.rs. - The docs site reuses the app, and deploys from the repository root —
website/importssrc/lib/themes/*,src/ui/app/shellShortcuts.tsandassets/icon.svgthrough the@/alias, so Vercel projectquarry-docsbuilds with root.and the commands invercel.json, servingquarry.jyz.land; awebsite-only build context cannot see those files. - The docs site installs only
website/package.json, so any bare import insidesrc/liborsrc/uithatwebsite/does not declare fails on Vercel while passing locally — the app'snode_modulessits one directory up, which is exactly how@xterm/xtermreached a production build;bun scripts/docs-deps.tswalks the import graph fromwebsite/srcintosrc/and is a gate step, and a missing package gets added towebsite/package.jsonrather than left to hoisting. - Terminal rendering and keystrokes belong to xterm, not React —
useXterm.tsowns one emulator per PTY; a prompt that repaints itself with carriage returns needs a VT grid, which a line parser cannot be taught.focusTarget.tsdecides whether a click may take focus. - Raw PTY bytes reach the emulator through
subscribeRawinuseTerminalSessions.ts, which also replays the handshake buffer — a blank panel beside a live pid means a missing subscription, not a PTY fault. - A terminal retires its own map entry when the shell is reaped, guarded by
Arc::ptr_eq— so a reused id is safe, and the drop closes the master and writer instead of leaking them to tab close. - No kill calls a bare
wait()—teardown::until_gonebounds every reap byKILL_GRACEand hands a survivor to its own thread, in both the pty and run paths. - Rust pretty printing needs
initCommands: ["command script import <sysroot>/lib/rustlib/etc/lldb_lookup.py"]— without itVec/Stringarrive as raw structs, silently. - Never gate memory or disassembly on
supportsMemoryReferences— it is false while frames carryinstructionPointerReferenceand both requests work. evaluateworks on Rust only when the request carries the stopped frame'sframeId— without it lldb-dap refuses every expression, so a no-frame probe reads as "Rust is broken"; measured 2026-11-09.- The Rust evaluate parser rejects method calls and
ascasts — simple names, arithmetic andv[0]answer, whilev.len()andtag as u32fall back to Objective-C++ and fail. - Data breakpoint
dataIdis<hex>/<size>with no0x,hitBreakpointIdsis null, and the stop reports the line after the store. realpaththe project directory beforelaunch—/var/…versus/private/var/…leaves every breakpoint unverified.- Every
gitrun goes throughgit::output_withinwithGIT_TIMEOUT(30s), never a bareCommand::output()— a held index lock or a credential prompt otherwise pins the command thread forever. - The DAP pump bounds its wait by adapter liveness, not by frame silence — a paused debuggee emits nothing for minutes, so
wait_framepollsPUMP_POLL_INTERVALand only ends when the process is gone. cargo fmtinsrc-taurirewriteslsp.rs— that file is not rustfmt-clean, so a crate-wide format adds an out-of-unit diff. Format the one file instead:rustfmt --edition 2024 src/dap.rs.- A dispatched unit's report is a claim, not evidence: check the call site exists, not just the helper — one shipped an unused
resolveDebugArtifactand an unwired panel, another left itslib.rsregistration out, which fails only at runtime. - An empty handler is the new unwired panel — a parity batch shipped four commands with real labels, accelerators and
run: () => {}plus a keymap file nothing imported; audit command → handler → API → visible result, andrg 'run: \(\) => \{\}'incommandList.tsmust return nothing. - Updater signing key: private
~/.tauri/quarry-updater.key(no password), public key insrc-tauri/tauri.conf.jsonplugins.updater.pubkey— never print or commit the private one, never rotate it once a release ships, or every installed app orphans. - A local
bun run tauri buildneedsTAURI_SIGNING_PRIVATE_KEYset (the key path or content) becausebundle.createUpdaterArtifactsis on; without it the bundler refuses to produce updater artefacts. - Alphas publish from this Mac with
bun run release:local— signed macOS bundle,latest.json, release, then a check that the public manifest serves it. - The release build is universal (
--target universal-apple-darwin), so its artefacts live undersrc-tauri/target/universal-apple-darwin/release/bundle/, and readingtarget/release/bundlepicks up the previous arch-only build — the version guard catches it asthe updater archive was signed for <old version>; verify withlipo -infoonContents/MacOS/quarry. - The app icon is drawn on Apple's grid by
scripts/make-icon.swift— the rounded plate is 824 of a 1024 canvas and the rest is transparent, because art that fills its canvas renders oversized in the Dock;bunx tauri icon src-tauri/icons/icon.pngthen fills the Windows, Store and ico art from it. - CI builds all three platforms only for
quarry-beta*andv*tags, or a manual dispatch;scripts/bump-version.tskeeps five version files in step — rootpackage.json,src-tauri/Cargo.toml,src-tauri/Cargo.lock,src-tauri/tauri.conf.jsonandwebsite/package.json, so stage all five or the docs site keeps claiming the previous release. - The workflow builds Windows, so Rust must compile there: gate every
std::os::unix,PermissionsExtandfrom_modebehind#[cfg(unix)]; a macOS-only build hides it until CI. - Linux bundles AppImage and Windows nsis only — the deb and msi bundlers reject the hyphen in
X.Y.Z-alpha.N(invalid version), AppImage and nsis accept it. - Main agent may push alpha tags and publish test releases here; subagents never push, tag or release. Tag
quarry-alphaNpairs with versionX.Y.Z-alpha.N(bun scripts/bump-version.ts alpha), and a stable tag isv<version>. - Landings go through a pull request, never a push to
main(user, 2026-11-02): branch,git push bot HEAD:refs/heads/<branch>, open the PR asjyzbot, and wait — GitHub forbids self-approval, so the owner approves and merges, and the alpha is cut from the mergedmain. Thebotremote is https on purpose:github-jyzbotssh was timing out on port 22 here (2026-11-02), while the https path already authenticates asjyzbotthroughgh auth git-credential. - Do not flood the owner's GitHub notifications (user, 2026-11-10: "stop making prs and ci fails notify my github account", "this repo only") — batch a wave into one PR per area instead of a PR per tiny change, never leave
mainred, and keep the repo muted rather than muting the account globally; the mute needs thenotificationsscope, which neitherghlogin here has, so it isgh auth refresh -s notificationsthengh api -X PUT /repos/JeffreyJYZ/quarry/subscription -f ignored=trueas the owner. mainprotection must keepdismiss_stale_reviewsoff — with it on, the release tag push dismissed the owner approval within seconds and every PR needed an admin bypass (measured 2026-11-04); 1 approval, no code owners, no last-push rule,enforce_adminsfalse.- Bump the version inside the feature branch, not in a second PR — protection blocks a direct main push, so a separate bump PR doubles the approvals for one alpha;
bun scripts/bump-version.ts alphabefore the branch is pushed keeps each release to one review (2026-11-03). - Standing permission (user, 2026-10-26): release an alpha whenever there is something to ship — no ask, no "want me to cut a release?"; bump, push,
bun run release:local, report the version. - Report a release by version and the PR link only — the app auto-updates, so dmg and
latest.jsonURLs are noise the user deletes (2026-11-04); never paste them unless asked. - The release upload prints nothing through a
| tailpipe for minutes, and that is not a hang —gh release createuploads the dmg and the updater tarball before it prints anything; check for a livebun run scripts/release-local.tsprocess before retrying, or the second run collides with the first (measured 2026-11-04). - Never pipe a build, release or test sweep through
tail/head(user, 2026-11-04: "no more pipes!!! so i can actually see it") — the pipe buffers every line until the command ends, so a three-minute upload reads as a hang and nothing is visible; run it unpiped and let the output stream. - Gate one worktree at a time, unpiped — every worktree owns its own
target/, so six parallel gates compiled the dependency tree six times and load hit 78 on four performance cores, onecargo nexteststep alone taking 138s (measured 2026-11-09); serial, or one sharedCARGO_TARGET_DIR, and never throughtail/head, which hides the progress. - Every gate run goes in the background (
background: true) — a foregroundbun run gateblocks the whole turn for minutes while it compiles (user, 2026-11-09: "REMEMBER ALL GATE RUNS IN BACKGROUND"). release:localrefuses a commit whose CI run has failed or been cancelled, and runsbun run gateitself before building — it does not wait on a queued or running run (CI repeats the same nine steps), and--skip-ciis the loud escape hatch for both checks.- The updater needs
updater:allow-downloadandupdater:allow-installseparately insrc-tauri/capabilities/default.json;allow-download-and-installcovers only that one command, sodownload()theninstall()diesCommand plugin:updater|download not allowed by ACLat runtime, never at gate. src/lib/updates/capabilities.test.tsguards that pairing — it reads the capability file and the store, so a renamed updater call fails the suite instead of failing silently in the app.- The updater installs into the bundle it is running from, so a second copy silently freezes —
2026-10-26:/Applications/quarry.appsat atalpha.7while alpha.16/17 self-updated the repo bundle; check bothdefaults read <app>/Contents/Info.plist CFBundleShortVersionStringvalues when a version looks wrong. - Never swap
/Applications/quarry.appby hand — a self-update is the only end-to-end proof the ACL and signature work; replacing the bundle skips the one path that broke (user, 2026-10-26). - Verification ladder:
bun run gateandbun run build; Rust addscargo test,cargo check --all-targets,cargo clippy --all-targets -- -D warnings; LSP work addsscripts/lsp-*.ts, debugger workscripts/dap-*.ts. Evaluate is measured byscripts/dap-eval-contexts.ts, which passes; the olderdap-eval-probe.tsfailures were no-frame-id requests. - The debugger probes need
sudo DevToolsSecurity -enableonce — until then every launch sits 20 s on the Touch ID prompt and reads asdap-cpp: launch timed out; enabled 2026-11-05, anddap-cpp-probe,dap-spikeanddap-eval-contextsthen pass. - Screenshot a launch only once the window has painted — an 8 s capture of the installed app showed a blank frame twice (2026-11-05) and read as a crash; the same session renders normally seconds later, so wait for a rail icon or a tab before calling it broken.
- UI work adds
bun run scripts/unstyled-classes.ts— it prints every class a component uses that no stylesheet defines, which is how a restructure silently drops styling; the count must be 0. - A branch that passes the gate can still break it once merged — two findings each appended to
files/tests_items.rs, 211 lines together, and only the merged tree showed it; runbun run gateon main after landing several branches and before cutting the release (2026-11-08). - A
tauri devwindow outlives its CLI — killingbun run tauri devleavestarget/debug/quarryrunning, so six restarts left seven quarry windows on screen; killtarget/debug/quarrytoo and checkpgrep -f target/debug/quarryafter each run.