Commit Graph

207 Commits

Author SHA1 Message Date
yuzhiran a4242ada0e fix: search_rankings missing columns 500 error + campaigns.html var typo
database.py: add 5 missing search_rankings columns (ai_search_engine, citation_snippet, citation_url, geo_score, content_type) - caused /api/seo/rankings Internal Server Error

campaigns.html: fix template referencing rankingOverview instead of keywordRankingOverview

Ultraworked with Sisyphus

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-24 16:55:12 +08:00
yuzhiran d11d7f4980 fix: pipeline content tracking + topic article preview
db_helper.py: save_article now calculates and persists word_count
generator.py: run_creator_blocking sets word_count for HTML-imported articles
writer.py: fix title regex stripping content-leading numbers (35岁后→岁后)
trends.py: fix Baidu hot_score str/int type comparison crash
database.py: add missing content_tasks.org_id ALTER TABLE migration
schemas.py + topics.py: topic list API returns article_count + articles[] previews
topics.html: table view and card view show article badges with word counts, clickable to open preview

Ultraworked with Sisyphus

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-24 12:31:02 +08:00
yuzhiran 57e6e16c11 docs: finalize DB cleanup - delete 5 old TopicFields + 5 stale TrendFieldMapping rows 2026-06-23 18:36:54 +08:00
yuzhiran 187b414193 docs: document DB cleanup Phase F (32 old topics + 66 articles + 5 tasks removed)
Records the DB cleanup executed on 2026-06-23: cascade-deleted 32 sustainability/carbon topics, 66 articles, 5 tasks. Deactivated orphan TopicFields (科技人文交叉, 测试). 15 AI/tech topics remain.

Ultraworked with Sisyphus

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-23 17:45:45 +08:00
yuzhiran 56c9376c58 docs: document brand optimization v25.1 (brand tone, SEO/GEO, sources, series column, WeChat publisher)
PROGRESS.md: adds Phase A-F brand optimization to v25 section covering 6 prompt brand tone injection, long-tail SEO keywords, differentiated sources (machine-intelligence/arXiv/indie dev/industry reports/AI products), series column feature, and WeChat publisher blocked status.

Ultraworked with Sisyphus

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-23 13:32:23 +08:00
yuzhiran 302efd5f2d fix(ui): responsive mobile layout with auth flow refactoring for campaigns
Adds: v-cloak fix, mobile card-list views for all tables, responsive CSS breakpoints, early auth redirect, CDN script reorder to head, ElementPlusIconsVue safety check, global ElMessage reference. Moves async mounted to .then() pattern to avoid Vue 3 SFC issues.

Ultraworked with Sisyphus

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-23 13:30:19 +08:00
yuzhiran 897f72012f chore(cleanup): remove old content ideas and sustainability data
Deleted: 10 legacy topic cards (001-010), README from content/ideas/, old sustainability_topics.json, test-fix notification. These belonged to deprecated 'sustainable living' content pillar.

Ultraworked with Sisyphus

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-23 13:26:50 +08:00
yuzhiran 0258a9af9f feat(script): add DB migration script for content focus refactoring
Comprehensive DB migration: TopicField cleanup (5 old deactivated, 3 new updated), Topic reassignment (43/47 migrated), Article cleanup (15 deleted), CollectorCategory/Cleaning (12 old deactivated), TrendFieldMapping sync (11 entries)

Ultraworked with Sisyphus

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-23 13:26:22 +08:00
yuzhiran 9058539bae feat(config): add differentiated information sources (arXiv/indie dev/industry reports)
Adds 5 new sources: machine-intelligence RSS, arXiv paper search, indie developer search, industry data report search, AI product changelog search. Differentiates from generic AI media.

Ultraworked with Sisyphus

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-23 13:25:39 +08:00
yuzhiran 9fba863ce7 feat(config): align content strategy with brand direction
initial_data: field descriptions humanized, collector search queries include long-tail keywords, platform formats updated collector.py: DEFAULT_CHINA_PAINS expanded with specific pain questions (e.g. '35岁学AI来得及吗') topic_selector.py: domain mapping 11->18 entries (Prompt/AI编程/AI写作/数据隐私/AI教育/一人企业)

Ultraworked with Sisyphus

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-23 13:25:11 +08:00
yuzhiran 45ad5443c1 feat(prompt): inject brand tone into 6 platform prompts
Section expansion: zhihu (unique data + debate), wechat (tech-humanity reflection), xiaohongshu (real usage data) Title optimize: all 3 platforms aligned with new brand direction

Ultraworked with Sisyphus

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-23 13:24:38 +08:00
yuzhiran ef289b18d1 feat(ui): add series filter to topics search area
Adds column/category filter dropdown in topics.html search form, with seriesOptions computed and filteredTopics logic

Ultraworked with Sisyphus

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-23 13:23:19 +08:00
yuzhiran f1e6c11505 feat(models): add series column to Topic for content columns
Topic model: new series VARCHAR field (optional, indexed)
Schema: series in TopicBase/TopicCreate/TopicUpdate
API: GET /api/topics supports ?series= query param
DB migration: ALTER TABLE topics ADD COLUMN series

Ultraworked with Sisyphus

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-23 13:22:13 +08:00
yuzhiran e9cd0374f4 feat(script): SEO auditor + PROGRESS.md v24 update
Add seo_auditor.py - crawls external websites, scores 6 SEO dimensions (meta/heading/content/performance/links/mobile), generates optimization tasks. Update PROGRESS.md with v24 external promotion feature.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-21 16:07:43 +08:00
yuzhiran 8a04a23e86 feat(ui): external promotion dashboard (campaigns.html)
Add campaigns.html with 6 tabs (Overview/Products/Campaigns/Rankings/Audits/Tasks) using Vue 3 + Element Plus CDN. Add nav entry to uni-nav.js.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-21 16:06:46 +08:00
yuzhiran 8f5a9e7ede feat(api): external promotion CRUD + audit endpoints
Add 20 API endpoints under /api/external/* covering products, campaigns, keywords, audits, rankings, optimization tasks with org_id filtering.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-21 16:05:55 +08:00
yuzhiran 12e49f2811 feat(models): add external promotion tables (6 models)
Add ExternalProduct, PromotionCampaign, CampaignKeyword, SEOAudit, KeywordRanking, OptimizationTask models and 18 Pydantic schemas for the external promotion module.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-21 16:04:52 +08:00
yuzhiran 81f89f6f00 docs: PROGRESS.md - landing fixes, v23 verification, cleanup
Mark landing OG image creation, GitHub link fix, nav bug fix.
Add v23 feature verification results (12 pages 200, org_id, RBAC).
Update last-updated date. Clean up completed todos.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-18 16:28:55 +08:00
yuzhiran a692f1dd44 fix: landing OG image + GitHub link
Create og-landing.png (1200x630, 62KB) for OG meta tag.
Fix GitHub link placeholder (your-org -> github.com).

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-18 16:27:59 +08:00
Yuzhiran Dev 4b87125683 docs: update PROGRESS.md - M4 complete, remaining TODOs done 2026-06-18 08:16:35 +08:00
Yuzhiran Dev 5a19e77d27 feat: rank_tracker AI citation + admin task management tab 2026-06-17 20:42:37 +08:00
Yuzhiran Dev d3ea832b3b feat: admin.html task management tab (TaskConfig + TaskLog timeline)
- Add 任务管理 tab button
- Show all 7 task modules table with enable/disable switch, schedule, params
- Edit dialog for schedule/params editing
- Click module to show el-timeline of recent 30 run logs
- View result data dialog
- Supports toggleModule, saveTaskConfig, loadTaskLogs
2026-06-17 20:10:56 +08:00
Yuzhiran Dev 1ff015e281 docs: v23 PROGRESS.md + archive WORKSPACE_REDESIGN.md 2026-06-17 18:33:19 +08:00
Yuzhiran Dev f6e5e90736 feat: Wave 3 - Dashboard redesign + RBAC + AI assistant updates
- Redesign index.html from system-monitor to user-centric workspace
  (welcome banner, summary cards, 今日待办, AI 智能建议, collapsible admin section)
- Add fetchTodos/fetchSuggestions/getPriorityClass/isOverdue methods
- Update uni-nav current-page from 'dashboard' to 'workspace'
- Add require_role to 10 admin router imports (RBAC foundation)
- Update ai-assistant.js: add factory/insights pages, org_id in chat requests
2026-06-17 18:24:57 +08:00
Yuzhiran Dev 5caf7bc52e feat: Wave 2 - API org isolation + factory.html + insights.html
- Add org_id auto-population to articles.py, publishing.py, metrics.py
- Add org_id filtering to search_rankings.py geo endpoints
- Add org_id to calendar.py create/update/delete endpoints
- Add org_id to tasks.py create endpoints
- Create factory.html content pipeline page (3-tab: 待创作/进行中/待审查)
- Create insights.html analytics page (4-tab: 概览/搜索排名/GEO/平台对比)
2026-06-17 16:13:48 +08:00
Yuzhiran Dev dcfeccc97b feat(models): add org_id to Article, PublishRecord, ContentMetrics, SearchRanking, GeoReadinessScore
- Add org_id column to 5 models with default='default'
- Update to_dict() methods for ContentMetrics, SearchRanking, GeoReadinessScore
- Add ALTER TABLE migrations in database.py init_db()
- Add org_id to 6 Pydantic response schemas
- Add require_role() helper factory in auth.py
2026-06-17 14:27:27 +08:00
Yuzhiran Dev 00431c827b feat: add org_id to ContentCalendar and ContentTask models 2026-06-17 09:02:54 +08:00
Yuzhiran Dev c8a5e8fd87 docs: Update PROGRESS.md for v21 GEO and v22 landing page
- v21: GEO tracking (geo_tracker.py, FAQ/HowTo schema, GeoReadinessScore, scheduler, admin tab)
- v22: Landing page (landing.html, routing, responsive design, auth flow changes)
- Commit count: 165 -> 170

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-16 08:28:31 +08:00
Yuzhiran Dev c069a140bb fix: Auth redirects and navigation for landing page routing
- login.html: Post-login redirect / -> /index.html; already-logged-in redirect / -> /index.html
- articles.html, topics.html: Auth failure redirect -> /login.html
- uni-nav.js: Dashboard link / -> /index.html; navigate function fix for prefix handling
- sw.js: Remove / pre-cache; HTML documents use Network First strategy for fresh content

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-16 08:28:06 +08:00
Yuzhiran Dev 24e46eced5 feat: Product landing page at / with responsive design
- landing.html: Full product website (hero, features, how-it-works, platform coverage, pricing, FAQ, CTA, footer)
- main.py: Route / to landing.html (overrides StaticFiles default index.html)
- Workspace dashboard remains at /index.html
- Responsive: desktop nav, hamburger mobile menu, single-column on small screens
- No Vue/Element Plus dependency; standalone HTML+CSS+JS (~30KB)

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-16 08:27:38 +08:00
Yuzhiran Dev f15e0f720a feat: Admin GEO readiness dashboard tab
- New 'GEO 就绪度' tab button in filter bar
- Overview stat cards: total checks, AI citations, citation rate, avg readiness
- AI engine breakdown display (DeepSeek/ChatGPT/Perplexity)
- Readiness scores table with 6-dimension color-coded tags
- Manual GEO tracking trigger button

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-16 08:27:11 +08:00
Yuzhiran Dev 7c9a8b88b4 feat: FAQ/HowTo schema injection and SEO pipeline enhancement
- writer.py: inject_geo_metadata now detects content type (article/listicle/howto/faq/review) and injects appropriate JSON-LD (FAQPage, HowTo, ItemList)
- New helpers: _detect_content_type, _extract_faq_pairs, _extract_howto_steps
- outline.py: _extract_seo_keywords regex support for CJK
- prompt_loader.py: Minor update

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-16 08:26:44 +08:00
Yuzhiran Dev 93d1d511e5 feat: Register scheduled GEO tracker (07:30 daily)
- New MODULE entry: scheduled_geo_tracker
- New LOG_FILE_MAP entry
- New MODULE_JOBS entry
- _run_geo_tracker method: subprocess invokes geo_tracker.py

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-16 08:26:13 +08:00
Yuzhiran Dev 2aedb69efd feat: AI search citation tracking script
scripts/geo_tracker.py: Simulates DeepSeek/ChatGPT/Perplexity queries via LLM to detect article citations. Calculates GEO readiness score (6 dimensions: schema/faq/howto/citations/headings/word_count). Writes results to SearchRanking(search_engine='geo') and GeoReadinessScore tables.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-16 08:25:44 +08:00
Yuzhiran Dev 773080cf4f feat: GEO data model and API endpoints
- SearchRanking: +5 fields (ai_search_engine, citation_snippet, citation_url, geo_score, content_type)
- New GeoReadinessScore model (6-dimension scoring: schema/faq/howto/citations/word_count/readability/headings)
- GET /api/seo/geo/overview, GET /api/seo/geo/readiness, POST /api/seo/geo/track

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-16 08:25:18 +08:00
Yuzhiran Dev 63a6fabc00 fix: Script bug fixes (bare except, timezone, regex, test)
- collector.py, compliance_checker.py, trends.py: bare except -> specific
- db_helper.py: datetime.now() -> timezone.utc (8 occurrences)
- compliance_checker.py: regex \x08 -> \b word boundary + import json
- search_providers.py: minor fixes
- test_new_features.py: service reachability check retry

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-16 08:24:50 +08:00
Yuzhiran Dev d601a26850 fix: API route security fixes (path traversal, auth, bare except)
- articles.py: Path traversal sanitization
- optimizer_logs.py: Admin auth guard
- platform_config.py: Admin auth guard
- system.py: Path traversal whitelist
- topic_config.py: Admin auth guard
- topics.py: Minor fix

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-16 08:23:50 +08:00
Yuzhiran Dev 8595bbc521 feat: GEO/SEO structured data + search ranking tracker 2026-06-09 17:18:09 +08:00
Yuzhiran Dev 23ff63baa9 fix: 三平台内容差异化 + admin敏感词管理表格化
- writer.py: _expand_section() 去除 <100字阈值,始终调用 LLM 平台专属扩写
- prompt_loader.py: 新增 section_expansion_zhihu/wechat/xiaohongshu 三个独立 prompt
- admin.html: 配置管理标签页 + 敏感词/清理规则子标签 + 敏感词表格化管理(编辑/删除)
- config_items.py: PUT /sensitive-words/{id} 支持更新 word/category
- compliance_checker.py: AI 套话从 DB 加载 + 人称规则修正
- initial_data.py: PlatformConfig 字数迁移 + 新种子
- 各前端页面: LLM 配置 rate_limit 字段 + 供应商列表排序
2026-06-08 13:51:35 +08:00
Yuzhiran Dev d0896ef10e fix: _wrap_chinese crash on mixed-width punctuation
_image_generator.py _wrap_chinese 当标题中只有 ASCII 标点
(如 ( ) ?) 而无全角标点时,max() 收到空序列崩溃。

修复:try-except 兜底 + 补充 ASCII 标点到断点列表
2026-06-03 13:13:19 +08:00
Yuzhiran Dev c6628b22f6 fix: 任务抽屉产出结果优化 + server 启动修复
- 任务抽屉产出结果 tab 优先显示 last_message(日志消息),
  过滤 result_data 中的 None/空值
- 修复 tasks.py 因 opencode 块删除导致的 SyntaxError
- 修复 scheduled_generate 存储 None 值问题
- 清理 DB 中旧 scheduled_refresh_search_cache 的 56 条
  TaskLog + 1 条 TaskConfig
- 更新 PROGRESS.md
2026-06-03 11:06:25 +08:00
Yuzhiran Dev 499c511140 chore: opencode冗余清理 + LLM任务级模型选择 + systemd服务化
- 删除 opencode_search.py / mcp_search_server.py 及所有 MCP 引用
- 移除搜索缓存定时任务(scheduled_refresh_search_cache)
- 清理前后端所有 opencode/MCP 代码和注释
- LLM 提供商量换:opencode-go→nvidia(默认)+sensenova(合规审查)
- llm_configs 新增 is_default 字段,API 层互斥逻辑
- 所有定时任务支持独立 LLM 模型选择(LLM_TASK_PROVIDER env)
- compliance_optimizer.py 修复:import os / 解硬编码 / 关键词过滤
- Scheduler 日志修复:始终 INSERT,避免僵尸 running 行
- Systemd 服务化:Restart=always / 单 worker / Type=exec
- 搜索提供商:替换 opencode→360/搜狗/微信(免 Key)
- 更新 AGENTS.md / PROGRESS.md
2026-06-02 15:38:16 +08:00
Yuzhiran Dev abbf1468bc fix(admin): LLM 路由标签动态化
- 默认提供商按 id 排序取第一个活跃的(nvidia step-3.7-flash)
- 合规审查取活跃且 model=deepseek-v4-flash 的(sensenova)
- 不再硬编码
2026-06-01 14:46:22 +08:00
Yuzhiran Dev 53f105305f fix(admin): LLM 路由显示不准确
- 默认路由改为动态取第一个活跃提供商(当前为 nvidia step-3.7-flash)
- 合规审查标签改为固定 sensenova (deepseek-v4-flash)
- 移除硬编码的 opencode-go 标签
2026-06-01 14:42:32 +08:00
Yuzhiran Dev f1dc29f439 fix(llm): 分场景使用不同模型
- nvidia 激活、模型改为 step-3.7-flash → 用于日常生成/采集/优化等
- compliance_optimizer.py 显式指定 provider=sensenova → 合规审查走 deepseek-v4-flash
- _FALLBACK 同步更新为 step-3.7-flash
- 管理后台标签同步更新
2026-06-01 14:35:41 +08:00
Yuzhiran Dev 475945418e feat(llm): LLM 配置完全通过管理后台维护
- _get_provider_config 改从 DB 读取 api_key(.env 为 fallback)
- 前端 admin.html 新增 sensenova provider 选项,默认值更新为 sensenova
- 新增提供商不再需要改代码,后台直接配即可
2026-06-01 14:23:24 +08:00
Yuzhiran Dev 2c17f006fc feat(llm): 添加 sensenova 提供商,替换 opencode-go
_API_KEYS/_FALLBACK 添加 sensenova,DB 中设 is_active=true
与 opencode-go 同模型(deepseek-v4-flash),但走 sensenova 通道
2026-06-01 14:17:36 +08:00
Yuzhiran Dev 31d8434010 fix(llm): call_llm 429 自动 fallback + 移除 compliance 硬编码 provider
- nvidia_client.py 新增 _get_provider_fallback_list() 从 DB 读提供商顺序
- call_llm 循环尝试提供商列表,HTTP 429 自动跳过到下一个
- 移除 compliance_optimizer.py 中硬编码 provider="opencode-go"
- 新增 logging 模块引用
2026-06-01 13:23:35 +08:00
Yuzhiran Dev 09c467e56d ops(systemd): 添加 systemd 服务,自动恢复崩溃进程
- 创建 yzr-platform.service(Restart=always,崩溃后10秒恢复)
- 更新 AGENTS.md 命令文档
- 替换原来的 setsid/nohup 启动方式
2026-06-01 12:56:02 +08:00
Yuzhiran Dev 1084388fec fix(topics): 外键约束导致 delete 400
选题有关联 content_tasks/article/publish_record/metrics 表,
外键约束阻止删除。改为先级联删除关联数据再删选题。

前端同时显示服务端返回的具体错误信息,而不是笼统的 删除失败。
2026-06-01 12:08:51 +08:00