Skip to content

Epic: Git Sync Reliability Improvements #381

Closed
4 of 4 issues completed
Closed

Description

@vybe

Summary

Comprehensive improvements to Trinity's git sync system to address silent data loss, conflict deadlocks, and observability gaps. Based on real incidents from 2026-04-17 where three agents hit multiple failure modes.

Context

Trinity's git-sync design (trinity/* working branch per instance, auto-commits, pull redirected to origin/main) is architecturally sound. However, the conflict-handling, branch-ownership, and observability layers have 7 verified failure modes:

ID Problem Severity
P1 Silent desync accumulation (no sync health signal) High
P2 Parallel-history deadlock (both UI options wrong) High
P3 No "reset template, preserve state" primitive Medium
P4 Git internals leak into error modal Medium
P5 No branch-ownership enforcement (silent clobber) Critical
P6 Working-branch divergence hidden by ahead/behind High
P7 Three generate_instance_id() call sites, no cross-check Medium

Proposed Solutions

Solution Description Priority Issue
S7 Branch ownership enforcement P1 #382
S4 Persistent state allowlist P1 #383
S3 Reset-preserve-state operation P1 #384
S2 Parallel-history detection P2 #385
S5 Operator-readable diagnosis P2 #386
S0 Self-hosted git URL support P2 #387
S1 Sync health observability P2 #389
S6 Fleet sync audit endpoint P3 #390

Rollout Phases

Phase Ships Unblocks
0 S0 (#387) + S4 (#383) Local repro harness, reset-preserve-state
1 S2 (#385) + S3 (#384) + S5 (#386) + S7 (#382) UI recovery from conflicts, branch safety
2 S1 (#389) Silent desync prevention
3 S6 (#390) Ops playbooks, bulk health checks

Evidence

Full proposal with code citations: ability-trinity-git-improvements-proposal.md

Real incident: 2026-04-17, three agents (polygon-vybe, alpaca-vybe-live, alpaca-vybe-live-2) hit P1-P7. One lost 50KB of trading data from silent branch clobber.

Child Issues

Sub-issues

Sub-issues

4 of 4 Issues completed
Loading 4 sub-issues

Activity

  1. added
    priority-p1
    type-feature
    on Apr 18, 2026
  2. AndriiPasternak31 commented on Apr 18, 2026

    @AndriiPasternak31
    Contributor

    Phase-1 PR tracking

    Sub-issue Solution PR Status
    #382 S7 Branch ownership enforcement #396 Open
    #383 S4 Persistent-state allowlist #394 Open (prereq for S3)
    #384 S3 Reset-preserve-state — Deferred — blocks on #394 merging
    #385 S2 Parallel-history detection #395 Open
    #386 S5 Operator-readable diagnosis #397 Open

    Each PR lands a Tier-1 regression under tests/git-sync/ adapted from /tmp/trinity-repro/ repros.

    Reviewer rebase ordering

    S3 (#384) will be dispatched once #394 merges.

  3. 41 remaining items

  4. added
    complexity-high
    theme-reliability
    type-epic
    on Jun 3, 2026
  5. vybe commented on Jul 3, 2026

    @vybe
    ContributorAuthor

    Groom 2026-07-03: closing as complete — the git-sync reliability scope (S1–S6: auto-sync heartbeat, sync-state persistence, operator alerts, reset-to-main-preserve-state recovery, fleet sync-audit, duplicate-binding detection) shipped via #384/#389/#390 and is documented in architecture.md. The one remaining child (#253) was an aged parked idea, closed separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

complexity-highpriority-p1theme-reliabilitytype-epictype-feature

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions