Skip to content

feat(notify): show the source task in Telegram alerts - #68

Open
chevyphillip wants to merge 2 commits into
jiwoochris:mainfrom
chevyphillip:feat/telegram-alert-source-task
Open

chevyphillip wants to merge 2 commits into
jiwoochris:mainfrom
chevyphillip:feat/telegram-alert-source-task

Conversation

@chevyphillip

Copy link
Copy Markdown
Contributor

요약

텔레그램 알림에 출처 작업(task) 이름과 finding id 를 표시합니다. 지금은 무엇을
찾았는지만 나오고 어느 실행에서 나왔는지가 없어서, 한 engagement 안에서 제목이 같은
두 finding 을 구분할 수 없습니다. 단일 push 와 digest 두 경로 모두에 같은 형태로
표시합니다.

변경 유형

  • 버그 수정 (fix)
  • 기능 추가 (feat)
  • 문서 (docs)
  • 현지화·번역 (i18n)
  • 리팩터링·정리 (refactor / chore)
  • 기타:

관련 이슈

이슈 번호를 모르겠습니다. 해당 이슈가 있으면 알려 주시면 연결하겠습니다.
(자발적 기여 PR 입니다.)

구현

  • db.NotificationTaskName — task id → 표시 이름. best effort: 행이 없거나
    (삭제된 task) task id 가 없는 옛 스냅샷이면 빈 이름과 nil 을 반환합니다.
    알림 전달이 실패하면 안 되기 때문입니다. task 이름은 증거가 아니라 표시용
    필드입니다.
  • telegramItemMeta — 출처 줄을 한 곳에서만 만들어 단일 push 와 digest 가 서로
    달라질 수 없게 했습니다.
  • 라벨은 기존 현지화 문구(자산, 개요, 상세 보기)를 그대로 씁니다. 새 어휘를
    도입하지 않습니다.
  • task 이름은 60 rune 으로 자르고 HTML escape 합니다. 사용자 입력에서 올 수
    있기 때문입니다.
  • 표시할 값이 없으면 빈 라벨 대신 줄 자체를 생략합니다.

검증 방법

  • Go 변경: go build ./... 통과, go test ./... 통과 (16 packages)
  • web 변경: 해당 없음
  • UI 변경: 해당 없음

추가한 테스트 notify/telegram_meta_test.go 가 고정하는 것:

  • 단일 push 와 digest 두 경로 모두에 task 이름과 finding id 가 나온다.
  • task 도 id 도 없으면 meta 줄이 아예 나오지 않는다.
  • task 이름의 HTML 특수문자가 escape 된다 (a<b>&c → a&lt;b&gt;&amp;c).

현지화 체크리스트

현지화 PR 은 아니지만 기존 현지화 규칙을 따랐습니다.

  • 에이전트의 내부 추론 프롬프트를 번역하지 않았습니다. (해당 없음 — 프롬프트 파일 미변경)
  • 사용자에게 노출되는 산출물만 다뤘습니다. (알림 본문)
  • 명령·페이로드·코드·URL·로그 원문은 그대로 두었습니다.
  • UI 문자열 변경 없음. 알림 라벨은 기존 자산/개요/상세 보기 재사용.

사용 범위 확인

  • 이 변경은 사용 범위와 국내법을 벗어난 사용을 조장하지 않습니다.
    검증은 로컬 테스트와 로컬 HTTP 서버로만 수행했습니다.
  • 테스트·스캔 산출물을 커밋에 포함하지 않았습니다.

An alert said what was found but not which run found it, so two findings
with the same title in one engagement were indistinguishable. The task
name and the finding id now appear on their own line in both the single
push and the digest.

The source line goes through one helper, telegramItemMeta, so both
render paths cannot drift apart. Labels follow the existing localized
wording ("자산", "개요", "상세 보기") rather than introducing a second
vocabulary.

A task name is a label, not evidence: it is capped at 60 runes and
HTML-escaped, since it can come from user input. A missing task row or a
zero id renders no line at all instead of an empty label.

NotificationTaskName is best effort by design — a deleted task or an old
snapshot without a task id must not fail the delivery.

Verification: go build ./... and go test ./... pass (16 packages).
@chevyphillip

Copy link
Copy Markdown
Contributor Author

CI 는 이 포크에서 실행되지 않습니다. 포크에서 Actions 를 활성화했지만 워크플로가
등록되지 않아(workflow_dispatch 트리거도 없음) gh pr checks 는 계속 비어 있습니다.
그래서 ci.yml 의 go job 과 동일한 단계를 로컬에서 직접 돌린 결과를 남깁니다.

go build ./...            exit 0
go vet ./...              exit 0
go test ./... -count=1    16 packages ok, 0 failures

Go 1.27.3 / linux amd64. ci.yml 의 go-db job(PostgreSQL matrix: agent, config,
db, evidence, llmrec, server)은 이 환경에 해당 서비스를 띄우지 않아 돌리지
못했습니다 — 리뷰어 쪽 CI 에서 확인 부탁드립니다.

이 PR 이 건드리지 않는 것

현지화와 무관합니다. agent/promptcatalog.go, agent/prompt.go, db 시드
프롬프트는 변경하지 않았습니다. 알림 라벨은 기존 문구(자산, 개요,
상세 보기)를 그대로 재사용하며 새 어휘를 도입하지 않았습니다.

렌더 결과 비교

변경 전에는 어느 실행에서 나온 finding 인지 알 수 없었습니다:

[🟠 High] Reflected XSS
자산: a.nintendo.com
개요: q reflects

변경 후:

[🟠 High] Reflected XSS
Task: Nintendo-Reconn-Phase-01 · Finding: #7
자산: a.nintendo.com
개요: q reflects

Task / Finding 두 라벨은 필드 이름 그대로 두었습니다. task 이름은 사용자 입력에서
올 수 있으므로 60 rune 으로 자르고 HTML escape 합니다.

@chevyphillip
chevyphillip marked this pull request as ready for review November 14, 2026 05:28
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T21:57:31.539110Z bd1ad09 Manual request
ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c6899ac52e

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread notify/telegram.go Resolved

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bd1ad09769

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread notify/telegram.go Resolved
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.

1 participant