Python SDK
fs.plan()
SDK Reference: compile a deterministic Plan from accepted recommendations
def plan(result: ReviewResult, *, accept: list[str] | None = None) -> Plan:Overview
Compiles a deterministic Plan from the accepted recommendations in a ReviewResult. The Plan is the central domain primitive of the Dataset Contract lifecycle: an ordered, inspectable set of steps derived from accepted recommendations, with full traceability back to the originating findings and reviewers. It is deterministic (the same accepted recommendations always produce the same Plan), inspectable (every step is readable before anything runs), serializable (versioned schema), and AI-independent (a Plan from rules and a Plan from natural language are identical objects).
When to Use It
Use after fs.review() to turn the ranked, explainable recommendations produced by the Recommendation Engine into an actionable, human-reviewable plan. Review the recommendation IDs first, then pass the ones you accept via accept.
Parameters
- result:
ReviewResult. An existing result object produced byfs.review(). - accept:
list[str] | None. Recommendation IDs to include in the Plan. IfNoneor empty, returns an empty Plan.
Raises ValueError if any accepted recommendation ID is not found in the review's recommendations.
Return Value
Returns a Plan dataclass containing:
plan_schema_version:str(currently"0.1.0").items: Ordered tuple ofPlanItemobjects, one per accepted recommendation.source_review_id: Optional identifier of theReviewResultthe Plan was derived from.accepted_recommendation_ids: The recommendation IDs that were accepted to create this Plan.
Each PlanItem includes an id, recommendation_id, title, rationale, confidence (0.0 to 1.0), severity (critical, warning, or info), affected_columns, suggested_action, originating_findings, and originating_reviewers.
SDK Example
import featuresmith as fsresult = fs.review("data.csv", target_column="label")# Inspect the ranked recommendations firstfor rec in result.recommendations: print(f"{rec.id} [{rec.severity}] {rec.title}")# Accept the ones you want in the planplan = fs.plan(result, accept=["rec.quality.missingness.cabin"])for item in plan.items: print(f"{item.id}: {item.title}") print(f" Action: {item.suggested_action}")How Recommendations Are Generated
The centralized Recommendation Engine merges findings from every review section into a single ranked, explainable list. Findings affecting the same column with the same rule category are grouped into one recommendation, and each recommendation is ranked by severity (descending), then confidence (descending), then number of affected columns (descending). Recommendation IDs follow the pattern rec.<rule_category>.<column> (for example, rec.quality.missingness.cabin).
Notes and Limitations
- Advisory Only: The Plan is purely advisory — nothing is auto-applied. Executing the steps (code generation, dataset mutation) is planned for a future release.
- Empty by Default: Calling
fs.plan()withoutacceptreturns an empty Plan.
Related Documentation
See the review SDK reference fs.review(), the review models reference Review Models, and the CLI counterpart featuresmith plan.