Skip to content

feat: add short-video simulation support and evaluation pipeline#217

Open
akz142857 wants to merge 3 commits intocamel-ai:mainfrom
akz142857:feat/tiktok-platform
Open

feat: add short-video simulation support and evaluation pipeline#217
akz142857 wants to merge 3 commits intocamel-ai:mainfrom
akz142857:feat/tiktok-platform

Conversation

@akz142857
Copy link
Copy Markdown

@akz142857 akz142857 commented Apr 16, 2026

Summary

This PR introduces a short-video simulation capability in OASIS with supporting experiment and analysis tooling.

Core changes

  • Add TikTok-style short-video simulation flow and related platform/recsys wiring
  • Add short-video metrics module under oasis/analysis
  • Add short-video experiment pipeline and batch runner under examples/experiment/short_video_negative_feedback
  • Add CI scripts for deterministic tests, short-video smoke, and optional model-dependent probes
  • Add/adjust tests and docs for the new short-video path

Validation

  • Local full CI script passed on branch:
    • deterministic tests
    • short-video pipeline smoke
    • optional LLM tests (with usable key)
    • optional online/model-dependent tests

Notes for reviewers

Linked Issue

Closes #212

Scope

This PR focuses on the short-video scenario extension and its experiment/analysis workflow, while keeping existing OASIS flows compatible.

ziy added 2 commits April 6, 2026 15:23
…ommerce)

Add TikTok as the third simulation platform alongside Twitter and Reddit.

Engine changes:
- ActionType: 14 new TikTok actions (upload_video, watch_video, share_video,
  duet, stitch, not_interested, enter/exit_livestream, livestream_comment,
  send_gift, start/end_livestream, view_product, add_to_cart)
- RecsysType.TIKTOK: traffic pool racing algorithm with 7-level promotion/
  demotion, configurable scoring weights, per-user interest personalization,
  and 72h time decay
- DefaultPlatformType.TIKTOK with conditional DB schema (video, livestream,
  livestream_viewer, order tables created only for TikTok)
- Platform: 14 async handler methods following existing (agent_id, message)
  dispatch pattern, with trace recording and pool level persistence
- generate_tiktok_agent_graph: JSON profile loader with interest tags
  appended to bio for recsys personalization
- OasisEnv: TIKTOK branch with tiktok_recsys_params passthrough for
  configurable algorithm parameters (14 tunable knobs)

All changes are additive — existing Twitter/Reddit functionality is unchanged.

Ref: MiroFish issue 666ghj/MiroFish#476
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2a815818e9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +885 to +886
if pct <= promote_pct and level < max_pool_level:
v["_pool_action"] = "promote"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Prevent level-0 videos from being re-promoted

Videos marked traffic_pool_level = 0 are described as “previously demoted/stopped”, but this condition allows them to be promoted again on later recsys updates whenever they rank in the top percentile of pool 0. That reintroduces content that should be permanently removed from circulation and breaks the traffic-pool lifecycle semantics for TikTok experiments.

Useful? React with 👍 / 👎.

Comment thread oasis/social_platform/recsys.py Outdated
Comment on lines +1007 to +1009
for trace in trace_table:
if trace.get("action") == ActionType.FOLLOW.value:
uid = trace["user_id"]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Build follow graph from current follow state

This follow map is built only from historical follow traces and never subtracts unfollow actions, so users who unfollow someone will still keep receiving “following” recommendations from that creator. In long simulations with follow churn, this makes the recommendation mix diverge from the actual social graph stored in the follow table.

Useful? React with 👍 / 👎.

Comment thread examples/tiktok_simulation.py Outdated
Comment on lines +149 to +150
"quality_score": 0.85,
"hook_strength": 0.90,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid passing unsupported upload_video kwargs

This example passes quality_score and hook_strength, but SocialAction.upload_video only accepts content, duration_seconds, category, and topic_tags. When env.step() calls perform_action_by_data, Python will raise TypeError: ... unexpected keyword argument, so the example fails at its first upload step.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Addressed the review feedback in commit b08a8e5:

  1. Prevented re-promotion of level-0 videos in TikTok traffic pools.
  2. Switched TikTok "following" recommendation source to current follow table state (so unfollow is respected), instead of historical follow traces.
  3. Fixed examples/tiktok_simulation.py (and related docs snippets) to avoid unsupported upload_video kwargs.

Also added regression coverage in test/infra/database/test_tiktok_recsys.py:

  • test_level_zero_videos_are_not_repromoted
  • test_following_recommendations_use_current_follow_state

Validation run: pytest -q test/infra/database/test_tiktok_recsys.py (3 passed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Add TikTok/Douyin platform support (video feed, livestream, e-commerce)

1 participant