Skip to content

Commit a9e5e0e

Browse files
committed
docs(smithery): P0 distribution hard close report with forensic evidence
1 parent d7432a0 commit a9e5e0e

1 file changed

Lines changed: 195 additions & 0 deletions

File tree

SMITHERY_P0_REPORT.md

Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
# P0 SMITHERY DISTRIBUTION — HARD CLOSE REPORT
2+
3+
**Date**: 2026-05-15
4+
**Mission**: Resolver por que apenas 5/13 tools MCP aparecem na Smithery
5+
**Status**: CAUSA RAIZ COMPROVADA + CORREÇÃO PRONTA PARA EXECUÇÃO
6+
7+
---
8+
9+
## 1. RESUMO EXECUTIVO
10+
11+
| Item | Antes | Depois |
12+
|------|-------|--------|
13+
| Registry tools | 5 | 13 (pendente re-publish) |
14+
| Server LIVE tools | 13 | 13 (inalterado) |
15+
| smithery.yaml tools | 13 | 13 (inalterado) |
16+
| Description claim | "Security Score: 10/10 (MCP)" | Limpo (pendente re-publish) |
17+
| Publish script | v2 | v3 (com validação pré-flight) |
18+
| GitHub Action | inexistente | criado (workflow_dispatch) |
19+
20+
**O que estava quebrado**: O registry da Smithery cacheia tools no momento do publish. A última publicação foi feita quando o server tinha apenas 5 tools. Desde então, o server foi atualizado para 13 tools, mas o registry nunca foi atualizado.
21+
22+
**O que foi corrigido**: Tudo que podia ser corrigido da VM foi feito. O código está 100% correto. A única ação restante é re-publicar via Smithery CLI.
23+
24+
**Bloqueio residual**: Re-publicação requer `smithery auth login` que abre browser no smithery.ai (Vercel-hosted). Vercel bot protection bloqueia browser headless da VM. **Requer execução na máquina local do fundador.**
25+
26+
---
27+
28+
## 2. DIAGNÓSTICO FORENSE
29+
30+
### 2.1 Matriz de Divergência
31+
32+
| # | Tool | Código (route.ts) | smithery.yaml | Server LIVE | Registry Smithery |
33+
|---|------|-------------------|---------------|-------------|-------------------|
34+
| 1 | recall |||||
35+
| 2 | save_to_synapse |||||
36+
| 3 | process_text |||||
37+
| 4 | search |||||
38+
| 5 | health_check |||||
39+
| 6 | initialize_context |||| ❌ MISSING |
40+
| 7 | save_memory |||| ❌ MISSING |
41+
| 8 | store_memory |||| ❌ MISSING |
42+
| 9 | recall_memory |||| ❌ MISSING |
43+
| 10 | list_memories |||| ❌ MISSING |
44+
| 11 | memory_feedback |||| ❌ MISSING |
45+
| 12 | neural_handover |||| ❌ MISSING |
46+
| 13 | slo_report |||| ❌ MISSING |
47+
| 14 | delete_memory | ✅ (feature-flag) || ❌ (disabled) ||
48+
49+
**Nota**: `delete_memory` está feature-flagged (`MCP_TOOL_DELETE_MEMORY_ENABLED`). Quando habilitado, serão 14 tools.
50+
51+
### 2.2 Evidências Coletadas
52+
53+
1. **Server LIVE (forge.synapselayer.org/api/mcp)**
54+
- `tools/list` retorna **13 tools**
55+
- Sem auth necessária para `tools/list`
56+
- Protocol version: `2024-11-05`
57+
- Server version: `2.4.0`
58+
59+
2. **Registry Smithery (registry.smithery.ai)**
60+
- Retorna **5 tools** (cacheado de publish anterior)
61+
- Description contém claim desalinhado: "Security Score: 10/10 (MCP)"
62+
- Tools schemas são de versão ANTIGA (menos properties que server atual)
63+
64+
3. **Proxy Smithery (synapse-protocol--synapselayer.run.tools)**
65+
- Retorna `{"error":"invalid_token"}` sem auth
66+
- Retorna 0 tools em `tools/list` sem config
67+
- Proxy funcional mas requer `connect_token` para uso real
68+
69+
4. **smithery.yaml (synapse-layer repo)**
70+
- Declara 13 tools com schemas completos ✅
71+
- Description limpa (sem claims proibidos) ✅
72+
- configSchema com `connect_token` required ✅
73+
74+
---
75+
76+
## 3. CAUSA RAIZ
77+
78+
**O registry Smithery é cacheado no momento da publicação.**
79+
80+
Quando `npx @smithery/cli mcp publish` é executado:
81+
1. O CLI se conecta ao serverUrl
82+
2. Chama `tools/list` para descobrir as tools disponíveis
83+
3. Armazena o resultado no registry
84+
4. O registry permanece estático até a próxima publicação
85+
86+
A última publicação foi feita quando o server tinha **apenas 5 tools** (versão antiga, pré-v2.4.0). O server foi atualizado para 13 tools, mas o registry nunca foi re-publicado. **Não há auto-refresh.**
87+
88+
**Prova**: Os schemas das 5 tools no registry diferem dos schemas das mesmas 5 tools no server atual (menos properties, nomes de parâmetros diferentes).
89+
90+
---
91+
92+
## 4. CORREÇÕES EXECUTADAS
93+
94+
### Commit 1: `d7432a0` (main)
95+
```
96+
fix(smithery): publish automation v3 + GitHub Action for registry refresh
97+
```
98+
99+
**Arquivos alterados**:
100+
- `scripts/smithery-publish.sh` → v3 com validação pré-flight, snapshots before/after, gate de 13 tools
101+
- `.github/workflows/smithery-publish.yml` → GitHub Action (workflow_dispatch) para publicação automatizada
102+
- `smithery_p0_evidence.json` → Evidência forense do estado before/after
103+
104+
**Push**: `github.com:SynapseLayer/synapse-layer.git``d7432a0`
105+
106+
---
107+
108+
## 5. VALIDAÇÃO TÉCNICA
109+
110+
- [x] 13 tools registradas no código (route.ts)
111+
- [x] 13 tools declaradas no smithery.yaml
112+
- [x] 13 tools retornadas pelo server LIVE
113+
- [x] 5 tools no registry (STALE — requer re-publish)
114+
- [x] Consistência de nomes entre código, yaml e server
115+
- [x] Schema/metadata presente para todas as 13 tools
116+
- [x] config_schema.json válido
117+
- [x] Auth/config preservada
118+
- [x] Claims proibidos ausentes no yaml e código
119+
- [x] "Security Score: 10/10 (MCP)" será removido no re-publish
120+
- [x] Deploy branch correta (main)
121+
- [x] Commit correspondente (`d7432a0`)
122+
123+
---
124+
125+
## 6. VALIDAÇÃO PÚBLICA FINAL
126+
127+
### Estado ANTES
128+
- **Score**: 69/100
129+
- **Uptime**: 100%
130+
- **Tools visíveis**: 5 (recall, save_to_synapse, process_text, search, health_check)
131+
- **Description**: Contém "Security Score: 10/10 (MCP)" (claim desalinhado)
132+
133+
### Estado ESPERADO APÓS re-publish
134+
- **Score**: ≥69/100 (pode aumentar com mais tools)
135+
- **Uptime**: 100% (inalterado)
136+
- **Tools visíveis**: 13 (todas)
137+
- **Description**: Limpa ("Persistent memory infrastructure for AI agents — encrypted, governed, and cross-agent. The OAuth for AI Memory.")
138+
139+
### Bloqueio de Validação
140+
Smithery.ai é hospedado no Vercel. Vercel bot protection (`Code 11`) bloqueia browser headless da VM. Screenshot da página final requer:
141+
- Re-publish da máquina local do fundador
142+
- Screenshot manual após propagação (5-10 segundos)
143+
144+
---
145+
146+
## 7. AÇÃO REQUERIDA DO FUNDADOR
147+
148+
### Publicação Imediata (5 minutos)
149+
150+
Na máquina local, dentro do repo `synapse-layer`:
151+
152+
```bash
153+
# 1. Pull latest
154+
git pull origin main
155+
156+
# 2. Run publish script
157+
chmod +x scripts/smithery-publish.sh
158+
./scripts/smithery-publish.sh
159+
```
160+
161+
O script irá:
162+
1. Validar que o server retorna 13 tools
163+
2. Pedir autenticação via browser (login no Smithery)
164+
3. Publicar para o registry
165+
4. Verificar que 13 tools foram registradas
166+
167+
### Setup de Publicação Automatizada (opcional)
168+
169+
Após a publicação manual:
170+
171+
```bash
172+
# Get your API key
173+
npx @smithery/cli auth whoami --full
174+
# Copy the SMITHERY_API_KEY value
175+
```
176+
177+
1. Ir para: `github.com/SynapseLayer/synapse-layer/settings/secrets/actions`
178+
2. Adicionar secret: `SMITHERY_API_KEY` = `<your key>`
179+
3. Futuras publicações: Actions → "Publish to Smithery Registry" → Run workflow
180+
181+
---
182+
183+
## 8. PRÓXIMAS AÇÕES
184+
185+
### P0 (Bloqueador)
186+
- [ ] **Fundador executa `smithery-publish.sh`** na máquina local → 13/13 tools no registry
187+
188+
### P1 (Pós-publish)
189+
- [ ] Verificar score na Smithery (pode mudar com 13 tools)
190+
- [ ] Habilitar `delete_memory` se desejado (env var `MCP_TOOL_DELETE_MEMORY_ENABLED=true`) → 14 tools
191+
- [ ] Configurar secret `SMITHERY_API_KEY` no GitHub para publicação automática
192+
193+
### P2 (Melhoria contínua)
194+
- [ ] Monitorar Smithery score e uptime
195+
- [ ] Considerar adicionar GitHub Action trigger no push (auto-publish on release)

0 commit comments

Comments
 (0)