Skip to content

Harden credential cleanup and unblock Python CI - #2

Merged
alfdav merged 1 commit into
mainfrom
cursor/recon-fixes-547a
Aug 15, 2026
Merged

alfdav merged 1 commit into
mainfrom
cursor/recon-fixes-547a

Conversation

@alfdav

@alfdav alfdav commented Aug 15, 2026

Copy link
Copy Markdown
Owner

Summary

Verified recon findings against main @ 354364f and landed the smallest correctness/safety/CI/test fixes. No roadmap features.

Verified and fixed

  1. Installer leftover cleanupcleanup_temp_files / cleanup_on_exit no longer rmtree("aws") or unlink installer zip/pkg names in cwd unless TempFox registered those paths as its own leftovers.
  2. AKIA session token — empty AWS_SESSION_TOKEN is omitted (and inherited values are popped) for test_aws_connection and run_cloudfox_aws_all_checks.
  3. Profile delete honestydelete_aws_profile now returns the AND of the credentials/config write results, so --cleanup-profiles can report a failed write.
  4. Expired token on all-checks — CloudFox nonzero exits that match EXPIRED_TOKEN_INDICATORS use the same warning as the connection test. No recursive main().
  5. Access key inputAWS_ACCESS_KEY_ID uses getpass like secret/token. No documented reason to echo it.
  6. CI Codecovcodecov-action@v3 + fail_ci_if_error: true on 3.11 is the hypothesized cause of the red test (3.11) job (upload exit 255, no CODECOV_TOKEN). Upgraded to @v5, fail_ci_if_error: false, continue-on-error: true. Does not invent a token. Do not treat CI as green until this workflow change has run on the PR.
  7. tests/test_aws_profiles.py — real generate/list/create/delete/write/chmod tests against an isolated tmp ~/.aws.
  8. CLI tests--list-profiles, --cleanup-profiles, and --no-profile through main.
  9. CloudFox tests — JSON vs raw-text wrapping, retention (MAX_OUTPUT_FILES), and the current “write files before returncode check” behavior.
  10. LICENSE — standard MIT file matching the README copyright/body. GitHub LICENSE path 404 confirmed.

Verified and skipped

  • Custom / default profile orphansget_tempfox_profiles still only matches tempfox-*. That is why custom/default names are not removed by --cleanup-profiles. No new cleanup UX was added; delete return values are now honest, and tests document the prefix filter.

Test plan

  • make hygiene-fast baseline on 354364f (32 passed)
  • Failing tests first for the behavior changes, then implementation
  • make hygiene after changes: ruff, format, mypy, pytest --cov-fail-under=35, repo-scan
  • 55 passed, coverage 58.21%
  • GitHub Actions on this PR: lint/typecheck/pytest should stay green on 3.8–3.12; 3.11 Codecov upload may still fail, but the job should not go red because of it

Residual risks

  • install_aws_cli still downloads/extracts into cwd. A first-time AWS CLI install can overwrite a pre-existing cwd aws/ via unzip -o. Cleanup will not delete a tree it did not create.
  • CloudFox still writes .txt/.json before checking returncode (unchanged; now tested).
  • Codecov upload remains best-effort until a real CODECOV_TOKEN exists. This PR does not claim CI is green.
  • mypy prints a pre-existing “Python 3.9 is not supported” note and still reports success.

Out of scope (unchanged)

Credential rotation, audit logging, multi-account orchestration, extensible checks, and the unmerged claude/remove-dead-code-leiPM branch.

Open in Web Open in Cursor 

Stop atexit leftover cleanup from deleting cwd aws/ or installer
archives TempFox did not create. Omit empty AWS_SESSION_TOKEN on
AKIA paths, honor profile write results, classify expired tokens
during CloudFox all-checks, and collect access key IDs via getpass.

Add isolated AWS profile/CLI/CloudFox tests, a LICENSE file matching
the README MIT terms, and make Codecov upload best-effort so the
3.11 job no longer fails without CODECOV_TOKEN.

Co-authored-by: David Diaz <alfdav@users.noreply.github.com>
@alfdav
alfdav marked this pull request as ready for review August 15, 2026 23:22

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approved. Cursor Bugbot was not present after the first check poll, so that signal was skipped; remaining policy and review-state checks did not require human review. No reviewers were assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@alfdav
alfdav merged commit aa7dd27 into main Aug 15, 2026
8 checks passed
alfdav added a commit that referenced this pull request Aug 16, 2026
Mark PRs #2#4 shipped in docs; point MIGRATION at make hygiene
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants