feat(gossip): hallways-aware chatter node selection - #2247
Conversation
|
Hi @milla-jovovich @igorls — this PR is rebased onto the latest "develop", the full test suite passes, and the design/context is documented in the body. Ready for review. |
|
@milla-jovovich @igorls this branch is up to date with |
fatkobra
left a comment
There was a problem hiding this comment.
Blocking: hallway context currently conflates room names with hall names.
The hallway records expose the rooms in which an entity co-occurs. The new
selection code stores those room values in hall_scores, then compares them
directly with node.hall.
Those are different namespaces:
- a hallway record may say that an entity occurs in room
audit_report; - a chatter node may belong to hall
security.
The relationship can be meaningful even though the strings are not equal.
The current test masks the problem by using the literal value security as
both the hallway room and the chatter node's hall.
Please make the relationship explicit. For example:
- add room-level affinity to
ChatterNodeand compare room with room; or - resolve each hallway room to its owning hall before applying hall-level
scoring.
Please add a regression test in which the room and hall names differ, such
as room audit_report belonging to hall security, and verify that the
appropriate chatter node still receives the hallway-context boost.
This PR is stacked on #2239, so it should also be rebased after the parent
gossip fixes are settled.
Add a rooms field to ChatterNode and match hallway co-occurrence rooms against node rooms rather than hall names. Regression test uses a room (audit_report) that differs from the node hall (security) to prove the namespaces are no longer conflated. Refs MemPalace#2247
187e13b to
b221c0d
Compare
|
Hi @fatkobra — this branch is stacked on its parent gossip PR. I will rebase it once the parent lands and then re-request review. No action needed until then. |
|
Merged latest |
Add a rooms field to ChatterNode and match hallway co-occurrence rooms against node rooms rather than hall names. Regression test uses a room (audit_report) that differs from the node hall (security) to prove the namespaces are no longer conflated. Refs MemPalace#2247
2c04d96 to
0b0ae0c
Compare
Add a rooms field to ChatterNode and match hallway co-occurrence rooms against node rooms rather than hall names. Regression test uses a room (audit_report) that differs from the node hall (security) to prove the namespaces are no longer conflated. Refs MemPalace#2247
Add a rooms field to ChatterNode and match hallway co-occurrence rooms against node rooms rather than hall names. Regression test uses a room (audit_report) that differs from the node hall (security) to prove the namespaces are no longer conflated. Refs MemPalace#2247
Add a rooms field to ChatterNode and match hallway co-occurrence rooms against node rooms rather than hall names. Regression test uses a room (audit_report) that differs from the node hall (security) to prove the namespaces are no longer conflated. Refs MemPalace#2247
Add a rooms field to ChatterNode and match hallway co-occurrence rooms against node rooms rather than hall names. Regression test uses a room (audit_report) that differs from the node hall (security) to prove the namespaces are no longer conflated. Refs MemPalace#2247
Implements mempalace/gossip.py with ChatterNode, GossipMessage, GossipProtocol, default chatter-node config, topic/priority detection, propagation through palace graph tunnels, and TTL-bounded derived KG triples. Adds tests/test_gossip.py with 16 unit tests. Full suite: 4261 passed, 31 skipped.
- Make DEFAULT_GOSSIP_CONFIG neutral/empty; add EXAMPLE_GOSSIP_CONFIG for tests. - Add config parameter to GossipProtocol and gossip() for explicit setup. - Report attempted/successful/failed targets and only mark a node propagated when at least one write succeeds. - Add mempalace_gossip to service.WRITE_TOOLS and invariant test. Refs MemPalace#2239
Add a rooms field to ChatterNode and match hallway co-occurrence rooms against node rooms rather than hall names. Regression test uses a room (audit_report) that differs from the node hall (security) to prove the namespaces are no longer conflated. Refs MemPalace#2247
…mPalace#2221) The MemPalace#2221 fix reached develop through MemPalace#2228 at an earlier revision of the branch, so three guards and their tests did not come with it. One of the three is a regression the gate that did land introduced. sweep_directory: the new gate probes the file type with f.stat() inside a try, and its except OSError printed SKIP and continued. A dangling symlink, a symlink loop and a file unlinked between rglob and the gate all raise there. Before the gate existed each of them reached sweep(), raised, and was appended to failures — so the gate turned "could not read this transcript" into a silent skip and a successful exit. A probe that FAILS is an error, not a benign file type: log it, print WARNING, book it in failures. A probe that succeeds and reports a non-regular file still skips silently. _parse_gradle: the is_file() gate sat in front of the try whose except OSError the parser already had, so a manifest under a directory with r but no x raised PermissionError out of a call that used to answer "no manifest name". The gate moves inside that try. _collect_manifest_names stats with os.path.isfile, which reports instead of raising, matching the parsers it guards. split_file: the type gate in main() covers the files the glob listed, but split_file builds its output names itself, so a pre-existing FIFO at one of them wedged write_text in the kernel waiting for a reader. Output names that are anything but a regular file are skipped. That gate asks os.path.lexists, not os.path.exists. exists() follows the link, so a DANGLING symlink at an output name reads as "nothing there" and the write goes through it, creating the target — a chunk landing wherever the link points rather than in the output directory. Measured: the two calls differ on that one case and agree on every other (regular file, symlink to a file, missing name, FIFO, symlink to FIFO, directory). test_gather_origin_samples_survives_an_unreadable_directory broke under root rather than passing vacuously: CAP_DAC_OVERRIDE walks into the 0o444 directory, the walled-off file stays readable, and the count assertion sees two samples instead of one. It now carries the same needs_unprivileged_posix gate as the three new permission tests. miner._read_text_no_follow: comment fix only. F_SETLEASE on a FIFO fails EINVAL, not ENXIO — measured on Linux 6.18 / glibc 2.39. The code branches on EAGAIN and is unaffected.
0b0ae0c to
47ca87e
Compare
Add a rooms field to ChatterNode and match hallway co-occurrence rooms against node rooms rather than hall names. Regression test uses a room (audit_report) that differs from the node hall (security) to prove the namespaces are no longer conflated. Refs MemPalace#2247
|
@fatkobra thanks for the detailed review — the blockers are noted. As you pointed out, these are stacked on #2239 and should wait for the parent to be resolved first. Opened #2335 to make the design case for derived routing vs KG mutation per your review on #2239. Once there's sign-off on the derived-view approach (no KG writes, sidecar for routing state), I'll rewrite the stack with the fixes for your specific blockers on this PR. |
|
Closing — stacked on #2239 which was just closed. See comment there for rationale. The hallway-aware node selection logic will be reused in a query-time search expansion PR. |
Stacked on #2239 (feat/gossip-mvp).
Summary
Adds hallway-aware chatter-node selection to
GossipProtocol:Test plan
tests/test_gossip.pypasses (18 tests).tests/test_mcp_server.pypasses.