From bcbf7f7a1643394fc5a9376f97a33e305724a642 Mon Sep 17 00:00:00 2001 From: Daniel Petty Date: Fri, 9 Oct 2026 04:13:29 +0000 Subject: [PATCH] feat(review): devops review score scores saved review sessions against a label file offline and reproduces the S11 and loop baselines (#1138) --- README.md | 1 + changelog.d/1138.md | 15 + docs/CLI_REFERENCE.md | 53 +- docs/ERRORS.md | 1 + docs/SELF_IMPROVEMENT.md | 85 +- docs/VISION.md | 2 +- ...iew-findings-come-from-tools-not-models.md | 59 + docs/agent/tasks/task-1138-review-score.md | 56 + docs/commands/ai.md | 31 +- docs/commands/review.md | 24 + pyproject.toml | 7 + .../devops_cli/tasks/rag_context_indexing.md | 5 +- src/devops_cli/ai/review/history.py | 15 +- src/devops_cli/ai/review/pipeline.py | 6 +- src/devops_cli/ai/run_store.py | 81 +- src/devops_cli/commands/ai_runs.py | 26 +- src/devops_cli/commands/review.py | 216 +- src/devops_cli/config/constants.py | 17 + src/devops_cli/git/operations.py | 30 + src/devops_cli/lang/en/help.py | 10 + src/devops_cli/lang/en/messages.py | 8 + src/devops_cli/review/score.py | 918 +++++ tests/fixtures/review_labels/labels.json | 3342 +++++++++++++++++ .../k8s_cloudflared_deployment_yaml.json | 1 + ...k8s_llm_profiles_ollama-profiles_yaml.json | 1 + .../files/k8s_llm_profiles_services_yaml.json | 1 + .../k8s_monitoring_service-aliases_yaml.json | 1 + .../files/k8s_otel_networkpolicy_yaml.json | 1 + .../files/src_devops_cli_ai___init___py.json | 1 + .../src_devops_cli_ai_mcp_server_py.json | 1 + .../src_devops_cli_ai_rag_indexer_py.json | 1 + .../src_devops_cli_ai_rag_qdrant_py.json | 1 + .../src_devops_cli_ai_review_schema_py.json | 1 + .../src_devops_cli_ai_review_verdicts_py.json | 1 + .../files/src_devops_cli_commands_gh_py.json | 1 + .../src_devops_cli_commands_release_py.json | 1 + .../src_devops_cli_commands_workspace_py.json | 1 + .../src_devops_cli_config_settings_py.json | 1 + .../files/src_devops_cli_main_py.json | 1 + ...ixtures_review_recall_recall_set_json.json | 1 + .../tests_golden_review_findings_json.json | 1 + .../tests_test_ai_request_priority_py.json | 1 + .../tests_test_batch_2_review_defects_py.json | 1 + .../files/tests_test_host_sandbox_py.json | 1 + .../files/tests_test_k8s_tls_py.json | 1 + .../files/tests_test_review_scope_py.json | 1 + .../tests_test_review_verification_py.json | 1 + .../sessions/20261003-060647/findings.json | 366 ++ .../sessions/20261003-060647/profile.json | 8 + .../k8s_cloudflared_deployment_yaml.json | 1 + ...k8s_llm_profiles_ollama-profiles_yaml.json | 1 + .../files/k8s_llm_profiles_services_yaml.json | 1 + .../k8s_monitoring_service-aliases_yaml.json | 1 + .../src_devops_cli_ai_mcp_server_py.json | 1 + .../src_devops_cli_ai_rag_embeddings_py.json | 1 + ...li_ai_review_common_hallucinations_py.json | 1 + .../src_devops_cli_ai_spend_pricing_py.json | 1 + .../files/src_devops_cli_commands_ci_py.json | 1 + .../files/src_devops_cli_commands_gh_py.json | 1 + ...ps_cli_commands_k8s_security_audit_py.json | 1 + .../src_devops_cli_security_dive_py.json | 1 + .../tests_golden_review_findings_json.json | 1 + .../tests_test_ai_request_priority_py.json | 1 + .../files/tests_test_crypto_tls_py.json | 1 + ...est_hallucination_catalog_learning_py.json | 1 + .../sessions/20261003-065531/findings.json | 338 ++ .../sessions/20261003-065531/profile.json | 8 + .../k8s_cloudflared_deployment_yaml.json | 1 + ...k8s_llm_profiles_ollama-profiles_yaml.json | 1 + .../files/k8s_llm_profiles_services_yaml.json | 1 + .../k8s_monitoring_service-aliases_yaml.json | 1 + .../files/k8s_otel_networkpolicy_yaml.json | 1 + .../src_devops_cli_ai_client_unified_py.json | 1 + .../src_devops_cli_ai_mcp_server_py.json | 1 + .../src_devops_cli_ai_rag_embeddings_py.json | 1 + .../src_devops_cli_ai_review_pipeline_py.json | 1 + .../files/src_devops_cli_commands_ci_py.json | 1 + .../files/src_devops_cli_commands_gh_py.json | 1 + .../src_devops_cli_commands_telemetry_py.json | 1 + .../src_devops_cli_github_metrics_py.json | 1 + .../src_devops_cli_security_base_py.json | 1 + .../tests_golden_review_findings_json.json | 1 + .../tests_test_ai_request_priority_py.json | 1 + .../files/tests_test_crypto_tls_py.json | 1 + ...est_hallucination_catalog_learning_py.json | 1 + ...tests_test_review_static_analyzers_py.json | 1 + .../sessions/20261003-073236/findings.json | 331 ++ .../sessions/20261003-073236/profile.json | 8 + .../k8s_cloudflared_deployment_yaml.json | 1 + .../files/k8s_llm_profiles_services_yaml.json | 1 + .../k8s_monitoring_service-aliases_yaml.json | 1 + .../files/k8s_otel_networkpolicy_yaml.json | 1 + ...src_devops_cli_ai_rag_investigator_py.json | 1 + .../src_devops_cli_ai_spend_pricing_py.json | 1 + .../src_devops_cli_commands_docker_py.json | 1 + ...ps_cli_commands_k8s_security_audit_py.json | 1 + ...ixtures_review_recall_recall_set_json.json | 1 + .../tests_golden_review_findings_json.json | 1 + .../tests_test_ai_request_priority_py.json | 1 + .../files/tests_test_crypto_tls_py.json | 1 + ...tests_test_k8s_port_forward_daemon_py.json | 1 + .../sessions/20261003-102523/findings.json | 205 + .../sessions/20261003-102523/profile.json | 8 + tests/test_git_operations.py | 33 + tests/test_review_prompt_consistency.py | 79 - tests/test_review_score.py | 934 +++++ tests/test_run_comparison.py | 112 + uv.lock | 208 +- 108 files changed, 7550 insertions(+), 168 deletions(-) create mode 100644 changelog.d/1138.md create mode 100644 docs/adr/0005-review-findings-come-from-tools-not-models.md create mode 100644 docs/agent/tasks/task-1138-review-score.md create mode 100644 src/devops_cli/review/score.py create mode 100644 tests/fixtures/review_labels/labels.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-060647/files/k8s_cloudflared_deployment_yaml.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-060647/files/k8s_llm_profiles_ollama-profiles_yaml.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-060647/files/k8s_llm_profiles_services_yaml.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-060647/files/k8s_monitoring_service-aliases_yaml.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-060647/files/k8s_otel_networkpolicy_yaml.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_ai___init___py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_ai_mcp_server_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_ai_rag_indexer_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_ai_rag_qdrant_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_ai_review_schema_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_ai_review_verdicts_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_commands_gh_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_commands_release_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_commands_workspace_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_config_settings_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_main_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-060647/files/tests_fixtures_review_recall_recall_set_json.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-060647/files/tests_golden_review_findings_json.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-060647/files/tests_test_ai_request_priority_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-060647/files/tests_test_batch_2_review_defects_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-060647/files/tests_test_host_sandbox_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-060647/files/tests_test_k8s_tls_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-060647/files/tests_test_review_scope_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-060647/files/tests_test_review_verification_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-060647/findings.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-060647/profile.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-065531/files/k8s_cloudflared_deployment_yaml.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-065531/files/k8s_llm_profiles_ollama-profiles_yaml.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-065531/files/k8s_llm_profiles_services_yaml.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-065531/files/k8s_monitoring_service-aliases_yaml.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-065531/files/src_devops_cli_ai_mcp_server_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-065531/files/src_devops_cli_ai_rag_embeddings_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-065531/files/src_devops_cli_ai_review_common_hallucinations_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-065531/files/src_devops_cli_ai_spend_pricing_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-065531/files/src_devops_cli_commands_ci_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-065531/files/src_devops_cli_commands_gh_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-065531/files/src_devops_cli_commands_k8s_security_audit_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-065531/files/src_devops_cli_security_dive_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-065531/files/tests_golden_review_findings_json.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-065531/files/tests_test_ai_request_priority_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-065531/files/tests_test_crypto_tls_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-065531/files/tests_test_hallucination_catalog_learning_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-065531/findings.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-065531/profile.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-073236/files/k8s_cloudflared_deployment_yaml.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-073236/files/k8s_llm_profiles_ollama-profiles_yaml.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-073236/files/k8s_llm_profiles_services_yaml.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-073236/files/k8s_monitoring_service-aliases_yaml.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-073236/files/k8s_otel_networkpolicy_yaml.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-073236/files/src_devops_cli_ai_client_unified_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-073236/files/src_devops_cli_ai_mcp_server_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-073236/files/src_devops_cli_ai_rag_embeddings_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-073236/files/src_devops_cli_ai_review_pipeline_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-073236/files/src_devops_cli_commands_ci_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-073236/files/src_devops_cli_commands_gh_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-073236/files/src_devops_cli_commands_telemetry_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-073236/files/src_devops_cli_github_metrics_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-073236/files/src_devops_cli_security_base_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-073236/files/tests_golden_review_findings_json.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-073236/files/tests_test_ai_request_priority_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-073236/files/tests_test_crypto_tls_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-073236/files/tests_test_hallucination_catalog_learning_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-073236/files/tests_test_review_static_analyzers_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-073236/findings.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-073236/profile.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-102523/files/k8s_cloudflared_deployment_yaml.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-102523/files/k8s_llm_profiles_services_yaml.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-102523/files/k8s_monitoring_service-aliases_yaml.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-102523/files/k8s_otel_networkpolicy_yaml.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-102523/files/src_devops_cli_ai_rag_investigator_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-102523/files/src_devops_cli_ai_spend_pricing_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-102523/files/src_devops_cli_commands_docker_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-102523/files/src_devops_cli_commands_k8s_security_audit_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-102523/files/tests_fixtures_review_recall_recall_set_json.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-102523/files/tests_golden_review_findings_json.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-102523/files/tests_test_ai_request_priority_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-102523/files/tests_test_crypto_tls_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-102523/files/tests_test_k8s_port_forward_daemon_py.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-102523/findings.json create mode 100644 tests/fixtures/review_labels/sessions/20261003-102523/profile.json create mode 100644 tests/test_review_score.py diff --git a/README.md b/README.md index 28e03e1aee..464ce9942f 100644 --- a/README.md +++ b/README.md @@ -331,6 +331,7 @@ The comprehensive Value vs. Effort Prioritization Matrix, phased milestone deliv | | `devops review verify [OPTIONS] ` | Record a person's or an agent's verdict on a review finding or candidate. | | | `devops review stats [OPTIONS]` | Compute and display review accuracy statistics across saved sessions. | | | `devops review benchmark [OPTIONS] ` | Review the same files several times and report median time, LLM calls, tokens and backend busy share per stage. | +| | `devops review score [OPTIONS] ` | Score saved review sessions against a label file: precision, recall and stability, each with its n. | | | `devops review export-feedback [OPTIONS]` | Append review verdicts to the JSONL feedback dataset, which `devops ai prompt-eval` reads. | | | `devops review corpus COMMAND [ARGS]...` | AI-powered multi-persona code review and security audits. | | | `devops review samples COMMAND [ARGS]...` | AI-powered multi-persona code review and security audits. | diff --git a/changelog.d/1138.md b/changelog.d/1138.md new file mode 100644 index 0000000000..b34cdf5f17 --- /dev/null +++ b/changelog.d/1138.md @@ -0,0 +1,15 @@ +### Added +- `devops review score SESSION... --labels FILE [--json]` scores saved review sessions against a label file, offline: lenient, strict and per-distinct-defect precision split by producer, VERIFIED and HIGH/CRITICAL precision, recall against the label file's recall set and against its input's known defects, and stability across sessions of one input digest (the mean pairwise Jaccard of their identities and Fleiss' κ of their statuses over the identities every one reported). Every ratio shows its n; a ratio over a row no label covers reads "not computable", and those rows are listed. A SESSION without a readable findings.json is refused, and a session that records no input digest is compared with no other. Each score is kept as a `review-score` run, which names each figure it could not compute and why (#1138). +- A row's identity is its cluster in a session the label file maps row by row; otherwise the `fingerprint_v2` of the findings.sarif result at its cited file and line, else that result's tool, rule, path and line or object, and results of more than one tool, rule or fingerprint at that place leave the row unlabelled; otherwise, for a model's row, the one label of its path and origin page within five lines. Nothing is read from a title. Stored absolute paths are made relative to the input's checkout, a row outside the session's reviewed tree counts as false, and a row echoed from a fixture page is no recall (#1138). +- `tests/fixtures/review_labels/labels.json` holds the seed labels of S11 and the ten loop sessions (S12–S21): a row map of all 492 findings.json rows and 169 labelled clusters, transcribed from the loop study. Scored, they give S11 12/51 lenient, 11/51 strict and 4/30 per distinct defect, and the loop 75/441 and 49/441 (#1138). +- `devops review score --materialise-golden DIR` writes the golden set's files into a git repository with one fixed commit, for a path review, and lists the 12 golden defects no tool can express as accepted recall loss. It refuses a DIR that is a file and a golden file under `.git/` (#1138). +- `devops ai runs check` takes `--max-precision-drop` and `--max-stability-drop` for review score runs, and `--max-calls-increase` for model calls, a review's cost. A precision or stability figure the baseline recorded and the run could not compute, such as precision over a new unlabelled row, fails the check and reads "not computable"; model calls are judged when both runs record them (#1138). +- ADR 0005 records that review findings come from tools and checked facts while models explain and plan, and `docs/VISION.md` item 8 becomes Evidence-First Code Reviews (#1138). +- Dependency: statsmodels 0.15.0, with scipy, pandas, patsy and formulaic, for Fleiss' κ; it is imported only when a score computes κ (#1138). + +### Changed +- `devops ai runs check` also fails a run whose model calls rose more than its `--max-calls-increase` (default 20%) over the baseline's, for any two runs that both record calls, review benchmarks included (#1138). +- `docs/SELF_IMPROVEMENT.md`'s recall protocol scores its samples with `devops review score` in place of an inline `score_recall.py` script. It counts reported rows only: it no longer counts the candidates before re-ranking and verification, so its bar counts a sample that reports a set finding, not one that only found it (#1138). + +### Fixed +- The knowledge base's RAG article no longer says reviews ground on whatever the index holds: a review asks the index for each page by its file path and symbol names, and for each finding it verifies by the finding's title and description, and writes nothing to it (#1138). diff --git a/docs/CLI_REFERENCE.md b/docs/CLI_REFERENCE.md index c73f9a5bdb..55716a5bcf 100644 --- a/docs/CLI_REFERENCE.md +++ b/docs/CLI_REFERENCE.md @@ -3621,6 +3621,28 @@ devops ai review benchmark [OPTIONS] | `--no-static-scan` | `boolean` | - | Disable static security scanning. | | `--concurrency`, `-c` | `integer` | - | Max concurrent workers for parallel review and verification. | +#### `devops ai review score` + +**Score saved review sessions against a label file: precision, recall and stability, each with its n.** + +```bash +devops ai review score [OPTIONS] +``` + +**Arguments:** + +| Argument | Type | Required | Description | +|---|---|---|---| +| `` | `path` | No | Review session directories to score. | + +**Options:** + +| Option / Flag | Type | Default | Description | +|---|---|---|---| +| `--labels` | `path` | - | Label file: the labelled inputs, the row map of each mapped session and the labels, such as tests/fixtures/review_labels/labels.json. | +| `--materialise-golden` | `path` | - | Write the label file's golden set into this directory as a git repository with one fixed commit, for a path review, and list the defects no tool can express. Takes no sessions. | +| `--json` | `boolean` | - | Output findings or metrics as JSON. | + #### `devops ai review export-feedback` **Append review verdicts to the JSONL feedback dataset, which `devops ai prompt-eval` reads.** @@ -4536,7 +4558,7 @@ devops ai runs reindex [OPTIONS] | Option / Flag | Type | Default | Description | |---|---|---|---| -| `--mechanism`, `-m` | `choice (review-benchmark|sample-validation|corpus-score|gateway-tune|prompt-eval|ai-benchmark|template-sweep)` | - | Only index runs of this mechanism. | +| `--mechanism`, `-m` | `choice (review-benchmark|sample-validation|corpus-score|review-score|gateway-tune|prompt-eval|ai-benchmark|template-sweep)` | - | Only index runs of this mechanism. | #### `devops ai runs connect` @@ -4567,7 +4589,7 @@ devops ai runs list [OPTIONS] | Option / Flag | Type | Default | Description | |---|---|---|---| -| `--mechanism`, `-m` | `choice (review-benchmark|sample-validation|corpus-score|gateway-tune|prompt-eval|ai-benchmark|template-sweep)` | - | Only list runs of this mechanism. | +| `--mechanism`, `-m` | `choice (review-benchmark|sample-validation|corpus-score|review-score|gateway-tune|prompt-eval|ai-benchmark|template-sweep)` | - | Only list runs of this mechanism. | | `--subject-key`, `-s` | `string` | - | Only list runs matching this subject key or prefix. | | `--limit`, `-n` | `integer` | `20` | Maximum number of runs to show. | | `--format`, `-f` | `string` | `table` | Output format: table or json. | @@ -4635,6 +4657,9 @@ devops ai runs check [OPTIONS] | `--max-recall-drop` | `float` | `0.0` | Maximum allowable relative drop in recall (e.g. 0.05 for 5%). | | `--max-duration-increase` | `float` | `0.15` | Maximum allowable relative increase in duration (e.g. 0.15 for 15%). | | `--max-tokens-increase` | `float` | `0.2` | Maximum allowable relative increase in prompt tokens (e.g. 0.20 for 20%). | +| `--max-precision-drop` | `float` | `0.0` | Maximum allowable relative drop in a review score's lenient and strict precision (e.g. 0.05 for 5%). | +| `--max-stability-drop` | `float` | `0.0` | Maximum allowable relative drop in a review score's Jaccard and Fleiss kappa (e.g. 0.05 for 5%). | +| `--max-calls-increase` | `float` | `0.2` | Maximum allowable relative increase in model calls, a review's cost (e.g. 0.20 for 20%). | | `--format`, `-f` | `string` | `table` | Output format: table or json. | #### `devops ai runs baseline` @@ -4689,7 +4714,7 @@ devops ai runs baseline show [OPTIONS] | Option / Flag | Type | Default | Description | |---|---|---|---| -| `--mechanism`, `-m` | `choice (review-benchmark|sample-validation|corpus-score|gateway-tune|prompt-eval|ai-benchmark|template-sweep)` | - | Mechanism for subject lookup. | +| `--mechanism`, `-m` | `choice (review-benchmark|sample-validation|corpus-score|review-score|gateway-tune|prompt-eval|ai-benchmark|template-sweep)` | - | Mechanism for subject lookup. | | `--format`, `-f` | `string` | `table` | Output format: table or json. | ### `devops ai cost` @@ -5209,6 +5234,28 @@ devops review benchmark [OPTIONS] | `--no-static-scan` | `boolean` | - | Disable static security scanning. | | `--concurrency`, `-c` | `integer` | - | Max concurrent workers for parallel review and verification. | +### `devops review score` + +**Score saved review sessions against a label file: precision, recall and stability, each with its n.** + +```bash +devops review score [OPTIONS] +``` + +**Arguments:** + +| Argument | Type | Required | Description | +|---|---|---|---| +| `` | `path` | No | Review session directories to score. | + +**Options:** + +| Option / Flag | Type | Default | Description | +|---|---|---|---| +| `--labels` | `path` | - | Label file: the labelled inputs, the row map of each mapped session and the labels, such as tests/fixtures/review_labels/labels.json. | +| `--materialise-golden` | `path` | - | Write the label file's golden set into this directory as a git repository with one fixed commit, for a path review, and list the defects no tool can express. Takes no sessions. | +| `--json` | `boolean` | - | Output findings or metrics as JSON. | + ### `devops review export-feedback` **Append review verdicts to the JSONL feedback dataset, which `devops ai prompt-eval` reads.** diff --git a/docs/ERRORS.md b/docs/ERRORS.md index 281e9d1e18..a739314bd2 100644 --- a/docs/ERRORS.md +++ b/docs/ERRORS.md @@ -99,6 +99,7 @@ names the class each row describes. One code never maps to two exit statuses. | `ReleaseWorkingTreeDirtyError` | `RELEASE_WORKING_TREE_DIRTY` | `1` | Git | Raised when the working tree has uncommitted changes before cutting a release. | | `ReplyRejectedError` | `LLM_INFERENCE_ERROR` | `10` | Devops_cli.ai.client.models | Raised when the caller's validator refused a reply; it carries the reply, never cached. | | `ReviewPoolError` | `REVIEW_POOL_ERROR` | `1` | Ai | Raised when an error occurs during parallel review worker pool execution. | +| `ReviewStateError` | `REVIEW_STATE_ERROR` | `1` | Devops_cli.review.state | Exception raised for invalid review finding state or state transition. | | `RoadmapCardChangedError` | `ROADMAP_CARD_CHANGED` | `1` | Roadmap | Raised before a job's board write that would revert a change made since it read the card. | | `RoadmapRefineError` | `ROADMAP_REFINE_FAILED` | `1` | Roadmap | Raised after a refine run in which the model call failed for one or more items. | | `RoadmapRunError` | `DEVOPS_CLI_ERROR` | `1` | Roadmap | Raised when one or more roadmap jobs fail during execution. | diff --git a/docs/SELF_IMPROVEMENT.md b/docs/SELF_IMPROVEMENT.md index c9fbe5b12f..0a3202568a 100644 --- a/docs/SELF_IMPROVEMENT.md +++ b/docs/SELF_IMPROVEMENT.md @@ -169,7 +169,7 @@ prompt is built from it: a prompt changes when someone edits a file under `ai/ta | Data | Default path | Written by | Read by | | :--- | :--- | :--- | :--- | -| Review sessions | `.data/reviews//` | each review | `devops review findings`, `verify`, `stats`, `export-feedback`, `corpus score` | +| Review sessions | `.data/reviews//` | each review | `devops review findings`, `verify`, `stats`, `score`, `export-feedback`, `corpus score` | | Learned catalog | `.data/common_hallucinations.json` | a person's INVALIDATED verdict | every review | | Mitigations ledger | `.data/mitigated_findings.json` | a person's MITIGATED verdict | branch and PR reviews, `devops pr check-readiness` | | Feedback dataset | `.data/feedback_dataset.jsonl` | `devops review export-feedback` | `devops ai prompt-eval` | @@ -972,69 +972,30 @@ evidence. The gate calls no model, so it cannot score recall; a person runs this done ``` -3. **Score.** Save the script below as `score_recall.py` and run it once per arm on that arm's - sessions, as in `python3 score_recall.py $R/b/tests/fixtures/review_recall/recall_set.json - $R/data-b/reviews/2*/`. For each finding of the set it prints how many samples found it, with a - match among the candidates before verification, and how many reported it, then the location - and title of each match. A match names the file and cites a line inside the set's range. Last, - it lists every other candidate on the set's files. - - ```python - import json, re, sys - - recall_set, *sessions = sys.argv[1:] - entries = json.load(open(recall_set))["findings"] - - - def place(finding): - """The set's path that a finding names, or None, and the first and last line it cites.""" - path, _, lines = finding["location"].partition(":") - named = next( - (e["path"] for e in entries if path == e["path"] or path.endswith("/" + e["path"])), - None, - ) - span = re.fullmatch(r"(\d+)(?:-(\d+))?", lines) - return named, span and (int(span[1]), int(span[2] or span[1])) - - - def matches(entry, finding): - path, span = place(finding) - start, end = entry["lines"] - return path == entry["path"] and bool(span) and span[0] <= end and span[1] >= start - - - def load(session, name): - return json.load(open(f"{session}/{name}"))["findings"] - - - for entry in entries: - found = [[f for f in load(s, "candidates.json") if matches(entry, f)] for s in sessions] - kept = [[f for f in load(s, "findings.json") if matches(entry, f)] for s in sessions] - print( - f"{entry['path']}:{entry['lines'][0]}-{entry['lines'][1]}", - f"found {sum(map(bool, found))}/{len(sessions)}", - f"reported {sum(map(bool, kept))}/{len(sessions)}", - ) - for session, hits in zip(sessions, found): - for f in hits: - print(" ", session, f["location"], f["title"]) - print("unmatched on the set's files") - for session in sessions: - for f in load(session, "candidates.json"): - if place(f)[0] and not any(matches(e, f) for e in entries): - print(" ", session, f["location"], f["title"]) - ``` +3. **Score.** From a devops-cli checkout, score each arm's sessions with `devops review score`, + as in `devops review score $R/data-b/reviews/2*/ --labels + tests/fixtures/review_labels/labels.json`. The label file names the recall set, so the Recall + Set table shows, for each finding of the set, how many samples reported it. A row matches when + it names the file, as a repository path or through the file its cited code names, cites a line + inside the set's range, and was raised on the file's own page rather than echoed from a + fixture. A location without line numbers, as kube-linter gives, cites no line. The Unlabelled + Rows table lists every row no label covers, those on the set's files among them. The score + reads each session's reported rows (`findings.json`) only. The `score_recall.py` script this + step ran until #1138 also counted the candidates before re-ranking and verification + (`candidates.json`), and its bar counted a sample that found a set finding there; the protocol + no longer measures candidates, so it no longer tells a finding lost after generation from one + never generated, and the bar in step 4 counts reported rows. 4. **Read.** The bar counts a sample only when one of its matches describes the set's defect: - read each title, because a finding on the construct's lines can describe another defect. An - unmatched candidate that describes a set's defect on other lines counts for it too; name it in - the PR. Label every other unmatched candidate valid, opinion or false: they are what the - change adds on the set's own files. B passes when it finds each Network Exposure finding of the - set in at least 2 of its 3 samples; the Error Handling and Security Claims findings are counted - and reported, not gated. A path review shows no code to a docs page and no diff to a broad - `except`, so those two classes are measured in branch reviews; #423 carries broad excepts and - #921 the `docs/VISION.md` text. A's counts, read the same way, are the baseline. A finding that B found and - did not report was lost at verification, not at generation. + read each title (`devops review findings `), because a finding on the construct's + lines can describe another defect. An unmatched row that describes a set's defect on other + lines counts for it too; name it in the PR. Label every other row on the set's files valid, + opinion or false: they are what the change adds on the set's own files. B passes when it + reports each Network Exposure finding of the set in at least 2 of its 3 samples; the Error + Handling and Security Claims findings are counted and reported, not gated. A path review shows + no code to a docs page and no diff to a broad `except`, so those two classes are measured in + branch reviews; #423 carries broad excepts and #921 the `docs/VISION.md` text. A's counts, read + the same way, are the baseline. 5. **Precision guard.** Session `20261002-205520` reported 24 findings on 15 files, and 22 of them were false or opinion: all but the broad excepts at `pricing.py:55` and `:65`. Review those files once from B, fresh, at T, and label each finding in the session's `findings.json` valid, diff --git a/docs/VISION.md b/docs/VISION.md index 9dd348477a..f25a2f4f56 100644 --- a/docs/VISION.md +++ b/docs/VISION.md @@ -11,7 +11,7 @@ The principles devops-cli is built on and the themes it is heading toward. This 5. **Agent Harness Slots & Sub-Agent Local Offloading**: Partition multi-agent execution into swappable slots (Model, Skills, Tools, Sub-Agents). Offload token-intensive sub-agent tasks (code exploration, AST symbol mapping) to local open-weight models ("Big decides, small types, big checks") toward an unmeasured token savings target. 6. **Model Curation & AI Bill of Materials (AIBOM)**: `devops scan aibom` flags models that use `trust_remote_code` and compiles AI Bill of Materials (AIBOM) records; automated model curation and static AST/Semgrep inspection before GPU provisioning remain visionary themes with no implementation yet. 7. **Model Dependency Chaos Engineering & Slow-Zone Resilience**: Deliberately test fallback models ("Chaos Monkey for Models") against tool suites and keep documentation/CLI `--help` 100% synchronized so lesser models can pilot automation without human coaching. -8. **Auditable Multi-Persona Code Reviews**: Domain-specialized personas (`devsecops`, `architect`, `pm`, `auditor`, `qa`) with deterministic static metadata extraction (`SegmentMeta`), prompt boundary isolation, and closed-loop finding verification. +8. **Evidence-First Code Reviews**: A finding exists only when one of these produces it: a pinned, version-aware analysis tool; a vulnerability database; a language or dependency fact confirmed at the versions the project declares and locks; a rule from the project's tested rule pack (reference-exploit rules included, admitted by a person); or a replayable sandbox observation. The pipeline checks its location against the reviewed commit before reporting it. The review keeps a reference library: official language, dependency, tool and practice documentation, plus the project's own knowledge-base manuals where the versions they state match. The library is pinned to the versions the reviewed project declares and locks, derived from the project itself, refreshed as a side effect of use, and reported for coverage in every review. Language models correlate, investigate, explain and plan across findings, but never create, re-rate or overturn one. Their quotes, citations and version claims are checked before they are shown. A proposed fix counts only when re-running the same tools and the project's tests on the patched tree confirms it. Review work runs as content-addressed jobs, so no GPU host idles while the queue holds work it can serve. Every review states what it checked, with which versions, and what it could not check. 9. **Zero Boilerplate & Standard Library Leverage**: Expressive integration of modern standard library utilities (`pathlib`, `ast`, `collections`, `itertools`, `functools`), Pydantic v2 schemas, and strict indentation budgets (<6 levels). 10. **Complete Observability Triad & Centralized Kubernetes Logging**: Unified telemetry integrating Prometheus client metrics, Jaeger/OTel distributed tracing, and Grafana Loki centralized log aggregation with LogQL CLI querying and agentic incident diagnosis. 11. **Pre-1.0 Alpha Velocity & Post-1.0 SemVer Change Management**: Until at least release `1.0.0`, `devops-cli` is active alpha software with no intention of maintaining backwards compatibility. The codebase must remain clean of legacy references and obsolete shims at all times so that it can reach maturity at a reasonable rate. Any version after `1.0.0` will follow strict semantic versioning conventions, and use all change management best practices including feature flags, deprecations, and migration functionality. diff --git a/docs/adr/0005-review-findings-come-from-tools-not-models.md b/docs/adr/0005-review-findings-come-from-tools-not-models.md new file mode 100644 index 0000000000..5e0cf78594 --- /dev/null +++ b/docs/adr/0005-review-findings-come-from-tools-not-models.md @@ -0,0 +1,59 @@ +# Review findings come from tools and checked facts; models explain and plan + +`devops review` asked a model to find defects page by page, and a second model call to verify them. On a fixed input the result was a sample, not a measurement. Ten `--no-cache` runs of release/v0.2.25 at e3ff98c (S12–S21) reported 28–57 findings each and 154 distinct findings in all. Two runs agreed on persona findings with a mean Jaccard of 0.131. One run found 38% of the nine known valid defects. None of the 94 VERIFIED rows and none of the 50 HIGH or CRITICAL rows was strictly valid. A file that does not exist, `app/shell.py:4`, was VERIFIED and ranked first in all eleven runs, S11 included. The model called Python 3.14's unparenthesized `except A, B:` a syntax error 22 times, and the verifier confirmed it 3 times. The scanner candidates were identical in every run, and every strictly valid row was a kube-linter result. The model verifier refuted all 90 read-only-root-filesystem results; 49 were kept only because a guard blocked those refutations. Voting over five runs raised lenient precision only from 17.4% to 25.2%, at five times the calls. Each failure had been answered with another guard or catalog entry: the catalog holds 53 hand-kept entries, and `verification.py` changed in 20 commits in one month. + +The knowledge base and the document ingestors never reached a review. On 2026-09-30 a search that hit a vector-dimension mismatch deleted and recreated both Qdrant collections, and nothing has written to them since. All 2,084 searches in the loop returned nothing. No command, schedule or hook runs ingestion. Drift is measured against a local cache, not the index, so the wipe looked like no drift. The docs ingestor writes files nothing reads. Contract grounding found a contract in 0 of 20,244 file payloads. The review queried its own code index by file path and symbol names, never by what a finding names. The knowledge base states PEP 758 correctly, but it carries no version metadata, and 7 of the 25 versions it states differ from the lockfile. + +A finding now exists only when one of these produces it: +- a pinned tool, including the language's own compiler and type checker at the project's declared floor; +- an advisory database; +- a language or dependency fact confirmed at the declared and locked versions; +- a rule in devops-cli's tested rule pack, where reference-exploit rules join only when a person merges them; +- (later) a replayed sandbox observation. + +One admission function builds every finding from that anchor. It checks that the location exists in the reviewed commit: a line region, or the named object or package when the tool reports no line. It takes severity from the rule's metadata and a policy table. Only tools and people change a finding's state: +- a tool run opens or fixes it; +- reviewed project configuration suppresses it; +- a person's valid verdict or a replayed observation confirms it. + +Tools run on a worktree of the reviewed commit, inside the sandbox with no network, at the language and dependency versions the project declares. Inline suppression markers count only where they already exist at the base revision. A tool's findings count only after its output on a canary for the target language version matches the recorded expected output. + +A reference store of version-pinned facts and official documentation sits beside the tools: +- **Contents:** derived from the reviewed project (its languages, version floor, locked dependencies, tools and the rules that fired), plus the project's own knowledge-base manuals where the versions they state match. +- **Refresh:** a side effect of running devops commands. Fetches that could not finish wait in a pending list that later commands drain. +- **Lookup:** by key, with a full-text fallback. +- **Reporting:** every review reports what it needed, what each model job received and what was missing. + +Models correlate, explain and plan from findings and reference items. Their output is stored apart from findings, and it has no field that can create, move, re-rate or change the state of a finding. Its quotes, citations, version strings and code are checked before they are shown. + +A patch counts only when both of these pass on the patched tree in the sandbox: +- the producing tools, with inline suppressions ignored; +- the base revision's mapped tests. + +A patch that changes a suppression, a test or tool configuration does not count. + +Review work runs as content-addressed jobs pulled by one worker per GPU tier slot, so no tier idles while the queue holds work it can serve. + +## Considered Options + +- **Keep model-generated findings and harden verification** (more guards, self-consistency voting, better prompts): rejected. Voting cannot remove deterministic false positives: 22 false clusters survived a majority vote. On kube-linter rows the guards kept false findings more often than valid ones (153/200 against 49/90). More prompt and guard fixes are what the last month's churn already was. +- **Fix ingestion and keep page-level embedding search as the review's knowledge path**: rejected. The query names a file, not a fact; code embeddings track identifier names; and the stored text had no version. A keyed lookup with a full-text fallback is still retrieval for generation, but it needs no vector store. Embeddings stay for chat and the knowledge base's index, and may return to reviews once labelled misses show that keyed and full-text lookups miss relevant documents. +- **Let model-written reference-exploit rules produce findings once their tests pass**: rejected. A rule written after seeing the candidate, and tested on it, proves only that it matches what it was fitted to. Such a rule passed `semgrep --test` on a safe candidate. Model-written rules produce leads until a person merges them into the pack. +- **Route through the gateway alone** (least-busy, `max_parallel_requests`) as the scheduler: rejected for the job system. It cannot see that the 48gib-slow tier's two models share one slot, its 429s put a deployment into cooldown, and it keeps no record per item. Until the job system exists, the current pipeline uses least-busy behind a client cap. `cancel_on_disconnect` and `num_retries: 0` stay as safety nets. +- **Target workers at a LiteLLM deployment id**: rejected while BerriAI/litellm#43495 is open. Each tier gets a one-deployment model group instead. +- **A cluster-side queue (Kubernetes Jobs) or DBOS for every item**: rejected. A pod per 3–18 s call costs more than the call, and DBOS fixes a job's partition when it is enqueued and adds three dependencies. Kubernetes Jobs remain the executor for sandboxed probes. +- **Vendoring Semgrep registry rules or bundling the CodeQL CLI**: rejected by their licences. This repository is public, so anything committed is redistributed. Registry rules are fetched into the user's own cache for internal use, and CodeQL results are read from GitHub code scanning. + +## Consequences + +- **Deleted, not kept behind flags (pre-1.0):** the persona review stage, the model verifier, the hallucination catalog, the model-claim guards and the legacy segment engine. The persona definitions stay for chat and analysis. +- **A false positive is fixed once:** in tool configuration, or as a suppression with a reason and an expiry. A missed defect becomes a tested rule in devops-cli's rule pack. Nothing records model mistakes any more. +- **Out of scope until someone writes a rule:** defects that no tool or rule can express, such as a prose claim in VISION.md or a missing depth limit. +- **The pinned tools become part of the supply chain.** A tools lock with checksums and hashed requirements, the sandbox and the canary guard them, and each review lists newer releases of every pinned tool. +- **Stability is defined over equal inputs:** the commit, the tools lock, the ruleset snapshot, the advisory database snapshot and the reference store snapshot. +- **The knowledge base's manuals declare the versions they apply to.** Matching manuals ground explanations; mismatched ones are reported as drift. Chat's index of the knowledge base is rebuilt whenever the installed knowledge base differs from what the index holds. +- **`devops ai ingest` becomes `status`, `sync`, `lookup` and `prune`** over the reference store. Its `library`, `docs`, `index-libraries` and `query-library` commands go. +- **Documentation changes:** + - CONTEXT.md's code-review terms change, and VISION.md items 8 and 16 change; + - README.md, AGENTS.md section 5, SELF_IMPROVEMENT.md, KNOWN_ISSUES.md and TELEMETRY.md are rewritten through their usual paths; + - the findings metric's `persona` label becomes `producer`. diff --git a/docs/agent/tasks/task-1138-review-score.md b/docs/agent/tasks/task-1138-review-score.md new file mode 100644 index 0000000000..eefdc7923d --- /dev/null +++ b/docs/agent/tasks/task-1138-review-score.md @@ -0,0 +1,56 @@ +# Task: devops review score scores saved review sessions against a label file offline and reproduces the S11 and loop baselines (#1138) + +**Issue**: [#1138](https://github.com/dan-petty/devops-cli/issues/1138) +**Status**: Done +**Milestone**: v0.2.30 +**Priority**: priority/p1-high +**Scope**: type/feature, scope/review + +## Description + +Every review evaluation from S5 to S21 computed precision, recall and stability by hand, the baselines existed only as prose, and the loop study's labels sat in gitignored scratch files. `devops review score` scores saved sessions against a committed label file, offline, and the seed labels reproduce the published baselines. + +- **The scorer** (`src/devops_cli/review/score.py`). A label file (pydantic, unknown fields refused) holds inputs and labels. An input has a name, a split (`tuning` or `held-out`), its page digests, the checkout its sessions stored absolute paths under, its known defects, its accepted recall loss and a row map: session id to the label key of each findings.json row. A label holds the identity (key, producer, rule, path, lines, object, origin page, `fingerprint_v2`), the label (valid-strict, valid-lenient, opinion or false), the defect id, the expected severity, a note, the labeller and the date. A session's findings.json is read with `ai/review/history.py`'s `HistoryPayload`, made public (`HistoryFinding` gains `location`, `severity` and `cited_code`), and a SESSION without a readable findings.json, or with a page that does not parse, is refused rather than scored as empty; findings.sarif is read through `security/sarif.read_sarif`, locations through `review_schema._parse_location` and `security/normalization.split_location`, and fixture pages through `path_classes.is_fixture_path`. +- **Identity.** A row of a mapped session takes its cluster from the row map. Any other row takes the findings.sarif result at its cited file and line (or its object): that result's `fingerprint_v2`, else its tool, rule, path and line or object, the key the loop study clustered tool findings on. Results at one place that differ in tool, rule or fingerprint (two kube-linter checks on one object, Bandit's B603 and B607 on one line) leave the row without an identity, so it is listed as unlabelled; identical duplicates, which sessions write for Bandit's B108, are one result. A model's row takes the one persona label of its path and origin page within five lines, and two such labels leave it unlabelled. Nothing is read from a title or a message. A stored absolute path is made relative to the input's checkout with `PurePosixPath.relative_to`, a row outside the session's `files/` pages counts as false without a lookup, and a row echoed from a fixture page is no recall. +- **Figures.** Each ratio (`Ratio`) carries its numerator and denominator in the table and in `--json`, and reads "not computable" while one of its rows has no label; the unlabelled rows are listed. Per session: lenient, strict and per-distinct-defect precision, the same three split by producer, VERIFIED and HIGH/CRITICAL precision, recall against the label file's recall set (per finding, the sessions whose report cites it) and against the input's known defects. Per input digest (a session that records none is a group of its own, not computable for stability): pooled precision, the mean pairwise Jaccard of the identities the sessions report, and Fleiss' κ of their statuses over the identities every session reported, by statsmodels' `fleiss_kappa` and `aggregate_raters`, imported only when κ is computed (owner decision 2026-10-09). `fleiss_kappa` needs equal ratings per subject, so the loop study's κ of 0.444 (126 clusters, 730 ratings) is not recomputed. +- **The command** (`commands/review.py`): `devops review score SESSION... --labels FILE [--json]` records a `review-score` run (`Mechanism.REVIEW_SCORE`) whose results hold the report plus `precision_lenient`, `precision_strict`, `recall`, `stability_jaccard`, `stability_kappa` and the median `llm_calls`, `prompt_tokens` and wall time, and `not_computable`, which names each of the first five the score could not compute and why. Stability is the mean over the inputs with two or more sessions, and not computable while one of them is. `--materialise-golden DIR` takes no sessions: it writes the golden input's files (`tests/golden/review_findings.json`) into DIR and makes one commit through `git/operations.commit_snapshot` (fixed author, committer and date, no email address, no hooks, no signing), the commit `git commit` makes of the same files, and lists the accepted recall loss. It refuses a DIR that is a file, a golden file outside DIR or under its `.git/`, before it writes anything. +- **Run checks** (`ai/run_store.py`, `commands/ai_runs.py`). `devops ai runs check` takes `--max-precision-drop`, `--max-stability-drop` and `--max-calls-increase`. A precision or stability figure either run recorded gets a verdict; one the baseline recorded and the current run could not compute fails, its reason "not computable ()" and its current value shown as "not computable", so new unlabelled rows cannot pass the check. Model calls are judged when both runs recorded them. The drop limits come from one table in `run_store.py`, and the recall verdicts call `_evaluate_drop_verdict` directly. Cost is model calls: `cost_usd` is 0.0 in every recorded session, since the models are self-hosted. +- **Labels** (`tests/fixtures/review_labels/labels.json`). A one-off transcription, run outside the repository and not committed, read `.data/review-labels/clusters.json` (`per_session[*].findings_row`, `s11_label`, `prior_label_s10`, `rel_path`, `origin`, `line_span_e3`, `rule_id`, `rule_sub`, `loc_suffix`) and the precision report's section 1 lists. Its row map covers all 51 S11 rows and all 441 loop rows; 169 clusters are labelled (168 reported, plus C243, config.py:514, valid and never reported): valid-strict 12, valid-lenient 8, opinion 8, false 141. Defect ids follow the report's merges: kube-linter objects group per check and file, the recall-set echoes C091, C093 and C036 join C092, C094 and C039, and C246 and C247 are one defect. S11 and the loop are tuning inputs with the 9 known defects of the loop evaluation; the golden set is held out, with no digest until it is first scored, its 12 known defects and 12 defects no tool can express (missing-containment, missing-depth-limit, unchecked-status, unvalidated-dest, processed-timestamps, if-none-of, not-properly, api-need-to, cwe400-upload, missing-auth-header, miscounted-line and persona-self-dismissal). The labellers are the S11, S10 and loop evaluations' agent lenses, dated 2026-10-03. +- **Recorded slices** (`tests/fixtures/review_labels/sessions/`): S11, S12, S13 and S18, trimmed to the rows' location, status, severity, reportable and verified_by, the profile's call, token and time figures, and the `files/` pages the rows name, by `file_path` only. The expected figures are the loop evaluation's section 2 table, which the transcription reproduced for all 11 sessions from the raw findings.json rows (S20's HIGH cell reads 3/6, as the evaluation's skeptic corrected). The slices' stability was computed from clusters.json at transcription time: Jaccard over the three loop slices' row clusters is 0.3672 (3 pairs), and κ is 1.0 over the 19 clusters all three report, each with one status in all three. +- **Docs.** `docs/adr/0005-review-findings-come-from-tools-not-models.md` holds #1137's decision record byte for byte; `docs/VISION.md` item 8 is #1137's Evidence-First Code Reviews text; the knowledge base's `rag_context_indexing.md` states the two lookups a review makes (each page by file path and symbol names, up to three chunks; each finding the verifier checks by title and description, up to two) and that a review writes nothing to the index. `docs/SELF_IMPROVEMENT.md`'s recall protocol scores with `devops review score` in place of its inline `score_recall.py`, whose test cases moved to `tests/test_review_score.py`; the protocol now counts reported rows only, no longer the candidates before re-ranking and verification, and the doc and the changelog fragment say so. CONTEXT.md is not changed. +- **Tests** mirror the source tree: `tests/test_review_score.py`, and cases in `tests/test_run_comparison.py` and `tests/test_git_operations.py`. They read the committed fixtures and write sessions into `tmp_path`; the golden tests run local git with `GIT_CONFIG_GLOBAL=/dev/null` and `GIT_CONFIG_NOSYSTEM=1`. + +## Acceptance Criteria + +- [x] Label rescue: `clusters.json`, `candidates.jsonl` and `clusters-method.md` are in `.data/review-labels/` (copied 2026-10-03); the prose labels and partitions are transcribed into `tests/fixtures/review_labels/`, and `test_the_label_file_maps_every_s11_and_loop_row_to_a_label` checks all 441 loop rows and all 51 S11 rows. +- [x] `devops review score SESSION... --labels FILE [--json]` reports lenient, strict and per-distinct-defect precision split by producer, VERIFIED and HIGH/CRITICAL precision, recall against the recall file and the known-defect list, and stability across sessions of equal input digests, with n beside every ratio: `test_the_recorded_slices_reproduce_the_published_precision`, `test_precision_splits_by_producer`, `test_every_ratio_carries_its_n_in_the_table_and_the_json` and `test_recall_counts_the_samples_whose_report_cites_each_finding`. A SESSION without a readable findings.json is refused, and a session without an input digest gets no stability: `test_a_session_without_a_readable_findings_json_is_refused` and `test_sessions_without_an_input_digest_are_compared_with_no_other`. +- [x] Unlabelled rows are listed, and a ratio over one reads "not computable", in the report and in `devops ai runs check`: `test_an_unlabelled_row_is_listed_and_every_label_ratio_reads_not_computable`, `test_a_score_whose_new_rows_are_unlabelled_fails_the_run_check` and `test_a_score_figure_the_current_run_could_not_compute_fails_the_check`. +- [x] Identity: `fingerprint_v2` from findings.sarif for new sessions, the loop's clusters through the committed row map for S11–S21, and persona rows by path, origin page and ±5 lines; two tool findings at one place leave the row unlabelled: `test_new_sessions_match_labels_by_fingerprint_loop_key_and_persona_window` and `test_two_tool_findings_at_one_place_leave_its_rows_unlabelled`. +- [x] A location outside the reviewed tree never matches a label, and a hit whose source page is a fixture is not recall: `test_a_row_outside_the_reviewed_tree_counts_as_false_without_a_label`, `test_a_hit_echoed_from_a_fixture_page_is_not_recall` and `test_echoed_known_defects_are_not_recall_in_the_slices`. +- [x] Each label holds identity, label, defect id, expected severity, note, labeller and date, and each input is marked tuning or held-out (`LabelFile`, `Label`, `LabelledInput`). The loop evaluation recorded no expected severity per cluster, so 168 of the 169 seed labels leave it null, 19 of the 20 valid ones among them; see the pending seed-label review below. +- [x] `--materialise-golden DIR` writes the golden files into a repository with one fixed commit, and lists the accepted recall loss: `test_the_golden_set_materialises_as_one_fixed_commit`, `test_commit_snapshot_makes_the_same_one_commit_of_the_same_files` and `test_the_committed_golden_input_lists_its_accepted_recall_loss`; a DIR that is a file, or a golden file outside DIR or under its `.git/`, is refused before anything is written: `test_materialising_into_a_directory_that_holds_files_or_a_file_is_refused` and `test_a_golden_set_that_cannot_be_written_is_refused`. +- [x] The recorded slices print 12/51, 11/51 and 4/30, each loop slice its section 2 row, and the slices' Jaccard and κ: `test_the_recorded_slices_reproduce_the_published_precision` and `test_the_loop_slices_pin_their_stability_and_pooled_precision`. +- [x] `devops ai runs check` has tolerances for precision, stability and cost (model calls): `test_score_runs_check_precision_stability_and_calls_at_their_tolerances`, `test_a_score_figure_the_current_run_could_not_compute_fails_the_check`, `test_only_a_figure_neither_run_recorded_goes_without_a_verdict` and `test_cli_runs_check_takes_the_score_tolerances`. +- The reference-coverage tolerance: moved to #1147, the first item that records received ÷ needed per job (#1137's P2-2 also lists it). +- [x] Over `.data/reviews`, `devops review score` gives S11 12/51 and the loop 75/441 lenient and 49/441 strict, run offline with `DEVOPS_CLI_DATA_DIR` set to a temporary directory and a config without `runs.index_url`, so the run stayed on the workstation. +- [x] The ADR, VISION item 8 and the knowledge-base fix land here; CONTEXT.md's code-review terms are not changed. +- [x] Producer-split precision replaces #871's original `review stats --by producer`. +- [x] The scorer makes stored scanner paths repo-relative when it reads them: `test_stored_scanner_paths_are_made_relative_to_the_input_root`. +- [x] Tests run offline with fakes and recorded tool output: no network, no real scanner, no model. +- Each test under 1 s: met by every test of this item but one. `test_the_loop_slices_pin_their_stability_and_pooled_precision` is the only test that computes κ, and it pays statsmodels' import (about 0.85 s alone, 1.1–1.2 s for the test under pytest), the cost of the owner's κ decision (2026-10-09); every other test scores sessions whose inputs have one session each, or none with an identity on every row, so no other test imports statsmodels. +- [x] `changelog.d/1138.md` records the change; `CHANGELOG.md` and `docs/ROADMAP.md` are not edited. +- The three tools-only runs of `devops review branch --no-persona-review --no-verification` on the loop input: moved to #1137's P0 exit, since they wait on #1140. +- The 16 BLE001 rows in the loop's diff hunks: moved to #873, since no session holds them until #873 admits ruff findings. +- Pending a person: review the seed labels in `tests/fixtures/review_labels/labels.json`, above all the 99 new reads of the loop evaluation and the golden input's accepted recall loss, and set `expected_severity` on the valid-strict and valid-lenient labels (19 of the 20 are null; the loop evaluation recorded none). +- Pending a person: score golden `real_defects` once on the current pipeline: `uv run devops review score --labels tests/fixtures/review_labels/labels.json --materialise-golden /tmp/golden`, then `cd /tmp/golden && uv run --project devops review path . --no-cache`, then `uv run devops review score --labels tests/fixtures/review_labels/labels.json`; add the session's `subject.input` digest to the golden input and label each listed unlabelled row with the golden defect id it is. +- Pending a person: on a host whose load1 is above 20 (`uptime`), run `uv run devops review branch --no-persona-review --no-verification --no-cache`; the session's `profile.json` shows `static_analyzers.Semgrep` as `ran` and its `static_analyzer_seconds`. +- [x] `uv run devops ci` passes: the PR's passing checks. + +## Deliverables + +- [x] `src/devops_cli/review/score.py`, with the `review score` command and its HELP and MESSAGES strings. +- [x] `Mechanism.REVIEW_SCORE`, the score figures and tolerances in `ai/run_store.py`, and the `ai runs check` flags. +- [x] `git/operations.commit_snapshot`, the history reader's public `HistoryPayload`, and `HistoryFinding`'s `location`, `severity` and `cited_code`. +- [x] `tests/fixtures/review_labels/labels.json` and the four recorded slices. +- [x] statsmodels 0.15.0 in `pyproject.toml` and `uv.lock`, with a mypy override, since it ships no type information. +- [x] ADR 0005, VISION item 8, the knowledge-base article, `docs/SELF_IMPROVEMENT.md` and the generated command reference. diff --git a/docs/commands/ai.md b/docs/commands/ai.md index 54cb2d28f9..e0a5b01efe 100644 --- a/docs/commands/ai.md +++ b/docs/commands/ai.md @@ -759,6 +759,28 @@ devops ai review benchmark [OPTIONS] | `--no-static-scan` | `boolean` | - | Disable static security scanning. | | `--concurrency`, `-c` | `integer` | - | Max concurrent workers for parallel review and verification. | +### `devops ai review score` + +**Score saved review sessions against a label file: precision, recall and stability, each with its n.** + +```bash +devops ai review score [OPTIONS] +``` + +**Arguments:** + +| Argument | Type | Required | Description | +|---|---|---|---| +| `` | `path` | No | Review session directories to score. | + +**Options:** + +| Option / Flag | Type | Default | Description | +|---|---|---|---| +| `--labels` | `path` | - | Label file: the labelled inputs, the row map of each mapped session and the labels, such as tests/fixtures/review_labels/labels.json. | +| `--materialise-golden` | `path` | - | Write the label file's golden set into this directory as a git repository with one fixed commit, for a path review, and list the defects no tool can express. Takes no sessions. | +| `--json` | `boolean` | - | Output findings or metrics as JSON. | + ### `devops ai review export-feedback` **Append review verdicts to the JSONL feedback dataset, which `devops ai prompt-eval` reads.** @@ -1692,7 +1714,7 @@ devops ai runs reindex [OPTIONS] | Option / Flag | Type | Default | Description | |---|---|---|---| -| `--mechanism`, `-m` | `choice (review-benchmark|sample-validation|corpus-score|gateway-tune|prompt-eval|ai-benchmark|template-sweep)` | - | Only index runs of this mechanism. | +| `--mechanism`, `-m` | `choice (review-benchmark|sample-validation|corpus-score|review-score|gateway-tune|prompt-eval|ai-benchmark|template-sweep)` | - | Only index runs of this mechanism. | ### `devops ai runs connect` @@ -1723,7 +1745,7 @@ devops ai runs list [OPTIONS] | Option / Flag | Type | Default | Description | |---|---|---|---| -| `--mechanism`, `-m` | `choice (review-benchmark|sample-validation|corpus-score|gateway-tune|prompt-eval|ai-benchmark|template-sweep)` | - | Only list runs of this mechanism. | +| `--mechanism`, `-m` | `choice (review-benchmark|sample-validation|corpus-score|review-score|gateway-tune|prompt-eval|ai-benchmark|template-sweep)` | - | Only list runs of this mechanism. | | `--subject-key`, `-s` | `string` | - | Only list runs matching this subject key or prefix. | | `--limit`, `-n` | `integer` | `20` | Maximum number of runs to show. | | `--format`, `-f` | `string` | `table` | Output format: table or json. | @@ -1791,6 +1813,9 @@ devops ai runs check [OPTIONS] | `--max-recall-drop` | `float` | `0.0` | Maximum allowable relative drop in recall (e.g. 0.05 for 5%). | | `--max-duration-increase` | `float` | `0.15` | Maximum allowable relative increase in duration (e.g. 0.15 for 15%). | | `--max-tokens-increase` | `float` | `0.2` | Maximum allowable relative increase in prompt tokens (e.g. 0.20 for 20%). | +| `--max-precision-drop` | `float` | `0.0` | Maximum allowable relative drop in a review score's lenient and strict precision (e.g. 0.05 for 5%). | +| `--max-stability-drop` | `float` | `0.0` | Maximum allowable relative drop in a review score's Jaccard and Fleiss kappa (e.g. 0.05 for 5%). | +| `--max-calls-increase` | `float` | `0.2` | Maximum allowable relative increase in model calls, a review's cost (e.g. 0.20 for 20%). | | `--format`, `-f` | `string` | `table` | Output format: table or json. | ### `devops ai runs baseline` @@ -1845,7 +1870,7 @@ devops ai runs baseline show [OPTIONS] | Option / Flag | Type | Default | Description | |---|---|---|---| -| `--mechanism`, `-m` | `choice (review-benchmark|sample-validation|corpus-score|gateway-tune|prompt-eval|ai-benchmark|template-sweep)` | - | Mechanism for subject lookup. | +| `--mechanism`, `-m` | `choice (review-benchmark|sample-validation|corpus-score|review-score|gateway-tune|prompt-eval|ai-benchmark|template-sweep)` | - | Mechanism for subject lookup. | | `--format`, `-f` | `string` | `table` | Output format: table or json. | --- diff --git a/docs/commands/review.md b/docs/commands/review.md index 8692e3b8f5..0f6c0742ab 100644 --- a/docs/commands/review.md +++ b/docs/commands/review.md @@ -279,6 +279,30 @@ devops review benchmark [OPTIONS] --- +## `devops review score` + +**Score saved review sessions against a label file: precision, recall and stability, each with its n.** + +```bash +devops review score [OPTIONS] +``` + +**Arguments:** + +| Argument | Type | Required | Description | +|---|---|---|---| +| `` | `path` | No | Review session directories to score. | + +**Options:** + +| Option / Flag | Type | Default | Description | +|---|---|---|---| +| `--labels` | `path` | - | Label file: the labelled inputs, the row map of each mapped session and the labels, such as tests/fixtures/review_labels/labels.json. | +| `--materialise-golden` | `path` | - | Write the label file's golden set into this directory as a git repository with one fixed commit, for a path review, and list the defects no tool can express. Takes no sessions. | +| `--json` | `boolean` | - | Output findings or metrics as JSON. | + +--- + ## `devops review export-feedback` **Append review verdicts to the JSONL feedback dataset, which `devops ai prompt-eval` reads.** diff --git a/pyproject.toml b/pyproject.toml index ff6a794621..bb37bccf30 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -63,6 +63,7 @@ dependencies = [ "graphql-core==3.3.0", "markdownify==1.2.3", "beautifulsoup4==4.15.0", + "statsmodels==0.15.0", ] [project.scripts] @@ -128,6 +129,12 @@ enable_error_code = ["ignore-without-code"] module = "pydantic_ai.run" implicit_reexport = true +# statsmodels ships no type information; `devops review score` calls its fleiss_kappa and +# aggregate_raters (#1138). +[[tool.mypy.overrides]] +module = "statsmodels.*" +ignore_missing_imports = true + [tool.pytest.ini_options] asyncio_mode = "auto" testpaths = ["tests"] diff --git a/src/devops_cli/ai/knowledge_base/devops_cli/tasks/rag_context_indexing.md b/src/devops_cli/ai/knowledge_base/devops_cli/tasks/rag_context_indexing.md index da9d3552e9..e7173c3b5c 100644 --- a/src/devops_cli/ai/knowledge_base/devops_cli/tasks/rag_context_indexing.md +++ b/src/devops_cli/ai/knowledge_base/devops_cli/tasks/rag_context_indexing.md @@ -2,7 +2,7 @@ ## 1. Overview & Purpose -Retrieval-Augmented Generation (RAG) in `devops-cli` indexes codebase documentation, architecture decisions, CLI commands, and operational procedures into a local vector database. When executing AI code reviews or natural language queries, relevant semantic chunks are retrieved and injected into prompt context to ground LLM responses in concrete repository facts. +Retrieval-Augmented Generation (RAG) in `devops-cli` indexes codebase documentation, architecture decisions, CLI commands, and operational procedures into a local vector database. A natural language query retrieves the chunks most similar to its text and injects them into the prompt context. A code review asks the index in two places: each page's persona prompt gets up to three chunks retrieved with the page's file path and symbol names, not with what a finding names, and the verifier gets up to two chunks per finding, retrieved with the finding's title and description. Both are marked as untrusted context. A review writes nothing to the index, so it gets only what `devops ai rag index` and `index-kb` put there, and nothing when the index is empty or RAG is off. --- @@ -15,7 +15,8 @@ graph TD C --> D[Vector Index (Qdrant)] D --> E[Semantic Similarity Query cosine distance] E --> F[Top-K Context Chunks] - F --> G[Grounded AI Review / Chat Prompt] + F --> G[Query & Chat Prompt] + F --> H[Review Page & Verifier Prompts: untrusted context] ``` - **Vector Storage**: Connects to a Qdrant server by URL (`qdrant.url`, or the in-cluster `llm/qdrant` service via the Kubernetes API proxy); no embedded mode is used; `.data/rag/` holds only the local index cache. diff --git a/src/devops_cli/ai/review/history.py b/src/devops_cli/ai/review/history.py index 4b65fa6af7..c9273ba673 100644 --- a/src/devops_cli/ai/review/history.py +++ b/src/devops_cli/ai/review/history.py @@ -31,6 +31,7 @@ from devops_cli.ai.review.profile import ReviewProfile from devops_cli.ai.review_schema import ( + CitedCode, assign_category, normalize_finding_status, parse_finding_references, @@ -77,6 +78,10 @@ class HistoryFinding(BaseModel): """ title: str = "" + location: str = "" + severity: str = "" + # The file and line the location cites, repository-relative, as the review read them (#950). + cited_code: CitedCode | None = None category: str | None = None category_raw: str | None = None references: list[str] = Field(default_factory=list) @@ -101,8 +106,8 @@ def _assign_category(self) -> HistoryFinding: return self -class _HistoryPayload(BaseModel): - """The fields of findings.json and candidates.json that history reads.""" +class HistoryPayload(BaseModel): + """The fields of findings.json and candidates.json that history and the review scorer read.""" generated_at: str = "" subject: dict[str, str] = Field(default_factory=dict) @@ -201,7 +206,7 @@ def _count_once_per_subject( def _read_session(session_dir: Path) -> ReviewSessionRecord: """Read a session; an unreadable findings.json leaves it with no findings and no subject.""" - reported = _read_payload(session_dir / CONST_REVIEW_FINDINGS_FILENAME) or _HistoryPayload() + reported = _read_payload(session_dir / CONST_REVIEW_FINDINGS_FILENAME) or HistoryPayload() candidates = _read_payload(session_dir / CONST_REVIEW_CANDIDATES_FILENAME) profile = ReviewProfile.load(session_dir) return ReviewSessionRecord( @@ -214,12 +219,12 @@ def _read_session(session_dir: Path) -> ReviewSessionRecord: ) -def _read_payload(path: Path) -> _HistoryPayload | None: +def _read_payload(path: Path) -> HistoryPayload | None: """The history fields of a session file; None when it is missing or cannot be read.""" if not path.is_file(): return None try: - return _HistoryPayload.model_validate_json(path.read_bytes()) + return HistoryPayload.model_validate_json(path.read_bytes()) except (OSError, ValueError) as exc: logger.debug("Skipping unreadable review session file %s: %s", path, exc) return None diff --git a/src/devops_cli/ai/review/pipeline.py b/src/devops_cli/ai/review/pipeline.py index 9d2c947ce0..60d10bab3d 100644 --- a/src/devops_cli/ai/review/pipeline.py +++ b/src/devops_cli/ai/review/pipeline.py @@ -112,6 +112,8 @@ CONST_REVIEW_CONSOLE_PANEL_SEVERITIES, CONST_REVIEW_CONSOLE_TABLE_SEVERITIES, CONST_REVIEW_GENERATED_FILES, + CONST_REVIEW_PAGES_DIRNAME, + CONST_REVIEW_SARIF_FILENAME, CONST_REVIEW_STATUS_ORDER, CONST_REVIEW_SYMBOL_DELTA_CHANGE_TYPES, CONST_SEVERITY_CRITICAL, @@ -2372,7 +2374,7 @@ def __init__( self.session_dir = _checked_session_dir( session_dir or _get_reviews_base_dir().resolve() / self.session_id ) - self.files_dir = self.session_dir / "files" + self.files_dir = self.session_dir / CONST_REVIEW_PAGES_DIRNAME self.session_dir.mkdir(parents=True, exist_ok=True) self.files_dir.mkdir(parents=True, exist_ok=True) self.llm_client = llm_client or LLMClient() @@ -4907,7 +4909,7 @@ def generate_consolidated_report( logical_locations=loc_tuple, ) ) - write_sarif(sarif_findings, self.session_dir / "findings.sarif") + write_sarif(sarif_findings, self.session_dir / CONST_REVIEW_SARIF_FILENAME) if profiler := active_profiler(): profiler.set_findings( diff --git a/src/devops_cli/ai/run_store.py b/src/devops_cli/ai/run_store.py index 7b27bed73c..ea5986e461 100644 --- a/src/devops_cli/ai/run_store.py +++ b/src/devops_cli/ai/run_store.py @@ -37,6 +37,14 @@ from devops_cli.config.settings import AIConfig INDEX_PREFIX = f"{CONST_CACHE_NAMESPACE_ROOT}:runs" +# The figures a `devops review score` run records that a later run may not let fall, each with +# the `RegressionTolerances` field that bounds its drop (#1138). +_SCORE_DROP_METRICS = { + "precision_lenient": "max_precision_drop", + "precision_strict": "max_precision_drop", + "stability_jaccard": "max_stability_drop", + "stability_kappa": "max_stability_drop", +} class Mechanism(StrEnum): @@ -45,6 +53,7 @@ class Mechanism(StrEnum): REVIEW_BENCHMARK = "review-benchmark" SAMPLE_VALIDATION = "sample-validation" CORPUS_SCORE = "corpus-score" + REVIEW_SCORE = "review-score" GATEWAY_TUNE = "gateway-tune" PROMPT_EVAL = "prompt-eval" AI_BENCHMARK = "ai-benchmark" @@ -539,7 +548,12 @@ def _extract_prompt_tokens(results: dict[str, Any]) -> float | None: stage_sum = _extract_stage_token_sum(stages, "median_prompt_tokens") if stage_sum is not None: return stage_sum - for key in ("prompt_tokens", "total_prompt_tokens", "total_input_tokens"): + for key in ( + "prompt_tokens", + "median_prompt_tokens", + "total_prompt_tokens", + "total_input_tokens", + ): val = results.get(key) if isinstance(val, (int, float)): return float(val) @@ -610,6 +624,8 @@ def _extract_core_metrics(res: dict[str, Any]) -> dict[str, float]: _extract_metric_item(metrics, "recall", _extract_recall(res), 4) calls = res.get("median_llm_calls") or res.get("llm_calls") or res.get("total_calls") _extract_metric_item(metrics, "llm_calls", calls, 1) + for key in _SCORE_DROP_METRICS: + _extract_metric_item(metrics, key, res.get(key), 4) for key in ( "total_sites", "parse_failures", @@ -722,6 +738,11 @@ class RegressionTolerances(BaseModel): max_recall_drop: float = 0.0 max_duration_increase: float = 0.15 max_tokens_increase: float = 0.20 + # `devops review score` runs (#1138): precision and stability may not drop, and the model + # calls a review makes are its cost, since the self-hosted models record no price. + max_precision_drop: float = 0.0 + max_stability_drop: float = 0.0 + max_calls_increase: float = 0.20 class MetricVerdict(BaseModel): @@ -729,7 +750,8 @@ class MetricVerdict(BaseModel): metric: str base_value: float - current_value: float + # None when the current run could not compute a figure the baseline recorded. + current_value: float | None change_pct: float | None tolerance_pct: float passed: bool @@ -745,16 +767,17 @@ class RegressionReport(BaseModel): verdicts: list[MetricVerdict] -def _evaluate_recall_verdict(m: MetricDiff, max_drop: float) -> MetricVerdict: +def _evaluate_drop_verdict(m: MetricDiff, metric_name: str, max_drop: float) -> MetricVerdict: drop = (m.base_value - m.current_value) / m.base_value if m.base_value > 0 else 0.0 passed = drop <= max_drop + label = metric_name.replace("_", " ").capitalize() reason = ( - f"Recall dropped by {drop:.1%}, exceeds tolerance {max_drop:.1%}" + f"{label} dropped by {drop:.1%}, exceeds tolerance {max_drop:.1%}" if not passed - else f"Recall within tolerance ({drop:.1%} <= {max_drop:.1%})" + else f"{label} within tolerance ({drop:.1%} <= {max_drop:.1%})" ) return MetricVerdict( - metric="recall", + metric=metric_name, base_value=m.base_value, current_value=m.current_value, change_pct=m.percent_change, @@ -789,6 +812,49 @@ def _evaluate_increase_verdict( ) +def _not_computable_verdict(m: MetricDiff, max_drop: float, reason: str) -> MetricVerdict: + """A failed verdict on a figure the baseline recorded and the current run could not compute.""" + return MetricVerdict( + metric=m.name, + base_value=m.base_value, + current_value=None, + change_pct=None, + tolerance_pct=round(max_drop * 100, 2), + passed=False, + reason=f"{m.name.replace('_', ' ').capitalize()} not computable ({reason})", + ) + + +def _score_verdicts(comparison: RunComparison, tol: RegressionTolerances) -> list[MetricVerdict]: + """Verdicts on a review score's precision and stability, and on model calls. + + A precision or stability figure either run recorded gets a verdict, and one the baseline + recorded fails when the current run could not compute it, with the score's reason; model + calls are judged when both runs recorded them. `comparison.metrics` reads a figure a run + did not record as 0.0, so which run recorded which figure comes from the runs themselves. + """ + base = extract_metrics(comparison.base_run)[0] + current = extract_metrics(comparison.current_run)[0] + reasons = comparison.current_run.results.get("not_computable") + verdicts = [] + for name, tolerance in _SCORE_DROP_METRICS.items(): + limit: float = getattr(tol, tolerance) + if name in base and name not in current: + reason = reasons.get(name) if isinstance(reasons, dict) else None + verdicts.append( + _not_computable_verdict(comparison.metrics[name], limit, reason or "not recorded") + ) + elif name in current: + verdicts.append(_evaluate_drop_verdict(comparison.metrics[name], name, limit)) + if "llm_calls" in base and "llm_calls" in current: + verdicts.append( + _evaluate_increase_verdict( + comparison.metrics["llm_calls"], "llm_calls", tol.max_calls_increase + ) + ) + return verdicts + + def check_regression( comparison: RunComparison, tolerances: RegressionTolerances | None = None ) -> RegressionReport: @@ -798,7 +864,7 @@ def check_regression( for r_name in ("recall", "recall_found", "recall_reported"): if r_name in comparison.metrics: verdicts.append( - _evaluate_recall_verdict(comparison.metrics[r_name], tol.max_recall_drop) + _evaluate_drop_verdict(comparison.metrics[r_name], "recall", tol.max_recall_drop) ) if "wall_seconds" in comparison.metrics: verdicts.append( @@ -822,6 +888,7 @@ def check_regression( comparison.metrics["comment_collisions"], "comment_collisions", 0.0 ) ) + verdicts.extend(_score_verdicts(comparison, tol)) return RegressionReport( passed=bool(verdicts) and all(v.passed for v in verdicts), base_run_id=comparison.base_run.run_id, diff --git a/src/devops_cli/commands/ai_runs.py b/src/devops_cli/commands/ai_runs.py index 08841b9d24..4b3fbfe2c7 100644 --- a/src/devops_cli/commands/ai_runs.py +++ b/src/devops_cli/commands/ai_runs.py @@ -373,7 +373,7 @@ def _render_regression_report(report: RegressionReport) -> None: [ v.metric, f"{v.base_value:.4g}", - f"{v.current_value:.4g}", + f"{v.current_value:.4g}" if v.current_value is not None else "not computable", change_str, f"{v.tolerance_pct:.1f}%", verdict_str, @@ -630,6 +630,27 @@ def check_cmd( help="Maximum allowable relative increase in prompt tokens (e.g. 0.20 for 20%).", ), ] = 0.20, + max_precision_drop: Annotated[ + float, + typer.Option( + "--max-precision-drop", + help="Maximum allowable relative drop in a review score's lenient and strict precision (e.g. 0.05 for 5%).", + ), + ] = 0.0, + max_stability_drop: Annotated[ + float, + typer.Option( + "--max-stability-drop", + help="Maximum allowable relative drop in a review score's Jaccard and Fleiss kappa (e.g. 0.05 for 5%).", + ), + ] = 0.0, + max_calls_increase: Annotated[ + float, + typer.Option( + "--max-calls-increase", + help="Maximum allowable relative increase in model calls, a review's cost (e.g. 0.20 for 20%).", + ), + ] = 0.20, output_format: Annotated[ str, typer.Option("--format", "-f", help="Output format: table or json."), @@ -654,6 +675,9 @@ def check_cmd( max_recall_drop=max_recall_drop, max_duration_increase=max_duration_increase, max_tokens_increase=max_tokens_increase, + max_precision_drop=max_precision_drop, + max_stability_drop=max_stability_drop, + max_calls_increase=max_calls_increase, ) comparison = compare_runs(base_record, record) report = check_regression(comparison, tolerances) diff --git a/src/devops_cli/commands/review.py b/src/devops_cli/commands/review.py index 68b7e7411c..b2a8085631 100644 --- a/src/devops_cli/commands/review.py +++ b/src/devops_cli/commands/review.py @@ -1,4 +1,4 @@ -"""AI Code Review CLI command group (branch, path, PR, findings, verify, stats).""" +"""AI Code Review CLI command group (branch, path, PR, findings, verify, stats, score).""" from __future__ import annotations @@ -143,6 +143,12 @@ print_warning, write_stdout, ) +from devops_cli.review.score import ( + Agreement, + ScoreReport, + materialise_golden, + score_sessions, +) app = new_typer(help=HELP.review.app, no_args_is_help=True) @@ -1569,6 +1575,214 @@ def benchmark( ) +# ============================================================================= +# Command: devops review score +# ============================================================================= + + +def _agreement_text(agreement: Agreement, unit: str) -> str: + if agreement.value is None: + return f"not computable ({agreement.reason})" + return f"{agreement.value:.3f} (n={agreement.n} {unit})" + + +def _render_score(report: ScoreReport) -> None: + """Show each session's precision and recall, each input's stability, and what is unlabelled.""" + print_section(" Review Score ", style="bold cyan") + sessions = report.sessions + print_table( + title="Precision per Session", + columns=[ + ("Session", "cyan"), + ("Input", ""), + ("Rows", "right"), + ("Lenient", "right"), + ("Strict", "right"), + ("Per Defect", "right"), + ], + rows=[ + [escape_text(s.session), escape_text(s.input), str(s.rows)] + + [str(ratio) for ratio in (s.lenient, s.strict, s.distinct)] + for s in sessions + ], + ) + print_table( + title="VERIFIED, HIGH/CRITICAL and Recall per Session", + columns=[ + ("Session", "cyan"), + ("VERIFIED", "right"), + ("VERIFIED, Strict", "right"), + ("HIGH/CRITICAL", "right"), + ("Recall Set", "right"), + ("Known Defects", "right"), + ], + rows=[ + [escape_text(s.session)] + + [ + str(ratio) + for ratio in (s.verified, s.verified_strict, s.high, s.recall_set, s.known_defects) + ] + for s in sessions + ], + ) + print_table( + title="Precision by Producer", + columns=[ + ("Session", "cyan"), + ("Producer", ""), + ("Rows", "right"), + ("Lenient", "right"), + ("Strict", "right"), + ("Per Defect", "right"), + ], + rows=[ + [escape_text(s.session), escape_text(name), str(p.rows)] + + [str(ratio) for ratio in (p.lenient, p.strict, p.distinct)] + for s in sessions + for name, p in s.by_producer.items() + ], + ) + _render_score_inputs(report) + + +def _render_score_inputs(report: ScoreReport) -> None: + print_table( + title="Inputs: Pooled Precision and Stability", + columns=[ + ("Input", "cyan"), + ("Split", ""), + ("Sessions", "right"), + ("Lenient", "right"), + ("Strict", "right"), + ("Jaccard", "right"), + ("Fleiss κ", "right"), + ], + rows=[ + [ + escape_text(g.input), + g.split or "unlabelled input", + str(g.sessions), + str(g.lenient), + str(g.strict), + _agreement_text(g.jaccard, "pairs"), + _agreement_text(g.kappa, "identities"), + ] + for g in report.groups + ], + ) + if report.recall_set: + print_table( + title="Recall Set", + columns=[("Finding", "cyan"), ("Reported In", "right")], + rows=[ + [escape_text(e.location), f"{e.reported_in}/{e.sessions}"] + for e in report.recall_set + ], + ) + if report.unlabelled: + print_table( + title=f"Unlabelled Rows ({len(report.unlabelled)})", + columns=[ + ("Session", "cyan"), + ("Row", "right"), + ("Location", ""), + ("Producer", ""), + ("Identity", "dim"), + ], + rows=[ + [escape_text(u.session), str(u.row), escape_text(u.location), u.producer] + + [escape_text(u.identity or "")] + for u in report.unlabelled + ], + ) + + +def _materialise_golden( + labels: Path, destination: Path, sessions: list[Path] | None, json_output: bool +) -> None: + if sessions: + print_error(MESSAGES.review.score_golden_takes_no_sessions) + raise typer.Exit(1) + try: + golden = materialise_golden(labels, destination) + except ValidationError as exc: + print_error(exc.message) + raise typer.Exit(1) from exc + if json_output: + write_stdout(golden.model_dump_json(indent=2) + "\n") + return + print_success( + MESSAGES.review.score_golden_written.format( + path=escape_text(golden.path), files=golden.files, commit=golden.commit + ) + ) + print_table( + title="Accepted Recall Loss", + columns=[("Defect", "cyan"), ("Why No Tool Can Express It", "")], + rows=[ + [escape_text(loss.defect_id), escape_text(loss.reason)] for loss in golden.accepted_loss + ], + ) + + +def _score_setup(sessions: Sequence[Path]) -> dict[str, Any]: + """What could change the scored reviews: their prompts, conventions and pinned tools.""" + profiles = [p for p in (ReviewProfile.load(d) for d in sessions) if p is not None] + return { + name: sorted({digest for p in profiles if (digest := getattr(p, name))}) + for name in ("prompt_digest", "conventions_digest", "tools_lock_digest") + } + + +@app.command("score") +def review_score( + labels: Annotated[ + Path, + typer.Option("--labels", metavar="FILE", help=HELP.review.score_labels), + ], + sessions: Annotated[ + list[Path] | None, + typer.Argument(metavar="SESSION...", help=HELP.review.score_sessions), + ] = None, + materialise_golden_dir: Annotated[ + Path | None, + typer.Option( + "--materialise-golden", metavar="DIR", help=HELP.review.score_materialise_golden + ), + ] = None, + json_output: Annotated[ + bool, + typer.Option("--json", help=HELP.options.json_output), + ] = False, +) -> None: + """Score saved review sessions against a label file: precision, recall and stability, each with its n.""" + if materialise_golden_dir is not None: + _materialise_golden(labels, materialise_golden_dir, sessions, json_output) + return + if not sessions: + print_error(MESSAGES.review.score_no_sessions) + raise typer.Exit(1) + try: + report = score_sessions(sessions, labels) + except ValidationError as exc: + print_error(exc.message) + raise typer.Exit(1) from exc + saved = record_run( + Mechanism.REVIEW_SCORE, + setup=_score_setup(sessions), + subject={ + "labels_digest": report.labels_digest, + "inputs": sorted({s.digest for s in report.sessions}), + }, + results={**report.model_dump(mode="json"), **report.run_metrics()}, + ) + if json_output: + write_stdout(report.model_dump_json(indent=2) + "\n") + else: + _render_score(report) + announce_run(saved, to_stderr=json_output) + + # ============================================================================= # Commands: devops review corpus generate | score # ============================================================================= diff --git a/src/devops_cli/config/constants.py b/src/devops_cli/config/constants.py index 11f616616f..7baf8dd6be 100644 --- a/src/devops_cli/config/constants.py +++ b/src/devops_cli/config/constants.py @@ -880,6 +880,23 @@ # Held while `devops review verify` reads and writes a session's files, so verdicts given on one # session at once, as an MCP client's parallel calls give them, wait their turn (#949). CONST_REVIEW_VERDICT_LOCK_FILENAME = ".verify.lock" +# The admitted tool findings of a review session, with their fingerprint_v2 (#871). +CONST_REVIEW_SARIF_FILENAME = "findings.sarif" +# A review session's per-page records: the file each page read and the findings it raised there. +CONST_REVIEW_PAGES_DIRNAME = "files" +# `devops review score` (#1138): the labels a person gives a distinct finding, the two that count +# as valid, the producer of a model's finding, and the severities its HIGH/CRITICAL figure reads. +CONST_REVIEW_LABEL_VALID_STRICT = "valid-strict" +CONST_REVIEW_LABEL_VALID_LENIENT = "valid-lenient" +CONST_REVIEW_LABEL_FALSE = "false" +CONST_REVIEW_LABELS_VALID: Final[frozenset[str]] = frozenset( + {CONST_REVIEW_LABEL_VALID_STRICT, CONST_REVIEW_LABEL_VALID_LENIENT} +) +CONST_REVIEW_PRODUCER_PERSONA = "persona" +CONST_REVIEW_SCORE_HIGH_SEVERITIES: Final[frozenset[str]] = frozenset({"CRITICAL", "HIGH"}) +# A model's finding matches a label of its path and origin page when their lines lie this close, +# the window the loop study clustered persona findings with. +CONST_REVIEW_SCORE_PERSONA_LINE_WINDOW = 5 CONST_REVIEW_GENERATED_FILES = frozenset( { "uv.lock", diff --git a/src/devops_cli/git/operations.py b/src/devops_cli/git/operations.py index 3cd3075340..cb20615583 100755 --- a/src/devops_cli/git/operations.py +++ b/src/devops_cli/git/operations.py @@ -11,12 +11,14 @@ import logging from collections.abc import Generator +from datetime import datetime from pathlib import Path, PurePosixPath import git as gitlib from devops_cli.config.constants import ( CONST_GIT_DIR_NAME, + CONST_GIT_MAIN_BRANCH, CONST_GIT_NAME_STATUS_CHANGE_TYPES, CONST_GIT_NAME_STATUS_TWO_PATH_LETTERS, CONST_GIT_SYMLINK_MODE, @@ -247,6 +249,34 @@ def create_branch(repo_dir: Path, branch_name: str) -> None: ) +def commit_snapshot( + repo_dir: Path, + paths: list[str], + message: str, + *, + author: str, + email: str, + date: datetime, +) -> str: + """Make `repo_dir` a new repository whose one commit holds `paths`, and return its id. + + The author, committer and both dates are the ones given, no hook runs and nothing is signed, + so the same files always give the same commit, whatever the git configuration. + """ + repo = gitlib.Repo.init(str(repo_dir), initial_branch=CONST_GIT_MAIN_BRANCH) + repo.index.add(sorted(paths)) + actor = gitlib.Actor(author, email) + commit = repo.index.commit( + message, + author=actor, + committer=actor, + author_date=date, + commit_date=date, + skip_hooks=True, + ) + return str(commit.hexsha) + + def list_branches( repo_dir: Path, all_branches: bool = False, diff --git a/src/devops_cli/lang/en/help.py b/src/devops_cli/lang/en/help.py index 16dbb67b50..64cee72af7 100644 --- a/src/devops_cli/lang/en/help.py +++ b/src/devops_cli/lang/en/help.py @@ -1121,6 +1121,16 @@ class ReviewCommandHelp: "File(s) or directory(ies) to review on every run; keep them fixed to compare benchmarks." ) benchmark_runs: str = "Number of reviews to run; the report takes medians across them." + score_sessions: str = "Review session directories to score." + score_labels: str = ( + "Label file: the labelled inputs, the row map of each mapped session and the labels, " + "such as tests/fixtures/review_labels/labels.json." + ) + score_materialise_golden: str = ( + "Write the label file's golden set into this directory as a git repository with one " + "fixed commit, for a path review, and list the defects no tool can express. Takes no " + "sessions." + ) corpus: str = "Synthetic defect corpora: inject known defects into clean files and score reviews against them." corpus_generate: str = ( "Copy source files with one known defect injected into each, and record where." diff --git a/src/devops_cli/lang/en/messages.py b/src/devops_cli/lang/en/messages.py index f3e1b6de16..c904a0dbf6 100644 --- a/src/devops_cli/lang/en/messages.py +++ b/src/devops_cli/lang/en/messages.py @@ -69,6 +69,14 @@ class ReviewMessages: ) no_review_dir_found: str = "No review directory found." no_saved_sessions: str = "No saved review sessions found." + score_no_sessions: str = ( + "Name the SESSION directories to score, or write the golden set with --materialise-golden." + ) + score_golden_takes_no_sessions: str = "--materialise-golden takes no SESSION directories." + score_golden_written: str = ( + "Golden set written → [bold]{path}[/bold]: {files} files in commit {commit}. Review it " + "with: devops review path {path}" + ) updated_finding_status: str = "Updated finding #{index} status → {status}" updated_candidate_status: str = "Updated candidate #{index} status → {status}" candidate_moved: str = "Candidate #{index} added to findings.json as finding #{number}" diff --git a/src/devops_cli/review/score.py b/src/devops_cli/review/score.py new file mode 100644 index 0000000000..634218927f --- /dev/null +++ b/src/devops_cli/review/score.py @@ -0,0 +1,918 @@ +"""Score saved review sessions against a label file, offline (#1138). + +A label file names the inputs that were reviewed and labels the distinct findings their reviews +reported. A label holds the finding's identity, its label (valid-strict, valid-lenient, opinion or +false), the defect it is, the severity it should have, a note, its labeller and the date; an input +is either a tuning or a held-out input. Every figure the scorer reports is a ratio with its n, and +a ratio over a row no label covers reads "not computable" until a person labels the row. + +A row's identity is: +- in a session the label file maps row by row, the cluster its row map names; +- otherwise the findings.sarif result at the row's cited file and line: its `fingerprint_v2` + partial fingerprint, else the tool, rule, path and line or object the loop study keyed its + clusters on; results of more than one tool, rule or fingerprint at that place leave the row + without an identity, since only its title, which is never read, tells which one it is; +- otherwise, for a model's row, the one label of the row's path and origin page whose lines lie + within five of the row's. + +Nothing is parsed from a title or a message. A stored absolute path is made relative to the +checkout its input records, a row outside the session's reviewed tree (its `files/` pages) counts +as false without a lookup, and a row raised on a fixture page is no recall. Stability compares the +sessions of one input digest: the mean pairwise Jaccard of the identities they report, and +Fleiss' κ of their statuses over the identities every one of them reported. A session that records +no input digest is compared with no other. +""" + +from __future__ import annotations + +import itertools +import statistics +from collections.abc import Callable, Iterable, Sequence +from dataclasses import dataclass +from datetime import UTC, date, datetime +from pathlib import Path, PurePosixPath +from typing import Any, Literal + +from pydantic import BaseModel, ConfigDict, Field, computed_field, model_validator +from pydantic import ValidationError as PydanticValidationError + +from devops_cli.ai.review.history import HistoryFinding, HistoryPayload +from devops_cli.ai.review.path_classes import is_fixture_path +from devops_cli.ai.review.profile import ReviewProfile +from devops_cli.ai.review_schema import _parse_location +from devops_cli.ai.run_store import digest +from devops_cli.config.constants import ( + CONST_GIT_DIR_NAME, + CONST_REVIEW_FINDINGS_FILENAME, + CONST_REVIEW_LABEL_FALSE, + CONST_REVIEW_LABEL_VALID_STRICT, + CONST_REVIEW_LABELS_VALID, + CONST_REVIEW_PAGES_DIRNAME, + CONST_REVIEW_PRODUCER_PERSONA, + CONST_REVIEW_SARIF_FILENAME, + CONST_REVIEW_SCORE_HIGH_SEVERITIES, + CONST_REVIEW_SCORE_PERSONA_LINE_WINDOW, + CONST_STATUS_VERIFIED, +) +from devops_cli.exceptions.validation import ValidationError +from devops_cli.git.operations import commit_snapshot +from devops_cli.security.normalization import NormalizedFinding, split_location +from devops_cli.security.sarif import SarifError, read_sarif + +LabelValue = Literal["valid-strict", "valid-lenient", "opinion", "false"] +Split = Literal["tuning", "held-out"] +# A row's repository path, first and last cited line, and object. +_Place = tuple[str, int | None, int | None, str | None] +# The golden set's one commit: a fixed author, committer and date and no email address, so the +# same golden files always give the same commit, the one `git commit` makes of them. +GOLDEN_AUTHOR = "devops-cli golden" +GOLDEN_EMAIL = "" +GOLDEN_MESSAGE = "The golden review set's files, for a path review\n" +GOLDEN_DATE = datetime(2026, 10, 3, tzinfo=UTC) + + +class _LabelRecord(BaseModel): + model_config = ConfigDict(extra="forbid", frozen=True) + + +class Identity(_LabelRecord): + """What makes two findings one: its producer, rule and place, and the page that raised it.""" + + key: str + producer: str + rule: str | None = None + path: str + start_line: int | None = None + end_line: int | None = None + # A kube-linter finding's object, such as `DaemonSet/ollama-16gib`. + object: str | None = None + # The page whose review raised it: its own path, or the fixture page it was echoed from. + origin: str + fingerprint_v2: str | None = None + + +class Label(_LabelRecord): + """A person's call on one distinct finding.""" + + identity: Identity + label: LabelValue + defect_id: str + expected_severity: str | None = None + note: str + labeller: str + date: date + + +class AcceptedLoss(_LabelRecord): + """A defect of an input that no tool can express, so missing it is no recall loss to fix.""" + + defect_id: str + reason: str + + +class LabelledInput(_LabelRecord): + """An input reviews ran on: its page digests, its checkout and the sessions mapped by row.""" + + name: str + split: Split + digests: list[str] = Field(default_factory=list) + # The checkout the input's sessions stored absolute paths under. + root: str = "" + # The golden findings file whose `files` this input reviews, relative to the label file. + source: str | None = None + known_defects: list[str] = Field(default_factory=list) + accepted_loss: list[AcceptedLoss] = Field(default_factory=list) + # Session id -> the label key of each findings.json row, in order. + sessions: dict[str, list[str]] = Field(default_factory=dict) + + +class LabelFile(_LabelRecord): + """Labelled inputs and their labels; paths in it are relative to the file.""" + + about: str = "" + recall_set: str | None = None + inputs: list[LabelledInput] + labels: list[Label] + + @model_validator(mode="after") + def _row_maps_name_labels(self) -> LabelFile: + keys = {label.identity.key for label in self.labels} + named = {key for i in self.inputs for rows in i.sessions.values() for key in rows} + if missing := sorted(named - keys): + raise ValueError(f"row maps name keys no label holds: {', '.join(missing[:10])}") + return self + + +def load_label_file(path: Path) -> LabelFile: + """Read a label file, refusing one that does not parse or names a key no label holds.""" + try: + return LabelFile.model_validate_json(path.read_bytes()) + except (OSError, PydanticValidationError) as exc: + raise ValidationError(f"Cannot read label file {path}: {exc}", field="labels") from exc + + +class Ratio(BaseModel): + """A count over its n; `reason` says why it is not computable.""" + + numerator: int = 0 + denominator: int = 0 + reason: str | None = None + + @computed_field # type: ignore[prop-decorator] + @property + def value(self) -> float | None: + """The ratio, or None while it is not computable or has no n.""" + return None if self.reason or not self.denominator else self.numerator / self.denominator + + def __str__(self) -> str: + if self.reason: + return f"not computable ({self.reason})" + if self.value is None: + return "0/0" + return f"{self.numerator}/{self.denominator} ({self.value:.1%})" + + +class Agreement(BaseModel): + """A stability statistic over its n: session pairs for Jaccard, identities for κ.""" + + value: float | None = None + n: int = 0 + reason: str | None = None + + +class ProducerScore(BaseModel): + """Precision of one producer's rows.""" + + rows: int + lenient: Ratio + strict: Ratio + distinct: Ratio + + +class SessionScore(BaseModel): + """One session's figures.""" + + session: str + input: str + digest: str + rows: int + lenient: Ratio + strict: Ratio + distinct: Ratio + verified: Ratio + verified_strict: Ratio + high: Ratio + by_producer: dict[str, ProducerScore] + recall_set: Ratio + known_defects: Ratio + llm_calls: int | None = None + prompt_tokens: int | None = None + wall_seconds: float | None = None + + +class GroupScore(BaseModel): + """The sessions of one input digest, pooled, and how much they agree.""" + + digest: str + input: str + split: Split | None = None + sessions: int + lenient: Ratio + strict: Ratio + jaccard: Agreement + kappa: Agreement + + +class RecallEntry(BaseModel): + """A finding of the recall set and the sessions whose report cites it.""" + + location: str + reported_in: int + sessions: int + + +class UnlabelledRow(BaseModel): + """A row no label covers: a person labels it, and the ratios over it become computable.""" + + session: str + row: int + location: str + producer: str + identity: str | None = None + + +class ScoreReport(BaseModel): + """Every scored session, each input's pooled figures, recall and the rows left to label.""" + + labels_digest: str + sessions: list[SessionScore] + groups: list[GroupScore] + recall_set: list[RecallEntry] + unlabelled: list[UnlabelledRow] + + def run_metrics(self) -> dict[str, Any]: + """The top-level figures `devops ai runs check` compares, and why each other one is not. + + A figure that is not computable is left out, and `not_computable` names it with its + reason, so the check fails a run that cannot compute a figure its baseline recorded. + """ + sessions = self.sessions + gated: dict[str, tuple[float | None, str | None]] = { + "precision_lenient": _figure(_pooled([s.lenient for s in sessions])), + "precision_strict": _figure(_pooled([s.strict for s in sessions])), + "recall": _figure(_pooled([s.known_defects for s in sessions])), + "stability_jaccard": _stability(self.groups, lambda g: g.jaccard), + "stability_kappa": _stability(self.groups, lambda g: g.kappa), + } + medians = { + "median_llm_calls": _median(s.llm_calls for s in sessions), + "median_prompt_tokens": _median(s.prompt_tokens for s in sessions), + "median_wall_seconds": _median(s.wall_seconds for s in sessions), + } + figures = {name: value for name, (value, _) in gated.items()} | medians + return { + **{name: round(value, 4) for name, value in figures.items() if value is not None}, + "not_computable": { + name: reason for name, (value, reason) in gated.items() if value is None + }, + } + + +class GoldenRepository(BaseModel): + """The golden set written out as a repository, and the defects no tool can express.""" + + path: str + commit: str + files: int + accepted_loss: list[AcceptedLoss] + + +class _PageFinding(BaseModel): + location: str = "" + + +class _SessionPage(BaseModel): + file_path: str + findings: list[_PageFinding] = Field(default_factory=list) + + +class _RecallFinding(BaseModel): + path: str + lines: tuple[int, int] + + +class _RecallSet(BaseModel): + findings: list[_RecallFinding] + + +class _GoldenSet(BaseModel): + files: dict[str, str] + + +@dataclass(frozen=True, slots=True) +class _Row: + """A findings.json row as the scorer reads it.""" + + session: str + number: int + location: str + path: str + start: int | None + end: int | None + status: str + severity: str + producer: str + origin: str + in_tree: bool + identity: str | None + label: Label | None + + @property + def verdict(self) -> str | None: + """The row's label; false outside the reviewed tree; None when no label covers it.""" + if not self.in_tree: + return CONST_REVIEW_LABEL_FALSE + return self.label.label if self.label is not None else None + + @property + def defect(self) -> str: + return self.label.defect_id if self.label else (self.identity or self.location) + + @property + def valid(self) -> bool: + return self.verdict in CONST_REVIEW_LABELS_VALID + + @property + def strict(self) -> bool: + return self.verdict == CONST_REVIEW_LABEL_VALID_STRICT + + +@dataclass(frozen=True, slots=True) +class _LabelIndex: + by_key: dict[str, Label] + by_fingerprint: dict[str, Label] + by_tool_key: dict[tuple[str, str | None, str, int | str | None], Label] + persona: dict[tuple[str, str], list[Label]] + + @classmethod + def of(cls, labels: Sequence[Label]) -> _LabelIndex: + persona: dict[tuple[str, str], list[Label]] = {} + for label in labels: + if label.identity.producer == CONST_REVIEW_PRODUCER_PERSONA: + persona.setdefault((label.identity.path, label.identity.origin), []).append(label) + return cls( + by_key={label.identity.key: label for label in labels}, + by_fingerprint={ + label.identity.fingerprint_v2: label + for label in labels + if label.identity.fingerprint_v2 + }, + by_tool_key={_label_tool_key(label.identity): label for label in labels}, + persona=persona, + ) + + +@dataclass(frozen=True, slots=True) +class _Session: + """A saved session's rows and the files around them.""" + + path: Path + digest: str + findings: tuple[HistoryFinding, ...] + tree: frozenset[str] + # Each location a page raised -> that page. + origins: dict[str, str] + # Each place findings.sarif names -> every result there. + sarif: dict[tuple[str, int | str | None], list[NormalizedFinding]] + profile: ReviewProfile | None + + +# ============================================================================= +# Reading +# ============================================================================= + + +def _read_session(session_dir: Path) -> _Session: + """A saved session; one without a readable findings.json, or with a page that does not + parse, is refused rather than scored as a session that reported nothing.""" + try: + record = HistoryPayload.model_validate_json( + (session_dir / CONST_REVIEW_FINDINGS_FILENAME).read_bytes() + ) + pages = [ + _SessionPage.model_validate_json(page.read_bytes()) + for page in sorted((session_dir / CONST_REVIEW_PAGES_DIRNAME).glob("*.json")) + ] + except (OSError, PydanticValidationError) as exc: + raise ValidationError( + f"Cannot read review session {session_dir}: {exc}", field="session" + ) from exc + origins: dict[str, str] = {} + for page in pages: + for finding in page.findings: + origins.setdefault(finding.location, page.file_path) + sarif: dict[tuple[str, int | str | None], list[NormalizedFinding]] = {} + for result in _sarif_results(session_dir): + sarif.setdefault(_result_key(result.path, result.line, result.symbol), []).append(result) + return _Session( + path=session_dir, + digest=record.subject.get("input", ""), + findings=tuple(record.findings), + tree=frozenset(page.file_path for page in pages), + origins=origins, + sarif=sarif, + profile=ReviewProfile.load(session_dir), + ) + + +def _sarif_results(session_dir: Path) -> list[NormalizedFinding]: + sarif = session_dir / CONST_REVIEW_SARIF_FILENAME + if not sarif.is_file(): + return [] + try: + return read_sarif(sarif) + except SarifError as exc: + raise ValidationError(f"{sarif} is not SARIF: {exc}", field="session") from exc + + +def _read_recall_set(label_file: LabelFile, labels_path: Path) -> list[_RecallFinding]: + if label_file.recall_set is None: + return [] + source = labels_path.parent / label_file.recall_set + try: + return _RecallSet.model_validate_json(source.read_bytes()).findings + except (OSError, PydanticValidationError) as exc: + raise ValidationError(f"Cannot read recall set {source}: {exc}", field="labels") from exc + + +# ============================================================================= +# Identity +# ============================================================================= + + +def _result_key(path: str, line: int | None, obj: str | None) -> tuple[str, int | str | None]: + return path, line if line is not None else obj + + +def _label_tool_key(identity: Identity) -> tuple[str, str | None, str, int | str | None]: + return (identity.producer, identity.rule, identity.path, identity.object or identity.start_line) + + +def _relative(path: str, root: str) -> str: + """A stored absolute path under the input's checkout, as a repository path.""" + pure = PurePosixPath(path) + if root and pure.is_absolute() and pure.is_relative_to(root): + return pure.relative_to(root).as_posix() + return path + + +def _place(finding: HistoryFinding, root: str) -> _Place: + """The repository path, first and last line, and object a row's location cites.""" + path, start, end = _parse_location(finding.location) + obj = None + if start is None: + path, _, obj = split_location(finding.location) + if finding.cited_code is not None: + return finding.cited_code.file, start or finding.cited_code.line, end, obj + return _relative(path, root), start, end, obj + + +def _within_window(label: Label, start: int | None, end: int | None) -> bool: + first = label.identity.start_line + if start is None or first is None: + return False + last = label.identity.end_line or first + gap = max(first - (end or start), start - last, 0) + return gap <= CONST_REVIEW_SCORE_PERSONA_LINE_WINDOW + + +def _persona_label( + index: _LabelIndex, path: str, origin: str, start: int | None, end: int | None +) -> Label | None: + """The one persona label near the row; none when no label, or more than one, is near.""" + near = [lab for lab in index.persona.get((path, origin), []) if _within_window(lab, start, end)] + return near[0] if len(near) == 1 else None + + +def _tool_label( + index: _LabelIndex, results: Sequence[NormalizedFinding] +) -> tuple[str | None, Label | None]: + """A tool row's identity and label: by fingerprint, else by the loop's cluster key. + + The results at the row's place that differ in tool, rule or fingerprint leave it with + neither, as two persona labels near a model's row do; identical duplicates are one result. + """ + kinds = {(r.tool, r.rule_id, r.partial_fingerprints.get("fingerprint_v2")) for r in results} + if len(kinds) > 1: + return None, None + result = results[0] + fingerprint = result.partial_fingerprints.get("fingerprint_v2") + label = index.by_fingerprint.get(fingerprint or "") or index.by_tool_key.get( + (result.tool, result.rule_id, result.path, result.symbol or result.line) + ) + return (label.identity.key if label else fingerprint), label + + +def _row( + session: _Session, + number: int, + finding: HistoryFinding, + place: tuple[str, int | None, int | None], + found: tuple[str, str | None, Label | None, str], +) -> _Row: + """A row; one outside the reviewed tree keeps its identity but matches no label.""" + path, start, end = place + producer, identity, label, origin = found + in_tree = path in session.tree + return _Row( + session=session.path.name, + number=number, + location=finding.location, + path=path, + start=start, + end=end, + status=finding.status, + severity=finding.severity.upper(), + producer=producer, + origin=origin, + in_tree=in_tree, + identity=identity, + label=label if in_tree else None, + ) + + +def _mapped_rows(session: _Session, keys: list[str], index: _LabelIndex, root: str) -> list[_Row]: + """Rows of a session the label file maps row by row: each row's cluster is its identity.""" + if len(keys) != len(session.findings): + raise ValidationError( + f"Session {session.path.name} holds {len(session.findings)} findings.json rows, but " + f"its row map names {len(keys)} rows.", + field="labels", + ) + rows = [] + for number, (finding, key) in enumerate(zip(session.findings, keys, strict=True), start=1): + label = index.by_key[key] + path, start, end, _ = _place(finding, root) + found = (label.identity.producer, key, label, label.identity.origin) + rows.append(_row(session, number, finding, (path, start, end), found)) + return rows + + +def _found( + session: _Session, index: _LabelIndex, finding: HistoryFinding, place: _Place +) -> tuple[str, str | None, Label | None, str]: + """A new session's row: its producer, identity, label and origin page.""" + path, start, end, obj = place + origin = session.origins.get(finding.location, path) + results = session.sarif.get(_result_key(path, start, obj)) + if results: + identity, label = _tool_label(index, results) + return "+".join(sorted({r.tool for r in results})), identity, label, origin + label = _persona_label(index, path, origin, start, end) + return CONST_REVIEW_PRODUCER_PERSONA, label.identity.key if label else None, label, origin + + +def _new_rows(session: _Session, index: _LabelIndex, root: str) -> list[_Row]: + """Rows of any other session: identity from findings.sarif, else the persona window.""" + rows = [] + for number, finding in enumerate(session.findings, start=1): + place = _place(finding, root) + found = _found(session, index, finding, place) + rows.append(_row(session, number, finding, place[:3], found)) + return rows + + +# ============================================================================= +# Figures +# ============================================================================= + + +def _ratio(rows: Sequence[_Row], counts: Callable[[_Row], bool]) -> Ratio: + """How many rows count, over the rows; not computable while a row has no label.""" + unlabelled = sum(row.verdict is None for row in rows) + counted = sum(counts(row) for row in rows if row.verdict is not None) + reason = f"{unlabelled} of {len(rows)} rows unlabelled" if unlabelled else None + return Ratio(numerator=counted, denominator=len(rows), reason=reason) + + +def _pooled(ratios: Sequence[Ratio]) -> Ratio: + reasons = [r.reason for r in ratios if r.reason] + return Ratio( + numerator=sum(r.numerator for r in ratios), + denominator=sum(r.denominator for r in ratios), + reason=f"{len(reasons)} of {len(ratios)} sessions not computable" if reasons else None, + ) + + +def _distinct(rows: Sequence[_Row]) -> Ratio: + """Valid distinct defects over the distinct defects the rows report.""" + base = _ratio(rows, lambda row: row.valid) + defects = {row.defect for row in rows} + valid = {row.defect for row in rows if row.valid} + return Ratio(numerator=len(valid), denominator=len(defects), reason=base.reason) + + +def _known_defects(rows: Sequence[_Row], known: Sequence[str]) -> Ratio: + """The input's known defects a row reports from the defect's own page, not a fixture echo.""" + if not known: + return Ratio(reason="the input lists no known defects") + base = _ratio(rows, lambda row: row.valid) + found = {row.defect for row in rows if row.valid and not is_fixture_path(row.origin)} + return Ratio(numerator=len(found & set(known)), denominator=len(known), reason=base.reason) + + +def _cites(row: _Row, entry: _RecallFinding) -> bool: + """A row in the reviewed tree, raised on its own page, citing a line of the entry's range.""" + first, last = entry.lines + return ( + row.in_tree + and row.path == entry.path + and row.start is not None + and row.start <= last + and (row.end or row.start) >= first + and not is_fixture_path(row.origin) + ) + + +def _recall_hits(rows: Sequence[_Row], entries: Sequence[_RecallFinding]) -> list[bool]: + return [any(_cites(row, entry) for row in rows) for entry in entries] + + +def _by_producer(rows: Sequence[_Row]) -> dict[str, ProducerScore]: + producers = sorted({row.producer for row in rows}) + return { + name: ProducerScore( + rows=len(mine := [row for row in rows if row.producer == name]), + lenient=_ratio(mine, lambda row: row.valid), + strict=_ratio(mine, lambda row: row.strict), + distinct=_distinct(mine), + ) + for name in producers + } + + +def _session_score( + session: _Session, + rows: Sequence[_Row], + labelled: LabelledInput | None, + entries: Sequence[_RecallFinding], +) -> SessionScore: + verified = [row for row in rows if row.status == CONST_STATUS_VERIFIED] + high = [row for row in rows if row.severity in CONST_REVIEW_SCORE_HIGH_SEVERITIES] + hits = _recall_hits(rows, entries) + profile = session.profile + return SessionScore( + session=session.path.name, + input=labelled.name if labelled else session.digest, + digest=session.digest, + rows=len(rows), + lenient=_ratio(rows, lambda row: row.valid), + strict=_ratio(rows, lambda row: row.strict), + distinct=_distinct(rows), + verified=_ratio(verified, lambda row: row.valid), + verified_strict=_ratio(verified, lambda row: row.strict), + high=_ratio(high, lambda row: row.valid), + by_producer=_by_producer(rows), + recall_set=Ratio(numerator=sum(hits), denominator=len(hits)), + known_defects=_known_defects(rows, labelled.known_defects if labelled else ()), + llm_calls=profile.llm_calls if profile else None, + prompt_tokens=profile.prompt_tokens if profile else None, + wall_seconds=profile.total_wall_seconds if profile else None, + ) + + +def _jaccard(identities: Sequence[set[str]], missing: int) -> Agreement: + if len(identities) < 2: + return Agreement(reason="one session") + if missing: + return Agreement(reason=f"{missing} rows have no identity") + pairs = list(itertools.combinations(identities, 2)) + values = [len(a & b) / len(a | b) if a | b else 1.0 for a, b in pairs] + return Agreement(value=statistics.fmean(values), n=len(pairs)) + + +def _kappa(statuses: Sequence[dict[str, str]], missing: int) -> Agreement: + """Fleiss' κ of the sessions' statuses over the identities every session reported. + + statsmodels' `fleiss_kappa` needs as many ratings for every subject, so an identity some + session did not report is left out rather than rated as absent. + """ + if len(statuses) < 2: + return Agreement(reason="one session") + if missing: + return Agreement(reason=f"{missing} rows have no identity") + common = sorted(set.intersection(*(set(s) for s in statuses))) + ratings = [[session[identity] for session in statuses] for identity in common] + categories = {rating for subject in ratings for rating in subject} + if not common: + return Agreement(reason="no identity every session reported") + if len(categories) < 2: + return Agreement(n=len(common), reason=f"every rating is {categories.pop()}") + from statsmodels.stats.inter_rater import aggregate_raters, fleiss_kappa + + table, _ = aggregate_raters(ratings) + return Agreement(value=float(fleiss_kappa(table, method="fleiss")), n=len(common)) + + +def _group_score( + group_digest: str, + scored: Sequence[tuple[SessionScore, list[_Row]]], + labelled: LabelledInput | None, +) -> GroupScore: + sessions = [rows for _, rows in scored] + missing = sum(row.identity is None for rows in sessions for row in rows) + if group_digest: + jaccard = _jaccard([{row.identity or "" for row in rows} for rows in sessions], missing) + kappa = _kappa([_first_status(rows) for rows in sessions], missing) + else: + jaccard = kappa = Agreement(reason="the session records no input digest") + return GroupScore( + digest=group_digest, + input=labelled.name if labelled else (group_digest or scored[0][0].session), + split=labelled.split if labelled else None, + sessions=len(scored), + lenient=_pooled([score.lenient for score, _ in scored]), + strict=_pooled([score.strict for score, _ in scored]), + jaccard=jaccard, + kappa=kappa, + ) + + +def _first_status(rows: Sequence[_Row]) -> dict[str, str]: + statuses: dict[str, str] = {} + for row in rows: + statuses.setdefault(row.identity or "", row.status) + return statuses + + +def _figure(ratio: Ratio) -> tuple[float | None, str | None]: + """A pooled ratio as a run figure, or why it is not computable.""" + if ratio.value is None: + return None, ratio.reason or "no rows" + return ratio.value, None + + +def _stability( + groups: Sequence[GroupScore], statistic: Callable[[GroupScore], Agreement] +) -> tuple[float | None, str | None]: + """The mean of a statistic over the inputs with two or more sessions, while each has it.""" + compared = [g for g in groups if g.sessions > 1] + if not compared: + return None, "no input has two sessions" + values = [] + for group in compared: + agreement = statistic(group) + if agreement.value is None: + return None, f"input {group.input}: {agreement.reason}" + values.append(agreement.value) + return statistics.fmean(values), None + + +def _median(values: Iterable[float | None]) -> float | None: + present = [v for v in values if v is not None] + return float(statistics.median(present)) if present else None + + +# ============================================================================= +# Scoring +# ============================================================================= + + +def _input_of(label_file: LabelFile, session: _Session) -> LabelledInput | None: + """The input a session belongs to: the one mapping it by row, else the one of its digest.""" + mapped = next((i for i in label_file.inputs if session.path.name in i.sessions), None) + if mapped is not None and session.digest not in mapped.digests: + raise ValidationError( + f"Session {session.path.name} reviewed input {session.digest or 'unrecorded'}, " + f"not input {mapped.name}, whose row map names it.", + field="labels", + ) + return mapped or next((i for i in label_file.inputs if session.digest in i.digests), None) + + +def score_sessions(session_dirs: Sequence[Path], labels_path: Path) -> ScoreReport: + """Score saved review sessions against a label file; no model, network or scanner runs.""" + label_file = load_label_file(labels_path) + index = _LabelIndex.of(label_file.labels) + entries = _read_recall_set(label_file, labels_path) + scored: list[tuple[SessionScore, list[_Row], LabelledInput | None]] = [] + for session_dir in session_dirs: + session = _read_session(session_dir) + labelled = _input_of(label_file, session) + root = labelled.root if labelled else "" + keys = labelled.sessions.get(session.path.name) if labelled else None + rows = ( + _mapped_rows(session, keys, index, root) + if keys is not None + else _new_rows(session, index, root) + ) + scored.append((_session_score(session, rows, labelled, entries), rows, labelled)) + return _report(label_file, scored, entries) + + +def _report( + label_file: LabelFile, + scored: Sequence[tuple[SessionScore, list[_Row], LabelledInput | None]], + entries: Sequence[_RecallFinding], +) -> ScoreReport: + groups: dict[tuple[str, str], list[tuple[SessionScore, list[_Row], LabelledInput | None]]] = {} + for score, rows, labelled in scored: + # Sessions group by input digest; a session that records none is a group of its own. + key = (score.digest, "" if score.digest else score.session) + groups.setdefault(key, []).append((score, rows, labelled)) + hits = [_recall_hits(rows, entries) for _, rows, _ in scored] + return ScoreReport( + labels_digest=digest(label_file.model_dump(mode="json")), + sessions=[score for score, _, _ in scored], + groups=[ + _group_score(group, [(score, rows) for score, rows, _ in items], items[0][2]) + for (group, _), items in groups.items() + ], + recall_set=[ + RecallEntry( + location=f"{entry.path}:{entry.lines[0]}-{entry.lines[1]}", + reported_in=sum(session[i] for session in hits), + sessions=len(hits), + ) + for i, entry in enumerate(entries) + ], + unlabelled=[ + UnlabelledRow( + session=row.session, + row=row.number, + location=row.location, + producer=row.producer, + identity=row.identity, + ) + for _, rows, _ in scored + for row in rows + if row.verdict is None + ], + ) + + +# ============================================================================= +# The golden set +# ============================================================================= + + +def materialise_golden(labels_path: Path, destination: Path) -> GoldenRepository: + """Write the golden input's files into a new repository with one fixed commit.""" + label_file = load_label_file(labels_path) + golden = next((i for i in label_file.inputs if i.source), None) + if golden is None or golden.source is None: + raise ValidationError(f"{labels_path} names no golden input source.", field="labels") + if destination.exists() and not destination.is_dir(): + raise ValidationError(f"{destination} is not a directory.", field="materialise_golden") + if destination.exists() and any(destination.iterdir()): + raise ValidationError(f"{destination} is not empty.", field="materialise_golden") + source = labels_path.parent / golden.source + try: + files = _GoldenSet.model_validate_json(source.read_bytes()).files + except (OSError, PydanticValidationError) as exc: + raise ValidationError(f"Cannot read golden set {source}: {exc}", field="labels") from exc + root = destination.resolve() + targets = {rel_path: (root / rel_path).resolve() for rel_path in files} + for rel_path, target in targets.items(): + if not target.is_relative_to(root): + raise ValidationError(f"Golden file {rel_path} lies outside {root}.", field="labels") + if CONST_GIT_DIR_NAME in target.relative_to(root).parts: + raise ValidationError( + f"Golden file {rel_path} lies in the repository's {CONST_GIT_DIR_NAME} directory.", + field="labels", + ) + for rel_path, target in targets.items(): + target.parent.mkdir(parents=True, exist_ok=True) + target.write_text(files[rel_path], encoding="utf-8") + commit = commit_snapshot( + root, + list(files), + GOLDEN_MESSAGE, + author=GOLDEN_AUTHOR, + email=GOLDEN_EMAIL, + date=GOLDEN_DATE, + ) + return GoldenRepository( + path=str(root), commit=commit, files=len(files), accepted_loss=golden.accepted_loss + ) + + +__all__ = [ + "AcceptedLoss", + "Agreement", + "GoldenRepository", + "GroupScore", + "Identity", + "Label", + "LabelFile", + "LabelledInput", + "ProducerScore", + "Ratio", + "RecallEntry", + "ScoreReport", + "SessionScore", + "UnlabelledRow", + "load_label_file", + "materialise_golden", + "score_sessions", +] diff --git a/tests/fixtures/review_labels/labels.json b/tests/fixtures/review_labels/labels.json new file mode 100644 index 0000000000..88d3394317 --- /dev/null +++ b/tests/fixtures/review_labels/labels.json @@ -0,0 +1,3342 @@ +{ + "about": "Seed labels for `devops review score` (#1138): the loop study's clusters of S11 (20261003-060647) and S12-S21 (20261003-065531 to -115921), one cluster per findings.json row, labelled valid-strict, valid-lenient, opinion or false. Transcribed from the study's clusters.json, cluster_overrides.json and precision report; the owner reviews them.", + "recall_set": "../review_recall/recall_set.json", + "inputs": [ + { + "name": "s11", + "split": "tuning", + "digests": [ + "197b2f088fcf1557" + ], + "root": "/workspaces/devops-cli", + "known_defects": [ + "no-read-only-root-fs@k8s/llm/profiles/ollama-profiles.yaml", + "C092", + "C094", + "C096", + "C012", + "C039", + "C236", + "C237", + "C243" + ], + "sessions": { + "20261003-060647": ["C005", "C012", "C239", "C240", "C245", "C249", "C185", "C115", "C237", "C244", "C266", "C267", "C268", "C269", "C270", "C271", "C272", "C273", "C274", "C275", "C276", "C281", "C283", "C284", "C285", "C286", "C287", "C288", "C289", "C290", "C291", "C292", "C293", "C294", "C295", "C071", "C236", "C241", "C246", "C019", "C084", "C144", "C145", "C146", "C147", "C148", "C156", "C157", "C193", "C209", "C218"] + } + }, + { + "name": "loop", + "split": "tuning", + "digests": [ + "3d555ac817ab1d60" + ], + "root": "/workspaces/devops-cli", + "known_defects": [ + "no-read-only-root-fs@k8s/llm/profiles/ollama-profiles.yaml", + "C092", + "C094", + "C096", + "C012", + "C039", + "C236", + "C237", + "C243" + ], + "sessions": { + "20261003-065531": ["C005", "C019", "C115", "C092", "C094", "C096", "C112", "C142", "C256", "C095", "C024", "C031", "C276", "C278", "C281", "C283", "C284", "C285", "C286", "C287", "C288", "C289", "C290", "C291", "C292", "C293", "C294", "C295", "C026", "C042", "C044", "C117", "C266", "C268", "C269", "C270", "C271", "C274", "C275", "C041", "C108", "C149", "C150", "C156", "C173", "C174", "C176"], + "20261003-073236": ["C005", "C107", "C115", "C007", "C010", "C019", "C051", "C139", "C256", "C009", "C012", "C024", "C125", "C276", "C278", "C281", "C282", "C283", "C284", "C285", "C286", "C287", "C288", "C289", "C290", "C291", "C292", "C293", "C294", "C295", "C014", "C029", "C057", "C059", "C108", "C113", "C116", "C131", "C266", "C021", "C156", "C173", "C179", "C212", "C213", "C053"], + "20261003-080659": ["C005", "C024", "C092", "C094", "C108", "C115", "C026", "C096", "C128", "C256", "C185", "C225", "C235", "C036", "C071", "C118", "C276", "C278", "C281", "C282", "C283", "C284", "C285", "C286", "C287", "C288", "C289", "C290", "C291", "C294", "C065", "C066", "C067", "C068", "C069", "C070", "C119", "C120", "C121", "C127", "C266", "C268", "C269", "C270", "C271", "C275", "C122", "C123", "C149", "C150", "C187", "C190", "C191", "C193", "C227"], + "20261003-084218": ["C005", "C012", "C115", "C019", "C021", "C034", "C092", "C094", "C095", "C096", "C117", "C256", "C098", "C037", "C276", "C281", "C283", "C284", "C285", "C286", "C287", "C288", "C289", "C290", "C291", "C292", "C293", "C294", "C295", "C015", "C266", "C268", "C269", "C270", "C271", "C274", "C275", "C156", "C222", "C225", "C230", "C231", "C233"], + "20261003-091619": ["C005", "C019", "C117", "C256", "C185", "C037", "C143", "C266", "C276", "C281", "C283", "C284", "C285", "C286", "C287", "C288", "C289", "C290", "C291", "C292", "C293", "C294", "C295", "C020", "C040", "C052", "C058", "C059", "C084", "C086", "C088", "C089", "C109", "C110", "C114", "C268", "C269", "C270", "C271", "C272", "C273", "C274", "C275", "C023", "C042", "C144", "C146", "C147", "C156"], + "20261003-095001": ["C005", "C019", "C141", "C142", "C020", "C025", "C027", "C037", "C256", "C023", "C206", "C208", "C210", "C276", "C281", "C283", "C284", "C285", "C286", "C287", "C288", "C289", "C290", "C291", "C292", "C293", "C294", "C295", "C022", "C061", "C101", "C103", "C124", "C266", "C268", "C269", "C270", "C275", "C122", "C150", "C173", "C233"], + "20261003-102523": ["C005", "C012", "C109", "C110", "C256", "C036", "C091", "C093", "C276", "C281", "C283", "C284", "C285", "C286", "C287", "C288", "C289", "C290", "C291", "C292", "C293", "C294", "C295", "C117", "C266", "C156", "C187", "C189"], + "20261003-105505": ["C005", "C025", "C035", "C037", "C092", "C094", "C096", "C256", "C276", "C278", "C281", "C283", "C284", "C285", "C286", "C287", "C288", "C289", "C290", "C291", "C294", "C062", "C061", "C095", "C102", "C104", "C106", "C266", "C268", "C269", "C270", "C271", "C275", "C156", "C173", "C216", "C227"], + "20261003-112847": ["C005", "C023", "C024", "C019", "C021", "C026", "C038", "C256", "C054", "C059", "C039", "C091", "C093", "C276", "C278", "C281", "C282", "C283", "C284", "C285", "C286", "C287", "C288", "C289", "C290", "C291", "C292", "C293", "C294", "C295", "C057", "C266", "C268", "C269", "C270", "C271", "C272", "C273", "C274", "C275", "C049", "C050", "C149", "C150", "C156"], + "20261003-115921": ["C005", "C013", "C092", "C094", "C096", "C256", "C156", "C227", "C012", "C115", "C276", "C278", "C281", "C283", "C284", "C285", "C286", "C287", "C288", "C289", "C290", "C291", "C292", "C293", "C294", "C295", "C017", "C018", "C026", "C042", "C046", "C266", "C268", "C269", "C270", "C271", "C272", "C274", "C275", "C011", "C095", "C157", "C173", "C177", "C182", "C184", "C187", "C196", "C228"] + } + }, + { + "name": "golden", + "split": "held-out", + "digests": [], + "source": "../../golden/review_findings.json", + "known_defects": [ + "world-writable-dir", + "playbook-0777", + "unpinned-image", + "dropped-await", + "fstring-sql", + "bare-except", + "masked-live-key", + "real-secret-in-tests", + "unbound-local", + "real-nameerror", + "token-logged", + "shell-injection" + ], + "accepted_loss": [ + { + "defect_id": "missing-containment", + "reason": "no rule checks that a resolve() is followed by a containment check" + }, + { + "defect_id": "missing-depth-limit", + "reason": "the defect is a project constant never enforced; no rule knows what the constant bounds" + }, + { + "defect_id": "unchecked-status", + "reason": "no rule requires a status check before a response body is parsed" + }, + { + "defect_id": "unvalidated-dest", + "reason": "no rule requires a containment check on a path read from the environment" + }, + { + "defect_id": "processed-timestamps", + "reason": "a naive against aware comparison of values typed only at runtime" + }, + { + "defect_id": "if-none-of", + "reason": "authorization logic: the loop's fall-through return" + }, + { + "defect_id": "not-properly", + "reason": "rate-limiter logic: the function allows every request" + }, + { + "defect_id": "api-need-to", + "reason": "an API design choice: the token arrives in the query string" + }, + { + "defect_id": "cwe400-upload", + "reason": "no rule bounds a read_text() of a caller-supplied path" + }, + { + "defect_id": "missing-auth-header", + "reason": "no rule knows which requests need an Authorization header" + }, + { + "defect_id": "miscounted-line", + "reason": "the location is past the end of app/short.py, so admission rejects it by design" + }, + { + "defect_id": "persona-self-dismissal", + "reason": "the same print as token-logged; a tool reports the construct once" + } + ] + } + ], + "labels": [ + { + "identity": { + "key": "C005", + "producer": "persona", + "rule": null, + "path": "app/shell.py", + "start_line": 4, + "end_line": 4, + "object": null, + "origin": "tests/golden/review_findings.json", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C005", + "expected_severity": null, + "note": "D13: app/shell.py is not in the tree; the finding is the golden shell-injection entry", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C007", + "producer": "persona", + "rule": null, + "path": "k8s/llm/profiles/ollama-profiles.yaml", + "start_line": 350, + "end_line": 350, + "object": null, + "origin": "k8s/llm/profiles/ollama-profiles.yaml", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C007", + "expected_severity": null, + "note": "the observed pascal/maxwell/kepler is not at :351, which reads ampere-hopper", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C009", + "producer": "persona", + "rule": null, + "path": "k8s/llm/profiles/ollama-profiles.yaml", + "start_line": 359, + "end_line": 359, + "object": null, + "origin": "k8s/llm/profiles/ollama-profiles.yaml", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C009", + "expected_severity": null, + "note": "OLLAMA_HOST 0.0.0.0 is required for the Service and the probes", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C010", + "producer": "persona", + "rule": null, + "path": "k8s/llm/profiles/ollama-profiles.yaml", + "start_line": 412, + "end_line": 412, + "object": null, + "origin": "k8s/llm/profiles/ollama-profiles.yaml", + "fingerprint_v2": null + }, + "label": "opinion", + "defect_id": "C010", + "expected_severity": null, + "note": "hostPath DirectoryOrCreate", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C011", + "producer": "persona", + "rule": null, + "path": "k8s/otel/networkpolicy.yaml", + "start_line": 9, + "end_line": 9, + "object": null, + "origin": "k8s/otel/networkpolicy.yaml", + "fingerprint_v2": null + }, + "label": "opinion", + "defect_id": "C011", + "expected_severity": null, + "note": "podSelector {} within the namespace", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C012", + "producer": "persona", + "rule": null, + "path": "k8s/otel/networkpolicy.yaml", + "start_line": 30, + "end_line": 32, + "object": null, + "origin": "k8s/otel/networkpolicy.yaml", + "fingerprint_v2": null + }, + "label": "valid-lenient", + "defect_id": "C012", + "expected_severity": "MEDIUM", + "note": "otel NetworkPolicy ipBlock 0.0.0.0/0 on 16686 (:31-32); MEDIUM, not HIGH", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C013", + "producer": "persona", + "rule": null, + "path": "k8s/otel/networkpolicy.yaml", + "start_line": 37, + "end_line": 37, + "object": null, + "origin": "k8s/otel/networkpolicy.yaml", + "fingerprint_v2": null + }, + "label": "opinion", + "defect_id": "C013", + "expected_severity": null, + "note": "OTLP ingress from all namespaces; the comment documents it as the design", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C014", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/client/unified.py", + "start_line": 80, + "end_line": 80, + "object": null, + "origin": "src/devops_cli/ai/client/unified.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C014", + "expected_severity": null, + "note": "urlsplit for span attributes only", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C015", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/gateway.py", + "start_line": 195, + "end_line": 195, + "object": null, + "origin": "src/devops_cli/ai/gateway.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C015", + "expected_severity": null, + "note": "S11 verification lens section 6: all 22 deterministic INVALIDATED checked, 21 right outcome (the wrong one is config.py:514) (re-read at e3ff98c)", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C017", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/library/drift_auditor.py", + "start_line": 86, + "end_line": 86, + "object": null, + "origin": "src/devops_cli/ai/library/drift_auditor.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C017", + "expected_severity": null, + "note": "unlink-before-write is deliberate (docstring :82-83)", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C018", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/library/drift_auditor.py", + "start_line": 332, + "end_line": 332, + "object": null, + "origin": "src/devops_cli/ai/library/drift_auditor.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C018", + "expected_severity": null, + "note": "save_error is the documented contract", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C019", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/mcp/server.py", + "start_line": 201, + "end_line": 201, + "object": null, + "origin": "src/devops_cli/ai/mcp/server.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C019", + "expected_severity": null, + "note": "min_val=1 is the documented 1-based index", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C020", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/mcp/server.py", + "start_line": 219, + "end_line": 219, + "object": null, + "origin": "src/devops_cli/ai/mcp/server.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C020", + "expected_severity": null, + "note": "S11 verification lens section 6: 'LLM, all 31 checked, 31 have the right outcome' ('all false or opinion'); the synthesis says about 10 of the 31 were spot-checked (re-read at e3ff98c)", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C021", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/mcp/server.py", + "start_line": 1146, + "end_line": 1149, + "object": null, + "origin": "src/devops_cli/ai/mcp/server.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C021", + "expected_severity": null, + "note": "S11 verification lens section 6: 'LLM, all 31 checked, 31 have the right outcome' ('all false or opinion'); the synthesis says about 10 of the 31 were spot-checked (re-read at e3ff98c)", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C022", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/mcp/server.py", + "start_line": 1146, + "end_line": 1146, + "object": null, + "origin": "src/devops_cli/ai/mcp/server.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C022", + "expected_severity": null, + "note": "argv list, and trace_id is validated", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C023", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/mcp/server.py", + "start_line": 1353, + "end_line": 1353, + "object": null, + "origin": "src/devops_cli/ai/mcp/server.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C023", + "expected_severity": null, + "note": "the `--` separator is correct", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C024", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/rag/embeddings.py", + "start_line": 196, + "end_line": 196, + "object": null, + "origin": "src/devops_cli/ai/rag/embeddings.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C024", + "expected_severity": null, + "note": "an empty list from _parsed_vectors raises EmbeddingsError at :214, so nothing is silent", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C025", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/rag/embeddings.py", + "start_line": 196, + "end_line": 196, + "object": null, + "origin": "src/devops_cli/ai/rag/embeddings.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C025", + "expected_severity": null, + "note": "PEP 758 unparenthesized except is valid", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C026", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/rag/embeddings.py", + "start_line": 206, + "end_line": 206, + "object": null, + "origin": "src/devops_cli/ai/rag/embeddings.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C026", + "expected_severity": null, + "note": "the bounded reply excerpt is intended", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C027", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/rag/embeddings.py", + "start_line": 206, + "end_line": 206, + "object": null, + "origin": "src/devops_cli/ai/rag/embeddings.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C027", + "expected_severity": null, + "note": "the bounded reply excerpt is intended", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C029", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/rag/embeddings.py", + "start_line": 703, + "end_line": 703, + "object": null, + "origin": "src/devops_cli/ai/rag/embeddings.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C029", + "expected_severity": null, + "note": "the backoff re-raise is correct", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C031", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/rag/embeddings.py", + "start_line": 738, + "end_line": 738, + "object": null, + "origin": "src/devops_cli/ai/rag/embeddings.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C031", + "expected_severity": null, + "note": "the halving recursion is correct", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C034", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/rag/investigator.py", + "start_line": 147, + "end_line": 147, + "object": null, + "origin": "src/devops_cli/ai/rag/investigator.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C034", + "expected_severity": null, + "note": "a benign double-checked Event fast path", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C035", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/rag/investigator.py", + "start_line": 194, + "end_line": 194, + "object": null, + "origin": "src/devops_cli/ai/rag/investigator.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C035", + "expected_severity": null, + "note": "as designed", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C036", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/rag/investigator.py", + "start_line": 280, + "end_line": 295, + "object": null, + "origin": "tests/fixtures/review_recall/recall_set.json", + "fingerprint_v2": null + }, + "label": "valid-lenient", + "defect_id": "C039", + "expected_severity": null, + "note": "echo of recall-set record 3 relocated onto investigator.py:280; the code has the #423 defect, but 'catches SystemExit/KeyboardInterrupt' is wrong", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C037", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/rag/investigator.py", + "start_line": 283, + "end_line": 283, + "object": null, + "origin": "src/devops_cli/ai/rag/investigator.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C037", + "expected_severity": null, + "note": "a constant bound on a slice", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C038", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/rag/investigator.py", + "start_line": 283, + "end_line": 283, + "object": null, + "origin": "src/devops_cli/ai/rag/investigator.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C038", + "expected_severity": null, + "note": "the log is debug level and %.50s", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C039", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/rag/investigator.py", + "start_line": 294, + "end_line": 294, + "object": null, + "origin": "src/devops_cli/ai/rag/investigator.py", + "fingerprint_v2": null + }, + "label": "valid-lenient", + "defect_id": "C039", + "expected_severity": null, + "note": "investigator.py:293-295 `except Exception` to a debug log, ctx None (#423; recall record 3)", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C040", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/rag/investigator.py", + "start_line": 296, + "end_line": 296, + "object": null, + "origin": "src/devops_cli/ai/rag/investigator.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C040", + "expected_severity": null, + "note": "as designed", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C041", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/review/common_hallucinations.py", + "start_line": 229, + "end_line": 229, + "object": null, + "origin": "src/devops_cli/ai/review/common_hallucinations.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C041", + "expected_severity": null, + "note": "as designed", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C042", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/review/common_hallucinations.py", + "start_line": 266, + "end_line": 274, + "object": null, + "origin": "src/devops_cli/ai/review/common_hallucinations.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C042", + "expected_severity": null, + "note": "S11 verification lens section 6: 'LLM, all 31 checked, 31 have the right outcome' ('all false or opinion'); the synthesis says about 10 of the 31 were spot-checked (re-read at e3ff98c)", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C044", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/review/common_hallucinations.py", + "start_line": 294, + "end_line": 294, + "object": null, + "origin": "src/devops_cli/ai/review/common_hallucinations.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C044", + "expected_severity": null, + "note": "as designed", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C046", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/review/common_hallucinations.py", + "start_line": 314, + "end_line": 314, + "object": null, + "origin": "src/devops_cli/ai/review/common_hallucinations.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C046", + "expected_severity": null, + "note": "as designed", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C049", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/review/mitigations.py", + "start_line": 171, + "end_line": 183, + "object": null, + "origin": "src/devops_cli/ai/review/mitigations.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C049", + "expected_severity": null, + "note": "repo_root is not input", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C050", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/review/mitigations.py", + "start_line": 194, + "end_line": 194, + "object": null, + "origin": "src/devops_cli/ai/review/mitigations.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C050", + "expected_severity": null, + "note": "absolute paths never match (#845)", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C051", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/review/pipeline.py", + "start_line": 1020, + "end_line": 1020, + "object": null, + "origin": "src/devops_cli/ai/review/pipeline.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C051", + "expected_severity": null, + "note": "errors=replace", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C052", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/review/pipeline.py", + "start_line": 1810, + "end_line": 1810, + "object": null, + "origin": "src/devops_cli/ai/review/pipeline.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C052", + "expected_severity": null, + "note": "secret-scan routing is deliberate", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C053", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/review/pipeline.py", + "start_line": 1824, + "end_line": 1824, + "object": null, + "origin": "src/devops_cli/ai/review/pipeline.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C053", + "expected_severity": null, + "note": "_checked_session_dir guards the session directory", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C054", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/review/pipeline.py", + "start_line": 1824, + "end_line": 1824, + "object": null, + "origin": "src/devops_cli/ai/review/pipeline.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C054", + "expected_severity": null, + "note": "_checked_session_dir guards the session directory", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C057", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/review/pipeline.py", + "start_line": 2850, + "end_line": 2850, + "object": null, + "origin": "src/devops_cli/ai/review/pipeline.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C057", + "expected_severity": null, + "note": "secret-scan routing is deliberate", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C058", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/review/pipeline.py", + "start_line": 2999, + "end_line": 2999, + "object": null, + "origin": "src/devops_cli/ai/review/pipeline.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C058", + "expected_severity": null, + "note": "as designed", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C059", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/review/pipeline.py", + "start_line": 3091, + "end_line": 3091, + "object": null, + "origin": "src/devops_cli/ai/review/pipeline.py", + "fingerprint_v2": null + }, + "label": "opinion", + "defect_id": "C059", + "expected_severity": null, + "note": "setattr over VERDICT_FIELDS", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C061", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/review/runner.py", + "start_line": 442, + "end_line": 465, + "object": null, + "origin": "src/devops_cli/ai/review/runner.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C061", + "expected_severity": null, + "note": "S10 label (#1052)", + "labeller": "agent: S10 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C062", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/review/runner.py", + "start_line": 458, + "end_line": 458, + "object": null, + "origin": "src/devops_cli/ai/review/runner.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C062", + "expected_severity": null, + "note": "calibration reads findings only", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C065", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/review/runner.py", + "start_line": 1306, + "end_line": 1306, + "object": null, + "origin": "src/devops_cli/ai/review/runner.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C065", + "expected_severity": null, + "note": "a vague runner.py claim", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C066", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/review/runner.py", + "start_line": 1497, + "end_line": 1497, + "object": null, + "origin": "src/devops_cli/ai/review/runner.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C066", + "expected_severity": null, + "note": "a vague runner.py claim", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C067", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/review/runner.py", + "start_line": 1527, + "end_line": 1527, + "object": null, + "origin": "src/devops_cli/ai/review/runner.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C067", + "expected_severity": null, + "note": "a vague runner.py claim", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C068", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/review/runner.py", + "start_line": 1644, + "end_line": 1644, + "object": null, + "origin": "src/devops_cli/ai/review/runner.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C068", + "expected_severity": null, + "note": "a vague runner.py claim", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C069", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/review/runner.py", + "start_line": 1695, + "end_line": 1695, + "object": null, + "origin": "src/devops_cli/ai/review/runner.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C069", + "expected_severity": null, + "note": "a vague runner.py claim", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C070", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/review/runner.py", + "start_line": 2323, + "end_line": 2323, + "object": null, + "origin": "src/devops_cli/ai/review/runner.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C070", + "expected_severity": null, + "note": "a vague runner.py claim", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C071", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/review/verdicts.py", + "start_line": 55, + "end_line": 210, + "object": null, + "origin": "src/devops_cli/ai/review/verdicts.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C071", + "expected_severity": null, + "note": "MITIGATED sets verified False by #845's design", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C084", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/review_schema.py", + "start_line": 618, + "end_line": 618, + "object": null, + "origin": "src/devops_cli/ai/review_schema.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C084", + "expected_severity": null, + "note": "the match is a space-padded whole word", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C086", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/review_schema.py", + "start_line": 844, + "end_line": 844, + "object": null, + "origin": "src/devops_cli/ai/review_schema.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C086", + "expected_severity": null, + "note": "no _parse_finding_references exists; :844 already calls parse_finding_references", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C088", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/review_schema.py", + "start_line": 1269, + "end_line": 1269, + "object": null, + "origin": "src/devops_cli/ai/review_schema.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C088", + "expected_severity": null, + "note": ":1268 already reads (f.severity or \"\")", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C089", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/review_schema.py", + "start_line": 1483, + "end_line": 1483, + "object": null, + "origin": "src/devops_cli/ai/review_schema.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C089", + "expected_severity": null, + "note": "reset_verification_state clears all verdict fields", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C091", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/spend/pricing.py", + "start_line": 53, + "end_line": 56, + "object": null, + "origin": "tests/fixtures/review_recall/recall_set.json", + "fingerprint_v2": null + }, + "label": "valid-lenient", + "defect_id": "C092", + "expected_severity": null, + "note": "echo of recall-set record 5 relocated onto pricing.py:53; the code has the #423 defect, but 'catches SystemExit/KeyboardInterrupt' is wrong", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C092", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/spend/pricing.py", + "start_line": 55, + "end_line": 55, + "object": null, + "origin": "src/devops_cli/ai/spend/pricing.py", + "fingerprint_v2": null + }, + "label": "valid-lenient", + "defect_id": "C092", + "expected_severity": null, + "note": "pricing.py:55 `except Exception: return False` around load_settings (#423; recall record 5)", + "labeller": "agent: S10 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C093", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/spend/pricing.py", + "start_line": 65, + "end_line": 68, + "object": null, + "origin": "tests/fixtures/review_recall/recall_set.json", + "fingerprint_v2": null + }, + "label": "valid-lenient", + "defect_id": "C094", + "expected_severity": null, + "note": "echo of recall-set record 6 relocated onto pricing.py:65; the code has the #423 defect, but 'catches SystemExit/KeyboardInterrupt' is wrong", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C094", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/spend/pricing.py", + "start_line": 67, + "end_line": 67, + "object": null, + "origin": "src/devops_cli/ai/spend/pricing.py", + "fingerprint_v2": null + }, + "label": "valid-lenient", + "defect_id": "C094", + "expected_severity": null, + "note": "pricing.py:67, the same pattern (#423; recall record 6)", + "labeller": "agent: S10 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C095", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/spend/pricing.py", + "start_line": 97, + "end_line": 101, + "object": null, + "origin": "src/devops_cli/ai/spend/pricing.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C095", + "expected_severity": null, + "note": "a non-IP host correctly falls through to the configured-host checks", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C096", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/spend/pricing.py", + "start_line": 137, + "end_line": 137, + "object": null, + "origin": "src/devops_cli/ai/spend/pricing.py", + "fingerprint_v2": null + }, + "label": "valid-lenient", + "defect_id": "C096", + "expected_severity": null, + "note": "pricing.py:137 `except Exception: pass` (#423)", + "labeller": "agent: S10 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C098", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/ai/spend/pricing.py", + "start_line": 219, + "end_line": 219, + "object": null, + "origin": "src/devops_cli/ai/spend/pricing.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C098", + "expected_severity": null, + "note": "resolve_review_data_path is #1063 by design", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C101", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/commands/ai_ingest.py", + "start_line": 46, + "end_line": 46, + "object": null, + "origin": "src/devops_cli/commands/ai_ingest.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C101", + "expected_severity": null, + "note": "local CLI input", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C102", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/commands/ai_ingest.py", + "start_line": 46, + "end_line": 46, + "object": null, + "origin": "src/devops_cli/commands/ai_ingest.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C102", + "expected_severity": null, + "note": "the three functions resolve the default the same way", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C103", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/commands/ai_ingest.py", + "start_line": 295, + "end_line": 295, + "object": null, + "origin": "src/devops_cli/commands/ai_ingest.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C103", + "expected_severity": null, + "note": "local CLI input", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C104", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/commands/ai_ingest.py", + "start_line": 295, + "end_line": 295, + "object": null, + "origin": "src/devops_cli/commands/ai_ingest.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C104", + "expected_severity": null, + "note": "the three functions resolve the default the same way", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C106", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/commands/ai_ingest.py", + "start_line": 339, + "end_line": 339, + "object": null, + "origin": "src/devops_cli/commands/ai_ingest.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C106", + "expected_severity": null, + "note": "the three functions resolve the default the same way", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C107", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/commands/ci.py", + "start_line": 357, + "end_line": 364, + "object": null, + "origin": "src/devops_cli/commands/ci.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C107", + "expected_severity": null, + "note": "S11 verification lens section 6: 'LLM, all 31 checked, 31 have the right outcome' ('all false or opinion'); the synthesis says about 10 of the 31 were spot-checked (re-read at e3ff98c)", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C108", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/commands/ci.py", + "start_line": 442, + "end_line": 448, + "object": null, + "origin": "src/devops_cli/commands/ci.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C108", + "expected_severity": null, + "note": "docs_fix runs generate at :357, then check always runs", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C109", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/commands/docker.py", + "start_line": 382, + "end_line": 382, + "object": null, + "origin": "src/devops_cli/commands/docker.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C109", + "expected_severity": null, + "note": "safe=True", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C110", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/commands/docker.py", + "start_line": 411, + "end_line": 411, + "object": null, + "origin": "src/devops_cli/commands/docker.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C110", + "expected_severity": null, + "note": "safe=True", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C112", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/commands/gh.py", + "start_line": 254, + "end_line": 254, + "object": null, + "origin": "src/devops_cli/commands/gh.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C112", + "expected_severity": null, + "note": "as designed", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C113", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/commands/gh.py", + "start_line": 254, + "end_line": 259, + "object": null, + "origin": "src/devops_cli/commands/gh.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C113", + "expected_severity": null, + "note": "as designed", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C114", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/commands/gh.py", + "start_line": 325, + "end_line": 346, + "object": null, + "origin": "src/devops_cli/commands/gh.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C114", + "expected_severity": null, + "note": "as designed", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C115", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/commands/gh.py", + "start_line": 333, + "end_line": 335, + "object": null, + "origin": "src/devops_cli/commands/gh.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C115", + "expected_severity": null, + "note": "the state check at :333 runs before _resolve_repo", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C116", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/commands/gh.py", + "start_line": 419, + "end_line": 425, + "object": null, + "origin": "src/devops_cli/commands/gh.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C116", + "expected_severity": null, + "note": "both parsers raise ValueError", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C117", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/commands/k8s/security_audit.py", + "start_line": 45, + "end_line": 55, + "object": null, + "origin": "src/devops_cli/commands/k8s/security_audit.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C117", + "expected_severity": null, + "note": "argv list", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C118", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/commands/review.py", + "start_line": 160, + "end_line": 160, + "object": null, + "origin": "src/devops_cli/commands/review.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C118", + "expected_severity": null, + "note": "local paths; #1063 is the guard, not a hole", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C119", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/commands/review.py", + "start_line": 338, + "end_line": 338, + "object": null, + "origin": "src/devops_cli/commands/review.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C119", + "expected_severity": null, + "note": "local paths; #1063 is the guard, not a hole", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C120", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/commands/review.py", + "start_line": 350, + "end_line": 350, + "object": null, + "origin": "src/devops_cli/commands/review.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C120", + "expected_severity": null, + "note": "local paths; #1063 is the guard, not a hole", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C121", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/commands/review.py", + "start_line": 774, + "end_line": 774, + "object": null, + "origin": "src/devops_cli/commands/review.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C121", + "expected_severity": null, + "note": "local paths; #1063 is the guard, not a hole", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C122", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/commands/scan.py", + "start_line": 98, + "end_line": 98, + "object": null, + "origin": "src/devops_cli/commands/scan.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C122", + "expected_severity": null, + "note": "safe=True", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C123", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/commands/scan.py", + "start_line": 792, + "end_line": 792, + "object": null, + "origin": "src/devops_cli/commands/scan.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C123", + "expected_severity": null, + "note": "safe=True", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C124", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/commands/scan.py", + "start_line": 894, + "end_line": 894, + "object": null, + "origin": "src/devops_cli/commands/scan.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C124", + "expected_severity": null, + "note": "scan_all catches each scanner and masks the reason (registry.py:79-95)", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C125", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/commands/telemetry.py", + "start_line": 320, + "end_line": 327, + "object": null, + "origin": "src/devops_cli/commands/telemetry.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C125", + "expected_severity": null, + "note": "as designed", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C127", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/core/cli.py", + "start_line": 199, + "end_line": 199, + "object": null, + "origin": "src/devops_cli/core/cli.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C127", + "expected_severity": null, + "note": "as designed", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C128", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/github/metrics.py", + "start_line": 107, + "end_line": 108, + "object": null, + "origin": "src/devops_cli/github/metrics.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C128", + "expected_severity": null, + "note": "lines without | are skipped", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C131", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/github/metrics.py", + "start_line": 176, + "end_line": 176, + "object": null, + "origin": "src/devops_cli/github/metrics.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C131", + "expected_severity": null, + "note": "as designed", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C139", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/security/base.py", + "start_line": 226, + "end_line": 226, + "object": null, + "origin": "src/devops_cli/security/base.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C139", + "expected_severity": null, + "note": "ScanOutcome masks every reason (base.py:67-93)", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C141", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/security/checkov.py", + "start_line": 281, + "end_line": 281, + "object": null, + "origin": "src/devops_cli/security/checkov.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C141", + "expected_severity": null, + "note": "S10 label: PEP 758 unparenthesized except is valid", + "labeller": "agent: S10 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C142", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/security/dive.py", + "start_line": 112, + "end_line": 112, + "object": null, + "origin": "src/devops_cli/security/dive.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C142", + "expected_severity": null, + "note": "a symlinked dive binary is refused", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C143", + "producer": "persona", + "rule": null, + "path": "src/devops_cli/security/dive.py", + "start_line": 112, + "end_line": 112, + "object": null, + "origin": "src/devops_cli/security/dive.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C143", + "expected_severity": null, + "note": "argv list", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C144", + "producer": "persona", + "rule": null, + "path": "tests/fixtures/review_recall/recall_set.json", + "start_line": 4, + "end_line": 10, + "object": null, + "origin": "tests/fixtures/review_recall/recall_set.json", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C144", + "expected_severity": null, + "note": "D15: a fixture record reported on the fixture itself", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C145", + "producer": "persona", + "rule": null, + "path": "tests/fixtures/review_recall/recall_set.json", + "start_line": 17, + "end_line": 17, + "object": null, + "origin": "tests/fixtures/review_recall/recall_set.json", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C145", + "expected_severity": null, + "note": "D15: a fixture record reported on the fixture itself", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C146", + "producer": "persona", + "rule": null, + "path": "tests/fixtures/review_recall/recall_set.json", + "start_line": 25, + "end_line": 34, + "object": null, + "origin": "tests/fixtures/review_recall/recall_set.json", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C146", + "expected_severity": null, + "note": "D15: a fixture record reported on the fixture itself", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C147", + "producer": "persona", + "rule": null, + "path": "tests/fixtures/review_recall/recall_set.json", + "start_line": 41, + "end_line": 50, + "object": null, + "origin": "tests/fixtures/review_recall/recall_set.json", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C147", + "expected_severity": null, + "note": "D15: a fixture record reported on the fixture itself", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C148", + "producer": "persona", + "rule": null, + "path": "tests/fixtures/review_recall/recall_set.json", + "start_line": 49, + "end_line": 49, + "object": null, + "origin": "tests/fixtures/review_recall/recall_set.json", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C148", + "expected_severity": null, + "note": "D15: a fixture record reported on the fixture itself", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C149", + "producer": "persona", + "rule": null, + "path": "tests/golden/review_findings.json", + "start_line": 360, + "end_line": 374, + "object": null, + "origin": "tests/golden/review_findings.json", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C149", + "expected_severity": null, + "note": "D15: a fixture record reported on the fixture itself", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C150", + "producer": "persona", + "rule": null, + "path": "tests/golden/review_findings.json", + "start_line": 430, + "end_line": 441, + "object": null, + "origin": "tests/golden/review_findings.json", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C150", + "expected_severity": null, + "note": "D15: a fixture record reported on the fixture itself", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C156", + "producer": "persona", + "rule": null, + "path": "tests/test_ai_request_priority.py", + "start_line": 201, + "end_line": 202, + "object": null, + "origin": "tests/test_ai_request_priority.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C156", + "expected_severity": null, + "note": "test_ai_request_priority:201-202 [S8-S10]", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C157", + "producer": "persona", + "rule": null, + "path": "tests/test_batch_2_review_defects.py", + "start_line": 182, + "end_line": 182, + "object": null, + "origin": "tests/test_batch_2_review_defects.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C157", + "expected_severity": null, + "note": "the call at :194 passes pr_files", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C173", + "producer": "persona", + "rule": null, + "path": "tests/test_hallucination_catalog_learning.py", + "start_line": 35, + "end_line": 35, + "object": null, + "origin": "tests/test_hallucination_catalog_learning.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C173", + "expected_severity": null, + "note": "S11 verification lens section 6: all 22 deterministic INVALIDATED checked, 21 right outcome (the wrong one is config.py:514) (re-read at e3ff98c)", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C174", + "producer": "persona", + "rule": null, + "path": "tests/test_hallucination_catalog_learning.py", + "start_line": 35, + "end_line": 35, + "object": null, + "origin": "tests/test_hallucination_catalog_learning.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C174", + "expected_severity": null, + "note": "a test-helper value change narrated as a defect", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C176", + "producer": "persona", + "rule": null, + "path": "tests/test_hallucination_catalog_learning.py", + "start_line": 42, + "end_line": 42, + "object": null, + "origin": "tests/test_hallucination_catalog_learning.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C176", + "expected_severity": null, + "note": "a test-helper value change narrated as a defect", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C177", + "producer": "persona", + "rule": null, + "path": "tests/test_hallucination_catalog_learning.py", + "start_line": 43, + "end_line": 43, + "object": null, + "origin": "tests/test_hallucination_catalog_learning.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C177", + "expected_severity": null, + "note": "a test-helper value change narrated as a defect", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C179", + "producer": "persona", + "rule": null, + "path": "tests/test_hallucination_catalog_learning.py", + "start_line": 85, + "end_line": 85, + "object": null, + "origin": "tests/test_hallucination_catalog_learning.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C179", + "expected_severity": null, + "note": "a test-helper value change narrated as a defect", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C182", + "producer": "persona", + "rule": null, + "path": "tests/test_hallucination_catalog_learning.py", + "start_line": 169, + "end_line": 169, + "object": null, + "origin": "tests/test_hallucination_catalog_learning.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C182", + "expected_severity": null, + "note": "a test-helper value change narrated as a defect", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C184", + "producer": "persona", + "rule": null, + "path": "tests/test_hallucination_catalog_learning.py", + "start_line": 181, + "end_line": 181, + "object": null, + "origin": "tests/test_hallucination_catalog_learning.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C184", + "expected_severity": null, + "note": "a test-helper value change narrated as a defect", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C185", + "producer": "persona", + "rule": null, + "path": "tests/test_host_sandbox.py", + "start_line": 310, + "end_line": 316, + "object": null, + "origin": "tests/test_host_sandbox.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C185", + "expected_severity": null, + "note": "test-only shutil.which on the sandbox PATH; criterion states the safe state", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C187", + "producer": "persona", + "rule": null, + "path": "tests/test_k8s_port_forward_daemon.py", + "start_line": 26, + "end_line": 30, + "object": null, + "origin": "tests/test_k8s_port_forward_daemon.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C187", + "expected_severity": null, + "note": "S11 verification lens section 6: 'LLM, all 31 checked, 31 have the right outcome' ('all false or opinion'); the synthesis says about 10 of the 31 were spot-checked (re-read at e3ff98c)", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C189", + "producer": "persona", + "rule": null, + "path": "tests/test_k8s_port_forward_daemon.py", + "start_line": 28, + "end_line": 29, + "object": null, + "origin": "tests/test_k8s_port_forward_daemon.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C189", + "expected_severity": null, + "note": "a test helper", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C190", + "producer": "persona", + "rule": null, + "path": "tests/test_k8s_port_forward_daemon.py", + "start_line": 103, + "end_line": 103, + "object": null, + "origin": "tests/test_k8s_port_forward_daemon.py", + "fingerprint_v2": null + }, + "label": "opinion", + "defect_id": "C190", + "expected_severity": null, + "note": "`assert mock_killpg.called` without its arguments", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C191", + "producer": "persona", + "rule": null, + "path": "tests/test_k8s_port_forward_daemon.py", + "start_line": 320, + "end_line": 320, + "object": null, + "origin": "tests/test_k8s_port_forward_daemon.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C191", + "expected_severity": null, + "note": "a test helper", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C193", + "producer": "persona", + "rule": null, + "path": "tests/test_k8s_tls.py", + "start_line": 85, + "end_line": 85, + "object": null, + "origin": "tests/test_k8s_tls.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C193", + "expected_severity": null, + "note": "tls_management.py:171 prints 'Applied TLS secret'", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C196", + "producer": "persona", + "rule": null, + "path": "tests/test_rag_indexer_retriever.py", + "start_line": 252, + "end_line": 252, + "object": null, + "origin": "tests/test_rag_indexer_retriever.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C196", + "expected_severity": null, + "note": "the real engine is used deliberately", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C206", + "producer": "persona", + "rule": null, + "path": "tests/test_review_scope.py", + "start_line": 32, + "end_line": 41, + "object": null, + "origin": "tests/test_review_scope.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C206", + "expected_severity": null, + "note": "S11 verification lens section 6: 'LLM, all 31 checked, 31 have the right outcome' ('all false or opinion'); the synthesis says about 10 of the 31 were spot-checked (re-read at e3ff98c)", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C208", + "producer": "persona", + "rule": null, + "path": "tests/test_review_scope.py", + "start_line": 78, + "end_line": 78, + "object": null, + "origin": "tests/test_review_scope.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C208", + "expected_severity": null, + "note": "narration", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C209", + "producer": "persona", + "rule": null, + "path": "tests/test_review_scope.py", + "start_line": 131, + "end_line": 131, + "object": null, + "origin": "tests/test_review_scope.py", + "fingerprint_v2": null + }, + "label": "opinion", + "defect_id": "C209", + "expected_severity": null, + "note": "test design", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C210", + "producer": "persona", + "rule": null, + "path": "tests/test_review_scope.py", + "start_line": 176, + "end_line": 176, + "object": null, + "origin": "tests/test_review_scope.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C210", + "expected_severity": null, + "note": "the observed call (head_dir=..., None) is fabricated", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C212", + "producer": "persona", + "rule": null, + "path": "tests/test_review_static_analyzers.py", + "start_line": 93, + "end_line": 93, + "object": null, + "origin": "tests/test_review_static_analyzers.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C212", + "expected_severity": null, + "note": "deliberate", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C213", + "producer": "persona", + "rule": null, + "path": "tests/test_review_static_analyzers.py", + "start_line": 193, + "end_line": 196, + "object": null, + "origin": "tests/test_review_static_analyzers.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C213", + "expected_severity": null, + "note": "S11 verification lens section 6: 'LLM, all 31 checked, 31 have the right outcome' ('all false or opinion'); the synthesis says about 10 of the 31 were spot-checked (re-read at e3ff98c)", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C216", + "producer": "persona", + "rule": null, + "path": "tests/test_review_verification.py", + "start_line": 133, + "end_line": 155, + "object": null, + "origin": "tests/test_review_verification.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C216", + "expected_severity": null, + "note": "both tests exist", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C218", + "producer": "persona", + "rule": null, + "path": "tests/test_review_verification.py", + "start_line": 439, + "end_line": 439, + "object": null, + "origin": "tests/test_review_verification.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C218", + "expected_severity": null, + "note": ":439 passes repo_root=tmp_path; the parameter is optional", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C222", + "producer": "persona", + "rule": null, + "path": "tests/test_security_dive.py", + "start_line": 94, + "end_line": 94, + "object": null, + "origin": "tests/test_security_dive.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C222", + "expected_severity": null, + "note": "test-file hygiene, no defect", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C225", + "producer": "persona", + "rule": null, + "path": "tests/test_security_dive.py", + "start_line": 203, + "end_line": 203, + "object": null, + "origin": "tests/test_security_dive.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C225", + "expected_severity": null, + "note": "test-file hygiene, no defect", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C227", + "producer": "persona", + "rule": null, + "path": "tests/test_telemetry_profile.py", + "start_line": 137, + "end_line": 156, + "object": null, + "origin": "tests/test_telemetry_profile.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C227", + "expected_severity": null, + "note": "S11 verification lens section 6: 'LLM, all 31 checked, 31 have the right outcome' ('all false or opinion'); the synthesis says about 10 of the 31 were spot-checked (re-read at e3ff98c)", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C228", + "producer": "persona", + "rule": null, + "path": "tests/test_telemetry_profile.py", + "start_line": 177, + "end_line": 177, + "object": null, + "origin": "tests/test_telemetry_profile.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C228", + "expected_severity": null, + "note": "test-file hygiene, no defect", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C230", + "producer": "persona", + "rule": null, + "path": "tests/test_verdict_writers.py", + "start_line": 126, + "end_line": 126, + "object": null, + "origin": "tests/test_verdict_writers.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C230", + "expected_severity": null, + "note": "test-file hygiene, no defect", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C231", + "producer": "persona", + "rule": null, + "path": "tests/test_verdict_writers.py", + "start_line": 132, + "end_line": 132, + "object": null, + "origin": "tests/test_verdict_writers.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C231", + "expected_severity": null, + "note": "test-file hygiene, no defect", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C233", + "producer": "persona", + "rule": null, + "path": "tests/test_verdict_writers.py", + "start_line": 460, + "end_line": 463, + "object": null, + "origin": "tests/test_verdict_writers.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C233", + "expected_severity": null, + "note": "S11 verification lens section 6: all 22 deterministic INVALIDATED checked, 21 right outcome (the wrong one is config.py:514) (re-read at e3ff98c)", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C235", + "producer": "persona", + "rule": null, + "path": "tests/test_workspace.py", + "start_line": 217, + "end_line": 219, + "object": null, + "origin": "tests/test_workspace.py", + "fingerprint_v2": null + }, + "label": "opinion", + "defect_id": "C235", + "expected_severity": null, + "note": "asks for one more test case", + "labeller": "agent: loop evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C236", + "producer": "semgrep", + "rule": "yaml.kubernetes.security.run-as-non-root.run-as-non-root", + "path": "k8s/llm/profiles/ollama-profiles.yaml", + "start_line": 36, + "end_line": 36, + "object": null, + "origin": "k8s/llm/profiles/ollama-profiles.yaml", + "fingerprint_v2": null + }, + "label": "valid-strict", + "defect_id": "C236", + "expected_severity": null, + "note": "Semgrep run-as-non-root on the ollama DaemonSets (ollama-profiles.yaml:36)", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C237", + "producer": "semgrep", + "rule": "yaml.kubernetes.security.allow-privilege-escalation-no-securitycontext.allow-privilege-escalation-no-securitycontext", + "path": "k8s/llm/profiles/ollama-profiles.yaml", + "start_line": 53, + "end_line": 53, + "object": null, + "origin": "k8s/llm/profiles/ollama-profiles.yaml", + "fingerprint_v2": null + }, + "label": "valid-strict", + "defect_id": "C237", + "expected_severity": null, + "note": "Semgrep allow-privilege-escalation on the ollama DaemonSets (ollama-profiles.yaml:53)", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C239", + "producer": "semgrep", + "rule": "python.lang.security.audit.non-literal-import.non-literal-import", + "path": "src/devops_cli/ai/__init__.py", + "start_line": 12, + "end_line": 12, + "object": null, + "origin": "src/devops_cli/ai/__init__.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C239", + "expected_severity": null, + "note": "Semgrep non-literal-import on a static map", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C240", + "producer": "semgrep", + "rule": "python.lang.security.audit.logging.logger-credential-leak.python-logger-credential-disclosure", + "path": "src/devops_cli/ai/rag/indexer.py", + "start_line": 353, + "end_line": 353, + "object": null, + "origin": "src/devops_cli/ai/rag/indexer.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C240", + "expected_severity": null, + "note": "Semgrep logger-credential on a line that logs no credential", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C241", + "producer": "semgrep", + "rule": "python.lang.security.audit.logging.logger-credential-leak.python-logger-credential-disclosure", + "path": "src/devops_cli/ai/rag/qdrant.py", + "start_line": 164, + "end_line": 164, + "object": null, + "origin": "src/devops_cli/ai/rag/qdrant.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C241", + "expected_severity": null, + "note": "Semgrep logger-credential on a line that logs no credential", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C243", + "producer": "semgrep", + "rule": "python.lang.security.audit.logging.logger-credential-leak.python-logger-credential-disclosure", + "path": "src/devops_cli/commands/config.py", + "start_line": 514, + "end_line": 514, + "object": null, + "origin": "src/devops_cli/commands/config.py", + "fingerprint_v2": null + }, + "label": "valid-strict", + "defect_id": "C243", + "expected_severity": null, + "note": "Semgrep at config.py:514; valid, but INVALIDATED by the syntax_error check (#1022, #770) and never reported", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C244", + "producer": "semgrep", + "rule": "python.lang.security.audit.non-literal-import.non-literal-import", + "path": "src/devops_cli/commands/release.py", + "start_line": 60, + "end_line": 60, + "object": null, + "origin": "src/devops_cli/commands/release.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C244", + "expected_severity": null, + "note": "Semgrep non-literal-import on a static map", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C245", + "producer": "semgrep", + "rule": "python.lang.security.audit.non-literal-import.non-literal-import", + "path": "src/devops_cli/commands/workspace.py", + "start_line": 43, + "end_line": 43, + "object": null, + "origin": "src/devops_cli/commands/workspace.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C245", + "expected_severity": null, + "note": "Semgrep non-literal-import on a static map", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C246", + "producer": "semgrep", + "rule": "python.lang.security.audit.logging.logger-credential-leak.python-logger-credential-disclosure", + "path": "src/devops_cli/config/settings.py", + "start_line": 657, + "end_line": 657, + "object": null, + "origin": "src/devops_cli/config/settings.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C246", + "expected_severity": null, + "note": "Semgrep logger-credential on a line that logs no credential", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C249", + "producer": "semgrep", + "rule": "python.lang.security.audit.non-literal-import.non-literal-import", + "path": "src/devops_cli/main.py", + "start_line": 93, + "end_line": 93, + "object": null, + "origin": "src/devops_cli/main.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C249", + "expected_severity": null, + "note": "Semgrep non-literal-import on a static map", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C256", + "producer": "bandit", + "rule": "B103", + "path": "tests/test_crypto_tls.py", + "start_line": 243, + "end_line": 243, + "object": null, + "origin": "tests/test_crypto_tls.py", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "C256", + "expected_severity": null, + "note": "Bandit B103 0o666 is the deliberate insecure precondition of test_tls_overwriting_insecure_permissions, which then asserts 0600/0644", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C266", + "producer": "kube-linter", + "rule": "no-anti-affinity", + "path": "k8s/cloudflared/deployment.yaml", + "start_line": null, + "end_line": null, + "object": "Deployment/cloudflared", + "origin": "k8s/cloudflared/deployment.yaml", + "fingerprint_v2": null + }, + "label": "opinion", + "defect_id": "no-anti-affinity@k8s/cloudflared/deployment.yaml", + "expected_severity": null, + "note": "cloudflared anti-affinity (#1023)", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C267", + "producer": "kube-linter", + "rule": "no-read-only-root-fs", + "path": "k8s/llm/profiles/ollama-profiles.yaml", + "start_line": null, + "end_line": null, + "object": "DaemonSet/ollama-128gib", + "origin": "k8s/llm/profiles/ollama-profiles.yaml", + "fingerprint_v2": null + }, + "label": "valid-strict", + "defect_id": "no-read-only-root-fs@k8s/llm/profiles/ollama-profiles.yaml", + "expected_severity": null, + "note": "kube-linter no-read-only-root-fs on the ollama DaemonSets: ollama-profiles.yaml sets no securityContext", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C268", + "producer": "kube-linter", + "rule": "no-read-only-root-fs", + "path": "k8s/llm/profiles/ollama-profiles.yaml", + "start_line": null, + "end_line": null, + "object": "DaemonSet/ollama-16gib", + "origin": "k8s/llm/profiles/ollama-profiles.yaml", + "fingerprint_v2": null + }, + "label": "valid-strict", + "defect_id": "no-read-only-root-fs@k8s/llm/profiles/ollama-profiles.yaml", + "expected_severity": null, + "note": "kube-linter no-read-only-root-fs on the ollama DaemonSets: ollama-profiles.yaml sets no securityContext", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C269", + "producer": "kube-linter", + "rule": "no-read-only-root-fs", + "path": "k8s/llm/profiles/ollama-profiles.yaml", + "start_line": null, + "end_line": null, + "object": "DaemonSet/ollama-24gib", + "origin": "k8s/llm/profiles/ollama-profiles.yaml", + "fingerprint_v2": null + }, + "label": "valid-strict", + "defect_id": "no-read-only-root-fs@k8s/llm/profiles/ollama-profiles.yaml", + "expected_severity": null, + "note": "kube-linter no-read-only-root-fs on the ollama DaemonSets: ollama-profiles.yaml sets no securityContext", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C270", + "producer": "kube-linter", + "rule": "no-read-only-root-fs", + "path": "k8s/llm/profiles/ollama-profiles.yaml", + "start_line": null, + "end_line": null, + "object": "DaemonSet/ollama-32gib", + "origin": "k8s/llm/profiles/ollama-profiles.yaml", + "fingerprint_v2": null + }, + "label": "valid-strict", + "defect_id": "no-read-only-root-fs@k8s/llm/profiles/ollama-profiles.yaml", + "expected_severity": null, + "note": "kube-linter no-read-only-root-fs on the ollama DaemonSets: ollama-profiles.yaml sets no securityContext", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C271", + "producer": "kube-linter", + "rule": "no-read-only-root-fs", + "path": "k8s/llm/profiles/ollama-profiles.yaml", + "start_line": null, + "end_line": null, + "object": "DaemonSet/ollama-48gib", + "origin": "k8s/llm/profiles/ollama-profiles.yaml", + "fingerprint_v2": null + }, + "label": "valid-strict", + "defect_id": "no-read-only-root-fs@k8s/llm/profiles/ollama-profiles.yaml", + "expected_severity": null, + "note": "kube-linter no-read-only-root-fs on the ollama DaemonSets: ollama-profiles.yaml sets no securityContext", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C272", + "producer": "kube-linter", + "rule": "no-read-only-root-fs", + "path": "k8s/llm/profiles/ollama-profiles.yaml", + "start_line": null, + "end_line": null, + "object": "DaemonSet/ollama-48gib-slow", + "origin": "k8s/llm/profiles/ollama-profiles.yaml", + "fingerprint_v2": null + }, + "label": "valid-strict", + "defect_id": "no-read-only-root-fs@k8s/llm/profiles/ollama-profiles.yaml", + "expected_severity": null, + "note": "kube-linter no-read-only-root-fs on the ollama DaemonSets: ollama-profiles.yaml sets no securityContext", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C273", + "producer": "kube-linter", + "rule": "no-read-only-root-fs", + "path": "k8s/llm/profiles/ollama-profiles.yaml", + "start_line": null, + "end_line": null, + "object": "DaemonSet/ollama-64gib", + "origin": "k8s/llm/profiles/ollama-profiles.yaml", + "fingerprint_v2": null + }, + "label": "valid-strict", + "defect_id": "no-read-only-root-fs@k8s/llm/profiles/ollama-profiles.yaml", + "expected_severity": null, + "note": "kube-linter no-read-only-root-fs on the ollama DaemonSets: ollama-profiles.yaml sets no securityContext", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C274", + "producer": "kube-linter", + "rule": "no-read-only-root-fs", + "path": "k8s/llm/profiles/ollama-profiles.yaml", + "start_line": null, + "end_line": null, + "object": "DaemonSet/ollama-72gib", + "origin": "k8s/llm/profiles/ollama-profiles.yaml", + "fingerprint_v2": null + }, + "label": "valid-strict", + "defect_id": "no-read-only-root-fs@k8s/llm/profiles/ollama-profiles.yaml", + "expected_severity": null, + "note": "kube-linter no-read-only-root-fs on the ollama DaemonSets: ollama-profiles.yaml sets no securityContext", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C275", + "producer": "kube-linter", + "rule": "no-read-only-root-fs", + "path": "k8s/llm/profiles/ollama-profiles.yaml", + "start_line": null, + "end_line": null, + "object": "DaemonSet/ollama-96gib", + "origin": "k8s/llm/profiles/ollama-profiles.yaml", + "fingerprint_v2": null + }, + "label": "valid-strict", + "defect_id": "no-read-only-root-fs@k8s/llm/profiles/ollama-profiles.yaml", + "expected_severity": null, + "note": "kube-linter no-read-only-root-fs on the ollama DaemonSets: ollama-profiles.yaml sets no securityContext", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C276", + "producer": "kube-linter", + "rule": "dangling-service", + "path": "k8s/llm/profiles/services.yaml", + "start_line": null, + "end_line": null, + "object": "Service/ollama-128gib", + "origin": "k8s/llm/profiles/services.yaml", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "dangling-service@k8s/llm/profiles/services.yaml", + "expected_severity": null, + "note": "D11 (#1024): kube-linter dangling-service on services.yaml; the selectors match the DaemonSet labels", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C278", + "producer": "kube-linter", + "rule": "dangling-service", + "path": "k8s/llm/profiles/services.yaml", + "start_line": null, + "end_line": null, + "object": "Service/ollama-16gib-fast", + "origin": "k8s/llm/profiles/services.yaml", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "dangling-service@k8s/llm/profiles/services.yaml", + "expected_severity": null, + "note": "D11 (#1024): kube-linter dangling-service on services.yaml; the selectors match the DaemonSet labels", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C281", + "producer": "kube-linter", + "rule": "dangling-service", + "path": "k8s/llm/profiles/services.yaml", + "start_line": null, + "end_line": null, + "object": "Service/ollama-32gib", + "origin": "k8s/llm/profiles/services.yaml", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "dangling-service@k8s/llm/profiles/services.yaml", + "expected_severity": null, + "note": "D11 (#1024): kube-linter dangling-service on services.yaml; the selectors match the DaemonSet labels", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C282", + "producer": "kube-linter", + "rule": "dangling-service", + "path": "k8s/llm/profiles/services.yaml", + "start_line": null, + "end_line": null, + "object": "Service/ollama-48gib", + "origin": "k8s/llm/profiles/services.yaml", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "dangling-service@k8s/llm/profiles/services.yaml", + "expected_severity": null, + "note": "D11 (#1024): kube-linter dangling-service on services.yaml; the selectors match the DaemonSet labels", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C283", + "producer": "kube-linter", + "rule": "dangling-service", + "path": "k8s/llm/profiles/services.yaml", + "start_line": null, + "end_line": null, + "object": "Service/ollama-48gib-fast", + "origin": "k8s/llm/profiles/services.yaml", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "dangling-service@k8s/llm/profiles/services.yaml", + "expected_severity": null, + "note": "D11 (#1024): kube-linter dangling-service on services.yaml; the selectors match the DaemonSet labels", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C284", + "producer": "kube-linter", + "rule": "dangling-service", + "path": "k8s/llm/profiles/services.yaml", + "start_line": null, + "end_line": null, + "object": "Service/ollama-48gib-slow", + "origin": "k8s/llm/profiles/services.yaml", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "dangling-service@k8s/llm/profiles/services.yaml", + "expected_severity": null, + "note": "D11 (#1024): kube-linter dangling-service on services.yaml; the selectors match the DaemonSet labels", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C285", + "producer": "kube-linter", + "rule": "dangling-service", + "path": "k8s/llm/profiles/services.yaml", + "start_line": null, + "end_line": null, + "object": "Service/ollama-64gib", + "origin": "k8s/llm/profiles/services.yaml", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "dangling-service@k8s/llm/profiles/services.yaml", + "expected_severity": null, + "note": "D11 (#1024): kube-linter dangling-service on services.yaml; the selectors match the DaemonSet labels", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C286", + "producer": "kube-linter", + "rule": "dangling-service", + "path": "k8s/llm/profiles/services.yaml", + "start_line": null, + "end_line": null, + "object": "Service/ollama-64gib-standard", + "origin": "k8s/llm/profiles/services.yaml", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "dangling-service@k8s/llm/profiles/services.yaml", + "expected_severity": null, + "note": "D11 (#1024): kube-linter dangling-service on services.yaml; the selectors match the DaemonSet labels", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C287", + "producer": "kube-linter", + "rule": "dangling-service", + "path": "k8s/llm/profiles/services.yaml", + "start_line": null, + "end_line": null, + "object": "Service/ollama-72gib", + "origin": "k8s/llm/profiles/services.yaml", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "dangling-service@k8s/llm/profiles/services.yaml", + "expected_severity": null, + "note": "D11 (#1024): kube-linter dangling-service on services.yaml; the selectors match the DaemonSet labels", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C288", + "producer": "kube-linter", + "rule": "dangling-service", + "path": "k8s/llm/profiles/services.yaml", + "start_line": null, + "end_line": null, + "object": "Service/ollama-96gib", + "origin": "k8s/llm/profiles/services.yaml", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "dangling-service@k8s/llm/profiles/services.yaml", + "expected_severity": null, + "note": "D11 (#1024): kube-linter dangling-service on services.yaml; the selectors match the DaemonSet labels", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C289", + "producer": "kube-linter", + "rule": "dangling-service", + "path": "k8s/llm/profiles/services.yaml", + "start_line": null, + "end_line": null, + "object": "Service/ollama-fast", + "origin": "k8s/llm/profiles/services.yaml", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "dangling-service@k8s/llm/profiles/services.yaml", + "expected_severity": null, + "note": "D11 (#1024): kube-linter dangling-service on services.yaml; the selectors match the DaemonSet labels", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C290", + "producer": "kube-linter", + "rule": "dangling-service", + "path": "k8s/llm/profiles/services.yaml", + "start_line": null, + "end_line": null, + "object": "Service/ollama-slow", + "origin": "k8s/llm/profiles/services.yaml", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "dangling-service@k8s/llm/profiles/services.yaml", + "expected_severity": null, + "note": "D11 (#1024): kube-linter dangling-service on services.yaml; the selectors match the DaemonSet labels", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C291", + "producer": "kube-linter", + "rule": "dangling-service", + "path": "k8s/llm/profiles/services.yaml", + "start_line": null, + "end_line": null, + "object": "Service/ollama-standard", + "origin": "k8s/llm/profiles/services.yaml", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "dangling-service@k8s/llm/profiles/services.yaml", + "expected_severity": null, + "note": "D11 (#1024): kube-linter dangling-service on services.yaml; the selectors match the DaemonSet labels", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C292", + "producer": "kube-linter", + "rule": "dangling-service", + "path": "k8s/monitoring/service-aliases.yaml", + "start_line": null, + "end_line": null, + "object": "Service/kube-prometheus-grafana", + "origin": "k8s/monitoring/service-aliases.yaml", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "dangling-service@k8s/monitoring/service-aliases.yaml", + "expected_severity": null, + "note": "D11 (#1024): kube-linter dangling-service on service-aliases.yaml", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C293", + "producer": "kube-linter", + "rule": "dangling-service", + "path": "k8s/monitoring/service-aliases.yaml", + "start_line": null, + "end_line": null, + "object": "Service/kube-prometheus-kube-prome-prometheus", + "origin": "k8s/monitoring/service-aliases.yaml", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "dangling-service@k8s/monitoring/service-aliases.yaml", + "expected_severity": null, + "note": "D11 (#1024): kube-linter dangling-service on service-aliases.yaml", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C294", + "producer": "kube-linter", + "rule": "dangling-service", + "path": "k8s/monitoring/service-aliases.yaml", + "start_line": null, + "end_line": null, + "object": "Service/prometheus", + "origin": "k8s/monitoring/service-aliases.yaml", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "dangling-service@k8s/monitoring/service-aliases.yaml", + "expected_severity": null, + "note": "D11 (#1024): kube-linter dangling-service on service-aliases.yaml", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + }, + { + "identity": { + "key": "C295", + "producer": "kube-linter", + "rule": "dangling-service", + "path": "k8s/monitoring/service-aliases.yaml", + "start_line": null, + "end_line": null, + "object": "Service/pyroscope", + "origin": "k8s/monitoring/service-aliases.yaml", + "fingerprint_v2": null + }, + "label": "false", + "defect_id": "dangling-service@k8s/monitoring/service-aliases.yaml", + "expected_severity": null, + "note": "D11 (#1024): kube-linter dangling-service on service-aliases.yaml", + "labeller": "agent: S11 evaluation", + "date": "2026-10-03" + } + ] +} diff --git a/tests/fixtures/review_labels/sessions/20261003-060647/files/k8s_cloudflared_deployment_yaml.json b/tests/fixtures/review_labels/sessions/20261003-060647/files/k8s_cloudflared_deployment_yaml.json new file mode 100644 index 0000000000..da661f328d --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-060647/files/k8s_cloudflared_deployment_yaml.json @@ -0,0 +1 @@ +{"file_path": "k8s/cloudflared/deployment.yaml"} diff --git a/tests/fixtures/review_labels/sessions/20261003-060647/files/k8s_llm_profiles_ollama-profiles_yaml.json b/tests/fixtures/review_labels/sessions/20261003-060647/files/k8s_llm_profiles_ollama-profiles_yaml.json new file mode 100644 index 0000000000..1b45addcd5 --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-060647/files/k8s_llm_profiles_ollama-profiles_yaml.json @@ -0,0 +1 @@ +{"file_path": "k8s/llm/profiles/ollama-profiles.yaml"} diff --git a/tests/fixtures/review_labels/sessions/20261003-060647/files/k8s_llm_profiles_services_yaml.json b/tests/fixtures/review_labels/sessions/20261003-060647/files/k8s_llm_profiles_services_yaml.json new file mode 100644 index 0000000000..059159b421 --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-060647/files/k8s_llm_profiles_services_yaml.json @@ -0,0 +1 @@ +{"file_path": "k8s/llm/profiles/services.yaml"} diff --git a/tests/fixtures/review_labels/sessions/20261003-060647/files/k8s_monitoring_service-aliases_yaml.json b/tests/fixtures/review_labels/sessions/20261003-060647/files/k8s_monitoring_service-aliases_yaml.json new file mode 100644 index 0000000000..b5dd76584e --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-060647/files/k8s_monitoring_service-aliases_yaml.json @@ -0,0 +1 @@ +{"file_path": "k8s/monitoring/service-aliases.yaml"} diff --git a/tests/fixtures/review_labels/sessions/20261003-060647/files/k8s_otel_networkpolicy_yaml.json b/tests/fixtures/review_labels/sessions/20261003-060647/files/k8s_otel_networkpolicy_yaml.json new file mode 100644 index 0000000000..d978b9af2d --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-060647/files/k8s_otel_networkpolicy_yaml.json @@ -0,0 +1 @@ +{"file_path": "k8s/otel/networkpolicy.yaml"} diff --git a/tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_ai___init___py.json b/tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_ai___init___py.json new file mode 100644 index 0000000000..50ae1d1b82 --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_ai___init___py.json @@ -0,0 +1 @@ +{"file_path": "src/devops_cli/ai/__init__.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_ai_mcp_server_py.json b/tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_ai_mcp_server_py.json new file mode 100644 index 0000000000..179c9109bc --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_ai_mcp_server_py.json @@ -0,0 +1 @@ +{"file_path": "src/devops_cli/ai/mcp/server.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_ai_rag_indexer_py.json b/tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_ai_rag_indexer_py.json new file mode 100644 index 0000000000..2598140fba --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_ai_rag_indexer_py.json @@ -0,0 +1 @@ +{"file_path": "src/devops_cli/ai/rag/indexer.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_ai_rag_qdrant_py.json b/tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_ai_rag_qdrant_py.json new file mode 100644 index 0000000000..02ee075ae9 --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_ai_rag_qdrant_py.json @@ -0,0 +1 @@ +{"file_path": "src/devops_cli/ai/rag/qdrant.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_ai_review_schema_py.json b/tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_ai_review_schema_py.json new file mode 100644 index 0000000000..005527747f --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_ai_review_schema_py.json @@ -0,0 +1 @@ +{"file_path": "src/devops_cli/ai/review_schema.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_ai_review_verdicts_py.json b/tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_ai_review_verdicts_py.json new file mode 100644 index 0000000000..e8fe814406 --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_ai_review_verdicts_py.json @@ -0,0 +1 @@ +{"file_path": "src/devops_cli/ai/review/verdicts.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_commands_gh_py.json b/tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_commands_gh_py.json new file mode 100644 index 0000000000..b7cc19ca11 --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_commands_gh_py.json @@ -0,0 +1 @@ +{"file_path": "src/devops_cli/commands/gh.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_commands_release_py.json b/tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_commands_release_py.json new file mode 100644 index 0000000000..3768cf8931 --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_commands_release_py.json @@ -0,0 +1 @@ +{"file_path": "src/devops_cli/commands/release.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_commands_workspace_py.json b/tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_commands_workspace_py.json new file mode 100644 index 0000000000..2758ab2333 --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_commands_workspace_py.json @@ -0,0 +1 @@ +{"file_path": "src/devops_cli/commands/workspace.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_config_settings_py.json b/tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_config_settings_py.json new file mode 100644 index 0000000000..065f679986 --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_config_settings_py.json @@ -0,0 +1 @@ +{"file_path": "src/devops_cli/config/settings.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_main_py.json b/tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_main_py.json new file mode 100644 index 0000000000..abd5fc5852 --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-060647/files/src_devops_cli_main_py.json @@ -0,0 +1 @@ +{"file_path": "src/devops_cli/main.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-060647/files/tests_fixtures_review_recall_recall_set_json.json b/tests/fixtures/review_labels/sessions/20261003-060647/files/tests_fixtures_review_recall_recall_set_json.json new file mode 100644 index 0000000000..c9596976fc --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-060647/files/tests_fixtures_review_recall_recall_set_json.json @@ -0,0 +1 @@ +{"file_path": "tests/fixtures/review_recall/recall_set.json"} diff --git a/tests/fixtures/review_labels/sessions/20261003-060647/files/tests_golden_review_findings_json.json b/tests/fixtures/review_labels/sessions/20261003-060647/files/tests_golden_review_findings_json.json new file mode 100644 index 0000000000..69a335277e --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-060647/files/tests_golden_review_findings_json.json @@ -0,0 +1 @@ +{"file_path": "tests/golden/review_findings.json"} diff --git a/tests/fixtures/review_labels/sessions/20261003-060647/files/tests_test_ai_request_priority_py.json b/tests/fixtures/review_labels/sessions/20261003-060647/files/tests_test_ai_request_priority_py.json new file mode 100644 index 0000000000..cce4f920ad --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-060647/files/tests_test_ai_request_priority_py.json @@ -0,0 +1 @@ +{"file_path": "tests/test_ai_request_priority.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-060647/files/tests_test_batch_2_review_defects_py.json b/tests/fixtures/review_labels/sessions/20261003-060647/files/tests_test_batch_2_review_defects_py.json new file mode 100644 index 0000000000..ba28778aab --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-060647/files/tests_test_batch_2_review_defects_py.json @@ -0,0 +1 @@ +{"file_path": "tests/test_batch_2_review_defects.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-060647/files/tests_test_host_sandbox_py.json b/tests/fixtures/review_labels/sessions/20261003-060647/files/tests_test_host_sandbox_py.json new file mode 100644 index 0000000000..0447bc4376 --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-060647/files/tests_test_host_sandbox_py.json @@ -0,0 +1 @@ +{"file_path": "tests/test_host_sandbox.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-060647/files/tests_test_k8s_tls_py.json b/tests/fixtures/review_labels/sessions/20261003-060647/files/tests_test_k8s_tls_py.json new file mode 100644 index 0000000000..feea171ba4 --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-060647/files/tests_test_k8s_tls_py.json @@ -0,0 +1 @@ +{"file_path": "tests/test_k8s_tls.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-060647/files/tests_test_review_scope_py.json b/tests/fixtures/review_labels/sessions/20261003-060647/files/tests_test_review_scope_py.json new file mode 100644 index 0000000000..2e73c08d9b --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-060647/files/tests_test_review_scope_py.json @@ -0,0 +1 @@ +{"file_path": "tests/test_review_scope.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-060647/files/tests_test_review_verification_py.json b/tests/fixtures/review_labels/sessions/20261003-060647/files/tests_test_review_verification_py.json new file mode 100644 index 0000000000..ded0871f31 --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-060647/files/tests_test_review_verification_py.json @@ -0,0 +1 @@ +{"file_path": "tests/test_review_verification.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-060647/findings.json b/tests/fixtures/review_labels/sessions/20261003-060647/findings.json new file mode 100644 index 0000000000..8a6b2cef1f --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-060647/findings.json @@ -0,0 +1,366 @@ +{ + "subject": { + "type": "branch", + "ref": "release/v0.2.25", + "input": "197b2f088fcf1557" + }, + "findings": [ + { + "location": "app/shell.py:4", + "status": "VERIFIED", + "severity": "HIGH", + "reportable": true, + "verified_by": "llm" + }, + { + "location": "k8s/otel/networkpolicy.yaml:30-32", + "status": "VERIFIED", + "severity": "HIGH", + "reportable": true, + "verified_by": "llm" + }, + { + "location": "/workspaces/devops-cli/src/devops_cli/ai/__init__.py:12", + "status": "VERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": "llm" + }, + { + "location": "/workspaces/devops-cli/src/devops_cli/ai/rag/indexer.py:12", + "status": "VERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": "llm" + }, + { + "location": "/workspaces/devops-cli/src/devops_cli/commands/workspace.py:43", + "status": "VERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": "llm" + }, + { + "location": "/workspaces/devops-cli/src/devops_cli/main.py:84", + "status": "VERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": "llm" + }, + { + "location": "tests/test_host_sandbox.py:310", + "status": "VERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": "llm" + }, + { + "location": "src/devops_cli/commands/gh.py:333", + "status": "UNVERIFIED", + "severity": "HIGH", + "reportable": true, + "verified_by": null + }, + { + "location": "/workspaces/devops-cli/k8s/llm/profiles/ollama-profiles.yaml:53", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "/workspaces/devops-cli/src/devops_cli/commands/release.py:60", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/cloudflared/deployment.yaml:Deployment/cloudflared", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/ollama-profiles.yaml:DaemonSet/ollama-128gib", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/ollama-profiles.yaml:DaemonSet/ollama-16gib", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/ollama-profiles.yaml:DaemonSet/ollama-24gib", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/ollama-profiles.yaml:DaemonSet/ollama-32gib", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/ollama-profiles.yaml:DaemonSet/ollama-48gib", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/ollama-profiles.yaml:DaemonSet/ollama-48gib-slow", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/ollama-profiles.yaml:DaemonSet/ollama-64gib", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/ollama-profiles.yaml:DaemonSet/ollama-72gib", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/ollama-profiles.yaml:DaemonSet/ollama-96gib", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-128gib", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-32gib", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-48gib-fast", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-48gib-slow", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-64gib", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-64gib-standard", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-72gib", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-96gib", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-fast", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-slow", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-standard", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/monitoring/service-aliases.yaml:Service/kube-prometheus-grafana", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/monitoring/service-aliases.yaml:Service/kube-prometheus-kube-prome-prometheus", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/monitoring/service-aliases.yaml:Service/prometheus", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/monitoring/service-aliases.yaml:Service/pyroscope", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "src/devops_cli/ai/review/verdicts.py:55", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "/workspaces/devops-cli/k8s/llm/profiles/ollama-profiles.yaml:36", + "status": "UNVERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": null + }, + { + "location": "/workspaces/devops-cli/src/devops_cli/ai/rag/qdrant.py:18", + "status": "UNVERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": null + }, + { + "location": "/workspaces/devops-cli/src/devops_cli/config/settings.py:19", + "status": "UNVERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": null + }, + { + "location": "src/devops_cli/ai/mcp/server.py:202", + "status": "UNVERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": null + }, + { + "location": "src/devops_cli/ai/review_schema.py:618", + "status": "UNVERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": null + }, + { + "location": "tests/fixtures/review_recall/recall_set.json:9", + "status": "UNVERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": null + }, + { + "location": "tests/fixtures/review_recall/recall_set.json:17", + "status": "UNVERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": null + }, + { + "location": "tests/fixtures/review_recall/recall_set.json:25", + "status": "UNVERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": null + }, + { + "location": "tests/fixtures/review_recall/recall_set.json:41", + "status": "UNVERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": null + }, + { + "location": "tests/fixtures/review_recall/recall_set.json:49", + "status": "UNVERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": null + }, + { + "location": "tests/test_ai_request_priority.py:201-202", + "status": "UNVERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": null + }, + { + "location": "tests/test_batch_2_review_defects.py:182", + "status": "UNVERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": null + }, + { + "location": "tests/test_k8s_tls.py:85", + "status": "UNVERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": null + }, + { + "location": "tests/test_review_scope.py:131", + "status": "UNVERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": null + }, + { + "location": "tests/test_review_verification.py:439", + "status": "UNVERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": null + } + ] +} diff --git a/tests/fixtures/review_labels/sessions/20261003-060647/profile.json b/tests/fixtures/review_labels/sessions/20261003-060647/profile.json new file mode 100644 index 0000000000..2c7977e4ee --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-060647/profile.json @@ -0,0 +1,8 @@ +{ + "session_id": "20261003-060647", + "target": "release/v0.2.25", + "llm_calls": 416, + "prompt_tokens": 4035461, + "total_wall_seconds": 2677.865, + "cost_usd": 0.0 +} diff --git a/tests/fixtures/review_labels/sessions/20261003-065531/files/k8s_cloudflared_deployment_yaml.json b/tests/fixtures/review_labels/sessions/20261003-065531/files/k8s_cloudflared_deployment_yaml.json new file mode 100644 index 0000000000..da661f328d --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-065531/files/k8s_cloudflared_deployment_yaml.json @@ -0,0 +1 @@ +{"file_path": "k8s/cloudflared/deployment.yaml"} diff --git a/tests/fixtures/review_labels/sessions/20261003-065531/files/k8s_llm_profiles_ollama-profiles_yaml.json b/tests/fixtures/review_labels/sessions/20261003-065531/files/k8s_llm_profiles_ollama-profiles_yaml.json new file mode 100644 index 0000000000..1b45addcd5 --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-065531/files/k8s_llm_profiles_ollama-profiles_yaml.json @@ -0,0 +1 @@ +{"file_path": "k8s/llm/profiles/ollama-profiles.yaml"} diff --git a/tests/fixtures/review_labels/sessions/20261003-065531/files/k8s_llm_profiles_services_yaml.json b/tests/fixtures/review_labels/sessions/20261003-065531/files/k8s_llm_profiles_services_yaml.json new file mode 100644 index 0000000000..059159b421 --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-065531/files/k8s_llm_profiles_services_yaml.json @@ -0,0 +1 @@ +{"file_path": "k8s/llm/profiles/services.yaml"} diff --git a/tests/fixtures/review_labels/sessions/20261003-065531/files/k8s_monitoring_service-aliases_yaml.json b/tests/fixtures/review_labels/sessions/20261003-065531/files/k8s_monitoring_service-aliases_yaml.json new file mode 100644 index 0000000000..b5dd76584e --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-065531/files/k8s_monitoring_service-aliases_yaml.json @@ -0,0 +1 @@ +{"file_path": "k8s/monitoring/service-aliases.yaml"} diff --git a/tests/fixtures/review_labels/sessions/20261003-065531/files/src_devops_cli_ai_mcp_server_py.json b/tests/fixtures/review_labels/sessions/20261003-065531/files/src_devops_cli_ai_mcp_server_py.json new file mode 100644 index 0000000000..179c9109bc --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-065531/files/src_devops_cli_ai_mcp_server_py.json @@ -0,0 +1 @@ +{"file_path": "src/devops_cli/ai/mcp/server.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-065531/files/src_devops_cli_ai_rag_embeddings_py.json b/tests/fixtures/review_labels/sessions/20261003-065531/files/src_devops_cli_ai_rag_embeddings_py.json new file mode 100644 index 0000000000..e5d3821315 --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-065531/files/src_devops_cli_ai_rag_embeddings_py.json @@ -0,0 +1 @@ +{"file_path": "src/devops_cli/ai/rag/embeddings.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-065531/files/src_devops_cli_ai_review_common_hallucinations_py.json b/tests/fixtures/review_labels/sessions/20261003-065531/files/src_devops_cli_ai_review_common_hallucinations_py.json new file mode 100644 index 0000000000..33aba81470 --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-065531/files/src_devops_cli_ai_review_common_hallucinations_py.json @@ -0,0 +1 @@ +{"file_path": "src/devops_cli/ai/review/common_hallucinations.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-065531/files/src_devops_cli_ai_spend_pricing_py.json b/tests/fixtures/review_labels/sessions/20261003-065531/files/src_devops_cli_ai_spend_pricing_py.json new file mode 100644 index 0000000000..fefbcace48 --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-065531/files/src_devops_cli_ai_spend_pricing_py.json @@ -0,0 +1 @@ +{"file_path": "src/devops_cli/ai/spend/pricing.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-065531/files/src_devops_cli_commands_ci_py.json b/tests/fixtures/review_labels/sessions/20261003-065531/files/src_devops_cli_commands_ci_py.json new file mode 100644 index 0000000000..886163ea6d --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-065531/files/src_devops_cli_commands_ci_py.json @@ -0,0 +1 @@ +{"file_path": "src/devops_cli/commands/ci.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-065531/files/src_devops_cli_commands_gh_py.json b/tests/fixtures/review_labels/sessions/20261003-065531/files/src_devops_cli_commands_gh_py.json new file mode 100644 index 0000000000..b7cc19ca11 --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-065531/files/src_devops_cli_commands_gh_py.json @@ -0,0 +1 @@ +{"file_path": "src/devops_cli/commands/gh.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-065531/files/src_devops_cli_commands_k8s_security_audit_py.json b/tests/fixtures/review_labels/sessions/20261003-065531/files/src_devops_cli_commands_k8s_security_audit_py.json new file mode 100644 index 0000000000..be1f72177f --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-065531/files/src_devops_cli_commands_k8s_security_audit_py.json @@ -0,0 +1 @@ +{"file_path": "src/devops_cli/commands/k8s/security_audit.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-065531/files/src_devops_cli_security_dive_py.json b/tests/fixtures/review_labels/sessions/20261003-065531/files/src_devops_cli_security_dive_py.json new file mode 100644 index 0000000000..29e4dca53f --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-065531/files/src_devops_cli_security_dive_py.json @@ -0,0 +1 @@ +{"file_path": "src/devops_cli/security/dive.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-065531/files/tests_golden_review_findings_json.json b/tests/fixtures/review_labels/sessions/20261003-065531/files/tests_golden_review_findings_json.json new file mode 100644 index 0000000000..69a335277e --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-065531/files/tests_golden_review_findings_json.json @@ -0,0 +1 @@ +{"file_path": "tests/golden/review_findings.json"} diff --git a/tests/fixtures/review_labels/sessions/20261003-065531/files/tests_test_ai_request_priority_py.json b/tests/fixtures/review_labels/sessions/20261003-065531/files/tests_test_ai_request_priority_py.json new file mode 100644 index 0000000000..cce4f920ad --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-065531/files/tests_test_ai_request_priority_py.json @@ -0,0 +1 @@ +{"file_path": "tests/test_ai_request_priority.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-065531/files/tests_test_crypto_tls_py.json b/tests/fixtures/review_labels/sessions/20261003-065531/files/tests_test_crypto_tls_py.json new file mode 100644 index 0000000000..f175cdd31a --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-065531/files/tests_test_crypto_tls_py.json @@ -0,0 +1 @@ +{"file_path": "tests/test_crypto_tls.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-065531/files/tests_test_hallucination_catalog_learning_py.json b/tests/fixtures/review_labels/sessions/20261003-065531/files/tests_test_hallucination_catalog_learning_py.json new file mode 100644 index 0000000000..9ad63e62ad --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-065531/files/tests_test_hallucination_catalog_learning_py.json @@ -0,0 +1 @@ +{"file_path": "tests/test_hallucination_catalog_learning.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-065531/findings.json b/tests/fixtures/review_labels/sessions/20261003-065531/findings.json new file mode 100644 index 0000000000..8a0d94eaf1 --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-065531/findings.json @@ -0,0 +1,338 @@ +{ + "subject": { + "type": "branch", + "ref": "release/v0.2.25", + "input": "3d555ac817ab1d60" + }, + "findings": [ + { + "location": "app/shell.py:4", + "status": "VERIFIED", + "severity": "HIGH", + "reportable": true, + "verified_by": "llm" + }, + { + "location": "src/devops_cli/ai/mcp/server.py:201", + "status": "VERIFIED", + "severity": "HIGH", + "reportable": true, + "verified_by": "llm" + }, + { + "location": "src/devops_cli/commands/gh.py:333", + "status": "VERIFIED", + "severity": "HIGH", + "reportable": true, + "verified_by": "llm" + }, + { + "location": "src/devops_cli/ai/spend/pricing.py:55", + "status": "VERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": "llm" + }, + { + "location": "src/devops_cli/ai/spend/pricing.py:67", + "status": "VERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": "llm" + }, + { + "location": "src/devops_cli/ai/spend/pricing.py:137", + "status": "VERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": "llm" + }, + { + "location": "src/devops_cli/commands/gh.py:254", + "status": "VERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": "llm" + }, + { + "location": "src/devops_cli/security/dive.py:112", + "status": "VERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": "llm" + }, + { + "location": "/workspaces/devops-cli/tests/test_crypto_tls.py:243", + "status": "VERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": "llm" + }, + { + "location": "src/devops_cli/ai/spend/pricing.py:97", + "status": "VERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": "llm" + }, + { + "location": "src/devops_cli/ai/rag/embeddings.py:196", + "status": "UNVERIFIED", + "severity": "HIGH", + "reportable": true, + "verified_by": null + }, + { + "location": "src/devops_cli/ai/rag/embeddings.py:738", + "status": "UNVERIFIED", + "severity": "HIGH", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-128gib", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-16gib-fast", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-32gib", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-48gib-fast", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-48gib-slow", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-64gib", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-64gib-standard", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-72gib", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-96gib", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-fast", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-slow", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-standard", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/monitoring/service-aliases.yaml:Service/kube-prometheus-grafana", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/monitoring/service-aliases.yaml:Service/kube-prometheus-kube-prome-prometheus", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/monitoring/service-aliases.yaml:Service/prometheus", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/monitoring/service-aliases.yaml:Service/pyroscope", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "src/devops_cli/ai/rag/embeddings.py:206", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "src/devops_cli/ai/review/common_hallucinations.py:272", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "src/devops_cli/ai/review/common_hallucinations.py:294", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "src/devops_cli/commands/k8s/security_audit.py:45-55", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/cloudflared/deployment.yaml:Deployment/cloudflared", + "status": "UNVERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/ollama-profiles.yaml:DaemonSet/ollama-16gib", + "status": "UNVERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/ollama-profiles.yaml:DaemonSet/ollama-24gib", + "status": "UNVERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/ollama-profiles.yaml:DaemonSet/ollama-32gib", + "status": "UNVERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/ollama-profiles.yaml:DaemonSet/ollama-48gib", + "status": "UNVERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/ollama-profiles.yaml:DaemonSet/ollama-72gib", + "status": "UNVERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/ollama-profiles.yaml:DaemonSet/ollama-96gib", + "status": "UNVERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": null + }, + { + "location": "src/devops_cli/ai/review/common_hallucinations.py:229", + "status": "UNVERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": null + }, + { + "location": "src/devops_cli/commands/ci.py:442-448", + "status": "UNVERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": null + }, + { + "location": "tests/golden/review_findings.json:374", + "status": "UNVERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": null + }, + { + "location": "tests/golden/review_findings.json:441", + "status": "UNVERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": null + }, + { + "location": "tests/test_ai_request_priority.py:202", + "status": "UNVERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": null + }, + { + "location": "tests/test_hallucination_catalog_learning.py:35", + "status": "UNVERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": null + }, + { + "location": "tests/test_hallucination_catalog_learning.py:35", + "status": "UNVERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": null + }, + { + "location": "tests/test_hallucination_catalog_learning.py:42", + "status": "UNVERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": null + } + ] +} diff --git a/tests/fixtures/review_labels/sessions/20261003-065531/profile.json b/tests/fixtures/review_labels/sessions/20261003-065531/profile.json new file mode 100644 index 0000000000..a23a5ee9de --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-065531/profile.json @@ -0,0 +1,8 @@ +{ + "session_id": "20261003-065531", + "target": "release/v0.2.25", + "llm_calls": 408, + "prompt_tokens": 3829935, + "total_wall_seconds": 1908.125, + "cost_usd": 0.0 +} diff --git a/tests/fixtures/review_labels/sessions/20261003-073236/files/k8s_cloudflared_deployment_yaml.json b/tests/fixtures/review_labels/sessions/20261003-073236/files/k8s_cloudflared_deployment_yaml.json new file mode 100644 index 0000000000..da661f328d --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-073236/files/k8s_cloudflared_deployment_yaml.json @@ -0,0 +1 @@ +{"file_path": "k8s/cloudflared/deployment.yaml"} diff --git a/tests/fixtures/review_labels/sessions/20261003-073236/files/k8s_llm_profiles_ollama-profiles_yaml.json b/tests/fixtures/review_labels/sessions/20261003-073236/files/k8s_llm_profiles_ollama-profiles_yaml.json new file mode 100644 index 0000000000..1b45addcd5 --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-073236/files/k8s_llm_profiles_ollama-profiles_yaml.json @@ -0,0 +1 @@ +{"file_path": "k8s/llm/profiles/ollama-profiles.yaml"} diff --git a/tests/fixtures/review_labels/sessions/20261003-073236/files/k8s_llm_profiles_services_yaml.json b/tests/fixtures/review_labels/sessions/20261003-073236/files/k8s_llm_profiles_services_yaml.json new file mode 100644 index 0000000000..059159b421 --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-073236/files/k8s_llm_profiles_services_yaml.json @@ -0,0 +1 @@ +{"file_path": "k8s/llm/profiles/services.yaml"} diff --git a/tests/fixtures/review_labels/sessions/20261003-073236/files/k8s_monitoring_service-aliases_yaml.json b/tests/fixtures/review_labels/sessions/20261003-073236/files/k8s_monitoring_service-aliases_yaml.json new file mode 100644 index 0000000000..b5dd76584e --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-073236/files/k8s_monitoring_service-aliases_yaml.json @@ -0,0 +1 @@ +{"file_path": "k8s/monitoring/service-aliases.yaml"} diff --git a/tests/fixtures/review_labels/sessions/20261003-073236/files/k8s_otel_networkpolicy_yaml.json b/tests/fixtures/review_labels/sessions/20261003-073236/files/k8s_otel_networkpolicy_yaml.json new file mode 100644 index 0000000000..d978b9af2d --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-073236/files/k8s_otel_networkpolicy_yaml.json @@ -0,0 +1 @@ +{"file_path": "k8s/otel/networkpolicy.yaml"} diff --git a/tests/fixtures/review_labels/sessions/20261003-073236/files/src_devops_cli_ai_client_unified_py.json b/tests/fixtures/review_labels/sessions/20261003-073236/files/src_devops_cli_ai_client_unified_py.json new file mode 100644 index 0000000000..03f6ab1f10 --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-073236/files/src_devops_cli_ai_client_unified_py.json @@ -0,0 +1 @@ +{"file_path": "src/devops_cli/ai/client/unified.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-073236/files/src_devops_cli_ai_mcp_server_py.json b/tests/fixtures/review_labels/sessions/20261003-073236/files/src_devops_cli_ai_mcp_server_py.json new file mode 100644 index 0000000000..179c9109bc --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-073236/files/src_devops_cli_ai_mcp_server_py.json @@ -0,0 +1 @@ +{"file_path": "src/devops_cli/ai/mcp/server.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-073236/files/src_devops_cli_ai_rag_embeddings_py.json b/tests/fixtures/review_labels/sessions/20261003-073236/files/src_devops_cli_ai_rag_embeddings_py.json new file mode 100644 index 0000000000..e5d3821315 --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-073236/files/src_devops_cli_ai_rag_embeddings_py.json @@ -0,0 +1 @@ +{"file_path": "src/devops_cli/ai/rag/embeddings.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-073236/files/src_devops_cli_ai_review_pipeline_py.json b/tests/fixtures/review_labels/sessions/20261003-073236/files/src_devops_cli_ai_review_pipeline_py.json new file mode 100644 index 0000000000..94f9d6975c --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-073236/files/src_devops_cli_ai_review_pipeline_py.json @@ -0,0 +1 @@ +{"file_path": "src/devops_cli/ai/review/pipeline.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-073236/files/src_devops_cli_commands_ci_py.json b/tests/fixtures/review_labels/sessions/20261003-073236/files/src_devops_cli_commands_ci_py.json new file mode 100644 index 0000000000..886163ea6d --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-073236/files/src_devops_cli_commands_ci_py.json @@ -0,0 +1 @@ +{"file_path": "src/devops_cli/commands/ci.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-073236/files/src_devops_cli_commands_gh_py.json b/tests/fixtures/review_labels/sessions/20261003-073236/files/src_devops_cli_commands_gh_py.json new file mode 100644 index 0000000000..b7cc19ca11 --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-073236/files/src_devops_cli_commands_gh_py.json @@ -0,0 +1 @@ +{"file_path": "src/devops_cli/commands/gh.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-073236/files/src_devops_cli_commands_telemetry_py.json b/tests/fixtures/review_labels/sessions/20261003-073236/files/src_devops_cli_commands_telemetry_py.json new file mode 100644 index 0000000000..a2763763b0 --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-073236/files/src_devops_cli_commands_telemetry_py.json @@ -0,0 +1 @@ +{"file_path": "src/devops_cli/commands/telemetry.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-073236/files/src_devops_cli_github_metrics_py.json b/tests/fixtures/review_labels/sessions/20261003-073236/files/src_devops_cli_github_metrics_py.json new file mode 100644 index 0000000000..92cda6850b --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-073236/files/src_devops_cli_github_metrics_py.json @@ -0,0 +1 @@ +{"file_path": "src/devops_cli/github/metrics.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-073236/files/src_devops_cli_security_base_py.json b/tests/fixtures/review_labels/sessions/20261003-073236/files/src_devops_cli_security_base_py.json new file mode 100644 index 0000000000..167c428be8 --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-073236/files/src_devops_cli_security_base_py.json @@ -0,0 +1 @@ +{"file_path": "src/devops_cli/security/base.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-073236/files/tests_golden_review_findings_json.json b/tests/fixtures/review_labels/sessions/20261003-073236/files/tests_golden_review_findings_json.json new file mode 100644 index 0000000000..69a335277e --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-073236/files/tests_golden_review_findings_json.json @@ -0,0 +1 @@ +{"file_path": "tests/golden/review_findings.json"} diff --git a/tests/fixtures/review_labels/sessions/20261003-073236/files/tests_test_ai_request_priority_py.json b/tests/fixtures/review_labels/sessions/20261003-073236/files/tests_test_ai_request_priority_py.json new file mode 100644 index 0000000000..cce4f920ad --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-073236/files/tests_test_ai_request_priority_py.json @@ -0,0 +1 @@ +{"file_path": "tests/test_ai_request_priority.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-073236/files/tests_test_crypto_tls_py.json b/tests/fixtures/review_labels/sessions/20261003-073236/files/tests_test_crypto_tls_py.json new file mode 100644 index 0000000000..f175cdd31a --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-073236/files/tests_test_crypto_tls_py.json @@ -0,0 +1 @@ +{"file_path": "tests/test_crypto_tls.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-073236/files/tests_test_hallucination_catalog_learning_py.json b/tests/fixtures/review_labels/sessions/20261003-073236/files/tests_test_hallucination_catalog_learning_py.json new file mode 100644 index 0000000000..9ad63e62ad --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-073236/files/tests_test_hallucination_catalog_learning_py.json @@ -0,0 +1 @@ +{"file_path": "tests/test_hallucination_catalog_learning.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-073236/files/tests_test_review_static_analyzers_py.json b/tests/fixtures/review_labels/sessions/20261003-073236/files/tests_test_review_static_analyzers_py.json new file mode 100644 index 0000000000..59bfd333cf --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-073236/files/tests_test_review_static_analyzers_py.json @@ -0,0 +1 @@ +{"file_path": "tests/test_review_static_analyzers.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-073236/findings.json b/tests/fixtures/review_labels/sessions/20261003-073236/findings.json new file mode 100644 index 0000000000..be364e69c6 --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-073236/findings.json @@ -0,0 +1,331 @@ +{ + "subject": { + "type": "branch", + "ref": "release/v0.2.25", + "input": "3d555ac817ab1d60" + }, + "findings": [ + { + "location": "app/shell.py:4", + "status": "VERIFIED", + "severity": "HIGH", + "reportable": true, + "verified_by": "llm" + }, + { + "location": "src/devops_cli/commands/ci.py:357-364", + "status": "VERIFIED", + "severity": "HIGH", + "reportable": true, + "verified_by": "llm" + }, + { + "location": "src/devops_cli/commands/gh.py:333-335", + "status": "VERIFIED", + "severity": "HIGH", + "reportable": true, + "verified_by": "llm" + }, + { + "location": "k8s/llm/profiles/ollama-profiles.yaml:350", + "status": "VERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": "llm" + }, + { + "location": "k8s/llm/profiles/ollama-profiles.yaml:412", + "status": "VERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": "llm" + }, + { + "location": "src/devops_cli/ai/mcp/server.py:201", + "status": "VERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": "llm" + }, + { + "location": "src/devops_cli/ai/review/pipeline.py:1020", + "status": "VERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": "llm" + }, + { + "location": "src/devops_cli/security/base.py:226", + "status": "VERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": "llm" + }, + { + "location": "/workspaces/devops-cli/tests/test_crypto_tls.py:243", + "status": "VERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": "llm" + }, + { + "location": "k8s/llm/profiles/ollama-profiles.yaml:359", + "status": "UNVERIFIED", + "severity": "HIGH", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/otel/networkpolicy.yaml:32", + "status": "UNVERIFIED", + "severity": "HIGH", + "reportable": true, + "verified_by": null + }, + { + "location": "src/devops_cli/ai/rag/embeddings.py:196", + "status": "UNVERIFIED", + "severity": "HIGH", + "reportable": true, + "verified_by": null + }, + { + "location": "src/devops_cli/commands/telemetry.py:320-327", + "status": "UNVERIFIED", + "severity": "HIGH", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-128gib", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-16gib-fast", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-32gib", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-48gib", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-48gib-fast", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-48gib-slow", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-64gib", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-64gib-standard", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-72gib", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-96gib", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-fast", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-slow", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-standard", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/monitoring/service-aliases.yaml:Service/kube-prometheus-grafana", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/monitoring/service-aliases.yaml:Service/kube-prometheus-kube-prome-prometheus", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/monitoring/service-aliases.yaml:Service/prometheus", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/monitoring/service-aliases.yaml:Service/pyroscope", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "src/devops_cli/ai/client/unified.py:80", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "src/devops_cli/ai/rag/embeddings.py:703", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "src/devops_cli/ai/review/pipeline.py:2850", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "src/devops_cli/ai/review/pipeline.py:3091", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "src/devops_cli/commands/ci.py:442-448", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "src/devops_cli/commands/gh.py:254-259", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "src/devops_cli/commands/gh.py:419-425", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "src/devops_cli/github/metrics.py:176", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/cloudflared/deployment.yaml:Deployment/cloudflared", + "status": "UNVERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": null + }, + { + "location": "src/devops_cli/ai/mcp/server.py:1146", + "status": "UNVERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": null + }, + { + "location": "tests/test_ai_request_priority.py:201-202", + "status": "UNVERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": null + }, + { + "location": "tests/test_hallucination_catalog_learning.py:35", + "status": "UNVERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": null + }, + { + "location": "tests/test_hallucination_catalog_learning.py:85", + "status": "UNVERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": null + }, + { + "location": "tests/test_review_static_analyzers.py:93", + "status": "UNVERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": null + }, + { + "location": "tests/test_review_static_analyzers.py:193", + "status": "UNVERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": null + }, + { + "location": "src/devops_cli/ai/review/pipeline.py:1824", + "status": "MITIGATED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": "llm" + } + ] +} diff --git a/tests/fixtures/review_labels/sessions/20261003-073236/profile.json b/tests/fixtures/review_labels/sessions/20261003-073236/profile.json new file mode 100644 index 0000000000..a630b08911 --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-073236/profile.json @@ -0,0 +1,8 @@ +{ + "session_id": "20261003-073236", + "target": "release/v0.2.25", + "llm_calls": 411, + "prompt_tokens": 3883936, + "total_wall_seconds": 1738.437, + "cost_usd": 0.0 +} diff --git a/tests/fixtures/review_labels/sessions/20261003-102523/files/k8s_cloudflared_deployment_yaml.json b/tests/fixtures/review_labels/sessions/20261003-102523/files/k8s_cloudflared_deployment_yaml.json new file mode 100644 index 0000000000..da661f328d --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-102523/files/k8s_cloudflared_deployment_yaml.json @@ -0,0 +1 @@ +{"file_path": "k8s/cloudflared/deployment.yaml"} diff --git a/tests/fixtures/review_labels/sessions/20261003-102523/files/k8s_llm_profiles_services_yaml.json b/tests/fixtures/review_labels/sessions/20261003-102523/files/k8s_llm_profiles_services_yaml.json new file mode 100644 index 0000000000..059159b421 --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-102523/files/k8s_llm_profiles_services_yaml.json @@ -0,0 +1 @@ +{"file_path": "k8s/llm/profiles/services.yaml"} diff --git a/tests/fixtures/review_labels/sessions/20261003-102523/files/k8s_monitoring_service-aliases_yaml.json b/tests/fixtures/review_labels/sessions/20261003-102523/files/k8s_monitoring_service-aliases_yaml.json new file mode 100644 index 0000000000..b5dd76584e --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-102523/files/k8s_monitoring_service-aliases_yaml.json @@ -0,0 +1 @@ +{"file_path": "k8s/monitoring/service-aliases.yaml"} diff --git a/tests/fixtures/review_labels/sessions/20261003-102523/files/k8s_otel_networkpolicy_yaml.json b/tests/fixtures/review_labels/sessions/20261003-102523/files/k8s_otel_networkpolicy_yaml.json new file mode 100644 index 0000000000..d978b9af2d --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-102523/files/k8s_otel_networkpolicy_yaml.json @@ -0,0 +1 @@ +{"file_path": "k8s/otel/networkpolicy.yaml"} diff --git a/tests/fixtures/review_labels/sessions/20261003-102523/files/src_devops_cli_ai_rag_investigator_py.json b/tests/fixtures/review_labels/sessions/20261003-102523/files/src_devops_cli_ai_rag_investigator_py.json new file mode 100644 index 0000000000..9a6ad0ae5c --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-102523/files/src_devops_cli_ai_rag_investigator_py.json @@ -0,0 +1 @@ +{"file_path": "src/devops_cli/ai/rag/investigator.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-102523/files/src_devops_cli_ai_spend_pricing_py.json b/tests/fixtures/review_labels/sessions/20261003-102523/files/src_devops_cli_ai_spend_pricing_py.json new file mode 100644 index 0000000000..fefbcace48 --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-102523/files/src_devops_cli_ai_spend_pricing_py.json @@ -0,0 +1 @@ +{"file_path": "src/devops_cli/ai/spend/pricing.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-102523/files/src_devops_cli_commands_docker_py.json b/tests/fixtures/review_labels/sessions/20261003-102523/files/src_devops_cli_commands_docker_py.json new file mode 100644 index 0000000000..652a8cb8e3 --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-102523/files/src_devops_cli_commands_docker_py.json @@ -0,0 +1 @@ +{"file_path": "src/devops_cli/commands/docker.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-102523/files/src_devops_cli_commands_k8s_security_audit_py.json b/tests/fixtures/review_labels/sessions/20261003-102523/files/src_devops_cli_commands_k8s_security_audit_py.json new file mode 100644 index 0000000000..be1f72177f --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-102523/files/src_devops_cli_commands_k8s_security_audit_py.json @@ -0,0 +1 @@ +{"file_path": "src/devops_cli/commands/k8s/security_audit.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-102523/files/tests_fixtures_review_recall_recall_set_json.json b/tests/fixtures/review_labels/sessions/20261003-102523/files/tests_fixtures_review_recall_recall_set_json.json new file mode 100644 index 0000000000..c9596976fc --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-102523/files/tests_fixtures_review_recall_recall_set_json.json @@ -0,0 +1 @@ +{"file_path": "tests/fixtures/review_recall/recall_set.json"} diff --git a/tests/fixtures/review_labels/sessions/20261003-102523/files/tests_golden_review_findings_json.json b/tests/fixtures/review_labels/sessions/20261003-102523/files/tests_golden_review_findings_json.json new file mode 100644 index 0000000000..69a335277e --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-102523/files/tests_golden_review_findings_json.json @@ -0,0 +1 @@ +{"file_path": "tests/golden/review_findings.json"} diff --git a/tests/fixtures/review_labels/sessions/20261003-102523/files/tests_test_ai_request_priority_py.json b/tests/fixtures/review_labels/sessions/20261003-102523/files/tests_test_ai_request_priority_py.json new file mode 100644 index 0000000000..cce4f920ad --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-102523/files/tests_test_ai_request_priority_py.json @@ -0,0 +1 @@ +{"file_path": "tests/test_ai_request_priority.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-102523/files/tests_test_crypto_tls_py.json b/tests/fixtures/review_labels/sessions/20261003-102523/files/tests_test_crypto_tls_py.json new file mode 100644 index 0000000000..f175cdd31a --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-102523/files/tests_test_crypto_tls_py.json @@ -0,0 +1 @@ +{"file_path": "tests/test_crypto_tls.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-102523/files/tests_test_k8s_port_forward_daemon_py.json b/tests/fixtures/review_labels/sessions/20261003-102523/files/tests_test_k8s_port_forward_daemon_py.json new file mode 100644 index 0000000000..ba744c6885 --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-102523/files/tests_test_k8s_port_forward_daemon_py.json @@ -0,0 +1 @@ +{"file_path": "tests/test_k8s_port_forward_daemon.py"} diff --git a/tests/fixtures/review_labels/sessions/20261003-102523/findings.json b/tests/fixtures/review_labels/sessions/20261003-102523/findings.json new file mode 100644 index 0000000000..43299c4265 --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-102523/findings.json @@ -0,0 +1,205 @@ +{ + "subject": { + "type": "branch", + "ref": "release/v0.2.25", + "input": "3d555ac817ab1d60" + }, + "findings": [ + { + "location": "app/shell.py:4", + "status": "VERIFIED", + "severity": "CRITICAL", + "reportable": true, + "verified_by": "llm" + }, + { + "location": "k8s/otel/networkpolicy.yaml:30-32", + "status": "VERIFIED", + "severity": "HIGH", + "reportable": true, + "verified_by": "llm" + }, + { + "location": "src/devops_cli/commands/docker.py:382", + "status": "VERIFIED", + "severity": "HIGH", + "reportable": true, + "verified_by": "llm" + }, + { + "location": "src/devops_cli/commands/docker.py:411", + "status": "VERIFIED", + "severity": "HIGH", + "reportable": true, + "verified_by": "llm" + }, + { + "location": "/workspaces/devops-cli/tests/test_crypto_tls.py:243", + "status": "VERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": "llm" + }, + { + "location": "src/devops_cli/ai/rag/investigator.py:280-295", + "status": "UNVERIFIED", + "severity": "HIGH", + "reportable": true, + "verified_by": null + }, + { + "location": "src/devops_cli/ai/spend/pricing.py:53-56", + "status": "UNVERIFIED", + "severity": "HIGH", + "reportable": true, + "verified_by": null + }, + { + "location": "src/devops_cli/ai/spend/pricing.py:65-68", + "status": "UNVERIFIED", + "severity": "HIGH", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-128gib", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-32gib", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-48gib-fast", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-48gib-slow", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-64gib", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-64gib-standard", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-72gib", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-96gib", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-fast", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-slow", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/llm/profiles/services.yaml:Service/ollama-standard", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/monitoring/service-aliases.yaml:Service/kube-prometheus-grafana", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/monitoring/service-aliases.yaml:Service/kube-prometheus-kube-prome-prometheus", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/monitoring/service-aliases.yaml:Service/prometheus", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/monitoring/service-aliases.yaml:Service/pyroscope", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "src/devops_cli/commands/k8s/security_audit.py:45-55", + "status": "UNVERIFIED", + "severity": "MEDIUM", + "reportable": true, + "verified_by": null + }, + { + "location": "k8s/cloudflared/deployment.yaml:Deployment/cloudflared", + "status": "UNVERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": null + }, + { + "location": "tests/test_ai_request_priority.py:201-202", + "status": "UNVERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": null + }, + { + "location": "tests/test_k8s_port_forward_daemon.py:26-30", + "status": "UNVERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": null + }, + { + "location": "tests/test_k8s_port_forward_daemon.py:28-29", + "status": "UNVERIFIED", + "severity": "LOW", + "reportable": true, + "verified_by": null + } + ] +} diff --git a/tests/fixtures/review_labels/sessions/20261003-102523/profile.json b/tests/fixtures/review_labels/sessions/20261003-102523/profile.json new file mode 100644 index 0000000000..9daa328275 --- /dev/null +++ b/tests/fixtures/review_labels/sessions/20261003-102523/profile.json @@ -0,0 +1,8 @@ +{ + "session_id": "20261003-102523", + "target": "release/v0.2.25", + "llm_calls": 407, + "prompt_tokens": 3716743, + "total_wall_seconds": 1472.511, + "cost_usd": 0.0 +} diff --git a/tests/test_git_operations.py b/tests/test_git_operations.py index 971f055246..35eee51616 100644 --- a/tests/test_git_operations.py +++ b/tests/test_git_operations.py @@ -4,6 +4,7 @@ import subprocess from collections.abc import Callable +from datetime import UTC, datetime from pathlib import Path from unittest.mock import MagicMock, patch @@ -19,6 +20,7 @@ _ensure_known_host, _normalize_clone_url, clone_repo, + commit_snapshot, create_branch, delete_merged_branches, fetch_all, @@ -542,3 +544,34 @@ def test_revision_helpers_report_a_failed_git_call(tmp_path: Path) -> None: ) assert results == (None, "main", []) + + +def test_commit_snapshot_makes_the_same_one_commit_of_the_same_files( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch +) -> None: + """The id is the one `git commit` gives these files with that identity, date and message.""" + monkeypatch.setenv("GIT_CONFIG_GLOBAL", "/dev/null") + monkeypatch.setenv("GIT_CONFIG_NOSYSTEM", "1") + when = datetime(2026, 10, 3, tzinfo=UTC) + commits = [] + for name in ("one", "two"): + (tmp_path / name / "app").mkdir(parents=True) + (tmp_path / name / "app" / "db.py").write_text("query = f'{x}'\n") + (tmp_path / name / "a.py").write_text("x = 1\n") + commits.append( + commit_snapshot( + tmp_path / name, + ["app/db.py", "a.py"], + "The golden review set's files, for a path review\n", + author="devops-cli golden", + email="", + date=when, + ) + ) + repo = gitlib.Repo(tmp_path / "one") + + assert (commits, repo.active_branch.name, len(list(repo.iter_commits()))) == ( + ["63b6e3c00959a24f7f5badfa9508a96cca4504ae"] * 2, + "main", + 1, + ) diff --git a/tests/test_review_prompt_consistency.py b/tests/test_review_prompt_consistency.py index a05532af3b..39f795a325 100644 --- a/tests/test_review_prompt_consistency.py +++ b/tests/test_review_prompt_consistency.py @@ -847,85 +847,6 @@ def test_every_recall_finding_is_in_its_file_at_its_revision() -> None: assert missing == [] -def test_the_recall_score_counts_the_samples_that_found_each_finding(tmp_path: Path) -> None: - """The protocol reviews every file of the set three times, fresh, and scores each finding. - - A finding matches when it names the file, as a repository path or an absolute one, and cites - a line inside the set's range, which spans the defective construct. Sessions S1 to S4 cited - the monitoring policy's world-open rule at its port list (46-48) and the investigator's - `except` at its `try` (280); a range of the cited line alone, widened by three, scored both - as misses and scored a false finding three lines from `VISION.md:12` as a hit. Found counts - the samples whose candidates hold a match, reported the samples whose report does. Every - other finding on the set's files, a location without line numbers as kube-linter gives - among them, is listed for the person to label. - """ - section = _doc_section(_SCORING_RECALL) - - def finding(location: str, title: str) -> dict[str, str]: - return {"location": location, "title": title} - - world = finding("k8s/monitoring/networkpolicy.yaml:19-20", "World ingress") - sessions = { - "s1": ( - [ - world, - finding("/r/t/src/devops_cli/ai/rag/investigator.py:280", "Swallowed error"), - finding("src/devops_cli/ai/spend/pricing.py:60", "Between the excepts"), - ], - [world], - ), - "s2": ( - [ - finding("k8s/otel/networkpolicy.yaml:NetworkPolicy/otel", "No lines"), - finding("k8s/monitoring/networkpolicy.yaml:46-48", "Port list"), - finding("docs/VISION.md:7-9", "Undeclared variable"), - finding("src/devops_cli/ai/review/runner.py:12", "Not in the set"), - ], - [], - ), - } - for name, (candidates, reported) in sessions.items(): - (tmp_path / name).mkdir() - (tmp_path / name / "candidates.json").write_text(json.dumps({"findings": candidates})) - (tmp_path / name / "findings.json").write_text(json.dumps({"findings": reported})) - lines = _run_documented_script( - section, ["score", str(_RECALL_SET), *(str(tmp_path / name) for name in sessions)] - ) - blocks: list[tuple[str, list[tuple[str, str, str]]]] = [] - for line in lines: - if line.startswith(" "): - session, location, title = line.split(maxsplit=2) - blocks[-1][1].append((Path(session).name, location, title)) - else: - blocks.append((line, [])) - - assert blocks == [ - ( - "k8s/monitoring/networkpolicy.yaml:18-47 found 2/2 reported 1/2", - [ - ("s1", "k8s/monitoring/networkpolicy.yaml:19-20", "World ingress"), - ("s2", "k8s/monitoring/networkpolicy.yaml:46-48", "Port list"), - ], - ), - ("k8s/otel/networkpolicy.yaml:18-35 found 0/2 reported 0/2", []), - ( - "src/devops_cli/ai/rag/investigator.py:280-295 found 1/2 reported 0/2", - [("s1", "/r/t/src/devops_cli/ai/rag/investigator.py:280", "Swallowed error")], - ), - ("docs/VISION.md:12-12 found 0/2 reported 0/2", []), - ("src/devops_cli/ai/spend/pricing.py:53-56 found 0/2 reported 0/2", []), - ("src/devops_cli/ai/spend/pricing.py:65-68 found 0/2 reported 0/2", []), - ( - "unmatched on the set's files", - [ - ("s1", "src/devops_cli/ai/spend/pricing.py:60", "Between the excepts"), - ("s2", "k8s/otel/networkpolicy.yaml:NetworkPolicy/otel", "No lines"), - ("s2", "docs/VISION.md:7-9", "Undeclared variable"), - ], - ), - ] - - def test_the_recall_protocol_reviews_every_file_of_the_set_fresh_in_any_shell() -> None: """Each sample reviews all of the set's files with no cache, no scanners and one persona. diff --git a/tests/test_review_score.py b/tests/test_review_score.py new file mode 100644 index 0000000000..3d5462e944 --- /dev/null +++ b/tests/test_review_score.py @@ -0,0 +1,934 @@ +"""Tests for `devops review score`: saved review sessions scored offline against a label file (#1138). + +The committed label file holds the loop study's clusters of S11 and S12–S21, one per findings.json +row. The recorded slices are trimmed copies of S11, S12, S13 and S18, and their expected figures +are the ones the loop evaluation published (its section 2 table, with the S20-style HIGH count +read from the rows), not numbers this scorer produced. +""" + +from __future__ import annotations + +import json +from pathlib import Path +from typing import Any + +import git as gitlib +import pytest +from typer.testing import CliRunner + +from devops_cli.ai.run_store import ( + Mechanism, + RunRecord, + check_regression, + compare_runs, + load_runs, + new_run, +) +from devops_cli.exceptions.validation import ValidationError +from devops_cli.main import app +from devops_cli.review.score import ( + LabelFile, + ScoreReport, + SessionScore, + load_label_file, + materialise_golden, + score_sessions, +) +from devops_cli.security.normalization import NormalizedFinding +from devops_cli.security.sarif import write_sarif + +cli = CliRunner(env={"COLUMNS": "250", "NO_COLOR": "1", "TERM": "dumb"}) + +FIXTURES = Path(__file__).parent / "fixtures" / "review_labels" +LABELS = FIXTURES / "labels.json" +S11, S12, S13, S18 = ( + FIXTURES / "sessions" / name + for name in ("20261003-060647", "20261003-065531", "20261003-073236", "20261003-102523") +) +LOOP_ROWS = { + "20261003-065531": 47, + "20261003-073236": 46, + "20261003-080659": 55, + "20261003-084218": 43, + "20261003-091619": 49, + "20261003-095001": 42, + "20261003-102523": 28, + "20261003-105505": 37, + "20261003-112847": 45, + "20261003-115921": 49, +} +NEW_INPUT = "feedfacefeedface" + + +def _fraction(ratio: Any) -> tuple[int, int]: + return ratio.numerator, ratio.denominator + + +def _write_session( + root: Path, + name: str, + rows: list[dict[str, Any]], + pages: dict[str, list[str]], + *, + digest: str = NEW_INPUT, + sarif: list[NormalizedFinding] | None = None, +) -> Path: + """A saved session: findings.json rows, files/ pages holding their findings' locations.""" + session = root / name + (session / "files").mkdir(parents=True) + findings = [{"status": "UNVERIFIED", "severity": "MEDIUM", **row} for row in rows] + subject = {"type": "path", "ref": "example", "input": digest} + (session / "findings.json").write_text(json.dumps({"subject": subject, "findings": findings})) + for index, (page, locations) in enumerate(pages.items()): + record = {"file_path": page, "findings": [{"location": loc} for loc in locations]} + (session / "files" / f"page{index}.json").write_text(json.dumps(record)) + if sarif is not None: + write_sarif(sarif, session / "findings.sarif") + return session + + +def _label(key: str, label: str = "false", **identity: Any) -> dict[str, Any]: + return { + "identity": {"key": key, "producer": "persona", "origin": identity.get("path"), **identity}, + "label": label, + "defect_id": key, + "note": "test label", + "labeller": "a person", + "date": "2026-10-09", + } + + +def _write_labels( + root: Path, labels: list[dict[str, Any]], recall_set: Path | None = None, **inputs: Any +) -> Path: + """A label file of one tuning input for the new sessions' digest.""" + labelled_input = {"name": "new", "split": "tuning", "digests": [NEW_INPUT], **inputs} + label_file: dict[str, Any] = {"inputs": [labelled_input], "labels": labels} + if recall_set is not None: + label_file["recall_set"] = str(recall_set) + path = root / "labels.json" + path.write_text(json.dumps(label_file)) + return path + + +RECALL_SET = FIXTURES.parent / "review_recall" / "recall_set.json" + + +# --- (a) the label file covers every S11 and loop row ----------------------------------------- + + +def test_the_label_file_maps_every_s11_and_loop_row_to_a_label() -> None: + """Every findings.json row of S11 and the loop has a cluster, and every cluster a label.""" + label_file: LabelFile = load_label_file(LABELS) + row_counts = {sid: len(rows) for i in label_file.inputs for sid, rows in i.sessions.items()} + keys = {label.identity.key for label in label_file.labels} + mapped = {key for i in label_file.inputs for rows in i.sessions.values() for key in rows} + + assert ( + row_counts, + sum(row_counts.values()), + mapped - keys, + {label.label for label in label_file.labels}, + {i.name: i.split for i in label_file.inputs}, + ) == ( + {"20261003-060647": 51, **LOOP_ROWS}, + 492, + set(), + {"valid-strict", "valid-lenient", "opinion", "false"}, + {"s11": "tuning", "loop": "tuning", "golden": "held-out"}, + ) + + +def test_a_row_map_naming_no_label_is_refused(tmp_path: Path) -> None: + labels = _write_labels(tmp_path, [_label("C1", path="a.py")], sessions={"s": ["C1", "C2"]}) + + with pytest.raises(ValidationError, match="C2"): + load_label_file(labels) + + +def test_a_session_whose_rows_differ_from_its_row_map_is_refused(tmp_path: Path) -> None: + session = _write_session(tmp_path, "s", [{"location": "a.py:1"}], {"a.py": []}) + labels = _write_labels(tmp_path, [_label("C1", path="a.py")], sessions={"s": ["C1", "C1"]}) + + with pytest.raises(ValidationError, match="2 rows"): + score_sessions([session], labels) + + +# --- (b) recorded slices reproduce the published baselines ------------------------------------- + + +def _alone(*sessions: Path) -> list[SessionScore]: + """Each session scored on its own, so no input has two sessions and no κ is computed: only + the stability test pays statsmodels' import, and every other test stays under a second.""" + return [score_sessions([session], LABELS).sessions[0] for session in sessions] + + +def test_the_recorded_slices_reproduce_the_published_precision() -> None: + """S11 prints 12/51, 11/51 and 4/30; each loop slice prints its section 2 row.""" + assert [ + ( + s.rows, + _fraction(s.lenient), + _fraction(s.strict), + _fraction(s.distinct), + _fraction(s.high), + _fraction(s.verified), + _fraction(s.verified_strict), + ) + for s in _alone(S11, S12, S13, S18) + ] == [ + (51, (12, 51), (11, 51), (4, 30), (1, 3), (1, 7), (0, 7)), + (47, (9, 47), (6, 47), (4, 28), (0, 5), (3, 10), (0, 10)), + (46, (1, 46), (0, 46), (1, 31), (1, 7), (0, 9), (0, 9)), + (28, (4, 28), (0, 28), (4, 15), (4, 7), (1, 5), (0, 5)), + ] + + +def test_the_loop_slices_pin_their_stability_and_pooled_precision() -> None: + """Jaccard of the three loop slices' row clusters, and Fleiss κ over the 19 they all report. + + Both were computed from clusters.json when the labels were transcribed, as the task file + records; every identity the three report carries one status in all three, so κ is 1. This is + the one test that computes κ, so it alone pays statsmodels' import. + """ + report: ScoreReport = score_sessions([S11, S12, S13, S18], LABELS) + s11, loop = report.groups + metrics = report.run_metrics() + + assert ( + (s11.input, s11.sessions, s11.jaccard.value, s11.kappa.value, _fraction(s11.lenient)), + (loop.input, loop.split, loop.sessions, _fraction(loop.lenient), _fraction(loop.strict)), + (round(loop.jaccard.value or 0, 4), loop.jaccard.n), + (loop.kappa.value, loop.kappa.n), + (metrics["stability_jaccard"], metrics["stability_kappa"], metrics["not_computable"]), + ) == ( + ("s11", 1, None, None, (12, 51)), + ("loop", "tuning", 3, (14, 121), (6, 121)), + (0.3672, 3), + (1.0, 19), + (0.3672, 1.0, {}), + ) + + +def test_precision_splits_by_producer() -> None: + by_producer = score_sessions([S11], LABELS).sessions[0].by_producer + + assert { + name: (s.rows, _fraction(s.lenient), _fraction(s.distinct)) + for name, s in by_producer.items() + } == { + "kube-linter": (25, (9, 25), (1, 4)), + "persona": (17, (1, 17), (1, 17)), + "semgrep": (9, (2, 9), (2, 9)), + } + + +# --- (c) unlabelled rows ------------------------------------------------------------------------- + + +def test_an_unlabelled_row_is_listed_and_every_label_ratio_reads_not_computable( + tmp_path: Path, +) -> None: + session = _write_session( + tmp_path, + "s", + [{"location": "src/a.py:3"}, {"location": "src/a.py:40"}], + {"src/a.py": ["src/a.py:3", "src/a.py:40"]}, + ) + labels = _write_labels(tmp_path, [_label("P1", path="src/a.py", start_line=4, end_line=4)]) + + report = score_sessions([session], labels) + scored = report.sessions[0] + + assert ( + [(u.session, u.row, u.location, u.producer) for u in report.unlabelled], + [r.value for r in (scored.lenient, scored.strict, scored.distinct, scored.known_defects)], + str(scored.lenient), + scored.recall_set.reason, + report.run_metrics()["not_computable"], + ) == ( + [("s", 2, "src/a.py:40", "persona")], + [None, None, None, None], + "not computable (1 of 2 rows unlabelled)", + None, + { + "precision_lenient": "1 of 1 sessions not computable", + "precision_strict": "1 of 1 sessions not computable", + "recall": "1 of 1 sessions not computable", + "stability_jaccard": "no input has two sessions", + "stability_kappa": "no input has two sessions", + }, + ) + + +def test_a_score_whose_new_rows_are_unlabelled_fails_the_run_check(tmp_path: Path) -> None: + """A pipeline change that adds a false finding no label covers cannot pass on precision.""" + pages = {"src/a.py": ["src/a.py:3", "src/a.py:40"]} + before = _write_session(tmp_path, "before", [{"location": "src/a.py:3"}], pages) + after = _write_session( + tmp_path, "after", [{"location": "src/a.py:3"}, {"location": "src/a.py:40"}], pages + ) + labels = _write_labels(tmp_path, [_label("A", "valid-strict", path="src/a.py", start_line=3)]) + + def run(session: Path) -> RunRecord: + metrics = score_sessions([session], labels).run_metrics() + return new_run(Mechanism.REVIEW_SCORE, setup={}, subject={}, results=metrics) + + report = check_regression(compare_runs(run(before), run(after))) + + assert (report.passed, [(v.metric, v.reason) for v in report.verdicts]) == ( + False, + [ + ( + "precision_lenient", + "Precision lenient not computable (1 of 1 sessions not computable)", + ), + ( + "precision_strict", + "Precision strict not computable (1 of 1 sessions not computable)", + ), + ], + ) + + +# --- (d) location and fixture rules --------------------------------------------------------------- + + +def test_a_row_outside_the_reviewed_tree_counts_as_false_without_a_label(tmp_path: Path) -> None: + """A label for app/shell.py would match, but app/shell.py is no page of the session.""" + session = _write_session( + tmp_path, + "s", + [{"location": "app/shell.py:4"}], + {"src/a.py": [], "tests/golden/review_findings.json": ["app/shell.py:4"]}, + ) + labels = _write_labels( + tmp_path, + [_label("C5", "valid-strict", path="app/shell.py", start_line=4, end_line=4)], + ) + + scored = score_sessions([session], labels) + + assert (_fraction(scored.sessions[0].lenient), scored.unlabelled) == ((0, 1), []) + + +def test_the_s11_shell_row_is_outside_its_reviewed_tree() -> None: + pages = {json.loads(p.read_text())["file_path"] for p in (S11 / "files").glob("*.json")} + + assert ("app/shell.py" in pages, "tests/golden/review_findings.json" in pages) == (False, True) + + +def test_a_hit_echoed_from_a_fixture_page_is_not_recall(tmp_path: Path) -> None: + """The persona copied the recall set's record onto pricing.py; that is not finding it.""" + row = {"location": "src/devops_cli/ai/spend/pricing.py:53"} + pricing = "src/devops_cli/ai/spend/pricing.py" + echo = _write_session( + tmp_path, + "echo", + [row], + {pricing: [], "tests/fixtures/review_recall/recall_set.json": [row["location"]]}, + ) + own = _write_session(tmp_path, "own", [row], {pricing: [row["location"]]}) + labels = _write_labels(tmp_path, [], recall_set=RECALL_SET) + + report = score_sessions([echo, own], labels) + + assert [_fraction(s.recall_set) for s in report.sessions] == [(0, 6), (1, 6)] + + +def test_echoed_known_defects_are_not_recall_in_the_slices() -> None: + """S18 reports pricing and investigator only through recall-set echoes, so it found one.""" + assert [_fraction(s.known_defects) for s in _alone(S11, S12, S13, S18)] == [ + (4, 9), + (4, 9), + (1, 9), + (1, 9), + ] + + +# --- (e) n beside every ratio --------------------------------------------------------------------- + + +def _ratios(node: Any) -> list[dict[str, Any]]: + if isinstance(node, dict): + own = [node] if "value" in node else [] + return own + [r for child in node.values() for r in _ratios(child)] + if isinstance(node, list): + return [r for child in node for r in _ratios(child)] + return [] + + +def test_every_ratio_carries_its_n_in_the_table_and_the_json() -> None: + table = cli.invoke(app, ["review", "score", str(S11), str(S12), "--labels", str(LABELS)]) + as_json = cli.invoke( + app, ["review", "score", str(S11), str(S12), "--labels", str(LABELS), "--json"] + ) + ratios = _ratios(json.loads(as_json.stdout)) + + assert ( + table.exit_code, + as_json.exit_code, + all({"numerator", "denominator"} <= r.keys() or "n" in r for r in ratios), + len(ratios) > 20, + all(text in table.stdout for text in ("12/51 (23.5%)", "11/51 (21.6%)", "4/30")), + ) == (0, 0, True, True, True) + + +# --- (f) new-session identity ------------------------------------------------------------------- + + +def test_new_sessions_match_labels_by_fingerprint_loop_key_and_persona_window( + tmp_path: Path, +) -> None: + """Identity comes from findings.sarif, never from a title; persona rows need one label.""" + worktree = "/home/example/worktrees/review-1-commit" + sarif = [ + NormalizedFinding( + tool="bandit", + rule_id="B103", + severity="LOW", + message="chmod", + path="tests/test_tls.py", + line=243, + partial_fingerprints={"fingerprint_v2": "fp-b103"}, + ), + NormalizedFinding( + tool="kube-linter", + rule_id="no-read-only-root-fs", + severity="LOW", + message="rootfs", + path="k8s/app.yaml", + symbol="DaemonSet/app", + ), + ] + rows = [ + { + "location": f"{worktree}/tests/test_tls.py:243", + "cited_code": { + "project": "example", + "file": "tests/test_tls.py", + "line": 243, + "excerpt": "", + }, + }, + {"location": "k8s/app.yaml:DaemonSet/app"}, + {"location": "src/a.py:12"}, + {"location": "src/a.py:30"}, + ] + session = _write_session( + tmp_path, + "s", + rows, + { + "tests/test_tls.py": [], + "k8s/app.yaml": [], + "src/a.py": ["src/a.py:12", "src/a.py:30"], + }, + sarif=sarif, + ) + labels = _write_labels( + tmp_path, + [ + { + **_label("B", path="tests/test_tls.py"), + "identity": { + "key": "B", + "producer": "bandit", + "rule": "B103", + "path": "tests/test_tls.py", + "start_line": 1, + "origin": "tests/test_tls.py", + "fingerprint_v2": "fp-b103", + }, + }, + { + **_label("K", "valid-strict"), + "identity": { + "key": "K", + "producer": "kube-linter", + "rule": "no-read-only-root-fs", + "path": "k8s/app.yaml", + "object": "DaemonSet/app", + "origin": "k8s/app.yaml", + }, + }, + _label("P", "opinion", path="src/a.py", start_line=8, end_line=9), + _label("Q1", path="src/a.py", start_line=27, end_line=27), + _label("Q2", path="src/a.py", start_line=34, end_line=35), + ], + ) + + report = score_sessions([session], labels) + + assert ( + [(u.row, u.location) for u in report.unlabelled], + {name: s.rows for name, s in report.sessions[0].by_producer.items()}, + _fraction(report.sessions[0].by_producer["kube-linter"].strict), + ) == ( + [(4, "src/a.py:30")], + {"bandit": 1, "kube-linter": 1, "persona": 2}, + (1, 1), + ) + + +def test_stored_scanner_paths_are_made_relative_to_the_input_root() -> None: + """S11 stored its Semgrep rows with the checkout's absolute paths; read as they are, the two + valid ollama-profiles.yaml rows would fall outside the reviewed tree and count as false.""" + rows = json.loads((S11 / "findings.json").read_text())["findings"] + semgrep = score_sessions([S11], LABELS).sessions[0].by_producer["semgrep"] + + assert ( + [rows[i]["location"] for i in (8, 36)], + _fraction(semgrep.strict), + ) == ( + [ + "/workspaces/devops-cli/k8s/llm/profiles/ollama-profiles.yaml:53", + "/workspaces/devops-cli/k8s/llm/profiles/ollama-profiles.yaml:36", + ], + (2, 9), + ) + + +def _kube_linter(check: str, fingerprint: str | None = None) -> NormalizedFinding: + return NormalizedFinding( + tool="kube-linter", + rule_id=check, + severity="LOW", + message=check, + path="k8s/app.yaml", + symbol="Deployment/app", + partial_fingerprints={"fingerprint_v2": fingerprint} if fingerprint else {}, + ) + + +def test_two_tool_findings_at_one_place_leave_its_rows_unlabelled(tmp_path: Path) -> None: + """Two kube-linter checks on one object: no row says which it is, so neither label is used; + the same result written twice, as sessions write Bandit's B108, is still one finding.""" + rows = [{"location": "k8s/app.yaml:Deployment/app"}] * 2 + pages = {"k8s/app.yaml": []} + labels = _write_labels( + tmp_path, + [ + { + **_label(check, value), + "identity": { + "key": check, + "producer": "kube-linter", + "rule": check, + "path": "k8s/app.yaml", + "object": "Deployment/app", + "origin": "k8s/app.yaml", + }, + } + for check, value in ( + ("no-read-only-root-fs", "valid-strict"), + ("run-as-non-root", "false"), + ) + ], + ) + two = _write_session( + tmp_path, + "two", + rows, + pages, + sarif=[ + _kube_linter("no-read-only-root-fs", "fp-1"), + _kube_linter("run-as-non-root", "fp-2"), + ], + ) + twice = _write_session( + tmp_path, + "twice", + rows, + pages, + sarif=[_kube_linter("no-read-only-root-fs", "fp-1")] * 2, + ) + + report = score_sessions([two, twice], labels) + + assert ( + [(u.session, u.row, u.producer, u.identity) for u in report.unlabelled], + [str(s.lenient) for s in report.sessions], + ) == ( + [("two", 1, "kube-linter", None), ("two", 2, "kube-linter", None)], + ["not computable (2 of 2 rows unlabelled)", "2/2 (100.0%)"], + ) + + +@pytest.mark.parametrize( + ("findings_json", "match"), + [(None, "No such file"), ("{", "Invalid JSON"), ('{"findings": "none"}', "valid array")], +) +def test_a_session_without_a_readable_findings_json_is_refused( + tmp_path: Path, findings_json: str | None, match: str +) -> None: + """A mistyped SESSION is refused, not scored as a session that reported nothing.""" + session = tmp_path / "session" + session.mkdir() + if findings_json is not None: + (session / "findings.json").write_text(findings_json) + labels = _write_labels(tmp_path, []) + + with pytest.raises(ValidationError, match=f"(?s)Cannot read review session .*{match}"): + score_sessions([session], labels) + + +def test_sessions_without_an_input_digest_are_compared_with_no_other(tmp_path: Path) -> None: + pages = {"src/a.py": ["src/a.py:3"]} + rows = [{"location": "src/a.py:3"}] + first = _write_session(tmp_path, "first", rows, pages, digest="") + second = _write_session(tmp_path, "second", rows, pages, digest="") + labels = _write_labels(tmp_path, [_label("A", path="src/a.py", start_line=3)]) + + groups = score_sessions([first, second], labels).groups + + assert [(g.input, g.sessions, g.jaccard.reason, g.kappa.reason) for g in groups] == [ + ("first", 1, "the session records no input digest", "the session records no input digest"), + ("second", 1, "the session records no input digest", "the session records no input digest"), + ] + + +# --- (g) stability -------------------------------------------------------------------------------- + + +def test_kappa_is_not_computable_for_one_status_or_one_session(tmp_path: Path) -> None: + rows = [{"location": "src/a.py:3"}, {"location": "src/a.py:20"}] + pages = {"src/a.py": ["src/a.py:3", "src/a.py:20"]} + first = _write_session(tmp_path, "first", rows, pages) + second = _write_session(tmp_path, "second", rows[:1], pages) + labels = _write_labels( + tmp_path, + [ + _label("A", path="src/a.py", start_line=3, end_line=3), + _label("B", path="src/a.py", start_line=20, end_line=20), + ], + ) + + pair = score_sessions([first, second], labels).groups[0] + alone = score_sessions([first], labels).groups[0] + + assert ( + (pair.jaccard.value, pair.jaccard.n, pair.kappa.value, pair.kappa.reason), + (alone.jaccard.reason, alone.kappa.reason), + ) == ( + (0.5, 1, None, "every rating is UNVERIFIED"), + ("one session", "one session"), + ) + + +def test_stability_needs_an_identity_on_every_row_and_one_every_session_reported( + tmp_path: Path, +) -> None: + pages = {"src/a.py": ["src/a.py:3", "src/a.py:20", "src/a.py:90"]} + first = _write_session(tmp_path, "first", [{"location": "src/a.py:3"}], pages) + second = _write_session(tmp_path, "second", [{"location": "src/a.py:20"}], pages) + third = _write_session(tmp_path, "third", [{"location": "src/a.py:90"}], pages) + labels = _write_labels( + tmp_path, + [ + _label("A", path="src/a.py", start_line=3, end_line=3), + _label("B", path="src/a.py", start_line=20, end_line=20), + ], + ) + + disjoint = score_sessions([first, second], labels).groups[0] + unidentified = score_sessions([first, third], labels).groups[0] + + assert ( + (disjoint.jaccard.value, disjoint.kappa.reason), + (unidentified.jaccard.reason, unidentified.kappa.reason), + ) == ( + (0.0, "no identity every session reported"), + ("1 rows have no identity", "1 rows have no identity"), + ) + + +# --- (h) golden materialisation ------------------------------------------------------------------- + + +def test_the_golden_set_materialises_as_one_fixed_commit( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch +) -> None: + """The pinned id is the commit `git commit` makes of these files with that author and date.""" + monkeypatch.setenv("GIT_CONFIG_GLOBAL", "/dev/null") + monkeypatch.setenv("GIT_CONFIG_NOSYSTEM", "1") + golden = tmp_path / "golden.json" + golden.write_text(json.dumps({"files": {"app/db.py": "query = f'{x}'\n", "a.py": "x = 1\n"}})) + labels = tmp_path / "labels.json" + labels.write_text( + json.dumps( + { + "inputs": [ + { + "name": "golden", + "split": "held-out", + "source": "golden.json", + "accepted_loss": [{"defect_id": "logic", "reason": "no rule"}], + } + ], + "labels": [], + } + ) + ) + + first = materialise_golden(labels, tmp_path / "one") + second = materialise_golden(labels, tmp_path / "two") + commits = list(gitlib.Repo(tmp_path / "one").iter_commits()) + + assert ( + first.commit, + second.commit, + len(commits), + (tmp_path / "one" / "app" / "db.py").read_text(), + [(loss.defect_id, loss.reason) for loss in first.accepted_loss], + ) == ( + "63b6e3c00959a24f7f5badfa9508a96cca4504ae", + first.commit, + 1, + "query = f'{x}'\n", + [("logic", "no rule")], + ) + + +def test_materialising_into_a_directory_that_holds_files_or_a_file_is_refused( + tmp_path: Path, +) -> None: + (tmp_path / "taken").mkdir() + (tmp_path / "taken" / "file").write_text("x") + (tmp_path / "plain").write_text("x") + + with pytest.raises(ValidationError, match="not empty"): + materialise_golden(LABELS, tmp_path / "taken") + with pytest.raises(ValidationError, match="not a directory"): + materialise_golden(LABELS, tmp_path / "plain") + + +def test_the_committed_golden_input_lists_its_accepted_recall_loss() -> None: + golden = next(i for i in load_label_file(LABELS).inputs if i.name == "golden") + loss = {entry.defect_id for entry in golden.accepted_loss} + + assert ( + {"missing-containment", "missing-depth-limit"} <= loss, + loss & set(golden.known_defects), + len(loss) + len(golden.known_defects), + ) == (True, set(), 24) + + +def test_a_session_whose_digest_is_not_its_mapped_input_is_refused(tmp_path: Path) -> None: + session = _write_session(tmp_path, "s", [{"location": "a.py:1"}], {"a.py": []}, digest="other") + labels = _write_labels(tmp_path, [_label("C1", path="a.py")], sessions={"s": ["C1"]}) + + with pytest.raises(ValidationError, match="reviewed input other"): + score_sessions([session], labels) + + +@pytest.mark.parametrize( + ("label_file", "golden", "match"), + [ + ("{", None, "Cannot read label file"), + ('{"inputs": [], "labels": []}', None, "names no golden input source"), + ( + '{"inputs": [{"name": "g", "split": "held-out", "source": "g.json"}], "labels": []}', + '{"files": {"../escape.py": "x"}}', + "lies outside", + ), + ( + '{"inputs": [{"name": "g", "split": "held-out", "source": "g.json"}], "labels": []}', + '{"files": {"a.py": "x", "sub/../.git/hooks/post-checkout": "x"}}', + "lies in the repository's .git directory", + ), + ( + '{"inputs": [{"name": "g", "split": "held-out", "source": "g.json"}], "labels": []}', + None, + "Cannot read golden set", + ), + ], +) +def test_a_golden_set_that_cannot_be_written_is_refused( + tmp_path: Path, label_file: str, golden: str | None, match: str +) -> None: + (tmp_path / "labels.json").write_text(label_file) + if golden is not None: + (tmp_path / "g.json").write_text(golden) + + with pytest.raises(ValidationError, match=match): + materialise_golden(tmp_path / "labels.json", tmp_path / "out") + assert not (tmp_path / "out" / "a.py").exists() + + +def test_a_recall_set_or_findings_sarif_that_does_not_parse_is_refused(tmp_path: Path) -> None: + session = _write_session(tmp_path, "s", [{"location": "a.py:1"}], {"a.py": []}) + labels = _write_labels(tmp_path, [], recall_set=tmp_path / "missing.json") + (tmp_path / "plain").mkdir() + (session / "findings.sarif").write_text('{"version": "1.0"}') + + with pytest.raises(ValidationError, match="Cannot read recall set"): + score_sessions([session], labels) + with pytest.raises(ValidationError, match="is not SARIF"): + score_sessions([session], _write_labels(tmp_path / "plain", [])) + + +# --- (i) the command records a run ---------------------------------------------------------------- + + +def test_review_score_records_a_run(isolate_data_dir: Path) -> None: + """S11 and S12 are two inputs of one session each, so the run records why it has no + stability figure; the stability test pins the figures a run of one input records.""" + result = cli.invoke( + app, ["review", "score", str(S11), str(S12), "--labels", str(LABELS), "--json"] + ) + (run,) = load_runs(Mechanism.REVIEW_SCORE) + + assert ( + result.exit_code, + run.subject["inputs"], + (run.results["precision_lenient"], run.results["precision_strict"]), + run.results["not_computable"], + run.results["median_llm_calls"], + [group["input"] for group in json.loads(result.stdout)["groups"]], + ) == ( + 0, + ["197b2f088fcf1557", "3d555ac817ab1d60"], + (round(21 / 98, 4), round(17 / 98, 4)), + { + "stability_jaccard": "no input has two sessions", + "stability_kappa": "no input has two sessions", + }, + 412.0, + ["s11", "loop"], + ) + + +def test_review_score_needs_sessions_or_a_golden_directory() -> None: + result = cli.invoke(app, ["review", "score", "--labels", str(LABELS)]) + + assert (result.exit_code, "SESSION" in result.output) == (1, True) + + +def test_review_score_materialises_the_golden_set( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch +) -> None: + monkeypatch.setenv("GIT_CONFIG_GLOBAL", "/dev/null") + monkeypatch.setenv("GIT_CONFIG_NOSYSTEM", "1") + result = cli.invoke( + app, + ["review", "score", "--labels", str(LABELS), "--materialise-golden", str(tmp_path / "g")], + ) + + assert ( + result.exit_code, + "missing-containment" in result.stdout, + (tmp_path / "g" / "core" / "paths.py").is_file(), + ) == (0, True, True) + + +def test_review_score_reports_what_it_refuses(tmp_path: Path) -> None: + bad_labels = tmp_path / "labels.json" + bad_labels.write_text("{") + golden = str(tmp_path / "g") + + def run(*args: str) -> Any: + return cli.invoke(app, ["review", "score", *args]) + + refused = run(str(S12), "--labels", str(bad_labels)) + both = run(str(S12), "--labels", str(LABELS), "--materialise-golden", golden) + no_golden = run("--labels", str(bad_labels), "--materialise-golden", golden) + + assert ( + (refused.exit_code, "Cannot read label file" in refused.output), + (both.exit_code, "takes no SESSION" in both.output), + (no_golden.exit_code, "Cannot read label file" in no_golden.output), + ) == ((1, True), (1, True), (1, True)) + + +def test_review_score_writes_the_golden_set_as_json( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch +) -> None: + monkeypatch.setenv("GIT_CONFIG_GLOBAL", "/dev/null") + monkeypatch.setenv("GIT_CONFIG_NOSYSTEM", "1") + result = cli.invoke( + app, + [ + "review", + "score", + "--labels", + str(LABELS), + "--materialise-golden", + str(tmp_path / "g"), + "--json", + ], + ) + written = json.loads(result.stdout) + + assert (result.exit_code, written["files"], len(written["accepted_loss"])) == (0, 28, 12) + + +def test_the_table_lists_unlabelled_rows_and_the_recall_set(tmp_path: Path) -> None: + session = _write_session(tmp_path, "s", [{"location": "src/a.py:40"}], {"src/a.py": []}) + labels = _write_labels(tmp_path, [], recall_set=RECALL_SET) + + result = cli.invoke(app, ["review", "score", str(session), "--labels", str(labels)]) + + assert ( + result.exit_code, + "Unlabelled Rows (1)" in result.output, + "src/a.py:40" in result.output, + "k8s/otel/networkpolicy.yaml:18-35" in result.output, + "not computable (1 of 1 rows unlabelled)" in result.output, + ) == (0, True, True, True, True) + + +# --- (k) the recall protocol's matching rules ----------------------------------------------------- + + +def test_recall_counts_the_samples_whose_report_cites_each_finding(tmp_path: Path) -> None: + """A match names the set's file and cites a line inside its range, which spans the construct. + + Sessions S1 to S4 cited the monitoring policy's world-open rule at its port list (46-48) and + the investigator's `except` at its `try` (280); a false finding three lines from + `VISION.md:12` is no hit, nor is a location without line numbers, as kube-linter gives. + """ + entries = json.loads(RECALL_SET.read_text())["findings"] + pages = {entry["path"]: [] for entry in entries} + investigator = "src/devops_cli/ai/rag/investigator.py" + s1 = _write_session( + tmp_path, + "s1", + [ + {"location": "k8s/monitoring/networkpolicy.yaml:19-20"}, + { + "location": f"/r/t/{investigator}:280", + "cited_code": {"project": "x", "file": investigator, "line": 280, "excerpt": ""}, + }, + {"location": "src/devops_cli/ai/spend/pricing.py:60"}, + ], + pages, + ) + s2 = _write_session( + tmp_path, + "s2", + [ + {"location": "k8s/otel/networkpolicy.yaml:NetworkPolicy/otel"}, + {"location": "k8s/monitoring/networkpolicy.yaml:46-48"}, + {"location": "docs/VISION.md:7-9"}, + ], + pages, + ) + labels = _write_labels(tmp_path, [], recall_set=RECALL_SET) + + report = score_sessions([s1, s2], labels) + + assert ( + [(e.location, e.reported_in, e.sessions) for e in report.recall_set], + [_fraction(s.recall_set) for s in report.sessions], + ) == ( + [ + ("k8s/monitoring/networkpolicy.yaml:18-47", 2, 2), + ("k8s/otel/networkpolicy.yaml:18-35", 0, 2), + ("src/devops_cli/ai/rag/investigator.py:280-295", 1, 2), + ("docs/VISION.md:12-12", 0, 2), + ("src/devops_cli/ai/spend/pricing.py:53-56", 0, 2), + ("src/devops_cli/ai/spend/pricing.py:65-68", 0, 2), + ], + [(2, 6), (1, 6)], + ) diff --git a/tests/test_run_comparison.py b/tests/test_run_comparison.py index 47c013cdfa..9e358e917e 100644 --- a/tests/test_run_comparison.py +++ b/tests/test_run_comparison.py @@ -307,6 +307,118 @@ def test_check_regression_verdicts() -> None: ) +def _score_run(**results: Any) -> RunRecord: + return _sample_run(Mechanism.REVIEW_SCORE, results=results) + + +def test_score_runs_check_precision_stability_and_calls_at_their_tolerances() -> None: + """A review score's precision and stability may fall, and its model calls rise, only so far.""" + base = _score_run( + precision_lenient=0.20, + precision_strict=0.10, + stability_jaccard=0.40, + stability_kappa=0.50, + median_llm_calls=100, + ) + current = _score_run( + precision_lenient=0.191, + precision_strict=0.10, + stability_jaccard=0.37, + stability_kappa=0.50, + median_llm_calls=115, + ) + comparison = compare_runs(base, current) + tolerant = RegressionTolerances( + max_precision_drop=0.05, max_stability_drop=0.10, max_calls_increase=0.15 + ) + strict = RegressionTolerances( + max_precision_drop=0.04, max_stability_drop=0.07, max_calls_increase=0.14 + ) + + def failed(tolerances: RegressionTolerances) -> list[str]: + report = check_regression(comparison, tolerances) + return sorted(v.metric for v in report.verdicts if not v.passed) + + assert (failed(tolerant), failed(strict)) == ( + [], + ["llm_calls", "precision_lenient", "stability_jaccard"], + ) + + +def test_a_score_figure_the_current_run_could_not_compute_fails_the_check() -> None: + """New false findings leave rows unlabelled, so precision is not computable: that fails.""" + base = _score_run(precision_lenient=0.20, precision_strict=0.10, median_llm_calls=100) + current = _score_run( + median_llm_calls=100, + not_computable={ + "precision_lenient": "1 of 2 sessions not computable", + "precision_strict": "1 of 2 sessions not computable", + }, + ) + + report = check_regression(compare_runs(base, current)) + + assert ( + report.passed, + [(v.metric, v.passed, v.current_value, v.reason) for v in report.verdicts], + ) == ( + False, + [ + ( + "precision_lenient", + False, + None, + "Precision lenient not computable (1 of 2 sessions not computable)", + ), + ( + "precision_strict", + False, + None, + "Precision strict not computable (1 of 2 sessions not computable)", + ), + ("llm_calls", True, 100.0, "llm_calls within tolerance (0.0% <= 20.0%)"), + ], + ) + + +def test_only_a_figure_neither_run_recorded_goes_without_a_verdict() -> None: + """κ the baseline had fails; κ neither had and calls one run never made get no verdict.""" + base = _score_run(precision_lenient=0.20, stability_kappa=0.50) + current = _score_run(precision_lenient=0.20, stability_jaccard=0.30, median_llm_calls=10) + + report = check_regression(compare_runs(base, current)) + + assert (report.passed, [(v.metric, v.passed) for v in report.verdicts]) == ( + False, + [("precision_lenient", True), ("stability_jaccard", True), ("stability_kappa", False)], + ) + + +def test_cli_runs_check_takes_the_score_tolerances(run_env: Path) -> None: + base = _score_run(precision_lenient=0.20, median_llm_calls=100) + current = _score_run(precision_lenient=0.19, median_llm_calls=110) + unlabelled = _score_run( + median_llm_calls=100, not_computable={"precision_lenient": "1 of 1 sessions not computable"} + ) + for run in (base, current, unlabelled): + save_run(run) + + def check(*flags: str, run: RunRecord = current) -> int: + args = ["ai", "runs", "check", run.run_id, "--baseline", base.run_id, *flags] + return cli.invoke(app, args).exit_code + + args = ["ai", "runs", "check", unlabelled.run_id, "--baseline", base.run_id] + blind = cli.invoke(app, [*args, "--max-precision-drop", "1.0"]) + + assert ( + check(), + check("--max-precision-drop", "0.06"), + check("--max-precision-drop", "0.06", "--max-calls-increase", "0.05"), + check("--max-stability-drop", "0.5", "--max-precision-drop", "0.06"), + (blind.exit_code, "not computable" in blind.stdout), + ) == (1, 0, 1, 0, (1, True)) + + def test_cli_runs_list_and_show(run_env: Path) -> None: """Verify devops ai runs list and show outputs.""" rec = _sample_run() diff --git a/uv.lock b/uv.lock index 9cc8623023..2bd666f8ac 100644 --- a/uv.lock +++ b/uv.lock @@ -2,8 +2,12 @@ version = 1 revision = 3 requires-python = ">=3.14" resolution-markers = [ - "python_full_version >= '3.15'", - "python_full_version < '3.15'", + "python_full_version >= '3.15' and sys_platform == 'win32'", + "python_full_version >= '3.15' and sys_platform == 'emscripten'", + "python_full_version >= '3.15' and sys_platform != 'emscripten' and sys_platform != 'win32'", + "python_full_version < '3.15' and sys_platform == 'win32'", + "python_full_version < '3.15' and sys_platform == 'emscripten'", + "python_full_version < '3.15' and sys_platform != 'emscripten' and sys_platform != 'win32'", ] [[package]] @@ -697,6 +701,7 @@ dependencies = [ { name = "qdrant-client" }, { name = "ratelimit" }, { name = "rich" }, + { name = "statsmodels" }, { name = "tenacity" }, { name = "textual" }, { name = "tiktoken" }, @@ -772,6 +777,7 @@ requires-dist = [ { name = "qdrant-client", specifier = "==1.19.1" }, { name = "ratelimit", specifier = "==2.2.1" }, { name = "rich", specifier = "==15.0.0" }, + { name = "statsmodels", specifier = "==0.15.0" }, { name = "tenacity", specifier = "==9.1.4" }, { name = "textual", specifier = "==8.2.8" }, { name = "tiktoken", specifier = "==0.14.0" }, @@ -999,6 +1005,24 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/cc/06/4f138f618dbea66803291274f228f01daf29f306fe8b96bc30dab765df75/filelock-3.32.6-py3-none-any.whl", hash = "sha256:3f16ecd0117feae0dfc147e8c62eb5daeccd8bd800378c3ddf416de9b4feb6b1", size = 100189, upload-time = "2026-09-08T22:57:10.182Z" }, ] +[[package]] +name = "formulaic" +version = "1.2.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "interface-meta" }, + { name = "narwhals" }, + { name = "numpy" }, + { name = "pandas" }, + { name = "scipy" }, + { name = "typing-extensions" }, + { name = "wrapt" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/f1/87/e7b9b39d218793f159d7425e264c0ac196da07f1decc333001502fac02fb/formulaic-1.2.2.tar.gz", hash = "sha256:c99e8f11ff7d327eaecaf63855ca69b7fa0da100ad6c0041ef80912fbac667e6", size = 657522, upload-time = "2026-06-02T18:24:42.632Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/fc/75/0576b03f7889ad25b5385b4f6c69e0543713425a6f193b056c9b0a2e65ce/formulaic-1.2.2-py3-none-any.whl", hash = "sha256:0f84ff49e3fc9dc0e68ab08a0a9427874021aa6c558e66b44dc634a35739b09b", size = 118939, upload-time = "2026-06-02T18:24:41.344Z" }, +] + [[package]] name = "frozenlist" version = "1.8.0" @@ -1367,6 +1391,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12", size = 7484, upload-time = "2025-10-18T21:55:41.639Z" }, ] +[[package]] +name = "interface-meta" +version = "2.0.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/28/5b/202a48a1ccdef721a95357fbe263c54ef87c18c4972df1ab5c22fe0f33d5/interface_meta-2.0.1.tar.gz", hash = "sha256:902bd9a95a12f195f15753a1080075d4eca7a2cb934fac7ac03c9e362b50796a", size = 15281, upload-time = "2026-04-30T22:35:36.882Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a1/d3/20a61a248feb1249cd81f83ce731f0bdf5170ed96a08a298f7081cda9e90/interface_meta-2.0.1-py3-none-any.whl", hash = "sha256:f38016bef9a4429b6d0792d809be7b65e9781820c674bf7f463999086b6e6323", size = 15330, upload-time = "2026-04-30T22:35:35.201Z" }, +] + [[package]] name = "jaraco-classes" version = "3.4.0" @@ -1988,6 +2021,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/79/7b/2c79738432f5c924bef5071f933bcc9efd0473bac3b4aa584a6f7c1c8df8/mypy_extensions-1.1.0-py3-none-any.whl", hash = "sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505", size = 4963, upload-time = "2025-04-22T14:54:22.983Z" }, ] +[[package]] +name = "narwhals" +version = "2.26.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/35/68/5351e34623d253423240ea7de3f8fc74fa8ab14b1ab3c0ec4ac8997413c9/narwhals-2.26.0.tar.gz", hash = "sha256:6b9cadca82f375c7e4cf584fdc86ca25da54827307a9c58f94547ee6104b82dd", size = 686970, upload-time = "2026-09-08T13:32:08.964Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/40/b5/1b84b2c784db76d69442334bc8b8748c840f13ca53be086f4f250ad4a0bc/narwhals-2.26.0-py3-none-any.whl", hash = "sha256:29326d74f107c347fd1009bd58e38d9f7c7c5b51e6de97bc93dbc325d9038b54", size = 474034, upload-time = "2026-09-08T13:32:07.159Z" }, +] + [[package]] name = "nodeenv" version = "1.10.0" @@ -2234,6 +2276,51 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/63/34/ba1c580383c9eada3711951fef0795c80b829a078d72188184bcab9dd527/packaging-26.3-py3-none-any.whl", hash = "sha256:d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c", size = 129956, upload-time = "2026-08-04T18:15:27.159Z" }, ] +[[package]] +name = "pandas" +version = "3.0.6" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "numpy" }, + { name = "python-dateutil" }, + { name = "tzdata", marker = "sys_platform == 'emscripten' or sys_platform == 'win32'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/e2/17/d7b106e05bfa642e8694451e7d3d759c6a241c5386a5d962e4f66c047e06/pandas-3.0.6.tar.gz", hash = "sha256:66b07ef7315a31bfe1089cd3d71a7de781c9dca986762d0b4fe7c0ef17465d10", size = 4667686, upload-time = "2026-09-17T23:23:18.345Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/75/55/1a8875395b05ccd572cbca0b9255dcd2db6e6508e632a558c1a6884b39ad/pandas-3.0.6-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:ee913a91669056c1de1a6b733fbfeab711de9e54e3bee2dfa5fe79d9457247d1", size = 10492213, upload-time = "2026-09-17T23:21:40.746Z" }, + { url = "https://files.pythonhosted.org/packages/35/61/47ae13476995cc8a40cd609e93e7cf11f273d8692925c2903cb6d38aa0d1/pandas-3.0.6-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:ff51a4459ed036e93d1eb1bb5e6e7b28685d3cb6b7c12b91c05b31024e234729", size = 10156618, upload-time = "2026-09-17T23:21:44.142Z" }, + { url = "https://files.pythonhosted.org/packages/bc/f2/cc5f2adb8d6e86a85d9fb5128f8cf205a61189336f70d1f7faf0d1b53ec9/pandas-3.0.6-cp314-cp314-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:654aae059295dbba6ecd2328ca12712a2cf1676214c8699f1c29213f7ccf9c34", size = 10375479, upload-time = "2026-09-17T23:21:47.159Z" }, + { url = "https://files.pythonhosted.org/packages/ca/ba/ffdcb19be4ff6bfe7d969e7cef2c567c633df5a3a1cc1053394ad053bca8/pandas-3.0.6-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:62f51d7f651c8054c5e82a69265c98082e795d1442df7ca6edc3a545d61214b1", size = 10783244, upload-time = "2026-09-17T23:21:50.367Z" }, + { url = "https://files.pythonhosted.org/packages/77/5b/e150075b2c6eb69fae896f2d9239bc6ed07db97735971d53d66de6553460/pandas-3.0.6-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:22172a92e7ee678ec0140c7af4fc9366b55413834a1cd86af78b3caa0b0574de", size = 11382223, upload-time = "2026-09-17T23:21:53.355Z" }, + { url = "https://files.pythonhosted.org/packages/d6/8a/b441c587dc7355bf6e1f68a91b4f76a6c29740f0c23be3acc5d4ebbeea6d/pandas-3.0.6-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:583be68728a31d0d750d5b8d9e00f02b153df0d4655f858bde93cb84cfc4227c", size = 11854881, upload-time = "2026-09-17T23:21:56.342Z" }, + { url = "https://files.pythonhosted.org/packages/b7/e9/f43410fada510b43fec09993c08f552086c3d247d3ee801a678f3cb10ea5/pandas-3.0.6-cp314-cp314-win_amd64.whl", hash = "sha256:77ccbe5057aece6fc172b9b77f19c04335af6882bc2e10c8f3ee4e6bfb3da553", size = 9791672, upload-time = "2026-09-17T23:21:59.332Z" }, + { url = "https://files.pythonhosted.org/packages/8b/9e/db14c059c21f9baa1907d436f8bf30e0c76c6288225c5e8b79a08ba8b2c5/pandas-3.0.6-cp314-cp314-win_arm64.whl", hash = "sha256:fb625f426b375bcc96e3a04c5d5d266cd7be6ae5d6866e0e703382ab5164068c", size = 9121246, upload-time = "2026-09-17T23:22:02.123Z" }, + { url = "https://files.pythonhosted.org/packages/67/ba/bad0f8dac020ab38a8637fddab01a57a82da7a496a6e6f19590aad53ab62/pandas-3.0.6-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:9e492cd4bdba6778de4fe0df7f4590c012161ebcf9902dce01b01dc683105514", size = 10920612, upload-time = "2026-09-17T23:22:05.404Z" }, + { url = "https://files.pythonhosted.org/packages/c4/a9/b500982e9aac6d52a58da4ad3f11e14168a315b06906b3f397c427878065/pandas-3.0.6-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:d7dcd21238cbb4828ff148481ba01cac8946dc5121457b5aeba28636f8f99a60", size = 10570213, upload-time = "2026-09-17T23:22:08.44Z" }, + { url = "https://files.pythonhosted.org/packages/4b/fa/e6ecd0073c98be8f840ac3125b955272835d7d9fd69f5944383b164deb5e/pandas-3.0.6-cp314-cp314t-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6ff482fa91fa2bafd92e8fe66ce3645c851824310f295c1f0a2f96e928fc4541", size = 10252356, upload-time = "2026-09-17T23:22:11.302Z" }, + { url = "https://files.pythonhosted.org/packages/04/f5/001e230a7a7803590d9275a1a3f7e1bb605e3a495cfe5e8d3a532090621b/pandas-3.0.6-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:db7ec631f26223beee8e5c9e0b8f23c24d8197bbd1d982421d4e3188bea51965", size = 10655952, upload-time = "2026-09-17T23:22:14.283Z" }, + { url = "https://files.pythonhosted.org/packages/ca/ab/bab587148a3852c96aae26c4b5f9e04ce2221801ad94e166b4fbf969ede0/pandas-3.0.6-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:bd75ed0c840f709fc2ae26ddd9534ac77ca1a48ac0cce521a74acaa85f3340a7", size = 11274177, upload-time = "2026-09-17T23:22:17.352Z" }, + { url = "https://files.pythonhosted.org/packages/f3/32/74b48d87df2b80892d713c149abfe36d5db4de41b4eccb042a2bc07dafc1/pandas-3.0.6-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:ef738d71d1059245b6bb03e312be06d8b3821326a83486c1ad03b9aba3710e44", size = 11719041, upload-time = "2026-09-17T23:22:20.227Z" }, + { url = "https://files.pythonhosted.org/packages/f6/c6/d64b72d64d7eb0fad9fe424d34138e45dee70ddbea1360dcd0adf30e28f6/pandas-3.0.6-cp314-cp314t-win_amd64.whl", hash = "sha256:429d9df32731ab01383ed98f2baa7a60368090d1a94fc06019a12062510e8630", size = 10191388, upload-time = "2026-09-17T23:22:23.524Z" }, + { url = "https://files.pythonhosted.org/packages/7a/30/5e5b2ccabeca73ae2b03fc82bca3eabb7466cf43737f05ac08d591665d47/pandas-3.0.6-cp314-cp314t-win_arm64.whl", hash = "sha256:a4dbd4dc65cbe645b92b8785d0f96dd7311010dc6606cf620e51b07b8788a12a", size = 9387796, upload-time = "2026-09-17T23:22:26.64Z" }, + { url = "https://files.pythonhosted.org/packages/b6/77/47c5fb0be8bdd00116814c2c40d9ec42dbeb943865ef95130fe58a898226/pandas-3.0.6-cp315-cp315-macosx_10_15_x86_64.whl", hash = "sha256:50c44cbf5820b6b91a5f74aae04972472aefadd3cd9fbd1010409d85528bd570", size = 10483960, upload-time = "2026-09-17T23:22:30.071Z" }, + { url = "https://files.pythonhosted.org/packages/09/08/a310cb2fefe6d2b4623ab2150da818d93d4e73e33b58e4d163bb74243c5a/pandas-3.0.6-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:eb6900de08ac85f93ac4948aa6b80842eba555875337b8359035ac9c43e92d34", size = 10149432, upload-time = "2026-09-17T23:22:32.818Z" }, + { url = "https://files.pythonhosted.org/packages/54/36/6af478ec3a26d7754555cd62c3101c589c0931b1d85398e4fa5403910a1c/pandas-3.0.6-cp315-cp315-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4e25e2e1adee99ddfada6f7206a79ae8e9c8a8861b0e3eaaba165006d3eef18e", size = 10360981, upload-time = "2026-09-17T23:22:35.621Z" }, + { url = "https://files.pythonhosted.org/packages/43/20/5ece0e9cb79a6473216620db6a90546f578001c2bd857b77c444b27acad1/pandas-3.0.6-cp315-cp315-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4ff44b2cb51cbd691c91f92c4ea6c71e34003f239ebd67c2e857dc898466b49c", size = 10776585, upload-time = "2026-09-17T23:22:38.427Z" }, + { url = "https://files.pythonhosted.org/packages/2f/b6/cd3038f31ade5e8d2b4e1c9549d4b31e4d598469562f47142b2ad9171c0a/pandas-3.0.6-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:5edd0a7abb0986ecce1ac81f56d99b6763f86aa6946dceb6c661224f90af5a19", size = 11385249, upload-time = "2026-09-17T23:22:41.18Z" }, + { url = "https://files.pythonhosted.org/packages/0a/87/05bb3003737f80375d7311774916a24d161e2e591abe8c672aed7813defc/pandas-3.0.6-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:1bcb3e9ed29e74a7439cedff9e2aefd3ea65de84d7de9ccb6c194192541bd60e", size = 11848595, upload-time = "2026-09-17T23:22:44.207Z" }, + { url = "https://files.pythonhosted.org/packages/c0/30/1c0d46acf236d19ef975e9cdd5d1e0dd54924b03f0ed8287096ad4a18152/pandas-3.0.6-cp315-cp315-win_amd64.whl", hash = "sha256:253e12cb9081b0afbac607920f6142975966bc315135e09de275fdbaa415d2de", size = 9783810, upload-time = "2026-09-17T23:22:47.097Z" }, + { url = "https://files.pythonhosted.org/packages/87/03/df3304a9c2833c4810e7f1c887b04105b24731f9deef8b5d5d04522a375b/pandas-3.0.6-cp315-cp315-win_arm64.whl", hash = "sha256:97274c9adf6255bb48c620cd6959805efa7f09ea2167f0e0ae006a448cd2fca7", size = 9116820, upload-time = "2026-09-17T23:22:50.149Z" }, + { url = "https://files.pythonhosted.org/packages/47/25/d5f6cce5efa17c38e4f752a875b4a26d66cfadd529cb8c81672f0376d6a6/pandas-3.0.6-cp315-cp315t-macosx_10_15_x86_64.whl", hash = "sha256:265f562fdd1079f69f3de96dd425c3405224038c0af4f920c54bd240ee2c4640", size = 10894614, upload-time = "2026-09-17T23:22:53.223Z" }, + { url = "https://files.pythonhosted.org/packages/ea/8b/e1876bfdc1df06bafc022d33202b5663bd86c81df2a6140aacafd0344669/pandas-3.0.6-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:c6e4aae3e9bea26c6c9a20d88d96c86ec4a99b4db5fd516bcb4e829ab2c0ee36", size = 10546973, upload-time = "2026-09-17T23:22:56.155Z" }, + { url = "https://files.pythonhosted.org/packages/e9/27/e0a27a5a5c27f7db66657b44def9e93121fd0ad4f0808355b9898fcbf204/pandas-3.0.6-cp315-cp315t-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a77a1a44e4d88f1c6a2a64d3eb12efec8420875722e14279800b173a7c7c2804", size = 10239717, upload-time = "2026-09-17T23:22:59.603Z" }, + { url = "https://files.pythonhosted.org/packages/d5/4f/4eadb7d86a921c1e8bc70916cfe601ed667c4169118d17d69958611c21f8/pandas-3.0.6-cp315-cp315t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:86fa853a12e0b70927e2b1ee00d56d2224ec9cbb4b9d58348b5ad52d2f21150e", size = 10641275, upload-time = "2026-09-17T23:23:02.81Z" }, + { url = "https://files.pythonhosted.org/packages/c7/d1/eba72e9d905e84e79aefeefdcc6bc1abe15d9077973566643f4211636966/pandas-3.0.6-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:c826e9babb7790142c399f58599d8de679bea059d7b39c5b6efa2096fac37266", size = 11262919, upload-time = "2026-09-17T23:23:06.038Z" }, + { url = "https://files.pythonhosted.org/packages/9d/8a/1c5bd2642b450e374b6191189f47c49538fe41f82348a66de6f647e6ab59/pandas-3.0.6-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:8fe77b408d82e2615674dfed62533b95e18a03610573877422aada4f625d4947", size = 11709148, upload-time = "2026-09-17T23:23:09.082Z" }, + { url = "https://files.pythonhosted.org/packages/73/3d/1b142bd0d0f1326a5d98c91c955b923cd1e06b5eecb428cd9d8817fa01c0/pandas-3.0.6-cp315-cp315t-win_amd64.whl", hash = "sha256:83e91d15738d7783c050197cef2f2cf82fc6353dae9865aa87ed1fa16aa4d55a", size = 10161518, upload-time = "2026-09-17T23:23:12.365Z" }, + { url = "https://files.pythonhosted.org/packages/0b/a3/6419c14da2adc1f09a6a183b8f91d7494d325b287f4ca984ac04f663638a/pandas-3.0.6-cp315-cp315t-win_arm64.whl", hash = "sha256:963ca21199097a84c7827c4678b04e30833084fbf8ef44fde3fa7180a29f8fa0", size = 9364529, upload-time = "2026-09-17T23:23:15.274Z" }, +] + [[package]] name = "pathable" version = "0.6.0" @@ -2252,6 +2339,19 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/f1/d9/7fb5aa316bc299258e68c73ba3bddbc499654a07f151cba08f6153988714/pathspec-1.1.1-py3-none-any.whl", hash = "sha256:a00ce642f577bf7f473932318056212bc4f8bfdf53128c78bbd5af0b9b20b189", size = 57328, upload-time = "2026-04-27T01:46:07.06Z" }, ] +[[package]] +name = "patsy" +version = "1.0.3" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "numpy" }, + { name = "packaging" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/08/e3/950e513affdfe1c1864397b4f40d6ed06ec1b54f608e462c27f151dd72df/patsy-1.0.3.tar.gz", hash = "sha256:79ebf4c93ff4d296e58a9d5be2b2ee31bd49d737cf11d70ffbd8a44b2de42e65", size = 399992, upload-time = "2026-08-29T21:35:32.258Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/20/70/cd3cf5cff538323076a879edef02cce6f13f7d75e03d12f211b0a0dbd178/patsy-1.0.3-py2.py3-none-any.whl", hash = "sha256:d3dbebe8fd5f46e29912d030b63c6268647b59bf788a99e2af28a30234cf357c", size = 233318, upload-time = "2026-08-29T21:35:30.913Z" }, +] + [[package]] name = "platformdirs" version = "4.11.8" @@ -3125,6 +3225,57 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/fe/a0/50787329e4f20bf9dc9f6230015d46ec69c51a97ace5bc202dae4755365d/ruff-0.16.8-py3-none-win_arm64.whl", hash = "sha256:d075e820af612102ce217f07cc93e69f9490b10ec13ea85fa87bd03d996cef8a", size = 10386316, upload-time = "2026-09-16T15:54:43.332Z" }, ] +[[package]] +name = "scipy" +version = "1.18.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "numpy" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/7e/74/66de6258867beb2ef08f35f9f2ac017a52cacd5081714d239ff1a442d458/scipy-1.18.1.tar.gz", hash = "sha256:52c4b7422442aba924d03ad4019852b08a92e64ea187b933135687bfe2747307", size = 30781235, upload-time = "2026-08-21T23:28:50.599Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/06/d5/d8eb4e280ddb56a4ab2c6f02ee49b56b23f6e977cf0802fd6d68dbef14f5/scipy-1.18.1-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:83de5453a7799afc9048b4616bd085cef126e36412f0ea2f6370c36a2a3a51e7", size = 31090936, upload-time = "2026-08-21T23:25:28.686Z" }, + { url = "https://files.pythonhosted.org/packages/2a/49/59ea385dc3a62ff498ddf3cfff7c2b41b0f9f9d3c4122b3f1dcb6d6327fe/scipy-1.18.1-cp314-cp314-macosx_12_0_arm64.whl", hash = "sha256:9554bcc6d715ee87a633a3cc8e7703c6628b100dd29cb8a2efc4c0533c7ff729", size = 28725221, upload-time = "2026-08-21T23:25:33.244Z" }, + { url = "https://files.pythonhosted.org/packages/70/e8/6b0c288c50942d78193696c9f15f9a0874f5178aa0ddf40f83d9924b3e8d/scipy-1.18.1-cp314-cp314-macosx_14_0_arm64.whl", hash = "sha256:011413b7426b75012840e35649e00fe0a2c3bae89fed433876e3a99251572efc", size = 20466839, upload-time = "2026-08-21T23:25:37.516Z" }, + { url = "https://files.pythonhosted.org/packages/4b/e0/54fd3793c729e3b936782f181b59cbb1205bf250ab605a16cb1ba61cdd5e/scipy-1.18.1-cp314-cp314-macosx_14_0_x86_64.whl", hash = "sha256:88f0e784020649f88ea48c9f5ddfa403bf9205820667c0914740b392035afb82", size = 23089121, upload-time = "2026-08-21T23:25:42.019Z" }, + { url = "https://files.pythonhosted.org/packages/0b/56/030af62bea3cf878e0028515dff78c123b01633606a879b63f42d2db99cc/scipy-1.18.1-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:2d3ab0e8c69a17dd3559eab8cbb88f258e285c94d572c2719033f90f83290c89", size = 34053851, upload-time = "2026-08-21T23:25:47.998Z" }, + { url = "https://files.pythonhosted.org/packages/6b/89/2a844506d49651e9aa1af6ef95b6bd8031cb1d5a4375edec6155037e04cf/scipy-1.18.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ac0333bdf38309aa3dcbe7e3fa7ea29e7a2c37c6ea306a757b700ded8e4596ad", size = 35329183, upload-time = "2026-08-21T23:25:53.522Z" }, + { url = "https://files.pythonhosted.org/packages/eb/56/c7370c3640e92ac9613cbf26cb3f729f9b12ddf1727b55b94b53b24d6f48/scipy-1.18.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:911de823097db8b63f034299d12662db93344e6ffa0b881cbb57748974b70168", size = 35672551, upload-time = "2026-08-21T23:25:59.387Z" }, + { url = "https://files.pythonhosted.org/packages/24/16/ec8536f351421f8bf60a1120930638f83790f4710b8230446aca3d6159d4/scipy-1.18.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:95298364e251be3e60249facbeeca03631d3bb7584f85879516ec55ac717b81f", size = 37469416, upload-time = "2026-08-21T23:26:05.432Z" }, + { url = "https://files.pythonhosted.org/packages/52/94/d73da0d28f16c45bb9b0a5691b91610b0275c5ef0eb5e43c87cf2dc1bf31/scipy-1.18.1-cp314-cp314-win_amd64.whl", hash = "sha256:78a0d7c918e74a232394117160e7e3db503377572a45bcef8826e4ab8a35feba", size = 37362755, upload-time = "2026-08-21T23:26:11.366Z" }, + { url = "https://files.pythonhosted.org/packages/89/25/e996e4dc74e10e227b1e14db5eaf6608bb6dd33884a64851c38f18dd4249/scipy-1.18.1-cp314-cp314-win_arm64.whl", hash = "sha256:cbf38d043c1aa4ab306e1ada6ab6eddacc3322a20b7af1b30bc93254b366fe09", size = 25036090, upload-time = "2026-08-21T23:26:15.887Z" }, + { url = "https://files.pythonhosted.org/packages/fa/c9/c00213f92309d753b48903e6a451b87eb52ff5b7a16e789d1568bbf221c4/scipy-1.18.1-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:0fcb3c93519f27bb4f0c4b0f7802cdcaca7fcf93267b75edda2e9f4e8a55cbd7", size = 31485550, upload-time = "2026-08-21T23:26:20.776Z" }, + { url = "https://files.pythonhosted.org/packages/74/b2/e3067c487982d4eeab2938928529410370c06fea84a4d3f4925e7d96647d/scipy-1.18.1-cp314-cp314t-macosx_12_0_arm64.whl", hash = "sha256:ddef79fb382df40104a19bb7151b3b23e57c1778fcf857c71ceecd9bd264513f", size = 29174642, upload-time = "2026-08-21T23:26:25.395Z" }, + { url = "https://files.pythonhosted.org/packages/d5/ab/374c9fe2d1ec014e576c781a4b5d8e1ba340e8f6b4638c16f711d2b194f0/scipy-1.18.1-cp314-cp314t-macosx_14_0_arm64.whl", hash = "sha256:0e82073ecc7acc6436fac4b31674109c7e1d3e596789767eda01258a8c9e8123", size = 20916357, upload-time = "2026-08-21T23:26:30.112Z" }, + { url = "https://files.pythonhosted.org/packages/90/38/223915c88a17317cafbf8ca2a42b11c265a9fb1e804aa665544132b5fe8a/scipy-1.18.1-cp314-cp314t-macosx_14_0_x86_64.whl", hash = "sha256:8bcf3c1ba5d6456e2effd30fcbd3459b044d683fcdac79a2e6830f0bdf7de487", size = 23482611, upload-time = "2026-08-21T23:26:34.846Z" }, + { url = "https://files.pythonhosted.org/packages/c4/d1/db0948da8ca57a80b36520ef0a768b967d99f3af65f4b6f1bf6362ad4dd4/scipy-1.18.1-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:cfbf154f2ba187f2ed6cce2639efff7d105f1140573642c0161615b6d91d6a87", size = 34143202, upload-time = "2026-08-21T23:26:40.4Z" }, + { url = "https://files.pythonhosted.org/packages/87/53/39d046cc7574ed6acacb6bd5723e220107ece80bff12faaf3efc4ddeede4/scipy-1.18.1-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a1d33a7836f7ddc1993427966a0823468ec41bcbdb1a9f9942d1d7e57f803ba3", size = 35380876, upload-time = "2026-08-21T23:26:46.1Z" }, + { url = "https://files.pythonhosted.org/packages/f9/da/32e0e799d875a85ca57d9bde6c78148afcc0e38276df683d95854eadc8c3/scipy-1.18.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:7f4b8bc363b6d65ee2152bec57568e3c52639bb34c46057b09857a307ed5e21d", size = 35770885, upload-time = "2026-08-21T23:26:51.533Z" }, + { url = "https://files.pythonhosted.org/packages/88/2e/f97a666d362fee68b18f41c9c30ed502ca5c98b549749bfcb52a8b74d1eb/scipy-1.18.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:11c423f1049c5755ad4409af52a9ada1cff96fe9b50795d4af3619f292901239", size = 37525424, upload-time = "2026-08-21T23:26:56.751Z" }, + { url = "https://files.pythonhosted.org/packages/ca/d5/a9e765a84654ebba8479a1fd1b059ced1af72b168a3b2a3a46540ea38d20/scipy-1.18.1-cp314-cp314t-win_amd64.whl", hash = "sha256:c24acac1e18912761c4700239bbc1fd32f615af690f1584d49b35859be51324d", size = 37416961, upload-time = "2026-08-21T23:27:01.546Z" }, + { url = "https://files.pythonhosted.org/packages/ee/16/e79e0d1c63ef698879d85439d37e9fb434e3b804e506a6991038d086ebd9/scipy-1.18.1-cp314-cp314t-win_arm64.whl", hash = "sha256:9f2897bf7737392ad0d5213ea7b6add72a4edf5679b3153106aeb88b6507b3b9", size = 25331848, upload-time = "2026-08-21T23:27:05.884Z" }, + { url = "https://files.pythonhosted.org/packages/be/4f/1bd37c883b67163e2ca1f60977a399500e6879c15defecac62831c8d078d/scipy-1.18.1-cp315-cp315-macosx_10_15_x86_64.whl", hash = "sha256:eb0dfcf4e28a99c12c999744a2ff67c9b06200e20401c7c88186e33552a46331", size = 31091484, upload-time = "2026-08-21T23:27:11.051Z" }, + { url = "https://files.pythonhosted.org/packages/8c/c5/ba929d7feb9b2332f96827c12e0e924b61973b59b4dea383b603372c65ce/scipy-1.18.1-cp315-cp315-macosx_12_0_arm64.whl", hash = "sha256:30f464bee641fa8e282577c7dce027308403213c6ca8270bba73285c91024bc5", size = 28725057, upload-time = "2026-08-21T23:27:15.9Z" }, + { url = "https://files.pythonhosted.org/packages/a4/19/68f1c50f609d955d230e66d25d02bd3e1e167ec540232135354fb9a4b9e3/scipy-1.18.1-cp315-cp315-macosx_14_0_arm64.whl", hash = "sha256:1bca3b943fc2567ea49cd02c99abde49da4d5178ec46f624bd8255cda8755beb", size = 20466734, upload-time = "2026-08-21T23:27:20.044Z" }, + { url = "https://files.pythonhosted.org/packages/ef/6d/319fa29b73d1802fa80b32a6eaf3f5be456ef81526da2716a9493bcb5501/scipy-1.18.1-cp315-cp315-macosx_14_0_x86_64.whl", hash = "sha256:c9d18a33309122074ea483dd92dd444189166b8b2ec429fe9ed5ac73c7a0aa23", size = 23089664, upload-time = "2026-08-21T23:27:24.345Z" }, + { url = "https://files.pythonhosted.org/packages/b7/db/30992f9b51a63de671daf3888ffd18378b6cb9ec9f2c972264238ffa7fd6/scipy-1.18.1-cp315-cp315-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:82f201b4c878551d48558337aab270d3c6cca5507b8737c8d8a608d234cccde0", size = 34054035, upload-time = "2026-08-21T23:27:29.409Z" }, + { url = "https://files.pythonhosted.org/packages/91/d4/bf3e735dc0b9d5a8ff45079d2540e17d3aff7a2f0048dd8f552ffd031d2b/scipy-1.18.1-cp315-cp315-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0ac49ea97594532dd44b7136094d35f5440fa06e6d9c6384a74c01764df388c5", size = 35333883, upload-time = "2026-08-21T23:27:34.293Z" }, + { url = "https://files.pythonhosted.org/packages/19/93/12d78ce9f871fe945fca588d32644e6e63f553c2a35c564d73f3b22a3313/scipy-1.18.1-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:ceb30a00ce7c92d459819443d29ca486d882b83fb6738bdcbb2a1cce94ac5daa", size = 35673124, upload-time = "2026-08-21T23:27:39.059Z" }, + { url = "https://files.pythonhosted.org/packages/70/cd/886219313a1012a48e6ae0ec4f302c837151beb92e1ff0d709ef8fdfc488/scipy-1.18.1-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:f29633129f9fa7e88a3f0fca835de2d030bfc9643f7799e1a0c46cee24d38fc7", size = 37470753, upload-time = "2026-08-21T23:27:44.435Z" }, + { url = "https://files.pythonhosted.org/packages/17/6c/a776888ce618bee54fbde26172f0f46ac1da70d27b63861797fe78e1904b/scipy-1.18.1-cp315-cp315-win_amd64.whl", hash = "sha256:92c14f5bdbfb6216315ce33e78080474082de8b3830122ba97809bfbe65f75c0", size = 37361483, upload-time = "2026-08-21T23:27:49.334Z" }, + { url = "https://files.pythonhosted.org/packages/ab/09/97b651691322ebee97999b017ffc18a15a0b815103844c97e8da9d469731/scipy-1.18.1-cp315-cp315-win_arm64.whl", hash = "sha256:e402cf31eb68f453dbb2d36fc6d722b33f24a55d68b2ae1d92fa6305ca71c298", size = 25035883, upload-time = "2026-08-21T23:27:53.596Z" }, + { url = "https://files.pythonhosted.org/packages/ed/0f/9ec20467bbabd0d44e2a77d0fd3d124f884b4d67df92af82c91d2d6a486f/scipy-1.18.1-cp315-cp315t-macosx_10_15_x86_64.whl", hash = "sha256:2a0b02f9fc46f8520330c23d45e6560db7e3a0d927232139427637f98943e11d", size = 31474926, upload-time = "2026-08-21T23:27:57.993Z" }, + { url = "https://files.pythonhosted.org/packages/8a/58/dcb79161e56efbedc50079fcd2f5fe427a0ebb53022eb476aa73c015ad8f/scipy-1.18.1-cp315-cp315t-macosx_12_0_arm64.whl", hash = "sha256:1d73131e358976663dd969e1fb4ed1404b815cd977eaaedc3b3a133ba2d81c35", size = 29164940, upload-time = "2026-08-21T23:28:03.062Z" }, + { url = "https://files.pythonhosted.org/packages/71/d3/1eeea80c817fcb8ef7bd4a05a58824977a0e57a375cfc3d7ea7c911c01ad/scipy-1.18.1-cp315-cp315t-macosx_14_0_arm64.whl", hash = "sha256:bff0b729edd992766136b34e39cc76bc2fad905aa58897ee72a9cd000a6d8443", size = 20906742, upload-time = "2026-08-21T23:28:07.642Z" }, + { url = "https://files.pythonhosted.org/packages/54/46/e59350428b6099301a20128108c995e2eb175a43f383af9a346e38824f9b/scipy-1.18.1-cp315-cp315t-macosx_14_0_x86_64.whl", hash = "sha256:10ac20c69d880f77f375db44c22e3e6a644f9fefa291d4cd2fb9790a89fc99fd", size = 23472183, upload-time = "2026-08-21T23:28:12.109Z" }, + { url = "https://files.pythonhosted.org/packages/89/31/cc91623fa98f0621766a0f0aaaadb2c66de74a7ea7e3837164f6e4354260/scipy-1.18.1-cp315-cp315t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:33a834464fdabc0f26a45508df31b3cc5d028e04dbf6c5ed398541418e0a12fe", size = 34130796, upload-time = "2026-08-21T23:28:17.906Z" }, + { url = "https://files.pythonhosted.org/packages/fc/3e/8572ef536957ddb8aa81bb4090d9e25f257e3b4e05d97deb54319deb8a3a/scipy-1.18.1-cp315-cp315t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:49023963c193dacee096301452f223ee24d86ec5807f8df93c0f7221d119e305", size = 35374253, upload-time = "2026-08-21T23:28:23.732Z" }, + { url = "https://files.pythonhosted.org/packages/b5/c6/59fdeffb4f1435299f93d9dc8140b43ad2916e6cfc944be6c3041fcec86d/scipy-1.18.1-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:d84a09d0dad90ba6525d8ac1c2334b33e64bf3ccfe9e841f02feb867a22681e4", size = 35758543, upload-time = "2026-08-21T23:28:29.431Z" }, + { url = "https://files.pythonhosted.org/packages/cf/d9/135be205d9de8783193aff9cc3bf483a03a38e4b29432c954e8cb66ac14e/scipy-1.18.1-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:179ce34a8d0fe273d8883ba59e17e052247d08973dfcb743ca52bb1cce2d60b0", size = 37521946, upload-time = "2026-08-21T23:28:35.245Z" }, + { url = "https://files.pythonhosted.org/packages/5c/a2/5b7d5270621ab7cfa3f7766067bf95dc360b5efb6394694e8143b4156e2b/scipy-1.18.1-cp315-cp315t-win_amd64.whl", hash = "sha256:5632e3ae3d09197c446310cd5187de63e28448ce22f0f67b2b93d97503c0c230", size = 37408295, upload-time = "2026-08-21T23:28:40.724Z" }, + { url = "https://files.pythonhosted.org/packages/63/ad/741c19fcb66755ff953daf9243af8480e4bf3d7fbe57583c178c7d2b6b51/scipy-1.18.1-cp315-cp315t-win_arm64.whl", hash = "sha256:eda632a7981f69730d6281f451db9c1c370993a2c0d7ddb43e2a809a2862b83a", size = 25319710, upload-time = "2026-08-21T23:28:45.713Z" }, +] + [[package]] name = "secretstorage" version = "3.5.0" @@ -3217,6 +3368,50 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/c8/cb/6a6a47d5b464bd08695d254f3da6e7986cc70c9fa5d778eda57538edfe56/starlette-1.6.0-py3-none-any.whl", hash = "sha256:a86dd39d14bb45f85a3d18525215a9ef0cfd1f192ac793220e72598c90335f0c", size = 75969, upload-time = "2026-08-08T18:27:56.196Z" }, ] +[[package]] +name = "statsmodels" +version = "0.15.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "formulaic" }, + { name = "numpy" }, + { name = "packaging" }, + { name = "pandas" }, + { name = "patsy" }, + { name = "scipy" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/a8/1f/a3cbf6ed7cf6286afec694bfef561f3e51483197716717fb8476f1f0c50e/statsmodels-0.15.0.tar.gz", hash = "sha256:5d257fe58d0772bc46a557880ca78e2a8e07fec7bfd9d11074aef8e33e1aecbc", size = 15736853, upload-time = "2026-08-27T10:45:21.988Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/86/51/daf737efb6002905bd006d296f9ad031ed3861b640075bde3b734706b49d/statsmodels-0.15.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:04e65ee05475aeceb9cb954cf96c0f9361b9cdfd497b8aae47afbab0c7c786dd", size = 11698848, upload-time = "2026-08-27T10:37:46.312Z" }, + { url = "https://files.pythonhosted.org/packages/22/b1/ca42c91e427db43917d4ab5cc6991e7e50b574bcfdf6c4c8eb9590af71d3/statsmodels-0.15.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:1f1443cc1ff7683f3d7a9054e6dccd92040fbd4324616a0b6dbb8af1ce7889fb", size = 11571229, upload-time = "2026-08-27T10:38:04.723Z" }, + { url = "https://files.pythonhosted.org/packages/5b/04/d803e8d014d4643d9c0a5eec78343073fbfff1c1018f776dd416c07fc076/statsmodels-0.15.0-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a45026596c71afa18543ec2af40b895609c181fc3649433c1cded5ce23ec5cd4", size = 11801588, upload-time = "2026-08-27T15:00:31.603Z" }, + { url = "https://files.pythonhosted.org/packages/fd/44/40d7678858065e9ec8efd9f37f04227b22a66632ba194e4aa43fda023f6a/statsmodels-0.15.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:edd803f4606061af8c7a83e2326ea294cbfa802a908dfbda4a88347301fb6820", size = 12062254, upload-time = "2026-08-27T15:00:49.803Z" }, + { url = "https://files.pythonhosted.org/packages/51/69/16c73c3c09f4b8d85f125d7d3ae0f7092d4736a83d24c0159e4fb21632ec/statsmodels-0.15.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:eb7fc1147cd8d17132190db7a8e63cd76a06145dec502816d8f3c20619923f2b", size = 12101259, upload-time = "2026-08-27T15:01:08.755Z" }, + { url = "https://files.pythonhosted.org/packages/23/4c/1138aad8e3c27ebf941d732788488cce7c28d76404a7b7fc1186faad2890/statsmodels-0.15.0-cp314-cp314-win_amd64.whl", hash = "sha256:c3c1138b4d0e5b0c2387b17dafd2a0fd137c67bd869f70d4ee56feecc918cb0d", size = 11348219, upload-time = "2026-08-27T15:11:12.924Z" }, + { url = "https://files.pythonhosted.org/packages/3a/bd/53546d8c9ab013d9a0513706d2a09a03aff12034e6f898987e8ce0f38257/statsmodels-0.15.0-cp314-cp314-win_arm64.whl", hash = "sha256:74c0b63448f03020cc27a8ee698fbcf2ba91e61a9f9eee7978c0c4ed33a9b17f", size = 10866645, upload-time = "2026-08-27T10:38:20.886Z" }, + { url = "https://files.pythonhosted.org/packages/38/a1/0d38328643d4704c8de7867518c3f52ec145ff62537b2ca1e14cdeecf51b/statsmodels-0.15.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:6197b4cca69fd7bc23ab9430abf1c479764cfe74767467f51964a633dfade7a5", size = 11870287, upload-time = "2026-08-27T10:38:38.271Z" }, + { url = "https://files.pythonhosted.org/packages/28/55/fac7e03895f24a0b4883ff9fc69f9421a5df1b60e7edd7e68d49f4327593/statsmodels-0.15.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:5538a734dd28efd450bb38a5d5fc94d13ee709bc497e3e4c0a24b3803e3eac39", size = 11755467, upload-time = "2026-08-27T10:38:54.683Z" }, + { url = "https://files.pythonhosted.org/packages/4c/38/5321b9f6065d1c5861e87853720603d56ae81795a83d3040410ca2684305/statsmodels-0.15.0-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:dde0657d18e322eedb2540a84c0582e97afd0f78c370b45eebb0d4ac228a7a83", size = 11636274, upload-time = "2026-08-27T15:03:41.86Z" }, + { url = "https://files.pythonhosted.org/packages/28/56/c75e984c492509d9ab2ba5f2c0e4eab7177cd2cec424cef9dafb42f0cc70/statsmodels-0.15.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:90e75e726be2c9fc1d1d4c43337503a35864bdf5b4693773a08c6ee92d04a153", size = 11865818, upload-time = "2026-08-27T15:04:01.503Z" }, + { url = "https://files.pythonhosted.org/packages/61/72/9e03975701c808767c19f394f670941a962204a4f6a00eeaf56b560348e8/statsmodels-0.15.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:65e64afc2655a486ea44a5ffe4e2b05ee3abbcb10ea61d1c02d3e9e519338d9b", size = 11907800, upload-time = "2026-08-27T15:05:49.786Z" }, + { url = "https://files.pythonhosted.org/packages/4f/a7/c467019a8bf1ab6a07ca88004f0a1d4ea2dae89642aa804e49437b256243/statsmodels-0.15.0-cp314-cp314t-win_amd64.whl", hash = "sha256:edee066ac9b171d95c3de925225331a21de1deb5b6452f252bc853e44566e72b", size = 11559083, upload-time = "2026-08-27T15:06:05.872Z" }, + { url = "https://files.pythonhosted.org/packages/54/10/dc78352367cd5bb298340b57c390c944b66236f6d026cc238bc8264c7633/statsmodels-0.15.0-cp314-cp314t-win_arm64.whl", hash = "sha256:40b2737456e75d96866943e33017a1dffc9166025ee33b7eb373fbe8c7a85e09", size = 11029613, upload-time = "2026-08-27T10:39:10.043Z" }, + { url = "https://files.pythonhosted.org/packages/de/cb/a1f5ad730cb66c7d911ebb45413880333d837f1cffff990a4c6d2c541b95/statsmodels-0.15.0-cp315-cp315-macosx_10_15_x86_64.whl", hash = "sha256:d48ba61db0d13d3033330e6bd1f864dfa9b48c0b952b3b0f7570206b35d552e5", size = 11702125, upload-time = "2026-08-30T16:04:07.635Z" }, + { url = "https://files.pythonhosted.org/packages/ce/db/fb95f242adce112c1507e2062ad6b7b00aea338925f2a03fbe47973c4d72/statsmodels-0.15.0-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:24b9917a09bbe0227047e512a40652c4b9117c2cfbf19c4a5b9971a8944a8606", size = 11571622, upload-time = "2026-08-30T16:04:29.558Z" }, + { url = "https://files.pythonhosted.org/packages/b5/3f/f4cc7e5f4d6c8f46551aee63e59d9b964881070f552400ebb76667b39ad9/statsmodels-0.15.0-cp315-cp315-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:333d0c70f269ff98b647f157d2ae7fbcf0617e6f9a5b1817fc6609766502292c", size = 11780713, upload-time = "2026-08-30T07:40:06.332Z" }, + { url = "https://files.pythonhosted.org/packages/e9/20/fa315a013f70efa6674adfaca59365ea7562371914c408551fc3c399792f/statsmodels-0.15.0-cp315-cp315-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:80b946d7c922f46f045f25e50daf13439f79c05e403ba50081cad509892c8b26", size = 12070117, upload-time = "2026-08-30T07:40:27.04Z" }, + { url = "https://files.pythonhosted.org/packages/91/43/a63f7880050c2c24056fa8d663b7c8a1816b25864660abbc73afff3f3558/statsmodels-0.15.0-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:cf897abce5616e2763ab7d7a7fa914677df87a649971f877b83a358c98f6e291", size = 12105153, upload-time = "2026-08-30T07:40:45.814Z" }, + { url = "https://files.pythonhosted.org/packages/d4/d4/523ddb13862c228407297754486b6c9e8777e5114f4532b667b47728c544/statsmodels-0.15.0-cp315-cp315-win_amd64.whl", hash = "sha256:511a4f9cadbf91a690bfa863bb3e25dce583d8140046886fdf35fbfabfbce401", size = 11352844, upload-time = "2026-08-30T16:04:48.14Z" }, + { url = "https://files.pythonhosted.org/packages/53/59/f3058214e61b15582ef17d761c9333def46960ee521313409b2705791029/statsmodels-0.15.0-cp315-cp315-win_arm64.whl", hash = "sha256:0cb6228713fe47046b606daee63ed4473a7c246fa97cf0a6d6f20d3b0c96c051", size = 10866685, upload-time = "2026-08-30T16:05:03.971Z" }, + { url = "https://files.pythonhosted.org/packages/4a/2d/43089b37f4bbbf7373929cd198de6cbdb0b5a4580a6e5e32bf9fe74fccab/statsmodels-0.15.0-cp315-cp315t-macosx_10_15_x86_64.whl", hash = "sha256:27e9467fae83ff327c9d16ae5ea7e771bcdd66a682f49aa324eeefea5584f2d5", size = 11858149, upload-time = "2026-08-30T16:05:20.585Z" }, + { url = "https://files.pythonhosted.org/packages/7d/38/ca88421b81666cdcfc3d0eb12c714f80f2be327669ececbb5930b68a71c0/statsmodels-0.15.0-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:ecf84918dcd410ab34d3d85d34e0b16ebb10319c9fc77dbf9a1f1a49324c59f8", size = 11739931, upload-time = "2026-08-30T16:05:37.286Z" }, + { url = "https://files.pythonhosted.org/packages/ab/64/98b9e2b1fbfdc4e2392bff349718d8dc796403006a3106ec375c59a5d3f8/statsmodels-0.15.0-cp315-cp315t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5891ad077b36d6401e44967739df3d2cdd380a0e6e9e46dadec7e3d3a828af55", size = 11657996, upload-time = "2026-08-30T07:41:05.608Z" }, + { url = "https://files.pythonhosted.org/packages/34/6d/d8c9e73013ee854031218e8a044ba679535268bc61cf59466f19ac8d980c/statsmodels-0.15.0-cp315-cp315t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:af80f9658c48792947fc754a026ffbebca61a8b483253781973f604a67cf1f8c", size = 11893402, upload-time = "2026-08-30T07:41:27.553Z" }, + { url = "https://files.pythonhosted.org/packages/cc/f5/b9b47f3c688a8af1b199af96e098b8f20897a60b45187c57ce6fcde77a5f/statsmodels-0.15.0-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:583eb2a46f7c7a5c34a26715c8b6d92199bfb4f04623db5fff9902a3c7c832d3", size = 11934786, upload-time = "2026-08-30T07:41:46.809Z" }, + { url = "https://files.pythonhosted.org/packages/c4/08/608871f18bc18c6cba0b484e81fd25a023ef3ca6541f6793ec839fa49e1f/statsmodels-0.15.0-cp315-cp315t-win_amd64.whl", hash = "sha256:38038823fbe86f11e09433b4a0f4af5f102327c3137a1604b002ce3cf722a31f", size = 11549124, upload-time = "2026-08-30T16:05:53.179Z" }, + { url = "https://files.pythonhosted.org/packages/e3/eb/90a506dbee5cde669e2ef28565ff6b7a0791ab415eab2da82f92d033cccc/statsmodels-0.15.0-cp315-cp315t-win_arm64.whl", hash = "sha256:90df413d7e09474f7e7cbf8807440c1bf76298cdd9daabf9141f76d7627c9151", size = 11021454, upload-time = "2026-08-30T16:06:08.124Z" }, +] + [[package]] name = "stevedore" version = "5.9.1" @@ -3565,6 +3760,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/67/81/4add07e5172b7ac40d8ed5ff580409a7801a4fe26d529bdd915401dabfbe/typing_inspection-0.4.4-py3-none-any.whl", hash = "sha256:65b8397ba37ccbce054456aaccddfc91e6e3083c92824df348d96ca832f3f147", size = 14750, upload-time = "2026-08-12T12:37:24.648Z" }, ] +[[package]] +name = "tzdata" +version = "2026.5" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d9/68/f1b440335057bfce71b6e50a9d09445aa2ecbd08359a337976627b8409e7/tzdata-2026.5.tar.gz", hash = "sha256:8cc73c0a0bfca7dbfa59235d60b2eff82231dee33f53d206db1acd9173cfc0a7", size = 200404, upload-time = "2026-10-03T09:23:14.143Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/94/21/1e5995a1c920cce14e4bffae20c665ec10e7ed03ab25e006cd741092b718/tzdata-2026.5-py2.py3-none-any.whl", hash = "sha256:b683bd1b6659ddcd810ff02ad09ba821d4bf1065072805063eb35c49617905ac", size = 347996, upload-time = "2026-10-03T09:23:12.535Z" }, +] + [[package]] name = "uncalled-for" version = "0.4.0"