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
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ agent-notes <command> [options]
|---------|-------------|
| `install [--local] [--copy]` | Interactive wizard or direct install |
| `uninstall [--local]` | Remove installed components |
| `update` | Pull latest, rebuild, reinstall |
| `doctor [--local] [--fix]` | Check installation health |
| `info` | Show status and component counts |
| `list [clis\|models\|roles\|agents\|skills\|rules\|all]` | List engine components or installed |
Expand Down
18 changes: 0 additions & 18 deletions agent_notes/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,15 +237,6 @@ def main():
p_uninstall = subparsers.add_parser("uninstall", help="Remove installed components")
p_uninstall.add_argument("--local", action="store_true", help="Remove from current project")

# update
p_update = subparsers.add_parser("update", help="Pull latest, show diff, reinstall")
p_update.add_argument("--dry-run", action="store_true", help="Show diff only, do not reinstall")
p_update.add_argument("-y", "--yes", action="store_true", help="Skip confirmation prompt")
p_update.add_argument("--only", action="append", choices=["agents","skills","rules","commands","config","settings"],
help="Filter diff to these component types (repeatable)")
p_update.add_argument("--since", help="Override 'before' commit label (cosmetic only for now)")
p_update.add_argument("--skip-pull", action="store_true", help="Skip git pull")

# doctor
p_doctor = subparsers.add_parser("doctor", help="Check installation health")
p_doctor.add_argument("--local", action="store_true", help="Check local installation")
Expand Down Expand Up @@ -325,15 +316,6 @@ def main():
elif args.command == "uninstall":
from .commands.install import uninstall
uninstall(local=args.local)
elif args.command == "update":
from .commands.update import update
update(
dry_run=args.dry_run,
yes=args.yes,
only=args.only,
since=args.since,
skip_pull=args.skip_pull,
)
elif args.command == "doctor":
from .commands.doctor import doctor
doctor(local=args.local, fix=args.fix)
Expand Down
3 changes: 1 addition & 2 deletions agent_notes/commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@
from . import build
from . import doctor
from . import validate
from . import update
from . import regenerate
from . import list as list_cmd
from . import memory as memory_cmd

__all__ = [
"install", "uninstall", "show_info",
"build", "doctor", "validate", "update",
"build", "doctor", "validate",
"regenerate", "set_role", "interactive_install",
"list_cmd", "memory_cmd",
]
45 changes: 40 additions & 5 deletions agent_notes/commands/doctor.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,25 +62,60 @@ def _check_session_hook(scope: str, issues: list) -> None:
))


def check_version_drift(scope: str, issues: list, fix_actions: list) -> None:
"""Check if the installed package version matches the current running version."""
from .. import install_state
from ..config import get_version
from ..domain.diagnostics import Issue, FixAction
from ..services.state_store import get_scope
from pathlib import Path

state = install_state.load_current_state()
if state is None:
return

project_path = Path.cwd() if scope == "local" else None
scope_state = get_scope(state, scope, project_path)
if scope_state is None:
return

installed_version = scope_state.installed_version
if not installed_version:
return

current_version = get_version()
if installed_version != current_version:
issues.append(Issue(
"version_drift",
"state.json",
f"Installed with v{installed_version} but running v{current_version}. "
"Run `agent-notes doctor --fix` or `agent-notes install` to update.",
))
fix_actions.append(FixAction("_TRIGGER_INSTALL", "state.json", "reinstall to update"))


def diagnose(scope: str, fix: bool = False) -> bool:
"""Run all diagnostic checks and optionally apply fixes."""
from .. import install_state

print_summary(scope)

issues = []
fix_actions = []

# Run checks
check_stale_files(scope, issues, fix_actions)
check_broken_symlinks(scope, issues, fix_actions)
check_broken_symlinks(scope, issues, fix_actions)
check_shadowed_files(scope, issues, fix_actions)
check_missing_files(scope, issues, fix_actions)
check_content_drift(scope, issues, fix_actions)

# Build freshness check (scope-independent)
check_build_freshness(issues, fix_actions)

# Version drift check
check_version_drift(scope, issues, fix_actions)

# SessionStart hook check (Claude Code only)
_check_session_hook(scope, issues)

Expand Down
169 changes: 0 additions & 169 deletions agent_notes/commands/update.py

This file was deleted.

40 changes: 23 additions & 17 deletions agent_notes/commands/wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from ._install_helpers import (
count_agents, count_global, count_skills
)
from ..services.counts import count_rules_total as _count_rules_total
from ..services.fs import place_file, place_dir_contents
from ..services.ui import (
_can_interactive, _safe_input, _checkbox_select, _radio_select,
Expand Down Expand Up @@ -79,22 +80,7 @@ def _get_skill_groups() -> Dict[str, List[str]]:

def _count_rules() -> int:
"""Count rule files."""
# For testing, allow bypassing the registry
import os
if os.environ.get('_WIZARD_TEST_MODE'):
if not DIST_RULES_DIR.exists():
return 0
return len(list(DIST_RULES_DIR.glob("*.md")))
else:
try:
from ..registries import default_rule_registry
registry = default_rule_registry()
return len(registry.all())
except Exception:
# Fallback to old behavior if registry fails
if not DIST_RULES_DIR.exists():
return 0
return len(list(DIST_RULES_DIR.glob("*.md")))
return _count_rules_total()


def _select_cli(step: int = 0, total: int = 0, version: str = '') -> Set[str]:
Expand Down Expand Up @@ -629,7 +615,27 @@ def _interactive_install() -> None:
print(f"{Color.RED}Build failed: {e}{Color.NC}")
return

# Execute installation
_execute_install(
clis=clis,
scope=scope,
copy_mode=copy_mode,
selected_skills=selected_skills,
role_models=role_models,
memory_backend=memory_backend,
memory_path=memory_path,
)


def _execute_install(
clis: Set[str],
scope: str,
copy_mode: bool,
selected_skills: List[str],
role_models: Dict[str, Dict[str, str]],
memory_backend: str,
memory_path: str,
) -> None:
"""Run all installation steps after parameters have been collected and the build is done."""
print(f"\nInstalling ({scope}, {'copy' if copy_mode else 'symlink'}) ...\n")

from ..services import fs as _fs
Expand Down
Loading
Loading