plan-controller

The controller that manages a migration plan from validation through execution and completion. A migration plan describes how related providers, networks, storage, hosts, hooks, and migrations work together.

In plain words
What is it for?
Use it to validate plans, coordinate migration resources, update plan conditions, and manage success, failure, cancellation, and archiving.
Why use it?
It keeps the migration lifecycle and its status in one place, while waiting for required resources and handling completed or archived plans.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/kubev2v/forklift-console-plugin/plan-controller
Clone the repo
git clone --depth 1 https://github.com/kubev2v/forklift-console-plugin

Made for: Cursor.

Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,889 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00013 $0.02889
Opus 5 $0.00006 $0.01444
Sonnet 5 $0.00003 $0.00578
Haiku 4.5 $0.00001 $0.00289

Measured 2d ago against content hash 10cfcd3f208d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

plan-controller scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/backend/plans/plan-controller.mdc · 284 lines

How it starts

The opening of the file, as written. The whole thing — 284 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Plan Controller

Analyzed from commit: 412c71822 on 2026-05-04

Overview

The Plan controller (pkg/controller/plan/controller.go) is the central reconciler for migration plans. It watches Plan CRs plus related resources (Provider, NetworkMap, StorageMap, Hook, Migration) and drives the full lifecycle from validation through execution.

The Migration controller (pkg/controller/migration/controller.go) is intentionally thin — it sets owner references, validates the plan reference, and reflects plan snapshot status back onto the Migration CR.


Reconcile Flow

Reconcile(plan)
│
├─ 1. Fetch Plan (abort if deleted → cleanup orphaned resources)
├─ 2. Skip if Archived (spec.archived + status has Archived condition)
├─ 3. Skip if Succeeded (unless needs archiving)
├─ 4. Postpone if dependencies not yet reconciled
│     (Provider, NetworkMap, StorageMap, Host, Hook ObservedGeneration < Generation)
├─ 5. BeginStagingConditions()
├─ 6. validate(plan) — sets conditions on plan.Status
│     └─ If validation returns error for dangling archived plan → archive + return
├─ 7. Set PopulatorDataSource labels (one-time, post-Succeeded/Failed/Canceled)
├─ 8. Archive if spec.archived
├─ 9. Set Ready condition (if no blockers, not archived, not validating VDDK)
├─ 10. EndStagingConditions()
└─ 11. execute(plan) — find/run migration, update status

Execute Flow

execute(plan)
│
├─ If blocker/archived/reQ-condition → fail executing migration if grace period exceeded → return
├─ Build plancontext.Context
├─ Find active migration (from snapshot)
│   ├─ If found → SetMigration, matchSnapshot (cancel if mutated)
│   └─ If snapshot marked Canceled → propagate to all non-terminal VMs
├─ runner.Cancel() — cancel VMs marked for cancellation
├─ Find pending migrations (sorted by creationTimestamp)
├─ If no active + pending exists → select first pending, create new snapshot
├─ If no migration at all → delete Executing condition, slow requeue
├─ runner.Run() — execute the migration
└─ Reflect snapshot conditions (Executing/Succeeded/Failed/Canceled) onto plan.Status

Read the full file on GitHub · 284 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 284 lines · 13 tokens per session scan A 10cfcd3f208d

Subscribe to this mod's changes

plan-controller is a cursor rule published in the GitHub repository kubev2v/forklift-console-plugin (11 stars, last pushed 2d ago), licensed Apache-2.0. It adds 13 tokens to every session and 2,889 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.