blas1n/claude-skills/a-guard-on-the-shared-function-proves-nothing-about-its-call-sites

Claude Code and agent skill by blas1n/claude-skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

공유 함수에 테스트를 붙이면 그 함수의 *계산*은 지켜지지만, 그걸 **부르는 쪽의 배선**은 무방비로 남는다. 인자를 틀리게 넘기거나 아예 안 넘겨도 스위트가 전부 초록이다. 감지기는 초록/빨강이 아니라 **호출 지점에서 전선을 끊었을 때도 빨개지는가**다. 호출자가 N 개면 테스트도 N 개 — 한쪽에 붙인 가드는 다른 쪽에 대해 아무 말도 안 한다. 트리거 - 공유 함수에 새 파라미터/콜백 추가, 두 곳 이상에서 같은 메커니즘을 배선, "계산은 테스트했다", 전선 절단이 초록으로 나왔을 때.

Install

npx vskill@latest install blas1n/claude-skills/a-guard-on-the-shared-function-proves-nothing-about-its-call-sites

SKILL.md

The same SKILL.md was published earlier as blas1n/claude-skills/a-guard-on-the-shared-function-proves-nothing-about-its-call-sites.

공유 함수의 가드는 그 호출자들에 대해 아무것도 증명하지 않는다

Problem

  • 증상: 새 기능의 단위 테스트가 전부 초록. 그런데 호출 지점에서

timeout_s=remaining_s 를 timeout_s=original 로 바꾸거나, redeliver=... 인자를 통째로 지워도 스위트가 여전히 전부 초록이다.

  • 근본 원인: 테스트가 공유 함수를 직접 부르며 자기가 만든 콜백·인자를

넘긴다. 그래서 그 함수의 계산은 검증되지만, 프로덕션 호출자가 무엇을 넘기는지는 한 번도 실행되지 않는다. 결함이 사는 홉과 가드가 놓인 홉이 다르다.

  • 흔한 오해: "핵심 로직에 테스트를 붙였으니 덮였다." → 덮인 건 로직이고,

틀릴 수 있는 곳은 배선이다. 그리고 배선은 호출자마다 따로 틀린다.

Solution

  1. 전선 절단을 호출 지점에서 따로 하라. 공유 함수 내부를 끊어 빨개지는 것은

증거가 아니다. 각 호출자에서 인자를 바꾸기 · 인자를 지우기 를 따로 해라.

  1. 빨개진 개수를 세라. "1 failed" 가 아니라 어느 테스트가 빨개졌는지까지

확인해야 겨냥이 맞았는지 안다.

  1. 호출자마다 테스트 하나. 호출자가 두 곳이면 하나에 붙인 가드는 다른 쪽에

대해 아무 말도 안 한다 — 그리고 대개 덜 쓰이는 쪽이 조용히 갈라진다.

  1. 배선 테스트는 공유 함수를 스텁해 "받은 인자"를 붙잡는 모양이 가장 싸다.
python
# 공유 함수를 스텁해 프로덕션 호출자가 실제로 넘긴 것을 붙잡는다
async def _invoke_redeliver(*_a, **kw):
redeliver = kw.get("redeliver")
assert redeliver is not None, "이 호출자는 재시도 경로 없이 기다린다"
await redeliver(120.0) # 호출자의 클로저를 실제로 실행
raise TaskTimeout("forced")
monkeypatch.setattr(dispatch, "await_completion", _invoke_redeliver)
monkeypatch.setattr(dispatch, "redispatch_task", spy)
...
assert spy.calls[0]["timeout_s"] == 120.0 # 원래 예산이 아니라 남은 예산

Key Insights

  • 절단 매트릭스를 돌려라. 가드 하나당 절단 하나를 스크립트로 만들어 한 번에

돌리면, 초록으로 남는 칸이 곧 무방비인 홉의 목록이다. 실측: 절단 9건 중 2건이 초록이었고 둘 다 호출 지점 배선이었다.

  • 절단이 문법을 깨면 절단이 아니다. 스크립트에 ast.parse 확인을 넣어라 —

안 그러면 빨강이 나왔다는 이유로 성공처럼 읽힌다.

  • "계산을 테스트했다"와 "배선을 테스트했다"는 다른 문장이다. 새 파라미터를

추가했다면 그 파라미터의 의미를 지키는 테스트와, 호출자가 그걸 옳게 채우는지 지키는 테스트가 각각 필요하다.

  • 같은 모양: mock 이 배선을 가리는 것, 미러된 표면이 덜 테스트되는 쪽으로 갈라지는 것.

Case: a guard written for one consumer of the data (hpgg, 2026-09-29)

Same shape, one level up — not one function with N callers, but one data file with N consumers, and the guard lived inside one consumer.

  • sameCohort refused previous-patch bracket files of another definition — but only for ▲▼ deltas. The

display path trusted the file name: after the patch rotation moved the old [1,2] file into previous/, the tier table's fallback showed it under 브론즈 – 플래티넘 [1-4].

  • The thin-sample fallback to the previous patch was a tier-page feature. 홈 / 영웅 / 영웅 상세 read the

current file directly — invisible for weeks, then on patch day 홈 rendered empty.

  • Neither showed up in any test: the fixture was never thin and its bracket files had league_tier: null.

How to apply: when a rule is about the data (which patch is shown, which cohort a file is), put it where the data is read (pickShown / readShown), not in the page that noticed first — then every consumer gets it by construction. And make the fixture able to express the dangerous state (thin meta, old-definition file), or the suite is green exactly on the day it matters. Sensor: build against a copy of the real broken data and count (role cards, tier badges) — then wire-cut the guard at each call site and see the bug come back.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/blas1n/claude-skills/a-guard-on-the-shared-function-proves-nothing-about-its-call-sites/badge)](https://verified-skill.com/skills/blas1n/claude-skills/a-guard-on-the-shared-function-proves-nothing-about-its-call-sites)

Something wrong with this skill or its page? Tell us.