feat(orchestrator): hierarchy view from council offices with a separate agent order

The Agents views gain a Hierarchie view: an org chart of the chair and
the line offices read from the council claims. The operator appoints,
hands over and recalls an office there; the page signs each change with
the passkey and a host unit (client/offices.py, offices path unit)
verifies the signature, removes a live holder itself and runs a plain
council.py claim for the successor. council.py loses the --operator
flag, so no agent can override a live holder.

The agent order is now separate from task priority: rasci.py agents
order stores it in agent-order.json beside the register through the
nofollow helpers and never writes a --prio pin. It only breaks ties of
equal task rank, also among the queue grants. The Hierarchie view edits
it as a drag list.

Host units run the installed skill scripts, so orchestrator.sh keeps the
offices unit off while the installed council.py, nofollow.py or rasci.py
differ from the tree. Job files, council files and hub records are read
with O_NOFOLLOW and O_NONBLOCK and size caps; nofollow.rewrite replaces
a claim without creating directories, so a beat never revives a released
office.

🎯 Fix: 92 %
💥 Break: 4 %
💸 Cost: 100 %
⏱️ Time: 79 %
🛡️ Security: 100 %
🏆 Score: 100
🚦 Gate: ✅ 90/5, cost and time <= 100, security 100 %

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kevin Veen-BirkenbachandClaude Opus 5.5 committed 2026-11-07 17:46:39 +00:00
1 parent 8e180be256
commit 4540494c30
53 files changed
+1821 -211

No files matched your search

+26 -4
View File
@@ -2,11 +2,12 @@ from __future__ import annotations
from pathlib import Path
from .council import agent
from .council import agent, ordered
from .fields import ORDER_NAME
from .records import read_json, shown
REGISTER = "rasci.json"
AGENT_ORDER = "agent-order.json"
OPERATOR = "operator/"
ENDED = ("done", "stopped")
@@ -98,10 +99,31 @@ def register_rows(tasks: dict[str, dict]) -> list[dict]:
return [register_row(task, row) for task, row in sorted(tasks.items(), key=pinned) if is_open(task, row, False)]
def priority(tasks: dict[str, dict]) -> list[str]:
def stored_order(path: Path) -> list[str]:
data = read_json(path)
names = data.get("agents") if isinstance(data, dict) else None
if not isinstance(names, list) or not all(isinstance(name, str) for name in names):
return []
return names
def agent_order(tasks: dict[str, dict], claims: list[dict], stored: list[str]) -> list[str]:
"""Args:
tasks: the register.
claims: every office claim; its holder is an agent too.
stored: the operator's agent order, as `rasci.py agents order` wrote it.
Returns:
The agents `rasci.py agents order` accepts: the stored ones it still
knows first, in their order, then the workers of open tasks by pin,
then the remaining office holders by name.
"""
names: list[str] = []
for _, row in sorted(tasks.items(), key=pinned):
worker = row.get("worker")
if status_of(row) not in ENDED and isinstance(worker, str) and ORDER_NAME.fullmatch(worker) and worker not in names:
if status_of(row) not in ENDED and isinstance(worker, str) and worker not in names:
names.append(worker)
return names
names += [name for name in ordered({claim["address"] or claim["session"] for claim in claims}) if name not in names]
known = [name for name in names if ORDER_NAME.fullmatch(name)]
listed = [name for name in dict.fromkeys(stored) if name in known]
return [*listed, *(name for name in known if name not in listed)]