Skip to contents

Specification IR & Constructors

Build, inspect, migrate, and query typed spec_ir objects.

new_spec_ir()
Construct a typed spec_ir statistical and simulation specification
spec_predictor()
Construct a predictor specification
spec_interaction()
Construct a two-way interaction term specification
is_spec_ir()
Test whether an object is a spec_ir
as_spec_ir()
Coerce a list into a spec_ir object
migrate_spec_ir()
Migrate a spec_ir object to the current IR schema version
spec_design_types()
Supported specification design types
spec_schema_path()
Locate the bundled JSON Schema for the spec_ir grammar
spec_total_n()
Compute total sample size implied by a spec_ir
spec_implied_intercept_sd()
Compute implied level-2 random intercept SD from ICC and outcome scale
spec_to_math()
Synthesize mathematical and formula summaries from a spec_ir

Multi-Scenario Comparison & Template Registry

Compare competing study designs (DEFF, N_eff, power) and manage reusable domain templates.

compare_specs()
Compare two or more validated spec_ir study designs side by side
as.data.frame(<spec_comparison>)
Coerce a spec_comparison object to a data frame
list_spec_templates()
List available built-in and custom spec_ir study templates
use_spec_template()
Instantiate a spec_ir from a registered template with optional overrides
register_spec_template()
Register a validated custom spec_ir template
unregister_spec_template()
Unregister a custom spec_ir template

Validation, Diffs & Serialization

Schema and statistical sanity guardrails, semantic diffs, and YAML/JSON I/O.

validate_spec_ir()
Validate a spec_ir object against schema and statistical sanity guardrails
is_valid_spec_ir()
Check whether a spec_ir object is valid
assert_valid_spec_ir()
Assert that a spec_ir object passes all schema and statistical checks
diff_spec_ir()
Compute a structured semantic diff between two spec_ir objects
format_diff_summary()
Format a concise one-line or bullet summary of a spec_diff
read_spec_ir()
Read a spec_ir object from a YAML or JSON file
write_spec_ir()
Write a spec_ir object to disk as YAML or JSON
as_spec_yaml()
Serialize a spec_ir object to YAML
as_spec_json()
Serialize a spec_ir object to JSON
parse_spec_text()
Parse a spec_ir object from YAML or JSON text

Natural-Language Translators & Refinement

Compile English descriptions into verified IR with pluggable backends.

nl_to_spec()
Translate a natural-language study description into a validated spec_ir
refine_spec()
Iteratively refine an existing spec_ir via natural language
answer_clarifications()
Apply user answers to structured clarification questions
translator_rule()
Construct the offline deterministic rule-based translator backend
translator_openai()
Construct an OpenAI-compatible LLM translator backend
translator_ollama()
Construct a local Ollama LLM translator backend
spec_system_prompt()
Return the strict JSON system prompt used by LLM translator backends

Undo/Redo History Stack

Track validated specification snapshots across visual and conversational edits.

spec_history()
Create an undo/redo specification history stack
history_push()
Push a validated spec_ir snapshot onto a spec_history stack
history_undo()
Undo the most recent change in a spec_history stack
history_redo()
Redo a previously undone change in a spec_history stack
history_can_undo() history_can_redo() history_current()
Inspect undo/redo availability and current snapshot in a spec_history
history_summary()
Summarize all snapshots stored in a spec_history stack

Dynamic UI Synthesis & bslib/Shiny Modules

Synthesize minimal context-specific controls with bidirectional sync.

spec_to_controls()
Synthesize a minimal dynamic UI descriptor from a validated spec_ir
patch_spec_from_control()
Apply a single dynamic UI control edit to a spec_ir with validation
render_spec_controls_ui()
Render a spec_ui_descriptor into bslib Shiny UI cards
render_diff_badges_ui()
Render visual diff badges for a spec_diff object
mod_spec_composer_ui()
Natural-Language Specification Composer Shiny Module (UI)
mod_spec_composer_server()
Natural-Language Specification Composer Shiny Module (Server)
mod_spec_controls_ui()
Dynamic Specification Controls Shiny Module (UI)
mod_spec_controls_server()
Dynamic Specification Controls Shiny Module (Server)
mod_spec_preview_ui()
Live Specification & Deterministic Codegen Preview Shiny Module (UI)
mod_spec_preview_server()
Live Specification & Deterministic Codegen Preview Shiny Module (Server)

Deterministic Compilers, AST Safety & Study Bundles

Compile AST-verified standalone R scripts, Quarto reports, and SHA-256 bundles.

compile_r_script()
Deterministically compile a validated spec_ir into a standalone R script
compile_quarto_report()
Deterministically compile a validated spec_ir into a Quarto report (.qmd)
verify_compiled_r_ast()
Statically verify the AST safety of a compiled R script
export_spec_bundle()
Export a self-contained reproducible study bundle from a validated spec_ir
verify_spec_bundle()
Verify integrity, schema validity, and AST safety of an exported study bundle

Flagship Demo Application & Presets

Launch the bundled interactive neuro-symbolic study designer.

run_specshiny_demo()
Launch the bundled specshiny flagship reference demo Shiny application
specshiny_demo_app()
Build the flagship specshiny reference demo Shiny app object
spec_presets()
Built-in natural-language study presets for the specshiny demo app