Resolution

A build has to get its jars from somewhere. Histos has two ways, and they are a choice about what is allowed to change. The default is solved. .locked is hermetic.

Compile, test, scaladoc, histos deps, and a plugin task all use the same choice. A solved build does not consult dependencies.lock. A hermetic build does not solve.

histos.Resolution
/** Where a build's jars come from. [[Resolution.Solve]] resolves from the build and remembers the result until the
  * build reloads. [[Resolution.Lock]] reads `dependencies.lock` and does not resolve. Omission is [[Resolution.Solve]].
  */
enum Resolution

Solved

Solved is the omission. You write the dependencies in histos.scala. Histos resolves them and remembers the result in .histos/resolution until the build file changes. A jar that is not remembered yet is fetched. That includes a test classpath and a tool the test runner needs. You do not write those into a lock first.

This is the mode to use while a build is moving. The program is the description. A published plugin can still be an exact revision in histos.plugins.scala. That revision is fetched. It does not freeze every other jar.

CI caches a solved build on histos.scala, because that file is what the solve depends on. It does not run histos resolve --check. That command compares a fresh solve with dependencies.lock, and a solved build has no lock. histos deps solves and writes .histos/resolution when that file is missing. It does not write a lock.

Hermetic

.locked makes the build hermetic. dependencies.lock is the complete set of jars and tools. Compile, test, scaladoc, deps, and a plugin task read that file and do not resolve. A cell or a tool that is not in the file is a failure, not a download.

histos resolve --update solves and writes the file. histos resolve --check fails when a fresh solve would write a different one. You commit the file. CI caches a hermetic build on it, because the jars cannot move unless the file moves.

Choose this when two machines, or a laptop and CI, must get the same bytes. A release is the usual reason. A plugin jar you do not want re-resolved tomorrow is another. The cost is that every jar the runner asks for has to be in the file, including a test tool. If it is missing, the command stops.

histos.Organized.locked
  /** Pin jars to `dependencies.lock`. Omission resolves from the build.
    */
  def locked: Organized =
    Organized(
      settings.copy(resolution = Resolution.Lock, intent = ResolutionIntent.Select(Resolution.Lock))
    )

The plugin catalog agrees

histos.plugins.scala has the same switch, and it defaults to solved. If the catalog selects a lock and the build says nothing, the build inherits the lock. If the build explicitly selects the other mode, loading fails. The two files have to describe one choice.

histos.plugin.HistosPlugins.resolution
def resolution: Resolution = Resolution.Solve