Repository navigation
fix(commands): answer an empty scan the same way everywhere, and build nothing (#164) - #199
Merged
Merged
Conversation
…d nothing (#164) Only /otel-init handled a repo whose scan returns no services. The others failed differently: - /otel-evaluate: "every service reports no OTel" is vacuously true over an empty list, so it said "No existing OTel instrumentation detected. Use /otel-instrument", pointing at a command that cannot help. - /otel-instrument: the "No candidates" branch printed its header and an empty list, no reason. - /otel-collector: generated a repo-root config for a repo with nothing to collect from. - /otel-backend: terraform-gen kept the template's <SERVICE_NAME> default, or invented an identity (unknown-service, 0.0.0), and built selectors, folder and rule-group names from it. The alerts use no_data_state = "OK", so a selector that matches nothing reports healthy. With --yes the command got past the unconfirmed-attributes prompt, which is how an orchestrated caller reaches it. - /otel-evaluate also wrote .claude/otel-context.json, but the .gitignore update lives in /otel-init Step 4, which an empty scan never reaches, so the cache was left untracked. /otel-init Step 2 now defines the rule once ("Empty scan"): print its message, write nothing (not the cache either), exit 0. It also covers a cache that already holds services: [] and overrides the other commands' "write what it returns" step. evaluate, instrument, collector and backend reference it right after loading context (evaluate before its vacuous check, backend before the --yes-skippable prompt). terraform-gen refuses to emit a module with no real service identity, and forbids both the placeholder and an invented one, as a backstop for a stale cache or a direct call. Adds fixtures/infra-only-repo (the issue's repro shape) and tests/hooks/zero-services-guard.test.sh, wired into lint-hooks; 13 of its 16 checks fail against the previous text. Bumps to 0.8.18. Not verified end to end: whether the scanner actually returns services: [] for that fixture is LLM-judged and not exercised here; the fixture pins the shape and the test pins the commands' response to an empty result.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Only
/otel-inithandled a repo whose scan returns no services; the other commands dead-ended or built output for a placeholder service. Closes #164.What changed
/otel-initStep 2 defines the "Empty scan" rule once: print the existing message, write nothing (not the cache either), exit 0. It also covers a cache that already holdsservices: []and overrides the other commands' "write what it returns" step/otel-evaluate(before its vacuous "no OTel" check),/otel-instrument,/otel-collectorand/otel-backend(before the--yes-skippable prompt) reference the rule right after loading contextterraform-genrefuses to emit a module with no real service identity and forbids both the<SERVICE_NAME>placeholder and an inventedunknown-service, as a backstopfixtures/infra-only-repo(the issue's repro shape) andtests/hooks/zero-services-guard.test.sh. Bumps to 0.8.18Test plan
All hook, snapshot, drift and e2e unit tests pass locally;
claude plugin validate . --strictpassesTeeth: 13 of the 16
zero-services-guardchecks fail against the previous textNot verified: whether the scanner returns
services: []for the new fixture is a model judgement and is not exercised here; the fixture pins the shape and the test pins the commands' responseVendor, SDK and semantic-convention facts were verified against the source, not recalled — linked where it isn't obvious.
Nothing hardcoded that has a single source of truth (
SEMCONV_VERSION,backends.txt,hooks/otel-paths.sh).