Skip to content

fix: status memory crash, per-tool counter, loud export failure without pyrage - #18

Merged
FZ2000 merged 2 commits into
mainfrom
fix/bugs
Mar 7, 2026
Merged

fix: status memory crash, per-tool counter, loud export failure without pyrage#18
FZ2000 merged 2 commits into
mainfrom
fix/bugs

Conversation

@FZ2000

@FZ2000 FZ2000 commented Mar 6, 2026

Copy link
Copy Markdown
Owner

Three bugs from the Forge audit report.

Fix 3 — status.py:49 crash when memory was synced (B1)

_data["memory"] is a flat dict {file_path, checksum, synced_at, ...}. The code iterated .values() treating it as a dict-of-dicts (like skills/linked_skills), then called .get("file_path") on strings — AttributeError on every status call after a memory sync.

# Before (crashes):
for info_dict in manifest._data.get("memory", {}).values():
    if fp := info_dict.get("file_path"):  # AttributeError: 'str'.get

# After (correct):
if fp := manifest._data.get("memory", {}).get("file_path"):
    recorded_paths.append(fp)

Fix 4 — sync_helpers.py per-tool success counter (B2)

total_copy/total_link accumulated across all tools in the loop, so the success message showed cumulative totals: "5 copied", "10 copied", "15 copied" for 3 tools × 5 skills. Now uses tool_copy/tool_link local variables for the message while still accumulating into the returned totals.

Fix 5 — export_import.py silent plaintext export when pyrage absent (B3)

Previously logged two warnings and continued exporting — secrets written in plaintext with no user acknowledgement. Now calls error() + raise SystemExit(1). The --no-secrets flag is the documented opt-out.

Updated test_export_import.py:

  • test_export_creates_structure and test_export_writes_cache_data now pass --no-secrets (correct user flow when pyrage unavailable)
  • Added test_export_fails_loudly_without_pyrage — asserts non-zero exit and no export dir created
  • Added test_export_no_secrets_succeeds_without_pyrage — asserts --no-secrets still works

Tests

122 passing (120 original + 2 new).

@FZ2000
FZ2000 merged commit 99fc928 into main Mar 7, 2026
4 checks passed
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.

1 participant