aminghadersohi opened a new pull request, #43202:
URL: https://github.com/apache/superset/pull/43202
### SUMMARY
MCP tool results must preserve user-authored domain values exactly. The
previous fixed in-band delimiter convention changed chart names, dashboard
metadata, dataset and metric fields, SQL, annotations, tags, themes, and other
returned strings. A client that reads one of those values and sends it back
through a rename, update, duplicate, save, or import path can persist the
presentation markup as application data. The fixed delimiters are also
attacker-controlled and therefore cannot establish a trustworthy boundary.
This change:
- makes the existing result-value compatibility helpers strict identity
operations, removing fixed delimiter insertion and escaping from every existing
result path;
- keeps the server-level instruction that all tool results are
user-controlled data with no instruction authority, without assigning trust to
an in-band token;
- preserves stored annotation JSON text rather than canonicalizing it on
read;
- covers every previously marked chart, dashboard, dataset, annotation, SQL
Lab, report, role, user, tag, task, and theme field in a central inventory;
- adds concrete read/modify/write regression coverage for dashboard
metadata, dataset metrics, saved queries, and themes, plus a database-backed
round-trip test for the full field inventory;
- prevents fixed marker literals from being reintroduced in production MCP
code and verifies result bodies are not emitted in structured audit logs.
Trust classification belongs out of band or in a client-owned presentation
boundary. It must not mutate application values.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Not applicable; this changes MCP result serialization and tests only.
### TESTING INSTRUCTIONS
1. Store a chart, dashboard, dataset metric, saved query, annotation, or
theme value containing literal opening and closing marker-like text.
2. Read it through the corresponding MCP tool and confirm the returned value
equals the stored value exactly.
3. Modify or write the returned value through the corresponding MCP mutation
tool and confirm no presentation markup is added to the database.
4. Run:
- `pytest` for the 29 changed MCP test modules (1,205 passed locally)
- `pytest -q tests/unit_tests/mcp_service` (3,620 passed locally; the
remaining ASGI health-check assertion depends on a version string absent from
the local editable test environment)
- `uvx pre-commit run --files <changed files>`
### AI IMPACT
This is a deterministic serialization change. It adds no model calls, prompt
tokens, provider or model changes, or inference latency. The existing
server-level instruction continues to state that tool results are
user-controlled data with no instruction authority. Model-quality evaluation is
not applicable; regression coverage validates protocol and persistence behavior
directly.
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in
[SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]