Commit Graph
2 Commits
Author SHA1 Message Date
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 5e575d2fb4 DD-338 Phase B.1.b: canonical sort-before-return on syncthing_connections
Adds handler-level deterministic ordering to the one multi-record tool in
this blade. Sort key is canonical deviceID ascending (dict key from the
Syncthing REST API's `/rest/system/connections` response).

Implementer-verified shape (architect OQ-5 deferred): the upstream Syncthing
REST API returns `connections.connections` as a dict keyed by canonical
deviceID — a fixed 64-character base32-shaped hex-class string (e.g.
`AAAAAAA-AAAAAAA-...`). The dict key IS the canonical id; `format_connection`
consumes `did` as its first positional arg and renders the device's name
(or first 8 chars of the deviceID as fallback) at the top of each per-device
section. Sort by `kv[0]` (the deviceID) is the canonical Track 2 contract.

The change is in-place — a `sorted(..., key=lambda kv: kv[0])` wraps the
existing `.items()` view inside the list-comprehension. No LOC delta.

Adds tests/test_determinism.py with N=5 byte-equal harness, sort-key
correctness, and empty-connections edge case (3 new cases / 136 total).

Catalog declaration flip from `unstable → stable` lands in the paired
stallari-plugins PR.

Version bump 0.6.0 → 0.6.1 (patch — single-tool additive contract).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-23 14:13:06 +10:00