feat(mcp): add config command reporting resolved configuration provenance#335
Conversation
JSONbored
left a comment
There was a problem hiding this comment.
@glorydavid03023 this is a useful MCP diagnostic command, but it needs validation evidence before merge.
A few notes:
- Showing config provenance without printing token values or local paths is the right behavior.
- The
--jsonshape is useful for tooling. - The blocker is validation evidence, not the command idea.
Required changes:
- Run the relevant MCP gate locally or clearly state any environment blocker with exact skipped checks.
- Keep the token/path redaction assertions in the tests.
- Make sure README output examples match the final command output.
Validation expected:
npm run build:mcpnpm run test:mcp-packnpm run typecheck- Focused
test/unit/mcp-cli.test.ts
…ance Add a `config` command to the gittensory-mcp CLI that prints the resolved effective configuration and the source that supplied each value (environment, profile, config file, or default): the active API URL and its source, the active profile and profile count, whether a config file is present and which environment variable steers its location, the cache-dir source, whether a token is configured and where it came from, and the source-upload posture. This fills a real diagnostic gap. `status` reports health and version, `doctor` runs checks, and `whoami` shows session identity, but none of them answer "what configuration is actually in effect and which source supplied it?" — the common question when an API URL or profile is not picked up as expected. Output prints provenance labels only: it never includes token values or local absolute paths, preserving the CLI's redaction invariant. A `--json` form is provided for tooling. Tests cover default resolution, environment overrides (with token/path non-leak assertions), named-profile resolution from the config file, and a global config file reached through a config-path override. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
308d6ac to
af27c15
Compare
|
Note Gittensory Gate skippedPR closed before full evaluation. No late first comment was created.
Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers. |
|
Rebased onto the latest
The one pre-existing test that times out locally ( |
JSONbored
left a comment
There was a problem hiding this comment.
@glorydavid03023 this is ready.
A few notes:
configfills a real gap betweenstatus,doctor, andwhoami.- The output reports source provenance without leaking tokens or local absolute paths.
- The tests cover default, environment, profile, and config-file resolution.
- No code changes requested.
Summary
Adds a
configcommand to thegittensory-mcpCLI that prints the resolved effective configuration and where each value came from:Each value is attributed to its source —
environment,profile,config(file), ordefault.Why this is useful (and not a duplicate of existing commands)
This fills a real diagnostic gap.
statusreports health/version,doctorruns check-style diagnostics, andwhoamishows session identity — but none answer the common question "what configuration is actually in effect, and which source supplied it?" That question comes up whenever an API URL, profile, or config-file location is not being picked up as expected (env vs profile vs global config vs default).configmakes that resolution explicit in one place.Why no linked issue
Additive, low-risk CLI ergonomics only. No public-behavior, auth/session, schema, deploy, or frontend-architecture change, so per CONTRIBUTING this does not require an issue first. Happy to file one if maintainers prefer.
Privacy
Output prints provenance labels only — never token values or local absolute paths — preserving the CLI's existing redaction invariant. A test asserts that neither a configured token nor the config directory path appears in output.
Changes
packages/gittensory-mcp/bin/gittensory-mcp.js—configdispatch inrunCli,configCommand()withresolvedApiUrlSource()/resolvedConfigPathSource()/resolvedTokenSource()helpers, and a help-text usage line.test/unit/mcp-cli.test.ts— cover default resolution, environment overrides (with token/path non-leak assertions), named-profile resolution from the config file, and a global config file reached through a config-path override.packages/gittensory-mcp/README.md— document the command, its sources, and the--jsonform.Contract notes
No MCP tool or HTTP/OpenAPI contract changes. Adds a local CLI command surface only; the
--jsonpayload is additive and parseable.Validation
Intended gate (CONTRIBUTING required checks):
Transparency note: my local authoring environment had no Node runtime available, so I could not execute the gate locally before opening this PR. The change was prepared against the existing CLI dispatch/config-resolution/test patterns and is intended to be validated by CI on this PR (I will also run the full gate locally). I aimed for thorough branch coverage of the new provenance helpers; if any check needs adjustment I'll follow up promptly.
Security / privacy
No auth, cookie, CORS, GitHub App output, identity, or contributor-evidence changes. The command exposes only provenance labels, the public API URL, and the user's own profile state — no tokens, local paths, wallet/hotkey, or scoring context.