Skip to content

[task] Preserve document metadata in ingestion pipeline tests #77

Open

Description

@AlexanderGardiner

Checks

  • I searched open and closed issues and pull requests and did not find a duplicate.

Area

Tests

Goal

Extend ingestion pipeline test coverage so metadata produced by extractors is verified after content is stored in the memory store.

Anchor has tests for individual extractor behavior and tests for basic ingestion. However, the pipeline-level tests mostly verify that content can be ingested and queried. They do not yet prove that document metadata survives the full path from extractor output to stored chunk metadata.

As file ingestion becomes a public workflow, this metadata path matters for debugging retrieval results and for downstream UI/inspection features.

This issue should be treated as a test-focused follow-up to #75 and #76.

Suggested file locations

  • tests/fixtures/ingestion/
  • tests/integration/test_ingestion_pipeline.py
  • tests/unit_harness.py

Scope

Add focused tests for metadata preservation across the extraction-to-ingestion boundary.

The tests should cover:

  • Plain text extractor metadata survives ingestion.
  • Markdown extractor metadata survives ingestion.
  • Stored metadata includes source.
  • Stored metadata includes source_format.
  • Stored metadata includes character offsets when the extractor provides them.
  • Stored metadata includes heading metadata for Markdown sections where applicable.
  • Existing ingestion metadata such as questions and timestamp is still present.

Out of scope

  • Do not change extractor behavior unless needed to make an existing documented field flow through.
  • Do not add new metadata fields.
  • Do not add PDF, Word, or source-code ingestion.
  • Do not add directory ingestion.
  • Do not introduce new dependencies.
  • Do not rewrite the ingestion pipeline.

Definition of done

  • Tests fail if extractor metadata is dropped before reaching MemoryStore.add.
  • Tests cover at least one .txt fixture and one .md fixture.
  • Tests cover Markdown with heading metadata.
  • Tests confirm generated ingestion fields still appear alongside document metadata.
  • The tests use deterministic/offline fixtures and do not require a live model.

Activity

  1. added
    help wantedMaintainers would welcome a community contribution on this work.
    area: testsAutomated tests and test infrastructure.
    kind: maintenanceRepository maintenance or infrastructure work.
    status: ready-for-workTriaged and ready for a contributor to claim.
    on Jul 7, 2026
  2. added
    needs: complianceThe author or reporter needs to fix template or policy gaps.
    and removed
    area: testsAutomated tests and test infrastructure.
    on Jul 7, 2026
  3. added
    area: testsAutomated tests and test infrastructure.
    and removed
    needs: complianceThe author or reporter needs to fix template or policy gaps.
    on Jul 7, 2026
  4. HarperZ9 commented on Jul 18, 2026

    @HarperZ9

    Hi Alexander, I can take a focused fixture-only pass if this is still open. Proposed boundary: one tiny .txt and one .md fixture with stable metadata, a recorder around MemoryStore.add, assertions for source, source_format, character offsets, Markdown headings, questions, and timestamp, plus a negative control that drops extractor metadata and proves the test fails.

    I would start from current main, make no extractor, API, or dependency changes, and run the repository's offline suite. I build provenance and replay tooling at Zentropy Labs, and I can attach an optional fair-source Gather and Forum field-preservation matrix as supplementary evidence, not a dependency or Anchor integration claim.

    Should the first contribution cover only metadata already emitted today, or also include a documented xfail for a field that is currently lost?

  5. AlexanderGardiner commented on Jul 18, 2026

    @AlexanderGardiner
    CollaboratorAuthor

    Hi, yes this is still open. Those sound like good starting assumptions, and yes xfail is appropriate. I'm not sure what you mean by Gather and Forum field-preservation matrix, but it is not needed currently.

  6. AlexanderGardiner commented on Jul 18, 2026

    @AlexanderGardiner
    CollaboratorAuthor

    Additionally please make sure to claim the issue if you begin work.

  7. github-actions commented on Aug 24, 2026

    @github-actions

    This issue has been quiet for a while. If it is still relevant, add context and it will stay open.

  8. HarperZ9 commented on Aug 28, 2026

    @HarperZ9

    /claim

  9. 1 remaining item

  10. github-actions commented on Aug 28, 2026

    @github-actions

    @HarperZ9 claimed this issue. Thanks for taking it on.

  11. added
    status: awaiting-claimer-responseWaiting for the claimer to confirm continued work before auto-unclaim.
    and removed
    status: staleAutomatically marked stale due to inactivity.
    on Aug 31, 2026
  12. github-actions commented on Sep 4, 2026

    @github-actions

    @HarperZ9 there has been no claimer activity for 7 days. Please reply within 24 hours if you're still working on this issue.

  13. HarperZ9 commented on Sep 4, 2026

    @HarperZ9

    Still working on this. I have rechecked the current issue and will keep the contribution to deterministic .txt/.md fixtures and focused metadata-preservation assertions across the extractor-to-MemoryStore.add boundary, including the agreed xfail where the existing field is currently lost. I will not change extractor behavior, APIs, dependencies, or the ingestion pipeline. I am starting from current main and will report back with the offline test results and PR.

  14. github-actions commented on Sep 12, 2026

    @github-actions

    @HarperZ9 there has been no claimer activity for 7 days. Please reply within 24 hours if you're still working on this issue.

  15. added
    status: ready-for-workTriaged and ready for a contributor to claim.
    and removed
    status: in-progressClaimed by a contributor and actively being worked.
    on Sep 14, 2026
  16. github-actions commented on Sep 14, 2026

    @github-actions

    No response was received within 24 hours, so this issue has been unclaimed and returned to status: ready-for-work.

  17. HarperZ9 commented on Oct 15, 2026

    @HarperZ9

    /claim

    The work for this issue is in #102, which is rebased on current main: 6 tests pass and 4 are expected failures (xfail) that mark the metadata gaps this issue describes.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: testsAutomated tests and test infrastructure.help wantedMaintainers would welcome a community contribution on this work.kind: maintenanceRepository maintenance or infrastructure work.status: ready-for-workTriaged and ready for a contributor to claim.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions