Skip to content

Add minimal evidence filtering and persist minimal evidence.json - #22

Draft
binrogithub wants to merge 1 commit into
masterfrom
codex/create-build_min_evidence-function
Draft

Add minimal evidence filtering and persist minimal evidence.json#22
binrogithub wants to merge 1 commit into
masterfrom
codex/create-build_min_evidence-function

Conversation

@binrogithub

Copy link
Copy Markdown
Owner

Motivation

  • Keep persisted evidence payloads small and predictable by filtering to a whitelisted set of keys before writing to disk.
  • Prevent accidental leakage of extra metadata when gateway handlers write evidence.json.

Description

  • Add hc_agent/core/evidence.py with build_min_evidence(evidence) which returns a dict containing only the allowed keys: service, endpoint, method, path, status, request_id, duration_ms, and signature_sha256.
  • Add gateway/handlers.py with write_evidence_json(evidence, output_dir) which calls build_min_evidence() and writes the minimal payload to evidence.json using pretty-printed JSON.
  • Add package initializer files hc_agent/__init__.py and hc_agent/core/__init__.py to expose the new module.

Testing

  • No automated tests were run 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