The derived-value record is ADR 0202 (was 0201)

The key-value-buckets record took 0201 on main while this waited to merge.
Only the comments citing the derived-value work move; this repository's other
0201 citations are the buckets record's own and stay.
This commit is contained in:
2026-10-04 04:33:56 +02:00
parent 1363a2fe27
commit 75b2676d32
5 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -61,7 +61,7 @@ func knownFor(m Manifest, needs []Needed, node string) (map[string]map[string]st
"as": as, "as": as,
} }
// What the provider derives for this consumer rather than for all of them // What the provider derives for this consumer rather than for all of them
// (novox/hq ADR 0201). Filled here, the one place a provision and the module // (novox/hq ADR 0202). Filled here, the one place a provision and the module
// requiring it are both in hand. // requiring it are both in hand.
served, err := ServedTo(n.Serves, as) served, err := ServedTo(n.Serves, as)
if err != nil { if err != nil {
+4 -4
View File
@@ -8,7 +8,7 @@ import (
) )
// What a provider derives for one consumer, said once in the provider's definition and delivered // What a provider derives for one consumer, said once in the provider's definition and delivered
// to both ends (novox/hq ADR 0201, issue 124). // to both ends (novox/hq ADR 0202, issue 124).
// //
// A `serves` block is otherwise literal: the same values for every consumer. Where the provider // A `serves` block is otherwise literal: the same values for every consumer. Where the provider
// *names the resource* — a bucket, a database, a vhost — the name is derived from who is asking, // *names the resource* — a bucket, a database, a vhost — the name is derived from who is asking,
@@ -165,7 +165,7 @@ func sortedAnyKeys(values map[string]any) []string {
} }
// derivedFor is what the provider on this machine derives for one consumer of one provision // derivedFor is what the provider on this machine derives for one consumer of one provision
// (novox/hq ADR 0201). // (novox/hq ADR 0202).
// //
// Settled first, then derived: an operator may set a prefix on what the provider serves and the // Settled first, then derived: an operator may set a prefix on what the provider serves and the
// mesh still fills the consumer's half of it ([ADR 0174]). Only the keys that actually name the // mesh still fills the consumer's half of it ([ADR 0174]). Only the keys that actually name the
@@ -213,7 +213,7 @@ func (r Resolution) derivedFor(provision, as, consumer, local string, settings S
"%s keeps several holders of %s (this one is %q), and %s derives %s for each "+ "%s keeps several holders of %s (this one is %q), and %s derives %s for each "+
"consumer from the login the mesh minted. Each holder has its own login, and a "+ "consumer from the login the mesh minted. Each holder has its own login, and a "+
"consumer is told one value per requirement — so the two ends would name "+ "consumer is told one value per requirement — so the two ends would name "+
"different things and nothing would compare them (novox/hq ADR 0201)", "different things and nothing would compare them (novox/hq ADR 0202)",
consumer, local, provision, m.Module, orNothing(sortedAnyKeys(names))) consumer, local, provision, m.Module, orNothing(sortedAnyKeys(names)))
} }
settled, err := Settle(names, settings[m.Module]) settled, err := Settle(names, settings[m.Module])
@@ -230,7 +230,7 @@ func (r Resolution) derivedFor(provision, as, consumer, local string, settings S
} }
// notTranscribed refuses a consumer's file that writes out the value its provider derives for it, // notTranscribed refuses a consumer's file that writes out the value its provider derives for it,
// instead of asking for it (novox/hq ADR 0201, issue 124). // instead of asking for it (novox/hq ADR 0202, issue 124).
// //
// **What would have caught the one wrong instance.** The object store's three consumers each wrote // **What would have caught the one wrong instance.** The object store's three consumers each wrote
// their bucket into their own configuration by hand. One of them named a predecessor's bucket, and // their bucket into their own configuration by hand. One of them named a predecessor's bucket, and
+3 -3
View File
@@ -647,7 +647,7 @@ func (r Resolution) compose(with Rendering, owner map[string]string,
} }
as := ConsumerIdentity(r.Node, IdentitySource(m.Slug, m.Module)) as := ConsumerIdentity(r.Node, IdentitySource(m.Slug, m.Module))
// What the provider derives for THIS consumer, filled here where the consumer is // What the provider derives for THIS consumer, filled here where the consumer is
// known (novox/hq ADR 0201). The same fill knownFor does below, so the binding file // known (novox/hq ADR 0202). The same fill knownFor does below, so the binding file
// and the module's `${bound:…}` substitutions cannot say different things. // and the module's `${bound:…}` substitutions cannot say different things.
told := *found told := *found
told.Serves, err = ServedTo(told.Serves, as) told.Serves, err = ServedTo(told.Serves, as)
@@ -777,7 +777,7 @@ func (r Resolution) compose(with Rendering, owner map[string]string,
// And the machine underneath, which no binding of its own can tell it. // And the machine underneath, which no binding of its own can tell it.
thisMachine := machineFacts(r, with.Names, with.MeshRange) thisMachine := machineFacts(r, with.Names, with.MeshRange)
// **A definition that already holds the answer transcribed it** (novox/hq ADR 0201). // **A definition that already holds the answer transcribed it** (novox/hq ADR 0202).
// Judged over what the module itself declares, and before anything is substituted: the // Judged over what the module itself declares, and before anything is substituted: the
// mesh's own generated files — the binding, the contributions — legitimately carry the // mesh's own generated files — the binding, the contributions — legitimately carry the
// derived value, and after substitution so does every consumer's file, so this is the one // derived value, and after substitution so does every consumer's file, so this is the one
@@ -1212,7 +1212,7 @@ type Contribution struct {
// is what makes swapping one for another cost nothing. // is what makes swapping one for another cost nothing.
Values map[string]any `json:"values"` Values map[string]any `json:"values"`
// Derived is what this provider's own definition said it derives for this consumer, already // Derived is what this provider's own definition said it derives for this consumer, already
// derived (novox/hq ADR 0201). // derived (novox/hq ADR 0202).
// //
// **The provider is told, rather than recomputing it.** A served value may name the consumer's // **The provider is told, rather than recomputing it.** A served value may name the consumer's
// identity — a bucket named for who is asking, a database prefixed with it — and before this // identity — a bucket named for who is asking, a database prefixed with it — and before this
@@ -7,7 +7,7 @@ import (
) )
// What a provider derives for each consumer, said once and delivered to both ends // What a provider derives for each consumer, said once and delivered to both ends
// (novox/hq ADR 0201, issue 124). // (novox/hq ADR 0202, issue 124).
// //
// The failure these are written against: the object store's provisioner derived each consumer's // The failure these are written against: the object store's provisioner derived each consumer's
// bucket from the login the mesh minted, in its own code, and the mesh had no channel to tell the // bucket from the login the mesh minted, in its own code, and the mesh had no channel to tell the
+1 -1
View File
@@ -1439,7 +1439,7 @@ func ParseManifest(raw []byte) (Manifest, error) {
"%s serves %q to whoever requires it, and does not provide it", m.Module, to)) "%s serves %q to whoever requires it, and does not provide it", m.Module, to))
} }
} }
// A served value may be derived for the consumer it is served to (novox/hq ADR 0201). Read // A served value may be derived for the consumer it is served to (novox/hq ADR 0202). Read
// here, where the definition is, rather than when somebody first requires it: a rule that // here, where the definition is, rather than when somebody first requires it: a rule that
// would be refused at the first consumer is wrong from the moment it is written. // would be refused at the first consumer is wrong from the moment it is written.
problems = append(problems, CheckServes(m)...) problems = append(problems, CheckServes(m)...)