Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 50 additions & 4 deletions docs/CLI_REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3573,7 +3573,7 @@ devops ai review samples list [OPTIONS]

| Option / Flag | Type | Default | Description |
|---|---|---|---|
| `--category`, `-c` | `choice (python|typescript-javascript|go|rust|java|csharp-dotnet|c-cpp|terraform|kubernetes-helm|dockerfile|shell|documentation)` | - | Only samples of this category. |
| `--category`, `-c` | `choice (python|typescript-javascript|go|rust|java|csharp-dotnet|c-cpp|terraform|kubernetes-helm|dockerfile|shell|documentation)` | - | Only samples of this category (repeatable). |

##### `devops ai review samples fetch`

Expand All @@ -3593,7 +3593,30 @@ devops ai review samples fetch [OPTIONS] <names>

| Option / Flag | Type | Default | Description |
|---|---|---|---|
| `--category`, `-c` | `choice (python|typescript-javascript|go|rust|java|csharp-dotnet|c-cpp|terraform|kubernetes-helm|dockerfile|shell|documentation)` | - | Only samples of this category. |
| `--category`, `-c` | `choice (python|typescript-javascript|go|rust|java|csharp-dotnet|c-cpp|terraform|kubernetes-helm|dockerfile|shell|documentation)` | - | Only samples of this category (repeatable). |

##### `devops ai review samples validate`

**Run devops ai tooling over fetched samples and save a JSON report per category.**

```bash
devops ai review samples validate [OPTIONS] <names>
```

**Arguments:**

| Argument | Type | Required | Description |
|---|---|---|---|
| `<names>` | `string` | No | Sample(s) to validate (default: every sample, or every one in --category). |

**Options:**

| Option / Flag | Type | Default | Description |
|---|---|---|---|
| `--category`, `-c` | `choice (python|typescript-javascript|go|rust|java|csharp-dotnet|c-cpp|terraform|kubernetes-helm|dockerfile|shell|documentation)` | - | Only samples of this category (repeatable). |
| `--review` | `boolean` | - | Also review each category's synthetic defect corpus and score it (calls the configured LLM). |
| `--all` | `boolean` | - | Run all reviewer personas in sequence. |
| `--seed` | `integer` | `1` | Seed choosing each file's defect; the same seed and files give the same corpus. |

#### `devops ai review hallucinations`

Expand Down Expand Up @@ -4825,7 +4848,7 @@ devops review samples list [OPTIONS]

| Option / Flag | Type | Default | Description |
|---|---|---|---|
| `--category`, `-c` | `choice (python|typescript-javascript|go|rust|java|csharp-dotnet|c-cpp|terraform|kubernetes-helm|dockerfile|shell|documentation)` | - | Only samples of this category. |
| `--category`, `-c` | `choice (python|typescript-javascript|go|rust|java|csharp-dotnet|c-cpp|terraform|kubernetes-helm|dockerfile|shell|documentation)` | - | Only samples of this category (repeatable). |

#### `devops review samples fetch`

Expand All @@ -4845,7 +4868,30 @@ devops review samples fetch [OPTIONS] <names>

| Option / Flag | Type | Default | Description |
|---|---|---|---|
| `--category`, `-c` | `choice (python|typescript-javascript|go|rust|java|csharp-dotnet|c-cpp|terraform|kubernetes-helm|dockerfile|shell|documentation)` | - | Only samples of this category. |
| `--category`, `-c` | `choice (python|typescript-javascript|go|rust|java|csharp-dotnet|c-cpp|terraform|kubernetes-helm|dockerfile|shell|documentation)` | - | Only samples of this category (repeatable). |

#### `devops review samples validate`

**Run devops ai tooling over fetched samples and save a JSON report per category.**

```bash
devops review samples validate [OPTIONS] <names>
```

**Arguments:**

| Argument | Type | Required | Description |
|---|---|---|---|
| `<names>` | `string` | No | Sample(s) to validate (default: every sample, or every one in --category). |

**Options:**

| Option / Flag | Type | Default | Description |
|---|---|---|---|
| `--category`, `-c` | `choice (python|typescript-javascript|go|rust|java|csharp-dotnet|c-cpp|terraform|kubernetes-helm|dockerfile|shell|documentation)` | - | Only samples of this category (repeatable). |
| `--review` | `boolean` | - | Also review each category's synthetic defect corpus and score it (calls the configured LLM). |
| `--all` | `boolean` | - | Run all reviewer personas in sequence. |
| `--seed` | `integer` | `1` | Seed choosing each file's defect; the same seed and files give the same corpus. |

### `devops review hallucinations`

Expand Down
4 changes: 2 additions & 2 deletions docs/ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,9 @@ High-density product roadmap, engineering milestones, and open-source integratio
- [x] **Synthetic Defect Templates for Infrastructure Code and Documentation (P2 - Medium, Issue #504)**:
- *Context & Rationale*: Infrastructure code and documentation get reviewed too, but the generator covers only a few YAML and Dockerfile patterns.
- *Delivered*: Twelve new templates, with shell, Dockerfile and documentation finders added to `disable-tls-verify` and `widen-file-mode`. Terraform: `expose-public-access`, `disable-encryption`, `open-ingress`. Dockerfiles: `run-as-root`, `unverified-download`. Shell: `drop-strict-mode`, `unquote-expansion`, `pipe-to-shell`, `curl --insecure`. Kubernetes: `enable-host-network`, `mount-host-path`, `drop-resource-limits`. Docs: insecure example commands inside code blocks and `contradict-documented-default`. Every site on the pinned samples still parses (HCL, YAML, `bash -n`, each Dockerfile `RUN`), and a corpus over them injected 31 defects.
- [ ] **Validate devops ai Tooling Across the Sample Repositories (P1 - High, Issue #505)**:
- [x] **Validate devops ai Tooling Across the Sample Repositories (P1 - High, Issue #505)**:
- *Context & Rationale*: Nothing shows whether AST parsing, repomaps, analysis and reviews work on projects that are not Python: which parser runs, whether pages and labels are right, and whether the reviewer finds defects in each language.
- *Deliverable*: One command runs the tooling over the fetched samples and saves a JSON report per category: files parsed, symbols found and the parser used; repomap and analysis output; and a scored review of the category's synthetic defect corpus. The first full run is recorded, and every failure becomes an issue.
- *Delivered*: `devops review samples validate` saves a JSON report per category. It records each file's parser and symbols, the file analysis and the repository map. With `--review` it adds a scored review of the category's defect corpus, and it names the problems it finds. The first full run (64 minutes, default persona) found 28 of 109 injected defects and kept 22. Its failures are filed: bare-name locations (#535), a verifier that invalidates what its reason confirms (#536), injections inside comments (#537), tree-sitter never installed (#538), no AST for YAML, Dockerfiles and Helm (#539, beside #506), C++ labelled C (#540), and a documented-default template that cannot be judged without code (#541).
- [ ] **AST Support for C#, C/C++, Shell and Markdown (P2 - Medium, Issue #506)**:
- *Context & Rationale*: The AST engine maps Python, TypeScript, JavaScript, Go, Rust, Java and HCL. C#, C, C++, shell and Markdown files yield no symbols, so repomaps, context packing and review grounding see nothing in them.
- *Deliverable*: Tree-sitter grammars where a maintained package exists, and fallback extractors for functions, types and headings, each tested on its pinned sample repository.
Expand Down
23 changes: 23 additions & 0 deletions docs/SELF_IMPROVEMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,29 @@ leaves out.
The score measures regression, not capability. A prompt can be tuned to find exactly the defects
this generator knows how to inject, so every score carries that caveat.

### Sample Repositories

devops ai is meant for any technical project. `devops review samples list` shows a checked-in
catalog of open-source repositories:
- one or more per category: Python, TypeScript/JavaScript, Go, Rust, Java, C#/.NET, C/C++,
Terraform, Kubernetes/Helm, Dockerfiles, shell and technical documentation;
- each pinned to a commit, with a permissive licence and the paths the tooling is run over.

`devops review samples fetch` takes each pinned commit into `.data/samples/`.

`devops review samples validate` runs the tooling over the fetched samples. It saves one JSON
report per category under `.data/reviews/sample-validations/<run>/`, recording:

- which parser read each file (tree-sitter, the regex fallback, or none) and the symbols it found;
- what file analysis made of each file: its language, symbols and dependencies;
- how many files and symbols the multilingual repository map shows of each sample;
- with `--review`, a review of the category's synthetic defect corpus, scored as above. It uses
the default persona, or every persona with `--all`.

Each report ends with its problems: a language read by the regex fallback, files that yield no
symbols, code types with no AST support, code the analysis mislabels, an empty repository map,
and a review that found nothing or failed.

---

## 5. Loop Failure Modes & Calibration Guardrails
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Task 505: Validate devops ai Tooling Across the Sample Repositories

**Issue**: [#505](https://github.com/dan-petty/devops-cli/issues/505)
**Status**: Backlog
**Status**: Done
**Milestone**: `v0.2.23`
**Priority**: `priority/p1-high`
**Scope**: `type/feature`, `scope/ai`, `priority/p1-high`
Expand All @@ -12,8 +12,79 @@

Nothing shows whether AST parsing, repomaps, analysis and reviews work on projects that are not Python: which parser runs, whether pages and labels are right, and whether the reviewer finds defects in each language.

#### Key Deliverables:
- One command runs the tooling over the fetched samples and saves a JSON report per category: files parsed, symbols found and the parser used; repomap and analysis output; and a scored review of the category's synthetic defect corpus. The first full run is recorded, and every failure becomes an issue.
- Unit and integration test coverage with structural tuple equality assertions.
- Maintain cyclomatic complexity $M \le 10$ and nesting depth $\le 5$.
- 100% passing across Gated CI validation suite (`uv run devops ci`).
### Key Deliverables Completed:

- [x] **`devops review samples validate [NAMES] [--category] [--review] [--all] [--seed]`** runs
the tooling over the fetched samples (#502). It saves one JSON report per category under
`.data/reviews/sample-validations/<run>/`, recording:
- which parser read each file (tree-sitter, the regex fallback, or none) and its symbols;
- what file analysis made of each file: its language, symbols and dependencies;
- how many files and symbols the multilingual repository map shows of each sample;
- with `--review`, the category's synthetic defect corpus (#503, #504), reviewed with the default
persona (or all with `--all`) and scored.
- [x] **Problems per category**:
- a language the engine claims but reads with the regex fallback;
- files with no symbols;
- code types with no AST support;
- code the file analysis reads as plain text or labels C++ as C;
- an empty repository map;
- a review that found nothing, lost everything to verification, or failed.

A failed review is recorded in its report instead of ending the run. Samples not fetched at
their commits are named, with the command that fetches them.
- [x] **`--category` is repeatable** on `samples list`, `fetch` and `validate`; it kept only the last.
- [x] **Documentation**: a Sample Repositories section in `docs/SELF_IMPROVEMENT.md`; command
references regenerated.
- [x] **Automated Tests & Quality Gates**:
- `tests/test_review_sample_validation.py`:
- a category report with the regex fallback, a file without symbols, unsupported C# and C++,
mislabelled C++ and an ignored licence file;
- every review problem;
- the command writing its report;
- `--review` injecting, reviewing (a stand-in review) and scoring;
- a failed review recorded;
- unfetched samples;
- repeated categories.
- 100% passing status across Gated CI validation suite (`uv run devops ci`).

## 2. First Full Run

`devops review samples validate --review`, run `20260924-205901`. All 16 samples at their pinned
commits, reviewed with the default persona through the cluster gateway. It took 64 minutes, nearly
all of it in the 12 reviews.

| Category | Files | Parser | Symbols | Repomap files | Review found / reported / injected |
| :--- | ---: | :--- | ---: | ---: | :--- |
| Python | 18 | fallback 17 (the stdlib parser) | 623 | 16 | 0 / 0 / 2 |
| TypeScript/JavaScript | 37 | fallback 37 | 54 | 102 | 4 / 3 / 20 |
| Go | 5 | fallback 5 | 191 | 18 | 1 / 1 / 4 |
| Rust | 37 | fallback 37 | 763 | 27 | 2 / 2 / 6 |
| Java | 85 | fallback 85 | 1,649 | 90 | 5 / 4 / 24 |
| C#/.NET | 116 | none | 0 | 0 | 3 / 2 / 14 |
| C/C++ | 24 | none | 0 | 1 | 1 / 1 / 10 |
| Terraform | 5 | fallback 5 | 439 | 41 | 0 / 0 / 2 |
| Kubernetes/Helm | 59 | none 57, fallback 2 | 7 | 14 | 6 / 5 / 8 |
| Dockerfiles | 14 | none | 0 | 0 | 5 / 3 / 14 |
| Shell | 3 | none | 0 | 0 | 0 / 0 / 2 |
| Documentation | 13 | none | 0 | 78 | 1 / 1 / 3 |

The reviews found 28 of the 109 injected defects (26%), and 22 were still reported after
verification.

### Failures, each filed

| Failure | Evidence | Issue |
| :--- | :--- | :--- |
| Findings located by a bare file or function name are not tied to their file | 36 of 208 candidates; resolving bare file names alone lifts the run to 33 found, 24 reported | #535 |
| The verifier invalidates findings its own reason confirms | all 3 unpinned `:latest` image findings | #536 |
| The defect generator injects into code examples inside block comments | 9 of 78 brace-language injections, all `drop-await` in ky's JSDoc | #537 |
| The AST engine never uses tree-sitter: no grammar is installed | every TS, JS, Go, Rust, Java and HCL file read by the regex fallback; 16 of 31 TypeScript and 10 of 37 Rust files yield no symbols | #538 |
| No AST support for C#, C/C++, shell and Markdown | 113 C#, 24 C/C++, 13 shell and 18 Markdown files; empty repository maps for serilog, fmt and nvm | #506 (open) |
| No AST support for YAML, Dockerfiles and Helm templates | 42 YAML files, 5 Dockerfiles, a Helm template; empty maps for the Docker samples | #539 |
| File analysis labels C++ as C and Helm templates as plain text | fmt's 4 `.cc` files, the chart's `_helpers.tpl` | #540 |
| `contradict-documented-default` cannot be judged without the code | both documentation injections drew no finding; kind's docs corpus holds no code | #541 |

The remaining misses are the model not finding or not keeping a defect. Examples are the Python,
Terraform and shell corpora (0 of 2 each), C# (3 of 14), and a Java guard found and then refuted
with false reasoning. #475 measures that per backend. The
TypeScript row counts 9 injections inside comments (#537); of the 11 real ones, 4 were found.
27 changes: 25 additions & 2 deletions docs/commands/ai.md
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ devops ai review samples list [OPTIONS]

| Option / Flag | Type | Default | Description |
|---|---|---|---|
| `--category`, `-c` | `choice (python|typescript-javascript|go|rust|java|csharp-dotnet|c-cpp|terraform|kubernetes-helm|dockerfile|shell|documentation)` | - | Only samples of this category. |
| `--category`, `-c` | `choice (python|typescript-javascript|go|rust|java|csharp-dotnet|c-cpp|terraform|kubernetes-helm|dockerfile|shell|documentation)` | - | Only samples of this category (repeatable). |

#### `devops ai review samples fetch`

Expand All @@ -883,7 +883,30 @@ devops ai review samples fetch [OPTIONS] <names>

| Option / Flag | Type | Default | Description |
|---|---|---|---|
| `--category`, `-c` | `choice (python|typescript-javascript|go|rust|java|csharp-dotnet|c-cpp|terraform|kubernetes-helm|dockerfile|shell|documentation)` | - | Only samples of this category. |
| `--category`, `-c` | `choice (python|typescript-javascript|go|rust|java|csharp-dotnet|c-cpp|terraform|kubernetes-helm|dockerfile|shell|documentation)` | - | Only samples of this category (repeatable). |

#### `devops ai review samples validate`

**Run devops ai tooling over fetched samples and save a JSON report per category.**

```bash
devops ai review samples validate [OPTIONS] <names>
```

**Arguments:**

| Argument | Type | Required | Description |
|---|---|---|---|
| `<names>` | `string` | No | Sample(s) to validate (default: every sample, or every one in --category). |

**Options:**

| Option / Flag | Type | Default | Description |
|---|---|---|---|
| `--category`, `-c` | `choice (python|typescript-javascript|go|rust|java|csharp-dotnet|c-cpp|terraform|kubernetes-helm|dockerfile|shell|documentation)` | - | Only samples of this category (repeatable). |
| `--review` | `boolean` | - | Also review each category's synthetic defect corpus and score it (calls the configured LLM). |
| `--all` | `boolean` | - | Run all reviewer personas in sequence. |
| `--seed` | `integer` | `1` | Seed choosing each file's defect; the same seed and files give the same corpus. |

### `devops ai review hallucinations`

Expand Down
27 changes: 25 additions & 2 deletions docs/commands/review.md
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ devops review samples list [OPTIONS]

| Option / Flag | Type | Default | Description |
|---|---|---|---|
| `--category`, `-c` | `choice (python|typescript-javascript|go|rust|java|csharp-dotnet|c-cpp|terraform|kubernetes-helm|dockerfile|shell|documentation)` | - | Only samples of this category. |
| `--category`, `-c` | `choice (python|typescript-javascript|go|rust|java|csharp-dotnet|c-cpp|terraform|kubernetes-helm|dockerfile|shell|documentation)` | - | Only samples of this category (repeatable). |

### `devops review samples fetch`

Expand All @@ -395,7 +395,30 @@ devops review samples fetch [OPTIONS] <names>

| Option / Flag | Type | Default | Description |
|---|---|---|---|
| `--category`, `-c` | `choice (python|typescript-javascript|go|rust|java|csharp-dotnet|c-cpp|terraform|kubernetes-helm|dockerfile|shell|documentation)` | - | Only samples of this category. |
| `--category`, `-c` | `choice (python|typescript-javascript|go|rust|java|csharp-dotnet|c-cpp|terraform|kubernetes-helm|dockerfile|shell|documentation)` | - | Only samples of this category (repeatable). |

### `devops review samples validate`

**Run devops ai tooling over fetched samples and save a JSON report per category.**

```bash
devops review samples validate [OPTIONS] <names>
```

**Arguments:**

| Argument | Type | Required | Description |
|---|---|---|---|
| `<names>` | `string` | No | Sample(s) to validate (default: every sample, or every one in --category). |

**Options:**

| Option / Flag | Type | Default | Description |
|---|---|---|---|
| `--category`, `-c` | `choice (python|typescript-javascript|go|rust|java|csharp-dotnet|c-cpp|terraform|kubernetes-helm|dockerfile|shell|documentation)` | - | Only samples of this category (repeatable). |
| `--review` | `boolean` | - | Also review each category's synthetic defect corpus and score it (calls the configured LLM). |
| `--all` | `boolean` | - | Run all reviewer personas in sequence. |
| `--seed` | `integer` | `1` | Seed choosing each file's defect; the same seed and files give the same corpus. |

---

Expand Down
Loading
Loading