feat: initial implementation of TFTSR IT Triage & RCA application
Implements Phases 1-8 of the TFTSR implementation plan.
Rust backend (Tauri 2.x, src-tauri/):
- Multi-provider AI: OpenAI-compatible, Anthropic, Gemini, Mistral, Ollama
- PII detection engine: 11 regex patterns with overlap resolution
- SQLCipher AES-256 encrypted database with 10 versioned migrations
- 28 Tauri IPC commands for triage, analysis, document, and system ops
- Ollama: hardware probe, model recommendations, pull/delete with events
- RCA and blameless post-mortem Markdown document generators
- PDF export via printpdf
- Audit log: SHA-256 hash of every external data send
- Integration stubs for Confluence, ServiceNow, Azure DevOps (v0.2)
Frontend (React 18 + TypeScript + Vite, src/):
- 9 pages: full triage workflow NewIssue→LogUpload→Triage→Resolution→RCA→Postmortem→History+Settings
- 7 components: ChatWindow, TriageProgress, PiiDiffViewer, DocEditor, HardwareReport, ModelSelector, UI primitives
- 3 Zustand stores: session, settings (persisted), history
- Type-safe tauriCommands.ts matching Rust backend types exactly
- 8 IT domain system prompts (Linux, Windows, Network, K8s, DB, Virt, HW, Obs)
DevOps:
- .woodpecker/test.yml: rustfmt, clippy, cargo test, tsc, vitest on every push
- .woodpecker/release.yml: linux/amd64 + linux/arm64 builds, Gogs release upload
Verified:
- cargo check: zero errors
- tsc --noEmit: zero errors
- vitest run: 13/13 unit tests passing
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 03:36:25 +00:00
|
|
|
import React, { useEffect, useState } from "react";
|
|
|
|
|
import { useParams, Link } from "react-router-dom";
|
|
|
|
|
import { ChevronRight } from "lucide-react";
|
|
|
|
|
import { DocEditor } from "@/components/DocEditor";
|
|
|
|
|
import { useSettingsStore } from "@/stores/settingsStore";
|
|
|
|
|
import {
|
|
|
|
|
generatePostmortemCmd,
|
|
|
|
|
|
|
|
|
|
updateDocumentCmd,
|
|
|
|
|
exportDocumentCmd,
|
|
|
|
|
type Document_,
|
|
|
|
|
} from "@/lib/tauriCommands";
|
|
|
|
|
|
|
|
|
|
export default function Postmortem() {
|
|
|
|
|
const { id } = useParams<{ id: string }>();
|
2026-04-10 01:42:40 +00:00
|
|
|
void useSettingsStore((s) => s.getActiveProvider);
|
feat: initial implementation of TFTSR IT Triage & RCA application
Implements Phases 1-8 of the TFTSR implementation plan.
Rust backend (Tauri 2.x, src-tauri/):
- Multi-provider AI: OpenAI-compatible, Anthropic, Gemini, Mistral, Ollama
- PII detection engine: 11 regex patterns with overlap resolution
- SQLCipher AES-256 encrypted database with 10 versioned migrations
- 28 Tauri IPC commands for triage, analysis, document, and system ops
- Ollama: hardware probe, model recommendations, pull/delete with events
- RCA and blameless post-mortem Markdown document generators
- PDF export via printpdf
- Audit log: SHA-256 hash of every external data send
- Integration stubs for Confluence, ServiceNow, Azure DevOps (v0.2)
Frontend (React 18 + TypeScript + Vite, src/):
- 9 pages: full triage workflow NewIssue→LogUpload→Triage→Resolution→RCA→Postmortem→History+Settings
- 7 components: ChatWindow, TriageProgress, PiiDiffViewer, DocEditor, HardwareReport, ModelSelector, UI primitives
- 3 Zustand stores: session, settings (persisted), history
- Type-safe tauriCommands.ts matching Rust backend types exactly
- 8 IT domain system prompts (Linux, Windows, Network, K8s, DB, Virt, HW, Obs)
DevOps:
- .woodpecker/test.yml: rustfmt, clippy, cargo test, tsc, vitest on every push
- .woodpecker/release.yml: linux/amd64 + linux/arm64 builds, Gogs release upload
Verified:
- cargo check: zero errors
- tsc --noEmit: zero errors
- vitest run: 13/13 unit tests passing
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 03:36:25 +00:00
|
|
|
|
|
|
|
|
const [doc, setDoc] = useState<Document_ | null>(null);
|
|
|
|
|
const [content, setContent] = useState("");
|
|
|
|
|
const [isLoading, setIsLoading] = useState(false);
|
|
|
|
|
const [error, setError] = useState<string | null>(null);
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
if (!id) return;
|
|
|
|
|
const load = async () => {
|
|
|
|
|
setIsLoading(true);
|
|
|
|
|
try {
|
|
|
|
|
const generated = await generatePostmortemCmd(id);
|
|
|
|
|
setDoc(generated);
|
|
|
|
|
setContent(generated.content_md);
|
|
|
|
|
} catch (err) {
|
|
|
|
|
setError(String(err));
|
|
|
|
|
} finally {
|
|
|
|
|
setIsLoading(false);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
load();
|
|
|
|
|
}, [id]);
|
|
|
|
|
|
|
|
|
|
const handleContentChange = async (newContent: string) => {
|
|
|
|
|
setContent(newContent);
|
|
|
|
|
if (doc) {
|
|
|
|
|
try {
|
|
|
|
|
const updated = await updateDocumentCmd(doc.id, newContent);
|
|
|
|
|
setDoc(updated);
|
|
|
|
|
} catch (err) {
|
|
|
|
|
setError(String(err));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleExport = async (format: "md" | "pdf" | "docx") => {
|
|
|
|
|
if (!doc) return;
|
|
|
|
|
try {
|
2026-04-03 13:37:47 +00:00
|
|
|
const path = await exportDocumentCmd(doc.id, doc.title, content, format, "");
|
|
|
|
|
setError(`Document exported to: ${path}`);
|
|
|
|
|
setTimeout(() => setError(null), 5000);
|
feat: initial implementation of TFTSR IT Triage & RCA application
Implements Phases 1-8 of the TFTSR implementation plan.
Rust backend (Tauri 2.x, src-tauri/):
- Multi-provider AI: OpenAI-compatible, Anthropic, Gemini, Mistral, Ollama
- PII detection engine: 11 regex patterns with overlap resolution
- SQLCipher AES-256 encrypted database with 10 versioned migrations
- 28 Tauri IPC commands for triage, analysis, document, and system ops
- Ollama: hardware probe, model recommendations, pull/delete with events
- RCA and blameless post-mortem Markdown document generators
- PDF export via printpdf
- Audit log: SHA-256 hash of every external data send
- Integration stubs for Confluence, ServiceNow, Azure DevOps (v0.2)
Frontend (React 18 + TypeScript + Vite, src/):
- 9 pages: full triage workflow NewIssue→LogUpload→Triage→Resolution→RCA→Postmortem→History+Settings
- 7 components: ChatWindow, TriageProgress, PiiDiffViewer, DocEditor, HardwareReport, ModelSelector, UI primitives
- 3 Zustand stores: session, settings (persisted), history
- Type-safe tauriCommands.ts matching Rust backend types exactly
- 8 IT domain system prompts (Linux, Windows, Network, K8s, DB, Virt, HW, Obs)
DevOps:
- .woodpecker/test.yml: rustfmt, clippy, cargo test, tsc, vitest on every push
- .woodpecker/release.yml: linux/amd64 + linux/arm64 builds, Gogs release upload
Verified:
- cargo check: zero errors
- tsc --noEmit: zero errors
- vitest run: 13/13 unit tests passing
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 03:36:25 +00:00
|
|
|
} catch (err) {
|
2026-04-03 13:37:47 +00:00
|
|
|
setError(`Export failed: ${String(err)}`);
|
feat: initial implementation of TFTSR IT Triage & RCA application
Implements Phases 1-8 of the TFTSR implementation plan.
Rust backend (Tauri 2.x, src-tauri/):
- Multi-provider AI: OpenAI-compatible, Anthropic, Gemini, Mistral, Ollama
- PII detection engine: 11 regex patterns with overlap resolution
- SQLCipher AES-256 encrypted database with 10 versioned migrations
- 28 Tauri IPC commands for triage, analysis, document, and system ops
- Ollama: hardware probe, model recommendations, pull/delete with events
- RCA and blameless post-mortem Markdown document generators
- PDF export via printpdf
- Audit log: SHA-256 hash of every external data send
- Integration stubs for Confluence, ServiceNow, Azure DevOps (v0.2)
Frontend (React 18 + TypeScript + Vite, src/):
- 9 pages: full triage workflow NewIssue→LogUpload→Triage→Resolution→RCA→Postmortem→History+Settings
- 7 components: ChatWindow, TriageProgress, PiiDiffViewer, DocEditor, HardwareReport, ModelSelector, UI primitives
- 3 Zustand stores: session, settings (persisted), history
- Type-safe tauriCommands.ts matching Rust backend types exactly
- 8 IT domain system prompts (Linux, Windows, Network, K8s, DB, Virt, HW, Obs)
DevOps:
- .woodpecker/test.yml: rustfmt, clippy, cargo test, tsc, vitest on every push
- .woodpecker/release.yml: linux/amd64 + linux/arm64 builds, Gogs release upload
Verified:
- cargo check: zero errors
- tsc --noEmit: zero errors
- vitest run: 13/13 unit tests passing
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 03:36:25 +00:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="p-6 space-y-4 h-full flex flex-col">
|
|
|
|
|
{/* Breadcrumb */}
|
|
|
|
|
<nav className="flex items-center gap-1 text-sm text-muted-foreground">
|
|
|
|
|
<Link to={`/issue/${id}/triage`} className="hover:text-foreground">
|
|
|
|
|
Triage
|
|
|
|
|
</Link>
|
|
|
|
|
<ChevronRight className="w-3 h-3" />
|
|
|
|
|
<Link to={`/issue/${id}/resolution`} className="hover:text-foreground">
|
|
|
|
|
Resolution
|
|
|
|
|
</Link>
|
|
|
|
|
<ChevronRight className="w-3 h-3" />
|
|
|
|
|
<Link to={`/issue/${id}/rca`} className="hover:text-foreground">
|
|
|
|
|
RCA
|
|
|
|
|
</Link>
|
|
|
|
|
<ChevronRight className="w-3 h-3" />
|
|
|
|
|
<span className="text-foreground font-medium">Post-Mortem</span>
|
|
|
|
|
</nav>
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
<h1 className="text-3xl font-bold">Post-Mortem Report</h1>
|
|
|
|
|
<p className="text-muted-foreground mt-1">
|
|
|
|
|
Document the incident timeline, impact, and lessons learned.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{error && (
|
|
|
|
|
<div className="text-sm text-destructive bg-destructive/10 rounded-md p-3">
|
|
|
|
|
{error}
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{isLoading ? (
|
|
|
|
|
<div className="flex-1 flex items-center justify-center">
|
|
|
|
|
<p className="text-muted-foreground">Generating post-mortem document...</p>
|
|
|
|
|
</div>
|
|
|
|
|
) : (
|
|
|
|
|
<div className="flex-1 min-h-0">
|
|
|
|
|
<DocEditor
|
|
|
|
|
content={content}
|
|
|
|
|
onChange={handleContentChange}
|
|
|
|
|
|
|
|
|
|
updatedAt={doc?.updated_at?.toString()}
|
|
|
|
|
onExport={handleExport}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|