Commit Graph

72 Commits

Author SHA1 Message Date
anadoris007 484689735f feat(narrative): add GodModeView, WorldBuilderView, cinematic locations
- New Vue views: GodModeView (inject event, modify emotions with
  preloaded current values, kill character with typed-name
  confirmation) and WorldBuilderView (rules editor, locations with
  cinematic atmosphere field, event log viewer)
- Shared sim-nav strip across Story/GodMode/World views
- Location schema extended with optional atmosphere field — a short
  mood phrase that anchors the opening visual of every scene set there
- Translator's _format_world_locations surfaces atmosphere to the LLM
  prompt so the field actually influences generation
- Routes added for /godmode/:simId and /world/:simId

Tests: 39/39 passing (added test_location_atmosphere_surfaces_in_prompt).
Frontend builds clean.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-22 15:01:08 +05:30
anadoris007 d3bec344c7 feat(narrative): extend translator with world context + dead filter
- PROSE_PROMPT_TEMPLATE extended with world_rules, world_events,
  world_locations, and event_enforcement substitution fields
- EVENT_ENFORCEMENT_STRENGTH set to "hard" — opening line MUST
  reference the most recent world event (aligns with existing
  punchy, cinematic voice)
- Character summaries now resolve location id → name for prompts
- translate_round loads world_state and filters dead characters
  from both the roster and the action list before prose generation
- User-supplied strings (rules, events, locations) brace-escaped
  before str.format() to prevent KeyError on stray { or }

Tests: 36/36 passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-22 14:54:22 +05:30
anadoris007 a569976d55 feat(narrative): add god_mode.kill_character with auto-death event 2026-04-20 22:25:24 +05:30
anadoris007 f25f68837c feat(narrative): add god_mode.modify_emotion with audit logging 2026-04-20 22:24:54 +05:30
anadoris007 f91dd00f37 feat(narrative): add god_mode.inject_event handler 2026-04-20 22:24:28 +05:30
anadoris007 16b7ef7521 feat(narrative): set status=alive on new characters 2026-04-20 22:23:59 +05:30
anadoris007 1a73b7f672 feat(narrative): add WorldStateStore for rules, locations, event log 2026-04-20 22:23:38 +05:30
anadoris007 caec8b5c77 feat(narrative): orchestrate round translation with state updates
translate_round() ties together:
  - reading the round's actions from actions.jsonl
  - generating prose via the LLM
  - updating per-character emotional state
  - persisting the beat, characters, and file offset

Full test suite now at 19/19 passing across action mapper, character
engine, story store, and translator.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-20 22:01:19 +05:30
anadoris007 9db7b399cc feat(narrative): add LLM-driven prose generation
Module-level call_llm() wrapper (patchable by tests) drives
PROSE_PROMPT_TEMPLATE rendering with character summaries, actions,
previous beats, and user-selected tone. Prompt tuned for punchy,
cinematic, dialogue-heavy voice.

Tests: 5/5 passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-20 22:00:29 +05:30
anadoris007 052fd87acd feat(narrative): add actions.jsonl round reader
Reads one round's worth of agent actions from the OASIS log file,
tracking file offset so callers can resume across translation calls.
Handles missing files, malformed JSON lines, and non-target rounds
gracefully.

Tests: 3/3 passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-20 21:29:15 +05:30
anadoris007 6b9e6eeeb2 feat(narrative): add CharacterEngine with emotional state tracking
Character profiles now track a six-dimension emotional state (anger,
fear, joy, sadness, trust, surprise) that evolves based on actions
taken. Initial deltas for all 13 OASIS actions chosen as a balanced
baseline (see module docstring for tuning guidance).

Tests: 5/5 passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-20 21:28:30 +05:30
anadoris007 05aa9f149e feat(narrative): add StoryStore for file-based narrative persistence
Three JSON files per simulation under narrative/ subdir:
- story_beats.json: chronological story passages
- translator_state.json: per-platform file offsets
- characters.json: extended character profiles

Tests: 4/4 passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-20 20:50:55 +05:30
anadoris007 2d782f04c1 feat(narrative): add action-to-verb mapping for OASIS actions
New narrative package with action_mapper module that maps the 13 OASIS
action types (CREATE_POST, LIKE_POST, REPOST, etc.) to narrative verbs
and interpretations used when generating story prose.

Tests: 4/4 passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-20 20:50:05 +05:30
BaiFu af71244974
Merge pull request #428 from Ghostubborn/feat/i18n
feat(i18n): 添加多语言切换功能,支持中英文
2026-04-02 14:27:04 +08:00
ghostubborn 24e9bee5be feat(i18n): replace all user-visible Chinese logger messages in zep_tools.py
These are shown to users via ConsoleLogger in the report page.
2026-04-01 17:46:39 +08:00
ghostubborn e79569ab4f feat(i18n): replace all user-visible Chinese in report_agent.py
Covers ReportLogger message fields and logger messages shown via ConsoleLogger.
2026-04-01 17:44:52 +08:00
666ghj e3350a919d fix(graph): enforce PascalCase for entity names and SCREAMING_SNAKE_CASE for edge names in ontology validation 2026-04-01 17:42:27 +08:00
ghostubborn 0e55e4cf6b feat(i18n): replace remaining Chinese in config generator and profile generator
Also update simulation prompts to be locale-neutral for timezone/schedule.
2026-04-01 17:19:12 +08:00
ghostubborn 7c07237544 fix(i18n): pass locale to background threads via thread-local storage
Background threads (graph building, simulation prep, report generation,
profile generation) now inherit the requesting user's locale preference.
Previously these fell back to 'zh' because Flask request context was
unavailable in spawned threads.
2026-04-01 16:55:51 +08:00
ghostubborn 592ee52f59 feat(i18n): replace remaining hardcoded Chinese in progress callbacks 2026-04-01 16:53:29 +08:00
ghostubborn da2490ec31 fix(i18n): protect JSON field values from language instruction in config generator
Ensure poster_type stays PascalCase English and stance stays English enum
values regardless of language setting. Only natural language fields follow
the user's language preference.
2026-04-01 16:41:22 +08:00
ghostubborn 97aa58384e fix(i18n): ensure ontology names stay PascalCase regardless of language setting
The language instruction was causing LLM to change entity/relation naming
conventions. Now explicitly enforce PascalCase/UPPER_SNAKE_CASE for technical
identifiers while only applying language preference to description fields.
2026-04-01 16:40:17 +08:00
ghostubborn 9d43b77511 feat(i18n): replace hardcoded Chinese in backend SSE progress messages 2026-04-01 16:32:10 +08:00
ghostubborn f75c6487b3 fix(i18n): replace remaining hardcoded language directives in LLM prompts
- oasis_profile_generator: replace hardcoded "使用中文" with dynamic get_language_instruction()
- ontology_generator: remove hardcoded "(中文)" from schema annotation
- report_agent: replace Chinese-specific language consistency rules with language-neutral ones
- zep_tools: dynamically select quote style based on locale
2026-04-01 15:55:04 +08:00
ghostubborn 8f6110df0f feat(i18n): inject language instruction into LLM system prompts 2026-04-01 15:24:12 +08:00
666ghj da6548e96f feat(graph): implement pagination for fetching nodes and edges; add utility functions for streamlined data retrieval 2026-02-27 15:53:29 +08:00
666ghj 25aa4f75d2 fix(report_agent): refine tool call handling and response validation; enforce strict separation between tool calls and final answers 2026-02-24 17:47:44 +08:00
666ghj 08ec856a58 fix(report_agent): update max_agents parameter description and enforce maximum limit of 10 agents 2026-02-14 18:35:05 +08:00
666ghj ddd9ff2479 feat(report_agent): update report language consistency guidelines; ensure all quoted content is translated to the report language for clarity 2026-02-14 18:24:03 +08:00
666ghj 7601d78fd4 feat(report_agent): enhance interview text processing and response handling; improve quote extraction and formatting for better clarity 2026-02-14 16:56:48 +08:00
666ghj dc0a9261d1 feat(report_agent): add detailed tool descriptions and prompts for future prediction report generation 2026-02-14 15:16:17 +08:00
666ghj d2041f6fb8 fix(report_agent): update description of insight_forge tool to remove "最强大" and enhance clarity 2026-02-14 14:48:23 +08:00
666ghj 0a59bace92 fix(report_agent): increase minimum tool call requirement from 2 to 3 per chapter and enhance user prompts to encourage diverse tool usage 2026-02-06 19:37:52 +08:00
666ghj e004fe8f14 fix(report_agent): update tool call requirements in content generation to allow up to 5 tool calls per chapter and clarify user prompts for insufficient data 2026-02-06 18:34:19 +08:00
666ghj f9abaf8e9f refactor(report_agent, Step4Report): simplify logging and remove subsection handling; update UI to reflect changes in section content generation 2026-02-06 18:13:30 +08:00
666ghj 54f1291967 fix(report_agent): handle None responses from LLM during content generation and enforce fallback behavior 2026-01-29 17:08:39 +08:00
666ghj 56b8babf17 feat(ZepGraphMemoryUpdater): add platform display name mapping and logging enhancements. 2026-01-16 09:00:10 +08:00
666ghj e6da45ee63 feat(history): 添加首页历史项目展示组件
- 新增 HistoryDatabase.vue 组件,实现扇形堆叠到网格展开的动画效果
- 后端 simulation.py 添加历史模拟数据 API 支持
- 修复 SimulationManager 过滤隐藏文件问题
- 前端 simulation.js 添加获取历史模拟数据的 API 方法
- Home.vue 集成历史项目展示组件
- 实现正方形网格背景装饰效果
2025-12-31 17:54:39 +08:00
666ghj 4be144c3f2 Refactor process termination in SimulationRunner to support cross-platform handling and improve code clarity. Update development script to ensure concurrent processes are terminated correctly. 2025-12-30 17:45:27 +08:00
666ghj 8bd768718e Add SIGHUP signal handling in SimulationRunner for Unix systems 2025-12-30 15:28:26 +08:00
666ghj 067855f7b5 Add UTF-8 encoding support for Windows in simulation_runner.py and run_parallel_simulation.py to resolve character encoding issues with third-party libraries. 2025-12-26 18:14:57 +08:00
666ghj 99c1b199d5 Update ReportAgent to reduce maximum tool calls and iterations for improved efficiency
- Decreased the maximum tool calls per section from 8 to 5.
- Reduced the maximum iterations in the ReACT loop from 8 to 5, streamlining the report generation process.
2025-12-16 22:47:14 +08:00
666ghj cb47e9859c Update ReportAgent to enhance report retrieval and streamline tool call process
- Reduced maximum tool calls per chat from 5 to 2 for improved efficiency.
- Simplified system prompt to focus on concise responses and report content.
- Implemented report content retrieval with length limitation to prevent context overflow.
- Adjusted tool call execution to limit to one call per iteration, enhancing clarity in responses.
- Updated user message prompts to encourage concise answers based on retrieved data.
2025-12-16 17:59:34 +08:00
666ghj 0fa2363104 Update maximum limits for tool calls and iterations in ReportAgent class
- Increased the maximum tool calls per section from 4 to 8, enhancing the agent's capabilities.
- Raised the maximum reflection rounds from 2 to 3 to allow for deeper analysis.
- Adjusted the maximum tool calls per chat from 3 to 5 for improved interaction.
- Expanded the maximum agents for interviews from 5 to 20, facilitating more comprehensive data gathering.
- Increased the maximum iterations for ReACT loops from 5 to 8 and from 3 to 5 in different contexts, optimizing the report generation process.
2025-12-14 23:36:44 +08:00
666ghj a097de4094 Enhance text output formatting and remove truncation in zep_tools.py
- Updated the `to_text` method in the `PanoramaResult` class to provide complete outputs for current facts, historical facts, and involved entities, improving data visibility.
- Modified the `to_text` method in the `AgentInterview` class to display the full agent bio without truncation.
- Adjusted the `ZepToolsService` class to retrieve all related entity details and facts without limiting the output, ensuring comprehensive data representation.
2025-12-14 22:41:46 +08:00
666ghj 9be2c28a5d Refactor report logging and enhance report generation features
- Renamed log_section_complete to log_section_content to better reflect its purpose, and added is_subsection parameter for improved logging of subsection content.
- Introduced log_section_full_complete method to log the completion of entire sections, including all subsections, enhancing tracking of report generation status.
- Adjusted maximum tool call limits for sections and chats to optimize performance during report generation.
- Updated system prompts and user prompts in the ReportAgent class to clarify the report's focus on future predictions rather than current analysis.
- Enhanced the Step3Simulation and Step4Report components for improved user experience, including UI updates and better handling of report generation states.
2025-12-14 03:28:41 +08:00
666ghj fde79721e8 Enhance agent bio display and tool result presentation in Step4Report component
- Updated the AgentInterview class to display the full agent bio, truncating only if it exceeds 1000 characters for better readability.
- Enhanced the Step4Report component to include structured display for tool results, allowing users to toggle between raw and structured views for various tools, improving user experience and clarity.
- Introduced new components for parsing and displaying results from different tools, including InsightForge, PanoramaSearch, InterviewAgents, and QuickSearch, providing a comprehensive view of the data.
2025-12-14 01:29:57 +08:00
666ghj b4435e273a Add report ID generation and logging features for report generation process
- Introduced a unique report ID generation mechanism to enhance tracking and management of reports.
- Implemented detailed logging for the report generation process, including agent actions, planning stages, and tool calls, improving traceability and debugging.
- Added new API endpoints for retrieving agent and console logs, allowing users to access detailed execution logs and console outputs during report generation.
- Enhanced the frontend GraphPanel component with a notification for users when simulations finish, improving user experience and feedback.
2025-12-13 21:11:14 +08:00
666ghj 8949ae6761 Enhance report generation process with improved formatting and content management
- Introduced strict formatting guidelines for chapter content, prohibiting the use of Markdown headers and emphasizing the use of bold text for section titles.
- Implemented a new method to save chapters along with their subsections into a single file, streamlining the report structure.
- Added content cleaning functionality to remove duplicate titles and ensure proper formatting before saving.
- Enhanced the report assembly process to include post-processing for title management and improved readability.
2025-12-13 19:13:14 +08:00
666ghj d768fd1ea2 Enhance simulation file management and frontend status display
- Updated SimulationRunner to include additional files for deletion, specifically Twitter and Reddit simulation databases, and environment status files.
- Refactored Step3Simulation component to streamline the status display, removing unnecessary conditions and improving the user interface for simulation phases.
- Introduced a reset function to clear all simulation states before starting a new simulation, ensuring a clean environment for each run.
2025-12-12 16:44:05 +08:00