Repository navigation
Description
Parent #1449. Depends on #1450, #1451, #1452, #1453. Floe 1.1.
CLI behavior
Provide an offline command using the existing argparse CLI:
floe contract import sales.xlsx --output-dir domains/sales
floe contract import sales.xlsx --output-dir domains/sales --dry-run
# Optional: check against workbook's domain / use project context
floe contract import sales.xlsx --domain sales --output-dir domains/salesThe workbook's Guide domain is default; --domain may override only if it matches the declared domain, to avoid misfiled outputs. An optional -c config.yml may help resolve existing project/domain paths, but is NOT required merely to generate YAML templates; no preconfigured source.path, sink, catalog, storage or partitioning is required.
Write by default, --dry-run previews without writes. Default output convention may be domains/<domain> if safely established, but make the destination explicit in docs. No separate technical-binding file, parser, or mandatory manual setup before generation.
Scope
- Route through workbook read/validation (feat(business-contract): parse Tables + Columns workbook with cell-level errors #1450), business-to-schema mapping (feat(business-contract): compile names/types, target table, PK and unique groups #1451), DQ/severity mapping (feat(business-contract): compile column quality checks and severity inheritance #1452) and editable YAML generator/reconciler (feat(business-contract): generate editable Floe YAML drafts and preserve engineer edits #1453).
- Distinguish errors: malformed workbook/business rule / conflict / unsafe output → command fails and writes nothing; missing technical source/sink TODOs → command succeeds and reports
generated draft; complete engineer TODOs, then run floe validate. - Report deterministic
created,updated,unchanged,blockedtable counts plus file paths, source Excel cell diagnostics and a readable preview of business contract deltas. - The initial import and a later reimport of completed YAML use the same command: only business-managed sections updated, technical configuration preserved.
- Optional
xlsxextra remains opt-in; error points to install step. Updatedocs/reference/cli.mdand a short guide demonstrating import → edit same YAML →floe validate→floe run; clarify the difference fromfloe add-entity --input sample.xlsx(schema inference on data). - No new web UI, wizard, ticket workflow or API format.
Acceptance
-
floe contract import --helpdocuments format, output directory, draft semantics and dry-run. -
floe contract import business.xlsx --output-dir domains/salescreates YAML drafts on a brand-new project directory without an existingconfig.yml. - Command returns success on structurally valid business-only imports even though full
floe validatecannot yet pass. - On engineer completion, the existing Floe CLI validates/runs the YAML with no intermediate conversion.
- Dry-run is read-only; invalid Excel, unsafe paths or conflicts return typed nonzero errors and no changes.
- Second identical import returns all unchanged; a revised workbook updates only business fields.
- No
Rulessheet,source_typeargument, technical bindings config or enforced FK behavior.
Tests first
test_cli_import_without_project_config, test_cli_dry_run_no_writes, test_cli_reports_missing_engineer_todos_as_next_step, test_cli_reimport_preserves_completed_source_and_sink, test_invalid_workbook_exits_without_changes.
Scope CLI wiring/docs separately from converter. AGENTS.md size limits apply.
Activity
[-]feat(cli): add floe contract import with domain selection, dry-run and summary[/-][+]feat(cli): import business Excel directly to editable Floe YAML drafts[/+]