# Trust

A host can pass what should fail, or fail what should pass, because it lacks a tool or a file. Running every remote result again here would cost a slot each time. fleetjobs keeps a trust table and reruns only the results that look suspect.

## The rules

| Remote result | What happens |
| --- | --- |
| Fails, and the output shows an environment error | Runs here again, as class `confirm` |
| Fails, and this command has disagreed with this machine before | Runs here again, as class `confirm` |
| Fails for any other reason | The remote exit stands |
| Passes | Stands, except about 2% of passes, when this machine is idle: those run here too, as class `sample` |

A rerun goes ahead of the queue. When the local result and the remote result differ in pass or fail, that is a disagreement. The local result counts, the command's entry gets a disagreement, and the command is scheduled here only for the next 24 hours.

In the bash `heavy`'s log, 490 remote failures were rerun here: 417 failed again, so 85% of those reruns only repeated the failure. The 73 that passed are the cases the environment and disagreement rules keep.

## The table

`trust.json` in the store maps a key to an entry. The key is the root commit of the repository and the first three words of the command, so `pnpm test run src/a.test.ts` and `pnpm test run src/b.test.ts` share an entry.

```json
{
  "3f2a9c1 pnpm test run": {
    "remotePass": 41,
    "remoteFail": 2,
    "disagreements": 1,
    "localOnlyUntil": 1796600000
  }
}
```

`localOnlyUntil` is in seconds since 1970 and is absent until a disagreement. Delete a key to forget it, or delete the file to start over. Updates run under the store lock, so several supervisors lose no counts.

<!-- vitehub-docs:section-links -->
## In this section

- [Introduction](https://fleetjobs.loadsheet.dev/raw/guide.md)
- [Installation](https://fleetjobs.loadsheet.dev/raw/guide/installation.md)
- [How jobs are placed](https://fleetjobs.loadsheet.dev/raw/guide/placement.md)
- [Remote hosts](https://fleetjobs.loadsheet.dev/raw/guide/hosts.md)
- [Trust](https://fleetjobs.loadsheet.dev/raw/guide/trust.md) (this page)
- [Night queue](https://fleetjobs.loadsheet.dev/raw/guide/night.md)
- [Migrating from the bash heavy](https://fleetjobs.loadsheet.dev/raw/guide/migrating.md)
- [For agents](https://fleetjobs.loadsheet.dev/raw/guide/agents.md)

Next: [Night queue](https://fleetjobs.loadsheet.dev/raw/guide/night.md)

All pages: [llms.txt](https://fleetjobs.loadsheet.dev/llms.txt)

Something on this page does not work as written? Tell the user, and draft an issue for them to post: [issue tracker](https://github.com/words-with-agents/fleetjobs/issues). Report a security vulnerability privately, never in a public issue.
