tfmodsearch 0.4.0__tar.gz

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 (91) hide show
  1. tfmodsearch-0.4.0/.agents/plugins/marketplace.json +14 -0
  2. tfmodsearch-0.4.0/.claude-plugin/marketplace.json +17 -0
  3. tfmodsearch-0.4.0/.github/workflows/publish.yml +47 -0
  4. tfmodsearch-0.4.0/.gitignore +107 -0
  5. tfmodsearch-0.4.0/.pre-commit-config.yaml +23 -0
  6. tfmodsearch-0.4.0/CHANGELOG.md +299 -0
  7. tfmodsearch-0.4.0/CONTRIBUTING.md +103 -0
  8. tfmodsearch-0.4.0/LICENSE +21 -0
  9. tfmodsearch-0.4.0/PKG-INFO +826 -0
  10. tfmodsearch-0.4.0/README.md +790 -0
  11. tfmodsearch-0.4.0/config.yaml +30 -0
  12. tfmodsearch-0.4.0/model/tfmod_bge_base_index.pkl +0 -0
  13. tfmodsearch-0.4.0/model/tfmod_gte_small_index.pkl +0 -0
  14. tfmodsearch-0.4.0/modules/module_template.md +423 -0
  15. tfmodsearch-0.4.0/modules/terraform-aws-modules/acm.md +312 -0
  16. tfmodsearch-0.4.0/modules/terraform-aws-modules/alb.md +755 -0
  17. tfmodsearch-0.4.0/modules/terraform-aws-modules/apigateway-v2.md +450 -0
  18. tfmodsearch-0.4.0/modules/terraform-aws-modules/app-runner.md +403 -0
  19. tfmodsearch-0.4.0/modules/terraform-aws-modules/appconfig.md +411 -0
  20. tfmodsearch-0.4.0/modules/terraform-aws-modules/appsync.md +373 -0
  21. tfmodsearch-0.4.0/modules/terraform-aws-modules/atlantis.md +489 -0
  22. tfmodsearch-0.4.0/modules/terraform-aws-modules/autoscaling.md +420 -0
  23. tfmodsearch-0.4.0/modules/terraform-aws-modules/batch.md +456 -0
  24. tfmodsearch-0.4.0/modules/terraform-aws-modules/cloudfront.md +765 -0
  25. tfmodsearch-0.4.0/modules/terraform-aws-modules/cloudwatch.md +1011 -0
  26. tfmodsearch-0.4.0/modules/terraform-aws-modules/customer-gateway.md +273 -0
  27. tfmodsearch-0.4.0/modules/terraform-aws-modules/datadog-forwarders.md +643 -0
  28. tfmodsearch-0.4.0/modules/terraform-aws-modules/dms.md +567 -0
  29. tfmodsearch-0.4.0/modules/terraform-aws-modules/dynamodb-table.md +565 -0
  30. tfmodsearch-0.4.0/modules/terraform-aws-modules/ebs-optimized.md +122 -0
  31. tfmodsearch-0.4.0/modules/terraform-aws-modules/ec2-instance.md +515 -0
  32. tfmodsearch-0.4.0/modules/terraform-aws-modules/ecr.md +442 -0
  33. tfmodsearch-0.4.0/modules/terraform-aws-modules/ecs.md +808 -0
  34. tfmodsearch-0.4.0/modules/terraform-aws-modules/efs.md +433 -0
  35. tfmodsearch-0.4.0/modules/terraform-aws-modules/eks-pod-identity.md +486 -0
  36. tfmodsearch-0.4.0/modules/terraform-aws-modules/eks.md +1048 -0
  37. tfmodsearch-0.4.0/modules/terraform-aws-modules/elasticache.md +661 -0
  38. tfmodsearch-0.4.0/modules/terraform-aws-modules/elb.md +389 -0
  39. tfmodsearch-0.4.0/modules/terraform-aws-modules/emr.md +567 -0
  40. tfmodsearch-0.4.0/modules/terraform-aws-modules/eventbridge.md +479 -0
  41. tfmodsearch-0.4.0/modules/terraform-aws-modules/fsx.md +538 -0
  42. tfmodsearch-0.4.0/modules/terraform-aws-modules/global-accelerator.md +482 -0
  43. tfmodsearch-0.4.0/modules/terraform-aws-modules/iam.md +894 -0
  44. tfmodsearch-0.4.0/modules/terraform-aws-modules/key-pair.md +248 -0
  45. tfmodsearch-0.4.0/modules/terraform-aws-modules/kms.md +379 -0
  46. tfmodsearch-0.4.0/modules/terraform-aws-modules/lambda.md +825 -0
  47. tfmodsearch-0.4.0/modules/terraform-aws-modules/managed-service-grafana.md +370 -0
  48. tfmodsearch-0.4.0/modules/terraform-aws-modules/managed-service-prometheus.md +392 -0
  49. tfmodsearch-0.4.0/modules/terraform-aws-modules/memory-db.md +427 -0
  50. tfmodsearch-0.4.0/modules/terraform-aws-modules/msk-kafka-cluster.md +783 -0
  51. tfmodsearch-0.4.0/modules/terraform-aws-modules/network-firewall.md +525 -0
  52. tfmodsearch-0.4.0/modules/terraform-aws-modules/notify-slack.md +335 -0
  53. tfmodsearch-0.4.0/modules/terraform-aws-modules/opensearch.md +594 -0
  54. tfmodsearch-0.4.0/modules/terraform-aws-modules/rds-aurora.md +584 -0
  55. tfmodsearch-0.4.0/modules/terraform-aws-modules/rds-proxy.md +336 -0
  56. tfmodsearch-0.4.0/modules/terraform-aws-modules/rds.md +460 -0
  57. tfmodsearch-0.4.0/modules/terraform-aws-modules/redshift.md +575 -0
  58. tfmodsearch-0.4.0/modules/terraform-aws-modules/route53.md +581 -0
  59. tfmodsearch-0.4.0/modules/terraform-aws-modules/s3-bucket.md +759 -0
  60. tfmodsearch-0.4.0/modules/terraform-aws-modules/secrets-manager.md +347 -0
  61. tfmodsearch-0.4.0/modules/terraform-aws-modules/security-group.md +512 -0
  62. tfmodsearch-0.4.0/modules/terraform-aws-modules/sns.md +323 -0
  63. tfmodsearch-0.4.0/modules/terraform-aws-modules/sqs.md +381 -0
  64. tfmodsearch-0.4.0/modules/terraform-aws-modules/ssm-parameter.md +285 -0
  65. tfmodsearch-0.4.0/modules/terraform-aws-modules/step-functions.md +415 -0
  66. tfmodsearch-0.4.0/modules/terraform-aws-modules/transit-gateway.md +405 -0
  67. tfmodsearch-0.4.0/modules/terraform-aws-modules/vpc.md +645 -0
  68. tfmodsearch-0.4.0/modules/terraform-aws-modules/vpn-gateway.md +374 -0
  69. tfmodsearch-0.4.0/plugins/tfmod-search/.claude-plugin/plugin.json +20 -0
  70. tfmodsearch-0.4.0/plugins/tfmod-search/.codex-plugin/plugin.json +11 -0
  71. tfmodsearch-0.4.0/plugins/tfmod-search/codex/mcp.json +6 -0
  72. tfmodsearch-0.4.0/plugins/tfmod-search/skills/aws-terraform-modules/SKILL.md +43 -0
  73. tfmodsearch-0.4.0/plugins/tfmod-search/skills/aws-terraform-modules/agents/openai.yaml +6 -0
  74. tfmodsearch-0.4.0/plugins/tfmod-search/skills/tf-module/SKILL.md +22 -0
  75. tfmodsearch-0.4.0/pyproject.toml +152 -0
  76. tfmodsearch-0.4.0/src/tfmod_mcp_server.py +1131 -0
  77. tfmodsearch-0.4.0/src/tfmod_search_cli.py +220 -0
  78. tfmodsearch-0.4.0/src/tfmod_search_lib.py +1083 -0
  79. tfmodsearch-0.4.0/tests/README.md +75 -0
  80. tfmodsearch-0.4.0/tests/conftest.py +22 -0
  81. tfmodsearch-0.4.0/tests/e2e/__init__.py +0 -0
  82. tfmodsearch-0.4.0/tests/e2e/test_mcp_stdio_e2e.py +152 -0
  83. tfmodsearch-0.4.0/tests/e2e/test_package_e2e.py +90 -0
  84. tfmodsearch-0.4.0/tests/e2e/test_plugin_e2e.py +163 -0
  85. tfmodsearch-0.4.0/tests/integration/__init__.py +6 -0
  86. tfmodsearch-0.4.0/tests/integration/test_all_modules_searchable.py +394 -0
  87. tfmodsearch-0.4.0/tests/integration/test_cli_index.py +207 -0
  88. tfmodsearch-0.4.0/tests/integration/test_mcp_server.py +331 -0
  89. tfmodsearch-0.4.0/tests/integration/test_model_comparison.py +395 -0
  90. tfmodsearch-0.4.0/tests/integration/test_parse_markdown.py +364 -0
  91. tfmodsearch-0.4.0/uv.lock +2471 -0
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "tfmodsearch",
3
+ "description": "TFModSearch — current Terraform AWS module documentation search for AI agents",
4
+ "plugins": [
5
+ {
6
+ "name": "tfmod-search",
7
+ "source": {
8
+ "source": "local",
9
+ "path": "./plugins/tfmod-search"
10
+ },
11
+ "description": "Search current terraform-aws-modules documentation before writing Terraform: MCP server (hybrid keyword + BM25 + semantic search) plus workflow skills"
12
+ }
13
+ ]
14
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "tfmodsearch",
3
+ "owner": {
4
+ "name": "Alexander Makeev",
5
+ "url": "https://github.com/SantyagoSeaman"
6
+ },
7
+ "description": "TFModSearch — current Terraform AWS module documentation search for AI agents",
8
+ "plugins": [
9
+ {
10
+ "name": "tfmod-search",
11
+ "source": "./plugins/tfmod-search",
12
+ "description": "Search current terraform-aws-modules documentation before writing Terraform: MCP server (hybrid keyword + BM25 + semantic search) plus workflow skills",
13
+ "displayName": "TFModSearch",
14
+ "keywords": ["terraform", "aws", "mcp", "search", "infrastructure"]
15
+ }
16
+ ]
17
+ }
@@ -0,0 +1,47 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ jobs:
9
+ build:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+
14
+ - name: Install uv
15
+ uses: astral-sh/setup-uv@v5
16
+
17
+ - name: Build distributions
18
+ run: uv build
19
+
20
+ - name: Check that tag matches project version
21
+ run: |
22
+ VERSION=$(uv run --no-project python -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")
23
+ TAG="${GITHUB_REF_NAME#v}"
24
+ if [ "$VERSION" != "$TAG" ]; then
25
+ echo "Tag $GITHUB_REF_NAME does not match pyproject version $VERSION" >&2
26
+ exit 1
27
+ fi
28
+
29
+ - uses: actions/upload-artifact@v4
30
+ with:
31
+ name: dist
32
+ path: dist/
33
+
34
+ publish:
35
+ needs: build
36
+ runs-on: ubuntu-latest
37
+ environment: pypi
38
+ permissions:
39
+ id-token: write
40
+ steps:
41
+ - uses: actions/download-artifact@v4
42
+ with:
43
+ name: dist
44
+ path: dist/
45
+
46
+ - name: Publish to PyPI
47
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,107 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ *.manifest
31
+ *.spec
32
+
33
+ # Installer logs
34
+ pip-log.txt
35
+ pip-delete-this-directory.txt
36
+
37
+ # Unit test / coverage reports
38
+ htmlcov/
39
+ .tox/
40
+ .nox/
41
+ .coverage
42
+ .coverage.*
43
+ .cache
44
+ nosetests.xml
45
+ coverage.xml
46
+ *.cover
47
+ *.py,cover
48
+ .hypothesis/
49
+ .pytest_cache/
50
+ cover/
51
+
52
+ # Virtual environments
53
+ .venv
54
+ venv/
55
+ ENV/
56
+ env/
57
+ .env
58
+
59
+ # IDEs and editors
60
+ .vscode/
61
+ .idea/
62
+ *.swp
63
+ *.swo
64
+ *~
65
+ .DS_Store
66
+
67
+ # Jupyter Notebook
68
+ .ipynb_checkpoints
69
+
70
+ # pyenv
71
+ .python-version
72
+
73
+ # mypy
74
+ .mypy_cache/
75
+ .dmypy.json
76
+ dmypy.json
77
+
78
+ # Pyre type checker
79
+ .pyre/
80
+
81
+ # pytype static type analyzer
82
+ .pytype/
83
+
84
+ # Cython debug symbols
85
+ cython_debug/
86
+
87
+ # NLTK data
88
+ nltk_data/
89
+
90
+ # Log files
91
+ logs/
92
+ *.log
93
+ startup.log
94
+ mcp_server.log
95
+
96
+ # Temporary files
97
+ *.tmp
98
+ .temp/
99
+ temp/
100
+
101
+ # User-specific Claude Code settings
102
+ .claude/
103
+ CLAUDE.md
104
+ /.serena/
105
+
106
+ # Internal maintenance docs (not part of the published package)
107
+ modules/UPDATE_PROMPTS.md
@@ -0,0 +1,23 @@
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v4.5.0
4
+ hooks:
5
+ - id: trailing-whitespace
6
+ - id: end-of-file-fixer
7
+ - id: check-yaml
8
+ - id: check-merge-conflict
9
+ - id: debug-statements
10
+
11
+ - repo: https://github.com/astral-sh/ruff-pre-commit
12
+ rev: v0.4.4
13
+ hooks:
14
+ - id: ruff
15
+ args: [--fix]
16
+ - id: ruff-format
17
+
18
+ - repo: https://github.com/pre-commit/mirrors-mypy
19
+ rev: v1.10.0
20
+ hooks:
21
+ - id: mypy
22
+ additional_dependencies: [types-PyYAML]
23
+ args: [--ignore-missing-imports]
@@ -0,0 +1,299 @@
1
+ # Changelog
2
+
3
+ ## [0.4.0] - 2026-07-11
4
+
5
+ [0.4.0]: https://github.com/SantyagoSeaman/tfmodsearch/releases/tag/v0.4.0
6
+
7
+ The distribution release: the project is renamed to **tfmodsearch**, published to PyPI, and ships plugins for Claude Code and Codex CLI that bundle the MCP server with agent workflow skills.
8
+
9
+ ### Changed
10
+
11
+ - **Project renamed to `tfmodsearch`** (repository, PyPI package, and primary command). The GitHub repository moved to `SantyagoSeaman/tfmodsearch`; old `aws-tf-modules-mcp-server` URLs redirect automatically.
12
+ - **New console commands**: `tfmodsearch` (MCP server) and `tfmodsearch-cli` (indexing/search CLI). The previous `aws-tf-modules-mcp-server` and `tfmod-search-cli` commands are kept as deprecated aliases.
13
+ - **Trimmed the published wheel** from ~11 MB to ~1.6 MB: it now ships only the production index (`model/tfmod_bge_base_index.pkl`) and the curated `modules/terraform-aws-modules/` docs, excluding the legacy gte-small index, work-in-progress docs, and internal templates.
14
+ - **Rewrote the MCP server `instructions`**: corrected the stale catalog size, fixed grammar, and added explicit workflow steering ("search before writing Terraform; use documented variable names, not memorized ones"). The advertised server version now derives from the installed package metadata instead of a hardcoded string.
15
+
16
+ ### Added
17
+
18
+ - **PyPI publication** with Trusted Publishing: a `publish.yml` GitHub Actions workflow builds and publishes to PyPI on version tags via OIDC (no API tokens), with a tag-vs-version consistency check.
19
+ - **Claude Code plugin** (`/plugin marketplace add SantyagoSeaman/tfmodsearch` → `/plugin install tfmod-search@tfmodsearch`): auto-configures the MCP server via `uvx tfmodsearch` and ships two skills.
20
+ - **Codex CLI plugin** with the same two-command install, plus an `agents/openai.yaml` declaring the MCP tool dependency for implicit skill invocation.
21
+ - **Skills** (portable SKILL.md format, shared by both plugins):
22
+ - `aws-terraform-modules` — auto-invoked when writing/reviewing Terraform for AWS: search first, write from current docs, pin module versions, prefer community modules.
23
+ - `tf-module` — user-invoked lookup (`/tf-module s3 bucket with lifecycle rules`) returning a ready-to-paste module block with current variable names.
24
+ - **`--warmup` flag** for the MCP server: pre-downloads the embedding model (~220 MB), loads the index, runs a test query, and exits — keeps first server startup within MCP client timeouts.
25
+
26
+ ### Fixed
27
+
28
+ - **`get_module` no longer guesses**: unknown module names previously fell through to hybrid search and silently returned the highest-scoring module's documentation (a hallucinated name could return the lambda docs). Name lookup is now exact-match first, then unique-substring; unknown or ambiguous names return an error listing the closest matches and directing the caller to `search_modules`.
29
+
30
+ ### Tests
31
+
32
+ - **New end-to-end suite** (`tests/e2e/`, 20 tests): full MCP stdio protocol sessions against a spawned server process (initialize handshake, tool discovery, all three tools, security rejections, `--warmup`), wheel payload/metadata/entry-point verification, a `uvx` packaged-server smoke test from a foreign directory, plugin manifest and skill contract checks for both the Claude Code and Codex layouts, and a live `claude plugin` install into an isolated config. Full suite: 259 tests passing.
33
+
34
+ ### Documentation
35
+
36
+ - README: new plugin-first installation section, Codex CLI integration guide (with `startup_timeout_sec` note), `claude mcp add` one-liner, AGENTS.md/CLAUDE.md steering snippet, and a PyPI badge. All install configs now use the published `tfmodsearch` package instead of `git+https` URLs.
37
+
38
+ ## [0.3.0] - 2026-07-11
39
+
40
+ [0.3.0]: https://github.com/SantyagoSeaman/tfmodsearch/releases/tag/v0.3.0
41
+
42
+ This release refreshes the entire module catalog against the latest upstream `terraform-aws-modules` versions, rebuilds the pre-built search index, and overhauls the README. It also rolls up the previously unreleased 0.2.1 changes.
43
+
44
+ ### Changed
45
+
46
+ - **Full documentation refresh for all 54 modules**: Every document in `modules/terraform-aws-modules/` was regenerated from the current Terraform Registry / GitHub source. Notable version and API updates include:
47
+ - `security-group` → 6.0.0 — major rearchitecture: per-rule `aws_vpc_security_group_ingress_rule`/`egress_rule` resources replace inline rule blocks
48
+ - `eks` → 21.24.0 — post-v21 variable names (`name`, `kubernetes_version`, `addons`, `compute_config`); no default add-ons are bootstrapped
49
+ - `lambda` → 8.8.1, `s3-bucket` → 5.14.1 (new `vectors` submodule), `iam` → 6.6.1, `rds` → 7.2.0, `ec2-instance` → 6.4.0, `alb` → 10.5.0, `apigateway-v2` → 6.1.0, `vpc` → 6.6.1, and others
50
+ - Corrected stale or incorrect variable names, defaults, and examples that could have produced invalid Terraform (e.g. EKS pre-v21 variables, Lambda Function URL configuration, RDS `create_db_subnet_group`/`storage_type` defaults, IAM `iam-role` trust-policy variables)
51
+ - Re-curated keyword lists to the 10–20 most relevant terms per module
52
+ - **Rebuilt the pre-built search index** (`model/tfmod_bge_base_index.pkl`) to reflect the refreshed documentation.
53
+
54
+ ### Added
55
+
56
+ - Canonical service-name keywords to improve retrieval for common full-name queries: `application-load-balancer` (alb), `relational-database` (rds), `simple-notification-service` (sns), `identity`/`access-management` (iam), and `vpn` (vpn-gateway).
57
+
58
+ ### Fixed
59
+
60
+ - **README accuracy**: corrected the pre-built index filename (`tfmod_bge_base_index.pkl`, previously shown as `tfmod_index.pkl` in several places), the catalog module count (added the missing `emr` module — now a consistent 54), the local-install commands (`pip install -e .` / `uv pip install -e .`), stale test counts, and the `get_module` tool terminology.
61
+
62
+ ### Documentation
63
+
64
+ - Added a "Why TFModSearch?" value-proposition section, an end-to-end `search_modules` → `get_module` workflow example, an explicit note that the pre-built index and module docs ship inside the installable package, and clarification of the default search weights.
65
+
66
+ ### Tests
67
+
68
+ - Relaxed `test_module_searchable_by_keyword` to assert the target module appears in the **top-3** results — matching `search_modules`'s documented top-3 return contract and the existing natural-language test — rather than strictly ranking #1. A few semantically adjacent module pairs (e.g. security-group vs network-firewall for "firewall rules") legitimately rank a sibling first while keeping the target in the top-3. Full suite: 239 tests passing.
69
+
70
+ ## [0.2.1] - 2026-01-26
71
+
72
+ [0.2.1]: https://github.com/SantyagoSeaman/tfmodsearch/releases/tag/v0.2.1
73
+
74
+ ### Added
75
+
76
+ - **Configurable Log Level**: New `log_level` option in `config.yaml` (default: INFO)
77
+ - Configurable via config file or CLI `--log_level` argument
78
+ - New `ConfigLoader.load_log_level()` method with standard precedence (CLI > YAML > default)
79
+
80
+ - **Quick Install via uvx**: Added simplified installation method using `uvx`
81
+ - No repository cloning required
82
+ - Single config line: `"command": "uvx", "args": ["git+https://github.com/..."]`
83
+ - Added uv installation instructions
84
+
85
+ ### Fixed
86
+
87
+ - **Silenced Noisy Third-Party Loggers**: FastMCP internal loggers now set to WARNING
88
+ - `fakeredis`, `docket`, `asyncio` no longer spam DEBUG output
89
+ - Server startup is now clean and quiet
90
+
91
+ ### Documentation
92
+
93
+ - Updated README with `uvx` as recommended installation method
94
+ - Added troubleshooting note for full path to `uvx` when not in PATH
95
+ - Updated CLAUDE.md with new `log_level` config option
96
+
97
+ ## [0.2.0] - 2026-01-25
98
+
99
+ [0.2.0]: https://github.com/SantyagoSeaman/tfmodsearch/releases/tag/v0.2.0
100
+
101
+ ### Changed
102
+
103
+ - **Embedding Model Upgrade**: Switched default model from `thenlper/gte-small` to `BAAI/bge-base-en-v1.5`
104
+ - Better retrieval performance with 768-dimensional embeddings (vs 384)
105
+ - Improved similarity distribution (addresses narrow clustering issue)
106
+ - BGE v1.5 specifically optimized for retrieval tasks with hard negatives training
107
+ - Model size: ~220MB (vs ~67MB for gte-small)
108
+
109
+ - **Optional Query Instruction Support**: Added configurable query instruction prefix for BGE models
110
+ - New `query_instruction` parameter in `compute_scores()` function
111
+ - Configurable via `config.yaml` or CLI `--query-instruction` argument
112
+ - Uses modern sentence-transformers `prompt` parameter in `model.encode()`
113
+ - Disabled by default (BGE v1.5 works well without instruction)
114
+ - Instruction: `"Represent this sentence for searching relevant passages: "`
115
+
116
+ - **Default Index Path**: Changed from `tfmod_gte_small_index.pkl` to `tfmod_bge_base_index.pkl`
117
+ - All references updated across codebase, CLI, and tests
118
+ - Pre-built index now included at `model/tfmod_bge_base_index.pkl`
119
+
120
+ - **Module List Description**: `modules_list` tool now uses `extract_purpose()` for cleaner descriptions
121
+ - Extracts Purpose field from Module Information section
122
+ - More concise and relevant module descriptions in catalog listing
123
+
124
+ - **Dependency Updates**:
125
+ - Updated `numpy` from `>=2.3.3` to `>=2.4.1`
126
+ - Updated `sentence-transformers` from `>=5.1.1` to `>=5.2.0`
127
+
128
+ ### Added
129
+
130
+ - **Integration Guides**: Comprehensive setup instructions in README
131
+ - Claude Code CLI integration with `claude mcp add` command
132
+ - Claude Desktop configuration for macOS
133
+ - GitHub Copilot integration for VS Code (requires VS Code 1.99+)
134
+ - Step-by-step setup and troubleshooting commands
135
+
136
+ - **New Search Library Functions**:
137
+ - `extract_purpose(text, max_length)`: Extract Purpose field from Module Information section
138
+ - `DEFAULT_MODEL_NAME` constant: Default embedding model identifier
139
+ - `BGE_QUERY_INSTRUCTION` constant: Optional query prefix for BGE models
140
+
141
+ - **Configuration Loader**: New `ConfigLoader.load_query_instruction()` method
142
+ - Supports precedence: CLI > YAML > default (None)
143
+ - Proper logging for configuration source
144
+
145
+ - **Build Configuration**: Added hatch wheel build settings in `pyproject.toml`
146
+ - Configured `tool.hatch.build.targets.wheel` for proper package distribution
147
+ - Source mapping from `src/` directory
148
+
149
+ - **Model Comparison Tests**: New test file `tests/integration/test_model_comparison.py`
150
+ - Compares embedding model performance (gte-small vs bge-base-en-v1.5)
151
+ - Tests across different query types (1-word to long natural language)
152
+ - Timing measurements and success rate analysis
153
+
154
+ ### Fixed
155
+
156
+ - **ServerState Initialization**: Added `query_instruction` parameter support
157
+ - Properly passed through `ServerStateManager.initialize()`
158
+ - Included in state logging output
159
+
160
+ ### Documentation
161
+
162
+ - **Module Documentation Updates**: Refreshed all 54 Terraform AWS module docs
163
+ - Updated module versions and feature descriptions
164
+ - Improved formatting and consistency across modules
165
+ - Enhanced best practices and use case sections
166
+
167
+ - **README Improvements**:
168
+ - Reorganized Quick Start section with integration-specific guides
169
+ - Updated all code examples to use new model and index paths
170
+ - Added GitHub Copilot and VS Code MCP documentation links
171
+
172
+ - **Configuration Comments**: Enhanced `config.yaml` with detailed comments
173
+ - Documented query instruction usage and BGE model notes
174
+ - Added model configuration guidance
175
+
176
+ ### Notes
177
+
178
+ - **Index Rebuild Required**: After upgrading, rebuild the search index with the new model
179
+ - **Index Size**: Increased from ~4.5MB to ~9MB due to larger embedding dimensions (768 vs 384)
180
+ - **Performance**: First query ~2-3s (model loading), subsequent queries ~0.02s
181
+ - **Breaking Change**: Default index path changed - update any hardcoded paths
182
+
183
+ ## [0.1.2] - 2025-10-13
184
+
185
+ [0.1.2]: https://github.com/SantyagoSeaman/tfmodsearch/releases/tag/v0.1.2
186
+
187
+ ### Changed
188
+
189
+ - **Parser Architecture Refactoring**: Complete rewrite of document parsing system
190
+ - Removed YAML frontmatter dependency in favor of pure regex-based parsing
191
+ - Created `ModuleDocumentParser` class with two-strategy parsing approach:
192
+ 1. "## Module Information" section parsing (preferred)
193
+ 2. Inline keywords search (fallback)
194
+ - Fixed module name parsing to strip backticks from Markdown formatting
195
+ - Removed YAML frontmatter blocks from 46 module documentation files
196
+ - Simplified codebase by eliminating `yaml` library dependency
197
+
198
+ - **Search Algorithm Improvements**: Enhanced hybrid search for better ranking accuracy
199
+ - **Minmax Normalization for Semantic Search**: Added min-max normalization to cosine similarities
200
+ - Spreads small embedding differences (0.89-0.92) into full 0-1 range for better discrimination
201
+ - Addresses limitation of `thenlper/gte-small` model's narrow similarity clustering
202
+ - All scoring components now equally normalized (keywords, BM25, semantic, exact match)
203
+ - **Adaptive Query Scaling**: Implemented logarithmic scaling for BM25 and semantic scores
204
+ - Formula: `log(len(matched_keywords) + 1, base=3)` dampens scores for short queries
205
+ - Reduces BM25 noise on 1-2 word keyword queries where lexical matching is unreliable
206
+ - Improves ranking for precise keyword searches (e.g., "tgw", "firewall", "ssh-keys")
207
+
208
+ - **Search Index**: Rebuilt index with refactored parser
209
+ - Index size optimized from 4.58MB → 4.51MB (1.5% reduction)
210
+ - All 54 modules now use consistent text-based parsing
211
+ - Maintains 1,529 unique keywords across corpus
212
+
213
+ ### Added
214
+
215
+ - **Comprehensive Test Suite**: Created extensive integration tests for search quality
216
+ - New file: `tests/integration/test_all_modules_searchable.py` (387 lines, 169 tests)
217
+ - **ModuleTestCase Dataclass**: Explicit document→query triple linkage
218
+ - Each module linked to: keyword query, exact name query, natural language query
219
+ - Clear traceability for test failures with document paths and query types
220
+ - **Parametrized Tests**: 162 tests (54 modules × 3 query types)
221
+ - `test_module_searchable_by_keyword`: Verifies keyword-based search
222
+ - `test_module_searchable_by_name`: Validates exact module name matching
223
+ - `test_module_searchable_by_natural_language`: Tests semantic search quality
224
+ - **Quality Validation Tests**: 7 additional tests
225
+ - Module completeness (keywords, names, content)
226
+ - Data integrity (no duplicates, sufficient keyword vocabulary)
227
+ - Search quality metrics (average keyword count, vocabulary size)
228
+ - **NLTK Initialization**: Created `tests/conftest.py` for pytest setup
229
+ - Automatic NLTK data initialization before test session
230
+ - Eliminates `punkt_tab` resource errors
231
+ - **Test Results**: 160/169 passing (94.7% pass rate)
232
+ - 9 failures due to expected search quality variations (keyword collisions, semantic ambiguity)
233
+
234
+ ### Fixed
235
+
236
+ - **Module Name Parsing**: Resolved backtick capture in regex patterns
237
+ - Changed pattern from `(.+?)` to `([^`]+?)` to exclude backticks from capture group
238
+ - All module names now parse correctly without Markdown formatting artifacts
239
+ - **Parser Fallback Logic**: Improved reliability with dual-strategy approach
240
+ - Primary strategy: Structured "## Module Information" section
241
+ - Fallback strategy: Inline keyword search in document body
242
+ - More resilient to documentation format variations
243
+
244
+ ### Documentation
245
+
246
+ - **Test Coverage**: Added inline documentation for all test classes and methods
247
+ - Detailed docstrings explaining test purpose and validation criteria
248
+ - Examples of query types and expected behavior
249
+ - **Parser Documentation**: Enhanced ModuleDocumentParser class documentation
250
+ - Strategy descriptions with regex patterns
251
+ - Normalization and deduplication logic explained
252
+ - **Search Algorithm Notes**: Added comments explaining scoring improvements
253
+ - Minmax normalization rationale and impact
254
+ - Logarithmic scaling formula and use cases
255
+
256
+ ## [0.1.1] - 2025-10-12
257
+
258
+ [0.1.1]: https://github.com/SantyagoSeaman/tfmodsearch/releases/tag/v0.1.1
259
+
260
+ ### Changed
261
+ - **Expanded Module Catalog**: Search index now includes 54 Terraform AWS modules
262
+ - **Search Index**: Rebuilt index with all 54 modules
263
+ - 1,535 unique keywords indexed
264
+ - Enhanced semantic search coverage across AWS services
265
+
266
+ ### Documentation
267
+ - Each new module includes:
268
+ - Comprehensive descriptions with 2-3 paragraphs
269
+ - 10-25 key features per module
270
+ - 8-10 real-world use cases
271
+ - 20-70+ best practices across multiple categories
272
+ - Integration examples and code snippets
273
+ - Links to official AWS documentation
274
+ - AI agent implementation notes
275
+
276
+ ## [0.1.0] - 2025-10-11
277
+
278
+ [0.1.0]: https://github.com/SantyagoSeaman/tfmodsearch/releases/tag/v0.1.0
279
+
280
+ ### Added
281
+ - Initial release of TFModSearch MCP Server
282
+ - Hybrid search engine combining semantic embeddings, BM25, and keyword matching
283
+ - FastMCP-based server with stdio transport
284
+ - Three MCP tools: `search_modules`, `get_module`, `modules_list`
285
+ - CLI interface with `index` and `search` subcommands
286
+ - Support for Terraform AWS modules documentation
287
+ - Configurable search weights via YAML config
288
+ - Security features: path validation, access controls
289
+ - Comprehensive test suite (39 integration tests)
290
+ - Documentation with examples and integration guides
291
+ - Pre-commit hooks for code quality (ruff, mypy)
292
+ - Claude Desktop integration support
293
+
294
+ ### Features
295
+ - **Hybrid Search**: Combines 4 scoring signals for accurate module discovery
296
+ - **CPU-Only Inference**: Uses `thenlper/gte-small` model for semantic embeddings
297
+ - **Fast Indexing**: Pre-built search index with BM25 and embeddings
298
+ - **Type Safety**: Full type hints with mypy checking
299
+ - **Comprehensive Documentation**: README, tests documentation, inline comments
@@ -0,0 +1,103 @@
1
+ # Contributing to TFModSearch MCP Server
2
+
3
+ Thank you for your interest in contributing! This document provides guidelines for contributing to this project.
4
+
5
+ ## Development Setup
6
+
7
+ 1. Fork the repository
8
+ 2. Clone your fork:
9
+ ```bash
10
+ git clone https://github.com/YOUR_USERNAME/tfmodsearch.git
11
+ cd tfmodsearch
12
+ ```
13
+
14
+ 3. Set up development environment:
15
+ ```bash
16
+ uv venv --python 3.13
17
+ source .venv/bin/activate
18
+ uv pip install -e ".[dev]"
19
+ ```
20
+
21
+ 4. Install pre-commit hooks:
22
+ ```bash
23
+ pre-commit install
24
+ ```
25
+
26
+ ## Development Workflow
27
+
28
+ 1. Create a feature branch:
29
+ ```bash
30
+ git checkout -b feature/your-feature-name
31
+ ```
32
+
33
+ 2. Make your changes following the code style guidelines
34
+
35
+ 3. Run tests and quality checks:
36
+ ```bash
37
+ # Run all tests
38
+ pytest tests/ -v
39
+
40
+ # Run type checker
41
+ mypy src/
42
+
43
+ # Run linter and formatter
44
+ ruff check src/ tests/
45
+ ruff format src/ tests/
46
+
47
+ # Or run all checks at once
48
+ pre-commit run --all-files
49
+ ```
50
+
51
+ 4. Commit your changes:
52
+ ```bash
53
+ git add .
54
+ git commit -m "feat: add amazing feature"
55
+ ```
56
+
57
+ 5. Push to your fork and create a Pull Request
58
+
59
+ ## Code Style Guidelines
60
+
61
+ - Follow PEP 8 style guidelines (enforced by `ruff`)
62
+ - Add type hints to all functions (checked by `mypy`)
63
+ - Write docstrings for public functions and classes
64
+ - Keep line length to 120 characters
65
+ - Use meaningful variable and function names
66
+
67
+ ## Commit Message Convention
68
+
69
+ We use conventional commit messages:
70
+
71
+ - `feat:` - New feature
72
+ - `fix:` - Bug fix
73
+ - `docs:` - Documentation changes
74
+ - `test:` - Adding or updating tests
75
+ - `refactor:` - Code refactoring
76
+ - `chore:` - Maintenance tasks
77
+
78
+ Example: `feat: add support for custom embeddings models`
79
+
80
+ ## Testing Guidelines
81
+
82
+ - Write tests for new features
83
+ - Ensure all tests pass before submitting PR
84
+ - Aim for high test coverage
85
+ - Use descriptive test names that explain what is being tested
86
+
87
+ ## Pull Request Process
88
+
89
+ 1. Update documentation if you're adding features
90
+ 2. Ensure all tests pass and code quality checks succeed
91
+ 3. Update the README.md if needed
92
+ 4. Provide a clear description of the changes in your PR
93
+ 5. Link any related issues
94
+
95
+ ## Questions or Issues?
96
+
97
+ - Open an issue for bugs or feature requests
98
+ - Use discussions for questions and ideas
99
+ - Be respectful and constructive in all interactions
100
+
101
+ ## License
102
+
103
+ By contributing, you agree that your contributions will be licensed under the MIT License.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Alexander Makeev
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.