chore(hq): daily sync 2026-02-16

This commit is contained in:
2026-02-16 10:00:29 +00:00
parent 3184eb0d0e
commit fa9193b809
166 changed files with 3262 additions and 78 deletions

View File

@@ -0,0 +1,97 @@
#!/usr/bin/env bash
# Autonomous / Vacation Mode Control
# ONLY Antoine (CEO) can activate this.
# Usage:
# bash autonomous-mode.sh set <normal|autonomous|full-auto> [duration_days] [notes]
# bash autonomous-mode.sh status
set -euo pipefail
MODE_FILE="/home/papa/atomizer/dashboard/autonomous-mode.json"
ACTION="${1:?Usage: autonomous-mode.sh set|status}"
case "$ACTION" in
set)
LEVEL="${2:?Specify level: normal, autonomous, or full-auto}"
DURATION="${3:-0}" # days, 0 = indefinite until manually changed
NOTES="${4:-}"
if [[ "$LEVEL" != "normal" && "$LEVEL" != "autonomous" && "$LEVEL" != "full-auto" ]]; then
echo "❌ Invalid level: $LEVEL (must be: normal, autonomous, full-auto)"
exit 1
fi
python3 -c "
import json
from datetime import datetime, timedelta, timezone
level = '$LEVEL'
duration = int('$DURATION')
notes = '$NOTES'
now = datetime.now(timezone.utc)
expires = None
if duration > 0:
expires = (now + timedelta(days=duration)).isoformat()
data = {
'level': level,
'activated_by': 'antoine',
'activated_at': now.isoformat(),
'expires_at': expires,
'auto_approved_count': 0,
'notes': notes or None
}
with open('$MODE_FILE', 'w') as f:
json.dump(data, f, indent=2)
icons = {'normal': '🟢', 'autonomous': '🟡', 'full-auto': '🔴'}
print(f'{icons[level]} Mode set to: {level}')
if expires:
print(f' Expires: {expires}')
if notes:
print(f' Notes: {notes}')
descriptions = {
'normal': 'Manager escalates decisions, waits for CEO approval',
'autonomous': 'Manager auto-approves routine work, escalates high-risk only',
'full-auto': 'Manager approves everything, CEO reviews async when back'
}
print(f' Behavior: {descriptions[level]}')
"
;;
status)
python3 -c "
import json
from datetime import datetime, timezone
with open('$MODE_FILE') as f:
data = json.load(f)
level = data.get('level', 'normal')
icons = {'normal': '🟢', 'autonomous': '🟡', 'full-auto': '🔴'}
print(f'{icons.get(level, \"⚪\")} Current mode: {level}')
if level != 'normal':
activated = data.get('activated_at', 'unknown')
expires = data.get('expires_at')
count = data.get('auto_approved_count', 0)
notes = data.get('notes', '')
print(f' Activated: {activated}')
if expires:
exp = datetime.fromisoformat(expires)
now = datetime.now(timezone.utc)
remaining = max(0, (exp - now).total_seconds() / 3600)
print(f' Expires in: {remaining:.1f} hours')
else:
print(f' Expires: manual deactivation only')
print(f' Auto-approved: {count} items')
if notes:
print(f' Notes: {notes}')
"
;;
*)
echo "Usage: autonomous-mode.sh set|status"
exit 1
;;
esac

View File

@@ -0,0 +1,97 @@
#!/usr/bin/env bash
# Auditor Challenge Mode
# Triggers auditor to proactively review recent work from target agents
# Usage:
# bash challenge-mode.sh <agent> [scope]
# bash challenge-mode.sh tech-lead "Review their material selection approach"
# bash challenge-mode.sh all "Challenge all recent decisions"
set -euo pipefail
ORCHESTRATE="/home/papa/atomizer/workspaces/shared/skills/orchestrate/orchestrate.sh"
HANDOFF_DIR="/home/papa/atomizer/handoffs"
TARGET="${1:?Usage: challenge-mode.sh <agent|all> [scope]}"
SCOPE="${2:-Review their most recent completed work for rigor, assumptions, and missed alternatives}"
# Gather recent completed handoffs from target agent(s)
CONTEXT=$(python3 -c "
import json, glob
target = '$TARGET'
handoffs = sorted(glob.glob('$HANDOFF_DIR/orch-*.json'), reverse=True)
results = []
for path in handoffs[:50]:
try:
with open(path) as f:
data = json.load(f)
agent = data.get('agent', '')
status = data.get('status', '').lower()
if status != 'complete':
continue
if target != 'all' and agent != target:
continue
result_preview = (data.get('result', '') or '')[:500]
deliverable = data.get('deliverable', {}) or {}
results.append({
'agent': agent,
'runId': data.get('runId', ''),
'result_preview': result_preview,
'deliverable_summary': deliverable.get('summary', 'none'),
'confidence': data.get('confidence', 'unknown'),
'notes': (data.get('notes', '') or '')[:200]
})
if len(results) >= 5:
break
except:
continue
print(json.dumps(results, indent=2))
")
if [ "$CONTEXT" = "[]" ]; then
echo "No recent completed work found for $TARGET"
exit 0
fi
# Save context for auditor
CONTEXT_FILE=$(mktemp /tmp/challenge-context-XXXX.json)
echo "$CONTEXT" > "$CONTEXT_FILE"
# Build the challenge task
if [ "$TARGET" = "all" ]; then
CHALLENGE_TASK="CHALLENGE MODE: Review the recent completed work from ALL agents.
Your task: $SCOPE
For each piece of work, apply your full audit mindset:
1. Challenge assumptions — what did they take for granted?
2. Check for missed alternatives — was this the best approach or just the first?
3. Validate reasoning — is the logic sound? Are there logical gaps?
4. Question confidence levels — is 'high confidence' justified?
5. Look for blind spots — what didn't they consider?
Be constructive but rigorous. Your goal is to make the team's work BETTER, not just find faults.
Produce a Challenge Report with findings per agent and overall recommendations."
else
CHALLENGE_TASK="CHALLENGE MODE: Review $TARGET's recent completed work.
Your task: $SCOPE
Apply your full audit mindset to $TARGET's output:
1. Challenge assumptions — what did they take for granted?
2. Check for missed alternatives — was this the best approach or just the first?
3. Validate reasoning — is the logic sound? Are there logical gaps?
4. Question confidence levels — is 'high confidence' justified?
5. Look for blind spots — what didn't they consider?
6. Suggest improvements — concrete, actionable next steps
Be constructive but rigorous. Your goal is to make $TARGET's work BETTER.
Produce a Challenge Report with specific findings and recommendations."
fi
# Delegate to auditor via orchestration
bash "$ORCHESTRATE" auditor "$CHALLENGE_TASK" \
--context "$CONTEXT_FILE" \
--timeout 300
rm -f "$CONTEXT_FILE"

View File

@@ -0,0 +1,101 @@
#!/usr/bin/env bash
# Check task board for tasks relevant to this agent
# Usage: bash check-taskboard.sh <agent-name>
# Returns: summary of pending/blocked tasks for this agent, or "nothing" if clear
set -euo pipefail
AGENT="${1:?Usage: check-taskboard.sh <agent-name>}"
HANDOFF_DIR="/home/papa/atomizer/handoffs"
SPRINT_FILE="/home/papa/atomizer/dashboard/sprint-mode.json"
# Check sprint mode
if [ -f "$SPRINT_FILE" ]; then
SPRINT_ACTIVE=$(python3 -c "import json; print(json.load(open('$SPRINT_FILE')).get('active', False))")
if [ "$SPRINT_ACTIVE" = "True" ]; then
echo "🏃 SPRINT MODE ACTIVE"
fi
fi
# Scan handoffs for this agent's tasks that aren't complete
PENDING=$(python3 -c "
import json, glob, sys
from datetime import datetime
agent = '$AGENT'
handoffs = sorted(glob.glob('$HANDOFF_DIR/orch-*.json'), reverse=True)
pending = []
for path in handoffs[:100]:
try:
with open(path) as f:
data = json.load(f)
if data.get('agent') != agent:
continue
status = data.get('status', '').lower()
if status in ('complete', 'done'):
continue
result_preview = (data.get('result', '') or '')[:80].replace('\n', ' ')
pending.append(f'{status}: {result_preview}')
except:
continue
if not pending:
print('nothing')
else:
for p in pending[:5]:
print(f' - {p}')
")
echo "$PENDING"
# Also check if there are tasks assigned to OTHER agents that this agent could contribute to
# (cross-pollination like Bhanu's model)
CROSS=$(python3 -c "
import json, glob
agent = '$AGENT'
# Agent domain mapping for cross-pollination
DOMAINS = {
'webster': ['research', 'literature', 'material', 'CTE', 'properties'],
'auditor': ['review', 'validate', 'check', 'verify', 'audit'],
'tech-lead': ['architecture', 'design', 'approach', 'methodology'],
'optimizer': ['optimization', 'parameter', 'objective', 'convergence'],
'study-builder': ['script', 'code', 'run_optimization', 'python'],
'nx-expert': ['NX', 'Nastran', 'mesh', 'FEA', 'solver'],
'secretary': ['summary', 'report', 'status', 'update'],
'manager': [],
}
my_keywords = DOMAINS.get(agent, [])
if not my_keywords:
print('none')
exit()
handoffs = sorted(glob.glob('$HANDOFF_DIR/orch-*.json'), reverse=True)
relevant = []
for path in handoffs[:50]:
try:
with open(path) as f:
data = json.load(f)
if data.get('agent') == agent:
continue
status = data.get('status', '').lower()
if status in ('complete', 'done'):
continue
result = (data.get('result', '') or '').lower()
if any(kw.lower() in result for kw in my_keywords):
relevant.append(f'{data.get(\"agent\")}: {(data.get(\"result\",\"\") or \"\")[:60].replace(chr(10),\" \")}')
except:
continue
if not relevant:
print('none')
else:
for r in relevant[:3]:
print(f' - {r}')
")
if [ "$CROSS" != "none" ]; then
echo "📌 Cross-pollination opportunities:"
echo "$CROSS"
fi

View File

@@ -62,6 +62,7 @@ DELEGATION_ACL = {
# Required handoff fields for strict validation
REQUIRED_FIELDS = ["status", "result"]
STRICT_FIELDS = ["schemaVersion", "status", "result", "confidence", "timestamp"]
DELIVERABLE_TYPES = ["document", "code", "analysis", "recommendation", "review", "data"]
# ── Helpers ──────────────────────────────────────────────────────────────────
@@ -132,11 +133,17 @@ IMPORTANT: When you complete this task, write your response as a JSON file to:
Use this exact format:
```json
{{
"schemaVersion": "1.0",
"schemaVersion": "1.1",
"runId": "{run_id}",
"agent": "{agent}",
"status": "complete",
"result": "<your findings/output here>",
"deliverable": {{
"type": "<document|code|analysis|recommendation|review|data>",
"title": "<short title of what you produced>",
"path": "<path to artifact file, or null if result is self-contained>",
"summary": "<one-line summary of the deliverable>"
}},
"artifacts": [],
"confidence": "high|medium|low",
"notes": "<any caveats or open questions>",
@@ -145,6 +152,8 @@ Use this exact format:
```
Status values: complete | partial | blocked | failed
⚠️ The "deliverable" block is MANDATORY. Every task must produce a concrete deliverable.
If your result is self-contained in "result", set deliverable.path to null and deliverable.type to "analysis" or "recommendation".
Write the file BEFORE posting to Discord. The orchestrator is waiting for it."""
if context:
@@ -266,6 +275,18 @@ def validate_handoff(data: dict, strict: bool = False) -> tuple[bool, str]:
if status == "blocked":
return False, f"Agent blocked: {data.get('notes', 'no details')}"
# Deliverable enforcement (schema v1.1+)
if strict and status == "complete":
deliverable = data.get("deliverable")
if not deliverable or not isinstance(deliverable, dict):
return False, "Missing deliverable block — every completed task must include a deliverable"
if not deliverable.get("type"):
return False, "Deliverable missing 'type' field"
if deliverable["type"] not in DELIVERABLE_TYPES:
return False, f"Invalid deliverable type: '{deliverable['type']}' (valid: {', '.join(DELIVERABLE_TYPES)})"
if not deliverable.get("summary"):
return False, "Deliverable missing 'summary' field"
return True, ""
@@ -376,8 +397,10 @@ def main():
parser.add_argument("--run-id", type=str, default=None)
parser.add_argument("--retries", type=int, default=1,
help="Max attempts (default: 1, max: 3)")
parser.add_argument("--validate", action="store_true",
help="Strict validation of handoff fields")
parser.add_argument("--validate", action="store_true", default=True,
help="Strict validation of handoff fields (default: True since v1.1)")
parser.add_argument("--no-validate", action="store_false", dest="validate",
help="Disable strict validation")
parser.add_argument("--workflow-id", type=str, default=None,
help="Workflow run ID for tracing")
parser.add_argument("--step-id", type=str, default=None,

View File

@@ -0,0 +1,86 @@
#!/usr/bin/env bash
# Sprint Mode Control
# Usage:
# bash sprint-mode.sh start <agents> [duration_hours] [reason]
# bash sprint-mode.sh stop
# bash sprint-mode.sh status
set -euo pipefail
SPRINT_FILE="/home/papa/atomizer/dashboard/sprint-mode.json"
ACTION="${1:?Usage: sprint-mode.sh start|stop|status}"
case "$ACTION" in
start)
AGENTS="${2:?Specify agents: e.g. 'tech-lead,webster,auditor'}"
DURATION="${3:-2}" # hours, default 2
REASON="${4:-Sprint activated}"
python3 -c "
import json
from datetime import datetime, timedelta, timezone
agents = '$AGENTS'.split(',')
duration_h = float('$DURATION')
now = datetime.now(timezone.utc)
expires = now + timedelta(hours=duration_h)
data = {
'active': True,
'agents': [a.strip() for a in agents],
'frequency_minutes': 5,
'started_at': now.isoformat(),
'expires_at': expires.isoformat(),
'reason': '$REASON'
}
with open('$SPRINT_FILE', 'w') as f:
json.dump(data, f, indent=2)
print(f'🏃 Sprint started: {len(agents)} agents, expires {expires.strftime(\"%H:%M UTC\")}')
for a in agents:
print(f' - {a}')
"
;;
stop)
python3 -c "
import json
data = {
'active': False,
'agents': [],
'frequency_minutes': 5,
'started_at': None,
'expires_at': None,
'reason': None
}
with open('$SPRINT_FILE', 'w') as f:
json.dump(data, f, indent=2)
print('⏹️ Sprint stopped')
"
;;
status)
python3 -c "
import json
from datetime import datetime, timezone
with open('$SPRINT_FILE') as f:
data = json.load(f)
if not data.get('active'):
print('No active sprint')
else:
agents = ', '.join(data.get('agents', []))
expires = data.get('expires_at', 'unknown')
reason = data.get('reason', '')
now = datetime.now(timezone.utc)
exp = datetime.fromisoformat(expires)
remaining = max(0, (exp - now).total_seconds() / 60)
print(f'🏃 Sprint active: {agents}')
print(f' Reason: {reason}')
print(f' Remaining: {remaining:.0f} minutes')
"
;;
*)
echo "Usage: sprint-mode.sh start|stop|status"
exit 1
;;
esac