feat: add Digital Twin Universe profile for E2E testing#2
Merged
michaeljabbour merged 5 commits intomichaeljabbour:mainfrom Apr 30, 2026
Merged
feat: add Digital Twin Universe profile for E2E testing#2michaeljabbour merged 5 commits intomichaeljabbour:mainfrom
michaeljabbour merged 5 commits intomichaeljabbour:mainfrom
Conversation
added 5 commits
April 29, 2026 18:20
Add 6 fixture files under tests/fixtures/seed-palace/ to support the memory-bundle-e2e DTU profile end-to-end tests. Files added: - README.md: Documents the fixture purpose, seeding flow, reset-palace script, extension guide, and a files table. - content/session-notes.md: 600+ word synthetic session notes with keywords for capture category detection (decided, resolved, learned, pattern). Covers dual-palace pattern, allow_uv_github_fast_path fix, project-context discovery, spool requirements, and real API keys. - content/architecture-decisions.md: 800+ word ADR log covering six decisions: two-layer architecture, behaviour-based bundle install, hot-path/drain-thread split, dual-palace seeding, real API keys, and Gitea mirror. - project-context/HANDOFF.md: Current work snapshot with working-on, next steps, key decisions, open items, and session log entry. - project-context/PROJECT_CONTEXT.md: Project overview with current phase, active milestone, team, architecture pointers table, and conventions. - project-context/GLOSSARY.md: Markdown table with 10 domain terms (Palace, Drawer, Wing, Room, Briefing, Spool, Seed palace, Drain thread, Capture hook, Briefing hook). The content/ files are mined into the MemPalace palace via mempalace mine ... --mode files The project-context/ files are copied to /workspace/project-context/ for the briefing hook's _find_project_context_dir() to discover.
Add three files that set up the integration test layer for DTU-based testing:
tests/integration/__init__.py
Empty package marker so pytest recognises the subdirectory as a Python
package and collects tests from it.
tests/integration/conftest.py
DTU-only fixtures:
- reset_palace (scope=module, autouse=True): calls subprocess.run(['reset-palace'])
before each test module so every module starts from a clean memory palace.
Calls pytest.fail() with returncode + stderr if the CLI returns non-zero,
and raises FileNotFoundError naturally on the host (where reset-palace is
absent) — confirming the fixture is wired even when the DTU tool is missing.
- workspace_dir: returns Path('/workspace'), the directory inside the DTU
that contains project-context/ and amplifier-bundle-memory/.
tests/integration/test_smoke.py
Minimal probe test that asserts str(workspace_dir) == '/workspace'.
On the host this fails at reset_palace (FileNotFoundError: 'reset-palace')
which confirms the conftest is being picked up correctly.
Replaces the single probe test with 7 integration smoke tests that exercise the full DTU provisioning surface: 1. test_palace_directory_exists: asserts /root/.mempalace and /root/.mempalace-seed are present (provision steps create both). 2. test_mempalace_installed: asserts mempalace --version exits 0 (confirms CLI is on PATH inside the DTU). 3. test_palace_has_seeded_drawers: calls mempalace mcp --call mempalace_status and asserts drawer_count > 0 (seed content loaded). 4. test_seed_content_searchable: calls mempalace mcp --call mempalace_search with query 'architecture decisions mempalace' and asserts at least one result is returned (seed content is queryable). 5. test_amplifier_installed: asserts amplifier --version exits 0 (confirms Amplifier CLI is installed in the container). 6. test_reset_palace_restores_seed: writes a sentinel file into /root/.mempalace, calls reset-palace, verifies the sentinel is gone (palace was replaced, not patched), and verifies drawer_count > 0 after reset (seed restore is functional). 7. test_project_context_files_present: asserts HANDOFF.md, PROJECT_CONTEXT.md, and GLOSSARY.md exist under /workspace/project-context (provision step 8 populated these files). All tests are DTU-only: they depend on /root/.mempalace, the mempalace CLI, amplifier, reset-palace, and /workspace/project-context being present in the container environment. Running on a host machine causes all tests to error at the autouse reset_palace fixture (FileNotFoundError on reset-palace) — this is the correct host behaviour confirming the tests cannot pass outside the DTU. Verified: python3 -m py_compile tests/integration/test_smoke.py -> syntax OK pytest --collect-only -q -> 7 tests collected pytest -v on host -> all 7 ERROR at fixture setup (correct)
The tests used 'mempalace mcp --call' syntax which does not exist in mempalace 3.3.3. The mcp subcommand only starts an MCP stdio server. Replace the affected tests: - test_palace_has_seeded_drawers: use 'mempalace status' and regex-parse the 'N drawers' count from the human-readable output - test_seed_content_searchable: use 'mempalace search <query> --results N' and check for '[1]' result marker in output - test_reset_palace_restores_seed: same status change Remove unused 'json' import, add 're' for drawer count parsing.
…ection - .amplifier/digital-twin-universe/profiles/memory-bundle-e2e.yaml: Ubuntu 24.04 Incus profile with Gitea URL rewrite, dual-palace seeding, and real API key passthrough - docs/development/dtu.md: prerequisites, launch sequence, usage modes, update loop - README.md: Development section linking to the DTU guide Enables reproducible E2E testing via: pytest tests/integration/ -v
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
Adds a reproducible end-to-end test environment for
amplifier-bundle-memoryusing the Amplifier Digital Twin Universe (DTU) framework.What's included
.amplifier/digital-twin-universe/profiles/memory-bundle-e2e.yaml— Incus container profile provisioning Ubuntu 24.04 with mempalace, Amplifier (via Gitea mirror for production-like install), real Anthropic + OpenAI API keys, and a seeded dual-palace for test isolationtests/fixtures/seed-palace/— Golden palace seed content (project-context files + drawer content) pre-populated at provision time and frozen as a reset snapshottests/integration/conftest.py— pytest fixtures:reset_palace(autouse, module-scope) andworkspace_dirtests/integration/test_smoke.py— 7 subprocess-based smoke tests verifying provisioning: palace dirs exist, mempalace installed, drawers seeded, search works, amplifier installed, reset-palace restores seed, project-context files presentdocs/development/dtu.md— Developer guide: prerequisites, launch sequence, three usage modes (pytest / interactive / palace inspection), update loopREADME.md— Added## Developmentsection linking to the DTU guideInstallation pattern documented
Uses the behaviour-based install approach so the memory stack layers onto any active bundle without replacing it:
How to use the DTU
See
docs/development/dtu.mdfor full instructions. Quick start:Test results