Skip to contents

Apply a compiled semantic rulebook sequentially to a target semantic assertion vector.

Usage

refine_by_rulebook(
  x,
  target,
  rulebook,
  prefix = NULL,
  keep_intermediate = TRUE,
  final_name = "final"
)

Arguments

x

A data frame.

target

Bare or quoted name of the initial semantic assertion column.

rulebook

A compiled rulebook object created with compile_rulebook().

prefix

Prefix used for generated refinement columns. Defaults to the target column name.

keep_intermediate

Logical. If TRUE, keeps all intermediate refinement columns. If FALSE, returns only the final refinement column.

final_name

Name of the final refinement column.

Value

A tibble with progressively refined semantic assertions.

Details

refine_by_rulebook() wraps an iterative refinement workflow where each semantic refinement stage operates on the semantic state produced by the previous stage.

The function is designed for operational semantic stabilization workflows where semantic assertions progressively mature through deterministic contextual refinement.

Each refinement stage creates a new refinement column, preserving semantic progression for inspection, auditing, and review.

Rulebooks are typically created with compile_rulebook() and operate on semantic operationalisations produced with:

Conceptually, the function behaves similarly to an iterative purrr::reduce() workflow applied to semantic refinement stages.