Skip to content
CAI
Software that uses CAICheck a score

simonbs/Runestone

71.5

Strong · 14 November 2026

18.6k

lines of production code

Swift

primary language

5

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Features

Added syntax highlighting utility and privacy manifest

Runestone now includes a \StringSyntaxHighlighter\ class that allows developers to generate syntax-highlighted attributed strings for a given text and language without requiring a \TextView\ instance, supporting configurable themes, languages, and formatting options like kerning and tab length. Additionally, a \PrivacyInfo.xcprivacy\ file has been added to declare that the library does not track users or collect/access data, ensuring compliance with Apple's privacy requirements.

Sources/Runestone · high confidence

Adds example app with keyboard tools, settings menu, and find/go-to-line features

The example application now includes a custom keyboard accessory view with undo, redo, and text-shifting buttons, alongside a main view controller that supports text persistence, theme selection, and line-number/page-guide settings. Users can access Find and Replace (on iOS 16+), Go to Line, and toggle editing/selection states via a context menu, with the interface adapting to keyboard height changes and preserving a unique text input context identifier.

Example/Example/Main · high confidence

Adds iOS example application with theme-aware UI

The Example/Example/Application directory now contains the core application entry points (AppDelegate and SceneDelegate) for an iOS example app. The app initializes with default user settings and configures the main window to respect the user's preferred interface style (light/dark mode) via the registered theme settings. On iOS, the app presents a MainViewController wrapped in a navigation controller with a standardized navigation bar appearance, while other platforms receive the MainViewController directly.

Example/Example/Application · high confidence

Adds interactive documentation tutorials for integrating Runestone

New interactive tutorials have been added to the Runestone documentation, providing step-by-step Swift code examples for integrating the library. These resources guide users through setting up a TextView, configuring appearance options such as line numbers and page guides, applying custom themes like the Tomorrow color scheme, and enabling syntax highlighting with TreeSitter.

Sources/Runestone/Documentation.docc/Tutorials · high confidence

Adds text highlight navigation and rounded corner styling

Users can now navigate between highlighted text ranges using previous/next commands, with an option to loop through results. Highlights can be styled with a custom color and rounded corners, and the system correctly handles ranges that span multiple lines or line fragments.

Sources/Runestone/TextView/Highlight · high confidence

Enhanced search and replace with regex capture groups and batch operations

The search and replace functionality now supports complex replacement strings when using regular expressions. Users can reference captured groups using $0, $1, etc., and apply case-modification modifiers (such as \\u for uppercase, \\l for lowercase) to those groups, mirroring Visual Studio Code's behavior. Additionally, replacement strings can now contain escape sequences for newlines, carriage returns, and tabs. To improve performance and user experience, multiple replacements are executed as a single batch operation, registering only one undo step for the entire set of changes.

Sources/Runestone/TextView/SearchAndReplace · high confidence

Example app adds character pair support and configurable text view settings

The example project now includes a BasicCharacterPair struct to define character pairs (such as parentheses and quotes) and configures the TextView to use these pairs by default. Additionally, the example app introduces settings for isEditable and isSelectable properties, allowing users to toggle text editing and selection capabilities within the demo.

Example/Example/Library · high confidence

Initial Example application project structure

The Example project has been added, providing a complete Xcode workspace and project configuration for the Runestone library. This includes the main application target with Swift UI components (MainView, ThemePicker), integration with Runestone frameworks (Languages, Themes), and necessary entitlements and Info.plist settings to run the demo app.

Example/Example.xcodeproj · high confidence

Initial documentation for Runestone framework

Added comprehensive documentation articles covering installation, getting started, creating themes, adding Tree-sitter languages, and syntax highlighting strings. The documentation also includes an overview of features, details on indentation, find and replace, character pairs, and navigation, along with an Info.plist setting default availability to iOS 14.0.

Sources/Runestone/Documentation.docc · high confidence

Initial project scaffolding and documentation

The repository is initialized with essential configuration files including a SwiftLint configuration, a SwiftGen input file, a LICENSE, and a CODEOWNERS file. A Tree-sitter submodule is added to support syntax highlighting and code folding features. The README is updated to provide a comprehensive overview of the Runestone framework, its features, and usage instructions.

(repo-wide) · high confidence

Initial release of the Runestone TextView core engine

This change introduces the foundational components of the Runestone code editor, including the \TextView\ class, text input handling via \TextInputView\, layout management, line movement, and content sizing. It establishes the core architecture for features such as syntax highlighting, line numbers, and text selection, replacing previous implementations with a new, modular structure.

Sources/Runestone/TextView/Core, Sources/Runestone/TextView/TextSelection · high confidence

Introduces TreeSitter query predicate support

The TreeSitter integration now supports query predicates, allowing users to filter captures based on their text content. This change adds logic to parse and evaluate \eq?\, \not-eq?\, \match?\, and \not-match?\ predicates within TreeSitter queries, enabling more precise syntax highlighting and code analysis rules.

Sources/Runestone/TreeSitter · high confidence

Introduces configurable indentation strategies and controller for text views

The text view now supports configurable indentation via a new \IndentController\ and \IndentStrategy\ system, allowing users to choose between tab-based or space-based indentation with a specified length. This change adds logic to correctly handle shifting lines left or right, inserting line breaks with appropriate indentation levels, and detecting existing indentation strategies in the text. It also includes utilities like \IndentLevelMeasurer\ and \TabWidthMeasurer\ to accurately calculate indentation widths and levels, ensuring consistent formatting behavior regardless of whether tabs or spaces are used.

Sources/Runestone/TextView/Indent · high confidence

Introduces configurable syntax highlighting themes and page guide controls

The text view now supports customizable appearance through a new \Theme\ protocol and \DefaultTheme\ implementation, allowing users to define colors and font traits for syntax highlighting tokens (such as keywords, comments, and strings) as well as UI elements like the gutter, line numbers, and search results. Additionally, a new \PageGuideController\ and \PageGuideView\ have been added to the appearance subsystem, enabling users to configure a vertical page guide line with specific column positioning, font, and hairline styling.

Sources/Runestone/TextView/Appearance · high confidence

JavaScript language support added to the example project

The Example/Languages location now includes a Swift package for JavaScript, providing syntax highlighting, injection rules (for template literals, regex, and JSDoc), and indentation scopes. This is implemented via a bundled TreeSitter JavaScript parser and associated query files, replacing the previous TreeSitterLanguages dependency for this example.

Example/Languages · high confidence

New Theme Picker example with live preview

The example project now includes a ThemePicker feature that allows users to browse available themes and see a live code preview update instantly. This new UI component, consisting of a table view controller and a custom preview cell, demonstrates how to configure the TextView with different EditorTheme settings, including background colors, text colors, and selection highlights, providing a practical reference for integrating theme switching in applications.

Example/Example/ThemePicker · high confidence

New example themes added

The example project now includes four new syntax highlighting themes: One Dark, Plain Text, Tomorrow, and Tomorrow Night. These themes are provided as Swift packages within the Example/Themes directory, allowing users to see how the Runestone editor can be styled with different color palettes and UI settings.

Example/Themes · high confidence

New types for text navigation and location

Users can now specify how text is selected when navigating to a specific line using the new GoToLineSelection enum, which offers options to position the caret at the beginning or end of the line, or to select the entire line. Additionally, the new TextLocation struct allows for precise identification of positions within the text using zero-based line numbers and column indices, enabling more granular navigation and interaction with the text view.

Sources/Runestone/TextView/Navigation · high confidence

Behavioural changes

1 commit (0 fixes) modifying Sources/TreeSitterSupport

A change to existing behaviour in Sources/TreeSitterSupport — 1 commit, 2 files: “Reduce large-document typing and unwrapped scrolling work (\#482)” (refs \#482).

Sources/TreeSitterSupport · medium confidence · unverified

3 commits (1 fix) modifying Design

A change to existing behaviour in Design — 3 commits (1 fix), 2 files: “Updates documentation”; “Adds interactive tutorials to the documentation (\#169)”; “Fixes spacing in documentation hero” (refs \#169).

Design · medium confidence · unverified

Adds localized strings for replace, undo, and line movement actions

The app now includes localized user interface strings for German, English, Spanish, Finnish, French, and Japanese. These resources provide translations for the 'Replace' menu item and specific undo action names (Typing, Replace All, Move Lines Up, Move Lines Down), ensuring these features are displayed in the user's preferred language. Also in this area: Spell checking and Writing Tools integration.

Sources/Runestone/Resources · high confidence

Introduces Tree-sitter based syntax highlighting and intelligent indentation

The syntax highlighting engine has been replaced with a new implementation powered by Tree-sitter. This change adds support for complex language features including injected languages (such as embedded JavaScript in HTML) and provides intelligent indentation that automatically adjusts based on the syntax tree structure (e.g., increasing indent after opening brackets or control flow statements). The update also includes automatic detection of indentation strategies (tabs vs. spaces) and ensures thread-safe parsing to prevent race conditions during text edits. Also in this area: Opt-in code and Markdown section folding with improved gutter interaction; Improved scrolling stability and syntax highlighting responsiveness; Enhanced syntax highlighting and Writing Tools panel lifecycle support; Spell checking and Writing Tools integration.

Sources/Runestone/TextView/SyntaxHighlighting · high confidence

Introduces a new Red-black tree-based line management system

The LineManager component now uses a generic Red-black tree (DocumentLineTree) to track document lines, replacing the previous implementation. This change introduces new internal structures including DocumentLineNodeData for storing line metrics (height, byte count, delimiter length), LineChangeSet for tracking inserted, removed, and edited lines, and LinePosition for row/column coordinates. The system now rebuilds the line tree from a StringView, calculates content height based on the rightmost node, and supports operations like inserting and removing characters with proper line merging and splitting logic.

Sources/Runestone/LineManager · high confidence

Introduces core text-editing infrastructure and iOS 17 caret compatibility

The library adds foundational types for byte-level text management (ByteCount, ByteRange) and helper extensions for string and range operations, establishing the basis for precise text manipulation. It also introduces a KeyboardObserver to manage keyboard visibility and a QuickTapGestureRecognizer to improve text interaction responsiveness. Additionally, the update adds specific workarounds for iOS 17 to ensure the text cursor (caret) remains visible and blinks correctly by accessing private UITextInput APIs.

Sources/Runestone/Library · high confidence

Introduces generic Red-Black Tree implementation for document layout

The \Sources/Runestone/RedBlackTree\ location now contains a new, generic Red-Black Tree data structure (\RedBlackTree\) designed to store and manage document line frames. This implementation replaces previous ad-hoc layout storage with a balanced tree that supports efficient insertion, removal, and location-based lookups via methods like \node(containingLocation:)\ and \nodePosition(at:)\. The change introduces generic constraints (\NodeID\, \NodeValue\, \NodeData\) to allow flexible node data, adds a \ClosedRangeValueSearchQuery\ for range-based searches, and provides an iterator for sequential traversal, fundamentally changing how the editor tracks and accesses line positions internally.

Sources/Runestone/RedBlackTree · high confidence

Refactors line layout and introduces configurable line break modes

The line controller's layout logic has been restructured to support distinct line break behaviors. A new \LineBreakSuggester\ system allows the text view to wrap lines either by word (defaulting to whitespace preference) or by character, addressing issues where ligatures were broken incorrectly or breaks occurred in the middle of character pairs. Additionally, the rendering pipeline now processes each line fragment individually rather than typesetting entire lines at once, which improves layout precision and performance for long lines.

Sources/Runestone/TextView/LineController · high confidence

Updated embedded Tree-sitter language parsers to version 13

The embedded Tree-sitter grammar sources for HTML, JavaScript, JSON, Python, and YAML in the test suite have been updated to the latest version (LANGUAGE\_VERSION 13). This upgrade refreshes the internal parser tables and external scanners for these languages, ensuring the test suite validates against the current upstream grammar definitions. Also in this area: Spell checking and Writing Tools integration.

Sources/TestTreeSitterLanguages · high confidence

Test coverage

Added unit tests for core text handling and language-specific indentation; Automated UI test scripts for Chinese and Korean input; New UI test host app and JavaScript language support for text input validation.

Dependencies

Upgrades to Tree-sitter 0.20.9 and Swift 5.5 toolchain

The Runestone package now depends on Tree-sitter version 0.20.9 and requires the Swift 5.5 toolchain, raising the minimum supported platform to iOS 14. This update introduces a new \TestTreeSitterLanguages\ target to support testing and includes a \PrivacyInfo.xcprivacy\ resource in the main library.

(dependencies) · high confidence

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

How this codebase got here

Score

  • CAI 65 → 71 (+6.1)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.4) — scores are not directly comparable.

Lenses

  • Code Health 94 → 93 (-0.8)
  • Architecture 90 → 100 (+9.5)
  • Maturity 59 → 59 (-0.1)
  • Readiness 73 → 72 (-0.9)
  • Security 60 → 90 (+30.0)

Resolved (10)

  • Duplicated block (23 lines × 3) (Example/Themes/Sources/RunestoneOneDarkTheme/OneDarkTheme.swift)
  • Duplicated block (5 lines × 2) (Sources/Runestone/Library/TextEditHelper.swift)
  • Hotspot: Example/Example/Main/MainViewController.swift (Example/Example/Main/MainViewController.swift)
  • LineController.updateSyntaxHighlightingIfNecessary (cognitive 17) (Sources/Runestone/TextView/LineController/LineController.swift)
  • No SBOM
  • No artifact signing
  • No build provenance
  • Off the main sequence: Runestone
  • Projects may be oversized for their cohesion
  • Unpinned build actions

New (36)

  • Duplicated block (10–12 lines × 2) (Sources/Runestone/TextView/Core/LayoutManager.swift)
  • Duplicated block (5 lines × 2) (Sources/Runestone/Library/TextEditHelper.swift)
  • Edited copy of a member (10 corresponding lines) (Sources/Runestone/TextView/Core/TextInputView.swift)
  • Edited copy of a member (11 corresponding lines) (Sources/Runestone/TextView/LineController/LineController.swift)
  • Edited copy of a member (11 corresponding lines) (Sources/Runestone/TextView/SyntaxHighlighting/TreeSitter/TreeSitterLanguage.swift)
  • Edited copy of a member (11 corresponding lines) (Sources/Runestone/TreeSitter/TreeSitterPredicateMapper.swift)
  • Edited copy of a member (15 corresponding lines) (Sources/Runestone/TextView/Highlight/HighlightNavigationController.swift)
  • Edited copy of a member (16 corresponding lines) (Sources/Runestone/RedBlackTree/RedBlackTree.swift)
  • Edited copy of a member (19 corresponding lines) (Sources/Runestone/TextView/Appearance/DefaultTheme.swift)
  • Edited copy of a member (4 corresponding lines) (Sources/Runestone/TextView/Core/TextInputView.swift)
  • Edited copy of a member (5 corresponding lines) (Sources/Runestone/TextView/Spelling/SpellCheckingService.swift)
  • Edited copy of a member (6 corresponding lines) (Example/Example/ThemePicker/ThemePickerPreviewCell.swift)
  • Edited copy of a member (9 corresponding lines) (Sources/Runestone/TextView/SearchAndReplace/SearchController.swift)
  • FindResultPresentationView.updateLayoutIfNeeded (cognitive 16) (Sources/Runestone/TextView/SearchAndReplace/FindResultPresentationView.swift)
  • Hotspot: Sources/Runestone/TextView/Spelling/SpellCheckingService.swift (Sources/Runestone/TextView/Spelling/SpellCheckingService.swift)
  • Hotspot: Sources/Runestone/TextView/SyntaxHighlighting/Internal/TreeSitter/TreeSitterSyntaxHighlighter.swift (Sources/Runestone/TextView/SyntaxHighlighting/Internal/TreeSitter/TreeSitterSyntaxHighlighter.swift)
  • No assertions: testClearlyMixedSentencesDoNotForceOneDictionaryOnBothLanguages (Tests/RunestoneTests/ParagraphSpellingLanguageModelTests.swift)
  • No assertions: testExternalScannerHTMLAndBoundaryEditsKeepStockChangedRanges (Tests/RunestoneTests/TreeSitterChangedRangeTests.swift)
  • No assertions: testJavaScriptAliasesUnicodeAndRecoveryKeepStockChangedRanges (Tests/RunestoneTests/TreeSitterChangedRangeTests.swift)
  • No assertions: testLateLanguageSwitchDoesNotForceTheOpeningLanguageOnTheLastSentence (Tests/RunestoneTests/ParagraphSpellingLanguageModelTests.swift)
  • …and 16 more

Changes since last survey

  • 12 commits — 12 feature/other, 0 fixes

By area

  • Sources/Runestone — 10 commits
  • (repo) — 1 commit
  • .github/workflows — 1 commit

Notable commits

  • change: Add opt-out for code folding haptic feedback (#476)
  • change: Detect automatic spelling languages from visible paragraphs
  • change: Dim the gutter and folding controls during find presentation (#485)
  • change: Dismiss spelling menu when the keyboard hides (#480)
  • change: Extend find result dimming across scroll view insets (#484)
  • change: Merge branch 'main' of https://github.com/simonbs/Runestone
  • change: Migrate CI off retired macOS 14 runners (#477)
  • change: Present native find results above dimmed text (#483)
  • change: Preserve syntax styles across editor settings changes (#479)
  • change: Reduce large-document typing and unwrapped scrolling work (#482)
  • change: Resolve bare spelling overrides to advertised dictionary identifiers
  • change: Support multilingual automatic spell checking (#478)

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

Survey your own repository

simonbs/Runestone 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 14 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit b1bf525d02a601bcba420a46c9b5864d4281eec6 — the exact code this score is about.
  • Scored under rubric-2026.11.4 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.65+preprod-3c33c1882dc1.