Skip to content

Trust Pipeline

The trust pipeline chains import → verify → publish into a single auditable flow. Every published snapshot carries a semantic fingerprint, optional stamp, and optional checks — making it easy to detect drift and guarantee idempotency.

Terminal window
# 1. One-command publish: CSV → .sheet → VisiHub
vgrid pipeline publish invoices.csv \
--repo acme/invoices --headers --stamp "Q4 Close" --json
# 2. Same data, same fingerprint → no re-upload
vgrid pipeline publish invoices.csv \
--repo acme/invoices --headers --stamp "Q4 Close" --json
# → {"already_published": true, ...}

That’s it. The pipeline imported the CSV into a canonical .sheet file, stamped it with a fingerprint, verified integrity, and published to VisiHub — all in one call. The second run detected the fingerprint match and returned immediately.

If you need more control, use the individual commands:

Terminal window
# 1. Inspect — evaluate formulas against raw data
vgrid sheet inspect data.csv --headers \
--calc "SUM(Amount)" --calc "SUM(Tax)" --json > checks.json
# 2. Import — convert to canonical .sheet with stamp
vgrid sheet import data.csv data.sheet --headers --stamp "Q4 Filing"
# 3. Verify — confirm fingerprint hasn't drifted
vgrid sheet verify data.sheet
# 4. Publish — upload with trust metadata
vgrid hub publish data.sheet --repo acme/invoices \
--checks checks.json --message "Q4 close" --json

End-to-end command that chains inspect → import → verify → hub publish.

Terminal window
vgrid pipeline publish <source> --repo <owner/slug> [options]
OptionDescription
--repoVisiHub repository in owner/slug format (required)
--headersTreat first row as column headers
--formulasFormula handling for XLSX: values (default), keep, recalc
--stamp [label]Stamp with provenance fingerprint + optional label
--checks-calc <expr>Evaluate formula as a check (repeatable)
--checks-file <path>Pre-computed checks JSON file
--delimiterCSV field delimiter
--sheetSheet to import by index or name (XLSX only)
--messageCommit message
--notesPath to markdown notes file
--out <path>Save .sheet file to path (default: temp, deleted after publish)
--jsonOutput as JSON
--dry-runValidate locally without auth or upload
--no-waitReturn immediately after upload (skip polling)
--timeoutPoll timeout in seconds (default: 120)
Terminal window
# CSV with header-aware checks
vgrid pipeline publish data.csv --repo acme/payments --headers \
--checks-calc "SUM(Amount)" --checks-calc "SUM(Tax)" --json
# XLSX with specific sheet and formula preservation
vgrid pipeline publish report.xlsx --repo acme/quarterly \
--sheet Revenue --formulas keep --stamp "Q4 2026" --json
# Dry run — no auth, no network, just validate locally
vgrid pipeline publish data.csv --repo acme/payments --headers \
--dry-run --json
# CI: fast, no polling
vgrid pipeline publish data.csv --repo acme/payments --headers \
--stamp --no-wait --json
# Save .sheet file for inspection
vgrid pipeline publish data.csv --repo acme/payments --headers \
--out report.sheet --json

Publish a verified .sheet file to VisiHub. Use this when you already have a .sheet file from sheet import or sheet apply.

Terminal window
vgrid hub publish <file.sheet> --repo <owner/slug> [options]
OptionDescription
--repoVisiHub repository in owner/slug format (required)
--messageCommit message (default: “Publish <filename>“)
--notesPath to markdown notes file
--checksPath to checks JSON (output from sheet inspect --calc)
--lockLock snapshot immutably (requires paid tier; not yet available)
--jsonOutput as JSON
--dry-runValidate + compute fingerprint locally (no auth, no network)
--no-waitReturn immediately after upload (skip polling)
--timeoutPoll timeout in seconds (default: 120)

The trust pipeline is designed for CI. Fingerprint-based idempotency means repeated runs with the same data are free — no duplicate revisions, no wasted uploads.

# GitHub Actions example
- name: Publish dataset
run: |
vgrid login --token ${{ secrets.VISIHUB_TOKEN }}
vgrid pipeline publish data.csv \
--repo acme/payments --headers --stamp \
--no-wait --json > publish.json
# Check result
if jq -e '.already_published' publish.json >/dev/null 2>&1; then
echo "No changes — skipped"
else
echo "Published revision $(jq -r '.revision_id' publish.json)"
fi

Key CI flags:

FlagWhy
--jsonMachine-parseable output on stdout (progress on stderr)
--no-waitDon’t block on server-side processing — return after upload
--stampEnable fingerprint-based idempotency
--dry-runPreflight validation without auth (useful in PR checks)

When the latest revision on VisiHub was published via the trust pipeline (source_metadata.type == "trust_pipeline") and its fingerprint matches the local fingerprint:

  • The command returns immediately with "already_published": true
  • Exit code is 0
  • No revision is created, no bytes uploaded

When the fingerprint differs (data changed), or the latest revision came from a different source (non-trust publish):

  • A new revision is created and uploaded normally

All trust pipeline JSON outputs include schema_version: 1. Fields:

{
"schema_version": 1,
"ok": true,
"repo": "acme/payments",
"revision_id": "123",
"version": 5,
"fingerprint": "v2:42:abc123...",
"stamped": true,
"stamp_matches": true,
"locked": false,
"dataset_url": "https://app.visihub.app/acme/payments",
"revision_url": "https://app.visihub.app/acme/payments/revisions/123"
}

The already_published field is only present when the publish was skipped due to fingerprint match.


When a .sheet file is published via the trust pipeline (hub publish or pipeline publish), the revision on VisiHub stores source_metadata with this structure:

{
"type": "trust_pipeline",
"fingerprint": "v2:42:abc123...",
"timestamp": "2026-02-12T14:30:00Z",
"trust_pipeline": {
"stamp": {
"expected_fingerprint": "v2:42:abc123...",
"label": "Q4 Filing",
"timestamp": "2026-02-12T14:30:00Z"
},
"checks": {
"format": "csv",
"sheet": "Sheet1",
"results": [
{"expr": "SUM(Amount)", "value": "12345.67", "value_type": "number"},
{"expr": "SUM(Tax)", "value": "1234.57", "value_type": "number"}
]
},
"notes": "Approved by Finance team."
}
}
FieldAlways presentDescription
typeYesAlways "trust_pipeline"
fingerprintYesSemantic fingerprint of the .sheet data
timestampYesISO 8601 timestamp of the publish
trust_pipeline.stampWhen --stamp usedProvenance stamp with expected fingerprint
trust_pipeline.checksWhen --checks* usedFormula evaluation results
trust_pipeline.notesWhen --notes usedFree-text notes

The fingerprint is content-based: the same data re-imported from a different file (or on a different machine) produces the same fingerprint. This is what enables idempotency — it’s based on what the data is, not where it came from.


CodeMeaning
0Published successfully (or already published)
1Verification failed or formula error
2Bad arguments (wrong format, missing file, invalid repo)
40Not authenticated (run vgrid login)
42Network error
43Server validation error
44Timeout waiting for processing