feat(FN-4711): complete Step 2 — add worktrunk install audit helper
Fusion-Task-Id: FN-4711 Fusion-Task-Lineage: 800e3606-c30f-40c5-a707-4dbbf5a9d032
This commit is contained in:
committed by
gsxdsm
parent
17dc1ba5ac
commit
1390e0e99b
@@ -68,6 +68,32 @@ async function emitBinaryAudit(
|
||||
await auditor.filesystem({ type, target: WORKTRUNK_INSTALL_PATH, metadata });
|
||||
}
|
||||
|
||||
async function emitInstallSuccessAudit(
|
||||
auditor: RunAuditor | undefined,
|
||||
payload: { binaryPath: string; installSource: "release-binary" | "cargo"; durationMs: number },
|
||||
runContext?: EngineRunContext,
|
||||
): Promise<void> {
|
||||
if (!auditor) return;
|
||||
try {
|
||||
await auditor.git({
|
||||
type: "worktree:worktrunk-install",
|
||||
target: payload.binaryPath,
|
||||
metadata: {
|
||||
op: "install",
|
||||
binaryPath: payload.binaryPath,
|
||||
installSource: payload.installSource,
|
||||
durationMs: payload.durationMs,
|
||||
taskId: runContext?.taskId,
|
||||
runId: runContext?.runId,
|
||||
},
|
||||
});
|
||||
} catch (err) {
|
||||
logger.warn("install-audit-failed", {
|
||||
err: err instanceof Error ? err.message : String(err),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
async function lookupPath(binaryName: string): Promise<string | null> {
|
||||
const command = process.platform === "win32" ? "where" : "which";
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user