Commit Graph
7 Commits
Author SHA1 Message Date
Michael RollandClaude Opus 5.5 b678f1da1c 0.10.0: Sicherheitsfixes und neue Werkzeuge (Konflikte, Versionen, Geräte)
Fixes:
- resume_folder braucht confirm bei sendreceive/sendonly (Löschungen würden
  sich auf alle Geräte verteilen)
- accept_folder legt Ordner unter <Default-Pfad>/<Label> an statt direkt im
  Default-Pfad; belegte Pfade werden abgelehnt
- override/revert prüfen den Ordnertyp
- Fehler als MCP-ToolError (isError) mit verständlichem Text
- truncate hält JSON gültig
- pause/resume patchen nur "paused"; Bearer-Vergleich zeitkonstant
- uv.lock zum mcp<2.0-Pin synchronisiert

Neu: syncthing_find_conflicts, syncthing_list_versions,
syncthing_restore_version, syncthing_folder_stats, syncthing_add_device,
syncthing_share_folder, syncthing_set_device_paused

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 12:48:13 +01:00
PiersandClaude Fable 5 bf50002e8b AUD-04-02 — add write gate + confirm discipline (DD-385 Phase W)
The blade had no write gate and no confirm parameter anywhere — every
mutating tool (override, revert, restart, accept-device, replace-stignore,
…) fired ungated, unlike every sibling blade. This brings syncthing up to
the class baseline:

- All 13 mutating tools now require SYNCTHING_WRITE_ENABLED=true
  (models.require_write, env read at call time) and refuse with a clear
  message when the gate is off.
- Destructive/disruptive operations additionally require confirm=true:
  syncthing_override_folder, syncthing_revert_folder, syncthing_restart,
  syncthing_accept_device, syncthing_accept_folder, syncthing_set_ignores.
  Refusals explain what the operation would do. These six are now
  annotated destructiveHint: true.
- New ConfirmWriteParams / ConfirmFolderWriteParams models; confirm field
  added to AcceptDeviceInput, AcceptFolderInput, SetIgnoresInput.
- Server-level FastMCP instructions document the gate + confirm contract;
  README, SKILL.md, and stallari-plugin.yaml (setup field + env entry)
  updated to match.
- Regression suite tests/test_write_gate.py: gated-off refusal (all 13,
  unset + non-"true" value), gated-on-without-confirm refusal (all 6
  destructive), gated-on-with-confirm proceeds (mocked), and
  non-destructive-needs-no-confirm. Existing write-tool tests updated to
  enable the gate + pass confirm. 201 tests green.

Version 0.8.0 → 0.9.0 (behaviour-affecting safety gate).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 23:20:48 +10:00
PiersandClaude Opus 4.7 b3a5f23450 DD-338 Phase E.python — depend on stallari-mcp-helpers (delete local helpers)
Pure substrate swap. Local `domain_hint.py` (155 LOC) deleted; canonical
`Pattern`, `compute_domain_hint`, `load_patterns_from_yaml` are now imported
from `stallari-mcp-helpers>=0.1.0,<1.0.0`. Local `meta_envelope` +
`append_meta` helpers in `formatters.py` deleted; canonical implementations
re-exported from the lib for backward call-site compatibility.

Surfaced two API divergences vs the spec's "names stay identical" assumption:

1. The lib's `append_meta(body, meta_line)` takes a pre-built meta line; the
   prior blade-local `append_meta(payload, **kwargs)` built the envelope
   internally. All 11 call-sites in `tools/folders.py` (8), `tools/devices.py`
   (1), `tools/instances.py` (1), `tools/system.py` (1) refactored to the
   two-step `append_meta(payload, meta_envelope(...))` pattern.

2. The lib's `compute_domain_hint(record, patterns)` takes 2 args and uses
   built-in dot-path field resolution; the prior blade-local
   `compute_domain_hint(record, patterns, projector)` took a per-blade
   projector callable. The flat record shapes this blade emits (folders +
   devices) resolve identically under either approach. The blade's
   `_syncthing_field_projector` was removed (was only used as the 3rd arg).

Wire-shape change (test fixtures updated for 2 sites):
- `_meta` field order now follows lib convention (matched_total, returned,
  latency_ms, filtered_by, redactions, next_cursor, error_notes?,
  domain_hints?). Prior local helper emitted latency_ms last.
- `_meta.next_cursor` is now always present (defaults to `null`). Tests
  pinning "next_cursor not in meta" updated to "next_cursor is None".
- `_meta.redactions`, `filtered_by`, `error_notes?`, `domain_hints?` all
  unchanged in conditional-inclusion semantics.

Pure substrate swap — no behavioural change to any tool. Pack-spec catalog
declarations unchanged.

Version: 0.7.0 → 0.8.0.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-24 09:38:46 +10:00
PiersandClaude Opus 4.7 1051f6a1bb DD-338 Phase C Wave 2 — syncthing audit_surface promotion
Promotes 4 folder-scoped multi-record tools from `audit_surface: minimal` to
`audit_surface: structured` by wrapping their client calls in `time.perf_counter()`
and emitting a `_meta` envelope via the existing `append_meta()` helper:

- `syncthing_folder_errors` — `folder=` + optional `scope=` (membership
  precondition mirrors `syncthing_folder_status`; refusal carries
  `redactions=["folder_outside_scope"]`).
- `syncthing_browse_folder` — `folder=` + optional `prefix=`, `levels=`.
- `syncthing_folder_need` — `folder=`, `page=`, `perpage=` (page+perpage
  advance documented in tool description; `next_cursor` omitted per Wave 2 OQ-4).
- `syncthing_remote_need` — `device=`, `folder=`, `page=`, `perpage=`.

Test additions (+14): per-tool `_meta` shape + filtered_by content + scope
membership match/mismatch on `syncthing_folder_errors`; new
`TestRemoteNeed` covers `syncthing_remote_need`; N=3 byte-equal
determinism class per promoted tool in `test_determinism.py` (latency_ms
stripped before compare). Existing 4 tests updated from `json.loads(raw)`
to `split_meta` + payload parse.

165/165 tests green (151 before + 14 new).

Version: 0.6.1 → 0.7.0 (pyproject); 0.3.1 → 0.4.0 (__init__.py).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-23 16:37:48 +10:00
PiersandClaude Opus 4.7 0bd5d1ce06 DD-338 A.1 — syncthing scope= arg + sort-before-return + _meta envelope on 3 read tools
Combined Track 1 + Track 2 + Track 3 single-PR (heaviest A.1 spec, only
top-5 blade in both scope AND determinism gap).

Track 1: scope= arg with env-var folder-ID list indirection
         (SYNCTHING_{WORK,PERSONAL,FAMILY,HOME,INFRASTRUCTURE}_FOLDERS
         comma-separated; per-instance _<INSTANCE> override). Server-side
         from blade-process perspective (Syncthing REST has no native
         folder filter; blade-internal filter IS the over-fetch boundary
         per DD-333).
Track 2: canonical sort on device.deviceID + folder id tie-breaker on
         replication_report (fixes sort-key collision case).
Track 3: structured _meta envelope (canonical JSON-tail wire shape per
         architect amendment 2026-05-21) with matched_total / returned /
         filtered_by / redactions / latency_ms; filtered_by alphabetised
         for hash reproducibility.

Touched tools: syncthing_list_devices, syncthing_folder_status,
syncthing_replication_report. Other 35 tools unchanged.

scope=public raises through the standard error path (folders are not
public in Syncthing's model). Unconfigured scope passes through with a
honest scope=<name>_unconfigured redaction.

Tests: 120 pass (97 baseline + 23 new). Determinism check is N=5
byte-equal (modulo latency_ms) per tool.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 21:58:19 +10:00
Claude 41f1018477 Token-efficient output, SKILL.md, Cloudflare Tunnel, new tools (v0.3.0)
Major improvements following best-in-class MCP patterns:

- Token efficiency: new formatters.py with compact JSON (no indent),
  short device IDs, character-limit truncation; all read tools gain
  concise=true (default) / concise=false toggle via ReadParams base
- Models: ReadParams/WriteParams hierarchy replaces flat models;
  backward-compatible aliases preserved for tests
- New tools: syncthing_remote_need (debug remote sync gaps),
  syncthing_device_stats (per-device statistics)
- SKILL.md: LLM skill guide with token rules, quick-start table,
  workflows, tool reference, and troubleshooting
- Cloudflare Tunnel: docker-compose.tunnel.yml for zero-trust HTTP
  deployment alongside existing Traefik/ACME support
- Fix duplicate dependencies in pyproject.toml; bump to v0.3.0

https://claude.ai/code/session_018efEinU8ypT2jHeex6o9PC
2026-02-17 03:44:48 +00:00
Piers Dawson-DamerandClaude Opus 4.6 3a33d34bd1 Refactor into package, add 6 new tools, add 96 tests
Split the monolithic syncthing_mcp.py into a proper src/syncthing_mcp/
package with focused modules: client, models, registry, server, and
tool submodules (system, folders, devices, config, instances).

New tools: browse_folder, file_info, folder_need (file-level queries),
override_folder, revert_folder (conflict resolution), check_upgrade
(system management). Bumps tool count from 30 to 36.

Adds comprehensive test suite (96 tests) using pytest + respx for
HTTP mocking, covering client methods, registry logic, model validation,
and all tool functions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 10:13:37 +11:00