Skip to content

Conversation

@AlexanderOnischenko
Copy link
Owner

Motivation

  • Migrate tracer events to an observed-first model where runtime logs carry only observed/observed_error and dependencies for deterministic replay bundles rather than embedding expected outcomes.
  • Provide self-contained, portable case bundles and a compact runtime API to load/run those bundles for deterministic testing and local regeneration of fixtures.
  • Exclude large auto-generated case bundle fixtures from the repository and replace them with placeholders so bundles are regenerated locally as needed.

Description

  • Replace the old replay_point API with log_replay_case(...) (v2) that validates inputs, enforces XOR of observed/observed_error, and requires structured requires entries in src/fetchgraph/replay/log.py.
  • Rework exporter logic in src/fetchgraph/replay/export.py to select replay_case events, produce .case.json bundle files via write_case_bundle, resolve requires with collect_requires, copy resource files with copy_resource_files, and add multi-export helper export_replay_case_bundles.
  • Add runtime helpers load_case_bundle and run_case and ReplayContext enhancements in src/fetchgraph/replay/runtime.py to load bundles and resolve resource paths for handlers.
  • Introduce a small tracer facade package (src/fetchgraph/tracer/*) with handler hub, CLI (fetchgraph-tracer entry point), validator validate_plan_normalize_spec_v1, and Makefile/pyproject.toml wiring (fetchgraph-tracer script and tracer-export Make target).
  • Update the user-facing CLI in src/fetchgraph/cli.py and Makefile to target tests/fixtures/replay_cases and the new export-case-bundle semantics.
  • Update tests in tests/test_replay_fixtures.py to use .case.json bundles: fixed cases assert exact expected equality and known_bad cases validate that the handler output fails the validator.
  • Remove large generated bundle fixtures and resource copies from tests/fixtures/replay_cases and add .gitkeep placeholders plus tests/fixtures/replay_cases/README.md documenting local regeneration.

Testing

  • No automated test run was executed as part of this change; pytest was not invoked in the rollout.
  • The test harness was updated: tests/test_replay_fixtures.py now targets tests/fixtures/replay_cases/*.case.json and distinguishes fixed vs known_bad flows but requires regenerated bundles to be present for full verification.
  • Fixture deletions were committed so repository contains placeholders and guidance (tests/fixtures/replay_cases/.gitkeep and README.md), and test runs will be skipped until bundles are recreated locally.

Codex Task

@AlexanderOnischenko
Copy link
Owner Author

@codex, please review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9d66581448

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 760 to 763
tx = _MoveTransaction(git_ops)
try:
tx.move(from_case, to_case)
if from_expected.exists():

Choose a reason for hiding this comment

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

P2 Badge Make overwrite actually replace existing targets

When fixture-demote runs with --overwrite, it skips the existence checks but still calls _GitOps.move, which uses git mv without -f. git mv -h states -f, --force is required to move/rename even if the target exists, so in the default git_mode=auto a tracked destination fixture will cause the demotion to fail exactly when overwrite is requested. Consider deleting the destination before moving or using git mv -f when overwrite is set.

Useful? React with 👍 / 👎.

@AlexanderOnischenko AlexanderOnischenko merged commit be0ea0f into feature/tracer Jan 26, 2026
@AlexanderOnischenko AlexanderOnischenko deleted the codex/implement-tracer-v2-features-and-export branch January 26, 2026 04:28
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.

2 participants