Skip to content

the overlay carries the prediction: attrs._behaviour and meta._behaviour on chant graph --live --overlay #2377

Description

@lex00

Part of #2355. The seam between the lexicon and behold, which nothing under the epic produces yet.

What

packages/core/src/behaviour.ts says where a prediction rides: one entity's PredictedBehaviour as attrs._behaviour on the graph node (line 299), and the report's meta — or the whole refusal report — as meta._behaviour on the overlay graph (lines 131–138, 421). behold #398 built its reader on exactly that channel and pins the shape as a comment there and on #2356. But git grep _behaviour packages/core/src lexicons/augur/src on main finds those doc comments and nothing else: predictBehaviour() exists (#2357), and no code path calls it from chant graph --live --overlay and writes its result onto the nodes. Today behold sees the block only from a behaviour.<env>.json report document it reads itself.

Do

When chant graph --live --overlay runs for a project whose lexicon implements predictBehaviour() and an engine is configured, call it once per graph and write each entity's block onto its node as attrs._behaviour, keyed the way the drift overlay keys entities, and the report meta (or the refusal report, whole) as meta._behaviour. No engine configured: no key on any node and no meta._behaviour — behold reads absence as "not looked", never as a refusal. A refusal: meta._behaviour carries the refusal report and no node carries a block. The engine never sees credentials: the request is built from the graph the overlay already has, not from a second read.

Proof

A test with the augur fixture engine: chant graph --live --overlay --format ir over the augur getting-started example carries a block on every mapped node and the meta on the graph; the same command with no engine variable carries neither; with an unreachable engine the meta is the refusal and no node has a block. behold's GET /api/overlay then renders the three states with no behold change (behold #398's golden tests are the reader side).

Refs #2355, #2359, INTENTIUS/behold#397, INTENTIUS/behold#398.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    behaviour-overlayCost, headroom and resilience from a behavioral engine, drawn as a colour on the nodeenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions