Skip to content

ci(browser): MCP connection drift-check workflow - #4

Merged
simo787c merged 3 commits into
mainfrom
feat/agentbase-browser-drift-check
Jul 27, 2026
Merged

ci(browser): MCP connection drift-check workflow#4
simo787c merged 3 commits into
mainfrom
feat/agentbase-browser-drift-check

Conversation

@simo787c

Copy link
Copy Markdown
Contributor

What

PR 4 of 4 for agentbase-browser. Adds an automated drift check for the two rot-prone facts every browser pack depends on: the MCP endpoint host and its OAuth auth model. This drift is rare (~1 event/year) but silent and total — when the server moves or changes auth under a still repo, every packaged connector URL and skill instruction breaks at once.

Stacked on #3 (base = feat/agentbase-browser-ret-et-flow) — merge #1#2#3 first.

How it checks

scripts/check-mcp-drift.sh fetches the live RFC 9728 metadata at api.agentbase.dk/.well-known/oauth-protected-resource/mcp (root-mounted, unauthenticated) and asserts:

  1. Host reachable + HTTP 200.
  2. Advertised resource equals the canonical https://api.agentbase.dk/mcp the packs ship.
  3. OAuth still advertised (authorization_servers non-empty).
  4. The canonical URL is actually present in a manifest/skill (catches a silently-changed URL).
  5. No plugin.json points at the dead api.flows.syv.ai host or carries a static-token block (userConfig/headers/Authorization/Bearer).

The stale-host and token checks are scoped to plugin.json on purpose: skill prose legitimately names the dead host as forbidden (kom-i-gang does), so a repo-wide scan would false-positive. The server's own bearer_methods_supported is a normal OAuth field and is not treated as drift.

When it runs

.github/workflows/mcp-drift-check.ymlpull_request, a weekly schedule (Mondays 06:17 UTC), and workflow_dispatch. On a non-PR failure it opens (or comments on an existing) "MCP connection drift detected" issue — because the failure that actually happens surfaces only in the cron run, where a red check alone goes unseen. On a PR the failing check is already visible to the author.

.gitattributes pins *.sh/*.yml to LF so CRLF can't break bash on the Linux runner.

Verification

  • Live endpoint confirmed: resource=https://api.agentbase.dk/mcp, one authorization server, HTTP 200.
  • Script passes bash -n and the repo-scan assertions against the current tree; jq assertions validated by hand against the live JSON (jq is preinstalled on ubuntu-latest).

To exercise the alarm path: push a branch that changes the canonical URL to a wrong host and confirm the check fails (and, on a dispatch run, opens the issue).

🤖 Generated with Claude Code

https://claude.ai/code/session_01SYvwyQEa9xsKzsQTwpBuhp

simo787c and others added 3 commits July 27, 2026 10:53
The build-from-scratch skill for agentbase-browser — the intake front half
the MCP's guidance.py (mechanics canon) deliberately lacks.

- skills/byg-et-flow/SKILL.md — interview → confirm the plan in chat → build
  → run on a real sample → iterate. Enforces a five-point intake bar before
  building (process+rules, variants, a real sample input, output+audience,
  Human-in-the-Loop placement) and the chat-checkpoint discipline (the canvas
  is invisible in another tab). Hands off to the MCP mechanics: read
  guide://flow-building, confirm handles with get_node_type, lay the whole
  graph in one set_flow rather than clobber-prone incremental edits.
- skills/byg-et-flow/references/flow-eksempler.md — four Danish flow shapes
  distilled from guidance.py EXAMPLES + docs relationships.md (document →
  structured data → spreadsheet; sort a document pile; loop over a list;
  conditional branching), each pointing at the live example:// resource and
  get_node_type for exact handles, so tool-schema drift can't reach the skill.

RED/GREEN tested: without the skill a fresh agent gathered only a partial
intake (missed variants and the approval step); with it, the full five-point
intake plus confirm-in-chat/run-on-sample loop.

Co-Authored-By: Claude <noreply@anthropic.com> via Dash <dash@syv.ai>
Claude-Session: https://claude.ai/code/session_01SYvwyQEa9xsKzsQTwpBuhp
The debug skill for agentbase-browser — reproduce, localise, smallest fix,
re-run. Mirrors the MCP's revise_flow prompt and folds in the concrete
failure catalogue from guidance.py + flow-agent/src/prompts.ts.

- skills/ret-et-flow/SKILL.md — the fault-finding loop (reproduce on a real
  failing input → localise the exact node:handle with get_execution → make the
  smallest change → re-run on the same input) plus a symptom→cause→fix table of
  the AgentBase-specific traps a generic agent won't know: empty output after a
  Hvis/ellers (config missing true_output/false_output → set both, route both
  branches to one shared field); raw {placeholder} (conditional branches merged
  into one template); dataurl→text needs Dokument-OCR not a code node; a list
  fed to a single-item node needs a Løkke; loop-control nodes must sit inside
  the loop; missing response_schema. Names no tool schemas — get_node_type and
  guide://flow-building stay the live source, so drift can't reach it.

RED/GREEN tested on an empty-if-else-output scenario: both baseline and
skilled agents debugged rather than rebuilt, but the skill made the agent lead
with the exact known root cause and its precise structural fix instead of a
diffuse list of guesses.

Co-Authored-By: Claude <noreply@anthropic.com> via Dash <dash@syv.ai>
Claude-Session: https://claude.ai/code/session_01SYvwyQEa9xsKzsQTwpBuhp
Guards the two rot-prone facts the browser packs depend on — the MCP endpoint
host and its OAuth auth model. Real drift here is ~1 event/year, always silent
and total: the server moves or changes auth under a still repo and every
packaged connector URL / skill instruction breaks at once.

- scripts/check-mcp-drift.sh — fetches the live RFC 9728 metadata at
  api.agentbase.dk/.well-known/oauth-protected-resource/mcp and asserts: host
  reachable + HTTP 200; advertised `resource` equals the canonical
  https://api.agentbase.dk/mcp the packs ship; OAuth still advertised
  (authorization_servers non-empty); the canonical URL is actually present in a
  manifest/skill; and no plugin.json points at the dead host or carries a
  static-token block (userConfig/headers/Authorization/Bearer). The stale-host
  and token checks are scoped to plugin.json — skill prose may legitimately name
  the dead host as forbidden, so a repo-wide scan would false-positive.
- .github/workflows/mcp-drift-check.yml — runs on pull_request, a weekly cron,
  and workflow_dispatch. On a non-PR failure it opens (or comments on an
  existing) "MCP connection drift detected" issue, because the failure that
  actually happens — the server moving under a still repo — surfaces only in the
  cron run, where a red check alone goes unseen.
- .gitattributes — pin *.sh / *.yml to LF so CRLF can't break bash on the runner.

Verified: live endpoint returns resource=https://api.agentbase.dk/mcp with one
authorization server; script passes syntax + repo-scan checks against the
current tree.

Co-Authored-By: Claude <noreply@anthropic.com> via Dash <dash@syv.ai>
Claude-Session: https://claude.ai/code/session_01SYvwyQEa9xsKzsQTwpBuhp
@simo787c
simo787c marked this pull request as ready for review July 27, 2026 09:45
@simo787c
simo787c changed the base branch from feat/agentbase-browser-ret-et-flow to main July 27, 2026 09:47
@simo787c
simo787c merged commit c87c8a8 into main Jul 27, 2026
1 check passed
@simo787c
simo787c deleted the feat/agentbase-browser-drift-check branch July 27, 2026 09:48
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