Skip to content

fix: restore MCP compatibility and confine type-map reads - #47

Draft
Coding-Dev-Tools wants to merge 4 commits into
masterfrom
codex/schemaforge-mcp-v1-20261009
Draft

Coding-Dev-Tools wants to merge 4 commits into
masterfrom
codex/schemaforge-mcp-v1-20261009

Conversation

@Coding-Dev-Tools

@Coding-Dev-Tools Coding-Dev-Tools commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

Schemaforge's MCP integration had three independent defects: optional extras allowed SDK 2.x despite importing the v1 FastMCP API; SSE passed unsupported address arguments to run(); and both optional MCP type-map paths reached TypeConfig.from_file without the existing root validation.

Both MCP declarations now require mcp>=1.0,<2. SSE configures host/port through the supported constructor and retains the stdio behavior. Both convert.type_map_path and check.type_map_path now use the same allowed-root contract as check.directory: SCHEMAFORGE_MCP_ROOT, or the current working directory when unset. Canonical resolution follows links before validation, and the validated canonical path is passed to loading. Outside-root maps are rejected before any loader call. Standalone CLI map loading is unchanged.

Four separate commits cover the dependency cap, the 31 mechanical formatting corrections requested by review, the two-file SSE repair, and the two-file path repair. The formatting commit preserved all affected ASTs and 686 assertions. The path commit preserves all prior 20 MCP test cases, all 17 test-function ASTs and their 35 assertions, transport wiring, optional dependency behavior, and other three tools. It adds 34 synthetic regression cases.

Current head: f26a119a678034b67688cf824be6594ecbc597d6
Current tree: 50d24e28036e20b2b1fa22dccfc5565fb6354cda

Validation:

  • Original SDK 2.3.0 baseline: 333 passed, 14 failed, matching PR44's actual CI job.
  • SSE replay before its repair: both default/custom SSE calls raised TypeError, while both stdio cases passed. Tests enforce the installed SDK's real signature with transport execution stubbed.
  • Final path regressions replayed against exact prior source c35332cc52d7403f026ab50c421933f2197cb989: 12 failing escape cases / 6 passing omitted-map and directory-guard cases. The failures observe mocked loader calls for absolute, traversal and linked escapes in both tools, under both root modes. No outside map contents are read by rejection probes.
  • Current head: 387 passed, no skips, locally on Python 3.12.14 and 3.14.7 with MCP 1.30.0; all 54 MCP cases pass. Tests cover valid canonical maps, omitted maps, unchanged directory rejection, and standalone CLI maps outside the MCP root. All files are temporary synthetic fixtures. Windows uses actual directory junctions because symlink privilege is unavailable; no permission changes or skips are introduced.
  • Fresh current-head CI run 37974035225 passed. Python 3.10.22, 3.11.17, 3.12.15 and 3.13.16 each ran 387 passing tests, including all 54 MCP cases, with MCP 1.30.0. Linux runs exercise actual symlinks. Schema consistency passed. Python 3.10, 3.11 and 3.13 were unavailable locally.
  • Ruff lint passed and all 57 Python files are formatted. Wheel build, installed-wheel CLI use without MCP, seven-format consistency and both Node smoke tests passed.

Fresh automated review run 37974036399 reports zero lint findings and clean formatting. Its remaining FAIL is the unchanged intentional Alembic revision fixture at tests/test_new_formats.py:713. The unchanged offline scanner reproduces exactly that one finding. The review response documents its synthetic generator input/output assertion. Maintainer disposition is still required; the gate remains unresolved. No human reviews or inline review comments are submitted.

PR47 remains a draft. Merge is held for unresolved review requirements and separate approval of the existing master-push GitHub Pages effect. Expected-head publication and remote commit/tree/file readback passed. No provider calls, real/private test-file reads, security-setting/permission changes, merge, release, deployment, or PR44–46 updates occurred.

@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Automated Code Review

Ruff lint: 0 issue(s)

Ruff format: Clean

Secret detection: 1 potential secret(s)

Review incomplete or critical issues found: secrets, Potential secrets detected

Verdict: FAIL

Automated by Coding-Dev-Tools/.github reusable workflow.

Copy link
Copy Markdown
Owner Author

Review follow-up for the automated review, verified at head 63c7442e29d3de4345e0deea8de8e36df1dda031 (tree 842e9b0dd1b225738b24bf100a306b7c0f6ad3f0).

The 31 formatting findings are fixed in a separate mechanical commit. Ruff 0.16.10 now reports all 57 Python files formatted and zero lint findings. AST comparisons across every changed file are identical, including all 686 assertions in those files. All 14 MCP tests and the custom-revision fixture are unchanged.

The remaining Hex High Entropy String result is an intentional test fixture at tests/test_new_formats.py:713:

  • test_alembic_custom_revision explicitly passes the fixed synthetic revision ID abc123def456 and parent ID prev_rev to AlembicGenerator.generate.
  • It asserts that the generated migration contains revision = 'abc123def456' and the corresponding down_revision. The generator inserts these identifiers into migration text; the fixture performs no authentication or network operation.
  • Offline detect-secrets 1.5.0 with the workflow's --all-files --no-verify options reproduces exactly this one result on master, the original fix, and the follow-up. The fixture function's AST and literal values are identical before and after formatting.

The fixture is therefore a reproducible false positive for credential detection. Its expected semantics and assertions have been preserved; no exclusions, allowlists, security/lint settings, or check policies changed. The current automated check still reports FAIL for that result and requires maintainer disposition; this evidence does not claim the gate is cleared. Current-head CI passed independently. PR47 remains a draft and is not merged.

Use the supported FastMCP constructor options for SSE host and port. Add offline signature-enforced transport regressions while preserving stdio defaults and optional MCP use.
@Coding-Dev-Tools Coding-Dev-Tools changed the title fix: constrain MCP dependency to the supported v1 SDK fix: keep MCP on supported v1 API and repair SSE startup Oct 9, 2026
Validate both optional MCP type-map paths against the existing allowed root after canonical link resolution. Add synthetic escape and valid-map regressions while preserving standalone CLI behavior and all prior MCP tests.
@Coding-Dev-Tools Coding-Dev-Tools changed the title fix: keep MCP on supported v1 API and repair SSE startup fix: restore MCP compatibility and confine type-map reads Oct 9, 2026

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.

1 participant