chaoscypher-cli 0.4.2__tar.gz → 0.4.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/PKG-INFO +3 -1
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/README.md +2 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/pyproject.toml +1 -1
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/source/add.py +5 -1
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/source/delete.py +20 -3
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/source/get.py +34 -13
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/source/search.py +11 -2
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/mcp/command.py +16 -4
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli.egg-info/PKG-INFO +3 -1
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_cli_plumbing.py +38 -2
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_cmd_quality_score.py +26 -4
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_cmd_source_add.py +4 -2
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_cmd_source_get.py +81 -14
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_cmd_source_misc.py +119 -36
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_first_run_gate.py +57 -30
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_mcp_maintenance_routing.py +65 -4
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_upgrade_guard.py +27 -3
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/setup.cfg +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/__init__.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/__main__.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/benchmark/__init__.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/benchmark/cards.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/benchmark/chat_dataset.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/benchmark/composite.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/benchmark/config.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/benchmark/data/config/extraction.yaml +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/benchmark/data/config/full.yaml +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/benchmark/data/config/quick.yaml +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/benchmark/data/config/workstation.yaml +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/benchmark/data/datasets/scientific_methods_tiny/manifest.yaml +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/benchmark/data/datasets/scientific_methods_tiny/scientific_methods_tiny.txt +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/benchmark/data/datasets/tech_encyclopedia_tiny/manifest.yaml +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/benchmark/data/datasets/tech_encyclopedia_tiny/queries.yaml +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/benchmark/data/datasets/tech_encyclopedia_tiny/tech_encyclopedia_tiny.txt +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/benchmark/data/datasets/war_and_peace_tiny/manifest.yaml +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/benchmark/data/datasets/war_and_peace_tiny/war_and_peace_tiny.txt +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/benchmark/data/models_registry.yaml +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/benchmark/dataset.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/benchmark/discovery.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/benchmark/embedding_dataset.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/benchmark/extraction_dataset.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/benchmark/graph_cache.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/benchmark/graph_provider.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/benchmark/judge_prompts.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/benchmark/leaderboard.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/benchmark/models.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/benchmark/models_registry.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/benchmark/orchestrator.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/benchmark/queries.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/benchmark/results.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/benchmark/runner.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/benchmark/scorers/__init__.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/benchmark/scorers/chat.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/benchmark/scorers/embedding.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/benchmark/scorers/v7.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/__init__.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/benchmark/__init__.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/benchmark/fixture.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/benchmark/init.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/benchmark/list.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/benchmark/run.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/benchmark/show.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/chat.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/chat_loop_adapter.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/completions.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/compose/__init__.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/compose/build.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/compose/down.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/compose/run.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/compose/up.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/config_cmd.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/db/__init__.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/db/create.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/db/current.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/db/delete.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/db/info.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/db/list.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/db/migrate.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/db/switch.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/diagnostics.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/doctor.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/graph/__init__.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/health.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/lexicon/__init__.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/lexicon/info.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/lexicon/list.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/lexicon/login.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/lexicon/pull.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/lexicon/push.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/lexicon/remove.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/lexicon/search.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/link/__init__.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/link/create.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/link/delete.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/link/get.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/link/list.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/link/update.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/node/__init__.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/node/_edges.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/node/create.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/node/delete.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/node/get.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/node/list.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/node/update.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/package/__init__.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/package/export.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/package/load.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/quality/__init__.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/quality/analyze.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/quality/recalculate.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/quality/report.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/quality/score.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/quality/utils.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/render_orchestration.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/runtime/__init__.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/runtime/serve.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/setup.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/source/__init__.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/source/confirm.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/source/extract.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/source/list.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/source/rebuild_search.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/template/__init__.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/template/create.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/template/delete.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/template/get.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/template/list.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/template/update.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/template/utils.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/upgrade.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/workflow/__init__.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/workflow/get.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/workflow/list.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/context.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/engine_config.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/lazy.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/mcp/__init__.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/py.typed +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/sources/__init__.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/sources/domains.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/sources/pipeline.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/sources/service.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/utils/__init__.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/utils/console.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/utils/display.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/utils/llm_check.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/utils/paths.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli.egg-info/SOURCES.txt +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli.egg-info/dependency_links.txt +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli.egg-info/entry_points.txt +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli.egg-info/requires.txt +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli.egg-info/top_level.txt +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_chat_loop_adapter.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_cmd_chat.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_cmd_completions.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_cmd_compose.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_cmd_config.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_cmd_db.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_cmd_db_migrate.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_cmd_diagnostics.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_cmd_doctor_more.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_cmd_health.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_cmd_lexicon_info.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_cmd_lexicon_login.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_cmd_lexicon_sync.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_cmd_link.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_cmd_node.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_cmd_quality_analyze.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_cmd_quality_report.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_cmd_serve_package.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_cmd_setup.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_cmd_source_extract_confirm_topup.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_cmd_template.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_cmd_workflow.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_commit_extraction_results_plumbing.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_context.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_database_flag_resolution.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_doctor.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_engine_config.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_help_text_consistency.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_index_normalization_parity.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_llm_metrics_and_quality_counters.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_package_export_empty_combo.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_package_roundtrip.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_source_add_gate.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_source_add_skip_duplicates.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_source_confirm.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_source_detect_prestep.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_source_domains_constant.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_source_extract.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_source_get_domain.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_source_get_stage_progress.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_source_list_awaiting.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_source_list_limit.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_source_list_pending.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_source_pipeline.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_source_service.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_sources_pipeline_more.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_sources_service_more.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_upgrade_command.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_utils_cli.py +0 -0
- {chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/tests/test_windows_console_encoding.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: chaoscypher-cli
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.3
|
|
4
4
|
Summary: Command-line tools for Chaos Cypher knowledge graph library
|
|
5
5
|
Author-email: Denis MacPherson <denis@chaoscypher.com>
|
|
6
6
|
Maintainer-email: Denis MacPherson <denis@chaoscypher.com>
|
|
@@ -38,6 +38,8 @@ Requires-Dist: mypy<2,>=1.20.0; extra == "dev"
|
|
|
38
38
|
|
|
39
39
|
# ChaosCypher CLI
|
|
40
40
|
|
|
41
|
+
<!-- mcp-name: io.github.chaoscypherinc/chaoscypher -->
|
|
42
|
+
|
|
41
43
|
Command-line tools for ChaosCypher knowledge graph library.
|
|
42
44
|
|
|
43
45
|
## Installation
|
|
@@ -54,7 +54,11 @@ def _is_url(value: str) -> bool:
|
|
|
54
54
|
def _get_pending_files(ctx: CLIContext) -> list[dict]:
|
|
55
55
|
"""Get files that haven't been committed yet."""
|
|
56
56
|
all_files = ctx.storage_adapter.list_files(ctx.database_name)
|
|
57
|
-
|
|
57
|
+
# Same filter as ``source list --pending``: the enum value is
|
|
58
|
+
# ``SourceStatus.ERROR`` ("error"); there is no "failed" status.
|
|
59
|
+
return [
|
|
60
|
+
f for f in all_files if f.get("status") not in (SourceStatus.COMMITTED, SourceStatus.ERROR)
|
|
61
|
+
]
|
|
58
62
|
|
|
59
63
|
|
|
60
64
|
def _show_resume_picker(ctx: CLIContext, console: Any) -> str | None:
|
{chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/source/delete.py
RENAMED
|
@@ -23,7 +23,9 @@ def delete(file_id: str, force: bool, database: str) -> None:
|
|
|
23
23
|
"""Delete an ingested file record.
|
|
24
24
|
|
|
25
25
|
FILE_ID is the source_processing file identifier.
|
|
26
|
-
This removes the
|
|
26
|
+
This removes the source record, orphaned graph nodes, search-index
|
|
27
|
+
rows, the staging file, and any rendered vision images — the same
|
|
28
|
+
cascade the API performs.
|
|
27
29
|
|
|
28
30
|
Example:
|
|
29
31
|
chaoscypher source delete if_abc123def456
|
|
@@ -49,8 +51,23 @@ def delete(file_id: str, force: bool, database: str) -> None:
|
|
|
49
51
|
console.print("[yellow]Cancelled.[/yellow]")
|
|
50
52
|
return
|
|
51
53
|
|
|
52
|
-
#
|
|
53
|
-
|
|
54
|
+
# Same cascade as the API path: SQL cascade + orphaned graph nodes in
|
|
55
|
+
# one transaction, then vector rows, staged file, and vision images.
|
|
56
|
+
from chaoscypher_core.services.graph.management.source import SourceService
|
|
57
|
+
|
|
58
|
+
service = SourceService(
|
|
59
|
+
repository=ctx.storage_adapter,
|
|
60
|
+
database_name=ctx.database_name,
|
|
61
|
+
settings=ctx.settings,
|
|
62
|
+
)
|
|
63
|
+
deleted = service.delete_source(
|
|
64
|
+
file_id,
|
|
65
|
+
graph_repo=ctx.graph_repository,
|
|
66
|
+
search_repo=ctx.search_repository,
|
|
67
|
+
)
|
|
68
|
+
if not deleted:
|
|
69
|
+
console.print(f"[red]File not found:[/red] {file_id}")
|
|
70
|
+
sys.exit(1)
|
|
54
71
|
|
|
55
72
|
console.print("[green]✓ File deleted successfully[/green]")
|
|
56
73
|
|
|
@@ -362,8 +362,16 @@ def get(source_id: str, database: str) -> None:
|
|
|
362
362
|
extraction_depth = file_record.get("extraction_depth", "full")
|
|
363
363
|
table.add_row("Extraction Depth", extraction_depth)
|
|
364
364
|
|
|
365
|
-
|
|
366
|
-
|
|
365
|
+
# Domain provenance lives in ``extraction_domain`` +
|
|
366
|
+
# ``extraction_domain_auto`` on the source row; a user-selected domain
|
|
367
|
+
# persisted before upload-time ``forced_domain`` stamping shows up as
|
|
368
|
+
# ``extraction_domain_auto=False`` (same rule as Cortex's retry path).
|
|
369
|
+
extraction_domain = file_record.get("extraction_domain")
|
|
370
|
+
domain_auto = file_record.get("extraction_domain_auto", True)
|
|
371
|
+
forced_domain = file_record.get("forced_domain") or (
|
|
372
|
+
None if domain_auto else extraction_domain
|
|
373
|
+
)
|
|
374
|
+
detected_domain = extraction_domain if domain_auto else None
|
|
367
375
|
domain_version = file_record.get("domain_version")
|
|
368
376
|
changed = _domain_changed(ctx, file_record)
|
|
369
377
|
value, detail = _format_domain_row(
|
|
@@ -376,8 +384,14 @@ def get(source_id: str, database: str) -> None:
|
|
|
376
384
|
if detail:
|
|
377
385
|
table.add_row("", detail)
|
|
378
386
|
|
|
379
|
-
|
|
380
|
-
|
|
387
|
+
# ``auto_analyze`` is the real column, but ``get_file``'s load_only
|
|
388
|
+
# projection does not carry it yet — render only when present so an
|
|
389
|
+
# absent key never prints a fabricated Yes/No.
|
|
390
|
+
auto_analyze = file_record.get("auto_analyze")
|
|
391
|
+
if auto_analyze is not None:
|
|
392
|
+
table.add_row(
|
|
393
|
+
"Extract Entities", "[green]Yes[/green]" if auto_analyze else "[dim]No[/dim]"
|
|
394
|
+
)
|
|
381
395
|
|
|
382
396
|
console.print(table)
|
|
383
397
|
|
|
@@ -487,16 +501,23 @@ def get(source_id: str, database: str) -> None:
|
|
|
487
501
|
|
|
488
502
|
console.print(ltable)
|
|
489
503
|
|
|
490
|
-
# Show error if failed
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
504
|
+
# Show error if failed (real columns: error_message + error_stage)
|
|
505
|
+
error_message = file_record.get("error_message")
|
|
506
|
+
if error_message:
|
|
507
|
+
error_stage = file_record.get("error_stage")
|
|
508
|
+
stage_suffix = f" [dim](stage: {error_stage})[/dim]" if error_stage else ""
|
|
509
|
+
console.print(f"\n[red]Error:[/red] {error_message}{stage_suffix}")
|
|
510
|
+
|
|
511
|
+
# Show indexing stats if available (real columns: chunk_count +
|
|
512
|
+
# total_content_length; the latter is outside get_file's projection
|
|
513
|
+
# today, so it renders only when the row carries it).
|
|
514
|
+
chunk_count = file_record.get("chunk_count") or 0
|
|
515
|
+
if chunk_count > 0:
|
|
497
516
|
console.print("\n[cyan]Indexing Stats:[/cyan]")
|
|
498
|
-
console.print(f" Chunks: {
|
|
499
|
-
|
|
517
|
+
console.print(f" Chunks: {chunk_count}")
|
|
518
|
+
content_length = file_record.get("total_content_length")
|
|
519
|
+
if content_length:
|
|
520
|
+
console.print(f" Content: {content_length:,} chars")
|
|
500
521
|
|
|
501
522
|
except Exception as e:
|
|
502
523
|
console.print(f"[red]Error:[/red] {e}")
|
{chaoscypher_cli-0.4.2 → chaoscypher_cli-0.4.3}/src/chaoscypher_cli/commands/source/search.py
RENAMED
|
@@ -206,10 +206,19 @@ def _hydrate_results(ctx: CLIContext, raw_results: list[tuple[str, float]]) -> l
|
|
|
206
206
|
}
|
|
207
207
|
)
|
|
208
208
|
|
|
209
|
-
# Hydrate chunks (
|
|
209
|
+
# Hydrate chunks (one batch read, mirroring the node branch above).
|
|
210
|
+
# get_chunks_by_ids_batch excludes the ~5 KB `embedding` BLOB and the
|
|
211
|
+
# `raw_content` TEXT via load_only(); the per-id reader used here before
|
|
212
|
+
# was unprojected, so a default --limit of 20 pulled both columns 20 times
|
|
213
|
+
# over to render a 100-character preview.
|
|
210
214
|
if chunk_entries:
|
|
215
|
+
chunk_ids = [cid for cid, _ in chunk_entries]
|
|
216
|
+
chunks_by_id = {
|
|
217
|
+
chunk["id"]: chunk for chunk in ctx.storage_adapter.get_chunks_by_ids_batch(chunk_ids)
|
|
218
|
+
}
|
|
219
|
+
|
|
211
220
|
for chunk_uuid, score in chunk_entries:
|
|
212
|
-
chunk_data =
|
|
221
|
+
chunk_data = chunks_by_id.get(chunk_uuid)
|
|
213
222
|
if chunk_data:
|
|
214
223
|
# Truncate content for display
|
|
215
224
|
content = chunk_data.get("content", "")
|
|
@@ -121,19 +121,31 @@ def mcp(database: str | None, mode: str | None, server_extraction: bool) -> None
|
|
|
121
121
|
else:
|
|
122
122
|
# Blocked DB: start the degraded maintenance-mode server (no Engine).
|
|
123
123
|
# This is the MCP analog of the web maintenance page — never invisible.
|
|
124
|
-
|
|
124
|
+
# Resolve the EFFECTIVE mode. This branch never builds a context, so
|
|
125
|
+
# the configured `mcp.mode` has to be read directly — testing the Click
|
|
126
|
+
# flag alone honoured read-only only when the operator typed it, while
|
|
127
|
+
# `mode: read` (the MCPSettings default) sailed past the guard. The
|
|
128
|
+
# documented Claude Desktop invocation passes no flag, so it took the
|
|
129
|
+
# unguarded path and advertised the destructive `apply_upgrade` tool.
|
|
130
|
+
from chaoscypher_core.app_config import get_settings
|
|
131
|
+
|
|
132
|
+
effective_mode = mode or get_settings().mcp.mode
|
|
133
|
+
|
|
134
|
+
if effective_mode == "read":
|
|
125
135
|
# The maintenance server cannot honor read-only: its purpose
|
|
126
136
|
# includes destructive repair (apply_upgrade). Refuse loudly
|
|
127
|
-
# instead of silently dropping the operator's
|
|
137
|
+
# instead of silently dropping the operator's read-only intent.
|
|
138
|
+
source = "--mode read" if mode else "the configured mcp.mode: read"
|
|
128
139
|
logger.error(
|
|
129
140
|
"mcp_maintenance_refuses_read_mode",
|
|
130
141
|
database=db_name,
|
|
131
142
|
blocked_on=state.blocked_on,
|
|
143
|
+
mode_source="flag" if mode else "settings",
|
|
132
144
|
)
|
|
133
145
|
msg = (
|
|
134
146
|
f"Database '{db_name}' is in maintenance mode, which cannot honor "
|
|
135
|
-
"
|
|
136
|
-
"(e.g. apply_upgrade). Re-run
|
|
147
|
+
f"{source}: maintenance tools include destructive repair "
|
|
148
|
+
"(e.g. apply_upgrade). Re-run with --mode write to use the "
|
|
137
149
|
"maintenance server, or repair the database first."
|
|
138
150
|
)
|
|
139
151
|
raise click.ClickException(msg)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: chaoscypher-cli
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.3
|
|
4
4
|
Summary: Command-line tools for Chaos Cypher knowledge graph library
|
|
5
5
|
Author-email: Denis MacPherson <denis@chaoscypher.com>
|
|
6
6
|
Maintainer-email: Denis MacPherson <denis@chaoscypher.com>
|
|
@@ -38,6 +38,8 @@ Requires-Dist: mypy<2,>=1.20.0; extra == "dev"
|
|
|
38
38
|
|
|
39
39
|
# ChaosCypher CLI
|
|
40
40
|
|
|
41
|
+
<!-- mcp-name: io.github.chaoscypherinc/chaoscypher -->
|
|
42
|
+
|
|
41
43
|
Command-line tools for ChaosCypher knowledge graph library.
|
|
42
44
|
|
|
43
45
|
## Installation
|
|
@@ -13,6 +13,8 @@ from __future__ import annotations
|
|
|
13
13
|
|
|
14
14
|
import sys
|
|
15
15
|
from pathlib import Path
|
|
16
|
+
from types import SimpleNamespace
|
|
17
|
+
from typing import Any
|
|
16
18
|
from unittest.mock import MagicMock, patch
|
|
17
19
|
|
|
18
20
|
import pytest
|
|
@@ -245,12 +247,46 @@ class TestUpgradeGuard:
|
|
|
245
247
|
_upgrade_guard(ctx)
|
|
246
248
|
ctx.exit.assert_not_called()
|
|
247
249
|
|
|
250
|
+
@staticmethod
|
|
251
|
+
def _blocked_state() -> Any:
|
|
252
|
+
"""Patches making the guard see a Blocked database.
|
|
253
|
+
|
|
254
|
+
Without these the guard returns at the ``state.ready`` check —
|
|
255
|
+
``_ensure_table`` seeds ``ready=1``, so an unseeded DB always reads
|
|
256
|
+
ready — and never reaches the allowlist branch at all.
|
|
257
|
+
"""
|
|
258
|
+
blocked = SimpleNamespace(ready=False, message="blocked", last_backup=None)
|
|
259
|
+
return (
|
|
260
|
+
patch("chaoscypher_cli.engine_config.read_current_database", lambda: "default"),
|
|
261
|
+
patch("chaoscypher_core.database.engine.get_db_path", lambda name: f"/tmp/{name}.db"),
|
|
262
|
+
patch(
|
|
263
|
+
"chaoscypher_core.database.migrations.state.get_upgrade_state",
|
|
264
|
+
lambda _p: blocked,
|
|
265
|
+
),
|
|
266
|
+
patch.object(sys, "argv", ["chaoscypher", "render-orchestration"]),
|
|
267
|
+
)
|
|
268
|
+
|
|
248
269
|
def test_safe_subcommand_bypasses_guard(self) -> None:
|
|
249
|
-
"""render-orchestration is in _UPGRADE_SAFE_SUBCOMMANDS.
|
|
270
|
+
"""render-orchestration is in _UPGRADE_SAFE_SUBCOMMANDS.
|
|
271
|
+
|
|
272
|
+
Driven against a Blocked database so the allowlist is the reason the
|
|
273
|
+
guard lets it through. Previously this ran against a ready database
|
|
274
|
+
and passed with ``_UPGRADE_SAFE_SUBCOMMANDS`` emptied.
|
|
275
|
+
"""
|
|
250
276
|
ctx = self._make_ctx(invoked_subcommand="render-orchestration")
|
|
251
|
-
|
|
277
|
+
a, b, c, d = self._blocked_state()
|
|
278
|
+
with a, b, c, d:
|
|
279
|
+
_upgrade_guard(ctx)
|
|
252
280
|
ctx.exit.assert_not_called()
|
|
253
281
|
|
|
282
|
+
def test_unsafe_subcommand_still_blocked(self) -> None:
|
|
283
|
+
"""Control: a subcommand off the allowlist exits 2 on the same state."""
|
|
284
|
+
ctx = self._make_ctx(invoked_subcommand="source")
|
|
285
|
+
a, b, c, _ = self._blocked_state()
|
|
286
|
+
with a, b, c, patch.object(sys, "argv", ["chaoscypher", "source"]):
|
|
287
|
+
_upgrade_guard(ctx)
|
|
288
|
+
ctx.exit.assert_called_once_with(2)
|
|
289
|
+
|
|
254
290
|
def test_import_error_returns_without_blocking(self) -> None:
|
|
255
291
|
"""If imports fail, guard lets the command run."""
|
|
256
292
|
ctx = self._make_ctx(invoked_subcommand="source")
|
|
@@ -27,6 +27,10 @@ from click.testing import CliRunner
|
|
|
27
27
|
from rich.table import Table
|
|
28
28
|
|
|
29
29
|
from chaoscypher_cli.commands.quality.score import score
|
|
30
|
+
from chaoscypher_core.services.quality.scoring import (
|
|
31
|
+
_GRADE_LABEL_THRESHOLDS,
|
|
32
|
+
_label_by_threshold,
|
|
33
|
+
)
|
|
30
34
|
|
|
31
35
|
|
|
32
36
|
# ---------------------------------------------------------------------------
|
|
@@ -307,8 +311,10 @@ class TestRichOutput:
|
|
|
307
311
|
|
|
308
312
|
def test_green_grade_tier(self) -> None:
|
|
309
313
|
"""Grade >= 70 renders with green colour."""
|
|
314
|
+
# 80.0 maps to "Excellent", not "Outstanding" (the cut is 85) — the
|
|
315
|
+
# fixture used an impossible pairing until 2026-09-10.
|
|
310
316
|
result = _invoke_score(
|
|
311
|
-
mock_score_obj=_make_mock_score(quality_grade=80.0, quality_label="
|
|
317
|
+
mock_score_obj=_make_mock_score(quality_grade=80.0, quality_label="Excellent")
|
|
312
318
|
)
|
|
313
319
|
assert result.exit_code == 0
|
|
314
320
|
assert "80" in result.output
|
|
@@ -394,15 +400,31 @@ class TestRichOutput:
|
|
|
394
400
|
|
|
395
401
|
|
|
396
402
|
class TestQualityLabels:
|
|
397
|
-
"""All five quality labels are rendered in the output.
|
|
403
|
+
"""All five quality labels are rendered in the output.
|
|
404
|
+
|
|
405
|
+
The label is **derived from the real Core mapping** rather than passed
|
|
406
|
+
in alongside the grade. Before 2026-09-10 this helper took both values,
|
|
407
|
+
stuffed both into its own mock and asserted only that the label came
|
|
408
|
+
back out — so the `grade` argument reached no assertion and the class
|
|
409
|
+
would have passed with the mapping inverted or deleted. The mapping
|
|
410
|
+
itself is pinned in
|
|
411
|
+
`packages/core/tests/unit/services/quality/test_scoring.py`
|
|
412
|
+
(`TestGradeLabelThresholds`); what this class covers is the *rendering*,
|
|
413
|
+
on grade/label pairs that cannot drift out of agreement with production.
|
|
414
|
+
"""
|
|
398
415
|
|
|
399
416
|
@staticmethod
|
|
400
417
|
def _check_label(grade: float, label: str) -> None:
|
|
418
|
+
derived = _label_by_threshold(grade, _GRADE_LABEL_THRESHOLDS, default="Low")
|
|
419
|
+
assert derived == label, (
|
|
420
|
+
f"grade {grade} maps to {derived!r}, not {label!r} — this test's "
|
|
421
|
+
"expectation has drifted from _GRADE_LABEL_THRESHOLDS"
|
|
422
|
+
)
|
|
401
423
|
result = _invoke_score(
|
|
402
|
-
mock_score_obj=_make_mock_score(quality_grade=grade, quality_label=
|
|
424
|
+
mock_score_obj=_make_mock_score(quality_grade=grade, quality_label=derived)
|
|
403
425
|
)
|
|
404
426
|
assert result.exit_code == 0
|
|
405
|
-
assert
|
|
427
|
+
assert derived in result.output
|
|
406
428
|
|
|
407
429
|
def test_outstanding_label(self) -> None:
|
|
408
430
|
self._check_label(90.0, "Outstanding")
|
|
@@ -169,13 +169,15 @@ class TestIsUrl:
|
|
|
169
169
|
|
|
170
170
|
|
|
171
171
|
class TestGetPendingFiles:
|
|
172
|
-
def
|
|
172
|
+
def test_filters_committed_and_errored(self) -> None:
|
|
173
|
+
# Errored sources carry SourceStatus.ERROR ("error"); the old
|
|
174
|
+
# "failed" literal never matched and leaked them into the picker.
|
|
173
175
|
ctx = MagicMock()
|
|
174
176
|
ctx.database_name = "default"
|
|
175
177
|
ctx.storage_adapter.list_files.return_value = [
|
|
176
178
|
{"id": "if_1", "status": "indexed"},
|
|
177
179
|
{"id": "if_2", "status": "committed"},
|
|
178
|
-
{"id": "if_3", "status": "
|
|
180
|
+
{"id": "if_3", "status": "error"},
|
|
179
181
|
{"id": "if_4", "status": "pending"},
|
|
180
182
|
]
|
|
181
183
|
pending = _get_pending_files(ctx)
|
|
@@ -44,12 +44,29 @@ def _base_record(**overrides: Any) -> dict[str, Any]:
|
|
|
44
44
|
"created_at": "2026-05-10T18:00:00Z",
|
|
45
45
|
"updated_at": "2026-05-10T19:00:00Z",
|
|
46
46
|
"extraction_depth": "full",
|
|
47
|
-
"
|
|
47
|
+
"auto_analyze": True,
|
|
48
48
|
}
|
|
49
49
|
record.update(overrides)
|
|
50
50
|
return record
|
|
51
51
|
|
|
52
52
|
|
|
53
|
+
def test_base_record_keys_are_real_source_row_columns() -> None:
|
|
54
|
+
"""Every fixture key must be a real ``SourceRow`` column.
|
|
55
|
+
|
|
56
|
+
``get_file`` is a ``model_dump`` of the row, so a fixture key that is not
|
|
57
|
+
a column (the old ``extract_entities`` / ``detected_domain`` / ``error`` /
|
|
58
|
+
``indexing_stats`` phantoms) would make these tests pass against data the
|
|
59
|
+
command can never receive in production.
|
|
60
|
+
"""
|
|
61
|
+
from sqlalchemy import inspect
|
|
62
|
+
|
|
63
|
+
from chaoscypher_core.adapters.sqlite.models import SourceRow
|
|
64
|
+
|
|
65
|
+
columns = {attr.key for attr in inspect(SourceRow).column_attrs}
|
|
66
|
+
phantom = set(_base_record()) - columns
|
|
67
|
+
assert not phantom, f"fixture keys not on SourceRow: {sorted(phantom)}"
|
|
68
|
+
|
|
69
|
+
|
|
53
70
|
def _make_ctx(file_record: dict[str, Any] | None) -> MagicMock:
|
|
54
71
|
"""Build a mock CLI context whose adapter returns ``file_record``."""
|
|
55
72
|
ctx = MagicMock()
|
|
@@ -120,15 +137,26 @@ class TestCoreDetails:
|
|
|
120
137
|
assert "Status" in result.output
|
|
121
138
|
assert "File Type" in result.output
|
|
122
139
|
assert "Extract Entities" in result.output
|
|
123
|
-
#
|
|
140
|
+
# auto_analyze True -> "Yes"
|
|
124
141
|
assert "Yes" in result.output
|
|
125
142
|
|
|
126
143
|
def test_extract_entities_false_renders_no(self) -> None:
|
|
127
|
-
ctx = _make_ctx(_base_record(
|
|
144
|
+
ctx = _make_ctx(_base_record(auto_analyze=False))
|
|
128
145
|
result = _invoke(ctx)
|
|
129
146
|
assert result.exit_code == 0, result.output
|
|
147
|
+
assert "Extract Entities" in result.output
|
|
130
148
|
assert "No" in result.output
|
|
131
149
|
|
|
150
|
+
def test_extract_entities_row_omitted_when_column_not_loaded(self) -> None:
|
|
151
|
+
# get_file's load_only projection does not carry auto_analyze today;
|
|
152
|
+
# an absent key must not fabricate a Yes/No.
|
|
153
|
+
record = _base_record()
|
|
154
|
+
del record["auto_analyze"]
|
|
155
|
+
ctx = _make_ctx(record)
|
|
156
|
+
result = _invoke(ctx)
|
|
157
|
+
assert result.exit_code == 0, result.output
|
|
158
|
+
assert "Extract Entities" not in result.output
|
|
159
|
+
|
|
132
160
|
def test_size_bytes_tier(self) -> None:
|
|
133
161
|
ctx = _make_ctx(_base_record(file_size=512))
|
|
134
162
|
result = _invoke(ctx)
|
|
@@ -148,13 +176,26 @@ class TestCoreDetails:
|
|
|
148
176
|
assert result.exit_code == 0, result.output
|
|
149
177
|
assert "MB" in result.output
|
|
150
178
|
|
|
151
|
-
def
|
|
152
|
-
ctx = _make_ctx(
|
|
179
|
+
def test_error_status_renders_error_footer(self) -> None:
|
|
180
|
+
ctx = _make_ctx(
|
|
181
|
+
_base_record(
|
|
182
|
+
status="error",
|
|
183
|
+
error_message="extraction blew up",
|
|
184
|
+
error_stage="extraction",
|
|
185
|
+
)
|
|
186
|
+
)
|
|
153
187
|
result = _invoke(ctx)
|
|
154
188
|
assert result.exit_code == 0, result.output
|
|
155
|
-
assert "
|
|
189
|
+
assert "error" in result.output
|
|
156
190
|
assert "Error:" in result.output
|
|
157
191
|
assert "extraction blew up" in result.output
|
|
192
|
+
assert "stage: extraction" in result.output
|
|
193
|
+
|
|
194
|
+
def test_no_error_footer_when_error_message_absent(self) -> None:
|
|
195
|
+
ctx = _make_ctx(_base_record(error_message=None, error_stage=None))
|
|
196
|
+
result = _invoke(ctx)
|
|
197
|
+
assert result.exit_code == 0, result.output
|
|
198
|
+
assert "Error:" not in result.output
|
|
158
199
|
|
|
159
200
|
|
|
160
201
|
# ---------------------------------------------------------------------------
|
|
@@ -171,12 +212,33 @@ class TestDomainRow:
|
|
|
171
212
|
assert "forced" in result.output
|
|
172
213
|
|
|
173
214
|
def test_detected_domain_renders(self) -> None:
|
|
174
|
-
ctx = _make_ctx(_base_record(
|
|
215
|
+
ctx = _make_ctx(_base_record(extraction_domain="technical", extraction_domain_auto=True))
|
|
175
216
|
result = _invoke(ctx)
|
|
176
217
|
assert result.exit_code == 0, result.output
|
|
177
218
|
assert "technical" in result.output
|
|
178
219
|
assert "auto-detected" in result.output
|
|
179
220
|
|
|
221
|
+
def test_user_selected_domain_without_forced_column_renders_forced(self) -> None:
|
|
222
|
+
# Rows persisted before upload-time forced_domain stamping carry the
|
|
223
|
+
# user's choice as extraction_domain + extraction_domain_auto=False.
|
|
224
|
+
ctx = _make_ctx(
|
|
225
|
+
_base_record(
|
|
226
|
+
extraction_domain="legal", extraction_domain_auto=False, forced_domain=None
|
|
227
|
+
)
|
|
228
|
+
)
|
|
229
|
+
result = _invoke(ctx)
|
|
230
|
+
assert result.exit_code == 0, result.output
|
|
231
|
+
assert "legal" in result.output
|
|
232
|
+
assert "forced" in result.output
|
|
233
|
+
assert "auto-detected" not in result.output
|
|
234
|
+
|
|
235
|
+
def test_no_domain_renders_auto_placeholder(self) -> None:
|
|
236
|
+
ctx = _make_ctx(_base_record(extraction_domain=None, forced_domain=None))
|
|
237
|
+
result = _invoke(ctx)
|
|
238
|
+
assert result.exit_code == 0, result.output
|
|
239
|
+
assert "auto" in result.output
|
|
240
|
+
assert "auto-detected" not in result.output
|
|
241
|
+
|
|
180
242
|
def test_domain_changed_warning_when_hash_differs(self) -> None:
|
|
181
243
|
ctx = _make_ctx(
|
|
182
244
|
_base_record(
|
|
@@ -609,19 +671,24 @@ class TestLLMMetrics:
|
|
|
609
671
|
|
|
610
672
|
class TestIndexingStats:
|
|
611
673
|
def test_indexing_stats_footer(self) -> None:
|
|
612
|
-
record = _base_record(
|
|
613
|
-
status="indexed",
|
|
614
|
-
indexing_stats={"chunk_count": 42, "token_count": 13_500},
|
|
615
|
-
)
|
|
674
|
+
record = _base_record(status="indexed", chunk_count=42, total_content_length=13_500)
|
|
616
675
|
ctx = _make_ctx(record)
|
|
617
676
|
result = _invoke(ctx)
|
|
618
677
|
assert result.exit_code == 0, result.output
|
|
619
678
|
assert "Indexing Stats" in result.output
|
|
620
|
-
assert "42" in result.output
|
|
679
|
+
assert "Chunks: 42" in result.output
|
|
621
680
|
assert "13,500" in result.output
|
|
622
681
|
|
|
623
|
-
def
|
|
624
|
-
|
|
682
|
+
def test_indexing_stats_chunks_only_when_content_length_not_loaded(self) -> None:
|
|
683
|
+
# total_content_length is outside get_file's projection today.
|
|
684
|
+
ctx = _make_ctx(_base_record(status="indexed", chunk_count=7))
|
|
685
|
+
result = _invoke(ctx)
|
|
686
|
+
assert result.exit_code == 0, result.output
|
|
687
|
+
assert "Chunks: 7" in result.output
|
|
688
|
+
assert "chars" not in result.output
|
|
689
|
+
|
|
690
|
+
def test_no_indexing_stats_when_no_chunks(self) -> None:
|
|
691
|
+
ctx = _make_ctx(_base_record(chunk_count=0))
|
|
625
692
|
result = _invoke(ctx)
|
|
626
693
|
assert result.exit_code == 0, result.output
|
|
627
694
|
assert "Indexing Stats" not in result.output
|