From e2d0ff03529b0a34146dbd97c3ebbb2b2f6d1faa Mon Sep 17 00:00:00 2001 From: Otto Date: Sat, 7 Mar 2026 17:14:58 +0100 Subject: [PATCH 1/6] Add unification plan for git hooks --- UNIFICATION_PLAN.md | 189 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 189 insertions(+) create mode 100644 UNIFICATION_PLAN.md diff --git a/UNIFICATION_PLAN.md b/UNIFICATION_PLAN.md new file mode 100644 index 0000000..334eae7 --- /dev/null +++ b/UNIFICATION_PLAN.md @@ -0,0 +1,189 @@ +# Git Hooks Unification Plan + +## Goal + +Consolidate the current multi-script architecture into standard, self-contained git hook files that can be installed directly without external dependencies. + +## Current Architecture + +``` +scripts/ +├── generate-proof.sh # Core proof generation logic +├── backfill-proofs.sh # History scanning + upgrade +├── install-ots-hook.sh # Installer script +├── pre-commit-backfill # Pre-commit hook wrapper +├── check-attestation.sh # Status checker +└── setup-gitignore.sh # Gitignore helper +``` + +**Problems:** +- Hooks depend on external scripts in repo root or global paths +- Multiple files to manage and copy +- Path resolution logic is fragile +- Hard to install manually + +## Target Architecture + +``` +hooks/ +├── post-commit # Self-contained post-commit hook +├── pre-commit # Self-contained pre-commit backfill hook +└── install.sh # Simple installer (copies hooks) +``` + +Each hook file contains all necessary logic inline - no external dependencies. + +## Implementation Plan + +### Phase 1: Create Self-Contained Hooks + +#### `hooks/post-commit` + +Inline the entire `generate-proof.sh` logic: + +```bash +#!/bin/bash +# Self-contained post-commit hook + +set -e + +COMMIT_HASH=$(git rev-parse HEAD) +OUTPUT_FILE=".ots/proof.ots" +mkdir -p "$(dirname "$OUTPUT_FILE")" + +# Inline: generate_with_ots_cli() +temp_file=$(mktemp) +temp_ots="${temp_file}.ots" +python3 -c "import sys; sys.stdout.buffer.write(bytes.fromhex('$COMMIT_HASH'))" > "$temp_file" +ots stamp "$temp_file" +if [ -f "$temp_ots" ]; then + mv "$temp_ots" "$OUTPUT_FILE" + rm -f "$temp_file" +fi + +# Inline: get previous commit +PREV_COMMIT=$(git rev-parse HEAD^1 2>/dev/null || echo "") +if [ -n "$PREV_COMMIT" ]; then + echo "$PREV_COMMIT" > ".ots/prev-commit.txt" +fi + +echo "[ots] Proof generated: ${COMMIT_HASH:0:8}" +``` + +#### `hooks/pre-commit` + +Inline the entire `backfill-proofs.sh` logic: + +```bash +#!/bin/bash +# Self-contained pre-commit backfill hook + +set -e + +# Inline: cache functions +get_cached_status() { ... } +cache_status() { ... } + +# Inline: main loop +COMMITS=$(git rev-list --reverse HEAD) +for COMMIT in $COMMITS; do + PROOF_FILE=".ots/${COMMIT}.ots" + if [ -f "$PROOF_FILE" ]; then + # Check cache, skip if attested + # Upgrade if pending and cache expired + else + # Generate proof inline + fi +done +``` + +### Phase 2: Simplify Installer + +#### `hooks/install.sh` + +```bash +#!/bin/bash +# Simple installer - just copies hooks + +REPO_PATH="${1:-.}" +HOOKS_DIR="$(cd "$REPO_PATH" && git rev-parse --git-dir)/hooks" + +echo "Installing OTS hooks to: $HOOKS_DIR" + +cp "$(dirname "$0")/post-commit" "$HOOKS_DIR/post-commit" +cp "$(dirname "$0")/pre-commit" "$HOOKS_DIR/pre-commit" + +chmod +x "$HOOKS_DIR/post-commit" "$HOOKS_DIR/pre-commit" + +echo "✓ Hooks installed" +``` + +### Phase 3: Migration Path + +1. **Keep current scripts** in `scripts/` for backward compatibility +2. **Add new `hooks/`** directory with unified hooks +3. **Update SKILL.md** to recommend new hooks +4. **Deprecate old scripts** (add deprecation warnings) +5. **Eventually remove** old scripts in next major version + +## Benefits + +| Aspect | Before | After | +|--------|--------|-------| +| Files to install | 6 scripts | 2 hooks + installer | +| External dependencies | Yes (scripts in root) | No (self-contained) | +| Manual installation | Complex (path resolution) | Simple (copy 2 files) | +| Debugging | Hard (multiple files) | Easy (single file per hook) | +| Portability | Low (path-dependent) | High (drop-in) | + +## Trade-offs + +**Pros:** +- Simpler installation +- No path resolution logic +- Easier to understand (single file = single responsibility) +- Better for manual installation + +**Cons:** +- Code duplication (generate-proof logic in both hooks) +- Larger hook files (~200-300 lines each) +- Harder to update (must update multiple files) + +## Mitigation + +- Extract shared functions into a sourced library: `hooks/.ots-lib.sh` +- Hooks source the library: `source "$(dirname "$0")/.ots-lib.sh"` +- Library is installed alongside hooks + +## Revised Architecture (with Library) + +``` +hooks/ +├── .ots-lib.sh # Shared functions (generate_proof, check_attested, etc.) +├── post-commit # Sources library, calls generate_proof() +├── pre-commit # Sources library, calls backfill_history() +└── install.sh # Copies all files +``` + +## Next Steps + +1. [ ] Create `hooks/.ots-lib.sh` with extracted functions +2. [ ] Create `hooks/post-commit` using library +3. [ ] Create `hooks/pre-commit` using library +4. [ ] Create `hooks/install.sh` +5. [ ] Test on git-timestamps-test repo +6. [ ] Update documentation +7. [ ] Deprecate old `scripts/` directory + +## Timeline + +- Phase 1 (Library + Hooks): 1-2 hours +- Phase 2 (Testing): 30 min +- Phase 3 (Documentation): 30 min +- **Total**: ~3 hours + +--- + +**Branch**: `git-scripts` +**Created**: 2026-03-07 +**Status**: Planning From a7c0f825be4491ecec199ca7b983ee46525853e5 Mon Sep 17 00:00:00 2001 From: Otto Date: Sat, 7 Mar 2026 17:17:25 +0100 Subject: [PATCH 2/6] Test self-contained unified hooks --- .gitignore | 1 + .ots/.attestation-cache | 19 +++ ...f5ab21764bc9a4507e25e0bc8de2989d4febad.ots | Bin 0 -> 595 bytes .ots/commit-chain.txt | 19 +++ ...eb0ad6782d2bc003206521cc66ea370dcccd9f.ots | Bin 0 -> 560 bytes .ots/prev-commit.txt | 2 +- .ots/proof.ots | Bin 630 -> 595 bytes hooks/install.sh | 50 ++++++ hooks/post-commit | 91 ++++++++++ hooks/pre-commit | 156 ++++++++++++++++++ test9.txt | 1 + 11 files changed, 338 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 .ots/4bf5ab21764bc9a4507e25e0bc8de2989d4febad.ots create mode 100644 .ots/f4eb0ad6782d2bc003206521cc66ea370dcccd9f.ots create mode 100755 hooks/install.sh create mode 100755 hooks/post-commit create mode 100755 hooks/pre-commit create mode 100644 test9.txt diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a8e2c1a --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.ots/.attestation-cache diff --git a/.ots/.attestation-cache b/.ots/.attestation-cache index aa496dc..45164d2 100644 --- a/.ots/.attestation-cache +++ b/.ots/.attestation-cache @@ -15,3 +15,22 @@ c0685dabfb48360a3abc103b75357f94e9f054b2:pending:1772897691 810d26b7af9c5d306e77fec290d360c7ac876b2e:pending:1772897694 3b54e0cb8c611d3f3525ad2386368f60200891f1:pending:1772897698 ed2cd259e918344c5a21ecf884b3178b4256ea74:pending:1772897704 +392ee723c3cf626d0e5281aa94771d7133bb345e:pending:1772897724 +db6f29e01a33d8ed8f127ff169d9f91d55e8a229:pending:1772897725 +4a6f5ed0c12315b0bc8a0fa5815ada1bd20e5963:pending:1772897726 +46aded7b9582bbed673843e2cf8a3f8fa742ad91:pending:1772897727 +c0685dabfb48360a3abc103b75357f94e9f054b2:pending:1772897728 +810d26b7af9c5d306e77fec290d360c7ac876b2e:pending:1772897728 +3b54e0cb8c611d3f3525ad2386368f60200891f1:pending:1772897729 +ed2cd259e918344c5a21ecf884b3178b4256ea74:pending:1772897730 +f4eb0ad6782d2bc003206521cc66ea370dcccd9f:pending:1772897732 +392ee723c3cf626d0e5281aa94771d7133bb345e:pending:1772900099 +db6f29e01a33d8ed8f127ff169d9f91d55e8a229:pending:1772900100 +4a6f5ed0c12315b0bc8a0fa5815ada1bd20e5963:pending:1772900100 +46aded7b9582bbed673843e2cf8a3f8fa742ad91:pending:1772900101 +c0685dabfb48360a3abc103b75357f94e9f054b2:pending:1772900102 +810d26b7af9c5d306e77fec290d360c7ac876b2e:pending:1772900103 +3b54e0cb8c611d3f3525ad2386368f60200891f1:pending:1772900104 +ed2cd259e918344c5a21ecf884b3178b4256ea74:pending:1772900105 +f4eb0ad6782d2bc003206521cc66ea370dcccd9f:pending:1772900106 +4bf5ab21764bc9a4507e25e0bc8de2989d4febad:pending:1772900109 diff --git a/.ots/4bf5ab21764bc9a4507e25e0bc8de2989d4febad.ots b/.ots/4bf5ab21764bc9a4507e25e0bc8de2989d4febad.ots new file mode 100644 index 0000000000000000000000000000000000000000..7277f907950c595054b8fef26a48a32d8699ae63 GIT binary patch literal 595 zcmZSZFG$S`$;?eHE=kNSC}v;?D9X=IW7yyM=tawmNmCd(;-{Mo@>&&xhD^3Z7=;GaR1n@x59xZCULC#_ET@S=|YbGA2_DAa%kx7yDY`= zLEu(=>w-;B|Lv{3DZcHbQN}iok1UyM{CPicXzcdiv@lAgk)iqiV_v!am-anmRD!2OI5jBP7ZyRgk#mZ_fJd#A>^vD1Fb<8R~GOI148)7rh2ac{+-p7xtw3@(eR#t-9 zjN;|w#1f!|i4{PXT4 zUp{P1x#6Il?Q!mQ%;ZzIoF}9zuKZUe6cE@x2k5}2n{OtRzYly_`P8~>_rdv{Iy&mL p9(M%Fszc`;&QE-w438K0T4!%Fx4T|&2kPm<9GIAsnVd=}W&m|d5V8OO literal 0 HcmV?d00001 diff --git a/.ots/commit-chain.txt b/.ots/commit-chain.txt index 5c48dc5..8f04c9f 100644 --- a/.ots/commit-chain.txt +++ b/.ots/commit-chain.txt @@ -28,3 +28,22 @@ c0685dabfb48360a3abc103b75357f94e9f054b2:46aded7b9582bbed673843e2cf8a3f8fa742ad9 4a6f5ed0c12315b0bc8a0fa5815ada1bd20e5963:db6f29e01a33d8ed8f127ff169d9f91d55e8a229 db6f29e01a33d8ed8f127ff169d9f91d55e8a229:392ee723c3cf626d0e5281aa94771d7133bb345e 392ee723c3cf626d0e5281aa94771d7133bb345e:392ee723c3cf626d0e5281aa94771d7133bb345e^1 +f4eb0ad6782d2bc003206521cc66ea370dcccd9f:ed2cd259e918344c5a21ecf884b3178b4256ea74 +ed2cd259e918344c5a21ecf884b3178b4256ea74:3b54e0cb8c611d3f3525ad2386368f60200891f1 +3b54e0cb8c611d3f3525ad2386368f60200891f1:810d26b7af9c5d306e77fec290d360c7ac876b2e +810d26b7af9c5d306e77fec290d360c7ac876b2e:c0685dabfb48360a3abc103b75357f94e9f054b2 +c0685dabfb48360a3abc103b75357f94e9f054b2:46aded7b9582bbed673843e2cf8a3f8fa742ad91 +46aded7b9582bbed673843e2cf8a3f8fa742ad91:4a6f5ed0c12315b0bc8a0fa5815ada1bd20e5963 +4a6f5ed0c12315b0bc8a0fa5815ada1bd20e5963:db6f29e01a33d8ed8f127ff169d9f91d55e8a229 +db6f29e01a33d8ed8f127ff169d9f91d55e8a229:392ee723c3cf626d0e5281aa94771d7133bb345e +392ee723c3cf626d0e5281aa94771d7133bb345e:392ee723c3cf626d0e5281aa94771d7133bb345e^1 +4bf5ab21764bc9a4507e25e0bc8de2989d4febad:f4eb0ad6782d2bc003206521cc66ea370dcccd9f +f4eb0ad6782d2bc003206521cc66ea370dcccd9f:ed2cd259e918344c5a21ecf884b3178b4256ea74 +ed2cd259e918344c5a21ecf884b3178b4256ea74:3b54e0cb8c611d3f3525ad2386368f60200891f1 +3b54e0cb8c611d3f3525ad2386368f60200891f1:810d26b7af9c5d306e77fec290d360c7ac876b2e +810d26b7af9c5d306e77fec290d360c7ac876b2e:c0685dabfb48360a3abc103b75357f94e9f054b2 +c0685dabfb48360a3abc103b75357f94e9f054b2:46aded7b9582bbed673843e2cf8a3f8fa742ad91 +46aded7b9582bbed673843e2cf8a3f8fa742ad91:4a6f5ed0c12315b0bc8a0fa5815ada1bd20e5963 +4a6f5ed0c12315b0bc8a0fa5815ada1bd20e5963:db6f29e01a33d8ed8f127ff169d9f91d55e8a229 +db6f29e01a33d8ed8f127ff169d9f91d55e8a229:392ee723c3cf626d0e5281aa94771d7133bb345e +392ee723c3cf626d0e5281aa94771d7133bb345e:392ee723c3cf626d0e5281aa94771d7133bb345e^1 diff --git a/.ots/f4eb0ad6782d2bc003206521cc66ea370dcccd9f.ots b/.ots/f4eb0ad6782d2bc003206521cc66ea370dcccd9f.ots new file mode 100644 index 0000000000000000000000000000000000000000..cebc5f6e0147d8214427f5793d549804dcce9553 GIT binary patch literal 560 zcmZSZFG$S`$;?eHE=kNSC}v;?D9X=IW7yyM=tawmNmCd((*CXUtF5WLlQqp)S?$h= zDgAcmO_yli|9AbEUPTaZG4}_7?s_-(Yf-0S8GGE@TbCY|=J@}Cqb^)>=gQ<`i#a|B zEcFd{IePzkZA+rS{@~-5?>IiPWUg^N@_{30$4t&8*Z)N_G~a*BtM`+qPe(hWq@Ma-UvfIb z(qoI&&DCAwM{Zb+j4@d;MOni(VOUT zEsYm$y`C=2`ox^f-5`k{l-m8-QV=^ODs>mxB^$NY|^RyW%sp|iOVeNIbv^p-_ARi z;~!ANoVMDgd1&E zxT$;46Qm@GQ^|PmiE9sx*Urmb_)MatDNR#R|Lux`6Q3eE!=r6^?}tlppsvUwpHA_Ykle6vXAdQ6V9*GbyO`qV7P2q#M%vN p69h7r!M&@kvFCL1_eCmjdo?vON=gcft@QQNGV}6MCr2|$0|3+fx{v?> delta 422 zcmcc2@{MJJVtv}bb$+!qm3OkH87r&ZIWeW*?!4&|&HMkZAJeM{;w|R>AaLh1FKdF@ z`x-@&4XdU)mUwdf|G=^Gt=ue|$zc;XJ}O+hng1~BXSYj*@3~%sWk=KBU$EXcsc9*v zY`T-x-_`8fIe;cCiC?k*uKh~u1-osmHP+1F_{fsE#&y*P4#N{{29*lue_x(>#X?Eo z@TpTLCR)Dz((Cbx|B7O@6 /dev/null 2>&1; then + echo "Error: not a git repository" >&2 + exit 1 +fi + +HOOKS_DIR="$(git rev-parse --git-dir)/hooks" + +echo "Installing OpenTimestamp hooks to: $HOOKS_DIR" + +# Copy hooks +cp "$SCRIPT_DIR/post-commit" "$HOOKS_DIR/post-commit" +cp "$SCRIPT_DIR/pre-commit" "$HOOKS_DIR/pre-commit" + +# Make executable +chmod +x "$HOOKS_DIR/post-commit" "$HOOKS_DIR/pre-commit" + +echo "✓ Post-commit hook installed" +echo "✓ Pre-commit backfill hook installed" + +# Setup .gitignore +GITIGNORE=".gitignore" +if [ ! -f "$GITIGNORE" ]; then + echo ".ots/.attestation-cache" > "$GITIGNORE" + echo "✓ Created .gitignore" +elif ! grep -q ".ots/.attestation-cache" "$GITIGNORE"; then + echo "" >> "$GITIGNORE" + echo ".ots/.attestation-cache" >> "$GITIGNORE" + echo "✓ Updated .gitignore" +fi + +echo "" +echo "Next steps:" +echo "1. Make a test commit to verify hooks work" +echo "2. Commit the .ots/ directory: git add .ots/" +echo "3. Commit with message: git commit -m 'Add OpenTimestamp proofs'" +echo "" +echo "To uninstall:" +echo " rm $HOOKS_DIR/post-commit $HOOKS_DIR/pre-commit" diff --git a/hooks/post-commit b/hooks/post-commit new file mode 100755 index 0000000..044dfe3 --- /dev/null +++ b/hooks/post-commit @@ -0,0 +1,91 @@ +#!/bin/bash +# Git OpenTimestamp Post-Commit Hook +# Self-contained - no external dependencies +# Generates cryptographic proof for each commit using OpenTimestamp + +set -e + +# Configuration +OUTPUT_DIR=".ots" +OUTPUT_FILE="$OUTPUT_DIR/proof.ots" + +# Ensure output directory exists +mkdir -p "$OUTPUT_DIR" + +# Get the current commit hash +COMMIT_HASH=$(git rev-parse HEAD) + +# Function to generate proof using ots CLI +generate_with_ots_cli() { + local hash="$1" + local output="$2" + + # Create a temporary file with the hash (convert hex to binary) + local temp_file=$(mktemp) + local temp_ots="${temp_file}.ots" + + # Use python3 for hex to binary conversion (more portable than xxd) + python3 -c "import sys; sys.stdout.buffer.write(bytes.fromhex('$hash'))" > "$temp_file" + + # Generate timestamp - ots creates .ots file alongside the original + ots stamp "$temp_file" 2>/dev/null + + # Move the generated .ots file to the desired location + if [ -f "$temp_ots" ]; then + mv "$temp_ots" "$output" + rm -f "$temp_file" + return 0 + else + rm -f "$temp_file" + return 1 + fi +} + +# Function to generate proof using nodejs fallback +generate_with_node() { + local hash="$1" + local output="$2" + + node -e " +const ots = require('@opentimestamps/ots'); +const fs = require('fs'); +const hash = '$hash'; +const output = '$output'; +const hashBuffer = Buffer.from(hash, 'hex'); +ots.Timestamp.hash(hashBuffer).then(timestamp => { + const proof = { hash: hash, timestamp: new Date().toISOString(), status: 'pending' }; + fs.writeFileSync(output, JSON.stringify(proof, null, 2)); + console.log('Generated local proof (nodejs fallback)'); +}).catch(err => { console.error('Error:', err); process.exit(1); }); +" +} + +# Check for available tools and generate proof +if command -v ots &> /dev/null; then + if generate_with_ots_cli "$COMMIT_HASH" "$OUTPUT_FILE"; then + echo "[ots] Generated proof with ots CLI: ${COMMIT_HASH:0:8}" + else + echo "[ots] Warning: ots CLI failed" >&2 + exit 0 + fi +elif command -v node &> /dev/null && node -e "require('@opentimestamps/ots')" &> /dev/null 2>&1; then + generate_with_node "$COMMIT_HASH" "$OUTPUT_FILE" + echo "[ots] Generated proof with nodejs fallback: ${COMMIT_HASH:0:8}" +else + echo "[ots] Warning: Neither ots CLI nor @opentimestamps/ots found, skipping proof" >&2 + exit 0 +fi + +# Save previous commit hash for chaining +PREV_COMMIT=$(git rev-parse HEAD^1 2>/dev/null || echo "") +if [ -n "$PREV_COMMIT" ]; then + echo "$PREV_COMMIT" > "$OUTPUT_DIR/prev-commit.txt" +fi + +# Create individual proof file for this commit +INDIVIDUAL_PROOF="$OUTPUT_DIR/${COMMIT_HASH}.ots" +if [ -f "$OUTPUT_FILE" ]; then + cp "$OUTPUT_FILE" "$INDIVIDUAL_PROOF" +fi + +echo "[ots] Proof generated successfully" diff --git a/hooks/pre-commit b/hooks/pre-commit new file mode 100755 index 0000000..9337782 --- /dev/null +++ b/hooks/pre-commit @@ -0,0 +1,156 @@ +#!/bin/bash +# Git OpenTimestamp Pre-Commit Backfill Hook +# Self-contained - no external dependencies +# Upgrades all historical proofs before each new commit + +set -e + +# Configuration +OUTPUT_DIR=".ots" +STATUS_CACHE="$OUTPUT_DIR/.attestation-cache" + +# Ensure output directory exists +mkdir -p "$OUTPUT_DIR" + +# Initialize cache file if it doesn't exist +if [ ! -f "$STATUS_CACHE" ]; then + echo "# Attestation status cache" > "$STATUS_CACHE" + echo "# Format: commit-hash:status:timestamp" >> "$STATUS_CACHE" +fi + +# Function to get cached status +get_cached_status() { + local commit="$1" + local cache_line=$(grep "^$commit:" "$STATUS_CACHE" 2>/dev/null | tail -1) + if [ -n "$cache_line" ]; then + local status=$(echo "$cache_line" | cut -d: -f2) + local timestamp=$(echo "$cache_line" | cut -d: -f3) + local now=$(date +%s) + local age=$((now - timestamp)) + # Cache valid for 1 hour (3600 seconds) + if [ "$age" -lt 3600 ]; then + echo "$status" + return 0 + fi + fi + return 1 +} + +# Function to cache status +cache_status() { + local commit="$1" + local status="$2" + local now=$(date +%s) + echo "$commit:$status:$now" >> "$STATUS_CACHE" +} + +# Function to generate proof using ots CLI +generate_proof() { + local hash="$1" + local output="$2" + + local temp_file=$(mktemp) + local temp_ots="${temp_file}.ots" + + python3 -c "import sys; sys.stdout.buffer.write(bytes.fromhex('$hash'))" > "$temp_file" + ots stamp "$temp_file" 2>/dev/null + + if [ -f "$temp_ots" ]; then + mv "$temp_ots" "$output" + rm -f "$temp_file" + return 0 + else + rm -f "$temp_file" + return 1 + fi +} + +# Function to check if proof is attested +is_attested() { + local proof_file="$1" + local pending_count=$(ots info "$proof_file" 2>&1 | grep -c "PendingAttestation" || echo "0") + [ "$pending_count" -eq 0 ] +} + +# Function to upgrade proof +upgrade_proof() { + local proof_file="$1" + ots upgrade "$proof_file" 2>/dev/null +} + +echo "[ots] Backfilling proofs..." + +# Get all commit hashes (oldest to newest) +COMMITS=$(git rev-list --reverse HEAD) +TOTAL=$(echo "$COMMITS" | wc -l) +CURRENT=0 +UPDATED=0 + +for COMMIT in $COMMITS; do + CURRENT=$((CURRENT + 1)) + PROOF_FILE="$OUTPUT_DIR/${COMMIT}.ots" + + # Skip verbose output for brevity + if [ $CURRENT -le 3 ] || [ $CURRENT -eq $TOTAL ]; then + echo "[ots] Processing commit $CURRENT/$TOTAL: ${COMMIT:0:8}" + elif [ $CURRENT -eq 4 ]; then + echo "[ots] ... processing remaining commits ..." + fi + + if [ -f "$PROOF_FILE" ]; then + # Check cached status first + CACHED_STATUS=$(get_cached_status "$COMMIT" || echo "") + + if [ "$CACHED_STATUS" = "attested" ]; then + continue + fi + + # Check if already attested + if is_attested "$PROOF_FILE"; then + cache_status "$COMMIT" "attested" + continue + fi + + # Cache as pending + cache_status "$COMMIT" "pending" + + # Skip upgrade if cache is fresh (< 10 min old) + CACHE_LINE=$(grep "^$COMMIT:" "$STATUS_CACHE" | tail -1) + CACHE_TIME=$(echo "$CACHE_LINE" | cut -d: -f3) + NOW=$(date +%s) + CACHE_AGE=$((NOW - CACHE_TIME)) + + if [ "$CACHE_AGE" -lt 600 ]; then + continue + fi + + # Try to upgrade + if upgrade_proof "$PROOF_FILE"; then + cache_status "$COMMIT" "attested" + UPDATED=$((UPDATED + 1)) + fi + else + # Generate new proof + if generate_proof "$COMMIT" "$PROOF_FILE"; then + cache_status "$COMMIT" "pending" + UPDATED=$((UPDATED + 1)) + fi + fi +done + +# Update latest proof symlink +LATEST_COMMIT=$(git rev-parse HEAD) +if [ -f "$OUTPUT_DIR/${LATEST_COMMIT}.ots" ]; then + cp "$OUTPUT_DIR/${LATEST_COMMIT}.ots" "$OUTPUT_DIR/proof.ots" +fi + +# Save commit chain +rm -f "$OUTPUT_DIR/commit-chain.txt" +git rev-list HEAD | while read COMMIT; do + PREV=$(git rev-parse ${COMMIT}^1 2>/dev/null || echo "") + if [ -n "$PREV" ]; then + echo "$COMMIT:$PREV" >> "$OUTPUT_DIR/commit-chain.txt" + fi +done + +echo "[ots] Backfill complete: $UPDATED proofs updated" diff --git a/test9.txt b/test9.txt new file mode 100644 index 0000000..10e6a35 --- /dev/null +++ b/test9.txt @@ -0,0 +1 @@ +# Test self-contained hooks From 02143e59edb79ecf121c99f4518ad232625f5df6 Mon Sep 17 00:00:00 2001 From: Otto Date: Sat, 7 Mar 2026 17:17:53 +0100 Subject: [PATCH 3/6] Implement self-contained unified hooks (no library) --- .ots/.attestation-cache | 11 +++++ ...c0f825be4491ecec199ca7b983ee46525853e5.ots | Bin 0 -> 770 bytes .ots/commit-chain.txt | 40 +----------------- ...d0ff03529b0a34146dbd97c3ebbb2b2f6d1faa.ots | Bin 0 -> 665 bytes .ots/prev-commit.txt | 2 +- .ots/proof.ots | Bin 595 -> 770 bytes UNIFICATION_PLAN.md | 21 ++++++++- 7 files changed, 33 insertions(+), 41 deletions(-) create mode 100644 .ots/a7c0f825be4491ecec199ca7b983ee46525853e5.ots create mode 100644 .ots/e2d0ff03529b0a34146dbd97c3ebbb2b2f6d1faa.ots diff --git a/.ots/.attestation-cache b/.ots/.attestation-cache index 45164d2..f20c055 100644 --- a/.ots/.attestation-cache +++ b/.ots/.attestation-cache @@ -34,3 +34,14 @@ c0685dabfb48360a3abc103b75357f94e9f054b2:pending:1772900102 ed2cd259e918344c5a21ecf884b3178b4256ea74:pending:1772900105 f4eb0ad6782d2bc003206521cc66ea370dcccd9f:pending:1772900106 4bf5ab21764bc9a4507e25e0bc8de2989d4febad:pending:1772900109 +392ee723c3cf626d0e5281aa94771d7133bb345e:pending:1772900246 +db6f29e01a33d8ed8f127ff169d9f91d55e8a229:pending:1772900247 +4a6f5ed0c12315b0bc8a0fa5815ada1bd20e5963:pending:1772900248 +46aded7b9582bbed673843e2cf8a3f8fa742ad91:pending:1772900248 +c0685dabfb48360a3abc103b75357f94e9f054b2:pending:1772900249 +810d26b7af9c5d306e77fec290d360c7ac876b2e:pending:1772900250 +3b54e0cb8c611d3f3525ad2386368f60200891f1:pending:1772900251 +ed2cd259e918344c5a21ecf884b3178b4256ea74:pending:1772900252 +f4eb0ad6782d2bc003206521cc66ea370dcccd9f:pending:1772900253 +4bf5ab21764bc9a4507e25e0bc8de2989d4febad:pending:1772900254 +e2d0ff03529b0a34146dbd97c3ebbb2b2f6d1faa:pending:1772900256 diff --git a/.ots/a7c0f825be4491ecec199ca7b983ee46525853e5.ots b/.ots/a7c0f825be4491ecec199ca7b983ee46525853e5.ots new file mode 100644 index 0000000000000000000000000000000000000000..0289f66b071f1a328085f81e71ac004b3754ec06 GIT binary patch literal 770 zcmZSZFG$S`$;?eHE=kNSC}v;?D9X=IW7yyM=tawmNmCd(rn-N9VDh`FXZgX0%4STw z1@*h4x!<4He!ov%viId9cDhZm*f8j4$C7#UqA4_^5OU( zU>-02_tlKdv?Grn@?;4dkmLBE@bp;kuLDX8%~+1=#;bNPhac$(ShM=Z#{COKfTWJktK7D|KblEDPECB zudO&4%FulOF|XcFo<1GzjFOUqVk>?9r2Hhkq>^O4zJ3dZ>xH*h~43~r2d&~3OVm?WKDk@7WLGx z<&P0i$poIyc80loC;qIh%=H(2ZNzI(}j5=F()%Ql~6E$5O^u}>GKV<#V$AYyqQ$^_+J{(_SIWd z9!4cZ_50l66aV;RSLoDE<)x9=mp}Nr=30iiByT&==bIH?i7{2#m;MXNvwxKlI5*iP zaew&2)feBiZ2Pn`syG(nz(pT8z9h_D_j}UWWVi!0HDC@*%goD51%@gt5u}!+7UgA@ LRF(sS8x+<6&+lg+ literal 0 HcmV?d00001 diff --git a/.ots/commit-chain.txt b/.ots/commit-chain.txt index 8f04c9f..b332115 100644 --- a/.ots/commit-chain.txt +++ b/.ots/commit-chain.txt @@ -1,42 +1,4 @@ -46aded7b9582bbed673843e2cf8a3f8fa742ad91:4a6f5ed0c12315b0bc8a0fa5815ada1bd20e5963 -4a6f5ed0c12315b0bc8a0fa5815ada1bd20e5963:db6f29e01a33d8ed8f127ff169d9f91d55e8a229 -db6f29e01a33d8ed8f127ff169d9f91d55e8a229:392ee723c3cf626d0e5281aa94771d7133bb345e -392ee723c3cf626d0e5281aa94771d7133bb345e:392ee723c3cf626d0e5281aa94771d7133bb345e^1 -c0685dabfb48360a3abc103b75357f94e9f054b2:46aded7b9582bbed673843e2cf8a3f8fa742ad91 -46aded7b9582bbed673843e2cf8a3f8fa742ad91:4a6f5ed0c12315b0bc8a0fa5815ada1bd20e5963 -4a6f5ed0c12315b0bc8a0fa5815ada1bd20e5963:db6f29e01a33d8ed8f127ff169d9f91d55e8a229 -db6f29e01a33d8ed8f127ff169d9f91d55e8a229:392ee723c3cf626d0e5281aa94771d7133bb345e -392ee723c3cf626d0e5281aa94771d7133bb345e:392ee723c3cf626d0e5281aa94771d7133bb345e^1 -810d26b7af9c5d306e77fec290d360c7ac876b2e:c0685dabfb48360a3abc103b75357f94e9f054b2 -c0685dabfb48360a3abc103b75357f94e9f054b2:46aded7b9582bbed673843e2cf8a3f8fa742ad91 -46aded7b9582bbed673843e2cf8a3f8fa742ad91:4a6f5ed0c12315b0bc8a0fa5815ada1bd20e5963 -4a6f5ed0c12315b0bc8a0fa5815ada1bd20e5963:db6f29e01a33d8ed8f127ff169d9f91d55e8a229 -db6f29e01a33d8ed8f127ff169d9f91d55e8a229:392ee723c3cf626d0e5281aa94771d7133bb345e -392ee723c3cf626d0e5281aa94771d7133bb345e:392ee723c3cf626d0e5281aa94771d7133bb345e^1 -3b54e0cb8c611d3f3525ad2386368f60200891f1:810d26b7af9c5d306e77fec290d360c7ac876b2e -810d26b7af9c5d306e77fec290d360c7ac876b2e:c0685dabfb48360a3abc103b75357f94e9f054b2 -c0685dabfb48360a3abc103b75357f94e9f054b2:46aded7b9582bbed673843e2cf8a3f8fa742ad91 -46aded7b9582bbed673843e2cf8a3f8fa742ad91:4a6f5ed0c12315b0bc8a0fa5815ada1bd20e5963 -4a6f5ed0c12315b0bc8a0fa5815ada1bd20e5963:db6f29e01a33d8ed8f127ff169d9f91d55e8a229 -db6f29e01a33d8ed8f127ff169d9f91d55e8a229:392ee723c3cf626d0e5281aa94771d7133bb345e -392ee723c3cf626d0e5281aa94771d7133bb345e:392ee723c3cf626d0e5281aa94771d7133bb345e^1 -ed2cd259e918344c5a21ecf884b3178b4256ea74:3b54e0cb8c611d3f3525ad2386368f60200891f1 -3b54e0cb8c611d3f3525ad2386368f60200891f1:810d26b7af9c5d306e77fec290d360c7ac876b2e -810d26b7af9c5d306e77fec290d360c7ac876b2e:c0685dabfb48360a3abc103b75357f94e9f054b2 -c0685dabfb48360a3abc103b75357f94e9f054b2:46aded7b9582bbed673843e2cf8a3f8fa742ad91 -46aded7b9582bbed673843e2cf8a3f8fa742ad91:4a6f5ed0c12315b0bc8a0fa5815ada1bd20e5963 -4a6f5ed0c12315b0bc8a0fa5815ada1bd20e5963:db6f29e01a33d8ed8f127ff169d9f91d55e8a229 -db6f29e01a33d8ed8f127ff169d9f91d55e8a229:392ee723c3cf626d0e5281aa94771d7133bb345e -392ee723c3cf626d0e5281aa94771d7133bb345e:392ee723c3cf626d0e5281aa94771d7133bb345e^1 -f4eb0ad6782d2bc003206521cc66ea370dcccd9f:ed2cd259e918344c5a21ecf884b3178b4256ea74 -ed2cd259e918344c5a21ecf884b3178b4256ea74:3b54e0cb8c611d3f3525ad2386368f60200891f1 -3b54e0cb8c611d3f3525ad2386368f60200891f1:810d26b7af9c5d306e77fec290d360c7ac876b2e -810d26b7af9c5d306e77fec290d360c7ac876b2e:c0685dabfb48360a3abc103b75357f94e9f054b2 -c0685dabfb48360a3abc103b75357f94e9f054b2:46aded7b9582bbed673843e2cf8a3f8fa742ad91 -46aded7b9582bbed673843e2cf8a3f8fa742ad91:4a6f5ed0c12315b0bc8a0fa5815ada1bd20e5963 -4a6f5ed0c12315b0bc8a0fa5815ada1bd20e5963:db6f29e01a33d8ed8f127ff169d9f91d55e8a229 -db6f29e01a33d8ed8f127ff169d9f91d55e8a229:392ee723c3cf626d0e5281aa94771d7133bb345e -392ee723c3cf626d0e5281aa94771d7133bb345e:392ee723c3cf626d0e5281aa94771d7133bb345e^1 +e2d0ff03529b0a34146dbd97c3ebbb2b2f6d1faa:4bf5ab21764bc9a4507e25e0bc8de2989d4febad 4bf5ab21764bc9a4507e25e0bc8de2989d4febad:f4eb0ad6782d2bc003206521cc66ea370dcccd9f f4eb0ad6782d2bc003206521cc66ea370dcccd9f:ed2cd259e918344c5a21ecf884b3178b4256ea74 ed2cd259e918344c5a21ecf884b3178b4256ea74:3b54e0cb8c611d3f3525ad2386368f60200891f1 diff --git a/.ots/e2d0ff03529b0a34146dbd97c3ebbb2b2f6d1faa.ots b/.ots/e2d0ff03529b0a34146dbd97c3ebbb2b2f6d1faa.ots new file mode 100644 index 0000000000000000000000000000000000000000..57a61049d1e375e08836b6e0a51a783a9f7c855d GIT binary patch literal 665 zcmZSZFG$S`$;?eHE=kNSC}v;?D9X=IW7yyM=tawmNmCd(^sX`4na*_2)cJ1IpDLQL zzT~v3L{0RqtDg@_bM$Ad+VMf)M$k@Xb&F7`Id@nrlBW2a=J@}C!>p2Vr}nY$IvgJa zUT(ds_eb5aTf2G@W1Q%Ll^h=xikROkxLVFk(I~E3C~#`pG5=E=+znPmWXOGbA-AUc zfeOb5g(p^5R-8-wYo%Gb-7M?ou7XYbe(`NN736>Hr`)btwFV10KC)!4@n7(P<6%c< zg37UitqjfgAM@({O`mQ4VyWsllAYviKG4p>^VGru5V>UsxReB+F}(?8Txh zoA;G2N`+gm{fURaHRzNJ+R(@uh>I$QzySI` z*Je|b(x;n~?u7gLr&?wcICZB@{VGnFm-v=bvU$`7(=ZCJ>}FYGx7 z7(ic7o@ln6UU%tL5WB~(C;rBp616of3S9nv*Y9CF>)o;x?n2SUMgDC*yV&3^)X|2! zFh7Y<@O%)srPw@e`khFLTGLSH2!XO3p!4L}%I4^ZnfzV$I%xG)VRz%kh1Pp4bDk{h z(hzCssWV;=v3vdp4*smP9|tG>Z-LvbsR6S)Ei*4K6&M<@m`N>3Ey~L*sVoNu6DW)T D)HWmp literal 0 HcmV?d00001 diff --git a/.ots/prev-commit.txt b/.ots/prev-commit.txt index 865151e..625117c 100644 --- a/.ots/prev-commit.txt +++ b/.ots/prev-commit.txt @@ -1 +1 @@ -4bf5ab21764bc9a4507e25e0bc8de2989d4febad +e2d0ff03529b0a34146dbd97c3ebbb2b2f6d1faa diff --git a/.ots/proof.ots b/.ots/proof.ots index 897fb4ee395978cbd2046999f87fbdcb32b8c32b..0289f66b071f1a328085f81e71ac004b3754ec06 100644 GIT binary patch delta 573 zcmV-D0>b^%1cC;TA%B%e_24x7dW@&R;UhKz4RC+DTMO^cEAPG^8I8l=B`)v~TGm`G z9YcDzX)0Mp!vn^>2>(+V>o2jV$nvB#*^!2=E{_ z*G`C@YQD86jTAn^hGLJI1|V$i*lL&KR$Apwg#0oH@F0*3^FA?cy^;BSd2LS>>oN<+ zAg>v^GoG+Z8(~8k9hV641Zk{Kqwoj^bXydPTbaTDgWux~F8K_OBO+*YbZ~PzFE3(r zV=j@88Gp@Y@%b4cEiMT0ATfy;L|BapOhbkJ6OW<<)#Emrh{nCKdBhx}>2MKEDG2Zo z+wR&N&|$VDK_#E$bKuP#2=E~II^nqn;IfnhQkc-E)n@bP&}jge3;oZMp6E`@BDcc` z@F1LqaLu_qPu9}aN#N;Vu6P$kuhL?Y0&Q}WpcaGmn=z9J@dRnCPowY%1dOf*LL2$5 zlYap^XXzI5^Vl|{MA*FSl5ykyW(e>gtF$EHT3}j_Oxz9^@#MNym5C#zS=XoF^{m!t zHyI6w2=O4ZAnFzZdOvmkQf@!$Xi=SGL}9;Ip{vpCgtqdzT60|p@dRnCPonS$^kAK? L`;yILlOO^!dk delta 386 zcmZo-yUa2{FF-@5wwpfpE+#;P431imuw^3YZ` zI=J!bm5HW?9~wCRe-N-*7Wz+F!yq^LPgUQ#e0C|0k1UyM{P{m{r0J(D+QyX?IXRQj zK*#sxw%AXd)4Vx82o!C(u%tGy`MaNdb$~tt(f%E<5Rain_4b#;*!NF&cf>|JwQVjN7%KsKTSCj8xa0( zt*9ew*cE|tMLx;na|?G~OMPJV4XEVTqHPuT?pj}Zx9sD4&xG^qbRAVo4;U_67O{4N Y+5~}&WpM9mYwS6l{C$zi Date: Sun, 8 Mar 2026 00:14:02 +0100 Subject: [PATCH 4/6] Test commit after hook unification --- .ots/.attestation-cache | 12 ++++++++++++ ...02143e59edb79ecf121c99f4518ad232625f5df6.ots | Bin 0 -> 945 bytes .ots/commit-chain.txt | 1 + .ots/prev-commit.txt | 2 +- .ots/proof.ots | Bin 770 -> 945 bytes test10.txt | 1 + 6 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 .ots/02143e59edb79ecf121c99f4518ad232625f5df6.ots create mode 100644 test10.txt diff --git a/.ots/.attestation-cache b/.ots/.attestation-cache index f20c055..7de6bd9 100644 --- a/.ots/.attestation-cache +++ b/.ots/.attestation-cache @@ -45,3 +45,15 @@ ed2cd259e918344c5a21ecf884b3178b4256ea74:pending:1772900252 f4eb0ad6782d2bc003206521cc66ea370dcccd9f:pending:1772900253 4bf5ab21764bc9a4507e25e0bc8de2989d4febad:pending:1772900254 e2d0ff03529b0a34146dbd97c3ebbb2b2f6d1faa:pending:1772900256 +392ee723c3cf626d0e5281aa94771d7133bb345e:pending:1772900273 +db6f29e01a33d8ed8f127ff169d9f91d55e8a229:pending:1772900274 +4a6f5ed0c12315b0bc8a0fa5815ada1bd20e5963:pending:1772900275 +46aded7b9582bbed673843e2cf8a3f8fa742ad91:pending:1772900276 +c0685dabfb48360a3abc103b75357f94e9f054b2:pending:1772900277 +810d26b7af9c5d306e77fec290d360c7ac876b2e:pending:1772900278 +3b54e0cb8c611d3f3525ad2386368f60200891f1:pending:1772900279 +ed2cd259e918344c5a21ecf884b3178b4256ea74:pending:1772900279 +f4eb0ad6782d2bc003206521cc66ea370dcccd9f:pending:1772900280 +4bf5ab21764bc9a4507e25e0bc8de2989d4febad:pending:1772900281 +e2d0ff03529b0a34146dbd97c3ebbb2b2f6d1faa:pending:1772900282 +a7c0f825be4491ecec199ca7b983ee46525853e5:pending:1772900283 diff --git a/.ots/02143e59edb79ecf121c99f4518ad232625f5df6.ots b/.ots/02143e59edb79ecf121c99f4518ad232625f5df6.ots new file mode 100644 index 0000000000000000000000000000000000000000..9ed45da2b6e9c4b78248b7a02135f6dc04b10d94 GIT binary patch literal 945 zcmZSZFG$S`$;?eHE=kNSC}v;?D9X=IW7yyM=tawmNmCd(GQw;>EpPu;UsX>x zA4R2S{0j_#N@}mZbK9D@{J3kr?xZ=>{idJcO1%DV9*dCKzxyZ=o&V_X|UVU+@X}`y3p$cVT7xgB*VE%o>*33sQCrd7BKG4h%^k|!rGm$m9AmEkd5t_ zg3bfS9LvkH`@R58F}e3Pjk`Ed=Z&4TL!AD*mu(e$ZdG&({&7q2+Fp6!`yP0xh5i2P X7^Zr?8y;$Uy0B17%*jknB@}J|X@0A1 literal 0 HcmV?d00001 diff --git a/.ots/commit-chain.txt b/.ots/commit-chain.txt index b332115..b42f52a 100644 --- a/.ots/commit-chain.txt +++ b/.ots/commit-chain.txt @@ -1,3 +1,4 @@ +a7c0f825be4491ecec199ca7b983ee46525853e5:e2d0ff03529b0a34146dbd97c3ebbb2b2f6d1faa e2d0ff03529b0a34146dbd97c3ebbb2b2f6d1faa:4bf5ab21764bc9a4507e25e0bc8de2989d4febad 4bf5ab21764bc9a4507e25e0bc8de2989d4febad:f4eb0ad6782d2bc003206521cc66ea370dcccd9f f4eb0ad6782d2bc003206521cc66ea370dcccd9f:ed2cd259e918344c5a21ecf884b3178b4256ea74 diff --git a/.ots/prev-commit.txt b/.ots/prev-commit.txt index 625117c..253c46a 100644 --- a/.ots/prev-commit.txt +++ b/.ots/prev-commit.txt @@ -1 +1 @@ -e2d0ff03529b0a34146dbd97c3ebbb2b2f6d1faa +a7c0f825be4491ecec199ca7b983ee46525853e5 diff --git a/.ots/proof.ots b/.ots/proof.ots index 0289f66b071f1a328085f81e71ac004b3754ec06..9ed45da2b6e9c4b78248b7a02135f6dc04b10d94 100644 GIT binary patch delta 743 zcmZo-+sHmau|6ZrruT|*Q0XSu-!II~UhXu~cxaFp^0(Qx!}u-Fhvf|)1lCJ`c>Yv1 zJL=hfKkxa692ao>{~%y?OxMTLam)N=Eu4A_RVOEKd{F2){XttMwk-DEg^=c;zsj2` z5@WQSE=?hkU%o&8b^=c%hL(F)dQG5%SyO=;35e{=p= zgA1FkZUJB{Z4Q3hJA*~8;_?CvK4xe_CnScPKAUFAGyg|+NXZLd^W^Yz$tPq@v|ha6_s zhNZt{XukiLSMMiJpU%X~I`tno{_}9Z`LlvC4QN*GCOzqYmt5QJ=Q&rteBXcR%ACwq zXZHz-I9RE$q(pu21uFUPczBz*d!Jy%j^CA^i;QgUTv#{b)fcCl_IrF53I?8iKqcqO z4V<{NSvbAUIbXG!yGg>kIn6lzD(5ezDjw6gqgxb!UVV~bqJG(CLf5DIol-oCaX;?? zwK;Y^o6xs9<2cWw+4sMOn@m0SZ1ajo3nN^`BpJ?C^2D+NgTpVNwt#VWMx)n&}m@EJTvs&T+ delta 556 zcmV+{0@MAm2Z9EWA%B%e_24x7dW@&R;UhKz4RC+DTMO^cEAPG^8I8l=B`)v~TGm`G z9YcDzX)0Mp!vn^>2>Aa_Z(=AEbxvbkHv2Y z@E|tVPKcgrzO^Tf6h6a-Vvm^yAZ+f~YM0|yTIEiJ{4xmeAdn36J~3^*k@!FO(_WQ5ZmtB9MEC5Bta#g)k15%jKr`2Zj=+J2Zm<#>SlAh>J%p$kL2=E}BhH%ZfJWtlr)k)y#V6J!< zMX%Cgk^*gVlNX?a^_wx12=N4ItWTrx2n39-20|P8t&@2JIBD<@=@#J|ceKXv|6 uZa?a1QJrH%VZT?QtI_O)w(_}Jb6p7W1Zk{KqVNdxV4be}lFeh2n*lTbK@o!h diff --git a/test10.txt b/test10.txt new file mode 100644 index 0000000..e6451d2 --- /dev/null +++ b/test10.txt @@ -0,0 +1 @@ +# Another test commit From 6dc83992382d17c347a30c823204646d02750fc5 Mon Sep 17 00:00:00 2001 From: Otto Date: Sun, 8 Mar 2026 00:36:44 +0100 Subject: [PATCH 5/6] Test separated ots hooks --- .ots/.attestation-cache | 13 ++ ...4cd5386431eb9d1fe1335c591452ba0b66cb6e.ots | Bin 0 -> 700 bytes .ots/commit-chain.txt | 1 + .ots/prev-commit.txt | 2 +- .ots/proof.ots | Bin 945 -> 700 bytes hooks/install.sh | 67 ++++++++-- hooks/post-commit-node | 49 +++++++ hooks/post-commit-ots | 41 ++++++ hooks/pre-commit-node | 100 ++++++++++++++ hooks/pre-commit-ots | 125 ++++++++++++++++++ test11.txt | 1 + 11 files changed, 386 insertions(+), 13 deletions(-) create mode 100644 .ots/094cd5386431eb9d1fe1335c591452ba0b66cb6e.ots create mode 100755 hooks/post-commit-node create mode 100755 hooks/post-commit-ots create mode 100755 hooks/pre-commit-node create mode 100755 hooks/pre-commit-ots create mode 100644 test11.txt diff --git a/.ots/.attestation-cache b/.ots/.attestation-cache index 7de6bd9..1ba9498 100644 --- a/.ots/.attestation-cache +++ b/.ots/.attestation-cache @@ -57,3 +57,16 @@ f4eb0ad6782d2bc003206521cc66ea370dcccd9f:pending:1772900280 4bf5ab21764bc9a4507e25e0bc8de2989d4febad:pending:1772900281 e2d0ff03529b0a34146dbd97c3ebbb2b2f6d1faa:pending:1772900282 a7c0f825be4491ecec199ca7b983ee46525853e5:pending:1772900283 +392ee723c3cf626d0e5281aa94771d7133bb345e:pending:1772925243 +db6f29e01a33d8ed8f127ff169d9f91d55e8a229:pending:1772925244 +4a6f5ed0c12315b0bc8a0fa5815ada1bd20e5963:pending:1772925245 +46aded7b9582bbed673843e2cf8a3f8fa742ad91:pending:1772925245 +c0685dabfb48360a3abc103b75357f94e9f054b2:pending:1772925246 +810d26b7af9c5d306e77fec290d360c7ac876b2e:pending:1772925247 +3b54e0cb8c611d3f3525ad2386368f60200891f1:pending:1772925248 +ed2cd259e918344c5a21ecf884b3178b4256ea74:pending:1772925249 +f4eb0ad6782d2bc003206521cc66ea370dcccd9f:pending:1772925250 +4bf5ab21764bc9a4507e25e0bc8de2989d4febad:pending:1772925251 +e2d0ff03529b0a34146dbd97c3ebbb2b2f6d1faa:pending:1772925251 +a7c0f825be4491ecec199ca7b983ee46525853e5:pending:1772925252 +02143e59edb79ecf121c99f4518ad232625f5df6:pending:1772925253 diff --git a/.ots/094cd5386431eb9d1fe1335c591452ba0b66cb6e.ots b/.ots/094cd5386431eb9d1fe1335c591452ba0b66cb6e.ots new file mode 100644 index 0000000000000000000000000000000000000000..d9ae0ccd2efde0dd6712d4fb78bbc31979e0394a GIT binary patch literal 700 zcmZSZFG$S`$;?eHE=kNSC}v;?D9X=IW7yyM=tawmNmCd(7H={5_<3^>`~9maIWsaR zTP3$K9|Qs$*RW_j_1;(z zcCK%6;DOy79~3(0w{P#>s=VN7=tMc?#1vkuaQhi0clvD}@13rmaN+(Uj*l#vYc_g( z;Hcx=KSftvMwg-a{$pOfpFDlaN*N_31;tkS`bj0pddZ17sd*`hML#}FLt3bVSkvQ}mm%SAYTH`Q zzTdO8$K=L^J_`}tOYC~yzDaWPoR_QfwT@0J_U6mu?wS1cQ;hMOh3EHthkHW#WV)Gc&VgxgPw45w zJdv1_nVhPJ;+1@0B$U7-K`*~39q6A&y4(J&Kf?JA=pX4Xw;w)>QAxknBeXDIXp=C< zM}_^OSqAb<#?viQY}ikSRjL`?_+fSYqk-j%)0qeTWck)YT;l$LWBx+XUD6SG_u($l z(T2GsDL;vjJ3a_}(n?DfJ9O`*9iLyv>&$%*fp*X9U%NHPvhmMJ8|ClGuk9t%j4wQQ z&(Cz9RNQJT@W;L$s6^`jgUb^uJOtHWG%HTDcTvt?v23M@TmQxA>9_6~X&Fp~J1=m< oO2*fTyIA4Q)6{@DFD)}KFBKTOun12rNiE9DEU7F9Mms3Z0r9pz)&Kwi literal 0 HcmV?d00001 diff --git a/.ots/commit-chain.txt b/.ots/commit-chain.txt index b42f52a..392bce1 100644 --- a/.ots/commit-chain.txt +++ b/.ots/commit-chain.txt @@ -1,3 +1,4 @@ +02143e59edb79ecf121c99f4518ad232625f5df6:a7c0f825be4491ecec199ca7b983ee46525853e5 a7c0f825be4491ecec199ca7b983ee46525853e5:e2d0ff03529b0a34146dbd97c3ebbb2b2f6d1faa e2d0ff03529b0a34146dbd97c3ebbb2b2f6d1faa:4bf5ab21764bc9a4507e25e0bc8de2989d4febad 4bf5ab21764bc9a4507e25e0bc8de2989d4febad:f4eb0ad6782d2bc003206521cc66ea370dcccd9f diff --git a/.ots/prev-commit.txt b/.ots/prev-commit.txt index 253c46a..9d540e0 100644 --- a/.ots/prev-commit.txt +++ b/.ots/prev-commit.txt @@ -1 +1 @@ -a7c0f825be4491ecec199ca7b983ee46525853e5 +02143e59edb79ecf121c99f4518ad232625f5df6 diff --git a/.ots/proof.ots b/.ots/proof.ots index 9ed45da2b6e9c4b78248b7a02135f6dc04b10d94..d9ae0ccd2efde0dd6712d4fb78bbc31979e0394a 100644 GIT binary patch delta 489 zcmdnUzK3;!V*TPR1|L6f4r0H5H6>?8=7dWfKgCXMk4)2ue`2zIoA0Y<9|UZLuHC=( zOY51>#;=D~s7$@c@&AKBVB;DVji=rl3&PIzEe<@eo8yB*=lu5V-CLCxJPn;Fr<|C= zYZY!kqvTG%&Evh()e|n|pyG~a*BJMpkqJ;&sh4F2-8 z|ED=V2z=?@vxjRPAlCFa=4D9uo7%RPv+wt8?J>D=q0fTD z-}|_|zaCIYA#am6!?ORbUz%?#-{x1nu4U=F$RyYKrkC9Vje9*Q$v`ER(Gt6!w{Mc% zJm=-=e66F?ioN;rxO*ml{S+f^{AS_#J>TK(Q$Cq)W}9I3DS4`?LNC z=R2V5q`%yL_$)>x{aTOE!hE4k!W0c z9`uvtTMIGP{R7ARg`&HpBl7M~c4jiq5cs5(mMnJY-b*_^zmC_L`yK*Kn%BQ}YmjB* zpOZGq-;-b4OQsoLc-80fMmV*IR delta 742 zcmdnPx{-Z?Vtq!KP45-spwdmQzh9V}z1(S}@z5YI@cgN2 zcGR=|e%|vBIWFM%|3Sd)n68hfUsH=Hs6wov-Rr*<~s^)-Tv~sH|w-Xoc9Ya%;NZ{5cJo_++gp? z_a*Ujr8P40>!bK<`G1=HV?8k;<7s8NKgd0I_De0Cr>?d{D_Eb!_-DyBrAeFo&G};u zE^NBKO@>?I4^YXDDLZrJd3$e8++j~V2$@Z8ifqu;+75Se$A=ek>l)(EP3~keuK)jm3dNGU%6ZNTYuTOJUa7L?>#^ycaGRqKIn1mL zOMlDIeE%`8-cO!BoylJqb?Z6)^KifUvw|@VXjbkfJ?Vd!T-)vEIaj`X-+$@KoXk~c z_X&wOSgEk2M1AlDD*5ktc$>I;pJ2s~-<6+>jBM^)SU2O<7pI!`dwdoO2A+LDCFjZw zoVc`EIK9p}U$vUMNy581%{cuk=P#xz9@Ds^TNHp^eUf3Ke%WS1*QcHJQap-rKkosx zId(pq(6>6{IM1Wm_rHdlOg;8&^NL3cBV5HK8O~Mm#Igc|!!Mw=fN^(5q+#$D*6w_* zbPel;Y;4CAbRIb7SYDRh_XTK*$-TE}+{J-9Z|tNU;`HCWY^&IFtD;-*k6VJ*_R0g_ V_rQZA?Dt>CFxBgf-IEg-EdYjMT4?|P diff --git a/hooks/install.sh b/hooks/install.sh index c96c932..3de1a6e 100755 --- a/hooks/install.sh +++ b/hooks/install.sh @@ -1,6 +1,6 @@ #!/bin/bash # Git OpenTimestamp Hooks Installer -# Copies self-contained hooks to git repository +# Detects available tools and installs matching hooks set -e @@ -9,21 +9,50 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" cd "$REPO_PATH" -# Verify we're in a git repository if ! git rev-parse --git-dir > /dev/null 2>&1; then echo "Error: not a git repository" >&2 exit 1 fi HOOKS_DIR="$(git rev-parse --git-dir)/hooks" +MODE="" -echo "Installing OpenTimestamp hooks to: $HOOKS_DIR" +# Detect available tools +if command -v ots &> /dev/null; then + MODE="ots" + echo "Detected: ots CLI" +elif command -v node &> /dev/null && node -e "require('@opentimestamps/ots')" &> /dev/null 2>&1; then + MODE="node" + echo "Detected: @opentimestamps/ots (Node.js)" + echo "Note: Node version creates local proofs only (no calendar submission)" + echo "" + + # Install node package locally if not already present + if [ ! -d "node_modules/@opentimestamps" ]; then + echo "Installing @opentimestamps/ots locally..." + npm install @opentimestamps/ots + echo "✓ Package installed" + fi +else + echo "Error: Neither ots CLI nor @opentimestamps/ots found" >&2 + echo "Install one of:" >&2 + echo " pipx install opentimestamps-client (recommended)" >&2 + echo " npm install @opentimestamps/ots (local proofs only)" >&2 + exit 1 +fi -# Copy hooks -cp "$SCRIPT_DIR/post-commit" "$HOOKS_DIR/post-commit" -cp "$SCRIPT_DIR/pre-commit" "$HOOKS_DIR/pre-commit" +echo "" +echo "Installing $MODE hooks to: $HOOKS_DIR" + +# Copy appropriate hooks +if [ "$MODE" = "ots" ]; then + cp "$SCRIPT_DIR/post-commit-ots" "$HOOKS_DIR/post-commit" + cp "$SCRIPT_DIR/pre-commit-ots" "$HOOKS_DIR/pre-commit" +else + cp "$SCRIPT_DIR/post-commit-node" "$HOOKS_DIR/post-commit" + cp "$SCRIPT_DIR/pre-commit-node" "$HOOKS_DIR/pre-commit" +fi -# Make executable chmod +x "$HOOKS_DIR/post-commit" "$HOOKS_DIR/pre-commit" echo "✓ Post-commit hook installed" @@ -32,19 +61,33 @@ echo "✓ Pre-commit backfill hook installed" # Setup .gitignore GITIGNORE=".gitignore" if [ ! -f "$GITIGNORE" ]; then - echo ".ots/.attestation-cache" > "$GITIGNORE" + cat > "$GITIGNORE" << 'EOF' +.ots/.attestation-cache +node_modules/ +EOF echo "✓ Created .gitignore" elif ! grep -q ".ots/.attestation-cache" "$GITIGNORE"; then - echo "" >> "$GITIGNORE" echo ".ots/.attestation-cache" >> "$GITIGNORE" + if [ "$MODE" = "node" ] && ! grep -q "node_modules/" "$GITIGNORE"; then + echo "node_modules/" >> "$GITIGNORE" + fi echo "✓ Updated .gitignore" fi +echo "" +echo "Mode: $MODE" +if [ "$MODE" = "ots" ]; then + echo " - Full Bitcoin attestation via calendars" + echo " - Proofs submitted to remote calendars" +else + echo " - Local proofs only (no calendar submission)" + echo " - For full attestation, use: pipx install opentimestamps-client" +fi + echo "" echo "Next steps:" -echo "1. Make a test commit to verify hooks work" -echo "2. Commit the .ots/ directory: git add .ots/" -echo "3. Commit with message: git commit -m 'Add OpenTimestamp proofs'" +echo "1. Make a test commit" +echo "2. Commit proofs: git add .ots/ && git commit -m 'Add OpenTimestamp proofs'" echo "" echo "To uninstall:" echo " rm $HOOKS_DIR/post-commit $HOOKS_DIR/pre-commit" diff --git a/hooks/post-commit-node b/hooks/post-commit-node new file mode 100755 index 0000000..06bb92b --- /dev/null +++ b/hooks/post-commit-node @@ -0,0 +1,49 @@ +#!/bin/bash +# Git OpenTimestamp Post-Commit Hook (Node.js version) +# Requires: @opentimestamps/ots (npm install) + +set -e + +OUTPUT_DIR=".ots" +OUTPUT_FILE="$OUTPUT_DIR/proof.ots" + +mkdir -p "$OUTPUT_DIR" + +COMMIT_HASH=$(git rev-parse HEAD) + +# Generate proof using Node.js +node -e " +const ots = require('@opentimestamps/ots'); +const fs = require('fs'); +const hash = '$COMMIT_HASH'; +const output = '$OUTPUT_FILE'; +const hashBuffer = Buffer.from(hash, 'hex'); + +ots.Timestamp.hash(hashBuffer).then(timestamp => { + // Note: This creates a local proof only, not submitted to calendars + // For full Bitcoin attestation, use the ots CLI version + const proof = { + hash: hash, + timestamp: new Date().toISOString(), + status: 'pending', + note: 'Local proof only - use ots CLI for calendar submission' + }; + fs.writeFileSync(output, JSON.stringify(proof, null, 2)); + console.log('[ots-node] Generated local proof: ' + hash.substring(0, 8)); +}).catch(err => { + console.error('[ots-node] Error:', err.message); + process.exit(1); +}); +" + +# Save previous commit for chaining +PREV_COMMIT=$(git rev-parse HEAD^1 2>/dev/null || echo "") +if [ -n "$PREV_COMMIT" ]; then + echo "$PREV_COMMIT" > "$OUTPUT_DIR/prev-commit.txt" +fi + +# Create individual proof file (JSON format for node version) +INDIVIDUAL_PROOF="$OUTPUT_DIR/${COMMIT_HASH}.ots" +cp "$OUTPUT_FILE" "$INDIVIDUAL_PROOF" + +echo "[ots-node] Proof generated successfully" diff --git a/hooks/post-commit-ots b/hooks/post-commit-ots new file mode 100755 index 0000000..776cc89 --- /dev/null +++ b/hooks/post-commit-ots @@ -0,0 +1,41 @@ +#!/bin/bash +# Git OpenTimestamp Post-Commit Hook (ots CLI version) +# Requires: opentimestamps-client (pipx install opentimestamps-client) + +set -e + +OUTPUT_DIR=".ots" +OUTPUT_FILE="$OUTPUT_DIR/proof.ots" + +mkdir -p "$OUTPUT_DIR" + +COMMIT_HASH=$(git rev-parse HEAD) + +# Generate proof using ots CLI +temp_file=$(mktemp) +temp_ots="${temp_file}.ots" + +python3 -c "import sys; sys.stdout.buffer.write(bytes.fromhex('$COMMIT_HASH'))" > "$temp_file" +ots stamp "$temp_file" 2>/dev/null + +if [ -f "$temp_ots" ]; then + mv "$temp_ots" "$OUTPUT_FILE" + rm -f "$temp_file" + echo "[ots] Generated proof: ${COMMIT_HASH:0:8}" +else + rm -f "$temp_file" + echo "[ots] Warning: Failed to generate proof" >&2 + exit 0 +fi + +# Save previous commit for chaining +PREV_COMMIT=$(git rev-parse HEAD^1 2>/dev/null || echo "") +if [ -n "$PREV_COMMIT" ]; then + echo "$PREV_COMMIT" > "$OUTPUT_DIR/prev-commit.txt" +fi + +# Create individual proof file +INDIVIDUAL_PROOF="$OUTPUT_DIR/${COMMIT_HASH}.ots" +cp "$OUTPUT_FILE" "$INDIVIDUAL_PROOF" + +echo "[ots] Proof generated successfully" diff --git a/hooks/pre-commit-node b/hooks/pre-commit-node new file mode 100755 index 0000000..76d033e --- /dev/null +++ b/hooks/pre-commit-node @@ -0,0 +1,100 @@ +#!/bin/bash +# Git OpenTimestamp Pre-Commit Backfill Hook (Node.js version) +# Requires: @opentimestamps/ots (npm install) +# Note: Node version only generates local proofs, no calendar submission + +set -e + +OUTPUT_DIR=".ots" +STATUS_CACHE="$OUTPUT_DIR/.attestation-cache" + +mkdir -p "$OUTPUT_DIR" + +# Initialize cache +if [ ! -f "$STATUS_CACHE" ]; then + echo "# Format: commit-hash:status:timestamp" > "$STATUS_CACHE" +fi + +get_cached_status() { + local commit="$1" + local cache_line=$(grep "^$commit:" "$STATUS_CACHE" 2>/dev/null | tail -1) + if [ -n "$cache_line" ]; then + local status=$(echo "$cache_line" | cut -d: -f2) + local timestamp=$(echo "$cache_line" | cut -d: -f3) + local now=$(date +%s) + if [ "$((now - timestamp))" -lt 3600 ]; then + echo "$status" + return 0 + fi + fi + return 1 +} + +cache_status() { + local commit="$1" + local status="$2" + echo "$commit:$status:$(date +%s)" >> "$STATUS_CACHE" +} + +generate_proof_node() { + local hash="$1" + local output="$2" + + node -e " +const ots = require('@opentimestamps/ots'); +const fs = require('fs'); +const hash = '$hash'; +const output = '$output'; +const hashBuffer = Buffer.from(hash, 'hex'); + +ots.Timestamp.hash(hashBuffer).then(timestamp => { + const proof = { hash: hash, timestamp: new Date().toISOString(), status: 'pending' }; + fs.writeFileSync(output, JSON.stringify(proof, null, 2)); +}).catch(err => { console.error('Error:', err); process.exit(1); }); +" +} + +echo "[ots-node] Backfilling proofs (local only, no calendar)..." + +COMMITS=$(git rev-list --reverse HEAD) +TOTAL=$(echo "$COMMITS" | wc -l) +CURRENT=0 +UPDATED=0 + +for COMMIT in $COMMITS; do + CURRENT=$((CURRENT + 1)) + PROOF_FILE="$OUTPUT_DIR/${COMMIT}.ots" + + if [ $CURRENT -le 3 ] || [ $CURRENT -eq $TOTAL ]; then + echo "[ots-node] Processing $CURRENT/$TOTAL: ${COMMIT:0:8}" + elif [ $CURRENT -eq 4 ]; then + echo "[ots-node] ... processing remaining ..." + fi + + if [ -f "$PROOF_FILE" ]; then + # Node version doesn't support upgrade, just check cache + CACHED_STATUS=$(get_cached_status "$COMMIT" || echo "") + [ "$CACHED_STATUS" = "attested" ] && continue + + # Mark as pending (node can't attest) + cache_status "$COMMIT" "pending" + else + if generate_proof_node "$COMMIT" "$PROOF_FILE"; then + cache_status "$COMMIT" "pending" + UPDATED=$((UPDATED + 1)) + fi + fi +done + +# Update latest proof +LATEST_COMMIT=$(git rev-parse HEAD) +[ -f "$OUTPUT_DIR/${LATEST_COMMIT}.ots" ] && cp "$OUTPUT_DIR/${LATEST_COMMIT}.ots" "$OUTPUT_DIR/proof.ots" + +# Save commit chain +rm -f "$OUTPUT_DIR/commit-chain.txt" +git rev-list HEAD | while read COMMIT; do + PREV=$(git rev-parse ${COMMIT}^1 2>/dev/null || echo "") + [ -n "$PREV" ] && echo "$COMMIT:$PREV" >> "$OUTPUT_DIR/commit-chain.txt" +done + +echo "[ots-node] Backfill complete: $UPDATED generated (local proofs only)" diff --git a/hooks/pre-commit-ots b/hooks/pre-commit-ots new file mode 100755 index 0000000..65d354d --- /dev/null +++ b/hooks/pre-commit-ots @@ -0,0 +1,125 @@ +#!/bin/bash +# Git OpenTimestamp Pre-Commit Backfill Hook (ots CLI version) +# Requires: opentimestamps-client (pipx install opentimestamps-client) + +set -e + +OUTPUT_DIR=".ots" +STATUS_CACHE="$OUTPUT_DIR/.attestation-cache" + +mkdir -p "$OUTPUT_DIR" + +# Initialize cache +if [ ! -f "$STATUS_CACHE" ]; then + echo "# Format: commit-hash:status:timestamp" > "$STATUS_CACHE" +fi + +get_cached_status() { + local commit="$1" + local cache_line=$(grep "^$commit:" "$STATUS_CACHE" 2>/dev/null | tail -1) + if [ -n "$cache_line" ]; then + local status=$(echo "$cache_line" | cut -d: -f2) + local timestamp=$(echo "$cache_line" | cut -d: -f3) + local now=$(date +%s) + if [ "$((now - timestamp))" -lt 3600 ]; then + echo "$status" + return 0 + fi + fi + return 1 +} + +cache_status() { + local commit="$1" + local status="$2" + echo "$commit:$status:$(date +%s)" >> "$STATUS_CACHE" +} + +generate_proof() { + local hash="$1" + local output="$2" + local temp_file=$(mktemp) + local temp_ots="${temp_file}.ots" + + python3 -c "import sys; sys.stdout.buffer.write(bytes.fromhex('$hash'))" > "$temp_file" + ots stamp "$temp_file" 2>/dev/null + + if [ -f "$temp_ots" ]; then + mv "$temp_ots" "$output" + rm -f "$temp_file" + return 0 + fi + rm -f "$temp_file" + return 1 +} + +is_attested() { + local proof_file="$1" + local pending_count=$(ots info "$proof_file" 2>&1 | grep -c "PendingAttestation" || echo "0") + [ "$pending_count" -eq 0 ] +} + +upgrade_proof() { + local proof_file="$1" + ots upgrade "$proof_file" 2>/dev/null +} + +echo "[ots] Backfilling proofs..." + +COMMITS=$(git rev-list --reverse HEAD) +TOTAL=$(echo "$COMMITS" | wc -l) +CURRENT=0 +UPDATED=0 + +for COMMIT in $COMMITS; do + CURRENT=$((CURRENT + 1)) + PROOF_FILE="$OUTPUT_DIR/${COMMIT}.ots" + + if [ $CURRENT -le 3 ] || [ $CURRENT -eq $TOTAL ]; then + echo "[ots] Processing $CURRENT/$TOTAL: ${COMMIT:0:8}" + elif [ $CURRENT -eq 4 ]; then + echo "[ots] ... processing remaining ..." + fi + + if [ -f "$PROOF_FILE" ]; then + CACHED_STATUS=$(get_cached_status "$COMMIT" || echo "") + + [ "$CACHED_STATUS" = "attested" ] && continue + + if is_attested "$PROOF_FILE"; then + cache_status "$COMMIT" "attested" + continue + fi + + cache_status "$COMMIT" "pending" + + CACHE_LINE=$(grep "^$COMMIT:" "$STATUS_CACHE" | tail -1) + CACHE_TIME=$(echo "$CACHE_LINE" | cut -d: -f3) + CACHE_AGE=$(($(date +%s) - CACHE_TIME)) + + [ "$CACHE_AGE" -lt 600 ] && continue + + if upgrade_proof "$PROOF_FILE"; then + cache_status "$COMMIT" "attested" + UPDATED=$((UPDATED + 1)) + fi + else + if generate_proof "$COMMIT" "$PROOF_FILE"; then + cache_status "$COMMIT" "pending" + UPDATED=$((UPDATED + 1)) + fi + fi +done + +# Update latest proof +LATEST_COMMIT=$(git rev-parse HEAD) +[ -f "$OUTPUT_DIR/${LATEST_COMMIT}.ots" ] && cp "$OUTPUT_DIR/${LATEST_COMMIT}.ots" "$OUTPUT_DIR/proof.ots" + +# Save commit chain +rm -f "$OUTPUT_DIR/commit-chain.txt" +git rev-list HEAD | while read COMMIT; do + PREV=$(git rev-parse ${COMMIT}^1 2>/dev/null || echo "") + [ -n "$PREV" ] && echo "$COMMIT:$PREV" >> "$OUTPUT_DIR/commit-chain.txt" +done + +echo "[ots] Backfill complete: $UPDATED updated" diff --git a/test11.txt b/test11.txt new file mode 100644 index 0000000..0ef48fe --- /dev/null +++ b/test11.txt @@ -0,0 +1 @@ +# Test new ots-only hooks From 9afe7a1b3171f8c60024502db84632a02ca23dd1 Mon Sep 17 00:00:00 2001 From: Otto Date: Sun, 8 Mar 2026 01:22:53 +0100 Subject: [PATCH 6/6] Test standard hook names (ots CLI only) --- .ots/.attestation-cache | 14 ++++++++++++++ ...6dc83992382d17c347a30c823204646d02750fc5.ots | Bin 0 -> 560 bytes .ots/commit-chain.txt | 1 + .ots/prev-commit.txt | 2 +- .ots/proof.ots | Bin 700 -> 560 bytes test12.txt | 1 + 6 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 .ots/6dc83992382d17c347a30c823204646d02750fc5.ots create mode 100644 test12.txt diff --git a/.ots/.attestation-cache b/.ots/.attestation-cache index 1ba9498..43d2019 100644 --- a/.ots/.attestation-cache +++ b/.ots/.attestation-cache @@ -70,3 +70,17 @@ f4eb0ad6782d2bc003206521cc66ea370dcccd9f:pending:1772925250 e2d0ff03529b0a34146dbd97c3ebbb2b2f6d1faa:pending:1772925251 a7c0f825be4491ecec199ca7b983ee46525853e5:pending:1772925252 02143e59edb79ecf121c99f4518ad232625f5df6:pending:1772925253 +392ee723c3cf626d0e5281aa94771d7133bb345e:pending:1772926605 +db6f29e01a33d8ed8f127ff169d9f91d55e8a229:pending:1772926606 +4a6f5ed0c12315b0bc8a0fa5815ada1bd20e5963:pending:1772926607 +46aded7b9582bbed673843e2cf8a3f8fa742ad91:pending:1772926608 +c0685dabfb48360a3abc103b75357f94e9f054b2:pending:1772926608 +810d26b7af9c5d306e77fec290d360c7ac876b2e:pending:1772926609 +3b54e0cb8c611d3f3525ad2386368f60200891f1:pending:1772926610 +ed2cd259e918344c5a21ecf884b3178b4256ea74:pending:1772926611 +f4eb0ad6782d2bc003206521cc66ea370dcccd9f:pending:1772926612 +4bf5ab21764bc9a4507e25e0bc8de2989d4febad:pending:1772926613 +e2d0ff03529b0a34146dbd97c3ebbb2b2f6d1faa:pending:1772926614 +a7c0f825be4491ecec199ca7b983ee46525853e5:pending:1772926614 +02143e59edb79ecf121c99f4518ad232625f5df6:pending:1772926615 +094cd5386431eb9d1fe1335c591452ba0b66cb6e:pending:1772926616 diff --git a/.ots/6dc83992382d17c347a30c823204646d02750fc5.ots b/.ots/6dc83992382d17c347a30c823204646d02750fc5.ots new file mode 100644 index 0000000000000000000000000000000000000000..fb8e56ea564c2ecc48b115c2ce2937150f41ec2e GIT binary patch literal 560 zcmZSZFG$S`$;?eHE=kNSC}v;?D9X=IW7yyM=tawmNmCd(_V8p|J$O04+H&p6Bdrrw zoKBiyYR;7?C9*Y{k%6y2X7&exBmWI|?J?j}zMZ-B`fRc3$2tCg;4o~im)e)E@s8tz z!2G`~YCFy-m}M{|O=b>%eU#%POXiwwvp;Ywo@skPb%V-GhUWW^dG&ts^yz44l#~<{ zTj}d3uinltU#Q~4 zBc0DPl2*#E<@lhm*!e{6AK_J3s-Gqb3Z}o<`t+;f{DWt+CGvl~2zqtZP8g`f^pE$# zBt@PN%_S9|=K9@G-?ce?PFwEWSUq7?ZHu(zBM_&~`M}X6w=(8~ywiQSQ}uLVPEE|o zOim^2Sb?=>LYdV+d){77vom{ZCLqc2QDMPt#W%OlzgTh2%+lSLS$&bhjoacAFFGGx zFZu8A+>*6hAlA?Nz!8;nr2U!5Mk~1Wni??c(=zk&QY#Swm0FTol$TjjS)Q1aqnDhY z`$6E+F7Gp+q~FiU2n+5$lrZ4|JpAhtcd`1UAJ>GNs;mSv6(#JG6H9=GB~}1!$R)=52$WXnK}6tqgg#rPvEVC?fG9G2LtuYtGDyZ7pnO1Nayp6q?Ph(IX);Xc0Q5& zM|jnh>Zgf+}+afLb2*l<&A2^!iR>pjgce>BeeE%`8-cO!By~$aO2Cf2Y&4e?8=7dWfKgCXMk4)2ue`2zIoA0Y<9|UZLuHC=( zOY51>#;=D~s7$@c@&AKBVB;DVji=rl3&PIzEe<@eo8yB*=lu5V-CLCxJPn;Fr<|C= zYZY!kqvTG%&Evh()e|n|pyG~a*BJDGz?qyGN~j>#<< z{N-u?Pjh?__|m;+6&JtTU753w54LfA+7C3lAuZHFtm$#g%aHIlwQVhD-|yMlV{+p{ zp9P1%_i=lFJ)n|8-X?E`W&d5jG~ZUf&98c0%hGp|Nv`uvFS`dC_j*#2fl4f+C3Zb; z-z2$t&db<1Tf9d-LUS_e}mO`6!$$E@d0UVEXxBXdv zg!3KHZPH(EKYSLWl76j6Xkot4CSi_`3j0N~4CI-Nr(2}hu%8aAR5QBq!|M1)1Irhu zGY|U7@~wp!>i&Ua{zB1R(h+(0CpMd9eh~Pim6j}a=-x{^KEICFnfo3BO`6xgc59Gj zqMW~C*-8_) e{)^GmZ{0J}GMEatEO5h0#@C6vSSPP#GzI`N=IXlu diff --git a/test12.txt b/test12.txt new file mode 100644 index 0000000..1af7b08 --- /dev/null +++ b/test12.txt @@ -0,0 +1 @@ +# Test renamed hooks