Skip to content

Phase 10: provider-neutral generic adapter interface - #9

Merged
EmergentMonk merged 25 commits into
mainfrom
phase-10/generic-adapters
Sep 29, 2026
Merged

EmergentMonk merged 25 commits into
mainfrom
phase-10/generic-adapters

Conversation

@EmergentMonk

@EmergentMonk EmergentMonk commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Summary

Implements Phase 10 — Generic Adapter Interface.

  • adds a provider-neutral AdapterContract and shared observation builder
  • adds one persistence path through the existing store, custody, and verifier modules
  • adds GenericHTTPAdapter for ordinary HTTP/HTTPS request-response boundaries
  • adds ProcessAdapter for local argv/stdin/stdout/stderr process boundaries
  • preserves provider/transport metadata as DECLARED artifacts under explicit extension namespaces
  • preserves exact directly captured bytes as OBSERVED evidence
  • makes failure observations persistable with COLLECTION_FAILED
  • excludes HTTP header values and inherited process environments from ordinary evidence payloads
  • adds executed success/failure tests for both structurally different adapters
  • adds a dedicated adapters.yml CI lane
  • documents the Phase 10 contract in ADAPTERS.md, ARCHITECTURE.md, README, and ROADMAP

Exit-gate demonstration

local HTTP server
      +
local child process
      ↓
same AdapterContract translation layer
      ↓
same provenance-core schema
      ↓
same LocalEvidenceStore / LocalCustodyLedger
      ↓
independent verification

No provider-specific changes are made to provenance-core.

Summary by Sourcery

Establish a provider-neutral adapter layer for HTTP and local process boundaries while reusing the existing core schema, persistence pipeline, and verification guarantees.

New Features:

  • Add a provider-neutral adapter contract with shared observation translation for generic integrations.
  • Add executable HTTP/HTTPS and local process adapters that capture request/response and argv/stdin/stdout/stderr boundaries.
  • Support persistence and independent verification of successful and failed adapter observations through the existing evidence, custody, and verification modules.

Enhancements:

  • Classify captured evidence as OBSERVED, DECLARED, or DERIVED while isolating transport metadata in namespaced artifacts.
  • Preserve failure observations with COLLECTION_FAILED status and apply explicit credential and runtime-environment retention boundaries.

CI:

  • Add a dedicated GitHub Actions lane for generic adapter tests.

Documentation:

  • Document the Phase 10 adapter contract, evidence boundaries, failure semantics, and roadmap status.

Tests:

  • Add executed success, failure, truncation, metadata-isolation, and contract-validation tests for both reference adapters.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @EmergentMonk, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 4 days and 8 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-09-29T11:49:41.176347Z 479d8cb PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@sourcery-ai

sourcery-ai Bot commented Sep 29, 2026

Copy link
Copy Markdown

Reviewer's Guide

Phase 10 adds a provider-neutral adapter translation layer with shared persistence, implements HTTP and local-process reference adapters, preserves captured evidence while isolating runtime metadata, supports persistable failures, and validates the design with integration tests and a dedicated CI lane.

Sequence diagram for successful generic adapter observation

sequenceDiagram
    participant Adapter as GenericHTTPAdapter or ProcessAdapter
    participant Translator as build_observation
    participant Store as LocalEvidenceStore
    participant Custody as LocalCustodyLedger
    participant Verify as Independent verifier

    Adapter->>Translator: observe()
    Translator-->>Adapter: AdapterObservation
    Adapter->>Store: persist_observation(observation)
    Store->>Store: put_artifact()
    Store->>Store: put_event()
    Store->>Custody: append()
    Store->>Store: finalize()
    Custody->>Verify: verify()
    Verify-->>Adapter: verified persisted observation
Loading

File-Level Changes

Change Details Files
Introduces a provider-neutral adapter contract and shared translation/persistence pipeline.
  • Defines contract, captured artifacts, failures, and observations.
  • Maps exact captures to OBSERVED events and metadata/extensions to DECLARED artifacts.
  • Persists artifacts, events, custody records, and verified snapshots through existing modules.
  • Represents failed operations with COLLECTION_FAILED while preserving captured evidence.
provenance_adapters/base.py
provenance_adapters/__init__.py
Adds generic HTTP and local process reference adapters with explicit evidence and privacy boundaries.
  • Captures HTTP descriptors/bodies and response bodies or prefixes without retaining header values; rejects redirects and enforces limits.
  • Executes argv directly with shell disabled, captures stdin/stdout/stderr, and excludes inherited environments.
  • Raises observation-carrying errors for transport, status, timeout, launch, non-zero exit, and capture-limit failures.
provenance_adapters/http.py
provenance_adapters/process.py
Adds executed integration coverage for both adapter shapes and failure persistence.
  • Exercises a local HTTP server and child process through the shared core schema and persistence path.
  • Verifies independent store/custody integrity and privacy exclusions.
  • Tests HTTP failure, process non-zero exit, and contract namespace validation.
tests/test_generic_adapters.py
Documents Phase 10 behavior and adds a focused CI lane.
  • Documents the contract, evidence classification, failure semantics, and credential boundaries.
  • Marks the roadmap phase implemented and updates architecture/README references.
  • Runs the generic adapter test module in a dedicated GitHub Actions workflow.
ADAPTERS.md
ARCHITECTURE.md
README.md
ROADMAP.md
.github/workflows/adapters.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown
Member Author

@copilot Please Review this exact SHA 0dc6337 against the existing contract. Report only actionable correctness defects, with a minimal reproduction, expected versus actual behavior, and affected lines. State whether each reproduction was executed or statically inferred. Don’t repeat fixed findings without a new failing case. Keep architectural suggestions separate and non-blocking.

Copilot AI commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

@copilot Please Review this exact SHA 0dc6337 against the existing contract. Report only actionable correctness defects, with a minimal reproduction, expected versus a...

Reviewed 0dc63371b37e5e18ae705a659bf4a330bcb0a87a against the adapter contract. No actionable correctness defects found. The targeted reproduction (python -m unittest discover -s tests -p 'test_generic_adapters.py' -v) was executed: all 6 tests pass, including the truncated-response assertion that the retained abc bytes are labeled response_prefix. The adapters workflow for this SHA also passed. The preceding SHA's failed run was the same test expecting response_body; this commit resolves that mismatch.

@EmergentMonk
EmergentMonk merged commit 7ed61a9 into main Sep 29, 2026
11 checks passed
@EmergentMonk
EmergentMonk deleted the phase-10/generic-adapters branch September 29, 2026 11:57
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.

2 participants