SPB Git

spb/khaelor Public

KHAELOR — a terminal-native autonomous engineering agent powered by Anthropic.

TypeScript 82.9% HTML 14.9% CSS 1.1% JavaScript 0.7%
1.5 KB · 54 lines shellscript
Raw Blame History
1#!/usr/bin/env bash2# KHAELOR3# File: scripts/check-headers.sh4# Description: Enforce Absolute Rule #0 — every first-party source file must carry the author header.5#6# Author: Simon-Pierre Boucher7# Contact: contact@spboucher.ai89set -euo pipefail1011ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"12cd "$ROOT"1314AUTHOR="Simon-Pierre Boucher"15CONTACT="contact@spboucher.ai"1617fail=018checked=01920# First-party source files: src/, scripts/, and deliverable docs (docs/**/*.md).21# Exemptions: references/ (third-party), node_modules/, pure data files (.json, lockfiles).22files=$(find src scripts docs -type f \23  \( -name '*.ts' -o -name '*.tsx' -o -name '*.js' -o -name '*.mjs' -o -name '*.cjs' \24     -o -name '*.sh' -o -name '*.rs' -o -name '*.md' -o -name '*.yaml' -o -name '*.yml' \25     -o -name '*.toml' -o -name '*.jsonc' \) \26  2>/dev/null | grep -v -E '(^|/)(node_modules|references|dist|build)/' || true)2728for f in $files; do29  checked=$((checked + 1))30  head_block=$(head -n 12 "$f")31  if ! grep -q "KHAELOR" <<<"$head_block"; then32    echo "MISSING HEADER (no KHAELOR marker): $f"33    fail=134    continue35  fi36  if ! grep -q "$AUTHOR" <<<"$head_block"; then37    echo "MISSING HEADER (no author line): $f"38    fail=139    continue40  fi41  if ! grep -q "$CONTACT" <<<"$head_block"; then42    echo "MISSING HEADER (no contact line): $f"43    fail=144    continue45  fi46done4748if [ "$fail" -ne 0 ]; then49  echo "check-headers: FAILED"50  exit 151fi5253echo "check-headers: OK ($checked files checked)"54