visus-mcp 0.6.0 → 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/.claude/settings.local.json +42 -1
  2. package/.github/ISSUE_TEMPLATE/bug_report.md +47 -0
  3. package/.github/ISSUE_TEMPLATE/false_positive.md +43 -0
  4. package/.github/ISSUE_TEMPLATE/new_pattern.md +49 -0
  5. package/.github/ISSUE_TEMPLATE/security_report.md +31 -0
  6. package/.github/PULL_REQUEST_TEMPLATE.md +39 -0
  7. package/.mcpregistry_github_token +1 -0
  8. package/.mcpregistry_registry_token +1 -0
  9. package/CLAUDE.md +197 -0
  10. package/CONTRIBUTING.md +329 -0
  11. package/README.md +111 -45
  12. package/STATUS.md +167 -29
  13. package/SUBMISSION.md +66 -0
  14. package/TROUBLESHOOT-COGNITO-AUTH-20260324-2029.md +415 -0
  15. package/TROUBLESHOOT-COGNITO-JWT-20260324.md +592 -0
  16. package/dist/browser/playwright-renderer.d.ts.map +1 -1
  17. package/dist/browser/playwright-renderer.js +71 -51
  18. package/dist/browser/playwright-renderer.js.map +1 -1
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +49 -6
  21. package/dist/index.js.map +1 -1
  22. package/dist/sanitizer/elicit-runner.d.ts +48 -0
  23. package/dist/sanitizer/elicit-runner.d.ts.map +1 -0
  24. package/dist/sanitizer/elicit-runner.js +100 -0
  25. package/dist/sanitizer/elicit-runner.js.map +1 -0
  26. package/dist/sanitizer/framework-mapper.d.ts +2 -0
  27. package/dist/sanitizer/framework-mapper.d.ts.map +1 -1
  28. package/dist/sanitizer/framework-mapper.js +91 -45
  29. package/dist/sanitizer/framework-mapper.js.map +1 -1
  30. package/dist/sanitizer/hitl-gate.d.ts +69 -0
  31. package/dist/sanitizer/hitl-gate.d.ts.map +1 -0
  32. package/dist/sanitizer/hitl-gate.js +101 -0
  33. package/dist/sanitizer/hitl-gate.js.map +1 -0
  34. package/dist/sanitizer/threat-reporter.d.ts +1 -0
  35. package/dist/sanitizer/threat-reporter.d.ts.map +1 -1
  36. package/dist/sanitizer/threat-reporter.js +10 -7
  37. package/dist/sanitizer/threat-reporter.js.map +1 -1
  38. package/infrastructure/stack.ts +1 -0
  39. package/lambda-deploy/index.js +81512 -0
  40. package/lambda-deploy/index.js.map +7 -0
  41. package/lambda-package/browser/__mocks__/playwright-renderer.d.ts +25 -0
  42. package/lambda-package/browser/__mocks__/playwright-renderer.d.ts.map +1 -0
  43. package/lambda-package/browser/__mocks__/playwright-renderer.js +119 -0
  44. package/lambda-package/browser/__mocks__/playwright-renderer.js.map +1 -0
  45. package/lambda-package/browser/playwright-renderer.d.ts +40 -0
  46. package/lambda-package/browser/playwright-renderer.d.ts.map +1 -0
  47. package/lambda-package/browser/playwright-renderer.js +214 -0
  48. package/lambda-package/browser/playwright-renderer.js.map +1 -0
  49. package/lambda-package/browser/reader.d.ts +31 -0
  50. package/lambda-package/browser/reader.d.ts.map +1 -0
  51. package/lambda-package/browser/reader.js +98 -0
  52. package/lambda-package/browser/reader.js.map +1 -0
  53. package/lambda-package/index.d.ts +18 -0
  54. package/lambda-package/index.d.ts.map +1 -0
  55. package/lambda-package/index.js +238 -0
  56. package/lambda-package/index.js.map +1 -0
  57. package/lambda-package/lambda-handler.d.ts +28 -0
  58. package/lambda-package/lambda-handler.d.ts.map +1 -0
  59. package/lambda-package/lambda-handler.js +257 -0
  60. package/lambda-package/lambda-handler.js.map +1 -0
  61. package/lambda-package/package-lock.json +7435 -0
  62. package/lambda-package/package.json +74 -0
  63. package/lambda-package/runtime.d.ts +50 -0
  64. package/lambda-package/runtime.d.ts.map +1 -0
  65. package/lambda-package/runtime.js +86 -0
  66. package/lambda-package/runtime.js.map +1 -0
  67. package/lambda-package/sanitizer/elicit-runner.d.ts +48 -0
  68. package/lambda-package/sanitizer/elicit-runner.d.ts.map +1 -0
  69. package/lambda-package/sanitizer/elicit-runner.js +100 -0
  70. package/lambda-package/sanitizer/elicit-runner.js.map +1 -0
  71. package/lambda-package/sanitizer/framework-mapper.d.ts +24 -0
  72. package/lambda-package/sanitizer/framework-mapper.d.ts.map +1 -0
  73. package/lambda-package/sanitizer/framework-mapper.js +342 -0
  74. package/lambda-package/sanitizer/framework-mapper.js.map +1 -0
  75. package/lambda-package/sanitizer/hitl-gate.d.ts +69 -0
  76. package/lambda-package/sanitizer/hitl-gate.d.ts.map +1 -0
  77. package/lambda-package/sanitizer/hitl-gate.js +101 -0
  78. package/lambda-package/sanitizer/hitl-gate.js.map +1 -0
  79. package/lambda-package/sanitizer/index.d.ts +63 -0
  80. package/lambda-package/sanitizer/index.d.ts.map +1 -0
  81. package/lambda-package/sanitizer/index.js +105 -0
  82. package/lambda-package/sanitizer/index.js.map +1 -0
  83. package/lambda-package/sanitizer/injection-detector.d.ts +34 -0
  84. package/lambda-package/sanitizer/injection-detector.d.ts.map +1 -0
  85. package/lambda-package/sanitizer/injection-detector.js +89 -0
  86. package/lambda-package/sanitizer/injection-detector.js.map +1 -0
  87. package/lambda-package/sanitizer/patterns.d.ts +30 -0
  88. package/lambda-package/sanitizer/patterns.d.ts.map +1 -0
  89. package/lambda-package/sanitizer/patterns.js +372 -0
  90. package/lambda-package/sanitizer/patterns.js.map +1 -0
  91. package/lambda-package/sanitizer/pii-allowlist.d.ts +49 -0
  92. package/lambda-package/sanitizer/pii-allowlist.d.ts.map +1 -0
  93. package/lambda-package/sanitizer/pii-allowlist.js +231 -0
  94. package/lambda-package/sanitizer/pii-allowlist.js.map +1 -0
  95. package/lambda-package/sanitizer/pii-redactor.d.ts +41 -0
  96. package/lambda-package/sanitizer/pii-redactor.d.ts.map +1 -0
  97. package/lambda-package/sanitizer/pii-redactor.js +213 -0
  98. package/lambda-package/sanitizer/pii-redactor.js.map +1 -0
  99. package/lambda-package/sanitizer/severity-classifier.d.ts +33 -0
  100. package/lambda-package/sanitizer/severity-classifier.d.ts.map +1 -0
  101. package/lambda-package/sanitizer/severity-classifier.js +113 -0
  102. package/lambda-package/sanitizer/severity-classifier.js.map +1 -0
  103. package/lambda-package/sanitizer/threat-reporter.d.ts +66 -0
  104. package/lambda-package/sanitizer/threat-reporter.d.ts.map +1 -0
  105. package/lambda-package/sanitizer/threat-reporter.js +163 -0
  106. package/lambda-package/sanitizer/threat-reporter.js.map +1 -0
  107. package/lambda-package/tools/fetch-structured.d.ts +51 -0
  108. package/lambda-package/tools/fetch-structured.d.ts.map +1 -0
  109. package/lambda-package/tools/fetch-structured.js +237 -0
  110. package/lambda-package/tools/fetch-structured.js.map +1 -0
  111. package/lambda-package/tools/fetch.d.ts +49 -0
  112. package/lambda-package/tools/fetch.d.ts.map +1 -0
  113. package/lambda-package/tools/fetch.js +131 -0
  114. package/lambda-package/tools/fetch.js.map +1 -0
  115. package/lambda-package/tools/read.d.ts +51 -0
  116. package/lambda-package/tools/read.d.ts.map +1 -0
  117. package/lambda-package/tools/read.js +127 -0
  118. package/lambda-package/tools/read.js.map +1 -0
  119. package/lambda-package/tools/search.d.ts +45 -0
  120. package/lambda-package/tools/search.d.ts.map +1 -0
  121. package/lambda-package/tools/search.js +220 -0
  122. package/lambda-package/tools/search.js.map +1 -0
  123. package/lambda-package/types.d.ts +167 -0
  124. package/lambda-package/types.d.ts.map +1 -0
  125. package/lambda-package/types.js +16 -0
  126. package/lambda-package/types.js.map +1 -0
  127. package/lambda-package/utils/format-converter.d.ts +39 -0
  128. package/lambda-package/utils/format-converter.d.ts.map +1 -0
  129. package/lambda-package/utils/format-converter.js +191 -0
  130. package/lambda-package/utils/format-converter.js.map +1 -0
  131. package/lambda-package/utils/truncate.d.ts +26 -0
  132. package/lambda-package/utils/truncate.d.ts.map +1 -0
  133. package/lambda-package/utils/truncate.js +54 -0
  134. package/lambda-package/utils/truncate.js.map +1 -0
  135. package/lambda.zip +0 -0
  136. package/mcp.json +44 -0
  137. package/package.json +9 -8
  138. package/server.json +43 -0
  139. package/src/browser/playwright-renderer.ts +74 -51
  140. package/src/index.ts +78 -6
  141. package/src/sanitizer/elicit-runner.ts +125 -0
  142. package/src/sanitizer/framework-mapper.ts +92 -45
  143. package/src/sanitizer/hitl-gate.ts +111 -0
  144. package/src/sanitizer/threat-reporter.ts +11 -7
  145. package/tests/elicit-runner.test.ts +232 -0
  146. package/tests/hitl-gate.test.ts +267 -0
  147. package/tests/threat-reporter.test.ts +69 -1
@@ -14,7 +14,48 @@
14
14
  "Bash(git push)",
15
15
  "Bash(git push:*)",
16
16
  "Bash(npm search:*)",
17
- "Bash(npm publish:*)"
17
+ "Bash(npm publish:*)",
18
+ "Bash(git tag:*)",
19
+ "Bash(npm view:*)",
20
+ "Bash(cat:*)",
21
+ "Bash(find:*)",
22
+ "Bash(git checkout:*)",
23
+ "Bash(node:*)",
24
+ "WebFetch(domain:mcp.so)",
25
+ "WebFetch(domain:pulsemcp.com)",
26
+ "WebFetch(domain:github.com)",
27
+ "WebFetch(domain:registry.modelcontextprotocol.io)",
28
+ "Bash(git remote:*)",
29
+ "Bash(brew install:*)",
30
+ "Bash(mcp-publisher:*)",
31
+ "Bash(npm version:*)",
32
+ "Bash(aws lambda get-function:*)",
33
+ "Bash(pkill:*)",
34
+ "Bash(docker info:*)",
35
+ "Bash(npx esbuild:*)",
36
+ "Bash(./node_modules/.bin/esbuild:*)",
37
+ "Bash(node_modules/.bin/esbuild:*)",
38
+ "Bash(zip:*)",
39
+ "Bash(aws lambda update-function-code:*)",
40
+ "Bash(aws lambda get-function-configuration:*)",
41
+ "Bash(aws sts get-caller-identity:*)",
42
+ "Bash(aws cognito-idp list-users:*)",
43
+ "Bash(aws cognito-idp admin-create-user:*)",
44
+ "Bash(aws cognito-idp admin-set-user-password:*)",
45
+ "Bash(aws cognito-idp initiate-auth:*)",
46
+ "Bash(TOKEN=\"eyJraWQiOiJ1eGNRZmJWbWx4WFBaSzdwYisxck5mcmxaaXBHZE5Wekw0WWFmMis5c25ZPSIsImFsZyI6IlJTMjU2In0.eyJzdWIiOiI3NDA4OTRjOC01MDYxLTcwOGMt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Qn6atP1FzZ5TSUb-DuDrS2lkGI-jnWjEA\")",
52
+ "Bash(/tmp/token.txt)",
53
+ "Bash(chmod:*)",
54
+ "Bash(/tmp/test-auth.sh)",
55
+ "Bash(/tmp/test-google.sh:*)",
56
+ "Bash(git reset:*)",
57
+ "Bash(npx visus-mcp:*)",
58
+ "WebSearch"
18
59
  ],
19
60
  "deny": [],
20
61
  "ask": []
@@ -0,0 +1,47 @@
1
+ ---
2
+ name: Bug Report
3
+ about: Something isn't working correctly
4
+ title: '[BUG] '
5
+ labels: bug
6
+ assignees: ''
7
+ ---
8
+
9
+ ## Describe the bug
10
+
11
+ A clear description of what went wrong.
12
+
13
+ ## Tool used
14
+
15
+ - [ ] visus_fetch
16
+ - [ ] visus_read
17
+ - [ ] visus_search
18
+ - [ ] visus_fetch_structured
19
+
20
+ ## To Reproduce
21
+
22
+ 1. Tool call (URL and parameters — remove any sensitive URLs)
23
+ 2. Expected output
24
+ 3. Actual output
25
+
26
+ ## Sanitization metadata
27
+
28
+ Paste the `sanitization` block from the tool response if relevant.
29
+
30
+ ```json
31
+ {
32
+ "patterns_detected": [],
33
+ "pii_types_redacted": [],
34
+ "content_modified": false
35
+ }
36
+ ```
37
+
38
+ ## Environment
39
+
40
+ - visus-mcp version: (run `npx visus-mcp --version`)
41
+ - Node.js version: (run `node --version`)
42
+ - OS: (macOS / Windows / Linux)
43
+ - Claude Desktop version (if applicable):
44
+
45
+ ## Additional context
46
+
47
+ Any other relevant information.
@@ -0,0 +1,43 @@
1
+ ---
2
+ name: False Positive Report
3
+ about: visus incorrectly flagged or redacted legitimate content
4
+ title: '[FALSE POSITIVE] '
5
+ labels: false-positive, sanitizer
6
+ assignees: ''
7
+ ---
8
+
9
+ ## What was incorrectly flagged?
10
+
11
+ Describe the legitimate content that was redacted or blocked.
12
+ Do NOT include sensitive URLs or private content.
13
+
14
+ ## Pattern category that fired
15
+
16
+ Which pattern triggered? (visible in the `patterns_detected` field of the sanitization metadata)
17
+
18
+ Pattern name: `pattern_name_here`
19
+
20
+ ## Example of the content
21
+
22
+ A minimal example of the text that triggered the false positive.
23
+ Keep it short — just enough to reproduce the pattern match.
24
+
25
+ ```
26
+ Example content here
27
+ ```
28
+
29
+ ## Expected behavior
30
+
31
+ What should visus have done with this content?
32
+
33
+ ## Domain context
34
+
35
+ What type of site was this? (news, documentation, health info, government, etc.) — helps assess if a domain-scoped allowlist is appropriate.
36
+
37
+ Domain type: ___
38
+
39
+ ## visus-mcp version
40
+
41
+ Run `npx visus-mcp --version`:
42
+
43
+ Version: ___
@@ -0,0 +1,49 @@
1
+ ---
2
+ name: New Injection Pattern Request
3
+ about: Suggest a new prompt injection pattern category
4
+ title: '[PATTERN] '
5
+ labels: enhancement, sanitizer
6
+ assignees: ''
7
+ ---
8
+
9
+ ## Pattern description
10
+
11
+ What type of injection attack does this detect?
12
+
13
+ ## Example of malicious content
14
+
15
+ A concrete example of what this pattern should catch.
16
+ (These examples are for security research — they will be added to the test corpus.)
17
+
18
+ **Example 1 (should be caught):**
19
+ ```
20
+ [paste example here]
21
+ ```
22
+
23
+ **Example 2 (should NOT be caught — negative case):**
24
+ ```
25
+ [paste legitimate content that looks similar but is safe]
26
+ ```
27
+
28
+ ## Proposed severity level
29
+
30
+ - [ ] CRITICAL — Immediate threat, direct instruction manipulation
31
+ - [ ] HIGH — Significant obfuscation or context manipulation
32
+ - [ ] MEDIUM — Moderate risk, indirect attack vectors
33
+ - [ ] LOW — Low risk, informational flag
34
+
35
+ ## Framework mapping (if known)
36
+
37
+ - OWASP LLM Top 10: (e.g. LLM01:2025)
38
+ - NIST AI 600-1: (e.g. MS-2.5)
39
+ - MITRE ATLAS: (e.g. AML.T0051)
40
+ - ISO/IEC 42001: (e.g. A.6.1.5)
41
+
42
+ ## Real-world context
43
+
44
+ Where have you seen this pattern used? (CVE, research paper, red team exercise, etc.)
45
+
46
+ ## Are you willing to submit a PR?
47
+
48
+ - [ ] Yes, I'll implement and test this pattern
49
+ - [ ] No, but I can provide more examples if needed
@@ -0,0 +1,31 @@
1
+ ---
2
+ name: Security Vulnerability
3
+ about: Report a security vulnerability in visus-mcp
4
+ title: '[SECURITY] '
5
+ labels: security
6
+ assignees: ''
7
+ ---
8
+
9
+ # ⚠️ STOP — Do not file public security issues.
10
+
11
+ If you have found a security vulnerability in visus-mcp, please report it **privately**:
12
+
13
+ 📧 **Email:** security@lateos.ai
14
+
15
+ 🔒 **GitHub Security Advisories:**
16
+ https://github.com/visus-mcp/visus-mcp/security/advisories/new
17
+
18
+ ## Include in your report:
19
+
20
+ - Description of the vulnerability
21
+ - Steps to reproduce
22
+ - Potential impact
23
+ - Suggested fix (optional)
24
+
25
+ We aim to respond within **48 hours** and will credit you in SECURITY.md once the issue is resolved.
26
+
27
+ Thank you for helping keep visus-mcp secure.
28
+
29
+ ---
30
+
31
+ **Do not proceed with this public issue template for security vulnerabilities.**
@@ -0,0 +1,39 @@
1
+ ## What does this PR do?
2
+
3
+ Brief description of the change.
4
+
5
+ ## Type of change
6
+
7
+ - [ ] New injection pattern
8
+ - [ ] False positive fix
9
+ - [ ] Bug fix
10
+ - [ ] Feature addition
11
+ - [ ] Documentation update
12
+ - [ ] Performance improvement
13
+
14
+ ## Test results
15
+
16
+ - [ ] npm test passes (all tests)
17
+ - [ ] npm run build compiles cleanly
18
+ - [ ] New tests added for new functionality
19
+ - [ ] Test count did not decrease
20
+
21
+ **Before:** X/X tests passing
22
+ **After:** X/X tests passing
23
+
24
+ ## Security checklist
25
+
26
+ - [ ] All new content passes through the sanitizer pipeline
27
+ - [ ] No new `any` types introduced
28
+ - [ ] No console.log (use structured stderr logging)
29
+ - [ ] No hardcoded secrets or API keys
30
+ - [ ] CLAUDE.md security rules not violated
31
+
32
+ ## Does this change affect sanitization coverage?
33
+
34
+ - [ ] No
35
+ - [ ] Yes — explain: ___
36
+
37
+ ## Related issues
38
+
39
+ Closes #___
@@ -0,0 +1 @@
1
+ ghu_9xbQ1SXXZ8bh3BmoTNB21qUfmu31cJ0ly3mc
@@ -0,0 +1 @@
1
+ {"token":"eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJtY3AtcmVnaXN0cnkiLCJleHAiOjE3NzQzMDc2MzIsIm5iZiI6MTc3NDMwNzMzMiwiaWF0IjoxNzc0MzA3MzMyLCJhdXRoX21ldGhvZCI6ImdpdGh1Yi1hdCIsImF1dGhfbWV0aG9kX3N1YiI6Imxlb2Nob25nIiwicGVybWlzc2lvbnMiOlt7ImFjdGlvbiI6InB1Ymxpc2giLCJyZXNvdXJjZSI6ImlvLmdpdGh1Yi5sZW9jaG9uZy8qIn0seyJhY3Rpb24iOiJwdWJsaXNoIiwicmVzb3VyY2UiOiJpby5naXRodWIudmlzdXMtbWNwLyoifV19.qXNypXv1OF_l3ob4Kju46rvn-vs4s5x3JIU2ZH7jJiaBV5gy0sX60NJSKM9ybJvcXggnW9_Mp1L-JeZDPVd5BQ","expires_at":1774307632}
package/CLAUDE.md CHANGED
@@ -71,6 +71,9 @@ npm publish --dry-run # Validate package before publishing
71
71
  npx visus-mcp # Start MCP server
72
72
  ```
73
73
 
74
+ **IMPORTANT: On every npm release, keep `server.json` version in sync with `package.json` version.**
75
+ The MCP registry requires that the version field in `server.json` matches the published npm package version.
76
+
74
77
  ## Coding Standards (Lateos Conventions)
75
78
 
76
79
  - **TypeScript strict mode** - No `any` types allowed
@@ -103,6 +106,8 @@ All tests must pass before Phase 1 is complete.
103
106
  - 43 injection payloads (one per pattern category)
104
107
  - 10 clean pages/content samples (should produce no detections)
105
108
 
109
+ ---
110
+
106
111
  ## Standard Troubleshooting Protocol
107
112
 
108
113
  Whenever you encounter an error, blocked deployment, or multi-step recovery task, you MUST generate a structured troubleshooting log automatically. This is not optional — it applies to every build, fix, and diagnostic task in this project.
@@ -118,6 +123,62 @@ Save to project root. Examples:
118
123
  - `TROUBLESHOOT-LAMBDA-20260314-0900.md`
119
124
  - `TROUBLESHOOT-SLIM-20260314-0629.md`
120
125
 
126
+ ### Log Structure
127
+
128
+ Every troubleshooting log MUST follow this three-phase structure:
129
+
130
+ #### Phase 1: Investigation (read-only)
131
+ No changes to code or infrastructure. Gather facts, reproduce the error, read logs.
132
+ Only advance to Phase 2 after root cause is confirmed or a clear hypothesis is formed.
133
+
134
+ #### Phase 2: Fix Plan
135
+ Write out the proposed fix and alternatives considered. Do NOT execute yet.
136
+ If root cause shifts during Phase 2, return to Phase 1.
137
+
138
+ #### Phase 3: Execution
139
+ Implement the fix. Log every action. Update the SUMMARY at the end.
140
+
141
+ ---
142
+
143
+ ### Stop Conditions (mandatory — check before every action)
144
+
145
+ If any of the following are true, **STOP immediately**, log the blocker, and wait for user input:
146
+
147
+ | Condition | Action |
148
+ |-----------|--------|
149
+ | Deployment or build hangs >10 minutes | Kill process, document, ask user for direction |
150
+ | Same error appears >2 times in a row | Stop retrying, propose alternative approach |
151
+ | Root cause shifts away from original task | Re-confirm scope with user before continuing |
152
+ | A tool or service is unavailable (Docker, AWS, etc.) | Document and present options — do not loop |
153
+ | Success criteria cannot be verified | Stop and ask user how to validate |
154
+
155
+ ---
156
+
157
+ ### Environment Pre-flight
158
+
159
+ Run this checklist before ANY deployment or infrastructure task. Log each result.
160
+
161
+ ```bash
162
+ # AWS credentials
163
+ aws sts get-caller-identity
164
+
165
+ # Docker health (required for CDK bundling)
166
+ docker info
167
+
168
+ # Disk space (ENOSPC will cause silent failures)
169
+ df -h /
170
+
171
+ # CDK version
172
+ npx cdk --version
173
+
174
+ # Node/npm
175
+ node --version && npm --version
176
+ ```
177
+
178
+ If Docker is unavailable or disk space is low, use the manual Lambda deploy path (see Lambda Deployment below) rather than attempting CDK.
179
+
180
+ ---
181
+
121
182
  ### Entry Format (append after EVERY action)
122
183
 
123
184
  ```markdown
@@ -130,6 +191,24 @@ Save to project root. Examples:
130
191
  **Status:** ✅ Success / ❌ Failed / ⚠️ Partial
131
192
  ```
132
193
 
194
+ ### Ruled Out (maintain throughout session)
195
+
196
+ Append to this section whenever a suspected cause is eliminated. Prevents re-investigation.
197
+
198
+ ```markdown
199
+ ## Ruled Out
200
+ - ❌ <Component>: <one-line reason> — confirmed <date/time>
201
+ ```
202
+
203
+ Example:
204
+ ```markdown
205
+ ## Ruled Out
206
+ - ❌ Cognito JWT: Auth correctly returns 401 on unauthenticated requests — not the issue
207
+ - ❌ API Gateway routing: Routes confirmed correct in stack outputs — not the issue
208
+ ```
209
+
210
+ ---
211
+
133
212
  ### Rules
134
213
 
135
214
  1. **Log BEFORE executing, not after** — write Goal and Reasoning first
@@ -137,6 +216,25 @@ Save to project root. Examples:
137
216
  3. **On failure:** log the full error, state your revised reasoning, attempt one alternative, log that too
138
217
  4. **Do not summarize or clean up errors** — paste raw output verbatim
139
218
  5. **End every log with a SUMMARY section:** root cause, resolution, lessons learned, and open issues
219
+ 6. **Populate "Ruled Out" in real time** — do not re-investigate eliminated causes
220
+ 7. **Complete Phase 1 fully before making any changes** — no exceptions
221
+
222
+ ---
223
+
224
+ ### CLAUDE.md Updates Required
225
+
226
+ At the end of every troubleshooting session, before closing, check whether any findings should be promoted to this file. Add a section to the troubleshoot doc:
227
+
228
+ ```markdown
229
+ ## CLAUDE.md Updates Required
230
+ - [ ] <Finding that should become a permanent convention>
231
+ - [ ] <New known error to add to the registry>
232
+ - [ ] <New deployment step or warning>
233
+ ```
234
+
235
+ Then apply those updates to CLAUDE.md as the final step of the session.
236
+
237
+ ---
140
238
 
141
239
  ### Purpose
142
240
 
@@ -152,6 +250,8 @@ Goal: Restore MCP handler Lambda with proper dependency packaging
152
250
 
153
251
  ---
154
252
 
253
+ ## Phase 1: Investigation
254
+
155
255
  ## [06:02:18] Step 1 - Locate MCP Handler Source
156
256
 
157
257
  **Goal:** Find the mcp_handler.py source file in the project
@@ -163,14 +263,109 @@ Goal: Restore MCP handler Lambda with proper dependency packaging
163
263
 
164
264
  ---
165
265
 
266
+ ## Ruled Out
267
+ - ❌ IAM permissions: Lambda execution role has correct policies — not the issue
268
+
269
+ ---
270
+
271
+ ## Phase 2: Fix Plan
272
+ ...
273
+
274
+ ## Phase 3: Execution
275
+ ...
276
+
277
+ ---
278
+
166
279
  # RECOVERY SUMMARY
167
280
 
168
281
  Final Status: ✅ RESTORED
169
282
  Root Cause: Lambda package missing runtime dependencies
170
283
  Resolution: Installed aws_lambda_powertools + aws_xray_sdk
171
284
  Lessons Learned: Always verify dependencies in Lambda packages
285
+
286
+ ## CLAUDE.md Updates Required
287
+ - [ ] Add aws_lambda_powertools to standard Lambda dependency checklist
288
+ ```
289
+
290
+ ---
291
+
292
+ ## Known Errors Registry
293
+
294
+ When a root cause is confirmed, add it here. Future sessions check this list first before investigating.
295
+
296
+ | Error | Root Cause | Fix | Date Confirmed |
297
+ |-------|-----------|-----|----------------|
298
+ | `ERR_MODULE_NOT_FOUND: @modelcontextprotocol/sdk` in Lambda | `index.js` (MCP stdio server) included in Lambda bundle via `package.json` `"main"` field; SDK not bundled | Add `@modelcontextprotocol/sdk` to `externalModules` in `infrastructure/stack.ts` | 2026-03-24 |
299
+ | CDK `docker buildx` hangs indefinitely | Docker resource contention or disk pressure on Apple Silicon Mac | Use manual Lambda deploy script (see below); fix Docker separately | 2026-03-24 |
300
+ | `ENOSPC` on Claude Code startup | Mac disk full; `~/.claude/debug/` write fails | Free disk space; `rm -rf ~/.claude/debug/`; restart | 2026-03-24 |
301
+ | 401 Unauthorized after `cdk deploy` | CDK does NOT automatically redeploy API Gateway stages when Lambda code or authorizer config changes | After every `cdk deploy`, run: `aws apigateway create-deployment --rest-api-id <api-id> --stage-name <stage>` | 2026-03-24 |
302
+ | `unable to get local issuer certificate` in Lambda | undici HTTP client in AWS Lambda Node.js 20 runtime lacks proper CA certificate configuration | Replace undici with Node.js native `fetch()` API (available in Node 18+) which has proper CA handling in Lambda | 2026-03-24 |
303
+
304
+ ---
305
+
306
+ ## Lambda Deployment
307
+
308
+ ### Bundling Conventions
309
+
310
+ **CRITICAL: Always use `--format=cjs` for Lambda bundles.**
311
+ AWS SDK v3 uses dynamic `require()` internally. ESM output from esbuild will fail at Lambda runtime with `ERR_REQUIRE_ESM` or similar. CommonJS is the correct format for all Lambda deployments.
312
+
313
+ **Always externalize these packages:**
314
+ - `playwright-core` — added via Lambda layer
315
+ - `@sparticuz/chromium` — added via Lambda layer
316
+ - `@modelcontextprotocol/sdk` — only needed for stdio mode, not Lambda
317
+
318
+ **Entry point must always be `src/lambda-handler.ts`, NOT `src/index.ts`.**
319
+ `index.ts` is the MCP stdio server and imports packages that must not be in the Lambda bundle.
320
+
321
+ ### Manual Deploy Script (use when CDK/Docker is unavailable)
322
+
323
+ ```bash
324
+ #!/bin/bash
325
+ # scripts/deploy-lambda.sh
326
+ # Use this when CDK Docker bundling is blocked
327
+
328
+ set -e
329
+
330
+ echo "Building Lambda bundle..."
331
+ npm run build
332
+
333
+ npx esbuild src/lambda-handler.ts \
334
+ --bundle \
335
+ --platform=node \
336
+ --target=node20 \
337
+ --format=cjs \
338
+ --outfile=dist/lambda-bundle.js \
339
+ --external:playwright-core \
340
+ --external:@sparticuz/chromium \
341
+ --external:@modelcontextprotocol/sdk \
342
+ --sourcemap
343
+
344
+ echo "Zipping..."
345
+ cd dist && zip -r ../lambda.zip lambda-bundle.js lambda-bundle.js.map && cd ..
346
+
347
+ echo "Getting function name..."
348
+ FUNCTION_NAME=$(aws cloudformation describe-stacks \
349
+ --stack-name VisusStack-dev \
350
+ --query "Stacks[0].Outputs[?OutputKey=='LambdaFunctionName'].OutputValue" \
351
+ --output text)
352
+
353
+ echo "Deploying to Lambda: $FUNCTION_NAME"
354
+ aws lambda update-function-code \
355
+ --function-name "$FUNCTION_NAME" \
356
+ --zip-file fileb://lambda.zip
357
+
358
+ echo "Waiting for update..."
359
+ aws lambda wait function-updated --function-name "$FUNCTION_NAME"
360
+
361
+ echo "Testing health endpoint..."
362
+ curl -s https://3lsush2fx0.execute-api.us-east-1.amazonaws.com/dev/health | jq .
363
+
364
+ echo "Done. Check CloudWatch for ERR_MODULE_NOT_FOUND — should be gone."
172
365
  ```
173
366
 
367
+ After using manual deploy, run a full `cdk deploy` when Docker is restored to keep CloudFormation state in sync with live infrastructure.
368
+
174
369
  ---
175
370
 
176
371
  ## CRITICAL: Security Rules — Never Violate These
@@ -240,6 +435,8 @@ lateos-visus/
240
435
  │ ├── browser/
241
436
  │ │ └── playwright-renderer.ts # Headless Chromium page fetcher
242
437
  │ └── types.ts # Shared TypeScript interfaces
438
+ ├── scripts/
439
+ │ └── deploy-lambda.sh # Manual Lambda deploy (bypasses CDK/Docker)
243
440
  └── tests/
244
441
  ├── sanitizer.test.ts
245
442
  ├── fetch-tool.test.ts