docs(testing): record the two real-AWS verify.sh traps as repo rules, not memory - #1401
Merged
Conversation
…809 fixes Both were found while integ-verifying #1383 / #1384 and were initially only written to machine-local memory, which does not follow the user to another terminal and is invisible to other contributors. Per the repo's own durable-rules ladder a fixture-authoring rule belongs in a git-tracked artifact, so they land in .claude/rules/testing.md (mandatory conventions, alongside the signal-trap / gone-probe / CLI-flag / version-literal rules) with the user-facing writeups in docs/testing.md. 1. AWS-CLI-CUSTOMIZED commands. Some aws subcommands are interactive wrappers, not API pass-throughs: in a non-interactive shell they print 'Warning: Input is not a terminal (fd=0).' then die with [Errno 22], and without </dev/null they HANG. Verified on 'aws emr list-instance-groups' (--no-paginate --no-cli-pager </dev/null does not help). The rule gives the probe procedure and the node/SDK replacement helper, including the two load-bearing details (|| return 1 so an SDK failure reaches set -e instead of an empty result satisfying a // empty jq default, and a pagination loop matching the provider's). 2. List readbacks must be order-insensitive. AWS does not preserve the submitted order of list-valued members, so an order-sensitive assertion is flaky AND its failure message accuses the fix - the first live run of the #1384 fixture reported 'issue NOT closed' while the fix was working. Sort both sides; the caveat about genuinely order-significant lists mirrors getDriftUnorderedPaths. The two memory files are reduced to pointers at these sections.
The sibling mandatory conventions all end by naming the test that enforces them. These two do not have one, so say so explicitly rather than let the '(mandatory)' heading imply CI coverage: the CLI-customized-command rule has a lint tracked in #1402, and the list-ordering rule stays judgment-based by design (a lint cannot decide whether a given list is order-significant).
|
🎉 This PR is included in version 0.278.6 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two real-AWS traps surfaced while integ-verifying #1383 and #1384. I initially
recorded them only as machine-local memory files, which was the wrong call —
~/.claude/projects/.../memory/does not follow the user to another terminaland is invisible to every other contributor, so a fixture-authoring rule
belongs in a git-tracked artifact. This moves them to
.claude/rules/testing.md(the mandatory-conventions section, alongside thesignal-trap / gone-probe / CLI-flag / version-literal rules) with the
user-facing writeups in
docs/testing.md. The two memory files are reduced topointers.
The two traps
1. AWS-CLI-CUSTOMIZED commands hang non-interactively. Some
awssubcommands are interactive wrappers rather than API pass-throughs. In a
non-interactive shell — which is every
verify.shrun — they printWarning: Input is not a terminal (fd=0).then die withaws: [ERROR]: [Errno 22] Invalid argument, and without a</dev/nulltheyHANG. Verified on
aws emr list-instance-groups;--no-paginate --no-cli-pager </dev/nulldoes not help. The rule gives the probe procedure(bogus id + hard timeout) and the
node --input-type=module -eSDKreplacement, including the two load-bearing details a naive copy would drop:
|| return 1so an SDK failure reaches the caller'sset -einstead of anempty result silently satisfying a
// empty-defaultedjqassertion, and apagination loop matching whatever the provider under test does.
2. List readbacks must be order-insensitive. AWS does not preserve the
submitted order of list-valued members, so an assertion that string-compares a
joined list against the submitted order is flaky — and because it fails on a
correct implementation, its message accuses the fix. The first live run of
the #1384 fixture reported "issue #1384 NOT closed" while the fix was working
perfectly. Sort both sides; the caveat about genuinely order-significant lists
mirrors the existing
getDriftUnorderedPathsjudgment call.Test plan
Docs-only (
.claude/rules/**+docs/**), nosrc/ortests/change, sothere is nothing to unit-test or live-test. What I did instead was verify every
factual claim against the merged code rather than against my own recollection:
tests/integration/emr-cluster/verify.sh(pagination loop +|| return 1both present)
sort(...)is present in the mergedtests/integration/lambda-esm-self-managed-kafka/verify.shquerysrc/analyzer/drift-normalize.tsreally does canonicalize on both comparisonsides, so the "integ-side twin" framing is accurate
Errno 22behavior was reproduced live in this session, including with--no-paginate --no-cli-pager </dev/nullOne claim did not survive that check and was corrected before pushing: I had
written
export AWS_PAGER=""as if it were a tree-wide invariant, but onlyemr-instance-configssets it. It is now stated as a recommendation for newand affected fixtures, so the rule does not describe a violation that most of
the tree would immediately be in.
vp run checkclean,vp run format:checkclean.Deferred
Trap 1 is arguably mechanically detectable — a lint could ban the known
CLI-customized verbs in
tests/integration/*/verify.sh, which would put it onthe strongest rung of the durable-rules ladder rather than the second. I did
not build it here: the repo's checker rules require a real-code fail probe plus
per-shape coverage floors, and the calibration set today is a single command
family (
aws emr). Filed as (#1402) so the option stays visible instead ofbeing silently dropped.