Slice B: group-scoped connectivity discovery matrix - #21
Open
Krishcalin wants to merge 2 commits into
Open
Krishcalin wants to merge 2 commits into
Krishcalin wants to merge 2 commits into
Conversation
Segmentation verifies declared intent; this discovers what the estate actually does,
for the zones of one device group — the AlgoSec "Matrix" view, built on the same path
engine rather than a new one.
- MatrixService.discover(group, graph): derive the group's zones (the connected
networks its devices sit on, /30 transit links and /32 loopbacks excluded), then walk
every ordered zone pair and report the path's routing + policy verdicts as they came
back. Capped at MAX_ZONES so a broad group cannot fan out unboundedly.
- The zones are the group's; the graph is the WHOLE estate. This is the trap the module
is arranged around: two edges in a group may reach each other only through a core that
is not in the group, and truncating the graph to the group would report that real path
as unreachable. The walk crosses everything and the response carries a scope_note
saying so. test_the_walk_crosses_a_device_outside_the_group is that assertion.
- Honesty preserved: an unrouted pair is not-routed/unreachable, never quietly reachable.
- GET /matrix/discover/{group_id} (SNAPSHOT_READ), recomputed per call and stored never —
a saved "isolated" is a claim about an estate that has since changed.
Tests: zone derivation and group-scoping, the crosses-outside-the-group proof, unrouted
honesty, transit/loopback exclusion, and the API (200 + 404). Endpoint registered in the
authorization matrix (coverage guard green).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…on't render as complete Two findings in the connectivity matrix, both an empty/partial result presented as a complete "what can reach what" answer (invariant 2, which the sibling segmentation service already guards): - _derive_zones silently dropped every IPv6 subnet (`if not isinstance(network, IPv4Network): continue`). An IPv6-only group produced an empty matrix; a dual-stack group had its IPv6 reachability omitted — in both cases with no caveat. It now reports whether any real IPv6 subnet was skipped, and discover() states it as a limitation. - A group deriving 0 or 1 zone yields no source/destination pair, so cells=[] with no limitation — indistinguishable from "fully isolated / nothing to report". discover() now adds a limitation when fewer than two comparable zones exist, saying it is the absence of comparable zones rather than a clean answer. Regression tests: a single-zone group is labelled rather than presented complete; an IPv6 interface is flagged rather than silently dropped. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Slice B — Group-scoped connectivity discovery matrix
The visible AlgoSec "Matrix" capability, from
docs/matrices-dr-sets-plan.md. Independent of the DR PRs (#19/#20) — it only readsTopologyService.graph(), so it can merge in any order. Basemain.What it does
Segmentation verifies declared intent; this discovers what the estate actually does, for the zones of one device group — built on the same path-walk engine, not a new one.
MatrixService.discover(group, graph):MAX_ZONES).The trap it's built around
The zones are the group's; the graph is the whole estate. A group's two edges may reach each other only through a core that is not in the group — truncating the graph to the group would report that real path as unreachable. The walk crosses everything, and the response carries a
scope_notesaying so.test_the_walk_crosses_a_device_outside_the_groupasserts exactly this (the cell's hops include the out-of-groupcore).Honesty
An unrouted pair is
not-routed/unreachable, never quietly reachable — the same discipline as the segmentation matrix.API & read-only
GET /matrix/discover/{group_id}(SNAPSHOT_READ), recomputed per call, stored never (a saved "isolated" is a claim about an estate that has since changed). No device is written; SRS §8 holds.Tests
Zone derivation + group-scoping, the crosses-outside-the-group proof, unrouted honesty, transit/loopback exclusion, and the API (200 + 404). Registered in the authorization matrix (coverage guard green).
🤖 Generated with Claude Code