test(observability): preserve #345 UA wire-capture checks as in-tree diagnostics + runbook
@scottschreckengaust is already working on this.
Since Sep 14, 2026.
Assessment
This issue has not been assessed yet.
Description
Summary
PR #345 (#319, solution attribution via native AWS_SDK_UA_APP_ID) shipped unit tests for the UA helpers (agent/tests/test_ua.py, cdk/test/handlers/shared/ua.test.ts, cli/test/ua.test.ts) and the SolutionUaAspect. During that work, two wire-capture verification scripts were written but never committed. They should be preserved in the repo as diagnostics, because they verify something the unit tests structurally cannot.
Why they matter (the gap unit tests can't cover)
The outbound User-Agent carries two solution segments:
app/uksb-wt64nei4u6#{AWS_SDK_UA_APP_ID} <- injected by the SDK/botocore itself, from the env var
md/uksb-wt64nei4u6#{component} <- from our helper (abcaUserAgent() / ua.py)
Unit tests assert the helper returns the right md/… string. But the app/… segment is SDK-native — our code never produces it — so a helper unit test can't observe it. The only ways to confirm the assembled header on the wire are CloudTrail or a wire capture, and CloudTrail is unavailable here (this account blocks DynamoDB data events). That is exactly the recurring hazard AGENTS.md calls out: "Dropping solution UA on a new AWS client (#319)." A repeatable wire-check is the regression guard for it.
The two scripts (currently uncommitted, in the feat-319-ua-appid worktree)
agent/ua_wire_check.py— imports the realagent/src/ua.py, builds boto3 clients likeaws_session.platform_client, registers a botocorebefore-sendhook, and prints the assembled UA across STS/DynamoDB/S3/SecretsManager.cdk/ua-wire-check.ts— the SDK v3 twin: imports the realsrc/handlers/shared/ua.ts, attaches afinalizeRequestmiddleware, prints the UA across Lambda/DynamoDB/S3/SecretsManager, varyingABCA_COMPONENT.
Both import the real helpers (no mirror → no drift) and capture the UA at request-build time, so even a perms failure still prints the header.
Known issues to fix during relocation
cdk/ua-wire-check.tshas a duplicate import line (@aws-sdk/client-lambdaimported twice) — won't compile as-is.- Both import paths assume the repo root; they need adjusting for their new locations.
- Neither has a documented home or run instructions in-tree.
Proposed placement
agent/ua_wire_check.py→agent/scripts/diagnostics/ua_wire_check.py(alongsidetest_sdk_smoke.py).cdk/ua-wire-check.ts→cdk/scripts/ua-wire-check.ts(add a row tocdk/scripts/README.md; run vianpx tsx).- Add a runbook:
docs/verification/ua-wire-check-runbook.md— how to run both tiers and interpret output (incl.AWS_SDK_UA_APP_ID=''opt-out check).
These paths are deliberately outside tsc/eslint (cdk scopes src/**+test/**), vulture (agent scopes src), and knip analysis — matching the existing cdk/scripts/generate-*.ts and agent/scripts/diagnostics/*.py helper scripts. They are manual, credentialed diagnostics, not CI tests.
Acceptance
- Both scripts committed at the proposed paths, with corrected imports and a fixed (compiling)
cdkscript. cdk/scripts/README.mdlists the new script.docs/verification/ua-wire-check-runbook.mddocuments how to run each tier and what a pass looks like.- No new failures in
mise //cdk:eslint,mise //cdk:build, oragentquality (scripts are outside those scopes by design).
Notes
Follow-up to merged #345 (#319). Small chore/test change; no runtime/behavioral impact. Needs maintainer approved + assignment before implementation (ADR-003).
- Dominant language
- TypeScript
- Stars
- 146
- Forks
- 46
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 26
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from aws-samples/sample-autonomous-cloud-coding-agents
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug v1
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
bug v1
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
-
documentation P2 security
Difficulty 2/5 1-2 days Newbie friendliness 74/100
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
aws-samples/sample-autonomous-cloud-coding-agents#767 · 2 comments ·
All issues in aws-samples/sample-autonomous-cloud-coding-agents
Similar issues
-
bug(cli): hapi doctor inline-media prints a fabricated B:\ helper-script path in packaged installs Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Crush Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
catppuccin/catppuccin#3125 ·
-
Add a SECURITY.md Open
Difficulty 1/5 Under an hour Newbie friendliness 90/100
ElementsProject/cln-application#167 · 1 comment · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Quantco/pnpm-licenses#17 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100