Skip to content

[Follow-up] Implement an evidence adapter function integrated (PR #2757) #2761

Description

@stranske

Why

PR #2757 established the read-only consumer-sync shadow handoff, but the current main runtime rail still needs one executable path for strict evidence ingestion, idempotency, safety controls, and machine-readable reporting. The current source of truth is scripts/orchestrator_runtime/; the former src/consumer_sync/* plan was never created and must not be used as a phantom target.

Scope

Extend the existing orchestrator runtime rail and its tests. Keep all consumer-sync effects read-only until the existing promotion policy is satisfied.

Non-Goals

Do not create a second capability ledger, accept raw prompt text as evidence, or enable consumer writes. Scaffold-only modules without executable tests and deliberate-break evidence do not count as completion.

Tasks

  • Extend scripts/orchestrator_runtime/evidence_schema.py and scripts/orchestrator_runtime/completion_event_adapter.py to parse strict consumer-sync plan evidence and reject prose, malformed payloads, spoofed capability IDs, oversized refs, and missing provenance before state mutation.
  • Extend scripts/orchestrator_runtime/capability_lifecycle.py with stable evidence identity, ledger-backed duplicate replay, counterexample preservation, and candidate retirement state.
  • Extend scripts/orchestrator_runtime/runner_effect_bridge.py with read-only effect allowlists, TTL checks, kill-switch termination, and explicit blocked-reason output.
  • Add scripts/orchestrator_runtime/consumer_sync_report.py and wire it to the existing runtime ledger so every candidate is classified as no-data, healthy-shadow-evidence, or failed-evidence-ingestion.
  • Add validation, replay, safety, reporting, and retirement coverage in tests/orchestrator_runtime/test_completion_event_adapter.py and new tests/orchestrator_runtime/test_consumer_sync_runtime.py fixtures.

Acceptance Criteria

  • python -m pytest tests/orchestrator_runtime/test_completion_event_adapter.py tests/orchestrator_runtime/test_consumer_sync_runtime.py -q passes with non-zero collection.
  • Invalid or replayed evidence produces no additional capability mutation or effect application, and accepted counterexamples remain queryable across process boundaries.
  • Shadow reporting returns exactly one of the three named evidence states and promotion remains blocked when rollback, TTL, harm, volume, or human-attention policy gates fail.
  • Deliberate-break gate: bypass the duplicate-evidence short circuit in scripts/orchestrator_runtime/capability_lifecycle.py; tests/orchestrator_runtime/test_consumer_sync_runtime.py::test_duplicate_plan_reuses_ledger_result must fail, then restore the guard.

Implementation Notes

PR #2757 and issue #2753 are the shadow-handoff predecessor. Reuse the versioned runtime rail added under scripts/orchestrator_runtime/ and preserve the source-first Workflows ownership boundary.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions