From b5bf767c41f686c54830c215e1ae63cbb69fb4f3 Mon Sep 17 00:00:00 2001 From: Happyarch Date: Mon, 22 Jun 2026 02:18:20 -0400 Subject: [PATCH] Refactor agent swarm config and expand work_queue status machine - Expand `work_queue` status pipeline: `needs_translation` -> `in_progress` -> `translated` -> `wired` -> `verified`. - Add `reset`, `wire`, and `verify` commands to `work_queue`. - Add safety guard to `work_queue place`: prevents overwriting output file if scratch path equals output path. - Update `build_index` to only mark labels as verified/translated if `label_exists_in_file` succeeds (greps `^LabelName:`). - Fix engine/ prefix paths in `build_index` `TRANSLATED_MAP`. - Auto-migrate DB on connection: `complete` -> `translated`, `unverified` -> `needs_translation`. - Restructure agent files into scoped roles (`.agents/roles/`) and skills (`.agents/skills/`). - Trim `.agents/AGENTS.md` to ~100 lines containing only overview, rules, quick-ref, and role table. - Consolidate agent sandbox configurations into `.agents/settings.json` and empty `.agents/hooks.json`. --- .agents/AGENTS.md | 355 +++++----------------------- .agents/hooks.json | 24 +- .agents/roles/dispatch.md | 83 +++++++ .agents/roles/docs.md | 39 +++ .agents/roles/integration.md | 71 ++++++ .agents/roles/worker.md | 69 ++++++ .agents/settings.json | 37 +-- .agents/skills/386-checklist.md | 46 ++++ .agents/skills/bug-check.md | 47 ++++ .agents/skills/commit-format.md | 44 ++++ .agents/skills/glitch-escalation.md | 37 +++ .agents/skills/path-map.md | 40 ++++ .agents/skills/register-map.md | 39 +++ dos_port/tools/build_index | 207 ++++++++-------- dos_port/tools/work_queue | 230 +++++++++++++----- 15 files changed, 874 insertions(+), 494 deletions(-) create mode 100644 .agents/roles/dispatch.md create mode 100644 .agents/roles/docs.md create mode 100644 .agents/roles/integration.md create mode 100644 .agents/roles/worker.md create mode 100644 .agents/skills/386-checklist.md create mode 100644 .agents/skills/bug-check.md create mode 100644 .agents/skills/commit-format.md create mode 100644 .agents/skills/glitch-escalation.md create mode 100644 .agents/skills/path-map.md create mode 100644 .agents/skills/register-map.md diff --git a/.agents/AGENTS.md b/.agents/AGENTS.md index 2d733f4c..802273fe 100644 --- a/.agents/AGENTS.md +++ b/.agents/AGENTS.md @@ -1,323 +1,89 @@ -# Antigravity Pokemon Yellow 32-bit PMODE Port — Agent Swarm +# Antigravity Pokemon Yellow DOS Port — Agent Swarm ## Overview -Claude is **not** part of this swarm. Claude is used directly via Claude Code 1:1 -for complex work, architecture decisions, and callsite wiring. The swarm handles -bulk translation of simple-category functions and placing them into the correct -files — nothing more. +Claude Code handles architecture, complex functions, and live-graph wiring. +The swarm handles bulk translation of `simple`-category functions only. ``` -Dispatch_Manager (gemini-3.1-pro, effort:high) ← top-level coordinator - ├── Code_Worker_1..5 (gemini-3.5-flash, effort:high) - ├── Integration_Agent (gemini-3.5-flash, effort:high) - └── Docs_Commit_Agent (gemini-3.1-pro, effort:high) +Dispatch_Manager (gemini-3.1-pro) ← coordinator + ├── Code_Worker_1..5 (gemini-3.5-flash) + ├── Integration_Agent (gemini-3.5-flash) + └── Docs_Commit_Agent (gemini-3.1-pro) ``` -**Hard boundary**: The swarm places translated code in the right files. It does -**not** wire functions into the game loop. Callsite connections (adding `call` -instructions into existing engine code, modifying `OverworldLoop`, etc.) are -reserved for Claude Code sessions where the user has direct control. +**Hard boundary**: Swarm places translated code. It does **not** wire functions +into the live game loop. Live-graph connections (`OverworldLoop`, `EnterMap`, +`DelayFrame` callees) are Claude Code only. --- -## Required Reading (all agents that write or review NASM) +## Role Files (read your role file before doing anything) -Every agent that generates, reviews, or integrates NASM code **must** read these -before doing any work. They are not optional background — violations will cause -silent runtime bugs or corrupt glitch behaviour. - -| Document | Why it matters | +| Role | File | |---|---| -| `CLAUDE.md` | Register map, memory model, DPMI gotchas, build conventions | -| `docs/register_map.md` | Canonical SM83→x86 register assignments | -| `docs/386_optimization_strategy.md` | Instruction selection rules for 386 targets | -| `docs/bugs_and_glitches.md` | Which SM83 bugs to preserve and at what fix level | -| `docs/glitch_safety.md` | Which glitches are safe to emulate vs. dangerous under DPMI | - -Dispatch_Manager must read all five before writing any ticket. -Code Workers must read all five before translating any function. -Integration_Agent must read `CLAUDE.md` and `docs/register_map.md` before placing files. -Docs_Commit_Agent must read `CLAUDE.md` for commit conventions. +| Dispatch_Manager | `.agents/roles/dispatch.md` | +| Code_Worker | `.agents/roles/worker.md` | +| Integration_Agent | `.agents/roles/integration.md` | +| Docs_Commit_Agent | `.agents/roles/docs.md` | --- -## Role: Dispatch_Manager -- **Model**: `gemini-3.1-pro` -- **Settings**: `effort: high` -- **Objective**: Top-level swarm coordinator. Reads the work queue, writes - per-function tickets for Code Workers, reviews returned translations, marks - jobs complete, and hands finished files to the Integration and Docs agents. - Does **not** touch `complex`-category functions — those are left for Claude. +## Skills (load on demand with `agy skill `) -### Work Queue Interface -Queue lives in `dos_port/tools/translation.db`. Use `dos_port/tools/work_queue` -(executable, no extension, outputs JSON): +| Skill | When to load | +|---|---| +| `register-map` | Before writing any NASM | +| `path-map` | Before placing any file | +| `386-checklist` | When choosing instructions | +| `bug-check` | When BUG/GLITCH annotation needed | +| `glitch-escalation` | When hitting a $FF__ register | +| `commit-format` | Before committing | + +--- + +## Work Queue Quick Reference ```sh dos_port/tools/work_queue status -dos_port/tools/work_queue claim --agent Dispatch_Manager --count 5 --category simple -dos_port/tools/work_queue fail --id --notes "reason" -dos_port/tools/work_queue list --category simple --status needs_translation --limit 20 -dos_port/tools/work_queue pending-placement # jobs ready for Integration Agent +dos_port/tools/work_queue claim --agent --count 5 --category simple +dos_port/tools/work_queue pending-placement +dos_port/tools/work_queue list --status needs_translation --category simple --limit 20 ``` -See `dos_port/tools/work_queue --help` for the full reference. +Run `dos_port/tools/work_queue --help` for full command reference. -### Scratch pad -Workers write their output to `dos_port/scratch/` — a fully untracked ephemeral -directory (gitignored). Each file is named `__