diff --git a/adapters/lib.sh b/adapters/lib.sh index 1e656ba..b1ef850 100755 --- a/adapters/lib.sh +++ b/adapters/lib.sh @@ -85,6 +85,12 @@ should_include() { # parse_hook_yaml # Emits key=value lines for each top-level scalar AND for trigger fields. # Output keys: name, script, event, match-tool (space-separated tokens), exclude. +# +# NOTE: This flattens all triggers into a single stream. When a hook has +# multiple triggers, the association between event and match-tool is lost. +# Currently all hooks use a single trigger, so this is not an issue in +# practice. If multi-trigger hooks are needed, this output format must be +# changed to emit delimited records (one per trigger). parse_hook_yaml() { local file="$1" awk ' diff --git a/adapters/opencode/config-merge.sh b/adapters/opencode/config-merge.sh index 5fea933..57361c3 100755 --- a/adapters/opencode/config-merge.sh +++ b/adapters/opencode/config-merge.sh @@ -3,8 +3,9 @@ # adapters/opencode/config-merge.sh — JSON config merge for opencode.json # ============================================================================= # Merges a built opencode.json with an existing one in the vault, preserving -# user keys and formatting. Only the "mcp" key is managed; everything else -# belongs to the user. +# user keys and indentation style (2-space, 4-space, or tab). Only the "mcp" +# key is managed; everything else belongs to the user. Note: jq normalizes +# whitespace and may reorder keys within objects. # # Sourced by the opencode adapter. Requires jq. # ============================================================================= diff --git a/tests/regression/take-snapshot.sh b/tests/regression/take-snapshot.sh index f093c9e..8514eef 100755 --- a/tests/regression/take-snapshot.sh +++ b/tests/regression/take-snapshot.sh @@ -15,7 +15,13 @@ DIST_DIR="$REPO_DIR/dist/claude-code" # Replace snapshot with current build output rm -rf "$SNAPSHOT_DIR" mkdir -p "$SNAPSHOT_DIR" -cp -r "$DIST_DIR"/* "$DIST_DIR"/.claude "$DIST_DIR"/.mcp.json "$SNAPSHOT_DIR/" 2>/dev/null || true + +# Required artifacts — fail loudly if missing +cp -r "$DIST_DIR/.claude" "$SNAPSHOT_DIR/.claude" +cp "$DIST_DIR/CLAUDE.md" "$SNAPSHOT_DIR/CLAUDE.md" + +# Optional artifacts — copy if present +[[ -f "$DIST_DIR/.mcp.json" ]] && cp "$DIST_DIR/.mcp.json" "$SNAPSHOT_DIR/.mcp.json" # Remove non-deterministic / install-only artifacts rm -f "$SNAPSHOT_DIR/.claude/.mbifc-manifest"