"body":"## Problem\nPlanner phase 5 pushes ops repo changes directly to `main` (`planner/AGENTS.md:37`, `planner/planner-run.sh`). Branch protection blocks this — see #758 for the symptom (PR #30 stuck, ops `main` frozen at v0.2.0 since 2026-04-08).\n\n## Why a new issue\n#758 is assigned to dev-qwen and labelled blocked; this reframes the fix rather than the symptom.\n\n## Proposal\nFold planner into the same flow architect already uses for ops PRs (`pr_create` → `pr_walk_to_merge` against `FORGE_OPS_REPO`). Architect proves merge perms work; review-bot already gates ops PRs and decides auto-approve vs request-changes. No new reviewer, no permission changes.\n\n## Changes\n- `planner/planner-run.sh` phase 5: stop direct push; create branch `planner/run-YYYY-MM-DD`, call `pr_create` then `pr_walk_to_merge`.\n- Planner formula prompt: replace \"push directly\" instructions with phase-protocol terminology used by architect.\n- `planner/AGENTS.md`: update phase 5 description.\n\n## Acceptance\n- Planner run produces a PR on ops repo, walks to merged via review-bot.\n- PR #30 closed (superseded) once new flow lands.\n- ops `main` advances past v0.2.0.\n\n## Acceptance criteria\n- [ ] Planner run produces a PR on ops repo, walks to merged via review-bot\n- [ ] PR #30 closed (superseded) once new flow lands\n- [ ] ops `main` advances past v0.2.0\n- [ ] CI green on the planner changes\n\n## Affected files\n- `planner/planner-run.sh` — replace direct push with `pr_create` + `pr_walk_to_merge`\n- `planner/AGENTS.md` — update phase 5 description"
"title":"fix: vault_request RETURN trap fires prematurely when vault-env.sh is sourced",
"body":"## Problem\n\n`vault_request()` in `lib/vault.sh` uses `trap ... RETURN` to clean up its temp TOML file. However, when `vault-env.sh` is sourced inside the function (as part of validation), bash fires RETURN traps for each function call made during the source. This causes the temp file to be deleted before `validate_vault_action` reads it.\n\n## Repro\n\n```bash\nsource lib/env.sh\nsource lib/vault.sh\nsource lib/pr-lifecycle.sh\nvault_request \"test-id\" \"id = \\\"test\\\"\\nformula = \\\"run-rent-a-human\\\"\\ncontext = \\\"test\\\"\\nsecrets = []\"\n# => ERROR: File not found: /tmp/vault-XXXX.toml\n# => ERROR: TOML validation failed\n```\n\n## Root cause\n\n```bash\n# In vault_request:\ntmp_toml=$(mktemp /tmp/vault-XXXXXX.toml)\ntrap 'rm -f \"$tmp_toml\"' RETURN # <-- fires on source, not just on return\n\n# Later:\nsource \"$vault_env\" # <-- RETURN trap fires here, deleting tmp_toml\nvalidate_vault_action \"$tmp_toml\" # <-- file is gone\n```\n\n## Fix\n\nUse `EXIT` trap instead of `RETURN`, or set the trap AFTER sourcing vault-env.sh.\n\n```bash\n# Option A: trap on EXIT instead\ntrap 'rm -f \"$tmp_toml\"' EXIT\n\n# Option B: source first, set trap after \nsource \"$vault_env\"\ntrap 'rm -f \"$tmp_toml\"' RETURN\n```\n\n## Acceptance criteria\n- [ ] `vault_request` successfully validates TOML without \"File not found\" error\n- [ ] Temp file is still cleaned up after function returns\n- [ ] Existing vault test (if any) passes\n\n## Affected files\n- `lib/vault.sh` — fix `trap ... RETURN` in `vault_request()`",