Skip to content

research/viral-gate-status

research/viral-gate-status — weekly viral-gate evaluation.

Category: research
Source: workflows/social/viral_gate_status.py

FieldTypeDefaultDescription
posts_log_pathstring""Path to a TSV posts log. Empty = look for ~/.fabric/posts.tsv. The committed examples/viral-gate/posts.example.tsv template documents the expected columns.
primary_required_hitsinteger2How many primary-threshold hits constitute MET.
primary_thresholdinteger50000Per-output view threshold for the primary gate (plan 073). ≥primary_required_hits runs at this bar = MET.
regenerateobjectWhen set, this run is a regeneration. Workflows may read direction / keep / extra_instructions to modulate prompts; the engine persists parent_run_id and parent_variant_index as run lineage columns.
secondary_thresholdinteger250000Per-output view threshold for the secondary gate. ≥1 run at this bar = MET regardless of primary count.
skip_fetchbooleanfalseWhen true, evaluate against the existing snapshot file without making any network calls. Useful for re-running the gate with tightened thresholds.
snapshots_pathstring""Path to the JSONL snapshot history. Empty = ~/.fabric/post-engagement-snapshots.jsonl. Snapshots are appended on every run so trajectory data survives across evaluations.
variantsinteger1Number of independent variant executions (1–10). When > 1, the engine runs the workflow N times with different sampling, producing N outputs.
window_daysinteger14Evaluation window from posted_at, in days.
FieldTypeDefaultDescription
cohortsany[]
evaluated_atstringrequired
kindobjectVariant card shape: video / carousel / image / text. Surfaced on the per-variant entry of the run-output API and used by gallery UIs to pick the right layout.
posts_log_pathstringrequired
primary_thresholdintegerrequired
roster_statestringrequiredRoster-level rollup of cohort gate states.
secondary_thresholdintegerrequired
snapshots_pathstringrequired
snapshots_writteninteger0Number of new engagement snapshots appended this run.
window_daysintegerrequired
load_log → fetch_engagement → persist_and_merge → join_costs → evaluate_gate → finalize
TaskDescription
load_logResolve paths + load + validate the posts log.
fetch_engagementFetch engagement for every URL in the log (in parallel, by URL).
persist_and_mergeAppend the new snapshots to the JSONL file and load the full history.
join_costsBest-effort cost-per-run join via the workflow runs API.
evaluate_gateApply plan 073’s gate criterion to each cohort.
finalizeShape the aggregate output.

Save the YAML below as my-run.yaml, edit the values, and run with the CLI or POST it to the API. Required fields are uncommented; optional knobs are documented above the input: block — copy any line under input: and uncomment to set.

workflow: research/viral-gate-status
# Optional fields — copy any line(s) under `input:` and uncomment to set:
# Path to a TSV posts log. Empty = look for ~/.fabric/posts.tsv. The committed examples/viral-gate/posts.example.tsv template documents the expected columns.
# posts_log_path: ""
#
# How many primary-threshold hits constitute MET.
# [min=1, max=20]
# primary_required_hits: 2
#
# Per-output view threshold for the primary gate (plan 073). ≥primary_required_hits runs at this bar = MET.
# [min=1]
# primary_threshold: 50000
#
# Per-output view threshold for the secondary gate. ≥1 run at this bar = MET regardless of primary count.
# [min=1]
# secondary_threshold: 250000
#
# When true, evaluate against the existing snapshot file without making any network calls. Useful for re-running the gate with tightened thresholds.
# skip_fetch: false
#
# Path to the JSONL snapshot history. Empty = ~/.fabric/post-engagement-snapshots.jsonl. Snapshots are appended on every run so trajectory data survives across evaluations.
# snapshots_path: ""
#
# Evaluation window from posted_at, in days.
# [min=1, max=365]
# window_days: 14
#
input: {}

Run it locally:

Terminal window
fab-workflow --from-file my-run.yaml

Or submit over the wire — the same file is the request body:

Terminal window
curl -X POST 'https://gofabric.dev/v1/workflows/runs?name=research/viral-gate-status' \
-H 'Authorization: Bearer fab_xxx' \
-H 'content-type: application/yaml' \
--data-binary @my-run.yaml

Every workflow also accepts the universal WorkflowInput fields — variants (1–10 fan-out) and regenerate (creative-direction hints with run lineage). See Run-specs (YAML / TOML / JSON) for the full top-level shape (metadata, priority, bundle, parent, etc.).