Documentation
¶
Overview ¶
Package surface holds the served surface of a node as a value, and the policies that decide it (concept v11, ADR 0030 "The served surface is a value under policies").
A Surface is what a controller's wildcard read of every endpoint returns: per endpoint the device types the Descriptor lists and per server cluster its revision, FeatureMap, AttributeList, AcceptedCommandList, GeneratedCommandList and the events it emits. It is canonically ordered, hashable (Surface.Digest) and JSON-encodable, and two of them compare element by element (Diff).
The surface is decided before any server is built. The device layer states what it would compose as candidate [Element]s, each with its Provenance — why it exists — and whether it is mandatory at the pin. The Policies judge every candidate (Evaluate): every policy judges every element, the verdicts merge with Refuse over Remove over Warn over Keep, a Remove of a mandatory element is kept (an operator-side policy never removes what the pin mandates), and a Refuse fails the composition (ErrRefused). The Report states the policies' digest, the effective surface read from the built servers, and at least one Decision per candidate.
What the candidates cover in this first phase (concept v11 S1): the device type, each server cluster the device layer composes, each FeatureMap bit of a cluster whose default server it builds, and each attribute, command and event the declarations or the device type add to such a server. An element a hand-written server decides internally — thermo's optional attributes for its feature selection, say — is no candidate: it appears in the effective surface only. A host's own server (a HostServer) is one cluster candidate; its features and elements are its own. The clusters the endpoint assembler mounts (Descriptor, BridgedDeviceBasicInformation, Identify, Groups, ScenesManagement) and the clusters a measurement source projects are neither candidates nor part of a device's effective surface; a node's report reads them from its assembled topology once it has one (Report.Assembled). The node adds one candidate per root feature its configuration selects that a root server declares as ahead of matter.js (concept v11 S2), and one per root cluster it mounts (concept v11 S3): mandatory for the RootNode device type's mandatory set, ProvenanceHostDeclared for a server its configuration adds, ProvenanceKitDefault for one it mounts by default.
One policy is built in and judges first: the reference policy. A server declares which of its elements implement which row of the "Ahead of matter.js" register (AheadSet); the device layer and the node tag each such candidate (Reference.Ahead), and the reference policy refuses a tagged candidate whose row Policies.Extensions does not enable (ErrExtensionNotEnabled, the error names the register ID): code that selects an ahead element the same code did not enable is a bug (ADR 0030 decision 3). A host-supplied server (device.HostServer) is neither tagged nor refused by the reference policy: its features are the host's own behaviour, and the *Ahead of matter.js* register describes this module's code.
The second built-in policy, judged next, is the level policy (Policies.Level, concept v11 §C.5): the specification level is a Matter revision matter.js has shipped, and what exists at each is the generated table of package schema (schema.Levels, from matter.js's release tags), which the device layer and the node copy into each candidate's Element.Levels. At a level below the pin it removes an optional element the level does not know, keeps one the pin mandates ("kept: mandatory at pin (absent at level <L>)"), re-adds features whose removal would leave a selection the pin's conformance rejects, never removes BridgedDeviceBasicInformation's ConfigurationVersion, and withholds an endpoint whose device type or mandated cluster the level does not know (ErrWithheld). An element no level knows — a vendor's — is not level-controlled, and Policies.ServerInternal records what a hand-written server or the endpoint assembler chose itself. The served ClusterRevision stays the pin's.
The third axis is the controller profile (Policies.Profiles, concept v11 §C.6, ADR 0030 decision 8): what a named controller ecosystem tolerates. The Profiles are generated from the evidence register notes/parity/controller_profiles.md (script/profilegen); each selected profile is a built-in policy "profile:<name>", judged after the level policy. Only a row of the confidence Reproduced removes an element (the chain keeps a mandatory one); a Reported or Inherited row keeps it with a Warn decision. A profile may imply a level, which applies when Policies.Level is "" (Policies.LevelOrigin). A profile without a Reproduced row removes nothing.
A surface that changes under a paired controller is announced (ADR 0030 decision 6, concept v11 §C.9): a node persists every endpoint's effective surface, raises the ConfigurationVersion when an endpoint comes back with another one, and reports each change as a SurfaceChange in Report.Changed. Policies.Custom takes the host's own policies, and package surfacetest has the policies the tests use.
The built-in policies never gate a whole cluster: which clusters reach an endpoint is the host's decision through the device types it declares (ADR 0030 decision 7). A Custom policy may still remove an opted-in optional cluster. The level policy removes an optional cluster only because the operator's level does not know it.
Index ¶
- Constants
- Variables
- func ElementLevels(el Element) schema.LevelSet
- func Evaluate(candidates []Element, p Policies) (kept []Element, decisions []Decision, err error)
- type Ahead
- type AheadSet
- type Change
- type Cluster
- type Confidence
- type Decision
- type Describer
- type DeviceTypeRef
- type Effect
- type Element
- type ElementPattern
- type Endpoint
- type Extensions
- type Kind
- type Level
- type Policies
- type Policy
- type Profile
- type ProfileRule
- type Provenance
- type Reference
- type RefusedError
- type Report
- type Reporter
- type Surface
- type SurfaceChange
- type Verdict
- type WithheldError
Constants ¶
const ( // ReasonFeatureSetInvalid keeps a feature the level does not know // because the cluster's remaining selection fails its conformance at // the pin without it. ReasonFeatureSetInvalid = "kept: feature selection invalid at pin without it" // ReasonSurfaceChangeSignal keeps BridgedDeviceBasicInformation's // ConfigurationVersion at every level (concept v11 §D.9). ReasonSurfaceChangeSignal = "kept: surface-change signal (concept v11 D.9)" // ReasonServerInternal keeps an effective element the level does not // know that no candidate decided: a hand-written server's own choice. ReasonServerInternal = "kept: server-internal, not level-controlled" )
The level policy's reasons.
Variables ¶
var ErrExtensionNotEnabled = errors.New("surface: ahead-of-matter.js extension not enabled")
ErrExtensionNotEnabled is wrapped by the *RefusedError Evaluate returns when the built-in reference policy refuses an element: a candidate tagged with an "Ahead of matter.js" register row (Reference.Ahead) the Policies.Extensions do not enable. The code selected an element the same code did not enable (ADR 0030 decision 3).
var ErrLevelAbovePin = errors.New("surface: specification level above the pin")
ErrLevelAbovePin is returned by Policies.Validate for a level above the pin's revision. schema.Levels lists none; a host that passes an operator's string gets it for "1.7".
var ErrProfileLevelConflict = errors.New("surface: selected controller profiles imply different levels")
ErrProfileLevelConflict is returned by Policies.Validate when two selected profiles imply different levels and no explicit Policies.Level decides.
var ErrRefused = errors.New("surface: composition refused")
ErrRefused is wrapped by the *RefusedError Evaluate returns when a policy refuses an element.
var ErrUnknownLevel = errors.New("surface: unknown specification level")
ErrUnknownLevel is returned by Policies.Validate for a level schema.Levels does not list.
var ErrUnknownProfile = errors.New("surface: unknown controller profile")
ErrUnknownProfile is returned by Policies.Validate for a profile name the register does not list.
var ErrWithheld = errors.New("surface: device withheld by the specification level")
ErrWithheld is wrapped by the *WithheldError a composition returns when the specification level does not know the device's type or a cluster the type mandates: the device is not composed, its report is (concept v11 §C.3 — an operator's setting withholds, it never fails the node).
Functions ¶
func ElementLevels ¶
ElementLevels returns the levels the element exists at, from the generated table (schema.ClusterLevels and its siblings): what the device layer and the node fill Element.Levels with.
func Evaluate ¶
Evaluate judges every candidate by every policy — the built-in reference policy first, then Policies.Custom; no policy short-cuts another — and returns the elements kept, in candidate order, and the decisions. Every verdict other than a plain Keep is a decision; an element no policy spoke about has one Keep decision with Policy "", so every candidate appears at least once. A Warn keeps the element and is recorded whatever its reason.
A Remove of a Mandatory element is kept: the decision is rewritten to Keep, its reason "kept: mandatory at pin (<the policy's reason>)". A Refuse stays a Refuse whatever the element. Any Refuse fails the evaluation with a *RefusedError naming every refusing decision; the decisions are returned beside it. When the reference policy refused, the error also matches ErrExtensionNotEnabled and names the register IDs. Without a refusal, a level that does not know a candidate device type or mandated cluster fails it with a *WithheldError (ErrWithheld), the decisions beside it. A Policies.Level Policies.Validate rejects fails it before any judgement.
Types ¶
type Ahead ¶
type Ahead struct {
// Features are the FeatureMap bits the row implements.
Features uint32
// Attributes, Commands and Events are the optional elements the row
// adds beside its features.
Attributes []uint32
Commands []uint32
Events []uint32
}
Ahead names the elements of one cluster server that implement one row of the "Ahead of matter.js" register (notes/parity/by_design.md): surface matter.js does not serve at the pin.
type AheadSet ¶
AheadSet is a cluster server's declaration of its ahead-of-matter.js elements: register ID → the elements that implement the row. A server package exports one next to the server; the device layer and the node tag each candidate it names (Element.Reference.Ahead).
type Change ¶
Change is one difference between two surfaces (Diff): the element of kind Kind with ID on cluster Cluster of the endpoint with key Endpoint, as it reads before and after. An absent element reads "".
What Before and After say per kind: a device type and a cluster its revision ("revision 4"); a feature, ID its one-bit mask, "set"; an attribute and an event "served"; a command "accepted" or "generated", one Change per list.
func Diff ¶
Diff returns every difference from a to b, endpoint by endpoint in key order (the root first), then device types, then clusters by ID; an empty slice when a controller could not tell them apart. Endpoint numbers are no difference. A device type is one Change per id: its entries' revisions ("revision 3", or "revision 3, revision 2" for an id listed twice) when they differ, else its positions in the DeviceTypeList ("position 0") when only the order moved. An endpoint or a cluster that only one side has is one Change per device type or one per cluster, not one per element.
type Cluster ¶
type Cluster struct {
ID uint32
Revision uint16
FeatureMap uint32
Attributes []uint32
Accepted []uint32
Generated []uint32
Events []uint32
}
Cluster is one server cluster's surface: its ClusterRevision and FeatureMap, and its four lists, each sorted ascending. Attributes includes the global attributes as the dispatcher serves them.
type Confidence ¶
type Confidence uint8
Confidence is how a row of the controller-profiles register (notes/parity/controller_profiles.md) knows what it states: the levels of docs/matter-ecosystem-observations.md.
const ( // Reproduced: observed against a real controller during this // project's own bring-up, with the evidence named in the row. Only a // Reproduced rule removes an element (concept v11 E.5). Reproduced Confidence = iota + 1 // Inherited: taken from matter.js, not independently reproduced here. Inherited // Reported: a third-party report acted on but not reproduced. Reported )
Confidences. The zero value is no confidence.
func (Confidence) String ¶
func (c Confidence) String() string
String returns the confidence's name as the register spells it ("Reproduced", "Inherited", "Reported").
type Decision ¶
Decision is one policy's verdict on one element. Policy is "" on the row that records an element no policy spoke about.
type Describer ¶
type Describer interface {
Describe() string
}
Describer is a Policy whose name alone does not identify what it judges: Describe returns a stable description of its parameters, which Policies.Digest covers beside the name.
type DeviceTypeRef ¶
DeviceTypeRef is one entry of a Descriptor's DeviceTypeList.
type Effect ¶
type Effect uint8
Effect is what a ProfileRule does.
const ( // EffectRemove removes the element the rule names — only when the // rule's confidence is [Reproduced]; any other confidence warns. EffectRemove Effect = iota + 1 // EffectWarn keeps the element with a warning decision. EffectWarn // EffectLevel sets the profile's specification level ([Profile].Level). EffectLevel )
Effects. The zero value is no effect.
type Element ¶
type Element struct {
// Endpoint is the endpoint's rendered StableKey; "" for the root.
Endpoint string
// Cluster is the cluster id; 0 for a device type.
Cluster uint32
Kind Kind
// ID is the device type id, the cluster id, the feature's one-bit
// mask, or the attribute, command or event id.
ID uint32
Provenance Provenance
Reference Reference
// Mandatory: removing the element would make the composition invalid
// at the pin — the device type mandates it, or the cluster's
// conformance does for the selected features.
Mandatory bool
// Levels are the specification levels the element exists at
// ([ElementLevels], from the generated table); the device layer and
// the node fill it. 0 is an element no level knows — a vendor's — which
// the level policy does not control. It is not part of the JSON.
Levels schema.LevelSet
}
Element is one candidate of an endpoint's surface.
type ElementPattern ¶
ElementPattern names the elements a ProfileRule is about, on every endpoint: a feature of a cluster (ID is its one-bit mask), an attribute, a command or an event of a cluster, or a device type (Cluster 0). The zero value — a level rule's — matches nothing.
func (ElementPattern) Matches ¶
func (p ElementPattern) Matches(e Element) bool
Matches reports whether e is an element the pattern names.
func (ElementPattern) String ¶
func (p ElementPattern) String() string
String renders the pattern in the register's form: "cluster 0x0201 feature MSCH" (the feature's code from the pin's schema, its mask when the schema names none), "cluster 0x0006 attribute 0x4000", "device-type 0x0301", and "level" for the zero value.
type Endpoint ¶
type Endpoint struct {
// Key is the endpoint's rendered StableKey; "" for the root.
Key string
// Number is the endpoint number, 0 until the endpoint is assembled. It
// is not part of any digest.
Number uint16
// DeviceTypes are the device types in the order the Descriptor lists
// them.
DeviceTypes []DeviceTypeRef
// Clusters are the server clusters, ordered by ID.
Clusters []Cluster
}
Endpoint is one endpoint's surface.
type Extensions ¶
type Extensions map[string]struct{}
Extensions are the "Ahead of matter.js" register IDs a host enables (Policies.Extensions). An ID this module does not declare is allowed: a host may enable a row before the module ships it.
func NewExtensions ¶
func NewExtensions(ids ...string) Extensions
NewExtensions returns the extensions ids.
func (Extensions) Has ¶
func (e Extensions) Has(id string) bool
Has reports whether the register ID id is enabled.
func (Extensions) IDs ¶
func (e Extensions) IDs() []string
IDs returns the enabled register IDs, sorted.
type Kind ¶
type Kind uint8
Kind is what an Element or a Change is about.
const ( KindDeviceType Kind = iota + 1 KindCluster KindFeature KindAttribute KindCommand KindEvent )
Kinds. The zero value is no kind.
func (Kind) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (Kind) String ¶
String returns the kind's name ("device-type", "cluster", "feature", "attribute", "command", "event").
func (*Kind) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type Level ¶
Level is a specification level (schema.Level): a Matter revision matter.js has shipped a release for. Policies.Level selects one; "" is the pin's.
type Policies ¶
type Policies struct {
// Extensions are the "Ahead of matter.js" register rows the host
// enables. The built-in reference policy, judged first, refuses a
// candidate tagged with a row ([Reference].Ahead) not in it
// ([ErrExtensionNotEnabled]). node.AheadRows lists every row the
// module's servers declare.
Extensions Extensions
// Level is the specification level the node composes at ([Level]):
// the built-in level policy, judged after the reference policy,
// removes the optional surface the level does not know, keeps what
// the pin mandates and withholds a device whose type or mandated
// cluster it does not know ([ErrWithheld]). "" is the pin's level,
// which changes nothing.
Level Level
// Profiles are the controller profiles the operator selects, by name
// ([Profiles], [ProfileByName]): one built-in policy "profile:<name>"
// per profile, judged after the level policy, removes what a
// Reproduced row of the register names (a mandatory element is kept)
// and records a warning for every other row that names an element. A
// profile's level applies when Level is "". An unknown name fails
// [Policies.Validate] ([ErrUnknownProfile]), and so do two profiles
// with different levels and no explicit Level
// ([ErrProfileLevelConflict]).
Profiles []string
// Custom are the host's own policies, judged in order after the
// built-in ones.
Custom []Policy
// contains filtered or unexported fields
}
Policies are the policies a node composes its devices under. The zero value enables no extension and adds no custom policy: every candidate of the matter.js baseline is served, and an ahead-of-matter.js candidate is refused.
func (Policies) Digest ¶
Digest identifies the policies: the SHA-256 over the enabled extensions, sorted, the effective level when it is not the pin's, the selected profile names, sorted, then every custom policy's kind, name and description, in order. The zero value has a fixed digest, and a Level naming the pin's level has the same one: the two compose alike. A profile the register lists is identified by its name; one package surfacetest injected also by its rules. A device carries the digest of the policies it was composed under, and a node refuses a device whose digest is not its own.
func (Policies) EffectiveLevel ¶
EffectiveLevel is the level p composes at: Policies.Level when it is set, else the level the selected Policies.Profiles agree on, else the pin's (Policies.LevelOrigin names which).
func (Policies) LevelOrigin ¶
LevelOrigin names where Policies.EffectiveLevel comes from: "explicit" for Policies.Level, "profile <name>[, <name>…]" for the selected profiles that set it, "pin" otherwise.
func (Policies) Report ¶
Report returns the head of a report composed under p: the policies' digest, the effective level and its origin, the selected profiles and the enabled extensions, each sorted and each once; no surface and no decision. device.Device and the node start their reports with it.
func (Policies) ServerInternal ¶
ServerInternal returns the level policy's keep decisions on the elements of the effective endpoint ep that the level of p does not know and no element of decided names: what a hand-written server or the endpoint assembler chose itself (ReasonServerInternal) — and on BridgedDeviceBasicInformation's ConfigurationVersion, which the assembler mounts on every bridged endpoint, the rule that keeps it at every level (ReasonSurfaceChangeSignal, concept v11 §D.9). It returns none at the pin's level. A feature is its one-bit mask. A command id's levels are those of the directions the endpoint serves it in: a request's where the id is accepted, a response's where it is generated, both where it is both — the level table keys a command id by its direction (review II R2-P6-par-2713, owner decision 227).
func (Policies) Validate ¶
Validate rejects a level schema.Levels does not list: ErrLevelAbovePin for one above the pin, ErrUnknownLevel otherwise; then a profile name the register does not list (ErrUnknownProfile), and two selected profiles with different levels when Level is "" (ErrProfileLevelConflict). device.New and node.New call it first.
type Policy ¶
Policy is one rule about the surface. Judge sees every candidate element and returns its verdict with a reason; the reason is "" for a plain Keep. Name identifies the policy in a Decision and, with its Describer description, in Policies.Digest.
type Profile ¶
type Profile struct {
Name string
// Level is the level a register row sets for the profile; "" when no
// row sets one.
Level Level
Rules []ProfileRule
}
Profile is a named controller ecosystem's tolerances (concept v11 §C.6, ADR 0030 decision 8): rules that remove or warn about elements, and optionally the level the profile implies. It is the device-side twin of the client side's eligibility.Compat. Profiles are generated from the evidence register notes/parity/controller_profiles.md (script/profilegen); a host selects them by name in Policies.Profiles.
func ProfileByName ¶
ProfileByName returns the register's profile called name.
type ProfileRule ¶
type ProfileRule struct {
// Element is the register row's Element cell; the zero value for a
// level row.
Element ElementPattern
Effect Effect
// Level is the level an [EffectLevel] row sets.
Level Level
Confidence Confidence
// Source names the evidence; Reason is the row's one sentence.
Source, Reason string
}
ProfileRule is one row of the controller-profiles register.
type Provenance ¶
type Provenance uint8
Provenance is why a candidate Element exists.
const ( // ProvenanceClusterMandatory: the cluster's own conformance makes the // feature or element mandatory for the selected features. ProvenanceClusterMandatory Provenance = iota + 1 // ProvenanceDeviceType: the device type mandates the cluster, the feature // or the element — or is the element. ProvenanceDeviceType // ProvenanceHostDeclared: the host declared it — a feature selection, an // optional element or initial value, an opted-in optional cluster, a // host's own server. ProvenanceHostDeclared // ProvenanceKitDefault: a server's own optional choice — an optional root // cluster the node mounts by default, an element a hand-written server // serves on its own (the level policy's server-internal decisions). ProvenanceKitDefault )
Provenances. The zero value is no provenance. The text form keeps the JSON key "origin" of a persisted surface, so a stored surface reads back unchanged (review 2026-11 W5-api-17).
func (Provenance) MarshalText ¶
func (o Provenance) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler.
func (Provenance) String ¶
func (o Provenance) String() string
String returns the provenance's name.
func (*Provenance) UnmarshalText ¶
func (o *Provenance) UnmarshalText(b []byte) error
UnmarshalText implements encoding.TextUnmarshaler.
type Reference ¶
type Reference struct {
// Ahead is the register ID; "" is the matter.js baseline. The device
// layer and the node set it from the servers' [AheadSet] declarations;
// the built-in reference policy refuses it unless
// [Policies].Extensions enables the row.
Ahead string
}
Reference is the reference an element is served against: matter.js's baseline, or an entry of the "Ahead of matter.js" register.
type RefusedError ¶
type RefusedError struct {
Decisions []Decision
// contains filtered or unexported fields
}
RefusedError names every refusing decision of one evaluation.
func (*RefusedError) Error ¶
func (e *RefusedError) Error() string
Error names each refusal: the policy, the element and the reason; when the reference policy refused, the register IDs first.
func (*RefusedError) Is ¶
func (e *RefusedError) Is(target error) bool
Is reports whether target is ErrExtensionNotEnabled and the reference policy refused at least one element; errors.Is finds ErrRefused through Unwrap.
type Report ¶
type Report struct {
Policies [32]byte
// Level is the specification level the surface was composed at: the
// pin's when neither [Policies].Level nor a selected profile sets one.
Level Level
// LevelOrigin names where Level comes from ([Policies.LevelOrigin]):
// "explicit", "profile <name>[, <name>…]" or "pin".
LevelOrigin string
// Profiles are the selected controller profiles ([Policies].Profiles),
// sorted, each once.
Profiles []string
// Extensions are the enabled "Ahead of matter.js" register IDs
// ([Policies].Extensions), sorted; nil when none is enabled. A host's
// pages show them next to the level and the profiles.
Extensions []string
Effective Surface
// Decisions has at least one row per candidate element ([Evaluate]).
Decisions []Decision
// Withheld are the elements the level policy withheld its endpoint
// for: a device type or a mandated cluster the level does not know.
Withheld []Element
// Assembled reports that Effective was read from the assembled
// topology: every endpoint as the endpoint assembler mounts it, its
// clusters (Descriptor, BridgedDeviceBasicInformation, Identify,
// Groups, ScenesManagement, Binding, measurement clusters) and its
// device types (BridgedNode) included. False is the device-level view
// before the first assembly: each device's own servers and device type.
Assembled bool
// Changed are the surface changes the reporter announced in this
// process ([SurfaceChange]), oldest first; a node keeps the last 100.
Changed []SurfaceChange
}
Report is what a device or a node states about its surface: the digest of the policies it was composed under, the effective surface read from its built servers, and every decision.
func (Report) MarshalJSON ¶
MarshalJSON implements json.Marshaler: the canonical encoding of Surface.MarshalJSON, the policies' digest in hex, the decisions and withheld elements in their order, their ids in hex as wide as their kind says (a feature's mask eight digits), and the announced changes, their digests in hex and their time in RFC 3339; the selected profiles and the level's origin.
func (*Report) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler for the encoding Report.MarshalJSON writes.
type Reporter ¶
type Reporter interface {
Surface() Report
}
Reporter is anything that reports its surface: a device.Device, a node.
type Surface ¶
Surface is the served surface of a node: the root endpoint and every other endpoint, ordered by Key.
func (Surface) Digest ¶
Digest is the SHA-256 of the canonical JSON of s with every endpoint number left out: two surfaces a controller cannot tell apart have the same digest, wherever their endpoints are numbered.
func (Surface) MarshalJSON ¶
MarshalJSON implements json.Marshaler: the canonical encoding — object keys sorted, no insignificant whitespace, endpoints by key, clusters by ID, every id list ascending and present (empty as []), device types in Descriptor order, endpoint numbers only where assembled. Every id is a lower-case hex string with the 0x prefix: four digits for a device type and a cluster ("0x0201"), eight for an attribute, command or event and for the FeatureMap ("0x00000000"); revisions and endpoint numbers are decimal.
func (*Surface) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler for the encoding Surface.MarshalJSON writes; an id may also be a decimal number.
type SurfaceChange ¶
SurfaceChange is one announced change of an endpoint's served surface (ADR 0030 decision 6, concept v11 §C.9): the endpoint with key Endpoint came back — after a restart, a reassembly or a replacement — with an effective surface whose Endpoint.Digest is After where the one last persisted for it was Before, and its node raised the ConfigurationVersion at At. Changes is the Diff of the two, empty when the earlier surface itself was not available (only its digest was).
type Verdict ¶
type Verdict uint8
Verdict is a policy's judgement of one element.
const ( // Keep serves the element; the zero value. Keep Verdict = iota // Warn serves the element and flags it: the policy has evidence // against it that does not remove it — a controller profile's row of // a confidence below Reproduced. The element stays in the surface; the // decision is always recorded, so a reader counts warnings by this // verdict and never by the reason's text. Warn // Remove composes without the element: a choice the code could not // foresee, an operator's setting. A mandatory element is kept. Remove // Refuse fails the composition: two decisions of the same developer // contradict each other. Refuse )
Verdicts, in ascending precedence: when several policies judge an element, Refuse wins over Remove, Remove over Warn, Warn over Keep.
func (Verdict) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (*Verdict) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type WithheldError ¶
type WithheldError struct {
Endpoint string
Elements []Element
// Report is the endpoint's report: the policies' digest, the
// decisions so far and the withheld elements; the effective surface
// is empty.
Report Report
}
WithheldError names the endpoint a level withheld and the elements the level does not know: the device type, the mandated clusters.
func (*WithheldError) Error ¶
func (e *WithheldError) Error() string
Error names the endpoint, the level and each element.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package surfacetest has the policies the tests of a surface policy chain use: one that removes, one that refuses and one that keeps the elements it matches.
|
Package surfacetest has the policies the tests of a surface policy chain use: one that removes, one that refuses and one that keeps the elements it matches. |