Skip to content

API Reference parrot_pipelines.planogram.migration_runner

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_pipelines.planogram.migration_runner

View source

Row-level migration runner for troc.planograms_configurations (FEAT-574, FEAT-612).

Drives the deployment sequence of wiki/flows/pipelines/planogram-cycle-migration.md over every active row: export originals, convert each one into a reviewable candidate, render the approved candidates as one guarded SQL transaction, and apply it. migration.py stays offline and read-only; this module is the only place that writes, and only through alter / apply with an explicit --yes.

Work directory layout::

<dir>/original/<config_name>.json     exported rows, never rewritten
<dir>/candidates/<config_name>.json   proposals edited by the reviewer
<dir>/apply.sql                       rendered from approved candidates

Alias MIGRATED_TYPES

Re-exported from parrot_pipelines.planogram.migration.MIGRATED_TYPES.

Attribute TABLE

Function build_candidate

Convert one exported row into a reviewable candidate document.

build_candidate(row: Dict[str, Any]) -> Dict[str, Any]

Parameter Type Default Description
row Dict[str, Any] One exported troc.planograms_configurations row.

Returns: Dict[str, Any] — The candidate: the proposed slots_definition, the original planogram_config with rule_bindings / layout_profile merged in, and the unresolved review list.

Raises:

  • ValueError — When the row's planogram type is not convertible.

Function candidate_problems

Everything that blocks a candidate from being applied.

candidate_problems(candidate: Dict[str, Any]) -> List[str]

Parameter Type Default Description
candidate Dict[str, Any] A candidate document, possibly edited by the reviewer.

Returns: List[str] — Open unresolved items plus the readiness problems the runtime preflight would report.

Alias check_row

Re-exported from parrot_pipelines.planogram.migration.check_row.

Alias convert_config

Re-exported from parrot_pipelines.planogram.migration.convert_config.

Attribute logger

Alias preflight

Re-exported from parrot_pipelines.planogram.migration.preflight.

Function render_update

One guarded UPDATE for an approved candidate.

The statement fails (aborting the surrounding transaction) when the row is gone or was modified after the export.

render_update(candidate: Dict[str, Any]) -> str

Parameter Type Default Description
candidate Dict[str, Any] An approved candidate document.

Returns: str — A DO block updating slots_definition and planogram_config of one row.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally