ReMe/tests/unit
Ziyang Guo 5d957113ce
test(dream): accept contextual provenance links in auto_dream assertion (#752)
* test(dream): accept contextual provenance links in auto_dream assertion

integrate.yaml (since #428) requires every `## Sources` entry to be a
complete sentence containing the wikilink and explicitly forbids bare
`- [[...]]` lines, but the integration assertion only matched the bare
line form, so prompt-conformant digests fail the provenance check
(reported in #739). Match the provenance link target with or without an
alias instead of a specific line form.

* test(dream): check provenance with the shared wikilink parser

The prefix-based check ("\[[[P]]\]" or "\[[[P|") kept a partial grammar
in the assertion and still mismatched the repository's wikilink syntax
in both directions: an unterminated aliased span like "[[P|the session
record" (no closing brackets) was accepted even though it produces no
source link, while valid anchored links such as "[[P#Decision]]" and
"[[P#Decision|the decision]]" were rejected even though the shared
parser resolves them to the expected target.

The assertion now delegates to a small dependency-light helper
(tests/integration/_provenance.py) that asks
WikilinkHandler.iter_matches whether any parsed link's target equals the
changed daily note. Bare links, contextual sentences, aliases, embeds,
and anchors all count; unterminated spans and links to other targets do
not.

Because tests/integration never runs in CI, the helper is also exercised
by tests/unit/test_auto_dream_provenance.py with uncredentialed,
parameterized cases for each accepted and rejected form, plus a
multi-target selection case.

---------

Co-authored-by: RerankerGuo <RerankerGuo@users.noreply.github.com>
2026-11-17 11:14:29 +08:00
..
fixtures fix(index): move file parsing off the service event loop (#599) 2026-11-03 13:39:14 +08:00
__init__.py init: reme version 0.4.0 (#284) 2026-06-22 15:41:19 +08:00
auto_resource_test_plugin.py feat(auto_resource): interpret image resources into daily notes (#500) 2026-09-07 12:00:38 +08:00
auto_resource_test_support.py refactor(agent)!: unify lossless streaming and collected replies (#713) 2026-11-05 16:04:27 +08:00
file_store_test_support.py refactor: simplify async tests and shared response rendering (#662) 2026-10-23 13:10:45 +08:00
test_agent_reply.py refactor(agent)!: unify lossless streaming and collected replies (#713) 2026-11-05 16:04:27 +08:00
test_agent_reply_consumers.py refactor(agent)!: unify lossless streaming and collected replies (#713) 2026-11-05 16:04:27 +08:00
test_agent_session_api.py feat(proactive): add resource packages and application-owned chat (#714) 2026-11-06 16:32:05 +08:00
test_agent_state_io.py fix(agent): preserve Unicode separators in saved state (#594) 2026-10-05 11:25:37 +08:00
test_agent_stream.py refactor(agent)!: unify lossless streaming and collected replies (#713) 2026-11-05 16:04:27 +08:00
test_app_config_step.py feat: add workspace web APIs and star growth report (#416) 2026-08-05 18:03:37 +08:00
test_application_config.py fix(hermes): preserve host dependencies in embedded installs (#742) 2026-11-13 11:18:48 +08:00
test_as_embedding_lazy.py fix(embedding): isolate caches by vector space (#442) 2026-08-10 22:42:16 +08:00
test_as_llm_lazy.py fix(as_llm): close owned OpenAI clients safely (#725) 2026-11-11 11:44:42 +08:00
test_async_utils.py feat(home): add reproducible benchmark preparation and candidate evaluation (#693) 2026-11-05 14:54:31 +08:00
test_atomic_file_write.py fix(memory): preserve file consistency and decision client lifecycle (#672) 2026-10-26 13:08:02 +08:00
test_auto_dream.py refactor(agent)!: unify lossless streaming and collected replies (#713) 2026-11-05 16:04:27 +08:00
test_auto_dream_provenance.py test(dream): accept contextual provenance links in auto_dream assertion (#752) 2026-11-17 11:14:29 +08:00
test_auto_image_steps.py fix(daily): preserve malformed indexes and report refresh failures (#726) 2026-11-10 12:20:35 +08:00
test_auto_memory_cc.py refactor(agent)!: unify lossless streaming and collected replies (#713) 2026-11-05 16:04:27 +08:00
test_auto_memory_direct_images.py refactor(agent)!: unify lossless streaming and collected replies (#713) 2026-11-05 16:04:27 +08:00
test_auto_memory_idempotency.py fix(dsh): recover memory backlogs and protect endpoint credentials (#653) 2026-10-21 18:58:29 +08:00
test_auto_memory_session_messages.py fix(auto-memory): persist same-ID transcript corrections (#668) 2026-11-05 15:58:28 +08:00
test_auto_resource_agent_inputs.py feat(auto-resource): unify text and image auto-resource using agentwrapper (#555) 2026-09-23 10:20:35 +08:00
test_auto_resource_batch_lookup.py feat(auto-resource): unify text and image auto-resource using agentwrapper (#555) 2026-09-23 10:20:35 +08:00
test_auto_resource_review_regressions.py refactor(agent)!: unify lossless streaming and collected replies (#713) 2026-11-05 16:04:27 +08:00
test_auto_tag.py refactor(agent)!: unify lossless streaming and collected replies (#713) 2026-11-05 16:04:27 +08:00
test_background_steps.py fix(daily): preserve malformed indexes and report refresh failures (#726) 2026-11-10 12:20:35 +08:00
test_base_agent_wrapper.py feat(proactive): add resource packages and application-owned chat (#714) 2026-11-06 16:32:05 +08:00
test_base_client.py fix(client): format IPv6 service URLs correctly (#719) 2026-11-11 11:43:02 +08:00
test_base_component.py refactor: simplify core, Studio, and unit test scaffolding (#658) 2026-10-22 19:35:21 +08:00
test_benchmark_docker.py feat(home): add reproducible benchmark preparation and candidate evaluation (#693) 2026-11-05 14:54:31 +08:00
test_benchmark_docker_queries.py feat(docker): Add Docker benchmark sandbox and pooled runner (#608) 2026-10-19 16:26:38 +08:00
test_benchmark_docker_start_callback.py feat(home): add reproducible benchmark preparation and candidate evaluation (#693) 2026-11-05 14:54:31 +08:00
test_benchmark_docker_upload.py feat(docker): Add Docker benchmark sandbox and pooled runner (#608) 2026-10-19 16:26:38 +08:00
test_benchmark_docker_versions.py feat(home): add reproducible benchmark preparation and candidate evaluation (#693) 2026-11-05 14:54:31 +08:00
test_benchmark_docker_workspace.py feat(docker): Add Docker benchmark sandbox and pooled runner (#608) 2026-10-19 16:26:38 +08:00
test_benchmark_legacy_termination.py fix(benchmark): preserve iteration-limit results in MemLens and MobileMem (#735) 2026-11-12 11:13:33 +08:00
test_benchmark_pool_callbacks.py feat(home): add reproducible benchmark preparation and candidate evaluation (#693) 2026-11-05 14:54:31 +08:00
test_bm25_live_length.py fix(bm25): preserve the index when batch tokenization fails (#637) 2026-10-19 17:56:52 +08:00
test_catalog_jobs.py feat(proactive): add resource packages and application-owned chat (#714) 2026-11-06 16:32:05 +08:00
test_cc_agent_wrapper.py refactor(agent)!: unify lossless streaming and collected replies (#713) 2026-11-05 16:04:27 +08:00
test_codex_agent_wrapper.py feat(proactive): add resource packages and application-owned chat (#714) 2026-11-06 16:32:05 +08:00
test_codex_capture_recovery.py fix(codex): tolerate delayed transcript capture (#681) 2026-11-06 11:09:47 +08:00
test_codex_plugin_mcp.py chore(deps): upgrade dependencies and bump ReMe to 0.4.2.2 (#692) 2026-10-28 16:36:17 +08:00
test_codex_plugin_runtime.py feat(integrations): add automatic memory plugins for Claude Code and Codex (#575) 2026-10-12 20:12:47 +08:00
test_coding_agent_plugins.py feat(integrations): add Qoder memory plugin (#682) 2026-10-29 11:27:10 +08:00
test_common_steps.py feat(traverse): return readable traversal summaries (#716) 2026-11-12 11:10:21 +08:00
test_compact_context.py fix(memory): preserve file consistency and decision client lifecycle (#672) 2026-10-26 13:08:02 +08:00
test_compaction_experiment.py refactor: generalize decision models and add recoverable context compaction (#626) 2026-10-19 17:56:30 +08:00
test_compaction_study.py refactor: generalize decision models and add recoverable context compaction (#626) 2026-10-19 17:56:30 +08:00
test_component_registry.py refactor: simplify core, Studio, and unit test scaffolding (#658) 2026-10-22 19:35:21 +08:00
test_compressor_step.py refactor: simplify async tests and shared response rendering (#662) 2026-10-23 13:10:45 +08:00
test_config_parser.py feat(studio): add Codex session history and proactive messages (#711) 2026-11-05 11:51:30 +08:00
test_cookbook_config.py refactor(auto-fin): one note per topic, merged by a separate digest step (#558) 2026-09-20 14:52:56 +08:00
test_cron_delay.py fix(cron): use elapsed time across daylight-saving transitions (#671) 2026-11-05 17:23:47 +08:00
test_crud_steps.py refactor: simplify async tests and shared response rendering (#662) 2026-10-23 13:10:45 +08:00
test_daily_index_dream.py fix(daily): preserve malformed indexes and report refresh failures (#726) 2026-11-10 12:20:35 +08:00
test_daily_list_range.py feat(daily): add date-range queries and pagination (#685) 2026-10-27 15:38:56 +08:00
test_daily_note_links.py feat(auto_resource): reuse parsed resource ownership per batch (#529) 2026-09-14 16:55:42 +08:00
test_daily_steps.py fix(daily): preserve malformed indexes and report refresh failures (#726) 2026-11-10 12:20:35 +08:00
test_dashscope_search_step.py feat: add DashScope web search job (#710) 2026-11-04 19:51:14 +08:00
test_data_connectors.py feat(proactive): add resource packages and application-owned chat (#714) 2026-11-06 16:32:05 +08:00
test_decision_config.py chore(deps): upgrade dependencies and bump ReMe to 0.4.2.2 (#692) 2026-10-28 16:36:17 +08:00
test_decision_demo.py refactor: generalize decision models and add recoverable context compaction (#626) 2026-10-19 17:56:30 +08:00
test_decision_model.py fix(memory): preserve file consistency and decision client lifecycle (#672) 2026-10-26 13:08:02 +08:00
test_default_file_chunker.py refactor: simplify async tests and shared response rendering (#662) 2026-10-23 13:10:45 +08:00
test_docker_runtime.py feat(docker): add container deployment and multi-platform release workflow (#582) 2026-10-03 23:54:58 +08:00
test_dream_checkpoint_versions.py refactor(agent)!: unify lossless streaming and collected replies (#713) 2026-11-05 16:04:27 +08:00
test_dream_frontmatter.py fix(dream): strip YAML front matter from extraction input (#738) 2026-11-16 12:32:42 +08:00
test_edit_read_limits.py fix(file-io): refuse edits after incomplete bounded reads (#663) 2026-11-04 15:25:11 +08:00
test_embedded_consumer_compat.py fix(core): finish application cleanup before propagating cancellation (#636) 2026-11-05 16:20:03 +08:00
test_evaluation_interface.py feat(studio): add Codex session history and proactive messages (#711) 2026-11-05 11:51:30 +08:00
test_evolve_utils.py refactor(agent)!: unify lossless streaming and collected replies (#713) 2026-11-05 16:04:27 +08:00
test_faiss_index_maintenance.py perf(file-store): retain unchanged BM25 documents on upsert (#728) 2026-11-12 11:23:10 +08:00
test_file_catalog.py refactor: simplify async tests and shared response rendering (#662) 2026-10-23 13:10:45 +08:00
test_file_chunker_workers.py fix(index): move file parsing off the service event loop (#599) 2026-11-03 13:39:14 +08:00
test_file_graph.py refactor: simplify async tests and shared response rendering (#662) 2026-10-23 13:10:45 +08:00
test_file_sandbox_backend.py fix(sandbox): enforce write grants and repair network isolation checks (#749) 2026-11-16 12:24:20 +08:00
test_file_store_consistency.py fix(embedding-store): keep shrinking an over-limit request until it fits (#686) 2026-10-30 11:19:21 +08:00
test_frontmatter_steps.py fix(frontmatter-read): put the frontmatter in the answer, not just a key count (#564) 2026-10-28 16:19:15 +08:00
test_graph_snapshot_step.py feat: add frontend-ready wikilink graph APIs (#414) 2026-08-05 16:45:50 +08:00
test_hermes_agent_integration.py fix(hermes): preserve host dependencies in embedded installs (#742) 2026-11-13 11:18:48 +08:00
test_http_client.py refactor(agent)!: unify lossless streaming and collected replies (#713) 2026-11-05 16:04:27 +08:00
test_http_web_workspace.py feat(jobs): add a unified enabled switch for all job types (#580) 2026-09-30 18:30:36 +08:00
test_injected_job_kwargs.py refactor(agent)!: unify lossless streaming and collected replies (#713) 2026-11-05 16:04:27 +08:00
test_job.py fix(core): finish application cleanup before propagating cancellation (#636) 2026-11-05 16:20:03 +08:00
test_job_status.py refactor(agent)!: unify lossless streaming and collected replies (#713) 2026-11-05 16:04:27 +08:00
test_json_file_chunker.py fix(chunker): restore malformed JSON text fallback (#557) 2026-10-14 14:43:27 +08:00
test_jsonl_file_chunker.py refactor: simplify core, Studio, and unit test scaffolding (#658) 2026-10-22 19:35:21 +08:00
test_keyword_index.py refactor: simplify core, Studio, and unit test scaffolding (#658) 2026-10-22 19:35:21 +08:00
test_keyword_upsert_delta.py perf(file-store): retain unchanged BM25 documents on upsert (#728) 2026-11-12 11:23:10 +08:00
test_line_anchor.py feat: simplify wikilink semantics and support line anchors (#412) 2026-08-05 11:47:50 +08:00
test_link_expansion.py refactor: simplify async tests and shared response rendering (#662) 2026-10-23 13:10:45 +08:00
test_lme_judge.py refactor(agent)!: unify lossless streaming and collected replies (#713) 2026-11-05 16:04:27 +08:00
test_local_backend.py fix(python): sandbox Python execution and disable benchmark service exposure (#708) 2026-11-04 14:31:59 +08:00
test_local_embedding_store.py fix(embedding-store): keep shrinking an over-limit request until it fits (#686) 2026-10-30 11:19:21 +08:00
test_logging_config.py feat: add Auto Fin cookbook and managed outbound proxy support (#392) 2026-07-25 18:09:39 +08:00
test_logo_utils.py feat(service): support explicit wildcard network binds (#547) 2026-09-15 14:26:33 +08:00
test_markdown_file_chunker.py fix(index): move file parsing off the service event loop (#599) 2026-11-03 13:39:14 +08:00
test_mcp_client.py fix(hermes): preserve host dependencies in embedded installs (#742) 2026-11-13 11:18:48 +08:00
test_memlens_benchmark.py refactor(agent)!: unify lossless streaming and collected replies (#713) 2026-11-05 16:04:27 +08:00
test_memlens_judge.py feat: add ReMe Image evaluation on MemLens (#640) 2026-10-26 15:07:16 +08:00
test_memlens_runner_failures.py feat: add ReMe Image evaluation on MemLens (#640) 2026-10-26 15:07:16 +08:00
test_mobilemem_audit.py feat: add ReMe Image evaluation on MobileMem-Omni (#641) 2026-10-26 15:20:23 +08:00
test_mobilemem_benchmark.py refactor(agent)!: unify lossless streaming and collected replies (#713) 2026-11-05 16:04:27 +08:00
test_mobilemem_judge.py feat: add ReMe Image evaluation on MobileMem-Omni (#641) 2026-10-26 15:20:23 +08:00
test_native_path_derived_indexes.py fix(tag-index): keep legacy Windows spellings consistent across index consumers (#717) 2026-11-12 12:09:43 +08:00
test_outbound_proxy.py feat: add Auto Fin cookbook and managed outbound proxy support (#392) 2026-07-25 18:09:39 +08:00
test_pa.py feat(proactive): add resource packages and application-owned chat (#714) 2026-11-06 16:32:05 +08:00
test_pa_events.py feat(proactive): add resource packages and application-owned chat (#714) 2026-11-06 16:32:05 +08:00
test_package_versions.py fix(hermes): preserve host dependencies in embedded installs (#742) 2026-11-13 11:18:48 +08:00
test_packaging.py init: reme version 0.4.0 (#284) 2026-06-22 15:41:19 +08:00
test_parallel_search_example.py feat(integrations): add opt-in Parallel MCP example (#720) 2026-11-12 11:14:46 +08:00
test_path_bubble_backend.py fix(python): sandbox Python execution and disable benchmark service exposure (#708) 2026-11-04 14:31:59 +08:00
test_path_permission.py refactor: simplify core, Studio, and unit test scaffolding (#658) 2026-10-22 19:35:21 +08:00
test_plugin.py Separate benchmark judge plugins (#535) 2026-09-10 20:16:46 +08:00
test_plugin_cli.py fix(release): harden embedding store and plugins for ReMe 0.4.1.9 (#503) 2026-08-28 11:35:04 +08:00
test_prepared_search_filter.py fix(file-store): match list-valued metadata in search filters (#697) 2026-10-30 11:17:33 +08:00
test_proactive_interest.py feat(proactive): add resource packages and application-owned chat (#714) 2026-11-06 16:32:05 +08:00
test_proactive_refresh.py refactor(agent)!: unify lossless streaming and collected replies (#713) 2026-11-05 16:04:27 +08:00
test_process_output_limits.py fix(python): sandbox Python execution and disable benchmark service exposure (#708) 2026-11-04 14:31:59 +08:00
test_prompt_handler.py refactor: simplify core, Studio, and unit test scaffolding (#658) 2026-10-22 19:35:21 +08:00
test_python_execute_timeout.py fix(python): sandbox Python execution and disable benchmark service exposure (#708) 2026-11-04 14:31:59 +08:00
test_qwen_token_tools.py feat(token counter): add Qwen token counting utility with fallback (#616) 2026-10-16 11:58:35 +08:00
test_read_image_steps.py refactor: simplify async tests and shared response rendering (#662) 2026-10-23 13:10:45 +08:00
test_read_newlines.py fix(file-io): align newline reads and multiline edits (#643) 2026-10-26 14:40:46 +08:00
test_read_with_neighbors.py refactor: simplify async tests and shared response rendering (#662) 2026-10-23 13:10:45 +08:00
test_reindex.py fix(reindex): return a readable summary so Studio stops showing a placeholder (#565) 2026-10-14 11:25:48 +08:00
test_reme_cli.py fix(python-execute): rename the timeout parameter to survive CLI client kwargs (#587) 2026-10-09 16:49:05 +08:00
test_resource_cleanup.py feat(proactive): add resource packages and application-owned chat (#714) 2026-11-06 16:32:05 +08:00
test_runtime_context.py refactor: simplify core, Studio, and unit test scaffolding (#658) 2026-10-22 19:35:21 +08:00
test_sandbox_startup_cancellation.py feat(sandbox): Add Home AutoBash plugin and path-scoped execution sandboxes (#603) 2026-10-27 18:08:26 +08:00
test_search_empty_response.py fix(search): explain empty results in metadata (#647) 2026-10-23 15:53:44 +08:00
test_search_score_threshold.py fix(search): clarify score thresholds and warn above hybrid bound (#642) 2026-10-19 17:54:56 +08:00
test_search_step.py refactor: simplify async tests and shared response rendering (#662) 2026-10-23 13:10:45 +08:00
test_service.py fix(hermes): preserve host dependencies in embedded installs (#742) 2026-11-13 11:18:48 +08:00
test_service_utils.py fix(client): format IPv6 service URLs correctly (#719) 2026-11-11 11:43:02 +08:00
test_session_image_assets.py feat(auto-memory): save session images with source links (#574) 2026-10-09 17:42:13 +08:00
test_shell_step.py refactor: simplify async tests and shared response rendering (#662) 2026-10-23 13:10:45 +08:00
test_source_format_merge.py refactor: derive dialog paths from session_dir (#421) 2026-08-06 17:07:14 +08:00
test_status_step.py fix: skip dependency bindings in status memory walk (#510) 2026-08-31 16:24:41 +08:00
test_sync_qwenpaw_agentscope.py fix: preserve QwenPaw dependency compatibility (#712) 2026-11-05 13:10:43 +08:00
test_tag_index.py fix(tag-index): keep legacy Windows spellings consistent across index consumers (#717) 2026-11-12 12:09:43 +08:00
test_threaded_watch.py fix(memory): preserve file consistency and decision client lifecycle (#672) 2026-10-26 13:08:02 +08:00
test_token_usage.py refactor(agent)!: unify lossless streaming and collected replies (#713) 2026-11-05 16:04:27 +08:00
test_tokenizer.py refactor: simplify async tests and shared response rendering (#662) 2026-10-23 13:10:45 +08:00
test_utils.py fix(search): keep zero float16 cosine scores finite (#674) 2026-10-28 16:55:38 +08:00
test_wikilink_utils.py refactor: simplify async tests and shared response rendering (#662) 2026-10-23 13:10:45 +08:00
test_workspace_web_steps.py feat(proactive): add resource packages and application-owned chat (#714) 2026-11-06 16:32:05 +08:00
test_write_metadata_lock.py refactor: simplify async tests and shared response rendering (#662) 2026-10-23 13:10:45 +08:00
test_zvec_file_store.py refactor: simplify async tests and shared response rendering (#662) 2026-10-23 13:10:45 +08:00