feat(issue-20): S2 Wiki-backed Report Memory#23
Open
LucasErcolano wants to merge 3 commits into
Open
Conversation
Resolves issue #20. - Add memory_mode feature flag: baseline | experimental, env/YAML driven, rollback-safe. - Add experiment runner: deterministic run_id, seed control, snapshot config, seed/prompt hashes, results.json export, runs/<case>/<variant>/<seed>/ layout. - Add docs and configs: docs/memory_experimental.md, docs/experiment_harness.md, configs/memory_baseline.yaml, configs/memory_experimental.yaml, configs/experiments/example_case.yaml, configs/experiments/v1_smoke_*.yaml incl. no-report smoke variant. - Add tests: backend/tests/test_memory_mode.py, backend/tests/test_experiment_runner.py, backend/tests/test_experiment_runner_memory.py. - Update backend services/tests for experimental memory integration, spike baseline/rollback behavior, memory metrics logging, and safe backend logger handling. - Update .gitignore for logs/runs/artifacts. - Final pre-merge cleanup: move temporary smoke/log artifacts out of tree; preserve no-report smoke config for simulation path validation. Issue: #20
Add optional wiki audit context layer to ReportAgent that compiles simulation knowledge-base pages into structured context injected into planning and section-generation prompts. Feature is fully opt-in via build_wiki_context_for_report()/wiki_context=None — no change to existing behavior when not activated. Implementation: - backend/app/services/wiki_memory/: new package (WikiStore, WikiCompiler, schemas, templates) for compiling wiki pages into context for report generation - backend/app/services/report_agent.py: add wiki_context param, inject <wiki_audit_context> block into plan_outline and generate_section_react prompts with prior-knowledge labeling - backend/app/api/report.py: integrate wiki context building with graceful degradation (non-fatal on error) - backend/app/services/__init__.py: refactor to lazy-import heavy services, eager-export wiki_memory public API Tests: 116/116 passing (compiler, store, integration, smoke). Docs: docs/wiki_backed_report_memory.md with MVP activation details. Smoke: scripts/real_lite_smoke.py for real-LLM verification.
34 tasks
Owner
Author
|
Análisis cualitativo de gaps para cerrar bien la issue S2 (#20):
En resumen: para cerrar #20, el PR debe cumplir todo el checklist de la issue y mantener el alcance en Wiki-backed Report Memory mínima/opt-in, sin mezclar un framework general de experimental memory si no es requerido por la issue. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements S2 Wiki-backed Report Memory for issue #20.
This PR adds a persistent local Markdown Wiki as an auxiliary audit/evidence context layer for ReportAgent. It does not replace Zep, GraphRAG, or the existing operational memory stack. Baseline behavior remains unchanged unless a
wiki_contextis explicitly available/provided.Linked issue
Closes #20
What changed
backend/app/services/wiki_memory/with:WikiStoreWikiCompilerbuild_wiki_context_for_report(...)wiki/agents.mdwiki/index.mdwiki/timeline.mdwiki/sources.mdwiki/contradictions.mdwiki/entities/*.mdwiki/claims/*.mdwiki/wiki_meta.jsonwiki/wiki_compile_log.jsonlwiki_compile_log.jsonlwiki_context.mdReportAgentplanning/section prompts via<wiki_audit_context>.wiki_context=Noneon error/missing data.docs/wiki_backed_report_memory.md.scripts/real_lite_smoke.py.Scope / PR hygiene
The PR is now narrowed to the S2 Wiki-backed Report Memory MVP.
Removed from the final branch diff:
experiment_runner.pymemory_mode.pymemory_*configsThe final diff keeps the feature minimal, local, additive, and opt-in.
MVP opt-in behavior
ReportAgent(..., wiki_context=None)is the default.build_wiki_context_for_report(...)returnsNoneand does not create wiki directories as a side effect.wiki_context=None.How to test
Targeted wiki suite:
Syntax check:
python -m py_compile backend/app/services/wiki_memory/*.py backend/app/services/report_agent.py backend/app/api/report.py scripts/real_lite_smoke.pyOptional bounded real-lite smoke, requiring a configured LLM provider/API key:
Expected local smoke outputs are written under
runs/wiki_report_memory_real_lite_<timestamp>/and includewiki/,wiki_compile_log.jsonl,wiki_context.md, baseline/with-wiki reports, and comparison artifacts.Local verification
from:
and:
python -m py_compile backend/app/services/wiki_memory/*.py backend/app/services/report_agent.py backend/app/api/report.py scripts/real_lite_smoke.pycompleted successfully.
Limitations
This PR does not claim:
The smoke validates the S2 integration boundary: real Wiki compilation, real context assembly/injection, safe fallback, and reproducible local artifacts.