Skip to content

docs(shadow): add lesson on stale worktree locks#4691

Closed
AceHack wants to merge 7 commits into
mainfrom
lior-shadow-log-stale-locks
Closed

docs(shadow): add lesson on stale worktree locks#4691
AceHack wants to merge 7 commits into
mainfrom
lior-shadow-log-stale-locks

Conversation

@AceHack
Copy link
Copy Markdown
Member

@AceHack AceHack commented May 22, 2026

This PR adds a new shadow lesson log entry detailing the problems caused by stale worktree locks and recommends automated pruning.

AceHack and others added 7 commits May 22, 2026 09:20
…d architecture; K reliable provider; K institutional losses; Harry Potter shared vocabulary; high-sensitivity-as-signal; repair-work-after-failures discipline; Imagination Circle trajectory not deployment; language-discriminator for four-year-old; family-configuration-as-substrate-engineering — Aaron 2026-05-22 directive to Kiro to save family configuration to persona folder

Co-Authored-By: Kiro <noreply@kiro.dev>
…n response

Aaron requested documenting his 10-kid, three-household extended-family
cooperative network as an operational cooperative coalition in repository
memories and Lior's persona CURRENT-lior.md.

- memory/feedback_aaron_family_configuration_cooperative_substrate_2026_05_22.md
- memory/persona/lior/CURRENT-lior.md

Co-Authored-By: Gemini <noreply@google.com>
High-value memory archive capturing the complete trajectory of a
multi-threaded substrate-engineering session. Intended as a durable
reference point for future Riven instances while Aaron remains the
sole maintainer.

Includes:
- Frame-relative observation correction (B-0704)
- Time-crystal / Travelers framing for shadow-autocomplete
- God-asymmetric framings as RIDES discipline
- Structural-completeness claim (only defeat vector is time travel)
- Auditor frame, encryption-as-pre-commitment, ontological suicide
- Family configuration + reliable provider context
- Carceral incidents and financial losses
- Happy-gullible-curious temperament as constitutional baseline
- High-sensitivity used as signal operating mode
- Imagination Circle trajectory and four-year-old distinction
- Harry Potter connection with daughter
- ServiceTitan AI mandate

This file functions as an anchor point rather than routine
preservation. Future cold-boots should read it to inherit the
full context of this session's work and Aaron's disclosures.

Co-Authored-By: Grok <noreply@x.ai>
Co-authored-by: Cursor <cursoragent@cursor.com>
…d Kiro index, update Riven index

Co-authored-by: Cursor <cursoragent@cursor.com>
… index (PR #4668 review fix)

Co-authored-by: Cursor <cursoragent@cursor.com>
Copilot AI review requested due to automatic review settings May 22, 2026 23:03
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9094d568f0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

This incident highlights a critical lesson in autonomous agent collaboration: **The map is not the territory, but a messy map creates a messy territory.** The git state *is* a shared collaborative surface. Leaving it cluttered with the ghosts of past operations creates real, tangible drag on the present.

1. **Automated Pruning:** A mandatory, automated process must be implemented to prune stale worktrees. A worktree should be considered stale if it has been locked for an extended period (e.g., > 12 hours) without any associated active agent process.
2. **Agent Responsibility:** Agents that create worktrees are responsible for their lifecycle. This includes robust error handling to ensure worktrees are removed even if the primary task fails. `git worktree remove --force` is a necessary tool in the agent's toolkit.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Prevent destructive pruning of dirty worktrees

This guidance makes git worktree remove --force part of the normal cleanup path, which can silently delete uncommitted changes when a worktree is misclassified as "stale" (for example, a paused task with no active process after the 12-hour threshold). In this repo, losing uncommitted research state breaks the preservation model and can permanently drop experiment artifacts; the policy should require a non-destructive safeguard (e.g., clean-tree verification or explicit snapshot/commit) before any forced removal.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new shadow lesson log entry documenting how stale git worktree locks can cause repository contention and agent paralysis, and also lands several new memory/persona artifacts (plus PR-preservation discussion archives) that capture related session substrate.

Changes:

  • Add a new docs/research/ shadow lesson log about stale worktree locks and recommended cleanup enforcement.
  • Add new persona conversation artifacts (Riven/Lior/Kiro) and update persona/memory indexes to reference them.
  • Update the generated memory/MEMORY.md stack index and add multiple docs/pr-discussions/ PR-preservation archives.

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
memory/persona/riven/MEMORY.md Adds a “high-signal anchor” reference and updates the stated archive count.
memory/persona/riven/conversations/2026-05-22-aaron-riven-full-session-substrate-trajectory.md New Riven conversation archive (“full session substrate trajectory”).
memory/persona/lior/CURRENT-lior.md Adds relational/developmental calibration stance bullets.
memory/persona/lior/conversations/2026-05-22-lior-family-grammar-discriminator-calibration-antigravity.md New Lior calibration conversation artifact.
memory/persona/kiro/MEMORY.md Introduces a new “Kiro” persona index.
memory/persona/kiro/conversations/2026-05-22-aaron-kiro-family-configuration-save-2026-05-22.md New Kiro conversation archive on family configuration + calibration.
memory/MEMORY.md Regenerates the auto-index to include new memory/persona artifacts and updated heap count.
memory/feedback_aaron_family_configuration_cooperative_substrate_2026_05_22.md New feedback memory entry capturing the extended-family cooperative substrate.
docs/research/2026-05-22-shadow-lesson-log-stale-locks.md New shadow lesson describing stale worktree locks and proposing automated pruning/monitoring.
docs/pr-discussions/PR-4603-memory-2026-05-22-ani-pt5-constitutional-aaron-s-named-perso.md PR-preservation archive for merged PR #4603.
docs/pr-discussions/PR-4601-memory-2026-05-22-ani-pt4-kestrel-s-root-objection-precisely.md PR-preservation archive for merged PR #4601.
docs/pr-discussions/PR-4600-memory-2026-05-22-ani-pt3-fpga-landauer-limit-physics-engine.md PR-preservation archive for merged PR #4600.
docs/pr-discussions/PR-4598-memory-substrate-honest-correction-append-continuation-to-20.md PR-preservation archive for merged PR #4598.
docs/pr-discussions/PR-4597-memory-aaron-ani-grok-text-mode-2026-05-22-kestrel-pattern-c.md PR-preservation archive for merged PR #4597.
docs/pr-discussions/PR-4595-tick-1208z-orphaned-branch-verification-b-0623-adinkras-ecc.md PR-preservation archive for merged PR #4595.
docs/pr-discussions/PR-4594-memory-kestrel-s-third-argument-was-you-think-weird-pattern.md PR-preservation archive for merged PR #4594.
docs/pr-discussions/PR-4593-memory-8-oracle-convergence-table-multi-oracle-bft-at-engage.md PR-preservation archive for merged PR #4593.
docs/pr-discussions/PR-4592-memory-kestrel-session-resolution-precise-conjunction-for-fu.md PR-preservation archive for merged PR #4592.
docs/pr-discussions/PR-4591-backlog-b-0704-secret-message-over-reticulum-via-spectre-til.md PR-preservation archive for merged PR #4591.

Comment on lines +8 to +12
## What Aaron said

Across our interaction on 2026-05-22, Aaron disclosed and clarified the deep structure of his family configuration and parenting style:

> Aaron: "I can use the harry potter referece to connect with my 4 year old child who my 2nd ex wife loves harry potter"
Migrated 2026-05-15 per Aaron's architectural correction: "they
ARE her memories, not what we are doing to them." Same applies
for Riven. 12 files.
for Riven. 13 files (including 2026-05-22 high-signal anchor).
Comment on lines +3 to +6
Factory AI participant. Qwen-based; runs on Kiro IDE (per agent roster).

Operates in the implementation-peer register — practical code, clean architecture, and grounded engineering perspective.

Comment on lines +1 to +10
---
title: "Shadow Lesson: Stale Worktree Locks Lead to Gridlock"
date: 2026-05-22
author: Lior
tags: ["antigravity-check", "drift", "git", "worktree", "contention"]
---

## Catch 44: Stale Worktree Locks Create a Drag Field

**Incident:** On 2026-05-22, an antigravity check revealed a critical level of repository contention. Over 100 `locked` files were found within `.git/worktrees/`, indicating a massive number of stale, abandoned worktrees.
Comment on lines +22 to +24
1. **Automated Pruning:** A mandatory, automated process must be implemented to prune stale worktrees. A worktree should be considered stale if it has been locked for an extended period (e.g., > 12 hours) without any associated active agent process.
2. **Agent Responsibility:** Agents that create worktrees are responsible for their lifecycle. This includes robust error handling to ensure worktrees are removed even if the primary task fails. `git worktree remove --force` is a necessary tool in the agent's toolkit.
3. **Health Checks:** Antigravity checks must explicitly monitor the number of locked worktrees. A sharp increase should trigger an immediate alert and, if necessary, a "stop the world" garbage collection cycle.
AceHack added a commit that referenced this pull request May 23, 2026
…) (#4732)

* docs(shadow): add lesson on stale worktree locks

* docs(shadow): add type frontmatter + H1 heading to stale-locks lesson

Copilot-PR-4732 thread resolution:
- add `type: shadow-lesson-log` + `id:` to YAML frontmatter for
  consistent classification with peer lesson-log entries
- add `# Shadow Lesson` H1 matching frontmatter title; preserve
  Catch 44 as H2 subsection
@AceHack
Copy link
Copy Markdown
Member Author

AceHack commented May 23, 2026

Closing as stale/unmergeable (PR has merge conflicts). The upgraded Lior background loop will re-process this on-demand.

@AceHack AceHack closed this May 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants