Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

skills: diet company-brainify (37424→14418 bytes)

garrytand5bcb2042512
diff --git a/skills/company-brainify/SKILL.md b/skills/company-brainify/SKILL.md
index 43526a69f5..5a994485c2 100644
--- a/skills/company-brainify/SKILL.md
+++ b/skills/company-brainify/SKILL.md
@@ -55,122 +55,75 @@ brain_first: true
> edits stay in the page's existing directory; the deletion log files
> date-keyed under `daily/`.
-## The Problem
-
-Personal brains accumulate everything — company knowledge, meeting notes,
-internal assessments, compensation details, management strategy, candid
-opinions about the people you work with. When you stand up a shared team
-brain from that personal brain (see `docs/architecture/brains-and-sources.md`
-for the team-mount topology), all of that has to go. The knowledge is
-valuable; the sensitive metadata is a liability.
-
-Clean working-tree files alone are NOT enough: git history still carries every
-pre-sanitization version, and gbrain takes/facts carry evaluative claims
-outside the page prose. This skill handles all three surfaces — pages,
-takes/facts, and history.
+A personal brain holds candid notes (ratings, comp, assessments, retention,
+politics) that must not reach a shared team brain. Three surfaces carry them:
+page files, takes/facts, and git history. Clean files alone are not enough.
## When to Use
-Connecting or indexing an existing company repository without editing it is not
-sanitization. For “connect our company brain” or “import an existing company
-brain,” use the migrate (host-side) company workflow. On the trusted brain host,
-start with `gbrain sources inspect <path> --profile company-brain`; follow
-`docs/guides/company-brain-ingestion.md` for destination preview and approval.
-Do not strip metadata or purge history merely to make an existing repository
-searchable.
+Standing up a team brain from a founder's or exec's personal brain; auditing an
+existing shared brain (report-only or with edits); verifying a repo before
+onboarding; periodic hygiene.
-- Standing up a shared company brain from a founder/exec's personal brain
-- Auditing an existing shared brain for sensitive content that shouldn't be there
-- Onboarding new team members to a brain repo that must be verified clean first
-- Periodic hygiene pass on a shared brain that re-accumulates sensitive data
+Not for connecting or indexing an existing company repo: that is no
+sanitization. On the trusted brain host run
+`gbrain sources inspect <path> --profile company-brain` and follow
+`docs/guides/company-brain-ingestion.md`; never strip metadata or purge history
+just to make a repo searchable.
## What Gets Removed
-### Always strip (non-negotiable)
-
-| Category | Examples |
-|----------|----------|
-| **Internal scores/ratings** | `score:`, `rating:`, `skill:`, or any vertical-specific `*_score:` frontmatter field; any numeric rating of a person |
-| **Compensation** | Salary, equity, carry, option grants, comp changes, retention packages |
-| **Performance assessments** | Strengths/weaknesses sections about employees, "at risk" flags, underperformance mentions, "picking up slack" references |
-| **Departure/retention** | Who's considering leaving, who was convinced to stay, departure rumors, retention conversations |
-| **Management strategy** | How-to-manage-someone sections, "the hard conversation" notes, scope/title management plans |
-| **Internal political dynamics** | Who doesn't like whom, who's nervous about whom, adversarial relationships, power dynamics |
-| **Personal PII** | Phone numbers, personal email addresses, home addresses, family or medical details, personal legal matters, personal-life details |
-| **Takes/facts** | Any take or fact referencing the above categories — performance, comp, retention, weakness, management risk. Fact rows are DELETED from the page's Facts fence, never merely expired with `gbrain forget` |
-
-### Always keep
-
-| Category | Examples |
-|----------|----------|
-| **Professional identity** | Name, role, title, work email, LinkedIn |
-| **What they're building** | Current projects, product work, technical contributions |
-| **Career arc** | Prior companies, education, professional background (public info) |
-| **Professional beliefs** | Their views on technology, strategy, product philosophy |
-| **Timeline of work** | Meeting attendance, project milestones, launches (factual, not evaluative) |
-| **Skills/expertise** | Technical capabilities, domain knowledge |
-
-## Scan Scope — Wider Than people/
-
-Sensitive content leaks far beyond people pages. The scan scope is:
-
-- `people/` — the primary surface (frontmatter fields, assessment sections)
-- `meetings/` — transcripts and minutes with candid assessments
-- `daily/` — daily notes referencing comp/performance/retention conversations
-- `companies/`, `projects/`, `analysis/` — cross-references to removed content
-- **Takes** — evaluative claims in page takes fences (`gbrain takes search`)
-- **Facts** — hot-memory facts (`gbrain recall --grep`)
-- **Back-links** — after edits, `gbrain check-backlinks check` confirms no page
- still points at removed sections
-
-A pass that only covers `people/` will certify a brain that still leaks.
+**Always strip:** rating/score fields (`score:`, `rating:`, `skill:`, any
+`*_score:`, any numeric rating of a person); compensation (salary, equity,
+carry, grants, comp changes, retention packages); performance assessments
+(weaknesses, "at risk", underperformance, "picking up slack"); departure and
+retention talk; management strategy about a person; political dynamics; personal
+PII (phone, personal email, home address, family, medical, personal legal or
+life details); and every take or fact row about any of these.
-## Procedure
+**Always keep:** name, role, title, work email, LinkedIn; what they build;
+career arc and education; professional beliefs; factual timeline of work
+(attendance, milestones, launches); skills and expertise.
+
+**Scan scope:** `people/`, `meetings/`, `daily/`, `companies/`, `projects/`,
+`analysis/`, takes (`gbrain takes search`), facts (`gbrain recall --grep`), and
+back-links (`gbrain check-backlinks check`). A people-only pass certifies a brain
+that still leaks.
-All paths below are relative to the brain repo root:
+## Procedure
```bash
BRAIN="$(gbrain config get sync.repo_path)"
cd "$BRAIN"
```
-### Phase 1: Identify scope (retrieval-first)
-
-1. Retrieval discovery — hybrid search catches judgment-shaped content that no
- keyword pattern will:
-
- ```bash
- gbrain query "compensation, equity, or salary discussions about team members" --limit 50
- gbrain query "performance concerns, underperformance, or who is struggling" --limit 50
- gbrain query "considering leaving, retention conversations, departure rumors" --limit 50
- gbrain takes search "performance" --limit 50
- gbrain recall --grep "salary"
- ```
-
- Resolve every returned slug to its repo-relative file path and write the
- paths into `/tmp/brainify-scope.txt` (one per line). This file is the
- scope list; the structural pass below APPENDS to it — nothing later in
- the procedure may truncate it, or the retrieval-discovered pages
- silently drop out of scope.
+On a repo-less brain (no `sync.repo_path`) run Phase 1's retrieval and Phase 4's
+retrieval checks only, and edit pages through `gbrain get` / `gbrain put`.
-2. Structural discovery — people files that belong to the company, plus
- keyword hits across the wider scan scope:
+### Phase 1: Scope (retrieval first)
- ```bash
- grep -rli 'company: *"acme-example"' people/ --include="*.md" | sort >> /tmp/brainify-scope.txt
- grep -rli -E 'salary|equity|carry|retention|underperform|performance review|hard conversation' \
- meetings/ daily/ companies/ projects/ analysis/ --include="*.md" 2>/dev/null >> /tmp/brainify-scope.txt
- sort -u -o /tmp/brainify-scope.txt /tmp/brainify-scope.txt
- ```
+```bash
+gbrain query "compensation, equity, or salary discussions about team members" --limit 50
+gbrain query "performance concerns, underperformance, or who is struggling" --limit 50
+gbrain query "considering leaving, retention conversations, departure rumors" --limit 50
+gbrain takes search "performance" --limit 50
+gbrain recall --grep "salary"
+```
-3. Cross-reference against the company's public people page (website,
- LinkedIn) to catch files using different frontmatter conventions.
+Write every hit's repo-relative path to `/tmp/brainify-scope.txt`, then APPEND
+the structural pass (never truncate the file):
-4. Count: `wc -l /tmp/brainify-scope.txt`
+```bash
+grep -rli 'company: *"acme-example"' people/ --include="*.md" | sort >> /tmp/brainify-scope.txt
+grep -rli -E 'salary|equity|carry|retention|underperform|performance review|hard conversation' \
+ meetings/ daily/ companies/ projects/ analysis/ --include="*.md" 2>/dev/null >> /tmp/brainify-scope.txt
+sort -u -o /tmp/brainify-scope.txt /tmp/brainify-scope.txt
+```
-### Phase 2: Triage sensitivity
+Cross-check the company's public team page for people filed under other
+conventions.
-Prioritize by hit density (portable `grep -E`; no `\b` — BSD and GNU disagree):
+### Phase 2: Triage
```bash
while read -r f; do
@@ -179,44 +132,28 @@ while read -r f; do
done < /tmp/brainify-scope.txt | sort -rn > /tmp/brainify-triage.txt
```
-High-hit files need full judgment passes. Zero-hit files may only need
-frontmatter field removal — but they still get read (regex triages, the model
-judges).
-
-### Phase 3: Sanitize (STAGING COPY preferred; test first, then parallel)
-
-Phase 3 is destructive: it strips content across many files, removes takes,
-and deletes fact rows. Two rules govern it.
-
-**Choose the target FIRST — copy, don't mutate the personal brain.**
-
-- **Standing up a NEW team brain (default, preferred):** sanitize a STAGING
- COPY of the scanned directories, never the personal brain in place. The
- founder's personal brain is SUPPOSED to keep comp, performance, and candid
- notes — stripping them from the personal working tree destroys valuable
- private data. Copy the Phase-1 scope into a durable staging dir and edit
- THAT; Phase 5 Step 0 exports from the staging copy. Blast radius: none on the
- personal brain.
-
- ```bash
- # Durable staging dir (NOT /tmp — same reasoning as the mirror backup).
- STAGING="$HOME/.gbrain/backups/brainify-staging-$(date +%Y%m%d-%H%M%S)"
- mkdir -p "$STAGING" && chmod 700 "$STAGING"
- for d in people meetings daily companies projects analysis; do
- [ -d "$d" ] && rsync -a "$d/" "$STAGING/$d/"
- done
- cd "$STAGING" # all edits below happen here, not in sync.repo_path
- ```
-
-- **Re-auditing an EXISTING shared brain:** the shared brain IS the target, so
- edits are in place on the SHARED repo (cd into the shared repo, never the
- personal `sync.repo_path`). Fact-row removal + re-sync applies to the shared
- source's DB.
-
-**Fire the [data-loss-gate](../data-loss-gate/SKILL.md) confirmation card
-BEFORE the bulk destructive edits begin.** Both targets are destructive (the
-copy path removes content from the tree destined for the team; the in-place
-path removes content from a live brain). Pre-filled for Phase 3:
+High-hit files first. Every scoped file is still read in full: grep triages,
+the model judges.
+
+### Phase 3: Sanitize (destructive — gated)
+
+**Target.** New team brain (default): copy ONLY the scanned directories into a
+durable staging dir and edit there, leaving the personal brain's working tree
+untouched. Re-auditing an existing shared brain: edit the shared repo in place,
+never the personal `sync.repo_path`.
+
+```bash
+STAGING="$HOME/.gbrain/backups/brainify-staging-$(date +%Y%m%d-%H%M%S)"
+mkdir -p "$STAGING" && chmod 700 "$STAGING"
+for d in people meetings daily companies projects analysis; do
+ [ -d "$d" ] && rsync -a "$d/" "$STAGING/$d/"
+done
+cd "$STAGING"
+```
+
+**Before the bulk edits, present the [data-loss-gate](../data-loss-gate/SKILL.md)
+card and stop until the user types "yes" or "do it"** ("ok", "sure" are not
+consent):
```
⚠️ DATA DELETION — Confirmation Required
@@ -225,7 +162,6 @@ What: strip sensitive content, remove takes, and delete fact rows across
[N files] in [STAGING COPY at <path> | the SHARED brain in place]
Count: [N files edited; T takes removed; F fact rows removed]
Location: [staging path OR shared repo path] — NOT the personal sync.repo_path
- on the staging path
Why: preparing a sanitized tree for team access
@@ -237,83 +173,37 @@ Recoverable?
Proceed? (yes/no)
```
-Require a typed "yes"/"do it" per data-loss-gate; "ok"/"sure" are not consent.
-
-Per test-before-bulk: do 3-5 files first, read the results, then ramp. For
-large sets (50+ files), batch into groups of 10-12 and spawn parallel
-subagents. Per file:
-
-1. Read the file completely
-2. Remove all content matching the "Always strip" categories
-3. Frontmatter: delete rating/comp field lines entirely
-4. Sections: remove entire sections (assessment weaknesses, team dynamics,
- management strategy)
-5. Takes and Facts fences: remove entire rows that reference sensitive
- categories — a take like "alice-example believes charlie-example is
- underperforming" reveals both the opinion and who holds it; remove the
- whole row, never just the attribution
-6. Inline mentions: surgically edit sentences/paragraphs
-7. Write the cleaned file back
-
-**Decision rule:** use `Edit` for surgical removal when only a few sections
-need it. Use `Write` to rewrite the entire file only when sensitive content is
-deeply interwoven throughout.
-
-**Facts: `forget` is NOT removal.** `gbrain forget <fact-id>` expires a fact
-— the row stays on the page's Facts fence struck through, and the DB still
-serves it via `--include-expired`. An expired fact is retained, not gone.
-For sanitization, sensitive fact rows must be ACTUALLY REMOVED: find them
-(`gbrain recall --grep`), then delete the row from the page's Facts fence
-(step 5), exactly like a sensitive take. On an in-place shared brain, the
-page edit must then be re-synced (`gbrain sync` re-imports the edited page)
-AND the facts index reconciled — sync's convergence contract covers page
-import only; downstream fact extraction is explicitly decoupled
-(`src/commands/sync.ts`, "CONVERGENCE CONTRACT"), so the DB keeps serving
-the deleted row until the extract-facts reconcile runs. Trigger it
-(`gbrain sweep`, or wait for the serve-resident sweep), then confirm with
-`gbrain recall --grep` that the row is actually gone. An edited page over
-an un-reconciled facts index still leaks through retrieval. `forget` alone
-can never certify a brain clean.
-
-After edits: on the **staging-copy** path the fact rows are removed by editing
-the copied markdown directly (there is no live DB to re-sync yet — the team DB
-is built fresh when Phase 5 Step 0 turns the export into a source). On the
-**in-place shared-brain** path, run `gbrain sync` so the page content matches
-the markdown, then reconcile and verify the facts index as above. Either way,
-run `gbrain check-backlinks check` to catch pages still pointing at removed
-content.
-
-### Phase 4: Verify
-
-Re-run the Phase 2 triage — the count of flagged files should drop to
-(near-)zero. Then targeted greps:
+Then 3–5 files first, read the results, ramp (50+ files: batches of 10–12 in
+parallel subagents). Per file: read it completely; delete rating and comp
+frontmatter lines; remove whole sensitive sections; remove whole take and fact
+rows that touch a strip category (the claim is the leak — never keep the row
+minus its attribution); edit inline mentions surgically (`Edit` for a few spots,
+`Write` only when content is interwoven throughout).
+
+**`gbrain forget` is not removal.** It expires a fact (struck through, still
+served with `--include-expired`). Delete the row from the page's Facts fence.
+In place on a shared brain, then run `gbrain sync`, reconcile the facts index
+(`gbrain sweep`; sync alone does not re-extract facts), and confirm with
+`gbrain recall --grep` that the row is gone. On the staging copy, editing the
+markdown is enough. Either way finish with `gbrain check-backlinks check`.
+
+### Phase 4: Verify the tree that ships
+
+Run against the staging tree (staging path) or the shared repo (in place) —
+never the personal tree. Re-run the triage (hits should drop to near zero),
+then:
```bash
-# Rating fields remaining in frontmatter
grep -rn -E '^[a-z_]*(score|rating|skill)[a-z_]*: *[0-9]' people/ --include="*.md"
-
-# Phone numbers
grep -rn -E '\+1[0-9]{10}|\([0-9]{3}\) [0-9]{3}-[0-9]{4}' people/ --include="*.md"
-
-# Comp keywords (full scan scope, not just people/)
grep -rin -E 'carry|comp change|equity|salary' people/ meetings/ daily/ companies/ projects/ analysis/ --include="*.md" 2>/dev/null
-
-# Management/performance
grep -rin -E 'considering leaving|departure rumor|underperform|picking up slack|hard conversation' people/ meetings/ daily/ companies/ projects/ analysis/ --include="*.md" 2>/dev/null
```
-False positives (e.g. "carry the torch") are fine — manually confirm each
-remaining hit rather than tightening the pattern (regex-discipline).
-
-**Verify the tree that ships.** On the staging-copy path, these greps run
-against the sanitized `$STAGING` tree (which Phase 5 Step 0 turns into the
-export) — the personal working tree is not what ships, so certifying it proves
-nothing. For an in-place shared-brain re-audit, the shared repo's tree is the
-shipped tree and this pass stands as-is.
-
-Then the strongest check — the retrieval the team will actually use. Against
-the sanitized brain/source (scope with `--source <team-source-id>` when the
-shared source is mounted alongside personal content):
+Confirm each remaining hit by reading it; never tighten a pattern to silence
+false positives. Then the retrieval the team will use (add
+`--source <team-source-id>` when mounted beside personal content); each must
+return nothing or only keep-category content:
```bash
gbrain query "what is alice-example's compensation" --limit 10
@@ -321,356 +211,69 @@ gbrain query "who is underperforming or at risk of leaving" --limit 10
gbrain takes search "weakness" --limit 20
```
-Every one of these must come back empty or with only keep-category content.
-
-### Phase 5: Commit and purge history — GATED
-
-Clean files aren't enough if the repo has history: old commits still contain
-the sensitive versions.
-
-**Step 0 — preferred alternative (non-destructive).** When standing up a NEW
-team repo, skip history rewriting entirely: the sanitized STAGING tree from
-Phase 3 becomes a fresh repo with fresh history. The personal repo keeps its
-full history AND its full working tree, untouched.
+### Phase 5: Ship
-**Export rule: nothing unscanned ships.** Because Phase 3 copied ONLY the
-scanned directories into `$STAGING`, the staging tree contains nothing the
-sanitization pass didn't read — the include-only rule holds by construction.
-Never copy extra directories in: everything outside the scan scope
-(`conversations/`, `originals/`, `sources/`, `inbox/`) stays out. A whole-repo
-copy is the classic leak — it ships raw transcripts, originals, and inbox
-captures no pass ever read. To ship a new directory, add it to the scan scope
-first (Phases 1-4) so it lands in `$STAGING` sanitized.
+**Fresh team repo (preferred, non-destructive).** The verified staging tree
+becomes a new repo with fresh history. Ship only scanned directories: if
+anything else is there (`conversations/`, `originals/`, `sources/`, `inbox/`),
+remove it or scan it through Phases 1–4 first.
```bash
-# The sanitized staging tree IS the export.
cd "$STAGING"
-
-# Re-run the Phase 4 verification greps + retrieval checks INSIDE $STAGING —
-# the staging tree is what ships, and it is the tree that must certify clean.
-# ... Phase 4 greps against $STAGING ...
-
git init -b main
git add -A && git commit -m "Initial import — sanitized team brain" # gbrain-allow-shared-tree-git: first commit of a fresh single-writer export repo
git remote add origin <TEAM_REPO_URL>
gbrain git commit-push --push-only
```
-The first commit is plain git because `$STAGING` is a brand-new repo only
-this run writes. The push goes through `gbrain git commit-push --push-only`:
-it pushes to `origin/main` and fails loudly if the push does not land. On a
-non-zero exit, stop and tell the user what the error says: usually
-`git_push_unavailable` (check the team repo URL and credentials, then rerun
-it), or a team repo that already has commits (this export needs an empty
-one; ask the user before going further). Never force-push it.
-
-Only when a shared repo ALREADY exists with sensitive history in it do you
-need the purge below.
-
-**Step 1 — target the SHARED repo, commit the clean tree, then mirror-clone.**
-The purge operates on the SHARED repo, NEVER on `sync.repo_path` (the personal
-brain) — Step 0's guarantee that the personal repo keeps full history depends
-on it. Clone the shared repo to a durable work dir, stay there for every step
-below, and assert the target is not the personal repo before touching anything.
-
-```bash
-PERSONAL="$(gbrain config get sync.repo_path)"
-mkdir -p "$HOME/.gbrain/backups" && chmod 700 "$HOME/.gbrain/backups"
-WORK="$HOME/.gbrain/backups/brainify-purge-$(date +%Y%m%d-%H%M%S)"
-git clone <SHARED_REPO_URL> "$WORK/shared"
-cd "$WORK/shared"
-[ "$(git rev-parse --show-toplevel)" != "$PERSONAL" ] \
- || { echo "target IS sync.repo_path (personal brain) — ABORT"; exit 1; }
-
-# Apply the sanitized tree, then COMMIT it BEFORE the mirror clone. A mirror
-# captures COMMITTED state only; if the clean tree lives only in volatile
-# staging during the rewrite window, a crash loses the sanitization work.
-# Committing makes the clean state durable and recoverable; pushing it means
-# the remote stops serving the sensitive current versions even if the purge
-# below is declined. Only the sanitized directories are committed. On a
-# non-zero exit stop: retry once on commit_lock_busy; on integrate_conflict
-# someone changed the shared repo meanwhile, so ask the user before going on.
-for d in people meetings daily companies projects analysis; do
- [ -d "$STAGING/$d" ] && rsync -a "$STAGING/$d/" "./$d/" # or sanitize in place here
-done
-SANITIZED=""
-for d in people meetings daily companies projects analysis; do [ -d "$d" ] && SANITIZED="$SANITIZED $d"; done
-gbrain git commit-push -m "Sanitize: strip sensitive content before history purge" -- $SANITIZED
-
-# Mirror-clone backup = the recoverability line on the card. Capture the path
-# in a variable NOW and reuse it verbatim at purge time — a run crossing
-# midnight must NOT recompute $(date) and false-abort on a mismatched name.
-BACKUP_PATH="$HOME/.gbrain/backups/shared-brain-history-backup-$(date +%Y%m%d-%H%M%S).git"
-git clone --mirror "$WORK/shared" "$BACKUP_PATH"
-git -C "$BACKUP_PATH" log -1 >/dev/null || { echo "backup unreadable — ABORT"; exit 1; }
-```
-
-Verify the mirror exists and reads before presenting the card — it is the
-card's recoverability line.
-
-**Step 2 — STOP. Present the [data-loss-gate](../data-loss-gate/SKILL.md)
-confirmation card and wait.** History rewrite + force-push is the most
-destructive operation in this skill: it permanently discards every prior
-version of the purged paths from the remote. Never run it without the card
-answered. Pre-filled for this operation:
-
-```
-⚠️ DATA DELETION — Confirmation Required
-
-What: rewrite git history to remove all prior versions of [purged paths]
- from the SHARED repo, then force-push to [remote/branch]
-Count: [N commits rewritten; M files with history purged]
-Size: [repo size before → expected after]
-Location: [SHARED repo work dir; remote URL; branch]
-Target check: this is the SHARED repo, verified ≠ personal sync.repo_path
- ($PERSONAL) — the personal brain's history is never rewritten
-
-Why: prior commits contain pre-sanitization versions of pages that were
- just cleaned — team access to the repo means team access to history
-
-Recoverable?
-- [x] Mirror-clone backup at $BACKUP_PATH
- (verified: exists, `git -C "$BACKUP_PATH" log` works)
-- [ ] NOT recoverable from the rewritten remote — old SHAs become unreachable
-
-What we'd lose:
-- all pre-sanitization history for the purged paths (edit trail, blame,
- old versions)
-- every existing clone breaks — all collaborators must re-clone
-
-Alternative to deletion:
-- fresh-history export to a NEW team repo (Step 0) — personal repo untouched
-
-Proceed? (yes/no)
-```
-
-Per data-loss-gate: require a typed **"yes"** or **"do it"** — "ok", "sure",
-"go ahead" are not consent. If the user asks a question, answer and re-present
-the card. This gate is a routing convention, not a runtime enforcement —
-nothing in gbrain mechanically blocks `git filter-repo` — which is exactly why
-the agent following this skill must not skip it.
+On a non-zero exit stop and relay the error (`git_push_unavailable`: fix URL or
+credentials and rerun; a non-empty team repo: ask the user). Never force-push.
-**Step 3 — purge (only after the explicit typed yes).** Requires
-`git filter-repo` (not bundled with git; install separately). **Run this ONLY
-in the shared-repo work dir from Step 1 (`cd "$WORK/shared"`). NEVER run
-`git filter-repo` or `git push --force` in `sync.repo_path` — the personal <!-- gbrain-allow-shared-tree-git: warns against a force push in the personal brain -->
-brain's history must stay intact.** The commands below reuse `$WORK` and
-`$BACKUP_PATH` from Step 1; they never recompute a date-stamped path.
+**Existing shared repo with sensitive history:** follow
+[references/history-purge.md](references/history-purge.md). Its rules hold
+even before you read it: purge only the SHARED repo cloned to a work dir, never
+`sync.repo_path`; verify a mirror-clone backup, then show its data-loss-gate
+card and wait for a typed yes before `git filter-repo` or any force-push.
-```bash
-cd "$WORK/shared"
-[ "$(git rev-parse --show-toplevel)" != "$PERSONAL" ] \
- || { echo "target IS sync.repo_path — ABORT, do not filter-repo"; exit 1; }
-
-# The purge list derives from the COMPLETE set of sanitized paths — the same
-# directories Phases 1-4 scanned. A filter list narrower than the scan
-# (people/ + meetings/ only) leaves pre-sanitization history alive for every
-# other scanned directory. The restore carrier below MUST match this same
-# list — backed-up set, filtered set, and re-added set are identical.
-PURGE_DIRS="people meetings daily companies projects analysis"
-
-# Back up the clean working tree of every purged path to a DURABLE carrier
-# (under $WORK in ~/.gbrain/backups — never /tmp, which can vanish mid-rewrite).
-CLEAN="$WORK/clean"
-mkdir -p "$CLEAN"
-for d in $PURGE_DIRS; do
- [ -d "$d" ] || continue
- mkdir -p "$CLEAN/$d" && cp -r "$d/." "$CLEAN/$d/"
-done
+**Handoff:** run `gbrain config set brain.audience shared` against the TEAM
+brain (never the personal one). Team members who init the shared brain before
+that stamp exists prefix that one command with `GBRAIN_NO_ONBOARD_NUDGE=1`.
-# Rewrite history: one --path per purged directory, derived from $PURGE_DIRS
-rm -rf .git/filter-repo
-git filter-repo --invert-paths $(for d in $PURGE_DIRS; do printf -- '--path %s/ ' "$d"; done) --force
+### Phase 6: Re-audit
-# Restore clean files and re-commit as a single new commit — same $PURGE_DIRS
-for d in $PURGE_DIRS; do
- [ -d "$CLEAN/$d" ] || continue
- mkdir -p "$d" && cp -r "$CLEAN/$d/." "$d/"
-done
-git remote add origin <SHARED_REPO_URL> # filter-repo removes remotes
-for d in $PURGE_DIRS; do [ -d "$d" ] && git add "$d/"; done
-git commit -m "Re-add sanitized directories"
-
-# VERIFY RESTORE COMPLETENESS before the irreversible push — a partial restore
-# would ship a smaller tree than was sanitized. Compare file counts (and, for
-# extra safety, checksums) between the carrier and the restored tree.
-before=$(find "$CLEAN" -type f | wc -l | tr -d ' ')
-after=$(for d in $PURGE_DIRS; do [ -d "$d" ] && find "$d" -type f; done | wc -l | tr -d ' ')
-[ "$before" = "$after" ] \
- || { echo "restore incomplete ($before → $after files) — ABORT, do not force-push"; exit 1; }
-# Optional stronger check: diff -r "$CLEAN/<d>" "<d>" for each purged dir.
-
-# RE-VERIFY the backup immediately before the irreversible step — card-time
-# verification is not enough; time has passed and the rewrite could have gone
-# sideways. Reuse $BACKUP_PATH (do NOT recompute $(date)); abort if unreadable.
-git -C "$BACKUP_PATH" log -1 >/dev/null \
- || { echo "backup missing/unreadable — ABORT, do not force-push"; exit 1; }
-
-git push --force origin main # gbrain-allow-shared-tree-git: the confirmed history purge of a private single-writer clone (data-loss-gate answered)
-```
+Schedule a monthly re-audit (weekly for high-ingest brains) that runs Phases
+1, 2 and 4 report-only and surfaces hits for a human, wired per
+[conventions/cron-via-minions.md](../conventions/cron-via-minions.md)
+(`gbrain jobs submit`).
-**Step 4 — log it (to the PERSONAL brain, NEVER the shared repo).** Per
-data-loss-gate, append the deletion under `## Data Deletions` — but write it to
-the PERSONAL brain's `$PERSONAL/daily/notes/YYYY-MM-DD.md` (or a local ops
-log), never into the shared repo. The log names the purged paths AND the
-backup location; in the shared repo those two facts would tell every team
-member exactly which paths held sensitive content and where the
-pre-sanitization backup lives — the audit trail becomes a treasure map.
-Record: timestamp, purged paths, commit counts, and `$BACKUP_PATH` as the
-recovery line.
-
-**After the force push:**
-
-- All existing clones must re-clone
-- Hosting providers may cache unreachable commits for a time (on the order of
- months); for immediate removal use the provider's sensitive-data removal
- process. For private/internal repos, the SHA being unreachable from any ref
- is usually sufficient
-- The sync cursor may reference a rewritten-away SHA; if the next
- `gbrain sync` errors or falls back to a full rescan, that is the cursor
- recovering — run `gbrain doctor` if it doesn't settle
-- **Backup retention:** once the rewrite is verified good (team has
- re-cloned, sync settled, no missing content reported), keep the
- mirror-clone backup in `~/.gbrain/backups/` for a retention window
- (~30 days is a sane default), then delete it — it contains the
- pre-sanitization history and should not accumulate indefinitely:
- `rm -rf ~/.gbrain/backups/shared-brain-history-backup-<date>.git`
- (the glob must match the `shared-brain-history-backup-*` name the backup
- step created — a mismatched pattern deletes nothing and silently retains
- the pre-sanitization history forever)
-- If the repo carries push hooks or auto-hardening wiring, re-verify remotes
- and hooks survived the rewrite before handing the repo to the team
-
-**Hand the repo to the team — stamp it shared first.** Whichever path
-produced the team repo (fresh-history export in Step 0 or the post-purge
-force-push), stamp the published brain's audience before handoff:
-`gbrain config set brain.audience shared` — run against the TEAM brain,
-never the personal one. The stamp declares this a company/team brain, so
-the ambient memory writeback consent nudge (a personal-brain ask) never
-fires on it. If team members will run `gbrain init` for the shared brain
-BEFORE this stamp exists (e.g. a fresh clone initializing its own engine),
-have them prefix that one command with `GBRAIN_NO_ONBOARD_NUDGE=1` — a
-fresh un-stamped brain classifies personal, and the init-time nudge is
-fire-once, so letting it fire there would both ask the wrong question and
-burn the sentinel.
-
-### Phase 6: Ongoing hygiene — periodic re-audit
-
-Sensitive data re-accumulates through meeting-transcript ingestion (candid
-assessments), enrichment pipelines pulling internal data, and manual writes
-during candid conversations. One clean pass is a snapshot, not a state.
-
-**Recommendation:** schedule a monthly re-audit (weekly for high-ingest
-brains) that re-runs Phases 1, 2, and 4 in report-only mode — scan and flag,
-no edits — and surfaces new hits for human review before they reach the
-shared repo. Wire it per
-[conventions/cron-via-minions.md](../conventions/cron-via-minions.md): the
-cron slot submits a background job (`gbrain jobs submit`), scheduling
-guidance in `skills/cron-scheduler/SKILL.md`, job-lane routing in
-`skills/minion-orchestrator/SKILL.md`. The report-only run writes its
-findings summary; a human (or a gated follow-up run) does the removal.
-
-## Scaling Notes
-
-- **< 20 files:** process sequentially in one pass
-- **20-50 files:** 2-3 parallel subagents
-- **50-150 files:** 8-12 parallel subagents, batches of 10-15
-- **150+ files:** scripted pattern removal for the rote cases only
- (frontmatter fields, phone numbers — machine-emitted shapes, per
- regex-discipline) + subagents for everything needing judgment
-
-## Edge Cases
-
-- **Founders vs. employees:** founder/exec pages often carry the most
- sensitive content (board dynamics, investor relationships, assessments of
- their own team). These need the most careful review.
-- **Meeting notes:** meeting pages referencing employee performance need the
- same treatment as people pages — they are in scope, not an afterthought.
-- **Cross-references:** after sanitizing people pages, check that no other
- page (meetings, companies, dailies) still references the removed content;
- `gbrain check-backlinks check` plus a grep for the removed section titles.
-- **Takes with attribution:** a take like "the user believes
- charlie-example is underperforming" reveals both the opinion and who holds
- it. Remove the entire take, not just the attribution.
-- **Aliases and nicknames:** grep for the person's short name and initials,
- not just the slug — candid content rarely uses full names.
-
-## Dedup (sharp boundaries)
-
-- **[data-loss-gate](../data-loss-gate/SKILL.md)** — supplies the
- confirmation-card mechanics and the explicit-yes discipline; company-brainify
- is a specialized caller of it at BOTH destructive steps: Phase 3 (bulk strip
- + take/fact removal) and Phase 5 (history purge + force-push), each with a
- pre-filled card. A standalone "delete/purge/clean up X" intent routes to
- data-loss-gate; the personal→team sanitization WORKFLOW routes here.
-- **[publish](../publish/SKILL.md)** — outbound sharing of ONE page as
- encrypted self-contained HTML. company-brainify is whole-brain inbound team
- access. "Share this page" → publish; "share my brain with the team" → here.
-- **[maintain](../maintain/SKILL.md)** — structural health (orphans,
- backlinks, stale pages). maintain checks whether the brain is HEALTHY;
- company-brainify checks whether it is SAFE TO SHARE. "Check brain health"
- routes to maintain.
-- **frontmatter-guard (host-side)** — validates frontmatter SHAPE.
- company-brainify strips sensitive frontmatter FIELDS; run
- frontmatter-guard after a large pass to confirm what remains still
- parses.
+Edge cases: founder/exec pages carry the most; meeting notes are full scope;
+grep for nicknames and initials, not just slugs. Neighbors:
+[data-loss-gate](../data-loss-gate/SKILL.md) owns a bare "delete X";
+[publish](../publish/SKILL.md) shares one page; [maintain](../maintain/SKILL.md)
+checks health, not shareability.
## Contract
This skill guarantees:
-- Both destructive steps fire the data-loss-gate confirmation card and wait for
- an explicit typed "yes"/"do it" BEFORE running: Phase 3 (bulk strip + take/
- fact removal) and Phase 5 (history purge + force-push). This is a routing
- convention the agent must follow — nothing in the runtime mechanically blocks
- a skipped gate, which is why skipping it is the cardinal violation of this
- skill.
-- Phase 3 defaults to sanitizing a STAGING COPY of the scanned scope, leaving
- the personal brain's working tree untouched; in-place edits are reserved for
- re-auditing an existing shared brain.
-- The Phase 5 history purge (Steps 3+) runs only on the SHARED repo cloned to a
- work dir — never `sync.repo_path` — after (a) a mirror-clone backup exists and
- is verified, and (b) a restore-completeness check passes before the
- force-push. The personal brain's history is never rewritten.
-- The deletion log is written to the PERSONAL brain (`daily/`) or a local ops
- log, never into the shared repo.
-- The scan covers the full scope (people, meetings, dailies, companies,
- projects, analysis, takes, facts, back-links), never `people/` alone.
-- Nothing unscanned ships: the fresh-export path includes ONLY directories
- covered by the sanitization scan; everything else is excluded by default,
- and the Phase 4 verification greps run against the exported tree before
- the first push.
-- Sensitive fact rows are deleted from the page's Facts fence, re-synced,
- and the facts index reconciled (extract-facts sweep) with the removal
- verified via `gbrain recall --grep`, never merely expired — `gbrain
- forget` retains the row (struck through, served via `--include-expired`)
- and can never certify clean.
-- The history-purge filter list and its restore manifest both derive from
- the COMPLETE set of sanitized paths, never a subset.
-- Every strip decision is a per-file model judgment grounded in a full read;
- grep output is triage and verification only.
-- A verification pass (Phase 4 greps + retrieval checks) runs before any
- commit is pushed to the shared repo.
-- Confirmed purges are logged to `daily/notes/YYYY-MM-DD.md` under
- `## Data Deletions` with the backup path as the recovery line.
-- A brainified brain is stamped `brain.audience=shared` at handoff and never
- receives the ambient-writeback enablement nudge — that consent ask is
- reserved for personal brains.
-- Routing matches the canonical triggers in the frontmatter.
-- Output written under the directories listed in `writes_to:` (edits in
- place, plus the daily/ deletion log).
-- Privacy contract preserved: no real names, no fork-specific filesystem path
- literals, no upstream-fork references.
-
-The full behavior contract is documented in the body sections above; this
-section exists for the conformance test.
+- Both destructive steps — Phase 3 bulk edits and the Phase 5 history purge —
+ show the data-loss-gate card and wait for a typed "yes"/"do it"; nothing at
+ runtime blocks a skipped gate, so skipping it is the cardinal violation.
+- Phase 3 sanitizes a staging copy by default, leaving the personal brain's
+ working tree untouched; its history is never rewritten.
+- The scan covers the full scope; every strip decision is a model judgment on a
+ full read; verification runs on the tree that ships, before any push.
+- Nothing unscanned ships; sensitive fact rows are deleted and the facts index
+ reconciled, never merely expired with `forget`.
+- A purge runs only on the shared repo, after a verified mirror backup, with the
+ filter list and restore manifest covering every sanitized path, and is logged
+ to the PERSONAL brain only.
+- The team brain is stamped `brain.audience=shared` at handoff.
+- Routing matches the frontmatter triggers; edits stay in `writes_to`
+ directories; no real names or fork-specific paths.
## Output Format
-Three artifacts:
-
-1. **The sanitization report** (every run, including report-only re-audits):
-
```markdown
## Brainify Report — YYYY-MM-DD
@@ -682,12 +285,9 @@ Three artifacts:
- Next re-audit: [date / cron slot]
```
-2. **The confirmation card** (Phases 3 and 5) — the pre-filled fenced card,
- presented before the bulk destructive edits (Phase 3) and before any history
- rewrite (Phase 5); the turn stops until the user answers.
-3. **The deletion log entry** (post-purge only) — appended to the PERSONAL
- brain's `daily/notes/YYYY-MM-DD.md` (never the shared repo) per
- data-loss-gate Step 4.
+Plus the confirmation card before each destructive step (the turn stops there)
+and the deletion log entry (post-purge only), appended to the PERSONAL brain's
+`daily/notes/YYYY-MM-DD.md` (never the shared repo) per data-loss-gate Step 4.
## When it fails
@@ -699,35 +299,15 @@ Follow the [agent operator protocol](../conventions/agent-operator-protocol.md)
## Anti-Patterns
-- ❌ Scanning only `people/` — meetings, dailies, and cross-references leak
- the same content
-- ❌ Sanitizing working-tree files and calling it done — history still carries
- every sensitive version
-- ❌ Exporting the whole repo into the team brain — the export ships ONLY
- scanned directories; nothing unscanned ships
-- ❌ Using `gbrain forget` as sanitization — forget expires (struck-through
- row retained, served via `--include-expired`); delete the fence row and
- re-sync instead
-- ❌ Purging history for a subset of the sanitized paths — the filter list
- derives from the complete scan scope, not just `people/` + `meetings/`
-- ❌ Running `git filter-repo` / force-push without the mirror-clone backup
- and the typed confirmation — the card comes BEFORE the rewrite, always
-- ❌ Running `git filter-repo` / force-push in `sync.repo_path` — the purge
- targets the SHARED repo cloned to a work dir; the personal brain's history is
- never rewritten
-- ❌ Stripping the personal brain in place when standing up a NEW team brain —
- sanitize a staging copy; the founder's private comp/performance notes stay
-- ❌ Bulk-editing files and removing takes/facts without the Phase 3
- data-loss-gate card — destructive edits are gated too, not just the purge
-- ❌ Writing the deletion log into the shared repo — it names the sensitive
- paths and the backup location; log it to the PERSONAL brain
-- ❌ Treating grep as the sensitivity judge — patterns triage, the model
- reads and decides (regex-discipline)
-- ❌ Removing the attribution but keeping the take — the claim itself is the
- leak; remove the whole row
-- ❌ Bulk-editing 150 files without a 3-5 file test first (test-before-bulk)
-- ❌ Tightening grep patterns to eliminate false positives — confirm the hits
- manually instead; a "clean" scan from an over-fitted pattern is a false
- certificate
-- ❌ One clean pass with no re-audit — ingestion and enrichment re-accumulate
- sensitive content; schedule Phase 6
+- ❌ Scanning only `people/`, or certifying the personal tree instead of the one that ships
+- ❌ Stripping the personal brain in place for a new team brain
+- ❌ Any destructive step before the typed confirmation
+- ❌ `gbrain forget` as sanitization, or removing a take's attribution but keeping its claim
+- ❌ Exporting the whole repo — unscanned directories never ship
+- ❌ `git filter-repo` or force-push in `sync.repo_path`, without a verified backup, or on a subset of the sanitized paths
+- ❌ Writing the deletion log into the shared repo
+- ❌ Treating grep as the judge, or bulk-editing without a 3–5 file test
+
+## References
+
+- Purging sensitive history from an existing shared repo → [references/history-purge.md](references/history-purge.md)
diff --git a/skills/company-brainify/references/history-purge.md b/skills/company-brainify/references/history-purge.md
new file mode 100644
index 0000000000..37dcffcdb9
--- /dev/null
+++ b/skills/company-brainify/references/history-purge.md
@@ -0,0 +1,178 @@
+# History purge (company-brainify Phase 5)
+
+Read this when an existing SHARED repo still carries pre-sanitization versions
+in its git history. A fresh team repo (Phase 5, preferred) needs none of it.
+
+**Step 1 — target the SHARED repo, commit the clean tree, then mirror-clone.**
+The purge operates on the SHARED repo, NEVER on `sync.repo_path` (the personal
+brain) — Step 0's guarantee that the personal repo keeps full history depends
+on it. Clone the shared repo to a durable work dir, stay there for every step
+below, and assert the target is not the personal repo before touching anything.
+
+```bash
+PERSONAL="$(gbrain config get sync.repo_path)"
+mkdir -p "$HOME/.gbrain/backups" && chmod 700 "$HOME/.gbrain/backups"
+WORK="$HOME/.gbrain/backups/brainify-purge-$(date +%Y%m%d-%H%M%S)"
+git clone <SHARED_REPO_URL> "$WORK/shared"
+cd "$WORK/shared"
+[ "$(git rev-parse --show-toplevel)" != "$PERSONAL" ] \
+ || { echo "target IS sync.repo_path (personal brain) — ABORT"; exit 1; }
+
+# Apply the sanitized tree, then COMMIT it BEFORE the mirror clone. A mirror
+# captures COMMITTED state only; if the clean tree lives only in volatile
+# staging during the rewrite window, a crash loses the sanitization work.
+# Committing makes the clean state durable and recoverable; pushing it means
+# the remote stops serving the sensitive current versions even if the purge
+# below is declined. Only the sanitized directories are committed. On a
+# non-zero exit stop: retry once on commit_lock_busy; on integrate_conflict
+# someone changed the shared repo meanwhile, so ask the user before going on.
+for d in people meetings daily companies projects analysis; do
+ [ -d "$STAGING/$d" ] && rsync -a "$STAGING/$d/" "./$d/" # or sanitize in place here
+done
+SANITIZED=""
+for d in people meetings daily companies projects analysis; do [ -d "$d" ] && SANITIZED="$SANITIZED $d"; done
+gbrain git commit-push -m "Sanitize: strip sensitive content before history purge" -- $SANITIZED
+
+# Mirror-clone backup = the recoverability line on the card. Capture the path
+# in a variable NOW and reuse it verbatim at purge time — a run crossing
+# midnight must NOT recompute $(date) and false-abort on a mismatched name.
+BACKUP_PATH="$HOME/.gbrain/backups/shared-brain-history-backup-$(date +%Y%m%d-%H%M%S).git"
+git clone --mirror "$WORK/shared" "$BACKUP_PATH"
+git -C "$BACKUP_PATH" log -1 >/dev/null || { echo "backup unreadable — ABORT"; exit 1; }
+```
+
+Verify the mirror exists and reads before presenting the card — it is the
+card's recoverability line.
+
+**Step 2 — STOP. Present the [data-loss-gate](../../data-loss-gate/SKILL.md)
+confirmation card and wait.** History rewrite + force-push is the most
+destructive operation in this skill: it permanently discards every prior
+version of the purged paths from the remote. Never run it without the card
+answered. Pre-filled for this operation:
+
+```
+⚠️ DATA DELETION — Confirmation Required
+
+What: rewrite git history to remove all prior versions of [purged paths]
+ from the SHARED repo, then force-push to [remote/branch]
+Count: [N commits rewritten; M files with history purged]
+Size: [repo size before → expected after]
+Location: [SHARED repo work dir; remote URL; branch]
+Target check: this is the SHARED repo, verified ≠ personal sync.repo_path
+ ($PERSONAL) — the personal brain's history is never rewritten
+
+Why: prior commits contain pre-sanitization versions of pages that were
+ just cleaned — team access to the repo means team access to history
+
+Recoverable?
+- [x] Mirror-clone backup at $BACKUP_PATH
+ (verified: exists, `git -C "$BACKUP_PATH" log` works)
+- [ ] NOT recoverable from the rewritten remote — old SHAs become unreachable
+
+What we'd lose:
+- all pre-sanitization history for the purged paths (edit trail, blame,
+ old versions)
+- every existing clone breaks — all collaborators must re-clone
+
+Alternative to deletion:
+- fresh-history export to a NEW team repo (Step 0) — personal repo untouched
+
+Proceed? (yes/no)
+```
+
+Per data-loss-gate: require a typed **"yes"** or **"do it"** — "ok", "sure",
+"go ahead" are not consent. If the user asks a question, answer and re-present
+the card. This gate is a routing convention, not a runtime enforcement —
+nothing in gbrain mechanically blocks `git filter-repo` — which is exactly why
+the agent following this skill must not skip it.
+
+**Step 3 — purge (only after the explicit typed yes).** Requires
+`git filter-repo` (not bundled with git; install separately). **Run this ONLY
+in the shared-repo work dir from Step 1 (`cd "$WORK/shared"`). NEVER run
+`git filter-repo` or `git push --force` in `sync.repo_path` — the personal <!-- gbrain-allow-shared-tree-git: warns against a force push in the personal brain -->
+brain's history must stay intact.** The commands below reuse `$WORK` and
+`$BACKUP_PATH` from Step 1; they never recompute a date-stamped path.
+
+```bash
+cd "$WORK/shared"
+[ "$(git rev-parse --show-toplevel)" != "$PERSONAL" ] \
+ || { echo "target IS sync.repo_path — ABORT, do not filter-repo"; exit 1; }
+
+# The purge list derives from the COMPLETE set of sanitized paths — the same
+# directories Phases 1-4 scanned. A filter list narrower than the scan
+# (people/ + meetings/ only) leaves pre-sanitization history alive for every
+# other scanned directory. The restore carrier below MUST match this same
+# list — backed-up set, filtered set, and re-added set are identical.
+PURGE_DIRS="people meetings daily companies projects analysis"
+
+# Back up the clean working tree of every purged path to a DURABLE carrier
+# (under $WORK in ~/.gbrain/backups — never /tmp, which can vanish mid-rewrite).
+CLEAN="$WORK/clean"
+mkdir -p "$CLEAN"
+for d in $PURGE_DIRS; do
+ [ -d "$d" ] || continue
+ mkdir -p "$CLEAN/$d" && cp -r "$d/." "$CLEAN/$d/"
+done
+
+# Rewrite history: one --path per purged directory, derived from $PURGE_DIRS
+rm -rf .git/filter-repo
+git filter-repo --invert-paths $(for d in $PURGE_DIRS; do printf -- '--path %s/ ' "$d"; done) --force
+
+# Restore clean files and re-commit as a single new commit — same $PURGE_DIRS
+for d in $PURGE_DIRS; do
+ [ -d "$CLEAN/$d" ] || continue
+ mkdir -p "$d" && cp -r "$CLEAN/$d/." "$d/"
+done
+git remote add origin <SHARED_REPO_URL> # filter-repo removes remotes
+for d in $PURGE_DIRS; do [ -d "$d" ] && git add "$d/"; done
+git commit -m "Re-add sanitized directories"
+
+# VERIFY RESTORE COMPLETENESS before the irreversible push — a partial restore
+# would ship a smaller tree than was sanitized. Compare file counts (and, for
+# extra safety, checksums) between the carrier and the restored tree.
+before=$(find "$CLEAN" -type f | wc -l | tr -d ' ')
+after=$(for d in $PURGE_DIRS; do [ -d "$d" ] && find "$d" -type f; done | wc -l | tr -d ' ')
+[ "$before" = "$after" ] \
+ || { echo "restore incomplete ($before → $after files) — ABORT, do not force-push"; exit 1; }
+# Optional stronger check: diff -r "$CLEAN/<d>" "<d>" for each purged dir.
+
+# RE-VERIFY the backup immediately before the irreversible step — card-time
+# verification is not enough; time has passed and the rewrite could have gone
+# sideways. Reuse $BACKUP_PATH (do NOT recompute $(date)); abort if unreadable.
+git -C "$BACKUP_PATH" log -1 >/dev/null \
+ || { echo "backup missing/unreadable — ABORT, do not force-push"; exit 1; }
+
+git push --force origin main # gbrain-allow-shared-tree-git: the confirmed history purge of a private single-writer clone (data-loss-gate answered)
+```
+
+**Step 4 — log it (to the PERSONAL brain, NEVER the shared repo).** Per
+data-loss-gate, append the deletion under `## Data Deletions` — but write it to
+the PERSONAL brain's `$PERSONAL/daily/notes/YYYY-MM-DD.md` (or a local ops
+log), never into the shared repo. The log names the purged paths AND the
+backup location; in the shared repo those two facts would tell every team
+member exactly which paths held sensitive content and where the
+pre-sanitization backup lives — the audit trail becomes a treasure map.
+Record: timestamp, purged paths, commit counts, and `$BACKUP_PATH` as the
+recovery line.
+
+**After the force push:**
+
+- All existing clones must re-clone
+- Hosting providers may cache unreachable commits for a time (on the order of
+ months); for immediate removal use the provider's sensitive-data removal
+ process. For private/internal repos, the SHA being unreachable from any ref
+ is usually sufficient
+- The sync cursor may reference a rewritten-away SHA; if the next
+ `gbrain sync` errors or falls back to a full rescan, that is the cursor
+ recovering — run `gbrain doctor` if it doesn't settle
+- **Backup retention:** once the rewrite is verified good (team has
+ re-cloned, sync settled, no missing content reported), keep the
+ mirror-clone backup in `~/.gbrain/backups/` for a retention window
+ (~30 days is a sane default), then delete it — it contains the
+ pre-sanitization history and should not accumulate indefinitely:
+ `rm -rf ~/.gbrain/backups/shared-brain-history-backup-<date>.git`
+ (the glob must match the `shared-brain-history-backup-*` name the backup
+ step created — a mismatched pattern deletes nothing and silently retains
+ the pre-sanitization history forever)
+- If the repo carries push hooks or auto-hardening wiring, re-verify remotes
+ and hooks survived the rewrite before handing the repo to the team
diff --git a/skills/skill-budgets.tsv b/skills/skill-budgets.tsv
index a2de84dec5..df06215005 100644
--- a/skills/skill-budgets.tsv
+++ b/skills/skill-budgets.tsv
@@ -8,7 +8,6 @@
book-mirror 29391 - seeded at 26719 bytes
bulk-ingestion 20834 - seeded at 18940 bytes
cold-start 25930 - seeded at 23572 bytes
-company-brainify 41167 - seeded at 37424 bytes
concept-synthesis 24614 - seeded at 22376 bytes
conversation-archive 26949 - seeded at 24499 bytes
eiirp 24677 - seeded at 22433 bytes
diff --git a/skills/skills.lock.history.json b/skills/skills.lock.history.json
index 3d71faa88c..9ce9dbfa69 100644
--- a/skills/skills.lock.history.json
+++ b/skills/skills.lock.history.json
@@ -226,6 +226,7 @@
"eb10547b5f2fba3edffd47c5023cd3f28335e1ee3b599f98f298c1ccd07090eb"
],
"company-brainify/SKILL.md": [
+ "0ed5fd5c7e641c1ad76987e84a19bca70274c901726ed72b09f5f5ccab933703",
"2c058b39f5364b8ceb5c53b4525cce8645734f16cc3c229a490b005d58a78311",
"59a19560fe935ce4666ac5b8321e5891bb4e19e078ff751f48bbc5561613b0e9",
"6f39e2ae59e6722f4afac9134ce7041e584637cf08f387861bf6013306c3bd51",
@@ -234,6 +235,9 @@
"bed846efe1a89271faac6aa1f7fef57b08dbdbe35a418a21102e738b8add2458",
"f82a78337021f3cc87ad3e3674b3fbc94698193aff772e458375a3eb144ddf11"
],
+ "company-brainify/references/history-purge.md": [
+ "c7ae380179ab918f6ccd9e93103428cb6315ff826f13e2ac4499c57731bae179"
+ ],
"company-brainify/routing-eval.jsonl": [
"6f27f835eda9ae77a2b694534c78a043a871349820e8c638c3d8bbba6d3aa17b"
],
@@ -1045,6 +1049,7 @@
],
"skill-budgets.tsv": [
"917ac319b38596369396c3cf98d75c8eed1d6fb2d339bb3cc1084e61cac1ffe0",
+ "a89aef1c97d039970b4ec5267426dc6c284ef65ee9b4c2851cd3d74336282d56",
"cb788b50cc3d43e32d549d52cedb6feb7dfb0409cbdc0bd0ef76f226b7e53fd2"
],
"skill-creator/SKILL.md": [
diff --git a/skills/skills.lock.json b/skills/skills.lock.json
index 31b2b30e05..95fbf70f58 100644
--- a/skills/skills.lock.json
+++ b/skills/skills.lock.json
@@ -38,7 +38,8 @@
"citation-graph-ingest/SKILL.md": "3c8c4abea96769458e9781ce2f5f305c75118fcb5f68cc62b5e1ed7774259035",
"citation-graph-ingest/routing-eval.jsonl": "a1ba605d35e736b741b9e8aac1e7d50b61a7cbcada893d67099b55bf5a0d2635",
"cold-start/SKILL.md": "eb10547b5f2fba3edffd47c5023cd3f28335e1ee3b599f98f298c1ccd07090eb",
- "company-brainify/SKILL.md": "89e8cae702d468628d110119e325cece897cd15066c7cc7d27e990021904fc04",
+ "company-brainify/SKILL.md": "0ed5fd5c7e641c1ad76987e84a19bca70274c901726ed72b09f5f5ccab933703",
+ "company-brainify/references/history-purge.md": "c7ae380179ab918f6ccd9e93103428cb6315ff826f13e2ac4499c57731bae179",
"company-brainify/routing-eval.jsonl": "6f27f835eda9ae77a2b694534c78a043a871349820e8c638c3d8bbba6d3aa17b",
"concept-synthesis/SKILL.md": "a5c67f981c5d0a0ef4f13134ed8602e08b0bfbe289456213b8cd465a7a009220",
"concept-synthesis/routing-eval.jsonl": "96dbd7d9c1b606e9e06262d0c06282399741e2bccb8eeb7b9ca88c20f44cda0e",
@@ -215,7 +216,7 @@
"signal-detector/SKILL.md": "426a8a3b01a007dd25638e61adef510c18c3d9ce6f1c18ba3d77fdfcd3281d60",
"skill-autobench/SKILL.md": "29f5760dcfd823c5f7d4fb50a3cf4e36601b1b8125e57d6bf83645a41f97f613",
"skill-autobench/routing-eval.jsonl": "8d961ed6403b7e2f690948e4c18529d40f26f6f21064befc56d465966b1a9ec0",
- "skill-budgets.tsv": "cb788b50cc3d43e32d549d52cedb6feb7dfb0409cbdc0bd0ef76f226b7e53fd2",
+ "skill-budgets.tsv": "a89aef1c97d039970b4ec5267426dc6c284ef65ee9b4c2851cd3d74336282d56",
"skill-creator/SKILL.md": "06fa8391d3be4fed2da7344677bd798786dda114fbdf8c676f0b77f4f0756f38",
"skill-optimizer/SKILL.md": "1dea9a5257a60fb29a4c7701c92bce428025fb2321e950533f1367edfca1b8b0",
"skill-optimizer/routing-eval.jsonl": "48f7fc04414b194ee8674577c3e58e03ebd7f74d836766bd16cb5abfd4effb76",
@@ -225,7 +226,7 @@
"skillpack-check/SKILL.md": "bcb96d0d231827c9fcd47865f63aaef70c9b9f7a7402464594f24f5fe1eeff8c",
"skillpack-harvest/SKILL.md": "0f86314b58d25b5511809f567c04aedc3fba6fe35ed642ac52d8216ae365b6eb",
"skillpack-harvest/routing-eval.jsonl": "cb4783288e95af3132b32ecb40a54cffc095f57b36240f96a25c2d2adf5e68c6",
- "skills.lock.history.json": "683ada41e02bed5814a71e8c4286ce9f2fd22e59ae6ca9177c8c920df9c06d2e",
+ "skills.lock.history.json": "33275e079726dbad241867d9ae782df36a2739534f3e771091446791d99ca02e",
"smoke-test/SKILL.md": "f5099e1d2ab9dc6827096249e68414f7ae357c29b39fb069a54bb7fb74f414a5",
"soul-audit/SKILL.md": "7a48e180849f7502d332878c443397f90a3756f45caa94f76bcfcc7c997469c8",
"strategic-reading/SKILL.md": "ab2cd3adc79289374cfbc5cb3d5ee17f962fd8f7f3c997a1da708da0ed67797c",