Skip to content

Feat/localstack coverage#47

Open
bartsdev wants to merge 13 commits into
mainfrom
feat/localstack-coverage
Open

Feat/localstack coverage#47
bartsdev wants to merge 13 commits into
mainfrom
feat/localstack-coverage

Conversation

@bartsdev

Copy link
Copy Markdown
Member

No description provided.

Bart Szydlowski and others added 13 commits June 1, 2026 15:52
…bility check

Adds a new localstack-coverage-advisor MCP tool that performs static analysis
of IaC templates against the LocalStack coverage database — no deployment required.

- Coverage tool with actions: list_services, get_service_coverage, check_operations,
  check_resources, scan_iac, patch_iac (Terraform only)
- scan_iac reads Terraform/CloudFormation/CDK/Pulumi files from disk and returns
  a per-resource deploy-readiness verdict
- patch_iac generates a unified diff gating blockers with count = 0 # localstack-patch
  and injecting a LocalStack provider config block
- coverage-advisor prompt: infers workspace root as iac_path, asks once if nothing
  found, offers patch after showing blockers
- Tool description targets natural language triggers (validate, will this work, etc.)
  and explicitly redirects to coverage-advisor over the deployer for static checks
- Deployer description updated to clarify it requires a running LocalStack instance

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…it response blocks

- Add resource_type_ops entries for aws_vpc, aws_subnet, aws_instance,
  aws_ram_resource_share, aws_ram_resource_association,
  aws_ram_resource_share_accepter (plus CloudFormation equivalents)
- Fix misleading "requires: " empty string for unknown resources — now
  shows "not in coverage database" inline in the blocker summary
- Split check_resources response into two content blocks (table + verdict)
  so Claude Code renders each block independently without truncation
- Add ResponseBuilder.blocks(...parts) helper for multi-block responses

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Replace "copy verbatim" rule with instruction to render as a markdown
  table with Resource/Status columns, grouped by stack/framework
- Remove "do not reformat" prohibition that was blocking table rendering
- Switch checkResources output to compact emoji-list format (shorter
  tool output, verdict on first line) so Claude has clean data to render

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Improves tool discoverability — "coverage" was ambiguous (sounds like
code coverage), "preflight" clearly signals "run this before deploying".

- Expands trigger phrases: will this work, will my terraform/stack/IaC
  work, will this deploy, can localstack run this, is this compatible,
  validate/check/preflight, any blockers, etc.
- Updates deployer description cross-reference
- Updates analytics key and prompt tool reference

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The preflight tool now calls the localstack-extension-coverage REST API
instead of querying a bundled SQLite DB directly. This removes the
services boundary violation and eliminates the better-sqlite3 native
module dependency.

Changes:
- Replace getDbPath()/Database open-close with getCoverageUrl()/coverageFetch()
- Default URL: http://localhost:4566/_extension/localstack-coverage
- Override via LOCALSTACK_COVERAGE_URL env var
- listServices, getServiceCoverage, checkOperations, checkResources all
  become async and call the extension REST endpoints
- patchIac uses /resources endpoint instead of its own inline SQL
- scan_iac and patch_iac unchanged (filesystem operations)
- Remove better-sqlite3 and @types/better-sqlite3 from dependencies
- Remove coverage.db copy step from build script

Requires localstack-extension-coverage to be installed and LocalStack
to be running. Hard-fails with a clear message if unreachable.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
aws_security_group, aws_security_group_rule, aws_internet_gateway,
aws_route_table, aws_route, aws_route_table_association, aws_eip,
aws_nat_gateway — plus CloudFormation equivalents.
- README: keep upstream snowflake-client row, add localstack-preflight after
- xmcp.config.ts: drop better-sqlite3 bundler workaround (sqlite removed), keep upstream template block
- yarn.lock: take upstream (better-sqlite3 dependency removed)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ght in tests and manifest

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… test

Adds two Gemini eval dataset scenarios that should trigger the
localstack-preflight tool (service overview and resource check), and
adds a direct MCP integration test that calls list_services and asserts
the response is non-error and mentions s3.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The coverage extension is not installed in the CI runner, so the
list_services call returns an HTTP error rather than coverage data.
Gate the assertion on LOCALSTACK_COVERAGE_URL — the same env var the
tool itself reads — so the test runs only when the extension is present.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Running `yarn install` locally with yarn 3.2.3 overwrote the lockfile
with berry format (__metadata: version: 6). The Dockerfile runs
`yarn install --frozen-lockfile` with yarn v1.22.22, which cannot parse
the berry format. Restore the yarn v1 lockfile from main.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…gured

test.skip() marks the test as skipped when LOCALSTACK_COVERAGE_URL is
absent; requireEnv() was throwing which Playwright counted as a failure.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant