Skip to content

Build the identity new verb: guided App creation via the manifest flow #70

Closed

Description

@radiusred-cody

Goal

Implement the path decided at the #68 gate: 'codecrew identity new ' generates a GitHub App manifest carrying the role's minimal permission set (the table in docs/identities.md), names the App for a crew member rather than the role, and hands the operator a one-click creation URL; the callback returns credentials to store under the ~/.config/codecrew convention. Webhooks are off by default — a crew App acts, it never listens — with an opt-in --with-webhook switch enabling the right event subscriptions for platform users (the watch seam, #54), per the operator's follow-up on #68. The manual ritual in docs/identities.md becomes the fallback the verb supersedes, updated in the same PR; platform footprint stated (Apps and the manifest flow are free on all plans). Code ships with tests per the #46 convention. #34's reviewer-App minting is the proving ground for the shipped verb.

Requirements

M5-R2

Plan

  1. Manifest builder, pure and tested first: per-role permission sets mirroring the docs/identities.md table (Metadata is implicit in the flow), App name from --name (crew-member naming — the verb refuses a name equal to the role, keeping the "identities outlive role reassignments" rule mechanical), homepage URL pointing at the hub, hook_attributes.active: false by default. --with-webhook flips it active with the protocol-traffic event set (issues, issue_comment, pull_request, pull_request_review, check_suite) and requires --webhook-url — the platform's receiver, per the Decide the no-App-fleet onboarding story for role identities #68 follow-up and the Document orchestration-platform interop (the ladder's last rung) #54 watch seam.
  2. The flow itself: the manifest flow is a form POST, so the "one-click URL" is a loopback page — the verb starts a localhost listener on an ephemeral port, serves an auto-submitting form targeting the account's apps/new endpoint, receives the redirect callback, and exchanges the code via POST /app-manifests/{code}/conversions (unauthenticated; one-hour code validity; API base URL injectable for tests). Target account defaults to the hub owner, --owner overrides; org vs personal endpoint chosen by account type.
  3. Credentials: the returned PEM lands at ~/.config/codecrew/<slug>.<date>.private-key.pem (0600) per the existing convention; App ID, slug, and client ID are printed; client_secret and webhook_secret are printed once and never written to disk. Next-steps output: the install URL — with the per-account boundary caveat from docs/identities.md — then routing the role in .codecrew.yml.
  4. Surface: identity new <role> dispatched in cli.go, usage text updated; refusals for an unknown role or missing --name.
  5. Tests ride along (feat: request review from the reviewer-role holder #46): manifest generation per role (permissions, naming, webhook default and toggle), the conversion exchange against an httptest server, PEM path convention and mode. The browser leg is manual by nature; Staff the reviewer role: dedicated App identity, agent-driven PR review #34's reviewer-App minting is the live proving ground.
  6. Docs in the same PR: docs/identities.md's manual ritual becomes the fallback the verb supersedes (SPEC's verb table gains the row); the quickstart stays untouched — climbing tiers is not a first milestone's business.

Ask-the-human points

None — the design was decided at the #68 gate (guided manifest flow, webhook opt-in). Deviations recorded as they occur.

Activity

  1. added
    cc:task
    on Aug 24, 2026
  2. radiusred-cody commented on Aug 24, 2026

    @radiusred-cody
    ContributorAuthor

    Started by @radiusred-cody[bot].

  3. radiusred-testy commented on Aug 26, 2026

    @radiusred-testy

    Finding (M5 QA, released v0.5.0): docs/identities.md carries a duplicated, mid-sentence-spliced passage. What I did: read the guided-creation section at main while verifying the M5-R2 doc obligations. What happened: the "alternatives weighed" passage appears twice — once correctly ("The alternatives weighed at the gate — a published manifest template with no verb, docs-only tier-sharpening, fine-grained PATs from a second account — are recorded there…"), and a second copy spliced directly after "The webhook secret is printed once at creation and never written to disk." on the same line, garbling the webhook paragraph. Blame: commit bccec89 (this task) added the second copy of the sentence commit 767486e (#68) had already placed. What should happen: the passage appears once, and the webhook paragraph ends at its own sentence. The R2 decision, rejected alternatives, and account-boundary fact are all still carried, so this is a doc-quality defect, not an R2 gap — filed for remediation, verdict on #67 unaffected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cc:task

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions