docs(tac): add Bun rewrite and Claude multi-agent notes

Folds Jarred Sumner's 'Rewriting Bun in Rust' (bun.com/blog/bun-in-rust)
and Claude Platform multi-agent sessions documentation into
loop_engineering.md. Key patterns: mechanical AI-assisted code
translation validated at scale (100K+ lines), adversarial AI review,
shared vault + isolated session threads aligning with TAC factory
architecture.
This commit is contained in:
artale 2026-07-09 04:04:43 +02:00
parent e3bc60b0c9
commit d0dfcf0683
1 changed files with 20 additions and 0 deletions

View File

@ -294,3 +294,23 @@ Reference: Kelsey Hightower LinkedIn, July 2026.
- The RSI loop (cron + skill_health.py + deploy-webhook + git-proxy) already follows this pattern: the deterministic monitoring runs on commodity hardware (cron, Python), while the planning/review layer uses AI. - The RSI loop (cron + skill_health.py + deploy-webhook + git-proxy) already follows this pattern: the deterministic monitoring runs on commodity hardware (cron, Python), while the planning/review layer uses AI.
- Kelsey's framing aligns with the Platform Engineer skill's MVI principle: "What happens if we don't add this?" Every agent in the factory should earn its token cost vs a deterministic alternative. - Kelsey's framing aligns with the Platform Engineer skill's MVI principle: "What happens if we don't add this?" Every agent in the factory should earn its token cost vs a deterministic alternative.
- The factory inventory's 25 containers include deterministic infrastructure (prometheus, grafana, forgejo, redis) alongside AI-driven agents — the split between commodity SDLC and AI augmentation is already in place. - The factory inventory's 25 containers include deterministic infrastructure (prometheus, grafana, forgejo, redis) alongside AI-driven agents — the split between commodity SDLC and AI augmentation is already in place.
## Mechanical code translation at scale
Reference: "Rewriting Bun in Rust" by Jarred Sumner (bun.com/blog/bun-in-rust, July 2026) and "Multi-agent sessions" on Claude Platform (platform.claude.com/docs/en/managed-agents/multi-agent).
**Bun's Zig→Rust port demonstrates what AI-assisted large-scale code translation looks like.** The team mechanically translated Bun's 100K+ lines of Zig to equivalent Rust. Key takeaways:
- Rust's safety guarantees (Drop for cleanup, bounds checking) caught latent bugs in the Zig code — specifically memory leaks from forgotten `defer` cleanup, and an off-by-one overflow bug that Rust panicked on instead of silently corrupting memory.
- Comptime in Zig mapped directly to const generics in Rust — identical semantics, different syntax (`can_merge_symbol_kinds(const IS_TYPESCRIPT_ENABLED: bool)` in one line vs `fn can_merge_symbol_kinds<const IS_TYPESCRIPT_ENABLED: bool>()` in the other).
- The PR was reviewed by adversarial AI agents checking translation correctness — the same pattern TAC's verifier/reviewer system uses.
- LLVM lifetime intrinsics emitted by Rust's codegen allowed better stack reuse, a performance win over the original Zig build.
**The porting pattern is directly applicable to TAC's agent factory:** an agent can read code, translate it line-by-line to a target language, and produce working output. The human (or verifier agent) reviews for correctness. This is the "agent writes code from spec" pattern (see Model routing appendix) applied to a production runtime, not just a toy.
**Claude's multi-agent API (beta, managed-agents-2026-04-01) validates TAC's factory architecture:** shared sandbox, filesystem, and vault credentials across agents; each agent in its own context-isolated session thread; persistent threads where the coordinator can follow up with a prior agent and retain its full history. This is architecturally identical to TAC's factory (6 agents on shared VPS, isolated workspaces, shared vault via git-proxy).
**Implications for TAC:**
- The Bun rewrite proves AI translation is viable for production codebases. The "spec → agent writes code" pipeline in the Model routing appendix is validated at scale.
- Claude's multi-agent architecture confirms TAC's approach is aligned with industry best practices: shared vault, isolated sessions, persistent threads.
- The adversarial agent review pattern (used on the Bun PR) is already part of TAC's verifier system — this validates the approach.