Files
stack/scripts/run-task.sh
jason.woltje db330c12c7 feat(release): self-determination - ensure at launch, drift warnings, M20 packages/* decision (#38)
- release.sh ensure: aligned no-op; drift -> package-if-needed + health-gated
  activate (M3 gate-then-flip, automated)
- ensure_release_aligned in common.sh: invoked by hello/verify/agent;
  MOSAIC_ENSURE_SKIP guards recursion; run-task warns on drift without
  auto-aligning (workers/suites never trigger builds or model gates)
- ROADMAP: M20 decision recorded - v2 adopts packages/* monorepo at usurpation
- BUILD-LOG Phase 20 + tool-race process note

Live-verified: post-reset pointer loss auto-restored via health-gated
ensure; drift warning fires on desired-version bump; idempotent no-op on
aligned state.

Closes #38
2026-09-03 14:42:09 -05:00

29 lines
1.3 KiB
Bash
Executable File

#!/usr/bin/env bash
# Run a mission/task file through the config-driven container path.
#
# Usage: scripts/run-task.sh run <task.json> (also: validate <task.json>, list)
#
# Ensures the configuration is valid and the data root carries the
# ownership marker before any task executes.
set -euo pipefail
cd "$(dirname "$0")/.."
# shellcheck source=common.sh
source scripts/common.sh
load_config
load_release # compose requires MOSAIC_IMAGE_TAG; task runs are release-scoped too
bootstrap_runtime_dir
# Workers never auto-align releases (no builds or model gates mid-automation);
# drift is reported so the operator or a human-facing launcher can align.
if [ -f "$MOSAIC_DEV_DIR/state/active.json" ]; then
ACTIVE_REL="$(node -e 'try{const p=JSON.parse(require("fs").readFileSync(process.argv[1],"utf8"));process.stdout.write(p.release||"")}catch{}' "$MOSAIC_DEV_DIR/state/active.json")"
[ "$ACTIVE_REL" = "$MOSAIC_RELEASE" ] || echo "run-task: note: release drift (active: ${ACTIVE_REL:-none}, desired: $MOSAIC_RELEASE) - run scripts/release.sh ensure to align" >&2
fi
if [ ! -f "$MOSAIC_DEV_DIR/user/USER.md" ]; then
echo "run-task: note: user profile not onboarded - continuing without user context (scripts/onboard.sh)" >&2
fi
exec node scripts/mosaic-task.mjs "$@"