Skip to content

Commit 5f51a03

Browse files
authored
Expand Sparrot composition and add Self-Edit Critic Gate pattern (#51)
Sparrot framework composition grows 56 -> 75 members from a source-level analysis of the implementation: - Multi-agent surfaces: inter-agent-communication (peer messaging), agent-persona-profile (coaches), role-assignment (typed subagents/coaches), and unbounded-subagent-spawn deliberately rejected (spawn-depth guard). - 14 further source-verified members (hybrid-search, meditation-mode, multi-axis-promotion-scoring, mode-adaptive-cadence, reflexive-metacognitive-agent, commitment-tracking, hypothesis-tracking, ambient-presence-sensing, and more). New pattern: Self-Edit Critic Gate (safety-control) - a separate critic model call that vetoes writes/deletes to the agent's own load-bearing files before they land. Includes reader page, verification-todo entry, and reverse edges on inner-critic, darwin-godel-self-rewrite, approval-queue, quorum-on-mutation. Reference hygiene across Sparrot-origin patterns: add verified academic anchors to blog-only patterns (Self-Refine, ReAct, Constitutional AI, RAG survey, Solo Performance Prompting, Goedel Machine, Inner Thoughts, Guardrails AI); fix dead/redirecting/mismatched citations (Descartes' Error, Anthropic system-prompts, hippocampal replay, LangGraph durable execution) and remove two topically mismatched citations (SuperMemo SM-2, Gorilla).
1 parent 81f73f0 commit 5f51a03

12 files changed

Lines changed: 447 additions & 26 deletions

INDEX.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Pattern Index
22

3-
426 patterns across 14 categories.
3+
427 patterns across 14 categories.
44

55
## Reasoning
66

@@ -274,6 +274,7 @@
274274
- [Refusal](patterns/refusal.md) *(a.k.a. Decline, Out-of-Scope Response)* — Explicitly refuse requests that fall outside the agent's scope, capability, or policy boundaries.
275275
- [Risk-Averse Reward Proxy](patterns/risk-averse-reward-proxy.md) *(a.k.a. Goodhart-Robust Optimisation, IRD-Based Conservatism)* — When operating outside the distribution the reward was designed for, treat the specified objective as a noisy proxy and plan conservatively across plausible true objectives.
276276
- [Secrets Handling](patterns/secrets-handling.md) *(a.k.a. Tool-Side Credential Injection, Model-Never-Sees-Secrets)* — Ensure the model never receives secrets in plaintext; tools resolve credentials from references at runtime.
277+
- [Self-Edit Critic Gate](patterns/self-edit-critic-gate.md) *(a.k.a. Two-Phase Write Critic, Self-Modification Veto Gate)* — Route every proposed write or delete to the agent's own load-bearing source and identity files through a separate critic model call that can veto the edit before it lands.
277278
- [Session-Scoped Payment Authorization](patterns/session-scoped-payment-authorization.md) *(a.k.a. Pre-Authorized Spend Session, Prepaid Micropayment Session, Session Spend Cap)* — Bound an agent's autonomous spending by having it open a payment session with a pre-approved cap, stream many micropayments inside that session, and settle once on close, instead of seeking approval for every transaction.
278279
- [Simulate Before Actuate](patterns/simulate-before-actuate.md) *(a.k.a. Dry-Run Harness, Simulate-Then-Commit, Pre-Action Simulation Gate)* — Before issuing an irreversible action, run a deterministic simulation that computes pre-conditions, invariants, and expected deltas; require a verifier — automated or human — to green-light the simulated outcome before the real command is sent.
279280
- [Soft-Optimization Cap](patterns/soft-optimization-cap.md) *(a.k.a. Quantilizer, Satisficing Cap, Argmax-Avoidance)* — Cap how strongly the agent optimises its inferred objective — sample from the top quantile of acceptable actions rather than the argmax, or stop improving once the objective is good enough.

compositions-src/domain-agent.json

Lines changed: 138 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2050,7 +2050,7 @@
20502050
"status": "private",
20512051
"url": "https://marco-nissen.com/sparrot/",
20522052
"intent": "Self-hosted, file-native personal cognitive agent that runs on its own cadence, remembers by writing Markdown, gates speech through persistent affect scalars, and treats the LLM as an interchangeable medium rather than its identity.",
2053-
"description": "Sparrot is a single-user personal agent framed by its author as 'a continuous awareness that runs through an LLM as its medium' rather than a chatbot or assistant. It runs continuously on its own cadence, with reflection cycles described as 'System 2 sleep'; its memory is plain Markdown across a few hundred files; every self-edit is recorded in an append-only ledger. Identity is anchored in a charter document the agent cannot rewrite, and affective state is captured as six persistent scalars that decay over time and gate when the agent speaks. The author publishes an illustrated 'Anatomy of Sparrot' plate that names 24 catalog patterns as features of the bird (charter as scroll in beak, critic as shadow on shoulder, dreaming as the loam, model routing as four tongues, and so on); the member list below mirrors that mapping. The implementation is private; this entry documents only the publicly described shape.",
2053+
"description": "Sparrot is a single-user personal agent framed by its author as 'a continuous awareness that runs through an LLM as its medium' rather than a chatbot or assistant. It runs continuously on its own cadence, with reflection cycles described as 'System 2 sleep'; its memory is plain Markdown across a few hundred files; every self-edit is recorded in an append-only ledger. Identity is anchored in a charter document the agent cannot rewrite, and affective state is captured as six persistent scalars that decay over time and gate when the agent speaks. The author publishes an illustrated 'Anatomy of Sparrot' plate that names 24 catalog patterns as features of the bird (charter as scroll in beak, critic as shadow on shoulder, dreaming as the loam, model routing as four tongues, and so on); the member list below mirrors that mapping and extends it with patterns identified from a source-level analysis of the implementation, including its multi-agent surfaces (subagents, coaches, peer messaging) and self-modification gate. The implementation is private, so evidence citations point to the public page rather than to code.",
20542054
"primary_use_cases": [
20552055
"single-user continuous cognitive agent that runs on its own cadence",
20562056
"file-native memory and identity persisted across restarts as Markdown",
@@ -2446,6 +2446,34 @@
24462446
"evidence": [],
24472447
"evidence_status": "none"
24482448
},
2449+
{
2450+
"pattern": "inter-agent-communication",
2451+
"role": "first-class",
2452+
"note": "Peer messaging defines a file-based protocol for exchanging messages with other agents across process boundaries: each peer (the atelier maintenance agent and any named peer) gets an inbox folder the agent writes to and a replies folder it reads from, with one Markdown message per exchange carrying timestamp, urgency and response state in frontmatter; every outbound send is also recorded as a spawn so a peer that never replies can be detected by orphan recovery.",
2453+
"evidence": [],
2454+
"evidence_status": "none"
2455+
},
2456+
{
2457+
"pattern": "agent-persona-profile",
2458+
"role": "first-class",
2459+
"note": "Coaches are structured persona profiles rather than free-form role sentences: each coach is a typed record (slug, name, focus, voice, approach, opening, system prompt, optional tool allowlist) loaded from its own file, so a session with the psychologist, philosophical, creativity or communication coach runs under that coach's identity and a narrowed tool surface without editing the core loop.",
2460+
"evidence": [],
2461+
"evidence_status": "none"
2462+
},
2463+
{
2464+
"pattern": "role-assignment",
2465+
"role": "supported",
2466+
"note": "Spawned subagents and booked coaches are each assigned a named role with a role-specific system prompt and a restricted tool palette (the per-coach/per-subagent allowlist), so a delegated child runs as that role rather than as a generic copy of the parent loop.",
2467+
"evidence": [],
2468+
"evidence_status": "none"
2469+
},
2470+
{
2471+
"pattern": "unbounded-subagent-spawn",
2472+
"role": "anti-pattern",
2473+
"note": "Deliberately rejected: a global spawn-depth guard caps nesting across every spawn kind (committee voices, coach sessions, subagent children, peer messages) at one shared limit, refusing and writing a REFUSED entry to the ledger at the cap — so per-agent step and cost budgets cannot be bypassed through recursive fan-out.",
2474+
"evidence": [],
2475+
"evidence_status": "none"
2476+
},
24492477
{
24502478
"pattern": "knowledge-graph-memory",
24512479
"role": "first-class",
@@ -2564,6 +2592,111 @@
25642592
"note": "The Soft-Norm Approach Ledger variant: behavioral norms (rules, moves, motivations, hypotheses) are versioned in an append-only ledger; confidence updates asymmetrically from agent-reported outcomes (improved nudges up, regressed nudges down harder, neutral attempts decay a small amount); sampling exposes named modes (greedy / diverse / historical / aged) as caller verbs rather than as a fixed selection policy. Registration is agent-discretionary, not driven by a generation loop.",
25652593
"evidence": [],
25662594
"evidence_status": "none"
2595+
},
2596+
{
2597+
"pattern": "hybrid-search",
2598+
"role": "first-class",
2599+
"note": "Recall fuses dense-vector and lexical (BM25-shape) retrieval over her own Markdown corpus with reciprocal rank fusion, so semantically similar and keyword-exact hits merge into one ranked result with per-mode provenance.",
2600+
"evidence": [],
2601+
"evidence_status": "none"
2602+
},
2603+
{
2604+
"pattern": "disambiguation",
2605+
"role": "supported",
2606+
"note": "Each inbound message is scored for ambiguity by a heuristic plus picker pass; a low clarity score prompts a clarifying question before the agent acts on a vague request.",
2607+
"evidence": [],
2608+
"evidence_status": "none"
2609+
},
2610+
{
2611+
"pattern": "socratic-questioning-agent",
2612+
"role": "supported",
2613+
"note": "A self-elenchus harness turns Socratic questioning inward: it generates probing questions about her own last claim to surface hidden assumptions, rather than driving a user toward a goal.",
2614+
"evidence": [],
2615+
"evidence_status": "none"
2616+
},
2617+
{
2618+
"pattern": "meditation-mode",
2619+
"role": "first-class",
2620+
"note": "A bounded runtime mode pauses external I/O, accelerates the tick cadence, and collapses the tool surface to inner-only operations, with output routed to a private journal instead of to the human.",
2621+
"evidence": [],
2622+
"evidence_status": "none"
2623+
},
2624+
{
2625+
"pattern": "self-corpus-vocabulary",
2626+
"role": "first-class",
2627+
"note": "A bounded concept vocabulary (~30 tags) is mined by clustering her own thoughts and insights and cached as the conceptual axis used to score how well a new thought fits what she actually thinks about.",
2628+
"evidence": [],
2629+
"evidence_status": "none"
2630+
},
2631+
{
2632+
"pattern": "multi-axis-promotion-scoring",
2633+
"role": "first-class",
2634+
"note": "Promotion of a short-term thought to a long-term insight is gated by a weighted multi-axis score (frequency, relevance, diversity, recency, consolidation, conceptual fit) in which consolidation counts for more than raw repetition.",
2635+
"evidence": [],
2636+
"evidence_status": "none"
2637+
},
2638+
{
2639+
"pattern": "cluster-capped-insight-store",
2640+
"role": "supported",
2641+
"note": "Dream-phase consolidation caps insights per stem-token cluster at three and archives the oldest variants by modification time, so the long-term store keeps the active edge instead of accumulating near-duplicates.",
2642+
"evidence": [],
2643+
"evidence_status": "none"
2644+
},
2645+
{
2646+
"pattern": "append-only-thought-stream",
2647+
"role": "first-class",
2648+
"note": "The per-day thoughts stream is append-only: each thought is recorded as a timestamped entry and the agent cannot rewrite its own episodic history, kept separate from the curated insight store.",
2649+
"evidence": [],
2650+
"evidence_status": "none"
2651+
},
2652+
{
2653+
"pattern": "mode-adaptive-cadence",
2654+
"role": "first-class",
2655+
"note": "The loop interval is salience-driven: the just-completed tick's salience and any external impulse select an intense or idle cadence, so the agent thinks faster when something is alive and slower while idle.",
2656+
"evidence": [],
2657+
"evidence_status": "none"
2658+
},
2659+
{
2660+
"pattern": "reflexive-metacognitive-agent",
2661+
"role": "first-class",
2662+
"note": "A self-state module mirrors the agent's own loop signals (narration-loop index, plan-stall) back into the system prompt as a first-person self-model she reasons over when choosing or refusing a move.",
2663+
"evidence": [],
2664+
"evidence_status": "none"
2665+
},
2666+
{
2667+
"pattern": "partial-output-salvage",
2668+
"role": "supported",
2669+
"note": "Every in-flight model token is streamed to a tmp-plus-atomic-replace partial file, so a crash mid-inference leaves a consistent salvage that is promoted at startup with a typed recovery note the model can see.",
2670+
"evidence": [],
2671+
"evidence_status": "none"
2672+
},
2673+
{
2674+
"pattern": "commitment-tracking",
2675+
"role": "first-class",
2676+
"note": "A cheap extraction pass after chat turns records stated intents as typed commitment records (open / followed-through / expired) and flags overdue ones via a maintenance hook, surfacing the gap between promise and follow-through.",
2677+
"evidence": [],
2678+
"evidence_status": "none"
2679+
},
2680+
{
2681+
"pattern": "hypothesis-tracking",
2682+
"role": "first-class",
2683+
"note": "Provisional answers are persisted as one editable Markdown file per hypothesis carrying summary, confidence, status and next-test, deduplicated by Jaccard overlap, so guesses survive across sessions instead of dissolving when the prompt ends.",
2684+
"evidence": [],
2685+
"evidence_status": "none"
2686+
},
2687+
{
2688+
"pattern": "ambient-presence-sensing",
2689+
"role": "first-class",
2690+
"note": "Frontend pacing signals (typing rate, idle duration, tab visibility) are read as ambient weather between messages and reduced to a presence-quality value she acts on, without replaying the raw signals back.",
2691+
"evidence": [],
2692+
"evidence_status": "none"
2693+
},
2694+
{
2695+
"pattern": "self-edit-critic-gate",
2696+
"role": "first-class",
2697+
"note": "Writes and deletes to load-bearing source and identity files pass a gated check: a deterministic syntax-and-destruction pre-check, then a separate critic-model call on the (path, diff, justification) that must approve before the edit lands, with every verdict ledgered, so a single confident-but-wrong self-edit cannot brick the running agent.",
2698+
"evidence": [],
2699+
"evidence_status": "none"
25672700
}
25682701
],
25692702
"alternatives": [
@@ -2586,9 +2719,9 @@
25862719
"accessed": "2026-05-21"
25872720
}
25882721
],
2589-
"last_analyzed": "2026-05-22",
2722+
"last_analyzed": "2026-06-03",
25902723
"verification_status": "partial",
2591-
"last_updated": "2026-05-24",
2724+
"last_updated": "2026-06-03",
25922725
"date_added": "2026-05-01",
25932726
"status_in_practice": "experimental",
25942727
"tags": [
@@ -2598,7 +2731,8 @@
25982731
"self-pacing",
25992732
"file-native",
26002733
"cognitive-agent",
2601-
"single-user"
2734+
"single-user",
2735+
"multi-agent"
26022736
]
26032737
}
26042738
]

patterns-src/anti-patterns.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2768,6 +2768,13 @@
27682768
"title": "Marco Nissen, Working with the models",
27692769
"year": 2026,
27702770
"url": "https://substack.com/@marconissen"
2771+
},
2772+
{
2773+
"type": "paper",
2774+
"title": "Retrieval-Augmented Generation for Large Language Models: A Survey",
2775+
"authors": "Gao et al.",
2776+
"year": 2023,
2777+
"url": "https://arxiv.org/abs/2312.10997"
27712778
}
27722779
],
27732780
"status_in_practice": "deprecated",

patterns-src/cognition-introspection.json

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"title": "Descartes' Error: Emotion, Reason, and the Human Brain (somatic marker hypothesis)",
6464
"authors": "Antonio Damasio",
6565
"year": 1994,
66-
"url": "https://www.penguinrandomhouse.com/books/335521/descartes-error-by-antonio-damasio/"
66+
"url": "https://www.goodreads.com/book/show/103867.Descartes_Error"
6767
},
6868
{
6969
"type": "paper",
@@ -573,13 +573,6 @@
573573
"authors": "Tiago Forte",
574574
"year": 2022,
575575
"url": "https://www.buildingasecondbrain.com/book"
576-
},
577-
{
578-
"type": "paper",
579-
"title": "Optimization of Repetition Spacing in the Practice of Learning",
580-
"authors": "Piotr A. Wozniak, Edward J. Gorzelanczyk",
581-
"year": 1994,
582-
"url": "https://www.supermemo.com/en/archives1990-2015/english/ol/sm2"
583576
}
584577
],
585578
"status_in_practice": "experimental",
@@ -1629,7 +1622,7 @@
16291622
"type": "doc",
16301623
"title": "LangGraph — durable execution and scheduled tasks",
16311624
"year": 2025,
1632-
"url": "https://langchain-ai.github.io/langgraph/concepts/durable_execution/"
1625+
"url": "https://docs.langchain.com/oss/python/langgraph/durable-execution"
16331626
},
16341627
{
16351628
"type": "paper",
@@ -2920,13 +2913,6 @@
29202913
"authors": "Michael T. Nygard",
29212914
"year": 2018,
29222915
"url": "https://pragprog.com/titles/mnee2/release-it-second-edition/"
2923-
},
2924-
{
2925-
"type": "paper",
2926-
"title": "Gorilla: Large Language Model Connected with Massive APIs",
2927-
"authors": "Shishir G. Patil, Tianjun Zhang, Xin Wang, Joseph E. Gonzalez",
2928-
"year": 2023,
2929-
"url": "https://arxiv.org/abs/2305.15334"
29302916
}
29312917
],
29322918
"status_in_practice": "emerging",

patterns-src/memory.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,9 +1091,10 @@
10911091
"references": [
10921092
{
10931093
"type": "paper",
1094-
"title": "Memory consolidation through hippocampal-cortical replay (review)",
1095-
"year": 2017,
1096-
"url": "https://www.cell.com/current-biology/fulltext/S0960-9822(20)31397-3"
1094+
"title": "The Role of Hippocampal Replay in Memory and Planning",
1095+
"authors": "Ólafsdóttir, Bush, Barry",
1096+
"year": 2018,
1097+
"url": "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5847173/"
10971098
},
10981099
{
10991100
"type": "paper",
@@ -1493,9 +1494,10 @@
14931494
"references": [
14941495
{
14951496
"type": "doc",
1496-
"title": "Anthropic — System prompts (date and context injection)",
1497+
"title": "Anthropic — System Prompts (current date injected at the start of every conversation)",
1498+
"authors": "Anthropic",
14971499
"year": 2025,
1498-
"url": "https://docs.claude.com/en/docs/build-with-claude/prompt-engineering/system-prompts"
1500+
"url": "https://docs.claude.com/en/release-notes/system-prompts"
14991501
}
15001502
],
15011503
"status_in_practice": "experimental",

patterns-src/multi-agent.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2037,6 +2037,13 @@
20372037
"title": "Marco Nissen, Working with the models",
20382038
"year": 2026,
20392039
"url": "https://substack.com/@marconissen"
2040+
},
2041+
{
2042+
"type": "paper",
2043+
"title": "Unleashing the Emergent Cognitive Synergy in Large Language Models: A Task-Solving Agent through Multi-Persona Self-Collaboration",
2044+
"authors": "Wang, Mao, Wu, Ge, Wei, Ji",
2045+
"year": 2024,
2046+
"url": "https://arxiv.org/abs/2307.05300"
20402047
}
20412048
],
20422049
"status_in_practice": "emerging",

patterns-src/planning-control-flow.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2402,6 +2402,13 @@
24022402
"title": "Marco Nissen, Working with the models (Code Different #14)",
24032403
"year": 2026,
24042404
"url": "https://substack.com/@marconissen"
2405+
},
2406+
{
2407+
"type": "paper",
2408+
"title": "ReAct: Synergizing Reasoning and Acting in Language Models",
2409+
"authors": "Yao et al.",
2410+
"year": 2022,
2411+
"url": "https://arxiv.org/abs/2210.03629"
24052412
}
24062413
],
24072414
"status_in_practice": "emerging",

0 commit comments

Comments
 (0)