This directory contains repo maintenance / devops helper scripts.
The Makefile is the source of truth for common workflows; these scripts are the underlying building blocks.
bootstrap_handbook.py:生成docs-site/docs/下中文样板结构(覆盖式;日常以 Git 中内容为准)。generate_fe_be_matrix.py:从web/openapi.json、web/lib/api、web/app生成docs-site/docs/integration/generated/fe-be-matrix.mdx(make handbook-build/make api-docs-build会调用)。make handbook-matrix-check:再生成矩阵后与 Git 比较,未提交更新则失败(CI:api-docs经handbook-build、PR:.github/workflows/handbook-matrix.yml)。split_api_md.py:将docs/api/source/legacy-api-narrative.md(若不存在则回退docs/API.md)按一级标题切到docs/api/reference/,并写_index.md(忽略代码围栏内的#行)。sync-handbook-i18n.mjs:docs-site构建前把默认语言文档镜像到i18n/en/.../current,并叠加热门页的英文覆盖(docs-site/i18n/en-overrides/)。check_doc_links.mjs:检查手册源文件中的相对链接是否指向存在的路径(docs-site的npm run check:links)。
init_env.py: create local env files from templates (non-destructive by default)- Example:
python scripts/init_env.py - Options:
--force,--dry-run,--gen-secret-key
- Example:
doctor.py: quick environment sanity check (python/node/pnpm/docker + required files)- Example:
python scripts/doctor.py
- Example:
check_parsers.py: print parser backend availability/config status- Example:
python scripts/check_parsers.py
- Example:
export_openapi.py: export backend OpenAPI to JSON (used bymake openapi-export)- Example:
python scripts/export_openapi.py --out web/openapi.json
- Example:
openapi_paths_sanity.py: fail if exportedweb/openapi.jsonhas too few paths (used bymake api-docs-build)- Example:
python scripts/openapi_paths_sanity.py
- Example:
openapi_check.py: ensure OpenAPI artifacts are present and up-to-date in git- Example:
python scripts/openapi_check.py
- Example:
api_smoke.py: smoke test OpenAPI endpoints against a running backend (usually docker)- Example:
python scripts/api_smoke.py --help - Live parser example:
python scripts/api_smoke.py --skip-llm-test --skip-mineru --live-parser-backends deepseek_ocr --live-parser-fixture runs/deepseek_ocr_smoke.pdf
- Example:
smoke_test.py: deployment-neutral knowledge-core gate (ready -> ingest -> retrieval evidence)- Example:
make core-e2eagainst either a host-run or Docker-run API; override withCORE_E2E_BASE_URL=http://host:8000. --core-onlyuses keyword retrieval, disables vector/KG/reranker dependencies, and removes the temporary dataset after a successful run. Failed runs retain it for diagnosis; reused datasets are never deleted.--bootstrap-registercreates a temporary local JWT account for fresh non-production stacks that do not already have login credentials.
- Example:
run_retention_jobs.py: bounded tenant-scoped retention for database, knowledge assets, and semantic cache storage- Semantic cache dry-run:
python scripts/run_retention_jobs.py --semantic-cache --tenant-id <uuid> --dry-run --max-scan 1000 --max-delete 100 - Use
--executeonly after reviewing the JSON plan; Milvus maintenance failures produce a non-zero exit code.
- Semantic cache dry-run:
rag_e2e_load_test.py: live ingest/retrieve/chat load runner plus serial-vs-concurrent throughput gate- Generate two reports with identical request counts and concurrency
1/N, then runRAG_CONCURRENCY_BASELINE=/tmp/c1.json RAG_CONCURRENCY_CANDIDATE=/tmp/cN.json make rag-concurrency-gate. - The comparison fails on errors, mismatched workloads, missing client overlap, or retrieval/chat throughput below the configured ratios.
- Generate two reports with identical request counts and concurrency
plugin_golden_closed_loop_smoke.py: live plugin Golden import + retrieval-only regression smoke for an already-ingested dataset- Example:
python scripts/plugin_golden_closed_loop_smoke.py --base-url http://127.0.0.1:8000 --dataset-id <dataset_uuid>
- Example:
plugin_corpus_closed_loop_smoke.py: live plugin-backed corpus ingest + Golden regression smoke from a local directory- Example:
python scripts/plugin_corpus_closed_loop_smoke.py --base-url http://127.0.0.1:8000 --source-dir /path/to/domain-corpus --plugin-ref plugin:<plugin-id>@<version>:chunk --include-source-root-name --overwrite-goldens - The raw JSON can include local source paths, filenames, document ids, and case ids; keep it local.
- Example:
plugin_corpus_closed_loop_evidence.py: sanitized evidence from a raw plugin corpus closed-loop smoke report- Example:
python scripts/plugin_corpus_closed_loop_evidence.py --input /tmp/plugin_corpus_closed_loop_report.json --json-out /tmp/plugin_corpus_closed_loop_evidence.json --markdown-out /tmp/plugin_corpus_closed_loop_evidence.md - Outputs aggregate document/chunk counts, plugin package provenance, and Golden retrieval metrics (
hit@1/3/5, MRR, NDCG, recall, expected metadata hit/recall) without raw filenames, document ids, case ids, questions, or chunk text.
- Example:
changzhou_gov_plugin_chunk_report.py: local Changzhou plugin governance/chunk/KG review report for the 01-06 sample families- Example:
make changzhou-gov-plugin-chunk-report - Outputs local raw
/tmp/changzhou_gov_plugin_chunk_report.jsonand/tmp/changzhou_gov_plugin_chunk_report.md; it may include chunk previews for debugging and does not write the database, vector store, or KG store.
- Example:
changzhou_gov_plugin_chunk_evidence.py: sanitized Changzhou plugin chunk/KG evidence for delivery handoff- Example:
make changzhou-gov-plugin-chunk-evidence - Outputs
/tmp/changzhou_gov_plugin_chunk_evidence.jsonand/tmp/changzhou_gov_plugin_chunk_evidence.mdwith aggregate section/chunk/KG metrics only.
- Example:
pipeline_plugin_runner.py: local plugin contract test and Golden draft generator- Example:
make changzhou-gov-plugin-test-report - Outputs local raw
/tmp/changzhou_gov_plugin_test_report.json, which may include Golden draft sample questions for debugging.
- Example:
plugin_release_gate.py: generic local pipeline-plugin release gate- Example:
PLUGIN_RELEASE_GATE_PLUGIN_DIR=/path/to/plugin PLUGIN_RELEASE_GATE_SAMPLE=/path/to/sample.json make plugin-release-gate - Runs the local stage test, verifies the written
.mimirq-plugin-test.jsonstill matches the current plugin package hash, builds the generic chunk readiness report, and checks declared Golden rules produce a draft. - Outputs aggregate release evidence only: stage counts, readiness checks, plugin refs, and package hash. It does not include chunk examples or content previews; use the chunk report scripts when debugging raw chunk text locally.
- Example:
changzhou_gov_plugin_test_evidence.py: sanitized Changzhou plugin test evidence for delivery handoff- Example:
make changzhou-gov-plugin-test-evidence - Outputs
/tmp/changzhou_gov_plugin_test_evidence.jsonand/tmp/changzhou_gov_plugin_test_evidence.mdwith stage pass states and Golden draft counts only.
- Example:
changzhou_gov_delivery_pack.py: combined handoff index for the Changzhou plugin evidence and Dify/MimirQ readiness evidence- Example:
make changzhou-gov-delivery-pack - Outputs
/tmp/changzhou_gov_delivery_pack.jsonand/tmp/changzhou_gov_delivery_pack.md; it copies aggregate metrics and sanitized artifact paths only, including plugin chunk/KG and test/Golden counts without sample content. - Defaults to a 30-minute readiness freshness gate; override with
CHANGZHOU_GOV_DELIVERY_PACK_MAX_READINESS_AGE_MINUTES=<minutes>when intentionally reviewing older artifacts. - Use
make changzhou-gov-delivery-pack-refreshfor delivery handoff: it runschangzhou-dify-readiness-gate-quietfirst, sending raw Dify/MimirQ gate output to/tmp/changzhou_gov_dify_readiness_gate.log.
- Example:
dify_console_login.py: refresh the Dify console Playwrightstorage_stateused by workflow trace diagnostics- Recommended:
DIFY_CONSOLE_EMAIL=<email> DIFY_CONSOLE_PASSWORD_FILE=/tmp/dify_console_password.txt make dify-console-login make dify-console-ensurefirst validates the existing storage state; if it is expired or expiring and bothDIFY_CONSOLE_EMAILplusDIFY_CONSOLE_PASSWORD_FILEare configured, it refreshes the state automatically.- Avoid putting Dify console passwords in repository files or shell history; the script writes only
console_tokenlocalStorage state to/tmp/dify_console_storage_state.jsonby default. - The Dify console web UI is served under the
/brainaibase path, for examplehttps://dify.example.com:3000/brainai/apps. KeepDIFY_CONSOLE_ORIGIN=https://dify.example.com:3000because browser storage state is keyed by origin, not by path.
- Recommended:
changzhou_gov_dify_external_knowledge_probe.py: compare Dify external hit-testing with direct MimirQ retrieval for the same Changzhou golden cases- MimirQ-only preflight:
make changzhou-dify-mimirq-direct-gateruns the same golden retrieval cases directly against MimirQ usingDIFY_EXTERNAL_KNOWLEDGE_API_KEY(S)from.env, without Dify console auth. The default command enables thechangzhou-retrievalquality profile, so it gates hit rates, evidence quality (answer_grounding_rate, key-point recall, effective context rate, and noise rate), and expected-metadata coverage/match rates for cases that declareexpected.metadata. - Existing-report gate:
python scripts/changzhou_gov_golden_eval.py --report /tmp/report.json --quality-profile changzhou-retrievalrechecks a saved report without calling MimirQ or requiring a token. - KG-on/KG-off comparison gate:
make changzhou-dify-kg-on-off-gatefirst writes KG-off and KG-on MimirQ-only reports with--kg-mode off/on, then compares them. The saved-report-only form remains available asCHANGZHOU_DIFY_KG_BASELINE_REPORT=/tmp/kg-off.json CHANGZHOU_DIFY_KG_CANDIDATE_REPORT=/tmp/kg-on.json CHANGZHOU_DIFY_KG_COMPARE_OUT=/tmp/changzhou_gov_dify_kg_compare.json make changzhou-dify-kg-compare-gate. --kg-modeis a MimirQ direct-gate extension:defaultinherits service settings;off/onsends request-level KG overrides to the Dify adapter. Standard Dify requests can omit these fields.- The compare gate verifies the KG-on candidate still passes
changzhou-retrieval, does not regress baseline hit/grounding/effective-context/metadata metrics, and keepskg_noise_rate <= 0.1. - Local route preflight:
make changzhou-dify-knowledge-map-checkvalidatesDIFY_EXTERNAL_KNOWLEDGE_MAP_JSONbefore remote Dify calls, including declaredplugin_refsand theirretrieval_policyavailability. - Its summary exposes
plugin_refs_checked,plugin_refs_invalid, andplugin_refs_missing_retrieval_policyfor CI/readiness triage. - Recommended after
make dify-console-login:make changzhou-dify-external-probe - Override output or a specific Dify external API id:
CHANGZHOU_DIFY_EXTERNAL_API_ID=<external_api_id> CHANGZHOU_DIFY_PROBE_OUT=/tmp/probe.json make changzhou-dify-external-probe - The command exits non-zero unless the Dify endpoint host is non-loopback, all cases have non-empty Dify hit-testing results, direct MimirQ retrieval is non-empty, and direct records match Dify's external knowledge schema.
- The JSON report includes
boundary.verdict;dify_external_boundary_okmeans endpoint config, local direct retrieval, and Dify dataset hit-testing all passed.
- MimirQ-only preflight:
changzhou_gov_dify_full_gate.py: run the Changzhou government-service Dify/MimirQ golden gate (preflight, generated answers, direct eval, workflow trace)- Recommended:
make changzhou-dify-full-gate - The workflow trace artifact records retrieval node titles/results plus
region_extractors, so district-route warnings can be traced back to the exact Dify area extractor output without reopening the console trace manually. - Generated-answer failures where direct retrieval is correct usually mean Dify ignored material evidence. Inspect the matched record in the eval artifact first: runtime
答案要点/必答要点prefixes are adapter hints sent to Dify only, not persisted chunk text. - End-to-end readiness:
make changzhou-dify-readiness-gateruns the local knowledge-map preflight, Dify console token check, strict external probe, then the full generated-answer/direct-eval/trace gate. It inherits thechangzhou-retrievalprofile for direct retrieval quality and keeps generated-answer grounding/key-point recall thresholds defaulting to0.9to avoid failing on harmless wording variance, then writes/tmp/changzhou_gov_dify_readiness_summary.json. - If
CHANGZHOU_DIFY_KG_COMPARE_OUTpoints to an existing compare artifact,make changzhou-dify-readiness-summaryincludes it as the optionalkg_comparestage and readiness status/evidence printskg_noise_rateplus candidate-gate status. - Terminal-safe readiness:
make changzhou-dify-readiness-gate-quietruns the same gate but redirects raw output to/tmp/changzhou_gov_dify_readiness_gate.log, then prints only the compact readiness status. - If an upstream stage fails, the readiness summary reports only the root cause in
failed_stages,root_cause_stage/root_cause_reason, andnext_action; downstream stages are markedstatus=skippedwithblocked_by=<stage>, so expired Dify console auth is not hidden behind skipped probe/full-gate stages. - Quick diagnosis:
make changzhou-dify-readiness-statusprints the latest summary's pass/fail state, freshness, boundary verdict, direct MimirQ base URL match state, non-blocking warning counters, affected case ids, advisory warning diagnoses/details, root cause, next action, skipped stages, and artifact paths. - If readiness status says the direct base differs from the external endpoint host, rerun with
CHANGZHOU_DIFY_MIMIRQ_BASE_URL=<MimirQ base used by Dify>so the direct gate and Dify boundary probe compare the same service instance. - Override cases or thresholds without editing the Makefile:
CHANGZHOU_DIFY_CASES=/tmp/boundary_cases.json CHANGZHOU_DIFY_EXTRA_ARGS='--min-hit-at-3 0.8' make changzhou-dify-full-gate - Reads
DIFY_EXTERNAL_KNOWLEDGE_API_KEY/DIFY_EXTERNAL_KNOWLEDGE_API_KEYSfrom the environment or repo.env; Dify App key and console storage state default to/tmp/dify_remote_app_api_key.jsonand/tmp/dify_console_storage_state.json.
- Recommended:
evaluate_mixed_rag_quality.py: compare complex mixed RAG questions across MimirQ/Dify runs using objective evidence and subquestion coverage, not an LLM judge.- Example:
MIXED_RAG_RUNS='mimirq=/tmp/mimirq_run.json dify=/tmp/dify_run.json' make mixed-rag-quality - Override the case set with
MIXED_RAG_CASES=/tmp/mixed_cases.json. - Case files use
{"schema":"mimirq.mixed_rag_eval_cases.v1","cases":[...]}. Each case declaresquestion,subquestions[], andevidence_clauses[]; each clause/subquestion usesrequired_termsand optionalmetadata. - Case files may define
answer_term_aliasesto accept answer-only wording variants such as{"Contact:":["Phone:"]}. This does not relax evidence/record matching. - Run files use
{"schema":"mimirq.mixed_rag_eval_run.v1","system":"mimirq","items":[...]}. Each item suppliescase_id, optionalanswer,records[], and optionallatency_ms. - Output JSON/Markdown reports include
mean_evidence_coverage,mean_subquestion_coverage,mean_answer_supported_clause_rate,mean_wrong_evidence_rate, missing clause IDs, unsupported answered clause IDs, a leaderboard, and pairwise case deltas. - Gate thresholds are optional: pass
MIXED_RAG_EXTRA_ARGS='--min-mean-evidence-coverage 0.8 --min-mean-subquestion-coverage 0.8 --max-mean-wrong-evidence-rate 0.3'.
- Example:
clean.py: remove local caches/artifacts (used bymake clean)- Example:
python scripts/clean.py
- Example:
dev_all.ps1: Windows helper that starts backend + web (if you don't havemake)dev.ps1is kept as a compatibility wrapper (deprecated)
dev_backend.ps1: start backend onlydev_web.ps1: start web onlyverify.ps1: Windows equivalent ofmake verifyaudit.ps1: dependency audit helper
benchmark_io_concurrency.py: local benchmarking helperchunk_preview_batch_eval.py: batch evaluate chunk preview behaviorremote_chunking_matrix.py: live chunking matrix against a running API; setMIMIRQ_REMOTE_LONG_PDF_FIXTURE=/path/to/long.pdfto reuse a local long PDF, or setMIMIRQ_REMOTE_FIXTURE_DOWNLOADS=1to download the RFC sample.convert_text_encoding.py: best-effort text encoding conversion utilitybackfill_kg_event_vector_metadata.py: re-upsert KG event vectors to backfill Milvus metadata fields (pipeline_hash,doc_pipeline_key)learn_fusion_weights_offline.py: grid-search fusion weights (vector/bm25/lexical/sparse) offline via Evidence APIapply_fusion_weights_to_dataset.py: persist learned fusion weights into datasetrag_defaults(safe by default; dry-run unless --execute)gen_secret_key.py: generate a SECRET_KEY valuerag_trace_tail.py: tail and pretty-printevent=rag_tracerecords from the metrics JSONL (PII-safe by default)rag_trace_diff.py: diff twoevent=rag_tracerecords byrequest_id(PII-safe; outputs compact delta summary)mine_hard_negatives_from_traces.py: mine PII-safe hard negatives fromevent=rag_tracemetrics logs (outputsmimirq.hard_negatives.v1JSONL)access_graph_diff.py: diff two access-graph exports (NDJSON/JSON) and output a bounded PII-safe change summary (for access reviews)regression_gate.py: enforce regression thresholds from evaluation outputs- Plugin Golden source example:
python scripts/regression_gate.py --dataset-id <dataset_uuid> --plugin-golden-ref plugin:<id>@<version>:chunk --metrics "" --thresholds ci/plugin.thresholds.json - Generated Plugin Golden thresholds preserve compact
case_sourceprovenance and reject plugin ref/package-hash mismatches before starting a run.
- Plugin Golden source example:
release_gate.py: combine regression gate + SLO snapshot + cost budgets into a single release gate (CI/staging)train_ltr_from_regression_cases.py: train an xgboost LTR reranker model from regression cases via Evidence API (retrieval-only)- Writes a sidecar manifest by default:
<out-model>.manifest.json(can be disabled with--no-manifest)
- Writes a sidecar manifest by default:
eval_ltr_offline.py: compare baseline retrieval vs local LTR rerank offline (candidates via Evidence API)prepare_ltr_rollout.py: materialize approved evidence / selected feedback into a bounded LTR rollout workflow, then train, evaluate, compare, and optionally register a candidate model without activating iteval_rerank_pipeline_offline.py: compare baseline retrieval vs a local multi-stage rerank pipeline (LTR/ColBERT), offline- Supports
--colbert-provider deterministic|hfplus model/device/batch flags - Summary JSON includes per-metric
wins/losses/tiesso you can see when the stronger path helps or hurts
- Supports
eval_retrieval_fusion_offline.py: compare fusion strategy variants offline via Evidence API (retrieval-only)run_sample_retrieval_benchmark.py: run a deterministic local sample benchmark fromdata/sample/retrieval_fixture_v1.json- Outputs:
runs/sample_bench.json(schema:mimirq.sample_retrieval_benchmark.v1) - Example:
python scripts/run_sample_retrieval_benchmark.py --out runs/sample_bench.json
- Outputs:
build_parsing_retrieval_fixture.py: convert parser-like document rows plus query specs into a deterministic retrieval fixture- Example:
python scripts/build_parsing_retrieval_fixture.py --documents-json runs/parsed_docs.json --queries-json runs/proof_queries.json --out runs/parsing_proof.fixture.json
- Example:
build_parsing_retrieval_fixture_from_file.py: parse a real source file first, then emit a deterministic retrieval fixture- Example:
python scripts/build_parsing_retrieval_fixture_from_file.py --input-file tests/fixtures/parsing_golden_broader/borderless_table_scan/input/sample.png --queries-json runs/proof_queries.json --out runs/parsing_file_proof.fixture.json --parser-backend image
- Example:
run_parsing_retrieval_proof.py: build a retrieval fixture from parser-like outputs and immediately run the deterministic retrieval benchmark- Outputs: retrieval fixture JSON plus benchmark report JSON
- Example:
python scripts/run_parsing_retrieval_proof.py --documents-json runs/parsed_docs.json --queries-json runs/proof_queries.json --fixture-out runs/parsing_proof.fixture.json --report-out runs/parsing_proof.report.json
run_parsing_retrieval_proof_from_file.py: parse a real source file, build a retrieval fixture from the parsed output, and immediately run the deterministic retrieval benchmark- Outputs: retrieval fixture JSON plus benchmark report JSON
- Example:
python scripts/run_parsing_retrieval_proof_from_file.py --input-file tests/fixtures/parsing_golden_broader/cross_page_table_pdf/input/sample.pdf --queries-json runs/proof_queries.json --fixture-out runs/parsing_file_proof.fixture.json --report-out runs/parsing_file_proof.report.json --parser-backend basic
run_parsing_retrieval_proof_batch.py: run multiple file-driven parsing proofs from a batch spec JSON and emit per-case fixtures/reports plus an aggregate batch report- Outputs:
<out-dir>/<case>.fixture.json,<out-dir>/<case>.report.json, and<out-dir>/batch.report.json - Example:
python scripts/run_parsing_retrieval_proof_batch.py --spec-json runs/parsing_proof_batch.spec.json --out-dir runs/parsing_proof_batch
- Outputs:
build_parsing_retrieval_proof_batch_spec.py: derive a batch proof spec from a parser manifest plus a case-id -> queries mapping JSON- Example:
python scripts/build_parsing_retrieval_proof_batch_spec.py --manifest-json tests/fixtures/parsing_golden_broader/manifest.json --case-queries-json runs/parsing_proof_case_queries.json --out runs/parsing_proof_batch.spec.json
- Example:
build_parsing_retrieval_proof_artifacts.py: derive normalizedsummary.jsonandreport.jsonfrom a parsing-proof batch report- Example:
python scripts/build_parsing_retrieval_proof_artifacts.py --batch-report runs/parsing_proof_batch/batch.report.json --summary-out runs/parsing_proof_batch/summary.json --report-out runs/parsing_proof_batch/report.json
- Example:
parsing_retrieval_proof_gate.py: evaluate parsing-proof summary artifacts against thresholds and emitgate.json- Example:
python scripts/parsing_retrieval_proof_gate.py --input runs/parsing_proof_batch/summary.json --thresholds ci/parsing_retrieval_proof_thresholds.v1.json --out runs/parsing_proof_batch/gate.json
- Example:
diff_parsing_retrieval_proof_summaries.py: diff a baseline parsing-proof summary and a current one into JSON/Markdown review artifacts- Example:
python scripts/diff_parsing_retrieval_proof_summaries.py --a ci/parsing_retrieval_proof_summary_baseline.v1.json --b runs/parsing_proof_batch/summary.json --out runs/parsing_proof_batch/diff.json --out-md runs/parsing_proof_batch/diff.md
- Example:
validate_parsing_retrieval_proof_governance.py: validate the machine-readable broader parsing-proof governance JSON- Example:
python scripts/validate_parsing_retrieval_proof_governance.py --governance ci/parsing_retrieval_proof_governance.v1.json
- Example:
validate_parsing_retrieval_proof_rollout.py: validate the staged rollout policy for broader parsing-proof (informational->warn->fail)- Example:
python scripts/validate_parsing_retrieval_proof_rollout.py --rollout ci/parsing_retrieval_proof_rollout.v1.json
- Example:
run_sample_parsing_retrieval_proof.py: run the repo's sample broader parsing-proof sweep using the checked-in broader manifest and sample query map- Outputs: a generated batch spec plus per-case reports,
summary.json,report.json,gate.json, anddiff.json/diff.md - Example:
python scripts/run_sample_parsing_retrieval_proof.py --out-dir runs/parsing_proof_broader_sample
- Outputs: a generated batch spec plus per-case reports,
run_queryset_health_diagnostics.py: build query-set health snapshot from benchmark report and maintain bounded trend history- Output snapshot schema:
mimirq.queryset_health_snapshot.v1 - Adds risk summary (
miss_rate,weak_hit_rate,hard_cases) and trend deltas for nightly drift checks - Embeds
policy_source+ stablepolicy_hashin snapshot/cron output for reproducible trend analysis across config changes - Emits
trend.policy_changedwhen policy hash changes relative to previous snapshot - Supports threshold policy via
--policy-jsonand per-run overrides such as--miss-rate-regression-threshold,--weak-hit-rate-regression-threshold --cronemits machine-readable JSON with status + risk summary for CI logs
- Output snapshot schema:
diff_queryset_health_snapshots.py: diff baseline/current query-set health snapshots for PR/release review- Output schema:
mimirq.queryset_health_diff.v1 - Includes metric deltas, policy drift (
policy_source/policy_hash), hard-case churn, degradation-flag churn - Supports
--out-mdto emit a human-readable Markdown summary for PR comments
- Output schema:
validate_queryset_health_policy.py: validate query-set health threshold policy JSON before CI/nightly usage- Example:
python scripts/validate_queryset_health_policy.py --policy ci/queryset_health_policy.v1.json
- Example:
check_retrieval_profile_compat.py: validate retrieval profile + reranker compatibility before runtime/CI- Example:
python scripts/check_retrieval_profile_compat.py --retrieval-profile hybrid_ce --enable-reranker true --reranker-provider cross_encoder
- Example:
Most scripts follow a simple contract:
0: success- non-zero: failure (prints a readable message)