com-lihaoyi/Ammonite
47.6
Weak · 27 September 2026
23.6k
lines of production code
Scala
primary language
4
measurements over time
What this system is
This release marks a significant architectural overhaul of Ammonite, introducing a new compiler interface module, a modular interpreter, and a refactored runtime that improves separation of concerns across the codebase. Key features include a new Build Server Protocol (BSP) server for IDE integration, an SSH server for remote REPL sessions, and a comprehensive terminal input filter system. The build system has been migrated to Mill 1.0.6, and legacy file/path handling classes have been removed in favor of \os-lib\. The release is accompanied by extensive test coverage for the new components and a deprecation notice for Ammonite.
Features
Add BSP server integration for script compilation and diagnostics
Ammonite now includes a new Build Server Protocol (BSP) server implementation, enabling IDEs and build tools to interact with Ammonite scripts. This adds support for compiling scripts, resolving dependencies, and reporting diagnostics (errors and warnings) via the BSP interface. The change introduces several new classes in the \ammonite.interp.script\ package, including \AmmoniteBuildServer\ which implements the BSP server, \ScriptProcessor\ for parsing and dependency resolution, \ScriptCompiler\ for compilation, and helper classes like \Diagnostic\ and \ScriptCache\. This allows external tools to trigger script compilation and receive structured feedback about script state and errors.
amm/interp/src/main/scala/ammonite/interp/script · high confidence
Add Environment utility for managing REPL execution context
A new \Environment\ case class and companion object have been added to \sshd/src/main/scala/ammonite/sshd/util/Environment.scala\. This utility manages the execution context for the Ammonite REPL, specifically handling the thread, class loader, and standard I/O streams (in, out, err). It provides a \withEnvironment\ method that temporarily installs a given environment, executes a code block, and then restores the original context, ensuring that stream redirection and class loading remain isolated during SSHD operations.
sshd/src/main/scala/ammonite/sshd/util · high confidence
Add SSH server support for remote Ammonite REPL sessions
Ammonite now includes an SSH server implementation that allows users to connect remotely to a REPL session. The new \ammonite.sshd\ package provides a configurable SSH server (\SshdRepl\) that accepts password or public key authentication, uses RSA host keys, and spawns an interactive REPL for each connected client. This enables headless or remote access to the Ammonite Scala REPL over SSH.
sshd/src/main/scala/ammonite/sshd · high confidence
Added stub packages for script, URL, and repository imports
A new file, Stubs.scala, was added to the Ammonite interpreter API, introducing empty package objects for $file, $exec, $ivy, $url, $stub, $cp, $plugin, and $repo. These stubs populate the Scala compiler with synthetic packages that allow users to import scripts, web resources, and Maven/Ivy artifacts using the respective magic import syntax.
amm/interp/api/src/main/scala/ammonite · high confidence
Adds comprehensive terminal input filtering and undo/redo support
The terminal now features a modular filter system that handles basic navigation, GUI-like editing (word movement, selection, indentation), readline-style hotkeys (Ctrl-A/E, Ctrl-U/K for cut/paste, Alt-b/f for word navigation), and full undo/redo functionality. Users can now navigate lines and words with arrow keys and modifiers, perform text selection and indentation, use common shell shortcuts like Ctrl-U to clear to the beginning of the line, and revert or reapply edits using Ctrl-/Alt- minus keys.
terminal/src/main/scala/ammonite/terminal/filters · high confidence
Automated documentation and artifact publishing via CI
The CI pipeline now automatically deploys the documentation site to GitHub Pages on every commit, and uploads build artifacts to GitHub Releases. This is enabled by new scripts and Mill build definitions that handle SSH key management, Git operations for the gh-pages branch, and direct uploads to the GitHub API.
ci · medium confidence
Expose new REPL API and runtime tools
The REPL API is restructured with new traits and objects in the \amm/repl/api\ package, including \FullReplAPI\, \ReplAPI\, \FrontEndAPI\, \FrontEnd\, \History\, and \Session\ management. Additionally, new runtime tools are exposed for the REPL, including a \grep\ function for searching pretty-printed output and a \tail\ function for following files, alongside a \time\ utility for measuring computation duration.
amm/repl/api · high confidence
Introduce InterpAPI and InterpLoad interfaces for script and library loading
The Ammonite REPL now exposes a structured API for managing dependencies and script execution. Users can use \watch\ and \watchValue\ to monitor file or value changes during script execution, access \colors\ and \repositories\ settings, and utilize the \load\ interface to import external scripts or JARs. The \InterpLoad\ trait provides methods like \cp\ and \ivy\ to load libraries from local paths, URLs, or Maven/Ivy coordinates, enabling more flexible dependency management within the REPL environment.
amm/interp/api/src/main/scala/ammonite/interp · high confidence
Migrate build system to Mill 1.0.6
The project has migrated its build system from SBT to Mill, introducing a new \build.mill\ configuration file and a \.mill-version\ file specifying version 1.0.6. This change includes the addition of a Mill launcher script (\mill\), a Windows batch wrapper (\mill.bat\), and a \.scalafmt.conf\ for code formatting. The \build.mill\ file defines the project's cross-compilation across multiple Scala versions (2.12, 2.13, and various 3.x versions) and declares dependencies such as \coursier\, \scalameta\, and \utest\. This shift simplifies the build process and aligns with the author's recommendation for Scala scripting and build tooling.
(repo-wide) · high confidence
New compiler interface module for REPL and script processing
A new \amm/compiler/interface\ module has been added, introducing abstract classes and traits that define the public API for the Ammonite compiler. This includes \Compiler\ and \CompilerBuilder\ for managing compilation sessions, \Preprocessor\ for transforming and wrapping user code, \CodeWrapper\ for handling code generation, and \Parser\ for splitting scripts and handling imports. These interfaces allow the REPL and script execution logic to be decoupled from the underlying Scala compiler implementation, enabling better modularity and potential future support for different compiler versions.
amm/compiler/interface · high confidence
Removals
Removed legacy file and path handling classes
The \ammonite.Ops\, \ammonite.Path\, and \ammonite.package\ source files have been deleted. This removes the previous implementations for file system operations (such as \mkdir\, \mv\, \rm\, \ls\, \write\, \read\, and \meta\) and the \Path\/\RelPath\ classes that managed absolute and relative paths. Users relying on these specific classes and implicit conversions will need to update their code or use the new NIO-based implementations.
src/main · high confidence
Architecture
Extracted core utility classes into the \`amm/util\` module
Moved shared infrastructure classes—including \Classpath\, \Frame\, \Imports\, \Model\, \Position\, \ReplClassLoader\, \Res\, and \Util\—into the \amm/util\ module. This refactoring consolidates common data structures and helper logic, improving code organization and enabling cross-building for Scala 2.12 and 2.13.
amm/util/src/main/scala · high confidence
Behavioural changes
Add Ammonite deprecation notice and new documentation structure
The readme now explicitly states that Ammonite is deprecated and recommends using Mill's single-file scripting or the upstream Scala REPL for REPL functionality. The documentation has been reorganized into distinct sections for the REPL, Scripts, and a Cookbook, with new helper files (ANSI.scala, Sample.scala) to support rendering examples with syntax highlighting and color. The Index page has been updated to reflect the deprecation status and guide users to alternative tools.
readme · high confidence
Added Scala 3-specific helper class
A new abstract class Helper is introduced in the Scala 3 source directory (amm/helper/src/main/scala-3/ammonite/helper/Helper.scala), providing a Scala 3-specific implementation or interface for the helper functionality.
amm/helper · medium confidence
Fix race condition in Java 9+ runtime export utility
The \java9rtexport\ utility classes (\Copy\ and \Export\) have been moved to the \amm/util\ module. The \Export\ class now includes synchronization to prevent a race condition during the export of the Java runtime JAR, ensuring thread-safe access to the temporary file and directory copying operations.
amm/util/src/main/java · medium confidence
REPL input and output handling refactored into dedicated components
The Ammonite REPL's interaction with the terminal has been restructured to improve separation of concerns. The \Repl\ class now delegates all terminal I/O to a \FrontEnd\ abstraction, with \AmmoniteFrontEnd\ handling the default terminal and \JLineUnix\/\JLineWindows\ providing JLine-based alternatives. This change isolates the logic for reading user input, managing history, and displaying output, making the REPL's core logic more modular and easier to test or replace.
amm/repl/src/main · high confidence
Refactor Ammonite's entry point and REPL runner into dedicated classes
The Ammonite application entry point has been refactored to separate concerns: \AmmoniteMain\ now handles the initial argument parsing and dispatch, while \Main\ encapsulates the configuration and REPL instantiation logic, and \MainRunner\ manages the execution of scripts, code blocks, and the REPL, including the watch-and-re-run loop. This restructuring isolates the command-line interface from the core execution logic, making the codebase more modular and testable.
amm/src/main/scala/ammonite · high confidence
Refactor command-line argument parsing and script execution
Ammonite's main entry point has been refactored to use the \mainargs\ library for parsing command-line arguments, replacing the previous mechanism. This introduces a new \Config\ case class to structure options like \--no-default-predef\, \-s\ (silent), \-w\ (watch), and \-c\ (code). Script execution is now handled via \Scripts.runScript\, which leverages \mainargs\ to dispatch \@main\-annotated methods and pretty-prints return values by default. Additionally, a \ProxyFromEnv\ utility was added to automatically configure Java system properties from environment variables, and a \TrapExitSecurityManager\ was introduced to catch \System.exit\ calls during script execution.
amm/src/main/scala/ammonite/main · high confidence
Refactored dependency loading and predef initialization into dedicated components
The \Interpreter\ class has been refactored to use a new \DependencyLoader\ for managing artifact resolution and caching, and \PredefInitialization\ for executing predef scripts. This change isolates the logic for loading dependencies and initializing the environment, improving code organization and maintainability within the interpreter module.
amm/interp/src/main/scala/ammonite/interp · high confidence
Refactored runtime core into new classes for classloading, evaluation, and import hooks
The Ammonite runtime has been refactored to improve modularity and maintainability. A new \ClassLoaders\ class manages frame state, classpath, and imports, while \Evaluator\ handles bytecode loading and execution. \ImportHook\ provides an extensible system for processing imports like \$file\, \$ivy\, and \$cp\. Additionally, \Storage\ abstracts persistent caching of compilation results and history. These changes underpin the broader migration to use \os-lib\ for file operations and improve how the REPL and scripts manage dependencies and state.
amm/runtime · high confidence
Refactored terminal input handling and filter system
The terminal input processing has been refactored to improve code organization and maintainability. The \Filter\ system was extracted into its own file (\Filter.scala\) with a cleaner interface using \TermInfo\ and \TermAction\ types. A new \ConsoleDim\ class was introduced to manage terminal dimensions and handle window resize signals. The \LineReader\ was extracted from \Terminal\ to separate concerns, and helper utilities like \FilterTools\ and \SpecialKeys\ were added to simplify filter construction and key code management.
terminal/src/main/scala/ammonite/terminal · medium confidence
Updated compiler compatibility layer for Scala 2.12 and 2.13
The compiler module now includes version-specific compatibility layers for Scala 2.12 and 2.13, introducing new files such as \CompilerCompatibility\, \MakeReporter\, and \AmmClassPath\ to handle internal API differences in the Scala compiler. These changes ensure that the REPL and code execution engine function correctly across different minor versions of the Scala 2 toolchain, addressing issues with classpath handling, reporter interfaces, and analyzer initialization.
amm/compiler/src/main · high confidence
Test coverage
Add Scala 3-specific test extensions for compiler tests; Add test scripts for predef load and import functionality; Added Ammonite integration tests for error truncation; Added BSP error handling tests; Added BSP multi-project test scripts; Added BSP test resources for comment and simple scripts; Added BSP test scripts for semantic database; Added Java test resource for ammonite loadable tests; Added integration tests for standalone script execution and error handling; Added line number tests for compilation and runtime errors; Added script execution tests; Added terminal emulator tests for edit, history, and navigation; Added test fixtures for BSP import-file functionality; Added test resource for scripts with dashes in names; Added test scripts for main argument parsing; Added test scripts for script-level caching; Added tests for Ammonite's main method execution and argument parsing; Added tests for compiler configuration and range position; Added tests for script caching, compiler settings, and YRangepos behavior; Added tests for the BSP server integration; Added tests for the SSH REPL server; Expanded integration test coverage for Ammonite scripts; Expanded test coverage for Ammonite script execution and dependency loading; Removed Ammonite path and operation test suites and associated test data; Restructured REPL test suite with new test harnesses.
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
This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.
Score
- CAI 31 → 48 (+16.5)
- Rubric changed (rubric-2026.08.15 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 100 → 86 (-14.1)
- Architecture 69 → 95 (+26.2)
- Maturity 52 → 54 (+1.9)
- Readiness 27 → 53 (+26.3)
- Security 15 → 32 (+17.3)
Resolved (26)
- Coverage not measured — test suite did not build
- Dimension evaluation failed
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- …and 6 more
New (226)
- AmmonitePhase.processImport (cognitive 24) (amm/compiler/src/main/scala-3.0.0-3.3.1/ammonite/compiler/AmmonitePhase.scala)
- AmmonitePhase.processImport (cognitive 24) (amm/compiler/src/main/scala-3.3.2+/ammonite/compiler/AmmonitePhase.scala)
- AmmonitePhase.processImport (cognitive 27) (amm/compiler/src/main/scala-3.4.2+/ammonite/compiler/AmmonitePhase.scala)
- AmmonitePhase.processImport (cognitive 27) (amm/compiler/src/main/scala-3.5.0+/ammonite/compiler/AmmonitePhase.scala)
- AmmonitePhase.processImport (cyclomatic 19) (amm/compiler/src/main/scala-3.0.0-3.3.1/ammonite/compiler/AmmonitePhase.scala)
- AmmonitePhase.processImport (cyclomatic 19) (amm/compiler/src/main/scala-3.3.2+/ammonite/compiler/AmmonitePhase.scala)
- AmmonitePhase.processImport (cyclomatic 20) (amm/compiler/src/main/scala-3.4.2+/ammonite/compiler/AmmonitePhase.scala)
- AmmonitePhase.processImport (cyclomatic 20) (amm/compiler/src/main/scala-3.5.0+/ammonite/compiler/AmmonitePhase.scala)
- AmmonitePlugin.apply (cognitive 38) (amm/compiler/src/main/scala-2/ammonite/compiler/AmmonitePlugin.scala)
- AmmonitePlugin.apply (cyclomatic 30) (amm/compiler/src/main/scala-2/ammonite/compiler/AmmonitePlugin.scala)
- BaseIvy.resolve (cognitive 17) (amm/runtime/src/main/scala/ammonite/runtime/ImportHook.scala)
- Classpath.classpath (cognitive 23) (amm/util/src/main/scala/ammonite/util/Classpath.scala)
- Compiler.apply (cognitive 31) (amm/compiler/src/main/scala-2/ammonite/compiler/Compiler.scala)
- Compiler.apply (cyclomatic 22) (amm/compiler/src/main/scala-2/ammonite/compiler/Compiler.scala)
- Compiler.compile (cognitive 28) (amm/compiler/src/main/scala-3.0.0-3.3.1/ammonite/compiler/Compiler.scala)
- Compiler.compile (cognitive 28) (amm/compiler/src/main/scala-3.3.2+/ammonite/compiler/Compiler.scala)
- Compiler.compile (cognitive 28) (amm/compiler/src/main/scala-3.4.2+/ammonite/compiler/Compiler.scala)
- Compiler.compile (cognitive 28) (amm/compiler/src/main/scala-3.5.0+/ammonite/compiler/Compiler.scala)
- Compiler.compile (cyclomatic 19) (amm/compiler/src/main/scala-3.0.0-3.3.1/ammonite/compiler/Compiler.scala)
- Compiler.compile (cyclomatic 19) (amm/compiler/src/main/scala-3.3.2+/ammonite/compiler/Compiler.scala)
- …and 206 more
Architecture
- Containers 0 added · 0 removed · contexts 1 added · 0 removed · edges 0 added · 0 removed
Added bounded contexts (1)
- repository
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
com-lihaoyi/Ammonite 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 27 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit c8804698996a98dcef71ad738f31f870c7716d36 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-d00c643c3f66.