Contextfulv0.23.0

Docs / Specification

contract disclosure · 60-visibility.md · 61-disclosure.md · 62-accountability.md · guide · card

Source-faithful visibility

A workspace serving a whole organization answers each reader inside the audience the originating source drew. This file holds the mirrored permission state, its observation clock, the resolution of a subject to the resources it reaches, the age budget on that state, the fidelity a table claims, and the pack that lands a source.

Mirrored permission state, from the source’s permission endpoint to the reader’s view:

Flowchart diagram Flowchart, top to bottom. 10 nodes, 12 edges. connector pack → visibility block [access mapping]; → ACL sweep job [cadence defaults] source permission endpoint → ACL sweep job [grants] federated source → registered statement [reader's credential] run: ACL sweep job → access tables [full, incremental, webhook] authority: admitted subject → semi-join filter [subject identity] disclosure: visibility block → lag within bound? [staleness budget] disclosure: access tables → semi-join filter [reachable resources]; → lag within bound? [watermark_at] disclosure: lag within bound? → admitted subject [no: VisibilityAccessStale]; → semi-join filter [yes] disclosure: semi-join filter → registered statement [compiled into] read: registered statement run ACL sweep job authority admitted subject disclosure reachable resources watermark_at staleness budget yes visibility block access tables lag within bound? semi-join filter read registered statement access mapping cadence defaults grants full, incremental, webhook subject identity no: VisibilityAccessStale compiled into reader's credential connector pack source permission endpoint federated source

mirror

The three-way conjunction, the access tables as store data, and the binding that compiles a table’s semi-join.

sweep

Observation of one source’s permission state: sweep kinds, the observation clock, the coverage watermark, tombstones and revocation.

unsettled: Does visibility sweep given no --grants file read the source’s permission endpoint under the block’s credential? owner: disclosure affects: disclosure.sweep

reach

Per-request resolution of a subject to the resources it reaches, the bounded group closure, and the reachable-set cache.

bound-staleness

The declared age budget on mirrored authorization, the refusal past it, and the one narrowing posture.

declare-fidelity

The fidelity level a table claims, the source family bounding the claim, and live federation under a reader’s delegated credential.

unsettled: Does a grants mapping refuse a roster read from content, a sharing engine’s inputs, or a federated result cached without its subject? owner: disclosure affects: disclosure.declare-fidelity

pack

The reviewed unit landing one source: a manifest fragment plus a connector pin, its access mapping, defaults and container allowlist.

drive-sweep

Mapping Drive file permissions into the governed source’s visibility rows.

Scenarios

Shapes

The access tables, each at _visibility/<source>/<name>. Every instant is an engine UTC instant taken when the sweep read the source.

CREATE TABLE resources (
  resource_id       VARCHAR NOT NULL,
  source            VARCHAR NOT NULL,
  resource_kind     VARCHAR NOT NULL,
  container_id      VARCHAR,
  visibility_class  VARCHAR NOT NULL,   -- mirrored | coarse | federated | unknown
  acl_observed_at   TIMESTAMP NOT NULL,
  acl_sweep_kind    VARCHAR NOT NULL,   -- full | incremental | webhook
  acl_sweep_id      VARCHAR NOT NULL
);

CREATE TABLE grants (
  resource_id       VARCHAR NOT NULL,
  principal         VARCHAR NOT NULL,
  principal_kind    VARCHAR NOT NULL,   -- user | group | team | channel | org | public
  level             VARCHAR NOT NULL,   -- source spelling, projected by the mapping
  expires_at        TIMESTAMP,          -- set on an operator-landed opening
  acl_observed_at   TIMESTAMP NOT NULL,
  acl_sweep_kind    VARCHAR NOT NULL,
  acl_sweep_id      VARCHAR NOT NULL
);

CREATE TABLE principals (
  principal         VARCHAR NOT NULL,
  principal_kind    VARCHAR NOT NULL,
  source_label      VARCHAR
);

CREATE TABLE group_members (
  "group"           VARCHAR NOT NULL,
  member            VARCHAR NOT NULL,
  member_kind       VARCHAR NOT NULL,
  acl_observed_at   TIMESTAMP NOT NULL
);

CREATE TABLE identity_links (
  source_principal  VARCHAR NOT NULL,
  subject           VARCHAR NOT NULL,
  method            VARCHAR NOT NULL,   -- scim_email | oidc_sub | operator_asserted
  confidence        DOUBLE
);

CREATE TABLE tombstones (
  scope             VARCHAR NOT NULL,   -- resource | grant | principal
  resource_id       VARCHAR,
  principal         VARCHAR,
  level             VARCHAR,
  revoked_at        TIMESTAMP NOT NULL
);

CREATE TABLE freshness (
  source              VARCHAR NOT NULL,
  epoch               BIGINT NOT NULL,      -- one per committed run
  sweep_id            VARCHAR NOT NULL,     -- the run whose resources and grants rows are current
  sweep_kind          VARCHAR NOT NULL,
  watermark_at        TIMESTAMP,            -- null until a run reads every governed resource
  last_full_sweep_at  TIMESTAMP,
  last_incremental_at TIMESTAMP,
  lag_seconds         BIGINT,
  budget_seconds      BIGINT
);

A bound content table, the sweep feeding it, and a pack’s mapping:

[pipeline.tables.pages.visibility]
source             = "wiki"
resource_key       = "page_id"
resource_kind      = "page"
fidelity           = "mirrored"
family             = "item-exception"
max_acl_staleness  = "15m"
on_stale           = "refuse"

[[acl_sweep]]
source        = "wiki"
credential    = "secret://wiki/permission-reader"
enumerate     = "pages"
full          = { every = "1h" }
incremental   = { every = "5m" }
events        = { stream = "wiki.permissions", gap_detectable = true }

[pack.wiki]
tables         = ["pages", "drafts"]
excluded       = ["drafts"]
allowlist      = { containers = ["eng", "ops"], evaluate = "all-of" }

[pack.wiki.access.pages]
resource_key   = "page_id"
resource_kind  = "page"
family         = "item-exception"
principal_kind = { user = "user", group = "group", workspace = "org", anyone = "public" }
level          = { viewer = "read", commenter = "read", editor = "write", owner = "admin" }

The levels each source family permits:

Source familymirroredcoarsefederatedexcluded
container-rosteryesyesyesyes
item-exceptionyesyesyesyes
person-container——yesyes
directory———yes

The envelope a bound read returns:

{
  "rows": 42,
  "visibility": {
    "fidelity": "coarse",
    "grain": "teamspace",
    "acl_lag_seconds": 212,
    "acl_budget_seconds": 900,
    "degraded": false,
    "group_closure_depth": 3,
    "federated_legs": [{ "source": "drive", "outcome": "timeout", "citations": 0 }]
  }
}