ktg-plugin-marketplace/plugins/ms-ai-architect/tests/capture-fixture.sh
Kjell Tore Guttormsen 6a7632146e feat(ms-ai-architect): add plugin to open marketplace (v1.5.0 baseline)
Initial addition of ms-ai-architect plugin to the open-source marketplace.
Private content excluded: orchestrator/ (Linear tooling), docs/utredning/
(client investigation), generated test reports and PDF export script.
skill-gen tooling moved from orchestrator/ to scripts/skill-gen/.

Security scan: WARNING (risk 20/100) — no secrets, no injection found.
False positive fixed: added gitleaks:allow to Python variable reference
in output-validation-grounding-verification.md line 109.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 17:17:17 +02:00

41 lines
1.1 KiB
Bash
Executable file

#!/bin/bash
# capture-fixture.sh — Extract agent output fixture from a document
# Usage: bash tests/capture-fixture.sh <source-file> <section-header> <output-dir>
#
# Example:
# bash tests/capture-fixture.sh docs/utredning/.../utredning.md "S5: Sikkerhetsvurdering" tests/fixtures/security-assessment/
set -euo pipefail
if [ $# -lt 3 ]; then
echo "Usage: $0 <source-file> <section-header> <output-dir>"
echo ""
echo "Extracts a section from source file and saves as fixture.md"
echo ""
echo "Example:"
echo " $0 docs/utredning/file.md 'S5: Sikkerhetsvurdering' tests/fixtures/security-assessment/"
exit 1
fi
SOURCE="$1"
HEADER="$2"
OUTPUT_DIR="$3"
if [ ! -f "$SOURCE" ]; then
echo "Error: Source file not found: $SOURCE"
exit 1
fi
mkdir -p "$OUTPUT_DIR"
# Extract section from ## header to next ## header (or EOF)
awk -v header="$HEADER" '
BEGIN { found=0 }
/^## / {
if (found) exit
if (index($0, header)) found=1
}
found { print }
' "$SOURCE" > "$OUTPUT_DIR/fixture.md"
LINES=$(wc -l < "$OUTPUT_DIR/fixture.md" | tr -d ' ')
echo "Captured $LINES lines to $OUTPUT_DIR/fixture.md"