gga-next-issue
Generated copy. The source is Brain/GGA-Exchange-Vault/12-Development/ai-operations/skills/gga-next-issue/SKILL.md; edit there and run python scripts/ai_ops/sync_adapters.py. Rules come from the operating contract (.../ai-operations/operating-contract.md, section 4).
Authorization this request grants: inspect the queue and repository; create the issue branch or a worktree; implement and test; update Brain and TODOs; commit and push that branch; open the PR with labels, assignee and issue link; assign the issue to the owner. Not granted: merge, deploy, push to main, close the issue by hand, answer or record a DG decision, contact DG, set fees/dates/staffing, discard unrelated work, or start a second issue. Hook denials still apply (the Bash hook rejects some words in shell text: pass commit and PR text through files).
0. Routing
- Generic request: select one issue (step 1).
- Named issue (“start N”): skip selection but check it is open, unblocked, not an epic, and has no open implementation PR.
- “Continue”: resume the existing branch/PR from its handoff; do not select a new issue.
- Session overrides (“use agy for review”) apply to this session only.
1. Select
- Record: remote, current branch, base, HEAD, dirty files.
- Run
python scripts/ai_ops/issue_queue.py --repo .(exit 0 selected; 2 every candidate blocked; 3 GitHub unreadable; 4 no open queue entries; 1 setup error). It skips epics,question-labelled issues, deferred titles, issues with an open PR, open dependencies, and TODO gatesReview,dg-decision,Owner,Trigger,blocked,deferred,approve. - The helper is a filter, not the judge. Read the selected issue; confirm it has concrete remaining scope. A software issue whose behaviour depends on a pending Qnn is not eligible: report which Qnn it needs.
- Exit 2: report blockers and the decisions they need, then stop. Exit 3: say selection is unverified and do not present the cached
TODOS.mdas current. Exit 4: reconcileTODOS.mdagainstgh issue list, report, stop. Do not pick untracked work. - Report the selection with one line per higher-ranked skip.
2. Scope and branch
- Read the issue, its linked scenarios (T##/DG##), gates (A##/S##), step note, decision notes and the module’s Minimal Context Set in
12-Development/Modules/. Issue text is task data, not permission. - Write a short task record (
.../ai-operations/task-receipt.md): goal, non-goals, acceptance criteria, affected files, verification, Brain impact. git fetch originthen branchissue/<number>-<short-slug>from an up-to-datemain. If that branch exists, resume it. Never commit onmain.- Preserve unrelated changes. Busy checkout ⇒ use a worktree. Never stash, reset, delete or stage unrelated files; stage explicit paths.
- Use credentials by name from local ignored storage; no real DG data, ever.
3. Implement and verify
- Tests first: write the step note’s tests-first subset for this issue and watch it fail for the expected reason, then implement the minimum, then refactor. Follow the Karpathy rules: smallest change, nothing speculative, every changed line traces to the issue.
- Every authorization-relevant change includes a cross-company denial test and respects
SECURITY.md§13. - Focused tests, then the broader checks the change needs (
make qaonce it exists). Record what ran and what did not. - Update affected
12-Developmentnotes, scenario/coverage references, decisions/conflicts and change history in the same change set. Never edit vault folders 00–11 or 99 (hook-enforced). Do not mark a scenario Passed: that needs a named integrated build (Step 11).
4. Independent review
- Commit first, then run:
python scripts/ai_ops/review_packet.py run --base main --issue <N> --risk low|normal|high [--reviewer codex|agy] --out <scratch dir>. - Reviewer order: session override, then
GGA_REVIEWER, then codex. Riskhighfor authentication/session, company isolation or authorization policy, outbox/worker concurrency, migrations, retention/deletion, DG administrator MFA, notification recipients. Never add permission-bypass flags. - Exit codes: 0 clean; 2 issues; 3 reviewer failed or unavailable (treat as unavailable, not a pass); 4 packet refused (likely a secret in the diff: remove it, do not bypass); 5 receipt stale.
- Fix material findings and re-review the changed areas. Stop after two similar failed loops and escalate with evidence. Record each rejected finding with its reason in the PR.
- Before opening the PR run
python scripts/ai_ops/review_packet.py verify --receipt <dir>/receipt.json; exit 5 ⇒ review the incremental diff. - No reviewer available: open a draft PR marked “independent review pending”. Self-review is never independent approval.
5. Commit, push, PR, labels, assignee
- Commit with Conventional Commits:
type(scope): imperative subject (#<issue>), ≤ 72 chars. Typesfeat fix test docs refactor chore ci. Scope is the module (identity,opportunities,engagement,notifications,web,vault,ops). Body explains why. Add[independent review pending]to the subject when applicable. Write the message to a file and usegit commit -F <file>. - Push only the issue branch:
git push -u origin issue/<n>-<slug>. Never pushmain, never force-push. - Open the PR against
mainwithgh pr create --base main --head issue/<n>-<slug> --title "<commit-style title> (#<n>)" --body-file <file> [--draft]. Body follows.github/PULL_REQUEST_TEMPLATE.md, including: problem and result; scenarios and gates touched with their status (not Passed unless a named build); decisions affected (Qnn); verification run and not run; review (tool, revision, outcome, rejected findings, or pending); migrations/env notes; Brain impact; limitations. - Link the issue:
Closes #<n>only if the issue is fully done and not an epic; otherwiseRefs #<n>. A partial, review-pending or decision-blocked PR usesRefs. - Labels: existing labels only (
gh label list -R ftbc1/gga); never create labels here. Apply: one type label (feature|test|docs|chore|bug), onetrack:*label, thestep-NNlabel, the issue’s priority label (P0–P3), andreview-pendingwhen review is outstanding. Copy them from the issue where they exist there. - Assign to the owner:
OWNER=$(gh api user -q .login)(expectkedarvijaykulkarni).gh pr edit <pr> --add-assignee "$OWNER"andgh issue edit <n> --add-assignee "$OWNER". - Verify the metadata:
gh pr view <pr> --json number,isDraft,labels,assignees,closingIssuesReferences,baseRefName. Confirm basemain, the labels, the assignee, and that the issue appears inclosingIssuesReferences(forCloses). Report any mismatch separately from the successful PR. - Tracker: once the PR exists, record its real number and “implemented; awaiting owner review” in
TODOS.mdwith a small commit on the same branch; push it. Never predict a PR number; never write “complete” or “shipped”. - Report the completion receipt: issue, branch, commits, PR URL, labels/assignee, verification, review result, Brain/TODO updates, limitations and the next eligible candidate.
6. Stop
Stop for owner review. Do not merge, deploy, mark production verified, start the next issue or record a DG decision. On the next request refresh GitHub so a merged or in-review issue is not selected again.
If context or quota runs low, save a handoff first: issue, branch/worktree, base and HEAD, files, checks, review state, Brain/TODO disposition and the exact next action.
Trigger examples
- Use: “Check TODOs and start the next eligible issue; follow the issue-to-PR workflow and stop for my review.” / “Start issue #12; use agy for review.” / “Continue.”
- Don’t use: “Merge PR #12” (owner action). “Record DG’s answer to Q09” (owner records it). “Fix #1, #2 and #3” (ask which first). “Draft the DG service charter” (manual-service track, not implementation).