[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-111738":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":12,"contributorsCount":12,"subscribersCount":12,"size":12,"stars1d":14,"stars7d":15,"stars30d":16,"stars90d":12,"forks30d":12,"starsTrendScore":17,"compositeScore":18,"rankGlobal":9,"rankLanguage":9,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":20,"hasPages":20,"topics":22,"createdAt":9,"pushedAt":31,"updatedAt":32,"readmeContent":33,"aiSummary":34,"trendingCount":12,"starSnapshotCount":12,"syncStatus":35,"lastSyncTime":36,"discoverSource":37},111738,"datakeel","chaw1\u002Fdatakeel","chaw1","Local-first workbench for auditable AI datasets, traceable business metrics, and human-approved MCP agents.",null,"Python",286,0,1,21,97,195,83,90,"Apache License 2.0",false,"main",[23,24,25,26,27,28,29,30],"data-catalog","data-governance","data-lineage","fastapi","metrics","openlineage","react","semantic-layer","2026-11-23 05:56:38","2026-11-23 20:27:43","# Datakeel\n\nVersion files, inspect evidence and ask business questions against registered metrics—with traceable results and controlled changes.\n\n[Ten-minute tour](docs\u002FDEMO.en.md) · [十分钟导览](docs\u002FDEMO.md)\n\n[Data standards](docs\u002FSTANDARDS.md) define fields and code lists, explain mapping suggestions, and report confirmed-column conformance and coverage. Every standard change and mapping confirmation requires approval.\n\n```bash\nuv sync\nuv run datakeel demo\n# Open http:\u002F\u002F127.0.0.1:8765\n# API reference: http:\u002F\u002F127.0.0.1:8765\u002Fapi\u002Fdocs\n# Stop both application processes with Ctrl+C\nuv run datakeel export --format openlineage --output events.json\nuv run datakeel export --format croissant --output croissant.json\nuv run pytest\nuv run ruff check .\nuv run pyright\n```\n\n[中文说明](README.zh.md) · [Architecture](docs\u002FARCHITECTURE.md) · [Code standards](docs\u002FCODE_STANDARDS.md) · [Controlled actions](docs\u002FACTIONS.md) · [Deployment](docs\u002FDEPLOYMENT.md) · [Changelog](CHANGELOG.md)\n\n## Proofreading workspace\n\n![Evidence workspace in English, light theme](docs\u002Fimages\u002Fui-evidence-en.png)\n\nThe interface organizes work into six groups: Workbench, Data, Evidence & quality, Operations, Agents and Models. Start at the workbench to review pending approvals, running pipelines, recent actions and dataset quality alerts. Eight object kinds share an archive with facts, relationships, evidence and history; each fact links to its source. Related actions with the same name fold into an expandable ×N card, and local graphs remain bounded to 25 visible nodes.\n\nCatalog names with an English translation use it consistently in object titles, breadcrumbs, search results, approval sheets and relationship cards. Names without a translation keep their original spelling.\n\nCatalog objects accept an optional `english_name`; metric, dimension and term definitions accept the same field. Owner display metadata is declared separately in [`owners.yaml`](contracts\u002Fsemantic-layer\u002Fowners.yaml), keyed by the unchanged owner name. English labels take precedence in the English interface; omitted labels retain the existing name fallback. Object IDs show the first eight characters only for complete UUIDs; business IDs such as `retail_revenue` remain complete, and copying always uses the full identity.\n\n- **Three-state marks** distinguish present, absent and unknown evidence; a dot means no assertion. Review status remains separate from the evidence value.\n- **Evidence anchors** connect an underlined caption and its superscript to the same numbered concept row and image box. Hovering highlights all three. At 1440×900, the evidence list shows six complete samples; use j\u002Fk, a\u002Fr and Esc in the detail drawer to navigate, accept, reject and close.\n- **Source footnotes** consolidate extractor\u002Fversion references and connect answer numbers to the metric, SQL, source fields and time range. Clarification candidates rerun the original question with an explicit metric; unavailable answers explain the missing information.\n- **Approval sheets** show frozen objects, impact, transfer, reversibility, digest, expiry and signer. Irreversible changes have a red outline and require explicit approval. A changed parameter invalidates the sheet; completed actions link to their receipt.\n\nPress **⌘K \u002F Ctrl+K** to search datasets, files, versions, actions, tables, fields, metrics and terms. Pasting a unique UUID or its first eight characters opens its archive. “Start a conversation” opens an editable draft and does not execute a command. Language and light\u002Fdark\u002Fsystem controls remain in the top bar. Latin Source Serif 4 (600\u002F700) and Source Code Pro (400\u002F500) are bundled locally with their [OFL license notices](web\u002Fpublic\u002FTHIRD-PARTY-LICENSES.txt); body text uses the system sans-serif stack, and Chinese serif headings fall back to system Songti fonts. The demo UI makes no external requests.\n\nTo reproduce the screenshot matrix against an isolated local demo:\n\n```bash\ncd web\nnpm ci\nnpm run screenshots -- http:\u002F\u002F127.0.0.1:8765\n# 13 pages × English\u002FChinese × light\u002Fdark → artifacts\u002Fscreenshots\u002F at repository root\ncd ..\n```\n\nThe script fixes the browser clock and records per-page console errors. The UI smoke additionally exercises controlled changes; start a fresh demo home for each run, then use a second terminal from the repository root:\n\n```bash\nDATAKEEL_HOME=\"$(mktemp -d)\" uv run datakeel demo --port 8773\n# In the second terminal:\nnpm --prefix web run smoke:ui -- http:\u002F\u002F127.0.0.1:8773\n# Screenshots and reports → artifacts\u002Fui-smoke\u002F at repository root\n```\n\nBoth scripts accept an optional output directory after the demo URL. See [code standards](docs\u002FCODE_STANDARDS.md) for the full development gate and [controlled actions](docs\u002FACTIONS.md) for the approval and execution rules.\n\n## Quick start\n\nInstall [uv](https:\u002F\u002Fdocs.astral.sh\u002Fuv\u002Fgetting-started\u002Finstallation\u002F), then run the first two commands above from this checkout. Python 3.12 is selected by `.python-version`; uv can install it. Node, Docker, external services, and model credentials are unnecessary for the default demo. A compiled React application is included in the Python package.\n\nThe demo starts an API and a worker, creates five file datasets, and imports the enterprise catalog described below. **Field notes · generated demo** retains the original 200 PNG images, 200 text files and eleven operators. Two intentionally empty texts are filtered, leaving 398 artifacts in a second version; the original 400 files remain downloadable. **Paired scenes · evidence demo** adds 1,000 image\u002Fcaption\u002Fannotation samples: 800 train and 200 val, with 50 annotation conflicts, 30 missing annotation sidecars and 10 corrupt images. Five deterministic evidence operators run through the same worker and DAG. The command prints URLs, completion time and extraction counters. Repeating it reuses imported datasets and runs evidence extraction against its incremental cache. Use a fresh `DATAKEEL_HOME` for an independent run, or `demo --legacy-only` for the original scenario.\n\nBrowse the dataset, switch file versions, download artifacts, inspect a lineage node's event, and read the five quality dimensions and six report chapters. No model is required. `DATAKEEL_LLM_URL` optionally names a chat-completions endpoint; a two-second request limit and failure fallback preserve the complete baseline, with baseline verification appended to generated prose.\n\nThe demo also publishes six [data assets](docs\u002FDATA_ASSETS.en.md) across public, internal, request-required and restricted classifications. Open **Asset market** to search, inspect cards, apply with a purpose and expiry, approve through a controlled action, use the grant, and inspect its audit. No grants are issued in advance. Query, export and download scopes are independent; use the same operator identifier when applying and reading (`local-user` for CLI\u002FHTTP defaults; `local` for Agent\u002FMCP).\n\nReads that include protected resources require grants. In the default demo, an all-lineage export and an unfiltered MCP metric list skip protected entries such as Customer count and report the skipped count, entry IDs and reason; the return-rate question's protected nearby candidates are refused with an application hint. Naming a protected resource directly is refused until you apply for it. A metric list filtered to `retail` and the Retail revenue question remain available. Follow the [asset tour](docs\u002FDEMO.en.md#data-assets-discover-apply-use-and-audit) for the complete approval flow.\n\n## Build local installation artifacts\n\nFrom a source checkout, `make build-wheel` refreshes the locked license notices, installs the locked frontend audit inputs with `npm ci`, builds one pure-Python wheel, and exports hashed runtime requirements. Python 3.12, uv, Node and the Rust audit toolchain are build prerequisites; Node is not needed to run the resulting wheel. Install it into a new environment rather than using the source tree:\n\n```bash\nmake build-wheel\npython3.12 -m venv .venv-wheel\n. .venv-wheel\u002Fbin\u002Factivate\npython -m pip install dist\u002Fdatakeel-*.whl\ndatakeel demo\n```\n\nWith Docker installed, `make build-image` builds the same wheel and installs it over the locked requirements in a non-root local image. The command has no publish or remote-tag option:\n\n```bash\nmake build-image\ndocker run --rm -p 127.0.0.1:8765:8765 -v datakeel-data:\u002Fdata datakeel:local\n# Open http:\u002F\u002F127.0.0.1:8765; stop the container with Ctrl+C\n```\n\nNeither command uploads a wheel or image. No PyPI or Docker Hub publication is implied.\n\n## Explore the enterprise catalog and ask data\n\nThe same demo also creates **Fictional Kitchen Co.**, a generated kitchen-appliance business with four SQLite sources: ERP, CRM, ecommerce and service. Its 20 tables and four views appear as **24 table objects, 128 fields, 13 metrics, 12 dimensions and 32 terms**. The generator writes 51,992 rows and independent answers in `gold.json`; repeated runs preserve the SQLite `.dump` text and gold bytes. SQLite metadata reflection supplies containment and foreign-key references. Field derivation comes only from parsed view definitions or supplied SQL, using `sqlglot` 30.24.0 (MIT). Engineering metadata can also be imported from dbt artifacts, the Airflow REST API v1 (live or offline exports), and OpenLineage events as described below.\n\nOpen **Data catalog** to browse sources → tables → fields, table owners, neighboring relationships and consuming metrics. Metrics and the glossary support search and pagination. Each metric card shows its definition, owner, version, caveats and unresolved reference reasons. **Downstream impact** presents a bounded tree of fields, tables, metrics, dimensions and terms. **View lineage** opens the object archive’s relationships tab with `include_catalog=true`, two hops and at most 25 visible nodes; catalog relationships have their own edge kind and nodes occupy columns by object type.\n\nOpen **Ask data** and choose `上个季度华东区零售额是多少`. At the demo's fixed reference instant, **2026-10-01T00:00:00Z**, it returns **4,979,475 yuan** for `[2026-07-01, 2026-10-01)`. The answer includes `retail_revenue`, its original version and owner, caveats, parameterized SQL, source tables\u002Ffields, highlighted term matches and a lineage link. Expand SQL to inspect bound parameters. **Replay saved answer** reloads the saved result and metric version without executing the query again. These instructions also work without starting the UI:\n\n```bash\nuv run datakeel demo --once\nuv run datakeel ask '上个季度华东区零售额是多少' --reference-instant 2026-10-01T00:00:00Z\nuv run datakeel ask '退货率为什么上升' --reference-instant 2026-10-01T00:00:00Z\nuv run datakeel ask '上个季度营业额是多少' --reference-instant 2026-10-01T00:00:00Z\nuv run datakeel eval-ask --json\nuv run datakeel rebuild-catalog\n```\n\nUse the same `DATAKEEL_HOME` and database configuration for each command. Outside the demo\u002Fevaluation, omitted `--reference-instant` uses the current instant. Time ranges are half-open; at the fixed reference, “近 30 天” means `[2026-09-01, 2026-10-01)`. In unrestricted fixtures, including `eval-ask`, unknown concepts such as the return-rate question return `unanswerable` with three nearby metrics. Published access policies also cover those disclosed candidates. “营业额” matches competing definitions and returns `clarification` with candidates. Neither state contains a numeric answer or executable SQL. Matching is deterministic; the candidate-ID reranker and its fake provider exist only in unit tests, outside demo, golden and `eval-ask`. There is no `ask --provider` option. The compiler alone produces SELECT queries from registered definitions; execution enforces a read-only connection, statement timeout and row cap.\n\nEnglish questions use the same parser and refusal path as Chinese ones. Month names and abbreviations with a year, `Q2 2026` \u002F `2026 Q2` \u002F `the second quarter of 2026`, `last|this|previous month|quarter|year`, `from … to …` ranges and `as of` \u002F `at the end of` (point-in-time, like 截至) resolve against `--reference-instant`; Chinese also accepts 第N季度, N季度 and `2026年Q3`. Periods that start at or after the reference are refused. `by|per|for each|broken down by` plus a dimension name groups; `in|for` plus a dimension value filters. Dimensions and values take English aliases from the semantic layer (`english_name`, `synonyms` and the optional `value_synonyms`, keyed by declared value). Every answer records an `interpretation`: metric, time range and basis, filters, groups and unconsumed fragments. Any time, filter, grouping or calculation fragment that no parser consumed returns `clarification` or `unanswerable` naming that fragment, never an unconditioned number.\n\nMetric matching first uses registered names and aliases, then normalized identifier words, then conservative name prefixes. `refund_amount`, `refund amount`, `refund-amount` and `Refund Amounts` share an identifier form; normalization is limited to case, separators and regular English `-s`\u002F`-es` plurals. Registered English aliases include their common singular\u002Fplural spellings. Competing registered meanings or identifier forms ask for clarification. Stewardship questions such as `Who owns the highest refund amount?` remain knowledge questions without numeric SQL; business rankings retain their existing measurement interpretation.\n\n### Metric definitions and controlled changes\n\nThe [semantic layer](contracts\u002Fsemantic-layer\u002Fmetrics.yaml) intentionally separates 出货额 (ERP shipment prices, supply-chain owner), 销售额 (CRM booked invoices, finance owner) and 零售额 (completed orders at the paid price, retail owner). This abbreviated YAML illustrates the real schema; the demo loads the complete metric, dimension and term files when initializing an empty metric catalog:\n\n```yaml\nmetrics:\n  - id: retail_revenue\n    name: 零售额\n    synonyms: [终端零售额, 实付零售额, 营业额]\n    description: Completed ecommerce orders at their paid amount, before later refunds.\n    owner: 零售运营负责人\n    version: 1\n    measure:\n      table: ecommerce\u002Fmain\u002Forders\n      column: ecommerce\u002Fmain\u002Forders\u002Fpaid_amount\n      aggregation: sum\n    filters:\n      - column: ecommerce\u002Fmain\u002Forders\u002Fstatus\n        op: eq\n        value: completed\n    time:\n      column: ecommerce\u002Fmain\u002Forders\u002Fdate\n      granularity: day\n    dimensions: [retail_region, retail_channel, retail_category]\n    caveats:\n      [\n        \"Synthetic amounts in yuan; shipment, invoiced and retail amounts differ.\",\n      ]\n```\n\n`time` is required. Aggregations are `sum`, `count`, `count_distinct`, `avg`, `min`, `max`; filter `op` is `eq`, `ne`, `in`, `gte` or `lte`, with a list value only for `in`. Dimensions bind a registered `column` and may list static `values`; terms use `means: {kind: metric|dimension|column, id: ...}`. Neither `grain` nor `values_source` is accepted. IDs use `source\u002Fschema\u002Ftable[\u002Fcolumn]`, with `main` for SQLite and percent-encoded separators\u002Fwhitespace within names. Missing references make a metric `unresolved` with reasons and prevent query execution.\n\nThe catalog owns metric versions. YAML `version` is an expected current version checked during import, not a way to overwrite history. Rerunning the demo preserves existing metric edits. In **Data catalog → Metrics → Edit definition**, change the amount field, filters or business wording, then **Review change** to prepare `update_metric`. Inspect the plan before **Execute action**; the receipt records the result and a successful update creates the next version. Changing `retail_revenue` from `paid_amount` to `list_amount` makes the same demo question return **5,255,975**. `rollback_metric`, the declared `inverse_of`, restores an earlier definition as another new version. Prepare it through `POST \u002Fapi\u002Factions\u002Frollback_metric\u002Fprepare` with `metric_id` and the historical `version`, then execute its returned plan through the existing action endpoint. **View version history (JSON)** opens [`GET \u002Fapi\u002Fcatalog\u002Fmetrics\u002Fretail_revenue\u002Fhistory`](http:\u002F\u002F127.0.0.1:8765\u002Fapi\u002Fcatalog\u002Fmetrics\u002Fretail_revenue\u002Fhistory), including `plan_id`, actor and from\u002Fto versions. Term changes likewise use `update_term` \u002F `rollback_term`.\n\nSource imports use `import_catalog` \u002F `restore_catalog`. An explicit unchanged prepare+execute import returns `unchanged` without adding catalog events; receipts include `parse_failures`. `rebuild-catalog` reconstructs catalog objects and edges from events and compares canonical hashes including the projector version; `--expected-hash` accepts a previously saved hash. Question assets and the registered `ask.answers_with`, `ask.matched_term`, `ask.unanswerable` assertions reuse evidence provenance, review and `rebuild-evidence`. Catalog and question assets never enter file-selection manifests.\n\nLocal dbt artifacts, live or offline Airflow REST v1 metadata, authenticated OpenLineage events, and metric draft confirmation are documented in [Metadata imports](docs\u002FMETADATA_IMPORTS.en.md).\n\n## Inspect and select evidence\n\nOpen **Evidence**, choose **Paired scenes · evidence demo**, and apply the example filter: val samples whose caption mentions `person`, with no `annotated_as\u002Fperson=present` assertion and a direct train near duplicate. The unchanged generated dataset returns **47 samples**, including one with unknown annotation state. A missing annotation file does not prove that a person is absent.\n\nRows show versioned thumbnails, caption highlights, annotation boxes, a compact assertion matrix, candidate counts, quality score (the existing five-dimensional file score, 0–100), and direct near-duplicate candidates. A shared source version appears once above the table; extractor\u002Fversion references are consolidated in source footnotes. Filters cover concept, scene presence, label gaps, split, quality and train\u002Fval neighbors. Select displayed rows to **Create version**, **Quarantine selection**, or **Delete selection**. Version creation and quarantine execute through reversible actions; deletion stops at an approval sheet. The plan freezes the selected file IDs and source version. Later assertion reviews do not silently change its membership; file-state changes still invalidate stale plans.\n\nThe detail drawer accepts, rejects or resets an assertion to `candidate`. `decide_assertions` changes only its review status and appends an audit entry; evidence content and provenance remain immutable. Queries use candidate\u002Faccepted assertions by default, while detail views retain rejected assertions for review. **View evidence subgraph** opens the file archive’s relationships tab, whose legend and edge styles distinguish `lineage`, `semantic` and catalog relationships.\n\nWhen a source version contains paired-sample metadata but has not been extracted, **Prepare evidence extraction** prepares a `run_pipeline` plan pinned to that displayed source version. Review the frozen input and select **Execute action** explicitly; the page shows the task and action receipt, polls progress, and refreshes the evidence after successful completion. Ordinary file datasets instead explain the pairing requirements under **Generate or import paired samples locally**: put each scene under `train\u002F` or `val\u002F`, with its image and optional `caption.txt` \u002F `annotations.json` sidecars. Follow the shown local generator\u002Fimporter commands using the same `DATAKEEL_HOME` and `DATAKEEL_DATABASE_URL` as the service; for existing samples, skip generation and point the importer at their directory. The paired importer preserves those references without running extraction. Refresh the data library, select the imported dataset in Evidence, and prepare its extraction plan. Missing sidecars remain unknown evidence.\n\nThe five operators are `evidence.image_phash`, `evidence.caption_mentions`, `evidence.annotation_labels`, `evidence.label_gap` and `evidence.near_duplicate`. The [lexicon](contracts\u002Fevidence\u002Flexicon.yaml) maps `pedestrian`, `行人` and annotation aliases to canonical `person`; scene concepts such as `night` use the same `mentions` predicate. Caption-derived observations are `present` or `unknown`; missing sidecars remain unknown. A label gap is `present` only when a caption mentions a concept and a supplied annotation file omits it. Only directly measured `corrupt` observations can be `absent` in this release. Text spans use NFC-normalized Unicode code points, `[start, end)`; image boxes use `xyxy` source pixels in the upright frame (EXIF Orientation applied) with the upright width\u002Fheight; see [Image orientation](docs\u002FANNOTATION_WORKBENCH.md#image-orientation) for re-extracting evidence made up to v0.18.0.\n\nThe [near-duplicate contract](contracts\u002Fevidence\u002Fnear_duplicate.yaml) fixes 64-bit dHash and Hamming distance ≤8. The default `mode: prefix` compares hashes within four-bit prefix buckets and can miss pairs across buckets. `mode: exact` uses disjoint-segment indexing to recover every pair within the threshold, with additional indexing and comparison cost. Each direct pair is stored once and queried in both directions; there is no transitive expansion or automatic merge. The optional `datakeel-accel` package runs the same integer comparisons in Rust; `DATAKEEL_ACCEL=auto|off|required` selects its use, with Python fallback in `auto`. See [build instructions, measured performance and implementation reports](docs\u002FRUST_ACCEL.md). The model-extractor interface and fake adapter have unit tests only; neither runs in the extraction DAG, evidence evaluation or model budget.\n\n## Image quality and point clouds\n\n`image.quality` scores blur, exposure, noise, resolution and solid color, with each failed check's measured reason. PLY (ASCII and both binary byte orders) and PCD (ASCII and binary) point clouds can be probed, cleaned, voxel-downsampled, filtered for statistical outliers, checked for suspected unit mismatch and rendered as top-down PNG previews. Results feed the five quality dimensions, reports, lineage and the file object page. Run `uv run python scripts\u002Fdemo_media.py --output \u003Cnew-directory>` for an offline end-to-end example; see [image and point-cloud quality](docs\u002FMEDIA_QUALITY.md) for signals, defaults and limits.\n\n## Extract and review a text knowledge graph\n\nThe demo includes **Business notes · knowledge graph demo**: 24 recorded passages, three clearly labelled scripted long documents and one deliberate truncation. Open **Knowledge graph**, search for `Vivo`, and inspect the pending-review relation. The evidence sentence is present; the tail entity is not. Reject it through the existing review action and confirm the graph shows a rejected edge. Source verification and human review remain separate.\n\nEntities retain all mention positions. Relations merge repeated evidence across chunks and documents, preserve extractor\u002Fmodel attribution, and expose read-only schema proposals. Extraction reports show successful, cached, failed and unexecuted blocks. The default replay and fake scripts are offline; external profiles require approval of a frozen destination, model, input and budget before worker execution. Agent and MCP share `query_kg`, `explain_relation` and the controlled `run_kg_extraction` action; Agent discovers these tools on demand.\n\n```bash\nuv run datakeel eval-kg --json\nuv run datakeel eval-kg --profile replay-flash --json\n```\n\nThe report separates original recording scores from actual product-candidate scores, including verified-only subsets and excluded-relation reasons. Replay incurs no model tokens or charges. [Schema, profiles, external cases, optional local extraction and the outbound threat model](docs\u002FKG.md) explain how to use your own authorized text and endpoints.\n\n## Deterministic workflows and routing\n\nOpen **Workflows** to choose **Dataset health check**, **Metric definition change**, or **Low-quality sample cleanup**. Review the generated input form, start explicitly, and follow each step's output and status in the saved timeline. Cleanup automatically quarantines matching files, pauses for deletion approval, then continues only when you return and click **Continue after approval**. Use the [tour's independent three-file dataset](docs\u002FDEMO.en.md#8-run-a-cleanup-workflow-and-approve-it-1-minute) to try deletion safely without changing the original 400-file demo.\n\nAgent conversations suggest a matching workflow and show the selected model tier and any backup attempt. A suggestion opens a prefilled form; it does not run automatically. Explicit conversation models stay pinned; `model: auto` uses the configured tier. The default fake provider remains offline.\n\n```bash\nuv run datakeel workflow list\nuv run datakeel workflow validate contracts\u002Fworkflows\u002Flow-quality-cleanup.yaml\nuv run datakeel routing validate\nuv run datakeel eval-route\n```\n\n[YAML, CLI, HTTP\u002FSSE, recovery and routing reference](docs\u002FWORKFLOWS.md) describes the contracts and failure behavior. A separate `datakeel api` process needs `datakeel worker` for queued pipelines. Failed or disconnected runs do not retry from the middle; only approval pauses can resume.\n\n## Offline chat demo\n\nOpen **Agent**, select **Field notes · generated demo**, and create a conversation. New UI conversations use provider `fake` \u002F model `fake-demo`. This is a deterministic local demo provider, not a live language model. Try these messages in one conversation:\n\n1. `Find text files with quality below 60`.\n2. `Quarantine those files and create a version` — reversible actions execute automatically and return receipts.\n3. `Delete those files` — execution stops at an approval sheet. Inspect the object count, bytes, expiry and frozen parameters, then select **Approve and delete files** or **Return**. Approval executes once; returning the plan changes no files.\n\nThe Chinese equivalent of step 2 is `把质量低于 60 分的文本样本隔离并生成新版本`. Search uses the original source-file assets, including the two empty texts; derived artifacts remain separately versioned. A receipt links to its lineage node. The quality page can filter by quarantine state; **Approvals**, **Run records** (select **Action** under **Run type**), **Ontology**, and **Trace and cost** expose the same persisted facts.\n\nFor evidence chat, create a conversation on **Paired scenes · evidence demo** and ask `Find val samples whose caption mentions a pedestrian but has no person annotation, with a train near duplicate`. Then try `Explain the evidence`, `Create a new version from these samples`, or `Delete these samples`. The offline provider calls the real `query_evidence` and `explain_sample` functions. It displays at most **two samples per response** and acts only on those returned IDs and their source version; use Evidence pagination for the full result set. Explanations distinguish unknown from absence. This is a bounded deterministic demo of these intents, not a general language understanding benchmark.\n\nEnable **Dry run** when creating a conversation to prepare every action without executing it. Complete conversation messages, tool results, plans and receipts are stored in the database. Reloading restores the stream and refreshes human decisions; it does not submit the message again. The built-in Agent never receives `approve_plan` or `execute_plan` as model-callable tools.\n\nThe Agent runs on LangGraph with synchronous checkpoints in the same SQLite or PostgreSQL database. A plan that requires approval pauses at a durable checkpoint, so the conversation can continue after a process restart. After a human approval, clients can resume the pending plan without adding a user message; an action already executed through the approval sheet reuses its receipt. A new message instead invalidates the old pause and records that decision. The [action guide](docs\u002FACTIONS.md#resuming-a-paused-agent--恢复暂停的-agent) describes the resume request and approval checks.\n\nConversation and daily limits cover both tokens and USD and persist across restarts. Defaults are 100,000 tokens \u002F USD 1 per conversation and 1,000,000 tokens \u002F USD 10 per UTC day; the conversation form exposes these limits. Input is reserved conservatively before a remote call. Trace segments sum to observed input tokens, with cache-read\u002Fwrite subsets recorded separately. If a dispatched request fails without usage, its trace shows `billing_status=unknown`: observed usage stays zero, while `accounted_tokens` and estimated cost charge the reservation to the budget. Actual usage over budget is recorded before stopping further tool execution. Fake-provider costs use the disclosed test tariff in `contracts\u002Fmodel-prices.yaml`; no money is spent.\n\nDiscover `delegate_agent` through `tool_search`, or try `Delegate a catalog review` in the offline demo. Independent child conversations appear as collapsible steps with tools and tokens; all calls charge the root budget. The catalog analyst, evidence reviewer and metric manager cannot prepare irreversible actions. Tool data enters compact data-only JSON envelopes; a canary leak stops the reply before persistence or tool execution. Injected data can still induce reversible actions; irreversible changes always require human approval.\n\nThe **Memory** page supports explicit creation, dataset filtering and confirmed deletion, with email\u002Fphone redaction before storage. Relevant entries are retrieved across conversations using decayed strength, and Agent shows which entries were used. Delete an entry and repeat the question in a new conversation to verify it is no longer retrieved. See the [Agent reference](docs\u002FAGENT.md) for definitions, parameters, APIs and golden formats. Type a request such as \"take Xiao Wang's untouched tasks and give them to Xiao Li\" and the Agent plans a chain of controlled actions, asks for anything missing and runs only after you confirm. This is a **beta**: on new wording about eight in ten requests get the right plan straight away, and a wrong plan is simply cancelled because nothing that changes data runs before you confirm; planning uses DeepSeek Flash with thinking on by default. See [One sentence to plan](docs\u002FONE_SENTENCE.md).\n\n### Optional provider configuration\n\nThe runtime supports OpenAI chat-completions and Anthropic messages. Configuration is optional: the offline demo and tests never call those services. Store `DATAKEEL_OPENAI_API_KEY` or `DATAKEEL_ANTHROPIC_API_KEY` outside the repository as environment secrets, then explicitly set `provider` and `model` in `POST \u002Fapi\u002Fagent\u002Fconversations` (`openai` \u002F `gpt-4.1-mini`, or `anthropic` \u002F `claude-haiku-4-5-20251001`). These models are listed in `contracts\u002Fmodel-prices.yaml`. With a key set, a new Web conversation uses that provider with `model: auto`, routed to models the configured endpoint serves; without one it uses the offline demo and says so. Use `DATAKEEL_OPENAI_BASE_URL` (normally ending in `\u002Fv1`) or `DATAKEEL_ANTHROPIC_BASE_URL` (the server root) for endpoint overrides. An OpenAI-compatible base URL can point to another compatible provider; its model must have a price entry before use. `DATAKEEL_PROVIDER_TIMEOUT` defaults to 180 seconds; one-sentence planning requests ask for JSON and are streamed, so a reasoning model's long answer is not cut off while it thinks. The deprecated complete-endpoint settings `DATAKEEL_OPENAI_URL` and `DATAKEEL_ANTHROPIC_URL` remain compatible for one release only when they end in `\u002Fchat\u002Fcompletions` and `\u002Fv1\u002Fmessages`, respectively; explicit base URLs take precedence. Selecting a real provider and sending a message would make a billable external request. These adapters use LangChain chat models and are verified with local HTTP fixtures only. Automatic model retries are disabled. LangSmith tracing is forcibly disabled even when `LANGSMITH_TRACING` or `LANGCHAIN_TRACING_V2` is set; this release has no tracing opt-in. The older `DATAKEEL_LLM_URL` controls report enrichment independently.\n\n### Export model traces with OpenTelemetry\n\n`datakeel export-traces [--conversation-id ID]` reads the existing trace store without migrating or writing it, then synchronously exports OTLP\u002FHTTP protobuf spans. It uses the [OpenTelemetry GenAI client-inference conventions](https:\u002F\u002Fgithub.com\u002Fopen-telemetry\u002Fsemantic-conventions-genai\u002Fblob\u002F16f3130892e2e02fa3f0eef72c0e6b554ff08e5c\u002Fdocs\u002Fgen-ai\u002Fclient-inference.md) (currently **Development**) and OpenInference attributes on the same spans. Prompts, completions, tool payloads, transcripts, model-route JSON and exporter credentials are not exported. Run, plan and accounting IDs are not presented as official conversation sessions. Span times are approximate values reconstructed from persisted settlement time and latency, not exact provider timestamps.\n\nThe command uses the standard `OTEL_EXPORTER_OTLP_*` settings. A signal-specific endpoint includes `\u002Fv1\u002Ftraces`; a generic endpoint lets the SDK append that path. Only HTTP 200 responses with `rejected_spans=0` count as accepted. Every span must be accepted before the command prints a count and returns success; failures and partial exports return nonzero. There is no background queue or export cursor, so repeating the command can create duplicate dashboard spans.\n\n```bash\n# Local OTLP collector\nOTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http:\u002F\u002F127.0.0.1:4318\u002Fv1\u002Ftraces \\\n  uv run datakeel export-traces --conversation-id \u003Cid>\n\n# Local Phoenix (OpenInference attributes are included)\nOTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http:\u002F\u002F127.0.0.1:6006\u002Fv1\u002Ftraces \\\n  uv run datakeel export-traces --conversation-id \u003Cid>\n\n# Langfuse: generic base endpoint and credentials supplied outside the repository\nexport OTEL_EXPORTER_OTLP_ENDPOINT=https:\u002F\u002Fcloud.langfuse.com\u002Fapi\u002Fpublic\u002Fotel\nexport OTEL_EXPORTER_OTLP_HEADERS='Authorization=Basic \u003Cbase64-public-key-secret-key>,x-langfuse-ingestion-version=4'\nuv run datakeel export-traces --conversation-id \u003Cid>\n```\n\n## How it fits together\n\n![Current Datakeel architecture: protocol entry points, application and domain layers, core contracts, and fact stores](docs\u002Fimages\u002Farchitecture-overview.svg)\n\nThe database is the fact store. A version is an immutable file manifest with SHA-256 hashes; the networkx graph is rebuilt from events. PostgreSQL workers claim one shard using `FOR UPDATE SKIP LOCKED`; SQLite claims serialize with `BEGIN IMMEDIATE`. Heartbeats, bounded retries, lease fencing, and a transactional terminal-event outbox protect task completion.\n\n```text\ndatakeel\u002F\n  core\u002F          Asset and event models\n  semantic\u002F      Generated contract snapshots and resolver\n  operators\u002F     file\u002F, image\u002F, text\u002F, evidence\u002F operators and schemas\n  evidence\u002F      Assertions, anchors, queries and extraction contracts\n  kg\u002F            Text chunks, schema checks, entity identity and source verification\n  kg_eval\u002F       Independent benchmark scoring and product-path evaluation\n  extraction_runtime\u002F  Typed adapters for explicitly selected model transports\n  catalog\u002F       SQLite reflection, SQL field lineage and catalog imports\n  metrics\u002F       YAML definitions, resolution and read-only SQL compilation\n  ask\u002F           Deterministic questions, evidence and isolated evaluation\n  sample_enterprise\u002F  Packaged deterministic enterprise sources and gold\n  pipeline\u002F      Typed-slot validation and concurrent DAG execution\n  quality\u002F       Five-dimensional scoring and six-chapter reports\n  lineage\u002F       Idempotent events, graph projection and exports\n  governance\u002F    Standards, metadata validation and compliance\n  storage\u002F       Database models and local\u002FS3 object stores\n  worker\u002F        Claims, leases, reaper and outbox\n  api\u002F           HTTP routes and read-only \u002Fadmin view\n  ontology\u002F      Versioned types, queries and read-only functions\n  actions\u002F       Frozen plans, approvals and execution policy\n  agent\u002F         Conversations, context, tool discovery, guards and metering\n  runtime\u002F       LangGraph execution, LangChain chat adapters and checkpoint saver\n  harness\u002F       Persistent budgets, traces and golden evaluation\n  mcp\u002F           FastMCP tools over stdio or SSE\n  cli\u002F           demo, api, worker, migrate, export, ask, eval, eval-evidence, eval-ask, eval-kg,\n                 rebuild-evidence, rebuild-catalog, mcp\nweb\u002F             React + TypeScript + Vite source\ncontracts\u002F       Operator\u002Fevidence contracts, semantic layer, question\u002Fgolden corpora\nexamples\u002F        Regeneratable sample-data entry point\ntests\u002F           Unit, integration and regression tests\nscripts\u002F         Snapshot generation and repeatable verification\ndocs\u002F            Architecture, code standards and user guides\n```\n\nOntology is an interface over existing facts: `AssetRef` remains the identity, versions remain manifests, and object sets freeze revisions for controlled execution. Approvals bind a plan digest and expire; changed parameters or targets invalidate execution. Successful and failed actions retain attributable audit and lineage evidence.\n\n## Run the roles separately\n\n```bash\nuv run datakeel migrate\nuv run datakeel api --port 8765\n# In another terminal, with the same configuration:\nuv run datakeel worker\n# Noninteractive fixture generation and execution:\nuv run datakeel demo --once\n```\n\nFor SQLite, `db status` inspects without writes, `db upgrade` explicitly upgrades, and `migrate` is its compatibility alias. Services require a current store. See [database maintenance and isolated recovery](docs\u002FDATABASE_MAINTENANCE.md).\n\n\n`DATAKEEL_HOME` defaults to `.datakeel` and holds the database, objects, generated samples, and isolated execution attempts. `DATAKEEL_DATABASE_URL=postgresql:\u002F\u002Fuser@127.0.0.1:5432\u002Fdatakeel` selects PostgreSQL. `DATAKEEL_S3_BUCKET` selects S3 and `DATAKEEL_S3_ENDPOINT` optionally selects a compatible endpoint; normal AWS environment\u002Fprofile discovery supplies access settings outside the repository. API and worker processes must share the same object store.\n\nFor a new local PostgreSQL instance (Docker required):\n\n```bash\ndocker run -d --name datakeel-local-pg -p 127.0.0.1:55438:5432 -e POSTGRES_USER=datakeel -e POSTGRES_DB=datakeel -e POSTGRES_HOST_AUTH_METHOD=trust postgres:17-alpine\nexport DATAKEEL_DATABASE_URL=postgresql:\u002F\u002Fdatakeel@127.0.0.1:55438\u002Fdatakeel\nexport DATAKEEL_HOME=.datakeel\u002Fpostgres\nuv run datakeel demo\n```\n\nThe example binds the trust-enabled test instance only to loopback. Multi-user authentication and production deployment are outside this release; the local actor is `local`.\n\n## API workflows\n\nThe interactive [local API reference](http:\u002F\u002F127.0.0.1:8765\u002Fapi\u002Fdocs) includes all request schemas.\n\n| Workflow               | Endpoints                                                                                                                                                                                |\n| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| Dataset and imports    | `GET\u002FPOST \u002Fapi\u002Fdatasets`, `GET \u002Fapi\u002Fdatasets\u002F{id}`; imports accept a list of `{filename, content_base64}`                                                                                |\n| Versions and downloads | `GET \u002Fapi\u002Fdatasets\u002F{id}\u002Fversions`, `\u002Ffiles?version={version_id}`, `\u002Ffiles\u002F{file_id}\u002Fdownload`                                                                                            |\n| Execution              | `POST \u002Fapi\u002Ftasks`, `GET \u002Fapi\u002Ftasks`, `\u002Fapi\u002Ftasks\u002F{id}`, `\u002Fapi\u002Ftasks\u002F{id}\u002Fartifacts`                                                                                                      |\n| Lineage                | `GET \u002Fapi\u002Flineage\u002Fgraph?asset={id}&direction=upstream&depth=3`, `POST \u002Fapi\u002Flineage\u002Fevents`                                                                                               |\n| Evidence               | `POST \u002Fapi\u002Fevidence\u002Fquery`, `GET \u002Fapi\u002Fevidence\u002Fassets\u002F{asset_id}?version_id={version_id}`, `POST \u002Fapi\u002Fevidence\u002Fassertions\u002Fdecide`                                                        |\n| Evidence subgraph      | `GET \u002Fapi\u002Flineage\u002Fgraph?include_semantic=true&asset_id={id}&hops=2&max_nodes=100`                                                                                                        |\n| Catalog                | `GET \u002Fapi\u002Fcatalog\u002F{collection}`; collections: `sources`, `tables`, `columns`, `metrics`, `dimensions`, `terms`, `owners`; filters: `limit`, `offset`, `search`, `parent_id`, `source_id` |\n| Table and metric       | `GET \u002Fapi\u002Fcatalog\u002Ftables\u002F{asset_id}`, `GET \u002Fapi\u002Fcatalog\u002Fmetrics\u002F{id}`, `GET \u002Fapi\u002Fcatalog\u002Fmetrics\u002F{id}\u002Fhistory`                                                                           |\n| Ask and replay         | `POST \u002Fapi\u002Fask`, `GET \u002Fapi\u002Fask\u002F{id}`                                                                                                                                                     |\n| Catalog relationships  | `GET \u002Fapi\u002Fcatalog\u002Fneighbors?asset_id={id}`, `GET \u002Fapi\u002Fcatalog\u002Fimpact?asset_id={id}&max_nodes=100`                                                                                        |\n| Catalog subgraph       | `GET \u002Fapi\u002Flineage\u002Fgraph?asset_id=retail_revenue&hops=2&max_nodes=30&include_catalog=true`                                                                                                |\n| Quality                | `GET \u002Fapi\u002Fdatasets\u002F{id}\u002Fquality`, `PUT \u002Fapi\u002Fdatasets\u002F{id}\u002Fquality\u002Fconfig`                                                                                                                |\n| Governance             | `PUT \u002Fapi\u002Fdatasets\u002F{id}\u002Ftemplate`, `GET\u002FPUT \u002Fmetadata`, `GET \u002Fmetadata\u002Fchanges`, `GET \u002Fcompliance`                                                                                       |\n| Agent conversations    | `POST\u002FGET \u002Fapi\u002Fagent\u002Fconversations`, `GET \u002Fapi\u002Fagent\u002Fconversations\u002F{id}`, `POST \u002Fapi\u002Fagent\u002Fconversations\u002F{id}\u002Fmessages` (SSE)                                                            |\n| Agent resume           | `POST \u002Fapi\u002Fagent\u002Fconversations\u002F{id}\u002Fresume` with `{plan_id, idempotency_key}` (SSE); `GET \u002Fapi\u002Fagent\u002Fconversations\u002F{id}\u002Faudit` exposes recovery audit                                    |\n| Controlled actions     | `POST \u002Fapi\u002Factions\u002F{type}\u002Fprepare`, `POST \u002Fapi\u002Fapprovals\u002F{plan_id}`, `POST \u002Fapi\u002Factions\u002F{plan_id}\u002Fexecute`, `GET \u002Fapi\u002Factions\u002Fruns`                                                      |\n| Ontology and metering  | `GET \u002Fapi\u002Fontology`, `POST \u002Fapi\u002Fontology\u002Fobject-sets\u002Fevaluate`, `GET \u002Fapi\u002Fharness\u002Ftraces`, `GET \u002Fapi\u002Fharness\u002Fcosts?group_by=conversation`                                                |\n| Reports and export     | `GET \u002Fapi\u002Fdatasets\u002F{id}\u002Freport`, `GET \u002Fapi\u002Fexport?format=croissant&dataset_id={id}`                                                                                                      |\n\nTask submission takes `dataset_id`, an `idempotency_key`, optional `version_id`, `pipeline`, `shards` and `queue`. Without `version_id`, tasks replay the imported snapshot. An explicit version consumes that immutable snapshot. A task's input list is frozen when submitted. The default is one shard: exact and approximate deduplication see the whole dataset. Explicit multi-shard execution is suitable for independent transforms; deduplication is local to each shard, with no global reduction step. Queue names `cpu`, `io`, and `gpu` are supported; this release ships CPU\u002FIO operators.\n\nSee [the contract guide](contracts\u002FREADME.md) for the typed DAG JSON format and generated operator manifest. Each operator emits an event even for an empty routed batch. Rejecting an invalid DAG happens before it enters the queue.\n\nEvidence extraction uses the existing `run_pipeline` action. Supply the complete preset returned by `datakeel.pipeline.evidence.evidence_pipeline()` as its `pipeline` parameter, with `dataset_id` and `shards=1`. The operator manifest lists the five evidence operators. Global near-duplicate extraction rejects multiple shards. Omitting `pipeline` retains the original default pipeline.\n\nEach extraction reports `inputs`, `skipped_cached`, `extracted` and `failed`, both overall and per operator. For the fresh default corpus these are 5,000 inputs, 4,990 extracted and 10 image-decode failures; unchanged reruns cache all 5,000 inputs and extract zero. The cache includes actual input content, selector, extractor ID\u002Fversion, schema version and both evidence-contract hashes. Changing only the caption extractor version re-extracts its 1,000 inputs, with other operators cached and old caption assertions invalidated with an audit.\n\n`POST \u002Fapi\u002Fevidence\u002Fquery` accepts a flat ObjectSet 1.1 plus `cursor` and `page_size` (default 50, maximum 200). Results sort by asset ID; pass `next_cursor` for the next page. Replace the dataset ID below with the paired dataset's ID from `GET \u002Fapi\u002Fdatasets`:\n\n```bash\nDATASET_ID=\"replace-with-paired-dataset-id\"\ncurl --fail http:\u002F\u002F127.0.0.1:8765\u002Fapi\u002Fevidence\u002Fquery \\\n  -H 'Content-Type: application\u002Fjson' --data-binary @- \u003C\u003CEOF\n{\n  \"schema_version\": \"1.1\",\n  \"dataset_id\": \"${DATASET_ID}\",\n  \"split\": \"val\",\n  \"assertion_filters\": [\n    {\"predicate\": \"mentions\", \"concept\": \"person\", \"value\": \"present\"},\n    {\"predicate\": \"annotated_as\", \"concept\": \"person\", \"value\": \"present\", \"operator\": \"not_exists\"}\n  ],\n  \"has_near_duplicate_in\": \"train\",\n  \"page_size\": 20\n}\nEOF\n```\n\n`not_exists` above means no matching annotation assertion; it includes unknown cases. To select confirmed gaps only, require `label_gap\u002Fperson=present`. Legacy ObjectSet 1.0 manifests remain readable with their original serialization. Assertion filters are evaluated when preparing an action, and the resulting objects are frozen.\n\nThe existing lineage endpoint supports `include_semantic`, `asset_id`, `hops` (1–3) and `max_nodes` (1–1,000); semantic neighbors use deterministic BFS ordered by asset type and ID. `near_duplicate_of` projects to the existing `similar_to` link type. Extraction events reference content-addressed knowledge bundles; assertion bodies stay outside the event table. Rebuild the assertion\u002Fcache projection and replay review audits with:\n\n```bash\nuv run datakeel rebuild-evidence\n```\n\nThe command reports before\u002Fafter canonical hashes including `PROJECTOR_VERSION`, and exits nonzero if they differ. After manually clearing a disposable projection, pass its saved hash with `--expected-hash` to compare against the original state.\n\nQuality returns all five dimension objects. Unannotated data excludes the annotation dimension by default and renormalizes 25\u002F20\u002F15\u002F25\u002F15 weights. For example, `{\"min_size_bytes\":999999}` lowers completeness; `{\"thresholds\":{\"excellent\":99}}` changes grade boundaries. Consistency groups by modality; distribution uses Shannon evenness.\n\nTemplates accept JSON Schema or a `fields` mapping with required\u002Fenum\u002Fpattern constraints. A template can be bound before completing metadata. Saving invalid metadata is rejected atomically; accepted field changes record before\u002Fafter\u002Fsource\u002Freason and refresh 40\u002F30\u002F30 directory\u002Fnaming\u002Fmetadata compliance. Template references are local-only.\n\n`export --format openlineage` emits a JSON array; **each array element** is validated against the official RunEvent schema. Croissant 1.1 describes original source files and download URLs. Set `DATAKEEL_BASE_URL` for CLI exports served from a different address; HTTP exports derive the address from the request.\n\n## MCP clients\n\n`uv run datakeel mcp` starts the stdio server; a client owns its stdin\u002Fstdout lifecycle. It exposes **102 tools**: thirty-seven read functions (including `training_distribution`, `training_leakage`, `get_training_quality`, `annotation_quality`, `list_quality_rules`, `get_table_quality`, `query_standard_coverage`, `list_standard_usage`, `query_kg`, `explain_relation`, `query_evidence`, `get_evidence`, `explain_sample`, fourteen production reads such as `project_progress`, `next_task`, `production_prelabel_accuracy` and the team-tier `lease_status` and `assignees`, and the four below), sixty-five action tools that **prepare plans only** (including `clean_training_data`, `draft_label_set`, role and production actions such as `define_role`, `save_revision`, `run_prelabel`, `upgrade_project_template` and `finalize_project`, quality-rule edits\u002Fruns, `confirm_metric_draft`, issue assignment, `annotation_acceptance`, `publish_release`, `generate_datasheet`, `publish_datasheet`, `submit_custom_operator`, data-asset publication and grants, standards imports and mappings, `run_kg_extraction`, `decide_assertions`, catalog imports\u002Frestores, metric updates\u002Frollbacks and term updates\u002Frollbacks). There is no approve or execute tool: a person reviews, approves and executes a prepared plan on the Web UI or CLI, so an MCP host cannot complete a plan on its own, and a call named `approve_plan` or `execute_plan` is refused and audited. Every invocation records status, asset references and caller attribution; the built-in Agent uses the UI approval flow above. See [Quality rules](docs\u002FQUALITY_RULES.md) for table contracts, worker cron, issue recovery and signed alerts.\n\nThe Agent and MCP share `ask_data`, `list_metrics`, `explain_metric` and `impact_of`. `ask_data` reads source data and persists its answer\u002Fevidence in Datakeel. Calls involving assets retain their `asset_refs`; an empty `list_metrics` result may have no references. Tool and action schemas come from the same typed models as HTTP.\n\nFor Claude Desktop, merge this entry into `claude_desktop_config.json` through **Settings → Developer → Edit Config**. For Cursor, use the same JSON in the project's `.cursor\u002Fmcp.json` or the user's `~\u002F.cursor\u002Fmcp.json`. Replace both absolute paths; `DATAKEEL_HOME` must match the demo's home to share its datasets. See the official [Desktop setup](https:\u002F\u002Fmodelcontextprotocol.io\u002Fdocs\u002Fdevelop\u002Fconnect-local-servers) and [Cursor MCP configuration](https:\u002F\u002Fcursor.com\u002Fdocs\u002Fmcp).\n\n```json\n{\n  \"mcpServers\": {\n    \"datakeel\": {\n      \"command\": \"\u002Fabsolute\u002Fpath\u002Fto\u002Fuv\",\n      \"args\": [\n        \"--directory\",\n        \"\u002Fabsolute\u002Fpath\u002Fto\u002Fdatakeel\",\n        \"run\",\n        \"datakeel\",\n        \"mcp\"\n      ],\n      \"env\": {\n        \"DATAKEEL_HOME\": \"\u002Fabsolute\u002Fpath\u002Fto\u002Fdatakeel\u002F.datakeel\"\n      }\n    }\n  }\n}\n```\n\nFor a separate local SSE process, run:\n\n```bash\nuv run datakeel mcp --transport sse --host 127.0.0.1 --port 8766\n```\n\nA Cursor SSE configuration can instead use:\n\n```json\n{\n  \"mcpServers\": {\n    \"datakeel\": {\n      \"url\": \"http:\u002F\u002F127.0.0.1:8766\u002Fsse\"\n    }\n  }\n}\n```\n\nUse the same database\u002Fobject-store settings as the API and worker. The service uses the single local identity and defaults to loopback; it does not provide multi-user authentication. Connecting a desktop model client is optional and separate from Datakeel's offline demo.\n\n## Evaluation and verification\n\n```bash\nuv run datakeel eval --provider fake\nuv run datakeel eval --provider fake --json\nuv run datakeel eval-evidence\nuv run datakeel eval-evidence --json\nuv run datakeel eval-ask\nuv run datakeel eval-ask --json\nuv run datakeel eval-kg --json\nuv run python scripts\u002Fmutate.py --output mutation-results.json\n```\n\nThe 58 golden cases retain the twelve original cases covering reads, actions, approvals, loops, budgets, cross-turn references and dry-run, plus the four evidence cases for queries, unknown-state explanations, selected-version creation and deletion approval. Four enterprise cases cover an answer, clarification, refusal and an answer changed by a controlled metric update. Twelve advanced cases cover delegation, canary leaks, injection approval and cross-conversation memory. Four graph cases cover queries, missing-endpoint explanations, automatic replay and external approval with zero conversation executions. Four knowledge-question cases check candidate labels, missing catalog assets, subject ambiguity and rejected claims using actual tool-result JSON. Three image cases preserve transcription evidence boundaries, and one asset case checks that an ungranted Agent directs the user to apply without leaking data. Two standards cases verify the least compliant table and confirmed standard usage. Two quality cases check failing table rules and a table's issue history, and one annotation case checks agreement and sampling acceptance results. Two training cases measure class distributions and planted cross-split leakage from real tool results, and one LLM training-data case checks malformed and duplicate records through the read-only quality tool. Six one-sentence cases cover a multi-step chain that changes nothing before confirmation, a question for a missing project answered in the next turn, a refusal naming the missing permission, permission checked before any question, an unknown parameter that becomes a question instead of being dropped, and a request no registered action fits. Each executes real local services against isolated generated fixtures with scripted model replies. A second run reports the previous run ID and changes in passed cases, tokens and cost; `--json` emits the full report. Failed cases return a nonzero exit status. `--provider openai` and `--provider anthropic` opt into real paid evaluation and are not run by offline checks.\n\nThe mutation script requires all 856 mutations to be `KILLED` in temporary source copies. For missing-annotation `unknown → absent`, production assertion validation first rejects the malformed value; an explicitly recorded bypass only in the temporary mutant then lets the real `explain_sample` result reach its golden content check, which must fail. Raising the near-duplicate threshold by four is killed by an actual-image chain test: A–B and B–C have distance 6, A–C has distance 12. Two enterprise mutations test the candidate-ID boundary against model-supplied SQL and reject numeric guesses in an unanswerable answer. These are focused production-boundary tests, not a live model path. Runtime checks also cover signed resume authorization and tool-call idempotency. Workflow and routing checks cover signed workflow resume, the intent score margin, graph cycle detection, and settling the failed attempt before a fallback. Five advanced mutations remove the canary, delegation depth, tool scope, memory hard-delete and per-question memory reinforcement guards. Three graph mutations remove endpoint verification, discard pending-review candidates and omit the model from cache identity. Four knowledge mutations alter candidate review labels, split whole identifiers, route unsupported knowledge questions to metric values, and discard relationships after rejecting the other endpoint association. Structured goldens and focused regressions must catch all four. Eight asset mutations remove missing-grant, expiry, revocation, exact-scope, tool-cache replay, source-manifest, Agent message replay and version-producer checks. Two standards mutations reverse compliance ranking and discard confirmed mappings; the corresponding golden cases must fail. Additional mutations protect normalized metric identity and ambiguity, the person-question boundary, flow argument slots, bounded classifier choices, literal verification, request negation and workflow write confirmation. The tracks merged in v0.13.0 add mutations for time-series detection, releases and delivery, custom operators, image routing and coordinates, data assets, metric drafts, quality rules, metadata import, annotation quality and datasheets; their feature documents describe what each one breaks. v0.14.0 adds anchors for the scale benchmark, chart selection, follow-up resolution and the MCP refusal of approval and execution calls. v0.15.0 adds anchors for training splits, exports, leakage and write authorization, LLM training-data checks, redaction, deduplication and cleaning, production roles, assignments, revisions and prediction imports, the annotation workbench, and the two batches of smaller fixes. v0.16.0 adds anchors for team-tier lease expiry and its deadline boundary, exactly-once reaping that rereads renewals, review separation in claims and the review queue, the skill-level filter, whole-package returns, the PostgreSQL lock order and per-person load serialization. v0.17.0 adds anchors for template attribute checks (required fields on every shape, number ranges, valid defaults, type-only checks on model drafts and the recheck at submission), plans for reclaims and dispatch that freeze only state, round and holders, the enforced lease deadline in `lease_status` and the task status read, file-name search before paging, sample names that never expose server paths, current loads in the dispatch preview, leases listed only for the running stage, and hiding a reviewer's own work from the team review queue. v0.18.0 adds anchors for when the generic labels `secret`, `token`, `key` and `auth` treat a value as a credential (character classes, all digits, a capital after the first letter, the eight-character minimum, randomness of long words, hyphenated prose), the four-character password minimum, prefixed configuration keys, already-masked placeholders, Chinese punctuation after a credential, bracketed area codes (mainland, North American area and exchange digits, bracketed mobile prefixes, half brackets), reference numbers and single-space phone sequences, image sizes and relative paths recorded at import with hidden entries skipped, the YOLO refusal without a size, unknown images in COCO results, the round kept when open work is reopened, who may list and receive a named assignment, and relative paths as workbench sample names. v0.19.0 adds anchors for upright images (the EXIF point maps including mirrors and size swaps, upright sizes recorded at import and read for older datasets, upright pixels served to the workbench and sent to a prelabel model, older revisions, batches and splits read upright, YOLO and COCO imports in the right frame, upright exports traced in the manifest, and evidence extractor versions that retire stale boxes), per-project template locks and their signed upgrade, a load limit that counts only open annotation work and a dispatch limit no higher than the project's, rework handed over to a named person, English interpretations and coded refusal reasons in Ask, cloud prelabel budgets, estimates, reruns, failures and the single live run per project, IoU matching, confidence tiers and calibration, accountable pass-through, drafts only on tasks someone holds and the signature needed to widen pass-through, AI pre-review rules, review sampling and the risk-ordered queue, and the person who triggered a pass-through staying out of review after its rework is handed over. v0.20.0 adds anchors for one-sentence planning (the wording registry gate, recipes used only when they cover the whole sentence, containers of a write taken only from the page, the previous turn, an earlier step or the person's words, permission checked before any question, per-action preconditions, plans that would change nothing, groups read before a card and protected tasks left out, cards written in words, repair rounds and plain answers for failures), action chains (signatures, resuming without repeats, a rejected signature, only the requester may run a chain, the signer being the request's person), label set drafting (sources, invented sample ids dropped, signatures and cost limits), endpoint-aware model routing, and the places where planning meets this version's per-person load limit, review separation after a rework handover, template upgrades and cloud prelabel. v0.21.0 adds anchors for native skeleton tri-state validation, template-ID alignment and used-point deletion, EXIF conversion, COCO topology, visibility, bounds and import\u002Fexport protection, keypoint-only and mixed-empty-box metric exclusion, and every downstream workflow check. v0.22.0 adds anchors for strict segment integers, source-probe validation at project creation, upgrade and native import, pre-filter format rejection, WebVTT unreviewed protection and mixed-metric degradation. Each isolated test subprocess retains its 300-second limit; a full golden evaluation subprocess may take 900 seconds because it shares the runner with other mutation workers. A subprocess that times out is measured once more; a second timeout is reported as an environment failure and fails the gate. Neither a timeout nor a setup failure counts as a successful mutation kill.\n\n`eval-evidence` generates a fresh 1,000-sample corpus in an isolated local process and runs the production extraction DAG. It measures the 15 questions in [questions.yaml](contracts\u002Fevidence\u002Fquestions.yaml): four near-duplicate, four conflict, four corrupt-image and three missing-annotation queries. The baseline uses labels, paths and existing quality facts; the evidence expression adds assertions and direct neighbors. The report includes each query's precision\u002Frecall, macro averages, pair metrics, three-state counts, extraction counters and elapsed times. It records `provider=evidence` in the existing `eval_runs` table, with the question file's SHA-256 as `suite_digest`. The temporary corpus is discarded; its report and gold digest remain. `--questions path.yaml` selects an alternative validated question suite.\n\nWith the default `prefix` mode on the bundled synthetic corpus and question file, the measured macro precision is **0.336567 → 1.000000** and macro recall **0.933333 → 0.989542**. Direct pairs are **48\u002F52**, precision 1.0 and recall 0.923077; val-to-train pairs are **47\u002F51**, recall 0.921569. The resulting `threshold_met` is true (recall gain ≥0.05, precision drop ≤0.02, pair precision ≥0.9 and pair recall ≥0.8). The macro recall gain comes mainly from `missing-car`, whose label-only baseline cannot identify cars without annotations. These are measurements on this generated corpus and declared baselines, not evidence of generalization to real datasets. Every result, including `threshold_met: false`, is persisted and printed; an unmet metric threshold does not fail the command. Execution or validation errors still fail. No model extraction, model token count or model charge is part of this benchmark.\n\nRun `uv run datakeel eval-evidence --mode exact --json` to evaluate the same generated corpus without prefix misses. The measured exact-mode direct pairs are **52\u002F52** and val-to-train pairs **51\u002F51**, both precision\u002Frecall **1.0**; the evidence macro precision\u002Frecall are both **1.0**. The report records `near_duplicate_mode` and the near-duplicate operator's actual implementation\u002Fversion. These measurements use the generated fixture, not real-world data.\n\n`eval-ask` creates fresh local enterprise sources and compares [20 questions](contracts\u002Fask\u002Fquestions.yaml) with the generator's independent gold: 14 answerable (`ok-`), four unanswerable (`ua-`) and two clarification (`cl-`). The reference instant is fixed at `2026-10-01T00:00:00Z`. Numeric tolerance is 0.5%; evidence checks depend on answer state, requiring metric\u002FSQL\u002Ftables\u002Ffields\u002Fmatches for answered questions and the appropriate assertions\u002Fcandidates for refusals or clarification. Reports record each answer, correctness, evidence completeness, elapsed time and suite\u002Fgold digests in `eval_runs` with `provider=ask`. The report threshold is at least 13\u002F14 correct, 4\u002F4 refusals and 20\u002F20 complete evidence; clarification counts are reported separately. `threshold_met=false` is persisted and printed without failing the command. Invalid suites and execution failures outside individual question evaluation still fail. `--questions path.yaml` selects another validated suite; no model call, token budget or charge is involved.\n\nFor the complete repository gate (Node is needed for frontend development):\n\n```bash\nuv run python scripts\u002Fgenerate_semantic.py\nuv run pytest tests\u002Fsemantic\n(cd web && npm ci && npm run build)\nmake check\nuv run python scripts\u002Fcheck_readme.py\nbash scripts\u002Fci-check.sh\n```\n\n`make check` enforces formatting, Ruff ALL, strict typing, import boundaries, source size, coverage and all frontend checks. Install hooks with `uv run pre-commit install`. `bash scripts\u002Fci-check.sh` is the local CI equivalent: the same gate plus README execution and mutation tests. Set `DATAKEEL_TEST_DATABASE_URL` to a fresh local PostgreSQL database to repeat the same gate on PostgreSQL; otherwise it uses SQLite. The pytest and mutation steps run on parallel workers; `DATAKEEL_TEST_WORKERS` chooses how many (`1` runs serially). GitHub CI runs the same commands on both stacks in parallel jobs (one gate job, four pytest shards, two mutation shards and a report job that checks shard completeness and merges coverage and mutation results), targeting under 45 minutes per run. See the [test execution guide](docs\u002FTEST_SPEED.md).\n\nThe frontend build copies deployable assets into `datakeel\u002Fweb_dist`. Vite development serves on port 5173 and proxies `\u002Fapi` to 8765. Rebuild after changing frontend source. Both generated semantic snapshots have drift tests; the official OpenLineage schema is pinned and tested offline.\n\nRun `uv run python scripts\u002Fverify_acceptance.py --base-url http:\u002F\u002F127.0.0.1:8765` against the demo. For database tests, set `DATAKEEL_TEST_DATABASE_URL` to the new local PostgreSQL instance; its role needs `CREATEDB`. Each `db` fixture receives its own database cloned from a per-worker migrated template and drops only that copy; migration tests using `unmigrated_db` still create and remove only their own uniquely named schema. `scripts\u002Fverify_acceptance.py --workers` starts two real worker processes and verifies eight shards complete with one attempt each. Stop any other worker on that test database first.\n\nS3 has a client-contract test; a live S3-compatible service is not required or automatical","Datakeel 是一个面向数据治理与可信分析的数据语义层平台，支持指标版本管理、证据溯源审查、业务问题问答及变更受控的协作工作流。核心功能包括：基于 OpenLineage 和 Croissant 标准的数据血缘追踪、多状态证据标记（存在\u002F缺失\u002F未知）、审批驱动的标准与映射变更、结构化语义层（指标\u002F维度\u002F术语）注册与英文本地化支持，以及 FastAPI 后端与 React 前端构成的可部署应用。适用于中大型组织在数据目录建设、监管合规审计、指标一致性治理及跨团队数据协作等场景。",2,"2026-11-24 04:41:37","CREATED_QUERY"]