Skip to content

Dog-fooding agent-doc Part 3: YouTube Upload in Rust, tmux-router Tests, and JetBrains Plugin IPC

Brian Takita
Authors:Brian Takita
Posted on:March 13, 2026

Building developer tools live with AI — implementing YouTube's resumable upload protocol in Rust, writing 61 tmux-router tests, wiring JetBrains plugin IPC for real-time document patching, and reflections on chaos, consciousness, and vibe coding.

Dog-fooding agent-doc Part 3: YouTube Upload in Rust, tmux-router Tests, and JetBrains Plugin IPC

This is Part 3 of my dog-fooding series where I build features live using agent-doc as the development surface. The whole point of dog-fooding is that I'm using the tool I'm building to build the tool — and the rough edges I hit become the next features I ship.

This session covers a lot of ground: implementing YouTube's resumable upload protocol in corky (my Rust correspondence toolkit), comprehensive test coverage for tmux-router, and a significant architectural shift in the JetBrains plugin — moving from direct file modification to IPC-based patch delivery.

Note: The screen capture had a slight offset that clipped the top of the editor window — OBS + XSHM + HiDPI misalignment. Cropped to fit, but you'll notice the top edge is cut off in places. Fixed for next time with PipeWire capture.

YouTube Resumable Upload in Rust

The session opens with implementing YouTube video upload directly in corky. The goal: this very video gets uploaded using the API we're building during the recording. There's a nice bootstrapping quality to it.

Key technical details:

  • Resumable upload protocol — YouTube's API uses a two-phase approach: initiate the upload to get a session URI, then send the video data in chunks
  • Config consolidation — Merged profiles.toml into a single .corky.toml config file, reducing configuration surface area
  • Multi-platform publish — Released to crates.io, PyPI (via maturin), and GitHub Releases with prebuilt binaries

The YouTube upload feature is part of corky's broader correspondence toolkit vision — manage email, social media, and other communication channels from a single Rust CLI.

agent-doc Mode System: Append, Template, and Stream

A significant chunk of this session dealt with formalizing agent-doc's mode system. The existing agent-doc-mode field was getting deprecated in favor of two separate concerns:

Old Mode New Format New Write Strategy
append append merge
template template merge
stream stream CRDT

This separation of format (how the document is structured) from write strategy (how changes are applied) is cleaner. The CRDT write strategy for stream mode is particularly interesting — instead of overwriting the file, changes get applied as conflict-free patches. This enables real-time collaboration between the CLI tool and editor plugins.

61 tmux-router Tests: Layout Reconciliation Done Right

The tmux-router component manages terminal layouts for agent-doc sessions. During this session, we discovered that join-pane was hard-coded to horizontal splits regardless of the desired layout — the reorder phase would eventually correct this by breaking and rejoining with target flags, but it was wasteful.

The fix led to a comprehensive test suite:

  • Layout reconciliation — ensuring pane arrangements match the declared layout
  • Anchor positioning — first pane sync and correct anchor placement
  • Join flag logic — horizontal vs. vertical splits applied correctly from the start
  • Migration paths — testing transitions between layout configurations

61 tests passing. Tests don't affect the release, but they prevent the kind of layout bugs that make the tool feel unreliable.

JetBrains Plugin IPC: No More Cursor Jumping

This was the most architecturally significant change in the session. The JetBrains plugin had a cursor-jumping problem: when agent-doc modified a file externally, IntelliJ's file change detection would briefly move the cursor to the change region before snapping back.

The solution was to stop modifying files externally altogether:

  1. agent-doc writes a patch file — JSON patch to a designated location instead of modifying the document directly
  2. The plugin watches for patches — Extended the virtual file listener to watch for patch files
  3. Plugin applies changes internally — When a patch file appears, the plugin reads the JSON, opens a write action on the document, and applies changes through IntelliJ's own document API

No external file modification means no cursor jump. No sidecar process needed.

This architecture also sets up a cross-editor plugin specification. Since each editor has its own implementation of patch application, having a well-defined JSON patch format means we can write a reference implementation with a virtual editor and verify that every plugin (JetBrains, VS Code, Neovim) conforms to spec.

There's a thread running through this session about integrating Existence Lang with the development workflow. The idea: use tag-path to decompose variable names and abstractions into semantic tags, then map those tags to an ontology.

The ontology becomes a dictionary. You can search for terms, get autocomplete through agent-doc, and find ontology hits inside your codebase. Combined with sift (semantic code search), this creates a system where your code's vocabulary is grounded in a formal ontology.

On Vibe Coding, Chaos, and Consciousness

The philosophical core of this session — and honestly, of the whole dog-fooding series — is about dealing with chaos directly rather than deferring it.

When you try to make everything super incremental, things get lost. You need project managers. Stuff gets forgotten and deprioritized and you lose coherence in your system. If you don't deal with the chaos as it comes up, you defer it to later. You put nice boxes around it, but the chaos is still there. It doesn't go away just because you deprioritize it.

This is Jung's shadow applied to software: the shadow factory pipeline. Every deferred mess, every "we'll clean this up later" — that's shadow creation in action.

Programming in Different States of Mind

I actually encourage people to program in different states of mind. Consciousness operates on different levels — limbic system, reptilian brain, cerebral cortex, all processing differently. Like an artist squinting at a painting to see outlines and colors differently, if you can experience your codebase through different states of consciousness, you retain memories from each state and see things from almost completely different perspectives.

It's like having multiple viewpoints. You get bigger-picture thinking. You synthesize things in different ways and see angles you'd miss otherwise.

This connects directly to vibe coding. I'm not a super-planner who gets the file format perfect on the first pass. I'm more of a vibey guy — I iterate, I synthesize in real-time, I let intuition guide the fast-paced logic. Vibe coding is perfect for that temperament. But I want to take it to the next level: not just vibes, but vibes grounded in ontology and creative logic.

Expansion and Contraction

Expanding consciousness isn't just about going wider. It's also contraction — because even in the small, contracted state you can see things you can't see in the expanded state. Like Byzantine art where there are no shadows because you're seeing in God's view, everything at once.

We're tied to existence. We have time, at least in the system we're in. And working within those constraints — expanding and contracting, dealing with chaos as it arises, programming in different states of mind — that's how you build systems that maintain coherence.

What Shipped

  • corky — YouTube resumable upload, config consolidation (profiles.toml -> .corky.toml)
  • agent-doc v0.17.0 — Mode system refactor (format + write strategy), tmux-router bug fixes
  • JetBrains plugin v0.2.1 — IPC-based patch delivery, cursor jump fix
  • tmux-router — 61 tests covering layout reconciliation, anchor positioning, join flag logic
  • Published to crates.io, PyPI, and GitHub Releases

Watch the Series