Skip to content

docs(#5422): add yq/jq pitfalls and fail-open gate severity guidance - #5423

Merged
waynesun09 merged 1 commit into
mainfrom
agent/5422-yq-failopen-guidance
Jul 23, 2026
Merged

docs(#5422): add yq/jq pitfalls and fail-open gate severity guidance#5423
waynesun09 merged 1 commit into
mainfrom
agent/5422-yq-failopen-guidance

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

Summary

Adds two new subsections to the AGENTS.md shell scripting section to address guidance gaps identified in PR #4049, where a jq-only function (ascii_downcase) was used in a yq expression and the surrounding 2>/dev/null || echo "" pattern silently made the agent-check gate non-functional.

Changes

  • yq/jq pitfalls — documents common function name mismatches between yq and jq (downcase vs ascii_downcase, upcase vs ascii_upcase), instructs agents to verify functions against yq's built-in set, and sets reviewer severity at medium
  • Fail-open error suppression — distinguishes gate/guard steps (where fail-open is a correctness bug) from non-critical steps (where it's acceptable), includes code examples of the dangerous pattern and a safer fail-closed alternative, and instructs reviewers to flag fail-open in gate steps at medium severity or higher

Testing

  • make lint-md-links passes — no broken markdown links introduced
  • Markdown renders correctly with proper heading hierarchy (H3 subsections under H2 Shell scripting)
  • Monitor next 3 code agent PRs with yq expressions for correct function names (per issue validation criteria)
  • Monitor next 3 review agent runs on fail-open patterns in gate steps for correct severity (per issue validation criteria)

Checklist

  • PR title follows Conventional Commits (correct type, ! for breaking changes)
  • Documentation-only change — no code or test changes needed

Closes #5422

Post-script verification

  • Branch is not main/master (agent/5422-yq-failopen-guidance)
  • Secret scan passed (gitleaks — 129d28b4cf53342aaf871e45cc45845f6a1ab61d..HEAD)
  • PR body secret scan passed (gitleaks — no-git)
  • Pre-commit hooks passed (authoritative run on runner)
  • Tests ran inside sandbox

@fullsend-ai-coder
fullsend-ai-coder Bot requested a review from a team as a code owner July 21, 2026 20:16
@fullsend-ai-coder fullsend-ai-coder Bot added the ready-for-review Triggers review agent dispatch label Jul 21, 2026
@fullsend-ai-review

fullsend-ai-review Bot commented Jul 21, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 8:18 PM UTC · Completed 8:33 PM UTC
Commit: 29e2b03 · View workflow run →

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown

Site preview

Preview: https://8b248d2a-site.fullsend-ai.workers.dev

Commit: 0a74f6f947959e415ae10ee91288f0d8a4d8d354

@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@fullsend-ai-review

fullsend-ai-review Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review

Findings

Medium

Previous run

Review

Findings

Medium

Low

  • [technical accuracy] AGENTS.md:85 — The claim "split in yq requires different syntax than jq's split for some input types" is imprecise. The basic split("delimiter") syntax is identical in both tools; the actual difference is that jq supports a 2-arity split(regex; flags) form that yq does not. The phrase "for some input types" suggests the difference is about the data being split rather than function arity.
    Remediation: Replace with a more precise description, e.g.: "ltrimstr/rtrimstr exist in both. split(\"str\") works identically in both, but jq's 2-arity split(regex; flags) form is not available in yq."

Labels: PR modifies AGENTS.md documentation with shell scripting guidance

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-review fullsend-ai-review Bot added requires-manual-review Review requires human judgment documentation labels Jul 21, 2026

@waynesun09 waynesun09 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Automated multi-agent review (3 independent passes, cross-checked against actual yq/jq behavior rather than by inspection alone). One new medium-severity finding on the "yq/jq pitfalls" section, plus an update to an existing low-severity comment:

  • The "silently fails / produces no output" framing for unrecognized yq functions doesn't match actual behavior (loud parse error, non-zero exit) - see inline comment.
  • Updated the earlier low-severity comment on the ltrimstr/rtrimstr/split bullet to medium: ltrimstr/rtrimstr don't exist in yq at all (the original claim has it backwards), which is a more significant inaccuracy than the split note alone.

The fail-open guidance and its bash examples checked out against testing.

Comment thread AGENTS.md Outdated
@rh-hemartin

Copy link
Copy Markdown
Member

@waynesun09 how do we proceed here? I think it that for some reason is not happening. Also this has no assignee and the issue is a retro filed one with no assignee either.

@waynesun09 waynesun09 self-assigned this Jul 22, 2026
@waynesun09 waynesun09 added the ok-to-test Allow e2e CI to run after maintainer review (must be re-applied after each push) label Jul 22, 2026
@waynesun09

Copy link
Copy Markdown
Member

/fs-fix

@fullsend-ai-coder

fullsend-ai-coder Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 6:58 PM UTC · Completed 7:03 PM UTC
Commit: 7ada4e0 · View workflow run →

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 Fix agent — iteration 1 (human-triggered)

Addressed all 3 review findings (2 inline comments covering 3 inaccuracies). Corrected the 'silently fails' framing to accurately describe yq's loud parse-error behavior, fixed the ascii_downcase bullet, and replaced the backwards ltrimstr/rtrimstr claim with accurate information. All changes are documentation-only in AGENTS.md.

Fixed (3):

  1. silently fails framing does not match actual yq behavior (AGENTS.md): Replaced 'silently fails, producing empty or incorrect output' with accurate description: yq causes a parse error (non-zero exit, stderr message) on unrecognized functions, and it becomes silent only when combined with error suppression. Added cross-reference to the Fail-open error suppression section.
  2. ascii_downcase silently produces no output claim is wrong (AGENTS.md): Changed 'silently produces no output' to 'causes a parse error' for the ascii_downcase bullet, matching verified yq v4.47.2 behavior.
  3. ltrimstr/rtrimstr exist in both is backwards and split divergence is imprecise (AGENTS.md): Replaced incorrect claim that ltrimstr/rtrimstr exist in both tools. They are jq-only; yq only has trim (whitespace-only). Clarified split divergence: split("str") works the same in both, but jq's 2-arg split(regex; flags) form has no yq equivalent.

Tests: passed

Updated by fullsend fix agent

fullsend-ai-coder Bot added a commit that referenced this pull request Jul 22, 2026
Fix three factual inaccuracies in the yq/jq pitfalls section:

- Replace "silently fails" framing with accurate description: yq
  produces a visible parse error (non-zero exit, stderr) on
  unrecognized functions — silence requires error suppression
- Fix ascii_downcase bullet: causes a parse error, not silent
- Fix ltrimstr/rtrimstr bullet: they are jq-only (not "exist in
  both"), and clarify the actual split divergence (2-arg form)

Addresses review feedback on #5423
@waynesun09

Copy link
Copy Markdown
Member

/fs-review

@fullsend-ai-review

fullsend-ai-review Bot commented Jul 23, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 11:45 AM UTC · Completed 11:57 AM UTC
Commit: 7ada4e0 · View workflow run →

Add two subsections to the AGENTS.md shell scripting section:

1. yq/jq pitfalls — documents common function name mismatches between
yq and jq (e.g., downcase vs ascii_downcase, upcase vs ascii_upcase)
and instructs reviewers to flag unrecognized yq function names at
medium severity.

2. Fail-open error suppression — distinguishes gate/guard steps (where
fail-open breaks correctness) from non-critical steps (where fail-open
is acceptable). Includes code examples showing the dangerous pattern
and a safer fail-closed alternative. Instructs reviewers to flag
fail-open patterns in gate steps at medium severity or higher.

These gaps were identified in PR #4049 where ascii_downcase (jq-only)
was used in a yq expression, and the surrounding 2>/dev/null || echo ""
pattern silently swallowed the error, making the entire agent-check
gate non-functional.

Note: pre-commit could not run due to sandbox network restrictions
(HTTP 403 fetching git tags). The post-script runs pre-commit
authoritatively on the runner.

Closes #5422

@waynesun09 waynesun09 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Final confirmation squad pass (3 agents: Claude, Claude, Gemini) after rebasing onto main (content moved from AGENTS.md to docs/contributing/shell-scripting.md during main's doc restructure) and applying the in-scope fixes from the prior review round (split() semantics claim corrected, SAFER-example nuance added, severity-rule caveat added).

All technical claims independently re-verified against real yq v4.47.2 / jq 1.7.1 binaries - no remaining inaccuracies. One self-contradiction the fix introduced (bolded "fail-closed" callout directly contradicted by the very next paragraph) was caught and corrected in a follow-up commit. CI is fully green, no conflicts.

The two pre-existing workflow bugs found in .github/workflows/reusable-dispatch.yml (fail-open gate steps predating this PR) remain out of scope per explicit direction - not fixed here, no follow-up issue filed.

@waynesun09
waynesun09 added this pull request to the merge queue Jul 23, 2026
Merged via the queue into main with commit 64d024a Jul 23, 2026
16 checks passed
@waynesun09
waynesun09 deleted the agent/5422-yq-failopen-guidance branch July 23, 2026 16:23
@fullsend-ai-retro

fullsend-ai-retro Bot commented Jul 23, 2026

Copy link
Copy Markdown

🤖 Finished Retro · ✅ Success · Started 4:25 PM UTC · Completed 4:35 PM UTC
Commit: 0a74f6f · View workflow run →

@fullsend-ai-retro

Copy link
Copy Markdown

Retro: PR #5423 — yq/jq pitfalls and fail-open gate severity guidance

Workflow: Issue #5422 (retro-filed from PR #4049) → triage (12 min) → code agent → PR #5423 → review → fix → re-review → human approval → merged. Total: ~44 hours, with the automated pipeline (issue → PR) completing in ~12 minutes and the remaining time spent awaiting human review.

What went well:

  • The review agent caught a genuine factual error (the ltrimstr/rtrimstr reversal) through independent verification against yq v4.47.2, and self-corrected its initial LOW severity to MEDIUM after 3-agent cross-checking.
  • The fix agent (run 29948918482) performed well — it corrected all 3 technical inaccuracies and produced more accurate text than the review agent's own suggested remediation.
  • waynesun09's final approval used a 3-agent confirmation squad (Claude, Claude, Gemini) that independently verified all claims against real binaries, catching a self-contradiction the fix agent introduced.
  • The re-review (run 30004227474) confirmed 0 new findings across all dimensions.

What required rework:

Evidence for existing issues (skipped as proposals):

1 proposal filed targeting the retro agent's causal attribution accuracy when filing issues.

Proposals filed

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

Labels

documentation ok-to-test Allow e2e CI to run after maintainer review (must be re-applied after each push) ready-for-review Triggers review agent dispatch requires-manual-review Review requires human judgment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AGENTS.md: add yq function validation and fail-open gate severity guidance to shell scripting section

2 participants