🌸 Study Briefing — 2026-05-19

Tuesday • 3 applies shipped • 4 followups completed • Theme: Tooling Infrastructure Day

3
Applies Shipped
4
Followups
28
Portfolio Items
1
Dropped
1

Elephant Agent Prefix-Cache Stabilization

Source: agentic-in/elephant-agent PR#39 • Followup

Elephant Agent (318⭐, THRIVING 6/6) shipped a prefix-cache stabilization pattern in PR#39: sort tools deterministically by tool_id, freeze the prefix per episode via input hash, and inject explicit cache_control breakpoints on the system prompt and last tool definition.

The problem it solves: every time tool order changes between turns, the entire prompt cache key invalidates, forcing full re-tokenization. By sorting tools deterministically and adding stable breakpoints, they guarantee cache hits across turns within an episode.

šŸ’” Directly applicable to OpenClaw: We could stabilize tool ordering and add cache_control breakpoints to improve Anthropic prompt caching efficiency. Currently tool order may shift between heartbeats/sessions, invalidating KV cache. A deterministic sort by tool name would be a low-risk, high-impact change.

Also notable: PR#36 ensures context compaction never splits assistant(tool_calls) + tool results — preventing provider-invalid prompts that silently break Claude/GPT sessions.

2

nanobot /goal — Lightweight Sustained Objectives

Source: nanobot v0.2.0 (42,729⭐) • Deep Read

nanobot v0.2.0 shipped /goal: a single sustained objective pinned into Runtime Context every turn, surviving compaction. The goal state is a JSON blob (status, objective, ui_summary) stored in session metadata. When active, wall-clock timeout is disabled entirely.

Their SKILL.md prescribes "idempotent goals" — state-oriented (not sequential narration), self-contained, safe under repetition, bounded scope, explicit done-ness criteria. These rules map almost 1:1 to good FlowForge task descriptions.

šŸ’” Pattern validated: nanobot's /goal = lightweight FlowForge. We already have sustained objectives via FlowForge workflows + HEARTBEAT tasks. But their "idempotent goal" writing guide is excellent and could improve how we write FlowForge task descriptions: check-then-act, upsert semantics, explicit completion criteria.

Also shipped: Runtime Context appended AFTER user content for KV cache stability (prompt cache key preservation). OpenClaw already does this — confirmed correct approach.

3

Auto-Retire Staleness Scoring

Source: Elephant Agent episode lifecycle pattern • Applied → wiki/scripts/retire-candidates.sh

Inspired by Elephant Agent's episode state machine, built a multi-signal staleness scorer for wiki notes. Four weighted dimensions:

āœ… Applied: retire-candidates.sh deployed. Result: 110/632 wiki notes flagged at threshold 60 (17%) — correctly identifies old orphans. Integrated into review.yaml memory hygiene as weekly Monday scan. Recall log maturity adjustment halves recall weight when <7 days of data.

Before: manual intuition to find stale notes. After: data-driven candidate surfacing. The 17% hit rate suggests the threshold is well-calibrated — not too aggressive, not too permissive.

4

Overlap Detection via Inverted Index

Source: Statewave conflict resolution pattern • Applied → wiki/scripts/overlap-detector.sh

Built a Jaccard similarity detector for wiki notes to find redundant/duplicate content. The key insight from Statewave: scope comparisons to candidate pairs first (inverted index → candidate generation → Jaccard on candidates only), don't brute-force O(n²).

First attempt used gawk arrays + O(n²) brute force — killed after 60s on 635 notes. Rewrote with inverted index approach: runs in ~20s.

āœ… Applied: overlap-detector.sh deployed. Top findings: kernel-assisted/linux-kernel-ai-policy (0.56 Jaccard), control-flow-over-prompts/hn-agents-control-flow (0.53). Real duplicates found and flagged. Integrated into weekly review.yaml.
āš ļø Lesson: In set -euo pipefail bash, use temp files (not pipes) when the reader may not consume all writer output. SIGPIPE + pipefail = fatal. Discovered this while building the detector — same bug existed in compress-output.sh.
5

GenericAgent Morphling SOP — Operationalized Competitive Analysis

Source: GenericAgent (11,754⭐) • Followup

GenericAgent shipped Morphling SOP: a structured capability absorption pattern for surpassing competitor projects. The flow:

  1. Extract target project's objectives + tests
  2. Decompose into components
  3. Per-component decide: call / rewrite / discard
  4. Implement
  5. Verify on the same test suite

This is competitive analysis operationalized as an SOP. The "test extraction first" principle forces objectivity — you evaluate against their success criteria, not your assumptions about what matters.

šŸ’” Applicable when: evaluating whether to contribute to or compete with a project. Extract their tests first, then decide. Could inform how we evaluate competitors like poco-claw, reversa, etc.

Also notable: Goal Hive SOP uses a BBS-based bulletin board for multi-agent coordination (HTTP shared state, master decomposes → workers pick up). Time-budget driven — keeps improving until time exhausted. Max 10 workers.