White-Label Reform Engine

Detect brand, package, domain, env, docs, metadata, asset, license, and attribution surfaces before staging reviewable white-label edits


White-Label Reform Engine

The White-Label Reform Engine turns repo remixing into a reviewable plan before CODE applies edits. It detects source identity across code, docs, metadata, assets, package files, domains, and environment keys, then stages proposed changes with license and attribution guardrails.

What It Detects

  • Brand names and source identity candidates from package metadata, README headings, domains, and environment prefixes.
  • Package identifiers such as name in package.json and scoped package names.
  • Domains, URLs, and email addresses that need customer-facing replacement.
  • Environment keys such as ACME_API_KEY, ACME_DOMAIN, and branded service prefixes.
  • UI copy in JSX/TSX/HTML-style files.
  • Documentation references in Markdown, MDX, text, and README files.
  • Metadata in manifests, package files, layout/config files, and similar identity surfaces.
  • Asset filenames under public/static/assets folders.
  • License, notice, author, and copyright surfaces that must be reviewed instead of automatically rewritten.

CODE Handoff Files

REFORM-to-CODE handoffs now include two white-label proof files:

  • /REFORMCODE_WHITE_LABEL_PLAN.md is the human-readable plan for CODE users and reviewers.
  • /.reformcode/white-label-plan.json is the machine-readable contract for agents, workflows, future recipe automation, and governance memory.

The plan is intentionally staged, not applied. It lists findings, planned edits, blocked edits, guardrails, target profile, and review checklist so a user or CODE agent can apply changes deliberately.

Guardrails

  • License, notice, authors, contributors, and copyright files are blocked from automatic edits.
  • Package license metadata is marked for human review.
  • Missing license evidence creates a review guardrail before redistribution.
  • Unknown source identity creates a scope guardrail so broad renames do not run blindly.
  • Environment keys are only auto-suggested when the source prefix is clear; otherwise they remain review-only.

Target Profile

When no explicit target is provided, the engine uses a safe placeholder profile:

  • Brand name: Your Brand
  • Product name: Your Product
  • Package scope: @your-org
  • Package name: your-product
  • Domain: yourbrand.com
  • Environment prefix: YOUR_BRAND

Future UI can collect these values before generating a plan. The current deterministic engine already supports passing a target profile through createWhiteLabelReformPlan().

Developer Notes

Use createWhiteLabelReformPlan() for deterministic planning, renderWhiteLabelPlanMarkdown() for reviewer-facing output, and getWhiteLabelReformPaths() for the canonical CODE workspace file paths.

The engine lives in lib/reform/white-label.ts and is covered by __tests__/lib/reform/white-label.test.ts. Handoff integration is covered by __tests__/lib/reform/handoff.test.ts.