MCPcopy Create free account

hub / github.com/aaronjmars/MiroShark / functions

Functions3,647 in github.com/aaronjmars/MiroShark

↓ 1 callersMethod_get_profile_path
Get Profile file path
backend/scripts/run_reddit_simulation.py:449
↓ 1 callersMethod_get_recent_posts
(self, cursor, limit: int)
backend/wonderwall/social_agent/round_analyzer.py:327
↓ 1 callersFunction_get_report_id_for_simulation
Get the latest report_id corresponding to a simulation Traverses the reports directory to find reports matching the simulation_id. If mu
backend/app/api/simulation.py:2222
↓ 1 callersMethod_get_system_prompt
Get system prompt — locale-aware via the active context.
backend/app/services/wonderwall_profile_generator.py:765
↓ 1 callersMethod_get_viral_posts
(self, cursor, limit: int = 3)
backend/wonderwall/social_agent/round_analyzer.py:539
↓ 1 callersFunction_has_outcome_record
Return True iff the card already carries an outcome OR the on-disk reader confirms one for the sim. Belt-and-suspenders so the verified gate m
backend/app/services/feed.py:780
↓ 1 callersFunction_has_trajectory_rows
Return ``True`` when the sim has at least one recorded round. Reuses ``chart_svg.load_trajectory_for_chart`` so the trajectory check stays co
backend/app/services/frame_metadata.py:115
↓ 1 callersFunction_host_of
Return the lower-cased ``host[:port]`` of an absolute URL, or ``None``. Requires both a scheme and a netloc so a bare path (``/share/x``) or a
backend/app/services/oembed_service.py:92
↓ 1 callersFunction_impact_badge
(delta)
backend/app/api/simulation.py:4171
↓ 1 callersMethod_infer_risk_tolerance
Infer risk tolerance from entity characteristics for Polymarket profiles.
backend/app/services/wonderwall_profile_generator.py:405
↓ 1 callersMethod_init_belief_system
Initialize belief states for all agents from simulation config.
backend/scripts/run_reddit_simulation.py:555
↓ 1 callersMethod_init_db
Create the database with core + simulation-specific schemas.
backend/wonderwall/simulations/base.py:123
↓ 1 callersMethod_interleave_by_type
Reorder entities to interleave types for diverse early results. Instead of [Org, Org, Org, Person, Person], produces [Person, Org, Pe
backend/app/services/wonderwall_profile_generator.py:982
↓ 1 callersMethod_interview_single_agent_llm
Interview a single agent via LLM. Designed to be called in parallel from a ThreadPoolExecutor.
backend/app/services/graph_tools.py:1433
↓ 1 callersFunction_intro_tweet
Open the thread with the scenario, scale, and current consensus. The thread numbering ``1/`` is intentionally added at the end so the operato
backend/app/services/thread_formatter.py:262
↓ 1 callersFunction_is_deployed_environment
True when running on a known managed deploy platform (Railway / Cloud Run).
backend/app/__init__.py:32
↓ 1 callersMethod_is_group_entity
Check if this is a group/institutional type entity
backend/app/services/wonderwall_profile_generator.py:631
↓ 1 callersMethod_is_individual_entity
Check if this is an individual type entity. Uses exact match on known types, then keyword matching on the type name. Defaults to True
backend/app/services/wonderwall_profile_generator.py:610
↓ 1 callersMethod_is_nonspeaking_entity
Reject entities that shouldn't become simulation agents. Catches: - Dates extracted as entities ("June 18, 2023", "November 5, 2024")
backend/app/services/entity_reader.py:117
↓ 1 callersFunction_is_running
Return True when the simulation hasn't reached a terminal status. A terminal state ⇒ ``<changefreq>weekly</changefreq>`` because the artifact
backend/app/services/sitemap.py:144
↓ 1 callersFunction_is_truthy
(value: str)
backend/app/api/feed.py:47
↓ 1 callersFunction_iter_candidate_sim_ids
Yield candidate simulation directory names from ``data_dir``. Skips dotfiles + non-directories. Never raises — a missing data dir yields noth
backend/app/services/lineage_service.py:242
↓ 1 callersFunction_iter_sim_dirs
Yield ``(simulation_id, sim_dir_path)`` for every directory under ``sim_root`` that looks like a simulation folder. Skips dotfiles and non-di
backend/app/services/project_stats.py:111
↓ 1 callersFunction_iter_sim_dirs
Yield ``(simulation_id, sim_dir_path)`` for every directory under ``sim_root`` that looks like a simulation folder. Skips dotfiles and non-di
backend/app/services/platform_stats.py:97
↓ 1 callersFunction_iter_sim_dirs
Yield ``(simulation_id, sim_dir_path)`` for every directory under ``sim_root`` that looks like a simulation folder. Same posture as ``platfor
backend/app/services/outcome_distribution.py:113
↓ 1 callersFunction_iter_sim_dirs
Yield ``(simulation_id, sim_dir_path)`` for every simulation-shaped directory under ``sim_root``. Skips dotfiles + non-directories — same pos
backend/app/services/activity_feed.py:116
↓ 1 callersFunction_iter_sim_dirs
Yield ``(simulation_id, sim_dir_path)`` for every simulation-shaped directory under ``sim_root``. Skips dotfiles + non-directories so a stray
backend/app/services/platform_status.py:90
↓ 1 callersFunction_key_hint
Return the first ``_KEY_HINT_LENGTH`` characters of the secret followed by ``"..."`` so a caller can confirm both ends are using the same key
backend/app/services/signed_result.py:105
↓ 1 callersFunction_last_modified_for
Best-effort ``lastmod`` date for a single sim. Prefers a state-side timestamp (``updated_at`` ⇒ ``created_at``), then falls back to the on-di
backend/app/services/sitemap.py:186
↓ 1 callersFunction_lineage_summary
One-line lineage description for the header markdown cell. Mirrors the EmbedDialog's ``reproLineageDescription`` — "Original", "Fork of sim_a
backend/app/services/notebook_export.py:173
↓ 1 callersFunction_list_graphs
()
backend/mcp_server.py:242
↓ 1 callersMethod_llm_adjudicate
Batched LLM call. Returns a verdict per pair, aligned by index.
backend/app/storage/contradiction_detector.py:154
↓ 1 callersMethod_llm_adjudicate
Batched LLM call. For each ambiguous (idx, entity, candidates), ask the LLM to pick a candidate letter or "none". Returns {i
backend/app/storage/entity_resolver.py:247
↓ 1 callersMethod_llm_client
(self)
backend/app/storage/community_builder.py:56
↓ 1 callersMethod_llm_client
(self)
backend/app/storage/contradiction_detector.py:62
↓ 1 callersMethod_llm_client
(self)
backend/app/storage/entity_resolver.py:70
↓ 1 callersFunction_loadLogo
()
frontend/src/utils/chartExport.js:14
↓ 1 callersMethod_load_agent_profiles
Load Agent profile files for simulation
backend/app/services/graph_tools.py:1568
↓ 1 callersFunction_load_all
()
backend/app/services/country_registry.py:24
↓ 1 callersFunction_load_belief_bootstrap
Read the latest belief snapshot from ``trajectory.json``. Returns the same shape the embed-summary endpoint uses — a dict with ``rounds``, ``
backend/app/api/watch.py:110
↓ 1 callersFunction_load_belief_layer
Map ``agent_id → {final_position, rounds_participated, final_stance}``. Reuses ``agent_sparklines_service.load_agent_trajectories`` so the pe
backend/app/services/agent_export.py:231
↓ 1 callersMethod_load_belief_states_if_exists
(self)
backend/scripts/belief_integration.py:171
↓ 1 callersFunction_load_config
Load ``<sim_dir>/simulation_config.json`` defensively. Missing/corrupt → ``{}``.
backend/app/services/clone_service.py:150
↓ 1 callersMethod_load_config
Load configuration file
backend/scripts/run_twitter_simulation.py:422
↓ 1 callersMethod_load_config
Load configuration file
backend/scripts/run_reddit_simulation.py:444
↓ 1 callersFunction_load_config_scenario
Read ``simulation_requirement`` from ``simulation_config.json``. The scenario lives in the LLM-generated config file. Falls back to the empty
backend/app/services/lineage_service.py:121
↓ 1 callersMethod_load_entity_graph
Load (src_idx, tgt_idx, weight) triples for Leiden. Weight = count of distinct valid RELATION edges between the pair.
backend/app/storage/community_builder.py:192
↓ 1 callersMethod_load_entity_metadata
Fetch name + summary for every entity in any kept cluster.
backend/app/storage/community_builder.py:267
↓ 1 callersMethod_load_name_corpus
Return {name_lower: {uuid, name, name_lower, summary}} for the graph.
backend/app/storage/entity_resolver.py:145
↓ 1 callersFunction_load_outcome
Load + sanitize ``outcome.json`` exactly like the gallery does. Re-implemented (rather than imported) so the transcript service has no depend
backend/app/services/transcript.py:209
↓ 1 callersFunction_load_profile_names
``user_id → display name`` lookup for the simulation's agents. Reads ``reddit_profiles.json`` first (every run produces it), then ``polymarke
backend/app/services/agent_sparklines_service.py:74
↓ 1 callersFunction_load_profiles
Load the agent roster — reddit_profiles.json first, then polymarket. Returns a list keyed by ``user_id`` order of first appearance. Each entr
backend/app/services/agent_export.py:119
↓ 1 callersFunction_load_quality_health
Read ``quality.json`` health label if present. Never raises.
backend/app/api/watch.py:186
↓ 1 callersMethod_load_run_state
Load run state from file
backend/app/services/simulation_runner.py:127
↓ 1 callersFunction_load_scenario_preview
Read ``simulation_requirement`` from ``simulation_config.json``. Empty string when the config is missing or doesn't carry the field — same po
backend/app/services/agent_export.py:264
↓ 1 callersFunction_load_state
Load ``<sim_dir>/state.json`` defensively. Missing/corrupt → ``None``.
backend/app/services/clone_service.py:135
↓ 1 callersFunction_load_templates
Load all template JSON files from the templates directory.
backend/app/api/templates.py:36
↓ 1 callersMethod_local_search
Local keyword matching search (fallback approach)
backend/app/services/graph_tools.py:578
↓ 1 callersFunction_main
()
backend/mcp_server.py:346
↓ 1 callersFunction_make_app
Standalone Flask app that only knows about ``notifications_bp``. Mirrors the helper pattern in ``test_unit_admin_auth.py`` — mounting the blu
backend/tests/test_unit_notifications_config.py:24
↓ 1 callersFunction_make_service
()
backend/tests/test_unit_graph_tools_locale.py:37
↓ 1 callersFunction_make_stub_agent
A SocialAgent backed by camel's STUB model — no API key, no network.
backend/tests/test_smoke_camel_agent.py:35
↓ 1 callersFunction_manifest_path
()
backend/app/services/agent_mcp_tools.py:60
↓ 1 callersFunction_mark_fired
Record (sim_id, status) and return True if this is the first time.
backend/app/services/webhook_service.py:237
↓ 1 callersMethod_maybe_batch_compact_sync
Batch-compact very old individual summaries into one block. When there are more than compact_batch_size compacted rounds sitting indi
backend/scripts/round_memory.py:357
↓ 1 callersFunction_md_outcome_line
(outcome: Optional[dict])
backend/app/services/transcript.py:340
↓ 1 callersFunction_md_resolution_line
(resolution: Optional[dict])
backend/app/services/transcript.py:352
↓ 1 callersFunction_merge_per_platform_trajectories
Merge every ``trajectory_<platform>.json`` in *sim_dir* into a single authoritative ``trajectory.json`` that consumers (drift chart, article g
backend/scripts/belief_integration.py:29
↓ 1 callersFunction_normalise_completed_at
Pick the completion timestamp for a completed sim. ``state.json.updated_at`` is what ``simulation_runner`` writes on the terminal-state trans
backend/app/services/batch_status.py:193
↓ 1 callersFunction_normalise_completed_at
Pick the completion timestamp for a completed sim. ``state.json.updated_at`` is what ``simulation_runner`` writes on the terminal-state trans
backend/app/services/activity_feed.py:219
↓ 1 callersFunction_normalize_base_url
Strip the trailing slash so we can append ``/share/<id>`` cleanly. The share blueprint already calls ``.rstrip("/")``; keeping the same norma
backend/app/services/frame_metadata.py:134
↓ 1 callersFunction_normalize_country
Lowercase + strip; empty → ``None``. Matches manager.create_simulation.
backend/app/services/clone_service.py:176
↓ 1 callersFunction_normalize_demographic_filters
Pass-through dict; drop non-dict (matches /create's coercion).
backend/app/services/clone_service.py:165
↓ 1 callersMethod_normalize_gender
Normalize gender field to Wonderwall required English format Wonderwall requires: male, female, other
backend/app/services/wonderwall_profile_generator.py:1340
↓ 1 callersFunction_normalize_preview
Whitespace-collapse + length-clamp the preview before hashing/sending.
backend/app/api/simulation.py:366
↓ 1 callersFunction_normalize_topics
Coerce ``interested_topics`` to a list of trimmed strings. Drops empty entries and de-duplicates while preserving order so a consumer iterati
backend/app/services/agent_export.py:195
↓ 1 callersFunction_oembed_allowed_hosts
Hosts an inbound oEmbed ``url`` is allowed to belong to. A consumer hands us the canonical share URL it scraped the discovery tag from; we on
backend/app/api/share.py:299
↓ 1 callersFunction_optional_int
Int or ``None`` when missing / unparseable.
backend/app/services/agent_export.py:178
↓ 1 callersMethod_parse_event_config
Parse event configuration result
backend/app/services/simulation_config_generator.py:742
↓ 1 callersFunction_parse_model_json
Parse model output as JSON, tolerating ``` fences and stray prose.
backend/app/utils/url_fetcher.py:75
↓ 1 callersFunction_parse_status_code_from_message
Extract the integer HTTP status from an ``HTTP <N>`` message. Returns ``None`` for network errors / serialization failures / anything that is
backend/app/services/webhook_service.py:378
↓ 1 callersMethod_parse_time_config
Parse time configuration result and validate agents_per_hour values don't exceed total agent count
backend/app/services/simulation_config_generator.py:627
↓ 1 callersFunction_participating_agents
Count agents that posted at least once in this round. ``active_agent_count`` is the runner's recorded headline number; we prefer the ``viral_
backend/app/services/trajectory_export.py:106
↓ 1 callersFunction_payload_confidence_pct
Return the leading-stance percentage from ``final_consensus``. Used as the confidence proxy for the high/medium-confidence filter tokens. ``m
backend/app/services/webhook_service.py:514
↓ 1 callersFunction_payload_direction
Pick the dominant stance bucket from ``final_consensus``. Returns ``"bullish"`` / ``"neutral"`` / ``"bearish"`` using the same ``>=`` plurali
backend/app/services/webhook_service.py:483
↓ 1 callersFunction_payload_quality_key
Return the normalised lowercase quality bucket — ``"excellent"`` / ``"good"`` / etc — or ``None`` if no quality is recorded. ``quality_health
backend/app/services/webhook_service.py:536
↓ 1 callersFunction_phase_from_prompt_type
(prompt_type: str)
backend/app/utils/llm_client.py:72
↓ 1 callersFunction_pick_leader
Return the plurality stance key. Tie-breaks in a fixed order: ``bullish`` > ``bearish`` > ``neutral``. A live tie at one-decimal-rounded perc
backend/app/services/signal_service.py:125
↓ 1 callersMethod_pick_seed_uuids
Top-K entity UUIDs to use as traversal seeds (from vector + BM25 hits).
backend/app/storage/search_service.py:149
↓ 1 callersFunction_platforms_summary
Render the platforms block as a one-line summary for the header. Mirrors the EmbedDialog's ``reproPlatformsLabel`` so the notebook header mat
backend/app/services/notebook_export.py:149
↓ 1 callersFunction_polyline_points
Build an SVG ``points`` attribute string for one stance series. Each row contributes ``x,y`` where x comes from the round number and y from t
backend/app/services/chart_svg.py:128
↓ 1 callersFunction_post_json
Issue the POST. Returns ``(ok, message)`` — never raises.
backend/app/services/discord_notify.py:275
↓ 1 callersFunction_post_json
Issue the POST. Returns ``(ok, message)`` — never raises.
backend/app/services/telegram_notify.py:343
↓ 1 callersFunction_post_json
Issue the POST. Returns ``(ok, message)`` — never raises.
backend/app/services/slack_notify.py:272
↓ 1 callersMethod_post_process_report
Post-process report content 1. Remove duplicate headings 2. Keep report main title (#) and section titles (##), remove other
backend/app/services/report_agent.py:3400
↓ 1 callersMethod_print_generated_profile
Output generated persona to console in real time (full content, no truncation)
backend/app/services/wonderwall_profile_generator.py:1233
↓ 1 callersFunction_probe_neo4j
Best-effort liveness + graph count. Never raises.
backend/app/api/mcp.py:221
↓ 1 callersFunction_promote_counterfactual_if_due
Convert a queued counterfactual into a director event when its round arrives. Preset branches and the /branch-counterfactual endpoint write a one
backend/scripts/director_events.py:83
↓ 1 callersFunction_prompt_type_from_caller
Best-effort caller → prompt_type. Falls back to the function name.
backend/app/utils/llm_client.py:64
↓ 1 callersMethod_push
Called by EventLogger writer thread.
backend/app/utils/event_logger.py:284
← previousnext →901–1,000 of 3,647, ranked by callers