Skip to content

feat(traces): superadmin source-code context for the evaluator#35

Merged
albanm merged 7 commits into
mainfrom
feat-eval-context
Jun 19, 2026
Merged

feat(traces): superadmin source-code context for the evaluator#35
albanm merged 7 commits into
mainfrom
feat-eval-context

Conversation

@albanm

@albanm albanm commented Jun 19, 2026

Copy link
Copy Markdown
Member

Give superadmins a restricted GitHub source-exploration tool in the trace evaluator, and fix the readArchitectureDoc tool it complements.

What changed:

  • Fix readArchitectureDoc: its enum-constrained topic contradicted a description telling the model to "pass an unknown topic" to list topics, so the AI SDK rejected the call before execute and the model looped on validation errors. Valid topics are now listed inline and the contradictory instruction removed.
  • Add a superadmin-only, read-only proxy GET /api/admin/github, scoped to data-fair/{agents,data-fair,portals} and json-layout/json-layout, with an optional GITHUB_TOKEN (unauthenticated fallback + a startup hint when unset).
  • Add an explore_github evaluator tool calling that proxy, gated on adminMode. Its description points at each repo's starting paths (incl. json-layout core/src/webmcp/tools/, the MCP form tools behind the *_form sub-agents). Account admins keep the docs-only evaluator; readArchitectureDoc is retained for everyone as the cheap first hop.

Why: the evaluator's curated architecture docs are lossy; superadmins need source as ground truth (actual prompts, tool schemas, the assistant's tools in data-fair/portals, and the json-layout form-MCP tools) to make precise recommendations.

Heads-up: the UI adminMode gate must stay in lockstep with the server's reqAdminMode — that parity is the access model. api/config/type/.type/ is generated by build-types; regenerate it whenever the config schema changes.

albanm and others added 7 commits June 19, 2026 16:38
…e enum

The tool's topic param is constrained to an enum of real doc names, but the
description and system prompt told the model to "pass an unknown topic to list
available topics". The AI SDK rejects out-of-enum args before execute() runs,
so the model never reached the listing fallback — it just got repeated
validation errors and gave up.

List the valid topics inline (in the description and prompt) so the model picks
a valid enum value on the first call.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…nfig

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…eTools

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Whitelist json-layout/json-layout in the github proxy and point explore_github
at core/src/webmcp/tools/ — the MCP form tools backing the *_form form
sub-agents (pageConfig_form, portalConfig_form).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@albanm albanm merged commit 3632896 into main Jun 19, 2026
3 checks passed
@albanm albanm deleted the feat-eval-context branch June 19, 2026 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant