INNER CODE UNIT · Python
inventory_commands
yohey-w/multi-agent-shogun · scripts/slim_yaml.py:129
def inventory_commands(commands):
unknown = []
old_active = []
for cmd in commands:
if not isinstance(cmd, dict):
continue
status = get_item_status(cmd) or 'unknown'
cmd_id = cmd.get('id', '<missing-id>')
if status not in TERMINAL_STATUSES and status not in ACTIVE_STATUSES:
unknown.append(f"{cmd_id}:{status}")
if status in ACTIVE_STATUSES and is_old_timestamp(cmd.get('timestamp')):
old_active.append(f"{cmd_id}:{status}:{cmd.get('timestamp')}")
if unknown:
print_inventory("non-canonical command status: " + ", ".join(unknown))
if old_active:
print_inventory("old non-terminal commands kept for human review: " + ", ".join(old_active))