Skip to content

Triage acceptance policy; admitted roots wait for triage - #483

Merged
el-bri-ga merged 10 commits into
mainfrom
feat/triage-policy
Nov 20, 2026
Merged

el-bri-ga merged 10 commits into
mainfrom
feat/triage-policy

Conversation

@el-bri-ga

@el-bri-ga el-bri-ga commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Closes #476, closes #481

A configured triage policy lets the tracker accept routine triage itself, and admit mode now leaves a root in Triage until its triage is accepted. No model calls anywhere.

What it does

  • KBL_TRIAGE_POLICY_FILE: {"rules":[{"name","tiers","areas","deny_areas","types","sizes","deny_needs"}]}. Each rule needs a name and at least one condition; the first match names the acceptance. No file: every triage waits for a person.
  • When a finished, plain triage matches, the tracker writes accepted as itself with admitted_by: <rule> (format 25). It runs when the triage item is completed and in the sweep, so a crash in between is finished by the next sweep; a second write is refused by the fold.
  • A person takes it back with POST /v1/work/proposals/undo-admission (undo_admission tool, "Take back the policy acceptance" in the panel): the root returns to Triage with triage's answer and the policy stays off it. A person's own accept clears the rule's name.
  • Dashboard: "Admitted by policy " in the panel, card chip and timeline.
  • Admit mode hands out a root's fix before its triage is accepted; the worker then cannot complete #481: admit mode no longer writes accepted, so work_next and work_peek hand out triage and augment first. From format 25, finishing a fix cancels triage and augment children nobody holds and that have no recorded work; any other open child still refuses, and the refusal now names it and its holder.

Design calls

  • tiers is a list (like the fit rows), not a max_tier, because tier 0 is the most urgent and "at most N" reads both ways.
  • Never admitted by a rule, whatever it says: unclear, duplicate, split, dependencies, edited, changed upstream, left scope, closed, reopened, accepted by a person, or triage item still open. The fold checks this too (policy_blocker), so a rule can only narrow it.
  • A reopened root and a taken-back acceptance set policy_held: the policy never accepts them again.
  • The fold's rejection of admitted_by from anyone but the tracker, plus the ingest route refusing it, keeps the record the tracker's own.
  • The intake rule's tier no longer sets an admitted root's tier (it was written by the admit-time accepted). The accept takes triage's tier. Skip rules keep theirs.
  • A log below format 25 runs no rule.
  • Not done from the Admit mode hands out a root's fix before its triage is accepted; the worker then cannot complete #481 follow-up: the one-click dashboard action for the open-children question. With auto-cancel on format 25 the worker no longer asks in the common case, so I left the dashboard part.
  • Found, not fixed: a person accepting a root before its triage finishes lets a later unclear answer open a question on a root an agent already holds (the fault sweep avoids it).

Tests (each revert-checked): fold tests for the policy, take-back, and moot children; format 25 corpus (core, wasm golden); tracker tests (match, no-match, crash recovery, person wins, below format, ingest refusal); the tracker fault sweep now runs policy roots under crashes (default seeds now 100); policy file parser tests; dashboard unit tests; dev/check-tracker-policy.mjs in CI. Ingest tests that expected an accepted root changed because admit no longer accepts.

@el-bri-ga
el-bri-ga enabled auto-merge (squash) November 20, 2026 01:40
Upgrade-Break: a new log starts at format 25, which a build that reads up to 24 refuses, so the previous build cannot read a log this build created.
@sonarqubecloud

Copy link
Copy Markdown

@el-bri-ga
el-bri-ga merged commit 76dd811 into main Nov 20, 2026
10 checks passed
@el-bri-ga
el-bri-ga deleted the feat/triage-policy branch November 20, 2026 03:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant