Skip to content

[WEB-5602] Promote Coding Discovery Tool staging to main - #442

Merged
AttAditya merged 6 commits into
mainfrom
staging
Nov 27, 2026
Merged

AttAditya merged 6 commits into
mainfrom
staging

Conversation

@AttAditya

@AttAditya AttAditya commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Scope

Promote the full staging branch to main. Includes #437, which reports stable discovery agent group IDs. Also includes #441 (WEB-6954 memory-fix agent), which is outside WEB-5602.

Verification

At creation, staging had six commits not in main, and main had seventeen commits not in staging. Review mergeability and the full release scope. Verify the scanner artifact used in staging includes #437 and reports the intended tool variant before relying on the end-to-end sanction test.

Unbound Review · Score 2/5 (2 P1s) · a7c5c2f

  • codex (own score 3/5): The PR adds stable discovery agent group IDs and a macOS memory credential remediation flow. The remediation flow can overwrite a concurrent file save when atomic exchange is unavailable, and resumed scans can skip pending fixes.
  • claude (own score 4/5): The PR promotes staging to main, bringing two changes. First, each detector now has a registered agent_group_id that is stamped onto every tool row; multi-product detectors such as Visual Studio's bundled Copilot can override it per row. Second, it adds a macOS, root-only 'Fix It' flow: after the completed scan event, the agent polls the backend and removes confirmed credentials from Claude memory files, using a helper that runs as the file's own

findings: 0 P0 · 2 P1 · 1 P2 (top 5 P0/P1 inline) · engines: codex ✅ · claude ✅

Findings not posted inline
  • P2 scripts/coding_discovery_tools/memory_fix.py:222 Result post retried back-to-back with no backoff — _post_result retries the results POST 3 times with no delay between tries. The file has already been edited at this point. A brief backend or network outage of a few seconds can fail all 3 tries, so the edit is never reported (it is only counted as results_post_failed). On the next run the file hash (claude)

rules applied: CLAUDE.md

@AttAditya
AttAditya requested a review from a team November 27, 2026 15:45

@vigneshsubbiah16 vigneshsubbiah16 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Security consensus: no issues found. (reviewers: Claude, Semgrep, Gitleaks)

Pre-existing (not introduced by this PR)

  • [MEDIUM] API key is passed to curl on the command line — scripts/coding_discovery_tools/s3_uploader.py:269
    • What: _curl_post_json still sends -H "Authorization: Bearer {api_key}" as a curl argument. Any local user can read curl's arguments in the process list while the request runs.
    • Why it matters now: this PR adds a comment that moves the request body to stdin because "the process list … every local user can read". The bearer token stays in the arguments anyway. The new memory-fix poll also makes repeated calls for up to 25 minutes after each scan, so the token is exposed for longer.
    • Fix: Put the headers in a curl config file read from stdin, or a 0600 temp file passed with -K/--config. Send the body with --data-binary @file, or put it in the same config, so the API key never appears in the arguments.
    • Flagged by: Claude
  • Semgrep python-logger-credential-disclosure at utils.py:2347 and utils.py:2356 is on lines this diff does not touch. Those calls log a file path and an exception message, not the credential itself. Not re-raised.

🤖 consensus review · reviewers: Claude, Semgrep, Gitleaks · head a7c5c2f2 · 2026-11-27T15:54Z

mine = _identity(dir_fd, temp_name)
swapped = _exchange(dir_fd, temp_name, name)
if swapped is None:
os.rename(temp_name, name, src_dir_fd=dir_fd, dst_dir_fd=dir_fd)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 · Avoid overwriting concurrent saves on fallback (codex)

When atomic exchange is unavailable, a user save that lands after the preceding identity check is overwritten by the remediation file. The helper then reports success, losing the user's newer memory content.

memory_fix_helper.py:243-245 checks the file before calling _put_in_place; lines 220-223 fall back to an unconditional rename when _exchange returns None. The fallback cannot detect a save between the check and rename.

memories = collect_claude_memories(user_home, user_name)
if memories:
tool_filtered["memories"] = memories
if memory_fixes_pending:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 · Collect fix candidates for resumed tools (codex)

A resumed scan skips Claude Code entries already reported by the interrupted run, so it never collects their memory files for pending fixes. The scan can complete successfully while the requested remediation is not attempted.

ai_tools_discovery.py:4524-4532 skips a fully resumed tool and lines 4570-4573 skip resumed user entries. The only collection of memory_fix_files occurs later at lines 4651-4658, and the fix step at lines 5109-5113 receives that incomplete list.

@AttAditya
AttAditya merged commit b37c878 into main Nov 27, 2026
10 of 11 checks passed
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.

4 participants