feat(#90): ServerSpec spine — promote FLAG_ENV_MIGRATIONS into the server-package axis #96

Closed
the_og wants to merge 0 commits from feat/90 into main
Owner

What

Promotes FLAG_ENV_MIGRATIONS (the per-npm-package seed shipped in #89) into a richer, orthogonal ServerSpec registry — the foundation the sidecar (#91), version-pin (#92) and permission (#93) work all hang off.

ServerSpec is a new axis; ClientSpec is untouched. A server has both (which host reads it, which package it is).

Changes (pure bcc_core, no GUI)

  • ServerSpec frozen dataclass + SERVER_SPECS registry. Fields: env_flags, removed_flags, drift_flags, sidecar_paths, sidecar_doc_path, schema.
  • FLAG_ENV_MIGRATIONS is now a derived view of the registry — same shape #89 shipped, so every existing reader and the migration functions are behaviour-identical. The migration logic is unchanged; only the registry data grew.
  • resolve_server_spec(data) is the ServerSpec entry point; detect_migratable_package is a thin name-only wrapper over it.
  • #4 follow-ups (verified facts): --sudoPassword and --suPassword now auto-migrate to SSH_MCP_SUDO_PASSWORD (two flags → one var; the existing no-clobber logic handles the collision). --disableSudo stays warn-only (sudo is now a role/policy — no env replacement).
  • drift_warnings(): --maxChars=none changed meaning across versions (v1 silently parsed none to a 5000-char cap). Warn-only, no auto-fix; matches both the inline --flag=value and separate --flag value forms.
  • Seed data for later issues: ssh-mcp's verified per-platform sidecar TOML paths (from package source, not the README) and zod enums (auth/approvalMode/role/port).

⚠️ One intentional #89 test change (not a regression)

test_removed_flag_warnings_covers_migratable_and_manual asserted the old state where --sudoPassword was warn-only. The verified ssh-mcp facts (and issue #90) mandate adding sudo/su to the auto-migrate map, so that flag now moves into env. Updated that one test's post-migration assertions accordingly, with an inline comment citing the reason. All other #89 tests pass unchanged.

Testing

ruff check + ruff format --check clean; pytest green (509 passed, 1 skipped). Added tests for the registry seed, the derived-view invariant, resolve_server_spec/detect_migratable_package parity, the su-password mapping, the two-flags-one-var no-clobber path, and --maxChars=none drift (both arg forms).

Closes #90. Part of epic #94.


Stacked PR — base is main. This is the foundation; #91 and #92 branch off it (siblings), #93 off #91. Recommended merge order: #90 → #91 / #92 → #93.
🤖 Generated with Claude Code

## What Promotes `FLAG_ENV_MIGRATIONS` (the per-npm-package seed shipped in #89) into a richer, orthogonal **`ServerSpec`** registry — the foundation the sidecar (#91), version-pin (#92) and permission (#93) work all hang off. `ServerSpec` is a **new axis**; `ClientSpec` is untouched. A server has both (which host reads it, which package it is). ### Changes (pure `bcc_core`, no GUI) - **`ServerSpec` frozen dataclass + `SERVER_SPECS` registry.** Fields: `env_flags`, `removed_flags`, `drift_flags`, `sidecar_paths`, `sidecar_doc_path`, `schema`. - **`FLAG_ENV_MIGRATIONS` is now a derived view** of the registry — same shape #89 shipped, so every existing reader and the migration functions are behaviour-identical. **The migration logic is unchanged; only the registry data grew.** - **`resolve_server_spec(data)`** is the ServerSpec entry point; `detect_migratable_package` is a thin name-only wrapper over it. - **#4 follow-ups (verified facts):** `--sudoPassword` **and** `--suPassword` now auto-migrate to `SSH_MCP_SUDO_PASSWORD` (two flags → one var; the existing no-clobber logic handles the collision). `--disableSudo` stays warn-only (sudo is now a role/policy — no env replacement). - **`drift_warnings()`:** `--maxChars=none` changed meaning across versions (v1 silently parsed `none` to a 5000-char cap). Warn-only, no auto-fix; matches both the inline `--flag=value` and separate `--flag value` forms. - **Seed data** for later issues: ssh-mcp's verified per-platform sidecar TOML paths (from package source, not the README) and zod enums (auth/approvalMode/role/port). ### ⚠️ One intentional #89 test change (not a regression) `test_removed_flag_warnings_covers_migratable_and_manual` asserted the **old** state where `--sudoPassword` was warn-only. The verified ssh-mcp facts (and issue #90) mandate adding sudo/su to the auto-migrate map, so that flag now moves into env. Updated that one test's post-migration assertions accordingly, with an inline comment citing the reason. All other #89 tests pass unchanged. ### Testing `ruff check` + `ruff format --check` clean; `pytest` green (509 passed, 1 skipped). Added tests for the registry seed, the derived-view invariant, `resolve_server_spec`/`detect_migratable_package` parity, the su-password mapping, the two-flags-one-var no-clobber path, and `--maxChars=none` drift (both arg forms). Closes #90. Part of epic #94. --- **Stacked PR** — base is `main`. This is the foundation; #91 and #92 branch off it (siblings), #93 off #91. Recommended merge order: **#90 → #91 / #92 → #93**. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
the_og added 1 commit 2026-08-12 02:55:11 -04:00
feat(#90): promote FLAG_ENV_MIGRATIONS into a ServerSpec spine
CI / Lint (ruff) (pull_request) Successful in 7s
CI / Tests (py3.10 / ubuntu-latest) (pull_request) Successful in 11s
CI / Tests (py3.12 / windows-latest) (pull_request) Successful in 25s
CI / Tests (py3.12 / ubuntu-latest) (pull_request) Successful in 10s
CI / Tests (py3.13 / ubuntu-latest) (pull_request) Successful in 11s
CI / Catalog signature (pull_request) Successful in 6s
e087107710
Introduce the server-package axis (orthogonal to ClientSpec): a frozen
ServerSpec dataclass + SERVER_SPECS registry that the sidecar (#91),
version-pin (#92) and permission (#93) work all hang off.

- ServerSpec carries env_flags / removed_flags / drift_flags / sidecar_paths
  / sidecar_doc_path / schema. FLAG_ENV_MIGRATIONS is now a derived view of
  the registry, so every existing reader and the migration functions keep the
  exact shape #89 shipped — the migration LOGIC is unchanged, only the DATA grew.
- resolve_server_spec(data) is the ServerSpec entry point; detect_migratable_package
  is a thin name-only wrapper over it (behaviour identical).
- Add the verified #4 follow-ups: --sudoPassword AND --suPassword now auto-migrate
  to SSH_MCP_SUDO_PASSWORD (two flags → one var; existing no-clobber handles it).
  --disableSudo stays warn-only (sudo is now a role/policy, no env replacement).
- Add drift_warnings(): --maxChars=none changed meaning (v1 silently capped at
  5000 chars). Warn-only, no auto-fix; matches inline and separate arg forms.
- Seed ssh-mcp's verified per-platform sidecar TOML paths and zod enums
  (auth/approvalMode/role/port) as data for later issues.

Pure core + tests, no GUI. One #89 test (sudoPassword now migratable) updated to
reflect the intended data growth, with a comment citing the verified facts.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
the_og closed this pull request 2026-08-12 23:53:45 -04:00

Pull request closed

This pull request cannot be reopened because the branch was deleted.
Sign in to join this conversation.