Skip to content

fix(docs-review): check related docs by name and directory, not just identifier grep#3233

Closed
csoceanu wants to merge 3 commits into
fullsend-ai:mainfrom
csoceanu:fix/docs-review-related-docs-check
Closed

fix(docs-review): check related docs by name and directory, not just identifier grep#3233
csoceanu wants to merge 3 commits into
fullsend-ai:mainfrom
csoceanu:fix/docs-review-related-docs-check

Conversation

@csoceanu

@csoceanu csoceanu commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

The docs-review skill finds stale docs by grepping for identifiers from the diff. This misses docs that describe the same feature area but don't mention any specific changed identifier — common when a PR adds new behavior rather than renaming existing behavior.

This PR adds a step to check whether documentation files covering the same feature exist based on file name and directory structure, and evaluate them as candidates even without grep matches.

Changes

  • docs-review/SKILL.md step 4: after the identifier grep, also check for related doc files by name/directory match
  • docs-review/SKILL.md step 5: handle candidates without grep hits by reading section headings in the quick-scan pass
  • docs-currency.md: align the sub-agent instructions with the updated skill

Context

An impact analysis of 111 merged PRs found that the skill missed stale docs in 7 PRs (6% false negative rate). In most of these cases, the PR added new user-visible behavior and the related doc file wasn't found because the new identifiers didn't exist in existing docs. This change addresses that gap by matching code files to doc files by name and directory structure, not just identifier grep.

…identifier grep

The docs-review skill currently finds stale docs by grepping for
identifiers from the diff. This misses docs that describe the same
feature area but don't mention any specific changed identifier —
common when a PR adds new behavior rather than renaming existing
behavior.

Add a step to check whether documentation files covering the same
feature exist based on file name and directory structure, and
evaluate them as candidates even without grep matches. Update the
quick-scan pass to handle candidates without grep hits by reading
section headings instead.

Signed-off-by: csoceanu <csoceanu@redhat.com>
@csoceanu csoceanu requested a review from a team as a code owner July 7, 2026 08:11
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

E2E tests did not run

E2E tests run automatically for org/repo members and collaborators on pull requests.

For other contributors, a maintainer must add the ok-to-test label after the latest push.

See E2E testing guide for details.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Improve docs-review: include related docs via name/directory matching

🐞 Bug fix 📝 Documentation 🕐 10-20 Minutes

Grey Divider

AI Description

• Expand docs-review candidate selection beyond identifier grep to include related docs by
 path/name.
• Update quick-scan guidance to evaluate no-grep candidates via section headings.
• Align docs-currency sub-agent instructions with the updated docs-review workflow.
Diagram

graph TD
  A["PR diff"] --> B["Extract identifiers"] --> C["Grep docs"] --> D["Name/dir match"] --> E["Candidate docs"] --> F["Quick scan (context/headings)"] --> G["Verdicts"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Semantic matching (LLM/embeddings) between diff summary and docs
  • ➕ Catches conceptually-related docs even when names/paths don’t align
  • ➕ Reduces reliance on repository-specific directory conventions
  • ➖ More complex and expensive to run; may require infra/supporting tooling
  • ➖ Harder to make deterministic and explainable for reviewers
2. Explicit code-to-doc ownership mapping (metadata file/frontmatter)
  • ➕ Highly deterministic; fewer false positives from heuristic matching
  • ➕ Scales well once the mapping is maintained
  • ➖ Ongoing maintenance cost and risk of drift
  • ➖ Requires repo-wide adoption to be effective
3. Directory-based allowlist of “docs per module” rules
  • ➕ Simple implementation; predictable behavior
  • ➕ Keeps logic close to existing project structure
  • ➖ Less flexible across repos with different layouts
  • ➖ May miss cross-cutting docs that live outside the module’s doc folder

Recommendation: The PR’s approach (augmenting grep with name/directory-based candidate discovery, then using headings for no-grep quick scans) is the best low-complexity improvement for reducing false negatives. Semantic matching or explicit mappings could further improve recall, but they add significant operational or maintenance overhead that doesn’t seem justified for this incremental fix.

Files changed (2) +12 / -3

Documentation (2) +12 / -3
SKILL.mdAdd name/directory-based related-doc discovery and heading-based quick scan +9/-2

Add name/directory-based related-doc discovery and heading-based quick scan

• Extends the candidate-doc collection step to include documentation inferred by file name and directory structure, not only identifier grep matches. Updates the quick-scan pass to handle candidates without grep hits by reading section headings to determine relevance.

internal/scaffold/fullsend-repo/skills/docs-review/SKILL.md

docs-currency.mdAlign docs-currency instructions with related-doc discovery heuristic +3/-1

Align docs-currency instructions with related-doc discovery heuristic

• Updates the sub-agent guidance to also consider docs that cover the same feature area by name/directory match, even when no identifier references are found.

internal/scaffold/fullsend-repo/skills/pr-review/sub-agents/docs-currency.md

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

Site preview

Preview: https://4c4fee58-site.fullsend-ai.workers.dev

Commit: 8ac17f5e2fb7c7aa22e3d5358534d77c670ef3d4

@qodo-code-review

qodo-code-review Bot commented Jul 7, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📜 Skill insights (0)

Context used
✅ Compliance rules (platform): 61 rules

Grey Divider


Remediation recommended

1. Re-adds PR-modified docs ✓ Resolved 🐞 Bug ≡ Correctness
Description
Step 4 excludes documentation files modified in the PR, but the newly added name/directory-match
step can add those same files back into the candidate list (because they’re no longer “already in
the candidate list”). This can lead to false-positive stale-doc findings against docs that the PR is
actively updating, violating the skill’s own constraint.
Code

internal/scaffold/fullsend-repo/skills/docs-review/SKILL.md[R127-130]

+Additionally, for each changed code file, check whether a
+documentation file covering the same feature exists based on file
+name and directory structure. If one exists and is not already in the
+candidate list, add it.
Relevance

⭐⭐ Medium

Docs-review doc tweaks often rejected (PRs #717, #2044); no prior evidence about re-excluding
PR-modified docs.

PR-#717
PR-#2044

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The instructions first exclude PR-modified docs, then add name/dir matched docs without re-applying
the “modified in PR” exclusion; the constraints section reiterates PR-modified docs must not appear
in findings.

internal/scaffold/fullsend-repo/skills/docs-review/SKILL.md[123-130]
internal/scaffold/fullsend-repo/skills/docs-review/SKILL.md[198-200]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Step 4 first excludes docs that are modified in the same PR, but the newly added “name/directory match” addition can re-introduce those excluded docs because the check is only “not already in the candidate list”.

## Issue Context
The skill later states as a constraint that PR-modified docs must not appear in findings, so step 4 should not produce candidate sets that can include PR-modified docs.

## Fix Focus Areas
- internal/scaffold/fullsend-repo/skills/docs-review/SKILL.md[123-130]

Suggested change: amend the new sentence to explicitly retain the same exclusion (e.g., “If one exists, is not modified in this PR, and is not already in the candidate list, add it.”) or state that after all candidate additions, re-filter the candidate list to remove PR-modified docs.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational

2. Related-doc match underspecified 🐞 Bug ⚙ Maintainability
Description
The new “match by file name and directory structure” instruction doesn’t define a concrete heuristic
(what directories to search, what constitutes a match, or how many candidates to add), so different
runs/agents can apply different interpretations and produce inconsistent candidate sets. This
ambiguity is duplicated into the docs-currency sub-agent instructions, increasing variance in
behavior.
Code

internal/scaffold/fullsend-repo/skills/docs-review/SKILL.md[R127-130]

+Additionally, for each changed code file, check whether a
+documentation file covering the same feature exists based on file
+name and directory structure. If one exists and is not already in the
+candidate list, add it.
Relevance

⭐⭐⭐ High

Team frequently accepts clarifying underspecified/ambiguous instructions to reduce variance (e.g.,
PR #1903).

PR-#1903

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The skill introduces the new name/dir matching step but provides no further definition elsewhere;
the same underspecified phrasing is repeated in the docs-currency sub-agent instructions.

internal/scaffold/fullsend-repo/skills/docs-review/SKILL.md[127-130]
internal/scaffold/fullsend-repo/skills/pr-review/sub-agents/docs-currency.md[18-22]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new related-doc discovery step relies on “file name and directory structure” but does not specify how to perform the mapping. Without a defined heuristic and limits, different agents may select different docs (or too many docs), reducing repeatability.

## Issue Context
This instruction is now present both in the docs-review skill (step 4) and in the docs-currency sub-agent summary, so it should be specific enough to apply consistently.

## Fix Focus Areas
- internal/scaffold/fullsend-repo/skills/docs-review/SKILL.md[127-130]
- internal/scaffold/fullsend-repo/skills/pr-review/sub-agents/docs-currency.md[18-22]

Suggested change: document an explicit heuristic (and bounds), e.g.:
- Only consider docs under known doc roots (docs/, README*, etc.).
- Match by basename/stem (case-insensitive), optionally plus one parent directory segment.
- Cap added candidates per changed file (e.g., top 1–3 matches).
- Provide 1–2 examples of expected matches/non-matches.
This makes the step reproducible and reduces over-expansion of candidates.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

Comment thread internal/scaffold/fullsend-repo/skills/docs-review/SKILL.md Outdated
Comment on lines +127 to +130
Additionally, for each changed code file, check whether a
documentation file covering the same feature exists based on file
name and directory structure. If one exists and is not already in the
candidate list, add it.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Informational

2. Related-doc match underspecified 🐞 Bug ⚙ Maintainability

The new “match by file name and directory structure” instruction doesn’t define a concrete heuristic
(what directories to search, what constitutes a match, or how many candidates to add), so different
runs/agents can apply different interpretations and produce inconsistent candidate sets. This
ambiguity is duplicated into the docs-currency sub-agent instructions, increasing variance in
behavior.
Agent Prompt
## Issue description
The new related-doc discovery step relies on “file name and directory structure” but does not specify how to perform the mapping. Without a defined heuristic and limits, different agents may select different docs (or too many docs), reducing repeatability.

## Issue Context
This instruction is now present both in the docs-review skill (step 4) and in the docs-currency sub-agent summary, so it should be specific enough to apply consistently.

## Fix Focus Areas
- internal/scaffold/fullsend-repo/skills/docs-review/SKILL.md[127-130]
- internal/scaffold/fullsend-repo/skills/pr-review/sub-agents/docs-currency.md[18-22]

Suggested change: document an explicit heuristic (and bounds), e.g.:
- Only consider docs under known doc roots (docs/, README*, etc.).
- Match by basename/stem (case-insensitive), optionally plus one parent directory segment.
- Cap added candidates per changed file (e.g., top 1–3 matches).
- Provide 1–2 examples of expected matches/non-matches.
This makes the step reproducible and reduces over-expansion of candidates.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

csoceanu added 2 commits July 7, 2026 11:24
The name/directory match step could re-add documentation files that
step 4 already excluded (docs modified in the same PR). Add the
same exclusion condition to prevent false-positive findings against
docs that the PR author is actively updating.

Signed-off-by: csoceanu <csoceanu@redhat.com>
@rh-hemartin

Copy link
Copy Markdown
Member

Hello! We are migrating agents to an independent repository, we still need to remove files from here. Could you open this very same PR but against https://github.com/fullsend-ai/agents?

@csoceanu

csoceanu commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

Sure, opened the same PR against the agents repo: fullsend-ai/agents#55

@rh-hemartin rh-hemartin closed this Jul 8, 2026
@fullsend-ai-retro

fullsend-ai-retro Bot commented Jul 8, 2026

Copy link
Copy Markdown

🤖 Finished Retro · ✅ Success · Started 8:34 AM UTC · Completed 8:42 AM UTC
Commit: 8ac17f5 · View workflow run →

@fullsend-ai-retro

Copy link
Copy Markdown

PR #3233 was a human-authored fork PR by csoceanu modifying 2 files under internal/scaffold/fullsend-repo/ to improve the docs-review skill. It was closed without merge after a human reviewer redirected the contributor to fullsend-ai/agents (~5 hours later). The fullsend review agent was never dispatched because the contributor lacks write permission (fork PR authorization gate). This is the 4th+ documented instance of this redirection pattern. Two proposals follow: one for a CI-level deprecated-path check that covers fork PRs (gap in #3476 which only targets the review agent), and one providing evidence for #2974 (retro self-skip when no fullsend agents participated).

Proposals filed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants