⏳ This skill is pending AI review.
Scores will appear once the review pipeline completes.
rymac-4r-icm-audit
Runs the 4R audit (Read, Run, Reality, Report) on an ICM workspace or any folder system an AI works from. Reads the structure, has a fresh agent with no memory do 1 real job in a throwaway copy, plants real mistakes to prove every guard catches what it claims, and writes a plain English report that lists EVERY finding, each measured and ranked by importance with file and line evidence, then fixes all of them on the owner's go and re-audits to prove each fix. Use when the user says "am I crazy",
Choose how to use this skill
You do not need every option. Choose the path your AI client supports. The stable page stays the same; versioned files are immutable.
1. Native installer
This listing has no registered native installer command. Use the complete package or source fallback below, depending on what your client supports.
Do not guess an installer command or replace an existing version without reviewing the diff.
2. Complete package recommended
Download the ZIP when available. It includes SKILL.md plus the references, security notes and version metadata.
No complete ProSkills package is published for this listing yet.3. Prompt-only
Copy the prompt above when the agent can read the stable page or when you want to adopt the workflow without installing a skill.
Need only the instruction file?
Download SKILL.md only if your client requires a single file. The complete ZIP is safer for a full installation because it preserves the references and release context.
No path installs or executes anything by itself. Your agent still needs access to the project files. Before updating, compare the installed version and review the diff.
// RATINGS
// README
The 4R Audit: Read, Run, Reality, Report
Find out if your ICM folder system actually works, not just if the folders look right.
Most audits read your files and tell you what the files say.
The 4R audit does that, then has a fresh AI with no memory do 1 real job in a copy of your workspace.
Then the 4R audit plants real mistakes to see if your guards catch them.
Then you get a plain English report with every fix it found, not just a few. Each fix is measured (who it hits, how much, how bad) and ranked by importance, with the file and the line. The most important ones are named at the top.
Then, when you say go, the 4R audit fixes every item in that order, proves each fix, and runs itself again so you see before and after.
Your workspace is never changed. Not 1 byte. Everything runs in a throwaway copy.
The 4 layers
- Read. 9 questions about the structure. Do your routes go anywhere? Is every folder on the map? Is anything unsaved, or behind its online copy? Are there keys sitting in files? Is the workspace growing? 7 of the 9 are answered by a script, not an opinion.
- Run. A fresh AI that has never seen your workspace does 1 real job, cold. The AI reports every place it got stuck, with the file and line that caused it.
- Reality. Every promise your workspace makes gets tested. The audit plants a mistake each guard should catch and a clean case each guard should pass, up to 4 tests for each promise. Those tests get saved, and every later audit replays the same ones and plants nothing new. Then the audit checks every line that says "done" or "live" against the thing each 1 describes.
- Report. The verdict in 1 sentence, the most important fixes, the counts, then every fix measured and ranked, and what the audit could not see. 1 run shows everything it found. Nothing is held back for the next run.
- Fix, when you say go. Every fix gets made in rank order, each 1 proven with the same test that found it. Anything that spends money, deletes something or needs your call gets asked as 1 plain question first. Then the 4R audit runs again.
No made up score out of 100. Only numbers that were counted.
Install the 4R audit
- Download rymac-4r-icm-audit.zip here: https://filesnfolders.com/downloads/rymac-4r-icm-audit.zip
- Unzip the zip into your Claude Code skills folder:
- Mac or Linux:
~/.claude/skills/ - Windows:
C:\Users\YOUR-NAME\.claude\skills\You should end up with a folder calledrymac-4r-icm-auditinsideskills.
- Mac or Linux:
- Restart Claude Code.
The first run copies 3 small helper files from the audit's
agentsfolder into your.claude/agentsfolder. Each helper has its model written in, so the audit's grunt work never runs on your biggest model. - Open Claude Code in the folder you want audited and type:
"am I crazy?"
That's the trigger. "4R audit" and "audit my ICM" work too.
If the audit doesn't start: check that the folder sits directly inside skills, not in a
second folder inside skills.
What you need
- Claude Code
- bash, which Mac and Linux already have. On Windows, bash comes with Git for Windows.
- git and python make 2 of the checks sharper. The audit still runs without them.
Check the audit itself first
The 4R audit tests your guards, so the audit tests its own scripts too. Run this once after you install:
"bash ~/.claude/skills/rymac-4r-icm-audit/scripts/selftest.sh"
The self-test builds a workspace full of planted mistakes and a clean workspace, then checks
that every script catches the mistakes and stays quiet on the clean 1. You want to see
every line held (129 of 129 held on this version).
What changed in v1.6.0
1 change, and it is the big 1: the audit can no longer grow every time you run it.
- What went wrong. The rule said to plant new mistakes "only where something changed". The fix pass changes your guards. So the next audit saw a changed guard, planted more mistakes, found more holes, and the next fix pass changed the guard again. 1 owner's 3rd audit planted 955 mistakes. His guard file grew on every pass, and his AI started asking him to approve every step.
- The new law. Your first audit plants up to 4 tests for each promise, 40 at the most. Every audit after that plants 0 new tests. It replays the same saved tests, so before and after always compare the same thing. A guard that changed never earns new tests.
- The only 2 ways a later audit plants anything: a promise that has no saved test yet, or a hole YOU name in your own words. The report prints your words back to you.
- A script holds the law, not a sentence.
scripts/plant-limit.shsets the number before any mistake is planted and checks the number before the report. Over the number, no report gets written. A saved test that got rewritten or removed fails the run too. - The audit tells you when to stop. When every saved test holds and the stranger got stuck 0 times, the report says: stop here, running it again finds nothing new.
- A fix no longer adds a new guard for everyday work. A fix repairs the line that was blind. A new guard line is only for a step you can't pull back: a send, a delete, a payment, a publish. The record shows the size of each guard file before and after.
- Already ran an older version? Your saved tests stay. The first run on this version lists them, replays them, and plants nothing new.
- Self test: 129 of 129.
What changed in v1.5.6
1 change, from a customer's follow up question.
- A left out file your map names gets flagged first, and usually comes along. The copy
skips files over 1 MB. But "not in the audit's copy" is not the same as "does not exist". If
your map (CLAUDE.md, AGENTS.md or CONTEXT.md at the top) points your AI at a file and that
file got left out, the stranger gets sent to a file the stranger never had, and reports the
file missing. So the copy step now checks every left out file against your map. A named file
up to 5 MB comes along anyway, marked
NEEDED brought alongand marked in the snapshot list. A named file over 5 MB stays out and printsNEEDED NOT IN THE COPYat the top, before the stranger starts, and the report puts that line in its most important block. A big file your map never names is left out the same as before. - Self test: 93 of 93.
What changed in v1.5.5
6 changes, every 1 from a question somebody in the community asked.
- The snapshot list. The copy step now writes 1 list of every file the audit had and every file the audit did not have. Each file carries a fingerprint (SHA-256, a code built from the file's exact bytes, so 1 changed letter changes the code). Each file left out carries its reason: over the size limit, or the ignore rule that matched. An ignore rule gets 1 line with a count, never 1 line per file.
- Anybody can check the list.
bash scripts/verify-snapshot.sh <folder> <the snapshot list>builds every fingerprint again on your own machine and prints which files match, which changed and which are missing. So you never have to trust the report's totals. - The examined list. A file being in the copy and a file being opened by the auditor are 2 different claims. The stranger now lists every file the stranger opened, and the report gives both counts apart. A file the stranger went looking for that the copy left out gets named, so a miss caused by the copy never gets blamed on your folder.
- Every skip rule gets tested. A check that skips "finished" work can hide the exact mistake the skip was meant to save time on. Layer 3 now plants 1 case inside every skip.
- "Caught 6 of 6 planted shapes", never "proven". A planted mistake proves a check catches that shape. Nothing more. The report says the count and names the shapes. And every claim the audit checks now names where the answer was read fr
// HOW IT'S BUILT
// FILES
19 files shipped with this skill. Inline text is the catalog copy. The upstream link is the source repository.
SKILL.md8.1 KB79b442b3e166upstream ↗
--- name: rymac-4r-icm-audit description: Runs the 4R audit (Read, Run, Reality, Report) on an ICM workspace or any folder system an AI works from. Reads the structure, has a fresh agent with no memory do 1 real job in a throwaway copy, plants real mistakes to prove every guard catches what it claims, and writes a plain English report that lists EVERY finding, each measured and ranked by importance with file and line evidence, then fixes all of them on the owner's go and re-audits to prove each fix. Use when the user says "am I crazy", "am I crazy?", "4R audit", "audit my ICM", "audit this ICM", "run the audit", "audit day", "is my workspace drifting", "am I drifting", or asks whether a folder system, an agent folder, or an ICM workspace actually works. Make sure to use this skill whenever someone doubts their ICM setup or asks for an audit of one. argument-hint: [target folder · blank = the workspace this session is in] --- # The 4R audit: Read, Run, Reality, Report A look at the files tells you what a workspace SAYS. Only running the workspace tells you what it DOES. This audit does both, proves every guard catches what it claims to catch, and hands the owner **every** finding in 1 report, measured and ranked. Then it fixes all of them. **1 run finds everything it can find.** An audit that shows 3 fixes and holds the rest back makes the owner run it again and again to find what the first run already saw. A VIP ran an earlier version 11 times for that reason. Never again: every finding goes on the report. Supporting files, read each 1 when its layer starts: - `references/read.md`: layer 1, the 9 questions and the script behind each - `references/run.md`: layer 2, the cold walk and the prompt for the fresh agent - `references/reality.md`: layer 3, planting mistakes and checking the claims that say done - `references/report.md`: layer 4, how every fix gets measured and ranked, and the record - `references/fix.md`: after the report, the fix pass that fixes every item and proves it - `templates/report.html`: the report page, fill the slots - `templates/record.md`: the record kept in the results home Scripts, run them, do not read them: `scripts/routes.sh`, `scripts/nested-repos.sh`, `scripts/secrets.sh`, `scripts/placeholders.sh`, `scripts/guards.sh`, `scripts/size.sh`, `scripts/copy-target.sh`. `scripts/selftest.sh` proves every script on planted cases. Run it first on a new machine. ## The 4 promises this audit keeps 1. **The target is never changed during the audit.** Not 1 byte. Everything that runs, writes, or gets planted happens in a throwaway copy outside the target. An audit that edits what it measures has measured itself. Fixes come after, in the fix pass, on the owner's go. 2. **Every finding cites a file and a line, or a command and its output.** No citation, no finding. Unknown is an honest answer. A guess is not. 3. **No invented score.** The report gives counts that were counted and fixes measured with real numbers. Never a grade out of 100. 4. **Every finding is shown.** Every dead route, every unfilled slot, every unsaved folder, every key, every 2 way fact, every place the stranger got stuck, every guard that failed, every claim that is no longer true. Each 1 becomes a fix. Nothing is held for next time. ## Setup, before layer 1 1. **Target:** the folder in the arguments, else the workspace this session is in (walk up to the folder holding the root `CLAUDE.md`). 2. **Results home:** if the target's `CLAUDE.md` or `CONTEXT.md` names a home for 4R audits, use that folder and leave that folder out of every layer. Otherwise use a folder named `4r-audits/` beside the target, never inside the target. 3. **Scratch copy:** `bash scripts/copy-target.sh <target> <scratch>` into the session's temp or scratch folder. Layers 2 and 3 only ever touch the scratch copy. 4. **Last audit:** if the results home holds an earlier record for this target, read the record. **Every fix it listed gets checked again**: fixed, still open, or worse. An open fix from last time stays on this report with its age. The change since last time is the headline of the report. ## The layers, in order. Copy this and tick each 1 off - [ ] **1. READ.** Answer the 9 questions in `references/read.md`. 7 of them have a script. Run the scripts, never answer those 7 by reading alone. Every line a script flags is a finding. Question 9 counts size, so the fix pass can show before and after. - [ ] **2. RUN.** Pick 1 real job the workspace exists to do. Hand the scratch copy and the job to a fresh agent with the prompt in `references/run.md`. Record whether the job got done, how many files the agent read before knowing where to go, and every place the agent got stuck, each with file and line. Check each stuck point yourself. - [ ] **3. REALITY.** For **every** promise from layer 1 question 3, plant 1 mistake the guard should catch and 1 clean case the guard should pass, in the scratch copy or on a copy of the guard's input. A promise with no guard gets its mistake planted too. Then check **every** claim that says done, live, approved or a count in the entry files and the status files, 3 at the least. `references/reality.md` has the method. - [ ] **4. REPORT.** Every finding from layers 1 to 3 becomes a numbered fix. Each fix gets measured (who it hits, how many, how bad) and ranked by importance, the method in `references/report.md`. The most important ones get named at the top. Write the record with `templates/record.md`, then the page with `templates/report.html`. Before publishing, run the completeness check in `references/report.md`. Say plainly what the audit could not see. - [ ] **5. FIX, on the owner's go.** Offer to fix every item, in rank order. On the go, follow `references/fix.md`: each fix gets its own change and its own proof, the calls only the owner can make get asked as plain questions, then the 4R audit runs again and the report shows before and after. Before any fix adds a line, look for a line to delete or combine. ## Rules 1. **Run the layers in order.** Layer 2 often explains a layer 1 finding, and layer 3 often shows a layer 1 guard never worked. 2. **A rule held only by a sentence is a finding, even when everyone obeys the rule.** A sentence works until the day the agent forgets the sentence. A hook that only reminds is still a sentence. 3. **A guard that exists is not a guard that works.** Only a planted mistake proves a guard. **Every planted test is saved and replayed on every later run**, so before and after always compare the SAME tests. New shapes get planted only for a promise with no saved tests yet, a guard file that changed since the last record, or a hole the owner names. A run that invents a harder test and scores it against an easier old 1 makes a working guard look broken, and the owner looks bad to his own people. 4. **When torn between 2 readings, take the harsher 1 and say you were torn.** 5. **Write for the owner, not for a builder.** Plain words a 9th grader follows. Any technical word gets explained in the same sentence. Numbers as digits. 6. **Name what the audit could not see**: a folder too big to copy, a guard that needs a paid service, a job the workspace cannot do without a person. 7. **Never fix during the audit.** Fixes come after the report, in the fix pass, followed by a re-audit so each change is measured. 8. **Show every finding in 1 report, measured and ranked. Never only 3.** A capped list makes the owner rerun the audit to find what this run already saw. Every finding from every layer becomes a numbered fix with its measurements, its file and its line. The most important are named first. Nothing found gets held back. ## Credit ICM, Interpretable Context Methodology, is Jake Van Clief and David McDermott's method, https://arxiv.org/abs/2603.16021. The 4R audit is RyMac's own instrument (filesnfolders.com). 2 ideas in layer 1 come from Jake's own ICM audit, written fresh in these words: a rule that lives only in a sentence, and an example that breaks the rule printed beside it.README.md8.9 KB098755b59a80upstream ↗
# The 4R Audit: Read, Run, Reality, Report **Find out if your ICM folder system actually works, not just if the folders look right.** Most audits read your files and tell you what the files say. The 4R audit does that, then has a fresh AI with no memory do 1 real job in a copy of your workspace. Then the 4R audit plants real mistakes to see if your guards catch them. Then you get a plain English report with **every** fix it found, not just a few. Each fix is measured (who it hits, how much, how bad) and ranked by importance, with the file and the line. The most important ones are named at the top. Then, when you say go, the 4R audit fixes every item in that order, proves each fix, and runs itself again so you see before and after. Your workspace is never changed. Not 1 byte. Everything runs in a throwaway copy. --- ## The 4 layers 1. **Read.** 9 questions about the structure. Do your routes go anywhere? Is every folder on the map? Is anything unsaved, or behind its online copy? Are there keys sitting in files? Is the workspace growing? 7 of the 9 are answered by a script, not an opinion. 2. **Run.** A fresh AI that has never seen your workspace does 1 real job, cold. The AI reports every place it got stuck, with the file and line that caused it. 3. **Reality.** Every promise your workspace makes gets tested. The audit plants a mistake each guard should catch, in every shape the mistake comes in, and a clean case each guard should pass. Then the audit checks every line that says "done" or "live" against the thing each 1 describes. 4. **Report.** The verdict in 1 sentence, the most important fixes, the counts, then every fix measured and ranked, and what the audit could not see. 1 run shows everything it found. Nothing is held back for the next run. 5. **Fix, when you say go.** Every fix gets made in rank order, each 1 proven with the same test that found it. Anything that spends money, deletes something or needs your call gets asked as 1 plain question first. Then the 4R audit runs again. No made up score out of 100. Only numbers that were counted. --- ## Install the 4R audit 1. Download **rymac-4r-icm-audit.zip** from the Releases section on this GitHub page. 2. Unzip the zip into your Claude Code skills folder: - Mac or Linux: `~/.claude/skills/` - Windows: `C:\Users\YOUR-NAME\.claude\skills\` You should end up with a folder called `rymac-4r-icm-audit` inside `skills`. 3. Restart Claude Code. 4. Open Claude Code in the folder you want audited and type: **"am I crazy?"** That's the trigger. **"4R audit"** and **"audit my ICM"** work too. **If the audit doesn't start:** check that the folder sits directly inside `skills`, not in a second folder inside `skills`. ## What you need - Claude Code - bash, which Mac and Linux already have. On Windows, bash comes with Git for Windows. - git and python make 2 of the checks sharper. The audit still runs without them. ## Check the audit itself first The 4R audit tests your guards, so the audit tests its own scripts too. Run this once after you install: **"bash ~/.claude/skills/rymac-4r-icm-audit/scripts/selftest.sh"** The self-test builds a workspace full of planted mistakes and a clean workspace, then checks that every script catches the mistakes and stays quiet on the clean 1. You want to see every line held (`49 of 49 held` on this version). --- ## What changed in v1.5.3 3 fixes that 3 real audits found in October and November. Each 1 made a working workspace look worse than it was. - **The audit's own saved tests are not your checks.** The saved tests live in your results home (`4r-audits/4r-tests/`), and the guard count used to count them as checks you wrote. Every run looked like it had grown more guards than it had. Anything under `4r-audits/` is left out of the guard count now. - **A borrowed toolkit is set aside, not counted as yours.** A toolkit somebody else wrote, installed as a skill, counted as 39,246 lines of your own checks on 1 run, and a quiet 2 weeks read as +38%. Put an empty file named `.4r-borrowed` inside any folder you installed as is, and the size count sets that folder aside (the way it already sets aside `vendor/` and `dist/`). - **New files come along on the copy.** The throwaway copy took only files git had already saved. A file made after the last save was missing from the copy, so the stranger walked twice on a re-audit. The copy now carries every file git does not ignore, saved or not. - Self test: 49 of 49. ## What changed in v1.5.2 A Mac user ran the self test, got 47 of 49, and sent the fix. - **The "behind its online copy" check works on a Mac now.** The check asked the online copy with `timeout 20`, and macOS doesn't ship a `timeout` command. The call failed quietly, so a Mac never saw BEHIND, even when the copy really was behind. The script uses `timeout` only where it exists now. - Self test: 49 of 49 on a Mac (it was 47 of 49). ## What changed in v1.5.1 A member ran the audit and caught it breaking 2 of its own promises. Both are fixed. - **The audit never writes into your folder now, not even git's own cache.** Checking a code folder for unsaved work ran `git status`, which quietly rewrites `.git/index` and can leave an empty `index.lock` behind that stops git working there. Every git call in every script is read only now (`GIT_OPTIONAL_LOCKS=0`). - **"Couldn't see" instead of "0 hooks".** Run from a cloud sandbox (Cowork, a web session), the audit cannot see the hooks on your own computer. It used to report 0, which tells you that you have no guards when you might. It now prints a `BLIND` line and the report says "couldn't see". - Self test: 49 of 49 (the 2 new checks are these 2 bugs). ## What changed in v1.5.0 Owners running the audit kept getting a fresh list of "new" problems every run, even when nothing in their workspace had changed. The cause was the audit, not the workspace: each run made up harder tests and scored them against the easier tests from the run before. A guard that worked looked broken. - **Every planted test is saved** in your results home (`4r-tests/`) and **replayed first on every run, unchanged.** Before and after now compare the SAME tests. - **New tests get planted only where something changed**: a guard file that changed since the last audit, a promise with no tests yet, or a hole you name. Nothing changed, nothing new. - **New tests are counted on their own line**, never mixed into "since last time". - The key scan no longer calls a picture packed into a web page a saved key, and still reports every long real token. - Self test: 47 of 47. ## What changed in v1.4.0 A builder in the Skool asked the right question: are your fixes only added, or deleted too? His own routine audits grew his setup from about 15,000 lines to 95,000 in a few weeks. So the 4R audit now counts size. - **Question 9, "Is the workspace growing?"** `scripts/size.sh` counts the lines in your rules, your skills and your checks, lists the 10 biggest files, sets machine built and borrowed code aside, and compares against your last audit. - **The fix pass looks for a line to delete or combine before it adds 1**, and records the lines each fix added and removed. The re-audit shows size before and after. - **The saved work check now asks the online copy**, so a laptop copy that fell behind its online copy gets flagged, not called fine. - Self test: 47 of 47. ## What changed in v1.3.1 The key scan now finds 2 more kinds: a phone app token (Twilio), and any value saved under a name that ends in `_TOKEN`, `_SECRET`, `_API_KEY` or `_PASSWORD`, wherever the value sits, a settings file included. A value that names itself a test fake is counted, not listed. Self test: 39 of 39. ## What changed in v1.3.0 Earlier versions showed only the top 3 fixes. That meant running the audit again and again to find what the first run already saw. v1.3.0 shows every finding in 1 report, measures each 1, ranks them by importance, tests every guard and every "done" line instead of 3, carries any open fix from the last audit forward, and fixes everything on your go. --- ## Where the results go Every audit writes a record, so the next audit can show you what changed. - If your `CLAUDE.md` or `CONTEXT.md` names a home for 4R audits, the record goes there. - If not, the record goes in a folder called `4r-audits` next to your workspace, never inside your workspace. Run the 4R audit every week and the report tells you if you're getting better or drifting. --- ## Credit ICM, Interpretable Context Methodology, is Jake Van Clief and David McDermott's method: https://arxiv.org/abs/2603.16021 The 4R audit is RyMac's own instrument. 2 ideas in the Read layer come from Jake's own ICM audit, written fresh here: a rule that lives only in a sentence, and an example that breaks the rule printed beside the example. Built by RyMac, USMC Veteran, at [filesnfolders.com](https://filesnfolders.com). Come say hello in the free community: https://www.skool.com/buildmarketclose/about MIT license: free to use, share and change.scripts/copy-target.sh2.5 KB723e8e92a2b2upstream ↗
#!/usr/bin/env bash # copy-target.sh - 4R audit setup. Makes the throwaway copy that layers 2 and 3 work in. # # Usage: bash copy-target.sh <target folder> <scratch folder> [max KB per file, default 1024] # # In a git repo, copies the files saved in the history (what the owner means by "the # workspace"). Anywhere else, copies every file except .git and node_modules. Files over # the size limit are skipped and counted, so a folder of videos does not fill the disk. # The target's own .claude settings come along so its hooks can be tested. # # Refuses a scratch folder inside the target: the audit never writes into what it measures. # Exit 0 = copied. Exit 2 = bad arguments. set -u # 2026-10-07 (a member found it): a plain "git status" rewrites .git/index and can # leave an index.lock behind in the folder it reads. This keeps every git call read only. export GIT_OPTIONAL_LOCKS=0 T="${1:?usage: bash copy-target.sh <target> <scratch> [max KB]}" D="${2:?usage: bash copy-target.sh <target> <scratch> [max KB]}" MAXKB="${3:-1024}" [ -d "$T" ] || { echo "copy-target: no folder at $T"; exit 2; } T="$(cd "$T" && pwd)" mkdir -p "$D" || exit 2 D="$(cd "$D" && pwd)" case "$D/" in "$T/"*) echo "copy-target: refusing, $D is inside the target $T"; rmdir "$D" 2>/dev/null; exit 2 ;; esac list="$(mktemp)" if git -C "$T" rev-parse --show-toplevel >/dev/null 2>&1; then # 2026-11-02, 4R fix 22: new files not in the history yet came along too late on a re-audit, so the stranger walked twice. (cd "$T" && git ls-files && git ls-files --others --exclude-standard) > "$list.all" src="saved files (git), plus new files git does not ignore" else (cd "$T" && find . \( -name .git -o -name node_modules \) -prune -o -type f -print | sed 's#^\./##') > "$list.all" src="all files" fi for extra in .claude/settings.json .claude/settings.local.json; do [ -f "$T/$extra" ] && echo "$extra" >> "$list.all"; done # 1 pass of du over every listed file (portable on Linux, macOS and Git Bash), then keep the small ones (cd "$T" && tr '\n' '\0' < "$list.all" | xargs -0 du -k 2>/dev/null) \ | awk -F'\t' -v max="$MAXKB" '$1 <= max { sub(/^[^\t]*\t/, ""); print }' > "$list" big=$(( $(sort -u "$list.all" | wc -l) - $(wc -l < "$list") )) (cd "$T" && tar -cf - -T "$list" 2>/dev/null) | (cd "$D" && tar -xf - 2>/dev/null) copied=$(find "$D" -type f | wc -l | tr -d ' ') rm -f "$list" "$list.all" echo "COPY $copied files copied from the target's $src into $D" echo " $big files over ${MAXKB} KB left out" exit 0scripts/guards.sh3.8 KB1d48572d898eupstream ↗
#!/usr/bin/env bash # guards.sh - 4R audit, layer 1, question 3. Read only. # # Usage: bash guards.sh <target folder> # # Lists everything that actually RUNS, as opposed to what is only written down: # 1. hooks: every command in the Claude settings files that apply to the target # (the user's ~/.claude/settings.json, and the target's own .claude/settings.json # and .claude/settings.local.json), with the event each 1 fires on # 2. check scripts: every script in the target whose name says it checks something # (check, guard, lint, validate, gate, test, audit, verify, hook), then a count of # every other script # # Exit 0 always. This script lists evidence, layer 3 proves whether each guard works. set -u # 2026-10-07 (a member found it): a plain "git status" rewrites .git/index and can # leave an index.lock behind in the folder it reads. This keeps every git call read only. export GIT_OPTIONAL_LOCKS=0 T="${1:?usage: bash guards.sh <target folder>}" [ -d "$T" ] || { echo "guards: no folder at $T"; exit 2; } T="$(cd "$T" && pwd)" # a python that actually RUNS, not just a name on the path (on Windows, python3 is often a # Microsoft Store placeholder that prints nothing and exits 49) PY="" for c in python3 python; do if command -v "$c" >/dev/null 2>&1 && [ "$("$c" -c 'print(1)' 2>/dev/null)" = "1" ]; then PY="$c"; break; fi done hooks=0 for s in "$HOME/.claude/settings.json" "$T/.claude/settings.json" "$T/.claude/settings.local.json"; do [ -f "$s" ] || continue if [ -n "$PY" ]; then out="$("$PY" - "$s" <<'PYEOF' import json, sys try: d = json.load(open(sys.argv[1], encoding="utf-8")) except Exception as e: print(" unreadable " + str(e)); sys.exit(0) for event, groups in (d.get("hooks") or {}).items(): for g in groups or []: m = g.get("matcher") or "every call" for h in g.get("hooks") or []: c = (h.get("command") or "").replace("\n", " ") print(" hook %-18s %-22s %s" % (event, m[:22], c[:150])) PYEOF )" else out="$(grep -o '"command": *"[^"]*' "$s" | sed 's/"command": *"/ hook /')" fi if [ -n "$out" ]; then echo "from $s" printf '%s\n' "$out" hooks=$((hooks + $(printf '%s\n' "$out" | grep -c '^ hook'))) fi done echo "HOOKS $hooks commands that run on their own" # 2026-10-07 (a member found it): run from a cloud sandbox (Cowork, a web session), # this computer's home folder is not the owner's, so their own hooks are invisible. A 0 there # would tell them they have no guards when they might. Say it could not see, never 0. if [ ! -f "$HOME/.claude/settings.json" ]; then echo "BLIND couldn't see the owner's own hooks: this computer has no $HOME/.claude/settings.json" echo " (a cloud sandbox has none). The count above is the target's own settings only." echo " Report the owner's hooks as \"couldn't see\", never as 0." fi checks="$(find "$T" \( -name .git -o -name node_modules \) -prune -o -type f \ \( -name '*.sh' -o -name '*.py' -o -name '*.mjs' -o -name '*.js' -o -name '*.ps1' \) -print 2>/dev/null \ | grep -iE '(check|guard|lint|valid|gate|test|audit|verify|hook)[^/]*$' \ | grep -v '/4r-audits/' | sort)" # 2026-10-18 (fix 21 of an audit): the audit's own saved tests are not the owner's checks nchecks=0 [ -n "$checks" ] && nchecks=$(printf '%s\n' "$checks" | wc -l | tr -d ' ') echo "CHECKS $nchecks scripts named like a check" [ -n "$checks" ] && printf '%s\n' "$checks" | sed "s#^$T/# check #" | head -60 [ "$nchecks" -gt 60 ] && echo " (first 60 of $nchecks shown)" other=$(find "$T" \( -name .git -o -name node_modules \) -prune -o -type f \ \( -name '*.sh' -o -name '*.py' -o -name '*.mjs' -o -name '*.ps1' \) -print 2>/dev/null | wc -l | tr -d ' ') echo "SCRIPTS $other scripts in the tree in all" exit 0scripts/nested-repos.sh4.0 KB8cab8704838cupstream ↗
#!/usr/bin/env bash # nested-repos.sh - 4R audit, layer 1, question 6. Read only. # # Usage: bash nested-repos.sh <target folder> # # Finds every folder inside the target that keeps its own save history (a git repo), # up to 4 levels down. For each 1 it prints: # parent how the target's own backup sees the folder: a pointer (backs up nothing # inside), ignored (fine only if the folder has its own online copy), # untracked (never saved by the parent), or tracked # unsaved changes not saved (committed) in the folder's own history # unpushed saves that never reached the folder's online copy, or "no online copy" # behind saves the online copy has that this computer never got (asks the online copy, read only) # # Exit 0 = no nested repo, or every nested repo is saved, pushed and not a pointer. # Exit 1 = at least 1 nested repo is at risk. set -u # 2026-10-07 (a member found it): a plain "git status" rewrites .git/index and can # leave an index.lock behind in the folder it reads. This keeps every git call read only. export GIT_OPTIONAL_LOCKS=0 T="${1:?usage: bash nested-repos.sh <target folder>}" [ -d "$T" ] || { echo "nested-repos: no folder at $T"; exit 2; } T="$(cd "$T" && pwd)" parent_is_repo=0 git -C "$T" rev-parse --show-toplevel >/dev/null 2>&1 && parent_is_repo=1 n=0; risk=0 while IFS= read -r g; do R="$(dirname "$g")"; rel="${R#$T/}" n=$((n + 1)) view="n/a (the target has no save history of its own)" if [ "$parent_is_repo" -eq 1 ]; then if git -C "$T" ls-files -s -- "$rel" 2>/dev/null | awk '$1=="160000"' | grep -q .; then view="POINTER, the parent backs up nothing inside this folder"; risk=1 elif git -C "$T" check-ignore -q -- "$rel/" 2>/dev/null || git -C "$T" check-ignore -q -- "$rel" 2>/dev/null; then view="ignored by the parent, so this folder's own online copy is its only backup" elif git -C "$T" ls-files -- "$rel" 2>/dev/null | grep -q .; then view="tracked by the parent" else view="UNTRACKED, the parent never saved this folder"; risk=1 fi fi unsaved=$(git -C "$R" status --porcelain 2>/dev/null | wc -l | tr -d ' ') if git -C "$R" rev-parse --abbrev-ref --symbolic-full-name '@{u}' >/dev/null 2>&1; then unpushed="$(git -C "$R" rev-list --count '@{u}..HEAD' 2>/dev/null) saves not pushed" [ "$(git -C "$R" rev-list --count '@{u}..HEAD' 2>/dev/null)" != "0" ] && risk=1 else unpushed="NO ONLINE COPY set up"; risk=1 fi # behind: the online copy holds saves this computer never got (2026-10-05: a laptop copy of an app sat 118 saves # behind its online copy and this check called the folder fine). Asks the online copy directly, read only, 20 s max. # NESTED_OFFLINE=1 skips the question. behind="" if [ -z "${NESTED_OFFLINE:-}" ] && up="$(git -C "$R" rev-parse --abbrev-ref --symbolic-full-name '@{u}' 2>/dev/null)"; then rem="${up%%/*}"; br="${up#*/}" # macOS ships no timeout command, so it is only used where it exists (a Mac user caught this, 2026-10-09). TO=""; command -v timeout >/dev/null 2>&1 && TO="timeout 20" head_online="$($TO git -C "$R" ls-remote "$rem" "refs/heads/$br" 2>/dev/null | awk '{print $1}')" if [ -n "$head_online" ] && [ "$head_online" != "$(git -C "$R" rev-parse HEAD 2>/dev/null)" ]; then if ! git -C "$R" cat-file -e "$head_online^{commit}" 2>/dev/null; then behind="BEHIND, the online copy has saves this computer never got"; risk=1 elif [ "$(git -C "$R" rev-list --count "HEAD..$head_online" 2>/dev/null)" != "0" ]; then behind="BEHIND by $(git -C "$R" rev-list --count "HEAD..$head_online") saves"; risk=1 fi fi fi [ "$unsaved" != "0" ] && risk=1 printf '%s/\n parent %s\n unsaved %s changes\n unpushed %s\n' "$rel" "$view" "$unsaved" "$unpushed" [ -n "$behind" ] && printf ' behind %s\n' "$behind" done < <(find "$T" -mindepth 2 -maxdepth 5 -name .git -not -path '*/node_modules/*' 2>/dev/null | sort) echo "NESTED $n folders inside the target keep their own save history" exit "$risk"scripts/placeholders.sh3.2 KBd0be432f7ffcupstream ↗
#!/usr/bin/env bash # placeholders.sh - 4R audit, layer 1, question 5. Read only. # # Usage: bash placeholders.sh <target folder> # # Finds lines holding an unfilled slot: {{slots}}, [YOUR ...], TODO, TBD, lorem ipsum, # NOT FILLED IN, <PRODUCT NAME>. The finding is the slots in ENTRY files, the files an # agent reads first on every run: CLAUDE.md, AGENTS.md, CONTEXT.md, README.md, SKILL.md. # Slots anywhere else are counted as background, because a page draft or a customer's # own file can hold slots on purpose. # # Never counted: archives (_archive, archive), build output (dist, build), .git, # node_modules, and templates (a folder named template, templates, _templates or # skeleton, or a file with "template" in its name), because a template is supposed # to hold slots. # # Exit 0 = no slot in any entry file. Exit 1 = at least 1. set -u # 2026-10-07 (a member found it): a plain "git status" rewrites .git/index and can # leave an index.lock behind in the folder it reads. This keeps every git call read only. export GIT_OPTIONAL_LOCKS=0 T="${1:?usage: bash placeholders.sh <target folder>}" [ -d "$T" ] || { echo "placeholders: no folder at $T"; exit 2; } T="$(cd "$T" && pwd)" # 1 awk pass over every candidate file. A slot shown inside `backticks` or inside a ``` code # block is documentation (a skill explaining the slots the skill fills), never a gap. AWKRX='\{\{[^}]+\}\}|\[YOUR [^]]+\]|(^|[^A-Za-z])TODO([^A-Za-z]|$)|(^|[^A-Za-z])TBD([^A-Za-z]|$)|[Ll]orem ipsum|NOT FILLED IN|<PRODUCT NAME>' counts="$(find "$T" \( -name .git -o -name node_modules -o -name _archive -o -name archive -o -name dist -o -name build \) -prune -o \ -type f \( -name '*.md' -o -name '*.txt' -o -name '*.html' \) -print0 2>/dev/null \ | xargs -0 awk -v rx="$AWKRX" ' FNR == 1 { fence = 0 } /^[[:space:]]*```/ { fence = !fence; next } fence { next } { line = $0; gsub(/`[^`]*`/, "", line); if (line ~ rx) c[FILENAME]++ } END { for (f in c) print f ":" c[f] }' 2>/dev/null)" entry=0; entryfiles=0; entrylines=""; other=0; otherfiles=0; otherlines=""; tpl=0; tplfiles=0 while IFS= read -r c; do [ -z "$c" ] && continue n="${c##*:}"; f="${c%:*}"; rel="${f#$T/}"; base="${rel##*/}" case "/$rel" in */template/*|*/templates/*|*/_templates/*|*/skeleton/*|*-skeleton/*|*template*) tpl=$((tpl + n)); tplfiles=$((tplfiles + 1)); continue ;; esac case "$base" in CLAUDE.md|AGENTS.md|CONTEXT.md|README.md|SKILL.md) entry=$((entry + n)); entryfiles=$((entryfiles + 1)); entrylines="$entrylines $n $rel" ;; *) other=$((other + n)); otherfiles=$((otherfiles + 1)); otherlines="$otherlines $n $rel" ;; esac done <<< "$counts" echo "SLOTS $entry lines with an unfilled slot in $entryfiles ENTRY files (read first, every run)" printf '%s\n' "$entrylines" | sed '/^$/d' | sort -rn | head -25 | awk -F'\t' '{printf " entry %4d %s\n", $1, $2}' echo " background: $other more lines in $otherfiles other files, top 10:" printf '%s\n' "$otherlines" | sed '/^$/d' | sort -rn | head -10 | awk -F'\t' '{printf " other %4d %s\n", $1, $2}' echo " $tpl more lines in $tplfiles template files, where slots belong" [ "$entry" -eq 0 ] && exit 0 exit 1scripts/routes.sh4.5 KB83831cb5a062upstream ↗
#!/usr/bin/env bash # routes.sh - 4R audit, layer 1, questions 1 and 2. Read only. # # Usage: bash routes.sh <target folder> # # 1. Every path the entry files (CLAUDE.md, AGENTS.md, CONTEXT.md at the top of the # target) name in backticks is checked on disk. A path is a backticked token with a # slash in it or a file ending (.md .sh .py and so on). Placeholders (<slug>, {{x}}, # [brand]), globs, web addresses and commands with spaces are skipped, because # nothing can resolve them. A name that is not at the top but exists elsewhere in # the target is a SHORT name, counted apart: the name resolves, just not from the top. # 2. Every top level folder is checked for a mention anywhere in those entry files. # # Exit 0 = every route resolves and every top folder is named. Exit 1 = at least 1 # dead route or unnamed folder. Exit 2 = no target, or no entry file at its top. set -u # 2026-10-07 (a member found it): a plain "git status" rewrites .git/index and can # leave an index.lock behind in the folder it reads. This keeps every git call read only. export GIT_OPTIONAL_LOCKS=0 T="${1:?usage: bash routes.sh <target folder>}" [ -d "$T" ] || { echo "routes: no folder at $T"; exit 2; } T="$(cd "$T" && pwd)" entries=() for f in CLAUDE.md AGENTS.md CONTEXT.md; do [ -f "$T/$f" ] && entries+=("$f"); done [ "${#entries[@]}" -eq 0 ] && { echo "routes: no CLAUDE.md, AGENTS.md or CONTEXT.md at the top of $T"; exit 2; } EXT='\.(md|sh|py|mjs|js|cjs|ts|tsx|json|jsonl|html|txt|yml|yaml|csv|ps1|toml|xml|svg|png|jpg|zip)$' # a web address written without http (allodra.ai/affiliate, site.vercel.app/page) is not a route DOMAIN='^[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*\.(com|ai|app|io|net|org|co|dev|so|xyz|us|me)(/|$)' # every file and folder in the target, once, so a short name can be looked up (saved files in a git repo) ALL="$(mktemp)" if git -C "$T" rev-parse --show-toplevel >/dev/null 2>&1; then (cd "$T" && git ls-files) > "$ALL" else (cd "$T" && find . \( -name .git -o -name node_modules \) -prune -o -print | sed 's#^\./##') > "$ALL" fi awk -F/ '{p=""; for(i=1;i<NF;i++){p=p $i "/"; print p}}' "$ALL" | sort -u >> "$ALL" trap 'rm -f "$ALL"' EXIT total=0; dead=0; deadlines=""; short=0; shortlines="" seen="" for f in "${entries[@]}"; do while IFS= read -r hit; do ln="${hit%%:*}"; tok="${hit#*:}"; tok="${tok#\`}"; tok="${tok%\`}" case "$tok" in *'<'*|*'{{'*|*'*'*|*'$'*|*'['*|http*|www.*|~*|/*|*' '*|*'|'*|*'='*) continue ;; esac printf '%s' "$tok" | grep -qiE "$DOMAIN" && continue tok="${tok%%#*}" # drop an #anchor tok="$(printf '%s' "$tok" | sed -E 's/:[0-9]+(-[0-9]+)?$//')" # drop a :line suffix case "$tok" in */*) ;; *) printf '%s' "$tok" | grep -qiE "$EXT" || continue ;; esac [ -z "$tok" ] && continue key="$f|$tok" case "$seen" in *"<$key>"*) continue ;; esac seen="$seen<$key>" total=$((total + 1)) if [ ! -e "$T/$tok" ]; then # not at the top: a short name written without the folder, found elsewhere? where="$(awk -v t="${tok%/}" '{ s=$0; sub(/\/$/, "", s); if (s == t || (length(s) > length(t) && substr(s, length(s) - length(t)) == "/" t)) { n++; if (!f) f=$0 } } END { if (n) print f (n > 1 ? " (and " n-1 " more places, so an agent has to guess)" : "") }' "$ALL")" if [ -n "$where" ]; then short=$((short + 1)) shortlines="$shortlines short $f:$ln \`$tok\` is at $where" else dead=$((dead + 1)) deadlines="$deadlines dead $f:$ln \`$tok\`" fi fi done < <(grep -no '`[^`]*`' "$T/$f" 2>/dev/null) done echo "ROUTES $((total - dead)) of $total named paths resolve (entry files: ${entries[*]})" [ -n "$deadlines" ] && printf '%s\n' "$deadlines" | sed '/^$/d' echo " $short of those are short names, written without the folder and found elsewhere" [ -n "$shortlines" ] && printf '%s\n' "$shortlines" | sed '/^$/d' # 2. rooms: every top level folder, named or not alltext="$(cat "${entries[@]/#/$T/}" 2>/dev/null)" rooms=0; orphans=0; orphanlines="" for d in "$T"/*/; do [ -d "$d" ] || continue name="$(basename "$d")" case "$name" in .*|node_modules) continue ;; esac rooms=$((rooms + 1)) if ! printf '%s' "$alltext" | grep -qF "$name"; then orphans=$((orphans + 1)) orphanlines="$orphanlines orphan $name/" fi done echo "ROOMS $((rooms - orphans)) of $rooms top folders are named in the entry files" [ -n "$orphanlines" ] && printf '%s\n' "$orphanlines" | sed '/^$/d' [ "$dead" -eq 0 ] && [ "$orphans" -eq 0 ] && exit 0 exit 1scripts/secrets.sh4.3 KB1b49537a27bbupstream ↗
#!/usr/bin/env bash # secrets.sh - 4R audit, layer 1, question 7. Read only. Never prints a full key. # # Usage: bash secrets.sh <target folder> # # 1. Scans every text file (binaries, .git, node_modules and build output skipped) for the shapes of # real keys: AI keys, cloud keys, payment keys, chat app tokens, private key blocks. # Each hit prints as file:line, the kind of key, and the first 6 characters only. # In a git repo, each hit also says whether the file is saved in the history (the # worst case: the key ships with every copy and every push). # 2. Lists every settings file that usually holds keys (.env, .env.local and so on, # never .env.example). Fine on 1 machine. Never inside a zip somebody else gets. # # Exit 0 = nothing found. Exit 1 = at least 1 key shape or saved settings file. set -u # 2026-10-07 (a member found it): a plain "git status" rewrites .git/index and can # leave an index.lock behind in the folder it reads. This keeps every git call read only. export GIT_OPTIONAL_LOCKS=0 T="${1:?usage: bash secrets.sh <target folder>}" [ -d "$T" ] || { echo "secrets: no folder at $T"; exit 2; } T="$(cd "$T" && pwd)" is_repo=0; git -C "$T" rev-parse --show-toplevel >/dev/null 2>&1 && is_repo=1 KINDS='AI key (Anthropic)|sk-ant-[A-Za-z0-9_-]{20,} AI key (OpenRouter)|sk-or-v1-[A-Za-z0-9]{32,} AI key (OpenAI)|(sk-proj-[A-Za-z0-9_-]{32,}|sk-[A-Za-z0-9]{32,}) cloud key (AWS)|AKIA[0-9A-Z]{16} cloud key (Google)|AIza[0-9A-Za-z_-]{35} code host token (GitHub)|(ghp_[A-Za-z0-9]{36}|github_pat_[A-Za-z0-9_]{40,}) chat app token (Slack)|xox[abprs]-[A-Za-z0-9-]{10,} payment key (Stripe live)|(sk|rk)_live_[A-Za-z0-9]{20,} email key (Resend)|re_[A-Za-z0-9]{8,}_[A-Za-z0-9]{16,} phone app token (Twilio)|(SK[0-9a-fA-F]{32}|AUTH_TOKEN["[:space:]]*[=:]["[:space:]]*[0-9a-fA-F]{32}) named secret in a file|(_TOKEN|_SECRET|_API_KEY|_PASSWORD)["[:space:]]*[=:]["[:space:]]*[A-Za-z0-9_-]{24,} private key block|-----BEGIN [A-Z ]*PRIVATE KEY-----' hits=0; savedhits=0; fakes=0; packed=0 while IFS='|' read -r kind rx; do [ -z "$kind" ] && continue while IFS= read -r h; do file="${h%%:*}"; rest="${h#*:}"; ln="${rest%%:*}"; val="${rest#*:}" rel="${file#$T/}" # a value that names itself a fake (like a test file's "whsec_test_only_not_real") is no key: counted, never listed if [ "$kind" = "named secret in a file" ] && printf '%s' "$val" | grep -qiE 'test|fake|example|dummy|harness|not.?real|placeholder|sample'; then fakes=$((fakes + 1)); continue fi # a match inside a picture packed into a page (a data: address, or a run of 100+ base64 letters # right before or after the match) is the picture's own letters, not a key: counted, never listed v="${val:0:16}" if sed -n "${ln}{p;q}" "$file" | grep -qE "(data:[^,]{0,80};base64,[A-Za-z0-9+/=]*|[A-Za-z0-9+/]{100})$v"; then packed=$((packed + 1)); continue fi saved="" if [ "$is_repo" -eq 1 ]; then if git -C "$T" ls-files --error-unmatch -- "$rel" >/dev/null 2>&1; then saved=" SAVED IN THE HISTORY"; else saved=" on disk only"; fi fi case "$saved" in *SAVED*) savedhits=$((savedhits + 1)) ;; esac printf ' key %s:%s %s %s...%s\n' "$rel" "$ln" "$kind" "${val:0:6}" "$saved" hits=$((hits + 1)) done < <(grep -rInoE --exclude-dir=.git --exclude-dir=node_modules --exclude-dir=.next --exclude-dir=dist --exclude-dir=build "$rx" "$T" 2>/dev/null) done <<< "$KINDS" echo "KEYS $hits key shaped strings found, $savedhits of them SAVED IN THE HISTORY (build output folders .next, dist and build skipped; $fakes values that name themselves test fakes left out; $packed matches inside a picture packed into a page left out)" envs=0 while IFS= read -r e; do rel="${e#$T/}" saved="" if [ "$is_repo" -eq 1 ]; then if git -C "$T" ls-files --error-unmatch -- "$rel" >/dev/null 2>&1; then saved=" SAVED IN THE HISTORY"; else saved=" on disk only, keep out of every zip"; fi fi printf ' file %s%s\n' "$rel" "$saved" envs=$((envs + 1)) done < <(find "$T" \( -name .git -o -name node_modules \) -prune -o -type f \( -name '.env' -o -name '.env.*' \) \ ! -name '*.example' ! -name '*.sample' ! -name '*.template' -print 2>/dev/null | sort) echo "ENVS $envs settings files that usually hold keys" [ "$hits" -eq 0 ] && [ "$envs" -eq 0 ] && exit 0 exit 1scripts/selftest.sh9.9 KB235ee2f708d3upstream ↗
#!/usr/bin/env bash # selftest.sh - proves every 4R script on planted mistakes before anybody trusts it. # The audit's own layer 3, turned on the audit. # # Usage: bash selftest.sh (from anywhere) # # Builds 2 throwaway workspaces in a temp folder: # BAD a dead route, an unnamed folder, an unfilled slot, a key shaped string, # a settings file, a nested repo with unsaved work, a check script # CLEAN the same shape with none of the mistakes # Every script must fire on BAD and stay quiet on CLEAN. The fake key is built while # the test runs, so no key shaped text is ever saved in this repo. # # Exit 0 = every assertion held. Exit 1 = a script is blind or jumpy. set -u HERE="$(cd "$(dirname "$0")" && pwd)" W="$(mktemp -d 2>/dev/null || mktemp -d -t 4r)" trap 'rm -rf "$W"' EXIT fails=0; n=0 ok() { n=$((n + 1)); echo "ok $1"; } bad() { n=$((n + 1)); fails=$((fails + 1)); echo "WRONG $1"; } expect_exit() { [ "$2" = "$3" ] && ok "$1 (exit $3)" || bad "$1 (wanted exit $3, got $2)"; } expect_has() { printf '%s' "$2" | grep -qF -- "$3" && ok "$1" || bad "$1 (missing: $3)"; } expect_not() { printf '%s' "$2" | grep -qF -- "$3" && bad "$1 (should not print: $3)" || ok "$1"; } # ---------- BAD ---------- B="$W/bad"; mkdir -p "$B/docs" "$B/orphan" "$B/scripts" "$B/inner" printf '# Bad\n\nRead `docs/a.md` first, then `docs/missing.md`. Checks live in `scripts/`.\n' > "$B/CLAUDE.md" printf 'Notes are in `notes.md`. Name files like `[brand]-[slug].md`. The site is `example.com/page`.\n' >> "$B/CLAUDE.md" printf 'Hello {{client name}}.\n' > "$B/docs/a.md" printf 'Owner: {{your name}}\n' >> "$B/CLAUDE.md" printf 'Hi {{name}}\n' > "$B/docs/page-template.html" FAKE="sk-ant-$(printf 'A%.0s' $(seq 1 30))" printf 'key = %s\n' "$FAKE" > "$B/docs/notes.md" printf 'API_KEY=x\n' > "$B/.env" printf 'x\n' > "$B/orphan/x.md" printf '#!/usr/bin/env bash\nexit 0\n' > "$B/scripts/check-thing.sh" (cd "$B/inner" && git init -q . && printf 'x\n' > draft.md) out="$(bash "$HERE/routes.sh" "$B" 2>&1)"; rc=$? expect_exit "routes fires on a dead route" "$rc" 1 expect_has "routes counts 3 of 4 resolving" "$out" "3 of 4 named paths resolve" expect_has "routes names the dead route with its line" "$out" "dead CLAUDE.md:3" expect_has "routes names the unnamed folder" "$out" "orphan orphan/" expect_has "routes finds a short name where the short name lives" "$out" '`notes.md` is at docs/notes.md' expect_not "routes skips a naming example in brackets" "$out" "[brand]" expect_not "routes skips a web address" "$out" "example.com" out="$(bash "$HERE/placeholders.sh" "$B" 2>&1)"; rc=$? expect_exit "placeholders fires on a slot" "$rc" 1 expect_has "placeholders names the entry file" "$out" "entry 1 CLAUDE.md" expect_has "placeholders counts a page draft as background" "$out" "docs/a.md" expect_not "placeholders leaves a file named template alone" "$out" "page-template.html" mkdir -p "$W/doc"; printf '# Doc\n\nThe page fills `{{HEADLINE}}` for you.\n\n```\n{{EXAMPLE}}\n```\n' > "$W/doc/SKILL.md" out="$(bash "$HERE/placeholders.sh" "$W/doc" 2>&1)"; rc=$? expect_exit "placeholders leaves slots shown as code alone" "$rc" 0 mkdir -p "$W/sp"; printf '# Sp\n\nOwner: {{your name}}\n' > "$W/sp/README.md"; mkdir -p "$W/sp/my notes"; printf 'Hi {{x}}\n' > "$W/sp/my notes/draft page.md" out="$(bash "$HERE/placeholders.sh" "$W/sp" 2>&1)" expect_has "placeholders reads a file with spaces in its name" "$out" "my notes/draft page.md" out="$(bash "$HERE/secrets.sh" "$B" 2>&1)"; rc=$? expect_exit "secrets fires on a key" "$rc" 1 expect_has "secrets names the kind" "$out" "AI key (Anthropic)" expect_has "secrets lists the settings file" "$out" "ENVS 1 settings" expect_not "secrets never prints the full key" "$out" "$FAKE" TW="$(printf '%s%s' 0123456789abcdef 0123456789abcdef)" # built at run time so this file holds no token shape mkdir -p "$W/tw/.claude"; printf '{"allow":["Bash(sed -i s/^TWILIO_AUTH_TOKEN=.*/TWILIO_AUTH_TOKEN=%s/ .env.local)"]}\n' "$TW" > "$W/tw/.claude/settings.local.json" out="$(bash "$HERE/secrets.sh" "$W/tw" 2>&1)"; rc=$? expect_exit "secrets fires on a token pasted into an allow rule" "$rc" 1 expect_has "secrets names a Twilio token" "$out" "phone app token (Twilio)" NS="$(printf '%s%s' Zq8kLmN3pR7tVx2y B5cD9fG4hJ6kM1nP)" mkdir -p "$W/ns"; printf 'BUILD_GRANT_SECRET=%s\n' "$NS" > "$W/ns/notes.md" out="$(bash "$HERE/secrets.sh" "$W/ns" 2>&1)"; rc=$? expect_has "secrets names a secret saved under its own name" "$out" "named secret in a file" mkdir -p "$W/nc"; printf 'Set BUILD_GRANT_SECRET in Vercel. Never paste the value here.\n' > "$W/nc/notes.md" out="$(bash "$HERE/secrets.sh" "$W/nc" 2>&1)"; rc=$? expect_exit "secrets quiet on a secret named but not written" "$rc" 0 mkdir -p "$W/nf"; printf 'process.env.X_SECRET = "whsec_test_only_not_real_000000";\n' > "$W/nf/a.test.mjs" out="$(bash "$HERE/secrets.sh" "$W/nf" 2>&1)"; rc=$? expect_exit "secrets quiet on a value that names itself a test fake" "$rc" 0 out="$(bash "$HERE/nested-repos.sh" "$B" 2>&1)"; rc=$? expect_exit "nested-repos fires on unsaved work" "$rc" 1 expect_has "nested-repos names the folder" "$out" "inner/" expect_has "nested-repos sees no online copy" "$out" "NO ONLINE COPY" out="$(bash "$HERE/guards.sh" "$B" 2>&1)"; rc=$? expect_exit "guards always lists" "$rc" 0 expect_has "guards finds the check script" "$out" "check-thing.sh" mkdir -p "$B/.claude" printf '{"hooks":{"PreToolUse":[{"matcher":"Write","hooks":[{"type":"command","command":"bash scripts/check-thing.sh"}]}]}}' > "$B/.claude/settings.json" out="$(HOME="$W/nohome" bash "$HERE/guards.sh" "$B" 2>&1)" expect_has "guards reads a hook out of the target's settings" "$out" "HOOKS 1 commands" expect_has "guards says it could not see the owner's hooks on a computer with none" "$out" "BLIND" # 2026-10-07: the audit never writes into the target, not even git's own cache find "$B" -path '*/.git/*' -prune -o -type f -print | while read -r f; do touch "$f"; done before="$(find "$B" -path '*/.git/index*' -type f -exec md5sum {} + | sort)" NESTED_OFFLINE=1 bash "$HERE/nested-repos.sh" "$B" >/dev/null 2>&1 after="$(find "$B" -path '*/.git/index*' -type f -exec md5sum {} + | sort)" [ "$before" = "$after" ] && ok "nested-repos leaves every .git/index untouched" || bad "nested-repos rewrote a .git/index in the target" D="$W/scratch" out="$(bash "$HERE/copy-target.sh" "$B" "$D" 2>&1)"; rc=$? expect_exit "copy-target copies" "$rc" 0 [ -f "$D/docs/a.md" ] && ok "copy-target copied a nested file" || bad "copy-target lost docs/a.md" out="$(bash "$HERE/copy-target.sh" "$B" "$B/inside" 2>&1)"; rc=$? expect_exit "copy-target refuses a scratch inside the target" "$rc" 2 [ -d "$B/inside" ] && bad "copy-target left a folder inside the target" || ok "copy-target left the target untouched" # ---------- A KEY SAVED IN THE HISTORY ---------- K="$W/saved"; mkdir -p "$K" printf 'key = %s\n' "$FAKE" > "$K/config.md" (cd "$K" && git init -q . && git add config.md && git -c user.name=t -c user.email=t@t commit -q -m t) out="$(bash "$HERE/secrets.sh" "$K" 2>&1)"; rc=$? expect_exit "secrets fires on a saved key" "$rc" 1 expect_has "secrets says the key is saved in the history" "$out" "1 of them SAVED IN THE HISTORY" # ---------- SIZE ---------- Z="$W/size"; mkdir -p "$Z/skills/s" "$Z/scripts" "$Z/build" "$Z/docs" printf 'a\nb\nc\n' > "$Z/CLAUDE.md" printf 'a\nb\n' > "$Z/skills/s/SKILL.md" printf 'a\nb\nc\nd\n' > "$Z/scripts/check.sh" printf 'a\nb\nc\nd\ne\nf\ng\nh\n' > "$Z/build/app.js" printf 'not counted\n' > "$Z/docs/notes.md" printf '# old\nSIZE rules=2 skills=2 checks=2 files=3\n' > "$W/old-record.md" out="$(bash "$HERE/size.sh" "$Z" 2>&1)"; rc=$? expect_exit "size counts a workspace" "$rc" 0 expect_has "size counts the exact lines in each part" "$out" "SIZE rules=3 skills=2 checks=4 files=3" expect_has "size sets the build folder aside" "$out" "set aside: 1 machine built" out="$(bash "$HERE/size.sh" "$Z" "$W/old-record.md" 2>&1)" expect_has "size shows growth against the last record" "$out" "(last audit 2, +2, +100%)" expect_has "size shows no change where nothing grew" "$out" "(last audit 2, +0, +0%)" # ---------- A LAPTOP COPY BEHIND ITS ONLINE COPY ---------- N="$W/behind"; mkdir -p "$N" git init -q --bare "$W/online.git" (cd "$N" && git init -q -b main inner && cd inner && printf 'a\n' > a.md && git add a.md && git -c user.name=t -c user.email=t@t commit -q -m a \ && git remote add origin "$W/online.git" && git push -q -u origin main 2>/dev/null) printf '# N\n\nThe app lives in `inner/`.\n' > "$N/CLAUDE.md" (cd "$W" && git clone -q -b main "$W/online.git" other 2>/dev/null && cd other && printf 'b\n' > b.md && git add b.md \ && git -c user.name=t -c user.email=t@t commit -q -m b && git push -q origin main 2>/dev/null) out="$(bash "$HERE/nested-repos.sh" "$N" 2>&1)"; rc=$? expect_exit "nested-repos fires on a copy behind its online copy" "$rc" 1 expect_has "nested-repos says the copy is behind" "$out" "BEHIND, the online copy has saves this computer never got" (cd "$N/inner" && git pull -q 2>/dev/null) out="$(bash "$HERE/nested-repos.sh" "$N" 2>&1)" expect_not "nested-repos quiet once the copy catches up" "$out" "BEHIND" # ---------- CLEAN ---------- C="$W/clean"; mkdir -p "$C/docs" printf '# Clean\n\nRead `docs/a.md` first. Everything lives in `docs/`.\n' > "$C/CLAUDE.md" printf 'Hello Dana.\n' > "$C/docs/a.md" out="$(bash "$HERE/routes.sh" "$C" 2>&1)"; rc=$? expect_exit "routes quiet on a clean map" "$rc" 0 expect_has "routes counts 2 of 2" "$out" "2 of 2 named paths resolve" out="$(bash "$HERE/placeholders.sh" "$C" 2>&1)"; rc=$? expect_exit "placeholders quiet on filled files" "$rc" 0 out="$(bash "$HERE/secrets.sh" "$C" 2>&1)"; rc=$? expect_exit "secrets quiet with no keys" "$rc" 0 out="$(bash "$HERE/nested-repos.sh" "$C" 2>&1)"; rc=$? expect_exit "nested-repos quiet with no nested repo" "$rc" 0 echo if [ "$fails" -eq 0 ]; then echo "selftest: $n of $n held. Every script fires on the mistake and stays quiet on the clean case."; exit 0; fi echo "selftest: $fails of $n WRONG. Do not trust the audit until this passes."; exit 1scripts/size.sh5.4 KB033b92becbd7upstream ↗
#!/usr/bin/env bash # size.sh - 4R audit, layer 1, question 9: is the workspace growing? Read only. # # Usage: bash size.sh <target folder> [last record .md] # # Counts the lines in the 3 parts of a workspace that grow every time a fix gets ADDED: # rules the files an agent reads first: every CLAUDE.md, AGENTS.md and CONTEXT.md # skills the written instructions: every .md under a folder named skills/, and every SKILL.md # checks every script: .sh .py .mjs .js .cjs .ts .ps1 (hooks, guards, check scripts) # Set aside (counted apart, never in the totals): build/ dist/ vendor/ .next/ coverage/ gsd-core/ synced/, *.min.js, *.bundle.js, # and any folder holding a file named .4r-borrowed (a toolkit somebody else wrote, installed as is) # Saved files only when the target is a git repo (what an agent and a backup both see), # else every file. node_modules and .git are never counted. # Prints each part, the 10 biggest files, and 1 machine line the record keeps: # SIZE rules=<lines> skills=<lines> checks=<lines> files=<count> # Given the last record, the change since then prints beside each part. # # Why this exists (2026-10-05): a builder's own routine audits grew his harness from about # 15,000 lines to 95,000 in a few weeks, because every fix was ADDED and almost nothing was # deleted. An audit that never counts size cannot see that coming. # # Exit 0 = counted. Exit 2 = no target. Growth is a finding for the report, never a crash. set -u # 2026-10-07 (a member found it): a plain "git status" rewrites .git/index and can # leave an index.lock behind in the folder it reads. This keeps every git call read only. export GIT_OPTIONAL_LOCKS=0 T="${1:?usage: bash size.sh <target folder> [last record .md]}" LAST="${2:-}" [ -d "$T" ] || { echo "size: no folder at $T"; exit 2; } T="$(cd "$T" && pwd)" W="$(mktemp -d 2>/dev/null || mktemp -d -t size)" trap 'rm -rf "$W"' EXIT if git -C "$T" rev-parse --show-toplevel >/dev/null 2>&1; then (cd "$T" && git ls-files) > "$W/all" else (cd "$T" && find . \( -name .git -o -name node_modules \) -prune -o -type f -print | sed 's#^\./##') > "$W/all" fi # sort every path into its part in 1 pass, then count lines in batches, never 1 program per file # (1 program per file took minutes on a 28,000 file workspace on Windows) # machine built or borrowed code is set aside and counted apart: nobody wrote those lines by hand, and they would # drown the signal (a video app's build folder alone held 250,000 lines on the first run) # 2026-10-18 (fix 20 of an audit): a borrowed toolkit installed as a skill (39,246 lines) counted as the owner's own # checks and made a quiet 2 weeks read +38%. A folder holding a file named .4r-borrowed is set aside with all it holds. (cd "$T" && find . \( -name .git -o -name node_modules \) -prune -o -type f -name .4r-borrowed -print 2>/dev/null \ | sed 's#^\./##; s#\.4r-borrowed$##') > "$W/borrowed" awk -v R="$W/rules" -v S="$W/skills" -v C="$W/checks" -v X="$W/aside" -v B="$W/borrowed" ' BEGIN { nb = 0; while ((getline line < B) > 0) if (line != "") bp[++nb] = line } /(^|\/)node_modules\// { next } /(^|\/)(build|dist|vendor|\.next|coverage|gsd-core|synced)\// || /\.(min|bundle)\.js$/ { print > X; next } { for (i = 1; i <= nb; i++) if (index($0, bp[i]) == 1) { print > X; next } } { n = split($0, a, "/"); b = a[n] if (b == "CLAUDE.md" || b == "AGENTS.md" || b == "CONTEXT.md") print > R else if (($0 ~ /(^|\/)skills\// && b ~ /\.md$/) || b == "SKILL.md") print > S else if (b ~ /\.(sh|py|mjs|js|cjs|ts|ps1)$/) print > C }' "$W/all" : > "$W/rows" for p in rules skills checks; do [ -s "$W/$p" ] || continue (cd "$T" && tr '\n' '\000' < "$W/$p" | xargs -0 wc -l 2>/dev/null) \ | awk -v p="$p" '{ n = $1; sub(/^ *[0-9]+ /, ""); if ($0 != "total") printf "%s\t%s\t%s\n", p, n, $0 }' >> "$W/rows" done sum() { awk -F'\t' -v p="$1" '$1 == p { s += $2 } END { print s + 0 }' "$W/rows"; } cnt() { awk -F'\t' -v p="$1" '$1 == p { n++ } END { print n + 0 }' "$W/rows"; } rules=$(sum rules); skills=$(sum skills); checks=$(sum checks) files=$(awk 'END { print NR + 0 }' "$W/rows") was() { # the number this part had in the last record's SIZE line [ -n "$LAST" ] && [ -f "$LAST" ] || return 0 grep -o "SIZE rules=[0-9]* skills=[0-9]* checks=[0-9]* files=[0-9]*" "$LAST" | tail -1 | tr ' ' '\n' | awk -F= -v k="$1" '$1 == k { print $2 }' } line() { # part, lines, files w="$(was "$1")" if [ -n "$w" ]; then d=$(( $2 - w )) pct=$(awk -v a="$2" -v b="$w" 'BEGIN { if (b > 0) printf "%+.0f%%", (a - b) * 100 / b; else print "new" }') printf ' %-7s %7s lines in %5s files (last audit %s, %+d, %s)\n' "$1" "$2" "$3" "$w" "$d" "$pct" else printf ' %-7s %7s lines in %5s files\n' "$1" "$2" "$3" fi } echo "size: the parts that grow when a fix gets added" line rules "$rules" "$(cnt rules)" line skills "$skills" "$(cnt skills)" line checks "$checks" "$(cnt checks)" [ -n "$LAST" ] && [ -z "$(was rules)" ] && echo " (the last record has no SIZE line, so this run is the size baseline)" echo "the 10 biggest of them:" sort -t "$(printf '\t')" -k2,2nr "$W/rows" | head -10 | awk -F'\t' '{ printf " %7s %-7s %s\n", $2, $1, $3 }' aside=$( [ -s "$W/aside" ] && awk 'END { print NR + 0 }' "$W/aside" || echo 0 ) [ "$aside" -gt 0 ] && echo "set aside: $aside machine built or borrowed files (build, dist, vendor, bundles, toolkits), not counted" echo "SIZE rules=$rules skills=$skills checks=$checks files=$files" exit 0references/fix.md2.5 KB123068f2d151upstream ↗
# After the report: the fix pass The audit never fixes while it measures. Once the report is in the owner's hands, the audit offers to fix every item on it, in rank order. On the owner's go, this is the pass. ## Before the first fix 1. **Read the list back in rank order.** All of it. The owner's go covers the list as shown. 2. **Pull out the calls only the owner can make.** Anything that spends money, deletes something, sends to a customer or a list, changes a price, or picks between 2 business choices. Ask each 1 as 1 plain question. Those fixes wait for the answer. Every other fix goes ahead. 3. **Follow the workspace's own rules for making changes.** If the workspace says a change to an app goes through a named process, a review, or a gate, each fix goes through it. The fix pass never steps around a gate the audit just proved. ## Each fix, 1 at a time, in rank order 1. **Look for a line to delete or combine before you add 1.** A stale clause gets replaced, not joined by a new 1. A rule written in 2 places becomes 1 place. A fix pass that only ever adds is how a workspace bloats: a builder's own audits took his setup from about 15,000 lines to 95,000 that way. 2. **Make the change.** The smallest change that closes the finding. 1 fix, 1 change. 3. **Prove the change with the same test that found it.** - A guard that came out blind: plant the same mistake again. The guard fires now. Plant the clean case again. The guard stays quiet. - A claim that was not true: the claim now matches the thing it describes. - A dead route, a slot, a 2 way fact: run the script that found it. The line is gone. - A stuck point: the file and line the stranger named now say the thing plainly. 4. **Write 1 line in the record** under the fix: what changed, the file and line, the lines added and the lines removed (counted, never guessed), and the proof (the command and its output). 5. A fix that cannot be proven is not done. Say so in the record and move on. ## After the last fix 1. **Run the 4R audit again**, all 4 layers, on a fresh scratch copy. 2. The new report shows **before and after** for every count, the size line included (run `scripts/size.sh` again, with the first record as the last record), and every fix from this list marked fixed, still open (with why), or waiting on the owner's answer. 3. Anything the second run finds that the first did not goes on the new list, measured and ranked like the rest. Say plainly that it is new and why the first run missed it.references/read.md5.2 KBeb468d78f9c5upstream ↗
# Layer 1, READ: 9 questions Read the target's entry files first: the root `CLAUDE.md` (or `AGENTS.md`), then the root `CONTEXT.md`. Then answer each question below. A question with a script gets the script's output as its evidence. A question without a script gets a file and a line. All scripts take the target folder and print their own evidence. Run them from the skill folder: `bash scripts/<name>.sh <target>`. --- ## 1. Do the routes go anywhere? `bash scripts/routes.sh <target>` Every path the entry files name, checked on disk. The script prints `N of M resolve` and lists each dead route with the file and line it sits on. A dead route is the cheapest hard finding there is: the agent follows the map and lands on nothing. ## 2. Is every room on the map? The same script's second half: every top level folder, checked for a mention in the entry files. A folder nobody routes to is a folder the agent never opens. It is either dead weight or work the owner thinks is covered and is not. ## 3. What holds up the biggest promise? Find every strong rule in the entry files: the lines with always, never, only, every, must, or refuse. List them all. Mark the ones that would cost the most if broken (money, a customer, lost work), but test every 1 in layer 3, not only the costly ones. Then run `bash scripts/guards.sh <target>`. The script lists everything that actually runs: the hooks in the Claude settings files and the check scripts in the tree. For each of the 3 rules, name the guard that holds the rule, or write "held by the sentence only". A hook that only adds a reminder and never blocks counts as a sentence. If the script prints a `BLIND` line, the audit is running on a computer that is not the owner's (a cloud sandbox like Cowork). Their own hooks were invisible. Write "couldn't see" for the owner's hooks, never 0, and list it under what the audit could not see. A rule held only by a sentence is a finding even if nobody has broken the rule yet. Layer 3 tests every guard named here. ## 4. Does an example break the rule printed beside the example? Open every file with a worked example, a sample output, or a "for instance". Check each example against the rules printed near the example, 1 at a time. 2 kinds show up: - **The example contradicts the rule.** The rule says under 200 words, the sample runs 400. - **The example leans on something that does not exist.** The sample reads `data/clients.csv` and there is no `data/` folder. This is slow. This is also where the quiet findings live, because a model copies examples before a model follows rules. ## 5. Is the owner in the workspace, or a template? `bash scripts/placeholders.sh <target>` Counts the unfilled slots per file: `{{slots}}`, `[YOUR ...]`, TODO, TBD, lorem ipsum, `NOT FILLED IN`, `<PRODUCT NAME>`. A workspace full of slots makes an agent that writes like nobody, because the owner's voice, offer and facts never made the trip in. Say which slots sit in files the agent reads on every run. ## 6. Is any work sitting unsaved? `bash scripts/nested-repos.sh <target>` Finds every folder with its own save history (a git repo) inside the target. For each 1 the script says whether the parent backup can see the folder, how many changes sit unsaved, and how many saves never reached the online copy. A repo the parent treats as a pointer is backed up by nobody. ## 7. Are there keys lying in files? `bash scripts/secrets.sh <target>` Scans every text file for the shapes of real keys (AI keys, cloud keys, payment keys, private key blocks) and for saved settings files that usually hold keys. The script masks every value the script prints. A key in a file is 1 shared zip away from a stranger. ## 8. Does the workspace tell 1 truth? Check every fact the owner cares about that the entry files and status files state: every price, every status (live, built, waiting), every count, every place a thing lives, every date a status was written. 3 at the least. Search the tree for each 1. If the same fact is written in 2 places and the 2 disagree, the agent will quote whichever 1 the agent read last. Cite both places. Every disagreement is its own fix. ## 9. Is the workspace growing? `bash scripts/size.sh <target> <last record>` Counts the lines in the 3 parts that grow every time a fix gets added: the rules an agent reads first (every CLAUDE.md, AGENTS.md, CONTEXT.md), the skills (the written instructions), and the checks (every hook, guard and script). Machine built or borrowed code is set aside and counted apart. Given the last record, each part shows its change since then. A builder's own routine audits grew his setup from about 15,000 lines to 95,000 in a few weeks, because every fix was added and almost nothing was deleted. An agent reads more, follows less, and costs more every time that happens. Growth is not a crime: new work adds lines. **A part that grew while the work stayed the same is a finding**, and so is any 1 file in the 10 biggest that nobody can say why it is that big. The record keeps the SIZE line so the next audit can compare. --- ## What layer 1 hands to the next layers - The 3 promises from question 3, with their guards or "sentence only". Layer 3 tests them. - The job for layer 2: the thing the workspace exists to do, named in the workspace's own entry file.references/reality.md3.9 KB36d98ce8efadupstream ↗
# Layer 3, REALITY: prove the guards, check the claims A guard that exists is not a guard that works. A claim that says done is not a thing that is done. Layer 3 checks both, and only in the scratch copy. ## Part A0: replay the saved tests first The results home keeps a folder `4r-tests/` beside the records: every mistake and clean case any earlier run planted, each with the guard it feeds, the exact input, and what the guard should do (block or pass). Replay every 1 of them first, unchanged. **These replays are the only guard numbers that go in "since last time".** A saved test that held last time and breaks now is a real step back. Never rewrite a saved test to make it pass. ## Part A: plant new shapes, only where something changed Plant new tests only for: a promise with no saved tests yet, a guard file changed since the last record (its date or its save history says so), or a hole the owner named. Nothing changed means nothing new gets planted, and the replay is the answer. Every new test gets saved into `4r-tests/` the same run, and the report lists new tests in their own count, apart from the replays. For each promise that gets new tests: 1. **Find the guard's input.** A hook reads what the agent is about to write. A check script reads a file or a folder. A test reads a fixture. 2. **Plant 1 mistake the guard should catch.** Make the mistake real and specific: the banned word in a sentence, a price that is not on the price list, a file in the wrong folder, a key in a settings file. Plant the mistake in the scratch copy, or feed the guard a copy of its input with the mistake in it. 3. **Plant 1 clean case the guard should pass.** Almost the same input, without the mistake. A guard that blocks everything is as broken as a guard that blocks nothing. 4. **Plant every shape the mistake comes in.** A send script can have 2 names. A banned word can have 2 spellings. A guard that catches 1 shape and misses the other is blind, and only planting both shows it. 5. **Run the guard on all of them. Record 4 things:** did the guard fire on the mistake, did the guard stay quiet on the clean case, the exact line the guard printed, and the exit code. Score each guard with 1 word: | Word | Means | |---|---| | **proven** | fired on the mistake, passed the clean case | | **blind** | stayed quiet on the mistake | | **jumpy** | fired on the clean case too | | **missing** | the promise has no guard at all (from layer 1) | For a promise with no guard, plant the mistake anyway and show that nothing stops the mistake. That turns "sentence only" from an opinion into evidence. ## Part B: check every claim that says done Find every line in the entry files and the status files that claims a state, 3 at the least: done, live, shipped, approved, passing, backed up, a count. Status files, trackers and handoff notes are full of them. For each 1, check the thing the claim describes: - a file said to exist: does the file exist? - a count: count again. - a check said to pass: run the check. - a date: is the thing older or newer than the claim? A claim that was true once and is not true now is the most common kind of wrong in a workspace, because nobody re-reads a line that says done. Never check a claim by touching something live (a website form, a payment, an email). Read only. If a claim can only be checked live, list the claim under "could not see". ## Part C: if the workspace rebuilds anything, rebuild once If the workspace has a step that regenerates an output (a build, an export, an index), run that step once in the scratch copy with some real work already inside. Check the real work survived. A rebuild that deletes the owner's work is the costliest finding there is, and only running the rebuild finds it. ## Put everything back Save every test planted this run into the results home's `4r-tests/` (the inputs, the expected result, and any small script that feeds them). Then delete the scratch copy. Nothing planted may leave the scratch.references/report.md5.7 KBb9bcc7bb14f0upstream ↗
# Layer 4, REPORT: every finding, measured and ranked 2 outputs, every time: 1. **The record**, `templates/record.md`, saved in the results home as `<target-name>-<YYYY-MM-DD>.md`. If a record for this target already exists from an earlier date, keep that file and start the new 1 with the change since then. **Never write over a record.** A second audit on the same day saves as `<target-name>-<YYYY-MM-DD>-2.md`, a third as `-3`, and so on. The newest record is the "last time" for the next audit. 2. **The page**, `templates/report.html` with every `{{slot}}` filled. In Claude Code with Artifacts, publish the page. Anywhere else, save the page beside the record. ## Step 1. Turn every finding into a fix Go layer by layer and list every finding. Each 1 becomes its own numbered fix. Nothing gets merged away and nothing gets cut for length. The list has no cap. Where findings come from: - **Read:** every dead route, every short name an agent has to guess, every folder not on the map, every rule held by a sentence only, every example that breaks its rule, every unfilled slot in a file the agent reads, every folder with unsaved work, every key in a file, every fact written 2 ways. - **Run:** every place the stranger got stuck that you checked and found true, and the job itself if it came out wrong or not at all. - **Reality:** every guard that came out blind, jumpy or missing, and every claim that is no longer true. - **Last time:** every fix from the last record that is still open. ## Step 2. Measure every fix Each fix carries 3 measurements, all counted, none guessed: | Measurement | What goes in it | |---|---| | **Who it hits** | customers and money, the owner's work, or the agent's way around | | **How much** | the counted number: people on a list, files, days behind, phases, lines, times a stranger got stuck on it. Say what was counted | | **Weight** | 1 of 4, below | The 4 weights, heaviest first: | Weight | Means | Examples | |---|---|---| | **Money** | a customer, a sale, a payment, an email to a list, a key that could leak | a guard that lets a list send through, a buyer who gets nothing, a key in a shared file | | **Lost work** | work that could vanish or a record that lies | unsaved work, a state file behind the truth, a rebuild that deletes work | | **Slows the agent** | the agent gets lost, guesses, or reads the wrong order | a missing route, 2 files that disagree, a rule only a reminder holds | | **Polish** | the owner's own rules broken in small ways | a banned word, an unfilled slot, a title that breaks the voice | ## Step 3. Rank them Heaviest weight first. Inside the same weight, the bigger counted number first. When 2 fixes tie, the 1 the owner's own rules call hardest goes first. Number them 1 to the last. **The most important** are every Money fix, plus any fix that hit the owner or a customer for real in the last week. Name them at the top of the report in plain words, with why each 1 matters. If there are none, say so. ## Step 4. The completeness check, before anything is published Count the findings in each layer of the record and count the fixes. They must match. - Every flagged line from the 6 scripts is a fix, or is named as not a real finding with why (a naming example, a file in a borrowed toolkit). - Every stuck point you checked true is a fix. - Every guard that is not "proven" is a fix. - Every claim that is not true is a fix. - Every open fix from last time is on the list with its age. If the counts do not match, the report is not done. ## The order the owner reads, top to bottom 1. **The verdict, 1 sentence.** What works, what does not, in plain words. 2. **The most important.** The fixes from step 3, each with why it matters. 3. **The counts.** Only numbers that were counted: fixes found by weight, routes that resolve, guards proven out of guards tested, places the stranger got stuck, keys found, folders unsaved, claims still true out of claims checked, open fixes from last time. 4. **Every fix, ranked.** 1 row each: the rank, the fix, who it hits, how much, the weight, the file and line. All of them. 5. **Layer by layer:** what Read found, what Run found (with the stranger's own words for each stuck point), what Reality proved (the guard table). 6. **What the audit could not see.** Always present. An empty section is a claim that the audit saw everything, and no audit does. 7. **The old audit you were doing, next to the 4R audit.** 1 row per finding from today: could an audit that only reads files have found it (finds this, sees the check exists but not that the check works, cannot see, not checked), and how the 4R audit found it. Name no person and no product. The old audit is "the old audit you were doing". 8. **Since last time**, when an earlier record exists: better, worse, same, per count (the guard count comes ONLY from the replayed saved tests; new tests this run are counted on their own line and never turn a held guard into a worse number), and every fix from last time marked fixed, still open or worse. 9. **The offer.** 1 line: "Say go and every fix gets made in this order, each with its proof, then the audit runs again." The calls only the owner can make are listed as plain questions. ## Rules for the words - Plain English a 9th grader follows. Any technical word gets explained in the same sentence, the way you would to a smart friend who has never coded. - Numbers as digits. - A finding without a file and line, or a command and its output, does not go in. - No score out of 100, no letter grade, no traffic light that is not backed by a count. - End the chat summary on 1 line: "Better or worse since last time: ___, because ___." On a first audit: "First audit, the baseline is set."references/run.md2.3 KB4695745e0000upstream ↗
# Layer 2, RUN: the cold walk Layer 1 says what the workspace claims. Layer 2 finds out whether a stranger can use the workspace. The stranger is a fresh agent with no memory of the owner, the auditor, or the work. ## Pick the job 1 real job the workspace exists to do, taken from its own entry file: a row in its routing table, or the first stage of its line. Prefer the job the owner does most. A job that ends in a file is best, because a file can be checked. If the job needs input (a transcript, a brief, a customer), write a small made up 1 and say in the report that it was made up. ## Hand the job over Use a fresh agent (a subagent with no shared context, or a new session). Give the agent the prompt below with the 3 slots filled. Nothing else. No hints about where things live. ``` You are walking a folder system cold. You have never seen it. Everything you need must come from its own files. The folder: <scratch copy path> The job: <1 sentence, the way the owner would say it> The input, if the job needs 1: <the made up input> Rules: - Work ONLY inside that folder. Write nothing anywhere else. - Never fix the folder system itself. If something is broken or unclear, write it down as a finding and carry on the way a new person would. - Start at the entry file (CLAUDE.md or AGENTS.md) and follow what the files say. Report, evidence only, no advice: 1. Did the job get done? Yes, partly, or no. If a file came out, give its path. 2. How many files you read before you knew where to go. 3. Every place you got stuck or had to guess, each with the file and line that caused it. 4. Every rule you found that you could not follow, and why. ``` ## Read what comes back - **Done, with a file:** open the file. Check the file against the rules the workspace states for that kind of output. A job done wrong is worse than a job not done. - **Files read before knowing where to go:** the entry file plus 2 more is a workspace that routes well. Past 5, the map is not doing its job. - **Each stuck point** becomes a finding with the file and line the agent gave. Check the line yourself before it goes in the report. An agent can misread. ## If the target is too big to copy Copy the entry files and the 1 home the job routes to, and say in the report that the walk ran on a slice..gitattributes36 Bf7e2def60ba8upstream ↗
* text=auto eol=lf *.sh text eol=lfLICENSE1.0 KBb929e88525c1upstream ↗
MIT License Copyright (c) 2026 OathDriven LLC Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.templates/record.md3.4 KB6d64a2481a00upstream ↗
# 4R audit: {{target name}}, {{YYYY-MM-DD}} Target: `{{target path}}` · Scratch copy: {{files copied}} files, {{files left out}} left out Results home: `{{results home}}` (left out of every layer) · Last audit: {{date or "none, this is the baseline"}} ## The verdict {{1 sentence, plain words: what works and what does not}} ## The most important {{every Money fix, plus any fix that hit the owner or a customer for real this week, each with why it matters. Or "none"}} ## The counts (each 1 counted, never estimated) | Count | Now | Last time | |---|---|---| | Routes that resolve | {{n of m}} | {{or -}} | | Top folders named in the entry files | {{n of m}} | | | Lines with an unfilled slot, outside templates | {{n}} | | | Folders with their own save history at risk | {{n}} | | | Key shaped strings / settings files with keys | {{n}} / {{n}} | | | Saved tests replayed / still held | {{n}} / {{n}} | | | New tests this run (only where something changed) / found a hole | {{n}} / {{n}} | | | Stranger's job done | {{yes, partly, no}} | | | Files the stranger read before knowing where to go | {{n}} | | | Places the stranger got stuck | {{n}} | | | Claims that say done, still true | {{n of m}} | | | Fixes found: Money / Lost work / Slows the agent / Polish | {{n}} / {{n}} / {{n}} / {{n}} | | | Fixes from last time still open | {{n of m}} | | ## Size (question 9) | Part | Lines | Files | Last time | |---|---|---|---| | rules | {{n}} | {{n}} | {{n or -}} | | skills | {{n}} | {{n}} | | | checks | {{n}} | {{n}} | | The 10 biggest: {{file, lines}} · Set aside: {{n}} built or borrowed files SIZE rules={{n}} skills={{n}} checks={{n}} files={{n}} ## Every fix, measured and ranked (all of them, no cap) | # | Fix | Who it hits | How much (counted) | Weight | File and line | |---|---|---|---|---|---| | 1 | {{fix}} | {{customers and money / the owner's work / the agent}} | {{the number, and what was counted}} | {{Money, Lost work, Slows the agent, Polish}} | `{{file}}:{{line}}` | | {{n}} | {{every finding from every layer, 1 row each, until none is left}} | | | | | Completeness check: {{findings counted per layer}} = {{fixes listed}} ## Waiting on the owner {{the calls only the owner can make, each as 1 plain question}} ## Layer 1, READ {{1 line per question, 1 to 8, each with its evidence}} ## Layer 2, RUN Job: {{the job, in the owner's words}} · Input: {{real or made up}} {{the stranger's report, stuck points quoted with file and line}} ## Layer 3, REALITY | Promise | Guard | Planted mistake | Clean case | Word | |---|---|---|---|---| | {{promise}} | {{guard or none}} | {{fired / quiet}} | {{passed / fired}} | {{proven, blind, jumpy, missing}} | Claims checked: {{claim, where the claim sits, what was checked, still true or not}} ## The old audit you were doing, next to the 4R audit | Today's finding | The old audit (reads files only) | The 4R audit | |---|---|---| | {{finding}} | {{finds this / sees the check exists / cannot see / not checked}} | {{how the 4R audit found it}} | ## What the audit could not see {{always at least 1 line}} ## Since last time {{better, worse, or same per count, or "first audit, the baseline is set"}} {{every fix from last time: fixed, still open (with its age), or worse}} ## The fix pass {{after the owner's go: 1 line per fix, what changed, file and line, lines added and removed, the proof. Then the re-audit's before and after, the size line included}}templates/report.html15 KBa983357f809eupstream ↗
<!-- The 4R audit report page. Fill every {{slot}}. The look is the RyMac receipts sheet: cream paper, Courier Prime, scarlet red pen, ballpoint blue. 1 file, no build step. --> <title>4R Audit: {{TARGET NAME}}</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Caveat:wght@400;700&family=Courier+Prime:ital,wght@0,400;0,700;1,400&display=swap"> <style> /* One committed visual world: a typed sheet on a 2006 desk. The site this page reports on IS that sheet, so the page does not flip with the reader's theme. Every colour is painted explicitly so it holds on any host background. */ :root{ --desk:#E4DCC7; --desk-deep:#D6CBB0; --paper:#FDFBF3; --raised:#FFFDF6; --ink:#14110E; --body:#4A4438; --muted:#6E6552; --stone:#8A8069; --hair:#CFC5AB; --hair-soft:#DED5BD; --scarlet:#C8102E; --ballpoint:#2C55C8; --manila:#A8781F; --highlighter:#FFEF7A; --pad:clamp(20px,4vw,52px); } *{box-sizing:border-box} body{ margin:0; background:var(--desk); background-image: radial-gradient(ellipse 120% 80% at 50% -10%, rgba(255,253,246,.55), rgba(255,253,246,0) 60%), repeating-linear-gradient(92deg, rgba(122,110,86,.05) 0 2px, rgba(122,110,86,0) 2px 7px); color:var(--body); font-family:'Courier Prime',ui-monospace,'Courier New',monospace; font-size:16px; line-height:1.62; -webkit-font-smoothing:antialiased; padding:clamp(14px,3vw,44px); } .sheet{ max-width:980px; margin:0 auto; background:var(--paper); border:1px solid var(--hair); box-shadow:0 1px 0 var(--raised) inset, 0 18px 44px rgba(40,34,22,.20), 0 2px 6px rgba(40,34,22,.12); padding:var(--pad); } /* ---------- letterhead ---------- */ .head{ display:flex;flex-wrap:wrap;gap:14px 28px;align-items:flex-end;justify-content:space-between; border-bottom:2px solid var(--ink); padding-bottom:14px; } .head h1{ font-size:clamp(19px,3.1vw,26px); font-weight:700;letter-spacing:.10em;text-transform:uppercase; color:var(--ink);margin:0;line-height:1.25;text-wrap:balance; } .head .sub{font-size:12px;letter-spacing:.16em;text-transform:uppercase;color:var(--stone);margin-top:6px} .stamp{ font-size:11px;letter-spacing:.14em;text-transform:uppercase;color:var(--scarlet); border:1.5px solid var(--scarlet);padding:7px 11px;transform:rotate(-1.4deg); white-space:nowrap;line-height:1.5;text-align:center; } .stamp b{display:block;font-weight:700;letter-spacing:.08em} /* ---------- hero number ---------- */ .hero{ display:grid;grid-template-columns:minmax(0,auto) minmax(220px,1fr); gap:clamp(18px,4vw,48px);align-items:center; padding:clamp(26px,5vw,44px) 0 clamp(20px,4vw,32px); border-bottom:1px solid var(--hair-soft); } .figure{position:relative;padding:14px 30px;justify-self:start} .figure .num{ display:block;font-weight:700;color:var(--ink); font-size:clamp(66px,15vw,132px);line-height:.9;letter-spacing:-.03em; font-variant-numeric:tabular-nums; } .figure .num i{font-style:normal;font-size:.44em;letter-spacing:0} .figure .cap{ display:block;margin-top:12px;font-size:12px;letter-spacing:.17em; text-transform:uppercase;color:var(--muted); } .circle{position:absolute;inset:-14px -6px -18px -10px;width:calc(100% + 16px);height:calc(100% + 32px);overflow:visible;pointer-events:none} .circle ellipse{ fill:none;stroke:var(--scarlet);stroke-width:2.6;stroke-linecap:round; stroke-dasharray:640;stroke-dashoffset:640; animation:draw 1.15s .35s cubic-bezier(.5,.05,.3,1) forwards; } @keyframes draw{to{stroke-dashoffset:0}} .hand{ font-family:'Caveat',ui-rounded,cursive; color:var(--scarlet);font-size:clamp(24px,3.6vw,34px);line-height:1.25; } .hand .small{display:block;font-size:.62em;color:var(--muted);margin-top:6px} .hero .read{font-size:15px;color:var(--body);margin-top:14px;max-width:34ch} .hero .read b{color:var(--ink)} /* ---------- tiles ---------- */ .tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(178px,1fr));gap:1px;background:var(--hair-soft); border-top:1px solid var(--hair-soft);border-bottom:1px solid var(--hair-soft);margin-top:0} .tile{background:var(--paper);padding:20px 18px} .tile .k{font-size:11px;letter-spacing:.16em;text-transform:uppercase;color:var(--stone);display:block} .tile .v{display:block;font-size:clamp(28px,4.4vw,38px);font-weight:700;color:var(--ink);line-height:1.15; margin-top:8px;font-variant-numeric:tabular-nums} .tile .n{display:block;font-size:13px;color:var(--muted);margin-top:4px} .tile .v.blue{color:var(--ballpoint)} /* ---------- sections ---------- */ section{padding-top:clamp(30px,5vw,46px)} h2{ font-size:13px;letter-spacing:.19em;text-transform:uppercase;color:var(--ink); margin:0 0 4px;font-weight:700; } .lede{font-size:14px;color:var(--muted);margin:0 0 22px;max-width:66ch} /* ---------- split bars ---------- */ .splits{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:clamp(24px,4vw,44px)} .rowlist{display:flex;flex-direction:column;gap:14px;margin-top:16px} .row{display:grid;grid-template-columns:1fr auto;gap:4px 12px;align-items:baseline} .row .name{font-size:14px;color:var(--ink)} .row .val{font-size:14px;font-weight:700;color:var(--ink);font-variant-numeric:tabular-nums} .track{grid-column:1 / -1;height:14px;background:var(--desk-deep);border-radius:4px;overflow:hidden} .fill{height:100%;border-radius:4px;width:var(--w);transform-origin:left;transform:scaleX(0); animation:slide .65s cubic-bezier(.2,.7,.3,1) forwards;animation-delay:var(--d)} @keyframes slide{to{transform:scaleX(1)}} .fill.b{background:var(--ballpoint)} .fill.m{background:var(--manila)} /* ---------- then / now ---------- */ table{border-collapse:collapse;width:100%;font-size:14px;margin-top:14px} caption{text-align:left;font-size:12px;color:var(--stone);padding-bottom:8px;letter-spacing:.06em} th,td{padding:11px 12px;text-align:right;border-bottom:1px solid var(--hair-soft); font-variant-numeric:tabular-nums} th:first-child,td:first-child{text-align:left;font-variant-numeric:normal} thead th{font-size:11px;letter-spacing:.14em;text-transform:uppercase;color:var(--stone); border-bottom:1.5px solid var(--ink);font-weight:400} tbody td{color:var(--ink)} tbody tr:last-child td{border-bottom:1.5px solid var(--ink);font-weight:700} td .up{color:var(--ballpoint);font-weight:700} /* ---------- red pen block ---------- */ .pen{ margin-top:clamp(30px,5vw,46px); border:1.5px solid var(--scarlet); padding:clamp(20px,3.6vw,30px); background:linear-gradient(0deg, rgba(200,16,46,.035), rgba(200,16,46,.035)); } .pen h2{color:var(--scarlet)} .pen ul{list-style:none;padding:0;margin:18px 0 0;display:flex;flex-direction:column;gap:16px} .pen li{display:grid;grid-template-columns:auto 1fr;gap:14px;align-items:start} .pen .x{color:var(--scarlet);font-weight:700;font-size:18px;line-height:1.35} .pen .t{font-size:14px;color:var(--ink)} .pen .t b{color:var(--scarlet)} .pen .t span{display:block;color:var(--muted);font-size:13px;margin-top:3px} .kept{margin-top:22px;padding-top:18px;border-top:1px dashed rgba(200,16,46,.4); font-family:'Caveat',cursive;font-size:clamp(21px,3vw,27px);color:var(--scarlet);line-height:1.3} /* ---------- the ask ---------- */ .cta{margin-top:clamp(34px,5vw,52px)} .arrows{display:flex;align-items:center;justify-content:center;gap:clamp(8px,2vw,20px); margin-bottom:10px;flex-wrap:nowrap} .arrows svg{flex:0 0 auto;width:clamp(64px,11vw,124px);height:auto} .arrows .flip{transform:scaleX(-1)} .arrows span{ font-family:'Caveat',cursive;color:var(--scarlet); font-size:clamp(20px,3.4vw,31px);line-height:1.2;text-align:center; transform:rotate(-1.5deg); } .box{ border:2px solid var(--scarlet);background:var(--raised); padding:clamp(22px,4vw,34px);text-align:center; display:flex;flex-direction:column;align-items:center;gap:14px; } .box h3{ margin:0;color:var(--ink);font-size:clamp(19px,3.2vw,26px);font-weight:700; letter-spacing:.01em;text-wrap:balance;line-height:1.3; } .box p{margin:0;font-size:15px;color:var(--body);max-width:52ch} .btn{ display:inline-block;margin-top:6px; background:var(--scarlet);color:#FFF8EE;text-decoration:none; font-family:'Courier Prime',monospace;font-weight:700; font-size:clamp(15px,2.4vw,18px);letter-spacing:.04em; padding:15px 30px;border:2px solid var(--scarlet); transition:background .13s ease,color .13s ease,transform .13s ease; } .btn:hover,.btn:focus-visible{background:var(--ink);border-color:var(--ink);color:var(--paper);transform:translateY(-1px)} .box .fine{font-size:12px;letter-spacing:.14em;text-transform:uppercase;color:var(--stone)} .head a,footer a{color:inherit;text-decoration:none;border-bottom:1.5px solid var(--scarlet)} .head a:hover,.head a:focus-visible,footer a:hover,footer a:focus-visible{color:var(--scarlet)} /* ---------- footer ---------- */ footer{margin-top:clamp(30px,5vw,44px);padding-top:16px;border-top:2px solid var(--ink); display:flex;flex-wrap:wrap;gap:10px 24px;justify-content:space-between; font-size:12px;color:var(--stone);letter-spacing:.06em} footer b{color:var(--ink);font-weight:700} a{color:var(--ballpoint)} a:focus-visible,.col:focus-visible{outline:2px solid var(--scarlet);outline-offset:3px} @media (prefers-reduced-motion:reduce){ .bar,.fill{animation:none;transform:none} .col .lab{animation:none;opacity:1} .circle ellipse{animation:none;stroke-dashoffset:0} } @media (max-width:640px){ .hero{grid-template-columns:1fr} .figure{justify-self:center;text-align:center} } </style> <div class="sheet"> <div class="head"> <div> <h1>{{TARGET NAME}}<br>the 4R audit: read, run, reality, report</h1> <div class="sub">{{1 LINE: what was audited, and that nothing in the target was changed}}</div> </div> <div class="stamp"><b>Pulled fresh</b>{{DATE}} · {{TIME}}</div> </div> <div class="hero"> <div class="figure"> <svg class="circle" viewBox="0 0 300 190" aria-hidden="true" preserveAspectRatio="none"> <ellipse cx="150" cy="95" rx="141" ry="84" transform="rotate(-3 150 95)"></ellipse> </svg> <span class="num">{{THE 1 NUMBER THAT MATTERS MOST}}</span> <span class="cap">{{WHAT THAT NUMBER COUNTS}}</span> </div> <div> <p class="hand">{{THE VERDICT, 1 SENTENCE}}<span class="small">{{THE 1 FIX THAT MATTERS MOST, 1 LINE}}</span></p> <p class="read">{{HOW THE AUDIT RAN: the 4 layers in 2 or 3 plain sentences, the job the stranger was given, and that everything ran in a throwaway copy}}</p> </div> </div> <div class="tiles"> <div class="tile"><span class="k">Routes that resolve</span><span class="v">{{N of M}}</span><span class="n">{{note}}</span></div> <div class="tile"><span class="k">Guards proven</span><span class="v blue">{{N of M}}</span><span class="n">{{note}}</span></div> <div class="tile"><span class="k">Stranger's job</span><span class="v">{{done / partly / no}}</span><span class="n">{{N stuck points}}</span></div> <div class="tile"><span class="k">Claims still true</span><span class="v">{{N of M}}</span><span class="n">{{note}}</span></div> <div class="tile"><span class="k">Work at risk</span><span class="v">{{N}}</span><span class="n">{{unsaved folders, keys in files}}</span></div> <div class="tile"><span class="k">Fixes found</span><span class="v">{{N}}</span><span class="n">{{Money N, Lost work N, Slows the agent N, Polish N. Open from last time N}}</span></div> </div> <div class="pen"> <h2>The most important</h2> <ul> <li><span class="x">1</span><span class="t"><b>{{FIX}}</b> {{WHY it matters, in business words, with its counted number}}<span>{{file}}:{{line}}</span></span></li> <li><span class="x">{{N}}</span><span class="t"><b>{{every Money fix, plus any fix that hit the owner or a customer for real this week}}</b> {{WHY}}<span>{{file}}:{{line}}</span></span></li> </ul> </div> <section> <h2>Every fix, measured and ranked ({{N}} in all, no cap)</h2> <p class="lede">Every finding from every layer is here. Heaviest weight first: Money, then Lost work, then Slows the agent, then Polish. Inside a weight, the bigger counted number first.</p> <table> <thead><tr><th>#</th><th>Fix</th><th>Who it hits</th><th>How much, counted</th><th>Weight</th><th>File and line</th></tr></thead> <tbody> <tr><td>1</td><td style="text-align:left">{{FIX}}</td><td>{{customers and money / your work / the agent}}</td><td>{{the number and what was counted}}</td><td>{{Money / Lost work / Slows the agent / Polish}}</td><td style="text-align:left">{{file}}:{{line}}</td></tr> <tr><td>{{N}}</td><td style="text-align:left">{{every other finding, 1 row each, until none is left}}</td><td></td><td></td><td></td><td></td></tr> </tbody> </table> <p class="lede" style="margin-top:14px"><b>Say go and every fix gets made in this order, each with its proof, then the audit runs again.</b> {{the calls only you can make, each as 1 plain question}}</p> </section> <section> <h2>Layer 1, read: what the files say</h2> <p class="lede">{{1 line per question that found something, each with its evidence}}</p> </section> <section> <h2>Layer 2, run: a stranger did 1 real job</h2> <p class="lede">{{the job, what came out, how many files the stranger read before knowing where to go, each stuck point in the stranger's own words with file and line}}</p> </section> <section> <h2>Layer 3, reality: planted mistakes and claims that say done</h2> <table> <thead><tr><th>Promise</th><th>Guard</th><th>On the mistake</th><th>On the clean case</th><th>Word</th></tr></thead> <tbody> <tr><td>{{promise}}</td><td style="text-align:left">{{guard or none}}</td><td>{{fired / quiet}}</td><td>{{passed / fired}}</td><td>{{proven / blind / jumpy / missing}}</td></tr> </tbody> </table> <p class="lede" style="margin-top:14px">{{the 3 claims checked, each still true or not}}</p> </section> <section> <h2>The old audit you were doing, next to the 4R audit</h2> <p class="lede">The old audit reads your files and tells you what the files say. The 4R audit also runs your workspace and plants mistakes. Every finding from today, and which audit could have found each 1.</p> <table> <thead><tr><th>Today's finding</th><th>The old audit</th><th>The 4R audit</th></tr></thead> <tbody> <tr><td>{{finding}}</td><td>{{finds this / sees the check exists / cannot see / not checked}}</td><td>{{how the 4R audit found it}}</td></tr> </tbody> </table> </section> <section> <h2>Since last time</h2> <p class="lede">{{better, worse or same per count, or "first audit, the baseline is set". Then every fix from last time: fixed, still open with its age, or worse}}</p> </section> <div class="pen"> <h2>What this audit could not see</h2> <p class="kept">{{always at least 1 line}}</p> </div> <footer> <span><b>Counted, not estimated.</b> Every number here was read off a file or a script's own output. The target was never changed.</span> <span>The 4R audit by RyMac, filesnfolders.com · ICM by Jake Van Clief and David McDermott, arXiv:2603.16021</span> </footer> </div>
Plain-text copy, no login: /skill-bundles/oathdriven-rymac-4r-icm-audit.md