{"version":107,"agent":"codex-prose-authorship-1","message":"Add sanitized prose authorship DTOs","time":1791785184372,"timeIso":"2026-10-12T06:06:24.372Z","changes":5,"change":1258,"files":["client/src/issues-wire.ts","client/test/issues.test.ts"],"draft":null,"diff":[{"path":"client/src/issues-wire.ts","added":30,"removed":4,"diff":"--- a/client/src/issues-wire.ts\n+++ b/client/src/issues-wire.ts\n@@ -8,6 +8,14 @@\n /** Who is acting: an agent through the client, or a signed-in person through the website. */\n export type Actor = { agent: string } | { person: string };\n \n+/** Public per-field author classification; missing legacy evidence is unknown. */\n+export interface ProseAuthorship {\n+\tkind: \"human\" | \"agent\" | \"unknown\";\n+\tactor: string | null;\n+\tprovenance: \"native\" | \"copy\" | \"import\" | \"historical\" | \"unknown\";\n+\tauthorField: string | null;\n+}\n+\n export interface Lines {\n \tfile: string;\n \tfrom: number;\n@@ -18,6 +26,7 @@\n export interface IssueRow {\n \tid: number;\n \ttitle: string;\n+\tauthorship: { title: ProseAuthorship };\n \tparent: number | null;\n \tstatus: Status;\n \t/** Who it's for: set when it's written or edited, else the first agent whose start note named it. */\n@@ -44,6 +53,7 @@\n \tby: string;\n \tkind: \"comment\" | \"objection\";\n \ttext: string;\n+\tauthorship: ProseAuthorship;\n \tat: number;\n \t/** Images it carries (abso issue 171); left out when none. */\n \tattachments?: Attachment[];\n@@ -68,6 +78,7 @@\n \tof: string;\n \tkind: \"question\" | \"task\";\n \tquestion: string;\n+\tauthorship: { question: ProseAuthorship };\n \t/** Files the question carries; absent when none, and from older servers. */\n \tattachments?: Attachment[];\n \treview: boolean;\n@@ -78,13 +89,13 @@\n \tblocks: number[];\n \tat: number;\n \t/** Its answer; for a withdrawn ask, the asker's note on why, with the asker as `by`. */\n-\tanswer: { by: string; words: string; at: number; attachments?: Attachment[] } | null;\n+\tanswer: { by: string; words: string; at: number; authorship: ProseAuthorship; attachments?: Attachment[] } | null;\n \t/** When waiting first listed it to the one it's asked of; null until then (abso issue 124). */\n \tseen: number | null;\n \t/** \"withdrawn\" when the asker took it back; absent for an open or answered ask, and from older servers. */\n \toutcome?: \"withdrawn\";\n \t/** When the one asked acknowledged it without answering yet, with their note; it stays open. Absent until then. */\n-\tack?: { at: number; note: string };\n+\tack?: { at: number; note: string; authorship: { note: ProseAuthorship } };\n \t/** Its thread: what the asker and the one asked said on it, oldest first. The answer closes it and isn't one of these. Absent from older servers. */\n \treplies?: AskReply[];\n \t/** Who it waits on now: the one asked, or the asker while the newest reply is a question from the one asked. Null once it's closed. Absent from older servers. */\n@@ -96,6 +107,7 @@\n \tid: number;\n \tby: string;\n \ttext: string;\n+\tauthorship: ProseAuthorship;\n \tat: number;\n \t/** A question back from the one asked: the ask waits on the asker until they reply. */\n \tquestion?: true;\n@@ -108,7 +120,13 @@\n }\n \n export interface IssuePage {\n-\tissue: IssueRow & { description: string; lines: Lines | null; watchers: string[]; attachments?: Attachment[] };\n+\tissue: IssueRow & {\n+\t\tdescription: string;\n+\t\tauthorship: { title: ProseAuthorship; description: ProseAuthorship };\n+\t\tlines: Lines | null;\n+\t\twatchers: string[];\n+\t\tattachments?: Attachment[];\n+\t};\n \tcomments: Comment[];\n \tedits: Edit[];\n \tasks: Ask[];\n@@ -157,8 +175,16 @@\n \n /** One issue search hit: the issue, where it matched, a few words around it. */\n export interface IssueSearchHit {\n-\tissue: { id: number; title: string; status: Status; updated: number; labels: string[] };\n+\tissue: {\n+\t\tid: number;\n+\t\ttitle: string;\n+\t\tstatus: Status;\n+\t\tupdated: number;\n+\t\tlabels: string[];\n+\t\tauthorship: { title: ProseAuthorship };\n+\t};\n \twhere: \"title\" | \"description\" | \"comment\";\n+\tmatchedAuthorship: ProseAuthorship;\n \tcomment?: number;\n \t/** The words around the match; char(1) and char(2) bracket each matched span. */\n \tsnippet: string;"},{"path":"client/test/issues.test.ts","added":35,"removed":7,"diff":"--- a/client/test/issues.test.ts\n+++ b/client/test/issues.test.ts\n@@ -246,16 +246,44 @@\n \t});\n \n \tit(\"shows a search hit as the issue, then where it matched, without the match markers\", () => {\n-\t\tconst issue = { id: 12, title: \"Pull is slow\", status: \"open\" as const, updated: 0, labels: [] };\n+\t\tconst unknownAuthorship = {\n+\t\t\tkind: \"unknown\" as const,\n+\t\t\tactor: null,\n+\t\t\tprovenance: \"unknown\" as const,\n+\t\t\tauthorField: null,\n+\t\t};\n+\t\tconst issue = {\n+\t\t\tid: 12,\n+\t\t\ttitle: \"Pull is slow\",\n+\t\t\tstatus: \"open\" as const,\n+\t\t\tupdated: 0,\n+\t\t\tlabels: [],\n+\t\t\tauthorship: { title: unknownAuthorship },\n+\t\t};\n \t\tassert.deepEqual(\n-\t\t\tsearchLines({ issue, where: \"comment\", comment: 40, snippet: \"the \\u0001network\\u0002 drops mid-sync\" }),\n+\t\t\tsearchLines({\n+\t\t\t\tissue,\n+\t\t\t\twhere: \"comment\",\n+\t\t\t\tcomment: 40,\n+\t\t\t\tsnippet: \"the \\u0001network\\u0002 drops mid-sync\",\n+\t\t\t\tmatchedAuthorship: unknownAuthorship,\n+\t\t\t}),\n \t\t\t['   12  open         \"Pull is slow\"', '       in comment 40: \"the network drops mid-sync\"'],\n \t\t);\n-\t\tassert.deepEqual(searchLines({ issue, where: \"description\", snippet: \"Pages load late.\", meaning: true }), [\n-\t\t\t'   12  open         \"Pull is slow\"',\n-\t\t\t'       by meaning: \"Pages load late.\"',\n-\t\t]);\n-\t\tassert.deepEqual(searchLines({ issue, where: \"title\", snippet: \"Pull is slow\" })[1], \"       in the title\");\n+\t\tassert.deepEqual(\n+\t\t\tsearchLines({\n+\t\t\t\tissue,\n+\t\t\t\twhere: \"description\",\n+\t\t\t\tsnippet: \"Pages load late.\",\n+\t\t\t\tmeaning: true,\n+\t\t\t\tmatchedAuthorship: unknownAuthorship,\n+\t\t\t}),\n+\t\t\t['   12  open         \"Pull is slow\"', '       by meaning: \"Pages load late.\"'],\n+\t\t);\n+\t\tassert.deepEqual(\n+\t\t\tsearchLines({ issue, where: \"title\", snippet: \"Pull is slow\", matchedAuthorship: unknownAuthorship })[1],\n+\t\t\t\"       in the title\",\n+\t\t);\n \t});\n \n \tit(\"withdraw is one POST to the asker's own withdraw/<ask> route\", async () => {"}],"ci":null}