Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -487,11 +487,12 @@ A scanner's map of a codebase or an organization, marked and sent to agents ([ma

## Pipeline templates

The saved pipeline graphs the editor and the Pipelines page work on, under `/api/v1/pipelines/templates`: list, read, create, update, delete and duplicate. Every authenticated principal may read and write them; the two writes with answers worth knowing:
The saved pipeline graphs the editor and the Pipelines page work on, under `/api/v1/pipelines/templates`: list, read, create, update, delete and duplicate. Every authenticated principal may read and write them; the writes with answers worth knowing:

| Endpoint | Answer |
|---|---|
| `PUT /api/v1/pipelines/templates/{id}` | Updates the fields sent. `default_for_kind` set to a kind makes the template that kind's default route; an explicit `null` clears it. 409 when another template already holds the kind (clear it first), or when the new name is taken |
| `PUT /api/v1/pipelines/templates/{id}` | Updates the fields sent. `default_for_kind` set to a kind makes the template that kind's default route; an explicit `null` clears it. 409 when another template already holds the kind (clear it first), or when the new name is taken. 409 too for a rename, or a change that makes it stop taking a code job, of a template a settings document's `slop_policy.route_template` routes slop jobs to ([slop routing](slop-routing.md#the-route-template)); the answer names those documents |
| `DELETE /api/v1/pipelines/templates/{id}` | Deletes the template. 409, naming the documents, while a settings document's `slop_policy.route_template` routes slop jobs to it, `slop-cleanup` by default ([slop routing](slop-routing.md#the-route-template)) |
| `POST /api/v1/pipelines/templates/{id}/duplicate` | `{"name": "..."}` copies the graph, the sandbox profile and what the row says of its jobs (below) under the new name and answers 201; the copy is no kind's default. 409 when a template of that name already exists |

**What a template's row says of its jobs.** Five columns (#167) decide how embry0 treats a job of the template, where it once went by the built-in templates' names. `POST` accepts them, `PUT` changes the ones sent, and every read, the list included, returns them; on the Pipelines page a template's menu edits them under *Behaviour…*:
Expand Down
17 changes: 17 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ asks:
- The salvage policy (`salvage`, until now fixed in the code as `wip: unfinished — <agent> stopped (<reason>)`): the subject of the commit that keeps a stopped coding run's work, as a template naming `{agent}` and `{reason}`, so a repository whose commit rules refuse `wip:` can write what they accept. A subject past 100 characters has only its reason shortened. An organization's or a repository's layer may set it, and a coding job reads it when it starts, as it reads `done_when`.
- The scout's policy (`scout`, from `SCOUT_TEMPLATES`, `SCOUT_MAX_IN_FLIGHT`, `SCOUT_REVISIT_HOURS` and `SCOUT_MAX_LEADS_PER_JOB`, plus each job's hard cap, until now fixed at 1 USD, and a daily cap, off by default): the scout reads it every tick, so a change applies within 5 minutes with no restart. Which repositories it reads is `background.scout` (above).
- The Slop-O-Meter's scoring policy and pace (`slop_meter`, from `SLOP_METER_INTERVAL_SECONDS`, which is `interval_hours`, or `enabled: false` for `0`, `SLOP_METER_API_CALLS_PER_TICK` and `SLOP_METER_RATE_RESERVE`; everything else was fixed in the meter's code, and its defaults are those values, so a deployment that writes nothing scores exactly as before): what a changed line of each kind of file weighs (`weights`, merged glob by glob), which directories are vendored and what is a test, the hours a commit, a co-author or a comment implies, the lines an hour covers and the weekly cap, who counts as the core team and the small-repository rule, the outlier thresholds and what the judge is told, the five levels' bounds and names, and the owner's own bots and AI agents. An organization's layer may set every key but `enabled` and `interval_hours`, and a repository's what counts as code in its layout. Each organization's `slop_meter_bots` was copied into its layer as `bots` once, each bot once and an entry the section cannot hold left out; `PATCH /api/v1/orgs/{owner}` still takes it until 0.2.0. `bots` and `ai_agents` add to what a layer inherits. A credential's forge budget is the deployment's; an organization's `api_calls_per_tick` and `rate_reserve` only narrow its own share. Every score records the version of the settings it was computed with; every 5 minutes the meter compares it with the version each repository reads now and rescores only those that differ, from what it read, with no fetch and no forge call ([how a change rescores](slop-meter.md#how-a-change-rescores)). Until the first start's import has imported the three variables, the meter reads them as before. The variables left (`SLOP_METER_CATCHUP_SECONDS`, `_DATA_PATH`, `_GIT_TIMEOUT_SECONDS`, `_COMMITS_PER_TICK`, `_EVENT_PAGES`, `_REVIEWS_PER_TICK`, `_LOGINS_PER_TICK`, `_JUDGMENTS_PER_TICK`) are the process's own limits.
- The slop policy (`slop_policy`, until now fixed in the code: every code job judged slop ran `slop-cleanup`, the seven kinds, the classifiers' and the reviewer's words, the ticket heading "Slop, not a bug", and the meter's dungeon level 2 and lean level 4; no variable set them, so nothing is imported, and a deployment that writes nothing routes and prompts exactly as before): whether and where a code job judged slop is routed and from which score, which an organization's or a repository's layer may set, and the kinds, the guides, the heading and the two levels, which only an organization's may. A job reads it for its repository when it starts, the watcher for its stack's repository on every analysis. `route_template` must name a template that takes a code job, and such a template cannot be deleted or renamed while a document routes to it ([slop routing](slop-routing.md)).
- The dashboard's game layer and home page (`ui`, new: no variable configured them). The game is on and the guild is the home until a document says otherwise. The dashboard reads the section before it draws its navigation and home page, every minute after that and at once after a save on the Policy tab, and `GET /api/v1/config/ui` and the game's routes read it on every request, so turning the game off or on needs no restart and no reload. The deployment's only: the dashboard knows no viewer's organization to read a layer for. See [turning the game off](world.md#turning-the-game-off).

### Which repositories background features read
Expand Down Expand Up @@ -578,6 +579,22 @@ How the Slop-O-Meter weighs a changed line and a person's attention, where its l
| `bots` | list of text | `[]` | at most 200 entries, each at most 200 characters | organization, added to | | Bots, as commit names, addresses or forge logins matched whole without regard to case: their commits add lines but no attention, and as a co-author they count as an AI agent does. Beyond the ones every deployment knows ([bot] accounts, noreply@ addresses, known coding agents) and embry0's own commit identities. Each document adds to the list it inherits, so a bot the deployment lists counts for every organization; no layer takes one out, and a bot spelled otherwise is the same one. At most 200 in all, counted with what a write inherits. Was the organization's slop_meter_bots. |
| `ai_agents` | list of text | `[]` | at most 200 entries, each at most 200 characters | organization, added to | | AI coding agents beyond the known ones, each its commit address up to and including the @ (aider@, any domain) or a whole address (agent@tools.example), matched without regard to case: a commit one authors adds lines but no attention, and one it co-authors counts ai_coauthor_share of its author's hours. Each document adds to the list it inherits, as bots. At most 200 in all, counted with what a write inherits. |

#### `slop_policy`

What embry0 does with a code job or a finding judged slop: whether and where it is routed, what the classifiers and the reviewer are told, its kinds, its ticket heading and the meter levels it acts on.

| Key | Type | Default | Allowed | Overridable by | Imported from | Description |
|---|---|---|---|---|---|---|
| `enabled` | true or false | `true` | | organization, repository | | A code job judged slop runs route_template instead of the route triage picked. False: it takes its normal route, the verdict is still recorded on the job, and triage is told so. |
| `route_template` | text | `"slop-cleanup"` | at least 1 characters, at most 100 characters | organization, repository | | The pipeline template a code job judged slop runs. A write that changes it, by naming another or by taking the key out, must leave a template that takes a code job: one whose jobs are recorded as code jobs and whose route has a coding step. A template a document routes to cannot be deleted, renamed or changed to stop taking one. A job pinned to the full pipeline takes it only when its route also has review and QA. A template a person named for the job still wins. |
| `min_score_to_route` | whole number | `0` | ≥ 0, ≤ 100 | organization, repository | | The least slop_score (0 to 100, how much of the trouble is shape) a slop verdict needs to be routed. 0 routes every slop verdict; one below it takes its normal route. |
| `kinds` | list of text | `["duplication", "dead_code", "half_wired", "contradicting_layers", "symptom_patch", "misleading_docs", "off_pattern"]` | at most 20 entries, each at most 40 characters | organization | | The kinds of slop a verdict may name, as lowercase words joined by _. A kind a classifier names that is not here is dropped from its verdict. Describe each in classifier_guide, which is what the classifiers are told. |
| `classifier_guide` | text | `"Tell slop apart from bugs:\n- bug: the behavior differs from what the code, its docs or the ticket intend.\n Fixing it changes behavior.\n- slop: the behavior is what the code says, and the trouble is the code's\n shape. Cleaning it keeps behavior. Kinds: duplication (the same logic in\n more than one place), dead_code (paths, flags or files nothing reaches),\n half_wired (a feature or abstraction started and not finished),\n contradicting_layers (two layers that disagree about one thing),\n symptom_patch (guards, retries, fallbacks or catch-alls stacked on a symptom\n instead of its cause), misleading_docs (comments or docs that say what the\n code does not do), off_pattern (code that ignores the repository's own way).\n- noise: nothing to do.\nA guard, retry or catch-all stacked on a symptom is slop when removing it and\nfixing the shape keeps the outcome. When the code does the wrong thing (keeps\nretrying what can never succeed, drops or duplicates data, answers wrongly),\nit is a bug, even when sloppy code caused it: say bug, and name the slop in\nthe evidence. Do not call a real defect slop to make it look smaller.\nslop_score (0-100) is how much of the trouble is shape rather than behavior:\n0 for a pure bug, 100 for pure slop."` | at most 4000 characters | organization | | What triage and the watcher are told slop, a bug and noise are, and what slop_score means, in their system prompts. Name each of kinds in it. |
| `review_guide` | text | `"## This change is a slop cleanup\n\nIt was judged slop, not a bug: it must keep behavior and improve shape.\nApprove only when all of these hold, and request changes otherwise, saying which:\n- behavior is unchanged: the tests pass, and no public behavior, API or output\n moved (removing what nothing reaches is fine);\n- the change removes or merges more than it adds, or is plainly simpler;\n- it adds no new guard, retry, fallback, catch-all or flag to hide a symptom."` | at most 2000 characters | organization | | What the reviewer of a change the Slopmaster made is told to check, before its usual instructions. The lines the branch adds and removes are said after it. |
| `ticket_heading` | text | `"Slop, not a bug"` | at most 80 characters | organization | | The heading, without its # marks, that the watcher's draft ticket for a finding judged slop opens with, in the tracker it files to. Triage is told to weigh a section under it. |
| `triage_lean_min_level` | whole number or null | `4` | ≥ 1, ≤ 5 | organization | | The Slop-O-Meter level (1 to 5) from which triage leans toward slop on a borderline verdict, told with the levels' names (slop_meter.level_names). Null: it is given the reading and never told to lean. |
| `dungeon_min_level` | whole number or null | `2` | ≥ 1, ≤ 5 | organization | | The Slop-O-Meter level (1 to 5) from which a repository or an area has a Slop Dungeon on the world map even with no open slop finding. Null: only open slop and recent cleanups make one. |

#### `ui`

What the dashboard shows: the game layer, and the page it opens on.
Expand Down
86 changes: 86 additions & 0 deletions docs/examples/settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,92 @@ slop_meter:
# inherits, as bots. At most 200 in all, counted with what a write inherits.
# ai_agents: []

# What embry0 does with a code job or a finding judged slop: whether and where
# it is routed, what the classifiers and the reviewer are told, its kinds, its
# ticket heading and the meter levels it acts on.
slop_policy:
# A code job judged slop runs route_template instead of the route triage
# picked. False: it takes its normal route, the verdict is still recorded on
# the job, and triage is told so.
# enabled: true

# The pipeline template a code job judged slop runs. A write that changes
# it, by naming another or by taking the key out, must leave a template that
# takes a code job: one whose jobs are recorded as code jobs and whose route
# has a coding step. A template a document routes to cannot be deleted,
# renamed or changed to stop taking one. A job pinned to the full pipeline
# takes it only when its route also has review and QA. A template a person
# named for the job still wins.
# route_template: slop-cleanup

# The least slop_score (0 to 100, how much of the trouble is shape) a slop
# verdict needs to be routed. 0 routes every slop verdict; one below it
# takes its normal route.
# min_score_to_route: 0

# The kinds of slop a verdict may name, as lowercase words joined by _. A
# kind a classifier names that is not here is dropped from its verdict.
# Describe each in classifier_guide, which is what the classifiers are told.
# kinds:
# - duplication
# - dead_code
# - half_wired
# - contradicting_layers
# - symptom_patch
# - misleading_docs
# - off_pattern

# What triage and the watcher are told slop, a bug and noise are, and what
# slop_score means, in their system prompts. Name each of kinds in it.
# classifier_guide: |-
# Tell slop apart from bugs:
# - bug: the behavior differs from what the code, its docs or the ticket intend.
# Fixing it changes behavior.
# - slop: the behavior is what the code says, and the trouble is the code's
# shape. Cleaning it keeps behavior. Kinds: duplication (the same logic in
# more than one place), dead_code (paths, flags or files nothing reaches),
# half_wired (a feature or abstraction started and not finished),
# contradicting_layers (two layers that disagree about one thing),
# symptom_patch (guards, retries, fallbacks or catch-alls stacked on a symptom
# instead of its cause), misleading_docs (comments or docs that say what the
# code does not do), off_pattern (code that ignores the repository's own way).
# - noise: nothing to do.
# A guard, retry or catch-all stacked on a symptom is slop when removing it and
# fixing the shape keeps the outcome. When the code does the wrong thing (keeps
# retrying what can never succeed, drops or duplicates data, answers wrongly),
# it is a bug, even when sloppy code caused it: say bug, and name the slop in
# the evidence. Do not call a real defect slop to make it look smaller.
# slop_score (0-100) is how much of the trouble is shape rather than behavior:
# 0 for a pure bug, 100 for pure slop.

# What the reviewer of a change the Slopmaster made is told to check, before
# its usual instructions. The lines the branch adds and removes are said
# after it.
# review_guide: |-
# ## This change is a slop cleanup
#
# It was judged slop, not a bug: it must keep behavior and improve shape.
# Approve only when all of these hold, and request changes otherwise, saying which:
# - behavior is unchanged: the tests pass, and no public behavior, API or output
# moved (removing what nothing reaches is fine);
# - the change removes or merges more than it adds, or is plainly simpler;
# - it adds no new guard, retry, fallback, catch-all or flag to hide a symptom.

# The heading, without its # marks, that the watcher's draft ticket for a
# finding judged slop opens with, in the tracker it files to. Triage is told
# to weigh a section under it.
# ticket_heading: Slop, not a bug

# The Slop-O-Meter level (1 to 5) from which triage leans toward slop on a
# borderline verdict, told with the levels' names (slop_meter.level_names).
# Null: it is given the reading and never told to lean.
# triage_lean_min_level: 4

# The Slop-O-Meter level (1 to 5) from which a repository or an area has a
# Slop Dungeon on the world map even with no open slop finding. Null: only
# open slop and recent cleanups make one.
# dungeon_min_level: 2

# What the dashboard shows: the game layer, and the page it opens on.
ui:
# Show the game layer: the guild, the agents' levels, skills and outfits,
Expand Down
Loading
Loading