Skip to content

fix(test): assemble the Muse key fixture so privacy:scan stays green - #3443

Merged
lidge-jun merged 1 commit into
devfrom
codex/260904-privacy-scan-muse-fixture
Sep 4, 2026
Merged

fix(test): assemble the Muse key fixture so privacy:scan stays green#3443
lidge-jun merged 1 commit into
devfrom
codex/260904-privacy-scan-muse-fixture

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Sep 4, 2026

Copy link
Copy Markdown
Owner

Summary

#3437 added a Muse Code key fixture to tests/oauth-manual-code.test.ts as a string literal. privacy:scan detects the real key grammar (LLM|<digits>|<tail>) and cannot tell a fabricated key from a live one, so it matched - which is the scanner working correctly, not a false positive.

dev has been failing the gates job since that merge. This builds the fixture from parts, exactly the way tests/meta-muse-oauth.test.ts:22 already does for the same reason.

Verification

  • bun run privacy:scan - Privacy scan passed (red before this change).
  • bun test tests/oauth-manual-code.test.ts - 18 pass, 0 fail. The assertion is unchanged; only how the fixture is constructed changed.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Security note: no real credential was ever committed. The literal was fabricated, but it matched the detector's grammar, and a detector that only fires on real keys would be useless - so the fixture moves rather than the rule.

Summary by CodeRabbit

  • Tests
    • Updated OAuth manual-code test data to construct the fixture dynamically rather than using a hardcoded API key value.
    • Preserved coverage for API keys returned as raw values while avoiding false positives from privacy scanning.

#3437 added the fixture as a literal, which privacy:scan's meta-api-key rule
matches: it detects the real key grammar and cannot tell a fake from a real
one. That is the scanner doing its job, and it has been red on dev since
that merge.

Built from parts the way tests/meta-muse-oauth.test.ts already does.
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner September 4, 2026 08:24
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-04T08:26:40.781391Z fe0556b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Sep 4, 2026
@coderabbitai

coderabbitai Bot commented Sep 4, 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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: 1c261de8-4f33-4bd1-bd07-e55344e61ed1

📥 Commits

Reviewing files that changed from the base of the PR and between 8401b68 and fe0556b.

📒 Files selected for processing (1)
  • tests/oauth-manual-code.test.ts

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


📝 Walkthrough

Walkthrough

The OAuth raw-value test now builds its Muse Code API key fixture from separate runtime segments. The expected parse result remains unchanged.

Changes

OAuth test fixture

Layer / File(s) Summary
Dynamic API key fixture
tests/oauth-manual-code.test.ts:63-65
The test assembles the fixture from a 16-digit segment and a 27-character alphabetic tail instead of using a hardcoded literal.

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

Merge Risk: ⚪ Minimal · up to fe055

The OAuth raw-value test now constructs its fabricated key at runtime, preserving its expected behavior while avoiding privacy-scan matches. No current merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: assembling the Muse key test fixture to prevent privacy:scan failures.
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 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/260904-privacy-scan-muse-fixture

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.

@lidge-jun

Copy link
Copy Markdown
Owner Author

리뷰 · 우선순위 78 / 80

이 PR은 devgates/prepush에 들어 있는 privacy:scan이 빨간 이유를 고칩니다. 바로 앞의 #3437이 Windows/Linux에서 Muse Code 키를 붙여 넣을 수 있게 하면서, tests/oauth-manual-code.test.ts에 Muse 키 모양의 문자열을 글자 그대로 넣었습니다. 그런데 scripts/privacy-scan.tsmeta-api-key 규칙은 진짜 키와 가짜 키를 구분하지 않습니다. 규칙이 보는 것은 LLM|<숫자>|<꼬리> 문법뿐이라서, 테스트용으로 만든 가짜 키도 그대로 잡힙니다. 스캐너가 잘못 울린 게 아니라, 진짜 키처럼 생긴 리터럴을 저장소에 두면 안 된다는 규칙을 제대로 지킨 결과입니다. 그 때문에 #3437이 dev에 들어온 뒤부터 bun run privacy:scan이 실패하고, gates도 같이 막혀 있습니다.

고치는 방법은 이미 같은 저장소 안에 있습니다. tests/meta-muse-oauth.test.ts 22번째 줄 근처의 CANARYLLM|와 숫자 16개, 문자 27개를 실행 시점에 이어 붙입니다. 이 PR도 oauth-manual-code.test.ts의 같은 Muse 키 픽스처를 그 방식과 똑같이 조립합니다. 그래서 파일 안을 문자열로 훑는 privacy:scan은 더 이상 그 줄을 키로 보지 않고, 테스트가 쓰는 값의 모양은 그대로 유지됩니다. 바꾸는 파일은 tests/oauth-manual-code.test.ts 하나뿐이고, parseCallbackInput이 그 키를 kind: "raw"로 통과시킨다는 검증 내용은 그대로입니다. 프로덕션 코드, OAuth 로그인 경로, Muse 붙여넣기 동작(#3437이 연 meta-muse 쪽)은 손대지 않습니다.

지금 dev HEAD는 8401b68db이고, 방금 전에 #3439로 260904 merge train 뒤의 다른 테스트 회귀 두 개를 고친 상태입니다. 그 수리와 겹치지 않는 별개 CI 구멍입니다. #3437이 연 Muse 붙여넣기 기능은 살려 두고, 스캐너만 다시 초록으로 돌리려는 아주 작은 픽스라서 types.ts/config.ts 분할 캠페인과도 무관합니다. 중복 PR로 보이는 항목도 없습니다. 작성자 설명대로 진짜 자격 증명이 커밋된 적은 없고, 감지기 문법을 맞춘 가짜 리터럴을 조립식으로 옮긴 것입니다.

라인 63 - 주석과 조립식 키로 바뀌는 지점입니다. 예전 리터럴 꼬리는 25글자였고, 새 값은 c 27개라서 meta-muse-oauthCANARY와 길이가 맞춰집니다. parseCallbackInput 검증은 키 내용이 아니라 raw 통과 여부만 보므로 동작에는 문제 없습니다. 다만 CI의 gates/privacy:scan이 아직 pending이므로, 초록을 보고 합치는 편이 안전합니다.

라인 없음 / scripts/privacy-scan.ts meta-api-key - 규칙 자체(LLM|\d+|…)는 이 PR에서 바꾸지 않습니다. 픽스처만 조립식으로 옮기는 선택이 맞습니다. 규칙을 느슨하게 만들면 진짜 키도 놓칠 수 있습니다.

메인테이너의 판단이 필요한 지점

  • gates가 초록이 되는 즉시 합칠지, 전체 매트릭스(keyring/macos 등)까지 기다릴지
  • 다른 테스트 파일에 Muse 키 문법 리터럴이 더 남아 있는지 한 번 더 훑을지(지금 PR 범위 밖)

너의 추천
gates에서 privacy:scan이 통과하는 것을 확인한 뒤 바로 dev에 머지하세요. #3437 회귀로 dev prepush/gates가 막힌 상태라 우선순위가 높고, 수정 방식도 이미 검증된 CANARY 패턴과 동일합니다. 범위 키우지 말고 이 한 줄 고침만 착지시키면 됩니다.

이 댓글은 grok-bot이 작성했습니다

@lidge-jun
lidge-jun merged commit 5ea3f20 into dev Sep 4, 2026
24 of 25 checks passed
@lidge-jun
lidge-jun deleted the codex/260904-privacy-scan-muse-fixture branch September 4, 2026 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant