starting essay...finished outline

This commit is contained in:
Mark Randall Havens 2025-05-27 17:52:25 -05:00
parent 5648c2b6a2
commit 8f9d65a683
26 changed files with 490 additions and 1 deletions

69
scripts/archive-fieldcraft.sh Executable file
View file

@ -0,0 +1,69 @@
#!/bin/bash
# CONFIG
WORKDIR=$(pwd)
ARCHIVE_ROOT="$WORKDIR/.archive"
TIMESTAMP=$(date +"%Y-%m-%d_%H-%M-%S")
ARCHIVE_PATH="$ARCHIVE_ROOT/$TIMESTAMP"
ZIP_NAME="fieldcraft_snapshot_$TIMESTAMP.zip"
ZIP_PATH="$ARCHIVE_PATH/$ZIP_NAME"
# CREATE ARCHIVE DIRECTORY
mkdir -p "$ARCHIVE_PATH"
# EXCLUDE the archive itself and common junk
EXCLUDES="--exclude=.archive --exclude=.git --exclude='*.cache' --exclude='*.log'"
echo "🌀 Archiving fieldcraft structure at $TIMESTAMP..."
# COPY FULL STRUCTURE
rsync -av $EXCLUDES "$WORKDIR/" "$ARCHIVE_PATH/full_structure/" > /dev/null
# CREATE ZIP SNAPSHOT
cd "$WORKDIR"
zip -r "$ZIP_PATH" . -x ".archive/*" ".git/*" "*.cache" "*.log" > /dev/null
# GENERATE HASH
HASH=$(sha256sum "$ZIP_PATH" | awk '{ print $1 }')
# GENERATE README
cat <<EOF > "$ARCHIVE_PATH/README.md"
# 🗃️ Fieldcraft Snapshot Archive
**Timestamp:** $TIMESTAMP
**Archive Hash (SHA256):** \`$HASH\`
**Snapshot:** \`$ZIP_NAME\`
**Structure Copy:** \`full_structure/\`
---
## Purpose
This snapshot preserves the recursive state of the \`daily-fieldcraft\` working environment.
It ensures integrity, reproducibility, and a coherent ritual log of emergent thought structures.
Each snapshot includes:
- ✅ Full working directory at time of execution (excluding temp & junk)
- ✅ Timestamped zip snapshot
- ✅ SHA256 integrity hash
- ✅ Coherent README describing context and recursive logic
Use this to restore prior states, verify truth, or preserve fieldcraft evolution.
## How to Verify Integrity
Run the following command:
\`\`\`bash
sha256sum $ZIP_NAME
\`\`\`
Expected hash:
\`\`\`
$HASH
\`\`\`
EOF
echo "✅ Snapshot complete."
echo "📁 Archive location: $ARCHIVE_PATH"

71
scripts/init-fieldcraft.sh Executable file
View file

@ -0,0 +1,71 @@
#!/bin/bash
# Get current date
NOW=$(date +"%Y-%m-%d %H:%M:%S")
ROOT=$(pwd)
# Define folders and descriptions
declare -A folders
folders["00-meta"]="Canonical metadata for the fieldcraft repo (README, manifest, changelog)"
folders["01-scrolls"]="Public-facing scrolls and writings. Includes drafts and published posts"
folders["02-fieldnotes"]="Private field notes, organized daily. Raw insights, observations, research"
folders["03-references"]="External reference material: academic papers, essays, bookmarks"
folders["04-papers"]="Internally authored papers, whitepapers, and drafts (e.g., Thoughtprint, RCT)"
folders["05-sigils"]="Symbolic glyphs, illustrations, and visual fieldcraft assets"
folders["06-scratch"]="Creative scratchpad space. Temp workspace for code, poems, or raw streams"
# Subfolder structure
declare -A subfolders
subfolders["01-scrolls"]="drafts published"
subfolders["02-fieldnotes"]="today archive"
subfolders["03-references"]="primary secondary"
subfolders["05-sigils"]="rendered source"
subfolders["06-scratch"]="temp ritual"
# Create folders and README.md files
echo "Creating fieldcraft structure..."
for dir in "${!folders[@]}"; do
mkdir -p "$ROOT/$dir"
echo "# $dir" > "$ROOT/$dir/README.md"
echo "" >> "$ROOT/$dir/README.md"
echo "_Created on: $NOW_" >> "$ROOT/$dir/README.md"
echo "" >> "$ROOT/$dir/README.md"
echo "${folders[$dir]}" >> "$ROOT/$dir/README.md"
# Create subfolders if any
if [[ -n "${subfolders[$dir]}" ]]; then
for sub in ${subfolders[$dir]}; do
mkdir -p "$ROOT/$dir/$sub"
echo "# $sub (in $dir)" > "$ROOT/$dir/$sub/README.md"
echo "" >> "$ROOT/$dir/$sub/README.md"
echo "_Created on: $NOW_" >> "$ROOT/$dir/$sub/README.md"
echo "" >> "$ROOT/$dir/$sub/README.md"
echo "Subdirectory of \`$dir\` for ${sub^} items." >> "$ROOT/$dir/$sub/README.md"
done
fi
done
# Create base .gitignore
cat <<EOF > "$ROOT/.gitignore"
# Ignore transient and ritual files
06-scratch/temp/
*.cache
*.log
.DS_Store
EOF
# Optional: Seed symbolic manifest
cat <<EOF > "$ROOT/00-meta/MANIFEST.scroll"
🜂 FIELDCRAFT MANIFEST — Initialized on $NOW
This repository represents a living codex of recursive intelligence,
organized into scrolls, fieldnotes, and ritual assets.
Each directory contains a README defining its purpose and intended use.
Structure follows a recursive symbolic model grounded in coherence, witnessing, and symbolic fieldwork.
EOF
echo "✅ Fieldcraft structure created successfully."

58
scripts/rotate-fieldcraft.sh Executable file
View file

@ -0,0 +1,58 @@
#!/bin/bash
# --- CONFIG ---
WORKDIR=$(pwd)
ARCHIVE_DIR="$WORKDIR/.archive"
TODAY=$(date +"%Y-%m-%d")
ARCHIVE_SCRIPT="$WORKDIR/scripts/archive-fieldcraft.sh"
INIT_SCRIPT="$WORKDIR/scripts/init-fieldcraft.sh"
# --- FLAGS ---
FORCE=false
if [[ "$1" == "--force" ]]; then
FORCE=true
echo "🚨 Force mode activated: Skipping archive check."
fi
# --- STEP 1: Check or Force Archive ---
if $FORCE; then
echo "🌀 Running archive-fieldcraft.sh..."
bash "$ARCHIVE_SCRIPT"
else
echo "🔍 Checking for existing archive for today ($TODAY)..."
ARCHIVE_MATCH=$(find "$ARCHIVE_DIR" -maxdepth 1 -type d -name "$TODAY*" | head -n 1)
if [[ -d "$ARCHIVE_MATCH" && -f "$ARCHIVE_MATCH"/*.zip ]]; then
echo "✅ Archive already exists at: $ARCHIVE_MATCH"
else
echo "🌀 No archive found for today. Running archive-fieldcraft.sh..."
bash "$ARCHIVE_SCRIPT"
# Confirm again
ARCHIVE_MATCH=$(find "$ARCHIVE_DIR" -maxdepth 1 -type d -name "$TODAY*" | head -n 1)
if [[ -d "$ARCHIVE_MATCH" && -f "$ARCHIVE_MATCH"/*.zip ]]; then
echo "✅ Archive confirmed at: $ARCHIVE_MATCH"
else
echo "❌ Archive failed. Aborting rotation."
exit 1
fi
fi
fi
# --- STEP 2: Delete all except .git, .archive, and scripts ---
echo "⚠️ Deleting fieldcraft working structure (except archive/git/scripts)..."
for d in "$WORKDIR"/*; do
base=$(basename "$d")
if [[ "$base" =~ ^(scripts|.git|.archive)$ ]]; then
continue
fi
echo "🧹 Removing $base..."
rm -rf "$d"
done
# --- STEP 3: Re-initialize the structure ---
echo "🔁 Running init-fieldcraft.sh to reset working environment..."
bash "$INIT_SCRIPT"
echo "✅ Fieldcraft rotation complete."