Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
23 changes: 23 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,29 @@ fi
repo_root=$(git rev-parse --show-toplevel)
cd "$repo_root"

# core.hooksPath is an absolute path to the primary checkout, so this hook also
# runs from linked worktrees whose branch predates the sync tooling and therefore
# does not contain scripts/update-docs-inventory.mjs. Those commits aborted with
# MODULE_NOT_FOUND before the author could do anything about it. Fail open for
# that one task instead.
if [ "$sync_inventory" = "1" ] && [ ! -f scripts/update-docs-inventory.mjs ]; then
if git cat-file -e "HEAD:scripts/update-docs-inventory.mjs" 2>/dev/null; then
echo "[pre-commit] scripts/update-docs-inventory.mjs was removed or renamed by the pending commit; refusing to skip inventory synchronization." >&2
exit 1
fi
echo "[pre-commit] scripts/update-docs-inventory.mjs is absent from this worktree - skipping inventory sync." >&2
sync_inventory=0
Comment thread
BigSimmo marked this conversation as resolved.
# `|| true`: grep exits 1 when it filters everything out, which `set -e` would
# otherwise treat as a hook failure.
docs_to_check=$(printf '%s\n' $docs_to_check | grep -v '^docs/scripts-index\.md$' || true)
fi

# Re-check after dropping a task: an empty docs_to_check would make the trailing
# unstaged-docs diff match every modified file in the tree.
if [ "$sync_sitemap" = "0" ] && [ "$sync_inventory" = "0" ] && [ "$check_module_map" = "0" ]; then
exit 0
fi

echo "[pre-commit] Synchronizing generated documentation..."
if [ "$sync_sitemap" = "1" ]; then
npm run sitemap:update
Expand Down
3 changes: 2 additions & 1 deletion docs/branch-review-ledger.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ Records before 2026-07-28 were written by hand and had drifted: 146 lines carrie
| 2026-07-30 | PR-1458 | 8c1975b178c67e4c54acffc395d85e38c43d39f5 | PR #1458 superseded root-gate reconciliation | PASS: retained only unique documentation corrections after PR #1480 landed the stronger tracked-root gate; archived resolved shared-hook issue #143 | docs index and links passed; outstanding-issues and branch-review-ledger guards passed; diff check passed |
| 2026-07-30 | PR-1448 | 8ece7f345e93170c6bd242701eaff05f5504d98b | PR #1448 authenticated live workflow | PASS after review repair: protected-main-only checkout, explicit bounded mutations, scoped secrets, and static dispatch confirmation; no live provider workflow dispatched | GitHub Actions and PR-policy guards passed; focused Vitest 3 passed; docs links and scripts, issue and ledger guards, Prettier and diff checks passed |
| 2026-07-30 | codex/outstanding-deletion-guard | da1bed4bcb05f2b975823c76bab0913278cfaea6 | issue 148 deletion guard | approved: no P0-P2 findings; base comparison is fail-closed in CI and preserves archive moves | verify:cheap; deletion self-test; unreadable-base proof; CI scope; GitHub Actions pin guard |
| 2026-07-30 | PR-1494 | 807a3a09f5afc12e8db4f9158abe09d9c7b336c9 | PR #1494 pre-commit fail-open review | FIXED P2: legacy worktrees may skip a genuinely absent generator, while a staged deletion or rename now fails closed | docs-inventory Vitest 5 passed; shell syntax passed; Prettier test check passed; diff check passed |
| 2026-07-30 | codex/ingestion-fixes-current-main-20260731 | fe68a0a817213ef33ddeee35b45034656986d089 | ingestion fixes replacement release readiness | ready after fixing unreachable partial-batch handling and invalid recovery owner lookup | 4 focused files 183 tests passed; typecheck passed; production-readiness READY; git diff --check passed |
| 2026-07-30 | codex/sync-ci-anti-churn | 4f99c6d6dbcd4d2c16d5ec58183003c64d989ac8 | issue 145 anti-churn guidance | approved: guidance now covers both pushes and sync mutations without weakening cancellation | check:outstanding-issues; prettier AGENTS; diff check |
| 2026-07-30 | PR-1492 | a50640970a4e4197c64fba7239aeae073445fed9 | PR #1492 branch-sync churn review | FIXED P2: exact-head queued or in-progress workflows now block automated branch updates; Run PR guidance matches the executable guard | focused Vitest 1 file, 8 tests passed; Prettier passed; sync dry-run passed on 19 open PRs; diff check passed; no provider-backed application checks run |
| 2026-07-30 | codex/ingestion-fixes-current-main-20260731 | fe68a0a817213ef33ddeee35b45034656986d089 | ingestion fixes replacement release readiness | ready after fixing unreachable partial-batch handling and invalid recovery owner lookup | 4 focused files 183 tests passed; typecheck passed; production-readiness READY; git diff --check passed |
2 changes: 2 additions & 0 deletions tests/docs-inventory.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ describe("scripts documentation inventory", () => {
expect(packageJson.scripts["docs:check-inventory"]).toContain("--check");
expect(hook).toContain("npm run sitemap:update");
expect(hook).toContain("node scripts/update-docs-inventory.mjs");
expect(hook).toContain('git cat-file -e "HEAD:scripts/update-docs-inventory.mjs"');
expect(hook).toContain("was removed or renamed by the pending commit; refusing to skip");
expect(hook).toContain("npm run docs:check-index");
expect(hook).toContain("sync_sitemap=0");
expect(hook).toContain("--diff-filter=ACMRD");
Expand Down
Loading