TimeWraith User Guide: Self-Hosted Time-Bug Hunts, Setup, and Practical Limitations
How to install and run TimeWraith locally with Docker, connect your Kiro Crew, interpret investigation outcomes and eight fix gates, tune budgets, and understand where the tool stops.
Date and time bugs rarely fail in UTC on an ordinary Tuesday. They surface during 2:00 AM daylight saving fall-back hours, 30-minute fractional shifts like Australia/Lord_Howe, leap days, and month-end rollovers. TimeWraith is a self-hosted regression investigator that sweeps public GitHub repositories across 13 IANA time zones inside isolated Docker containers—and refuses to call a bug real or a fix verified unless deterministic code proves it.
1. What TimeWraith Does
TimeWraith splits responsibility cleanly: Kiro agents propose, plain code referees. You give it a public GitHub URL and a branch, tag, or commit SHA. The backend orchestrates a six-stage pipeline:
- Repository inspection (Code): clones the pinned commit with hardened Git settings (hooks, submodules, LFS, and symlinks disabled) and writes a capability report.
- Discovery (Bat Scout): reviews scanner candidates for clock reads, date arithmetic, and zone conversions, keeping up to 15 suspects with concrete line citations. Code drops unresolved citations.
- Experiment design (Pumpkin Mechanic): writes a small adapter per candidate and picks invariants from a fixed catalog. After dependency install, code checks the adapter at ordinary baseline instants in
UTCandAmerica/New_York; broken adapters go through an automated repair loop before any sweep starts. - Controlled execution (Code, No-Network Docker): sweeps roughly 2,600 clock points per experiment across 13 IANA zones covering 2024–2026 DST boundaries, month ends, leap day, and anchor dates.
- Independent verification (Raven Archivist): violations that repeat 3/3 in clean containers are checked against the repository’s own tests and docs, then probed live by Raven. A defect only counts if code reproduces it 3/3 at the failing point, passes a control point, and confirms a generated regression test fails with an assertion on the unmodified code.
- Optional fix & eight gates (Doctor Stitch): Doctor Stitch works through TimeWraith’s scoped MCP tools to edit source code and submit a patch. Code applies only that
git diffto a fresh clean copy and runs eight sequential gates before marking the fix verified.
2. Quick Start with Docker
TimeWraith requires Docker Desktop 4.29+ (Linux-container mode on Windows/macOS) or Docker Engine 26+ on Linux. Nothing else needs to be installed on your host machine.
Option A: Run the prebuilt image (no clone required)
docker run -d --name timewraith --restart unless-stopped -p 127.0.0.1:8787:8787 \
--label com.docker.compose.project=timewraith \
--label com.docker.compose.service=app \
-v timewraith-data:/data \
-v /var/run/docker.sock:/var/run/docker.sock \
ghcr.io/tumblerwarren/timewraith-kiroween:latestOn Windows PowerShell, replace the trailing \ line continuations with backticks (`). Once started, open http://localhost:8787. The image preloads four finished cases (rrule, cron-parser, node-cron, and date-fns) so you can inspect real findings, regression tests, and decision records immediately without signing in or spending credits.
Option B: Run from source with Docker Compose
git clone https://github.com/TumblerWarren/timewraith-kiroween.git
cd timewraith-kiroween
docker compose up -d --buildOn Linux hosts, pass the group ID owning the Docker socket so the app container can launch throwaway test sandboxes:
DOCKER_GID=$(stat -c %g /var/run/docker.sock) docker compose up -d --buildSecurity note: TimeWraith binds to 127.0.0.1:8787 only because the local API has no login and talks to the Docker socket to spawn sandboxes. Never expose port 8787 directly to a public network.3. Setting Up the Kiro Crew & GitHub
To run live hunts on new repositories, open the Crew Setup page inside TimeWraith (#/crew). The readiness board walks through three steps:
- Docker check: confirms the engine can start throwaway containers.
- Start Kiro Crew container: pulls and starts
ghcr.io/kirodotdev/kirocrew:stablelocked down with--cap-drop ALL,no-new-privileges, 2 GB RAM, 256 PIDs, and zero mounted repositories. - Sign in to Kiro: choose Google, GitHub, or AWS Builder ID. TimeWraith prints a one-time device code and approval link; approve in your browser and the session persists in the
timewraith-crew-homeDocker volume.
Optional GitHub sharing: GitHub sign-in lives inside a separate timewraith-git container so Kiro agents never have access to your GitHub token. Even after signing in, TimeWraith never pushes automatically—you must accept a verified fix, run the repository contribution check (CONTRIBUTING, PR template, lint/typecheck, upstream merge check), and explicitly confirm the branch name before pushing to your fork.
4. Running Your First Investigation
- Open New Case and paste a public GitHub repository URL (for example,
https://github.com/kelektiv/node-cron) and a branch, tag, or commit SHA (such asmain). - Choose whether to pause for Plan Approval (recommended for your first run so you can review Bat Scout’s suspects and Pumpkin Mechanic’s adapters before sweeping) or enable automatic execution.
- Monitor progress on the Case page: watch discovery, dependency install (with automatic self-healing retries if Node version or lockfile flags conflict), the 13-zone sweep, and Raven’s verification probes in real time.
- Open the Activity and Findings tabs to inspect every
DecisionRecord—showing which source lines were cited, which citations were dropped, and which code rule decided each step. - If a bug is reproduced and Doctor Stitch produces a verified fix, review the unified diff and eight-gate checklist before choosing Accept (to export a local branch or
.patchfile) or Reject.
5. Outcomes, Eight Gates & Session Budgets
TimeWraith separates honest terminal states rather than collapsing everything into "pass" or "fail":
| Outcome | What it means |
|---|---|
| Bugs reproduced · Fixes verified | One or more violations repeated 3/3 in clean containers, failed a generated regression test, and (where fixed) passed all 8 gates. |
| Intended behaviour only | A rule broke, but a passing repository test or existing doc line confirms the behavior is deliberate—listed for transparency, never patched. |
| No anomaly observed | Enough experiments ran (at least 70% by default) and every checked invariant held across all 13 zones. |
| Inconclusive | Too few experiments could execute (for example, missing runtime APIs such as Temporal), so TimeWraith refuses to call the repo clean. |
| No safe fix found | Doctor Stitch exhausted 3 attempts without passing all 8 gates. The reproduced bug and failing regression test are still preserved. |
| Agents stopped | Your Kiro account hit its usage limit mid-run; unverified findings are not reported as clean. |
The eight fix gates (run cheapest first on a clean copy)
test_first— original violation repeated 3/3 and generated regression test fails on unmodified code.diff_limits— at most 3 files and 60 changed lines, with zero edits to tests, configs, lockfiles, or CI files.fixed— regression test passes 3/3 and all 13 zones satisfy the invariant.mutation_check— reverting only the source edit makes the regression test fail again.no_regressions— the repository’s own full test suite introduces no new failures.no_new_anomalies— no other experiment in the case exhibits a new violation.static_checks— the project’s TypeScript (tsc) and ESLint checks do not newly fail.independent_review— Raven Archivist inspects the diff and regression test blind, without seeing Doctor Stitch’s explanation.
6. Configuration & Environment Variables
Every runtime limit can be overridden with TW_* environment variables (or a backend/.env file when running from source):
| Variable | Default | Purpose |
|---|---|---|
TW_PORT | 8787 | Localhost HTTP port bound by Docker Compose |
TW_AGENT_RUNTIME | auto | auto (Kiro Crew when signed in, else stub), stub, or command |
TW_INVESTIGATION_BUDGET_S | 10800 | Active time budget per investigation (3 hours) |
TW_MAX_AGENT_CALLS | 100 | Maximum agent invocations per investigation |
TW_MAX_TOOL_CALLS | 100 | Tool calls per fix attempt (12 min via TW_FIX_SESSION_S) |
TW_MAX_DESIGN_CALLS / TW_MAX_VERIFY_CALLS | 100 / 100 | Tool calls per adapter repair (8 min) and verification (10 min) session |
TW_MAX_FIX_ATTEMPTS | 3 | Maximum fix attempts per reproduced bug |
TW_MAX_PATCH_FILES / TW_MAX_PATCH_LINES | 3 / 60 | Patch size limits enforced by diff_limits |
7. Current Scope & Honest Limitations
TimeWraith is a focused instrument for date/time regressions, not a universal bug finder. Keep these boundaries in mind before pointing it at a repository:
- Language & runner support: JavaScript and TypeScript projects running Jest or Vitest from the repository root are supported end to end. Python has a partial worker path using pytest. Monorepos with non-root test setups and other languages (Go, Rust, Java, C#, Ruby) are not supported yet.
- Unit-level clocks only: TimeWraith freezes process clocks and time zones inside sandboxed test runners. It does not control browser clocks, distributed clocks, or database server clocks.
- Fixed sweep schedule: the sweep tests ~2,600 precomputed clock points across 13 zones (2024–2026 DST shifts, leap day, month ends, anchors). There is no fuzzing or adaptive binary-search shrinking; the first failing instant per zone and invariant is reported.
- Plain-text intent lookup: repository tests and docs are searched via plain text matching. If intentional behavior is documented only in external wikis or issue comments, Raven may not see it unless found by GitHub issue search.
- Patch size ceiling: fixes that genuinely require refactoring across more than 3 files or 60 lines will be stopped by
diff_limits(you can raiseTW_MAX_PATCH_FILESandTW_MAX_PATCH_LINES, or take the failing regression test and fix it by hand). - Kiro usage limits & credits: live investigations spend credits on your signed-in Kiro account (roughly 18–30 agent calls per case). Use
TW_AGENT_RUNTIME=stubor browse the four preloaded cases when testing setup without spending credits.
8. Demo Video & Resources
- Walkthrough video: Watch the TimeWraith demo on YouTube ↗
- GitHub repository: TumblerWarren/timewraith-kiroween ↗
- Architecture & build log: TimeWraith: Building a Kiro Crew That Hunts Time Bugs (Kiroween 2026) →
- Tool overview page: TimeWraith on DevBuildTool →