Skip to content

Route the role automatically when identity new runs in the hub #76

Closed

Description

@radiusred-cody

Goal

Fold back the second live-fire finding on #73 (operator direction, 2026-08-24): after minting, identity new should write the role's routing into the hub's .codecrew.yml itself rather than printing an instruction — the milestone-new ROADMAP precedent: edit locally, say so, commit via the next PR. Line surgery preserving the file's comments and structure, validated by re-parsing before write; --no-route opts out for the rare case it's unwanted; the printed instruction remains the fallback when the routing table isn't local (pointer-only spokes) or the edit can't be applied safely. Tests ride along (#46).

Requirements

M5-R2

Plan

  1. routeRole(path, role, slug): line surgery on .codecrew.yml handling both table shapes — the scaffold's inline <role>: { identity: ~ } and the nested identity: line under the role key (trailing comments on the rewritten identity line are dropped: they describe the old routing). Everything else in the file — comments, ordering, other roles — is untouched. The result is re-parsed with config.Parse and the role's identity verified against the slug before anything is written; any miss returns an error.
  2. In identityNew: after the key is stored, when the verb runs in the hub (current == hub, the ROADMAP precedent from milestone new) and --no-route wasn't given, apply routeRole to the local file and print routed <role> → <slug> in .codecrew.yml — commit it via your next PR (--no-route to skip). On a spoke, with --no-route, or when the surgery errors, print the manual routing instruction exactly as today.
  3. Tests (feat: request review from the reviewer-role holder #46): both file shapes, comment/sibling preservation, the trailing-comment drop, unknown-role and unparseable-result errors, and --no-route flag parsing.
  4. Docs touch: the verb's paragraph in docs/identities.md and the SPEC §6 row say the routing is written for you in the hub.

Ask-the-human points

None — direction given by the operator on #73's finding.

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-cody commented on Aug 24, 2026

    @radiusred-cody
    ContributorAuthor

    Deviation: one next-step line added beyond the plan — 3. optional: give it the crew logo under Display information: <settings URL> (org- vs personal-account URL chosen by owner type). Prompted by the operator mid-task (2026-08-24): a CodeCrew project logo is coming and should dress every crew App. The manifest has no avatar field and no API uploads one — the logo is a manual step on the App's settings page — so the verb's best move is handing over the right URL. Tested alongside the routing work.

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