| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
refactor(slidea,deep_research): consolidate deep_research output layout Two related changes that pull deep_research artifacts from scattered locations into one per-run / per-session directory. 1. Per-invocation workspace_dir replaces module-level constant. core/deep_research/context.py used to compute WORKSPACE_DIR at import time as <output_root>/research_workspace — a shared directory that mixed artifacts from every invocation. Now each caller injects workspace_dir through LangGraph config['configurable']: - slidea's deep_research_node sets it to <run_dir>/research/ - scripts/run_deep_research.py sets it to <output_root>/<session_id>/ reporter_node's filename changes from {title[:30]}.md to fixed deep_report.md so slidea's cache-reuse check on <run_dir>/research/deep_report.md lines up without an extra copy. The separate save_text() in deep_research_node is dropped because reporter_node now writes directly to the right location. 2. Per-run sqlite checkpointer. Both run_deep_research.py and run_ppt_pipeline.py now write their LangGraph sqlite to <run_dir>/checkpointer.sqlite (deep_research: <session_id>/checkpointer.sqlite) instead of <output_root>/dr_db/ and the process CWD respectively. The CWD placement in run_ppt_pipeline.py was a latent bug — sqlite landed wherever the pipeline was launched from. The cleanup loop is unchanged; only the target path moves. Docs: - deep_research/SKILL.md: drop the dr_db cleanup guidance; document the per-session layout and the auto-cleanup of checkpointer on success. - slidea/SKILL.md: drop the db_data cleanup guidance — that directory never existed in code, only in docs. - caching-and-paths.md: directory tree now shows research/ as {research.json (simple) | deep_report.md + todo_*.txt (deep)} and the new checkpointer.sqlite entry; Cleaning Up section rewrites around the per-run sqlite. - staged-execution.md: distinguish simple/deep research outputs in the stage table. - deep_research/.env.example: add OUTPUT_DIR option — deep_research already consumed output_files_dir via the shared config module, this just surfaces the knob to users. Verified end-to-end: - deep_research standalone (Python GIL topic, ~8 min): deep_report.md and todo_*.txt land at <session_id>/, no research_workspace/, no dr_db/, checkpointer.sqlite cleaned on success. - slidea deep mode (Python GIL topic, ~5 min, 5-page PPTX): all deep research artifacts under <run_id>/research/, no stray sqlite in the skill install dir (latent CWD bug fixed). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> | 17 天前 | |
fix(slidea): staged execution output layout + session-id safety Six interrelated bugs uncovered when running --stages outline,render against a real Tavily-enabled environment. All changes orbit the same theme: ensure each run's artifacts land in exactly one directory, and make session-id a safe key for run_id recovery. 1. Staged render lost config — generate_pages_node did not accept or thread config, so prepare_generation_context_node inside the SVG subgraph could not see run_id and silently fell back to creating a new directory at the output root. Result: parse/research/thought/ outline landed in <run_id>/ but render landed in a fresh <new_ts>_<topic>/ (without the slides/ wrapper). Fixed by adding config parameter to generate_pages_node and passing config=config at the call site (run_ppt_pipeline.py:417). 2. Staged mode did not auto-recover run_id — only --resume went through _find_run_id_by_session. --stages <non-all> always generated a new run_id, so two staged invocations with the same --session-id created two directories. Fixed by adding a staged branch to the run_id resolver that prefers session-id recovery and only falls through to new_semantic_run_id when no prior run.json matches. 3. slides/svg/ nesting broke relative image paths — SVGs referenced images as images/xxx.png but lived under slides/svg/ while images were at slides/images/, so the relative path resolved to slides/svg/images/xxx.png (did not exist). On-disk SVGs were un- viewable in browsers; PPTX export only worked because the inliner had a .parent fallback. Root cause: _svg_page_filename returned svg/<name> (with prefix). Removed the prefix so SVGs sit directly under slides/, updated all readers (svg_dir fields in ppt.json, patch_render_missing.py, run_ppt_pipeline.py cached-svg lookup), test fixtures, and every doc that mentioned slides/svg/. 4. patch_render_missing save_dir fallback created orphan directory — when patch-render was called on a run that never rendered (no ppt.json), _resolve_save_dir fell back to <output_root>/<topic> with no timestamp prefix. Fixed to use <out_dir>/slides, matching the standard layout. 5. prepare_generation_context_node silently fell back when config was missing — this is why bug #1 above was able to lurk. Changed both SVG and HTML routes to raise RuntimeError when neither state.save_dir nor config-derived cache_dir is available, so future regressions surface immediately instead of contaminating the output root. 6. Default session-id "local" could collide across unrelated runs — staged-mode recovery would silently pick one of the matching runs (filesystem glob order, non-deterministic) and write into it, potentially overwriting an unrelated task's PPTX. Three-layer fix: - Auto-generate session-id (auto_<pid>_<ts>) when --session-id is omitted, so unrelated runs can never collide. - Detect multi-run collisions in _find_run_id_by_session: if multiple original runs match the same session-id, refuse to guess, log a WARNING listing the candidates, and return empty so the caller falls through to a fresh run_id. - Log INFO on successful recovery with the recovered run_id and a preview of the original request text, so users can verify the right run was picked. Also fixes: test stubs in test_cli_stage_smoke.py needed the new config kwarg on generate_pages_node, and needed explicit --session-id local to match existing fixtures once the default stopped being "local". Docs cleanup: --run-id is no longer advertised as a required flag for staged execution (auto-recovery handles it). staged-execution.md, quickstart.md, cli.md, svg-route.md examples all drop --run-id and use --session-id alone. caching-and-paths.md gains a Session-id Collision Detection section. Verified end-to-end with real Tavily keys: - Staged outline,render across two invocations with the same --session-id produces a single run directory (no split). - Deep-mode full pipeline with real images: 4 SVGs at slides/, 54 images at slides/images/, all 7 image hrefs resolve correctly, PPTX exported at 332 KB. - Collision detection unit-tested with two synthetic runs sharing a session-id: WARNING emitted, empty result, no contamination. - Auto session-id unit-tested: each invocation gets a unique auto_<pid>_<ts>, INFO log announces the generated value. - All 16 pipeline-contract + patch-render tests pass. cli_stage_smoke passes except 4 pre-existing langgraph-import errors unrelated to these changes. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> | 16 天前 | |
fix(slidea): run_id correctness — tz-aware timestamp and resume reuse Two related fixes around run_id generation: 1. CI flagged scripts/run_ppt_pipeline.py:34 (new_semantic_run_id) for using datetime.now() without tz, violating rule G.PSL.02. Same pattern existed in core/utils/cache.py:new_run_id. Both now use datetime.now(timezone.utc).astimezone(), matching the existing pattern in svg_page_generators/node.py. 2. Resume flow was creating a second cache directory and splitting artifacts across both. Root cause: under --resume, args.text is empty, so new_semantic_run_id("") fell back to a fresh _ppt-suffixed run_id. The LangGraph checkpoint kept the original save_dir from state, but config["configurable"]["run_id"] carried the NEW id, so render-stage output (which reads from config) landed in the new dir while parse-stage output stayed in the original. Fix: _find_run_id_by_session scans output/*/run.json for a matching session_id, filters out resume-attempt records (resume: true), and returns the ORIGINAL run_id. main() uses this on --resume so the cache directory is reused instead of duplicated. If no prior run matches the session_id, the CLI fails with a clear error instead of silently starting a new run. Verified via unit-level: _find_run_id_by_session correctly recovers the original semantic-suffix run_id from the existing buggy artifacts and skips the resume-attempt record. Signed-off-by: Zhukunpeng <zhukunpeng8@huawei.com> | 18 天前 | |
slidea: init. Adding a fully open-source AI-powered PPT generation skill whose name is slidea Signed-off-by: JiangYifei <jiangyifei@huawei.com> Signed-off-by: WanBo <wanbo13@huawei.com> Signed-off-by: SuBo <subo7@huawei.com> Signed-off-by: Zhukunpeng <zhukunpeng8@huawei.com> Signed-off-by: Bin Wu <wu.wubin@huawei.com> | 3 个月前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 17 天前 | ||
| 16 天前 | ||
| 18 天前 | ||
| 3 个月前 |