Skip to content

Add hc_agent MCP run gateway and storage helpers - #10

Draft
binrogithub wants to merge 1 commit into
masterfrom
codex/add-gateway-module-to-implement-hc_run-functions
Draft

Add hc_agent MCP run gateway and storage helpers#10
binrogithub wants to merge 1 commit into
masterfrom
codex/add-gateway-module-to-implement-hc_run-functions

Conversation

@binrogithub

Copy link
Copy Markdown
Owner

Motivation

  • Provide a simple MCP gateway to persist HC agent runs and return storage metadata for downstream consumption.
  • Ensure run artifacts are consistently written to a runs/<run_id>/ layout with predictable filenames for preview, apply, evidence, run, and report content.
  • Normalize and shrink payloads before persisting to avoid non-serializable values and oversized evidence blobs.

Description

  • Add package scaffolding hc_agent/ and hc_agent/mcp/ and introduce hc_agent/mcp/run_gateway.py which defines RunRequest, RunResult, hc_run, and hc_run_demo helper functions.
  • Add hc_agent/mcp/storage.py implementing sanitize_obj(...) to convert common Python types (dataclasses, Paths, Enums, bytes, collections) to JSON-serializable values.
  • Implement build_min_evidence(...) to trim evidence dictionaries to a preferred set of keys when available and normalize lists/iterables.
  • Implement init_run_dir(...) and write_run_artifacts(...) to create runs/<run_id>/ and write preview.json, apply.json, evidence.json, run.json, and report.md while applying sanitize_obj and build_min_evidence where appropriate.

Testing

  • No automated tests were executed for this change.

Codex Task

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