Repository navigation
Conversation
A repository where appmap-setup never ran fails downstream in ways that do not name the real cause: missing manifests, missing appmap.yml, MCP "query DB not found" errors, and agents improvising config with shell text-editing tools that are not available everywhere the skills run. Make the setup state an enforced precondition: - manage.mjs `doctor`: a setup preflight that checks the manifest, appmap.yml, the record commands, and the AppMap CLI (>= 3.201.0), one line per check, and exits non-zero naming appmap-setup as the fix. - manage.mjs `init`: seeds gold_traces/ (baseline/appmaps included) and writes manifest.yaml from --framework/--runner/--args or --record-command, so bootstrap needs no cp, heredocs, or text editing. Refuses to overwrite an existing manifest. - Engine errors for a missing manifest, missing appmap.yml, and an unconfigured commands block now route to the appmap-setup skill. - appmap-gold-traces and appmap-review SKILL.md gain a "verify the repository is set up" preflight; appmap-setup Phase 5 uses `init` and ends with a green `doctor` as the definition of "set up"; appmap-record documents the "query DB not found" recovery; README states the ordering. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PL1Hzq3gd7XuTnz7pSmiCh
Contributor
|
Why did you close this? |
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.
Problem
Field testing (setting up gold traces on Stirling, Windows) showed that when a user skips
appmap-setup, every downstream piece goes down a failure path that does not name the real cause:gold_traces/manifest.yamlorappmap.ymland improvise — including reaching for shell text-editing commands that do not exist in the environment (Windows cmd.exe, restricted agents).appmap query mcp --appmap-dir …fail with "query DB not found … Runappmap indexfirst", but indexing cannot help because nothing was ever recorded.Setup must run first, and every other skill should reject a not-set-up state and route the user to
appmap-setupinstead of working around it.Changes
Engine (
manage.mjs)doctorcommand — a setup preflight. Checks, in order: the manifest, the nearest-ancestorappmap.yml, the record commands block, the AppMap CLI and its version (≥ 3.201.0, required bysanitize), then the curated entries and their committed baselines. Prints one line per check; exits non-zero on a hard failure with an explicit "run the appmap-setup skill" instruction and "do not create or edit this configuration by hand". An emptyentrieslist exits 0 with a pointer to the gold-traces Bootstrap (that state is setup-complete by design).initcommand — seedsgold_traces/(baseline/appmaps/included) and writesmanifest.yamlitself, taking the record configuration as flags (--framework,--runner,--args, or--record-command). Nocp, no heredocs, no text editing. Refuses to overwrite an existing manifest.appmap.yml, and an unconfiguredcommandsblock now nameappmap-setupas the fix.Skills
appmap-gold-traces: new "First, verify the repository is set up" section (rundoctor, stop on failure); Bootstrap steps 1–2 now useinitand defer toappmap-setup; the engine-command reference documentsdoctorandinit.appmap-review: same preflight before any compare; the ad-hoc two-file mode is documented as the one exemption.appmap-setup: declared the entry point ("every other AppMap skill … refuses to run without it"); the pre-check and Phase 5 usedoctor/init, and a greendoctoris the definition of "set up". Removed the stale claim that the YAML parser can't read[].appmap-record: documents the "query DB not found" MCP error and its real fix (record first, via setup).README.md: states the ordering up front.Tests — 8 new cases in
manage.test.mjscoveringinit(seeding, overwrite refusal, flag validation, no-flags guidance) anddoctor(missing manifest, unconfigured commands, full pass with stub CLI, version gate). All 55 pass, plus the frameworks/review suites (47) — same invocation as CI.Risk analysis
doctor/initare additive commands; they dispatch before the manifest loads, so no existing command's control flow changes. The only behavior changes to existing paths are error-message texts (three sites), which nothing parses.init's generated manifest is new YAML-writing code; free-form values (runner, args, record template) are always JSON-double-quoted, which is valid YAML for every edge case (leading-,:,#). Covered by a round-trip test through the real YAML reader.doctor's CLI probe spawns<appmap_cli> --versionwithout a shell; a.cmdshim on Windows PATH would not be found and would report the CLI missing (a false negative that still routes to the right fix). The standard installs (~/.appmap/bin/appmap(.exe), release binary on PATH) are.exe/ELF and resolve fine./appmap-setup. That is the intended change; the exemption forappmap-review's ad-hoc file mode is preserved.Companion docs PR: getappmap/applandinc.github.io#1584 — "If setup was skipped" section in the gold-traces reference.
🤖 Generated with Claude Code
https://claude.ai/code/session_01PL1Hzq3gd7XuTnz7pSmiCh