feat(gateway): confirmed problem → GitHub issue (🎫 reaction opens a structured issue)#61
Open
hanfour wants to merge 22 commits into
Open
feat(gateway): confirmed problem → GitHub issue (🎫 reaction opens a structured issue)#61hanfour wants to merge 22 commits into
hanfour wants to merge 22 commits into
Conversation
… {cmd} work token, 🎫-reaction trigger)
…omic claim (incorporate 6 review findings)
…claim lifecycle, public-repo guard, exec/path hardening, fail-soft, naming/gate accuracy)
… on post-createIssue fail), diagnosis plumbing, snapshot-only consistency, permalink source, affordance ordering
… split created/failed event payloads, audit precedes best-effort Slack reply
…safeRepoHint parser for nested repos, pre-create gh check releases claim
…re repoVisibility (no-gh no longer misclassified as public-repo block)
…, grounded in real APIs)
… with injectable exec + no-leak
…ment; deterministic doctor tests
…+ resolveGithubToken
…e rejecting traversal
… with isSafeRepoPath)
…uard statSync against concurrent deletion
…permalink), gated on repo, 🎫 via chat.update
…ken/public-guard/create/finalize/audit
…ce slug-fail, title fallback, recover rename guard
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A tech, after the bot escalates a diagnosed problem in a Slack thread, confirms it with a 🎫 reaction → the gateway opens a structured GitHub issue in the problem's repo. Uses a work GitHub token passed per-command as
GH_TOKEN(never the host's personalghlogin). Sub-project 1 of the larger "clarify → diagnose → notify tech → confirm → issue → (later) draft PR" pipeline. End state is a well-formed issue; a human (or a future sub-project 2) picks up development.Spec:
docs/superpowers/specs/2026-06-12-confirmed-problem-to-github-issue-design.md(converged over 6 grounded review rounds). Plan:docs/superpowers/plans/2026-06-12-confirmed-problem-to-github-issue.md(9 tasks, TDD, subagent-driven with per-task spec + quality review + an opus whole-feature final review).What's included
adapters/github.ts— gh-CLI wrapper (findGhBinary,resolveRepoSlug,repoVisibility,createIssue,githubDoctor) behind an injectable exec seam; no-leak error sanitisation.gateway/issue-candidate.ts— durable snapshot record (independent of the consumable escalation marker, so the 🎫 path survives "reply first, react later"), lock-then-finalize lifecycle, mode 0600, doctor self-heal sweep.gateway/slack/issue.ts—IssueCoordinator: load → authorize → atomic claim → gh-check → slug → token → public-repo guard → createIssue → finalize → audit → reply.gateway/slack/escalation.ts+free-chat-turn.ts— writes the candidate at escalate time (gated onrequest.repo), plumbs the diagnosis snapshot, best-effort permalink, appends the 🎫 affordance viachat.updateonly after the record is saved.gateway/slack/index.ts— widenedreaction_addedgate + 🎫 dispatch.config.ts/events.ts/escalate.ts/doctor-checks/github-token.ts—github.token(SecretSource{cmd}/{env}) +allowPublicRepos; two token-free audit events; nested-repo parser support; doctor check + stale-claim recovery.Security properties (verified in review)
GH_TOKENvia env, errors sanitised to exit-code only).createIssueis invoked, no failure path releases the.claiminglock; every pre-create early-return does release. Crash-consistent finalize (write url → atomic rename); doctor finalizes url-present locks, never re-creates.gh/gitcalls useexecFilearg-arrays (no shell); three independent path guards (safeRepoHintparser boundary,isSafeRepoPath,assertSafeSegment).mentionedUserIds(not the live pool) and not blocklisted can trigger; public-repo guard is default-deny (incl. "unknown" visibility) so internal diagnosis content can't reach a public repo.Test plan
npm run cli:buildclean.github.token(work account{cmd}reference) + a private target repo in a real~/.pmk/gateway.json; drive a real escalation, react 🎫 as a tagged tech, confirm a real issue is opened in the correct repo and the URL is posted back to the thread.pmk gateway doctorreports thegithub-tokencheck correctly (configured vs unconfigured).ghis on the host PATH and the work token hasreposcope.🤖 Generated with Claude Code