#!/bin/bash # N4 (a) - read-only git / file-system evidence on M3U96b:~/UQO_RESEARCH_DB for the two extraction runs. # Writes results/runs/git_evidence.md and the two inter-revision patches. Never modifies git state. set -u OUT="$HOME/firc0001_review/results/runs"; mkdir -p "$OUT" cd "$HOME/UQO_RESEARCH_DB" || exit 1 export GIT_PAGER=cat FILES="project-db/spid/extract/llm.py project-db/spid/extract/rules.py project-db/spid/extract/base.py project-db/spid/taxonomy.py project-db/spid/resolve.py project-db/spid/ingest.py project-db/spid/config.py project-db/spid/pipeline.py project-db/spid/store.py project-db/spid/__main__.py project-db/run_full_extract.py src/parsing/html_parser.py src/parsing/section_extractor.py src/parsing/filing_parser.py src/parsing/chunker.py scripts/parse_filings.py" { echo "# Git and file-system evidence for the two SPID extraction runs (N4a)" echo echo "Generated $(date -Iseconds) on $(hostname) from a read-only inspection of \`~/UQO_RESEARCH_DB\` (clone of \`gitsrv:srv/git/uqo-research-db.git\`)." echo echo "## Repository state" echo '```' echo "HEAD: $(git rev-parse HEAD)"; echo "branch: $(git rev-parse --abbrev-ref HEAD)"; echo "tags: $(git tag | tr '\n' ' ')" echo "remote: $(git remote -v | head -1)" echo "working tree (git status --short | head -20):"; git status --short | head -20 echo '```' echo echo "## All commits (there is no commit before 2026-10-27; the June 2026 run has no git revision)" echo '```' git log --format='%h %ad %an %s' --date=iso echo '```' echo echo "## First commit of each extractor / parser file (git log --diff-filter=A)" echo '```' for f in $FILES; do printf '%-45s %s\n' "$f" "$(git log --diff-filter=A --format='%h %ad' --date=iso -- "$f" | tail -1)"; done echo '```' echo echo "## Commits touching each file" echo '```' for f in $FILES; do printf '%-45s %s\n' "$f" "$(git log --format='%h' -- "$f" | tr '\n' ' ')"; done echo '```' echo echo "## File modification times (file-system evidence; extractor modules untouched since 2026-06-17)" echo '```' for f in $FILES; do [ -f "$f" ] && printf '%-45s %s %s bytes sha256=%s\n' "$f" "$(stat -f '%Sm' -t '%Y-%m-%d %H:%M:%S' "$f")" "$(stat -f '%z' "$f")" "$(shasum -a 256 "$f" | cut -c1-16)"; done echo '```' echo echo "## git diff --stat 0304133..2324b58 (first commit -> revision cited by the paper) for the extractor, parser and driver" echo '```' git diff --stat 0304133 2324b58 -- project-db/spid src/parsing scripts/parse_filings.py project-db/run_full_extract.py echo '```' echo echo "## git diff --stat df7905d..2324b58 (the pair named in the paper)" echo '```' git diff --stat df7905d 2324b58 -- project-db/spid src/parsing scripts/parse_filings.py project-db/run_full_extract.py echo '```' echo echo "## git diff --stat 2324b58..HEAD (after the paper's revision)" echo '```' git diff --stat 2324b58 HEAD -- project-db/spid src/parsing scripts/parse_filings.py project-db/run_full_extract.py echo '```' echo echo "## June 2026 run parameters from project-db/logs/extract.log (first and last lines; model id absent)" echo '```' head -2 project-db/logs/extract.log; echo '...'; tail -2 project-db/logs/extract.log echo "grep -c 'gpt' project-db/logs/extract.log = $(grep -c 'gpt' project-db/logs/extract.log)" echo "grep -c 'gpt' data/logs/spid_extract.log = $(grep -c 'gpt' data/logs/spid_extract.log)" echo "project-db/logs mtimes:"; for f in project-db/logs/*; do printf ' %-40s %s\n' "$f" "$(stat -f '%Sm' -t '%Y-%m-%d %H:%M:%S' "$f")"; done echo "project-db/.env present: $( [ -f project-db/.env ] && echo yes || echo no ) (content never read)" echo "project-db/.env.example model line: $(grep -h 'SPID_LLM_MODEL' project-db/.env.example 2>/dev/null | head -2 | tr '\n' ' ')" echo '```' echo echo "## Interpretation" echo "- The repository's first commit (0304133, 2026-10-27) already contains \`project-db/\`; no revision of the June 2026 code exists in git. The sentence '2324b58 supersedes df7905d examined in the June study' names two October commits." echo "- The extractor modules (llm.py, rules.py, base.py, taxonomy.py, resolve.py, ingest.py) carry 2026-06-17 modification times: the prompt, the gate, the taxonomy and the resolver used in October are, by file-system evidence, the files that existed before the June run. The driver/config/store (config.py, pipeline.py, __main__.py: 2026-10-27 12:34; store.py: 2026-10-27 21:34) were edited before the first commit, so their June versions are not recoverable." echo "- The only change to these files between df7905d and 2324b58 is the one-line DuckDB 2.0 compatibility fix in store.py (see patch)." } > "$OUT/git_evidence.md" git diff 0304133 2324b58 -- project-db/spid src/parsing scripts/parse_filings.py project-db/run_full_extract.py > "$OUT/git_diff_0304133_2324b58.patch" git diff df7905d 2324b58 -- project-db/spid src/parsing scripts/parse_filings.py project-db/run_full_extract.py > "$OUT/git_diff_df7905d_2324b58.patch" git diff 2324b58 HEAD -- project-db/spid src/parsing scripts/parse_filings.py project-db/run_full_extract.py > "$OUT/git_diff_2324b58_HEAD.patch" wc -l "$OUT"/*.patch echo "git state after: $(git rev-parse HEAD) $(git status --short | wc -l) changed paths"