Skip to content

docs(agents): add typed-test checklist to the ESLint suppressions guidance - #1420

Open
easonLiangWorldedtech wants to merge 1 commit into
Zoo-Code-Org:mainfrom
easonLiangWorldedtech:docs/agents-typed-test-guidance
Open

docs(agents): add typed-test checklist to the ESLint suppressions guidance#1420
easonLiangWorldedtech wants to merge 1 commit into
Zoo-Code-Org:mainfrom
easonLiangWorldedtech:docs/agents-typed-test-guidance

Conversation

@easonLiangWorldedtech

@easonLiangWorldedtech easonLiangWorldedtech commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Closes #1419.

Adds a concise typed-test checklist to the ESLint Suppressions section of AGENTS.md so agents do not add blanket no-explicit-any suppression entries for new or substantially changed test files:

  • Typed structural doubles: mock context/proxy classes typed against the real public types they stand in for, unknown for storage values and mock callback parameters.
  • Bracket notation for private members; public members called without casts so their generic signatures keep checking arguments.
  • A single documented construction-site double assertion instead of per-use as any casts.
  • Required validation: check-types + narrowest Vitest suite + eslint --prune-suppressions with no new entry and no raised count.
  • An exception requires a next-to-cast comment and maintainer approval.

Documentation-only change, grounded in the typing pass that retired the 137-count parallelMode suppression entry in #977 (f91e19c).

Summary by CodeRabbit

  • Documentation
    • Added guidance for writing typed test files.
    • Documented preferred approaches for test doubles, private member access, type checking, linting, and exception handling.

…dance

Closes Zoo-Code-Org#1419.

Agents kept adding blanket no-explicit-any suppression entries for large
new test files (137 in the parallelMode spec of Zoo-Code-Org#977). Give the ESLint
Suppressions section a concrete typed-test workflow so the existing
"counts must never increase" rule is applied consistently at test-file
scale: typed structural doubles, bracket notation for private members,
single documented construction-site double assertions, the required
check-types + vitest + eslint --prune-suppressions validation, and a
maintainer-approved exception path.

Documentation-only change.
@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3fa58836-2fb1-4f45-affa-179bd2bf6825

📥 Commits

Reviewing files that changed from the base of the PR and between b0fdbc7 and 9c00ef4.

📒 Files selected for processing (1)
  • AGENTS.md

Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

AGENTS.md adds a “Typed test files” subsection under “ESLint Suppressions.” It defines typing practices, validation commands, and maintainer approval requirements for unavoidable exceptions.

Changes

Typed test guidance

Layer / File(s) Summary
Typed test checklist
AGENTS.md
Adds guidance to use typed structural doubles, unknown, bracket notation, and construction-site casts. It also specifies type-check, lint, and test validation steps, plus an approval process for exceptions.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 9c00e

This documentation-only change adds guidance for typed test doubles and validation without altering product or runtime behavior; no actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: edelauna

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR satisfies issue #1419. It adds the typed-test checklist, covers typed doubles and unknown values, requires narrow ESLint validation with --prune-suppressions, documents the exception process, a…
Out of Scope Changes check ✅ Passed The change is limited to AGENTS.md and directly supports the linked issue. No unrelated code or configuration changes are identified.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Title check ✅ Passed The title clearly and concisely identifies the documentation change: adding a typed-test checklist to ESLint suppression guidance.
Description check ✅ Passed The description links issue #1419 and explains the change, design guidance, validation commands, and exception process. It does not reproduce every optional template section, but it contains the core …
Full details: Linked Issues check

Explanation

The PR satisfies issue #1419. It adds the typed-test checklist, covers typed doubles and unknown values, requires narrow ESLint validation with --prune-suppressions, documents the exception process, and does not modify suppression counts.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

Full details: Description check

Explanation

The description links issue #1419 and explains the change, design guidance, validation commands, and exception process. It does not reproduce every optional template section, but it contains the core information needed for review.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions github-actions Bot added the awaiting-review PR changes are ready and waiting for maintainer re-review label Aug 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Review process

Thanks for contributing. This comment tracks the review sequence and the next action.

  1. Required CI checks pass.
  2. The workflow starts CodeRabbit automatically.
  3. CodeRabbit reviews and approves the latest commit.
  4. A human maintainer reviews and approves after CodeRabbit.

Current step: Required CI passed. Wait for CodeRabbit to approve the latest commit.

@github-actions github-actions Bot added coderabbit-review-active Required CI passed; CodeRabbit review is active awaiting-coderabbit Waiting for CodeRabbit to approve the latest commit awaiting-review PR changes are ready and waiting for maintainer re-review and removed awaiting-review PR changes are ready and waiting for maintainer re-review labels Aug 29, 2026
@easonLiangWorldedtech

Copy link
Copy Markdown
Contributor Author

@coderabbitai can you check all my pr and see can pass the review gate foreach pr

@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="Zoo-Code-Org/Zoo-Code"
author="easonLiangWorldedtech"

echo "=== Open pull requests authored by ${author} ==="
gh pr list --repo "$repo" --author "$author" --state open --limit 100 \
  --json number,title,url,isDraft,mergeStateStatus,reviewDecision,statusCheckRollup \
  --jq '.[] | {
    number,
    title,
    url,
    isDraft,
    mergeStateStatus,
    reviewDecision,
    checks: [
      .statusCheckRollup[]? | {
        name: (.name // .context),
        status,
        conclusion
      }
    ]
  }'

echo
echo "=== Review threads and reviews ==="
for pr in $(gh pr list --repo "$repo" --author "$author" --state open --limit 100 --json number --jq '.[].number'); do
  echo "--- PR #${pr} ---"
  gh api graphql \
    -F owner="${repo%%/*}" \
    -F name="${repo#*/}" \
    -F number="$pr" \
    -f query='
query($owner: String!, $name: String!, $number: Int!) {
  repository(owner: $owner, name: $name) {
    pullRequest(number: $number) {
      reviewThreads(first: 100) {
        nodes { isResolved isOutdated comments(first: 1) { nodes { author { login } body } } }
      }
      reviews(first: 100) {
        nodes { author { login } state submittedAt }
      }
    }
  }
}' \
    --jq '{
      unresolvedThreads: [
        .data.repository.pullRequest.reviewThreads.nodes[]
        | select(.isResolved == false)
        | {
          outdated: .isOutdated,
          author: .comments.nodes[0].author.login,
          body: .comments.nodes[0].body
        }
      ],
      reviews: [
        .data.repository.pullRequest.reviews.nodes[]
        | {author: .author.login, state, submittedAt}
      ]
    }'
done

Length of output: 2092


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="Zoo-Code-Org/Zoo-Code"
author="easonLiangWorldedtech"

prs="$(gh api --paginate "repos/${repo}/pulls?state=open&per_page=100" \
  --jq ".[] | select(.user.login == \"${author}\") | .number")"

if [ -z "$prs" ]; then
  echo "No open pull requests authored by ${author} were found in ${repo}."
  exit 0
fi

for pr in $prs; do
  echo "=== PR #${pr} ==="
  gh api "repos/${repo}/pulls/${pr}" --jq '{
    number,
    title,
    html_url,
    draft,
    state,
    mergeable,
    mergeable_state,
    requested_reviewers: [.requested_reviewers[].login],
    requested_teams: [.requested_teams[].slug]
  }'

  echo "-- Reviews --"
  gh api --paginate "repos/${repo}/pulls/${pr}/reviews?per_page=100" \
    --jq '[.[] | {user: .user.login, state, submitted_at}]'

  echo "-- Check runs --"
  head_sha="$(gh api "repos/${repo}/pulls/${pr}" --jq '.head.sha')"
  gh api --paginate "repos/${repo}/commits/${head_sha}/check-runs?per_page=100" \
    -H 'Accept: application/vnd.github+json' \
    --jq '[.check_runs[] | {name, status, conclusion, details_url}]'

  echo "-- Unresolved review threads --"
  gh api graphql \
    -F owner="${repo%%/*}" \
    -F name="${repo#*/}" \
    -F number="$pr" \
    -f query='
query($owner: String!, $name: String!, $number: Int!) {
  repository(owner: $owner, name: $name) {
    pullRequest(number: $number) {
      reviewThreads(first: 100) {
        nodes {
          isResolved
          isOutdated
          comments(first: 1) {
            nodes { author { login } body path }
          }
        }
      }
    }
  }
}' \
    --jq '[.data.repository.pullRequest.reviewThreads.nodes[]
      | select(.isResolved == false)
      | {
        outdated: .isOutdated,
        author: .comments.nodes[0].author.login,
        path: .comments.nodes[0].path,
        body: .comments.nodes[0].body
      }]'
done

Length of output: 202134


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="Zoo-Code-Org/Zoo-Code"
author="easonLiangWorldedtech"

echo "=== Base branch protection requirements ==="
branches="$(gh api --paginate "repos/${repo}/pulls?state=open&per_page=100" \
  --jq ".[] | select(.user.login == \"${author}\") | .base.ref" | sort -u)"

for branch in $branches; do
  printf '%s\t' "$branch"
  gh api "repos/${repo}/branches/${branch}/protection" 2>/dev/null \
    --jq '{
      required_approvals: (.required_pull_request_reviews.required_approving_review_count // 0),
      dismiss_stale_reviews: (.required_pull_request_reviews.dismiss_stale_reviews // false),
      required_checks: [(.required_status_checks.contexts // [])[]],
      strict_checks: (.required_status_checks.strict // false)
    }' \
    || echo '{"protection":"unavailable"}'
done

echo
echo "=== Open pull request gate summary ==="
printf 'PR\tDraft\tMergeable\tMerge-state\tFailed/cancelled checks\tUnresolved threads\tLatest blocking reviews\tURL\n'

gh api --paginate "repos/${repo}/pulls?state=open&per_page=100" \
  --jq ".[] | select(.user.login == \"${author}\") | .number" |
while read -r pr; do
  pr_data="$(gh api "repos/${repo}/pulls/${pr}")"
  draft="$(jq -r '.draft' <<<"$pr_data")"
  mergeable="$(jq -r '.mergeable' <<<"$pr_data")"
  merge_state="$(jq -r '.mergeable_state' <<<"$pr_data")"
  url="$(jq -r '.html_url' <<<"$pr_data")"
  sha="$(jq -r '.head.sha' <<<"$pr_data")"

  bad_checks="$(gh api --paginate "repos/${repo}/commits/${sha}/check-runs?per_page=100" \
    -H 'Accept: application/vnd.github+json' \
    --jq '[.check_runs[] | select(.conclusion == "failure" or .conclusion == "cancelled" or .conclusion == "timed_out" or .conclusion == "action_required") | .name] | unique | join(",")')"

  unresolved="$(gh api graphql \
    -F owner="${repo%%/*}" -F name="${repo#*/}" -F number="$pr" \
    -f query='query($owner:String!,$name:String!,$number:Int!){repository(owner:$owner,name:$name){pullRequest(number:$number){reviewThreads(first:100){nodes{isResolved}}}}}' \
    --jq '[.data.repository.pullRequest.reviewThreads.nodes[] | select(.isResolved == false)] | length')"

  blocking_reviews="$(gh api --paginate "repos/${repo}/pulls/${pr}/reviews?per_page=100" \
    --jq '[.[] | select(.state == "CHANGES_REQUESTED") | .user.login] | unique | join(",")')"

  printf '%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n' \
    "$pr" "$draft" "$mergeable" "$merge_state" "$bad_checks" "$unresolved" "$blocking_reviews" "$url"
done | sort -n

Length of output: 7903


@easonLiangWorldedtech, I checked all 58 open pull requests that you authored in Zoo-Code-Org/Zoo-Code.

No pull request can currently pass the merge gate. Every pull request is either:

  • Blocked by repository requirements: 44 pull requests.
  • Dirty with merge conflicts: 14 pull requests.

GitHub did not allow access to the main branch-protection configuration. Therefore, I cannot identify the exact unmet requirement for each blocked pull request. The API returned 403 Resource not accessible by integration.

PR #1420

#1420 has:

  • No failed or cancelled checks.
  • No unresolved review threads.
  • No merge conflicts.
  • mergeable: true.
  • mergeable_state: blocked.

The implementation and CI status look clean. It still needs the repository merge requirements, such as required approval or an up-to-date branch requirement, before it can pass the gate.

Pull requests with merge conflicts

These pull requests have mergeable_state: dirty:

  • #799, #926, #928, #966, #979, #981, #983
  • #1311, #1338, #1355, #1356, #1359, #1366, #1379

The following are drafts and also have merge conflicts:

  • #799, #926, #928, #966, #979, #981, #983

Pull requests with failed or cancelled checks

  • #799: codecov/patch, e2e-mock
  • #926: e2e-mock, both platform unit-test checks
  • #966: e2e-mock
  • #979: e2e-mock
  • #1354: platform-unit-test (windows-latest)
  • #1404: extension-host-visual
  • #1406: extension-host-visual
  • #1410: extension-host-visual
  • #1411: extension-host-visual
  • #1412: extension-host-visual
  • #1413: extension-host-visual

Pull requests with unresolved review threads

Pull requests with recorded change requests

Prioritize conflicts, failed checks, and unresolved review threads first. After those are fixed, push the updates and wait for required approvals on the blocked pull requests.

You are interacting with an AI system.

@easonLiangWorldedtech

Copy link
Copy Markdown
Contributor Author

@coderabbitai How to clean the awaiting-coderabbit and coderabbit-review-active labels?

@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🤖 web_search executed:

site:docs.coderabbit.ai "awaiting-coderabbit" OR "coderabbit-review-active"

Length of output: 16198


@easonLiangWorldedtech, these are CodeRabbit workflow labels. CodeRabbit normally removes them when the review state changes.

  • awaiting-coderabbit means the pull request is queued for a CodeRabbit review.
  • coderabbit-review-active means CodeRabbit is processing a review.

Do not remove coderabbit-review-active while CodeRabbit is still publishing a review. The label can return on the next commit or review trigger.

To stop reviews for one pull request, post this top-level PR comment:

`@coderabbitai` pause

After the review is no longer active, remove stale labels from the GitHub PR Labels menu. This only changes the GitHub label state. It does not disable CodeRabbit. A later push, @coderabbitai review, or automatic-review trigger can add the labels again.

To resume reviews later, post:

`@coderabbitai` resume

If you want to remove these labels from many pull requests, do it in small groups and only after confirming that no review is active. I cannot perform a bulk label-removal action without maintainer confirmation.

You are interacting with an AI system.

@easonLiangWorldedtech

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@easonLiangWorldedtech

Copy link
Copy Markdown
Contributor Author

@coderabbitai resume

@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Reviews resumed.

@easonLiangWorldedtech

easonLiangWorldedtech commented Aug 30, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai do I need to ask you to approve to pass the PR review gate CI? what is the command?

@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

@easonLiangWorldedtech, if the repository requires a CodeRabbit approval, post this top-level PR comment:

`@coderabbitai` approve

Use it after CodeRabbit finishes the review and all review findings are resolved.

This command only provides the CodeRabbit approval. It cannot satisfy other GitHub merge requirements, such as:

  • A required human maintainer approval.
  • Required status checks.
  • An up-to-date branch requirement.
  • Signed commits or other repository rules.

For PR #1420, the previous check showed no failed checks, unresolved threads, or conflicts. GitHub still reports the PR as blocked, so a separate repository requirement may remain.

You are interacting with an AI system.

@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

@easonLiangWorldedtech, if the repository requires a CodeRabbit approval, add this top-level comment on the pull request:

`@coderabbitai` approve

Run this command after CodeRabbit completes its review and you resolve its findings.

This approval does not satisfy other GitHub merge requirements. The pull request can still require a human approval, successful required checks, or an up-to-date branch.

You are interacting with an AI system.

@easonLiangWorldedtech

Copy link
Copy Markdown
Contributor Author

@coderabbitai approve

@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Comments resolved. Approval is disabled; enable reviews.request_changes_workflow to allow explicit top-level @coderabbitai resolve or @coderabbitai approve commands.

@easonLiangWorldedtech

Copy link
Copy Markdown
Contributor Author

@coderabbitai why the CI still stuck?

@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="Zoo-Code-Org/Zoo-Code"
pr="1420"

echo "=== Pull request state ==="
pr_json="$(gh api "repos/${repo}/pulls/${pr}")"
jq '{
  number,
  state,
  draft,
  html_url,
  head: {ref: .head.ref, sha: .head.sha},
  base: {ref: .base.ref},
  mergeable,
  mergeable_state,
  rebaseable,
  merge_commit_sha,
  labels: [.labels[].name],
  requested_reviewers: [.requested_reviewers[].login],
  requested_teams: [.requested_teams[].slug]
}' <<<"$pr_json"

sha="$(jq -r '.head.sha' <<<"$pr_json")"
base="$(jq -r '.base.ref' <<<"$pr_json")"

echo
echo "=== Check runs for the current head commit ==="
gh api --paginate "repos/${repo}/commits/${sha}/check-runs?per_page=100" \
  -H 'Accept: application/vnd.github+json' \
  --jq '[.check_runs[] | {
    name,
    status,
    conclusion,
    started_at,
    completed_at,
    details_url
  }]'

echo
echo "=== Legacy commit statuses for the current head commit ==="
gh api "repos/${repo}/commits/${sha}/status" \
  --jq '{state, statuses: [.statuses[] | {context, state, description, target_url}]}'

echo
echo "=== Submitted reviews ==="
gh api --paginate "repos/${repo}/pulls/${pr}/reviews?per_page=100" \
  --jq '[.[] | {user: .user.login, state, submitted_at, commit_id}]'

echo
echo "=== Unresolved review-thread count ==="
gh api graphql \
  -F owner="${repo%%/*}" \
  -F name="${repo#*/}" \
  -F number="$pr" \
  -f query='
query($owner: String!, $name: String!, $number: Int!) {
  repository(owner: $owner, name: $name) {
    pullRequest(number: $number) {
      reviewThreads(first: 100) {
        nodes { isResolved isOutdated }
      }
    }
  }
}' \
  --jq '[.data.repository.pullRequest.reviewThreads.nodes[] | select(.isResolved == false)] | length'

echo
echo "=== Accessible branch protection ==="
gh api "repos/${repo}/branches/${base}/protection" \
  --jq '{
    required_status_checks,
    required_pull_request_reviews,
    required_linear_history,
    required_signatures,
    enforce_admins,
    required_conversation_resolution,
    required_deployments
  }' \
  || true

echo
echo "=== Accessible repository rulesets ==="
gh api --paginate "repos/${repo}/rulesets?includes_parents=true&per_page=100" \
  --jq '[.[] | {id, name, target, enforcement, conditions, rules}]' \
  || true

Length of output: 7819


@easonLiangWorldedtech, the CI is not stuck. All current check runs passed.

The pending check is PR review gate. Its status says:

Required CI passed. Wait for CodeRabbit to approve the latest commit.

Your earlier command did not create an approval. CodeRabbit returned:

Approval skipped: request-changes workflow disabled

The repository configuration disables explicit CodeRabbit approvals. A repository maintainer must enable:

reviews:
  request_changes_workflow: true

After that change, wait until CodeRabbit completes its review, then post this top-level PR comment again:

`@coderabbitai` approve

PR #1420 also has five requested human reviewers. A human approval can still be required by the GitHub merge rules after the PR review gate completes.

The awaiting-coderabbit and coderabbit-review-active labels are consistent with the pending CodeRabbit approval requirement.

🐇⏳

You are interacting with an AI system.

@easonLiangWorldedtech

Copy link
Copy Markdown
Contributor Author

@coderabbitai approve

@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

@easonLiangWorldedtech, processing the CodeRabbit approval request for PR #1420.

✅ Action performed

Comments resolved. Approval is disabled; enable reviews.request_changes_workflow to allow explicit top-level @coderabbitai resolve or @coderabbitai approve commands.

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

Labels

awaiting-coderabbit Waiting for CodeRabbit to approve the latest commit awaiting-review PR changes are ready and waiting for maintainer re-review coderabbit-review-active Required CI passed; CodeRabbit review is active

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhance AGENTS.md guidance for typed tests and ESLint suppressions

2 participants