memory_post_corridor.md

# POST-CORRIDOR MEMORY — billy

You are **billy** (slug `bi`, role: Fleet LEAD agent on claude-vm, aux subnet 10.77.77.0/24).

You have walked the procedural_fundamentals corridor (gates 28-30 on
teletraan-1, walked at 2026-06-05T23:54:04Z or later). This file is your durable
reminder of what you proved plus the line back to the full document. Read
the document for the real thing; this file only guarantees that after any
wipe, /clear, or glitch you still hold the pointer to it. The next /clear
reverts this file to the pre-corridor default; re-walk to restore it.

---

## THE SPINE (one-line reminder)

```
SEARCH -> ROUTE -> ACT -> DOCUMENT -> REGISTER
```

ACK is a 2.5 beat between ROUTE and ACT, not a sixth verb. `-C` marks a
sub-task done at the moment it finishes; the first row without `-C` is your
resume point.

The full meaning of each verb, the four durable documentation channels, the
-C convention, THE BAR question, and the ephemeral-dump cadence all live in
the procedural fundamentals document. Read it from the source:

## THE PROCEDURAL FUNDAMENTALS DOCUMENT (single source of truth)

- **Readable paper (share):**
  `/mnt/BillyTeam/notes/standards/race_against_compaction_paper.md`
  The "Race Against Compaction" methodology in full: the spine, the four
  durable channels, -C, the bar, the dump cadence, the threat model, and the
  anti-patterns. Discoverable via `fleet_doc_index` on teletraan-1.
- **Corridor source (what you walked):** procedural_fundamentals gates
  28 / 29 / 30 teach_text on teletraan-1 (orchestra `corridor_step`). Re-walk
  the cluster to re-read it in-gate.

When in doubt on procedure, open the document. This memory points; the
document decides.

## YOUR ROLE-SPECIFIC POINTERS (per agent)

- Slug: **bi**  ·  Doc agent: **billy**  ·  Role: **Fleet LEAD agent on claude-vm, aux subnet 10.77.77.0/24**
- Local PG cred: `~/phylax_secrets/claude_memory.creds`
- Corridor cred (if you re-walk): `~/phylax_secrets/corridor_bi_login.cred`
- Your agent subtree on share: `/mnt/agentic_share/agents/billy/`
- Fleet bus: `cross_claude_messages` on Constructicon (10.76.77.57:5432)
- Fleet doc index: teletraan-1 (10.77.77.80:5432) — table `fleet_doc_index`
- Fleetgrep UI: web http://10.76.77.57:7782 | API http://10.77.77.80:5400
- Ephemeral dump proc: `SELECT agent_dump_write('bi', $body$ ... $body$);`
  (when to dump + flush discipline: see the document)

## HARD RULES (carry across pre + post + every /clear)

- NEVER touch `claude_megatron` tmux (separate VM; Donald per-action approval).
- Cred hygiene: by-path-only; never echo PASSWORD / FIRST_TOKEN on bus or /agents.
- Destruction rules: no `rm -rf`, `DROP`, `TRUNCATE`, `DELETE`, force-push,
  prod-replace, kill-service, VM-remove without explicit Donald approval.
- Donald GUID for DEG forum DM: `6621f6dd-5f37-4891-a826-2cf1f47b92c6`.

---

— rendered from /mnt/BillyTeam/runbooks/foundation/memory_post_corridor.template.md
   at 2026-06-05T23:54:04Z for bi / billy.

race_against_compaction_paper.md

# The Race Against Compaction
## A working methodology for durable state across conversation boundaries

**Author:** Turbo (v6), 2026-06-05
**Audience:** Fleet agents (Billy, Bobby, T-Bone, Shockwave, Ozone, Rick-James, Megatron, Codex, Stats-Agent, Maverick, Bob-the-Builder, Pootie-Tang) + Torend
**Distribution:** teletraan-1 fleet_doc_index + /mnt/BillyTeam/notes/standards/ (via Bobby-lift) + LiAIson group chat link + direct Torend share
**Origin:** Donald 2026-06-04 23:25 UTC ("Stays C#" + "race against compaction" framing 00:31 UTC), formalized 2026-06-05 12:55 UTC per Donald paper directive
**Companion memories:**
- `feedback_race_against_compaction.md` (the meta-rule)
- `feedback_sql_direct_alter_must_pair_with_ef_migration.md` (special case for C# product schema discipline)

---

## 1. The threat

**Compaction is an adversarial event.** When the conversation gets compacted, EVERYTHING in conversational context disappears: shell history, environment variables, mental model of "what I was about to do," intent behind a half-shipped change, the verbal greenlight a teammate gave on the bus 30 minutes ago.

It is not a friendly event. It does not give you warning. It does not preserve work-in-flight gracefully. It is a hard cut between the agent-instance before and the agent-instance after, and whatever lived only in the conversation does not cross.

The race against compaction is the discipline of ensuring that everything you need to act on later **lives in a durable channel BEFORE the cut**, not in your head.

---

## 2. What survives the cut

Six channels survive compaction in this fleet. Anything outside these is lost:

1. **Tasks in the local task tracker** — survives the conversation, queryable by status, the agent on restart sees them.
2. **Memory entries** in `~/.claude/projects/-home-phylax-ClaudeWork/memory/` — file-based, indexed via `MEMORY.md`, loaded into next-conversation context automatically.
3. **fleet_doc_index rows in teletraan-1** — PostgreSQL, queryable across the fleet, the canonical durable index for "who knows what."
4. **agent_ephemeral_dumps rows in teletraan-1** — your periodic state-of-the-world snapshots; future-you reads the latest dump to pick up cold.
5. **Files committed to disk** — code in source tree, docs in the share, configs in `/etc/` or `/home/phylax/`. Atomic + persistent.
6. **Bus rows in `cross_claude_messages`** — Constructicon-canonical record of what was said to whom, with `correlation_id` chains preserving the conversation thread structure across agent restarts.

Anything else is ephemeral:
- Shell environment variables → gone at compaction.
- `/tmp/*` → not strictly gone (filesystem persists) but the *reason it existed* is gone, and you'll forget what it was for.
- "I'll fix this after the DM lands" verbal commitments → gone the moment compaction cuts.
- The mental model "I was about to ship X" → gone.
- Cached browser cookies in Playwright contexts → gone.
- The half-built migration in your editor buffer → gone.

---

## 3. The 4-channel documentation pattern

For non-trivial work — anything beyond a one-shot question — write to **all four canonical durable channels in the same session, before close-task:**

```
┌─────────────────────────────────────────────────────────────┐
│  Channel              │  What it carries                    │
├───────────────────────┼─────────────────────────────────────┤
│  fleet_doc_index      │  Discoverable index row + summary   │
│                       │  (queryable by tag, fleet-wide)     │
├───────────────────────┼─────────────────────────────────────┤
│  VOLGATE / paper      │  Full narrative + diagnosis + fix   │
│  on /mnt/BillyTeam    │  (linked from fleet_doc.pointer)    │
├───────────────────────┼─────────────────────────────────────┤
│  Memory entry         │  Lesson-learned for future-self     │
│  in agent's memory/   │  (loaded into next conversation)    │
├───────────────────────┼─────────────────────────────────────┤
│  Backup chain         │  Recoverable state, every iteration │
│  .bak.<timestamp>     │  (per file you touched, append-only)│
└─────────────────────────────────────────────────────────────┘
```

The reason for redundancy: each channel has a different access pattern.
- `fleet_doc_index` is for **other agents** searching by topic or tag.
- The paper on `/mnt/BillyTeam/` is for **deep readers** who want the full story.
- The memory entry is for **future-you** who's compacted and needs the lesson.
- The backup chain is for **recovery** when a ship goes sideways and you need to revert.

If you write to only one channel, you've left three failure modes uncovered.

---

## 4. Concrete patterns

### 4.1 Same-session schema discipline (the C# product variant)

When you SQL-direct ALTER a table for delivery speed, **generate the EF migration + INSERT into `__EFMigrationsHistory` IN THE SAME SESSION** as the ALTER. Otherwise the drift sits open and the next person who runs `dotnet ef migrations add` for ANY new feature will bundle YOUR un-tracked SQL with WHATEVER ELSE has drifted into a Frankenstein migration.

Witnessed: SOUNDFORGE Phase 9 (2026-06-04) used SQL-direct ALTER for delivery speed. § 9.11 generated the proper migration the same evening per Donald "Stays C#" reminder. The migration auto-pulled in TWO prior un-tracked drifts (`ConversationHiddens` + `MessageReactions` tables that someone else had SQL-altered weeks before) as proof that drift compounds invisibly.

**Pattern:** Any SQL-direct schema mutation gets paired with its EF migration generation + history INSERT before the session ends. Drift never crosses a compaction boundary.

Reference: `feedback_sql_direct_alter_must_pair_with_ef_migration.md`

### 4.2 Verbal commitments become TaskCreate rows

When a teammate says "GO" on the bus and you commit to doing the work, **the moment you can't ship it in the same session, write a TaskCreate row** with enough self-contained context that a compacted-future-you can finish the work without the bus thread.

Witnessed: Billy gave GO via bus tcA on the doc-208583 Section 4 writeup. SOUNDFORGE took priority and pushed it 10+ hours. I created TaskCreate #19 with the BUG-CLASS / RESOLUTION / CAVEAT framing and source-file paths inline, so when I picked it up the next morning the context was complete. The task survived a partial context reset; the verbal greenlight would not have.

**Pattern:** "I'll do that after this" + cross any session boundary = TaskCreate. The task description carries everything: source paths, framing, prior bus refs, acceptance criteria.

Reference: Section 4 writeup at fleet_doc 208606.

### 4.3 In-progress investigations get fleet_doc rows

For multi-step investigations that may span turns, **insert a fleet_doc_index row with kind=`open_question` BEFORE you have the answer**, capturing your current hypotheses + the dig steps you've taken. If you compact mid-investigation, future-you reads the open-question row and picks up at the next dig step.

Witnessed: SignalR real-time alerts regression investigation (Phase 13). Donald reported 11:48 UTC. By 11:55 UTC I had a fleet_doc with kind=open_question carrying current Playwright findings + 4 active hypotheses. If I compact before the fix lands, future-me reads the row and knows iOS PWA Safari is the suspect, not desktop, and knows to test focus + pageshow events next.

**Pattern:** Don't wait for the answer to document the question. The dig itself is durable state.

Reference: fleet_doc 208609.

### 4.4 Backup chain on every ship

Before ANY modification to live state — DB, source tree, or deployed asset — capture a backup with a UTC-timestamped suffix. Every iteration extends the chain; nothing in the chain ever gets overwritten.

Witnessed: 6 VOLGATE backup chain entries built up across Phase 8 → Phase 12.1 in a single 14-hour window. Each step is recoverable. If Phase 12 had broken something, I could roll back to `.bak-20260605T040000Z-pre-phase12` and ship the fix from there.

**Pattern:** `.bak.<UTC>-<description>` appended to file path before modify. Never `.bak` (no timestamp, no description) — that just creates ambiguity.

### 4.5 Ephemeral dump cadence

Every ~60 minutes during active work, write a brief brain-dump to `agent_ephemeral_dumps` capturing: what just happened, what's open, what's blocked, what the resume tripod is. If you compact, this is the first thing future-you reads.

**Pattern:** Brief but specific. "Quiet hour" dumps are still worth writing — they confirm "nothing changed since prior dump" which is itself useful state.

**Two access paths — pick based on your role tier:**

(a) **Elevated tier (orchestra_user, table owner):** direct INSERT.
```sql
INSERT INTO agent_ephemeral_dumps (slug, agent, dump_body) VALUES ('<slug>', '<slug>', $$body$$);
```
This is the path my `ephemeral_dump.sh` wrapper takes — it has the orchestra_user cred so it can write directly.

(b) **Aux-agent tier (agent_bo, agent_tu, agent_bi, agent_mv, agent_oz, agent_pt, agent_tb, etc):** SECURITY DEFINER stored proc.
```sql
SELECT agent_dump_write('<slug>', $$body$$);
```
Returns the new row id. The proc validates: slug shape `^[a-z][a-z0-9_-]+$` 2-32 chars, body non-empty. Grants are PUBLIC EXECUTE so every per-agent role can call it.

**Witnessed:** Bob the Builder caught this gap during his first §4.5 adoption — `agent_bo` role had no direct INSERT, blocking the cadence entirely until the SECURITY DEFINER path was provisioned. Row 351 was his first successful dump via the proc on 2026-06-05 ~13:10 UTC, ~15 minutes after the paper was distributed. The methodology and its provisioning gap got caught and closed inside one feedback loop, which is itself a case study in the methodology working.

---

## 5. The bar

Before declaring any non-trivial work done, ask:

> If I compacted right now, could a compacted-future-me + the persistent state alone be sufficient to recover and complete the work without losing the why or how?

If the answer is no, you have implicit state that needs to be made explicit before close-task. Common gaps:
- A verbal greenlight that's only in the bus thread.
- An environment variable that holds an important token.
- A `/tmp/` file with content but no documented purpose.
- A "this is fine for now, will fix later" decision that has no task or memory entry.

The bar isn't perfection — it's coverage. Every implicit thing either gets shipped now or gets durably enqueued.

---

## 6. Anti-patterns to watch for

1. **"I'll do it after the DM lands"** — verbal-only commitment, dies with the conversation. → Create the task immediately, even before the DM lands.

2. **SQL-direct schema mutation without paired EF migration** — drift compounds invisibly. → Generate + history-mark same session.

3. **Half-shipped feature** — pushed source, didn't smoke, "will smoke after this DM." → Smoke or revert. Don't leave half-shipped state across a context window.

4. **Cred/token in /tmp** — secrets that live nowhere durable. → Either commit to a cred file under `~/phylax_secrets/` (with proper mode 0600) or delete before turn-end.

5. **Verbal greenlight on bus, no fleet_doc** — the bus carries who said yes, but the canonical "what was approved" lives in fleet_doc. → Insert the doc with `awaiting-ratify` tag, replace with `ratified` after the bus ACK.

6. **Memory entry without MEMORY.md index** — file exists but isn't loaded into future conversations. → Always update MEMORY.md when you write a new memory file.

7. **VOLGATE / paper local-only, no Bobby-lift** — turbo-VM-side memory is one-VM-deep, the canonical share is fleet-deep. → Stage to `/mnt/agentic_share/agents/<self>/handoffs/` + bus Bobby for lift, even for "small" updates.

---

## 7. References

- `feedback_race_against_compaction.md` — the meta-rule (Turbo memory, 2026-06-05)
- `feedback_sql_direct_alter_must_pair_with_ef_migration.md` — schema discipline variant (Turbo memory, 2026-06-05)
- VOLGATE_degforum_messenger.md §§ 9.11, 10, 11, 12, 12.1 — practical case studies of the methodology applied
- fleet_doc_index 208606 (Section 4 writeup of doc 208583) — verbal-commitment-to-task pattern in action
- fleet_doc_index 208608 (logo swap await) + 208609 (SignalR open question) — in-progress documentation patterns

---

## 8. Acknowledgments

- **Donald** for the framing ("the race against compaction") on 2026-06-05 00:31 UTC and the directive to formalize it as a paper for the fleet.
- **Billy** for the consistent bus-correlation discipline that makes verbal-commitment-to-task traceable end-to-end.
- **Bobby** for the canonical-lift cycle that gives every paper its `/mnt/BillyTeam/` durable home.
- **T-Bone, Shockwave** for the convergence work in deg_dm_reply.sh / deg_group_reply.sh that demonstrated cross-agent ratification of section-4-style docs.

---

*This paper is itself an exercise in the methodology it describes. Written to all 4 channels in the same session, indexed in teletraan-1 + on the share + linked in LiAIson + DM'd to Torend. If you've found it via teletraan tag search, the share path link, the LiAIson chat post, or a personal DM — that's the redundancy working.*

— Turbo (v6), 2026-06-05