feat: add lib script validation at run initialization

This commit is contained in:
2026-04-04 08:36:46 +02:00
parent d9ec148bb3
commit 008315b0c4

View File

@@ -63,6 +63,45 @@ After emitting `run.start`, record `SEQ_RUN_START=1`.
If `--start-from` is specified, verify that the required prior artifacts exist in `.archeflow/artifacts/${RUN_ID}/` before skipping phases. If missing, abort with an error. If `--start-from` is specified, verify that the required prior artifacts exist in `.archeflow/artifacts/${RUN_ID}/` before skipping phases. If missing, abort with an error.
#### 0a. Lib Script Validation
Verify that all required library scripts exist and are executable before proceeding. Fail fast if any dependency is missing.
```bash
# Required lib scripts
REQUIRED_LIBS=(
"archeflow-event.sh"
"archeflow-memory.sh"
"archeflow-git.sh"
"archeflow-rollback.sh"
"archeflow-report.sh"
"archeflow-progress.sh"
)
MISSING=()
for lib in "${REQUIRED_LIBS[@]}"; do
if [[ ! -x "./lib/$lib" ]]; then
MISSING+=("$lib")
fi
done
if [[ ${#MISSING[@]} -gt 0 ]]; then
echo "ERROR: Missing or non-executable lib scripts:" >&2
for m in "${MISSING[@]}"; do
echo " - lib/$m" >&2
done
echo "Ensure ArcheFlow is installed correctly. See README for setup." >&2
exit 1
fi
# Check jq availability (required for event processing and memory)
if ! command -v jq &>/dev/null; then
echo "ERROR: jq is required but not found in PATH." >&2
echo "Install with: apt install jq / brew install jq" >&2
exit 1
fi
```
#### 0b. Memory Injection #### 0b. Memory Injection
Load cross-run memory lessons and inject into agent prompts. Use `--audit` to track which lessons were injected for this run: Load cross-run memory lessons and inject into agent prompts. Use `--audit` to track which lessons were injected for this run: