@aborruso/ckan-mcp-server 0.4.17 → 0.4.18

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 (87) hide show
  1. package/LOG.md +59 -0
  2. package/README.md +104 -34
  3. package/dist/index.js +161 -45
  4. package/dist/worker.js +42 -42
  5. package/package.json +12 -1
  6. package/.devin/wiki.json +0 -273
  7. package/CLAUDE.md +0 -398
  8. package/PRD.md +0 -999
  9. package/REFACTORING.md +0 -238
  10. package/examples/langgraph/01_basic_workflow.py +0 -277
  11. package/examples/langgraph/02_data_exploration.py +0 -366
  12. package/examples/langgraph/README.md +0 -719
  13. package/examples/langgraph/metadata_quality.py +0 -299
  14. package/examples/langgraph/requirements.txt +0 -12
  15. package/examples/langgraph/setup.sh +0 -32
  16. package/examples/langgraph/test_setup.py +0 -106
  17. package/openspec/AGENTS.md +0 -456
  18. package/openspec/changes/add-ckan-analyze-dataset-structure/proposal.md +0 -17
  19. package/openspec/changes/add-ckan-analyze-dataset-structure/specs/ckan-insights/spec.md +0 -7
  20. package/openspec/changes/add-ckan-analyze-dataset-structure/tasks.md +0 -6
  21. package/openspec/changes/add-ckan-analyze-dataset-updates/proposal.md +0 -17
  22. package/openspec/changes/add-ckan-analyze-dataset-updates/specs/ckan-insights/spec.md +0 -7
  23. package/openspec/changes/add-ckan-analyze-dataset-updates/tasks.md +0 -6
  24. package/openspec/changes/add-ckan-audit-tool/proposal.md +0 -17
  25. package/openspec/changes/add-ckan-audit-tool/specs/ckan-insights/spec.md +0 -7
  26. package/openspec/changes/add-ckan-audit-tool/tasks.md +0 -6
  27. package/openspec/changes/add-ckan-dataset-insights/proposal.md +0 -17
  28. package/openspec/changes/add-ckan-dataset-insights/specs/ckan-insights/spec.md +0 -7
  29. package/openspec/changes/add-ckan-dataset-insights/tasks.md +0 -6
  30. package/openspec/changes/add-ckan-host-allowlist-env/design.md +0 -38
  31. package/openspec/changes/add-ckan-host-allowlist-env/proposal.md +0 -16
  32. package/openspec/changes/add-ckan-host-allowlist-env/specs/ckan-request-allowlist/spec.md +0 -15
  33. package/openspec/changes/add-ckan-host-allowlist-env/specs/cloudflare-deployment/spec.md +0 -11
  34. package/openspec/changes/add-ckan-host-allowlist-env/tasks.md +0 -12
  35. package/openspec/changes/add-escape-text-query/proposal.md +0 -12
  36. package/openspec/changes/add-escape-text-query/specs/ckan-search/spec.md +0 -11
  37. package/openspec/changes/add-escape-text-query/tasks.md +0 -8
  38. package/openspec/changes/add-mqa-quality-tool/proposal.md +0 -21
  39. package/openspec/changes/add-mqa-quality-tool/specs/ckan-quality/spec.md +0 -71
  40. package/openspec/changes/add-mqa-quality-tool/tasks.md +0 -29
  41. package/openspec/changes/archive/2026-01-08-add-mcp-resources/design.md +0 -115
  42. package/openspec/changes/archive/2026-01-08-add-mcp-resources/proposal.md +0 -52
  43. package/openspec/changes/archive/2026-01-08-add-mcp-resources/specs/mcp-resources/spec.md +0 -92
  44. package/openspec/changes/archive/2026-01-08-add-mcp-resources/tasks.md +0 -56
  45. package/openspec/changes/archive/2026-01-08-expand-test-coverage-specs/design.md +0 -355
  46. package/openspec/changes/archive/2026-01-08-expand-test-coverage-specs/proposal.md +0 -161
  47. package/openspec/changes/archive/2026-01-08-expand-test-coverage-specs/tasks.md +0 -162
  48. package/openspec/changes/archive/2026-01-08-translate-project-to-english/proposal.md +0 -115
  49. package/openspec/changes/archive/2026-01-08-translate-project-to-english/specs/documentation-language/spec.md +0 -32
  50. package/openspec/changes/archive/2026-01-08-translate-project-to-english/tasks.md +0 -115
  51. package/openspec/changes/archive/2026-01-10-add-ckan-find-relevant-datasets/proposal.md +0 -17
  52. package/openspec/changes/archive/2026-01-10-add-ckan-find-relevant-datasets/specs/ckan-insights/spec.md +0 -7
  53. package/openspec/changes/archive/2026-01-10-add-ckan-find-relevant-datasets/tasks.md +0 -6
  54. package/openspec/changes/archive/2026-01-10-add-cloudflare-workers/design.md +0 -734
  55. package/openspec/changes/archive/2026-01-10-add-cloudflare-workers/proposal.md +0 -183
  56. package/openspec/changes/archive/2026-01-10-add-cloudflare-workers/specs/cloudflare-deployment/spec.md +0 -389
  57. package/openspec/changes/archive/2026-01-10-add-cloudflare-workers/tasks.md +0 -519
  58. package/openspec/changes/archive/2026-01-15-add-mcp-prompts/proposal.md +0 -13
  59. package/openspec/changes/archive/2026-01-15-add-mcp-prompts/specs/mcp-prompts/spec.md +0 -22
  60. package/openspec/changes/archive/2026-01-15-add-mcp-prompts/tasks.md +0 -10
  61. package/openspec/changes/archive/2026-01-15-add-mcp-resource-filters/proposal.md +0 -13
  62. package/openspec/changes/archive/2026-01-15-add-mcp-resource-filters/specs/mcp-resources/spec.md +0 -38
  63. package/openspec/changes/archive/2026-01-15-add-mcp-resource-filters/tasks.md +0 -10
  64. package/openspec/changes/archive/2026-01-19-update-repo-owner-ondata/proposal.md +0 -13
  65. package/openspec/changes/archive/2026-01-19-update-repo-owner-ondata/specs/repository-metadata/spec.md +0 -14
  66. package/openspec/changes/archive/2026-01-19-update-repo-owner-ondata/tasks.md +0 -12
  67. package/openspec/changes/archive/2026-01-19-update-search-parser-config/proposal.md +0 -13
  68. package/openspec/changes/archive/2026-01-19-update-search-parser-config/specs/ckan-insights/spec.md +0 -11
  69. package/openspec/changes/archive/2026-01-19-update-search-parser-config/specs/ckan-search/spec.md +0 -11
  70. package/openspec/changes/archive/2026-01-19-update-search-parser-config/tasks.md +0 -6
  71. package/openspec/changes/archive/add-automated-tests/design.md +0 -324
  72. package/openspec/changes/archive/add-automated-tests/proposal.md +0 -167
  73. package/openspec/changes/archive/add-automated-tests/specs/automated-testing/spec.md +0 -143
  74. package/openspec/changes/archive/add-automated-tests/tasks.md +0 -132
  75. package/openspec/project.md +0 -115
  76. package/openspec/specs/ckan-insights/spec.md +0 -23
  77. package/openspec/specs/ckan-search/spec.md +0 -16
  78. package/openspec/specs/cloudflare-deployment/spec.md +0 -344
  79. package/openspec/specs/documentation-language/spec.md +0 -32
  80. package/openspec/specs/mcp-prompts/spec.md +0 -26
  81. package/openspec/specs/mcp-resources/spec.md +0 -120
  82. package/openspec/specs/repository-metadata/spec.md +0 -19
  83. package/private/commenti-privati.yaml +0 -14
  84. package/testo.md +0 -12
  85. package/web-gui/PRD.md +0 -158
  86. package/web-gui/public/index.html +0 -883
  87. package/wrangler.toml +0 -6
@@ -1,456 +0,0 @@
1
- # OpenSpec Instructions
2
-
3
- Instructions for AI coding assistants using OpenSpec for spec-driven development.
4
-
5
- ## TL;DR Quick Checklist
6
-
7
- - Search existing work: `openspec spec list --long`, `openspec list` (use `rg` only for full-text search)
8
- - Decide scope: new capability vs modify existing capability
9
- - Pick a unique `change-id`: kebab-case, verb-led (`add-`, `update-`, `remove-`, `refactor-`)
10
- - Scaffold: `proposal.md`, `tasks.md`, `design.md` (only if needed), and delta specs per affected capability
11
- - Write deltas: use `## ADDED|MODIFIED|REMOVED|RENAMED Requirements`; include at least one `#### Scenario:` per requirement
12
- - Validate: `openspec validate [change-id] --strict` and fix issues
13
- - Request approval: Do not start implementation until proposal is approved
14
-
15
- ## Three-Stage Workflow
16
-
17
- ### Stage 1: Creating Changes
18
- Create proposal when you need to:
19
- - Add features or functionality
20
- - Make breaking changes (API, schema)
21
- - Change architecture or patterns
22
- - Optimize performance (changes behavior)
23
- - Update security patterns
24
-
25
- Triggers (examples):
26
- - "Help me create a change proposal"
27
- - "Help me plan a change"
28
- - "Help me create a proposal"
29
- - "I want to create a spec proposal"
30
- - "I want to create a spec"
31
-
32
- Loose matching guidance:
33
- - Contains one of: `proposal`, `change`, `spec`
34
- - With one of: `create`, `plan`, `make`, `start`, `help`
35
-
36
- Skip proposal for:
37
- - Bug fixes (restore intended behavior)
38
- - Typos, formatting, comments
39
- - Dependency updates (non-breaking)
40
- - Configuration changes
41
- - Tests for existing behavior
42
-
43
- **Workflow**
44
- 1. Review `openspec/project.md`, `openspec list`, and `openspec list --specs` to understand current context.
45
- 2. Choose a unique verb-led `change-id` and scaffold `proposal.md`, `tasks.md`, optional `design.md`, and spec deltas under `openspec/changes/<id>/`.
46
- 3. Draft spec deltas using `## ADDED|MODIFIED|REMOVED Requirements` with at least one `#### Scenario:` per requirement.
47
- 4. Run `openspec validate <id> --strict` and resolve any issues before sharing the proposal.
48
-
49
- ### Stage 2: Implementing Changes
50
- Track these steps as TODOs and complete them one by one.
51
- 1. **Read proposal.md** - Understand what's being built
52
- 2. **Read design.md** (if exists) - Review technical decisions
53
- 3. **Read tasks.md** - Get implementation checklist
54
- 4. **Implement tasks sequentially** - Complete in order
55
- 5. **Confirm completion** - Ensure every item in `tasks.md` is finished before updating statuses
56
- 6. **Update checklist** - After all work is done, set every task to `- [x]` so the list reflects reality
57
- 7. **Approval gate** - Do not start implementation until the proposal is reviewed and approved
58
-
59
- ### Stage 3: Archiving Changes
60
- After deployment, create separate PR to:
61
- - Move `changes/[name]/` → `changes/archive/YYYY-MM-DD-[name]/`
62
- - Update `specs/` if capabilities changed
63
- - Use `openspec archive <change-id> --skip-specs --yes` for tooling-only changes (always pass the change ID explicitly)
64
- - Run `openspec validate --strict` to confirm the archived change passes checks
65
-
66
- ## Before Any Task
67
-
68
- **Context Checklist:**
69
- - [ ] Read relevant specs in `specs/[capability]/spec.md`
70
- - [ ] Check pending changes in `changes/` for conflicts
71
- - [ ] Read `openspec/project.md` for conventions
72
- - [ ] Run `openspec list` to see active changes
73
- - [ ] Run `openspec list --specs` to see existing capabilities
74
-
75
- **Before Creating Specs:**
76
- - Always check if capability already exists
77
- - Prefer modifying existing specs over creating duplicates
78
- - Use `openspec show [spec]` to review current state
79
- - If request is ambiguous, ask 1–2 clarifying questions before scaffolding
80
-
81
- ### Search Guidance
82
- - Enumerate specs: `openspec spec list --long` (or `--json` for scripts)
83
- - Enumerate changes: `openspec list` (or `openspec change list --json` - deprecated but available)
84
- - Show details:
85
- - Spec: `openspec show <spec-id> --type spec` (use `--json` for filters)
86
- - Change: `openspec show <change-id> --json --deltas-only`
87
- - Full-text search (use ripgrep): `rg -n "Requirement:|Scenario:" openspec/specs`
88
-
89
- ## Quick Start
90
-
91
- ### CLI Commands
92
-
93
- ```bash
94
- # Essential commands
95
- openspec list # List active changes
96
- openspec list --specs # List specifications
97
- openspec show [item] # Display change or spec
98
- openspec validate [item] # Validate changes or specs
99
- openspec archive <change-id> [--yes|-y] # Archive after deployment (add --yes for non-interactive runs)
100
-
101
- # Project management
102
- openspec init [path] # Initialize OpenSpec
103
- openspec update [path] # Update instruction files
104
-
105
- # Interactive mode
106
- openspec show # Prompts for selection
107
- openspec validate # Bulk validation mode
108
-
109
- # Debugging
110
- openspec show [change] --json --deltas-only
111
- openspec validate [change] --strict
112
- ```
113
-
114
- ### Command Flags
115
-
116
- - `--json` - Machine-readable output
117
- - `--type change|spec` - Disambiguate items
118
- - `--strict` - Comprehensive validation
119
- - `--no-interactive` - Disable prompts
120
- - `--skip-specs` - Archive without spec updates
121
- - `--yes`/`-y` - Skip confirmation prompts (non-interactive archive)
122
-
123
- ## Directory Structure
124
-
125
- ```
126
- openspec/
127
- ├── project.md # Project conventions
128
- ├── specs/ # Current truth - what IS built
129
- │ └── [capability]/ # Single focused capability
130
- │ ├── spec.md # Requirements and scenarios
131
- │ └── design.md # Technical patterns
132
- ├── changes/ # Proposals - what SHOULD change
133
- │ ├── [change-name]/
134
- │ │ ├── proposal.md # Why, what, impact
135
- │ │ ├── tasks.md # Implementation checklist
136
- │ │ ├── design.md # Technical decisions (optional; see criteria)
137
- │ │ └── specs/ # Delta changes
138
- │ │ └── [capability]/
139
- │ │ └── spec.md # ADDED/MODIFIED/REMOVED
140
- │ └── archive/ # Completed changes
141
- ```
142
-
143
- ## Creating Change Proposals
144
-
145
- ### Decision Tree
146
-
147
- ```
148
- New request?
149
- ├─ Bug fix restoring spec behavior? → Fix directly
150
- ├─ Typo/format/comment? → Fix directly
151
- ├─ New feature/capability? → Create proposal
152
- ├─ Breaking change? → Create proposal
153
- ├─ Architecture change? → Create proposal
154
- └─ Unclear? → Create proposal (safer)
155
- ```
156
-
157
- ### Proposal Structure
158
-
159
- 1. **Create directory:** `changes/[change-id]/` (kebab-case, verb-led, unique)
160
-
161
- 2. **Write proposal.md:**
162
- ```markdown
163
- # Change: [Brief description of change]
164
-
165
- ## Why
166
- [1-2 sentences on problem/opportunity]
167
-
168
- ## What Changes
169
- - [Bullet list of changes]
170
- - [Mark breaking changes with **BREAKING**]
171
-
172
- ## Impact
173
- - Affected specs: [list capabilities]
174
- - Affected code: [key files/systems]
175
- ```
176
-
177
- 3. **Create spec deltas:** `specs/[capability]/spec.md`
178
- ```markdown
179
- ## ADDED Requirements
180
- ### Requirement: New Feature
181
- The system SHALL provide...
182
-
183
- #### Scenario: Success case
184
- - **WHEN** user performs action
185
- - **THEN** expected result
186
-
187
- ## MODIFIED Requirements
188
- ### Requirement: Existing Feature
189
- [Complete modified requirement]
190
-
191
- ## REMOVED Requirements
192
- ### Requirement: Old Feature
193
- **Reason**: [Why removing]
194
- **Migration**: [How to handle]
195
- ```
196
- If multiple capabilities are affected, create multiple delta files under `changes/[change-id]/specs/<capability>/spec.md`—one per capability.
197
-
198
- 4. **Create tasks.md:**
199
- ```markdown
200
- ## 1. Implementation
201
- - [ ] 1.1 Create database schema
202
- - [ ] 1.2 Implement API endpoint
203
- - [ ] 1.3 Add frontend component
204
- - [ ] 1.4 Write tests
205
- ```
206
-
207
- 5. **Create design.md when needed:**
208
- Create `design.md` if any of the following apply; otherwise omit it:
209
- - Cross-cutting change (multiple services/modules) or a new architectural pattern
210
- - New external dependency or significant data model changes
211
- - Security, performance, or migration complexity
212
- - Ambiguity that benefits from technical decisions before coding
213
-
214
- Minimal `design.md` skeleton:
215
- ```markdown
216
- ## Context
217
- [Background, constraints, stakeholders]
218
-
219
- ## Goals / Non-Goals
220
- - Goals: [...]
221
- - Non-Goals: [...]
222
-
223
- ## Decisions
224
- - Decision: [What and why]
225
- - Alternatives considered: [Options + rationale]
226
-
227
- ## Risks / Trade-offs
228
- - [Risk] → Mitigation
229
-
230
- ## Migration Plan
231
- [Steps, rollback]
232
-
233
- ## Open Questions
234
- - [...]
235
- ```
236
-
237
- ## Spec File Format
238
-
239
- ### Critical: Scenario Formatting
240
-
241
- **CORRECT** (use #### headers):
242
- ```markdown
243
- #### Scenario: User login success
244
- - **WHEN** valid credentials provided
245
- - **THEN** return JWT token
246
- ```
247
-
248
- **WRONG** (don't use bullets or bold):
249
- ```markdown
250
- - **Scenario: User login** ❌
251
- **Scenario**: User login ❌
252
- ### Scenario: User login ❌
253
- ```
254
-
255
- Every requirement MUST have at least one scenario.
256
-
257
- ### Requirement Wording
258
- - Use SHALL/MUST for normative requirements (avoid should/may unless intentionally non-normative)
259
-
260
- ### Delta Operations
261
-
262
- - `## ADDED Requirements` - New capabilities
263
- - `## MODIFIED Requirements` - Changed behavior
264
- - `## REMOVED Requirements` - Deprecated features
265
- - `## RENAMED Requirements` - Name changes
266
-
267
- Headers matched with `trim(header)` - whitespace ignored.
268
-
269
- #### When to use ADDED vs MODIFIED
270
- - ADDED: Introduces a new capability or sub-capability that can stand alone as a requirement. Prefer ADDED when the change is orthogonal (e.g., adding "Slash Command Configuration") rather than altering the semantics of an existing requirement.
271
- - MODIFIED: Changes the behavior, scope, or acceptance criteria of an existing requirement. Always paste the full, updated requirement content (header + all scenarios). The archiver will replace the entire requirement with what you provide here; partial deltas will drop previous details.
272
- - RENAMED: Use when only the name changes. If you also change behavior, use RENAMED (name) plus MODIFIED (content) referencing the new name.
273
-
274
- Common pitfall: Using MODIFIED to add a new concern without including the previous text. This causes loss of detail at archive time. If you aren’t explicitly changing the existing requirement, add a new requirement under ADDED instead.
275
-
276
- Authoring a MODIFIED requirement correctly:
277
- 1) Locate the existing requirement in `openspec/specs/<capability>/spec.md`.
278
- 2) Copy the entire requirement block (from `### Requirement: ...` through its scenarios).
279
- 3) Paste it under `## MODIFIED Requirements` and edit to reflect the new behavior.
280
- 4) Ensure the header text matches exactly (whitespace-insensitive) and keep at least one `#### Scenario:`.
281
-
282
- Example for RENAMED:
283
- ```markdown
284
- ## RENAMED Requirements
285
- - FROM: `### Requirement: Login`
286
- - TO: `### Requirement: User Authentication`
287
- ```
288
-
289
- ## Troubleshooting
290
-
291
- ### Common Errors
292
-
293
- **"Change must have at least one delta"**
294
- - Check `changes/[name]/specs/` exists with .md files
295
- - Verify files have operation prefixes (## ADDED Requirements)
296
-
297
- **"Requirement must have at least one scenario"**
298
- - Check scenarios use `#### Scenario:` format (4 hashtags)
299
- - Don't use bullet points or bold for scenario headers
300
-
301
- **Silent scenario parsing failures**
302
- - Exact format required: `#### Scenario: Name`
303
- - Debug with: `openspec show [change] --json --deltas-only`
304
-
305
- ### Validation Tips
306
-
307
- ```bash
308
- # Always use strict mode for comprehensive checks
309
- openspec validate [change] --strict
310
-
311
- # Debug delta parsing
312
- openspec show [change] --json | jq '.deltas'
313
-
314
- # Check specific requirement
315
- openspec show [spec] --json -r 1
316
- ```
317
-
318
- ## Happy Path Script
319
-
320
- ```bash
321
- # 1) Explore current state
322
- openspec spec list --long
323
- openspec list
324
- # Optional full-text search:
325
- # rg -n "Requirement:|Scenario:" openspec/specs
326
- # rg -n "^#|Requirement:" openspec/changes
327
-
328
- # 2) Choose change id and scaffold
329
- CHANGE=add-two-factor-auth
330
- mkdir -p openspec/changes/$CHANGE/{specs/auth}
331
- printf "## Why\n...\n\n## What Changes\n- ...\n\n## Impact\n- ...\n" > openspec/changes/$CHANGE/proposal.md
332
- printf "## 1. Implementation\n- [ ] 1.1 ...\n" > openspec/changes/$CHANGE/tasks.md
333
-
334
- # 3) Add deltas (example)
335
- cat > openspec/changes/$CHANGE/specs/auth/spec.md << 'EOF'
336
- ## ADDED Requirements
337
- ### Requirement: Two-Factor Authentication
338
- Users MUST provide a second factor during login.
339
-
340
- #### Scenario: OTP required
341
- - **WHEN** valid credentials are provided
342
- - **THEN** an OTP challenge is required
343
- EOF
344
-
345
- # 4) Validate
346
- openspec validate $CHANGE --strict
347
- ```
348
-
349
- ## Multi-Capability Example
350
-
351
- ```
352
- openspec/changes/add-2fa-notify/
353
- ├── proposal.md
354
- ├── tasks.md
355
- └── specs/
356
- ├── auth/
357
- │ └── spec.md # ADDED: Two-Factor Authentication
358
- └── notifications/
359
- └── spec.md # ADDED: OTP email notification
360
- ```
361
-
362
- auth/spec.md
363
- ```markdown
364
- ## ADDED Requirements
365
- ### Requirement: Two-Factor Authentication
366
- ...
367
- ```
368
-
369
- notifications/spec.md
370
- ```markdown
371
- ## ADDED Requirements
372
- ### Requirement: OTP Email Notification
373
- ...
374
- ```
375
-
376
- ## Best Practices
377
-
378
- ### Simplicity First
379
- - Default to <100 lines of new code
380
- - Single-file implementations until proven insufficient
381
- - Avoid frameworks without clear justification
382
- - Choose boring, proven patterns
383
-
384
- ### Complexity Triggers
385
- Only add complexity with:
386
- - Performance data showing current solution too slow
387
- - Concrete scale requirements (>1000 users, >100MB data)
388
- - Multiple proven use cases requiring abstraction
389
-
390
- ### Clear References
391
- - Use `file.ts:42` format for code locations
392
- - Reference specs as `specs/auth/spec.md`
393
- - Link related changes and PRs
394
-
395
- ### Capability Naming
396
- - Use verb-noun: `user-auth`, `payment-capture`
397
- - Single purpose per capability
398
- - 10-minute understandability rule
399
- - Split if description needs "AND"
400
-
401
- ### Change ID Naming
402
- - Use kebab-case, short and descriptive: `add-two-factor-auth`
403
- - Prefer verb-led prefixes: `add-`, `update-`, `remove-`, `refactor-`
404
- - Ensure uniqueness; if taken, append `-2`, `-3`, etc.
405
-
406
- ## Tool Selection Guide
407
-
408
- | Task | Tool | Why |
409
- |------|------|-----|
410
- | Find files by pattern | Glob | Fast pattern matching |
411
- | Search code content | Grep | Optimized regex search |
412
- | Read specific files | Read | Direct file access |
413
- | Explore unknown scope | Task | Multi-step investigation |
414
-
415
- ## Error Recovery
416
-
417
- ### Change Conflicts
418
- 1. Run `openspec list` to see active changes
419
- 2. Check for overlapping specs
420
- 3. Coordinate with change owners
421
- 4. Consider combining proposals
422
-
423
- ### Validation Failures
424
- 1. Run with `--strict` flag
425
- 2. Check JSON output for details
426
- 3. Verify spec file format
427
- 4. Ensure scenarios properly formatted
428
-
429
- ### Missing Context
430
- 1. Read project.md first
431
- 2. Check related specs
432
- 3. Review recent archives
433
- 4. Ask for clarification
434
-
435
- ## Quick Reference
436
-
437
- ### Stage Indicators
438
- - `changes/` - Proposed, not yet built
439
- - `specs/` - Built and deployed
440
- - `archive/` - Completed changes
441
-
442
- ### File Purposes
443
- - `proposal.md` - Why and what
444
- - `tasks.md` - Implementation steps
445
- - `design.md` - Technical decisions
446
- - `spec.md` - Requirements and behavior
447
-
448
- ### CLI Essentials
449
- ```bash
450
- openspec list # What's in progress?
451
- openspec show [item] # View details
452
- openspec validate --strict # Is it correct?
453
- openspec archive <change-id> [--yes|-y] # Mark complete (add --yes for automation)
454
- ```
455
-
456
- Remember: Specs are truth. Changes are proposals. Keep them in sync.
@@ -1,17 +0,0 @@
1
- # Change: Add ckan_analyze_dataset_structure tool
2
-
3
- ## Why
4
- Users need quick schema and quality signals without manual inspection.
5
-
6
- ## What Changes
7
- - Add MCP tool `ckan_analyze_dataset_structure` for schema summaries.
8
- - Use resource schema or DataStore fields for columns and types.
9
- - Compute null-rate stats when DataStore is available.
10
-
11
- ## Impact
12
- - Affected specs: `ckan-insights`
13
- - Affected code: `src/tools/datastore.ts` and resource utilities
14
-
15
- ## Open Questions
16
- - Default `sample_size` for null-rate analysis?
17
- - How to select resource when only dataset id is provided?
@@ -1,7 +0,0 @@
1
- ## ADDED Requirements
2
- ### Requirement: Analyze dataset structure
3
- The system SHALL provide a `ckan_analyze_dataset_structure` tool that accepts `server_url`, a `resource_id` or `dataset_id`, and optional `sample_size`, returning column names and types; when a DataStore is available it MUST compute per-column null rates from a sampled query.
4
-
5
- #### Scenario: Schema summary with null rates
6
- - **WHEN** the tool is invoked for a DataStore-enabled resource
7
- - **THEN** the system returns columns, types, and null-rate statistics
@@ -1,6 +0,0 @@
1
- ## 1. Implementation
2
- - [ ] 1.1 Add tool schema and registration
3
- - [ ] 1.2 Resolve resource selection (resource_id or dataset)
4
- - [ ] 1.3 Compute schema summary + null rates
5
- - [ ] 1.4 Add fixtures + tests
6
- - [ ] 1.5 Update README/EXAMPLES
@@ -1,17 +0,0 @@
1
- # Change: Add ckan_analyze_dataset_updates tool
2
-
3
- ## Why
4
- Users need quick insight on dataset freshness and update cadence.
5
-
6
- ## What Changes
7
- - Add MCP tool `ckan_analyze_dataset_updates` for dataset freshness analysis.
8
- - Combine `metadata_modified` and resource `last_modified` to estimate cadence.
9
- - Flag stale datasets based on a configurable threshold.
10
-
11
- ## Impact
12
- - Affected specs: `ckan-insights`
13
- - Affected code: `src/tools/package.ts` and `src/tools/datastore.ts`
14
-
15
- ## Open Questions
16
- - Default `stale_days` threshold?
17
- - How to handle resources without `last_modified`?
@@ -1,7 +0,0 @@
1
- ## ADDED Requirements
2
- ### Requirement: Analyze dataset updates
3
- The system SHALL provide a `ckan_analyze_dataset_updates` tool that accepts `server_url`, `dataset_id`, and optional `stale_days`, and returns update cadence based on `metadata_modified` and resource `last_modified`, including a `stale` flag when the most recent update exceeds the threshold.
4
-
5
- #### Scenario: Update cadence and stale flag
6
- - **WHEN** the tool is invoked with a dataset id and stale threshold
7
- - **THEN** the system returns last update timestamps, cadence summary, and a stale flag
@@ -1,6 +0,0 @@
1
- ## 1. Implementation
2
- - [ ] 1.1 Add tool schema and registration
3
- - [ ] 1.2 Compute update cadence from metadata/resource dates
4
- - [ ] 1.3 Add stale detection output
5
- - [ ] 1.4 Add fixtures + tests
6
- - [ ] 1.5 Update README/EXAMPLES
@@ -1,17 +0,0 @@
1
- # Change: Add ckan_audit tool
2
-
3
- ## Why
4
- Operators need an automated probe to detect datastore/SQL/alias support and capture portal quirks.
5
-
6
- ## What Changes
7
- - Add MCP tool `ckan_audit` to probe CKAN API capabilities.
8
- - Detect DataStore availability, SQL endpoint, and datastore id alias support.
9
- - Return suggested overrides for portal configuration.
10
-
11
- ## Impact
12
- - Affected specs: `ckan-insights`
13
- - Affected code: `src/tools/status.ts` or new insights module
14
-
15
- ## Open Questions
16
- - Should audit run only read-only GET probes?
17
- - Which overrides format to return (JSON block vs markdown list)?
@@ -1,7 +0,0 @@
1
- ## ADDED Requirements
2
- ### Requirement: Audit CKAN portal capabilities
3
- The system SHALL provide a `ckan_audit` tool that accepts `server_url` and returns detected capabilities for DataStore, SQL endpoint availability, and datastore id alias support, plus suggested portal override values.
4
-
5
- #### Scenario: Capability probe
6
- - **WHEN** the tool probes a CKAN portal
7
- - **THEN** the response includes datastore availability, SQL support, alias support, and recommended overrides
@@ -1,6 +0,0 @@
1
- ## 1. Implementation
2
- - [ ] 1.1 Add tool schema and registration
3
- - [ ] 1.2 Probe datastore_search and datastore_search_sql
4
- - [ ] 1.3 Detect datastore id alias support
5
- - [ ] 1.4 Return override suggestions
6
- - [ ] 1.5 Add fixtures + tests
@@ -1,17 +0,0 @@
1
- # Change: Add ckan_dataset_insights tool
2
-
3
- ## Why
4
- Users want a single call that returns ranked datasets plus freshness and structure insights.
5
-
6
- ## What Changes
7
- - Add MCP tool `ckan_dataset_insights` as a wrapper.
8
- - Combine outputs from `ckan_find_relevant_datasets`, `ckan_analyze_dataset_updates`, and `ckan_analyze_dataset_structure`.
9
- - Provide compact summary per dataset.
10
-
11
- ## Impact
12
- - Affected specs: `ckan-insights`
13
- - Affected code: new insights module orchestrating existing tools
14
-
15
- ## Open Questions
16
- - Default number of datasets to enrich?
17
- - Should structure analysis be optional for non-DataStore resources?
@@ -1,7 +0,0 @@
1
- ## ADDED Requirements
2
- ### Requirement: Dataset insights wrapper
3
- The system SHALL provide a `ckan_dataset_insights` tool that accepts `server_url`, `query`, `limit`, and optional analysis parameters, and returns per-dataset summaries combining relevance scores, update cadence, and structure metrics.
4
-
5
- #### Scenario: Combined insights output
6
- - **WHEN** the tool is invoked with a query and limit
7
- - **THEN** the system returns the top N datasets with combined relevance, update, and structure insights
@@ -1,6 +0,0 @@
1
- ## 1. Implementation
2
- - [ ] 1.1 Add tool schema and registration
3
- - [ ] 1.2 Orchestrate find/update/structure analyses
4
- - [ ] 1.3 Define merged output format
5
- - [ ] 1.4 Add fixtures + tests
6
- - [ ] 1.5 Update README/EXAMPLES
@@ -1,38 +0,0 @@
1
- # Design: CKAN Host Allowlist via Environment
2
-
3
- ## Overview
4
- Introduce an optional, environment-driven allowlist for CKAN hosts. When configured, all CKAN requests must target hosts in the allowlist. When not configured, behavior remains unchanged.
5
-
6
- ## Configuration
7
- - Environment variable: `ALLOWED_CKAN_HOSTS`
8
- - Format: comma-separated hostnames (e.g., `dati.gov.it,data.gov,catalog.data.gov`)
9
- - Parsing rules:
10
- - Split on commas
11
- - Trim whitespace
12
- - Lowercase
13
- - Drop empty entries
14
-
15
- ## Enforcement
16
- - Validate hostnames extracted from:
17
- - Tool inputs: `server_url`
18
- - Resource URIs: `ckan://{server}/...`
19
- - Reject requests where the hostname is not in the allowlist.
20
- - Error message should be explicit: `Host not allowed: <hostname>`.
21
-
22
- ## Runtime Scope
23
- - Node.js (stdio/http) and Workers runtimes share the same validation utility.
24
- - Workers reads env via `env.ALLOWED_CKAN_HOSTS` (wrangler var), Node via `process.env.ALLOWED_CKAN_HOSTS`.
25
-
26
- ## Integration Points
27
- - Add a small utility module, e.g. `src/utils/allowlist.ts`:
28
- - `parseAllowedHosts(value?: string): Set<string> | null`
29
- - `assertAllowedHost(serverUrl: string, allowed: Set<string> | null): void`
30
- - Call `assertAllowedHost` inside CKAN request flow or immediately in each tool/resource handler before network calls.
31
-
32
- ## Backwards Compatibility
33
- - If `ALLOWED_CKAN_HOSTS` is unset or empty, allow all hosts (no behavior change).
34
-
35
- ## Testing
36
- - Unit tests for parsing behavior (case, whitespace, empty entries).
37
- - Unit tests for allow/deny logic with known hostnames and invalid URLs.
38
- - Tool/resource tests to verify rejection when allowlist is set.
@@ -1,16 +0,0 @@
1
- # Change: Add allowlist for CKAN hosts via environment
2
-
3
- ## Why
4
- Public HTTP/Workers deployments can be abused to proxy requests to arbitrary hosts. A host allowlist provides a simple, configurable barrier without breaking local usage.
5
-
6
- ## What Changes
7
- - Add `ALLOWED_CKAN_HOSTS` env var (comma-separated hostnames) to restrict `server_url` targets.
8
- - Validate `server_url` host against the allowlist for all tools/resources that call CKAN.
9
- - Document and expose the env var in `wrangler.toml` for Workers deployments.
10
-
11
- ## Design Reference
12
- See `openspec/changes/add-ckan-host-allowlist-env/design.md` for configuration, enforcement, and runtime details.
13
-
14
- ## Impact
15
- - Affected specs: `cloudflare-deployment`, new `ckan-request-allowlist`
16
- - Affected code: request validation utilities; Workers/Node configuration handling; tools/resources that accept `server_url` or `ckan://` URIs.
@@ -1,15 +0,0 @@
1
- ## ADDED Requirements
2
- ### Requirement: CKAN host allowlist validation
3
- The system SHALL validate every CKAN request target against an optional allowlist configured via `ALLOWED_CKAN_HOSTS`.
4
-
5
- #### Scenario: Allowed host
6
- - **WHEN** a tool or resource is called with a `server_url` whose hostname is in `ALLOWED_CKAN_HOSTS`
7
- - **THEN** the request proceeds as normal
8
-
9
- #### Scenario: Disallowed host
10
- - **WHEN** a tool or resource is called with a `server_url` whose hostname is not in `ALLOWED_CKAN_HOSTS`
11
- - **THEN** the request is rejected with a clear error indicating the host is not allowed
12
-
13
- #### Scenario: Allowlist not set
14
- - **WHEN** `ALLOWED_CKAN_HOSTS` is unset or empty
15
- - **THEN** the system accepts any valid `server_url`
@@ -1,11 +0,0 @@
1
- ## ADDED Requirements
2
- ### Requirement: Workers allowlist configuration
3
- The system SHALL allow configuring an allowlist of CKAN hosts for Workers deployments via environment variable.
4
-
5
- #### Scenario: Wrangler allowlist configuration
6
- - **WHEN** `wrangler.toml` sets `ALLOWED_CKAN_HOSTS` to a comma-separated list of hostnames
7
- - **THEN** the Workers runtime reads the variable and restricts CKAN requests to those hosts
8
-
9
- #### Scenario: Allowlist not set
10
- - **WHEN** `ALLOWED_CKAN_HOSTS` is unset or empty in the Workers environment
11
- - **THEN** the Workers runtime allows requests to any CKAN host