feat: currentAuthor() carries git user.email — fail-open identity (F5 SLICE-2, #14)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Ben Stull
2026-06-10 23:00:03 -07:00
parent 746071a585
commit ef4ec8dbe9
4 changed files with 56 additions and 2 deletions
+3 -1
View File
@@ -11,6 +11,7 @@ import * as vscode from "vscode";
import { CoauthorStore } from "./store";
import { emptyArtifact, type Artifact, type Provenance } from "./model";
import { buildFingerprint, resolve, shift, type OffsetRange } from "./anchorer";
import { gitUserEmail } from "./identity";
import { addThread, appendMessage, setStatus } from "./threadModel";
/** Test-facing snapshot of what is currently rendered for a document. */
@@ -72,7 +73,8 @@ export class ThreadController implements vscode.Disposable {
private currentAuthor(): Provenance {
const id = vscode.workspace.getConfiguration("git").get<string>("user.name") || process.env.USER || "human";
return { kind: "human", id };
const email = gitUserEmail(this.rootDir);
return { kind: "human", id, ...(email !== undefined ? { email } : {}) };
}
private persist(state: DocState): void {