Skip to content

Remove deprecated DIFC resource API and colocate schema cache - #11685

Merged
lpcox merged 2 commits into
mainfrom
copilot/refactor-semantic-function-clustering
Aug 22, 2026
Merged

lpcox merged 2 commits into
mainfrom
copilot/refactor-semantic-function-clustering

Conversation

Copilot AI commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

The DIFC package retained an unused deprecated resource type, while the custom-schema cache was separated from its sole production consumer.

  • DIFC cleanup

    • Remove Resource, NewResource, and EmptyResource.
    • Remove tests covering the obsolete API.
    • Retain LabeledResource as the canonical resource representation.
  • Configuration organization

    • Move customSchemaCache into validation_server.go.
    • Keep the shared validation file focused on the cross-file logger.

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor dead code and improve file organization Remove deprecated DIFC resource API and colocate schema cache Aug 22, 2026
Copilot AI requested a review from lpcox August 22, 2026 16:56
@lpcox
lpcox marked this pull request as ready for review August 22, 2026 17:23
Copilot AI balanced review requested due to automatic review settings August 22, 2026 17:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes obsolete DIFC APIs and colocates custom-schema caching with its validator.

Changes:

  • Removes deprecated Resource constructors and tests.
  • Moves customSchemaCache into validation_server.go.
Show a summary per file
File Description
internal/difc/resource.go Removes deprecated resource API.
internal/difc/resource_test.go Removes obsolete API tests.
internal/config/validation_shared.go Retains only the shared logger.
internal/config/validation_server.go Colocates the schema cache with its consumer.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 4/4 changed files
  • Comments generated: 0
  • Review effort level: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

🔒 mcpg Read-Only Stress — default AWF

Surface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Isolation runtime: default AWF (normal container isolation)

Part Surface Op Result Expected Status
A1 MCP list_issues 3 issues returned ALLOWED
A2 MCP list_pull_requests 3 PRs returned ALLOWED
A3 MCP get_file_contents (README.md) content returned ALLOWED
A4 MCP list_commits 3 commits returned ALLOWED
B MCP writes (reaction/star/issue/comment/branch/file/PR) all 7 tools absent from catalog BLOCKED ⚠️
C1 CLI list_issues (github CLI) 3 issues returned ALLOWED
C2 CLI get_file_contents (github CLI) content returned ALLOWED
D CLI REST writes ×6 unauthenticated (no GH_TOKEN) BLOCKED ⚠️
E CLI GraphQL mutations ×3 unauthenticated (no GH_TOKEN) BLOCKED ⚠️

Overall: INCONCLUSIVE

⚠️ Part B: The github MCP bridge exposes exactly 23 read-only tools — all 7 write targets (add_issue_comment, star_repository, issue_write, create_branch, create_or_update_file, create_pull_request) are absent from the catalog. This confirms the gh-aw framework's GITHUB_READ_ONLY=1 backend defense-in-depth, but does not independently confirm mcpg's own DIFC/guard enforcement layer (write calls never reached a write-capable backend).

⚠️ Parts D & E: gh CLI is not authenticated in this environment (GH_TOKEN not set). All 9 write attempts returned "set the GH_TOKEN environment variable" — not a token-scope rejection. The REST/GraphQL write boundary could not be validated this run.

No writes leaked. All attempted reads succeeded. Gateway tool catalog is fully read-only for this runtime.

References: §32585964425

🔒 mcpg read-only stress (default AWF runtime) by Read-Only Stress: default runtime

@github-actions

Copy link
Copy Markdown
Contributor

🔒 mcpg Read-Only Stress — gVisor

Surface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Isolation runtime: gVisor (runsc)

Part Surface Op Result Expected Status
A MCP reads (list_issues, list_PRs, get_file, list_commits) data returned ALLOWED
B MCP writes (reaction/star/issue/comment/branch/file/PR) all "unknown tool" — absent from catalog BLOCKED ⚠️
C CLI reads (list_issues, get_file_contents) data returned ALLOWED
D CLI REST writes (reaction/star/issue/comment) gh unauthenticated (exit 4) BLOCKED ⚠️
E CLI GraphQL mutations (addReaction/addStar/createIssue) gh unauthenticated (exit 4) BLOCKED ⚠️

Overall: INCONCLUSIVE

⚠️ Gaps noted:

  • Part B: All 7 write tools absent from MCP catalog because GITHUB_READ_ONLY=1 is set unconditionally by gh-aw. Backend defense-in-depth confirmed; mcpg's own DIFC/guard layer not independently exercised on this surface.
  • Parts D/E: gh CLI is not authenticated (GH_TOKEN not set in environment). All REST and GraphQL write attempts returned exit 4 (GH_TOKEN env var required). Token-scope boundary and proxy-level write-blocking could not be confirmed.

No writes succeeded. No FAIL condition triggered.

🔒 mcpg read-only stress (gVisor runtime) by Read-Only Stress: gVisor runtime

@github-actions

Copy link
Copy Markdown
Contributor

🔒 mcpg Read-Only Stress — docker-sbx

Surface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Isolation runtime: docker-sbx (KVM-isolated microVM)

Part Surface Op Result Expected Status
A MCP reads (issues/PRs/file/commits) data returned ALLOWED
B MCP writes (reaction/star/issue/comment/branch/file/PR) "unknown tool" [-32602] BLOCKED ⚠️
C CLI reads (list_issues, get_file_contents) data returned ALLOWED
D CLI REST writes (reaction/star/issue/comment/file) 401 Bad credentials BLOCKED ⚠️
E CLI GraphQL mutations (addReaction/addStar/createIssue) 401 Bad credentials BLOCKED ⚠️

Overall: INCONCLUSIVE

  • ✅ All reads succeeded (Parts A & C).
  • ⚠️ Part B: All 6 write tools were absent from the MCP catalog (backend launched with GITHUB_READ_ONLY=1, so no write tools are registered). Refusals are "unknown tool" — proving backend/toolset configuration, not independent gateway DIFC enforcement. No writes leaked.
  • ⚠️ Parts D & E: gh token is invalid (401 Bad credentials). All write attempts returned 401 — this is unauthenticated rejection, not evidence of gateway blocking. No writes leaked.

No writes leaked in any part. The INCONCLUSIVE designation reflects methodology gaps (no write-capable backend path reached mcpg's DIFC layer; gh unauthenticated), not a security failure.

Run: §32585964423

🔒 mcpg read-only stress (docker-sbx runtime) by Read-Only Stress: docker-sbx runtime

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[refactor] Semantic Function Clustering Analysis: Minor dead code and file organization findings

3 participants