Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
b053027
feat: add python gr2 sync status design slice
laynepenney Apr 15, 2026
669c747
feat: add python gr2 sync run executor
laynepenney Apr 15, 2026
ddc8174
feat: harden python gr2 sync semantics
laynepenney Apr 15, 2026
150d4a6
fix: align sync events and blockers
laynepenney Apr 15, 2026
03c1905
fix: align sync failure contract and interrupt handling
laynepenney Apr 15, 2026
666be45
Merge pull request #573 from synapt-dev/atlas/gr2-identity-org
laynepenney Apr 15, 2026
e43c019
design: hook/event contract + PR lifecycle for gr2 (#572)
laynepenney Apr 15, 2026
0725867
feat: gr2 event system runtime (emit, outbox, cursors, bridge, hooks,…
laynepenney Apr 15, 2026
926f35f
feat: start sprint 21 sync and platform adapter lane
laynepenney Apr 15, 2026
fd36218
test: add sync lock and dirty mode coverage
laynepenney Apr 15, 2026
3d0f2ee
fix: emit terminal event on sync lock contention
laynepenney Apr 15, 2026
fd01b78
test: add pr group lifecycle coverage
laynepenney Apr 15, 2026
c92145a
feat: persist and aggregate pr group state
laynepenney Apr 15, 2026
0628cec
fix: align core sync events to contract
laynepenney Apr 15, 2026
5fdb8eb
test: add workspace materialize event coverage
laynepenney Apr 15, 2026
fd993b2
feat: emit workspace materialize events
laynepenney Apr 15, 2026
584b611
test: add failure marker and sync conflict coverage
laynepenney Apr 15, 2026
4ebd578
feat: add failure markers and sync conflict details
laynepenney Apr 15, 2026
e6ff502
feat: converge on shared events and pr orchestration
laynepenney Apr 15, 2026
e5e305b
Merge pull request #575 from synapt-dev/atlas/sprint-21-sync-engine
laynepenney Apr 15, 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
178 changes: 178 additions & 0 deletions gr2/docs/ASSESS-SYNC-ADVERSARIAL-SPECS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
# Assess Sync Adversarial Specs

Artifact 2 for the Sprint 20 sync lane.

This document lists the failure-first specs the Python `gr2 sync` implementation
must satisfy before `sync run` is allowed to mutate workspace state.

## 1. Missing Spec

Preconditions:
- workspace has no `.grip/workspace_spec.toml`

Trigger:
- `gr2 sync status <workspace>`

Expected:
- command fails immediately
- error points to `gr2 workspace init`
- no cache, repo, lane, or event state is written

## 2. Partial Clone Failure

Preconditions:
- spec declares 3 repos
- repo A and B are reachable
- repo C remote is invalid or unavailable

Trigger:
- `gr2 sync run`

Expected:
- planner marks A/B runnable and C failing before execution starts
- execution stops on C if C is in the same phase batch
- result reports:
- A/B success or skipped state explicitly
- C as failure with repo-scoped error payload
- no successful repo update is silently rolled back
- event outbox records partial progress and terminal failure

Invariant:
- sync never reports all-green on partial workspace failure

## 3. Dirty Shared Repo

Preconditions:
- shared repo checkout exists
- uncommitted changes in repo root

Trigger:
- `gr2 sync status`

Expected:
- issue `dirty_shared_repo`
- issue blocks sync
- planner does not schedule branch movement or fetch-dependent mutation through
the dirty checkout

Invariant:
- dirty state wins over convenience

## 4. Dirty Lane Checkout During Sync

Preconditions:
- lane checkout exists
- lane repo has uncommitted changes

Trigger:
- `gr2 sync status`

Expected:
- issue `dirty_lane_repo`
- issue blocks sync
- planner may still inspect other repos, but lane mutation is blocked

Invariant:
- lane-local work is never overwritten by workspace sync

## 5. Conflicting Branch States Across Repos

Preconditions:
- lane spans repos `app`, `api`, `premium`
- expected branch is `feat/auth`
- `app` is on `feat/auth`
- `api` is behind remote
- `premium` is on a different local branch

Trigger:
- `gr2 sync status`

Expected:
- planner reports repo-scoped branch inspection operations
- branch divergence appears as explicit sync issue, not implicit correction
- no automatic branch checkout/rebase in status mode

Invariant:
- branch alignment must be explicit before mutation

## 6. Shared Cache Path Conflict

Preconditions:
- `.grip/cache/repos/<repo>.git` exists
- path is not a bare git directory

Trigger:
- `gr2 sync status`

Expected:
- issue `cache_path_conflict`
- sync blocks
- planner does not attempt to reuse or overwrite the invalid cache path

## 7. Invalid Repo Hook Config

Preconditions:
- shared repo has `.gr2/hooks.toml`
- file does not parse or violates schema

Trigger:
- `gr2 sync status`

Expected:
- spec validation fails before sync planning proceeds
- sync status returns blocked with the hook validation error included

Invariant:
- repo hook errors fail fast at plan time

## 8. Sync During Active Edit Lease

Preconditions:
- lane has an active `edit` lease
- lane repo is otherwise clean

Trigger:
- `gr2 sync run --lane <lane>`

Expected:
- sync refuses lane mutation for the leased lane
- non-lane workspace inspection may still succeed
- result clearly distinguishes lease-blocked lanes from unrelated workspace
status

Invariant:
- sync does not tunnel through active edit occupancy

## 9. Concurrent Sync From Two Worktrees

Preconditions:
- same workspace available from two operator shells
- both invoke sync against overlapping repos

Trigger:
- `gr2 sync run` concurrently

Expected:
- shared mutable resources use explicit lock discipline
- losing side returns machine-readable contention error
- no cache corruption, no partially-written apply metadata

Invariant:
- concurrency failure is reported, not hidden as random repo damage

## 10. Platform Backend Failure

Preconditions:
- `PlatformAdapter` backend is GitHub via `gh`
- `gh` auth is invalid or the command times out

Trigger:
- sync planner tries to refresh PR/check state

Expected:
- repo/local sync inspection still reports local status
- platform-dependent operations are marked degraded or failed
- failure is explicit in the result payload

Invariant:
- adapter failure must not masquerade as clean workspace state
Loading
Loading