Skip to content

One command for anything (minefield <url|files|symptom>), honest exit codes, uvx msmf, Claude Code plugin - #242

Draft
Blackwellboy wants to merge 5 commits into
mainfrom
claude/eloquent-ritchie-4ms1hy
Draft

Blackwellboy wants to merge 5 commits into
mainfrom
claude/eloquent-ritchie-4ms1hy

Conversation

@Blackwellboy

@Blackwellboy Blackwellboy commented Dec 4, 2026 •

Copy link
Copy Markdown
Owner

This is a CLI, packaging and docs change, not a trap entry, so the trap-entry items in the checklist do not apply. The items that cover every diff:

  • No secrets, private hostnames, internal paths, or personal data anywhere in the diff
  • No internal hostnames, ports, home directory paths, LAN or tailnet addresses in any file (docs use HOST:PORT; tests use loopback fixtures only)
  • No em, en or figure dashes in added text
  • Noted: both scans run from a private kit at git push on a maintainer machine and never in CI, so a green badge here says nothing about them

What this PR adds:

One command that takes whatever the user has, honest exit codes when nothing could be tested, and installs that work in any harness with nothing to set up first. Found by installing msmf 0.2.2 from PyPI into a clean environment and driving every command against the repo's own fixture lane.

Problems found

  1. uvx msmf fails. uvx and pipx run look for an executable named like the package, and msmf ships only minefield and minefield-mcp: An executable named 'msmf' is not provided by package 'msmf'.
  2. An unreachable endpoint looks like a clean run. minefield diagnose --base-url http://HOST:9/v1 (a typo in the port) exits 0 and prints "No canonical trap rose to the candidate list". Nothing says the server was never reached.
  3. Problems never change the exit code. A lane with five live PROBLEMs still exits 0, so CI cannot gate on it.
  4. The key can only go on the command line (--api-key), where it lands in shell history and ps.
  5. minefield --version is parsed as guide --version and fails with a usage error.
  6. The no-match hint sends people to quick, which is the full Doctor (34 requests on the fixture lane), not the 5-request lite check the menu calls "quick".

What changes

  • minefield <anything>: a URL (http(s):// or host:port) and/or files that exist and look like paths route to diagnose in lite mode (at most 5 requests), with leftover words as the symptom. Plain words still go to guide, and a bare word is never a path, so minefield logs are empty behaves as before even when ./logs exists. In a terminal the routed command is printed to stderr.
  • diagnose exits 3 and says "Could not reach URL: nothing was tested live" (with what to check) when the endpoint is unreachable. Opt-in --fail-on-problem exits 1 on a live PROBLEM. File and symptom leads never change the exit code, matching the GitHub Action doc's "never fails the build". The codes match hermes-minefield's (1 FAIL, 2 bad input/blocked, 3 UNKNOWN).
  • MINEFIELD_API_KEY is read when --api-key is absent. OPENAI_API_KEY is deliberately not read: that would send a cloud key to whatever local URL was typed.
  • minefield --version prints the version and trap count.
  • msmf alias 0.1.1 adds an msmf executable (needs publishing to take effect).
  • .claude-plugin/ makes the repo a Claude Code plugin marketplace: claude plugin install minefield@model-serving-minefield installs the existing skill plus the MCP server run through uvx. claude plugin validate . passes, and a real install into an empty config loads the skill and reports the server Connected.
  • MCP setup leads with a zero-install uvx --from model-serving-minefield minefield-mcp config for any client.
  • .gitignore ignores *.egg-info/. An editable install creates one, and 0.2.3 prep: traps 169-175, a short README, ExLlamaV3 page, one install name, Pages builder #241 currently commits model_serving_minefield.egg-info/ by accident.

Checks run

  • make test: all four suites OK, including 10 new tests in tests/test_one_command.py (routing, word-vs-path, unreachable exits 3, --fail-on-problem 1 on a broken lane and 0 on a clean one, env key never printed).
  • make verify-generated: clean after regenerating dist/ (the agent pack zip includes the docs).
  • integrity/run_checks.py: everything PASS except public surfaces, which fails locally by design without the Pages-site peer.

Secret-scan note

The first commit's new test used a made-up key (mf-test-key-...). Both gitleaks and detect-secrets flagged it as a generic API key. a1e8a84 switches the test to the allowlisted sk-SENTINEL prefix and marks the env-var name with # pragma: allowlist secret. Run on that commit, both scanners come back clean locally.

gitleaks scans every commit in the PR, so this PR's check stays red until the history is gone. A squash merge clears it, because only the final tree lands on main. I did not force-push a squashed branch myself.

Overlap with open PRs

#241 rewrites the README into TRAPS.md and docs/GUIDE.md. This PR's README edit is a few lines in the install section, so whichever merges second needs a small rebase there. No overlap in code.


Generated by Claude Code

…codes, uvx msmf

- A URL (http(s):// or host:port) and/or existing paths route to diagnose in
  lite mode (<=5 live requests); plain words still go to guide, and a bare
  word is never a path.
- diagnose exits 3 and says 'Could not reach URL: nothing was tested live'
  when the endpoint is unreachable (it exited 0 with a no-candidates message).
  Opt-in --fail-on-problem exits 1 on a live PROBLEM, for CI.
- MINEFIELD_API_KEY is read when --api-key is absent (OPENAI_API_KEY is not).
- minefield --version works.
- msmf alias 0.1.1 ships an msmf executable so 'uvx msmf ...' works.
- MCP setup leads with a zero-install uvx config for any client.
- .gitignore ignores *.egg-info (an editable install creates one).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P2NVAwhVxZZGB3jqJBvcP9
claude plugin validate . passes; a real install into an empty config loads the
skill and the MCP server reports Connected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P2NVAwhVxZZGB3jqJBvcP9
…r name for detect-secrets

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P2NVAwhVxZZGB3jqJBvcP9
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P2NVAwhVxZZGB3jqJBvcP9

Copy link
Copy Markdown
Owner Author

CI status on this PR:

  • verify failed for two reasons, both in this PR and both fixed:
    • detect-secrets flagged a made-up key in the new test, plus the API_KEY_ENV name. Fixed in a1e8a84 (allowlisted sk-SENTINEL prefix and a # pragma: allowlist secret comment). The workflow's own detect-secrets command now reports 0 findings on the tree.
    • After that, dist/ still held the old hash of minefield/cli.py. Regenerated in 8f5f24b, and make verify-generated now passes locally.
  • gitleaks (the PR-range job) will stay red. It scans every commit in the PR, and 69c51e6 still contains that fake key. It is not a real credential. A squash merge clears the check, because only the final tree lands on main. The alternative is a force-push of a squashed branch, which I did not do without your say-so.

Generated by Claude Code

This branch has not been deployed

No deployments
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.

2 participants