Repository navigation
Conversation
Validate the internal duplicate-check response with a strict zod schema before use, so downstream code only sees well-formed fields. Render the quoted issue title as a single inline code span with a delimiter longer than any backtick run in the title, capped at 280 characters with an ellipsis. Build the issue link only from validated repo name and issue number. Add tests covering markup, mentions, URLs, backtick-only titles, length capping, and schema rejections.
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryReviewed the incremental commit Files Reviewed (3 files)
Previous Review Summary (commit f0827ed)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit f0827ed)Status: 2 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (3 files)
Reviewed by deepseek-v4.1-flash-1017 · Input: 38.7K · Output: 3.2K · Cached: 152.6K Review guidance: REVIEW.md from base branch |
Fold whitespace in the quoted title so the duplicate notice always keeps it as one quoted paragraph inside the code span, and accept similarity scores within a small epsilon above 1, matching unclamped cosine scores returned by the search backend. Add tests for both.
|
bot: Closing as obsolete. The hardening this branch carried is therefore unreachable code and has no merge target. No replacement location exists on |
Pull request was closed
Change
The auto-triage worker builds a duplicate-notice comment from the internal duplicate-check response. This change treats that response as a validated boundary and formats the quoted title with ordinary markdown semantics:
services/auto-triage-infra/src/types.ts:SimilarTicketandDuplicateResultare now derived from zod schemas (similarTicketSchema,duplicateResultSchema) with strict field constraints (non-empty ids, positive integer issue number, similarity in [0, 1 + 1e-6] to tolerate unclamped cosine rounding, repo full name inowner/reposhape).services/auto-triage-infra/src/triage-orchestrator.ts:checkDuplicates()validates the response withduplicateResultSchemabefore use; an out-of-contract response throws, so the ticket is marked failed through the existing error path.closeDuplicate()renders the quoted title through a newformatQuotedIssueTitle()helper: whitespace is folded so the title stays one quoted paragraph, then it renders as a single CommonMark inline code span whose delimiter is one backtick longer than the longest backtick run in the title (padded when the title starts or ends with a backtick), truncated at 280 raw characters with an ellipsis. Code span content renders literally. The issue link is built only from validated fields.Verification
pnpm --filter kilo-auto-triage-worker exec vitest run: 21 passed (7 pre-existing, 14 new). New tests drive the realrunTriage → checkDuplicates → closeDuplicate → postCommentpath with a stubbed fetch and assert the exact comment body: a title containing HTML, an@org/teammention, and a URL appears unchanged inside one code span; a backtick-only title gets a longer delimiter; a 300-character title is capped at 280 + ellipsis; embedded line breaks fold to one paragraph; an out-of-range similarity fails schema validation and marks the ticket failed; a similarity marginally above 1 validates.typecheck(tsgo) andlint(oxlint) clean; formatted withoxfmt.Proxy answers
Answer: Inline code span
Confidence: 0.85
Answer: Throw, ticket marked failed
Confidence: 0.65
Answer: 280 chars + ellipsis
Confidence: 0.50
Answer: Strict on all fields
Confidence: 0.70
Answer: 280 raw title chars + ellipsis, then wrap in code span (Recommended)
Confidence: 0.80