docs(problems): add static analysis layer to testing-agents - #1826
Conversation
ReviewFindingsMedium
Low
Info
Labels: PR adds content to an exploratory problem document by an external contributor. Previous runReviewFindingsMedium
Low
Info
Previous run (2)ReviewFindingsMedium
Low
Info
Previous run (3)ReviewFindingsLow
Info
Previous run (4)ReviewFindingsLow
Info
Previous run (5)ReviewFindingsLow
Info
Previous run (6)ReviewFindingsMedium
Low
Info
Previous run (7)ReviewFindingsMedium
Low
Info
Previous run (8)ReviewFindingsMedium
Low
Info
Previous run (9)ReviewFindingsMedium
Low
Info
|
|
Thanks for the review. Addressed all three findings: scope-clarity - Added an "Optional: LLM-based rubric scoring" subsection with explicit trade-offs (cost scaling, non-determinism, judge bias, dimension fit). The deterministic static analysis layer is intentionally presented without trade-offs since it's fast, free, and CI-friendly by nature. The trade-offs live where the LLM dependency is introduced. section-ordering - Moved the section before "Relationship to other problem areas" and added a cross-reference to the CI pipeline's Step 1. unclear-reference - Removed the "with LLM (as skill.md)" phrase. |
|
Addressed the remaining findings: scope-classification-mismatch - Added a trade-offs block for the static analysis subsections covering: empirical threshold tuning, TF-IDF missing semantic similarity, dependency validation not catching semantic drift, false confidence from passing structural checks, and lint rule maintenance burden. terminology-consistency - The clarifying paragraph distinguishing "agent configurations" from "agent instructions" is intentional. The section operates on configurations (the broader structure, not just the text), and the distinction is defined in the intro. Happy to adjust if a maintainer prefers different framing. list-formatting-pattern - Noted. Happy to reformat if a maintainer prefers the em-dash bullet convention for this section. missing-authorization - Will open a follow-up issue for deeper integration work. cross-reference-pattern - The inline reference to harness-eval-lab is intentional. A dedicated subsection would be disproportionate for what is currently a single reference, not a tool recommendation. |
58e9aa5 to
1489f49
Compare
|
Squashed into a single signed-off commit to fix the DCO check. No content changes from the previous version. |
ralphbean
left a comment
There was a problem hiding this comment.
Good addition — static analysis of agent configs is a real gap in this doc. A couple things to sort out inline.
|
|
||
| Beyond per-component checks, agent configurations can be analyzed as systems. Individual components may each pass their own checks while the configuration as a whole has problems: an unbalanced token budget, clusters of overlapping triggers, duplicate content across skills, or broken references between components. | ||
|
|
||
| **Redundancy detection.** When an agent configuration grows organically, skills and instructions accumulate. TF-IDF cosine similarity across instruction texts could identify near-duplicate components (two skills that give substantially the same guidance with different names) without requiring LLM calls. A similarity threshold of around 0.85 may flag likely duplicates; lower thresholds (around 0.50) could surface overlapping trigger descriptions where multiple skills would activate simultaneously, wasting context window budget. The right thresholds are likely configuration-dependent and would need tuning. |
There was a problem hiding this comment.
[moderate] A few passages in the setup-level section read more like documentation for a specific tool than exploration of the design space. "TF-IDF cosine similarity" is presented as the technique for redundancy detection, and "a similarity threshold of around 0.85" / "around 0.50" read as calibration values from a particular implementation. The dimension scoring paragraph (soundness, safety, coherence, efficiency) has a similar feel.
I think we should present these as one option among several — embedding-based similarity, LLM-based comparison, etc. — and frame the thresholds as illustrative rather than recommended. Something like "one possible scoring taxonomy" for the dimensions would fit the doc's tone better.
The doc's convention (per CLAUDE.md: "present multiple options with trade-offs, not prescribe single solutions") is well-followed elsewhere — e.g., Approach 1 describes what golden-set evaluation is without prescribing a specific implementation. Bringing this section in line with that pattern would strengthen it.
There was a problem hiding this comment.
i agree @ralphbean , TF-IDF was the cheapest technique i had from my implementation so i used it as an example, but you're right it reads like it's the only option so i changed it. The best approach would actually be LLM-based semantic matching if cost allows, but for CI gating you'd want something cheaper.
i reframed it to similarity detection is now presented as a range of techniques (TF-IDF for cheap/fast, embeddings for better accuracy, LLM-based for best semantic matching) with cost/accuracy trade-offs between them. Thresholds are framed as illustrative values from one implementation, not recommendations. Dimension scoring is now "one possible scoring taxonomy.
also agreed on matching the approach 1 pattern. the updated version describes what static analysis checks are possible without prescribing how to implement them
| - Passing static checks can create false confidence. A configuration that is structurally sound, non-redundant, and security-clean can still give the agent bad guidance. Static analysis validates form, not function. | ||
| - Lint rules require maintenance as agent tooling evolves and new anti-patterns emerge. | ||
|
|
||
| #### Optional: LLM-based rubric scoring |
There was a problem hiding this comment.
[minor] Two small notes, neither blocking:
-
This section is a bit long relative to comparable ones (canary deployments ~24 lines, mutation testing ~22 lines). The LLM-based rubric scoring subsection drifts into behavioral testing territory already covered by the eval frameworks section. Could be trimmed or folded into a sentence or two.
-
The new content raises some good open questions — what similarity thresholds work across different setups? should lint rules be configuration-specific or universal? — that the Open Questions section at the bottom would be a natural home for.
There was a problem hiding this comment.
-
i trimmed the LLM rubric scoring subsection to two sentences, pointing to the existing eval frameworks discussion for LLM-as-judge trade-offs.
-
i added three open questions: similarity thresholds across setups, whether lint rules should be universal or per-architecture, and what token budget thresholds are appropriate for different component types across model context window sizes.
Add a new subsection under "CI pipeline for agent configurations" elaborating on Step 1 (static analysis). Covers component-level checks (structural integrity, security patterns, token budget), setup-level analysis (redundancy detection, dependency validation, token budget distribution, trigger overlap, dimension scoring), and optional LLM-based rubric scoring. Presents similarity techniques as options (TF-IDF, embeddings, LLM-based) rather than prescribing a single approach. Adds three open questions on thresholds, lint rule universality, and token budgets. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Benjamin Kapner <bkapner@redhat.com>
1489f49 to
92e2d17
Compare
|
thanks @ralphbean, is there anything i can do to help with the new PR's? or do changes here? its just a doc but i can elaborate the work |
|
@Benkapner sorry, this fell through the cracks! |
Site previewPreview: https://c01e6684-site.fullsend-ai.workers.dev Commit: |
E2E tests are runningAuthorization passed for this commit. See the E2E Tests workflow for results. |
|
🤖 Review · ❌ Terminated · Started 5:50 PM UTC · Ended 6:04 PM UTC |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
|
||
| Steps 2-4 are expensive (they invoke the LLM), so they may need dedicated pipeline infrastructure separate from normal build pipelines. Cost management is a real constraint — see [agent-infrastructure.md](agent-infrastructure.md). | ||
|
|
||
| ### Elaborating on Step 1: static analysis for agent configurations |
There was a problem hiding this comment.
[low] heading-hierarchy-and-style
The heading 'Elaborating on Step 1: static analysis for agent configurations' uses gerund/meta framing inconsistent with other level-3 headings in the document, which all use declarative or noun-phrase style.
Suggested fix: Change to a declarative heading like 'Static analysis for agent configurations'.
| **Token budget distribution.** Agent configurations have a token economy: some instructions are always loaded (system prompts, CLAUDE.md), while others load on demand (skills triggered by specific situations). Setup-level analysis can measure this distribution and flag inversions, for example a setup where always-loaded content consumes the majority of the context window, leaving little room for on-demand skills or actual task context. | ||
|
|
||
| **Trigger overlap.** Skills that activate based on natural-language trigger descriptions can overlap: two skills with similar "when to use" descriptions may both load for the same user request, consuming context budget without adding distinct value. The same similarity detection techniques used for redundancy detection could surface these overlaps. | ||
|
|
There was a problem hiding this comment.
[low] trade-offs-framing
Trade-offs are listed under a bold label rather than the document's established heading pattern (### Trade-offs or #### Trade-offs).
Suggested fix: Change 'Trade-offs:' to '#### Trade-offs' to match the established section structure while maintaining correct heading hierarchy.
|
|
||
| Application code has linters that catch structural problems, security anti-patterns, and style violations without executing the code. Agent configurations are similarly lintable. This layer is deterministic, fast, and CI-friendly. It requires no LLM calls, runs in seconds, and can gate every instruction change at zero marginal cost: if an instruction change breaks structure or introduces a security pattern, there is no reason to spend LLM budget on behavioral evaluation. An [open-source evaluation framework](https://github.com/Benkapner/harness-eval-lab) implements these checks for Claude Code configurations and has been applied to production setups. | ||
|
|
||
| #### Component-level analysis |
There was a problem hiding this comment.
[info] subsection-structure
Level-4 headings (####) are used for conceptual subsections ('Component-level analysis', 'Setup-level analysis'). Existing #### headings in the Eval frameworks section are all tool names, though using #### for sub-topics under ### is standard Markdown hierarchy.
| ### Elaborating on Step 1: static analysis for agent configurations | ||
|
|
||
| Step 1 above summarizes static analysis as linting for "obvious issues." This section expands on what that layer looks like in practice and what classes of problems it can catch. | ||
|
|
There was a problem hiding this comment.
[info] terminology-consistency
The section introduces 'agent configurations' as distinct from 'agent instructions.' The distinction is explicitly defined and the existing CI pipeline heading (line 295) already uses 'agent configurations.'
|
🤖 Finished Review · ✅ Success · Started 5:50 PM UTC · Completed 6:04 PM UTC |
|
🤖 Finished Retro · ✅ Success · Started 6:17 PM UTC · Completed 6:23 PM UTC |
Retro: PR #1826 — docs(problems): add static analysis layer to testing-agentsTimelineThis was an external community contribution by Benkapner adding 47 lines to FindingsReview iteration count was high for a docs-only PR. The review bot ran 10 iterations on this 47-line, single-file documentation change. Of those, approximately 7 were triggered by legitimate events (PR open, author comments, force pushes, final pre-merge check), but ~3 were redundant — re-reviewing unchanged code with no visible trigger event. This pattern of excessive review cycles on trivial changes wastes tokens without adding value. Human review quality was good. ralphbean's review caught a real issue — prescriptive tone presenting specific thresholds and techniques as definitive rather than illustrative — and the author addressed feedback well in a single iteration. Bot review findings were appropriate. The bot's final review produced only low/info-level findings (heading style, formatting patterns), which is the right calibration for a docs PR that had already been through human review. Proposals: None (existing coverage)All improvement opportunities identified are already covered by open issues:
This PR provides additional evidence for prioritizing these existing issues, particularly #1900 (docs fast path) and #893 (redundant dispatch filtering). |
Summary
Adds a new section to
docs/problems/testing-agents.mdcovering static analysis for agent configurations, a complementary testing layer to the behavioral approaches already documented.The document currently focuses on testing agent behavior (golden-set evaluation, behavioral contracts, canary deployments, mutation testing) and surveys tools for that purpose. This contribution adds a missing layer: testing the agent configuration itself without executing anything. It covers two levels of analysis:
This work is similar to an evaluation framework i developed that implements these static analysis and setup-level checks for Claude Code configurations. My tool runs 24 lint rules across 7 categories, performs system-level analysis (budget, triggers, dependencies), and scores configurations across dimensions like soundness, safety, coherence, and efficiency.
Follow-up
i would like to open a follow-up issue to explore deeper integration between this evaluation framework and fullsend, including contributing the tool itself or adapting its approach for fullsend's agent configuration testing pipeline (Step 1 of the CI pipeline described in the doc).