contextBridge.exposeInMainWorld('cfs', { … }). Single contract source for the renderer-side window.cfs.* shape. Flavor-specific: the macOS author preload omits health, deploy, deployRecovery, revert, auditResults, and system.
ipc-handlers.ts
Registers every cfs:* IPC channel. Each channel is a thin wrapper around a packages/core/handlers/ export.
ipc-validators.ts
Typed payload validators per channel (CF-SEC-002). Rejects malformed payloads at the IPC boundary, before they reach handlers.
navigation-guard.ts
Blocks will-navigate outside the bundled UI + file:// navigation (CF-SEC-001).
protocol-handler.ts
cfs-blob:// custom protocol for streaming in-process artifacts (PDFs, exports) to the renderer without writing to disk first.
log.ts
Typed main-process logger (v0.2.1). scoped(name), setLogger(), resetLogger(), redact(). Wraps electron-log; falls back to console in vitest.
elevate.ts
Process elevation. UAC on Windows, pkexec on Linux. Uses scoped('elevate') for all logging.
platform-detection.ts
RDP / Wayland / X11 / WSL detection helpers used by elevate + main window creation.
Other current page files are still flat files: Home.tsx (Dashboard), Compliance.tsx (Export Readiness), CisCatalog.tsx (Benchmark Mapping), Settings.tsx, ManifestAuditPack.tsx, ManifestCompliance.tsx, ManifestHistory.tsx, ManifestRationale.tsx, and NotFound.tsx.
Routes are wired in apps/desktop/src/App.tsx; sidebar labels are wired in apps/desktop/src/components/Sidebar.tsx.
Anchor wrapper that routes through cfs.shell.openExternal() so external URLs open in the user's default browser.
AuditProgressCounter.tsx
Stable-width progress counter for audit operations. Uses monospace digit rendering to prevent layout shift as numbers increment.
pages/ManifestEditor/components/VisualManifestViewer.tsx is shared by
ManifestEditor and ManifestNew. Its pure projection/mutation layer lives in
pages/ManifestEditor/visual-viewer.ts.
| Breadcrumb.tsx | Breadcrumb navigation component. Renders the current page path as clickable segments for quick navigation between parent views. |
Single source of truth for business logic. Each handler is a pure function called from apps/desktop/electron/ipc-handlers.ts and directly tested by vitest.
File
Role
index.ts
Re-exports.
manifests.ts
List / register / delete manifests. Platform-agnostic register (schema-only); deploy is the platform gate.
revertManifest: restore pre-deploy snapshot or delete the namespace when no usable snapshot exists. It revalidates snapshot YAML before apply and translates CLI-missing apply/delete failures to CLI_REQUIRED.
runOscfg() in runner.ts is the operational CLI spawn path. binary.ts uses spawnSync only for discovery/version probes; handlers and renderer code do not spawn oscfg directly.
Resolves oscfg from OSCFG_BIN env, well-known install paths, PATH, WindowsApps alias, MSIX (Get-AppxPackage), and the dev-only resources/oscfg/<plat>/ drop.
apply.ts
oscfg apply wrapper.
get.ts
oscfg get namespace / get resource -n <ns>.
exec.ts
oscfg exec resource --mode ... wrapper for direct provider reads.
manage.ts
Namespace/resource deletion helpers.
registered-types.ts
Whitelist of resource types accepted by the targeted CLI version (OSCFG_CLI_VERSION = '1.3.9-preview11'). Types missing from the list trigger a soft warning at register time; the manifest still registers.
registry-types.ts
Registry valueType mapping (Dword, String, …).
registry.ts
Registry resource specifics.
compliance.ts
Decides compliant / non-compliant / indeterminate from CLI output.
naming.ts
isValidNamespace: refuses path-traversal, control chars.
Local, deterministic diff/changelog analysis (no LLM or network). analyzeDiff, generateChangelog, renderChangelogMarkdown. Output is labeled via tagAsAiGenerated before it leaves the system.
provenance.ts
AiSource + Provenance types, normalizeUrl (strips utm_*, etc.), dedupeSources, computeCitationCoverage (mean of per-source confidence — a heuristic), decorateWithProvenance.
circular-guard.ts
tagAsAiGenerated / isAiGenerated / assertNotAiGenerated / stripAiMarker. Spoof-resistant (CF-SEC-007) via an in-process content-hash registry (FNV-1a 64-bit, browser-safe) in addition to the inline <!-- ai-generated:rev=N --> marker. Pure JS hash, no crypto import, so the module is safe to pull into the renderer bundle. assertNotAiGenerated/isAiGenerated detect marked content but are not currently wired into ingestion (advisory labeling, not enforcement).
The data files this module reads are not bundled in the repo or
installer (license restrictions). Users drop their own legally
licensed CIS benchmark files into the data directory at runtime.
Loaders return null when files are absent and the UI hides every
CIS surface.
File
Role
data.ts
Loads user-supplied JSON catalogs from the CIS data directory. Returns null on ENOENT.
crossref.ts
Strict-name match + property-mapping fallback.
compliance.ts
{matched, mismatched, missing, score}.
xccdf-parser.ts
XCCDF + OVAL XML parser. Supports registry exact lookup, non-registry indices, CSP-aware fuzzy title matching, and Linux fuzzy helpers used by bulk CIS Diff.
azure-policy-cis.ts
Azure Policy CIS JSON parser. Supplies the Azure Policy fallback catalogs; Windows uses PascalCase/CSP word-overlap, while Linux bulk matching uses linuxFuzzyMatch.