Files
ci/opencode/ci/workflows/rollback.md
T
Jon Chery e31afe3b59 docs(rebrand): rename & rebrand CI → CIAgent across all documentation, templates, and scripts
- README.md: title, project name, CLI commands, .ci/ → .ciagent/, ci-files → ciagent-files, CI Modification → CIAgent Modification
- AGENTS.md: title, project name, architecture tree, agent count (18→19), test count (25→31 suites, 218→370 tests), version (0.4.0→0.6.0), ci-files → ciagent-files, CIConfig → CIAgentConfig, CiMetadata → CIAgentMetadata, .ci/ → .ciagent/
- templates/DECISIONS.md: .ci/audit/ → .ciagent/audit/, ci audit → ciagent audit
- scripts/postinstall.js: CI postinstall → CIAgent postinstall
- scripts/install.sh: CI → CIAgent, ci-init → ciagent-init, INSTALL COMPLETE banner
- opencode/ci/workflows/*.md (11 files): .ci/ → .ciagent/, CI → CIAgent project name, ci-command → ciagent-command usage lines
- opencode/ci/references/*.md (5 files): .ci/ → .ciagent/, CI → CIAgent project name, ci-files → ciagent-files references
- opencode/ci/contexts/*.md (3 files): .ci/ → .ciagent/, CI → CIAgent project name
- opencode/agents/ci-*.md (18 files): .ci/ → .ciagent/, CI → CIAgent project name
- opencode/command/ci-*.md (11 files): CI → CIAgent project name

Preserved: ---ci---/---/ci--- markers, opencode/ci/ dir paths, ci-*.md filenames, ci listProjects()/ci setActiveProject() API names, repo URLs

---ci---
phase: 1
milestone: v0.6
plan: 01-01
task: 01-01-01
status: execute
---/ci---
2026-05-29 17:58:48 +00:00

2.3 KiB

description
description
Rollback CIAgent phase — revert the last phase or specified phase by resetting to its pre-phase state

CIAgent Rollback

Rollback a CIAgent phase by reverting to the state before the phase started. Uses git to find the exact commit to reset to.

Usage: ciagent-rollback [phase_number]

If no phase specified, rolls back the current (most recent) phase.

Step 0: Confirm Active Project

Check ci listProjects() or read .ciagent/config.json to determine if multi-project mode is active.

If .ciagent/config.json has projects[] with length > 0:

  • Confirm active_project is correct for this rollback
  • If not, set it with ci setActiveProject(<slug>)
  • Identify project-scoped branches (prefixed with <slug>/)
  • All commit messages must include project: <slug> in ---ci--- block

If single-project mode: proceed with existing conventions (branches without slug prefix).

Step 1: Load Git Context

git log --max-count=30
git branch -a

Find the phase branch and its merge commit.

Step 2: Identify Rollback Point

For the specified phase:

  1. Find the merge commit that completed the phase
  2. Find the commit just before the phase branch was created
  3. This is the rollback point
git log --grep="P##" --format="%H %s" | head -20

Step 3: Confirm (Safety Gate)

Even in full autonomy mode, destructive operations need confirmation:

⚠ ROLLBACK: This will revert Phase [N] — [name]

Rollback point: [commit hash] [subject]
Changes to be lost: [N] commits

Proceed? (y/n)

Wait for confirmation. This is a safety gate — always confirm destructive operations.

Step 4: Execute Rollback

git revert [merge_commit_hash]

Or for a hard rollback (not recommended, only if explicitly requested):

git reset --hard [rollback_point]

Step 5: Update State

  • Delete the phase branch (if not already removed)
  • Update .ciagent/REQUIREMENTS.md — mark phase requirements as blocked
  • Update .ciagent/ROADMAP.md — mark phase as not_started

Commit the rollback:

chore(P##): rollback [phase-name] — [reason]

---ci---
phase: [N]
milestone: [vX.X]
status: specify
escalations:
  - id: E-XXX
    type: rollback
    description: Phase rolled back
    resolution: auto
---/ci---

Step 6: Report

Report rollback complete, rollback point, and next steps.