Skip to content

Wave 2 — repo provisioning + repo-aware coding agents - #3

Merged
tobyvee merged 1 commit into
wave-1-safety-and-enablersfrom
wave-2-repo-context
Jun 27, 2026
Merged

tobyvee merged 1 commit into
wave-1-safety-and-enablersfrom
wave-2-repo-context

Conversation

@tobyvee

@tobyvee tobyvee commented Jun 27, 2026

Copy link
Copy Markdown
Owner

Wave 2 — repo-context critical path

Implements Wave 2 of the roadmap — the path that takes coding agents from writing blind to working
against real source. Stacked on #2 (base wave-1-safety-and-enablers); this diff is Wave 2
only. Merge order: #1 ← #2 ← #3.

ENG-013 — Repo provisioning + two-root workspace

  • Two roots, never conflated (packages/agents/src/workspace.ts): a persistent working-code root
    (workspace/, env AGENT_CODE_WORKSPACE) holding cloned target repos, distinct from the throwaway
    workspaces/ agent-state sandboxes. /workspace/ is gitignored.
  • PM tool grant: ROLES.pm.tools now includes git + gh, with a prompt covering
    list/reuse/create/clone (idempotent).
  • Scoped-token boundary: sandboxEnv(source, role) forwards AGENT_PM_GITHUB_TOKEN (as
    GITHUB_TOKEN/GH_TOKEN) only to the PM sandbox — the host token is never forwarded to any
    agent.
  • Idempotent provisioning (provision.ts): shallow clone-or-ff-pull into the working-code
    workspace, token passed via http.extraheader (never written to .git/config), no-op when GitHub
    isn't configured. Wired into implementTicket with repo_context_ready / repo_context_skipped
    audit events.

ENG-001 — Repo-aware coding agents

  • WorkerInput.workdir: the CLI backend runs claude -p in the cloned repo cwd (persistent — not
    cleaned up like the throwaway sandbox) so the agent reads/edits real files; implementTicket passes
    the clone path. The product's own tree is never touched. Test: the agent reads a seeded file in the
    workdir and the workdir is left intact.

Verification

pnpm typecheck · pnpm lint · pnpm test (85 tests) all green.

Deferred (noted in the tickets)

  • Literal claude --allowedTools tool-name gating — the security boundary is enforced via the
    PM-scoped token, so the abstract→Claude-Code tool-name mapping is a follow-up.
  • Per-epic repo association (target repo is GITHUB_OWNER/GITHUB_REPO for now); API-backend
    file-context injection (the CLI backend is the real repo-aware path).

🤖 Generated with Claude Code

… ENG-001)

ENG-013: two-root workspace (workspace.ts) — persistent working-code root for cloned target repos (AGENT_CODE_WORKSPACE), distinct from throwaway agent-state sandboxes; PM granted git/gh (ROLES.pm.tools + prompt); sandboxEnv(source, role) forwards a PM-scoped AGENT_PM_GITHUB_TOKEN only to the PM sandbox (host token never forwarded); idempotent ensureRepoCloned (provision.ts) shallow clone/ff-pull with token via http.extraheader, no-op when unconfigured, wired+audited in implementTicket. ENG-001: WorkerInput.workdir — CLI backend runs the agent in the cloned repo cwd (persistent, not cleaned up) so it reads/edits real source; implementTicket passes the clone path; product tree never touched. typecheck + lint + 85 tests green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant