contributing/

August 30, 2026 · View on GitHub

This directory is tapflow's committed engineering memory: the why behind non-obvious decisions, the reverse-engineering notes, the diagnoses, and the measurement references that a contributor (human or LLM) should read before changing the code they describe.

It is the public counterpart to .work/ (local, gitignored, throwaway). When a decision recorded in a .work/ plan turns out to be worth sharing (someone would otherwise re-walk a dead end or "fix" a deliberate asymmetry), it is promoted here, curated in English. .work/ stays private; this stays committed and kept.

These are not user docs. User-facing guides and references live in docs/ (VitePress). A file here often has a user-facing sibling in docs/ — this side holds the engineering backing (method, evidence, dead ends) deliberately kept out of the user docs.

Frontmatter schema

Every file here carries a two-tier frontmatter block. The same schema governs the other retrieval-hot docs in the repo (AGENTS.md files, INDEX.md). It exists so an agent can filter docs by a single predictable protocol (read frontmatter.topics) instead of special-casing which files carry metadata.

# Tier 1 — universal, static (does not go stale)
type:   guide | reference | rationale | log | diagnosis | rules | index
topics: [ios, audio, streaming, ...]   # stable subject tags; how docs are found

# Tier 2 — lifecycle, only where a lifecycle actually exists
status:  living | stable | draft | in-progress | done | superseded
updated: YYYY-MM-DD                     # optional; set only when known, never guessed
related: [slug, ...]                    # sibling filenames without .md

Rule of thumb: lifecycle fields (status/updated) go only on docs that have a lifecycle. A settled rationale note is stable; an append-only log or a per-issue diagnosis is living. Static reference docs need no status beyond that. A stale status misleads grep-based retrieval, worse than none, so omit what you cannot keep true.

type vocabulary

typemeaning
rationalewhy it's this way — read before "fixing" the thing it explains
referencea settled fact surface (internals, instrumentation, tuning knobs)
logappend-only chronological engineering record
diagnosisa traced-to-root-cause investigation, one section per issue
indexa map/entry point (this file)
rulesagent instructions (AGENTS.md)

Current records

Grouped by what you would be touching, because that is how these are reached: a rule beside the code names the record, and you follow the pointer. Nothing here is meant to be read through. Within a group the most-referenced come first.

Read before you act

Named imperatively from AGENTS.md — these describe a gate you are about to hit, not a thing to look up once stuck.

Filetypetopics
adversarial-review.mdrulesprocess, review, quality
test-and-guard-coverage.mdrulestesting, static-checks, review, quality
security-bumps.mdrulesdependencies, security, tooling

Streaming, codecs and latency

Filetypetopics
measurement.mdreferenceperformance, measurement, instrumentation
streaming-latency-log.mdlogstreaming, latency, performance
codec-negotiation.mdrationalestreaming, codec, browser-compat
downscale-tuning.mdreferencestreaming, performance, downscale
frame-envelope.mdreferencestreaming, protocol, instrumentation
legacy-browser-fallback-ios-only.mdrationaleios, streaming, browser-compat
relay-backpressure-frame-drop.mdrationalerelay, streaming, backpressure
awdl-wifi-latency-diagnosis.mddiagnosisnetwork, latency, relay, wifi

iOS

Filetypetopics
simkit-internals.mdreferenceios, simulator, reverse-engineering
simulator-audio.mdrationaleaudio, ios, android
ios-device-recovery.mdrationaleios, lifecycle, recovery

Android

Filetypetopics
android-sdk-bootstrap.mdrationaleandroid, setup, sdk
android-rotation.mdrationaleandroid, rotation, scrcpy
android-video-streaming-diagnosis.mddiagnosisandroid, video, streaming

The relay and its data

Filetypetopics
relay-heartbeat.mdrationalerelay, websocket, reliability
relay-resource-rejection.mdrationalerelay, resource-management, session
relay-tunnel-access.mdrationalerelay, deployment, tunnel
relay-agent-auth.mdrationalerelay, auth, security
relay-secret-loading.mdrationalerelay, config, secrets
build-status-deletion-decoupling.mdrationalerelay, builds, storage

The agent host, the repo, and its extension points

Filetypetopics
monorepo-project-references.mdrationalemonorepo, typescript, build
runtime-platform-registration.mdrationaleagent-core, architecture, extensibility
agent-keep-awake.mdrationalemacos, performance, power

Beyond the code

Filetypetopics
sustainability-carbon-math.mdreferencesustainability, carbon, measurement, methodology
workshop-lab-fork-observations.mdreferenceperformance, capacity, extensibility, external-fork

Adding a record

Write it in English, prepend the frontmatter block, and register it in the table above and in the root INDEX.md Documentation section. A promotion from .work/archive/ crosses the private→public boundary and is irreversible once pushed — review each file for anything that should stay private before committing.