> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# How law stays current

> The nightly pass that acts on law whose premise moved, the near-ruling check on new law, and the decision log.

Law recorded once reaches every later session. A ruling can outlive its premise, the fact it was made about. Code merges, CI changes, and a stored check reads differently than at record time. F\[no] ships three pieces that keep the law set current: the nightly upkeep pass, the near-ruling check on new law, and the decision log. The model behind law itself, and the difference between a ruling and a law, is on [How decisions and law work](/docs/concepts/decisions.md).

## Why law goes stale

A law with a state check, such as `--while <COMMAND>`, stores the answer it saw. State checks and end dates are covered under [Active periods](/docs/concepts/decisions.md#active-periods). The `fno inbox law match` and `fno inbox law stage` commands refresh that answer each time they run. When merged code or CI changes, the stored reading can stop describing the world: the law row is stale. A law whose `--until` date passed is expired. If a check cannot run at all, the row reads unknown. All three states mean the law is not dependable, so the upkeep pass looks for them.

## Run the pass

Run the pass in your project root. Without `--apply` it reports and touches nothing:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
fno inbox law upkeep run
```

Add `--apply` to act, and `--json` for machine-readable output:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
fno inbox law upkeep run --apply --json
```

With `--apply`, the pass decides one action for each row:

| State | Your words in the row | Action under `--apply` |
| - | - | - |
| `expired` | any | Retracted. The receipt, the record the retraction writes, names the passed date. |
| `stale` | none (quote-free) | Retracted. The receipt names the reading that moved. |
| `stale` | a `--quote` you recorded | One question filed on your board. Nothing is deleted. |
| `unknown` | any | Report only. A check that cannot run decides nothing. |

> **Note:** Rows with your quoted words are never retracted by the pass. The question lands on your board, the open-question list `fno inbox outstanding` shows, and names the law, the moved premise, and your exact words. It asks you to retire, renew or restore the law by hand. One question per law stays open per stale episode, one nightly finding, so the nightly pass never re-asks.

The pass writes every retraction as a record. The record carries `retracted_by: law-upkeep` and a reason that names the state and the moved reading. [The record history](/docs/concepts/decisions.md#how-a-ruling-ends) then shows why the row died.

With `--json`, the summary counts each state and action:

| Key | What it counts |
| - | - |
| `stale` | Rows whose stored reading moved |
| `expired` | Rows past their `--until` date |
| `unknown` | Rows whose check could not run |
| `retracted` | Rows the pass retracted (`retracted_stale` + `retracted_expired`) |
| `questioned` | Rows the pass filed a question for |
| `duplicates` | Laws that share one subject, report-only |

Two laws can carry the same subject. The pass reports them. It never merges or deletes either row.

## The nightly agent

Install the pass as a nightly launchd agent:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
fno inbox law upkeep install
```

The agent runs `fno inbox law upkeep run --apply` every night at 02:30 local time, half an hour after groom, F\[no]'s other nightly job, so the two never race. `--hour N` moves the hour. `--dry-run` prints the agent file and registers nothing. On macOS the plist lands at `~/.fno/agents/Library/LaunchAgents/sh.fno.law-upkeep.plist`, and the label reads `sh.fno.law-upkeep` with a per-home suffix. The agent writes `law-upkeep.out.log` and `law-upkeep.err.log` into the logs dir beside it. On other systems, such as Linux, the command prints status `unsupported` and the cron line to schedule by hand: `30 2 * * * fno inbox law upkeep run --apply`.

Check the installed state:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
fno inbox law upkeep status --json
```

![A terminal. The command prints one JSON line: installed is false, the label carries a per-home suffix, and no run is on record yet.](https://mintcdn.com/fno/GVNElmIUUJ7BCIv1/images/law-upkeep-status.png?fit=max\&auto=format\&n=GVNElmIUUJ7BCIv1\&q=85\&s=da2164bbb79eb56f48d175d3825ae59e)

Captured from a source build of fnodotdev/fno main (PRs 156, 157 and 179), not a release binary. The JSON prints on one line. This shot wraps it for print.

The status prints `installed` only with the plist file on disk and the label loaded in launchd. The age of the last run comes from the out log. A plist without a loaded label reads as not installed. Uninstall the agent:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
fno inbox law upkeep uninstall
```

## Name near rulings

Recording law writes a rule other sessions obey. A new law that says nearly the same thing as a live ruling has to account for it. When you run `fno inbox law set`, the command first reads the live laws and lead role rulings, the rulings a lead role recorded. The read covers one scope, the reach [a law's scope flags](/docs/concepts/decisions.md#law-has-a-scope) set. Near means at least 6 shared topic words with the new law, at half or more of the shorter text. Topic words are the words that carry the subject. The write refuses until you name each near ruling:

```text theme={"theme":{"light":"min-light","dark":"min-dark"}}
2 live ruling(s) say nearly the same thing as this law. Name each one: --supersedes <id> retires it, --keep <id> keeps it beside the new law
```

`--supersedes <id>` records the new law and retires the old row. `--keep <id>` records the new law and leaves the old row live beside it. The refusal exits with code 3 and names the ruling ids, so an agent can act on it.

## The sweep

A law that exists changes no work by itself. After the write, the command ranks your open nodes, the unfinished work items on [How work is organized](/docs/concepts/work-contracts.md), by the law's words. Rare words weigh more, and the read takes up to 5 words. Every open node that matches gets the law in one message from `fno/law-sweep` in the fleet's mail ([message agents](/docs/guides/message-agents.md)). The session that owns the work sees the rule the day it lands.

The word read can miss a guide that never uses the law's own words. Pass the missing word yourself:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
fno inbox law set <subject> --sweep desktop
```

Each `--sweep <word>` adds the open nodes that carry the word. A node with an owner session gets the message. A node with no owner prints one line on stderr instead.

## The decision log

The decision log is one markdown file beside your plans dir, the directory your project keeps its plan files in: `decision-log.md`. It lists the live rulings by subject, then the retirements of the last 30 days. One file shows what stands and what recently died.

Every law write rewrites it: `fno inbox law set`, `retract`, `restore` and `renew`, plus `fno inbox decide` and `fno backlog decide-retract`. To rewrite it on demand and print its path:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
fno backlog decisions --log
```

## Next steps

* [How decisions and law work](/docs/concepts/decisions.md): the model behind law, scopes and strengths.
* [Answer from chat](/docs/guides/answer-from-chat.md): record a law with limits, quotes and state checks.
* [How the attention ledger works](/docs/concepts/attention-ledger.md): the weekly read of what the fleet's coordination costs you.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.