How mizcausevic-dev/identity-cost-drift-brief works
Purpose and principal workflow
Identity Cost Drift Brief is a read-only executive-intelligence product for summarizing identity-spend drift, license waste, control duplication, and remediation priorities from synthetic lane data. In the main web workflow, an external HTTP client requests a page or JSON endpoint; the Express app obtains a view of the modeled data and returns rendered HTML or JSON. A separate CLI workflow lets a command-line user analyze a supplied JSON file and receive summary text or a JSON report.
Components
Web surface
• HTTP client — *null repository path*. External actor that initiates the main workflow by requesting a page or API route.
• Express routes and server — src/app.ts. Creates the Express app, maps page and API routes, and starts a listener when run directly; page handlers send HTML and API handlers send JSON.
• Executive views — src/services/render.ts. Builds the overview, drift-register, cost-tier, remediation, verification, and docs pages as HTML, drawing on the brief service’s outputs.
Analysis and modeled brief
• Brief analysis — src/analyze.ts. Applies thresholds to each lane’s drift, waste, review burden, duplication, and control-gap scores; computes per-lane recovery scores and report-level summary metrics.
• Sample identity-cost lanes — src/data/sampleVerticalBrief.ts. Defines the synthetic lane inputs, including owners, audiences, scores, narratives, and proposed next moves.
• Brief data and view shaping — src/services/verticalBriefService.ts. Analyzes the sample at module initialization and exposes summary, register, cost-tier, remediation, risk-map, verification, and combined-payload results.
• Domain contracts — src/types.ts. Defines the lane, assessment, report, summary, and payload shapes used across analysis and exports.
CLI and distribution
• CLI user — *null repository path*. External actor who invokes the documented command with an input file and optional output format.
• Command-line entry point — src/cli.ts. Reads and parses the selected JSON file, calls the analyzer, and prints either JSON or a formatted summary.
• Summary formatter — src/format.ts. Converts report summary metrics into the CLI’s human-readable text output.
• Static site and API artifacts — dist-static/index.html. The repository includes a prerendered static site and JSON artifacts under dist-static; the README documents prerendering, but the sampled source does not establish how those artifacts are generated or published.
Relationships
• HTTP client -> Express routes and server: sends page or API requests; the route handlers are defined in the app.
• Express routes and server -> Executive views: calls the corresponding renderer for HTML page responses.
• Express routes and server -> Brief data and view shaping: calls the relevant exports for JSON API responses.
• Executive views -> Brief data and view shaping: calls summary, register, cost-tier, remediation, risk-map, verification, and payload exports while building pages.
• Brief data and view shaping -> Sample identity-cost lanes: reads the synthetic lane array to construct register and cost-tier outputs.
• Brief data and view shaping -> Brief analysis: analyzes the sample to create the report used for summary, remediation, and risk-map outputs.
• Brief analysis -> Domain contracts: produces report and assessment values with the declared domain shapes.
• CLI user -> Command-line entry point: invokes the CLI with a JSON input path and optional format, as documented in the README.
• Command-line entry point -> Brief analysis: passes parsed input items to the analyzer.
• Command-line entry point -> Summary formatter: formats the report summary when text output is selected.
• Command-line entry point -> Domain contracts: interprets parsed input as lane items and uses the analyzer’s report summary.
• Static site and API artifacts -> Brief data and view shaping: ownership or generation relationship only; the sampled source does not establish a runtime interaction or artifact-generation data flow.
Coverage limits
The sampled files establish the Express route handlers, analysis logic, sample data, and CLI flow. The README documents prerendered output, but the prerender script, deployment behavior, and any live Kinetic Gain data connection were not established; the verification output explicitly describes the data as synthetic and the routes as read-only.
Main entry points: cli.ts CLI entry point · verticalBriefService.ts Brief view shaping · app.ts Express routes · analyze.ts Brief analysis
Components 10
Web surface
- HTTP client
- Express routes
src/app.ts - Executive views
src/services/render.ts
Analysis and modeled brief
- Brief view shaping
src/services/verticalBriefService.ts - Sample identity-cost lanes
src/data/sampleVerticalBrief.ts - Brief analysis
src/analyze.ts - Domain contracts
src/types.ts
CLI
- CLI user
- CLI entry point
src/cli.ts - Summary formatter
src/format.ts
Connections 11
- HTTP client → Express routes: sends requests
- Express routes → Executive views: renders pages
- Express routes → Brief view shaping: serves API
- Executive views → Brief view shaping: uses exports
- Brief view shaping → Sample identity-cost lanes: reads lanes
- Brief view shaping → Brief analysis: analyzes sample
- Brief analysis → Domain contracts: produces values
- CLI user → CLI entry point: invokes CLI
- CLI entry point → Brief analysis: analyzes input
- CLI entry point → Summary formatter: formats summary
- CLI entry point → Domain contracts: uses shapes