concept

Vector store access and lifecycle

Trusted tenant and group predicate with revision, deletion and current-state checks. A local fixture, not a full authorization system.

Formal Syntax & Structure

artificial-intelligence syntaxartificial-intelligence
eligible(record, tenant, groups, revision); materialize(candidate_ids, authoritative, tenant, groups, revision)

Working Example

Example Snippetartificial-intelligence
def materialize(candidate_ids, authoritative, tenant, groups, revision):    # Candidate keys are (tenant, local_id). Never emit cached payloads.    results = []    seen = set()    if not tenant or not revision:        return results    for key in candidate_ids:        if key in seen or key[0] != tenant:            continue        seen.add(key)        record = authoritative.get(key)        if record is None:            continue        acl = record.get("groups")        if (record.get("tenant") == tenant and record.get("revision") == revision                and record.get("deleted") is False and isinstance(acl, list)                and all(isinstance(g, str) and g for g in acl)                and set(acl) & set(groups)):            results.append(key[1])    return results
key = ("north", "a")store = {key: dict(tenant="north", groups=["staff"], revision="r1", deleted=False)}cache = [key, ("south", "a"), key]print(materialize(cache, store, "north", {"staff"}, "r1"))store[key]["deleted"] = Trueprint(materialize(cache, store, "north", {"staff"}, "r1"))