Skip to content

Formula Versioning

CalcBridge tracks formula changes with full version history, enabling rollback and audit trails.


Version Lifecycle

stateDiagram-v2
    [*] --> draft: Create Formula
    draft --> active: Activate
    active --> active: New Version
    active --> archived: Archive
    archived --> active: Reactivate

Creating Versions

Each time a formula graph is updated, a new version is created:

PUT /api/v1/formulas/{config_id}/versions
{
  "graph": { ... updated graph ... },
  "change_notes": "Added error handling for null prices"
}

Version Properties

Property Description
version_id Unique version identifier
graph Formula graph at this version
change_notes Description of changes
created_at When this version was created

Applying Specific Versions

When applying a formula, you specify which version to use:

POST /api/v1/formulas/{config_id}/apply
{
  "version_id": "v2",
  "workbook_id": "...",
  "sheet_id": "...",
  "target_column": "market_value"
}

Execution History

Track which versions were applied where:

GET /api/v1/formulas/{config_id}/runs

Each run records: - Version used - Target workbook and sheet - Rows affected - Execution status and timing


Formula Status

Status Description Actions Available
draft Under development Edit, validate, preview
active Ready for use Apply, create versions
archived No longer in use View history, reactivate