Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
5810cbe
docs: close phase 5 status gap
flyingrobots Mar 17, 2026
219ba2c
feat(tooling): harden post-phase5 dev loop
flyingrobots Mar 17, 2026
a6ffe8f
test(tooling): disable signing in verify-local fixtures
flyingrobots Mar 17, 2026
e1e8e4b
feat(wasm): remove legacy read adapters for abi v2
flyingrobots Mar 17, 2026
dfd31bd
feat(wasm): land abi v3 logical clock boundary
flyingrobots Mar 18, 2026
9d29321
chore(hooks): record hook timings in local csv logs
flyingrobots Mar 18, 2026
7874587
feat(replay): rebuild full worldline state from provenance
flyingrobots Mar 18, 2026
4ab2bd7
feat(replay): cut over playback to full worldline checkpoints
flyingrobots Mar 18, 2026
8f868fb
feat(replay): accelerate provenance replay from full-state checkpoints
flyingrobots Mar 18, 2026
2c2086a
feat(replay): unify playback with provenance replay
flyingrobots Mar 19, 2026
1d94c7d
docs: mark phase 7 complete in implementation plan
flyingrobots Mar 19, 2026
9f62438
fix(tooling): skip deleted markdown paths in docs lint
flyingrobots Mar 19, 2026
3ae7143
fix(replay): harden scheduler and checkpoint invariants
flyingrobots Mar 19, 2026
c8df037
fix(ttd-browser): adapt browser cursors to typed ticks
flyingrobots Mar 19, 2026
e753280
chore(tooling): clean up PR feedback follow-ups
flyingrobots Mar 19, 2026
a78999e
test(playback): prove checkpoint restore path
flyingrobots Mar 19, 2026
7124311
test(warp-core): fix append-only provenance invariants
flyingrobots Mar 19, 2026
754bd88
test(playback): remove redundant checkpoint clone
flyingrobots Mar 20, 2026
de346c9
test(playback): document stable isolated-node fixture roots
flyingrobots Mar 20, 2026
a7b3355
fix(replay): harden replay checkpoints and review tooling
flyingrobots Mar 20, 2026
90940fb
fix(phase7): resolve self-review findings
flyingrobots Mar 21, 2026
0a5824b
fix(review): resolve hook and replay follow-ups
flyingrobots Mar 21, 2026
c5b88c4
docs: update changelog for phase 7 follow-ups
flyingrobots Mar 21, 2026
e55385c
docs: clarify phase 7 snapshot migration
flyingrobots Mar 21, 2026
b3cabad
fix(review): close remaining ABI and tooling threads
flyingrobots Mar 21, 2026
b19ff1e
fix(review): resolve final phase 7 follow-ups
flyingrobots Mar 21, 2026
53f8798
docs: note final phase 7 review fixes
flyingrobots Mar 21, 2026
0e21171
fix(review): harden final phase 7 follow-ups
flyingrobots Mar 21, 2026
afbf5b7
docs: clarify final phase 7 review semantics
flyingrobots Mar 21, 2026
7b268b8
fix(review): resolve final phase 7 thread gaps
flyingrobots Mar 21, 2026
7825fc2
docs: align final phase 7 review notes
flyingrobots Mar 21, 2026
7c5cb54
fix(review): trim final replay and adapter follow-ups
flyingrobots Mar 21, 2026
537fe83
fix(review): resolve final phase 7 code and tooling gaps
flyingrobots Mar 21, 2026
61e1e98
fix(playback): validate replay base on no-op seeks
flyingrobots Mar 22, 2026
533c900
docs: note phase 7 completion and ADR wording
flyingrobots Mar 22, 2026
df608cd
fix(review): harden final phase 7 code and tooling gaps
flyingrobots Mar 22, 2026
6261953
docs(spec): clarify deterministic U0 observation payloads
flyingrobots Mar 22, 2026
e6a0a66
docs: note final phase 7 Rabbit review fixes
flyingrobots Mar 22, 2026
6400642
fix(tests): checkpoint fixtures use replay state
flyingrobots Mar 22, 2026
cc5aaaf
fix(tests): checkpoint playback uses replay state
flyingrobots Mar 22, 2026
d54cea1
fix(warp-core): harden replay validation follow-ups
flyingrobots Mar 22, 2026
97bb876
fix(tooling): tighten timing and verifier coverage
flyingrobots Mar 22, 2026
128ee62
fix(abi): clarify scheduler wire contract
flyingrobots Mar 22, 2026
20ea5e0
docs: note review-driven phase 7 fixes
flyingrobots Mar 22, 2026
914cb38
test(warp-core): remove expect from review fixtures
flyingrobots Mar 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
174 changes: 174 additions & 0 deletions .githooks/_timing.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: Apache-2.0
# © James Ross Ω FLYING•ROBOTS <https://github.com/flyingrobots>

hook_timing_detect_method() {
if command -v python3 >/dev/null 2>&1; then
printf '%s\n' "python3_monotonic_ns"
else
printf '%s\n' "date_epoch_seconds_as_ns"
fi
}

hook_timing_fallback_now_ns() {
printf '%s000000000\n' "$(date +%s)"
}

hook_timing_now_ns() {
case "${DX_HOOK_TIMING_METHOD:-$(hook_timing_detect_method)}" in
python3_monotonic_ns)
if ! command -v python3 >/dev/null 2>&1; then
if [[ -n "${DX_HOOK_START_NS:-}" ]]; then
printf '%s\n' "${DX_HOOK_START_NS}"
else
hook_timing_fallback_now_ns
fi
return 0
fi

local monotonic_ns=""
if monotonic_ns="$(
python3 - <<'PY' 2>/dev/null
import time

print(time.monotonic_ns())
PY
)"; then
printf '%s\n' "$monotonic_ns"
else
if [[ -n "${DX_HOOK_START_NS:-}" ]]; then
printf '%s\n' "${DX_HOOK_START_NS}"
else
hook_timing_fallback_now_ns
fi
fi
;;
*)
hook_timing_fallback_now_ns
;;
esac
}

hook_timing_prepare() {
DX_HOOK_REPO_ROOT="$1"
DX_HOOK_NAME="$2"
DX_HOOK_TIMING_METHOD="$(hook_timing_detect_method)"
DX_HOOK_START_NS="$(hook_timing_now_ns)"
DX_HOOK_TIMING_RECORDED=0
}

hook_timing_lock_metadata_file() {
printf '%s\n' "$1/owner"
}

hook_timing_write_lock_metadata() {
local lock_dir="$1"
local meta_file
meta_file="$(hook_timing_lock_metadata_file "$lock_dir")"
printf 'pid=%s\nstarted_at=%s\n' "$$" "$(date +%s)" >"$meta_file" 2>/dev/null || true
}

hook_timing_lock_is_stale() {
local lock_dir="$1"
local meta_file pid="" started_at="" key value now stale_after
meta_file="$(hook_timing_lock_metadata_file "$lock_dir")"
stale_after="${DX_HOOK_TIMING_STALE_LOCK_SECS:-30}"

if [[ ! -f "$meta_file" ]]; then
return 1
fi

while IFS='=' read -r key value; do
case "$key" in
pid) pid="$value" ;;
started_at) started_at="$value" ;;
esac
done <"$meta_file"

if [[ -n "$pid" ]]; then
if kill -0 "$pid" 2>/dev/null; then
return 1
fi
return 0
fi

if [[ "$started_at" =~ ^[0-9]+$ ]]; then
now="$(date +%s)"
if (( now >= started_at && now - started_at >= stale_after )); then
return 0
fi
fi

return 1
}

hook_timing_reap_stale_lock() {
local lock_dir="$1"
if ! hook_timing_lock_is_stale "$lock_dir"; then
return 1
fi
rm -rf "$lock_dir" 2>/dev/null || true
return 0
}

hook_timing_release_lock() {
local lock_dir="$1"
rm -f "$(hook_timing_lock_metadata_file "$lock_dir")" 2>/dev/null || true
rmdir "$lock_dir" 2>/dev/null || true
}

hook_timing_append() {
local exit_code="${1:-$?}"
if [[ "${DX_HOOK_TIMING_RECORDED:-0}" == "1" ]]; then
return 0
fi
DX_HOOK_TIMING_RECORDED=1

local repo_root="${DX_HOOK_REPO_ROOT:-}"
local hook_name="${DX_HOOK_NAME:-}"
local start_ns="${DX_HOOK_START_NS:-}"
if [[ -z "$repo_root" || -z "$hook_name" || -z "$start_ns" ]]; then
return 0
fi

local end_ns elapsed_ns elapsed_ms csv_dir csv_file timestamp_utc
local lock_dir lock_acquired=0 attempts=0
end_ns="$(hook_timing_now_ns)"
elapsed_ns=$(( end_ns - start_ns ))
if (( elapsed_ns < 0 )); then
elapsed_ns=0
fi
elapsed_ms=$(( elapsed_ns / 1000000 ))
csv_dir="${repo_root}/.dx-debug"
csv_file="${csv_dir}/${hook_name}-times.csv"
timestamp_utc="$(date -u +"%Y-%m-%dT%H:%M:%SZ")"

mkdir -p "$csv_dir" 2>/dev/null || return 0
lock_dir="${csv_file}.lock"
while (( attempts < 100 )); do
if mkdir "$lock_dir" 2>/dev/null; then
lock_acquired=1
hook_timing_write_lock_metadata "$lock_dir"
break
fi
hook_timing_reap_stale_lock "$lock_dir" || true
attempts=$(( attempts + 1 ))
sleep 0.01
done
if [[ "$lock_acquired" != "1" ]]; then
return 0
fi

if [[ ! -s "$csv_file" ]]; then
printf 'timestamp_utc,elapsed_ms,exit_code,pid\n' >>"$csv_file" 2>/dev/null || {
hook_timing_release_lock "$lock_dir"
return 0
}
fi
printf '%s,%s,%s,%s\n' \
"$timestamp_utc" \
"$elapsed_ms" \
"$exit_code" \
"$$" >>"$csv_file" 2>/dev/null || true
hook_timing_release_lock "$lock_dir"
}
7 changes: 7 additions & 0 deletions .githooks/commit-msg
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: Apache-2.0
set -euo pipefail
HOOK_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$HOOK_DIR/.." && pwd)"
# shellcheck source=.githooks/_timing.sh
source "$HOOK_DIR/_timing.sh"
hook_timing_prepare "$REPO_ROOT" "commit-msg"
trap 'hook_timing_append $?' EXIT

FILE="${1:-}"
if [[ -z "$FILE" || ! -f "$FILE" ]]; then
echo "[commit-msg] Missing commit message file. Usage: commit-msg <path>" >&2
Expand Down
12 changes: 11 additions & 1 deletion .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: Apache-2.0
set -euo pipefail
HOOK_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$HOOK_DIR/.." && pwd)"
# shellcheck source=.githooks/_timing.sh
source "$HOOK_DIR/_timing.sh"
hook_timing_prepare "$REPO_ROOT" "pre-commit"
trap 'hook_timing_append $?' EXIT
cd "$REPO_ROOT"

# 0) Sweep stale build artifacts on odd hours (keeps target/ from ballooning)
# Manual: ./scripts/sweep-stale-artifacts.sh [days]
Expand Down Expand Up @@ -117,7 +124,10 @@ fi

# 9) Markdown formatting and linting for staged .md files
# Use -z and --diff-filter=ACMRT to exclude deletions and handle whitespace safely
mapfile -d '' MD_FILES < <(git diff --cached --name-only -z --diff-filter=ACMRT -- '*.md')
MD_FILES=()
while IFS= read -r -d '' md_file; do
MD_FILES+=("$md_file")
done < <(git diff --cached --name-only -z --diff-filter=ACMRT -- '*.md')
if [[ ${#MD_FILES[@]} -gt 0 ]] && command -v npx >/dev/null 2>&1; then
echo "pre-commit: linting markdown files"

Expand Down
14 changes: 12 additions & 2 deletions .githooks/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,15 @@
# for the full workspace gates only when the changed paths justify it.
set -euo pipefail

REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
exec "$REPO_ROOT/scripts/verify-local.sh" pre-push
HOOK_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$HOOK_DIR/.." && pwd)"
# shellcheck source=.githooks/_timing.sh
source "$HOOK_DIR/_timing.sh"
hook_timing_prepare "$REPO_ROOT" "pre-push"
on_exit() {
local exit_code=$?
hook_timing_append "$exit_code"
}
trap on_exit EXIT
cd "$REPO_ROOT"
"$REPO_ROOT/scripts/verify-local.sh" pre-push
33 changes: 31 additions & 2 deletions .githooks/pre-push-parallel
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
# SPDX-License-Identifier: Apache-2.0
# Parallel pre-push hook - runs stages concurrently with isolated target dirs
set -euo pipefail
HOOK_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$HOOK_DIR/.." && pwd)"
# shellcheck source=.githooks/_timing.sh
source "$HOOK_DIR/_timing.sh"
hook_timing_prepare "$REPO_ROOT" "pre-push-parallel"
cd "$REPO_ROOT"

PINNED_FROM_FILE=$(awk -F '"' '/^channel/ {print $2}' rust-toolchain.toml 2>/dev/null || echo "")
PINNED="${PINNED:-${PINNED_FROM_FILE:-1.90.0}}"
Expand Down Expand Up @@ -31,16 +37,39 @@ fi

echo "🐰 BunBun 🐇 (parallel mode)"

LOGDIR=""
LOGDIR=$(mktemp -d)
# Trap EXIT, INT, TERM: kill background jobs then clean up
cleanup() {
local exit_code="${1:-0}"
# Kill any background jobs from this script
# Avoid GNU-only xargs -r by checking if pids is non-empty
pids=$(jobs -p 2>/dev/null) || true
[ -n "$pids" ] && echo "$pids" | xargs kill 2>/dev/null || true
rm -rf "$LOGDIR"
if [[ -n "${LOGDIR:-}" ]]; then
rm -rf "$LOGDIR"
fi
hook_timing_append "$exit_code"
}
on_exit() {
local exit_code=$?
cleanup "$exit_code"
}
on_signal() {
local signal_name="$1"
local exit_code=1
if [[ "$signal_name" == "INT" ]]; then
exit_code=130
elif [[ "$signal_name" == "TERM" ]]; then
exit_code=143
fi
trap - EXIT
cleanup "$exit_code"
exit "$exit_code"
}
trap cleanup EXIT INT TERM
trap on_exit EXIT
trap 'on_signal INT' INT
trap 'on_signal TERM' TERM

# Stage functions - each uses its own target dir and the pinned toolchain
run_fmt() {
Expand Down
7 changes: 7 additions & 0 deletions .githooks/pre-push-sequential
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: Apache-2.0
set -euo pipefail
HOOK_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$HOOK_DIR/.." && pwd)"
# shellcheck source=.githooks/_timing.sh
source "$HOOK_DIR/_timing.sh"
hook_timing_prepare "$REPO_ROOT" "pre-push-sequential"
trap 'hook_timing_append $?' EXIT
cd "$REPO_ROOT"
# Resolve the pinned toolchain from rust-toolchain.toml, fallback to explicit env or a sane default
PINNED_FROM_FILE=$(awk -F '"' '/^channel/ {print $2}' rust-toolchain.toml 2>/dev/null || echo "")
PINNED="${PINNED:-${PINNED_FROM_FILE:-1.90.0}}"
Expand Down
8 changes: 7 additions & 1 deletion .githooks/pre-rebase
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: Apache-2.0
set -euo pipefail
HOOK_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$HOOK_DIR/.." && pwd)"
# shellcheck source=.githooks/_timing.sh
source "$HOOK_DIR/_timing.sh"
hook_timing_prepare "$REPO_ROOT" "pre-rebase"
trap 'hook_timing_append $?' EXIT
echo "[pre-rebase] Rebase is disallowed for this repository. Use merge instead." >&2
exit 1

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ target-clippy
target-test
target-doc
.githooks/timing.jsonl
.dx-debug/
blog/
docs/.vitepress/cache

# Editor cruft
Expand Down
Loading
Loading