Skip to content

docs: add the repository move runbook to docs/ROUTINE_TASKS.md #5330

Open

Description

@dan-petty

Update 2026-11-26 (infra move): the GitHub root stacks go to tf/github/ of dan-petty/homelab (ADR 0032).

  • The runbook stays in docs/ROUTINE_TASKS.md. Its stack move step runs in a homelab checkout.
  • ADR 0035 amends ADR 0026: the stacks hold no repository setting, because devops repos onboard owns them. Write the verify step to match.

Problem or Motivation

No document orders a move or says what a transfer from dan-petty to retric-ai keeps.

Order 15 of the plan in #5311. The owner approved the plan on 2026-11-13.

Proposed Solution & Architectural Design

Write these steps: the preflight GETs and git grep, the Service pause, the owner POST through devops gh api, the stack move (removed block with destroy = false, then import blocks) and the verify step (imports only, postconditions pass). Add the rules: never create a repo at an old name, and the devops-cli move is one-way. Add the table of probe results.

Target Subsystem

SDLC, Git & PR Governance

Existing Tool Considered

GitHub REST POST /repos/{owner}/{repo}/transfer through devops gh api (only a user-to-server token can call it). No open tool does the transfer: gh has no verb (cli/cli#5292), GEI needs Enterprise Cloud, and the provider has no transfer resource.

Cost: Build: about 300k tokens, 0.5 day. Keep: about 50k tokens for each move. A dedicated command (about 1.2M tokens) is not built.

Acceptance Criteria

  • The owner runs the probe to retric-ai and back.
  • Each table row shows the measured result and its source.

Dependencies

#5316, #5325 and dan-petty/homelab#360; owner decision 15 in #5311 (probe). Part of #5311.

Source: #5311

Alternatives check of 2026-11-26: not-applicable.
Class: docs, no model call.
Tool: none found.

Proposed design

Problem statement

No document orders a repository move from dan-petty to retric-ai or states what a transfer keeps. This item adds the repository move runbook to docs/ROUTINE_TASKS.md: the preflight reads and old-name grep, the Service stop switch, the owner transfer through devops gh api, the stack move, the import-only verify step and the two move rules. The probe-results table waits on the owner probe of #5311 decision 15, so this item defers that table to a new issue and lands the steps that do not need the measurement.

Acceptance criteria

Requirement: Runbook section

docs/ROUTINE_TASKS.md SHALL hold a repository move runbook whose steps run in the order preflight, Service stop switch, owner transfer, stack move and verify.

Scenario: Docs row accepts the runbook section

  • WHEN A pull request adds the runbook section to docs/ROUTINE_TASKS.md and runs uv run devops ci --check --only docs.
  • THEN The docs row passes with no finding for docs/ROUTINE_TASKS.md, and the section lists the five steps in that order.

Requirement: Preflight reads

The preflight step MUST name each devops gh api GET (the repository, the target owner and the reader App installation) and MUST give the git grep command that finds each place that holds the old owner and repository name.

Scenario: Preflight lists each read and the old-name search

  • WHEN A pull request adds the preflight step to docs/ROUTINE_TASKS.md and runs uv run devops ci --check --only docs.
  • THEN The docs row passes, and the preflight step names the three GET endpoints and the git grep command with the place that each one finds.

Requirement: Service stop switch

The pause step MUST follow the stop switch of docs/CLUSTER.md and MUST state that a person suspends the devops-cli-service App installation in the web interface before the transfer.

Scenario: Pause step names the person's App suspension

  • WHEN A pull request adds the pause step to docs/ROUTINE_TASKS.md and runs uv run devops ci --check --only docs.
  • THEN The docs row passes, and the pause step lists the App suspension, the auto-sync stop, the scale to 0, the Job deletes and the hook stop in the order of docs/CLUSTER.md.

Requirement: Owner transfer

The transfer step MUST show devops gh api -X POST repos/{owner}/{repo}/transfer -f new_owner=retric-ai and MUST state that only the owner sends it in the move window after the preflight reads.

Scenario: Transfer step names the command and its caller

  • WHEN A pull request adds the transfer step to docs/ROUTINE_TASKS.md and runs uv run devops ci --check --only docs.
  • THEN The docs row passes, and the transfer step shows the POST path with new_owner=retric-ai and names the owner as its only caller.

Requirement: Stack move and verify

The stack move MUST remove the repository from the source stack with a removed block whose lifecycle sets destroy = false and MUST then import it into the target stack, and the verify step MUST run an import-only plan of the target stack that shows the repository and its settings and of the source stack that shows none.

Scenario: Stack keeps each resource through the move

  • WHEN A pull request adds the stack move and the verify step to docs/ROUTINE_TASKS.md and runs uv run devops ci --check --only docs.
  • THEN The docs row passes, and the stack move names the destroy = false removal and the import blocks, and the verify step names the two import-only plans.

Requirement: Move rules

The runbook MUST state that no one creates a repository at an old name and that the devops-cli move is one-way.

Scenario: Both move rules are stated

  • WHEN A pull request adds the move rules to docs/ROUTINE_TASKS.md and runs uv run devops ci --check --only docs.
  • THEN The docs row passes, and the runbook states both rules in separate sentences.

Existing Tool Considered

The alternatives check of 2026-11-16 records not-applicable for a docs item (no search) and names no tool. The open, maintained tool that covers the need is gh, through devops gh api: it sends the transfer as one REST POST, which ADR 0026 decision 6 records (docs/adr/0026-github-settings-are-opentofu-code-the-owner-applies.md:47), and GitHub documents the endpoint as "Transfer a repository" (https://docs.github.com/en/rest/repos, fetched 2026-11-23). It lacks a transfer verb (cli/cli#5292, recorded at docs/adr/0026-github-settings-are-opentofu-code-the-owner-applies.md:21), a stack move and an import-only plan check, so the runbook spells out the endpoint and the OpenTofu steps by hand. This item writes a document and builds no code, so its cost is the owner's one POST for each move; the issue records about 300k tokens to build and 50k to keep a move command, ADR 0026 rejects a dedicated command for now (docs/adr/0026-github-settings-are-opentofu-code-the-owner-applies.md:65), and the issue's dedicated command of about 1.2M tokens is not built.

Key questions

  • Where does the repository move runbook live?: Add a section to docs/ROUTINE_TASKS.md after the routine-task matrix. The item names this file, the file is the operational manual for routine tasks, and a second page splits the routine steps and adds a docs inventory entry for no gain. (best practice) [sources: docs/ROUTINE_TASKS.md:1, docs/ROUTINE_TASKS.md:20]
    • Chosen: Add a section to docs/ROUTINE_TASKS.md. The item names this file, and the file already holds the routine tasks in one ordered manual.
    • Rejected: Add a new page under docs/git/. A second page splits the routine steps and adds a docs inventory entry for no gain.
  • Which command sends the repository transfer, and who may call it?: The owner sends devops gh api -X POST repos/{owner}/{repo}/transfer -f new_owner=retric-ai in the move window after the preflight reads. ADR 0026 decision 6 records exactly this call, and AGENTS.md leaves repository settings to a person, so no Service job sends it. GitHub documents the REST endpoint as "Transfer a repository" (fetched 2026-11-23). The issue body's claim that only a user-to-server token can call it has no verified source in this run, so the runbook names the owner as the caller and states no token class. (best practice) [sources: docs/adr/0026-github-settings-are-opentofu-code-the-owner-applies.md:45, docs/adr/0026-github-settings-are-opentofu-code-the-owner-applies.md:47, AGENTS.md:21, https://docs.github.com/en/rest/repos]
    • Chosen: Owner POST through devops gh api. ADR 0026 decision 6 records this call, and the owner holds the permission that AGENTS.md leaves to a person.
    • Rejected: A Service job sends the transfer. AGENTS.md:21 keeps repository settings as a person's change, and no Service job holds the owner token.
    • Rejected: Build a dedicated devops command. The issue records about 1.2M tokens for that command, and ADR 0026 rejects a dedicated command for now.
  • How does the stack keep each resource through the move?: Remove the repository from the source stack with a removed block whose lifecycle sets destroy = false, then add the import blocks of the target stack. ADR 0026 keeps the import blocks with for_each in the code, and the verify step runs an import-only plan of the target stack, which shows the repository and its settings, and of the source stack, which shows none. (best practice) [sources: docs/adr/0026-github-settings-are-opentofu-code-the-owner-applies.md:26, docs/adr/0026-github-settings-are-opentofu-code-the-owner-applies.md:27, docs/adr/0026-github-settings-are-opentofu-code-the-owner-applies.md:47]
    • Chosen: Remove with destroy = false, then import into the target stack. ADR 0026 keeps import blocks with for_each in the code and checks the move with import-only plans, and the transfer keeps the repository.
    • Rejected: Destroy the source stack and recreate the repository in the target stack. A destroy deletes the repository with its issues, pull requests and settings, which the transfer keeps, and the source stack's import-only plan would check a stack that no longer holds the repository.
  • What stops the Service from writing to the repository during the move?: Follow the stop switch of docs/CLUSTER.md: a person suspends the devops-cli-service App installation in the web interface, so the next token mint fails. Then turn off automated sync from bootstrap to cluster to devops, scale roadmap-service to 0, delete each running Job and turn off each repository's hook. (best practice) [sources: docs/CLUSTER.md:212, docs/CLUSTER.md:213, docs/CLUSTER.md:219, docs/CLUSTER.md:220, docs/CLUSTER.md:221]
    • Chosen: Follow the stop switch of docs/CLUSTER.md. The App suspension makes the next token mint fail, so no Service job writes during the move, and the later steps stop the pod and the Jobs.
    • Rejected: Pause only the roadmap-service deployment. A paused deployment leaves the App installation and the hooks able to write.
  • Which reads form the preflight?: Three devops gh api GET requests and one search: the repository (repos/{owner}/{repo}), the target owner (orgs/retric-ai), the reader App installation on both accounts, which the import-only plans need, and git grep -n '<old-owner>/<repo>' for each place that holds the old name. The transfer fails when the target owner refuses it, and ADR 0026 records that the import-only plan needs the reader App on both accounts. (best practice) [sources: docs/adr/0026-github-settings-are-opentofu-code-the-owner-applies.md:47, docs/adr/0026-github-settings-are-opentofu-code-the-owner-applies.md:58]
    • Chosen: Read the repository, the target owner, the reader App installation and run the old-name grep. The transfer fails when the target owner refuses it, and the import-only plan that verifies the move needs the reader App on both accounts.
    • Rejected: Read only the repository. It leaves the target owner and the reader App unchecked until the transfer has already run, which is the failure the preflight exists to catch.
  • Which rules does the runbook state?: State that no one creates a repository at an old name and that the devops-cli move is one-way. ADR 0015 records that a move is hard to undo and changes the repository and image paths, which is why the runbook warns that this move is one-way. ADR 0026 records that the source stack's import-only plan must show no repository after the move, so a new repository at the old name would put work and an import block back on the old owner. Separate sentences make each rule a rule that a reader can follow. (best practice) [sources: docs/adr/0015-roadmap-jobs-act-as-a-github-app-on-the-personal-account.md:27, docs/adr/0026-github-settings-are-opentofu-code-the-owner-applies.md:27, docs/adr/0026-github-settings-are-opentofu-code-the-owner-applies.md:47]
    • Chosen: State both rules in separate sentences. The issue body names both rules; ADR 0015:27 records that a move is hard to undo and changes the repository and image paths, and ADR 0026:47 makes the source stack's plan show none, so both rules have a reason in the records.
    • Rejected: State only the old-name rule. It leaves a reader thinking that the move can be undone, while ADR 0015 records that a move is hard to undo and changes the repository and image paths.
    • Rejected: State both rules in one sentence. One sentence hides which rule a reader must follow.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#5316, #5325, dan-petty/homelab#360

Activity

  1. added
    source/agent
    on Nov 13, 2026
  2. added
    type/docs
    status/new
    value/medium
    effort/low
    on Nov 13, 2026
  3. dan-petty commented on Nov 13, 2026

    @dan-petty
    OwnerAuthor
  4. added
    priority/p3-low
    on Nov 13, 2026
  5. dan-petty commented on Nov 15, 2026

    @dan-petty
    OwnerAuthor

    Returned: two acceptance criteria need the owner probe, which has not run. The item asks for the table of probe results (#5311 decision 15: move a public probe repo to retric-ai and back), and its dependencies are all still open with no branch: #5316 (agent write guard), #5325 (tf/github/dan-petty) and dan-petty/homelab#360 (tf/github/retric-ai). A runbook written now would name routes and stacks that do not exist on origin/main (ca62d6a): tf/github is absent and devops gh holds no settings guard. Write it with the stacks and the probe measurements.

  6. devops-cli-service commented on Nov 16, 2026

    @devops-cli-service
    Contributor

    Alternatives check: not-applicable

    Class: docs. The check makes no search and no model call for an item of this class.

    Tool: none found

    Checked on 2026-11-16. A person decides what this means for the item. The check changes no label and closes no issue.

  7. devops-cli-service commented on Nov 20, 2026

    @devops-cli-service
    Contributor

    Owner question: See the first point of Open questions in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

  8. devops-cli-service commented on Nov 23, 2026

    @devops-cli-service
    Contributor

    Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.

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

    effort/lowpriority/p3-lowsource/agentstatus/newtype/docsvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions