{"success":true,"name":"brimind-solobro-find-what-actually-runs","description":"Before editing, fixing or verifying anything in this repo — find the copy that is actually running and the store it actually reads. Use whenever a fix \"works\" but the owner still sees the old behaviour, when a repo has two copies of a service, when a tool has both a file store and Mongo, or before claiming any repair is done. Written after a night lost repairing a JSON file the dashboard never rea","category":"unitary","path":"unitary/brimind-solobro-find-what-actually-runs/SKILL.md","file":"SKILL.md","content":"---\nname: brimind-solobro-find-what-actually-runs\ndescription: Before editing, fixing or verifying anything in this repo — find the copy that is actually running and the store it actually reads. Use whenever a fix \"works\" but the owner still sees the old behaviour, when a repo has two copies of a service, when a tool has both a file store and Mongo, or before claiming any repair is done. Written after a night lost repairing a JSON file the dashboard never reads.\n---\n> Imported from [PRIVATE_HOST] `~/unitary/agents/skills/brimind-solobro-find-what-actually-runs`. Paths are relative to `[PRIVATE_HOST]:[PATH]`; run commands there via `ssh [PRIVATE_HOST] 'cd ~/unitary && ...'`. Owner send rules from skill i7-remote-ops still apply.\n\n\n# Find what actually runs, before you touch it\n\nA fix applied to the wrong copy is not a slow fix. It is a **false report**: you\ntell the owner it is repaired, he looks at his screen, and nothing has changed.\nThat costs his trust, not just your hour.\n\nThis happened three times in one night, 2026-09-04:\n\n| What I did | What was true | Cost |\n|---|---|---|\n| Repaired the cycle invariant in `followup/data/followups.json` | followup runs on **MongoDB**; that file is dead weight | hours, and the owner had to say \"why are you forgetting this — I see your work only from here\" |\n| Added a send ledger to `GitHub/Alicent/services/whatsapp` | the running service is `Unitary tools/whatsapp`, a different, richer copy that **already had** history | a whole module, written and then deleted |\n| Concluded `pay.brimind.pro` was \"a separate deployment on old code\" | it was the same process; the tunnel was serving a stale one because [PRIVATE_HOST] ports were `TAKEN` | an hour, plus wrong docs written into three files |\n\nEach was avoidable in under a minute.\n\n## The four questions, before any edit\n\n**1. Which process is serving this port?**\n```bash\nlsof -nP -iTCP:<port> -sTCP:LISTEN      # the PID\nps -o command= -p <pid>                 # the path it was started from\n```\nThe path is the answer. Edit *that* tree, not the one your search found first.\n\n**2. Which store does it read?**\nA tool with `store.file.js` and `store.mongo.js` picks one at boot — look at\n`lib/store.js`, or just count: if Mongo has 18 projects and the JSON has 3, the\nJSON is not what you are looking at. Check both before repairing either:\n```bash\nnode -e \"…count in mongo…\" ; node -e \"…count in the json…\"\n```\n\n**3. Is the code I just changed even loaded?**\n`next-server` serves a **build**, not your source. Nothing you edit is live until:\n```bash\nnpm run build && launchctl kickstart -k gui/$(id -u)/<the launchd label>\n```\n`launchctl list | grep unitary` names the label.\n\n**4. Is there a second copy of this file in the repo?**\n```bash\nfind . -name \"<file>\" -not -path \"*/node_modules/*\"\n```\nTwo copies of a service is normal here (`whatsapp/` and Alicent's). Diff them\nbefore assuming they are the same.\n\n## Verify where the owner looks — not where you worked\n\nA `curl` you wrote and a file you read are your evidence, not his. Before saying\n\"repaired\":\n\n- if it is a dashboard, **load the dashboard** and check the card;\n- if it is a client message, **read what the provider says went out** — the\n  WhatsApp service's own `/chats`, not your ledger;\n- if it is a public page, **fetch the public URL**, not `localhost`;\n- if it is a data repair, **re-run the check that failed** (`npm run gatekeeper`),\n  not your own re-reading of the file.\n\nRank of evidence, weakest first: *my report* → *a record I wrote* → *a log written\nby the caller* → **the service's own account of itself, or the rendered page**.\n\n## Locating the Mac-side repo for a live BRIMIND domain\n\nWhen the task names a live URL (`projects.nextmindev.com/...`) instead of a repo\npath, do not ask the owner where the code lives before trying — find it:\n\n1. `grep -n '<domain>' <mac BRIMIND Caddyfile>` (e.g.\n   `[PATH]`) for the\n   `reverse_proxy localhost:<port>` line — that port is the app's dev/start port.\n2. Search content, not just filenames, for that port across the Mac's repo\n   roots (`~/Documents/GitHub`, `~/Documents/Unitary tools`) — a filename guess\n   from the domain (`dashboard-services` vs `Dashboard-services`, casing varies)\n   misses it; `grep -r '\"dev\": \".*-p <port>\"' --include=package.json` or a\n   plain port grep across `package.json`/`.env*` finds the real repo fast.\n3. Confirm with `git log`/`git remote -v` in the candidate repo before editing —\n   a repo can be ahead of `origin` with uncommitted WIP from a prior session;\n   read `git status` first so your commit does not silently absorb or clobber it.\n4. No SSH access to the [PRIVATE_HOST] serving that port is normal — finish the code\n   change, verify with a full `tsc --noEmit` + `next build` locally, commit and\n   push to `origin`, then tell the owner the deploy step (`git pull` + rebuild +\n   restart on the [PRIVATE_HOST]) is outstanding instead of guessing it succeeded.\n\n## Start the shift with the preflight\n\n`npm run gatekeeper` exists precisely to answer these questions before any work:\nwhich services are up, which channels are usable, what drifted. Running it first\nwould have caught the unpaired WhatsApp, the dead Telegram, the stale build and\nthe duplicate cadence — all found by hand instead, over hours.\n\n**Run it first. Run it again after a repair.** It is read-only and it is fast.\n\n## The one-line habit\n\nBefore \"I fixed it\", answer out loud: *fixed where, running where, seen by whom?*\nIf those three are not the same place, you have not fixed it yet.\n","linked_files":[],"origin":"brimind","owner_id":null,"source":"router"}