guard-sync-divergence-guard

Blocks guard script syncs when sibling repositories diverge from canonical git history.

Updated Mar 22, 2026
One-click install
npx skills add https://github.com/diazMelgarejo/orama-system --skill guard-sync-divergence-guard-diazmelgarejo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: guard-sync-divergence-guard
Source: https://github.com/diazMelgarejo/orama-system/tree/main/bin/orama-system/skills/guard-sync-divergence-guard
Command: npx skills add https://github.com/diazMelgarejo/orama-system --skill guard-sync-divergence-guard-diazmelgarejo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? When synchronizing attribution-guard scripts across multiple repositories, a blind sync can overwrite a sibling repo's newer guard mutations with an older canonical copy. This Skill prevents that data loss by scanning workspace siblings before any sync runs and aborting when a sibling carries changes absent from canonical history. ## Core Features & Use Cases - Fail-closed divergence check: Compares each sibling file's blob hash against canonical git history, distinguishing safe lag from dangerous sibling-ahead states. - Clear exit semantics: Returns exit 0 when safe to sync, exit 1 with GUARD_SYNC_E_DIVERGENCE when human review is required, and exit 2 on usage errors. - HITL workflow guidance: Walks the operator through promoting sibling improvements to canonical on a single open PR before re-running the sync. - Use Case: Before running sync-attribution-guard-scripts.sh to push guard updates from orama to Perpetua-Tools, run the divergence check to confirm Perpetua-Tools has not advanced its guards beyond canonical, avoiding clobbering PR-level hardening work. ## Quick Start Ask the agent to run the guard sync divergence check across the workspace before executing any attribution-guard sync script.

Frequently Asked Questions about guard-sync-divergence-guard

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check if it is safe to sync guard scripts across repositories?

Run bash scripts/git/check-guard-sync-divergence.sh --workspace before invoking the sync script. Exit code 0 means safe to sync, exit 1 signals GUARD_SYNC_E_DIVERGENCE requiring human review, and exit 2 indicates a usage error.

What causes a guard sync to be blocked by the divergence check?

A sync is blocked when a sibling file's blob hash is absent from canonical git history, meaning the sibling carries mutations canonical has never seen. It also blocks when the canonical blob exists only in sibling history, indicating canonical is behind.

When is a diverged sibling file still considered safe to sync?

A differing sibling file is safe when its blob hash exists somewhere in canonical git history, which means the sibling simply lags behind canonical and the sync upgrades an older copy rather than clobbering new work.

Can I bypass the guard sync divergence check in an emergency?

Yes, set GUARD_SYNC_SKIP_DIVERGENCE_CHECK=1 when running the sync script, but this requires explicit operator acknowledgment and documented justification. It must never be the default behavior for agents.

What should I do when the divergence check reports GUARD_SYNC_E_DIVERGENCE?

Identify the failing repo and path from checker output, then promote the sibling's advanced work to orama canonical on the single open PR for that repo. After merging canonical, re-run the checker until it passes, then sync downstream.