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”Context
Section titled “Context”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
archiveroom —intended-architectureandphase-0-investigationare claimed byinitiatives, every_archiveby 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 offsource_file. - S520.
decisionscarriedreferenceas a keyword so thatreference/decision-register.mdwould route to it. Becausereference/is the parent ofreference/decisions/, it matched four levels earlier and swept the whole family in. Measured: of 2,572 drawers inroom=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 werereference/_archive/stale docs. More stale drawers than decision drawers, in the room nameddecisions— androom=referenceheld onlyontology/anddesign/.
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.
Decision
Section titled “Decision”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:
- DR-112’s T3 tier is reinstated.
intended-architectureandphase-0-investigationroute toarchive(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. - DR-112’s Q4 is withdrawn. Relocating
intended-architecture/01-vision.mdto keep it out ofarchiveis replaced by anexclude_pathscarve-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. referencemoves off thedecisionskeyword list and onto thereferenceroom.
Alternatives Considered
Section titled “Alternatives Considered”- Deepest-wins (reverse the walk). Fixes
_archivebut token-matches long spec slugs: projected 14 spec files intoreference(id-119-design-system-…) and 9 intodecisions(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 underreference/. Routable, but changes published Starlight URLs to satisfy a mining concern. - Reorder the room declarations. Cannot work —
detect_roomiterates path parts in the outer loop, so a shallower part wins regardless of declaration order. - Patch
roommetadata in place. Rejected in S519 and still rejected:make_drawer_id_from_chunkhashes the room into the drawer id, so patched rows no longer match their recipe and fork on the next edit.
Consequences
Section titled “Consequences”- The patch lives in
site-packages/mempalace/miner.py, which the daemon imports, so the daemon must be restarted to pick it up anduv tool upgradere-arms the defect — the same standing hazard class as DR-110’shnsw:sync_thresholdre-pin. Backup atminer.py.bak-s520; an upstream issue againstgithub.com/MemPalace/mempalaceis owed. - Executed S520: 210 files / 7,993 drawers deleted and re-mined via the daemon job route.
room=decisions146 files → 120 (525 drawers),room=reference45 → 69 (2,219),room=archive133 → 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.