Skip to content

Add v2 artifact metadata schema#36

Merged
Pigbibi merged 2 commits into
mainfrom
codex/slice-a-artifact-metadata
Jul 13, 2026
Merged

Add v2 artifact metadata schema#36
Pigbibi merged 2 commits into
mainfrom
codex/slice-a-artifact-metadata

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • accept signal schema v2 with required model_version and scoring_version
  • keep schema v1 signals readable with unchanged default validator behavior
  • emit versioned metadata and expiry for generated theme momentum snapshots

Validation

  • python3 -m pytest -q (42 passed)
  • python3 scripts/validate_latest_signal.py examples/latest_signal.example.json
  • git diff --check

Research-only scope; no execution, portfolio, account, or production dependency changes.

Co-Authored-By: Codex <noreply@openai.com>
@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

🤖 Codex PR Review

Merge allowed: blocking findings were cleared by independent Codex arbitration

⚖️ Codex Review Arbitration

clear: The prior blocker is demonstrably fixed by the cumulative diff. src/research_signal_context_pipelines/theme_momentum.py still emits schema v2, but the PR now adds a public theme-momentum compatibility validator, validate_theme_momentum_snapshot(), that explicitly accepts both schema_version "1" and "2", requires the new metadata only for v2, and is re-exported from src/research_signal_context_pipelines/__init__.py. The contract is then exercised in tests/test_theme_momentum.py, which validates a newly built v2 snapshot and a legacy v1 snapshot derived from it after removing expires_at, model_version, and scoring_version. That directly disproves the earlier claim that there were no accompanying reader/validator updates or compatibility tests for theme-momentum artifacts.

ℹ️ Other Findings

1. 🟡 [MEDIUM] Logic in src/research_signal_context_pipelines/theme_momentum.py

validate_theme_momentum_snapshot() only checks that mode and artifact_type keys exist; it never verifies that they are the expected theme momentum values. A different artifact payload with those fields present can therefore pass validation and be misclassified as a valid theme momentum snapshot, leading downstream readers to consume incompatible data. (line 273)

Suggestion: Validate mode == "theme_momentum_snapshot" and artifact_type == THEME_MOMENTUM_ARTIFACT_TYPE inside validate_theme_momentum_snapshot() before accepting the payload.

2. 🟡 [MEDIUM] Reliability in src/research_signal_context_pipelines/theme_momentum.py

generated_at is accepted as any non-empty string instead of a real ISO-8601 timestamp. This means corrupted metadata such as "generated_at": "yesterday" will be treated as valid, defeating the validator's role as a guardrail for stale/invalid snapshot metadata. (line 282)

Suggestion: Parse generated_at with the same datetime validation used elsewhere (for example, the ISO datetime helper used by validate_signal) and reject malformed timestamps.


Review by Codex PR Review bot • PR

Co-Authored-By: Codex <noreply@openai.com>
@Pigbibi
Pigbibi merged commit 353a5d1 into main Jul 13, 2026
3 checks passed
@Pigbibi
Pigbibi deleted the codex/slice-a-artifact-metadata branch July 13, 2026 08:47
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.

1 participant