Skip to content

Coherence check flags the gitignored .engine/memory/ runtime as unowned, so the full local test suite fails after the engine has run #180

Description

@StarshipSuperjam

The engine opened this item itself — you didn't create it.

What this is. The engine's own coherence check — the rule that every file under .engine/ must be owned by a module — wrongly flags the memory system's working files as unowned, so the full local test suite can't pass on a machine where the engine has actually run.

  • Where: .engine/tools/module_coherence.py (the ownership walk) and the test_modules.py tests that consume it.
  • What goes wrong: the memory system keeps its working files — a running ledger, a search index, a capture-state file, and a lock — in .engine/memory/. That whole folder is gitignored runtime: it's created the moment the engine's memory hooks run, and is never committed. But the ownership walk doesn't skip it (it skips .venv, __pycache__, .cache, and .pytest_cache — not .engine/memory/), and the memory module's claim on the folder doesn't actually match the files inside it (it lists a bare directory, which matches no files). So the walk reports each runtime file as an orphan with no owner.
  • What that breaks: on any working copy where the memory hooks have run, python -m unittest reports two failing coherence tests — even on a clean, correct checkout. It does not affect the merge gate or CI: a fresh clone (which CI uses) has an empty .engine/memory/, so nothing is flagged there. This is a local developer-experience fault, not a release fault — nothing reaches main because of it.
  • How it was found: while fixing the scheduled self-review (Fix the scheduled self-review: doubled-path seal (#176) + the phantom setup toggle (#175) #179). Proven independent of that change by stashing all edits and re-running the check on a clean tree — the same four orphans appear.

What happens next. A maintainer skips the gitignored memory runtime from the ownership walk, the same way the other regenerable caches are already skipped, and merges under the usual review step. Not urgent — it never blocks a merge.

  • Most likely: add .engine/memory/ to the walk's skip set (PRUNE_DIRS in module_coherence.py), mirroring the existing .cache / .pytest_cache / .venv carve-out — all gitignored regenerable artifacts that are never owned files.
  • One gotcha to get right: that skip set currently matches by folder name, and there are two different memory folders — the runtime .engine/memory/ (skip it) and the committed code package .engine/tools/memory/ (must not be skipped, or its files silently stop being ownership-checked). So the fix has to target the path .engine/memory/, not the bare name memory.
  • A quick regression check: drop a dummy file under .engine/memory/ and confirm the coherence test stays green.

More detail.

Metadata

Metadata

Assignees

No one assigned

    Labels

    engineOpened by the engine about its own health (not your product).

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions