Reading diagrams / Topic 21 of 42

Guards, sign-in and roles

The rule

A red diamond on a path is a guard: a check that can stop the request, with a short stem for the way out. Its name is above it. Each kind of mark has a fixed place in its stretch of the path, so the map shows which checks and reads a stretch has, not their order within it; a line under the map says so. Where Yichus knows which runs first on every path, a filled chevron marked then sits between the check and the ring and points from the one that runs first. It is not the direction a request travels: in policy-docs, the chevron in with_policy's hull points from its read of docs to check_policy, so it reads, then checks. With no chevron, the places say nothing about order; the what-happens tree, later, draws a route's own steps in order.

The start of each path says who may call. A closed padlock means a caller signs in with a secret key. An open padlock means a publishable key, the kind safe to put in a web page, may call it. A red word after the route is a role the route declares: the caller must have it beyond signing in. A grey word under a route is not a role. It is a value the entry hands to its wrapper, taught in the next lesson; what that code does with it is decided by the check inside it.

A small gauge after a route's name is a rate limit the route declares: past it, the platform refuses the call. In problemsapi, /pulls/why has one.

The map shows that a check runs, and where. Whether it checks the right thing is in the program's requirements, not in the map. The line of small grey text under the map says the same about every name on it: a check, call or table is named with the label its author chose, often an AI, so a reader who doubts a name reads that rule itself.

A map can be compared with an earlier version of the program. Then a check named like “unexplained (in place of Api::unexplained)” stands where the earlier version had the check Api::unexplained, which that route no longer has. The map records the place, not what either check decides, so whether the new check does the same is a question for the code.

policy-docs.

Loading the system map.

problemsapi: a service that writes and checks maths problems, with routes for learners. It has seventeen routes, so routes with exactly the same marks share one thick line, a cable, with a count; a later topic opens them. The green box at the bottom of its wall is a later topic too.

Loading the system map.

Loading the worked examples and practice.