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
@@ -13,6 +13,7 @@ import * as vscode from "vscode";
import { CoauthorStore } from "./store";
import { newId, type AttributionRecord, type Provenance } from "./model";
import { buildFingerprint, resolve, type OffsetRange } from "./anchorer";
import { gitUserEmail } from "./identity";
import { applyChange, coalesce, type LiveSpan } from "./attributionTracker";
import { minimizeReplace, PendingEditRegistry } from "./pendingEdits";
@@ -79,7 +80,8 @@ export class AttributionController 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 state(docPath: string): DocAttribution {
let s = this.docs.get(docPath);