MG ContextOps DataHub Agent

MG ContextOps DataHub Agent is a public TypeScript reference implementation for governed metadata-aware development. It turns DataHub metadata evidence into normalized context records and then produces deterministic, bounded WorkPackets with explicit authority, scope, validation requirements, unknowns, provenance, and mandatory human review.

Problem

AI coding and data agents can fail when context is stale, conflicting, too broad, untrusted, or detached from decision authority. Metadata is useful evidence, but evidence should not automatically become permission to edit production systems.

This project demonstrates a safer pattern:

  • retrieve or load DataHub metadata evidence;
  • normalize it into source-neutral governed context records;
  • preserve provenance, attribution, authority state, and unknowns;
  • fail closed when required context is missing or non-authoritative;
  • generate deterministic bounded WorkPackets with allowed scope, blocked scope, validation, and proof requirements;
  • require human approval before downstream implementation.

DataHub usage

The default judge path is deterministic and zero-secret using committed synthetic / recorded DataHub-shaped metadata.

The public repository also includes a committed post-validation Mode B proof classified VERIFIED_LOCAL_ONLY. Mode B connected to local DataHub OSS through the official mcp-server-datahub==0.6.0 HTTP server, discovered the live MCP tool inventory, selected a server-annotated read-only tool, and executed exactly one attributable metadata retrieval. The verified local-OSS run was tokenless, with local_token_present=false; downstream consumer authority remains PROPOSED and human approval remains required.

This does not establish production activation, managed DataHub Cloud OAuth, DataHub writes, autonomous implementation authority, or consumer eligibility beyond PROPOSED.

Judge path

Mode A is the default reproducible path:

npm ci
./scripts/datahub-judge-preflight.sh
./scripts/datahub-judge-demo.sh --mode=fixture
jq . examples/official-mcp-proof/read-only-retrieval-summary.json

Expected result: deterministic PASS, zero secrets, human_approval_required=true, and no live-runtime claim.

Mode B is optional and fail-closed by default:

env -u DATAHUB_LOCAL_MCP_ALLOW ./scripts/datahub-judge-demo.sh --mode=local-oss

Expected result: exit code 3, BLOCKED, no MCP request.

Committed local-only live proof:

examples/official-mcp-proof/local-oss-live-readonly-validation-summary.json

Sample generated development artifact

Judges can inspect a deterministic generated development example here:

https://github.com/themg-max/mg-mcp-datahub-agent/tree/main/examples/showcase-ecommerce/customer-email-normalization

The artifact contains generated SQL, schema material, validation SQL, and generation proof. It is derived from committed synthetic fixture context, not from the PowerBI entity used in the live Mode B proof. That distinction is deliberate: provenance remains explicit rather than being implied.

The generated artifact is non-destructive, validated offline, and remains a proposal requiring human review before any downstream implementation.

What it produces

A deterministic generated WorkPacket is committed at:

examples/generated-work-packet/work-packet.json

The synthetic DataHub-shaped input fixture is:

fixtures/datahub-context.json

The generated packet is a proposal only. It never grants merge, deployment, IAM, production-write, or autonomous execution authority.

Architecture

  • DataHubClient — read-only transport boundary.
  • DataHubContextAdapter — defensive normalization of DataHub-shaped records.
  • NormalizedContextRecord — source-neutral governed context with provenance and authority state.
  • WorkPacket — deterministic proposal with objective, allowed scope, blocked scope, validation, unknowns, and mandatory human approval.

Competition work and pre-existing work

The broader MG MCP governance architecture and earlier fixture/bootstrap work pre-existed this hackathon, including authority states, bounded work packets, human-review requirements, fail-closed unknowns, lane/worktree discipline, and early fixture-first DataHub adapter work.

Competition-period work extended that baseline with:

  • an official DataHub MCP recorded-response read-only contract harness;
  • live-local official MCP read-only validation against DataHub OSS;
  • tokenless local-OSS proof-truthfulness hardening;
  • deterministic provenance / authority contracts;
  • focused tests and proof summaries;
  • deterministic judge reproducibility tooling;
  • fail-closed optional local mode;
  • public competition evidence packaging and sample generated development outputs.

The submission does not claim that the entire MG MCP platform was created during the competition.

Validation and security

The public package is Apache-2.0 licensed and includes CI, tests, setup instructions, sample outputs, and public-safe proof summaries.

Final public-main validation includes 48/48 tests passing, deterministic Mode A PASS, committed Mode B VERIFIED_LOCAL_ONLY proof, and offline SQLite validation of the generated development artifact.

Security boundaries:

  • no production DataHub credentials are required;
  • no customer or private organizational data is committed;
  • no DataHub write path is included;
  • no autonomous GitHub merge/deploy/IAM path is included;
  • private MG MCP configuration and protected governance records remain outside the public repository;
  • human approval remains required.

Why it matters

Data and AI platform teams need agents that know not only what metadata says, but what that metadata is allowed to authorize. MG ContextOps DataHub Agent demonstrates a practical bridge from DataHub context to bounded development work that is attributable, deterministic, fail-closed, and reviewable.

Challenge

Metadata-Aware Code Generation & Development

DataHub technologies

  • DataHub OSS / Core Platform
  • DataHub MCP Server

Public repository

https://github.com/themg-max/mg-mcp-datahub-agent

Current limitations

  • default judge Mode A is fixture / recorded-response only;
  • local official MCP proof is VERIFIED_LOCAL_ONLY, not production activation;
  • managed DataHub Cloud OAuth is not established;
  • no DataHub writes are claimed or demonstrated;
  • freshness remains UNKNOWN unless governed by an approved policy window;
  • downstream consumer eligibility remains PROPOSED and requires human approval.

Built With

Share this project:

Updates