Skip to content

Add hc_agent contracts module (RunnerEnvelope, RunSummary, StructuredError) - #26

Draft
binrogithub wants to merge 1 commit into
masterfrom
codex/add-canonical-contracts-module
Draft

Add hc_agent contracts module (RunnerEnvelope, RunSummary, StructuredError)#26
binrogithub wants to merge 1 commit into
masterfrom
codex/add-canonical-contracts-module

Conversation

@binrogithub

Copy link
Copy Markdown
Owner

Motivation

  • Centralize canonical runner payload contracts and a structured error helper to avoid duplication across the codebase and to guarantee stable JSON field names for external consumers.
  • Provide typed definitions for envelopes and summaries to improve IDE/type-checking ergonomics and make payload shapes explicit.

Description

  • Added a new hc_agent package with hc_agent/core/contracts.py that defines StructuredError, build_structured_error, RunSummary, and RunnerEnvelope as TypedDict types and helper function with literal JSON field names preserved (type, message, details, status, started_at, finished_at, duration_ms, metadata, run_id, summary, error).
  • Exported the canonical contracts from hc_agent/core/__init__.py (exports: RunSummary, RunnerEnvelope, StructuredError, build_structured_error).
  • Added top-level hc_agent/__init__.py to mark the new package.
  • This PR only introduces the canonical contracts module; other modules were not modified in this change set and will need to be updated in follow-up changes to import from hc_agent.core and remove local duplicates.

Testing

  • No automated tests were executed for these changes.

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