Skip to content
CAI
Software that uses CAICheck a score

AvdLee/Diagnostics

70.5

Strong · 1 October 2026

3k

lines of production code

Swift

with JavaScript

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a Swift diagnostics framework that captures application logs, crash data, and system metadata to generate comprehensive HTML and JSON reports. It features modular reporters for device health, directory structures, and user defaults, with built-in logic for log trimming and sensitive data filtering. The generated reports are designed to be agent-friendly, embedding structured JSON payloads to facilitate automated analysis by AI tools and support agents.

How it got here

2019 — Diagnostics framework initial release

13 changes.

This period marks the initial release of the Diagnostics framework, introducing a modular library for generating comprehensive system and application reports in HTML and JSON formats. The work included building core reporters for metadata, logs, and smart insights, alongside an example application to demonstrate integration and sharing capabilities. Comprehensive unit tests and CI configuration were added to ensure reliability and automate testing across supported platforms.

2021–2026 — Diagnostics module expansion

9 changes.

This period focused on building out a comprehensive diagnostics framework, introducing features for crash logging, structured JSON reporting, and smart device health insights. It also added specialized reporters for directory trees and an AI skill for analyzing diagnostic reports, supported by extensive test coverage for logging and reporting components.

Features

Add Diagnostics-Example iOS app project

Introduced a new example application project (Diagnostics-Example) that demonstrates how to integrate and use the Diagnostics framework. The project is configured to build as an iOS app, linking against the Diagnostics framework as a local Swift package dependency, and includes standard build configurations for debugging and release.

Example/Diagnostics-Example.xcodeproj · high confidence

Add fastlane configuration for CI testing

Introduced fastlane lanes to automate running diagnostics and package tests on macOS within the CI pipeline. The new \test\_diagnostics\ and \test\_package\ lanes provide a standardized way to execute test suites, supporting options for parallel testing and custom arguments, which stabilizes the CI process by ensuring consistent test execution environments.

fastlane · high confidence

Added Diagnostics-Example workspace configuration

The Diagnostics-Example project now includes a workspace file (contents.xcworkspacedata) that references the project itself, enabling the example app to be built and run within the Xcode workspace environment.

Example/Diagnostics-Example.xcodeproj/project.xcworkspace · high confidence

Added MetricsMonitor for crash and diagnostic logging

A new MetricsMonitor class has been introduced to capture and log application crashes and MetricKit diagnostics. On iOS, it registers as a subscriber to MXMetricManager to receive diagnostic payloads, while on macOS it installs a global uncaught exception handler to log crashes synchronously via the DiagnosticsLogger.

Sources/MetricKit · high confidence

Added Xcode workspace and Diagnostics scheme for Swift Package Manager

The package now includes an Xcode workspace and a specific build scheme for the 'Diagnostics' target. This allows developers to open the package in Xcode and run, test, profile, and archive the Diagnostics module directly, facilitating local development and debugging of diagnostic features within the Swift ecosystem.

.swiftpm · high confidence

Diagnostics reports now include embedded structured JSON for AI agent analysis

Diagnostics reports are now agent-friendly single-file HTML documents that embed a structured JSON payload (accessible via \script\#diagnostics-report-data\). This allows AI tools and support agents to inspect structured chapters, session metadata, log events, and crash diagnostics directly, while the browser view is rendered from this JSON. Existing historic log sessions remain readable, and uncaught exceptions are persisted as timestamped \crash\ events. Additionally, standalone JSON reports can now be created using \DiagnosticsReporter.create(format: .json)\. The repository also includes installation instructions and manifests for integrating a Diagnostics Report Analyzer Skill with various AI clients like Cursor, Claude Code, and OpenAI-compatible tools.

(repo-wide) · high confidence

Initial project setup for Diagnostics framework

The Diagnostics framework has been initialized with its core structural files, including the main header (Diagnostics.h) and the Info.plist configuration. This establishes the basic module definition, versioning exports, and bundle metadata required for the framework to be built and integrated.

Diagnostics · high confidence

Initial release of the Diagnostics reporting library

This change introduces the core Diagnostics library, enabling developers to generate comprehensive system and application reports in HTML or JSON formats. The library provides a modular architecture with built-in reporters for general device information, app system metadata, logs, and smart insights. Reports can be filtered to remove sensitive data, saved to the desktop (with native macOS support via a save panel), and attached to emails via MessageUI extensions. The generated HTML reports are agent-friendly, embedding structured JSON for programmatic analysis while maintaining a styled, interactive browser view.

Sources · high confidence

New Diagnostics Example App with configurable JSON reports and platform-specific sharing

The Example/Diagnostics-Example location now includes a complete example application demonstrating the Diagnostics library. Users can generate diagnostics reports in HTML or JSON formats via the UI. The example implements platform-specific sharing mechanisms: on iOS, it uses the native Mail Composer or system Share Sheet, while on macOS, it leverages the system's email sharing service with a fallback to saving the report to the desktop. It also showcases advanced features like custom filters (to redact sensitive data), custom reporters (adding specific session data), and smart insights (providing contextual warnings based on report content).

Example/Diagnostics-Example · high confidence

New Directory Tree Diagnostics Reporter

A new Diagnostics reporter has been added that generates a visual tree of directory structures, including files, directories, and symbolic links. Users can configure the scan by setting the root URL, maximum depth, and the number of items to display per directory (defaulting to 10 items with a summary for the rest). The reporter supports options to include hidden files and symbolic links, choose between localized or raw file names, and optionally print full paths. It also allows skipping specific directory contents via a closure, which improves performance on large or remote file systems like iCloud.

Sources/Reporters/DirectoryTree · high confidence

New Smart Insights for device health and app updates

The SmartInsights module now includes new diagnostic checks: it reports whether cellular data is enabled for the app (iOS only), warns if device storage is below 1GB, and checks for available app updates using the App Store API with a configurable iTunes region. These insights are exposed via the SmartInsightProviding protocol and a generic SmartInsight struct for quick integration.

Sources/SmartInsights · high confidence

New bundle and formatter extensions for diagnostics

Added new Swift extensions to support the diagnostics feature: BundleExtensions provides static accessors for the app name, display name, version, and build number; ByteCountFormatter adds type aliases for byte units; and DateFormatterExtensions introduces a shared, GMT-based date formatter for consistent timestamping.

Sources/Extensions · high confidence

New diagnostics reporters for system metadata, smart insights, and user defaults

The Sources/Reporters module now includes several new reporters that expand the diagnostics output: AppSystemMetadataReporter adds detailed device and app metadata (including specific iPhone model names and, on iOS, cellular data restrictions); SmartInsightsReporter introduces an async-based insight system that evaluates device storage, available updates, and cellular status to surface success, warning, or error messages; UserDefaultsReporter allows reporting specific user defaults keys as formatted JSON; GeneralInfoReporter provides a customizable introduction chapter; and LogsReporter captures and parses session logs with error handling for parsing failures.

Sources/Reporters · high confidence

New diagnostics-report-analyzer-skill for analyzing AvdLee Diagnostics HTML reports

Added a new skill that guides the agent to analyze AvdLee Diagnostics HTML reports by preferring embedded structured JSON payloads over rendered HTML, with a fallback to legacy HTML parsing for older reports. The skill defines an analysis workflow that prioritizes agent hints, app/system metadata, and crash/error events in the newest sessions, and specifies a standardized output format (Summary, Evidence, Recommended Next Steps) to support customer debugging and triage. Evaluation fixtures and test cases were added to verify correct handling of JSON-backed reports, legacy-only reports, and mixed-format reports containing both historic and structured sessions.

diagnostics-report-analyzer-skill · high confidence

Behavioural changes

Structured diagnostics logging with HTML reports and log trimming

The logging system now captures diagnostics in a structured JSON format (prefixed with DIAGNOSTICS\_JSON) and generates interactive HTML reports that display log sessions, events, and metadata. This change introduces a new DiagnosticsLogger that manages log sessions, captures system information, and handles error logging. Log files are automatically trimmed to 3 MB, keeping the most recent structured records while preserving session boundaries. The system also includes a LogsTrimmer that intelligently removes older entries while maintaining the integrity of session metadata.

Sources/Logging · high confidence

Test coverage

Added test coverage for diagnostics reporters and log trimming; Added tests for Smart Insights diagnostics; Added tests for diagnostic report attachment in mail compose view controller; Added tests for diagnostics logging behavior; Added tests for diagnostics report generation and filtering; Added tests for the Directory Tree diagnostics reporter.

Dependencies

Updated Swift package dependencies and platform support

The Swift package manifest (Package.swift) now targets Swift 6.0 and explicitly supports visionOS v1 alongside macOS v13, iOS v16, tvOS v14, and watchOS v6. The dependency on ExceptionCatcher has been updated to version 2.0.0, and the package now includes a PrivacyInfo.xcprivacy resource file. Additionally, the example project's resolved package state reflects an update to ExceptionCatcher version 2.0.1.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 70 → 71 (+0.8)
  • Rubric changed (rubric-2026.09.11 → rubric-2026.09.18) — scores are not directly comparable.

Lenses

  • Code Health 99 → 99 (-0.1)
  • Architecture 89 → 96 (+7.1)
  • Maturity 56 → 56 (+0.1)
  • Readiness 69 → 71 (+1.7)
  • Security 95 → 96 (+0.6)

Resolved (5)

  • Documentation: no installation or build instructions (README.md)
  • Documentation: no usage examples (README.md)
  • Hotspot: Sources/Logging/Loggable.swift (Sources/Logging/Loggable.swift)
  • Off-boarding risk: anonymized user #1
  • Outdated: fastlane

New (5)

  • Coverage not measured — Swift suite
  • High CVE: [GHSA redacted] (Gemfile.lock)
  • Off-boarding risk: anonymized user #1
  • Outdated: exceptioncatcher
  • functions.onload (cognitive 18) (Sources/functions.js)

Changes since last survey

  • 3 commits — 1 feature/other, 2 fixes

By area

  • (repo) — 1 commit
  • DiagnosticsTests/Logging — 1 commit
  • DiagnosticsTests/Reporters — 1 commit

Notable commits

  • fix: Address review feedback: marker regression test and doc comment
  • fix: Merge pull request #216 from AvdLee/fix/log-trim-hysteresis
  • change: Trim logs once to 75% of a 3 MB cap and batch stdout capture

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

AvdLee/Diagnostics was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 1 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit e3b6ffc95ab07ac3cb31e99103fc64cfb13efaeb — the exact code this score is about.
  • Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-e569280dd5e2.