- task schema: optional workspace (absent | :run ephemeral | named persistent under dataRoot/workspaces) and capabilities.tools (pi documented tool allowlist); strict validation, traversal-proof names - runner: creates host workspace, passes MOSAIC_WORKSPACE (container path) + MOSAIC_TOOLS; result.json records both - pi adapter: cds into workspace; --tools when allowlist present else --no-tools - mock adapter: logs delivered MOSAIC_* vars to stderr as deterministic plumbing evidence (dash prints 'export K=v', so use env not export) Closes #20
17 lines
836 B
Bash
17 lines
836 B
Bash
#!/bin/sh
|
|
# Mock adapter: deterministic response for seam tests. NEVER use where a
|
|
# real model response is required.
|
|
#
|
|
# Contract: see /opt/mosaic/adapters/README.md.
|
|
set -eu
|
|
|
|
[ -n "${MOSAIC_SYSTEM_PROMPT_FILE:-}" ] || { echo "mock adapter: MOSAIC_SYSTEM_PROMPT_FILE is required" >&2; exit 2; }
|
|
[ -n "${MOSAIC_REQUEST:-}" ] || { echo "mock adapter: MOSAIC_REQUEST is required" >&2; exit 2; }
|
|
[ -r "$MOSAIC_SYSTEM_PROMPT_FILE" ] || { echo "mock adapter: system prompt not readable: $MOSAIC_SYSTEM_PROMPT_FILE" >&2; exit 2; }
|
|
|
|
echo "mock adapter: responding verbatim from MOSAIC_MOCK_RESPONSE" >&2
|
|
# Deterministic plumbing evidence: which MOSAIC_* variables did the
|
|
# orchestrator actually deliver? (Auth secrets are not MOSAIC_-prefixed.)
|
|
(env | grep '^MOSAIC_' | sort) >&2 2>/dev/null || true
|
|
printf '%s\n' "${MOSAIC_MOCK_RESPONSE:-}"
|