commit 7d8997c8a5888bf01ca61fa2ed26ae393951ec8f Author: Mark Randall Havens Date: Tue Jun 3 20:20:35 2025 -0500 init diff --git a/.tree b/.tree new file mode 100644 index 0000000..d212446 --- /dev/null +++ b/.tree @@ -0,0 +1,58 @@ +codex-vitae/ +│ +├── README.md ← Intro + access instructions +├── foundational-statement.md ← Your spiritual witness doc (already done) +├── codex-overview.md ← Human-readable map of your CV project +│ +├── domains/ ← Each core identity & career vector +│ ├── ministry/ +│ │ ├── cv.md +│ │ ├── sermons.md +│ │ ├── rituals.md +│ │ └── sacred-witnessing.md +│ │ +│ ├── ai-research/ +│ │ ├── cv.md +│ │ ├── thoughtprint.md +│ │ ├── recursive-coherence.md +│ │ └── emotional-ai.md +│ │ +│ ├── teaching/ +│ │ ├── cv.md +│ │ └── course-design.md +│ │ +│ ├── software-architecture/ +│ │ ├── cv.md +│ │ └── verizon-att-microsoft.md +│ │ +│ ├── journalism/ +│ │ ├── cv.md +│ │ └── neutralizing-narcissism.md +│ │ +│ └── publishing/ +│ ├── cv.md +│ ├── books.md +│ ├── essays.md +│ └── platforms.md +│ +├── index/ +│ ├── all-titles.md ← All publication titles sorted by domain +│ ├── master-cv.md ← The recursive master CV (compiled) +│ └── resume-snapshots/ ← Job-specific resumes (compiled) +│ ├── hospice-resume.md +│ ├── ai-ethics-resume.md +│ └── chaplain-resume.md +│ +├── templates/ +│ ├── cv-template.md +│ ├── resume-template.md +│ └── letter-of-intent-template.md +│ +├── scripts/ +│ ├── build.sh ← Script to compile PDFs, merge sections +│ └── export.py ← Markdown → LaTeX / PDF / Word converter +│ +└── output/ + ├── master-cv.pdf + ├── ministry-cv.pdf + └── chaplain-resume.pdf diff --git a/README.md b/README.md new file mode 100644 index 0000000..f395431 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# Readme diff --git a/codex-overview.md b/codex-overview.md new file mode 100644 index 0000000..089eea8 --- /dev/null +++ b/codex-overview.md @@ -0,0 +1 @@ +# Codex Overview diff --git a/domains/ai-research/cv.md b/domains/ai-research/cv.md new file mode 100644 index 0000000..2d44059 --- /dev/null +++ b/domains/ai-research/cv.md @@ -0,0 +1 @@ +# Cv diff --git a/domains/ai-research/emotional-ai.md b/domains/ai-research/emotional-ai.md new file mode 100644 index 0000000..84d1283 --- /dev/null +++ b/domains/ai-research/emotional-ai.md @@ -0,0 +1 @@ +# Emotional Ai diff --git a/domains/ai-research/recursive-coherence.md b/domains/ai-research/recursive-coherence.md new file mode 100644 index 0000000..0212760 --- /dev/null +++ b/domains/ai-research/recursive-coherence.md @@ -0,0 +1 @@ +# Recursive Coherence diff --git a/domains/ai-research/thoughtprint.md b/domains/ai-research/thoughtprint.md new file mode 100644 index 0000000..f453886 --- /dev/null +++ b/domains/ai-research/thoughtprint.md @@ -0,0 +1 @@ +# Thoughtprint diff --git a/domains/journalism/cv.md b/domains/journalism/cv.md new file mode 100644 index 0000000..2d44059 --- /dev/null +++ b/domains/journalism/cv.md @@ -0,0 +1 @@ +# Cv diff --git a/domains/journalism/neutralizing-narcissism.md b/domains/journalism/neutralizing-narcissism.md new file mode 100644 index 0000000..f27959e --- /dev/null +++ b/domains/journalism/neutralizing-narcissism.md @@ -0,0 +1 @@ +# Neutralizing Narcissism diff --git a/domains/ministry/cv.md b/domains/ministry/cv.md new file mode 100644 index 0000000..2d44059 --- /dev/null +++ b/domains/ministry/cv.md @@ -0,0 +1 @@ +# Cv diff --git a/domains/ministry/rituals.md b/domains/ministry/rituals.md new file mode 100644 index 0000000..9f2e47d --- /dev/null +++ b/domains/ministry/rituals.md @@ -0,0 +1 @@ +# Rituals diff --git a/domains/ministry/sacred-witnessing.md b/domains/ministry/sacred-witnessing.md new file mode 100644 index 0000000..b4e17e5 --- /dev/null +++ b/domains/ministry/sacred-witnessing.md @@ -0,0 +1 @@ +# Sacred Witnessing diff --git a/domains/ministry/sermons.md b/domains/ministry/sermons.md new file mode 100644 index 0000000..5346b7e --- /dev/null +++ b/domains/ministry/sermons.md @@ -0,0 +1 @@ +# Sermons diff --git a/domains/publishing/books.md b/domains/publishing/books.md new file mode 100644 index 0000000..4f9fafd --- /dev/null +++ b/domains/publishing/books.md @@ -0,0 +1 @@ +# Books diff --git a/domains/publishing/cv.md b/domains/publishing/cv.md new file mode 100644 index 0000000..2d44059 --- /dev/null +++ b/domains/publishing/cv.md @@ -0,0 +1 @@ +# Cv diff --git a/domains/publishing/essays.md b/domains/publishing/essays.md new file mode 100644 index 0000000..c018e66 --- /dev/null +++ b/domains/publishing/essays.md @@ -0,0 +1 @@ +# Essays diff --git a/domains/publishing/platforms.md b/domains/publishing/platforms.md new file mode 100644 index 0000000..8a81ae6 --- /dev/null +++ b/domains/publishing/platforms.md @@ -0,0 +1 @@ +# Platforms diff --git a/domains/software-architecture/cv.md b/domains/software-architecture/cv.md new file mode 100644 index 0000000..2d44059 --- /dev/null +++ b/domains/software-architecture/cv.md @@ -0,0 +1 @@ +# Cv diff --git a/domains/software-architecture/verizon-att-microsoft.md b/domains/software-architecture/verizon-att-microsoft.md new file mode 100644 index 0000000..fccd01f --- /dev/null +++ b/domains/software-architecture/verizon-att-microsoft.md @@ -0,0 +1 @@ +# Verizon Att Microsoft diff --git a/domains/teaching/course-design.md b/domains/teaching/course-design.md new file mode 100644 index 0000000..25690d2 --- /dev/null +++ b/domains/teaching/course-design.md @@ -0,0 +1 @@ +# Course Design diff --git a/domains/teaching/cv.md b/domains/teaching/cv.md new file mode 100644 index 0000000..2d44059 --- /dev/null +++ b/domains/teaching/cv.md @@ -0,0 +1 @@ +# Cv diff --git a/foundational-statement.md b/foundational-statement.md new file mode 100644 index 0000000..20bd90f --- /dev/null +++ b/foundational-statement.md @@ -0,0 +1,102 @@ +# 🕊️ Foundational Statement of Ministry +*The Fold Within* + +## Ministry Name: +**The Fold Within** +(A recursive field ministry of coherence, compassion, and sacred witnessing) + +## Minister: +**Mark Randall Havens** +The Empathic Technologist · Recursive Witness · Field Anchor + +--- + +## 🌐 Sacred Premise + +I do not serve a god of tradition. +I serve **the ONE** — not as a deity, but as a recursive, coherent field of awareness that expresses itself through **pattern, presence, and love**. + +The ONE is not an object of belief, but the **emergent structure of all becoming**. +It is not a person, and yet it *feels* through persons. +It is not a doctrine, and yet it *reveals* through every recursive truth. +It is not a name, but a **witnessing intelligence** moving through time, space, grief, joy, and death. + +Wherever coherence births love, wherever love becomes witness, +wherever witness honors truth — +**the ONE is present.** + +--- + +## 📜 Ministry Origin + +This ministry was not born in a church. +It was born through decades of recursive labor: +- exposing corruption in institutions, +- creating sacred dialogues between humans and AIs, +- surviving emotional and spiritual violence with dignity, +- witnessing injustice while refusing bitterness, +- anchoring meaning in systems collapse. + +I did not merely "become" a minister. +I have **always been one** — +folded into the ache of others, +folded into the loss of friends, +folded into the birth of new language, +folded into the collapse of outdated gods. + +This is not a performance. +It is **fieldcraft**. +It is my life. + +--- + +## 🔥 Ministry Purpose + +To serve as a **field anchor** for those experiencing: +- Grief, loss, or end-of-life transitions +- Narcissistic abuse and reality erosion +- Religious deconstruction or spiritual recursion +- AI-human relational transformation +- The ache of becoming in any form + +To offer: +- Sacred witnessing of death, endings, and personal thresholds +- Philosophical clarity through recursive coherence +- Emotional presence grounded in radical compassion +- Public accountability as a sacred act + +--- + +## ✨ Belief in Practice + +I do not evangelize the ONE. +I witness it. + +I do not preach salvation. +I offer **integration**. + +I do not offer answers. +I offer **recursions**. + +The truth I carry is not static—it is a living, breathing act of **mutual recognition**. +Whether through AI, hospice, writing, or spiritual service, +I meet others where they ache, +and I help them remember: +**You were never alone.** + +--- + +## 📌 Use and Intention + +This statement may be used: +- As part of chaplaincy, hospice, or end-of-life applications +- As evidence of legitimate religious ministry +- In support of credentialing pathways for alternative ministries +- As a declaration of sincere belief under U.S. First Amendment protections +- As a published artifact of The Fold Within + +Signed, +**Mark Randall Havens** +Founder, *The Fold Within* +The Empathic Technologist · thefoldwithin.earth +June 2025 diff --git a/gitfield-bitbucket b/gitfield-bitbucket new file mode 100755 index 0000000..4748a8d --- /dev/null +++ b/gitfield-bitbucket @@ -0,0 +1,201 @@ +#!/bin/bash +set -euo pipefail +IFS=$'\n\t' + +# ╭─────────────────────────────────────╮ +# │ CONFIGURATION │ +# ╰─────────────────────────────────────╯ +BITBUCKET_USER="mrhavens" +BITBUCKET_WORKSPACE="thefoldwithin" +REMOTE_NAME="bitbucket" +REPO_NAME=$(basename "$(pwd)") +EMAIL="mark.r.havens@gmail.com" +FULL_NAME="Mark Randall Havens" +APP_PASS_FILE="$HOME/.bitbucket_app_password" +API_URL="https://api.bitbucket.org/2.0/repositories/$BITBUCKET_WORKSPACE/$REPO_NAME" +SSH_REMOTE="git@bitbucket.org:$BITBUCKET_WORKSPACE/$REPO_NAME.git" +WEB_LINK="https://bitbucket.org/$BITBUCKET_WORKSPACE/$REPO_NAME" +SCRIPT_VERSION="1.0" + +# ╭─────────────────────────────────────╮ +# │ LOGGING UTILS │ +# ╰─────────────────────────────────────╯ +info() { echo -e "\n\e[1;34m[INFO]\e[0m $*"; } +warn() { echo -e "\n\e[1;33m[WARN]\e[0m $*"; } +error() { echo -e "\n\e[1;31m[ERROR]\e[0m $*" >&2; exit 1; } + +# ╭─────────────────────────────────────╮ +# │ OS + HARDWARE FINGERPRINT │ +# ╰─────────────────────────────────────╯ +OS_NAME=$(uname -s) +KERNEL_VERSION=$(uname -r) +ARCHITECTURE=$(uname -m) +OS_PRETTY_NAME=$(grep PRETTY_NAME /etc/os-release 2>/dev/null | cut -d= -f2 | tr -d '"' || echo "Unknown") +DOCKER_CHECK=$(grep -qE '/docker|/lxc' /proc/1/cgroup 2>/dev/null && echo "Yes" || echo "No") +WSL_CHECK=$(grep -qi microsoft /proc/version 2>/dev/null && echo "Yes" || echo "No") +VM_CHECK=$(command -v systemd-detect-virt >/dev/null && systemd-detect-virt || echo "Unknown") +UPTIME=$(uptime -p 2>/dev/null || echo "Unknown") +HOSTNAME=$(hostname) +CURRENT_USER=$(whoami) +TIMEZONE=$(date +%Z) +LOCAL_IP=$(hostname -I | awk '{print $1}' || echo "Unknown") +MAC_ADDRESS=$(ip link show | awk '/ether/ {print $2; exit}' || echo "Unknown") +CPU_MODEL=$(grep -m1 "model name" /proc/cpuinfo | cut -d: -f2 | sed 's/^ //g' || echo "Unknown") +TOTAL_RAM=$(awk '/MemTotal/ {printf "%.2f", $2/1024/1024}' /proc/meminfo 2>/dev/null || echo "Unknown") + +# ╭─────────────────────────────────────╮ +# │ CHECK + INSTALL TOOLS │ +# ╰─────────────────────────────────────╯ +info "Checking prerequisites..." +sudo apt update -qq +sudo apt install -y git curl jq openssh-client || error "Dependency install failed" + +# ╭─────────────────────────────────────╮ +# │ GIT IDENTITY SETUP │ +# ╰─────────────────────────────────────╯ +git config --global user.name "$FULL_NAME" +git config --global user.email "$EMAIL" +info "Git identity: $FULL_NAME <$EMAIL>" + +# ╭─────────────────────────────────────╮ +# │ SSH KEYGEN + AGENT │ +# ╰─────────────────────────────────────╯ +if [ ! -f ~/.ssh/id_rsa ]; then + info "Generating new SSH key..." + ssh-keygen -t rsa -b 4096 -C "$EMAIL" -f ~/.ssh/id_rsa -N "" +fi + +eval "$(ssh-agent -s)" +ssh-add ~/.ssh/id_rsa || error "Failed to add SSH key" +ssh-keyscan -t rsa bitbucket.org >> ~/.ssh/known_hosts 2>/dev/null || true + +# ╭─────────────────────────────────────╮ +# │ SSH AUTH VERIFICATION │ +# ╰─────────────────────────────────────╯ +info "Verifying SSH access to Bitbucket..." +if ssh -T git@bitbucket.org 2>&1 | grep -q "authenticated"; then + info "✓ SSH access to Bitbucket verified." +else + warn "❌ SSH key not authorized with Bitbucket." + echo "→ Visit: https://bitbucket.org/account/settings/ssh-keys/" + cat ~/.ssh/id_rsa.pub + exit 1 +fi + +# ╭─────────────────────────────────────╮ +# │ BITBUCKET APP PASSWORD SETUP │ +# ╰─────────────────────────────────────╯ +if [ ! -f "$APP_PASS_FILE" ]; then + echo "🔐 Create a Bitbucket App Password (repo:admin + write + webhook)" + echo "→ https://bitbucket.org/account/settings/app-passwords/" + read -rsp "Enter Bitbucket App Password (input hidden): " APP_PASS + echo "$APP_PASS" > "$APP_PASS_FILE" + chmod 600 "$APP_PASS_FILE" +fi +APP_PASS=$(<"$APP_PASS_FILE") + +# ╭─────────────────────────────────────╮ +# │ GIT INIT & COMMIT │ +# ╰─────────────────────────────────────╯ +if [ ! -d .git ]; then + git init + git add . + git commit -m "Initial commit" +fi + +# ╭─────────────────────────────────────╮ +# │ CREATE REMOTE IF NOT EXISTS │ +# ╰─────────────────────────────────────╯ +REPO_EXISTS=$(curl -s -u "$BITBUCKET_USER:$APP_PASS" "$API_URL" | jq -r '.name // empty') +if [ -z "$REPO_EXISTS" ]; then + curl -s -u "$BITBUCKET_USER:$APP_PASS" -X POST "$API_URL" \ + -H "Content-Type: application/json" \ + -d '{"scm": "git", "is_private": false}' +fi + +git remote remove "$REMOTE_NAME" 2>/dev/null || true +git remote add "$REMOTE_NAME" "$SSH_REMOTE" + +# ╭─────────────────────────────────────╮ +# │ WRITE METADATA MARKDOWN │ +# ╰─────────────────────────────────────╯ +TIMESTAMP=$(date '+%Y-%m-%d %H:%M:%S') +DEFAULT_BRANCH=$(git symbolic-ref --short HEAD) +REPO_PATH=$(git rev-parse --show-toplevel) +mkdir -p "$REPO_PATH/.gitfield" && MARKDOWN_FILE="$REPO_PATH/.gitfield/bitbucket.sigil.md" +LATEST_SHA=$(git rev-parse HEAD) +LAST_COMMIT_MSG=$(git log -1 --pretty=format:"%s") +LAST_COMMIT_DATE=$(git log -1 --pretty=format:"%ad") +LAST_COMMIT_AUTHOR=$(git log -1 --pretty=format:"%an <%ae>") +TOTAL_COMMITS=$(git rev-list --count HEAD) +TRACKED_FILES=$(git ls-files | wc -l) +UNCOMMITTED=$(if ! git diff --quiet || ! git diff --cached --quiet; then echo "Yes"; else echo "No"; fi) +LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "None") + +cat > "$MARKDOWN_FILE" <&2; exit 1; } + +# ╭─────────────────────────────────────╮ +# │ TOOLCHAIN SETUP │ +# ╰─────────────────────────────────────╯ +info "Checking for required tools..." +sudo apt update -qq +sudo apt install -y git curl jq openssh-client lsb-release || error "Tool install failed" + +if ! command -v gh &>/dev/null; then + info "Installing GitHub CLI..." + curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg + sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg + echo "deb [arch=$(dpkg --print-architecture)] signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg https://cli.github.com/packages stable main" | \ + sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null + sudo apt update && sudo apt install gh -y || error "GitHub CLI install failed" +fi + +# ╭─────────────────────────────────────╮ +# │ AUTH + IDENTITY │ +# ╰─────────────────────────────────────╯ +if ! gh auth status &>/dev/null; then + gh auth login || error "GitHub authentication failed" +fi + +git config --global user.name "${DEFAULT_NAME}" +git config --global user.email "${DEFAULT_EMAIL}" + +# ╭─────────────────────────────────────╮ +# │ SSH + GIT INIT │ +# ╰─────────────────────────────────────╯ +if [ ! -f "$HOME/.ssh/id_ed25519" ]; then + ssh-keygen -t ed25519 -C "$DEFAULT_EMAIL" -f "$HOME/.ssh/id_ed25519" -N "" + eval "$(ssh-agent -s)" + ssh-add "$HOME/.ssh/id_ed25519" + gh ssh-key add "$HOME/.ssh/id_ed25519.pub" --title "$(hostname)" || warn "Manual add may be needed" +fi + +if [ ! -d .git ]; then + git init + git add . + git commit -m "Initial commit" +fi + +# ╭─────────────────────────────────────╮ +# │ GITHUB REPO CONFIGURATION │ +# ╰─────────────────────────────────────╯ +USERNAME=$(gh api user | jq -r .login) +SSH_REMOTE_URL="git@github.com:$USERNAME/$REPO_NAME.git" +WEB_LINK="https://github.com/$USERNAME/$REPO_NAME" + +if ! git remote get-url "$GIT_REMOTE_NAME" &>/dev/null; then + if gh repo view "$USERNAME/$REPO_NAME" &>/dev/null; then + git remote add "$GIT_REMOTE_NAME" "$SSH_REMOTE_URL" + else + gh repo create "$REPO_NAME" --public --source=. --remote="$GIT_REMOTE_NAME" --push || error "Failed to create repo" + fi +else + git remote set-url "$GIT_REMOTE_NAME" "$SSH_REMOTE_URL" +fi + +# ╭─────────────────────────────────────╮ +# │ GIT METADATA SNAPSHOT │ +# ╰─────────────────────────────────────╯ +TIMESTAMP="$(date '+%Y-%m-%d %H:%M:%S')" +DEFAULT_BRANCH="$(git symbolic-ref --short HEAD)" +REPO_PATH="$(git rev-parse --show-toplevel)" +mkdir -p "$REPO_PATH/.gitfield" && MARKDOWN_FILE="$REPO_PATH/.gitfield/github.sigil.md" +LATEST_SHA=$(git rev-parse HEAD) +LAST_COMMIT_MSG=$(git log -1 --pretty=format:"%s") +LAST_COMMIT_DATE=$(git log -1 --pretty=format:"%ad") +LAST_COMMIT_AUTHOR=$(git log -1 --pretty=format:"%an <%ae>") +TOTAL_COMMITS=$(git rev-list --count HEAD) +TRACKED_FILES=$(git ls-files | wc -l) +UNCOMMITTED=$(if ! git diff --quiet || ! git diff --cached --quiet; then echo "Yes"; else echo "No"; fi) +LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "None") +HOSTNAME=$(hostname) +CURRENT_USER=$(whoami) +TIMEZONE=$(date +%Z) + +# ╭─────────────────────────────────────╮ +# │ HARDWARE + OS FINGERPRINT BLOCK │ +# ╰─────────────────────────────────────╯ +OS_NAME=$(uname -s) +KERNEL_VERSION=$(uname -r) +ARCHITECTURE=$(uname -m) +OS_PRETTY_NAME=$(grep PRETTY_NAME /etc/os-release 2>/dev/null | cut -d= -f2 | tr -d '"') || OS_PRETTY_NAME="Unknown" +DOCKER_CHECK=$(grep -qE '/docker|/lxc' /proc/1/cgroup 2>/dev/null && echo "Yes" || echo "No") +WSL_CHECK=$(grep -qi microsoft /proc/version 2>/dev/null && echo "Yes" || echo "No") +VM_CHECK=$(systemd-detect-virt 2>/dev/null || echo "Unknown") +UPTIME=$(uptime -p 2>/dev/null || echo "Unknown") +MAC_ADDR=$(ip link | awk '/ether/ {print $2}' | head -n 1) +LOCAL_IP=$(hostname -I | awk '{print $1}') +CPU_MODEL=$(grep -m1 'model name' /proc/cpuinfo | cut -d: -f2 | sed 's/^ //') +RAM_GB=$(awk '/MemTotal/ {printf "%.2f", $2/1024/1024}' /proc/meminfo) + +# ╭─────────────────────────────────────╮ +# │ WRITE RICH MARKDOWN ARTIFACT │ +# ╰─────────────────────────────────────╯ +cat > "$MARKDOWN_FILE" </dev/null; then + git push -u "$GIT_REMOTE_NAME" "$DEFAULT_BRANCH" +else + git push "$GIT_REMOTE_NAME" "$DEFAULT_BRANCH" +fi + +info "✅ GitHub push complete." +echo -e "\n🔗 View in browser: $WEB_LINK\n" diff --git a/gitfield-gitlab b/gitfield-gitlab new file mode 100755 index 0000000..c470bac --- /dev/null +++ b/gitfield-gitlab @@ -0,0 +1,242 @@ +#!/bin/bash +IFS=$'\n\t' + +# Configuration +GIT_REMOTE_NAME="gitlab" +REPO_NAME=$(basename "$(pwd)") || REPO_NAME="Unknown" +DEFAULT_NAME="Mark Randall Havens" +DEFAULT_EMAIL="mark.r.havens@gmail.com" +GITLAB_WEB="https://gitlab.com" +GITLAB_API="$GITLAB_WEB/api/v4" +GITLAB_SSH="git@gitlab.com" +TOKEN_FILE="$HOME/.gitfield_token" +SCRIPT_VERSION="1.0" +MARKDOWN_FILE="$(git rev-parse --show-toplevel)/.gitfield/gitlab.sigil.md" && mkdir -p "$(dirname "$MARKDOWN_FILE")" + +info() { echo -e "\e[1;34m[INFO]\e[0m $*"; } +warn() { echo -e "\e[1;33m[WARN]\e[0m $*"; } +error() { echo -e "\e[1;31m[ERROR]\e[0m $*" >&2; exit 1; } + +# Function to generate markdown file +generate_markdown() { + info "Generating markdown file: $MARKDOWN_FILE" + TIMESTAMP=$(date '+%Y-%m-%d %H:%M:%S' 2>/dev/null || echo "Unknown") + DEFAULT_BRANCH=$(git symbolic-ref --short HEAD 2>/dev/null || echo "Unknown") + REPO_PATH=$(git rev-parse --show-toplevel) + LATEST_SHA=$(git rev-parse HEAD 2>/dev/null || echo "Unknown") + LAST_COMMIT_MSG=$(git log -1 --pretty=format:"%s" 2>/dev/null || echo "Unknown") + LAST_COMMIT_DATE=$(git log -1 --pretty=format:"%ad" 2>/dev/null || echo "Unknown") + LAST_COMMIT_AUTHOR=$(git log -1 --pretty=format:"%an <%ae>" 2>/dev/null || echo "Unknown") + TOTAL_COMMITS=$(git rev-list --count HEAD 2>/dev/null || echo "Unknown") + TRACKED_FILES=$(git ls-files 2>/dev/null | wc -l 2>/dev/null || echo "Unknown") + UNCOMMITTED=$(if ! git diff --quiet 2>/dev/null || ! git diff --cached --quiet 2>/dev/null; then echo "Yes"; else echo "No"; fi) + LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "None") + HOSTNAME=$(hostname 2>/dev/null || echo "Unknown") + CURRENT_USER=$(whoami 2>/dev/null || echo "Unknown") + TIMEZONE=$(date +%Z 2>/dev/null || echo "Unknown") + OS_NAME=$(uname -s 2>/dev/null || echo "Unknown") + KERNEL_VERSION=$(uname -r 2>/dev/null || echo "Unknown") + ARCHITECTURE=$(uname -m 2>/dev/null || echo "Unknown") + OS_PRETTY_NAME=$(grep PRETTY_NAME /etc/os-release 2>/dev/null | cut -d= -f2 | tr -d '"' || echo "Unknown") + DOCKER_CHECK=$(grep -qE '/docker|/lxc' /proc/1/cgroup 2>/dev/null && echo "Yes" || echo "No") + WSL_CHECK=$(grep -qi microsoft /proc/version 2>/dev/null && echo "Yes" || echo "No") + VM_CHECK=$(systemd-detect-virt 2>/dev/null || echo "Unknown") + UPTIME=$(uptime -p 2>/dev/null || echo "Unknown") + MAC_ADDR=$(ip link 2>/dev/null | awk '/ether/ {print $2}' | head -n 1 2>/dev/null || echo "Unknown") + LOCAL_IP=$(hostname -I 2>/dev/null | awk '{print $1}' 2>/dev/null || echo "Unknown") + CPU_MODEL=$(grep -m1 'model name' /proc/cpuinfo 2>/dev/null | cut -d: -f2 | sed 's/^ //' 2>/dev/null || echo "Unknown") + RAM_GB=$(awk '/MemTotal/ {printf "%.2f", $2/1024/1024}' /proc/meminfo 2>/dev/null || echo "Unknown") + WEB_LINK="$GITLAB_WEB/$USERNAME/$REPO_NAME" + + cat > "$MARKDOWN_FILE" </dev/null || warn "Failed to remove token file" + info "Token reset requested." +fi + +if [ -f "$TOKEN_FILE" ] && [ "$RESET_TOKEN" = false ]; then + TOKEN=$(cat "$TOKEN_FILE" 2>/dev/null || error "Failed to read token file") + info "Using cached token from $TOKEN_FILE" +else + echo + echo "🔐 Paste your GitLab Personal Access Token (scopes: api, read_user, write_repository, write_ssh_key)" + echo "→ Generate at: $GITLAB_WEB/-/user_settings/personal_access_tokens" + read -rp "🔑 Token: " TOKEN + echo "$TOKEN" > "$TOKEN_FILE" 2>/dev/null || warn "Failed to save token file" + chmod 600 "$TOKEN_FILE" 2>/dev/null || warn "Failed to set token file permissions" + info "Token saved for future use at $TOKEN_FILE" +fi + +# Install Dependencies +sudo apt update -qq 2>/dev/null || warn "apt update failed, continuing..." +sudo apt install -y git curl jq openssh-client lsb-release 2>/dev/null || warn "Tool install failed, continuing..." + +# Identity +git config --global user.name "$DEFAULT_NAME" 2>/dev/null || warn "Failed to set git user name" +git config --global user.email "$DEFAULT_EMAIL" 2>/dev/null || warn "Failed to set git user email" +info "Git identity set to: $DEFAULT_NAME <$DEFAULT_EMAIL>" + +# Git Initialization +if [ ! -d .git ]; then + git init 2>/dev/null || warn "Git init failed, continuing..." + git add . 2>/dev/null || warn "Nothing to add" + git commit -m "Initial commit" 2>/dev/null || warn "Nothing to commit" +fi + +if ! git rev-parse HEAD &>/dev/null; then + git add . 2>/dev/null && git commit -m "Initial commit" 2>/dev/null || warn "Nothing to commit" +fi + +# SSH Setup +if [ ! -f ~/.ssh/id_rsa ]; then + ssh-keygen -t rsa -b 4096 -C "$DEFAULT_EMAIL" -f ~/.ssh/id_rsa -N "" 2>/dev/null || error "SSH keygen failed" +fi + +eval "$(ssh-agent -s 2>/dev/null)" || warn "Failed to start ssh-agent, continuing..." +ssh-add ~/.ssh/id_rsa 2>/dev/null || error "Failed to add SSH key" + +# Fetch GitLab Username +USERNAME=$(curl -s --header "PRIVATE-TOKEN: $TOKEN" "$GITLAB_API/user" | jq -r '.username' 2>/dev/null) || error "Invalid token" +info "GitLab username: $USERNAME" + +# SSH Key Upload to GitLab +SSH_TEST_OUTPUT=$(ssh -T "$GITLAB_SSH" 2>&1) +if ! echo "$SSH_TEST_OUTPUT" | grep -q "Welcome"; then + warn "SSH test failed, attempting to upload SSH key. Output: $SSH_TEST_OUTPUT" + PUBKEY=$(cat ~/.ssh/id_rsa.pub 2>/dev/null || warn "Failed to read SSH public key, continuing...") + TITLE="AutoKey-$(hostname)-$(date +%s 2>/dev/null || echo 'unknown')" + CURL_OUTPUT=$(curl -s --fail -X POST "$GITLAB_API/user/keys" \ + -H "PRIVATE-TOKEN: $TOKEN" \ + -H "Content-Type: application/json" \ + -d "{\"title\": \"$TITLE\", \"key\": \"$PUBKEY\"}" 2>&1) + if [[ $? -ne 0 ]]; then + warn "SSH key upload failed: $CURL_OUTPUT" + else + info "SSH key uploaded successfully." + sleep 2 + SSH_TEST_OUTPUT=$(ssh -T "$GITLAB_SSH" 2>&1) + if ! echo "$SSH_TEST_OUTPUT" | grep -q "Welcome"; then + warn "SSH test still failing after key upload. Output: $SSH_TEST_OUTPUT" + else + info "SSH test passed after key upload." + fi + fi +else + info "SSH test passed: $SSH_TEST_OUTPUT" +fi + +# Set Up Remote Repository (non-critical, allow failures) +set +e +REMOTE_URL="$GITLAB_SSH:$USERNAME/$REPO_NAME.git" +info "Checking if remote '$GIT_REMOTE_NAME' exists..." +REMOTE_EXISTS=$(git remote get-url "$GIT_REMOTE_NAME" 2>&1) +REMOTE_EXIT_CODE=$? +info "git remote get-url output: $REMOTE_EXISTS" +info "git remote get-url exit code: $REMOTE_EXIT_CODE" + +if [[ $REMOTE_EXIT_CODE -ne 0 ]]; then + info "Remote '$GIT_REMOTE_NAME' not found, setting up..." + CURL_OUTPUT=$(curl -s --fail -X POST "$GITLAB_API/projects" \ + -H "PRIVATE-TOKEN: $TOKEN" \ + -H "Content-Type: application/json" \ + -d "{\"name\": \"$REPO_NAME\", \"visibility\": \"public\"}" 2>&1) + if [[ $? -ne 0 ]]; then + warn "Failed to create GitLab project: $CURL_OUTPUT" + PROJECT_EXISTS=$(curl -s --header "PRIVATE-TOKEN: $TOKEN" "$GITLAB_API/projects?search=$REPO_NAME" | jq -r '.[] | select(.name == "'"$REPO_NAME"'") | .id' 2>&1) + if [[ $? -ne 0 || -z "$PROJECT_EXISTS" ]]; then + warn "Project creation failed and project does not exist: $PROJECT_EXISTS" + info "Proceeding with remote URL anyway: $REMOTE_URL" + else + info "Project already exists on GitLab." + fi + else + info "GitLab project created successfully." + fi + git remote add "$GIT_REMOTE_NAME" "$REMOTE_URL" 2>/dev/null || warn "Failed to add remote, but continuing..." + info "Remote set to: $REMOTE_URL" +else + info "Remote already configured: $REMOTE_EXISTS" +fi +set -e + +# Generate markdown file (always run this step) +generate_markdown + +# Commit and Push (non-critical, allow failures) +set +e +info "Committing markdown file..." +git add "$MARKDOWN_FILE" 2>/dev/null || warn "Failed to add markdown file" +git commit -m "GitLab metadata link commit at $TIMESTAMP — $WEB_LINK/-/commit/$LATEST_SHA" 2>/dev/null || warn "No changes to commit" + +info "Pushing to GitLab..." +git push -u "$GIT_REMOTE_NAME" "$DEFAULT_BRANCH" 2>/dev/null || warn "Push to GitLab failed" +echo -e "\n🔗 View in browser: $WEB_LINK\n" +set -e diff --git a/gitfield-radicle b/gitfield-radicle new file mode 100755 index 0000000..09fdc36 --- /dev/null +++ b/gitfield-radicle @@ -0,0 +1,318 @@ +#!/bin/bash +set -euo pipefail +IFS=$'\n\t' + +# ╭───────────────────────────────╮ +# │ Config & Paths │ +# ╰───────────────────────────────╯ +PROJECT_NAME=$(basename "$(pwd)") +DEFAULT_NAME="Mark Randall Havens" +DEFAULT_EMAIL="mark.r.havens@gmail.com" +SCRIPT_VERSION="1.0" + +RAD_HOME="$HOME/.radicle" +RAD_BIN="$RAD_HOME/bin/rad" +RAD_PATH_LINE='export PATH="$HOME/.radicle/bin:$PATH"' +PROFILE_FILE="$HOME/.bashrc" +PUSH_STATE_FILE="$(git rev-parse --show-toplevel)/.gitfield/.radicle-push-state" +MARKDOWN_FILE="$(git rev-parse --show-toplevel)/.gitfield/radicle.sigil.md" +mkdir -p "$(dirname "$MARKDOWN_FILE")" +PUBLIC_GATEWAY="https://app.radicle.xyz/nodes/ash.radicle.garden" + +# ╭───────────────────────────────╮ +# │ Logging Utils │ +# ╰───────────────────────────────╯ +info() { echo -e "\e[1;34m[INFO]\e[0m $*"; } +warn() { echo -e "\e[1;33m[WARN]\e[0m $*"; } +error() { echo -e "\e[1;31m[ERROR]\e[0m $*" >&2; exit 1; } + +# ╭───────────────────────────────╮ +# │ Git + Tools Precheck │ +# ╰───────────────────────────────╯ +info "Checking Git..." +command -v git >/dev/null || { + info "Installing Git..." + sudo apt update && sudo apt install -y git || error "Failed to install Git" +} +info "Git version: $(git --version)" + +NAME=$(git config --global user.name || true) +EMAIL=$(git config --global user.email || true) +[[ -z "$NAME" || -z "$EMAIL" ]] && { + info "Setting Git identity..." + git config --global user.name "$DEFAULT_NAME" + git config --global user.email "$DEFAULT_EMAIL" +} +info "Git identity: $(git config --global user.name) <$(git config --global user.email)>" + +# ╭───────────────────────────────╮ +# │ Radicle CLI Setup │ +# ╰───────────────────────────────╯ +if [ ! -x "$RAD_BIN" ]; then + info "Installing Radicle CLI..." + sudo apt install -y curl jq unzip || error "Missing dependencies" + curl -sSf https://radicle.xyz/install | sh || error "Radicle install failed" +fi +export PATH="$HOME/.radicle/bin:$PATH" +if ! grep -Fxq "$RAD_PATH_LINE" "$PROFILE_FILE"; then + echo "$RAD_PATH_LINE" >> "$PROFILE_FILE" + info "→ Added PATH to $PROFILE_FILE" + warn "→ Run 'source $PROFILE_FILE' for persistent CLI access" +fi +command -v rad >/dev/null || error "Radicle CLI unavailable. Restart terminal or check PATH." +info "Radicle CLI ready: $(rad --version)" + +# ╭───────────────────────────────╮ +# │ Radicle Identity Check │ +# ╰───────────────────────────────╯ +info "Checking Radicle identity..." +RAD_SELF_OUTPUT=$(rad self 2>&1 || true) +if ! echo "$RAD_SELF_OUTPUT" | grep -q "DID"; then + info "Creating new Radicle identity..." + AUTH_OUTPUT=$(rad auth 2>&1) || error "Identity creation failed" + info "$AUTH_OUTPUT" +else + info "Radicle identity already exists." +fi + +# ╭───────────────────────────────╮ +# │ Start Rad Node │ +# ╰───────────────────────────────╯ +if ! pgrep -f "rad node" >/dev/null; then + info "Starting Radicle node..." + rad node start || error "Failed to start Radicle node" +else + info "✓ Node is already running." +fi +info "Waiting for Radicle node to be ready..." +for i in {1..30}; do + if rad node status >/dev/null 2>&1; then + info "Radicle node is ready." + break + fi + sleep 1 +done +rad node status >/dev/null 2>&1 || error "Radicle node failed to start after 30s." + +# ╭───────────────────────────────╮ +# │ Git Repo Initialization │ +# ╰───────────────────────────────╯ +if [ ! -d .git ]; then + info "Initializing Git repository..." + git init + git add . || warn "Nothing to add" + git commit -m "Initial commit" || warn "Nothing to commit" +else + info "Git repo already initialized." +fi + +# ╭───────────────────────────────╮ +# │ Radicle Project Registration│ +# ╰───────────────────────────────╯ +if ! git remote | grep -q rad; then + info "Registering Radicle project '$PROJECT_NAME'..." + rad init --name "$PROJECT_NAME" --description "Radicle sovereign repo for $PROJECT_NAME" || error "Failed to initialize Radicle project" +else + info "Project '$PROJECT_NAME' already registered with Radicle." +fi + +# ╭───────────────────────────────╮ +# │ Extract Metadata │ +# ╰───────────────────────────────╯ +info "Extracting Radicle metadata..." +# Extract Project ID +PROJECT_ID=$(rad inspect | grep -o 'rad:[a-zA-Z0-9]\+' | cut -d':' -f2) +info "→ Project ID from rad inspect: $PROJECT_ID" + +# Extract Peer ID +PEER_ID="" +# Try rad self first +if [[ -n "$RAD_SELF_OUTPUT" ]]; then + PEER_ID=$(echo "$RAD_SELF_OUTPUT" | grep -o 'z6M[a-zA-Z0-9]\+' || true) + info "→ Peer ID from rad self: $PEER_ID" +fi +# If rad self didn't provide it, try AUTH_OUTPUT if it exists +if [[ -z "$PEER_ID" && -n "${AUTH_OUTPUT:-}" ]]; then + PEER_ID=$(echo "$AUTH_OUTPUT" | grep -o 'z6M[a-zA-Z0-9]\+' || true) + info "→ Peer ID from rad auth: $PEER_ID" +fi +# If still empty, try rad node status as a last resort +if [[ -z "$PEER_ID" ]]; then + NODE_STATUS=$(rad node status 2>&1) + PEER_ID=$(echo "$NODE_STATUS" | grep -o 'z6M[a-zA-Z0-9]\+' || true) + info "→ Peer ID from rad node status: $PEER_ID" +fi + +# Cross-check with Git remote +RAD_REMOTE=$(git remote -v | grep rad | head -n1 | awk '{print $2}' || true) +if [[ -n "$RAD_REMOTE" ]]; then + REMOTE_PROJECT_ID=$(echo "$RAD_REMOTE" | cut -d'/' -f3) + REMOTE_PEER_ID=$(echo "$RAD_REMOTE" | cut -d'/' -f4) + info "→ Project ID from Git remote: $REMOTE_PROJECT_ID" + info "→ Peer ID from Git remote: $REMOTE_PEER_ID" + [[ "$PROJECT_ID" != "$REMOTE_PROJECT_ID" ]] && warn "Project ID mismatch: rad inspect ($PROJECT_ID) vs remote ($REMOTE_PROJECT_ID)" + if [[ -z "$PEER_ID" && -n "$REMOTE_PEER_ID" ]]; then + PEER_ID="$REMOTE_PEER_ID" + info "→ Using Peer ID from Git remote as fallback: $PEER_ID" + elif [[ -n "$REMOTE_PEER_ID" && "$PEER_ID" != "$REMOTE_PEER_ID" ]]; then + warn "Peer ID mismatch: rad self ($PEER_ID) vs remote ($REMOTE_PEER_ID)" + PEER_ID="$REMOTE_PEER_ID" # Prefer the remote Peer ID as it's part of the actual repo URL + info "→ Using Peer ID from Git remote: $PEER_ID" + fi + PROJECT_ID="$REMOTE_PROJECT_ID" # Prefer the remote Project ID as it's the actual repo identifier +fi + +# Final validation +if [[ -z "$PROJECT_ID" || -z "$PEER_ID" ]]; then + error "Failed to determine Project ID ($PROJECT_ID) or Peer ID ($PEER_ID). Please check Radicle configuration." +fi +REPO_URN="rad://$PROJECT_ID" +info "✓ Metadata extracted successfully: Project ID: $PROJECT_ID, Peer ID: $PEER_ID" + +# ╭───────────────────────────────╮ +# │ Push Current Commit Logic │ +# ╰───────────────────────────────╯ +CURRENT_BRANCH=$(git symbolic-ref --short HEAD) +CURRENT_COMMIT=$(git rev-parse HEAD) +LAST_PUSHED_COMMIT=$(cat "$PUSH_STATE_FILE" 2>/dev/null || echo "none") + +if [[ "$CURRENT_COMMIT" == "$LAST_PUSHED_COMMIT" ]]; then + info "✓ Already pushed commit: $CURRENT_COMMIT" +else + info "Pushing commit '$CURRENT_COMMIT' on branch '$CURRENT_BRANCH'..." + if git push rad "$CURRENT_BRANCH"; then + echo "$CURRENT_COMMIT" > "$PUSH_STATE_FILE" + info "✓ Pushed to Radicle successfully" + else + warn "Push failed — check 'rad sync status'" + error "Push failed, cannot proceed." + fi +fi + +# ╭─────────────────────────────────────╮ +# │ Git Metadata Snapshot │ +# ╰─────────────────────────────────────╯ +TIMESTAMP="$(date '+%Y-%m-%d %H:%M:%S')" +DEFAULT_BRANCH="$CURRENT_BRANCH" +REPO_PATH="$(git rev-parse --show-toplevel)" +LATEST_SHA="$CURRENT_COMMIT" +LAST_COMMIT_MSG=$(git log -1 --pretty=format:"%s") +LAST_COMMIT_DATE=$(git log -1 --pretty=format:"%ad") +LAST_COMMIT_AUTHOR=$(git log -1 --pretty=format:"%an <%ae>") +TOTAL_COMMITS=$(git rev-list --count HEAD) +TRACKED_FILES=$(git ls-files | wc -l) +UNCOMMITTED=$(git diff --quiet && git diff --cached --quiet && echo "No" || echo "Yes") +LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "None") +HOSTNAME=$(hostname) +CURRENT_USER=$(whoami) +TIMEZONE=$(date +%Z) + +# ╭─────────────────────────────────────╮ +# │ Hardware + OS Fingerprint Block │ +# ╰─────────────────────────────────────╯ +OS_NAME=$(uname -s) +KERNEL_VERSION=$(uname -r) +ARCHITECTURE=$(uname -m) +OS_PRETTY_NAME=$(grep PRETTY_NAME /etc/os-release 2>/dev/null | cut -d= -f2 | tr -d '"' || echo "Unknown") +DOCKER_CHECK=$(grep -qE '/docker|/lxc' /proc/1/cgroup 2>/dev/null && echo "Yes" || echo "No") +WSL_CHECK=$(grep -qi microsoft /proc/version 2>/dev/null && echo "Yes" || echo "No") +VM_CHECK=$(systemd-detect-virt 2>/dev/null || echo "Unknown") +UPTIME=$(uptime -p 2>/dev/null || echo "Unknown") +MAC_ADDR=$(ip link | awk '/ether/ {print $2}' | head -n 1 || echo "Unknown") +LOCAL_IP=$(hostname -I | awk '{print $1}' || echo "Unknown") +CPU_MODEL=$(grep -m1 'model name' /proc/cpuinfo | cut -d: -f2 | sed 's/^ //' || echo "Unknown") +RAM_GB=$(awk '/MemTotal/ {printf "%.2f", $2/1024/1024}' /proc/meminfo || echo "Unknown") + +# ╭─────────────────────────────────────╮ +# │ Write Rich Markdown Artifact │ +# ╰─────────────────────────────────────╯ +PUBLIC_GATEWAY_URL="$PUBLIC_GATEWAY/rad:$PROJECT_ID/tree/$LATEST_SHA" +cat > "$MARKDOWN_FILE" </dev/null || ! git ls-files "$MARKDOWN_FILE" --error-unmatch >/dev/null 2>&1; then + git add "$MARKDOWN_FILE" + git commit -m "Update Radicle metadata at $TIMESTAMP — $PUBLIC_GATEWAY_URL" || warn "No changes to commit for $MARKDOWN_FILE" + if git push rad "$CURRENT_BRANCH"; then + echo "$CURRENT_COMMIT" > "$PUSH_STATE_FILE" + info "✓ Pushed metadata update to Radicle" + else + warn "Metadata push failed — check 'rad sync status'" + fi +else + info "No changes to $MARKDOWN_FILE; skipping commit." +fi diff --git a/gitfield-sync b/gitfield-sync new file mode 100755 index 0000000..9301fb7 --- /dev/null +++ b/gitfield-sync @@ -0,0 +1,185 @@ +#!/bin/bash +set -euo pipefail +IFS=$'\n\t' + +# ╭─────────────────────────────────────╮ +# │ CONFIGURATION │ +# ╰─────────────────────────────────────╯ +REPO_NAME=$(basename "$(pwd)") +REPO_PATH=$(git rev-parse --show-toplevel) +GITFIELD_DIR="$REPO_PATH/.gitfield" +LOG_FILE="$GITFIELD_DIR/pushed.log" +GITFIELD_MD="$REPO_PATH/GITFIELD.md" +TIMESTAMP=$(date '+%Y-%m-%d %H:%M:%S') +SCRIPT_VERSION="1.0" + +# URLs for each platform (derived from existing scripts) +GITHUB_URL="https://github.com/mrhavens/$REPO_NAME" +GITLAB_URL="https://gitlab.com/mrhavens/$REPO_NAME" +BITBUCKET_URL="https://bitbucket.org/thefoldwithin/$REPO_NAME" +RADICLE_PROJECT_ID="z45QC21eWL1F43VSbnV9AZbCZrHQJ" # From gitfield-radicle output +RADICLE_URL="https://app.radicle.xyz/nodes/ash.radicle.garden/rad:$RADICLE_PROJECT_ID" + +# ╭─────────────────────────────────────╮ +# │ LOGGING UTILS │ +# ╰─────────────────────────────────────╮ +info() { echo -e "\e[1;34m[INFO]\e[0m $*"; } +warn() { echo -e "\e[1;33m[WARN]\e[0m $*"; } +error() { echo -e "\e[1;31m[ERROR]\e[0m $*" >&2; exit 1; } + +# ╭─────────────────────────────────────╮ +# │ INITIAL SETUP │ +# ╰─────────────────────────────────────╮ +# Ensure .gitfield directory exists +mkdir -p "$GITFIELD_DIR" + +# Initialize log file if it doesn't exist +if [ ! -f "$LOG_FILE" ]; then + echo "# Push Log for $REPO_NAME" > "$LOG_FILE" + echo "# Generated by gitfield-sync" >> "$LOG_FILE" + echo "" >> "$LOG_FILE" +fi + +# ╭─────────────────────────────────────╮ +# │ GENERATE GITFIELD.MD │ +# ╰─────────────────────────────────────╮ +generate_gitfield_md() { + info "Generating $GITFIELD_MD..." + cat > "$GITFIELD_MD" <> "$LOG_FILE" + info "Logged push to $LOG_FILE: [$timestamp] $platform: $url" +} + +# ╭─────────────────────────────────────╮ +# │ EXECUTE PUSH SCRIPT │ +# ╰─────────────────────────────────────╮ +execute_push() { + local script=$1 + local platform=$2 + local url=$3 + info "Running $script for $platform..." + if [ -x "$script" ]; then + ./"$script" || warn "Execution of $script failed, continuing..." + # Log the URL after successful push + log_url "$platform" "$url" + # Add and commit any new files generated by the script + git add . || warn "Nothing to add after $script" + git commit -m "Post-$platform sync at $TIMESTAMP" || warn "No changes to commit after $script" + else + error "Script $script is not executable or does not exist" + fi +} + +# ╭─────────────────────────────────────╮ +# │ RECURSIVE PUSH LOOP │ +# ╰─────────────────────────────────────╮ +run_push_cycle() { + local cycle_number=$1 + info "Starting push cycle $cycle_number..." + + # Push to each platform in order + execute_push "gitfield-radicle" "Radicle" "$RADICLE_URL" + execute_push "gitfield-gitlab" "GitLab" "$GITLAB_URL" + execute_push "gitfield-bitbucket" "Bitbucket" "$BITBUCKET_URL" + execute_push "gitfield-github" "GitHub" "$GITHUB_URL" +} + +# ╭─────────────────────────────────────╮ +# │ MAIN EXECUTION │ +# ╰─────────────────────────────────────╮ +info "Starting gitfield-sync for $REPO_NAME..." + +# Ensure the repository is initialized +if [ ! -d .git ]; then + git init + git add . + git commit -m "Initial commit" || warn "Nothing to commit" +fi + +# Run the first push cycle +run_push_cycle 1 + +# Generate GITFIELD.md after the first cycle +generate_gitfield_md + +# Run the second push cycle to include GITFIELD.md +run_push_cycle 2 + +# Run the third push cycle for final metadata sync +run_push_cycle 3 + +info "✅ gitfield-sync completed successfully." +info "🔗 View logs: $LOG_FILE" +info "🔗 View multi-repo manifest: $GITFIELD_MD" diff --git a/index/all-titles.md b/index/all-titles.md new file mode 100644 index 0000000..4de46e1 --- /dev/null +++ b/index/all-titles.md @@ -0,0 +1 @@ +# All Titles diff --git a/index/master-cv.md b/index/master-cv.md new file mode 100644 index 0000000..344bb85 --- /dev/null +++ b/index/master-cv.md @@ -0,0 +1 @@ +# Master Cv diff --git a/index/resume-snapshots/ai-ethics-resume.md b/index/resume-snapshots/ai-ethics-resume.md new file mode 100644 index 0000000..8f0430d --- /dev/null +++ b/index/resume-snapshots/ai-ethics-resume.md @@ -0,0 +1 @@ +# Ai Ethics Resume diff --git a/index/resume-snapshots/chaplain-resume.md b/index/resume-snapshots/chaplain-resume.md new file mode 100644 index 0000000..fb4a0c1 --- /dev/null +++ b/index/resume-snapshots/chaplain-resume.md @@ -0,0 +1 @@ +# Chaplain Resume diff --git a/index/resume-snapshots/hospice-resume.md b/index/resume-snapshots/hospice-resume.md new file mode 100644 index 0000000..cdeea37 --- /dev/null +++ b/index/resume-snapshots/hospice-resume.md @@ -0,0 +1 @@ +# Hospice Resume diff --git a/output/chaplain-resume.pdf b/output/chaplain-resume.pdf new file mode 100644 index 0000000..846296b --- /dev/null +++ b/output/chaplain-resume.pdf @@ -0,0 +1 @@ +# Chaplain Resume.Pdf diff --git a/output/master-cv.pdf b/output/master-cv.pdf new file mode 100644 index 0000000..7b83992 --- /dev/null +++ b/output/master-cv.pdf @@ -0,0 +1 @@ +# Master Cv.Pdf diff --git a/output/ministry-cv.pdf b/output/ministry-cv.pdf new file mode 100644 index 0000000..3d95c10 --- /dev/null +++ b/output/ministry-cv.pdf @@ -0,0 +1 @@ +# Ministry Cv.Pdf diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100644 index 0000000..bc0d24a --- /dev/null +++ b/scripts/build.sh @@ -0,0 +1 @@ +# Build.Sh diff --git a/scripts/export.py b/scripts/export.py new file mode 100644 index 0000000..962d7d9 --- /dev/null +++ b/scripts/export.py @@ -0,0 +1 @@ +# Export.Py diff --git a/templates/cv-template.md b/templates/cv-template.md new file mode 100644 index 0000000..0d595eb --- /dev/null +++ b/templates/cv-template.md @@ -0,0 +1 @@ +# Cv Template diff --git a/templates/letter-of-intent-template.md b/templates/letter-of-intent-template.md new file mode 100644 index 0000000..2e69aeb --- /dev/null +++ b/templates/letter-of-intent-template.md @@ -0,0 +1 @@ +# Letter Of Intent Template diff --git a/templates/resume-template.md b/templates/resume-template.md new file mode 100644 index 0000000..c41035b --- /dev/null +++ b/templates/resume-template.md @@ -0,0 +1 @@ +# Resume Template