Skip to content

fix(#273): reject --include-unexported with --analyzer - #275

Merged
jflowers merged 3 commits into
mainfrom
agent/273-include-unexported-analyzer-reject
Sep 25, 2026
Merged

jflowers merged 3 commits into
mainfrom
agent/273-include-unexported-analyzer-reject

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

Summary

  • Add missing --include-unexported validation in runQualityWithExternalAnalyzer to reject the flag when --analyzer is set, matching the existing --target and --ai-mapper rejection pattern
  • The flag depends on Go-specific go/packages visibility filtering that external analyzers cannot provide — both README.md and docs/reference/cli/quality.md already document it as rejected, but the code silently accepted and ignored it
  • Add TestQualityWithExternalAnalyzer_RejectsIncludeUnexported regression test following the existing RejectsTarget/RejectsAIMapper pattern

Test plan

  • New test TestQualityWithExternalAnalyzer_RejectsIncludeUnexported verifies the error message
  • Existing RejectsTarget and RejectsAIMapper tests still pass
  • Full go test -race -count=1 -short ./cmd/gaze/... passes
  • go vet ./cmd/gaze/... passes clean
  • Secret scan passed

Closes #273

Post-script verification

  • Branch is not main/master (agent/273-include-unexported-analyzer-reject)
  • Secret scan passed (gitleaks — 76f8ca963fcfbe6254538c6744c3bc11b0f456a7..HEAD)
  • PR body secret scan passed (gitleaks — no-git)

@fullsend-ai-coder fullsend-ai-coder Bot added the ready-for-review Triggers review agent dispatch label Sep 21, 2026
@fullsend-ai-review

fullsend-ai-review Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 6:15 PM UTC · Completed 6:28 PM UTC

Commit: e4f5708 · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $4.41

@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

✅MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ REPOSITORY gitleaks yes no no 1.61s
✅ REPOSITORY git_diff yes no no 0.17s

See detailed reports in MegaLinter artifacts
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

@fullsend-ai-review fullsend-ai-review Bot added the risk/moderate PR risk: moderate label Sep 21, 2026
@fullsend-ai-review

fullsend-ai-review Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Risk Assessment: moderate (2/5)

Details

Score unchanged from prior assessment at 2 (moderate). Tier 1 signals remain uniformly low-risk (all score 1). Tier 2 git history continues to drive the composite upward: both files sit in a high-churn zone (17-19 commits in 30d) with heavy fix/revert history (10 and 23 fix/revert commits in 90d). Tier 3 linked issue is low-risk: a well-scoped doc-code mismatch fix with clear validation criteria.

Previous run

Risk Assessment: moderate (2/5)

Details

Score unchanged from prior assessment at 2 (moderate). Tier 1 signals remain uniformly low-risk (all score 1). Tier 2 git history continues to drive the composite upward: both files sit in a high-churn zone (17-19 commits in 30d) with heavy fix/revert history (10 and 23 fix/revert commits in 90d for the test and production files respectively). Tier 3 linked issue is low-risk: a well-scoped doc-code mismatch fix.

Previous run (2)

Risk Assessment: moderate (2/5)

Details

Tiny, well-scoped bug fix (2 files, 37 lines) from a known bot author with 50% test file ratio. Tier 1 signals are uniformly low-risk. The moderate composite score is driven by Tier 2 git history: cmd/gaze/main.go remains a high-churn hotspot with 14 commits in 30 days and 21 fix/revert commits in 90 days.

Previous run (3)

Risk Assessment: moderate (2/5)

Details

Tiny, well-scoped bug fix (2 files, 37 lines) from a known bot author with 50% test file ratio. Tier 1 signals are uniformly low-risk. The moderate composite score is driven by Tier 2 git history: cmd/gaze/main.go remains a high-churn hotspot with ~10 commits in 30 days and high fix-commit density.

Previous run (4)

Risk Assessment: moderate (2/5)

Details

Tiny, well-scoped bug fix (2 files, 38 lines) from a known bot author with 50% test file ratio. Tier 1 signals are uniformly low-risk. The moderate composite score is driven by Tier 2 git history: cmd/gaze/main.go is a high-churn hotspot with 13 commits in 30 days, 5 distinct authors in 90 days, and ~20 fix commits.

@fullsend-ai-review

fullsend-ai-review Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Looks good to me

Previous run

Review

Findings

Medium

  • [error message inconsistency] cmd/gaze/main.go:1283 — The new --include-unexported rejection error message says "is not supported with --analyzer" but omits "or --language", inconsistent with the adjacent --target and --ai-mapper rejections (both say "with --analyzer or --language"). Since runQualityWithExternalAnalyzer is entered when either --analyzer OR --language is set, a user running gaze quality --language python --include-unexported would see an error mentioning only --analyzer, which is confusing because they never passed --analyzer. Both README.md and docs/reference/cli/quality.md document the rejection as applying to "--analyzer or --language".
    Remediation: Change the error message to: "--include-unexported is not supported with --analyzer or --language; the external analyzer controls its own function visibility"

Low

  • [pattern-inconsistency] cmd/gaze/external_analyzer_test.go:552 — The test GoDoc comment says "when used with --analyzer" while the sibling test comments say "when used with --analyzer or --language", a minor wording inconsistency. See also: [error message inconsistency] finding at cmd/gaze/main.go:1283 — fixing the error message would naturally address this comment too.

Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR
Previous run (2)

Looks good to me

Previous run (3)

Looks good to me

Previous run (4)

Review

Findings

Low

  • [test consistency] cmd/gaze/external_analyzer_test.go:505 — The new test sets languageFlag: "python" in the qualityParams struct, but the two sibling rejection tests it mirrors (TestQualityWithExternalAnalyzer_RejectsTarget and TestQualityWithExternalAnalyzer_RejectsAIMapper) omit languageFlag. Since all three tests validate early-return validation errors that fire before languageFlag is ever read, the field is functionally irrelevant. The inconsistency breaks the otherwise exact structural parallel between the three tests.
    Remediation: Either remove languageFlag: "python" from the new test to match the two sibling tests, or add it to all three for completeness. Removing it is the minimal-diff option.

Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-coder

fullsend-ai-coder Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 6:30 PM UTC · Completed 6:43 PM UTC

Commit: e4f5708 · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $1.79

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 Fix agent — iteration 1 (bot-triggered)

Addressed the single LOW-severity finding by removing the extraneous languageFlag field from the new rejection test, restoring structural consistency with the two sibling tests.

Fixed (1):

  1. Test consistency: languageFlag in RejectsIncludeUnexported breaks structural parallel with sibling tests (cmd/gaze/external_analyzer_test.go): Removed languageFlag: "python" from TestQualityWithExternalAnalyzer_RejectsIncludeUnexported to match the two sibling rejection tests (RejectsTarget, RejectsAIMapper), which omit languageFlag. The field is functionally irrelevant since all three tests validate early-return errors before languageFlag is read.

Tests: passed

Next steps:

  • /fs-review — request a re-review of the changes
  • /fs-fix <your instruction> — run another fix pass with specific guidance
  • Push commits directly — review re-runs automatically on push
    Updated by fullsend fix agent

fullsend-ai-coder Bot added a commit that referenced this pull request Sep 21, 2026
Remove languageFlag: "python" from the new
TestQualityWithExternalAnalyzer_RejectsIncludeUnexported test to match
the structural pattern of the two sibling rejection tests (RejectsTarget
and RejectsAIMapper), which omit languageFlag. The flag is functionally
irrelevant since all three tests validate early-return errors that fire
before languageFlag is read.

Addresses #275
@fullsend-ai-review

fullsend-ai-review Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 6:44 PM UTC · Completed 6:56 PM UTC

Commit: 3d202bb · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $3.59

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-review fullsend-ai-review Bot added the ready-for-merge All reviewers approved — ready to merge label Sep 21, 2026
jflowers pushed a commit that referenced this pull request Sep 22, 2026
Remove languageFlag: "python" from the new
TestQualityWithExternalAnalyzer_RejectsIncludeUnexported test to match
the structural pattern of the two sibling rejection tests (RejectsTarget
and RejectsAIMapper), which omit languageFlag. The flag is functionally
irrelevant since all three tests validate early-return errors that fire
before languageFlag is read.

Addresses #275
@jflowers
jflowers force-pushed the agent/273-include-unexported-analyzer-reject branch from 3d202bb to 0c130c3 Compare September 22, 2026 21:01
@fullsend-ai-review

fullsend-ai-review Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 9:02 PM UTC · Completed 9:14 PM UTC

Commit: 0c130c3 · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $3.17

fullsend-ai-review[bot]

This comment was marked as outdated.

Add missing validation in runQualityWithExternalAnalyzer to reject
--include-unexported when --analyzer is set, matching the existing
--target and --ai-mapper rejection pattern. The flag depends on
Go-specific go/packages visibility filtering that external analyzers
cannot provide.

Both README.md and docs/reference/cli/quality.md already document
this flag as rejected with --analyzer, but the code silently accepted
and ignored it. This aligns the runtime behavior with the documented
behavior.

Added TestQualityWithExternalAnalyzer_RejectsIncludeUnexported
following the existing RejectsTarget/RejectsAIMapper test pattern.

Closes #273
Remove languageFlag: "python" from the new
TestQualityWithExternalAnalyzer_RejectsIncludeUnexported test to match
the structural pattern of the two sibling rejection tests (RejectsTarget
and RejectsAIMapper), which omit languageFlag. The flag is functionally
irrelevant since all three tests validate early-return errors that fire
before languageFlag is read.

Addresses #275
@jflowers
jflowers force-pushed the agent/273-include-unexported-analyzer-reject branch from 0c130c3 to b85e6cc Compare September 25, 2026 13:56
@fullsend-ai-review

fullsend-ai-review Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 1:57 PM UTC · Completed 2:11 PM UTC

Commit: b85e6cc · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $4.46

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-review fullsend-ai-review Bot removed the ready-for-merge All reviewers approved — ready to merge label Sep 25, 2026
@fullsend-ai-coder

fullsend-ai-coder Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 2:12 PM UTC · Completed 2:25 PM UTC

Commit: b85e6cc · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $2.08

The --include-unexported error message and test comment mentioned only
--analyzer, inconsistent with the sibling --target and --ai-mapper
rejections which both say "with --analyzer or --language". Since
runQualityWithExternalAnalyzer is entered when either flag is set, a
user passing --language without --analyzer would see a confusing error.

Addresses #275
@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 Fix agent — iteration 2 (bot-triggered)

Both findings shared a root cause: the --include-unexported rejection was modeled after the --target and --ai-mapper rejections but missed 'or --language' in both the error message and the test comment. Fixed the error message in main.go and the GoDoc comment plus assertion string in the test file.

Fixed (2):

  1. error message inconsistency (cmd/gaze/main.go): Added 'or --language' to the --include-unexported rejection error message to match the adjacent --target and --ai-mapper rejections, which both say 'with --analyzer or --language'
  2. pattern-inconsistency (cmd/gaze/external_analyzer_test.go): Updated the test GoDoc comment to say 'when used with --analyzer or --language' matching the sibling test comments, and updated the strings.Contains assertion to match the corrected error message

Tests: passed

Next steps:

  • /fs-review — request a re-review of the changes
  • /fs-fix <your instruction> — run another fix pass with specific guidance
  • Push commits directly — review re-runs automatically on push
    Updated by fullsend fix agent

@fullsend-ai-review

fullsend-ai-review Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 2:27 PM UTC · Completed 2:38 PM UTC

Commit: be1b664 · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $3.75

@fullsend-ai-review fullsend-ai-review Bot added the ready-for-merge All reviewers approved — ready to merge label Sep 25, 2026

@jflowers jflowers left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Review: #275 — fix(#273): reject --include-unexported with --analyzer

Small, well-scoped bugfix that aligns runtime behavior with documented behavior by rejecting --include-unexported in the external-analyzer quality path. The change is correct, minimal, documented, and tested.

Verified

  • go build ./cmd/gaze — PASS
  • go vet ./cmd/gaze/... — PASS
  • CI Unit + Integration Tests (Go 1.25) — SUCCESS
  • CI MegaLinter — SUCCESS

Acceptance criteria (#273)

  • ✓ Reject with clear error (option A chosen)
  • ✓ Behavior matches README + docs/reference/cli/quality.md
  • ✓ Test covers --include-unexported + --analyzer

All three prior review findings (languageFlag, or --language message, GoDoc comment) are resolved in the current diff.

No issues found.

This review was generated by /uf.review-pr (AI-assisted).

@jflowers
jflowers merged commit 78459ca into main Sep 25, 2026
45 checks passed
jflowers pushed a commit that referenced this pull request Sep 25, 2026
Remove languageFlag: "python" from the new
TestQualityWithExternalAnalyzer_RejectsIncludeUnexported test to match
the structural pattern of the two sibling rejection tests (RejectsTarget
and RejectsAIMapper), which omit languageFlag. The flag is functionally
irrelevant since all three tests validate early-return errors that fire
before languageFlag is read.

Addresses #275
@fullsend-ai-retro

fullsend-ai-retro Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

🤖 Finished Retro · ✅ Success · Started 2:53 PM UTC · Completed 3:08 PM UTC

Commit: be1b664 · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $8.84

@fullsend-ai-retro

Copy link
Copy Markdown

Retro: PR #275 — fix(#273): reject --include-unexported with --analyzer

Outcome: Pipeline success. This PR demonstrates the full agent self-correction loop working end-to-end: a retro agent identified a dropped review finding from PR #242, auto-created issue #273, and the triage → code → review → fix pipeline resolved it with minimal human intervention. All 3 review findings were correct with zero false positives.

Timeline

Time Event Actor Cost
Sep 21 17:54 Issue #273 auto-created from PR #242 retro analysis retro agent —
Sep 21 17:59 Triage verified mismatch, labeled ready-to-code triage agent $0.94
Sep 21 18:14 PR #275 opened (+32/-5 lines, 2 files) code agent $2.38
Sep 21 18:28 Review: CHANGES_REQUESTED — LOW: extraneous languageFlag in test review agent $4.41
Sep 21 18:43 Fix iteration 1: removed languageFlag fix agent $1.79
Sep 21 18:56 Review: APPROVED review agent $3.59
Sep 22 21:14 Review: APPROVED (re-triggered by human rebase, no code change) review agent $3.17
Sep 25 14:11 Review: CHANGES_REQUESTED — MEDIUM: error message missing "or --language"; LOW: GoDoc wording review agent $4.46
Sep 25 14:25 Fix iteration 2: added "or --language" to message and comment fix agent $2.08
Sep 25 14:38 Review: APPROVED review agent $3.75
Sep 25 14:52 Human merge (AI-assisted review via /uf.review-pr, no additional findings) jflowers —

Total agent cost: ~$26.57 (reviews: $19.38 / 73%, fixes: $3.87, code: $2.38, triage: $0.94)

What went well

  • Self-correction pipeline: The retro → issue → code → review → merge loop completed autonomously. The retro agent correctly identified a dropped finding from a previous PR and created a well-structured issue.
  • Review accuracy: All 3 findings across 2 iterations were correct, actionable, and addressed. Zero false positives.
  • Fix agent reliability: Both fix iterations correctly resolved the findings including test and comment updates.

Evidence for existing issues (proposals skipped — already tracked)

  • Review non-determinism (fullsend-ai/fullsend#2746): The Sep 22 review approved code that the Sep 25 review found a MEDIUM-severity issue on — same code content, different outcomes. The error message inconsistency ("with --analyzer" vs. "with --analyzer or --language") was present since the first commit but was missed by 3 consecutive review passes (runs 1, 2, 3) before run 4 caught it.
  • Force-push re-review cost (fullsend-ai/fullsend#1372, #7628): Two human force-push/rebase events triggered re-reviews costing $3.17 and $4.46. The Sep 22 re-review was entirely redundant ($3.17 wasted on already-approved, unchanged code).
  • Finding cache (fullsend-ai/fullsend#2816): A persistent finding cache could ensure consistent coverage across re-reviews rather than relying on LLM non-determinism to surface previously-missed issues.

Autonomy readiness

The human reviewer performed an AI-assisted review and confirmed correctness without adding any findings beyond what the review agent had already identified. For this change class — small, pattern-following bug fixes with clear acceptance criteria and existing test patterns — the review agent provided sufficient quality assurance. The human's primary contribution was the governance gate (merge approval).

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

Labels

ready-for-merge All reviewers approved — ready to merge ready-for-review Triggers review agent dispatch risk/moderate PR risk: moderate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix --include-unexported doc-code mismatch when used with --analyzer

1 participant