[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-82169":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":8,"htmlUrl":8,"language":9,"languages":8,"totalLinesOfCode":8,"stars":10,"forks":11,"watchers":12,"openIssues":11,"contributorsCount":11,"subscribersCount":11,"size":11,"stars1d":11,"stars7d":13,"stars30d":13,"stars90d":11,"forks30d":11,"starsTrendScore":11,"compositeScore":14,"rankGlobal":8,"rankLanguage":8,"license":15,"archived":16,"fork":16,"defaultBranch":17,"hasWiki":18,"hasPages":18,"topics":19,"createdAt":8,"pushedAt":8,"updatedAt":20,"readmeContent":21,"aiSummary":22,"trendingCount":11,"starSnapshotCount":11,"syncStatus":13,"lastSyncTime":23,"discoverSource":24},82169,"SCOPE","nopnor\u002FSCOPE","nopnor",null,"Python",31,0,29,2,38.2,"MIT License",false,"main",true,[],"2026-06-12 04:01:37","# SCOPE\n\n[![arXiv](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FarXiv-2605.08043-b31b1b.svg)](https:\u002F\u002Farxiv.org\u002Fabs\u002F2605.08043)\n[![Project Page](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FProject-Page-315fbd.svg)](https:\u002F\u002Fnopnor.github.io\u002FSCOPE\u002F)\n[![Dataset](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDataset-Gen--Arena-yellow.svg)](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Frentianfei122\u002FGen-Arena)\n[![License: MIT](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-green.svg)](LICENSE)\n\nOfficial code release for **SCOPE: Structured Decomposition and Conditional Skill Orchestration for Complex Image Generation**.\n\nSCOPE is a specification-guided framework for complex image generation. It represents a prompt as persistent semantic commitments, including entities, constraints, and unknowns, then uses retrieval, reasoning, generation, verification, and repair stages to keep those commitments traceable throughout the generation lifecycle.\n\n- Paper: [arXiv:2605.08043](https:\u002F\u002Farxiv.org\u002Fabs\u002F2605.08043)\n- Project page: [https:\u002F\u002Fnopnor.github.io\u002FSCOPE\u002F](https:\u002F\u002Fnopnor.github.io\u002FSCOPE\u002F)\n- Gen-Arena dataset: [Hugging Face](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Frentianfei122\u002FGen-Arena)\n- Architecture notes: [docs\u002Farchitecture.md](docs\u002Farchitecture.md)\n\n## Overview\n\nComplex image prompts often contain many requirements that must remain identifiable across evidence gathering, prompt synthesis, image generation, verification, and repair. SCOPE treats these requirements as semantic commitments and stores them in a structured specification. Each stage reads and updates this shared specification, allowing downstream actions to target unresolved or violated commitments instead of regenerating blindly.\n\nThis repository contains:\n\n- Codex workflow skills for SCOPE-style agentic generation under `.codex\u002Fskills`\n- Python stage tools, contracts, runtime adapters, and CLIs under `src\u002Fscope`\n- Example runtime configuration files under `configs`\n- Gen-Arena materialization, dispatch, summarization, and evaluation utilities\n- A GitHub Pages project page under `docs`\n\nThe release does not include private credentials, generated experiment outputs, or bundled benchmark data. Download Gen-Arena separately from Hugging Face when running benchmark evaluation.\n\n## Installation\n\nRequirements:\n\n- Python 3.10+\n- Codex CLI for the full agent-driven workflow\n- Optional API keys for image generation, verification, and search backends\n\nInstall the package in editable mode:\n\n```bash\npip install -e .\n```\n\nFor development and tests:\n\n```bash\npip install -e \".[dev]\"\npytest -q\n```\n\n## Configuration\n\nSCOPE reads runtime settings from environment variables. Start from the example file:\n\n```bash\ncp configs\u002Fscope.example.env .env\n```\n\nFor a shell session, you can load the example environment as:\n\n```bash\nset -a\nsource configs\u002Fscope.example.env\nset +a\n```\n\nMain settings:\n\n- `SCOPE_IMAGE_PROVIDER`: image generation provider\n- `SCOPE_IMAGE_API_KEY`: image generation API key\n- `SCOPE_JUDGE_PROVIDER`: verifier provider\n- `SCOPE_JUDGE_API_KEY`: optional verifier API key\n- `SCOPE_SEARCH_PROVIDER`: search provider, for example `serper`\n- `SCOPE_SERPER_API_KEY`: optional Serper API key for external-reference retrieval\n\nThe corresponding YAML example is [configs\u002Fscope.example.yaml](configs\u002Fscope.example.yaml).\n\n## Quick Start\n\nThe full SCOPE workflow is agent-driven. The main workflow skill is:\n\n```text\n.codex\u002Fskills\u002Fscope-agentic-generation\u002FSKILL.md\n```\n\nIn a Codex session, ask Codex to use the SCOPE skill with your prompt and an output directory. Codex prepares the decomposition, retrieval, reasoning, synthesis, verification, and repair payloads; the Python CLIs validate and persist each stage artifact.\n\nThe workflow is:\n\n```text\ndecompose -> retrieve\u002Freason when needed -> synthesize -> generate -> verify -> repair when needed -> finalize -> evaluate\n```\n\nRequired or conditional stage input artifacts:\n\n- `decomposition.input.json`\n- `retrieval.input.json` when retrieval is needed\n- `reasoning.input.json` when reasoning is needed\n- `synthesis.input.json`\n- `verification.input.json`\n- `repair.input.json` when repair is needed\n\nMinimal stage validation example:\n\n```bash\nmkdir -p outputs\u002Fdemo\n\ncat > outputs\u002Fdemo\u002Fdecomposition.input.json \u003C\u003C'JSON'\n{\n  \"entities\": [\n    {\"id\": \"o1\", \"name\": \"math poster\", \"priority\": \"primary\"}\n  ],\n  \"constraints\": [\n    {\n      \"id\": \"c1\",\n      \"text\": \"The poster shows the correct result 45 in large readable numerals.\",\n      \"type\": \"text\",\n      \"priority\": \"critical\",\n      \"spec\": {\"require_readable_text\": true}\n    }\n  ],\n  \"unknowns\": []\n}\nJSON\n\npython -m scope.cli.stage \\\n  --stage decompose \\\n  --prompt \"A clean math poster showing the correct result of 17 + 28 in large readable numerals.\" \\\n  --decomposition-json outputs\u002Fdemo\u002Fdecomposition.input.json \\\n  --state outputs\u002Fdemo\u002Fstate.json \\\n  --output-dir outputs\u002Fdemo\n```\n\nAfter a completed run, summarize workflow metrics:\n\n```bash\npython -m scope.cli.evaluate --run-dir outputs\u002Fdemo\n```\n\nTypical run outputs include:\n\n- `state.json`\n- `final_prompt.txt`\n- generated image files\n- `metrics.json`\n- stage artifacts such as `decomposition.json`, `synthesis.json`, and `verification.json`\n\n## Gen-Arena Evaluation\n\nGen-Arena is released separately as a public dataset:\n\n```text\nhttps:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Frentianfei122\u002FGen-Arena\n```\n\nMaterialize Gen-Arena `eval.jsonl` files into runtime and evaluation packets:\n\n```bash\nscope-benchmark materialize-gen-arena-eval \\\n  --dataset-root \u002Fpath\u002Fto\u002FGen-Arena \\\n  --output-root benchmark\u002Fmaterialized\u002Fgen_arena\n```\n\nThis creates:\n\n```text\nbenchmark\u002Fmaterialized\u002Fgen_arena\u002F\u003Ccase_id>\u002Fbenchmark_input.json\nbenchmark\u002Fmaterialized\u002Fgen_arena\u002F\u003Ccase_id>\u002Fbenchmark_eval.json\nbenchmark\u002Fmaterialized\u002Fgen_arena\u002Fcases.index.json\n```\n\nDispatch materialized cases to independent Codex runs:\n\n```bash\nscope-benchmark run-codex \\\n  --index benchmark\u002Fmaterialized\u002Fgen_arena\u002Fcases.index.json \\\n  --run-root outputs\u002Fgen-arena-full \\\n  --concurrency 10\n```\n\nSummarize workflow metrics:\n\n```bash\nscope-benchmark summarize --run-root outputs\u002Fgen-arena-full\n```\n\nEvaluate Gen-Arena entity and constraint commitments:\n\n```bash\nscope-gen-arena-eval \\\n  --materialized-root benchmark\u002Fmaterialized\u002Fgen_arena \\\n  --run-root outputs\u002Fgen-arena-full\n```\n\nFor prompt-only generation cases, use a JSONL file with `id` and `prompt`:\n\n```bash\nscope-benchmark materialize-gen-arena \\\n  --prompt-jsonl \u002Fpath\u002Fto\u002FGen-Arena\u002Fcategory\u002Fprompt.jsonl \\\n  --output-root benchmark\u002Fmaterialized\u002Fgen_arena_prompt_only\n```\n\n## Command Reference\n\n- `scope-stage`: validate and persist one workflow stage\n- `scope-eval`: summarize one completed run directory\n- `scope-search`: collect web or image evidence for retrieval branches\n- `scope-benchmark`: materialize, dispatch, and summarize benchmark cases\n- `scope-gen-arena-eval`: compute Gen-Arena entity and constraint metrics\n\nThe commands can also be run as Python modules:\n\n```bash\npython -m scope.cli.stage --help\npython -m scope.cli.evaluate --help\npython -m scope.cli.benchmark --help\npython -m scope.cli.gen_arena_eval --help\n```\n\n## Repository Layout\n\n```text\n.codex\u002Fskills\u002F      Codex workflow skills for SCOPE generation\nconfigs\u002F            Runtime configuration examples\ndocs\u002F               Project page and architecture notes\nsrc\u002Fscope\u002F          Python stage tools, contracts, and runtime backends\ntests\u002F              Unit and smoke tests\n```\n\n## Citation\n\nIf you find SCOPE or Gen-Arena useful, please cite:\n\n```bibtex\n@misc{ren2026scope,\n  title         = {SCOPE: Structured Decomposition and Conditional Skill Orchestration for Complex Image Generation},\n  author        = {Tianfei Ren and Zhipeng Yan and Yiming Zhao and Zhen Fang and Yu Zeng and Guohui Zhang and Hang Xu and Xiaoxiao Ma and Shiting Huang and Ke Xu and Wenxuan Huang and Lionel Z. Wang and Lin Chen and Zehui Chen and Jie Huang and Feng Zhao},\n  year          = {2026},\n  eprint        = {2605.08043},\n  archivePrefix = {arXiv},\n  url           = {https:\u002F\u002Farxiv.org\u002Fabs\u002F2605.08043}\n}\n```\n\n## License\n\nThis project is released under the MIT License. See [LICENSE](LICENSE).\n","SCOPE 是一个用于复杂图像生成的规范引导框架。它将提示表示为持久化的语义承诺，包括实体、约束和未知数，并通过检索、推理、生成、验证和修复阶段来确保这些承诺在整个生成生命周期中可追溯。项目采用 Python 编写，核心功能包括结构化分解和条件技能编排，适用于需要根据详细且复杂的描述生成高质量图像的场景，如创意设计、数据可视化等。该框架支持多种图像生成和验证后端，并可通过配置文件灵活调整运行时设置。","2026-06-11 04:07:55","CREATED_QUERY"]