Skip to content

DR-114: Room routing gains a depth-blind priority pre-pass

DR-114: Room routing gains a depth-blind priority pre-pass

Section titled “DR-114: Room routing gains a depth-blind priority pre-pass”

miner.detect_room walks a file’s path parts outermost-first and returns on the first part matching any room name or keyword. A parent family therefore always beats a deeper one, and a child directory is unroutable whenever its parent also matches a room.

Two separate defects fall out of that single mechanism, found a session apart:

  • S519. The DR-106 stale families could not reach the archive room — intended-architecture and phase-0-investigation are claimed by initiatives, every _archive by its own parent family. DR-112’s T3 tier was inert as designed, and DR-113 withdrew it, ruling stale-family marking a recall-path concern keyed off source_file.
  • S520. decisions carried reference as a keyword so that reference/decision-register.md would route to it. Because reference/ is the parent of reference/decisions/, it matched four levels earlier and swept the whole family in. Measured: of 2,572 drawers in room=decisions, only 452 (17.6%) were DR records; 1,638 were the north-star reference set (platform-context.md, entity-glossary.md, platform-direction.md, deployment-architecture.md, cocoindex-pipeline.md) and 482 were reference/_archive/ stale docs. More stale drawers than decision drawers, in the room named decisions — and room=reference held only ontology/ and design/.

DR-113’s ruling that the tier “cannot be expressed as path-keyword room routing” is true only under shallowest-wins. It is a property of the traversal order, not of path routing.

A room may declare priority: true — it is then tested against every path part, in declaration order, before the depth-ordered walk. A deep marker directory therefore wins over its parent family. A priority room may declare exclude_paths — fnmatch patterns against the project-relative path — so a directory-keyed marker can carve out exceptions rather than being all-or-nothing. Absent the flag, routing is byte-identical to the depth-ordered behaviour, so the change is a no-op for every other palace and is upstreamable as-is.

Consequently:

  1. DR-112’s T3 tier is reinstated. intended-architecture and phase-0-investigation route to archive (9 and 34 files). DR-113’s mechanism claim is amended; its drawer-id ruling is untouched and still binding — changing a mined file’s room remains delete-then-re-mine, never a metadata patch.
  2. DR-112’s Q4 is withdrawn. Relocating intended-architecture/01-vision.md to keep it out of archive is replaced by an exclude_paths carve-out. The id-386 placement audit ruled KEEP IN PLACE on evidence — all 8 siblings cite it by bare filename, so the move breaks every one. Same routing outcome, no doc-tree churn.
  3. reference moves off the decisions keyword list and onto the reference room.
  • Deepest-wins (reverse the walk). Fixes _archive but token-matches long spec slugs: projected 14 spec files into reference (id-119-design-system-…) and 9 into decisions (id-110-url-import-reference-items), plus 22 initiatives files. Trades a precise failure for a diffuse one.
  • Restructure the tree so decisions/ is not nested under reference/. Routable, but changes published Starlight URLs to satisfy a mining concern.
  • Reorder the room declarations. Cannot work — detect_room iterates path parts in the outer loop, so a shallower part wins regardless of declaration order.
  • Patch room metadata in place. Rejected in S519 and still rejected: make_drawer_id_from_chunk hashes the room into the drawer id, so patched rows no longer match their recipe and fork on the next edit.
  • The patch lives in site-packages/mempalace/miner.py, which the daemon imports, so the daemon must be restarted to pick it up and uv tool upgrade re-arms the defect — the same standing hazard class as DR-110’s hnsw:sync_threshold re-pin. Backup at miner.py.bak-s520; an upstream issue against github.com/MemPalace/mempalace is owed.
  • Executed S520: 210 files / 7,993 drawers deleted and re-mined via the daemon job route. room=decisions 146 files → 120 (525 drawers), room=reference 45 → 69 (2,219), room=archive 133 → 320 (13,243). Residual rows 0, divergence 0, all 14 projection assertions green.
  • Room filters are now a usable precision instrument for the docs-site corpus, which is what DR-112 Q6 depends on. The canonical code repo is untouched by this and remains 57,581 drawers at room=general.