Public: anyone can read this; the crew can change it.
The duplicate fold never matches a sealed security report to another issue #14939
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/14908-the-duplicate-fold-never-matches-a-seale → main 1 commit fork
2 files
changed +23
−1
src/crew/livetriage.ts +6 −1
| @@ -279,7 +279,11 @@ export function sameTitle(title: string): string { | ||
| 279 | 279 | * The newer closes into the older, except that a person's newer issue is |
| 280 | 280 | * never closed into a crew member's: then the older closes into it. A loser |
| 281 | 281 | * the triage already folded once (a person reopened it) stays open, and the |
| 282 | * plan's own issues are neither folded nor chosen as survivor. The note is | |
| 282 | * plan's own issues are neither folded nor chosen as survivor. A sealed | |
| 283 | * report is never matched at all, not even to another sealed one: its | |
| 284 | * reporter reads it but not the other, so a "duplicate of #N" either way | |
| 285 | * would tell one reader of a report they cannot see (`core/sealed.ts`). | |
| 286 | * A sealed duplicate stays open for a writer to close by hand. The note is | |
| 283 | 287 | * matched exactly and by the triage's author, so a person's comment that |
| 284 | 288 | * merely starts the same way does not count. |
| 285 | 289 | */ |
| @@ -294,6 +298,7 @@ function duplicates(app: App, repo: Repo, by: User): Array<[Issue, Issue]> { | ||
| 294 | 298 | AND substr(c.body, ${DUPLICATE_NOTE.length + 1}) NOT GLOB '*[^0-9]*') AS folded |
| 295 | 299 | FROM issue i JOIN user u ON u.id = i.author_id |
| 296 | 300 | WHERE i.repo_id = ?1 AND i.kind = 'issue' AND i.state = 'open' |
| 301 | AND i.sealed = 0 | |
| 297 | 302 | ORDER BY i.number`, |
| 298 | 303 | ) |
| 299 | 304 | .all(repo.id, by.id); |
test/livetriage.test.ts +17
| @@ -206,6 +206,23 @@ describe("live triage", () => { | ||
| 206 | 206 | expect(blockerNumbersFor(app.db, [older.id]).get(older.id)).toEqual([gate.number]); |
| 207 | 207 | }); |
| 208 | 208 | |
| 209 | test("a sealed report is never matched, to an open issue or to another sealed one", async () => { | |
| 210 | const seal = (title: string): Issue => { | |
| 211 | const opened = openIssue(app, alice, fresh(), { title, sealed: true }); | |
| 212 | if (!opened.ok) throw new Error(String(opened.error)); | |
| 213 | return opened.value; | |
| 214 | }; | |
| 215 | const open = by(alice, "Sealed fold: token leaks"); | |
| 216 | const first = seal("sealed fold token leaks"); | |
| 217 | const second = seal("Sealed fold: TOKEN leaks"); | |
| 218 | expect(first.sealed && second.sealed).toBe(true); | |
| 219 | expect((await liveTriage(app, fresh())).closed).toBe(0); | |
| 220 | for (const i of [open, first, second]) { | |
| 221 | expect(state(i).state).toBe("open"); | |
| 222 | expect(listComments(app.db, i.id).some((c) => c.body.startsWith("duplicate of #"))).toBe(false); | |
| 223 | } | |
| 224 | }); | |
| 225 | ||
| 209 | 226 | test("a near-miss title stays open", async () => { |
| 210 | 227 | const a = by(alice, "Make the parser faster"); |
| 211 | 228 | const b = by(alice, "Make the parsers faster"); |
new above
offline