Commit 27dedef
authored
feat(connect): stat-only overall status + on-demand content reads (US1) (#706)
Related #696
Spec 075 US1. Connect overall status (GetAllStatus) now determines each
client's installed state via os.Stat metadata only and performs ZERO config
content reads, eliminating the macOS "wants to access data from other apps"
privacy prompt storm when simply viewing status (FR-001, SC-001/SC-002).
Reading a client's config contents to detect whether mcpproxy is registered
now happens only on an explicit per-client action via the new GetStatus(id),
which resolves Connected + AccessState (FR-002).
## Changes
- Add a content-read seam: Service.readFile (default os.ReadFile) +
NewServiceWithReader / setReadFile so tests inject reads/denials.
- ClientStatus gains additive access_state + remediation fields (FR-006).
- GetAllStatus: metadata-only existence; AccessState="unknown", Connected=false
for installed clients (eager findEntry removed).
- GetStatus(clientID): single on-demand content read via the seam; resolves
accessible/absent/malformed and Connected.
- Route all content reads (readOrCreate*, disconnect*, verifyJSONEntry,
entry-finders) through the seam; entry-finders parse bytes only.
- GetConnectedCount/GetConnectedIDs re-implemented to read lazily per client.
- CLI `mcpproxy connect` resolves Connected on demand (explicit action),
preserving the CONNECTED column.
## Testing
- New TestGetAllStatus_NoContentReads (reader asserts 0 calls),
TestGetStatus_ReadsSingleClientOnDemand (exactly 1 read), plus absent /
malformed / unknown-client cases.
- Migrated GetAllStatus connected-detection tests to GetStatus.
- go test ./internal/connect/... ./internal/httpapi/... -race green;
golangci-lint v2 clean; build (personal+server) ok; API E2E 65/65 pass.1 parent 10efe4a commit 27dedef
13 files changed
Lines changed: 1021 additions & 87 deletions
File tree
- cmd/mcpproxy
- docs/api
- internal/connect
- specs/075-macos-tcc-connect
- checklists
- contracts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
135 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
136 | 148 | | |
137 | 149 | | |
138 | 150 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
634 | 634 | | |
635 | 635 | | |
636 | 636 | | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
637 | 663 | | |
638 | 664 | | |
639 | 665 | | |
| |||
0 commit comments