Skip to content

feat: distinguish local-only repos from broken remotes on sync - #116

Merged
timeleft-- merged 3 commits into
mainfrom
automation/fava-trails-105
Sep 11, 2026
Merged

timeleft-- merged 3 commits into
mainfrom
automation/fava-trails-105

Conversation

@yia-mw-agent

Copy link
Copy Markdown
Contributor

Summary

  • Treat a data repo with no git remotes as local-only: sync returns not_configured with a concrete next step, and remotes are never added or changed automatically.
  • Distinguish that from a configured remote that is unreachable or denies permission, which remains an error.
  • Keep --sync-on-start fail-closed for every non-ok result, including missing remotes.

Closes #105

Motivation

A separate local JJ/Git repository is a valid evaluation setup, but sync without a configured Git remote was reported as a rebase error. Cross-machine sharing needs a reachable remote and operational work that onboarding should explain first.

Changes

  • fetch_and_rebase inspects git remotes before fetch; empty remotes skip fetch/rebase.
  • Fetch failures are classified as permission vs unreachable; rebase does not proceed.
  • MCP sync maps missing remotes to not_configured (operators get the next step; non-operators get a generic not-configured message).
  • Tunnel startup sync returns not_configured or error instead of ok on failure.
  • Docs and bootstrap output explain local-only vs shared remotes and maintenance/access implications before encouraging sync.

Test Plan

  • Absent remote, unreachable configured remote, permission failure, and healthy disposable local remote
  • Local save, recall, review, and supersession without a remote
  • --sync-on-start fail-closed for not_configured
  • uv run pytest tests/test_local_only_sync.py tests/test_gateway_sync.py tests/test_navigation_tools.py (21 passed)
  • Full suite: 858 passed; 5 pre-existing jj PATH misses in this environment (jj lives in ~/.local/bin)

Notes for Reviewers

FAVA does not create hosted repositories, push private content, or change remote settings automatically. Tests use only local disposable remotes.

AGENTS.md could not be updated in this environment (protected file); README, setup instructions, tunnel docs, and tool descriptions carry the same guidance.

Missing git remotes now return status not_configured with a next step
instead of a rebase error. Configured unreachable or permission-denied
remotes remain errors. Required startup sync stays fail-closed.
Local save, recall, review, and supersession still work without a remote.
…s-105

# Conflicts:
#	README.md
#	src/fava_trails/cli.py
#	src/fava_trails/server.py
JJ 0.42+ removed --allow-new. Use --allow-empty-description --all so the
healthy local-only sync test runs on the 0.28 and 0.45.1 matrix.

@timeleft-- timeleft-- left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent review is clean at exact head 88e4d52. Reproduced absent, unreachable, permission-denied, and healthy disposable-remote behavior with JJ 0.45.1; verified local save/recall/review/supersession without a remote and fail-closed startup sync. Focused lint and 74 tests passed, the full 1,061-test suite passed, and all nine GitHub checks are green across JJ 0.28.0 and 0.45.1. No hosted remote, private push, or automatic remote mutation is introduced.

@timeleft--
timeleft-- merged commit 30ac24e into main Sep 11, 2026
9 checks passed
@timeleft--
timeleft-- deleted the automation/fava-trails-105 branch September 11, 2026 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make local-only operation and missing-remote sync behavior clear

2 participants