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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [4.2.1] - 2026-07-19

### Fixed
- Explicitly waive the repository freshness check when neither the working directory nor the action target is inside a Git repository.

## [4.2.0] - 2026-07-18

### Added
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "omind"
version = "4.2.0"
version = "4.2.1"
description = "Reproduce the OMI/Obsidian memory integration for AI agents, plus a local web app to view, edit, and add memory entries."
readme = "README.md"
requires-python = ">=3.10"
Expand Down
2 changes: 1 addition & 1 deletion src/omind/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Copyright 2026 Aaron K. Clark
"""omind — OMI/Obsidian memory tooling for AI agents."""

__version__ = "4.2.0"
__version__ = "4.2.1"
4 changes: 3 additions & 1 deletion src/omind/guard.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@
)
GIT_FRESHNESS_MESSAGE = (
"repo work requires a same-turn freshness check before "
"review/edit/test/commit/push. Put a LITERAL-path fetch in the SAME command as "
"review/edit/test/commit/push. If neither the working directory nor the action "
"target is inside a Git repository, no fetch is required. Otherwise, put a "
"LITERAL-path fetch in the SAME command as "
"the write, chained with && — e.g.:\n"
' git -C "/abs/path/to/repo" fetch --all --prune '
'&& git -C "/abs/path/to/repo" commit -am "..."\n'
Expand Down
2 changes: 2 additions & 0 deletions src/omind/seeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@
- Before touching repo code, run `git status --short --branch` and a freshness
command (`git fetch --all --prune` or `git pull --ff-only`), then resolve the
current branch/base state.
If neither the current working directory nor the action target is inside a
Git repository, skip the Git status and freshness commands.
- Do not infer permission to edit installed global agent config, hooks, bootstrap
files, or JUMPSTART-style instructions from a question. Answer the question
first; change those files only after explicit current-turn authorization.
Expand Down
20 changes: 20 additions & 0 deletions tests/test_guard.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,26 @@ def test_new_repo_without_a_remote_does_not_demand_freshness(tmp_path: Path) ->
guard.clear_gate(session)


def test_non_repo_work_does_not_demand_freshness(
tmp_path: Path, monkeypatch: pytest.MonkeyPatch
) -> None:
"""A cwd and target outside Git must never demand an impossible fetch."""
monkeypatch.chdir(tmp_path)
session = "not-a-repo"
guard.clear_gate(session)
guard.record_consult(session, kind="read", target="task memory", relevant=True)

target = tmp_path / "notes.txt"
assert guard._repo_root_for_action(
{"tool": "Write", "file_path": str(target), "session": session}
) is None
allowed = guard.decide(
{"tool": "Write", "file_path": str(target), "session": session}
)
assert allowed.allow, allowed.rule_id
guard.clear_gate(session)


def test_new_repo_with_a_remote_still_demands_freshness(tmp_path: Path) -> None:
# A repo that HAS a remote has an upstream to be stale against, so the
# freshness demand is unchanged — the #149 waiver is scoped to no-remote.
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading