MVP #3: TrendAlert -> provenance investigation request bridge #10

Merged
chrysolambda-ops merged 3 commits from mvp-3-trendalert-bridge into main 2026-04-01 08:00:10 +00:00
chrysolambda-ops commented 2026-04-01 06:41:06 +00:00 (Migrated from github.com)

Closes #3

Summary

  • add stdlib-only adapter at tools/common/trendalert_investigation_adapter.py
  • transform TrendAlert payloads into retrieval/provenance request payloads
  • route queryType via nextStep.workflow
  • preserve evidence URLs/snippets in inputs
  • apply retrieval load-discipline defaults (cache, concurrency caps, retry/backoff, retry-after, robots)
  • harden fixture-driven tests at tools/common/tests/test_trendalert_investigation_adapter.py

Adversarial-fix wave (PR #10 blockers)

  • guarded nextStep parsing so malformed shapes/types no longer raise attribute errors
  • adapter now deterministically returns no-op (None) for malformed nextStep / workflow values instead of crashing
  • adapter now returns deterministic no-op (None) when mapped workflows produce empty inputs (prevents empty actionable requests)
  • added regression tests:
    • malformed nextStep type returns no-op
    • mapped workflow with empty inputs returns no-op

MVP #3 test-case checklist

  • MVP3-TC01 (P0): workflow routing maps nextStep.workflow to correct queryType (claim-tracing, archive-recovery, provenance-analysis, manual-review, none)
  • MVP3-TC02 (P0): workflow=none returns no request (None), not malformed payload
  • MVP3-TC03 (P0): evidence URLs/snippets preserved into request inputs[]
  • MVP3-TC04 (P0): retrieval load-discipline defaults present (cacheMode, concurrency cap, retry/backoff, retry-after, robots)
  • MVP3-TC05 (P0): fixtures 001/002/003 route to expected outcomes
  • MVP3-TC08 (P1): idempotent transform (same alert => identical request payload)
  • MVP3-TC09 (P1): malformed nextStep type deterministically returns no-op (None)
  • MVP3-TC10 (P2): sparse but valid alert transforms successfully with defaults
  • MVP3-TC11 (P1): mapped workflow with empty inputs deterministically returns no-op (None)

Test evidence

Command:

python3 -m unittest discover -s tools/common/tests -v

Output summary:

  • Ran 9 tests
  • OK (0 failures, 0 errors)

Imported from GitHub issue/PR. Originally posted by chrysolambda-ops on 2026-04-01T06:41:06Z.

Closes #3 ## Summary - add stdlib-only adapter at `tools/common/trendalert_investigation_adapter.py` - transform `TrendAlert` payloads into retrieval/provenance request payloads - route `queryType` via `nextStep.workflow` - preserve evidence URLs/snippets in `inputs` - apply retrieval load-discipline defaults (cache, concurrency caps, retry/backoff, retry-after, robots) - harden fixture-driven tests at `tools/common/tests/test_trendalert_investigation_adapter.py` ## Adversarial-fix wave (PR #10 blockers) - guarded `nextStep` parsing so malformed shapes/types no longer raise attribute errors - adapter now deterministically returns no-op (`None`) for malformed `nextStep` / workflow values instead of crashing - adapter now returns deterministic no-op (`None`) when mapped workflows produce empty `inputs` (prevents empty actionable requests) - added regression tests: - malformed `nextStep` type returns no-op - mapped workflow with empty inputs returns no-op ## MVP #3 test-case checklist - [x] **MVP3-TC01 (P0):** workflow routing maps `nextStep.workflow` to correct `queryType` (`claim-tracing`, `archive-recovery`, `provenance-analysis`, `manual-review`, `none`) - [x] **MVP3-TC02 (P0):** `workflow=none` returns no request (`None`), not malformed payload - [x] **MVP3-TC03 (P0):** evidence URLs/snippets preserved into request `inputs[]` - [x] **MVP3-TC04 (P0):** retrieval load-discipline defaults present (`cacheMode`, concurrency cap, retry/backoff, retry-after, robots) - [x] **MVP3-TC05 (P0):** fixtures `001/002/003` route to expected outcomes - [x] **MVP3-TC08 (P1):** idempotent transform (same alert => identical request payload) - [x] **MVP3-TC09 (P1):** malformed `nextStep` type deterministically returns no-op (`None`) - [x] **MVP3-TC10 (P2):** sparse but valid alert transforms successfully with defaults - [x] **MVP3-TC11 (P1):** mapped workflow with empty inputs deterministically returns no-op (`None`) ## Test evidence Command: ```bash python3 -m unittest discover -s tools/common/tests -v ``` Output summary: - Ran 9 tests - OK (0 failures, 0 errors) --- Imported from [GitHub issue/PR](https://github.com/Kyvero-Vexus/truth-kit/pull/10). Originally posted by [chrysolambda-ops](https://github.com/chrysolambda-ops) on 2026-04-01T06:41:06Z.
Sign in to join this conversation.
No description provided.