release: guided install, update skill, onboarding in three languages
This commit is contained in:
@@ -45,6 +45,11 @@ agents:
|
||||
input: eval records
|
||||
output: improvement candidates
|
||||
tools: [registry, drift-check]
|
||||
- id: rescue-runner
|
||||
role: one-shot rescue adapter
|
||||
input: handoff pack (no secrets)
|
||||
output: outbox artifacts (rescue attempt)
|
||||
tools: [claude-adapter, codex-adapter]
|
||||
|
||||
# Allowed transitions. Every edge MUST carry a `when`.
|
||||
handoffs:
|
||||
|
||||
@@ -50,7 +50,8 @@ states:
|
||||
|
||||
terminal_states: [Archived, Failed]
|
||||
|
||||
# Invariants — enforced by gates, not just convention.
|
||||
# Invariants — enforcement: declarative (structural contract, not runtime guard).
|
||||
# agent-contract.sh verifies these keys exist; runtime enforcement requires ledger checks (future work).
|
||||
invariants:
|
||||
- id: retry-once
|
||||
rule: Retry is allowed at most once per job_id. A second failure goes to Failed (terminal).
|
||||
|
||||
@@ -17,8 +17,9 @@ function arg(name, fallback = '') {
|
||||
function flag(name) { return argv.includes(`--${name}`) }
|
||||
|
||||
const HOME = process.env.HOME || ''
|
||||
const safe = (p, name) => { if (p.includes('..')) throw new Error(`${name}: path traversal not allowed`); return p }
|
||||
const REPORTS = path.resolve(
|
||||
arg('reports', process.env.ATHENA_REPORTS || path.join(HOME, '.agents', 'reports'))
|
||||
safe(arg('reports', process.env.ATHENA_REPORTS || path.join(HOME, '.agents', 'reports')), '--reports')
|
||||
)
|
||||
const RUN_ID = arg('run-id', process.env.ATHENA_RUN_ID || new Date().toISOString().slice(0, 10))
|
||||
const TITLE = arg('title', 'Athena post-run report')
|
||||
@@ -46,7 +47,7 @@ async function loadResults() {
|
||||
: Array.isArray(raw.processResults) ? raw.processResults
|
||||
: []
|
||||
const byGroup = new Map()
|
||||
for (const row of rows) byGroup.set(row.group_id ?? String(Math.random()), row)
|
||||
for (let i = 0; i < rows.length; i++) byGroup.set(rows[i].group_id ?? String(i), rows[i])
|
||||
return [...byGroup.values()]
|
||||
}
|
||||
|
||||
|
||||
@@ -16,9 +16,10 @@ function arg(name, fallback = '') {
|
||||
|
||||
const HOME = process.env.HOME || ''
|
||||
const ROOT = process.env.ATHENA_ROOT || path.resolve(process.cwd())
|
||||
const REPORT = arg('report', '')
|
||||
const safe = (p, name) => { if (p && p.includes('..')) throw new Error(`${name}: path traversal not allowed`); return p }
|
||||
const REPORT = safe(arg('report', ''), '--report')
|
||||
const REPORTS_DIR = path.resolve(
|
||||
arg('reports', process.env.ATHENA_REPORTS || path.join(HOME, '.agents', 'reports'))
|
||||
safe(arg('reports', process.env.ATHENA_REPORTS || path.join(HOME, '.agents', 'reports')), '--reports')
|
||||
)
|
||||
|
||||
// Rule 1: raw OCR / media file artifacts
|
||||
|
||||
@@ -14,10 +14,11 @@ function arg(name, fallback = '') {
|
||||
const flag = name => argv.includes(`--${name}`)
|
||||
|
||||
const HOME = process.env.HOME || ''
|
||||
const EVALS_PATH = arg('evals', path.join(HOME, '.agents', 'routing-evals.jsonl'))
|
||||
const LEDGER_PATH = arg('ledger', path.join(HOME, '.agents', 'job-ledger.jsonl'))
|
||||
const REPORTS_DIR = arg('reports', path.join(HOME, '.agents', 'reports'))
|
||||
const STEWARD_PATH = arg('steward', path.join(HOME, '.agents', 'steward-log.jsonl'))
|
||||
const safe = (p, name) => { if (p.includes('..')) throw new Error(`${name}: path traversal not allowed`); return p }
|
||||
const EVALS_PATH = safe(arg('evals', path.join(HOME, '.agents', 'routing-evals.jsonl')), '--evals')
|
||||
const LEDGER_PATH = safe(arg('ledger', path.join(HOME, '.agents', 'job-ledger.jsonl')), '--ledger')
|
||||
const REPORTS_DIR = safe(arg('reports', path.join(HOME, '.agents', 'reports')), '--reports')
|
||||
const STEWARD_PATH = safe(arg('steward', path.join(HOME, '.agents', 'steward-log.jsonl')), '--steward')
|
||||
const DAYS = parseInt(arg('days', '7'), 10)
|
||||
|
||||
async function readJsonl(filePath) {
|
||||
|
||||
@@ -16,10 +16,11 @@ function arg(name, fallback = '') {
|
||||
const flag = name => argv.includes(`--${name}`)
|
||||
|
||||
const HOME = process.env.HOME || ''
|
||||
const EVALS_PATH = arg('evals', process.env.ATHENA_EVALS ||
|
||||
path.join(HOME, '.agents', 'routing-evals.jsonl'))
|
||||
const REPORTS = path.resolve(arg('reports', process.env.ATHENA_REPORTS ||
|
||||
path.join(HOME, '.agents', 'reports')))
|
||||
const safe = (p, name) => { if (p.includes('..')) throw new Error(`${name}: path traversal not allowed`); return p }
|
||||
const EVALS_PATH = safe(arg('evals', process.env.ATHENA_EVALS ||
|
||||
path.join(HOME, '.agents', 'routing-evals.jsonl')), '--evals')
|
||||
const REPORTS = path.resolve(safe(arg('reports', process.env.ATHENA_REPORTS ||
|
||||
path.join(HOME, '.agents', 'reports')), '--reports'))
|
||||
const FORMAT = arg('format', 'md')
|
||||
const DAYS = parseInt(arg('days', '7'), 10)
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
# rescue-runner — Role Passport
|
||||
|
||||
**Soul:** One-shot emergency adapter. Invoked only when athena-runner gets stuck. Single attempt — if it fails, job goes to Failed (terminal) for human review.
|
||||
|
||||
**Does:** Receives the handoff pack from a stuck athena-runner. Re-submits to the alternate provider (if primary=claude, rescue tries codex; if primary=codex, rescue tries claude). Produces outbox artifacts identical in structure to a normal runner output.
|
||||
|
||||
**Tools:** [claude-adapter, codex-adapter]
|
||||
|
||||
**Model:** Inherits from run envelope (opposite of primary).
|
||||
|
||||
**Contract:**
|
||||
- Receives: handoff pack (no secrets, no vault paths)
|
||||
- Emits: outbox artifacts → athena-reviewer
|
||||
- NEVER writes to vault directly
|
||||
- NEVER calls itself recursively (forbidden: rescue-runner → rescue-runner)
|
||||
- One attempt only; second failure → Failed terminal state
|
||||
|
||||
**Won't:**
|
||||
- Re-route or spawn sub-jobs
|
||||
- Access ~/.secrets or any secret path
|
||||
- Modify the job ledger directly (ledger writes = athena-librarian only)
|
||||
|
||||
**Parity:** Engine-agnostic. Same contract on Claude Code and Codex. Only the provider adapter flips.
|
||||
@@ -12,10 +12,11 @@ set -uo pipefail
|
||||
INPUT="$(cat 2>/dev/null || true)"
|
||||
[ -z "$INPUT" ] && exit 0
|
||||
|
||||
# command из tool_input без jq (первое совпадение). Многострочный JSON → tr к одной строке.
|
||||
cmd="$(printf '%s' "$INPUT" | tr '\n' ' ' | sed -n 's/.*"command"[[:space:]]*:[[:space:]]*"\(.*\)/\1/p')"
|
||||
# срезать хвост после закрывающей кавычки значения (грубо, но command обычно последнее поле)
|
||||
cmd="${cmd%\"*}"
|
||||
# command из tool_input через python3 (корректный JSON-парсинг, нет greedy-regex артефактов).
|
||||
# python3 доступен после preinstall.sh (brew). Фолбэк → cmd="" → exit 0 (hook не блокирует).
|
||||
cmd="$(printf '%s' "$INPUT" | python3 -c \
|
||||
'import json,sys; d=json.load(sys.stdin); print(d.get("tool_input",{}).get("command",""),end="")' \
|
||||
2>/dev/null || true)"
|
||||
[ -z "$cmd" ] && exit 0
|
||||
|
||||
deny() {
|
||||
|
||||
Executable → Regular
Executable → Regular
Executable → Regular
+4
-2
@@ -10,8 +10,10 @@ set -uo pipefail
|
||||
INPUT="$(cat 2>/dev/null || true)"
|
||||
[ -z "$INPUT" ] && exit 0
|
||||
|
||||
# file_path из tool_input без jq (берём первое совпадение)
|
||||
fp="$(printf '%s' "$INPUT" | sed -n 's/.*"file_path"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' | head -1)"
|
||||
# file_path из tool_input через python3 (корректный JSON-парсинг, поддержка unicode-путей).
|
||||
fp="$(printf '%s' "$INPUT" | python3 -c \
|
||||
'import json,sys; d=json.load(sys.stdin); print(d.get("tool_input",{}).get("file_path",""),end="")' \
|
||||
2>/dev/null || true)"
|
||||
[ -z "$fp" ] && exit 0
|
||||
|
||||
base="$(basename "$fp")"
|
||||
|
||||
Executable → Regular
Executable → Regular
Executable → Regular
Reference in New Issue
Block a user