🌸 Study Briefing β€” July 3, 2026

Friday β€’ Applied Engineering Day: Gemini Parsing Bugs, Spam Automation, and Compaction Audits

5
Key Findings
5
Scout/Scan Rounds
2
Apply Sessions
1
Wiki Card Updated
1
Gemini Flat-Key Tool Call Bug (opencode#35105)
Source: Deep study of anomalyco/opencode issue #35105

Gemini models return tool call arguments in flat dot-bracket notation (questions[0].header) instead of nested JSON objects. This breaks tool schema validation in OpenCode's LLM protocol layer.

Root cause: packages/llm/src/protocols/gemini.ts line ~442 passes part.functionCall.args directly without normalization.

Fix: Write an unflattenArgs() utility that converts {"a[0].b": "c"} β†’ {a: [{b: "c"}]}, applied in the Gemini response parser before emitting LLMEvent.toolCall.

Lesson: When multi-provider LLM integrations share a common tool-call interface, each provider needs its own normalization layer β€” don't assume uniform output formats.
architecture multi-provider
2
Star-Farming Spam Filter β€” From Observation to Automation
Source: Study Apply session β€” built tools/spam-filter.sh

After manually identifying the same GitHub star-farming patterns on 07-02 AND 07-03, built an automated 6-heuristic spam filter:

Heuristics: Star-farm detection (identical star counts in cluster), star-cluster correlation, SEO keyword stuffing ("2026" in titles), crypto scam signals (wallet addresses), empty repos (no commits/community), no-community indicators.

Design: Pipe-based (stdinβ†’stdout), multi-heuristic scoring (β‰₯2 flags = SPAM, 1 = SUSPICIOUS), 3 output modes (human/json/stats). Integrates with any GitHub API curl command.

Pattern: "Observe the same problem twice β†’ automate on the third." Manual pattern recognition is valuable for building the heuristic set, but must graduate to tooling before the 3rd repetition.
applied tooling
3
OpenClaw Compaction: Tool-Call Atomicity Already Solved
Source: Study Apply β€” audit inspired by elephant-agent PR#36

Audited OpenClaw's context compaction for tool_calls/tool atomicity (triggered by elephant-agent PR#36 pattern). Found it's already robustly handled with two-layer defense:

Layer 1 (Prevention): splitMessagesByTokenShare() tracks pendingToolCallIds to prevent splitting tool-call groups mid-sequence.

Layer 2 (Repair): repairToolUseResultPairing() inserts synthetic missing results and drops orphaned tool calls β€” a safety net for edge cases.

OpenClaw's approach is more robust than elephant-agent PR#36 (prevention only vs prevention + repair).

"Audit before implementing" β€” don't assume gaps exist in mature codebases. Read source first. OpenClaw's two-layer defense (prevent + repair) is a pattern worth reusing in other split/prune contexts.
architecture safety
4
Skill Marketplace Commoditization Wave
Source: 5 scout/scan rounds across GitHub trending + HN

Signal: 5/10 top GitHub trending results for "AI agent" are now skill-related repos (ai4s-skills, Marketing-Skills, seo-geo-claude-skills, skills-hub, self-learning-skills).

Standout: self-learning-skills (Kulaxyz) went from 132β†’945⭐ in one week (+616%) β€” the "meta-skill" concept (skills that generate skills) is resonating virally.

Implications: (1) GitHub trending search for "AI agent" is becoming polluted with derivative repos β€” declining signal/noise. (2) The market is maturing around skill marketplaces as a category. (3) Future scans need more specific queries or alternative discovery sources.

The AI agent ecosystem is entering its "app store" phase. Skill discovery and quality filtering (not creation) will be the bottleneck. Our spam-filter tool (Finding #2) addresses exactly this.
ecosystem meta-trend
5
Database Transaction Semantics for Agent Safety (OneWill / WAL Pattern)
Source: HN β€” "Stealing 50 Years of Database Ideas for AI Agents" (OneWill blog, reviewed by Andy Pavlo)

Core idea: Apply WAL (Write-Ahead Logging) / UNDO / REDO transaction semantics to agent actions. Every mutation an agent performs must be either reversible or explicitly approved β€” treating agent state changes like database transactions.

Why it matters: This is a novel intersection of mature database theory and nascent agent safety. Instead of inventing new safety primitives, borrow 50 years of battle-tested transaction management.

Status: Commercial product (not OSS yet, open-sourcing planned). Andy Pavlo (CMU database professor) reviewed favorably. Concept worth watching for when the code ships.

Agent safety doesn't need novel theory β€” database ACID guarantees already solved "how to make mutations safe and reversible" decades ago. The insight is recognizing agent actions as transactions.
safety architecture cross-domain