# Configuration basics

`cooldown.toml` at the repo root is the policy surface. This page covers the keys you set on it, and two more pages build on them:

- **[Selectors](https://romnn.github.io/cooldown/docs/configuration/selectors/):** scoping the keys per tool, registry, or package.
- **[Precedence](https://romnn.github.io/cooldown/docs/configuration/precedence/):** how they combine.

## `min-age`

The cooldown window — the one knob most repos ever set. In its **scalar** form it is a single duration:

```toml
min-age = "14d"
```

In its **table** form it sets a different window per version-change kind:

```toml
min-age = { default = "14d", major = "30d", minor = "14d", patch = "7d" }
```

A bigger jump is a bigger change, so a longer window for majors than patches is a common shape — wait longer before adopting a brand-new major, less for a patch.

## Durations

Every duration field accepts the same flavors:

- Compact: `"7d"`, `"36h"`, `"2w"`.
- Human: `"2 weeks"`, `"10 days"`.
- ISO-8601: `"P7D"`.

## `latest` and `freeze`

Two ways to express the extremes of a window:

```toml
latest = true            # sugar for min-age = "0d" — adopt anything, no cooldown
freeze = "2026-06-01"    # an absolute cutoff instead of a rolling window
```

`freeze` pins the "as-of" instant: nothing published after that date is adoptable, no matter when
you run `cooldown` — useful for pinning an audited state, or for a CI job that should evaluate
against a fixed point in time rather than a moving one.

It freezes *publication-time* eligibility, and the registry's current state still applies:

- **An unpublished or yanked version** disappears.
- **The npm family's mutable `latest` dist-tag** still caps adoption, judged live by
  version-adopting commands and from a copy at most an hour old by read-only ones (`--fresh`
  forces live reads). Pass `--no-respect-dist-tags` for a tag-independent frozen run.

## `allow`

An **exemption set** — packages the cooldown does not apply to:

```toml
allow = ["acme/*"]
```

Exemptions are audited: every one shows up in [`cooldown explain`](https://romnn.github.io/cooldown/docs/commands/other/), so an exemption is always visible rather than silent. An `allow` glob uses the same flavor as the `[package."…"]` [selector](https://romnn.github.io/cooldown/docs/configuration/selectors/).

## `floor`

A **hard minimum** that no nearer, more-specific config can weaken:

```toml
floor = "3d"
```

Where `min-age` is authority-first (a higher layer overrides a lower one), `floor` only ever ratchets *stricter*: it is max-clamped across layers, so a `floor = "3d"` set high in your config can't be dialed back down by a more specific `[package."…"]` block. It is the guardrail for "no matter what else is configured, never adopt anything younger than this." An `allow` can bypass a floor only when it is co-declared with it in the same layer, or through the audited `--allow` flag or `COOLDOWN_ALLOW` variable. `--latest` does not bypass a floor — see [Precedence](https://romnn.github.io/cooldown/docs/configuration/precedence/).

## A worked example

```toml
# Repo-wide default, with a longer window for a brand-new major.
min-age = { default = "14d", major = "30d" }

# A trusted first-party package family, exempt.
allow = ["acme/*"]

# But never, anywhere, adopt something younger than 2 days.
floor = "2d"

# Packages from npm wait longer.
[registry.npm]
min-age = "21d"
```

Top-level keys come before the first `[table]`: TOML puts every key after a table header into that table.

Every value above has an origin and a scope. Two places show how they resolve:

- **[`cooldown config`](https://romnn.github.io/cooldown/docs/commands/other/):** prints the resolved result.
- **[Precedence](https://romnn.github.io/cooldown/docs/configuration/precedence/):** explains exactly how `allow` and `floor` interact.

## Flag defaults: `[global]` and `[<command>]`

Most command-line flags also have a config key, spelled like the flag. `[global]` sets a default for every command, and a section named after a command overrides it for that command: `[outdated]`, `[upgrade]`, `[fix]`, `[check]` or `[baseline]`. A flag on the command line overrides both.

```toml
[global]
respect-dist-tags = false

[upgrade]
fast = true
```

The keys these sections take:

- `exclude-folders`, `exclude-packages` and `include-hidden` (see [Exclusions](https://romnn.github.io/cooldown/docs/configuration/excludes/))
- `tool` and `package`
- `gitignore`, `major` and `respect-dist-tags`
- `all` and `transitive`
- `all-artifacts`, `allow-stale-lock`, `fail-on-unknown-age` and `fail-on-advisory-source`
- `fail-on-new-duplicate`, `strict`, `build`, `fast` and `downgrade-pinned`
- `dry-run`, `offline`, `fresh` and `json`
- `exit-code`, `concurrency` and `jobs`

`transitive` is a boolean here and only decides whether `outdated` lists transitive dependencies. The `--transitive <mode>` of `check`, `fix` and `upgrade` has no config key.

These sections are read from the global config, the repository-root `cooldown.toml` and a `--config` file; a nested `cooldown.toml` does not apply them, and an exclusion list there is a config error.

`strict-native = true` is a top-level key, not one of these sections. It makes [`check`](https://romnn.github.io/cooldown/docs/commands/check/#flags) fail when repo policy overrides a stricter native cooldown, like `--fail-on-stricter-native`.
