← Back to Pull requests

chore: JSDoc이 엉뚱한 선언에 붙는 것을 가드로 검사(JD-2) #400

Closed
unknown closed this pull request without merging on Nov 22, 2026 19:23 UTC
View on GitHub
unknown unknown commented on Nov 22, 2026 19:21 UTC
Author

요약

  • 가드 jsdocPlacement 추가 (src/__tests__/guards/jsdocPlacement.test.ts, TS AST, 테스트 제외 src). 다음 세 경우를 실패로 처리:

  • - 한 선언 앞 JSDoc이 연속 두 개 이상
    - JSDoc과 선언 사이에 일반 주석이 낀 경우 (빈 줄은 파일 머리말로 간주)
    - JSDoc 첫머리 백틱 이름이 같은 파일의 export인데 아래 선언 이름과 다른 경우
  • 예외는 심볼 키(file#rule>name)와 사유로 등록. 더 이상 해당하지 않는 낡은 예외도 실패

  • 기존 위반 17곳 정리 (문서 내용 유지, 위치·병합만), 예외 1곳 (byok gate, 사유 명시)

  • docs/CONVENTIONS.md#JD-2에 가드 경로와 범위 한 문장 추가

  • 공개 진입점 동작 변화 없음 (문서 주석 위치만, verify:dist 통과)
  • Closes #399

    검증

    | 게이트 | 결과 |
    |---|---|
    | yarn typecheck | exit 0 |
    | yarn lint | exit 0 |
    | yarn format:check | exit 0 |
    | yarn build | exit 0 |
    | yarn verify:dist | exit 0 (dist 파일 850개) |
    | yarn test | exit 0, 456개 파일 중 455 통과 · 1 skipped, 전체 테스트 14,776건 통과 (21 skipped) |

    반증

    가드의 detector 단위 테스트(합성 소스 입력)가 다음 위반을 실패로 잡는 것을 확인:

  • 겹친 JSDoc: flags two stacked JSDoc blocks, flags three stacked blocks as two adjacent pairs, flags stacked JSDoc on an interface member

  • 주석 낀 JSDoc: flags a JSDoc followed by a plain comment, flags JSDoc, comment, JSDoc as orphaned

  • 이름 불일치: flags a JSDoc naming another export above a different declaration

  • 낡은 예외: applies and expires name-mismatch exemptions, keeps no stale exemption
  • 🤖 Generated with Claude Code

    https://claude.ai/code/session_013hBnm9pKRoKzt3auDC5QTb

    Diff: 168 lines (+126 / -42) across 2 files Reviewer: claude[bot] Review duration: 2m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.35) × (1 − Review Confidence (0.51)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.35 · 168 lines diff across 2 files
    0.35
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 61% · Reviewer familiarity: 35%
    50%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.307
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #400"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 50.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 35.1% (MEDIUM) · Higher = larger blast radius
    35.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 50.8% · Lower = rushed or shallow review
    50.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 17.3% · Safe to merge
    17.3%