docs(agent-queue): version Phase 1 slice prompts (slice1, slice2)

Track the delegated agent task prompts under docs/jobs/ so the slice
decomposition of the gigafactory roadmap is reproducible and reviewable.
This commit is contained in:
saravanakumardb1 2026-05-29 18:05:06 -07:00
parent 67d8aa5766
commit 470b2ce8d0
2 changed files with 208 additions and 0 deletions

View File

@ -0,0 +1,101 @@
---
engine: devin
cwd: /Users/sd9235/code/mygh/learning_ai_devops_tools
yolo: true
lock: devops-tools
timeout: 3h
---
ROLE: Senior engineer. Implement Phase 1 — Slice 1 of the Agent Gigafactory roadmap.
SOURCE OF TRUTH: agent-queue/docs/GIGAFACTORY_ROADMAP.md (read §4, §5, §6, §7, §14 Phase 1
first). This slice implements ONLY the items listed below.
STRICT SCOPE:
- Edit ONLY files under agent-queue/ (primarily agent-queue.sh, selftest.sh, README.md,
docs/GIGAFACTORY_ROADMAP.md). DO NOT touch any other repo.
- DO NOT modify, move, or delete anything under agent-queue/queue/ — there are LIVE jobs
running there. DO NOT run `agent-queue.sh run`. selftest.sh uses its own temp queue
(AGENT_QUEUE_ROOT) — that is the only execution allowed.
- This is bash (single host). No service/Cosmos/Zod work in this slice (that is Phase 2).
DELIVERABLES (in agent-queue.sh, backward-compatible — legacy .md files with only
engine/cwd/yolo MUST behave exactly as today):
1. MANIFEST PARSING: recognize these new frontmatter keys with safe defaults via the existing
fm_get pattern: profile, engine-class, capabilities, prefers, priority, budget, deps,
deps-mode, idempotency-key, retry, review-policy, artifacts, tracker-item. In THIS slice
only items 25 are functional; the rest must be parsed + stored in the job .meta and shown
in `status`, but otherwise inert (document as "reserved, no-op until later phase").
2. PRIORITY ORDERING: replace pure-FIFO inbox selection with priority-then-age.
priority in {critical,high,medium,low} (default medium). Higher priority picked first; ties
broken by oldest timestamp. Must not break per-lock serialization.
3. CAPABILITY GRAMMAR + MATCH (single-host):
- detect_capabilities(): emit tokens for this host — os:<mac|linux>,
engine:<devin|claude|codex|copilot present>, node>=<major>, has:<tool> for a small probe
set (git, pnpm, docker if present).
- caps_match(required[], available[]) honoring §5 grammar: bare `key` = presence;
`key:value` exact; `key<op>version` with op in {>=,>,=,<=,<} (numeric/semver-major
compare); `os:any` = wildcard match-all. A job matches iff EVERY required token is satisfied.
- At run time, if a job declares `capabilities` the host does not satisfy, move the job to
failed/ with result=capability_mismatch and a clear log line (do NOT launch the agent).
4. ENGINE-CLASS RESOLUTION: if `engine` is unset but `engine-class` is set, pick a concrete
engine from a documented class map honoring `prefers-engine` then availability:
agentic-coder -> [devin, claude, codex]; chat-coder -> [copilot]. Explicit `engine` always
wins. If neither yields an available binary, fail the job with result=no_engine.
5. IDEMPOTENCY-KEY DEDUPE (on `add`): compute a content hash of the stripped body. If an
existing job in ANY stage (inbox/building/review/testing/shipped) has the same
idempotency-key AND same hash -> no-op (log "duplicate, skipped"). Same key + DIFFERENT hash
-> reject with a clear error UNLESS the prior job is still in inbox/ (then replace it).
TESTS (selftest.sh — tests are sacred; only ADD, never weaken existing ones). Add cases:
- backward-compat: a legacy engine/cwd/yolo-only .md still completes and lands in review/.
- priority: with max=1, a `critical` job queued after a `low` job runs first.
- capability mismatch: a job requiring `has:definitely-not-installed` -> failed/
result=capability_mismatch (agent never launched; use the existing no-op engine stub).
- engine-class: a job with `engine-class: agentic-coder` and no `engine`, DEVIN_BIN stubbed,
runs and lands in review/.
- idempotency: adding the same key+body twice yields exactly one inbox file; same key +
different body is rejected.
DOCS:
- README.md frontmatter table: add the new fields, clearly marking ACTIVE (Phase 1) vs RESERVED.
- docs/GIGAFACTORY_ROADMAP.md: tick ONLY the Phase 1 checklist boxes you fully completed and
update the §0 progress % for Phase 1 (do not tick incomplete items).
CONSTRAINTS:
- bash style consistent with the existing script; no new runtime dependencies; macOS + Linux
safe (no GNU-only flags without fallback). No emojis in code. No leftover debug echo noise.
- Work on a NEW branch: feat/gigafactory-p1-slice1. Commit in logical steps with conventional
commit messages. Push the branch and open a PR. DO NOT merge to main (human gate).
VERIFY GATE (must pass before finishing):
- bash agent-queue/selftest.sh -> MUST be fully green (existing + new cases).
- bash -n agent-queue/agent-queue.sh and node --check agent-queue/dashboard.mjs.
FINAL OUTPUT — print an implementation report in EXACTLY this format:
## Implementation Report — Phase 1 Slice 1
### Branch & commits
- branch: <name>
- commits: <sha> <message> (one per line)
- PR: <url or "opened, not merged">
### Files changed
- <path>: <one-line summary>
### What was implemented (per deliverable 1-5)
- <deliverable>: <how, key functions added/changed>
### Tests added
- <test name>: <what it asserts> (plus selftest.sh PASS/FAIL summary)
### Verify gate results
- selftest.sh: <PASS/FAIL + counts>
- bash -n / node --check: <result>
### Deviations / assumptions
- <anything changed from spec and why>
### Reserved (parsed-but-inert) fields
- <list fields parsed but no-op this slice>
### Suggested next slice
- <what should come next>

View File

@ -0,0 +1,107 @@
---
engine: devin
cwd: /Users/sd9235/code/mygh/learning_ai_devops_tools
yolo: true
lock: devops-tools
timeout: 3h
---
ROLE: Senior engineer. Implement Phase 1 — Slice 2 (Profiles + deps/DAG, single host).
SOURCE OF TRUTH: agent-queue/docs/GIGAFACTORY_ROADMAP.md (read §5 deps, §6 profiles,
§14 Phase 1). This slice implements ONLY the items below.
PREREQUISITE / BRANCHING:
- This builds on Slice 1 (PR #1, branch feat/gigafactory-p1-slice1).
- Base your work on `main` IF PR #1 has been merged; otherwise branch off
feat/gigafactory-p1-slice1. Do NOT duplicate or revert Slice 1 code.
- New branch: feat/gigafactory-p1-slice2. Push + open a PR. DO NOT merge.
STRICT SCOPE:
- Edit ONLY under agent-queue/ (agent-queue.sh, selftest.sh, README.md, new
profiles/ dir, docs/GIGAFACTORY_ROADMAP.md). No other repo.
- DO NOT modify/delete anything under agent-queue/queue/ (live jobs). DO NOT run
`agent-queue.sh run`. selftest.sh uses its own temp AGENT_QUEUE_ROOT only.
- bash, single host. No service/Cosmos work (that is Phase 2).
A. PROFILES (§6)
1. Create agent-queue/profiles/ with a starter catalog as profiles/<name>.md:
developer, backend-engineer, frontend-engineer, ux-designer, ui-designer, qa,
reviewer, docs-writer (and a reserved `planner`). Each has frontmatter:
name, persona (multi-line block), capabilities, default-verify, engine-class,
prefers-engine, allowed-scope, review-policy.
2. Profile resolution: when a job sets `profile: X`, inherit any of
{verify, capabilities, engine-class, prefers-engine, allowed-scope,
review-policy} that the job OMITS. Job-level fields ALWAYS override the profile.
Resolution runs BEFORE the capability gate + engine resolution so inherited
caps/engine-class take effect.
3. Persona injection: prepend the profile's persona to the job body in the
stripped body file fed to the engine. Never write secrets to logs.
4. allowed-scope guardrail — WARN-ONLY this phase: after the run, if cwd is a git
repo, compute changed paths and log a WARNING for any path outside the
allowed-scope globs. Non-blocking (do NOT fail the job). Expose the scope-check
as a unit-testable function.
5. Document the resolution precedence (job > profile > built-in default).
B. DEPS / DAG — single host (§5)
6. deps reference other jobs by `idempotency-key` (stable, author-controlled). A
dep is satisfied when a job with that key is in shipped/ (default), or in
shipped/ OR testing/ when the dependent job sets `deps-mode: soft`.
7. A job with unmet deps is BLOCKED: not selected to run, surfaced in `status` as
"blocked (waiting on <keys>)". Implement as a skip-with-reason in inbox
selection (like the busy-lock skip) — do NOT launch, do NOT move to failed.
Re-evaluated every run loop; becomes runnable once deps are satisfied.
8. Submit-time cycle detection on `add`: build the dep graph from idempotency-keys
across inbox + active stages; reject (die, nonzero) if the new job would create
a cycle.
9. No cross-machine deps (that is P2).
TESTS (selftest.sh — tests are sacred; only ADD):
- profile inherit verify: a profile whose default-verify is `false` → a job using
it (no own verify) routes to failed/; a profile with default-verify `true`
testing/.
- persona injection (golden): the body fed to the engine begins with the profile
persona (capture via a stub that copies its --prompt-file to a sentinel).
- profile caps inheritance: job omitting capabilities inherits the profile's →
unmet → failed/ result=capability_mismatch.
- allowed-scope warn: an out-of-scope change logs a WARNING and the job still
succeeds (or assert the scope-check function directly).
- deps block→run: job B deps:[keyA] stays blocked while A is unshipped; once A is
in shipped/, B becomes runnable and completes.
- deps-mode soft: dep satisfied when the dependency is in testing/.
- cycle detection: adding A deps:[keyB] while B deps:[keyA] is rejected.
DOCS:
- README: profiles section (catalog + resolution precedence) + deps/blocked
semantics.
- docs/GIGAFACTORY_ROADMAP.md: tick the §6 boxes you fully completed and the §5
`deps` box; bump §0 Phase 1 %.
CONSTRAINTS: bash style consistent with the existing script; no new runtime deps;
macOS + Linux safe; no emojis in code; no leftover debug noise; conventional
commits.
VERIFY GATE (must pass):
- bash agent-queue/selftest.sh → fully green (existing + new).
- bash -n agent-queue/agent-queue.sh ; node --check agent-queue/dashboard.mjs.
FINAL OUTPUT — print the implementation report in EXACTLY this format:
## Implementation Report — Phase 1 Slice 2
### Branch & commits
- branch / based-on: <name> (based on main | feat/gigafactory-p1-slice1)
- commits: <sha> <message> (one per line)
- PR: <url or "opened, not merged">
### Files changed
- <path>: <one-line summary>
### What was implemented (A1-5, B6-9)
- <item>: <how, key functions added/changed>
### Tests added
- <test name>: <what it asserts> (plus selftest.sh PASS/FAIL summary)
### Verify gate results
- selftest.sh: <PASS/FAIL + counts>
- bash -n / node --check: <result>
### Deviations / assumptions
- <anything changed from spec and why>
### Suggested next slice
- <what should come next (likely: tracker adapter aq from-tracker/to-tracker)>