feat(kvb-org-priority): let the operator reorder the agents' priority

rasci.py gains agents, which groups the open tasks by worker in rank order (operator pins first, then WSJF) and prints rank, agent, count and tasks, and order "A,B,...", which checks the names against that list and, under the register lock, pins the listed agents' tasks 1..n in the chosen order, keeping each agent's own task order, and drops the pins of every agent left out so they rank by WSJF after them. The new kvb-org-priority skill shows the current order, offers keep, up to two reasoned suggestions or the operator's own order through Other, applies it and tells the chair and every reordered agent. kvb-org-rasci documents both commands and names order as the one exception to writing only your own rows. test_rasci covers the order, the pins in show, the dropped pins and the usage errors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kevin Veen-BirkenbachandClaude Opus 5.5 committed 2026-11-04 17:07:22 +01:00
1 parent f815060584
commit 269590a93d
5 files changed
+120

No files matched your search

+4
View File
@@ -23,6 +23,8 @@ rasci.py artifacts [--ended] [--task <task>]
rasci.py estimate <task> "<party>" --value <fib> --complexity <fib>
rasci.py wsjf [--all]
rasci.py tools
rasci.py agents
rasci.py order "<agent>,<agent>,..."
```
## Objective and key results
@@ -58,6 +60,8 @@ published). `done` is refused while one is open; a task ended short of them is
(`--prio`) first, then WSJF from the estimates the chair collects; `show`
prints the rank as Prio and the score as WSJF.
- Write only your own rows; another session's task belongs to that session.
The one exception is `order`, the operator's pick through the
`kvb-org-priority` skill.
- On /kvb-org-rasci print `show` unchanged; its `gaps:` line names tasks
without exactly one A, without R, or open without a key result. `get`
prints one task in full, key results numbered.
+36
View File
@@ -213,6 +213,38 @@ def ranked(rows: dict[str, dict]) -> list[str]:
return sorted(rows, key=key)
def by_agent(rows: dict[str, dict]) -> dict[str, list[str]]:
agents: dict[str, list[str]] = {}
for task in ranked(rows):
agents.setdefault(rows[task].get("worker") or "-", []).append(task)
return agents
def cmd_agents(_: argparse.Namespace) -> int:
for rank, (agent, tasks) in enumerate(by_agent(merged(include_done=False)).items(), 1):
print(f"{rank}\t{agent}\t{len(tasks)}\t{', '.join(tasks)}")
return 0
def cmd_order(args: argparse.Namespace) -> int:
names = [name.strip() for name in args.agents.split(",") if name.strip()]
agents = by_agent(merged(include_done=False))
unknown = [name for name in names if name not in agents]
if not names or unknown or len(set(names)) != len(names):
fail(f"order needs distinct agents from `agents`; unknown: {', '.join(unknown) or '-'}")
with database() as tasks:
prio = 0
for name in names:
for task in agents[name]:
prio += 1
tasks.setdefault(task, {})["prio"] = prio
for name in agents.keys() - set(names):
for task in agents[name]:
tasks.get(task, {}).pop("prio", None)
print(f"pinned {prio} tasks of {len(names)} agents; the others rank by WSJF after them")
return 0
def okr(row: dict) -> str:
results = row.get("key_results", [])
text = cell(row.get("objective") or "-", 40)
@@ -489,6 +521,10 @@ def main() -> int:
p.add_argument("--task")
p.set_defaults(func=cmd_artifacts)
sub.add_parser("tools").set_defaults(func=cmd_tools)
sub.add_parser("agents").set_defaults(func=cmd_agents)
p = sub.add_parser("order")
p.add_argument("agents")
p.set_defaults(func=cmd_order)
args = parser.parse_args()
return args.func(args)