Skip to content

Preserve credential files during MCP sync - #289

Merged
Eli Pinkerton (wallstop) merged 1 commit into
migrate/mcp-json-writersfrom
migrate/mcp-credential-aliases
Oct 18, 2026
Merged

Eli Pinkerton (wallstop) merged 1 commit into
migrate/mcp-json-writersfrom
migrate/mcp-credential-aliases

Conversation

@wallstop

@wallstop Eli Pinkerton (wallstop) commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

DISCLOSURE: LLM-GENERATED TEXT

Why: Alias synchronization drops the credential file's BOM.

What:

  • Synchronize GitHub and Z.ai aliases with typed Python through uv.
  • Preserve BOM, line endings, and literal values during updates.
  • Keep existing precedence, divergence detection, and read-only dry runs.
  • Write aliases atomically and emit statuses without credential values.

Refs #171.


Note

Medium Risk
Changes how .env.local and MCP client configs are read/written across devcontainer shells and mcp:sync, including credential alias mirroring; mistakes could break auth or corrupt local configs, though behavior is heavily contract-tested.

Overview
Moves MCP sync file writes and credential alias logic out of inline Node/bash into typed Python helpers invoked by configure.mjs (aliases, JSON frontends, Codex TOML) and adds scripts/unity_mcp_settings.py for Unity bridge startup settings used by unity-mcp-host.mjs.

.env.local loading is reworked: env-local.sh delegates parsing to env_local.py via uv/Python with a NUL-delimited protocol so exports apply atomically and values stay literal (no shell injection). Existing precedence (DATAVIZ_ENV_LOCAL_PRECEDENCE=file for MCP credential keys) is preserved.

Credential alias sync (mcp_aliases.py) now updates .env.local through write_private / write_atomic, keeping BOM, line endings, and divergent-pair detection while emitting statuses only (no secret values in output).

npm run mcp:sync reports per-frontend failures and sets a non-zero exit when any writer fails, while other frontends can still run; JSON persistence is batched once per sync. Docs and harness scope map the new scripts to contract tests.

Reviewed by Cursor Bugbot for commit a76ffdb. Bugbot is set up for automated code reviews on this repo. Configure here.

Alias updates currently discard the credential file BOM. Move GitHub and Z.ai alias synchronization to typed Python, preserving precedence, divergence detection, dry runs, literal values, BOM, and line endings. Write atomically with private permissions and emit statuses only. Keep authentication probing in the doctor.

Validation: all 43 harness files; seven new alias cases on Python 3.9.25; strict pyright on four changed Python files; fast and full gates; npm payload unchanged at 181 files and 180528 bytes. Unity host passed 393 EditMode and 15 PlayMode tests. No live credential repair was performed. Revert this commit to restore the Node alias writer.

Refs #171.
@wallstop
Eli Pinkerton (wallstop) force-pushed the migrate/mcp-credential-aliases branch from 7fa2868 to a76ffdb Compare October 18, 2026 05:59
@wallstop
Eli Pinkerton (wallstop) changed the base branch from main to migrate/mcp-json-writers October 18, 2026 05:59
@wallstop
Eli Pinkerton (wallstop) added this pull request to stack #291 October 18, 2026 05:59
@wallstop
Eli Pinkerton (wallstop) merged commit cfb17c0 into main Oct 18, 2026
3 checks passed
@wallstop
Eli Pinkerton (wallstop) deleted the migrate/mcp-credential-aliases branch October 18, 2026 06:09
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