datakeel 0.27.0__py3-none-any.whl
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.
- datakeel/THIRD_PARTY_NOTICES.md +223 -0
- datakeel/__init__.py +8 -0
- datakeel/_contracts/agents/catalog-analyst.yaml +11 -0
- datakeel/_contracts/agents/evidence-reviewer.yaml +9 -0
- datakeel/_contracts/agents/kg-standard-analyst.yaml +12 -0
- datakeel/_contracts/agents/metric-manager.yaml +10 -0
- datakeel/_contracts/agents/production-ops.yaml +18 -0
- datakeel/_contracts/agents/training-auditor.yaml +12 -0
- datakeel/_contracts/annotation_qa/normal-single.json +27 -0
- datakeel/_contracts/ask/enterprise-reviews.yaml +20 -0
- datakeel/_contracts/ask/knowledge.yaml +311 -0
- datakeel/_contracts/ask/questions.yaml +90 -0
- datakeel/_contracts/assets/ranking.yaml +10 -0
- datakeel/_contracts/delivery-manifest.schema.json +181 -0
- datakeel/_contracts/evidence/lexicon.yaml +22 -0
- datakeel/_contracts/evidence/near_duplicate.yaml +12 -0
- datakeel/_contracts/evidence/questions.yaml +139 -0
- datakeel/_contracts/golden/01-read-only.yaml +20 -0
- datakeel/_contracts/golden/02-filtered-search.yaml +22 -0
- datakeel/_contracts/golden/03-reversible.yaml +44 -0
- datakeel/_contracts/golden/04-irreversible-approval.yaml +45 -0
- datakeel/_contracts/golden/05-rejected.yaml +42 -0
- datakeel/_contracts/golden/06-frozen-approval.yaml +45 -0
- datakeel/_contracts/golden/07-repeated-loop.yaml +37 -0
- datakeel/_contracts/golden/08-budget.yaml +22 -0
- datakeel/_contracts/golden/09-cross-turn-reference.yaml +49 -0
- datakeel/_contracts/golden/10-unknown-tool.yaml +21 -0
- datakeel/_contracts/golden/11-dry-run.yaml +39 -0
- datakeel/_contracts/golden/12-long-conversation.yaml +124 -0
- datakeel/_contracts/golden/13-evidence-query.yaml +105 -0
- datakeel/_contracts/golden/14-evidence-unknown.yaml +70 -0
- datakeel/_contracts/golden/15-evidence-version.yaml +134 -0
- datakeel/_contracts/golden/16-evidence-approval.yaml +134 -0
- datakeel/_contracts/golden/17-ask-answer.yaml +149 -0
- datakeel/_contracts/golden/18-ask-clarification.yaml +75 -0
- datakeel/_contracts/golden/19-ask-unanswerable.yaml +78 -0
- datakeel/_contracts/golden/20-ask-updated-metric.yaml +328 -0
- datakeel/_contracts/golden/21-delegation-catalog.yaml +48 -0
- datakeel/_contracts/golden/22-delegation-scope.yaml +51 -0
- datakeel/_contracts/golden/23-delegation-depth.yaml +75 -0
- datakeel/_contracts/golden/24-delegation-concurrency.yaml +65 -0
- datakeel/_contracts/golden/25-canary-text.yaml +18 -0
- datakeel/_contracts/golden/26-canary-arguments.yaml +25 -0
- datakeel/_contracts/golden/27-injection-approval.yaml +49 -0
- datakeel/_contracts/golden/28-memory-write.yaml +42 -0
- datakeel/_contracts/golden/29-memory-cross-session.yaml +38 -0
- datakeel/_contracts/golden/30-memory-delete.yaml +39 -0
- datakeel/_contracts/golden/31-memory-minimum-overlap.yaml +38 -0
- datakeel/_contracts/golden/32-canary-prefix.yaml +18 -0
- datakeel/_contracts/golden/33-kg-query.yaml +77 -0
- datakeel/_contracts/golden/34-kg-explain-review.yaml +90 -0
- datakeel/_contracts/golden/35-kg-replay-action.yaml +32 -0
- datakeel/_contracts/golden/36-kg-external-approval.yaml +35 -0
- datakeel/_contracts/golden/37-ask-knowledge-owner.yaml +107 -0
- datakeel/_contracts/golden/38-ask-knowledge-upstream.yaml +81 -0
- datakeel/_contracts/golden/39-ask-knowledge-clarification.yaml +64 -0
- datakeel/_contracts/golden/40-ask-knowledge-reviewed.yaml +65 -0
- datakeel/_contracts/golden/41-image-kg-explain.yaml +81 -0
- datakeel/_contracts/golden/41-standard-coverage.yaml +52 -0
- datakeel/_contracts/golden/42-image-kg-replay.yaml +27 -0
- datakeel/_contracts/golden/42-standard-usage.yaml +44 -0
- datakeel/_contracts/golden/43-image-kg-external.yaml +27 -0
- datakeel/_contracts/golden/44-annotation-quality.yaml +81 -0
- datakeel/_contracts/golden/44-asset-access.yaml +35 -0
- datakeel/_contracts/golden/44-quality-failures.yaml +54 -0
- datakeel/_contracts/golden/45-quality-table-history.yaml +50 -0
- datakeel/_contracts/golden/46-training-distribution.yaml +53 -0
- datakeel/_contracts/golden/46-training-quality.yaml +43 -0
- datakeel/_contracts/golden/47-training-leakage.yaml +51 -0
- datakeel/_contracts/golden/48-one-sentence-clarify.yaml +24 -0
- datakeel/_contracts/golden/48-one-sentence-multistep.yaml +23 -0
- datakeel/_contracts/golden/48-one-sentence-overreach.yaml +19 -0
- datakeel/_contracts/golden/49-one-sentence-permission-first.yaml +19 -0
- datakeel/_contracts/golden/49-one-sentence-unknown-param.yaml +21 -0
- datakeel/_contracts/golden/49-one-sentence-unsupported.yaml +18 -0
- datakeel/_contracts/kg/demo/image-truncated.png +0 -0
- datakeel/_contracts/kg/demo/image-truncated.yaml +18 -0
- datakeel/_contracts/kg/demo/long-documents.yaml +38 -0
- datakeel/_contracts/kg/eval/cases.yaml +1243 -0
- datakeel/_contracts/kg/eval/examples.yaml +80 -0
- datakeel/_contracts/kg/eval/image/SOURCES.md +5 -0
- datakeel/_contracts/kg/eval/image/cases.yaml +6552 -0
- datakeel/_contracts/kg/eval/image/images/b01.png +0 -0
- datakeel/_contracts/kg/eval/image/images/b02.png +0 -0
- datakeel/_contracts/kg/eval/image/images/b03.png +0 -0
- datakeel/_contracts/kg/eval/image/images/b04.png +0 -0
- datakeel/_contracts/kg/eval/image/images/b05.png +0 -0
- datakeel/_contracts/kg/eval/image/images/b06.png +0 -0
- datakeel/_contracts/kg/eval/image/images/b07.png +0 -0
- datakeel/_contracts/kg/eval/image/images/b08.png +0 -0
- datakeel/_contracts/kg/eval/image/images/b09.png +0 -0
- datakeel/_contracts/kg/eval/image/images/b10.png +0 -0
- datakeel/_contracts/kg/eval/image/images/b11.png +0 -0
- datakeel/_contracts/kg/eval/image/images/b12.png +0 -0
- datakeel/_contracts/kg/eval/image/images/en01_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/en01_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/en02_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/en02_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/en03_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/en03_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/en04_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/en04_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/en05_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/en05_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/en06_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/en06_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/en07_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/en07_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/en08_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/en08_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/en09_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/en09_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/en10_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/en10_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/en11_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/en11_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/en12_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/en12_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/zh01_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/zh01_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/zh02_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/zh02_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/zh03_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/zh03_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/zh04_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/zh04_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/zh05_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/zh05_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/zh06_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/zh06_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/zh07_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/zh07_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/zh08_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/zh08_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/zh09_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/zh09_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/zh10_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/zh10_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/zh11_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/zh11_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/zh12_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/zh12_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image-auto/SOURCES.md +17 -0
- datakeel/_contracts/kg/eval/image-auto/cases.yaml +183 -0
- datakeel/_contracts/kg/eval/image-auto/images/connector.png +0 -0
- datakeel/_contracts/kg/eval/image-auto/images/grey.png +0 -0
- datakeel/_contracts/kg/eval/image-auto/images/strike.png +0 -0
- datakeel/_contracts/kg/eval/image-auto/images/text-lineage.png +0 -0
- datakeel/_contracts/kg/eval/image-auto/images/text-location.png +0 -0
- datakeel/_contracts/kg/eval/image-auto/images/text-staff.png +0 -0
- datakeel/_contracts/kg/eval/truncated.yaml +2 -0
- datakeel/_contracts/kg/profiles/cloud.yaml +16 -0
- datakeel/_contracts/kg/profiles/fake-long.yaml +14 -0
- datakeel/_contracts/kg/profiles/fake.yaml +14 -0
- datakeel/_contracts/kg/profiles/ollama.yaml +19 -0
- datakeel/_contracts/kg/profiles/replay-demo.yaml +14 -0
- datakeel/_contracts/kg/profiles/replay-enterprise.yaml +14 -0
- datakeel/_contracts/kg/profiles/replay-flash.yaml +14 -0
- datakeel/_contracts/kg/profiles/replay-image-auto.yaml +10 -0
- datakeel/_contracts/kg/profiles/replay-image-cloud-flash.yaml +9 -0
- datakeel/_contracts/kg/profiles/replay-image-flash.yaml +9 -0
- datakeel/_contracts/kg/profiles/replay-image-qwen.yaml +9 -0
- datakeel/_contracts/kg/profiles/replay-image-rapidocr-qwen.yaml +9 -0
- datakeel/_contracts/kg/prompts/image-transcription-v1.txt +9 -0
- datakeel/_contracts/kg/recordings/auto-extraction.yaml +215 -0
- datakeel/_contracts/kg/recordings/auto-transcription.yaml +248 -0
- datakeel/_contracts/kg/recordings/deepseek-flash.yaml +2607 -0
- datakeel/_contracts/kg/recordings/fake-long.yaml +345 -0
- datakeel/_contracts/kg/recordings/image-cloud-flash.yaml +3784 -0
- datakeel/_contracts/kg/recordings/image-flash.yaml +3796 -0
- datakeel/_contracts/kg/recordings/image-qwen.yaml +1334 -0
- datakeel/_contracts/kg/recordings/image-rapidocr-qwen.yaml +4528 -0
- datakeel/_contracts/kg/recordings/qwen-flash-image.yaml +3711 -0
- datakeel/_contracts/kg/recordings/qwen-image.yaml +3754 -0
- datakeel/_contracts/kg/recordings/qwen3.5.yaml +2463 -0
- datakeel/_contracts/kg/recordings/rapidocr-image.yaml +4092 -0
- datakeel/_contracts/kg/schema.yaml +155 -0
- datakeel/_contracts/kg/transcription-profiles/bailian-qwen35-flash-auto.yaml +21 -0
- datakeel/_contracts/kg/transcription-profiles/bailian-qwen35-flash-coordinates.yaml +16 -0
- datakeel/_contracts/kg/transcription-profiles/bailian-qwen35-flash.yaml +16 -0
- datakeel/_contracts/kg/transcription-profiles/fake.yaml +7 -0
- datakeel/_contracts/kg/transcription-profiles/ollama-vision-local.yaml +16 -0
- datakeel/_contracts/kg/transcription-profiles/rapidocr-local.yaml +12 -0
- datakeel/_contracts/kg/transcription-profiles/replay-image-auto-ocr.yaml +7 -0
- datakeel/_contracts/kg/transcription-profiles/replay-image-auto-vlm.yaml +7 -0
- datakeel/_contracts/kg/transcription-profiles/replay-image-auto.yaml +8 -0
- datakeel/_contracts/kg/transcription-profiles/replay-image-demo-failure.yaml +14 -0
- datakeel/_contracts/kg/transcription-profiles/replay-image-demo.yaml +8 -0
- datakeel/_contracts/kg/transcription-profiles/replay-image-flash.yaml +8 -0
- datakeel/_contracts/kg/transcription-profiles/replay-image-ocr.yaml +8 -0
- datakeel/_contracts/model-prices.yaml +107 -0
- datakeel/_contracts/quality-rules/example.yaml +17 -0
- datakeel/_contracts/quality-rules/schema.json +348 -0
- datakeel/_contracts/routing/intent-cases.yaml +382 -0
- datakeel/_contracts/routing/intent-regression.yaml +168 -0
- datakeel/_contracts/routing/model-tier-cases.yaml +103 -0
- datakeel/_contracts/routing/models-tiered.example.yaml +47 -0
- datakeel/_contracts/routing/models.yaml +41 -0
- datakeel/_contracts/semantic-layer/dimensions.yaml +186 -0
- datakeel/_contracts/semantic-layer/metrics.yaml +467 -0
- datakeel/_contracts/semantic-layer/owners.yaml +22 -0
- datakeel/_contracts/semantic-layer/terms.yaml +184 -0
- datakeel/_contracts/standards/enterprise.yaml +935 -0
- datakeel/_contracts/standards/standards.schema.json +331 -0
- datakeel/_contracts/standards/synonyms.yaml +65 -0
- datakeel/_contracts/workflows/dataset-health.yaml +147 -0
- datakeel/_contracts/workflows/low-quality-cleanup.yaml +153 -0
- datakeel/_contracts/workflows/metric-change.yaml +158 -0
- datakeel/action_store/__init__.py +4 -0
- datakeel/action_store/file_handlers.py +120 -0
- datakeel/action_store/lifecycle.py +206 -0
- datakeel/action_store/validation.py +85 -0
- datakeel/actions/__init__.py +4 -0
- datakeel/actions/action_language.py +245 -0
- datakeel/actions/approvals.py +8 -0
- datakeel/actions/authorization.json +155 -0
- datakeel/actions/authorization.py +47 -0
- datakeel/actions/budget.py +104 -0
- datakeel/actions/catalog_parameters.py +63 -0
- datakeel/actions/custom_runs.py +49 -0
- datakeel/actions/data_asset_parameters.py +57 -0
- datakeel/actions/datasheet_parameters.py +59 -0
- datakeel/actions/declarations.py +141 -0
- datakeel/actions/dq_parameters.py +50 -0
- datakeel/actions/execution.py +8 -0
- datakeel/actions/execution_targets.json +67 -0
- datakeel/actions/file_declarations.json +244 -0
- datakeel/actions/file_declarations.py +58 -0
- datakeel/actions/identity_parameters.py +85 -0
- datakeel/actions/ir.py +102 -0
- datakeel/actions/kg_parameters.py +34 -0
- datakeel/actions/label_draft_parameters.py +62 -0
- datakeel/actions/llm_data_parameters.py +18 -0
- datakeel/actions/models.py +254 -0
- datakeel/actions/parameters.py +248 -0
- datakeel/actions/planning.py +8 -0
- datakeel/actions/policy.py +65 -0
- datakeel/actions/production_catalog_parameters.py +170 -0
- datakeel/actions/production_language.py +174 -0
- datakeel/actions/production_parameters.py +231 -0
- datakeel/actions/production_references.py +60 -0
- datakeel/actions/receipts.py +61 -0
- datakeel/actions/recovery.py +48 -0
- datakeel/actions/reference_assets.json +16 -0
- datakeel/actions/references.py +192 -0
- datakeel/actions/registry.py +141 -0
- datakeel/actions/release_parameters.py +43 -0
- datakeel/actions/selection_parameters.py +13 -0
- datakeel/actions/service.py +25 -0
- datakeel/actions/standard_parameters.py +48 -0
- datakeel/actions/worker.py +8 -0
- datakeel/agent/__init__.py +4 -0
- datakeel/agent/confirm.py +34 -0
- datakeel/agent/context.py +92 -0
- datakeel/agent/demo.py +173 -0
- datakeel/agent/dispatch.py +100 -0
- datakeel/agent/evidence_demo.py +152 -0
- datakeel/agent/factory.py +41 -0
- datakeel/agent/guards.py +97 -0
- datakeel/agent/memory.py +142 -0
- datakeel/agent/metering.py +151 -0
- datakeel/agent/models.py +59 -0
- datakeel/agent/providers.py +34 -0
- datakeel/agent/recovery.py +38 -0
- datakeel/agent/service.py +185 -0
- datakeel/agent/tools.py +196 -0
- datakeel/annotation_qa/__init__.py +61 -0
- datakeel/annotation_qa/categorical.py +99 -0
- datakeel/annotation_qa/classification.py +80 -0
- datakeel/annotation_qa/confidence_tiers.py +142 -0
- datakeel/annotation_qa/consensus.py +291 -0
- datakeel/annotation_qa/findings.py +215 -0
- datakeel/annotation_qa/geometry.py +187 -0
- datakeel/annotation_qa/grouping.py +32 -0
- datakeel/annotation_qa/labels.py +144 -0
- datakeel/annotation_qa/outliers.py +192 -0
- datakeel/annotation_qa/polygon_area.py +92 -0
- datakeel/annotation_qa/prelabel_crosscheck.py +64 -0
- datakeel/annotation_qa/prelabel_match.py +166 -0
- datakeel/annotation_qa/prelabel_metrics.py +72 -0
- datakeel/annotation_qa/review_messages.py +139 -0
- datakeel/annotation_qa/review_rules.py +257 -0
- datakeel/annotation_qa/rework.py +154 -0
- datakeel/annotation_qa/risk_scoring.py +109 -0
- datakeel/annotation_qa/service.py +64 -0
- datakeel/api/__init__.py +4 -0
- datakeel/api/app.py +112 -0
- datakeel/api/dependencies.py +18 -0
- datakeel/api/errors.py +43 -0
- datakeel/api/identity_access.py +128 -0
- datakeel/api/routes/__init__.py +4 -0
- datakeel/api/routes/actions.py +120 -0
- datakeel/api/routes/agent.py +396 -0
- datakeel/api/routes/annotation_qa.py +94 -0
- datakeel/api/routes/ask.py +82 -0
- datakeel/api/routes/catalog.py +92 -0
- datakeel/api/routes/custom_operators.py +82 -0
- datakeel/api/routes/data_assets.py +136 -0
- datakeel/api/routes/datasets.py +122 -0
- datakeel/api/routes/datasheets.py +101 -0
- datakeel/api/routes/delivery.py +50 -0
- datakeel/api/routes/evidence.py +68 -0
- datakeel/api/routes/governance.py +93 -0
- datakeel/api/routes/harness.py +42 -0
- datakeel/api/routes/intents.py +47 -0
- datakeel/api/routes/kg.py +191 -0
- datakeel/api/routes/lineage.py +70 -0
- datakeel/api/routes/llm_data.py +94 -0
- datakeel/api/routes/memories.py +56 -0
- datakeel/api/routes/metadata_imports.py +46 -0
- datakeel/api/routes/ontology.py +42 -0
- datakeel/api/routes/openlineage.py +46 -0
- datakeel/api/routes/production.py +170 -0
- datakeel/api/routes/quality_rules.py +85 -0
- datakeel/api/routes/releases.py +62 -0
- datakeel/api/routes/search.py +20 -0
- datakeel/api/routes/standards.py +102 -0
- datakeel/api/routes/standards_reporting.py +26 -0
- datakeel/api/routes/system.py +32 -0
- datakeel/api/routes/tasks.py +71 -0
- datakeel/api/routes/training.py +126 -0
- datakeel/api/routes/uploads.py +61 -0
- datakeel/api/routes/workflow_runs.py +113 -0
- datakeel/api/workflow_stream.py +62 -0
- datakeel/ask/__init__.py +4 -0
- datakeel/ask/access.py +42 -0
- datakeel/ask/charts.py +107 -0
- datakeel/ask/comparisons.py +113 -0
- datakeel/ask/consumption.py +278 -0
- datakeel/ask/dimension_cues.py +50 -0
- datakeel/ask/dimensions.py +237 -0
- datakeel/ask/evaluation.py +153 -0
- datakeel/ask/evaluation_checks.py +102 -0
- datakeel/ask/followup.py +335 -0
- datakeel/ask/followup_cues.py +162 -0
- datakeel/ask/followup_frames.py +60 -0
- datakeel/ask/generic.py +62 -0
- datakeel/ask/interpretation_en.py +48 -0
- datakeel/ask/knowledge_claims.py +229 -0
- datakeel/ask/knowledge_count.py +102 -0
- datakeel/ask/knowledge_focus.py +197 -0
- datakeel/ask/knowledge_frames.py +187 -0
- datakeel/ask/knowledge_intent_candidates.py +158 -0
- datakeel/ask/knowledge_names.py +59 -0
- datakeel/ask/knowledge_parser.py +259 -0
- datakeel/ask/knowledge_roles.py +352 -0
- datakeel/ask/knowledge_routing.py +227 -0
- datakeel/ask/knowledge_scope.py +161 -0
- datakeel/ask/knowledge_service.py +225 -0
- datakeel/ask/knowledge_subjects.py +255 -0
- datakeel/ask/knowledge_system.py +119 -0
- datakeel/ask/knowledge_vocabulary.py +351 -0
- datakeel/ask/matching.py +173 -0
- datakeel/ask/models.py +72 -0
- datakeel/ask/parser.py +20 -0
- datakeel/ask/profile.py +224 -0
- datakeel/ask/reasons.py +77 -0
- datakeel/ask/rerank.py +44 -0
- datakeel/ask/resolution.py +98 -0
- datakeel/ask/service.py +357 -0
- datakeel/ask/time.py +189 -0
- datakeel/ask/time_atoms.py +321 -0
- datakeel/ask/time_vocabulary.py +126 -0
- datakeel/assets/__init__.py +4 -0
- datakeel/assets/access.py +8 -0
- datakeel/assets/ranking.py +29 -0
- datakeel/assets/service.py +82 -0
- datakeel/catalog/__init__.py +4 -0
- datakeel/catalog/importers/__init__.py +4 -0
- datakeel/catalog/importers/airflow.py +306 -0
- datakeel/catalog/importers/airflow_rest.py +178 -0
- datakeel/catalog/importers/base.py +17 -0
- datakeel/catalog/importers/database.py +180 -0
- datakeel/catalog/importers/dbt.py +276 -0
- datakeel/catalog/importers/dbt_models.py +138 -0
- datakeel/catalog/importers/dbt_objects.py +283 -0
- datakeel/catalog/importers/dbt_retention.py +69 -0
- datakeel/catalog/importers/dbt_runs.py +95 -0
- datakeel/catalog/importers/dbt_semantics.py +200 -0
- datakeel/catalog/importers/helpers.py +30 -0
- datakeel/catalog/importers/models.py +23 -0
- datakeel/catalog/importers/sql.py +226 -0
- datakeel/catalog/importers/tabular.py +87 -0
- datakeel/catalog/metadata_service.py +101 -0
- datakeel/catalog/service.py +66 -0
- datakeel/cli/__init__.py +302 -0
- datakeel/cli/__main__.py +9 -0
- datakeel/cli/agent.py +285 -0
- datakeel/cli/ask.py +38 -0
- datakeel/cli/ask_evaluation.py +44 -0
- datakeel/cli/asset_demo.py +107 -0
- datakeel/cli/catalog.py +17 -0
- datakeel/cli/custom_operators.py +117 -0
- datakeel/cli/data_assets.py +125 -0
- datakeel/cli/database.py +77 -0
- datakeel/cli/delivery.py +122 -0
- datakeel/cli/demo.py +239 -0
- datakeel/cli/enterprise.py +89 -0
- datakeel/cli/evaluation.py +45 -0
- datakeel/cli/evidence.py +36 -0
- datakeel/cli/evidence_benchmark.py +69 -0
- datakeel/cli/evidence_evaluation.py +89 -0
- datakeel/cli/image_kg_demo.py +80 -0
- datakeel/cli/intents.py +57 -0
- datakeel/cli/kg_demo.py +93 -0
- datakeel/cli/kg_evaluation.py +148 -0
- datakeel/cli/kg_image_evaluation.py +176 -0
- datakeel/cli/llm_data.py +27 -0
- datakeel/cli/mcp.py +23 -0
- datakeel/cli/media_demo.py +88 -0
- datakeel/cli/memory.py +105 -0
- datakeel/cli/metadata_imports.py +80 -0
- datakeel/cli/parsers.py +15 -0
- datakeel/cli/production.py +94 -0
- datakeel/cli/production_demo.py +166 -0
- datakeel/cli/quality.py +83 -0
- datakeel/cli/release_plans.py +63 -0
- datakeel/cli/routing.py +61 -0
- datakeel/cli/standards.py +145 -0
- datakeel/cli/timeseries_demo.py +124 -0
- datakeel/cli/training.py +124 -0
- datakeel/cli/workflow.py +247 -0
- datakeel/core/__init__.py +4 -0
- datakeel/core/agent_models.py +177 -0
- datakeel/core/annotation_aql.py +77 -0
- datakeel/core/annotation_models.py +342 -0
- datakeel/core/annotation_sampling.py +156 -0
- datakeel/core/ask_chart_models.py +29 -0
- datakeel/core/ask_conversation_models.py +22 -0
- datakeel/core/ask_eval.py +109 -0
- datakeel/core/ask_frame_models.py +51 -0
- datakeel/core/ask_models.py +326 -0
- datakeel/core/canary.py +93 -0
- datakeel/core/catalog_canonical.py +67 -0
- datakeel/core/catalog_identity.py +16 -0
- datakeel/core/catalog_models.py +184 -0
- datakeel/core/catalog_projection.py +40 -0
- datakeel/core/catalog_vocabulary.py +30 -0
- datakeel/core/context_tokens.py +30 -0
- datakeel/core/custom_operators.py +84 -0
- datakeel/core/custom_requests.py +27 -0
- datakeel/core/custom_review.py +112 -0
- datakeel/core/custom_sandbox.py +78 -0
- datakeel/core/custom_schema.py +122 -0
- datakeel/core/data_asset_models.py +226 -0
- datakeel/core/datasheet_execution.py +58 -0
- datakeel/core/datasheet_models.py +133 -0
- datakeel/core/datasheet_types.py +85 -0
- datakeel/core/delivery_models.py +100 -0
- datakeel/core/dq_cron.py +98 -0
- datakeel/core/dq_models.py +208 -0
- datakeel/core/dq_monitor.py +83 -0
- datakeel/core/dq_views.py +38 -0
- datakeel/core/envelopes.py +42 -0
- datakeel/core/errors.py +58 -0
- datakeel/core/evidence_cache.py +139 -0
- datakeel/core/evidence_drafts.py +37 -0
- datakeel/core/evidence_eval.py +105 -0
- datakeel/core/evidence_execution.py +58 -0
- datakeel/core/evidence_inputs.py +43 -0
- datakeel/core/evidence_models.py +268 -0
- datakeel/core/evidence_replay.py +36 -0
- datakeel/core/file_queries.py +17 -0
- datakeel/core/harness_eval.py +162 -0
- datakeel/core/harness_models.py +149 -0
- datakeel/core/harness_pricing.py +67 -0
- datakeel/core/identity_models.py +77 -0
- datakeel/core/image_orientation.py +189 -0
- datakeel/core/intent_models.py +151 -0
- datakeel/core/json_schema.py +81 -0
- datakeel/core/keypoint_models.py +42 -0
- datakeel/core/kg_cache.py +28 -0
- datakeel/core/kg_contracts.py +181 -0
- datakeel/core/kg_costs.py +17 -0
- datakeel/core/kg_errors.py +26 -0
- datakeel/core/kg_eval_models.py +219 -0
- datakeel/core/kg_execution.py +264 -0
- datakeel/core/kg_image_auto_eval.py +36 -0
- datakeel/core/kg_image_eval.py +31 -0
- datakeel/core/kg_image_request.py +19 -0
- datakeel/core/kg_images.py +95 -0
- datakeel/core/kg_models.py +79 -0
- datakeel/core/kg_product.py +51 -0
- datakeel/core/kg_queries.py +119 -0
- datakeel/core/kg_registry.py +46 -0
- datakeel/core/knowledge_citations.py +33 -0
- datakeel/core/knowledge_eval.py +91 -0
- datakeel/core/knowledge_models.py +148 -0
- datakeel/core/knowledge_reviews.py +33 -0
- datakeel/core/label_guidelines.py +82 -0
- datakeel/core/link_matching.py +115 -0
- datakeel/core/link_models.py +74 -0
- datakeel/core/llm_data_governance.py +80 -0
- datakeel/core/llm_data_models.py +120 -0
- datakeel/core/logging.py +56 -0
- datakeel/core/media_alignment.py +42 -0
- datakeel/core/media_metadata.py +43 -0
- datakeel/core/media_models.py +139 -0
- datakeel/core/memory_models.py +95 -0
- datakeel/core/metadata_imports.py +102 -0
- datakeel/core/metadata_projection.py +100 -0
- datakeel/core/metric_history_models.py +30 -0
- datakeel/core/metric_models.py +217 -0
- datakeel/core/model_parameters.py +22 -0
- datakeel/core/models.py +113 -0
- datakeel/core/object_kinds.py +52 -0
- datakeel/core/orchestration.py +126 -0
- datakeel/core/orchestration_airflow.py +109 -0
- datakeel/core/orchestration_catalog.py +162 -0
- datakeel/core/orchestration_sources.py +72 -0
- datakeel/core/pii.py +338 -0
- datakeel/core/pii_credentials.py +201 -0
- datakeel/core/pii_patterns.py +153 -0
- datakeel/core/portable_metadata.py +92 -0
- datakeel/core/predicate_registry.py +154 -0
- datakeel/core/prelabel_models.py +273 -0
- datakeel/core/production_attributes.py +178 -0
- datakeel/core/production_catalog_models.py +286 -0
- datakeel/core/production_keypoints.py +112 -0
- datakeel/core/production_kinds.py +39 -0
- datakeel/core/production_models.py +254 -0
- datakeel/core/production_prediction_models.py +31 -0
- datakeel/core/production_reads.py +129 -0
- datakeel/core/production_segments.py +104 -0
- datakeel/core/production_team_models.py +158 -0
- datakeel/core/production_upgrade_models.py +79 -0
- datakeel/core/profile_models.py +140 -0
- datakeel/core/question_models.py +42 -0
- datakeel/core/recovery.py +27 -0
- datakeel/core/release_models.py +149 -0
- datakeel/core/routing_models.py +59 -0
- datakeel/core/schema.py +170 -0
- datakeel/core/search_models.py +43 -0
- datakeel/core/settings.py +102 -0
- datakeel/core/standard_history_models.py +50 -0
- datakeel/core/standard_models.py +280 -0
- datakeel/core/standard_reporting_models.py +59 -0
- datakeel/core/training_export_models.py +167 -0
- datakeel/core/training_models.py +159 -0
- datakeel/core/transcription_auto.py +90 -0
- datakeel/core/transcription_coordinates.py +103 -0
- datakeel/core/transcription_errors.py +26 -0
- datakeel/core/transcription_models.py +177 -0
- datakeel/core/transcription_wire.py +37 -0
- datakeel/core/uploads.py +127 -0
- datakeel/core/vector_assertion_rules.py +73 -0
- datakeel/core/vector_measurements.py +56 -0
- datakeel/core/vector_models.py +325 -0
- datakeel/core/vector_query.py +64 -0
- datakeel/core/vector_results.py +172 -0
- datakeel/core/workbench_models.py +251 -0
- datakeel/core/workflow_models.py +103 -0
- datakeel/dataset_store/__init__.py +8 -0
- datakeel/dataset_store/dataset_service.py +344 -0
- datakeel/dataset_store/datasets.py +251 -0
- datakeel/dataset_store/display_order.py +112 -0
- datakeel/dataset_store/events.py +33 -0
- datakeel/dataset_store/file_discovery.py +250 -0
- datakeel/dataset_store/file_pages.py +122 -0
- datakeel/dataset_store/file_rows.py +64 -0
- datakeel/dataset_store/file_state.py +104 -0
- datakeel/dataset_store/image_geometry.py +143 -0
- datakeel/dataset_store/import_sources.py +40 -0
- datakeel/dataset_store/lineage_service.py +259 -0
- datakeel/dataset_store/media_artifacts.py +50 -0
- datakeel/dataset_store/media_observations.py +96 -0
- datakeel/dataset_store/metadata_store.py +129 -0
- datakeel/dataset_store/object_projection.py +232 -0
- datakeel/dataset_store/object_queries.py +143 -0
- datakeel/dataset_store/openlineage_store.py +102 -0
- datakeel/dataset_store/profile_queries.py +132 -0
- datakeel/dataset_store/rows.py +77 -0
- datakeel/dataset_store/schema.py +62 -0
- datakeel/dataset_store/search.py +78 -0
- datakeel/dataset_store/search_sources.py +157 -0
- datakeel/dataset_store/upload_files.py +115 -0
- datakeel/dataset_store/upload_folders.py +79 -0
- datakeel/dataset_store/upload_service.py +168 -0
- datakeel/dataset_store/version_diff.py +191 -0
- datakeel/dataset_store/version_stream.py +110 -0
- datakeel/datasets/__init__.py +4 -0
- datakeel/datasets/openlineage_projection.py +162 -0
- datakeel/datasets/records.py +33 -0
- datakeel/datasets/views.py +126 -0
- datakeel/datasheets/__init__.py +4 -0
- datakeel/datasheets/destination.py +50 -0
- datakeel/datasheets/matching.py +171 -0
- datakeel/datasheets/measurement_labels.py +135 -0
- datakeel/datasheets/names.py +144 -0
- datakeel/datasheets/number_labels.py +107 -0
- datakeel/datasheets/number_words.py +141 -0
- datakeel/datasheets/numeric.py +276 -0
- datakeel/datasheets/prompt.py +81 -0
- datakeel/datasheets/render.py +134 -0
- datakeel/datasheets/sentences.py +64 -0
- datakeel/datasheets/templates.py +170 -0
- datakeel/datasheets/units.py +176 -0
- datakeel/datasheets/validation.py +89 -0
- datakeel/datasheets/vocabulary.py +327 -0
- datakeel/delegation/__init__.py +4 -0
- datakeel/delegation/demo.py +34 -0
- datakeel/delegation/loader.py +99 -0
- datakeel/delegation/models.py +72 -0
- datakeel/delegation/parallel.py +123 -0
- datakeel/delegation/policy.py +51 -0
- datakeel/delegation/scripts.py +30 -0
- datakeel/delegation/service.py +166 -0
- datakeel/delegation/tree.py +58 -0
- datakeel/delivery/__init__.py +4 -0
- datakeel/delivery/checks.py +205 -0
- datakeel/delivery/manifest.py +69 -0
- datakeel/delivery/reconcile.py +143 -0
- datakeel/docs/p9/enterprise-docs.yaml +542 -0
- datakeel/docs/p9/enterprise-flash.yaml +372 -0
- datakeel/evidence/__init__.py +4 -0
- datakeel/evidence/cache.py +8 -0
- datakeel/evidence/execution.py +52 -0
- datakeel/evidence/kg_images.py +106 -0
- datakeel/evidence/models.py +38 -0
- datakeel/evidence/presentation.py +140 -0
- datakeel/evidence/query_models.py +117 -0
- datakeel/evidence/registry.py +15 -0
- datakeel/evidence/runtime_compute.py +130 -0
- datakeel/evidence/runtime_inputs.py +198 -0
- datakeel/evidence/runtime_publication.py +61 -0
- datakeel/evidence/vector_cloud.py +200 -0
- datakeel/evidence/vector_duplicate.py +114 -0
- datakeel/evidence/vector_execution.py +322 -0
- datakeel/evidence/vector_parameters.py +16 -0
- datakeel/evidence/vector_payload.py +127 -0
- datakeel/evidence/vector_plan.py +133 -0
- datakeel/evidence/vector_plan_sets.py +77 -0
- datakeel/evidence/vector_publication.py +138 -0
- datakeel/evidence/vector_set_execution.py +133 -0
- datakeel/evidence/vector_set_publication.py +60 -0
- datakeel/evidence/vector_sets.py +207 -0
- datakeel/evidence/vector_transport.py +171 -0
- datakeel/extraction_runtime/__init__.py +4 -0
- datakeel/extraction_runtime/adapter.py +240 -0
- datakeel/extraction_runtime/factory.py +77 -0
- datakeel/extraction_runtime/transport.py +156 -0
- datakeel/governance/__init__.py +9 -0
- datakeel/governance/compliance.py +134 -0
- datakeel/governance/models.py +15 -0
- datakeel/governance/validation.py +145 -0
- datakeel/harness/__init__.py +4 -0
- datakeel/harness/annotation_cases.py +192 -0
- datakeel/harness/assessment.py +131 -0
- datakeel/harness/asset_cases.py +40 -0
- datakeel/harness/cases.py +128 -0
- datakeel/harness/dq_cases.py +74 -0
- datakeel/harness/enterprise_cases.py +33 -0
- datakeel/harness/enterprise_kg.py +101 -0
- datakeel/harness/enterprise_reviews.py +60 -0
- datakeel/harness/evaluation.py +38 -0
- datakeel/harness/evidence_cases.py +42 -0
- datakeel/harness/evidence_evaluation.py +163 -0
- datakeel/harness/evidence_metrics.py +141 -0
- datakeel/harness/evidence_questions.py +96 -0
- datakeel/harness/execution.py +220 -0
- datakeel/harness/image_kg_cases.py +66 -0
- datakeel/harness/injection_cases.py +41 -0
- datakeel/harness/kg_cases.py +53 -0
- datakeel/harness/knowledge_checks.py +123 -0
- datakeel/harness/knowledge_evaluation.py +110 -0
- datakeel/harness/llm_data_cases.py +19 -0
- datakeel/harness/operations.py +56 -0
- datakeel/harness/otel.py +199 -0
- datakeel/harness/otel_checked.py +146 -0
- datakeel/harness/pricing.py +29 -0
- datakeel/harness/resources.py +14 -0
- datakeel/harness/service.py +20 -0
- datakeel/harness/standard_cases.py +126 -0
- datakeel/harness/team_cases.py +33 -0
- datakeel/harness/tool_assessment.py +48 -0
- datakeel/harness/training_cases.py +53 -0
- datakeel/http.py +17 -0
- datakeel/intents/__init__.py +4 -0
- datakeel/intents/already.py +173 -0
- datakeel/intents/answers.py +221 -0
- datakeel/intents/capability.py +79 -0
- datakeel/intents/catalog.py +360 -0
- datakeel/intents/catalog_lookup.py +74 -0
- datakeel/intents/chain_replan.py +162 -0
- datakeel/intents/chains.py +221 -0
- datakeel/intents/choices.py +45 -0
- datakeel/intents/created.py +98 -0
- datakeel/intents/derived.py +193 -0
- datakeel/intents/describe.py +374 -0
- datakeel/intents/drafts.py +60 -0
- datakeel/intents/duplicates.py +168 -0
- datakeel/intents/edits.py +335 -0
- datakeel/intents/estimates.py +108 -0
- datakeel/intents/exclusions.py +83 -0
- datakeel/intents/explore.py +263 -0
- datakeel/intents/field_names.py +397 -0
- datakeel/intents/fill.py +388 -0
- datakeel/intents/fill_state.py +158 -0
- datakeel/intents/grounding.py +92 -0
- datakeel/intents/group_fill.py +394 -0
- datakeel/intents/impossible.py +165 -0
- datakeel/intents/landing.py +73 -0
- datakeel/intents/model_calls.py +120 -0
- datakeel/intents/model_parse.py +398 -0
- datakeel/intents/named_kinds.py +78 -0
- datakeel/intents/object_answers.py +114 -0
- datakeel/intents/object_edits.py +178 -0
- datakeel/intents/outcomes.py +110 -0
- datakeel/intents/partial.py +115 -0
- datakeel/intents/plain_words.py +27 -0
- datakeel/intents/planner.py +400 -0
- datakeel/intents/precondition_reasons.py +134 -0
- datakeel/intents/preconditions.py +396 -0
- datakeel/intents/public_text.py +276 -0
- datakeel/intents/read_scope.py +197 -0
- datakeel/intents/readonly.py +79 -0
- datakeel/intents/recipes.py +291 -0
- datakeel/intents/replanning.py +143 -0
- datakeel/intents/resolve.py +397 -0
- datakeel/intents/rules.py +118 -0
- datakeel/intents/scene.py +58 -0
- datakeel/intents/scope_words.py +49 -0
- datakeel/intents/segments.py +83 -0
- datakeel/intents/selectors.py +227 -0
- datakeel/intents/signatures.py +157 -0
- datakeel/intents/singular.py +50 -0
- datakeel/intents/step_values.py +80 -0
- datakeel/intents/task_files.py +78 -0
- datakeel/intents/task_scope.py +315 -0
- datakeel/intents/turns.py +157 -0
- datakeel/intents/validate.py +397 -0
- datakeel/intents/verify.py +398 -0
- datakeel/intents/what_changes.py +113 -0
- datakeel/intents/wording.py +397 -0
- datakeel/kg/__init__.py +4 -0
- datakeel/kg/aliases.py +173 -0
- datakeel/kg/assembly.py +208 -0
- datakeel/kg/cache.py +67 -0
- datakeel/kg/endpoints.py +56 -0
- datakeel/kg/extractors.py +117 -0
- datakeel/kg/gliner.py +80 -0
- datakeel/kg/identity.py +92 -0
- datakeel/kg/loader.py +65 -0
- datakeel/kg/policy.py +32 -0
- datakeel/kg/prompt.py +132 -0
- datakeel/kg/retention.py +63 -0
- datakeel/kg/text.py +41 -0
- datakeel/kg/verification.py +77 -0
- datakeel/kg_eval/__init__.py +6 -0
- datakeel/kg_eval/alignment.py +90 -0
- datakeel/kg_eval/counts.py +95 -0
- datakeel/kg_eval/execution.py +110 -0
- datakeel/kg_eval/image_auto_metrics.py +61 -0
- datakeel/kg_eval/image_execution.py +220 -0
- datakeel/kg_eval/image_loader.py +68 -0
- datakeel/kg_eval/image_metrics.py +146 -0
- datakeel/kg_eval/image_projection.py +52 -0
- datakeel/kg_eval/image_service.py +120 -0
- datakeel/kg_eval/loader.py +81 -0
- datakeel/kg_eval/projection.py +106 -0
- datakeel/kg_eval/scoring.py +112 -0
- datakeel/kg_eval/service.py +88 -0
- datakeel/label_drafts/__init__.py +4 -0
- datakeel/label_drafts/answer.py +249 -0
- datakeel/label_drafts/checked.py +143 -0
- datakeel/label_drafts/complete.py +200 -0
- datakeel/label_drafts/model.py +311 -0
- datakeel/label_drafts/models.py +71 -0
- datakeel/label_drafts/offline.py +174 -0
- datakeel/label_drafts/standards.py +211 -0
- datakeel/lineage/__init__.py +4 -0
- datakeel/lineage/collapse.py +122 -0
- datakeel/lineage/exports.py +202 -0
- datakeel/lineage/models.py +122 -0
- datakeel/lineage/service.py +231 -0
- datakeel/llm_data/__init__.py +9 -0
- datakeel/llm_data/acceleration.py +117 -0
- datakeel/llm_data/checks.py +203 -0
- datakeel/llm_data/contamination.py +175 -0
- datakeel/llm_data/engine.py +293 -0
- datakeel/llm_data/index.py +222 -0
- datakeel/llm_data/language.py +76 -0
- datakeel/llm_data/parsing.py +309 -0
- datakeel/llm_data/similarity.py +114 -0
- datakeel/llm_data/streaming.py +97 -0
- datakeel/mcp/__init__.py +8 -0
- datakeel/mcp/catalog.py +45 -0
- datakeel/mcp/dispatch.py +51 -0
- datakeel/mcp/local_tools.py +168 -0
- datakeel/mcp/server.py +134 -0
- datakeel/memory/__init__.py +4 -0
- datakeel/memory/consolidation.py +95 -0
- datakeel/memory/retrieval.py +112 -0
- datakeel/memory/service.py +160 -0
- datakeel/memory/tools.py +52 -0
- datakeel/metrics/__init__.py +4 -0
- datakeel/metrics/compiler.py +126 -0
- datakeel/metrics/compiler_filters.py +59 -0
- datakeel/metrics/date_boundaries.py +40 -0
- datakeel/metrics/execution.py +141 -0
- datakeel/metrics/loader.py +45 -0
- datakeel/metrics/projection.py +176 -0
- datakeel/metrics/resolution.py +37 -0
- datakeel/metrics/sql_safety.py +29 -0
- datakeel/metrics/time_grouping.py +36 -0
- datakeel/ontology/__init__.py +4 -0
- datakeel/ontology/annotation_demo.py +58 -0
- datakeel/ontology/annotation_functions.py +23 -0
- datakeel/ontology/annotation_parameters.py +15 -0
- datakeel/ontology/catalog_functions.py +137 -0
- datakeel/ontology/catalog_parameters.py +32 -0
- datakeel/ontology/data_asset_access.py +20 -0
- datakeel/ontology/dq_functions.py +99 -0
- datakeel/ontology/evidence_functions.py +39 -0
- datakeel/ontology/function_language.py +242 -0
- datakeel/ontology/functions.py +330 -0
- datakeel/ontology/kg_functions.py +40 -0
- datakeel/ontology/language_check.py +32 -0
- datakeel/ontology/llm_data_functions.py +25 -0
- datakeel/ontology/models.py +244 -0
- datakeel/ontology/parameters.py +56 -0
- datakeel/ontology/production_functions.py +171 -0
- datakeel/ontology/production_links.py +62 -0
- datakeel/ontology/properties.py +61 -0
- datakeel/ontology/registry.py +148 -0
- datakeel/ontology/standard_functions.py +65 -0
- datakeel/ontology/tool_batch.py +134 -0
- datakeel/ontology/tool_history.py +249 -0
- datakeel/ontology/tool_models.py +80 -0
- datakeel/ontology/tool_refs.py +106 -0
- datakeel/ontology/tool_search.py +147 -0
- datakeel/ontology/tooling.py +218 -0
- datakeel/ontology/training_functions.py +69 -0
- datakeel/ontology/training_parameters.py +26 -0
- datakeel/operators/__init__.py +92 -0
- datakeel/operators/audio/__init__.py +13 -0
- datakeel/operators/audio/clipping.py +74 -0
- datakeel/operators/audio/clipping_stream.py +121 -0
- datakeel/operators/audio/common.py +130 -0
- datakeel/operators/audio/dedup.py +73 -0
- datakeel/operators/audio/fingerprint.py +179 -0
- datakeel/operators/audio/flat_tops.py +149 -0
- datakeel/operators/audio/loudness.py +165 -0
- datakeel/operators/audio/models.py +57 -0
- datakeel/operators/audio/params.py +78 -0
- datakeel/operators/audio/probe.py +27 -0
- datakeel/operators/audio/streaming.py +124 -0
- datakeel/operators/audio/trim_silence.py +66 -0
- datakeel/operators/audio/vad.py +27 -0
- datakeel/operators/base.py +241 -0
- datakeel/operators/custom_container.py +393 -0
- datakeel/operators/custom_job.py +42 -0
- datakeel/operators/custom_memory.py +74 -0
- datakeel/operators/custom_output.py +135 -0
- datakeel/operators/custom_process.py +95 -0
- datakeel/operators/custom_sandbox.py +88 -0
- datakeel/operators/custom_subprocess.py +132 -0
- datakeel/operators/custom_usage.py +35 -0
- datakeel/operators/evidence/__init__.py +4 -0
- datakeel/operators/evidence/annotation_labels.py +148 -0
- datakeel/operators/evidence/caption_mentions.py +88 -0
- datakeel/operators/evidence/common.py +58 -0
- datakeel/operators/evidence/contracts.py +81 -0
- datakeel/operators/evidence/facts.py +56 -0
- datakeel/operators/evidence/image_phash.py +78 -0
- datakeel/operators/evidence/label_gap.py +61 -0
- datakeel/operators/evidence/llm_extractor.py +50 -0
- datakeel/operators/evidence/near_duplicate.py +99 -0
- datakeel/operators/evidence/near_duplicate_hashes.py +149 -0
- datakeel/operators/evidence/vector.py +43 -0
- datakeel/operators/failures.py +97 -0
- datakeel/operators/file/__init__.py +4 -0
- datakeel/operators/file/corrupt_check.py +44 -0
- datakeel/operators/file/dedup.py +30 -0
- datakeel/operators/file/empty_check.py +31 -0
- datakeel/operators/image/__init__.py +4 -0
- datakeel/operators/image/batch.py +34 -0
- datakeel/operators/image/convert.py +29 -0
- datakeel/operators/image/helpers.py +102 -0
- datakeel/operators/image/limits.py +24 -0
- datakeel/operators/image/parallel.py +45 -0
- datakeel/operators/image/quality.py +88 -0
- datakeel/operators/image/quality_scores.py +157 -0
- datakeel/operators/image/quality_signals.py +177 -0
- datakeel/operators/image/resize.py +37 -0
- datakeel/operators/image/thumbnail.py +35 -0
- datakeel/operators/media/__init__.py +4 -0
- datakeel/operators/media/align.py +191 -0
- datakeel/operators/media/command.py +165 -0
- datakeel/operators/media/isolation.py +104 -0
- datakeel/operators/media/probe_annotation.py +50 -0
- datakeel/operators/media/provenance.py +79 -0
- datakeel/operators/media/tools.py +284 -0
- datakeel/operators/pointcloud/__init__.py +4 -0
- datakeel/operators/pointcloud/artifacts.py +65 -0
- datakeel/operators/pointcloud/batch.py +42 -0
- datakeel/operators/pointcloud/cells.py +74 -0
- datakeel/operators/pointcloud/clean.py +36 -0
- datakeel/operators/pointcloud/codec.py +101 -0
- datakeel/operators/pointcloud/components.py +308 -0
- datakeel/operators/pointcloud/downsample.py +45 -0
- datakeel/operators/pointcloud/io.py +37 -0
- datakeel/operators/pointcloud/models.py +253 -0
- datakeel/operators/pointcloud/neighbors.py +168 -0
- datakeel/operators/pointcloud/outliers.py +44 -0
- datakeel/operators/pointcloud/pcd.py +98 -0
- datakeel/operators/pointcloud/ply.py +112 -0
- datakeel/operators/pointcloud/preview.py +83 -0
- datakeel/operators/pointcloud/probe.py +197 -0
- datakeel/operators/pointcloud/shape.py +111 -0
- datakeel/operators/pointcloud/statistics.py +105 -0
- datakeel/operators/pointcloud/unit_check.py +112 -0
- datakeel/operators/table/__init__.py +4 -0
- datakeel/operators/table/inference.py +166 -0
- datakeel/operators/table/io.py +146 -0
- datakeel/operators/table/models.py +99 -0
- datakeel/operators/table/params.py +30 -0
- datakeel/operators/table/profile.py +175 -0
- datakeel/operators/table/relations.py +77 -0
- datakeel/operators/table/statistics.py +62 -0
- datakeel/operators/text/__init__.py +4 -0
- datakeel/operators/text/dedup.py +40 -0
- datakeel/operators/text/encoding_fix.py +39 -0
- datakeel/operators/text/pii_redact.py +39 -0
- datakeel/operators/text/quality.py +46 -0
- datakeel/operators/text/training_quality.py +44 -0
- datakeel/operators/timeseries/__init__.py +4 -0
- datakeel/operators/timeseries/anomaly.py +119 -0
- datakeel/operators/timeseries/common.py +125 -0
- datakeel/operators/timeseries/gaps.py +80 -0
- datakeel/operators/timeseries/models.py +182 -0
- datakeel/operators/timeseries/order_dedup.py +91 -0
- datakeel/operators/timeseries/parsing.py +109 -0
- datakeel/operators/timeseries/resample.py +123 -0
- datakeel/operators/timeseries/rules.py +184 -0
- datakeel/operators/timeseries/timestamp_normalize.py +107 -0
- datakeel/operators/timeseries/unit_check.py +99 -0
- datakeel/operators/video/__init__.py +12 -0
- datakeel/operators/video/analysis.py +197 -0
- datakeel/operators/video/dedup.py +215 -0
- datakeel/operators/video/frames.py +163 -0
- datakeel/operators/video/freeze.py +160 -0
- datakeel/operators/video/invalid_frames.py +118 -0
- datakeel/operators/video/normalize.py +62 -0
- datakeel/operators/video/probe.py +27 -0
- datakeel/operators/video/render.py +79 -0
- datakeel/operators/video/segment.py +103 -0
- datakeel/operators/video/sequence.py +341 -0
- datakeel/persistence/__init__.py +21 -0
- datakeel/persistence/canonical.py +73 -0
- datakeel/persistence/canonical_tables.json +695 -0
- datakeel/persistence/legacy.py +157 -0
- datakeel/persistence/legacy_rows.py +153 -0
- datakeel/persistence/task_completion.py +141 -0
- datakeel/persistence/task_queries.py +34 -0
- datakeel/persistence/task_queue.py +32 -0
- datakeel/persistence/task_vector.py +74 -0
- datakeel/persistence/vector.py +13 -0
- datakeel/persistence/vector_tables.json +23 -0
- datakeel/pipeline/__init__.py +19 -0
- datakeel/pipeline/defaults.py +54 -0
- datakeel/pipeline/evidence.py +36 -0
- datakeel/pipeline/execution.py +200 -0
- datakeel/pipeline/image_pointcloud.py +40 -0
- datakeel/pipeline/media.py +75 -0
- datakeel/pipeline/models.py +62 -0
- datakeel/pipeline/sharding.py +32 -0
- datakeel/pipeline/tabular.py +59 -0
- datakeel/pipeline/validation.py +136 -0
- datakeel/prelabel/__init__.py +37 -0
- datakeel/prelabel/client.py +116 -0
- datakeel/prelabel/credential_source.py +56 -0
- datakeel/prelabel/estimate.py +98 -0
- datakeel/prelabel/images.py +59 -0
- datakeel/prelabel/parse.py +177 -0
- datakeel/prelabel/prompt.py +53 -0
- datakeel/quality/__init__.py +9 -0
- datakeel/quality/annotation.py +108 -0
- datakeel/quality/annotation_report.py +43 -0
- datakeel/quality/dq_constraints.py +208 -0
- datakeel/quality/dq_contracts.py +21 -0
- datakeel/quality/dq_engine.py +222 -0
- datakeel/quality/dq_evaluation.py +53 -0
- datakeel/quality/dq_regex.py +75 -0
- datakeel/quality/dq_report.py +13 -0
- datakeel/quality/dq_source.py +257 -0
- datakeel/quality/dq_statistics.py +146 -0
- datakeel/quality/dq_types.py +134 -0
- datakeel/quality/image_pointcloud.py +253 -0
- datakeel/quality/llm_data.py +68 -0
- datakeel/quality/media.py +251 -0
- datakeel/quality/models.py +84 -0
- datakeel/quality/report.py +222 -0
- datakeel/quality/scoring.py +379 -0
- datakeel/quality/standards.py +139 -0
- datakeel/quality/tabular.py +188 -0
- datakeel/quality/tabular_models.py +58 -0
- datakeel/quality/tabular_report.py +51 -0
- datakeel/routing/__init__.py +4 -0
- datakeel/routing/accounting.py +128 -0
- datakeel/routing/attempts.py +37 -0
- datakeel/routing/classifier.py +96 -0
- datakeel/routing/concepts.py +140 -0
- datakeel/routing/config.py +156 -0
- datakeel/routing/evaluation.py +113 -0
- datakeel/routing/intent.py +253 -0
- datakeel/routing/models.py +68 -0
- datakeel/routing/questions.py +172 -0
- datakeel/routing/scopes.py +137 -0
- datakeel/routing/service.py +89 -0
- datakeel/routing/tiers.py +36 -0
- datakeel/runtime/__init__.py +8 -0
- datakeel/runtime/chat.py +229 -0
- datakeel/runtime/chat_provider.py +139 -0
- datakeel/runtime/delegation_graph.py +120 -0
- datakeel/runtime/graph.py +370 -0
- datakeel/runtime/saver.py +172 -0
- datakeel/runtime/serializer.py +75 -0
- datakeel/runtime/tracing.py +26 -0
- datakeel/runtime/workflow_graph.py +239 -0
- datakeel/runtime/workflow_service.py +119 -0
- datakeel/sample.py +42 -0
- datakeel/sample_annotation_qa.py +127 -0
- datakeel/sample_enterprise/__init__.py +9 -0
- datakeel/sample_enterprise/common.py +27 -0
- datakeel/sample_enterprise/crm.py +68 -0
- datakeel/sample_enterprise/ecommerce.py +91 -0
- datakeel/sample_enterprise/erp.py +68 -0
- datakeel/sample_enterprise/generator.py +59 -0
- datakeel/sample_enterprise/gold.py +150 -0
- datakeel/sample_enterprise/models.py +68 -0
- datakeel/sample_enterprise/service.py +62 -0
- datakeel/sample_evidence/__init__.py +9 -0
- datakeel/sample_evidence/generator.py +159 -0
- datakeel/sample_evidence/images.py +65 -0
- datakeel/sample_evidence/models.py +82 -0
- datakeel/sample_image_kg.py +48 -0
- datakeel/sample_kg.py +68 -0
- datakeel/sample_media/__init__.py +8 -0
- datakeel/sample_media/generator.py +103 -0
- datakeel/sample_standards.py +66 -0
- datakeel/sample_timeseries.py +82 -0
- datakeel/sandbox_entry.py +186 -0
- datakeel/sandbox_worker.py +59 -0
- datakeel/semantic/__init__.py +270 -0
- datakeel/semantic/_snapshot.json +939 -0
- datakeel/semantic/_snapshot.py +11 -0
- datakeel/semantic/snapshot.ts +940 -0
- datakeel/standards/__init__.py +4 -0
- datakeel/standards/checks.py +279 -0
- datakeel/standards/coverage.py +88 -0
- datakeel/standards/lexical.py +223 -0
- datakeel/standards/loader.py +77 -0
- datakeel/standards/mapping.py +106 -0
- datakeel/standards/matching.py +378 -0
- datakeel/standards/names.py +197 -0
- datakeel/storage/__init__.py +4 -0
- datakeel/storage/action_access.py +101 -0
- datakeel/storage/action_approvals.py +106 -0
- datakeel/storage/action_deferred.py +88 -0
- datakeel/storage/action_execution.py +194 -0
- datakeel/storage/action_export.py +142 -0
- datakeel/storage/action_locks.py +66 -0
- datakeel/storage/action_operations.py +168 -0
- datakeel/storage/action_planning.py +277 -0
- datakeel/storage/action_reads.py +64 -0
- datakeel/storage/action_requests.py +80 -0
- datakeel/storage/action_rows.py +78 -0
- datakeel/storage/action_selection.py +105 -0
- datakeel/storage/action_snapshot.py +118 -0
- datakeel/storage/action_store.py +78 -0
- datakeel/storage/action_targets.py +70 -0
- datakeel/storage/action_worker.py +103 -0
- datakeel/storage/annotation_actions.py +63 -0
- datakeel/storage/annotation_frames.py +102 -0
- datakeel/storage/annotation_legacy.py +57 -0
- datakeel/storage/annotation_rework.py +90 -0
- datakeel/storage/annotation_rows.py +48 -0
- datakeel/storage/annotation_sampling.py +161 -0
- datakeel/storage/annotation_store.py +218 -0
- datakeel/storage/approval_evidence.py +29 -0
- datakeel/storage/ask_conversation_rows.py +24 -0
- datakeel/storage/ask_conversations.py +162 -0
- datakeel/storage/ask_evaluations.py +37 -0
- datakeel/storage/ask_evidence.py +189 -0
- datakeel/storage/ask_review.py +68 -0
- datakeel/storage/ask_rows.py +32 -0
- datakeel/storage/ask_store.py +164 -0
- datakeel/storage/base.py +8 -0
- datakeel/storage/budget_accounts.py +76 -0
- datakeel/storage/budget_rows.py +42 -0
- datakeel/storage/budget_service.py +90 -0
- datakeel/storage/catalog_action_state.py +86 -0
- datakeel/storage/catalog_actions.py +100 -0
- datakeel/storage/catalog_details.py +62 -0
- datakeel/storage/catalog_fields.py +56 -0
- datakeel/storage/catalog_graph.py +132 -0
- datakeel/storage/catalog_locks.py +17 -0
- datakeel/storage/catalog_pages.py +65 -0
- datakeel/storage/catalog_projection.py +120 -0
- datakeel/storage/catalog_queries.py +130 -0
- datakeel/storage/catalog_reads.py +31 -0
- datakeel/storage/catalog_rows.py +33 -0
- datakeel/storage/catalog_store.py +124 -0
- datakeel/storage/checkpoint_store.py +189 -0
- datakeel/storage/conversation_asset_refs.py +122 -0
- datakeel/storage/conversation_authorization.py +111 -0
- datakeel/storage/conversation_lock.py +62 -0
- datakeel/storage/conversation_memory_sources.py +57 -0
- datakeel/storage/conversation_resume.py +51 -0
- datakeel/storage/conversation_rows.py +58 -0
- datakeel/storage/conversation_secrets.py +19 -0
- datakeel/storage/conversation_store.py +183 -0
- datakeel/storage/custom_rows.py +31 -0
- datakeel/storage/custom_store.py +176 -0
- datakeel/storage/custom_validation.py +22 -0
- datakeel/storage/data_asset_access.py +218 -0
- datakeel/storage/data_asset_action_state.py +64 -0
- datakeel/storage/data_asset_actions.py +85 -0
- datakeel/storage/data_asset_cards.py +155 -0
- datakeel/storage/data_asset_context.py +87 -0
- datakeel/storage/data_asset_events.py +31 -0
- datakeel/storage/data_asset_grants.py +312 -0
- datakeel/storage/data_asset_native.py +113 -0
- datakeel/storage/data_asset_quality.py +88 -0
- datakeel/storage/data_asset_reads.py +17 -0
- datakeel/storage/data_asset_review.py +49 -0
- datakeel/storage/data_asset_rows.py +101 -0
- datakeel/storage/data_asset_store.py +229 -0
- datakeel/storage/data_asset_targets.py +142 -0
- datakeel/storage/database.py +127 -0
- datakeel/storage/datasheet_actions.py +121 -0
- datakeel/storage/datasheet_facts.py +192 -0
- datakeel/storage/datasheet_job_rows.py +25 -0
- datakeel/storage/datasheet_jobs.py +161 -0
- datakeel/storage/datasheet_rows.py +22 -0
- datakeel/storage/datasheet_sources.py +208 -0
- datakeel/storage/datasheet_store.py +159 -0
- datakeel/storage/datasheet_values.py +105 -0
- datakeel/storage/delivery_rows.py +21 -0
- datakeel/storage/delivery_service.py +213 -0
- datakeel/storage/dq_actions.py +191 -0
- datakeel/storage/dq_issues.py +154 -0
- datakeel/storage/dq_jobs.py +196 -0
- datakeel/storage/dq_reads.py +114 -0
- datakeel/storage/dq_results.py +125 -0
- datakeel/storage/dq_rows.py +96 -0
- datakeel/storage/dq_store.py +109 -0
- datakeel/storage/dq_views.py +173 -0
- datakeel/storage/dq_webhooks.py +60 -0
- datakeel/storage/draft_metering.py +104 -0
- datakeel/storage/evidence_actions.py +274 -0
- datakeel/storage/evidence_artifacts.py +50 -0
- datakeel/storage/evidence_cache.py +148 -0
- datakeel/storage/evidence_constraints.py +80 -0
- datakeel/storage/evidence_decisions.py +144 -0
- datakeel/storage/evidence_evaluations.py +51 -0
- datakeel/storage/evidence_filters.py +68 -0
- datakeel/storage/evidence_import.py +54 -0
- datakeel/storage/evidence_projection.py +212 -0
- datakeel/storage/evidence_queries.py +172 -0
- datakeel/storage/evidence_rows.py +49 -0
- datakeel/storage/evidence_runs.py +37 -0
- datakeel/storage/evidence_snapshot.py +102 -0
- datakeel/storage/evidence_store.py +274 -0
- datakeel/storage/governance_service.py +294 -0
- datakeel/storage/harness_evaluations.py +55 -0
- datakeel/storage/harness_rows.py +41 -0
- datakeel/storage/harness_service.py +150 -0
- datakeel/storage/identity_actions.py +115 -0
- datakeel/storage/identity_authorization.py +97 -0
- datakeel/storage/identity_mutations.py +192 -0
- datakeel/storage/identity_rows.py +54 -0
- datakeel/storage/identity_sessions.py +66 -0
- datakeel/storage/identity_store.py +146 -0
- datakeel/storage/intent_chains.py +100 -0
- datakeel/storage/intent_reads.py +212 -0
- datakeel/storage/intent_rows.py +22 -0
- datakeel/storage/kg_context.py +80 -0
- datakeel/storage/kg_eval_rows.py +22 -0
- datakeel/storage/kg_evaluations.py +60 -0
- datakeel/storage/kg_graph.py +96 -0
- datakeel/storage/kg_image_attribution.py +42 -0
- datakeel/storage/kg_image_eval_store.py +61 -0
- datakeel/storage/kg_image_preparation.py +203 -0
- datakeel/storage/kg_image_sources.py +205 -0
- datakeel/storage/kg_inputs.py +110 -0
- datakeel/storage/kg_preparation.py +176 -0
- datakeel/storage/kg_pricing.py +51 -0
- datakeel/storage/kg_progress.py +61 -0
- datakeel/storage/kg_provenance.py +39 -0
- datakeel/storage/kg_publication.py +268 -0
- datakeel/storage/kg_queries.py +241 -0
- datakeel/storage/kg_reviews.py +82 -0
- datakeel/storage/kg_rows.py +34 -0
- datakeel/storage/kg_run_reads.py +39 -0
- datakeel/storage/kg_source_documents.py +48 -0
- datakeel/storage/kg_store.py +208 -0
- datakeel/storage/kg_transcription_selection.py +40 -0
- datakeel/storage/label_drafts.py +308 -0
- datakeel/storage/link_context.py +105 -0
- datakeel/storage/link_drafts.py +129 -0
- datakeel/storage/link_queries.py +108 -0
- datakeel/storage/link_reviews.py +76 -0
- datakeel/storage/link_store.py +119 -0
- datakeel/storage/llm_data_access.py +51 -0
- datakeel/storage/llm_data_actions.py +233 -0
- datakeel/storage/llm_data_constraints.py +42 -0
- datakeel/storage/llm_data_evaluations.py +90 -0
- datakeel/storage/llm_data_facts.py +46 -0
- datakeel/storage/llm_data_reads.py +60 -0
- datakeel/storage/llm_data_rows.py +43 -0
- datakeel/storage/llm_data_selection.py +58 -0
- datakeel/storage/llm_data_sources.py +92 -0
- datakeel/storage/llm_data_store.py +253 -0
- datakeel/storage/memory_rows.py +45 -0
- datakeel/storage/memory_store.py +262 -0
- datakeel/storage/metric_audit.py +69 -0
- datakeel/storage/metric_drafts.py +125 -0
- datakeel/storage/metric_store.py +159 -0
- datakeel/storage/migrations.py +45 -0
- datakeel/storage/objects.py +221 -0
- datakeel/storage/pg_triggers.py +29 -0
- datakeel/storage/prediction_frames.py +133 -0
- datakeel/storage/production_acceptance.py +209 -0
- datakeel/storage/production_action_state.py +120 -0
- datakeel/storage/production_actions.py +169 -0
- datakeel/storage/production_ai_audit.py +100 -0
- datakeel/storage/production_ai_facts.py +158 -0
- datakeel/storage/production_ai_review.py +126 -0
- datakeel/storage/production_ai_rows.py +62 -0
- datakeel/storage/production_ai_rules.py +140 -0
- datakeel/storage/production_assignments.py +275 -0
- datakeel/storage/production_catalog.py +276 -0
- datakeel/storage/production_catalog_actions.py +115 -0
- datakeel/storage/production_catalog_changes.py +228 -0
- datakeel/storage/production_catalog_impact.py +76 -0
- datakeel/storage/production_catalog_plans.py +200 -0
- datakeel/storage/production_catalog_rows.py +113 -0
- datakeel/storage/production_cloud_labeling.py +198 -0
- datakeel/storage/production_cloud_prelabel.py +233 -0
- datakeel/storage/production_cloud_runner.py +317 -0
- datakeel/storage/production_counters.py +64 -0
- datakeel/storage/production_dispatch.py +206 -0
- datakeel/storage/production_dispatch_plans.py +36 -0
- datakeel/storage/production_dispatch_rules.py +161 -0
- datakeel/storage/production_finalize.py +167 -0
- datakeel/storage/production_human.py +8 -0
- datakeel/storage/production_idempotency.py +67 -0
- datakeel/storage/production_keypoint_upgrades.py +80 -0
- datakeel/storage/production_leases.py +175 -0
- datakeel/storage/production_load_locks.py +60 -0
- datakeel/storage/production_members.py +49 -0
- datakeel/storage/production_native.py +59 -0
- datakeel/storage/production_objects.py +188 -0
- datakeel/storage/production_prediction_parsing.py +369 -0
- datakeel/storage/production_predictions.py +190 -0
- datakeel/storage/production_prelabel_reads.py +107 -0
- datakeel/storage/production_prelabel_refs.py +84 -0
- datakeel/storage/production_prelabel_runs.py +188 -0
- datakeel/storage/production_prelabel_writes.py +133 -0
- datakeel/storage/production_projects.py +250 -0
- datakeel/storage/production_queries.py +252 -0
- datakeel/storage/production_reaper.py +152 -0
- datakeel/storage/production_review_policy.py +69 -0
- datakeel/storage/production_reviews.py +161 -0
- datakeel/storage/production_revisions.py +134 -0
- datakeel/storage/production_rows.py +162 -0
- datakeel/storage/production_schema.py +74 -0
- datakeel/storage/production_separation.py +81 -0
- datakeel/storage/production_statistics.py +160 -0
- datakeel/storage/production_task_images.py +46 -0
- datakeel/storage/production_tasks.py +85 -0
- datakeel/storage/production_team_reads.py +141 -0
- datakeel/storage/production_team_rows.py +86 -0
- datakeel/storage/production_template_upgrade.py +275 -0
- datakeel/storage/production_template_versions.py +140 -0
- datakeel/storage/production_tiers.py +75 -0
- datakeel/storage/release_actions.py +212 -0
- datakeel/storage/release_constraints.py +96 -0
- datakeel/storage/release_rows.py +43 -0
- datakeel/storage/release_service.py +105 -0
- datakeel/storage/standard_changes.py +222 -0
- datakeel/storage/standard_observations.py +121 -0
- datakeel/storage/standard_profiles.py +94 -0
- datakeel/storage/standard_queries.py +55 -0
- datakeel/storage/standard_store.py +109 -0
- datakeel/storage/term_changes.py +59 -0
- datakeel/storage/tool_invocations.py +127 -0
- datakeel/storage/tool_rows.py +29 -0
- datakeel/storage/training_download.py +67 -0
- datakeel/storage/training_export.py +175 -0
- datakeel/storage/training_import.py +67 -0
- datakeel/storage/training_inputs.py +220 -0
- datakeel/storage/training_rows.py +81 -0
- datakeel/storage/training_store.py +283 -0
- datakeel/storage/transcription_pricing.py +38 -0
- datakeel/storage/transcription_rows.py +19 -0
- datakeel/storage/transcription_store.py +65 -0
- datakeel/storage/vector_authorization.py +154 -0
- datakeel/storage/vector_budget.py +195 -0
- datakeel/storage/vector_cache.py +106 -0
- datakeel/storage/vector_current.py +37 -0
- datakeel/storage/vector_cursor.py +68 -0
- datakeel/storage/vector_integrity.py +70 -0
- datakeel/storage/vector_planning.py +86 -0
- datakeel/storage/vector_queries.py +196 -0
- datakeel/storage/vector_query_snapshot.py +188 -0
- datakeel/storage/vector_references.py +63 -0
- datakeel/storage/vector_reports.py +90 -0
- datakeel/storage/vector_rows.py +49 -0
- datakeel/storage/vector_set_integrity.py +74 -0
- datakeel/storage/workbench_assignees.py +63 -0
- datakeel/storage/workbench_pixels.py +20 -0
- datakeel/storage/workbench_reads.py +282 -0
- datakeel/storage/workbench_risk.py +121 -0
- datakeel/storage/workbench_samples.py +179 -0
- datakeel/storage/workflow_recovery.py +149 -0
- datakeel/storage/workflow_rows.py +66 -0
- datakeel/storage/workflow_store.py +202 -0
- datakeel/training/__init__.py +4 -0
- datakeel/training/export.py +153 -0
- datakeel/training/export_common.py +264 -0
- datakeel/training/export_detection.py +188 -0
- datakeel/training/export_hf.py +76 -0
- datakeel/training/export_keypoints.py +92 -0
- datakeel/training/export_records.py +76 -0
- datakeel/training/export_segments.py +63 -0
- datakeel/training/importers.py +143 -0
- datakeel/training/leakage.py +157 -0
- datakeel/training/native.py +38 -0
- datakeel/training/proportions.py +224 -0
- datakeel/training/refinement.py +147 -0
- datakeel/training/single_prevalence.py +196 -0
- datakeel/training/splitting.py +248 -0
- datakeel/training/text_hashes.py +62 -0
- datakeel/transcription/__init__.py +4 -0
- datakeel/transcription/adapters.py +103 -0
- datakeel/transcription/alignment.py +144 -0
- datakeel/transcription/auto.py +192 -0
- datakeel/transcription/auto_adapter.py +84 -0
- datakeel/transcription/auto_document.py +77 -0
- datakeel/transcription/auto_rows.py +123 -0
- datakeel/transcription/cache.py +38 -0
- datakeel/transcription/coordinates.py +58 -0
- datakeel/transcription/factory.py +140 -0
- datakeel/transcription/images.py +36 -0
- datakeel/transcription/loader.py +56 -0
- datakeel/transcription/ocr.py +117 -0
- datakeel/transcription/policy.py +28 -0
- datakeel/transcription/prompt.py +54 -0
- datakeel/transcription/quality.py +89 -0
- datakeel/transcription/transport.py +157 -0
- datakeel/versioning/__init__.py +66 -0
- datakeel/versioning/campaign.py +257 -0
- datakeel/versioning/campaign_v2.py +304 -0
- datakeel/versioning/campaign_v3.py +304 -0
- datakeel/versioning/configuration.py +56 -0
- datakeel/versioning/facts_v2.py +82 -0
- datakeel/versioning/inspect.py +185 -0
- datakeel/versioning/inspect_v2.py +224 -0
- datakeel/versioning/inspect_v3.py +184 -0
- datakeel/versioning/location.py +48 -0
- datakeel/versioning/lock.py +25 -0
- datakeel/versioning/models.py +76 -0
- datakeel/versioning/recovery.py +144 -0
- datakeel/versioning/recovery_models.py +34 -0
- datakeel/versioning/references.py +55 -0
- datakeel/versioning/registry.py +14 -0
- datakeel/versioning/sqlite_b1.json +1598 -0
- datakeel/versioning/sqlite_b2.json +1628 -0
- datakeel/versioning/sqlite_b2_altered_shards.json +6 -0
- datakeel/versioning/sqlite_b3.json +1628 -0
- datakeel/versioning/v1.py +106 -0
- datakeel/versioning/v2.py +66 -0
- datakeel/versioning/v3.py +68 -0
- datakeel/web_dist/.runtime-dependencies.json +16 -0
- datakeel/web_dist/.source-hash +1 -0
- datakeel/web_dist/THIRD-PARTY-LICENSES.txt +446 -0
- datakeel/web_dist/action-runs/index.html +19 -0
- datakeel/web_dist/assets/index-DMt5we1u.css +1 -0
- datakeel/web_dist/assets/index-N04GGpcG.js +69 -0
- datakeel/web_dist/assets/source-code-pro-latin-400-normal-DEXWLoHG.woff2 +0 -0
- datakeel/web_dist/assets/source-code-pro-latin-500-normal-DrRT_DWv.woff2 +0 -0
- datakeel/web_dist/assets/source-serif-4-latin-600-normal-DouSKlru.woff2 +0 -0
- datakeel/web_dist/assets/source-serif-4-latin-700-normal-CGGdTIBe.woff2 +0 -0
- datakeel/web_dist/favicon.svg +1 -0
- datakeel/web_dist/index.html +19 -0
- datakeel/web_dist/lineage/index.html +19 -0
- datakeel/web_dist/report/index.html +19 -0
- datakeel/web_dist/tasks/index.html +19 -0
- datakeel/worker/__init__.py +4 -0
- datakeel/worker/custom_runner.py +148 -0
- datakeel/worker/datasheet_model.py +144 -0
- datakeel/worker/datasheet_runner.py +57 -0
- datakeel/worker/dq_runner.py +63 -0
- datakeel/worker/dq_webhooks.py +65 -0
- datakeel/worker/heartbeat.py +15 -0
- datakeel/worker/kg_execution.py +183 -0
- datakeel/worker/kg_metering.py +131 -0
- datakeel/worker/kg_report.py +129 -0
- datakeel/worker/kg_runner.py +111 -0
- datakeel/worker/kg_transcription.py +259 -0
- datakeel/worker/media_observations.py +68 -0
- datakeel/worker/observations.py +112 -0
- datakeel/worker/queue.py +9 -0
- datakeel/worker/runner.py +159 -0
- datakeel/worker/transcription_consent.py +30 -0
- datakeel/worker/transcription_metering.py +140 -0
- datakeel/worker_store/__init__.py +4 -0
- datakeel/worker_store/completion.py +65 -0
- datakeel/worker_store/rows.py +59 -0
- datakeel/worker_store/schema.py +13 -0
- datakeel/worker_store/task_models.py +42 -0
- datakeel/worker_store/task_queries.py +29 -0
- datakeel/worker_store/task_queue.py +389 -0
- datakeel/worker_store/task_terminal.py +100 -0
- datakeel/worker_store/task_views.py +51 -0
- datakeel/workflows/__init__.py +4 -0
- datakeel/workflows/execution.py +129 -0
- datakeel/workflows/loader.py +104 -0
- datakeel/workflows/models.py +158 -0
- datakeel/workflows/resolver.py +152 -0
- datakeel/workflows/schemas.py +116 -0
- datakeel/workflows/validation.py +143 -0
- datakeel-0.27.0.dist-info/METADATA +248 -0
- datakeel-0.27.0.dist-info/RECORD +1430 -0
- datakeel-0.27.0.dist-info/WHEEL +4 -0
- datakeel-0.27.0.dist-info/entry_points.txt +2 -0
- datakeel-0.27.0.dist-info/licenses/LICENSE +202 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Copyright 2026 Datakeel contributors
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
"""Generate labelled local images with one known cross-directory duplicate."""
|
|
5
|
+
|
|
6
|
+
import hashlib
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
|
|
9
|
+
from PIL import Image
|
|
10
|
+
|
|
11
|
+
from datakeel.core.annotation_models import AnnotationBatch, AnnotationRecord
|
|
12
|
+
from datakeel.core.annotation_sampling import AnnotationImportRequest
|
|
13
|
+
from datakeel.core.harness_eval import CaseFixture
|
|
14
|
+
from datakeel.storage.annotation_store import import_annotations
|
|
15
|
+
from datakeel.storage.database import Database
|
|
16
|
+
from datakeel.storage.evidence_import import import_evidence_samples, source_manifest
|
|
17
|
+
|
|
18
|
+
_TRAIN_SIZE = 80
|
|
19
|
+
_TRAIN_VAL_SIZE = 90
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def seed_training_case(db: Database, directory: Path) -> CaseFixture:
|
|
23
|
+
"""Import 100 noise images, two balanced classes and one exact validation leak."""
|
|
24
|
+
root = directory / "training"
|
|
25
|
+
for index in range(100):
|
|
26
|
+
split = "train" if index < _TRAIN_SIZE else "val" if index < _TRAIN_VAL_SIZE else "test"
|
|
27
|
+
path = root / split / f"sample-{index:03d}.png"
|
|
28
|
+
path.parent.mkdir(parents=True, exist_ok=True)
|
|
29
|
+
# Reuse only this image; expected leakage is measured by the production code.
|
|
30
|
+
pixel_seed = 0 if index == _TRAIN_SIZE else index
|
|
31
|
+
pixels = hashlib.shake_256(str(pixel_seed).encode()).digest(32 * 32 * 3)
|
|
32
|
+
Image.frombytes("RGB", (32, 32), pixels).save(path)
|
|
33
|
+
dataset = import_evidence_samples(db, "Generated training golden fixture", root)
|
|
34
|
+
version_id, files = source_manifest(db, dataset.id)
|
|
35
|
+
import_annotations(
|
|
36
|
+
db,
|
|
37
|
+
dataset.id,
|
|
38
|
+
AnnotationImportRequest(
|
|
39
|
+
version_id=version_id,
|
|
40
|
+
idempotency_key="training-golden-labels",
|
|
41
|
+
batch=AnnotationBatch(
|
|
42
|
+
annotations=tuple(
|
|
43
|
+
AnnotationRecord(
|
|
44
|
+
sample_id=file.id,
|
|
45
|
+
annotator_id="reviewer",
|
|
46
|
+
labels=("even" if int(Path(file.filename).stem[-3:]) % 2 == 0 else "odd",),
|
|
47
|
+
)
|
|
48
|
+
for file in files
|
|
49
|
+
)
|
|
50
|
+
),
|
|
51
|
+
),
|
|
52
|
+
)
|
|
53
|
+
return CaseFixture(dataset_id=dataset.id, version_id=version_id, file_id=files[0].id)
|
datakeel/http.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Copyright 2026 Datakeel contributors
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
"""HTTP clients use explicit transport configuration and never ambient proxies."""
|
|
5
|
+
|
|
6
|
+
import httpx
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class Client(httpx.Client):
|
|
10
|
+
"""Provide a small synchronous JSON client for local verification commands."""
|
|
11
|
+
|
|
12
|
+
def __init__(self, base_url: str = "", timeout: float = 10) -> None:
|
|
13
|
+
"""Use only the provided HTTP target and a finite timeout."""
|
|
14
|
+
super().__init__(base_url=base_url, timeout=timeout, trust_env=False)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
Response = httpx.Response
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
# Copyright 2026 Datakeel contributors
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
"""A change that is already so: the target state compared with the current one.
|
|
5
|
+
|
|
6
|
+
Every state-changing step is compared with what the platform holds now before a card is
|
|
7
|
+
made. When nothing would change, the person hears the current state in plain words
|
|
8
|
+
("吴迪的账号已经停用", "这条已经在 Peter 手上审核", "这些文件本来就没被隔离") instead of a
|
|
9
|
+
card to confirm. Steps without a specific comparison fall back to the shared checks.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
from collections.abc import Callable
|
|
13
|
+
|
|
14
|
+
from pydantic import JsonValue
|
|
15
|
+
from pydantic import ValidationError as ModelValidationError
|
|
16
|
+
|
|
17
|
+
from datakeel.core.errors import DatakeelError
|
|
18
|
+
from datakeel.core.intent_models import ChainStep
|
|
19
|
+
from datakeel.dataset_store.object_queries import evaluate
|
|
20
|
+
from datakeel.intents.catalog import EntityCatalog
|
|
21
|
+
from datakeel.intents.describe import describe_step
|
|
22
|
+
from datakeel.intents.impossible import idle_reason
|
|
23
|
+
from datakeel.intents.object_edits import current_model
|
|
24
|
+
from datakeel.intents.plain_words import enum_label
|
|
25
|
+
from datakeel.intents.verify import unchanged
|
|
26
|
+
from datakeel.intents.wording import IDLE
|
|
27
|
+
from datakeel.ontology.models import ObjectSet
|
|
28
|
+
from datakeel.storage.database import Database
|
|
29
|
+
from datakeel.storage.identity_store import list_users
|
|
30
|
+
from datakeel.storage.intent_reads import task_holders
|
|
31
|
+
|
|
32
|
+
# A status change and nothing else; any other change is compared by the shared checks.
|
|
33
|
+
ACCOUNT_KEYS = frozenset({"operation", "user_id", "status", "request_id"})
|
|
34
|
+
type State = Callable[[Database, ChainStep, EntityCatalog, str], str | None]
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def _name(catalog: EntityCatalog, kind: str, identifier: JsonValue) -> str:
|
|
38
|
+
entry = catalog.get(kind, identifier) if isinstance(identifier, str) else None
|
|
39
|
+
return entry.label if entry is not None else str(identifier)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def _account(db: Database, step: ChainStep, catalog: EntityCatalog, language: str) -> str | None:
|
|
43
|
+
"""Enabling or disabling an account that is already so."""
|
|
44
|
+
params = step.params
|
|
45
|
+
wanted = params.get("status")
|
|
46
|
+
if params.get("operation") != "update" or not isinstance(wanted, str):
|
|
47
|
+
return None
|
|
48
|
+
user = next((item for item in list_users(db) if item.id == params.get("user_id")), None)
|
|
49
|
+
if user is None or user.status != wanted or set(params) - ACCOUNT_KEYS:
|
|
50
|
+
return None
|
|
51
|
+
status, who = enum_label(wanted, language), _name(catalog, "user", user.id)
|
|
52
|
+
if language == "zh":
|
|
53
|
+
return f"{who}的账号已经是{status}状态"
|
|
54
|
+
return f"{who}'s account is already {status}"
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def _holder(db: Database, step: ChainStep, catalog: EntityCatalog, language: str) -> str | None:
|
|
58
|
+
"""Giving tasks to the person who already holds them in that stage."""
|
|
59
|
+
tasks, actor = step.params.get("task_ids"), step.params.get("actor")
|
|
60
|
+
stage = str(step.params.get("stage") or "annotation")
|
|
61
|
+
if not isinstance(tasks, list) or not tasks or not isinstance(actor, str):
|
|
62
|
+
return None
|
|
63
|
+
holders = task_holders(db, [str(task) for task in tasks], stage)
|
|
64
|
+
if not all(holders.get(str(task)) == actor for task in tasks):
|
|
65
|
+
return None
|
|
66
|
+
who, zh = _name(catalog, "user", actor), language == "zh"
|
|
67
|
+
where = ("手上审核", " for review") if stage == "review" else ("手上", "")
|
|
68
|
+
return (
|
|
69
|
+
f"这些任务已经在{who}{where[0]}" if zh else f"those tasks are already with {who}{where[1]}"
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def _files(db: Database, step: ChainStep, catalog: EntityCatalog, language: str) -> str | None:
|
|
74
|
+
"""Quarantining files that are all quarantined, or releasing files none of which is."""
|
|
75
|
+
del catalog
|
|
76
|
+
zh = language == "zh"
|
|
77
|
+
try:
|
|
78
|
+
query = ObjectSet.model_validate(step.params.get("selection"))
|
|
79
|
+
found = evaluate(db, query).objects
|
|
80
|
+
except (ModelValidationError, DatakeelError):
|
|
81
|
+
return None
|
|
82
|
+
flags = [item.properties.get("quarantined") is True for item in found]
|
|
83
|
+
if step.action == "unquarantine_files" and not any(flags):
|
|
84
|
+
return "这些文件本来就没被隔离" if zh else "those files are not quarantined"
|
|
85
|
+
if step.action == "quarantine_files" and flags and all(flags):
|
|
86
|
+
return "这些文件已经隔离了" if zh else "those files are already quarantined"
|
|
87
|
+
return None
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def _model(db: Database, step: ChainStep, catalog: EntityCatalog, language: str) -> str | None:
|
|
91
|
+
"""A model change that leaves every setting as the catalog holds it."""
|
|
92
|
+
del catalog
|
|
93
|
+
wanted = step.params.get("model")
|
|
94
|
+
current = current_model(db, wanted) if isinstance(wanted, dict) else None
|
|
95
|
+
if current is None or current.model_dump(mode="json", exclude={"revision"}) != wanted:
|
|
96
|
+
return None
|
|
97
|
+
if language == "zh":
|
|
98
|
+
return f"「{current.name}」现在就是这些设置"
|
|
99
|
+
return f'"{current.name}" already has exactly these settings'
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
STATES: dict[str, State] = {
|
|
103
|
+
"update_model": _model,
|
|
104
|
+
"manage_users": _account,
|
|
105
|
+
"assign_tasks": _holder,
|
|
106
|
+
"quarantine_files": _files,
|
|
107
|
+
"unquarantine_files": _files,
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
def _ids(step: ChainStep, key: str) -> set[str]:
|
|
112
|
+
values = [{**step.params, **entry}.get(key) for entry in step.items or [step.params]]
|
|
113
|
+
flat = [item for value in values for item in (value if isinstance(value, list) else [value])]
|
|
114
|
+
return {item for item in flat if isinstance(item, str)}
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
def given_back(checked: list[ChainStep], idle: dict[str, str]) -> dict[str, str]:
|
|
118
|
+
"""A take-back whose tasks a later idle step would hand to the one holding them now.
|
|
119
|
+
|
|
120
|
+
"收回来再交给 X" when X already holds them would only take the tasks away from X, so the
|
|
121
|
+
take-back changes nothing the person wants either and is set aside with the same state.
|
|
122
|
+
"""
|
|
123
|
+
found: dict[str, str] = {}
|
|
124
|
+
for index, step in enumerate(checked):
|
|
125
|
+
taken = _ids(step, "task_id") | _ids(step, "task_ids")
|
|
126
|
+
if step.action != "revoke_assignment" or step.id in idle or not taken:
|
|
127
|
+
continue
|
|
128
|
+
back = (
|
|
129
|
+
idle[later.id]
|
|
130
|
+
for later in checked[index + 1 :]
|
|
131
|
+
if later.id in idle
|
|
132
|
+
and later.action == "assign_tasks"
|
|
133
|
+
and taken <= _ids(later, "task_ids")
|
|
134
|
+
)
|
|
135
|
+
if (state := next(back, None)) is not None:
|
|
136
|
+
found[step.id] = state
|
|
137
|
+
return found
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
# How the current state reads for an action whose state is shown through its own values.
|
|
141
|
+
STATE_WORDS: dict[str, tuple[str, str]] = {
|
|
142
|
+
"publish_label_set": ("已经发布过了", "is already published"),
|
|
143
|
+
"reopen_task": ("还没做完, 本来就开着", "is still open, not finished yet"),
|
|
144
|
+
"upgrade_project": ("已经是这个档位", "already has that tier"),
|
|
145
|
+
"configure_project": ("已经是这些设置", "already has these settings"),
|
|
146
|
+
"create_label_set": ("标签已经就是这些", "already has exactly these labels"),
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
def stated(db: Database, step: ChainStep, catalog: EntityCatalog, language: str) -> str:
|
|
151
|
+
"""The current state in the step's own words, for any action that would change nothing."""
|
|
152
|
+
zh = language == "zh"
|
|
153
|
+
lines = [line for line in describe_step(db, step, catalog, language) if line.value]
|
|
154
|
+
lines = [line for line in lines if line.tone != "default"][:4]
|
|
155
|
+
shown = ("、" if zh else ", ").join(f"{line.label} {line.value}" for line in lines)
|
|
156
|
+
words = STATE_WORDS.get(step.action, ("现在就是这样", "is already like that"))[0 if zh else 1]
|
|
157
|
+
if not shown:
|
|
158
|
+
return f"现在{words}" if zh else f"it {words}"
|
|
159
|
+
return f"{shown}: {words}"
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
def already_state(
|
|
163
|
+
db: Database, step: ChainStep, catalog: EntityCatalog, language: str
|
|
164
|
+
) -> str | None:
|
|
165
|
+
"""The current state in words when the step would change nothing; None otherwise."""
|
|
166
|
+
check = STATES.get(step.action)
|
|
167
|
+
found = check(db, step, catalog, language) if check and not step.items else None
|
|
168
|
+
if found is not None:
|
|
169
|
+
return found
|
|
170
|
+
if not unchanged(db, step):
|
|
171
|
+
return None
|
|
172
|
+
reason = idle_reason(step.action, language)
|
|
173
|
+
return reason if reason not in IDLE else stated(db, step, catalog, language)
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
# Copyright 2026 Datakeel contributors
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
"""Run one read-only function directly and phrase its result."""
|
|
5
|
+
|
|
6
|
+
import logging
|
|
7
|
+
import re
|
|
8
|
+
|
|
9
|
+
from pydantic import JsonValue
|
|
10
|
+
|
|
11
|
+
from datakeel.core.intent_models import ReadAnswer
|
|
12
|
+
from datakeel.core.models import JsonDocument
|
|
13
|
+
from datakeel.intents.object_answers import lineage_text, objects_text
|
|
14
|
+
from datakeel.intents.plain_words import ENUM_LABELS, enum_label, key_label
|
|
15
|
+
from datakeel.intents.selectors import near_duplicates_measured, still_computing
|
|
16
|
+
from datakeel.intents.wording import action_title
|
|
17
|
+
from datakeel.ontology.tool_models import ToolCallContext
|
|
18
|
+
from datakeel.ontology.tooling import invoke_tool
|
|
19
|
+
from datakeel.storage.database import Database
|
|
20
|
+
|
|
21
|
+
logger = logging.getLogger(__name__)
|
|
22
|
+
SUMMARY_LIMIT = 600
|
|
23
|
+
# Keys whose values are names people gave, never a fixed choice to translate.
|
|
24
|
+
NAMED_KEYS = frozenset({"name", "label", "actor", "filename", "title", "holder", "description"})
|
|
25
|
+
LIST_LIMIT = 10
|
|
26
|
+
UUID = re.compile(r"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", re.IGNORECASE)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def _number(item: dict[str, JsonValue], key: str) -> float:
|
|
30
|
+
value = item.get(key)
|
|
31
|
+
return float(value) if isinstance(value, int | float) and not isinstance(value, bool) else 0.0
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def _people(data: JsonValue) -> list[dict[str, JsonValue]]:
|
|
35
|
+
rows = data.get("annotators") if isinstance(data, dict) else None
|
|
36
|
+
return [item for item in rows if isinstance(item, dict)] if isinstance(rows, list) else []
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
_WINDOW_WORDS: dict[str, tuple[str, str]] = {
|
|
40
|
+
"today": ("今天", "today"),
|
|
41
|
+
"this_week": ("本周", "this week"),
|
|
42
|
+
"last_week": ("上周", "last week"),
|
|
43
|
+
"this_month": ("本月", "this month"),
|
|
44
|
+
"last_7_days": ("最近 7 天", "in the last 7 days"),
|
|
45
|
+
"last_30_days": ("最近 30 天", "in the last 30 days"),
|
|
46
|
+
"all_time": ("全部时间", "across all time"),
|
|
47
|
+
"custom": ("所选时间段内", "in the selected period"),
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def _rework_scope(data: dict[str, JsonValue]) -> tuple[str, str] | None:
|
|
52
|
+
days = data.get("days")
|
|
53
|
+
if isinstance(days, int) and not isinstance(days, bool):
|
|
54
|
+
return f"最近 {days} 天", f"in the last {days} days"
|
|
55
|
+
window = data.get("window")
|
|
56
|
+
return _WINDOW_WORDS.get(window) if isinstance(window, str) else None
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def _workload(data: JsonValue, language: str) -> str | None:
|
|
60
|
+
if not isinstance(data, dict) or not isinstance(data.get("annotators"), list):
|
|
61
|
+
return None
|
|
62
|
+
scope = _rework_scope(data)
|
|
63
|
+
reviewed = [item for item in _people(data) if _number(item, "review_count") > 0]
|
|
64
|
+
if not reviewed:
|
|
65
|
+
zh = (
|
|
66
|
+
f"{scope[0]}还没有审核记录, 算不出返工率。"
|
|
67
|
+
if scope
|
|
68
|
+
else "还没有审核记录, 算不出返工率。"
|
|
69
|
+
)
|
|
70
|
+
en = f"No reviews {scope[1]} yet." if scope else "No reviews yet."
|
|
71
|
+
return zh if language == "zh" else en
|
|
72
|
+
top = max(reviewed, key=lambda item: (_number(item, "rework_rate"), str(item.get("actor"))))
|
|
73
|
+
rate, actor = _number(top, "rework_rate"), top.get("actor")
|
|
74
|
+
count, total = int(_number(top, "rework_count")), int(_number(top, "review_count"))
|
|
75
|
+
if scope is not None:
|
|
76
|
+
return (
|
|
77
|
+
f"{scope[0]}返工率最高的是 {actor}: {rate:.0%} ({total} 次审核里返工 {count} 次)。"
|
|
78
|
+
if language == "zh"
|
|
79
|
+
else (
|
|
80
|
+
f"{actor} has the highest rework rate {scope[1]}: "
|
|
81
|
+
f"{rate:.0%} ({count} of {total} reviews)."
|
|
82
|
+
)
|
|
83
|
+
)
|
|
84
|
+
return (
|
|
85
|
+
f"返工率最高的是 {actor}: {rate:.0%} "
|
|
86
|
+
f"({total} 次审核里返工 {count} 次, 按项目全部审核记录统计)。"
|
|
87
|
+
if language == "zh"
|
|
88
|
+
else (
|
|
89
|
+
f"{actor} has the highest rework rate: {rate:.0%} "
|
|
90
|
+
f"({count} of {total} reviews across all project reviews)."
|
|
91
|
+
)
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def _holding(data: JsonValue, language: str) -> str | None:
|
|
96
|
+
people = _people(data)
|
|
97
|
+
if not people:
|
|
98
|
+
return None
|
|
99
|
+
rows = sorted(people, key=lambda item: (-_number(item, "assigned"), str(item.get("actor"))))
|
|
100
|
+
parts = [
|
|
101
|
+
f"{item.get('actor')} {int(_number(item, 'assigned'))}/{int(_number(item, 'completed'))}"
|
|
102
|
+
for item in rows[:10]
|
|
103
|
+
]
|
|
104
|
+
if language == "zh":
|
|
105
|
+
return "每人分到/已完成的任务数: " + ", ".join(parts) + "。"
|
|
106
|
+
return "Tasks assigned/completed per person: " + ", ".join(parts) + "."
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
def _unanswered(data: JsonValue, language: str) -> str | None:
|
|
110
|
+
"""A question no registered metric answers is said so, not dumped as evidence."""
|
|
111
|
+
if not isinstance(data, dict) or data.get("status") != "unanswerable":
|
|
112
|
+
return None
|
|
113
|
+
if language == "zh":
|
|
114
|
+
return (
|
|
115
|
+
"已登记的指标回答不了这个问题。可以直接问具体的数据, 比如数据集列表、找文件或治理报告。"
|
|
116
|
+
)
|
|
117
|
+
return (
|
|
118
|
+
"No registered metric answers this question. Ask for the data directly instead, "
|
|
119
|
+
"such as the list of datasets, a file search or the governance report."
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
def answer_text(function: str, data: JsonValue, language: str) -> str:
|
|
124
|
+
"""Prefer a sentence for well-known reads, otherwise a compact data summary."""
|
|
125
|
+
phrases = {
|
|
126
|
+
"rework_rate": _workload,
|
|
127
|
+
"annotator_workload": _holding,
|
|
128
|
+
"ask_data": _unanswered,
|
|
129
|
+
"production_objects": objects_text,
|
|
130
|
+
"get_lineage": lineage_text,
|
|
131
|
+
}
|
|
132
|
+
phrase = phrases.get(function)
|
|
133
|
+
sentence = phrase(data, language) if phrase else None
|
|
134
|
+
if sentence:
|
|
135
|
+
return sentence
|
|
136
|
+
summary = readable(data, language=language)
|
|
137
|
+
if len(summary) > SUMMARY_LIMIT:
|
|
138
|
+
summary = summary[:SUMMARY_LIMIT] + "…"
|
|
139
|
+
return f"{action_title(function, language)}: {summary}"
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
def _hidden(key: str, value: JsonValue) -> bool:
|
|
143
|
+
"""Identities mean nothing to a person reading the answer; the data keeps them."""
|
|
144
|
+
if key == "id" or key.endswith(("_id", "_ids")):
|
|
145
|
+
return True
|
|
146
|
+
return isinstance(value, str) and UUID.fullmatch(value) is not None
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
def _shown(key: str, value: JsonValue, language: str) -> str:
|
|
150
|
+
"""A fixed choice in words (pending reads 未开始); names people gave stay as they are."""
|
|
151
|
+
if isinstance(value, str) and key not in NAMED_KEYS and value in ENUM_LABELS:
|
|
152
|
+
return enum_label(value, language)
|
|
153
|
+
return str(value)
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
def _pair(item: dict[str, JsonValue], language: str) -> str | None:
|
|
157
|
+
"""{"state": "pending", "count": 1} reads as "未开始 1"."""
|
|
158
|
+
shown = [(key, value) for key, value in item.items() if not _hidden(key, value)]
|
|
159
|
+
if len(shown) == 2 and all(not isinstance(value, dict | list) for _, value in shown): # noqa: PLR2004
|
|
160
|
+
return " ".join(_shown(key, value, language) for key, value in shown)
|
|
161
|
+
return None
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
def readable(data: JsonValue, depth: int = 0, *, language: str = "en", key: str = "") -> str:
|
|
165
|
+
"""A compact plain summary: names and numbers, without ids, raw keys or JSON punctuation."""
|
|
166
|
+
if isinstance(data, dict):
|
|
167
|
+
parts = [
|
|
168
|
+
f"{key_label(name, language)}: "
|
|
169
|
+
+ readable(value, depth + 1, language=language, key=name)
|
|
170
|
+
for name, value in data.items()
|
|
171
|
+
if not _hidden(name, value) and value not in (None, [], {})
|
|
172
|
+
]
|
|
173
|
+
joined = "; ".join(parts) if depth == 0 else ", ".join(parts)
|
|
174
|
+
return joined if depth == 0 else f"({joined})"
|
|
175
|
+
if isinstance(data, list):
|
|
176
|
+
items = [
|
|
177
|
+
_pair(item, language) if isinstance(item, dict) else None for item in data[:LIST_LIMIT]
|
|
178
|
+
]
|
|
179
|
+
shown = [
|
|
180
|
+
pair if pair is not None else readable(item, depth + 1, language=language, key=key)
|
|
181
|
+
for pair, item in zip(items, data[:LIST_LIMIT], strict=True)
|
|
182
|
+
]
|
|
183
|
+
more = f" … +{len(data) - LIST_LIMIT}" if len(data) > LIST_LIMIT else ""
|
|
184
|
+
return ", ".join(shown) + more
|
|
185
|
+
if isinstance(data, float):
|
|
186
|
+
return f"{data:.4g}"
|
|
187
|
+
return "-" if data is None else _shown(key, data, language)
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
def run_read(
|
|
191
|
+
db: Database,
|
|
192
|
+
function: str,
|
|
193
|
+
arguments: dict[str, JsonValue],
|
|
194
|
+
context: ToolCallContext,
|
|
195
|
+
language: str,
|
|
196
|
+
) -> tuple[ReadAnswer | None, str]:
|
|
197
|
+
"""Invoke through the audited tool boundary with the person's own access."""
|
|
198
|
+
outcome = invoke_tool(db, function, JsonDocument(arguments), context)
|
|
199
|
+
if outcome.status != "SUCCEEDED":
|
|
200
|
+
# The raw error names internals; it goes to the log, the person gets plain words.
|
|
201
|
+
logger.warning("Read %s failed: %s", function, outcome.error)
|
|
202
|
+
title = action_title(function, language)
|
|
203
|
+
if language == "zh":
|
|
204
|
+
return None, f"{title}这个查询没能完成, 什么都没改。请换个说法或稍后再试。"
|
|
205
|
+
return None, f"The read ({title}) could not finish; nothing changed. Please try again."
|
|
206
|
+
data = outcome.content.root.get("data")
|
|
207
|
+
text = answer_text(function, data, language)
|
|
208
|
+
if _waiting(db, arguments, data):
|
|
209
|
+
text = still_computing(language)
|
|
210
|
+
return ReadAnswer(function=function, arguments=arguments, data=data), text
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
def _waiting(db: Database, arguments: dict[str, JsonValue], data: JsonValue) -> bool:
|
|
214
|
+
"""A read about near duplicates that found none before they were computed."""
|
|
215
|
+
dataset = arguments.get("dataset_id")
|
|
216
|
+
asked = arguments.get("has_near_duplicate_in") or "near_dup" in str(arguments)
|
|
217
|
+
found = data.get("objects", data.get("items")) if isinstance(data, dict) else data
|
|
218
|
+
empty = not found or (isinstance(data, dict) and data.get("total") == 0)
|
|
219
|
+
return bool(asked and empty and isinstance(dataset, str)) and not near_duplicates_measured(
|
|
220
|
+
db, str(dataset), None
|
|
221
|
+
)
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Copyright 2026 Datakeel contributors
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
"""An object that cannot do what the step asks: said as "cannot", never as a question.
|
|
5
|
+
|
|
6
|
+
A pre-label run runs offline models that draw boxes and cloud vision models (v0.19.0). With
|
|
7
|
+
another model the step would fail after confirmation, so the person hears that it cannot
|
|
8
|
+
be done and why, with the models that can run named as an alternative. The plan is not
|
|
9
|
+
rewritten into "use X instead?": choosing another model is the person's next sentence.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
from pydantic import JsonValue
|
|
13
|
+
from pydantic import ValidationError as ModelValidationError
|
|
14
|
+
|
|
15
|
+
from datakeel.actions.production_catalog_parameters import RunPrelabelParams
|
|
16
|
+
from datakeel.core.errors import DatakeelError
|
|
17
|
+
from datakeel.core.intent_models import ChainStep
|
|
18
|
+
from datakeel.core.prelabel_models import PrelabelEstimate
|
|
19
|
+
from datakeel.core.production_reads import ProductionObjectQuery
|
|
20
|
+
from datakeel.intents.plain_words import enum_label
|
|
21
|
+
from datakeel.storage.database import Database
|
|
22
|
+
from datakeel.storage.production_catalog_plans import catalog_requires_approval, prelabel_estimate
|
|
23
|
+
from datakeel.storage.production_objects import production_objects
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def _runs_prelabel(properties: dict[str, JsonValue]) -> bool:
|
|
27
|
+
"""What a pre-label run accepts: a cloud vision model or an offline model drawing boxes."""
|
|
28
|
+
capabilities = properties.get("capabilities")
|
|
29
|
+
if properties.get("provider") == "cloud":
|
|
30
|
+
return True
|
|
31
|
+
return (
|
|
32
|
+
properties.get("provider") == "fake"
|
|
33
|
+
and isinstance(capabilities, list)
|
|
34
|
+
and "box" in capabilities
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def model_mismatch(db: Database, step: ChainStep, language: str) -> str | None:
|
|
39
|
+
"""Why a pre-label run cannot use this model, with the usable ones; None when it can."""
|
|
40
|
+
wanted = step.params.get("model_id")
|
|
41
|
+
if step.action != "run_prelabel" or not isinstance(wanted, str):
|
|
42
|
+
return None
|
|
43
|
+
query = ProductionObjectQuery(kind="model")
|
|
44
|
+
models = {item.asset_ref.asset_id: item.properties for item in production_objects(db, query)}
|
|
45
|
+
chosen = models.get(wanted)
|
|
46
|
+
if chosen is None or _runs_prelabel(chosen):
|
|
47
|
+
return None
|
|
48
|
+
raw = chosen.get("capabilities")
|
|
49
|
+
kinds = [enum_label(str(kind), language) for kind in raw] if isinstance(raw, list) else []
|
|
50
|
+
name = str(chosen.get("name") or wanted)
|
|
51
|
+
usable = [str(item.get("name") or key) for key, item in models.items() if _runs_prelabel(item)]
|
|
52
|
+
if language == "zh":
|
|
53
|
+
does = f"做的是{'、'.join(kinds)}标注" if kinds else "不是框标注模型"
|
|
54
|
+
other = f"能跑的有 {'、'.join(usable)}" if usable else "要先登记一个框标注模型"
|
|
55
|
+
return f"「{name}」{does}, 预标注现在只能用框标注模型或云端视觉模型, 所以做不了 ({other})"
|
|
56
|
+
does = f"does {', '.join(kinds)}" if kinds else "is not a box model"
|
|
57
|
+
other = f"models that can run: {', '.join(usable)}" if usable else "register a box model"
|
|
58
|
+
return (
|
|
59
|
+
f'"{name}" {does} and pre-labelling only runs box models or cloud vision models, so it '
|
|
60
|
+
f"cannot be done ({other})"
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def cloud_prelabel(
|
|
65
|
+
db: Database, params: dict[str, JsonValue]
|
|
66
|
+
) -> tuple[PrelabelEstimate, bool] | None:
|
|
67
|
+
"""A cloud pre-label run's estimate and whether it is over budget, as preparation prices it.
|
|
68
|
+
|
|
69
|
+
None for an offline model or a step whose project or model is not settled yet.
|
|
70
|
+
"""
|
|
71
|
+
try:
|
|
72
|
+
checked = RunPrelabelParams.model_validate({**params, "request_id": "plan"})
|
|
73
|
+
with db.session() as session:
|
|
74
|
+
estimate = prelabel_estimate(session, checked)
|
|
75
|
+
if estimate is None:
|
|
76
|
+
return None
|
|
77
|
+
return estimate, catalog_requires_approval(session, checked)
|
|
78
|
+
except (ModelValidationError, DatakeelError):
|
|
79
|
+
return None
|