Skip to content

Add structured ingest traceability#49

Merged
ethanj merged 1 commit intomainfrom
feature/ingest-traceability
Apr 26, 2026
Merged

Add structured ingest traceability#49
ethanj merged 1 commit intomainfrom
feature/ingest-traceability

Conversation

@ethanj
Copy link
Copy Markdown
Contributor

@ethanj ethanj commented Apr 26, 2026

Summary

Adds structured ingest traceability to atomicmemory-core so benchmark and debugging workflows can inspect why each fact was stored, skipped, updated, or deleted.

This change:

  • adds a config-gated ingest trace collector that persists structured JSON trace artifacts
  • surfaces ingest_trace_id on ingest responses when tracing is enabled
  • records per-fact decision metadata across direct store, quick dedup, fast AUDN, deferred AUDN, LLM AUDN, write-security, entropy-gate, and verbatim ingest paths
  • makes ingest trace output configurable with INGEST_TRACE_DIR
  • hardens the ingest trace contract with closed action and reason-code unions
  • regenerates OpenAPI so the response shape stays in sync

Testing

  • dotenv -e .env.test -- pnpm exec tsc --noEmit
  • dotenv -e .env.test -- pnpm test src/services/__tests__/ingest-trace-branches.test.ts src/services/__tests__/ingest-trace.test.ts src/__tests__/memory-route-config-override.test.ts src/services/__tests__/retrieval-trace.test.ts src/__tests__/config-partition.test.ts src/__tests__/route-validation.test.ts --reporter verbose
  • dotenv -e .env.test -- npm test
  • dotenv -e .env -- pnpm build
  • fallow (still reports pre-existing repo-wide duplication/complexity debt outside this PR; no auto-fixes available)

Notes

  • OpenAPI artifacts were regenerated as part of this change.
  • The pre-existing performStoreVerbatim write-security behavior is intentionally not changed here; this PR is scoped to observability and trace-contract hardening.

@ethanj ethanj merged commit 8d6795f into main Apr 26, 2026
1 check passed
@ethanj ethanj deleted the feature/ingest-traceability branch April 26, 2026 01:37
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