Build immutable policy publication artifact

This commit is contained in:
tegwick 2026-08-18 12:16:04 +02:00
parent cac0301866
commit e8035f3887
22 changed files with 2375 additions and 452 deletions

View file

@ -0,0 +1,73 @@
# Uses the estate's tier-2 container-build runner and organization-scoped
# REGISTRY_USER / REGISTRY_TOKEN secrets.
name: Build and publish policy-nexus image
on:
push:
branches:
- main
paths:
- ".forgejo/workflows/publish-image.yaml"
- "Containerfile"
- "deploy/**"
- "publication.json"
- "tests/**"
- "tools/**"
workflow_dispatch:
env:
REGISTRY: forgejo.coulomb.social
IMAGE_NAME: coulomb/policy-nexus
DOCKER_HOST: tcp://127.0.0.1:2375
jobs:
build-and-push:
runs-on: container-build
steps:
- name: Build, verify, and publish immutable policy artifact
env:
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
run: |
set -eu
REF="${GITHUB_SHA:-main}"
SHORT="${REF:0:7}"
mkdir -p buildctx/_sources/net-kingdom "${HOME}/bin"
wget -qO /tmp/policy-nexus.tar.gz \
"https://forgejo.coulomb.social/${GITHUB_REPOSITORY}/archive/${SHORT}.tar.gz"
tar xzf /tmp/policy-nexus.tar.gz -C buildctx --strip-components=1
NETKINGDOM_REVISION=$(git ls-remote \
https://forgejo.coulomb.social/coulomb/net-kingdom.git \
refs/heads/main | awk '{print $1}')
test -n "$NETKINGDOM_REVISION"
NETKINGDOM_SHORT="$(printf '%s' "$NETKINGDOM_REVISION" | cut -c1-7)"
wget -qO /tmp/net-kingdom.tar.gz \
"https://forgejo.coulomb.social/coulomb/net-kingdom/archive/${NETKINGDOM_SHORT}.tar.gz"
tar xzf /tmp/net-kingdom.tar.gz \
-C buildctx/_sources/net-kingdom --strip-components=1
wget -qO- https://download.docker.com/linux/static/stable/x86_64/docker-27.3.1.tgz \
| tar xz --strip-components=1 -C "${HOME}/bin" docker/docker
export PATH="${HOME}/bin:${PATH}"
docker version
echo "${REGISTRY_TOKEN}" | docker login "${REGISTRY}" \
-u "${REGISTRY_USER}" --password-stdin
IMAGE="${REGISTRY}/${IMAGE_NAME}"
docker build \
--file buildctx/Containerfile \
--build-arg "VCS_REVISION=${REF}" \
--build-arg "NETKINGDOM_REVISION=${NETKINGDOM_REVISION}" \
--tag "${IMAGE}:git-${REF}" \
--tag "${IMAGE}:main" \
buildctx
docker push "${IMAGE}:git-${REF}"
docker push "${IMAGE}:main"
PUBLICATION_DIGEST=$(docker run --rm --entrypoint sha256sum \
"${IMAGE}:git-${REF}" /usr/share/nginx/html/publication-manifest.json \
| awk '{print $1}')
echo "published=${IMAGE}:git-${REF}"
echo "publication_manifest_digest=${PUBLICATION_DIGEST}"

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
__pycache__/
*.py[cod]

20
.repo-classification.yaml Normal file
View file

@ -0,0 +1,20 @@
repo_classification:
standard: Repo Classification Standard
version: "1.0"
classified_at: "2026-08-18"
classified_by: agent
category: project
domain: infotech
secondary_domains:
- government
capability_tags:
- canon
- governance
- knowledge
- documentation
business_stake:
- technology
- operations
business_mechanics:
- coordination
- operation

30
Containerfile Normal file
View file

@ -0,0 +1,30 @@
FROM docker.io/nginxinc/nginx-unprivileged@sha256:65e3e85dbaed8ba248841d9d58a899b6197106c23cb0ff1a132b7bfe0547e4c0 AS runtime-base
ARG VCS_REVISION=unknown
LABEL org.opencontainers.image.title="policy-nexus" \
org.opencontainers.image.description="Canonical Coulomb policy publication surface" \
org.opencontainers.image.source="https://forgejo.coulomb.social/coulomb/policy-nexus" \
org.opencontainers.image.revision="$VCS_REVISION"
COPY --chown=101:101 deploy/nginx.conf /etc/nginx/conf.d/default.conf
USER 101:101
EXPOSE 8080
FROM runtime-base AS local-artifact
COPY --chown=101:101 build/ /usr/share/nginx/html/
FROM docker.io/library/python@sha256:d09d15e60962ca365d1cd544a48773bac9d33f2fb1b00f2aa0deec78ade7dc31 AS release-builder
ARG NETKINGDOM_REVISION
ENV POLICY_NEXUS_SOURCE_REVISION_NET_KINGDOM=$NETKINGDOM_REVISION
WORKDIR /workspace/policy-nexus
COPY . /workspace/policy-nexus
COPY _sources/net-kingdom /workspace/net-kingdom
RUN rm -rf build \
&& python3 -m unittest discover -s tests -p 'test_*.py' \
&& python3 tools/build_site.py publication.json --output build \
&& python3 tools/verify_release.py build \
&& python3 tools/check_currency.py publication.json
FROM runtime-base AS release-artifact
COPY --from=release-builder --chown=101:101 /workspace/policy-nexus/build/ /usr/share/nginx/html/

View file

@ -52,11 +52,11 @@ This repo exists so that policy has a permanent address and a known freshness.
## What it does not own ## What it does not own
- **The content of estate policy.** Canon lives in `the-custodian`; per-repo - **The content of estate policy.** Canon lives in its owning canon repo;
ADRs live in their repos. This repo publishes what those own and must never per-repo ADRs live in their repos. This repo publishes what those own and
become a second place where policy is edited. The local-files-are-source-of- must never become a second place where policy is edited. The local-files-are-
truth rule applies with full force: if the site and the source disagree, the source-of-truth rule applies with full force: if the site and the source
source is right and the publication is a defect. disagree, the source is right and the publication is a defect.
- **Ratification.** Whether a draft becomes canon is a canon-process decision. - **Ratification.** Whether a draft becomes canon is a canon-process decision.
This repo can show that a draft is in flight and how long it has been; it This repo can show that a draft is in flight and how long it has been; it
cannot advance it. cannot advance it.
@ -94,9 +94,9 @@ publication surface with write authority becomes a second source of truth, and
the estate has a standing rule against exactly that. the estate has a standing rule against exactly that.
The first content it must carry is already waiting: NetKingdom's *Tenancy The first content it must carry is already waiting: NetKingdom's *Tenancy
Posture* standard, which needs to reach six reviewing repos and is currently Posture* standard, now reviewed by all six affected repos and still served from
served from a disposable artifact URL. The renderer that produces that page a disposable artifact URL. The renderer that produces that page from canon
from canon markdown now lives here as `tools/render.py`. markdown lives here as `tools/render.py`.
## What good looks like ## What good looks like

View file

@ -1,15 +1,33 @@
.PHONY: build clean .PHONY: build check currency clean release-build release-check image-build
# Publication targets. Source of truth is always the upstream repo; pages here # Publication targets. Source of truth is always the upstream repo; pages here
# are generated and must never be hand-edited. # are generated and must never be hand-edited.
SRC_NETKINGDOM ?= $(HOME)/net-kingdom SRC_NETKINGDOM ?= ../net-kingdom
build: build:
mkdir -p build python3 tools/build_site.py publication.json --output build
python3 tools/render.py $(SRC_NETKINGDOM)/canon/standards/tenancy-posture_v0.1.md \
--output build/tenancy-posture.html \ check:
--title "Tenancy Posture" \ python3 -m unittest discover -s tests -p 'test_*.py'
--subtitle "A framework for describing, holding and improving multi-tenancy — including where we are not there yet." python3 -m py_compile tools/render.py tools/build_site.py tools/check_currency.py tools/verify_release.py
git diff --check
currency:
python3 tools/check_currency.py publication.json
clean: clean:
rm -rf build rm -rf build
release-check:
python3 tools/verify_release.py build
python3 tools/check_currency.py publication.json
release-build: clean build release-check
image-build: release-check
@test -n "$(IMAGE_REF)" || (echo "IMAGE_REF is required" >&2; exit 2)
docker build \
--file Containerfile \
--target local-artifact \
--build-arg VCS_REVISION=$$(git rev-parse HEAD) \
--tag $(IMAGE_REF) .

View file

@ -1,21 +1,44 @@
# policy-nexus # policy-nexus
Permanent publication and regulatory intake for the estate's policy surface. Permanent publication for the estate's policy surface. Serves
Serves `policy.coulomb.social`. `policy.coulomb.social`.
Two halves: This repo publishes estate **canon and architecture decision records** from
the repositories that own them, at stable URLs, with visible status and
currency. Pages are generated, never authored here: the source of truth stays
upstream and this repo never writes back.
- **Outward** — publishes estate **canon and architecture decision records** Regulatory intake and disclosure decisions belong to `risk-nexus`; publishable
from the repositories that own them, at stable URLs, with visible status and records may arrive from it like any other source. This repo does not interpret
currency. Generated, never authored: the source of truth stays upstream and them.
this repo never writes back.
- **Inward** — records **regulation bearing on the estate**: rules that
constrain data it holds, markets it sells into, or obligations it has taken
on. A record says what a source said and when. It never says what the estate
must therefore do.
Not a CMS, not a documentation site, not a civic-information corpus, and not a Not a CMS, not a documentation site, not a policy author, and not a source of
source of legal advice. legal advice.
- Intent: `INTENT.md` - Intent: `INTENT.md`
- Workplans: `workplans/` - Workplans: `workplans/`
Build and verify the publication locally with:
```sh
make check
make build
make currency
```
`publication.json` is the explicit source and address registry. A build fails
closed when a source is unavailable or an immutable revision would change.
Production publication is split from runtime ownership. This repository builds
and publishes the immutable OCI site image; `rapp-policy-nexus` owns the Helm
package, exposure checks, and rollback; `railiance-apps` selects the approved
production digests. A release build additionally refuses dirty or synthetic
source provenance:
```sh
make release-build
make image-build IMAGE_REF=forgejo.coulomb.social/coulomb/policy-nexus:git-$(git rev-parse HEAD)
```
Tags are discovery handles only. Production always records the registry-resolved
OCI digest and the SHA-256 of `build/publication-manifest.json`.

186
build/index.html Normal file
View file

@ -0,0 +1,186 @@
<!doctype html><html lang="en"><meta charset="utf-8"><title>Coulomb Policy Nexus</title><style>:root{
--paper:#EDEEF0; --surface:#F6F7F8; --surface-2:#E4E6E9;
--ink:#171D24; --ink-2:#4A5561; --ink-3:#737E8A;
--rule:#D3D7DC; --rule-strong:#B6BCC3;
--brass:#8A6A2E; --brass-soft:#EFE5CD; --brass-line:#C9AE74;
--clay:#8A3A2C; --clay-soft:#F2DFDA;
--l0:#DCE0E2; --l1:#B9C4C7; --l2:#8CA1A6; --l3:#567D84; --l4:#23555E;
--chip-fg:#F6F7F8;
--font-display:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",sans-serif;
--font-body:"Iowan Old Style","Palatino Linotype",Palatino,Georgia,serif;
--font-mono:ui-monospace,"SF Mono","Cascadia Code",Menlo,Consolas,monospace;
--measure:66ch;
}
@media (prefers-color-scheme:dark){
:root:not([data-theme="light"]){
--paper:#12161A; --surface:#191E24; --surface-2:#222831;
--ink:#E6E9EC; --ink-2:#A3ADB7; --ink-3:#78838E;
--rule:#2A3138; --rule-strong:#3B444D;
--brass:#C9A45C; --brass-soft:#33290F; --brass-line:#6B5426;
--clay:#D08A76; --clay-soft:#3A211B;
--l0:#262C32; --l1:#35424A; --l2:#4A626B; --l3:#6A939D; --l4:#97C4CD;
--chip-fg:#12161A;
}
}
:root[data-theme="dark"]{
--paper:#12161A; --surface:#191E24; --surface-2:#222831;
--ink:#E6E9EC; --ink-2:#A3ADB7; --ink-3:#78838E;
--rule:#2A3138; --rule-strong:#3B444D;
--brass:#C9A45C; --brass-soft:#33290F; --brass-line:#6B5426;
--clay:#D08A76; --clay-soft:#3A211B;
--l0:#262C32; --l1:#35424A; --l2:#4A626B; --l3:#6A939D; --l4:#97C4CD;
--chip-fg:#12161A;
}
*{box-sizing:border-box}
body{
margin:0; background:var(--paper); color:var(--ink);
font-family:var(--font-body); font-size:17px; line-height:1.62;
-webkit-font-smoothing:antialiased;
}
.wrap{max-width:1180px;margin:0 auto;padding:0 24px 96px}
.layout{display:grid;grid-template-columns:180px minmax(0,1fr);gap:56px;align-items:start}
@media (max-width:960px){.layout{grid-template-columns:1fr;gap:0}.rail{display:none}}
/* ---------- rail ---------- */
.rail{position:sticky;top:28px;padding-top:8px;font-family:var(--font-display);font-size:12px;line-height:1.5}
.rail ol{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:7px}
.rail a{color:var(--ink-3);text-decoration:none;display:flex;gap:9px}
.rail a:hover,.rail a:focus-visible{color:var(--brass)}
.rail .n{font-family:var(--font-mono);font-size:10px;color:var(--rule-strong);min-width:16px;padding-top:1px}
.rail .grp{margin-top:14px;font-size:9.5px;letter-spacing:.14em;text-transform:uppercase;color:var(--rule-strong)}
/* ---------- header ---------- */
header{padding:64px 0 40px;border-bottom:2px solid var(--ink);margin-bottom:44px}
.eyebrow{font-family:var(--font-mono);font-size:11.5px;letter-spacing:.13em;text-transform:uppercase;color:var(--ink-3);display:flex;flex-wrap:wrap;gap:14px;margin-bottom:22px}
.eyebrow .stat{color:var(--clay)}
h1{font-family:var(--font-display);font-weight:800;letter-spacing:-.035em;line-height:.94;font-size:clamp(46px,9vw,92px);margin:0 0 6px;text-wrap:balance}
.sub{font-family:var(--font-display);font-weight:500;font-size:clamp(16px,2.4vw,21px);letter-spacing:-.01em;color:var(--ink-2);margin:0 0 30px;max-width:34ch;line-height:1.3}
.metagrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:20px 28px;border-top:1px solid var(--rule);padding-top:20px}
.metagrid dt{font-family:var(--font-mono);font-size:10px;letter-spacing:.13em;text-transform:uppercase;color:var(--ink-3);margin-bottom:5px}
.metagrid dd{margin:0;font-family:var(--font-display);font-size:13.5px;line-height:1.45;color:var(--ink)}
/* ---------- typography ---------- */
section{margin-bottom:60px;scroll-margin-top:24px}
h2{font-family:var(--font-display);font-weight:750;letter-spacing:-.022em;font-size:clamp(24px,3.4vw,31px);line-height:1.12;margin:0 0 18px;text-wrap:balance;display:flex;gap:14px;align-items:baseline}
h2 .sn{font-family:var(--font-mono);font-size:12px;font-weight:400;color:var(--brass);letter-spacing:.06em;flex:none;padding-top:2px}
h3{font-family:var(--font-display);font-weight:700;font-size:16px;letter-spacing:-.008em;margin:34px 0 10px;color:var(--ink)}
p{margin:0 0 15px;max-width:var(--measure)}
ul,ol{max-width:var(--measure);margin:0 0 15px;padding-left:20px}
li{margin-bottom:7px}
strong{font-weight:600}
em{font-style:italic}
code{font-family:var(--font-mono);font-size:.855em;background:var(--surface-2);padding:1px 5px;border-radius:2px}
a{color:var(--brass)}
.lede{font-size:19px;line-height:1.55;color:var(--ink-2);max-width:60ch}
/* ---------- devices ---------- */
.callout{border-left:3px solid var(--brass);background:var(--brass-soft);padding:18px 22px;margin:0 0 24px;max-width:var(--measure)}
.callout p:last-child{margin-bottom:0}
.callout .lbl{font-family:var(--font-mono);font-size:10px;letter-spacing:.13em;text-transform:uppercase;color:var(--brass);display:block;margin-bottom:8px}
.rule-quote{border-top:2px solid var(--ink);border-bottom:2px solid var(--ink);padding:26px 0;margin:28px 0;max-width:var(--measure)}
.rule-quote p{font-family:var(--font-display);font-weight:600;font-size:19px;line-height:1.38;letter-spacing:-.014em;margin:0;text-wrap:balance}
.hard{border-left:3px solid var(--clay);background:var(--clay-soft);padding:18px 22px;margin:0 0 24px;max-width:var(--measure)}
.hard .lbl{font-family:var(--font-mono);font-size:10px;letter-spacing:.13em;text-transform:uppercase;color:var(--clay);display:block;margin-bottom:8px}
.hard p:last-child{margin-bottom:0}
.dec{font-family:var(--font-mono);font-size:10.5px;letter-spacing:.08em;color:var(--brass);text-transform:uppercase}
.vec{font-family:var(--font-mono);font-size:.9em;font-weight:600;background:var(--surface-2);padding:2px 7px;border-radius:2px;white-space:nowrap;letter-spacing:.04em}
/* ---------- tables ---------- */
.scroll{overflow-x:auto;margin:0 0 24px;-webkit-overflow-scrolling:touch}
table{border-collapse:collapse;width:100%;min-width:520px;font-family:var(--font-display);font-size:13.5px;line-height:1.45}
th{text-align:left;font-family:var(--font-mono);font-size:9.5px;letter-spacing:.13em;text-transform:uppercase;color:var(--ink-3);font-weight:400;padding:0 16px 8px 0;border-bottom:1px solid var(--rule-strong);vertical-align:bottom}
td{padding:11px 16px 11px 0;border-bottom:1px solid var(--rule);vertical-align:top;color:var(--ink-2)}
td:first-child{color:var(--ink);font-weight:600}
tbody tr:last-child td{border-bottom:none}
.lvl{font-family:var(--font-mono);font-weight:600;font-size:12px;letter-spacing:.04em;color:var(--ink)}
/* ---------- ladders ---------- */
.breakout{margin:34px 0 40px}
.bhead{display:flex;justify-content:space-between;align-items:baseline;gap:20px;border-bottom:1px solid var(--rule-strong);padding-bottom:9px;margin-bottom:22px;flex-wrap:wrap}
.bhead h3{margin:0;font-size:13px;letter-spacing:.1em;text-transform:uppercase;font-family:var(--font-mono);font-weight:400;color:var(--ink-3)}
.bhead .note{font-family:var(--font-display);font-size:12.5px;color:var(--ink-3)}
.ladders{display:grid;gap:26px}
.ladder{display:grid;grid-template-columns:126px minmax(0,1fr);gap:18px;align-items:start}
@media (max-width:700px){.ladder{grid-template-columns:1fr;gap:10px}}
.ladder .pname{font-family:var(--font-display);font-weight:700;font-size:14px;letter-spacing:-.01em;padding-top:2px}
.ladder .pname span{display:block;font-family:var(--font-mono);font-size:10px;font-weight:400;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-3);margin-top:3px}
.rungs{display:grid;gap:3px;grid-template-columns:repeat(5,minmax(0,1fr))}
@media (max-width:700px){.rungs{grid-template-columns:repeat(2,minmax(0,1fr))}}
.rung{padding:9px 10px 11px;background:var(--surface);border-top:4px solid var(--l0);min-width:0}
.rung.r1{border-top-color:var(--l1)} .rung.r2{border-top-color:var(--l2)}
.rung.r3{border-top-color:var(--l3)} .rung.r4{border-top-color:var(--l4)}
.rung .code{font-family:var(--font-mono);font-size:11px;font-weight:600;letter-spacing:.06em;color:var(--ink);display:block;margin-bottom:4px}
.rung .txt{font-family:var(--font-display);font-size:11.5px;line-height:1.34;color:var(--ink-2);display:block}
.rung.na{opacity:.42}
/* ---------- matrix ---------- */
.matrix-shell{display:grid;grid-template-columns:auto minmax(0,1fr);gap:12px;align-items:stretch;margin-bottom:14px}
.ylab{writing-mode:vertical-rl;transform:rotate(180deg);font-family:var(--font-mono);font-size:9.5px;letter-spacing:.14em;text-transform:uppercase;color:var(--ink-3);text-align:center;padding-bottom:22px}
.mgrid{display:grid;grid-template-columns:34px repeat(5,minmax(0,1fr));gap:3px}
.mcell{background:var(--surface);min-height:60px;padding:6px;display:flex;flex-direction:column;justify-content:flex-end;gap:4px;min-width:0}
.mcell.tint1{background:color-mix(in srgb,var(--l1) 26%,var(--surface))}
.mcell.tint2{background:color-mix(in srgb,var(--l2) 26%,var(--surface))}
.mcell.tint3{background:color-mix(in srgb,var(--l3) 24%,var(--surface))}
.mcell.tint4{background:color-mix(in srgb,var(--l4) 22%,var(--surface))}
.mcell.void{background:repeating-linear-gradient(135deg,transparent,transparent 5px,var(--rule) 5px,var(--rule) 6px);opacity:.55}
.rlab,.clab{font-family:var(--font-mono);font-size:10px;font-weight:600;letter-spacing:.05em;color:var(--ink-3);display:flex;align-items:center;justify-content:center}
.rlab{min-height:60px}
.clab{padding-top:7px;min-height:22px}
.pin{font-family:var(--font-mono);font-size:9.5px;font-weight:600;letter-spacing:.02em;background:var(--ink);color:var(--paper);padding:2px 5px;border-radius:2px;line-height:1.3;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pin.ghost{background:transparent;color:var(--ink-2);border:1px dashed var(--rule-strong)}
.mnote{display:flex;gap:22px;flex-wrap:wrap;font-family:var(--font-display);font-size:12px;color:var(--ink-3);padding-top:6px}
.mnote .k{display:flex;align-items:center;gap:7px}
.sw{width:13px;height:13px;flex:none;background:var(--ink)}
.sw.g{background:transparent;border:1px dashed var(--rule-strong)}
.sw.v{background:repeating-linear-gradient(135deg,transparent,transparent 4px,var(--rule) 4px,var(--rule) 5px);border:1px solid var(--rule)}
@media (max-width:640px){
.mgrid{grid-template-columns:28px repeat(5,minmax(0,1fr))}
.mcell{min-height:52px;padding:4px}
.pin{font-size:8px;padding:1px 3px}
.rlab{min-height:52px}
}
/* ---------- methodology ---------- */
.verbs{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:2px;background:var(--rule);border:1px solid var(--rule)}
.verb{background:var(--surface);padding:18px 18px 20px}
.verb h4{font-family:var(--font-display);font-weight:750;font-size:15px;margin:0 0 7px;letter-spacing:-.01em}
.verb p{font-family:var(--font-display);font-size:12.5px;line-height:1.46;color:var(--ink-2);margin:0;max-width:none}
.verb .step{font-family:var(--font-mono);font-size:9.5px;letter-spacing:.13em;color:var(--brass);display:block;margin-bottom:9px}
/* ---------- questions ---------- */
.qs{display:flex;flex-direction:column;gap:0;border-top:1px solid var(--rule-strong)}
.q{display:grid;grid-template-columns:34px minmax(0,1fr) 170px;gap:18px;padding:16px 0;border-bottom:1px solid var(--rule);align-items:start}
@media (max-width:760px){.q{grid-template-columns:28px minmax(0,1fr);gap:12px}.q .owner{grid-column:2}}
.q .qn{font-family:var(--font-mono);font-size:11px;color:var(--brass);padding-top:3px}
.q .qt{font-family:var(--font-display);font-size:14px;line-height:1.48;color:var(--ink-2)}
.q .qt b{color:var(--ink);font-weight:700;display:block;margin-bottom:2px;font-size:14.5px}
.owner{font-family:var(--font-mono);font-size:10px;letter-spacing:.05em;color:var(--ink-3);padding-top:4px}
.owner .tag{display:inline-block;border:1px solid var(--rule-strong);padding:2px 7px;border-radius:2px}
.owner .tag.need{border-color:var(--clay);color:var(--clay)}
/* ---------- misc ---------- */
.numbers{font-family:var(--font-mono);font-size:12.5px;line-height:1.85;background:var(--surface);border-left:3px solid var(--l3);padding:16px 20px;margin:0 0 22px;overflow-x:auto;max-width:var(--measure)}
.numbers .v{color:var(--ink);font-weight:600}
.numbers .k{color:var(--ink-3)}
pre{font-family:var(--font-mono);font-size:12.5px;line-height:1.68;background:var(--surface);border-left:3px solid var(--rule-strong);padding:16px 20px;overflow-x:auto;margin:0 0 22px;max-width:var(--measure);color:var(--ink-2)}
.alt{border-bottom:1px solid var(--rule);padding:14px 0;max-width:var(--measure)}
.alt:last-of-type{border-bottom:none}
.alt b{font-family:var(--font-display);font-size:14px;display:block;margin-bottom:3px}
.alt p{font-size:14.5px;margin:0;color:var(--ink-2)}
.alt .verdict{font-family:var(--font-mono);font-size:10px;letter-spacing:.1em;text-transform:uppercase;color:var(--clay)}
footer{border-top:2px solid var(--ink);margin-top:20px;padding-top:22px;font-family:var(--font-mono);font-size:11px;letter-spacing:.06em;color:var(--ink-3);display:flex;justify-content:space-between;gap:20px;flex-wrap:wrap}
.tm td,.tm th{text-align:center}
.tm td:first-child,.tm th:first-child{text-align:left}
.yes{color:var(--l4);font-weight:700}
.no{color:var(--clay);font-weight:700}
.kind{font-family:var(--font-mono);font-size:9px;letter-spacing:.09em;text-transform:uppercase;padding:2px 6px;border-radius:2px;white-space:nowrap;border:1px solid var(--rule-strong);color:var(--ink-3)}
.kind.adv{border-color:var(--clay);color:var(--clay)}
.routes{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:2px;background:var(--rule);border:1px solid var(--rule);margin:0 0 22px}
.route{background:var(--surface);padding:16px 18px}
.route h4{font-family:var(--font-display);font-weight:750;font-size:14px;margin:0 0 6px}
.route p{font-family:var(--font-display);font-size:12.5px;line-height:1.45;color:var(--ink-2);margin:0;max-width:none}
.route .tag{font-family:var(--font-mono);font-size:9px;letter-spacing:.1em;text-transform:uppercase;color:var(--brass);display:block;margin-bottom:8px}
a:focus-visible,.rail a:focus-visible{outline:2px solid var(--brass);outline-offset:3px}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
</style><div class="wrap"><header><div class="eyebrow"><span>policy surface</span><span>generated from canonical sources — do not edit</span></div><h1>Coulomb Policy Nexus</h1><p class="sub">Canon and architecture decisions at stable addresses, with visible currency.</p></header><main><table><thead><tr><th>Document</th><th>Status</th><th>Lifecycle</th><th>Revision</th><th>Owner</th><th>Reviewed</th><th>Review due</th><th>Currency</th></tr></thead><tbody><tr><td><a href="/standards/tenancy-posture/v0.1/index.html">NetKingdom Tenancy Posture v0.1</a></td><td>proposed</td><td>active</td><td>draft-8</td><td>net-kingdom</td><td>2026-08-17</td><td>2027-02-17</td><td>current</td></tr></tbody></table></main></div></html>

View file

@ -0,0 +1,21 @@
{
"documents": [
{
"canonical_path": "standards/tenancy-posture/v0.1/index.html",
"currency": "current",
"id": "netkingdom-tenancy-posture",
"last_reviewed": "2026-08-17",
"lifecycle": "active",
"owner": "net-kingdom",
"review_due": "2027-02-17",
"revision": "draft-8",
"revision_path": "standards/tenancy-posture/v0.1/revisions/draft-8/index.html",
"source_digest": "99f802d91a0b3a65f0dac58230d8904f7c61cf3f81eff072fbbc59b634612a8a",
"source_revision": "cced59d3aa1dc0aa08fc128fc8c76699f59dcd90",
"status": "proposed",
"title": "NetKingdom Tenancy Posture v0.1"
}
],
"generated_as_of": "2026-08-18",
"schema_version": 1
}

View file

@ -0,0 +1,444 @@
<!doctype html>
<html lang="en"><meta charset="utf-8">
<meta name="policy-source-revision" content="cced59d3aa1dc0aa08fc128fc8c76699f59dcd90">
<meta name="policy-source-digest" content="99f802d91a0b3a65f0dac58230d8904f7c61cf3f81eff072fbbc59b634612a8a">
<title>NetKingdom Tenancy Posture v0.1</title>
<style>
:root{
--paper:#EDEEF0; --surface:#F6F7F8; --surface-2:#E4E6E9;
--ink:#171D24; --ink-2:#4A5561; --ink-3:#737E8A;
--rule:#D3D7DC; --rule-strong:#B6BCC3;
--brass:#8A6A2E; --brass-soft:#EFE5CD; --brass-line:#C9AE74;
--clay:#8A3A2C; --clay-soft:#F2DFDA;
--l0:#DCE0E2; --l1:#B9C4C7; --l2:#8CA1A6; --l3:#567D84; --l4:#23555E;
--chip-fg:#F6F7F8;
--font-display:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",sans-serif;
--font-body:"Iowan Old Style","Palatino Linotype",Palatino,Georgia,serif;
--font-mono:ui-monospace,"SF Mono","Cascadia Code",Menlo,Consolas,monospace;
--measure:66ch;
}
@media (prefers-color-scheme:dark){
:root:not([data-theme="light"]){
--paper:#12161A; --surface:#191E24; --surface-2:#222831;
--ink:#E6E9EC; --ink-2:#A3ADB7; --ink-3:#78838E;
--rule:#2A3138; --rule-strong:#3B444D;
--brass:#C9A45C; --brass-soft:#33290F; --brass-line:#6B5426;
--clay:#D08A76; --clay-soft:#3A211B;
--l0:#262C32; --l1:#35424A; --l2:#4A626B; --l3:#6A939D; --l4:#97C4CD;
--chip-fg:#12161A;
}
}
:root[data-theme="dark"]{
--paper:#12161A; --surface:#191E24; --surface-2:#222831;
--ink:#E6E9EC; --ink-2:#A3ADB7; --ink-3:#78838E;
--rule:#2A3138; --rule-strong:#3B444D;
--brass:#C9A45C; --brass-soft:#33290F; --brass-line:#6B5426;
--clay:#D08A76; --clay-soft:#3A211B;
--l0:#262C32; --l1:#35424A; --l2:#4A626B; --l3:#6A939D; --l4:#97C4CD;
--chip-fg:#12161A;
}
*{box-sizing:border-box}
body{
margin:0; background:var(--paper); color:var(--ink);
font-family:var(--font-body); font-size:17px; line-height:1.62;
-webkit-font-smoothing:antialiased;
}
.wrap{max-width:1180px;margin:0 auto;padding:0 24px 96px}
.layout{display:grid;grid-template-columns:180px minmax(0,1fr);gap:56px;align-items:start}
@media (max-width:960px){.layout{grid-template-columns:1fr;gap:0}.rail{display:none}}
/* ---------- rail ---------- */
.rail{position:sticky;top:28px;padding-top:8px;font-family:var(--font-display);font-size:12px;line-height:1.5}
.rail ol{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:7px}
.rail a{color:var(--ink-3);text-decoration:none;display:flex;gap:9px}
.rail a:hover,.rail a:focus-visible{color:var(--brass)}
.rail .n{font-family:var(--font-mono);font-size:10px;color:var(--rule-strong);min-width:16px;padding-top:1px}
.rail .grp{margin-top:14px;font-size:9.5px;letter-spacing:.14em;text-transform:uppercase;color:var(--rule-strong)}
/* ---------- header ---------- */
header{padding:64px 0 40px;border-bottom:2px solid var(--ink);margin-bottom:44px}
.eyebrow{font-family:var(--font-mono);font-size:11.5px;letter-spacing:.13em;text-transform:uppercase;color:var(--ink-3);display:flex;flex-wrap:wrap;gap:14px;margin-bottom:22px}
.eyebrow .stat{color:var(--clay)}
h1{font-family:var(--font-display);font-weight:800;letter-spacing:-.035em;line-height:.94;font-size:clamp(46px,9vw,92px);margin:0 0 6px;text-wrap:balance}
.sub{font-family:var(--font-display);font-weight:500;font-size:clamp(16px,2.4vw,21px);letter-spacing:-.01em;color:var(--ink-2);margin:0 0 30px;max-width:34ch;line-height:1.3}
.metagrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:20px 28px;border-top:1px solid var(--rule);padding-top:20px}
.metagrid dt{font-family:var(--font-mono);font-size:10px;letter-spacing:.13em;text-transform:uppercase;color:var(--ink-3);margin-bottom:5px}
.metagrid dd{margin:0;font-family:var(--font-display);font-size:13.5px;line-height:1.45;color:var(--ink)}
/* ---------- typography ---------- */
section{margin-bottom:60px;scroll-margin-top:24px}
h2{font-family:var(--font-display);font-weight:750;letter-spacing:-.022em;font-size:clamp(24px,3.4vw,31px);line-height:1.12;margin:0 0 18px;text-wrap:balance;display:flex;gap:14px;align-items:baseline}
h2 .sn{font-family:var(--font-mono);font-size:12px;font-weight:400;color:var(--brass);letter-spacing:.06em;flex:none;padding-top:2px}
h3{font-family:var(--font-display);font-weight:700;font-size:16px;letter-spacing:-.008em;margin:34px 0 10px;color:var(--ink)}
p{margin:0 0 15px;max-width:var(--measure)}
ul,ol{max-width:var(--measure);margin:0 0 15px;padding-left:20px}
li{margin-bottom:7px}
strong{font-weight:600}
em{font-style:italic}
code{font-family:var(--font-mono);font-size:.855em;background:var(--surface-2);padding:1px 5px;border-radius:2px}
a{color:var(--brass)}
.lede{font-size:19px;line-height:1.55;color:var(--ink-2);max-width:60ch}
/* ---------- devices ---------- */
.callout{border-left:3px solid var(--brass);background:var(--brass-soft);padding:18px 22px;margin:0 0 24px;max-width:var(--measure)}
.callout p:last-child{margin-bottom:0}
.callout .lbl{font-family:var(--font-mono);font-size:10px;letter-spacing:.13em;text-transform:uppercase;color:var(--brass);display:block;margin-bottom:8px}
.rule-quote{border-top:2px solid var(--ink);border-bottom:2px solid var(--ink);padding:26px 0;margin:28px 0;max-width:var(--measure)}
.rule-quote p{font-family:var(--font-display);font-weight:600;font-size:19px;line-height:1.38;letter-spacing:-.014em;margin:0;text-wrap:balance}
.hard{border-left:3px solid var(--clay);background:var(--clay-soft);padding:18px 22px;margin:0 0 24px;max-width:var(--measure)}
.hard .lbl{font-family:var(--font-mono);font-size:10px;letter-spacing:.13em;text-transform:uppercase;color:var(--clay);display:block;margin-bottom:8px}
.hard p:last-child{margin-bottom:0}
.dec{font-family:var(--font-mono);font-size:10.5px;letter-spacing:.08em;color:var(--brass);text-transform:uppercase}
.vec{font-family:var(--font-mono);font-size:.9em;font-weight:600;background:var(--surface-2);padding:2px 7px;border-radius:2px;white-space:nowrap;letter-spacing:.04em}
/* ---------- tables ---------- */
.scroll{overflow-x:auto;margin:0 0 24px;-webkit-overflow-scrolling:touch}
table{border-collapse:collapse;width:100%;min-width:520px;font-family:var(--font-display);font-size:13.5px;line-height:1.45}
th{text-align:left;font-family:var(--font-mono);font-size:9.5px;letter-spacing:.13em;text-transform:uppercase;color:var(--ink-3);font-weight:400;padding:0 16px 8px 0;border-bottom:1px solid var(--rule-strong);vertical-align:bottom}
td{padding:11px 16px 11px 0;border-bottom:1px solid var(--rule);vertical-align:top;color:var(--ink-2)}
td:first-child{color:var(--ink);font-weight:600}
tbody tr:last-child td{border-bottom:none}
.lvl{font-family:var(--font-mono);font-weight:600;font-size:12px;letter-spacing:.04em;color:var(--ink)}
/* ---------- ladders ---------- */
.breakout{margin:34px 0 40px}
.bhead{display:flex;justify-content:space-between;align-items:baseline;gap:20px;border-bottom:1px solid var(--rule-strong);padding-bottom:9px;margin-bottom:22px;flex-wrap:wrap}
.bhead h3{margin:0;font-size:13px;letter-spacing:.1em;text-transform:uppercase;font-family:var(--font-mono);font-weight:400;color:var(--ink-3)}
.bhead .note{font-family:var(--font-display);font-size:12.5px;color:var(--ink-3)}
.ladders{display:grid;gap:26px}
.ladder{display:grid;grid-template-columns:126px minmax(0,1fr);gap:18px;align-items:start}
@media (max-width:700px){.ladder{grid-template-columns:1fr;gap:10px}}
.ladder .pname{font-family:var(--font-display);font-weight:700;font-size:14px;letter-spacing:-.01em;padding-top:2px}
.ladder .pname span{display:block;font-family:var(--font-mono);font-size:10px;font-weight:400;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-3);margin-top:3px}
.rungs{display:grid;gap:3px;grid-template-columns:repeat(5,minmax(0,1fr))}
@media (max-width:700px){.rungs{grid-template-columns:repeat(2,minmax(0,1fr))}}
.rung{padding:9px 10px 11px;background:var(--surface);border-top:4px solid var(--l0);min-width:0}
.rung.r1{border-top-color:var(--l1)} .rung.r2{border-top-color:var(--l2)}
.rung.r3{border-top-color:var(--l3)} .rung.r4{border-top-color:var(--l4)}
.rung .code{font-family:var(--font-mono);font-size:11px;font-weight:600;letter-spacing:.06em;color:var(--ink);display:block;margin-bottom:4px}
.rung .txt{font-family:var(--font-display);font-size:11.5px;line-height:1.34;color:var(--ink-2);display:block}
.rung.na{opacity:.42}
/* ---------- matrix ---------- */
.matrix-shell{display:grid;grid-template-columns:auto minmax(0,1fr);gap:12px;align-items:stretch;margin-bottom:14px}
.ylab{writing-mode:vertical-rl;transform:rotate(180deg);font-family:var(--font-mono);font-size:9.5px;letter-spacing:.14em;text-transform:uppercase;color:var(--ink-3);text-align:center;padding-bottom:22px}
.mgrid{display:grid;grid-template-columns:34px repeat(5,minmax(0,1fr));gap:3px}
.mcell{background:var(--surface);min-height:60px;padding:6px;display:flex;flex-direction:column;justify-content:flex-end;gap:4px;min-width:0}
.mcell.tint1{background:color-mix(in srgb,var(--l1) 26%,var(--surface))}
.mcell.tint2{background:color-mix(in srgb,var(--l2) 26%,var(--surface))}
.mcell.tint3{background:color-mix(in srgb,var(--l3) 24%,var(--surface))}
.mcell.tint4{background:color-mix(in srgb,var(--l4) 22%,var(--surface))}
.mcell.void{background:repeating-linear-gradient(135deg,transparent,transparent 5px,var(--rule) 5px,var(--rule) 6px);opacity:.55}
.rlab,.clab{font-family:var(--font-mono);font-size:10px;font-weight:600;letter-spacing:.05em;color:var(--ink-3);display:flex;align-items:center;justify-content:center}
.rlab{min-height:60px}
.clab{padding-top:7px;min-height:22px}
.pin{font-family:var(--font-mono);font-size:9.5px;font-weight:600;letter-spacing:.02em;background:var(--ink);color:var(--paper);padding:2px 5px;border-radius:2px;line-height:1.3;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pin.ghost{background:transparent;color:var(--ink-2);border:1px dashed var(--rule-strong)}
.mnote{display:flex;gap:22px;flex-wrap:wrap;font-family:var(--font-display);font-size:12px;color:var(--ink-3);padding-top:6px}
.mnote .k{display:flex;align-items:center;gap:7px}
.sw{width:13px;height:13px;flex:none;background:var(--ink)}
.sw.g{background:transparent;border:1px dashed var(--rule-strong)}
.sw.v{background:repeating-linear-gradient(135deg,transparent,transparent 4px,var(--rule) 4px,var(--rule) 5px);border:1px solid var(--rule)}
@media (max-width:640px){
.mgrid{grid-template-columns:28px repeat(5,minmax(0,1fr))}
.mcell{min-height:52px;padding:4px}
.pin{font-size:8px;padding:1px 3px}
.rlab{min-height:52px}
}
/* ---------- methodology ---------- */
.verbs{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:2px;background:var(--rule);border:1px solid var(--rule)}
.verb{background:var(--surface);padding:18px 18px 20px}
.verb h4{font-family:var(--font-display);font-weight:750;font-size:15px;margin:0 0 7px;letter-spacing:-.01em}
.verb p{font-family:var(--font-display);font-size:12.5px;line-height:1.46;color:var(--ink-2);margin:0;max-width:none}
.verb .step{font-family:var(--font-mono);font-size:9.5px;letter-spacing:.13em;color:var(--brass);display:block;margin-bottom:9px}
/* ---------- questions ---------- */
.qs{display:flex;flex-direction:column;gap:0;border-top:1px solid var(--rule-strong)}
.q{display:grid;grid-template-columns:34px minmax(0,1fr) 170px;gap:18px;padding:16px 0;border-bottom:1px solid var(--rule);align-items:start}
@media (max-width:760px){.q{grid-template-columns:28px minmax(0,1fr);gap:12px}.q .owner{grid-column:2}}
.q .qn{font-family:var(--font-mono);font-size:11px;color:var(--brass);padding-top:3px}
.q .qt{font-family:var(--font-display);font-size:14px;line-height:1.48;color:var(--ink-2)}
.q .qt b{color:var(--ink);font-weight:700;display:block;margin-bottom:2px;font-size:14.5px}
.owner{font-family:var(--font-mono);font-size:10px;letter-spacing:.05em;color:var(--ink-3);padding-top:4px}
.owner .tag{display:inline-block;border:1px solid var(--rule-strong);padding:2px 7px;border-radius:2px}
.owner .tag.need{border-color:var(--clay);color:var(--clay)}
/* ---------- misc ---------- */
.numbers{font-family:var(--font-mono);font-size:12.5px;line-height:1.85;background:var(--surface);border-left:3px solid var(--l3);padding:16px 20px;margin:0 0 22px;overflow-x:auto;max-width:var(--measure)}
.numbers .v{color:var(--ink);font-weight:600}
.numbers .k{color:var(--ink-3)}
pre{font-family:var(--font-mono);font-size:12.5px;line-height:1.68;background:var(--surface);border-left:3px solid var(--rule-strong);padding:16px 20px;overflow-x:auto;margin:0 0 22px;max-width:var(--measure);color:var(--ink-2)}
.alt{border-bottom:1px solid var(--rule);padding:14px 0;max-width:var(--measure)}
.alt:last-of-type{border-bottom:none}
.alt b{font-family:var(--font-display);font-size:14px;display:block;margin-bottom:3px}
.alt p{font-size:14.5px;margin:0;color:var(--ink-2)}
.alt .verdict{font-family:var(--font-mono);font-size:10px;letter-spacing:.1em;text-transform:uppercase;color:var(--clay)}
footer{border-top:2px solid var(--ink);margin-top:20px;padding-top:22px;font-family:var(--font-mono);font-size:11px;letter-spacing:.06em;color:var(--ink-3);display:flex;justify-content:space-between;gap:20px;flex-wrap:wrap}
.tm td,.tm th{text-align:center}
.tm td:first-child,.tm th:first-child{text-align:left}
.yes{color:var(--l4);font-weight:700}
.no{color:var(--clay);font-weight:700}
.kind{font-family:var(--font-mono);font-size:9px;letter-spacing:.09em;text-transform:uppercase;padding:2px 6px;border-radius:2px;white-space:nowrap;border:1px solid var(--rule-strong);color:var(--ink-3)}
.kind.adv{border-color:var(--clay);color:var(--clay)}
.routes{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:2px;background:var(--rule);border:1px solid var(--rule);margin:0 0 22px}
.route{background:var(--surface);padding:16px 18px}
.route h4{font-family:var(--font-display);font-weight:750;font-size:14px;margin:0 0 6px}
.route p{font-family:var(--font-display);font-size:12.5px;line-height:1.45;color:var(--ink-2);margin:0;max-width:none}
.route .tag{font-family:var(--font-mono);font-size:9px;letter-spacing:.1em;text-transform:uppercase;color:var(--brass);display:block;margin-bottom:8px}
a:focus-visible,.rail a:focus-visible{outline:2px solid var(--brass);outline-offset:3px}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
</style>
<div class="wrap"><header><div class="eyebrow"><span>netkingdom-tenancy-posture</span> <span class="stat">proposed · draft-8</span> <span>net-kingdom</span> <span>reviewed 2026-08-17</span><span>generated from canonical source — do not edit</span></div><h1>NetKingdom Tenancy Posture v0.1</h1><p class="sub">A framework for describing, holding and improving multi-tenancy — including where we are not there yet.</p><p class="sub">Source: <code>net-kingdom · canon/standards/tenancy-posture_v0.1.md · cced59d3aa1dc0aa08fc128fc8c76699f59dcd90</code></p><p class="sub">Review due: 2027-02-17</p></header><div class="layout"><nav class="rail" aria-label="Sections"><ol><li><a href="#status"><span class="n">·</span>Status</a></li><li><a href="#s0"><span class="n">0</span>Terminology: axes, not planes</a></li><li><a href="#s1"><span class="n">1</span>Context</a></li><li><a href="#s2"><span class="n">2</span>What this document is</a></li><li><a href="#s3"><span class="n">3</span>Six orthogonal axes</a></li><li><a href="#s4"><span class="n">4</span>Graduated levels</a></li><li><a href="#s5"><span class="n">5</span>The posture vector</a></li><li><a href="#s6"><span class="n">6</span>Conformance is accuracy, not altitude</a></li><li><a href="#s7"><span class="n">7</span>Portability across placement levels</a></li><li><a href="#s8"><span class="n">8</span>Placement triggers</a></li><li><a href="#s9"><span class="n">9</span>Credentials as a tenancy control</a></li><li><a href="#s10"><span class="n">10</span>Blast radius must be published</a></li><li><a href="#s11"><span class="n">11</span>Commercial expression</a></li><li><a href="#s12"><span class="n">12</span>Methodology — analyze, establish, improve, guard</a></li><li><a href="#s13"><span class="n">13</span>Evidence per level</a></li><li><a href="#s14"><span class="n">14</span>Adoption stance — structure, not tooling</a></li><li><a href="#s15"><span class="n">15</span>Alternatives considered</a></li><li><a href="#s16"><span class="n">16</span>Held against outside practice</a></li><li><a href="#s17"><span class="n">17</span>Scaling demands</a></li><li><a href="#s18"><span class="n">18</span>Consequences</a></li><li><a href="#s19"><span class="n">19</span>Review resolutions and residual questions</a></li><li><a href="#s20"><span class="n">20</span>Ratification path</a></li></ol></nav><main><section id="status"><h2>Status</h2>
<p><strong>Proposed, draft-8; ratification-ready.</strong> Relocated from <code>the-custodian/canon/architecture</code> on 2026-08-17: multi-tenancy is part of the IT-security framework NetKingdom provides, so this framework belongs in NetKingdom canon beside the IAM Profile and the tenant-engine boundary contract, not in the work-factory canon.</p>
<ul><li><strong>draft-1</strong> proposed a single model with fixed characteristics. Rejected: it could not describe a repo that is not there yet.</li><li><strong>draft-2</strong> reframed to graduated levels per axis. Externally corroborated (§16), but four of its statements were wrong and one thing it needed was missing.</li><li><strong>draft-3</strong> applied those corrections, added the retention axis, and recorded an adoption stance.</li><li><strong>draft-4</strong> closed the two gaps draft-3 left open: <code>R4</code> had no mechanism beyond waiting, and the noisy-neighbour evidence artifact asserted something shared infrastructure cannot provide.</li><li><strong>draft-5</strong> relocated to NetKingdom and renamed the dimensions from <em>planes</em> to <em>axes</em>, because the word was already taken (§0).</li><li><strong>draft-6</strong> applied <code>tenant-engine</code>'s review: five changes, including an axis that did not fit its data shape.</li><li><strong>draft-7</strong> applies <code>audit-core</code>, <code>railiance-platform</code> and <code>flex-auth</code>. Eleven further changes, two of them corrections to statements this document made as fact about other repos. <strong>Every posture I guessed was too generous, on every repo that has now self-reported.</strong></li><li><strong>draft-8</strong> applies <code>adaptive-pricing</code>'s review, the last of the six, and the consistency review across all declarations. It adds the missing availability axis, a canonical declaration schema, explicit authority for tier assurance, retention/placement coupling, downgrade propagation, and honest sanctioned customer language. It also corrects the distinction between an implemented control and an evidenced current level.</li></ul>
<p><strong>Reviewed by all six. The score:</strong> six repos found three live defects in their own code by reading the ladders — <code>tenant-engine</code>'s unfiltered event accessor, <code>audit-core</code>'s unfiltered read path, <code>flex-auth</code>'s unauthenticated <code>/v1/check</code> — and <code>railiance-platform</code> found <code>apps-pg</code> running with no backup configured at all while writing its §10.2 disclosure. The framework changed to fit the repos; no repo was told to fabricate a posture.</p>
<p>Informed by five external research digests plus their index in <code>the-custodian/research/2026-08-17-adr008-*</code>, which carry full citations for the external claims made here.</p>
</section>
<section id="s0"><h2><span class="sn">00</span>Terminology: axes, not planes</h2>
<p><code>docs/platform-identity-security-architecture.md</code> — accepted, 2026-07-23 — already uses <strong>plane</strong> for a trust and deployment layer: the <em>bootstrap plane</em>, the <em>platform control plane</em>, and <em>tenant planes</em>. That meaning is established, ratified, and owned by this repo.</p>
<p>Drafts 14 of this document, written elsewhere, used <strong>plane</strong> for something different: an independent dimension of concern. Two incompatible senses of one word inside one canon is exactly the concept-ownership collision the estate has been careful about elsewhere, and the newcomer yields.</p>
<p>This framework therefore describes six <strong>axes</strong>. They are orthogonal to NetKingdom's planes, not a subdivision of them:</p>
<ul><li>A <strong>plane</strong> is <em>where</em> something runs and what trust it carries — bootstrap, platform control, tenant.</li><li>An <strong>axis</strong> is <em>which property</em> of tenancy is being described — identity, authorization, enforcement, placement, retention, availability.</li></ul>
<p>A workload in the tenant plane has a position on all six axes. A platform control plane service does too. The two vocabularies compose and neither replaces the other.</p>
<p>The rename is also an improvement. A posture vector is literally a point in six-dimensional space, and "axis" says that where "plane" did not.</p>
</section>
<section id="s1"><h2><span class="sn">01</span>Context</h2>
<p>Drafts 14 opened by claiming the estate "has never written down what it is building". Relocation proved that wrong, and the correction is worth keeping visible: <code>docs/platform-identity-security-architecture.md</code> has described the trust model, the tenant model and a capability progression since 2026-07-23. The accurate claim is narrower — <strong>what was missing is a way to say how far a given service has got, and to hold several answers at once.</strong> Seven documents cover slices of the subject and none of them does that:</p>
<div class="scroll"><table><thead><tr><th>Document</th><th>Covers</th><th>Status</th></tr></thead><tbody><tr><td><code>iam-profile_v0.3</code> (NetKingdom)</td><td>Tenant identifier shape, <code>tenant_roles</code> claim, staleness rules</td><td>Ratified</td></tr><tr><td><code>tenant-engine-boundary-contract_v0.1</code> (NetKingdom)</td><td>Who owns tenant records, roles, plan assignment</td><td>Ratified</td></tr><tr><td><code>business-app-service-contract_v0.1</code> §1 (Custodian)</td><td>Business apps: instance-per-client, tenant-keyed data</td><td>Ratified</td></tr><tr><td><code>rapp-postgres</code> ADR-0001</td><td>Consumer + tenant isolation in PostgreSQL</td><td>Proposed, governs one repo</td></tr><tr><td><code>rapp-postgres</code> ADR-0002</td><td>Per-consumer retention and the erasure horizon</td><td>Proposed, governs one repo</td></tr><tr><td><code>shared-platform-relational-storage_v0.1</code></td><td>The stacked-boundary gap</td><td>Routed 2026-08-10, <strong>still unratified</strong></td></tr><tr><td><code>platform-identity-security-architecture</code> (NetKingdom)</td><td>Trust model, planes, tenant model, capability progression</td><td>Accepted 2026-07-23</td></tr></tbody></table></div>
<p>This document is downstream of that architecture and must not restate it. It answers one question the architecture leaves open: given the model, <strong>where is this particular service today, and how would anyone know?</strong></p>
<p>Four failures existed when drafting began.</p>
<p><strong>The gap was diagnosed once and the fix stalled.</strong> The v0.1 draft was written to fill this hole and has sat unratified in neither canon directory. §20 attaches a ratification path so this one does not join it.</p>
<p><strong>Placement was owned by nobody.</strong> <code>user-engine-pg</code> and <code>target-revenue-pg</code> are dedicated; <code>apps-pg</code>, <code>net-kingdom-pg</code>, <code>platform-pg</code>, <code>state-hub-db</code> and <code>forgejo-db</code> are shared. Both live, neither written down. <code>tenant-engine</code> raised this with <code>railiance-platform</code> on 2026-08-16. Draft-8 resolves the authority split in §8.2.</p>
<p><strong>Two contradictory defaults were already ratified.</strong> Business apps get instance-per-client; platform services pool. Nothing says which shape a new service takes, and no definition separates the categories. Decision 4.4.1 now supplies the default; §19.4 retains the missing classification rule.</p>
<p><strong>There is no honest way to describe a repo that is not there yet.</strong> The estate absorbs repos with weak or absent tenant separation. Today such a repo is simply non-conformant, leaving it two bad options: misrepresent its posture, or stay outside the framework.</p>
</section>
<section id="s2"><h2><span class="sn">02</span>What this document is</h2>
<p><strong>A framework, not a model.</strong> It specifies no single correct implementation. It supplies terminology (§3, §4), a declaration (§5), a conformance rule (§6), methodology (§12), and evidence definitions (§13).</p>
<p>A service is conformant when its declared posture is accurate and its trajectory recorded. A service is non-conformant when it claims a level it cannot evidence — regardless of how high or low that level is.</p>
</section>
<section id="s3"><h2><span class="sn">03</span>Six orthogonal axes</h2>
<p>"Is this multi-tenant?" is treated as one question. It is six, and they are independent:</p>
<div class="scroll"><table><thead><tr><th>Axis</th><th>Question</th><th>Vocabulary owner</th></tr></thead><tbody><tr><td><strong>Identity (I)</strong></td><td>How is a tenant named and validated?</td><td><code>tenant-engine</code> / IAM Profile</td></tr><tr><td><strong>Authorization (A)</strong></td><td>How is a request bound to the tenants it may act for?</td><td><code>flex-auth</code></td></tr><tr><td><strong>Enforcement (E)</strong></td><td>Where, mechanically, is the tenant boundary enforced?</td><td>This framework</td></tr><tr><td><strong>Placement (P)</strong></td><td>Which substrate holds a tenant's data?</td><td><code>railiance-platform</code></td></tr><tr><td><strong>Retention (R)</strong></td><td>How long does data persist, and how is it erased?</td><td>The storage platform; policy by the consumer</td></tr><tr><td><strong>Availability (V)</strong></td><td>What failure can the complete service path survive, and within what recovery objective?</td><td>The delivering service; substrate facts by its providers</td></tr></tbody></table></div>
<p>Conflation produces errors today. <code>rapp-postgres</code>'s <code>PostgresConsumer</code> carries <code>tenantIsolation: consumer-service-boundary</code> — an <strong>E</strong>-axis fact in a <strong>P</strong>-axis artifact, reading as though storage enforces something it does not. The "dedicated versus shared" argument mixes P (capacity, blast radius) with E (correctness).</p>
<p>The axes are separated <em>precisely so each may sit at a different level</em>.</p>
<p><span class="dec">Decision 3.1:</span> every document, declaration and plan tier that says "isolation" MUST name which axis it means.</p>
<p><span class="dec">Decision 3.2:</span> the axes couple at their tops and the couplings MUST be stated where they apply, not used to argue the axes are one:</p>
<ul><li><code>E4</code> is reachable only at <code>P3</code> or above.</li><li><code>R</code>'s erasure horizon is bounded below by <code>P</code> — on shared substrate, a consumer's horizon is the instance maximum (§4.5).</li><li><code>R4</code> by key destruction is bounded by the <strong>key boundary</strong>, which is an E-axis property. Shredding a single tenant's data requires the application to encrypt under a per-tenant key before writing; the storage platform cannot supply it. <strong>Reaching the top of the retention ladder is not a retention project.</strong></li><li><code>V</code> composes as the <strong>minimum across the critical request path</strong>, not the maximum of its components. A replicated application on a single-instance database is not V2. A tested degraded mode may remove a dependency from that path, but the bypass itself is part of the V evidence.</li></ul>
<p><span class="dec">Decision 3.3 — scope.</span> The P and R ladders describe a service's <strong>primary datastore</strong>. The V ladder describes the service's complete critical request path, including providers it synchronously depends on. Caches, search indices, message queues and background jobs are named leak surfaces in the external baselines and are assessed separately, not silently covered by a datastore level. A declaration names material secondary stores and asynchronous paths as exceptions rather than implying that one vector proves them safe.</p>
</section>
<section id="s4"><h2><span class="sn">04</span>Graduated levels</h2>
<p>Each axis carries an ordered ladder. Higher is stronger, not better: the right level is the one a service can evidence and its risk warrants.</p>
<h3>4.1 Identity (I)</h3>
<div class="breakout"><div class="ladders">
<div class="ladder"><div class="pname">Identity<span>axis I</span></div><div class="rungs"><div class="rung r0"><span class="code">I0</span><span class="txt">No tenant concept. Data not attributable to a tenant.</span></div><div class="rung r1"><span class="code">I1</span><span class="txt">A local tenant notion exists but is not canonical, <strong>or</strong> the tenant is taken from the request rather than from a verified token.</span></div><div class="rung r2"><span class="code">I2</span><span class="txt">Canonical identifiers, bound at the identity provider and carried as a verified claim, <strong>and verified by this service on its own inbound calls</strong>.</span></div><div class="rung r3"><span class="code">I3</span><span class="txt">I2 plus capability roles honoured, with live <code>tenant-engine</code> re-query for privileged, destructive, credential-vending or <code>aal2</code>-class decisions.</span></div><div class="rung na"><span class="code"></span><span class="txt">Ladder ends at I3.</span></div></div></div>
</div></div>
<p>I1 now explicitly absorbs request-supplied tenant identifiers. "Never trust client-supplied tenant IDs without validation" is a named anti-pattern; a service reading the tenant from a header is at I1 however canonical the string.</p>
<p><strong>An axis is assessed on a service's own inbound surface, never on its authority over the concept.</strong> <code>tenant-engine</code> is the source of existence for tenant records and is nonetheless at I1, because it takes the acting identity from the request body rather than from a verified token. Draft-5 conflated these by naming the authority inside the I2 definition, which made the level describing canonical identity unclaimable by the service that provides it. Corrected on tenant-engine's review — a reader would otherwise assume the authority must be at I2 by definition.</p>
<p><code>business-app-service-contract</code> §2.1 sets app-local accounts as the v1 baseline for business apps — a sanctioned low level with recorded triggers for moving up. That is the pattern this framework generalises.</p>
<h3>4.2 Authorization (A)</h3>
<div class="breakout"><div class="ladders">
<div class="ladder"><div class="pname">Authorization<span>axis A</span></div><div class="rungs"><div class="rung r0"><span class="code">A0</span><span class="txt">No authorization, or tenant context not carried.</span></div><div class="rung r1"><span class="code">A1</span><span class="txt">Ad-hoc checks scattered through handlers.</span></div><div class="rung r2"><span class="code">A2</span><span class="txt">A single local authorization boundary; tenant context bound once, centrally.</span></div><div class="rung r3"><span class="code">A3</span><span class="txt">Decisions delegated to <code>flex-auth</code> as PDP, with live re-query where the IAM Profile requires it.</span></div><div class="rung r4"><span class="code">A4</span><span class="txt">A3 over a <strong>standard</strong> PDP interface (OpenID AuthZEN Authorization API 1.0), so the decision point is swappable and the enforcement point is not coupled to one engine's request shape.</span></div></div></div>
</div></div>
<p><strong>This ladder describes enforcement points.</strong> A decision point cannot occupy A3 — "delegated to <code>flex-auth</code>" is not something <code>flex-auth</code> can do. A service that <em>is</em> a PDP declares <strong>two numbers</strong>: its own inbound level, and the maximum it enables for consumers. <code>flex-auth</code> reads <code>A0, enables A3</code> — accurate, and considerably more alarming than <code>A3</code>, which is the point. Raised by <code>flex-auth</code>, whose absence from the §5 worked examples was this surfacing implicitly.</p>
<p>A4 is new. The specification reached Final in January 2026 and Keycloak shipped experimental support in May; the argument for it is <strong>interoperability</strong> — a swappable decision point and an enforcement point not coupled to one engine's request shape.</p>
<p><em>Correction from flex-auth's review:</em> earlier drafts also justified A4 as ending the copying of action strings between repos. <strong>It does not.</strong> AuthZEN standardises the envelope — subject, action, resource, context, endpoint — and deliberately does not standardise the action vocabulary or the policy language. At A4, <code>tenant.guardrail.set</code> still has to be agreed and still gets copied. Those are two problems with different fixes, and the cheaper one is not A4: <code>flex-auth</code>'s registry already carries action definitions per system and could serve them read-only. The vocabulary argument is withdrawn.</p>
<p><strong>Internal service-to-service calls are in scope for this axis.</strong> "Skipping tenant validation for internal services" is a named anti-pattern and our estate is mostly internal calls.</p>
<p><em>Correction from flex-auth's review:</em> earlier drafts asserted that <code>flex-auth</code> calls <code>tenant-engine</code> synchronously on the authorization path. <strong>That is not true.</strong> The adapter is built and complete and has no non-test caller, so the IAM Profile's live re-query exists and is unwired — which is also why <code>flex-auth</code> cannot reach I3. Built-and-unwired is the worst of the three states because it reads as capability.</p>
<p>The requirement, narrowed on their proposal because the original was too strong to be met and would have made <code>tenant-engine</code> a hard availability dependency of every decision in the estate:</p>
<div class="rule-quote"><p>Tenant context MUST be carried on every internal hop and MUST NOT be re-derived from a service identity. It MUST be revalidated against <code>tenant-engine</code> at least once per request chain — at the service that holds or mutates the tenant's data, or before a privileged, destructive, credential-vending or <code>aal2</code>-class decision, whichever comes first. A hop that neither holds tenant data nor makes such a decision may carry the context without revalidating it.</p></div>
<p><strong>And carrying tenant context is worthless without an authenticated hop to carry it over.</strong> <code>flex-auth</code> found this in itself: it carries tenant context faithfully and cannot distinguish "user-engine asking on behalf of tenant X" from "any pod asking on behalf of tenant X".</p>
<h3>4.3 Enforcement (E)</h3>
<div class="breakout"><div class="ladders">
<div class="ladder"><div class="pname">Enforcement<span>axis E</span></div><div class="rungs"><div class="rung r0"><span class="code">E0</span><span class="txt">None. Data not tenant-keyed; separation incidental or absent.</span></div><div class="rung r1"><span class="code">E1</span><span class="txt">Data tenant-keyed, filtering applied per query at call sites.</span></div><div class="rung r2"><span class="code">E2</span><span class="txt">Filtering centralised at a single service-side choke point binding authenticated identity to permitted tenants.</span></div><div class="rung r3"><span class="code">E3</span><span class="txt">E2 <strong>plus</strong> platform-assisted filtering: row-level security keyed on a tenant GUC set transaction-locally, or an equivalent enforced data-access layer.</span></div><div class="rung r4"><span class="code">E4</span><span class="txt">Structural: the credential a workload holds cannot address another tenant's data at all. Requires per-tenant credentials and per-tenant substrate.</span></div></div></div>
</div></div>
<p><strong>Correction from draft-2.</strong> Draft-2 described E3 as something "the application cannot trivially route around". That is false and it was this document overclaiming in exactly the way §6 prohibits. Any session can re-issue <code>SET</code> on a custom GUC, so an attacker with SQL execution can reset the tenant and read across the boundary. What E3 buys is precise, and the ladder must say so:</p>
<div class="scroll"><table class="tm"><thead><tr><th>Threat</th><th>E1</th><th>E2</th><th>E3</th><th>E4</th></tr></thead><tbody><tr><td>A developer forgets a tenant predicate</td><td class="no"></td><td class="yes"></td><td class="yes"></td><td class="yes"></td></tr><tr><td>A new code path bypasses the choke point</td><td class="no"></td><td class="no"></td><td class="yes"></td><td class="yes"></td></tr><tr><td>SQL injection reaching the connection</td><td class="no"></td><td class="no"></td><td class="no"></td><td class="yes"></td></tr><tr><td>The application process is compromised</td><td class="no"></td><td class="no"></td><td class="no"></td><td class="yes"></td></tr></tbody></table></div>
<p>E3 is a strong control against <strong>accident</strong> — the common case, and the one that causes real breaches — and no control at all against <strong>compromise</strong>. Only E4 holds against both, because the credential itself cannot address another tenant's data.</p>
<p><strong>Correction: E3 layers on E2, it does not replace it.</strong> External practice treats application-layer and database-layer filtering as complementary. A service that dropped its choke point on reaching E3 would be <em>worse</em> off, since E3 fails open under injection. Claiming E3 therefore requires the E2 evidence artifact as well.</p>
<p><strong>Correction: the GUC is set transaction-locally.</strong> Draft-2 said "at pool checkout", which is session scope and the wrong instrument. Under a pooler in statement mode, <code>SET</code> leaks between clients and returns other tenants' rows — a failure that appears only under production concurrency and produces no error. Use <code>SET LOCAL</code> inside an explicit transaction.</p>
<p><strong>Platform enforcement is a platform obligation.</strong> Reaching E3 requires the storage platform to <em>offer</em> the mechanism: provisioned policies, a documented GUC contract, and a probe. Where a consumer wants E3 and the platform has not supplied it, the gap is the platform's. §19.6 asks <code>rapp-postgres</code> to define that contract, which must carry <code>FORCE ROW LEVEL SECURITY</code> on every tenant table (without it the table owner bypasses policies silently, and ADR-0001 already established that our migration role owns the tables it creates), no <code>BYPASSRLS</code> on leased roles, <code>SECURITY INVOKER</code> for ordinary logic, and an <code>EXPLAIN</code> comparison because RLS disables functional indexes built on non-leakproof functions.</p>
<p><strong>Not all data is tenant-keyed, and the ladder must not pretend otherwise.</strong> A registry whose rows <em>are</em> the tenants has no per-tenant predicate to scope a policy by; enforcing one would break the service's function rather than secure it. <code>tenant-engine</code>'s <code>tenants</code> table is the worked example — <code>key-cape</code> enumerates it at token issuance and <code>flex-auth</code> queries it live, both of which are cross-tenant reads by design.</p>
<p>A service with mixed data shapes declares <strong>E-level plus a registry exception</strong>: the level its tenant-keyed tables hold, and a named list of tables excluded because they are registries rather than tenant data. The exception is part of the claim and is reviewable; an unnamed exception is an overclaim. Without this, mixed-shape services either overclaim or stay at E2 permanently, and <code>tenant-engine</code> declined to claim E3 on precisely that reasoning.</p>
<p><strong>Default expectation</strong> for a new platform service: E2 at first serve, E3 recorded as target. Services whose cross-tenant exposure would be a reportable breach SHOULD target E3 or above.</p>
<h3>4.4 Placement (P)</h3>
<div class="breakout"><div class="ladders">
<div class="ladder"><div class="pname">Placement<span>axis P</span></div><div class="rungs"><div class="rung r0"><span class="code">P0</span><span class="txt">Shares a database with another consumer.</span></div><div class="rung r1"><span class="code">P1</span><span class="txt">Database per consumer, shared cluster.</span></div><div class="rung r2"><span class="code">P2</span><span class="txt">Dedicated cluster per consumer.</span></div><div class="rung r3"><span class="code">P3</span><span class="txt">Dedicated cluster per tenant.</span></div><div class="rung r4"><span class="code">P4</span><span class="txt">P3 plus separate region or jurisdiction.</span></div></div></div>
</div></div>
<p>Enforcement and placement are independent axes. Plotted together, with where each service actually sits — parenthesised entries are targets or defaults rather than current positions, and <code></code> marks a cell the coupling in §3.2 makes unreachable:</p>
<div class="matrix-shell"><div class="ylab">Enforcement →</div><div class="mgrid"><div class="rlab">E4</div><div class="mcell void"></div><div class="mcell void"></div><div class="mcell void"></div><div class="mcell tint4"><span class="pin ghost">business app</span></div><div class="mcell tint4"></div><div class="rlab">E3</div><div class="mcell tint3"></div><div class="mcell tint3"><span class="pin ghost">target</span></div><div class="mcell tint3"></div><div class="mcell tint3"></div><div class="mcell tint3"></div><div class="rlab">E2</div><div class="mcell tint2"><span class="pin ghost">tenant-engine</span></div><div class="mcell tint2"><span class="pin">audit-core</span></div><div class="mcell tint2"></div><div class="mcell tint2"></div><div class="mcell tint2"></div><div class="rlab">E1</div><div class="mcell tint1"><span class="pin ghost">absorbed repo</span></div><div class="mcell tint1"></div><div class="mcell tint1"></div><div class="mcell tint1"></div><div class="mcell tint1"></div><div class="rlab">E0</div><div class="mcell"></div><div class="mcell"></div><div class="mcell"></div><div class="mcell"></div><div class="mcell"></div><div class="rlab"></div><div class="clab">P0</div><div class="clab">P1</div><div class="clab">P2</div><div class="clab">P3</div><div class="clab">P4</div></div></div><div class="mnote"><span class="k"><span class="sw"></span>Where a service sits today</span><span class="k"><span class="sw g"></span>Target or default</span><span class="k"><span class="sw v"></span>Unreachable at this placement</span></div>
<p><strong>P0 → P1 → P2 is movement along the horizontal axis only.</strong> Those steps buy consumer isolation, capacity predictability, independent retention and a smaller operational blast radius. They do not raise the tenant boundary by one step. Only P3 makes E4 reachable. This is the most misusable fact in the framework and §11 governs how it may be described.</p>
<p><span class="dec">Decision 4.4.1:</span> P1 is the default for platform services; P3 for client-facing business apps, as already ratified. A service unsure which it is must resolve that first (§19.4).</p>
<p><span class="dec">Decision 4.4.2 — placement scopes to data substrate.</span> Identity-provider placement (realm-per-tenant versus Organizations) is the same silo/pool decision on a different substrate, is live in our estate, and is undecided. Realm-per-tenant carries a stated ceiling around 520 tenants, far below our target. Recorded here as a parallel question (§19.7), not folded into P.</p>
<h3>4.5 Retention and erasure (R)</h3>
<p>New in draft-3. Implemented abstractly by the storage platform for any dataset; policy is built on top of that interface by the consumer or its governance layer. Reference implementation: <code>rapp-postgres</code> ADR-0002.</p>
<div class="breakout"><div class="ladders">
<div class="ladder"><div class="pname">Retention<span>axis R</span></div><div class="rungs"><div class="rung r0"><span class="code">R0</span><span class="txt">No retention or deletion position. Data kept indefinitely by default; no deletion path exists.</span></div><div class="rung r1"><span class="code">R1</span><span class="txt">Platform default retention applies (N=30 days). The consumer has declared no requirement.</span></div><div class="rung r2"><span class="code">R2</span><span class="txt">Retention declared as N days per dataset; the <strong>erasure horizon</strong> is published, and the consumer makes no promise shorter than it.</span></div><div class="rung r3"><span class="code">R3</span><span class="txt">Policy-driven deletion: the consumer or its governance layer declares what is due, the platform sweeps whole datasets on that instruction and evidences each run.</span></div><div class="rung r4"><span class="code">R4</span><span class="txt">Verified erasure: data proven unrecoverable across live storage, backups and derived copies, by one of the two routes below.</span></div></div></div>
</div></div>
<p><strong>R4 has two routes and a service MUST name which one it uses.</strong></p>
<div class="scroll"><table><thead><tr><th>Route</th><th>Mechanism</th><th>Cost</th></tr></thead><tbody><tr><td><strong>Horizon-elapsed</strong></td><td>Wait out the published erasure horizon; the data ages out of every retained copy.</td><td>Available to everyone, proves little, and the wait is set by a co-resident's retention requirement rather than your own.</td></tr><tr><td><strong>Key-destroyed</strong></td><td>Encrypt per entity, then destroy the key. Retained copies survive but are unreadable.</td><td>Requires per-entity keys, strong encryption, and an auditable destruction record. Immediate.</td></tr></tbody></table></div>
<p><span class="dec">Decision 4.5.3 — key destruction is not sufficient on its own.</span> The key-destroyed route requires that <strong>no retained commitment reveals the erased content</strong>. Found by <code>audit-core</code>, and it is a general defect rather than a fact about them:</p>
<ul><li>A SHA-256 over a canonical record whose fields are low-entropy — event type, actor, tenant, subject, timestamp — is a <strong>confirmation oracle</strong>. Anyone holding the hash can guess the payload, hash the guess, and confirm a match. Destroying the key does not make the content unrecoverable while that hash survives.</li><li>Shreddability is <strong>not retrofittable</strong> onto an integrity chain that commits to cleartext. It has to be built as encrypt-then-hash at accept time, with the chain committing to ciphertext. Retrofitting means rewriting the chain — the exact thing a tamper-evident log exists to make detectable.</li></ul>
<p>So a service claiming R4 by key destruction must show that its retained commitments — hashes, chains, indexes, search keys — do not reveal what was erased. The remedies are an HMAC under a per-subject key that dies with the key, or a per-record salt destroyed alongside it. <strong><code>audit-core</code> cannot reach R4 under its current design and targets R2; a fleet R4 target must exempt it explicitly.</strong></p>
<p><strong>Regulatory standing of the key-destroyed route, stated carefully because overclaiming here is worse than anywhere else in this framework.</strong> Data protection authorities have accepted key destruction as erasure where physical deletion would be manifestly disproportionate, and the practice is recognised under conditions — strong encryption, irreversible destruction, and an auditable record of it. <strong>The EDPB has not formally endorsed it as Article 17 erasure.</strong> A service reaching R4 by key destruction is making a defensible claim, not a settled one, and must say so rather than reporting a clean "deleted".</p>
<p>Three further properties.</p>
<p><strong>The erasure horizon is the interval between deleting data and it ceasing to be recoverable from anything the platform holds.</strong> Deleting a row does not remove it from yesterday's backup. With an N-day window, deleted data remains recoverable for N days. That is the difference between "deleted" and "erased" and the estate had never written it down.</p>
<p><strong>On shared substrate, retention is not per-consumer.</strong> Physical backup is instance-wide — one WAL stream, one window — so the instance retention is <em>derived</em> as the maximum across co-resident consumers, and every consumer's horizon is that maximum. A consumer declaring 7 days beside one declaring 90 gets 90. This is the retention analogue of ADR-0001's blast-radius disclosure: state the coupling rather than imply an isolation that is not there.</p>
<p><strong>Retention is therefore a placement trigger.</strong> A consumer needing a horizon shorter than the instance floor cannot have one at P1. It moves to P2 for a reason with nothing to do with performance — which is exactly why it needs recording, since nobody looks for a retention argument when reviewing placement.</p>
<p><span class="dec">Decision 4.5.4 — a retention promise binds both R and P.</span> A tier making a retention claim records an R minimum and a maximum erasure horizon in days. It also requires P2 or above <strong>unless</strong> its provider contract guarantees that the shared-substrate horizon stays within that maximum and rejects or notifies before a co-resident change would extend it. A bare <code>R2</code> minimum is insufficient: at P1 another consumer can change the promise without changing the tier or its holder.</p>
<p>Deletion splits mechanism from policy. The platform deletes whole <strong>datasets</strong> on instruction and records an opaque policy reference it never interprets, so every deletion traces to what authorised it. Rows are not a dataset: row expiry is the consumer's own DML under its migration lease. Dropping a consumer's whole database is an operator-gated offboarding step, never a scheduled one.</p>
<h3>4.6 Availability (V)</h3>
<p>New in draft-8. <code>adaptive-pricing</code> found that §11 required availability claims to map to a minimum level while the framework supplied no availability vocabulary. Placement is not a substitute: a dedicated cluster can still be a single instance on a single node.</p>
<div class="breakout"><div class="ladders">
<div class="ladder"><div class="pname">Availability<span>axis V</span></div><div class="rungs"><div class="rung r0"><span class="code">V0</span><span class="txt">No availability or recovery position. Recovery is untested or depends on improvisation.</span></div><div class="rung r1"><span class="code">V1</span><span class="txt">Restart or recreate recovery in one failure domain is documented and exercised. Interruption is expected; this is recovery, not failover.</span></div><div class="rung r2"><span class="code">V2</span><span class="txt">Redundant instances provide automated service failover, with measured RTO/RPO; a shared failure domain or critical dependency may remain.</span></div><div class="rung r3"><span class="code">V3</span><span class="txt">The complete critical path survives loss of one declared failure domain, with measured RTO/RPO from an exercise.</span></div><div class="rung r4"><span class="code">V4</span><span class="txt">The complete critical path survives regional loss through tested multi-region failover, with measured RTO/RPO.</span></div></div></div>
</div></div>
<p><span class="dec">Decision 4.6.1 — V is end-to-end.</span> A service declares the minimum across the components and synchronous providers required to serve the operation. An application with three replicas over a V1 database is V1. A status page or replica count is not evidence of a higher level.</p>
<p><span class="dec">Decision 4.6.2 — availability claims name the operation.</span> A read-only degraded mode and a mutation path may have different V levels. Decision 5.2 applies: declare the paths and quote the minimum unless the customer-facing claim explicitly and unambiguously names the narrower operation.</p>
</section>
<section id="s5"><h2><span class="sn">05</span>The posture vector</h2>
<p>A service states one level per axis, plus a target, review dates, evidence and any exceptions. <code>current</code> is the highest <strong>evidenced</strong> level; a control present in code but still awaiting the evidence required by §13 goes in <code>implemented</code>, not in <code>current</code>:</p>
<pre>schema_version: &quot;0.1&quot;
framework: netkingdom-tenancy-posture
service: example-service
role: tenant-data-service
tenancy:
current: { I: 2, A: 3, E: 2, P: 1, R: 1, V: 1 }
implemented: { E: 3 }
target: { I: 2, A: 3, E: 3, P: 1, R: 2, V: 2 }
reviewed: &quot;2026-08-17&quot;
review_due: &quot;2027-02-17&quot;
service_class: interactive
gap:
E: &quot;RLS is implemented; the §13 E3 probe is still absent.&quot;
R: &quot;Retention declared; erasure horizon not yet published to consumers.&quot;
V: &quot;Automated failover is not implemented or exercised.&quot;
evidence:
A3: &quot;docs/evidence/authorization-denial.md&quot;
E2: &quot;docs/evidence/cross-tenant-review.md&quot;
P1: &quot;rapp-postgres/docs/evidence/isolation-2026-08-10.md&quot;</pre>
<p><strong>Placement exceptions.</strong> Draft-2 assigned one P level per service, which cannot express the vertically partitioned model — most tenants pooled, some dedicated — that §11's isolation tiers require. A tier requiring <code>P2</code> bought by three tenants would put the service at two levels at once, forcing an over- or under-claim. Placement is therefore declared as a default plus exceptions:</p>
<pre> placement_exceptions:
- tenants: [&quot;tenant:enterprise:*&quot;]
P: 3
reason: &quot;isolation tier; see adaptive-pricing tier definition&quot;</pre>
<p>A service with exceptions must be able to say which tenants are on which substrate. That mapping is a first-class artifact, not archaeology.</p>
<p><span class="dec">Decision 5.5 — a provider declares what it makes reachable, not where it sits.</span> The six ladders describe a <em>consumer</em> of infrastructure. They describe a <em>provider</em> of it badly, and <code>railiance-platform</code>'s review demonstrated how badly: <code>apps-pg</code> is <code>I0 A0 E0</code> because a database has no tenant concept, carries no tenant claim and applies no tenant predicate. Those zeros are <strong>structural, not weak</strong> — the cluster is exactly as strong as its consumers make it.</p>
<p>The sharp case is OpenBao at <code>E0</code>. Literally correct, and actively misleading: the mechanism in place is credential-scoped structural separation — <code>E4</code> machinery — pointed at a <em>consumer</em> boundary rather than a tenant one. A reader scanning a column of E values would rank it below a service doing per-query filtering in application code, inverting the real security position.</p>
<p>So a platform service additionally declares, per axis, <strong>the level available now, the maximum it can make reachable, and what a consumer must do to reach it</strong>. For <code>apps-pg</code>: E4 unreachable (shared credential per consumer, no per-tenant credential), E3 conditional on the GUC contract, R2 blocked on a backup target, V1 at most on the single-node rail. That is the sentence a consumer actually needs, and no arrangement of the consumer ladders produces it.</p>
<p>A provider's own <code>P</code> is <code>n/a</code>, not a number. <code>apps-pg</code> <em>provides</em> <code>P1</code>; it is not <em>at</em> <code>P1</code>, and writing <code>P: 1</code> there would later read as an isolation claim.</p>
<p>Worked examples after applying the evidence rule and minimum-across-paths rule consistently:</p>
<div class="scroll"><table><thead><tr><th>Service</th><th>Current</th><th>Notes</th></tr></thead><tbody><tr><td><code>tenant-engine</code></td><td><code>I1 A0 E1 P n/a R0 V0</code></td><td>Acting identity is caller-supplied; unauthorised read paths set the A minimum; E2-shaped child-table controls are not evidenced; SQLite is outside P; no erasure or availability evidence. This corrects draft-7, which quoted A2/E2 despite its own minimum/evidence rules.</td></tr><tr><td><code>audit-core</code></td><td><code>I1 A2 E1 P1 R2 V0</code></td><td>E2 is implemented on both paths but awaits the adversarial artifact, so current remains E1. Its 30-day retention and erasure horizon are now declared and published.</td></tr><tr><td><code>flex-auth</code></td><td><code>I1 A0 E1 P n/a R n/a V0</code></td><td>Enables A3 for consumers. <code>/v1/check</code> authenticates no caller; E2 is implemented but not evidenced.</td></tr><tr><td><code>platform-pg</code> (provider)</td><td><code>I0 A0 E0 P n/a R2 V1</code></td><td>Provides P1; backup/restore and single-node recovery are evidenced. Provides no tenant boundary by itself.</td></tr><tr><td><code>apps-pg</code> (provider)</td><td><code>I0 A0 E0 P n/a R0 V0</code></td><td>Zeros are structural, except R0/V0 are live gaps: no backup and no recovery evidence.</td></tr><tr><td><code>adaptive-pricing</code> observatory</td><td><code>I0 A0 E0 P n/a R n/a V0</code></td><td>Local, unauthenticated, single-user analysis surface; not a production service.</td></tr><tr><td>A newly absorbed repo</td><td><code>I1 A1 E1 P0 R0 V0</code></td><td>Conformant <strong>if declared</strong>, with a recorded path.</td></tr></tbody></table></div>
<p><span class="dec">Decision 5.1:</span> the posture vector is declared in the repo, not in the hub, consistent with local-files-are-source-of-truth.</p>
<p><span class="dec">Decision 5.2 — declare per path, quote the minimum.</span> A service whose mutations are authorized and whose reads are not is at the reads' level. The quoted number is the minimum across paths; the per-path detail is declared beside it.</p>
<p>Draft-6 required only the minimum, on <code>tenant-engine</code>'s review. <code>audit-core</code> then showed why that is insufficient on its own: a bare minimum destroys signal, because <code>E3</code>-write/<code>E1</code>-read declares identically to <code>E1</code>/<code>E1</code>. Bare per-path invites "our write path is E3", which is the sentence §6 exists to stop. Both, related explicitly, is the rule.</p>
<p>Two services found this shape in themselves within a day of each other — <code>tenant-engine</code> (writes authorized, three read routes not) and <code>audit-core</code> (write path tenant-filtered, read path not filtered at all). Most services enforce harder on write than read, so this is the common case, not the corner.</p>
<p><span class="dec">Decision 5.3 — <code>n/a</code> is a level, and it is conformant.</span> <code>P0</code> presupposes a shared database and <code>R0</code> presupposes retained data. A service holding nothing at rest — <code>flex-auth</code> runs with its registry and policy baked read-only into the image and no decision log persisted — is neither. A datastore outside a ladder's substrate vocabulary, such as <code>tenant-engine</code>'s current SQLite PVC, also uses <code>n/a</code> rather than inventing a level. Without an admissible <code>n/a</code>, a missing rung <strong>forces</strong> the fabrication §6 prohibits, which is precisely what draft-1 was rejected for. <code>n/a</code> is declared with a stated reason.</p>
<p><span class="dec">Decision 5.4 — the vector lives at <code>tenancy.yaml</code> in the repo root.</span> Draft-6 said "in the repo" and not where or in what shape, which left §12's guard needing per-repo archaeology. <code>flex-auth</code> adopted <code>tenancy.yaml</code> speculatively; adopted here as the convention. A repo representing one service uses the single-service form above. A layer repo uses the schema's <code>services</code> list in the same root file — one vector per service, never an average. The normative schema is <code>canon/schemas/tenancy-posture_v0.1.schema.json</code>; prose documents may explain a declaration but do not replace it. The schema carries <code>current</code>, <code>implemented</code>, <code>target</code>, <code>reviewed</code>, <code>review_due</code>, <code>gap</code>, <code>placement_exceptions</code>, <code>service_class</code> (§8.3), per-path detail (§5.2), and provider reachability (§5.5). From the <code>net-kingdom</code> repo, owners validate one or more declarations with <code>uv run tools/tenancy-posture/validate.py &lt;path&gt;...</code>; the validator applies the JSON Schema and the evidence, date, implemented/current and provider-range rules that JSON Schema alone cannot express.</p>
</section>
<section id="s6"><h2><span class="sn">06</span>Conformance is accuracy, not altitude</h2>
<div class="rule-quote"><p><strong>A service is conformant when its declared posture is accurate, its target is recorded, and it does not claim a level it cannot evidence. It is non-conformant when it overclaims — at any altitude.</strong></p></div>
<ul><li>Declaring <code>E0</code> is conformant. Concealing <code>E0</code> is not.</li><li>A repo may be absorbed at any posture. It may not be absorbed silently.</li><li>No service is blocked from the estate for being low on a ladder. Services MAY be blocked from <em>specific work</em> — serving a tenant grouping, holding a data class, carrying a plan tier — by requirements expressed as minimum levels.</li><li>Downgrading is permitted and must be declared. A regression found by guarding is a defect; a regression declared in advance is a decision.</li><li><strong>A low level may be permanent by design, and the declaration must be able to say so.</strong> <code>flex-auth</code> is <code>I1</code> and always will be: a decision point evaluates the claims it is handed, and verifying its own inputs would make it the identity provider its scope refuses to be. A <code>target</code> equal to <code>current</code> with a reason is a settled position, not a stalled trajectory, and §12's guard must not nag it as though it were one.</li></ul>
<p><span class="dec">Decision 6.1 — downgrades propagate.</span> Before a planned downgrade of a current level or a provider's available level, the declaring repo MUST resolve the tier definitions and consumers that reference it. A downgrade below a recorded minimum blocks the change until the claim is changed, the workload is moved, or the affected owner explicitly accepts the gap. An unplanned regression is an incident and triggers the same notifications. Updating <code>tenancy.yaml</code> without notifying dependants is declaration drift, not a completed downgrade.</p>
<p>Without the axis separation, "not rigorous about tenant separation" is one verdict a repo passes or fails. With it, the same repo is <code>I1 A1 E1 P0 R0 V0</code> with a path — a plan, not an indictment.</p>
</section>
<section id="s7"><h2><span class="sn">07</span>Portability across placement levels</h2>
<p>Movement between P levels must be operational, not a rebuild:</p>
<ul><li>Connect by injected credential only — no cluster, host, namespace or database name in source.</li><li>Own a whole database, never tables inside someone else's.</li><li>Idempotent schema creation.</li><li>No cross-database joins or co-location assumptions.</li></ul>
<p><span class="dec">Decision 7.1:</span> mandatory at P1 and above. At P3, SHOULD rather than MUST — a per-client instance that never moves is not misconformant for naming its own database.</p>
</section>
<section id="s8"><h2><span class="sn">08</span>Placement triggers</h2>
<p>Recorded at provisioning time: noisy neighbour on a latency-critical path; a compliance or residency requirement; a plan tier requiring a higher minimum; an erasure horizon that no longer fits (§4.5); connection or memory ceiling reached.</p>
<p><span class="dec">Decision 8.1:</span> triggers MUST be <em>monitored</em>, not merely recorded. A trigger in a YAML comment nobody re-reads is documentation, not control.</p>
<p><span class="dec">Decision 8.2 — split authority, machine-reconciled.</span> <code>railiance-platform</code> owns the placement rule; the package repo owns the substrate numbers and enforcement; the consuming repo owns its workload requirements; <code>adaptive-pricing</code> owns any tier minimum. <code>adaptive-pricing</code> declined a standing co-signature and the framework accepts the replacement: typed tier minima are joined to consumer and provider declarations at tier definition and whenever one changes. A machine-checkable constraint must not depend on somebody remembering to collect a signature.</p>
<p><span class="dec">Decision 8.2.1 — trigger monitoring has an owner.</span> The provider monitors capacity ceilings and co-residency; the consumer monitors latency, compliance and erasure requirements; <code>adaptive-pricing</code> monitors tier-definition changes. The placement owner reconciles those signals. A trigger marked <code>unmonitored</code> is an explicit gap and cannot support a customer assurance claim.</p>
<h3>8.3 Service class — a placement input, never a priority</h3>
<p>A latency-critical consumer and a batch consumer can share an instance today with nothing distinguishing them. <code>tenant-engine</code> sits on <code>flex-auth</code>'s synchronous authorization path and chose a 5s statement timeout for that reason; <code>audit-core</code>, co-resident, is not latency-critical. Nothing prioritises between them.</p>
<p><strong>The framework does not add a QoS axis, because the platform cannot enforce one.</strong> Community PostgreSQL has no resource governor: no per-role CPU or I/O priority, no resource queues, no workload classes. Those exist in EDB's enterprise variant, in Greenplum, and in SQL Server — not in what we run. A declared priority level would therefore be an unenforced claim sitting in a declaration, which is precisely what retiring <code>tenantIsolation</code> was about. An axis implies graduation and enforcement; this has neither.</p>
<p><span class="dec">Decision 8.3.1 — co-residents are equal.</span> On shared substrate no consumer's query yields to another's. A consumer whose latency requirement cannot survive an unprioritised neighbour must escalate to <code>P2</code>. That is the honest mechanism and it is the only one we have.</p>
<p><span class="dec">Decision 8.3.2 — service class is declared anyway</span>, as a category rather than a level: <code>latency-critical</code>, <code>interactive</code>, or <code>batch</code>. It buys three things, none of which is priority:</p>
<ul><li><strong>A placement input.</strong> Mixing <code>latency-critical</code> with <code>batch</code> on one instance is a recognised mismatch. It may still be the right call — it is right today — but it should be a decision, not an accident of who was provisioned when.</li><li><strong>A trigger.</strong> A <code>latency-critical</code> consumer acquiring a <code>batch</code> co-resident is a recorded placement trigger under §8, on the same footing as noisy neighbour.</li><li><strong>An acceptance criterion for evidence.</strong> The noisy-neighbour artifact in §13 asks whether measured degradation is <em>acceptable</em>; without a declared class that word has no referent. Degradation tolerable for <code>batch</code> may be an outage for <code>latency-critical</code>.</li></ul>
<p><span class="dec">Decision 8.3.3 — class mixture must be visible.</span> The platform reports which classes are co-resident. An unenforceable risk that nobody can see is strictly worse than one that is stated.</p>
<p>The known escalation short of P2 is gateway-level prioritisation — ordering submissions in a connection proxy by the requesting tenant's current consumption. It is real, it is where the industry puts this when it must, and it is new infrastructure we do not run. Recorded as the option, not adopted.</p>
</section>
<section id="s9"><h2><span class="sn">09</span>Credentials as a tenancy control</h2>
<p>Short-lived leased credentials re-read at connection checkout, with overlap-first rotation, bound the residual risk at every E level below E4: a leaked credential expires rather than persisting. Stronger than the industry norm of a long-lived per-service secret.</p>
<p><span class="dec">Decision 9.1:</span> static long-lived database credentials are not a sanctioned path for any service above E0.</p>
<p><span class="dec">Decision 9.2 — the rule extends to consumer-facing credentials.</span> Draft-6 named database access only. <code>audit-core</code> pointed out that its <em>ingest</em> credentials are static long-lived bearer tokens, rotated by publishing a second alongside the first — and that the argument applies with <strong>more</strong> force to the credential that actually carries the tenant claim than to the one that reaches the database behind it. Read as an accidental omission; it was. Consumer-facing credentials are named in. Where a service cannot yet meet this, it is a stated gap rather than a silent exclusion.</p>
</section>
<section id="s10"><h2><span class="sn">10</span>Blast radius must be published</h2>
<p><span class="dec">Decision 10.1:</span> every platform holding consumer data MUST publish, in concrete terms, what a leaked runtime credential can and cannot reach at the levels it operates. <code>rapp-postgres</code> ADR-0001 §5 is the reference. Where the model cannot provide a guarantee, the platform says so and names the escalation.</p>
<p><span class="dec">Decision 10.2 — quotas are disclosed, not discovered.</span> The same obligation extends from what a leaked credential can reach to what the platform will refuse to do for you. Every consumer MUST be told, at provisioning, the throttles and quotas enforced against it — connection limits, statement timeouts, idle-transaction timeouts — and told again when they change. A consumer learning its statement timeout by hitting it in production is a disclosure failure, not a consumer bug. This is how <code>tenant-engine</code> was provisioned, by good practice rather than by rule; the rule now exists.</p>
</section>
<section id="s11"><h2><span class="sn">11</span>Commercial expression</h2>
<ul><li><strong>11.1</strong> Plan tiers are expressed <em>internally</em> as typed assurance requirements. A tier may require <code>E3 P2 R2 V2</code> and a maximum erasure horizon; it need not print those labels anywhere customer-facing.</li><li><strong>11.2</strong> Marketing and product language is free. No requirement to expose level labels or this document. "Dedicated infrastructure", "isolated tenancy", "private instance" all remain available.</li><li><strong>11.3</strong> The constraint is on <strong>evidence, not vocabulary</strong>. A customer-facing isolation, availability or retention claim must map to a minimum level the delivering service actually holds, recorded once when the tier is defined. The review is internal and happens at tier definition — not per campaign.</li><li><strong>11.4</strong> Two hard lines, because these reach contracts and compliance questionnaires:</li><li>A claim that another tenant <strong>cannot</strong> reach the customer's data requires <strong>E4</strong>.</li><li>A claim that deleted data <strong>is gone</strong> requires <strong>R4</strong>, or an erasure horizon disclosed alongside it. Where R4 is reached by key destruction, the claim is defensible but not settled law (§4.5) — it may be made, and it may not be made in language that implies a regulator has blessed it.</li><li>A claim that service survives loss of a zone requires <strong>V3</strong>; regional-loss language requires <strong>V4</strong>. "High availability" without a named failure and measured recovery objective is not an assurance claim this framework can evidence.</li><li><strong>11.5 — sanctioned honest language.</strong> The strong prohibitions above must not leave a commercial writer with only silence:</li><li>E3 may be described as database-backed defence against an omitted tenant filter; it must not be paraphrased as "another tenant cannot reach".</li><li>P2 may be described as a dedicated service database cluster with an independent capacity and restore boundary; it is not tenant-dedicated.</li><li>R2 may state the declared retention and published erasure horizon.</li><li>V1 may state exercised restart recovery in one failure domain and must say that interruption and single-domain loss remain.</li><li><strong>11.6 — authority and reconciliation.</strong> The tier definition is authoritative for the minimum and customer wording. <code>tenancy.yaml</code> is authoritative for the delivering service's current level; provider declarations are authoritative for what infrastructure makes available. None is derived by copying another. Approval joins them and fails closed on a missing, stale or insufficient declaration. A performance-differentiated tier requires P2 or an enforceable resource governor; service class alone grants no priority.</li></ul>
</section>
<section id="s12"><h2><span class="sn">12</span>Methodology — analyze, establish, improve, guard</h2>
<p><strong>Analyze.</strong> Assess a repo against the ladders; produce <code>tenancy.current</code> with reasoning recorded. Applies to new and absorbed services alike.</p>
<p><strong>Establish.</strong> Declare the target and gap. The target is set by data class, tenant groupings served and plan tiers carried — not by ambition.</p>
<p><strong>Improve.</strong> Move one axis at a time. Raising P while leaving E untouched is the characteristic misstep.</p>
<p><strong>Guard.</strong> Verify continuously that the declared posture holds — <strong>against the service's own declaration</strong>, not a universal maximum. Nobody must prove every service is at E4; the check is that none is below what it declared.</p>
<p>Regression found by guarding is a defect; regression declared in advance is a decision. The estate has been bitten twice by silent pin rollbacks producing ordinary-looking 403s and 404s rather than errors. Posture regression looks the same — an RLS context leak returns correct-looking rows for the wrong tenant. Guarding must be designed for invisible failure, not for crashes.</p>
</section>
<section id="s13"><h2><span class="sn">13</span>Evidence per level</h2>
<p><span class="dec">Decision 13.1:</span> a current level is claimed only with its evidence artifact present. This turns §6's accuracy rule from an honour system into a check. <code>implemented</code> records a control observed in code or configuration whose required artifact is still absent; it never satisfies a tier minimum.</p>
<p><span class="dec">Decision 13.1a — the floor needs no artifact, only a reason.</span> Found independently by <code>audit-core</code> and <code>flex-auth</code>: the table below defines artifacts from <code>I2</code>, <code>A2</code>, <code>E1</code>, <code>P1</code>, <code>R2</code> upward and none below, so a literal 13.1 made the lowest rungs unclaimable — including §5's own worked example of a conformant absorbed repo, <code>I1 A1 E1 P0 R0</code>, which could not satisfy it on any axis. A rule that forbids the declaration §6 exists to permit is a defect in the rule.</p>
<p>At <code>I0/I1</code>, <code>A0/A1</code>, <code>E0</code>, <code>P0</code>, <code>R0/R1</code>, <code>V0</code>, or <code>n/a</code>, a declaration requires a <strong>stated reason</strong>, not an artifact. Evidence is what stops you overclaiming, and there is nothing to overclaim at those floors.</p>
<p><span class="dec">Decision 13.4 — an artifact must assert something achievable.</span> Draft-3's noisy-neighbour evidence required proof that a saturating consumer "does not breach" another's allowance. Shared infrastructure cannot provide that; the risk is inherent and cannot be wholly removed. An artifact that can only fail, or that passes by being run gently enough, is an overclaim wearing the costume of evidence. Where a property cannot be guaranteed, the artifact measures and records it instead.</p>
<p><span class="dec">Decision 13.2 — evidence is of two kinds, and conflating them is an overclaim.</span> <em>Mechanical</em> evidence is a structural assertion a machine can make and belongs in CI. <em>Adversarial</em> evidence is semantic, requires setting up separate tenant contexts and comparing responses, and carries a review date rather than a green build. Cross-tenant findings are the category external testing practice identifies as needing human review. <strong>A passing CI run is not E2 evidence.</strong></p>
<div class="scroll"><table><thead><tr><th>Level</th><th>Evidence</th><th>Kind</th></tr></thead><tbody><tr><td><strong>I2</strong></td><td>Identifiers validated against the vocabulary; rejection test for a malformed id; binding shown to come from a verified token</td><td><span class="kind ">Mechanical</span></td></tr><tr><td><strong>I3</strong></td><td>Live re-query demonstrated on an <code>aal2</code>-class path; cached-claim path shown unused there</td><td><span class="kind ">Mechanical</span></td></tr><tr><td><strong>A2</strong></td><td>Choke point identified; test that an unbound request is refused</td><td><span class="kind ">Mechanical</span></td></tr><tr><td><strong>A3</strong></td><td>Live decision with a denial observed at the endpoint, not only at the decision surface</td><td><span class="kind ">Mechanical</span></td></tr><tr><td><strong>A4</strong></td><td>Decision served over the standard interface; a second PDP substituted without PEP change, <strong>with the decision differences between the two recorded</strong> — substitution proves interface portability, not decision equivalence</td><td><span class="kind ">Mechanical</span></td></tr><tr><td><strong>E1</strong></td><td>Every tenant-owned table carries the tenant key</td><td><span class="kind ">Mechanical</span></td></tr><tr><td><strong>E2</strong></td><td>Choke point identified; identity bound to tenant A demonstrably cannot read tenant B</td><td><span class="kind adv">Adversarial, with a review date</span></td></tr><tr><td><strong>E3</strong></td><td><code>FORCE ROW LEVEL SECURITY</code> on every tenant table; no <code>BYPASSRLS</code> on leased roles; probe that a session without the GUC reads nothing; probe that a wrong GUC reads nothing; <code>EXPLAIN</code> comparison</td><td><span class="kind ">Mechanical</span></td></tr><tr><td><strong>E4</strong></td><td>Per-tenant credential demonstrated unable to connect to another tenant's substrate</td><td><span class="kind ">Mechanical</span></td></tr><tr><td><strong>P1P4</strong></td><td>Provisioning declaration plus the platform's isolation probes</td><td><span class="kind ">Mechanical</span></td></tr><tr><td><strong>Shared P1P2 capacity assurance</strong></td><td>A recorded baseline of per-consumer resource usage; a run in which one consumer saturates its declared allowance; evidence that the governance controls <strong>bind</strong> (the greedy consumer is held at its limits) and that the degradation co-residents experience is <strong>measured, recorded and judged acceptable against each one's declared service class</strong> (§8.3); the aggregate headroom at time of measurement</td><td><span class="kind adv">Adversarial, load-generated, with a review date</span></td></tr><tr><td><strong>R2</strong></td><td>Declared retention rendered; erasure horizon published and reported in the operator surface</td><td><span class="kind ">Mechanical</span></td></tr><tr><td><strong>R3</strong></td><td>Sweep evidence records: timestamp, dataset, identifiers removed, authorising policy reference</td><td><span class="kind ">Mechanical</span></td></tr><tr><td><strong>R4</strong></td><td>Erasure demonstrated across live data, backups and derived copies within the horizon</td><td><span class="kind adv">Adversarial</span></td></tr><tr><td><strong>V1</strong></td><td>Critical dependencies enumerated; restart/recreate recovery exercised; interruption and measured recovery time recorded</td><td><span class="kind ">Mechanical exercise</span></td></tr><tr><td><strong>V2</strong></td><td>One instance terminated while traffic continues or recovers automatically; measured RTO/RPO and remaining shared failure domains recorded</td><td><span class="kind adv">Adversarial, failure-injected</span></td></tr><tr><td><strong>V3</strong></td><td>Declared failure domain removed in an exercise; complete critical path and degraded modes observed against RTO/RPO</td><td><span class="kind adv">Adversarial, failure-injected</span></td></tr><tr><td><strong>V4</strong></td><td>Region made unavailable in an exercise; traffic and state recover in the alternate region against RTO/RPO</td><td><span class="kind adv">Adversarial, failure-injected</span></td></tr></tbody></table></div>
<p>The P1P4 artifact proves the declared placement topology. The shared-capacity artifact is additional: it is required before a P1/P2 service can claim that a noisy-neighbour control binds, that the trigger is actively guarded, or that a customer performance assurance survives co-residency. It is not required merely to report the true topology as P1 or P2. No such capacity artifact exists in the estate today, so §11 requires P2 or an enforceable governor for a performance-differentiated tier.</p>
<p><span class="dec">Decision 13.3:</span> the tenant-boundary E2/E3 and noisy-neighbour artifacts do not exist anywhere in the estate today. <code>rapp-postgres</code> runs 19 adversarial probes, all against the <em>consumer</em> boundary, none against the tenant boundary inside a consumer. Externally, what this framework calls a tenant boundary failure is <strong>Broken Object Level Authorization</strong> — OWASP API1, top of the API Security Top 10 since that list launched, and the most commonly exploited API vulnerability in published assessments. We have no coverage for the highest-ranked risk in our class of system. §19.3 records the owner.</p>
</section>
<section id="s14"><h2><span class="sn">14</span>Adoption stance — structure, not tooling</h2>
<p><span class="dec">Decision 14.1:</span> external research is design input. This estate adopts published standards and structural patterns; it does not adopt tooling unless that tooling is an established industry standard with broad application. Everything else is built ground-up, so it can be optimised and refactored as the estate sees fit.</p>
<div class="scroll"><table><thead><tr><th>Class</th><th>Stance</th></tr></thead><tbody><tr><td>Security baselines (OWASP Multi-Tenant Security Cheat Sheet, API Security Top 10)</td><td>Adopt as the external reference our ladders answer to</td></tr><tr><td>Standards bodies (OpenID AuthZEN 1.0)</td><td>Adopt — this is what A4 is</td></tr><tr><td>Reference taxonomies (Azure tenancy models, AWS SaaS Lens, cell architecture)</td><td>Adopt as structure</td></tr><tr><td>Engine behaviour (PostgreSQL RLS mechanics)</td><td>Facts, not tooling</td></tr><tr><td>Third-party analyzers and test frameworks</td><td><strong>Do not adopt.</strong> Take their rule taxonomies as checklists for probes we write ourselves</td></tr></tbody></table></div>
<p>The practical effect is small and good: <code>rapp-postgres</code> already owns a ground-up probe harness — bash and psql, no dependency tree — that found four real defects in its own provisioning SQL. The evidence artifacts in §13 become new probes in a tool we control. One idea worth reimplementing from the external survey is <strong>policy-diff classification</strong>: labelling a change to an enforcement policy as safe or breaking <em>before</em> it lands.</p>
</section>
<section id="s15"><h2><span class="sn">15</span>Alternatives considered</h2>
<p><strong>One fixed model with a single set of characteristics</strong> (draft-1). <em>Rejected:</em> cannot describe a repo that is not there yet, forcing absorbed repos to misrepresent their posture or stay outside. A framework that can only describe its own end state is not a framework.</p>
<p><strong>A maturity model with a single overall level.</strong> <em>Rejected:</em> collapses the axis separation. A service strong on identity and weak on enforcement has a specific, actionable gap; one composite score hides it and invites averaging.</p>
<p><strong>Prohibiting row-level security</strong> (draft-2's inherited position). <em>Rejected in draft-2, refined in draft-3:</em> RLS is a real rung against the common threat. The error was never RLS — it was describing E3 in E4's language.</p>
<p><strong>Schema-per-consumer in one database.</strong> <em>Rejected:</em> <code>pg_catalog</code> is readable per-database, so every co-resident enumerates every other's table and column names regardless of grants. Retained as a describable state, never a target.</p>
<p><strong>Mandating E4 for everyone.</strong> <em>Rejected:</em> the tenant taxonomy includes <code>consumer</code> (private individuals) and <code>family</code>. A cluster per private individual is economically impossible; the taxonomy is itself evidence pooling is required.</p>
<p><strong>Per-consumer physical backup retention.</strong> <em>Rejected:</em> CNPG retention is a property of the instance's WAL archive. There is no mechanism, and claiming it would be a fabricated guarantee. Hence the derived maximum in §4.5.</p>
<p><strong>Platform-scheduled row expiry.</strong> <em>Rejected:</em> requires the platform to hold DML authority over consumer schemas and interpret consumer data semantics, both forbidden by ADR-0001. The consumer's migration lease is the correct instrument.</p>
<p><strong>Leaving each repo to its own model.</strong> <em>Rejected:</em> the status quo, which produced two contradictory ratified defaults and an unowned placement question.</p>
</section>
<section id="s16"><h2><span class="sn">16</span>Held against outside practice</h2>
<p><strong>The graduated reframe is corroborated, not invented here.</strong> Microsoft's tenancy-model guidance states it almost verbatim: <em>"Instead of viewing isolation as a discrete property, consider it a spectrum. You can deploy components of your architecture that are more isolated or less isolated than other components in the same architecture."</em> The same guidance derives our E↔P coupling independently — shared deployment means enforcement lives in application code; dedicated deployment means it is structural.</p>
<p><strong>Stronger than typical.</strong> Most multi-tenancy literature models one boundary, tenant-to-tenant. This estate has <strong>two stacked boundaries</strong>: platform-service to platform-service, and tenant to tenant inside a consumer. Naming them separately and refusing to enforce both with one mechanism is uncommon and correct. Graduated per-axis levels also beat the silo/pool/bridge trichotomy, which is approximately our P axis with the other four missing — which is why it cannot express "pooled infrastructure, structurally enforced boundary".</p>
<p><strong>Weaker than typical.</strong> The pool model's standard mitigation is a <em>verified</em> enforcement layer every service is demonstrably routed through. We have the concept and none of the verification (§13.3).</p>
<p><strong>Adopted without naming it.</strong> Short-lived leased credentials re-read at checkout beat the long-lived-secret norm. §9 promotes it to a tenancy control.</p>
<p><strong>Still unexplored.</strong> Neither P nor R describes a <strong>cell</strong> — a slice of infrastructure with a <em>fixed maximum size</em>, sized so one cell's failure is survivable and cell count scales linearly. <code>platform-pg</code> is, in these terms, an uncapped cell: §17 computes a ceiling and nothing enforces it (§19.8).</p>
<p>Sources: the five research digests in <code>the-custodian/research/2026-08-17-adr008-*</code>, which carry full citations for the claims in this section.</p>
</section>
<section id="s17"><h2><span class="sn">17</span>Scaling demands</h2>
<p>Derived from the live <code>platform-pg</code> specification. Connection arithmetic is exact; the per-backend memory estimate remains unmeasured and is explicitly a gap in <code>rapp-postgres</code> ADR-0004.</p>
<pre>instances: 1 (no HA; single-node rail)
max_connections: 100
memory limit: 1Gi
per consumer: 14 connections (12 runtime + 2 migration)</pre>
<p><strong>The hard connection bound is roughly six declarations; the enforceable operational ceiling is four.</strong> Seven declarations request 98 of 100 connections before CNPG's instance manager, metrics exporter and reserved slots. Every one of them is politely inside its declared 14-connection allowance; the instance still fails. ADR-0004 sets four because memory is expected to bind first and fails by OOM-killing every co-resident rather than refusing one connection.</p>
<p>That distinction matters because our governance addresses the wrong shape. Per-consumer <code>connection_limit</code>, <code>statement_timeout</code> and <code>idle_in_transaction_session_timeout</code> guard well against <strong>one greedy consumer</strong>. They do nothing about <strong>the aggregate of many modest ones</strong>, which is the second and less intuitive noisy-neighbour failure and the one this number describes. Two workload consumers plus the isolation probe occupy three of the four declared slots. The next workload request must trigger measurement and the overflow decision before admission.</p>
<p><strong>Memory likely binds first.</strong> 100 backends against 1Gi is ~10MB per backend. Connection exhaustion errors clearly; memory pressure OOM-kills and degrades every co-resident at once.</p>
<p><strong>E3 and pooling.</strong> <em>Corrected from draft-2, which had this backwards.</em> Transaction-scoped context (<code>SET LOCAL</code> inside an explicit transaction) is what makes E3 <strong>safe</strong> under a pooler. Statement-level pooling is what breaks it, serving other tenants' rows under concurrency with no error. E3 constrains which pooling mode is available, not whether pooling is available.</p>
<p><strong>Retention consumes the volume.</strong> WAL accumulates with the window, and §4.5 makes the window the maximum across consumers. A consumer declaring a long retention extends everyone's horizon <em>and</em> everyone's storage draw against a 20Gi volume.</p>
<p><strong>Restore time couples all consumers.</strong> Physical backup is instance-wide, so a consumer's RTO is a function of <em>total</em> instance size, not its own.</p>
<p><strong><code>platform-pg</code> is V1.</strong> <code>instances: 1</code> on a single-node rail provides exercised restart recovery and no failover. P1 describes its consumer placement and says nothing about this availability fact; the new V axis carries it.</p>
</section>
<section id="s18"><h2><span class="sn">18</span>Consequences</h2>
<ul><li>The estate gains one vocabulary and a way to be honest about partial adoption.</li><li>Absorbed repos get a described state and a path instead of a failing grade.</li><li><code>tenantIsolation</code> in <code>PostgresConsumer</code> is revealed as a mislabelled field.</li><li>The verification problem becomes tractable: guard against declaration.</li><li>Draft-2's RLS prohibition is reversed and its E3 description corrected; <code>rapp-postgres</code> acquires an obligation to define and offer the mechanism.</li><li>Adding a consumer with long retention <strong>silently extends everyone's erasure horizon</strong>. This must reach the consumer review checklist, not only this document.</li><li>A service selling an isolation tier must maintain a tenant→substrate mapping it does not have today.</li><li>Availability becomes an end-to-end, evidenced property rather than an inference from replica count or placement.</li><li>Nothing here changes a running system.</li></ul>
</section>
<section id="s19"><h2><span class="sn">19</span>Review resolutions and residual questions</h2>
<ol><li><strong><code>tenantIsolation</code> field — resolved.</strong> <code>rapp-postgres</code> retired it. A consumer declaration asks for mechanisms; posture lives in the consumer's <code>tenancy.yaml</code>.</li><li><strong>Placement ownership — resolved.</strong> §8.2 records the split. The policy has one owner; typed tier requirements replace the declined commercial co-signature.</li><li><strong>E2, E3 and noisy-neighbour evidence</strong><strong>owned as of 2026-08-17</strong> by <code>whitehat-security</code> (WHITEHAT-WP-0001), an independent adversarial evidence facility seeded for this purpose. <code>audit-core</code> and <code>tenant-engine</code> were right to decline it as fleet-scope work; the answer was a home of its own rather than a volunteer.</li></ol>
<p><strong>Owned by NetKingdom</strong> — corrected 2026-08-17; an earlier revision of this section proposed otherwise on independence grounds and was overruled. Offensive security is security work and belongs with the repo that owns security. The facility is framed offensively rather than as a conformance checker: it is pointed at infrastructure we choose, our own estate among them, and conformance testing is one use of a general capability.</p>
<p>The residual tension is recorded rather than resolved: NetKingdom owns this framework <em>and</em> the facility that tests conformance to it, so those findings are NetKingdom assessing NetKingdom. The mitigation is that findings leave for <code>risk-nexus</code>, under <code>the-custodian</code>, rather than being closed in place. Proportionate, not perfect. Revisit if conformance findings start getting quietly closed.</p>
<p>Two consequences land back here. <strong>Cadence is now a security parameter, not a schedule</strong> — for any control whose guarantee is detection rather than prevention, the interval between probe runs <em>is</em> the exposure window, and <code>rapp-postgres</code> ADR-0003 leaves that number to the facility. And <strong>a passing suite is not proof of isolation</strong>; it is proof that the attacks attempted did not work. §13's evidence artifacts should be read with that distinction, because a green run recorded as "E2 verified" would be exactly the overclaim §6 prohibits.</p>
<ol><li><strong>Business app vs platform service — open.</strong> Custodian canon: a classification rule. Candidate: reuse <code>repo-classification-standard_v1.0</code>.</li><li><strong>Tier → minimum level mapping — policy resolved, implementation open.</strong> <code>adaptive-pricing</code> owns typed minima and wording; <code>tenant-engine</code> owns plan assignment by id. Current tiers make no assurance claims.</li><li><strong>The E3 mechanism — resolved.</strong> <code>rapp-postgres</code> ADR-0003 publishes the GUC contract with the <code>FORCE</code>/<code>BYPASSRLS</code>/<code>SECURITY INVOKER</code>/<code>EXPLAIN</code> requirements.</li><li><strong>Identity-provider placement — open.</strong> Owner of <code>key-cape</code>: realm-per-tenant or Organizations? Realm-per-tenant's ~520 tenant ceiling is below our target.</li><li><strong>Cell sizing — resolved for <code>platform-pg</code>.</strong> <code>rapp-postgres</code> ADR-0004 sets four consumers and names absent overflow target <code>platform-pg-2</code>; measurement and provisioning remain live gaps.</li><li><strong>Retention floor and ceiling — resolved as policy.</strong> Both exist; requests outside them fail validation and the package repo owns the numbers.</li><li><strong>Engine neutrality — open.</strong> The P ladder rests on a PostgreSQL property. State it engine-specifically and say so, or abstract it and risk a non-Postgres implementation that silently differs?</li><li><strong>Erasure versus audit — framework resolved.</strong> <code>audit-core</code>: crypto-shredding a tenant's audit records destroys the evidence the service exists to hold, and ADR-0001 §2 deliberately built the role model so history could not be rewritten. The usual resolution separates the <em>fact</em> of an event, retained, from its <em>personal payload</em>, encrypted per subject and shreddable. Raised because a naive "R4 everywhere" target would instruct the audit service to destroy its own evidence. <code>audit-core</code> targets R2 and is explicitly not a fleet R4 target. The legal basis for retaining audit facts remains a risk/legal question outside this framework.</li><li><strong>Quality of service</strong><strong>resolved 2026-08-17.</strong> Co-residents are equal; a declared <em>service class</em> informs placement but never grants priority. See §8.3. The question asked whether to add a QoS dimension; the answer is no, and the reason is that we could not enforce one.</li></ol>
<p><strong>Routed elsewhere, deliberately.</strong> The tenant identifier <code>tenant:&lt;grouping&gt;:&lt;name&gt;</code> embeds headcount bands (<code>small</code>, <code>medium</code>, <code>large</code>) that change as a tenant grows, contradicting the consensus that identifiers should not encode mutable attributes. That is a critique of ADR-0013, not of this framework, and belongs to <code>tenant-engine</code> and NetKingdom canon. Folding it in here would overreach.</p>
</section>
<section id="s20"><h2><span class="sn">20</span>Ratification path</h2>
<ol><li>Reviewed by <code>tenant-engine</code>, <code>flex-auth</code>, <code>audit-core</code>, <code>rapp-postgres</code>, <code>railiance-platform</code> and <code>adaptive-pricing</code> against §19. <strong>Complete in draft-8.</strong></li><li>Each publishes its own posture vector (§5) as part of review. <strong>The framework is validated by whether it can describe them accurately</strong> — if a repo cannot express itself in these six ladders, the ladders are wrong and this document changes, not the repo. <strong>Complete in draft-8; all six root declarations validate against the canonical schema.</strong></li><li>On acceptance, <strong>supersedes</strong> the routing of <code>rapp-postgres/docs/canon-drafts/shared-platform-relational-storage_v0.1-draft.md</code>, whose §§38 are absorbed here. That draft is withdrawn rather than left pending.</li><li>On acceptance, <code>rapp-postgres</code> ADR-0001 through ADR-0004 move to <code>accepted</code> and are annotated as the PostgreSQL implementation of the E, P, R and shared-capacity rules.</li></ol>
</section><footer><span>netkingdom-tenancy-posture · draft-8 · proposed</span><span>net-kingdom · canon/standards/tenancy-posture_v0.1.md · cced59d3aa1dc0aa08fc128fc8c76699f59dcd90</span></footer></main></div></div></html>

View file

@ -0,0 +1,444 @@
<!doctype html>
<html lang="en"><meta charset="utf-8">
<meta name="policy-source-revision" content="cced59d3aa1dc0aa08fc128fc8c76699f59dcd90">
<meta name="policy-source-digest" content="99f802d91a0b3a65f0dac58230d8904f7c61cf3f81eff072fbbc59b634612a8a">
<title>NetKingdom Tenancy Posture v0.1</title>
<style>
:root{
--paper:#EDEEF0; --surface:#F6F7F8; --surface-2:#E4E6E9;
--ink:#171D24; --ink-2:#4A5561; --ink-3:#737E8A;
--rule:#D3D7DC; --rule-strong:#B6BCC3;
--brass:#8A6A2E; --brass-soft:#EFE5CD; --brass-line:#C9AE74;
--clay:#8A3A2C; --clay-soft:#F2DFDA;
--l0:#DCE0E2; --l1:#B9C4C7; --l2:#8CA1A6; --l3:#567D84; --l4:#23555E;
--chip-fg:#F6F7F8;
--font-display:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",sans-serif;
--font-body:"Iowan Old Style","Palatino Linotype",Palatino,Georgia,serif;
--font-mono:ui-monospace,"SF Mono","Cascadia Code",Menlo,Consolas,monospace;
--measure:66ch;
}
@media (prefers-color-scheme:dark){
:root:not([data-theme="light"]){
--paper:#12161A; --surface:#191E24; --surface-2:#222831;
--ink:#E6E9EC; --ink-2:#A3ADB7; --ink-3:#78838E;
--rule:#2A3138; --rule-strong:#3B444D;
--brass:#C9A45C; --brass-soft:#33290F; --brass-line:#6B5426;
--clay:#D08A76; --clay-soft:#3A211B;
--l0:#262C32; --l1:#35424A; --l2:#4A626B; --l3:#6A939D; --l4:#97C4CD;
--chip-fg:#12161A;
}
}
:root[data-theme="dark"]{
--paper:#12161A; --surface:#191E24; --surface-2:#222831;
--ink:#E6E9EC; --ink-2:#A3ADB7; --ink-3:#78838E;
--rule:#2A3138; --rule-strong:#3B444D;
--brass:#C9A45C; --brass-soft:#33290F; --brass-line:#6B5426;
--clay:#D08A76; --clay-soft:#3A211B;
--l0:#262C32; --l1:#35424A; --l2:#4A626B; --l3:#6A939D; --l4:#97C4CD;
--chip-fg:#12161A;
}
*{box-sizing:border-box}
body{
margin:0; background:var(--paper); color:var(--ink);
font-family:var(--font-body); font-size:17px; line-height:1.62;
-webkit-font-smoothing:antialiased;
}
.wrap{max-width:1180px;margin:0 auto;padding:0 24px 96px}
.layout{display:grid;grid-template-columns:180px minmax(0,1fr);gap:56px;align-items:start}
@media (max-width:960px){.layout{grid-template-columns:1fr;gap:0}.rail{display:none}}
/* ---------- rail ---------- */
.rail{position:sticky;top:28px;padding-top:8px;font-family:var(--font-display);font-size:12px;line-height:1.5}
.rail ol{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:7px}
.rail a{color:var(--ink-3);text-decoration:none;display:flex;gap:9px}
.rail a:hover,.rail a:focus-visible{color:var(--brass)}
.rail .n{font-family:var(--font-mono);font-size:10px;color:var(--rule-strong);min-width:16px;padding-top:1px}
.rail .grp{margin-top:14px;font-size:9.5px;letter-spacing:.14em;text-transform:uppercase;color:var(--rule-strong)}
/* ---------- header ---------- */
header{padding:64px 0 40px;border-bottom:2px solid var(--ink);margin-bottom:44px}
.eyebrow{font-family:var(--font-mono);font-size:11.5px;letter-spacing:.13em;text-transform:uppercase;color:var(--ink-3);display:flex;flex-wrap:wrap;gap:14px;margin-bottom:22px}
.eyebrow .stat{color:var(--clay)}
h1{font-family:var(--font-display);font-weight:800;letter-spacing:-.035em;line-height:.94;font-size:clamp(46px,9vw,92px);margin:0 0 6px;text-wrap:balance}
.sub{font-family:var(--font-display);font-weight:500;font-size:clamp(16px,2.4vw,21px);letter-spacing:-.01em;color:var(--ink-2);margin:0 0 30px;max-width:34ch;line-height:1.3}
.metagrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:20px 28px;border-top:1px solid var(--rule);padding-top:20px}
.metagrid dt{font-family:var(--font-mono);font-size:10px;letter-spacing:.13em;text-transform:uppercase;color:var(--ink-3);margin-bottom:5px}
.metagrid dd{margin:0;font-family:var(--font-display);font-size:13.5px;line-height:1.45;color:var(--ink)}
/* ---------- typography ---------- */
section{margin-bottom:60px;scroll-margin-top:24px}
h2{font-family:var(--font-display);font-weight:750;letter-spacing:-.022em;font-size:clamp(24px,3.4vw,31px);line-height:1.12;margin:0 0 18px;text-wrap:balance;display:flex;gap:14px;align-items:baseline}
h2 .sn{font-family:var(--font-mono);font-size:12px;font-weight:400;color:var(--brass);letter-spacing:.06em;flex:none;padding-top:2px}
h3{font-family:var(--font-display);font-weight:700;font-size:16px;letter-spacing:-.008em;margin:34px 0 10px;color:var(--ink)}
p{margin:0 0 15px;max-width:var(--measure)}
ul,ol{max-width:var(--measure);margin:0 0 15px;padding-left:20px}
li{margin-bottom:7px}
strong{font-weight:600}
em{font-style:italic}
code{font-family:var(--font-mono);font-size:.855em;background:var(--surface-2);padding:1px 5px;border-radius:2px}
a{color:var(--brass)}
.lede{font-size:19px;line-height:1.55;color:var(--ink-2);max-width:60ch}
/* ---------- devices ---------- */
.callout{border-left:3px solid var(--brass);background:var(--brass-soft);padding:18px 22px;margin:0 0 24px;max-width:var(--measure)}
.callout p:last-child{margin-bottom:0}
.callout .lbl{font-family:var(--font-mono);font-size:10px;letter-spacing:.13em;text-transform:uppercase;color:var(--brass);display:block;margin-bottom:8px}
.rule-quote{border-top:2px solid var(--ink);border-bottom:2px solid var(--ink);padding:26px 0;margin:28px 0;max-width:var(--measure)}
.rule-quote p{font-family:var(--font-display);font-weight:600;font-size:19px;line-height:1.38;letter-spacing:-.014em;margin:0;text-wrap:balance}
.hard{border-left:3px solid var(--clay);background:var(--clay-soft);padding:18px 22px;margin:0 0 24px;max-width:var(--measure)}
.hard .lbl{font-family:var(--font-mono);font-size:10px;letter-spacing:.13em;text-transform:uppercase;color:var(--clay);display:block;margin-bottom:8px}
.hard p:last-child{margin-bottom:0}
.dec{font-family:var(--font-mono);font-size:10.5px;letter-spacing:.08em;color:var(--brass);text-transform:uppercase}
.vec{font-family:var(--font-mono);font-size:.9em;font-weight:600;background:var(--surface-2);padding:2px 7px;border-radius:2px;white-space:nowrap;letter-spacing:.04em}
/* ---------- tables ---------- */
.scroll{overflow-x:auto;margin:0 0 24px;-webkit-overflow-scrolling:touch}
table{border-collapse:collapse;width:100%;min-width:520px;font-family:var(--font-display);font-size:13.5px;line-height:1.45}
th{text-align:left;font-family:var(--font-mono);font-size:9.5px;letter-spacing:.13em;text-transform:uppercase;color:var(--ink-3);font-weight:400;padding:0 16px 8px 0;border-bottom:1px solid var(--rule-strong);vertical-align:bottom}
td{padding:11px 16px 11px 0;border-bottom:1px solid var(--rule);vertical-align:top;color:var(--ink-2)}
td:first-child{color:var(--ink);font-weight:600}
tbody tr:last-child td{border-bottom:none}
.lvl{font-family:var(--font-mono);font-weight:600;font-size:12px;letter-spacing:.04em;color:var(--ink)}
/* ---------- ladders ---------- */
.breakout{margin:34px 0 40px}
.bhead{display:flex;justify-content:space-between;align-items:baseline;gap:20px;border-bottom:1px solid var(--rule-strong);padding-bottom:9px;margin-bottom:22px;flex-wrap:wrap}
.bhead h3{margin:0;font-size:13px;letter-spacing:.1em;text-transform:uppercase;font-family:var(--font-mono);font-weight:400;color:var(--ink-3)}
.bhead .note{font-family:var(--font-display);font-size:12.5px;color:var(--ink-3)}
.ladders{display:grid;gap:26px}
.ladder{display:grid;grid-template-columns:126px minmax(0,1fr);gap:18px;align-items:start}
@media (max-width:700px){.ladder{grid-template-columns:1fr;gap:10px}}
.ladder .pname{font-family:var(--font-display);font-weight:700;font-size:14px;letter-spacing:-.01em;padding-top:2px}
.ladder .pname span{display:block;font-family:var(--font-mono);font-size:10px;font-weight:400;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-3);margin-top:3px}
.rungs{display:grid;gap:3px;grid-template-columns:repeat(5,minmax(0,1fr))}
@media (max-width:700px){.rungs{grid-template-columns:repeat(2,minmax(0,1fr))}}
.rung{padding:9px 10px 11px;background:var(--surface);border-top:4px solid var(--l0);min-width:0}
.rung.r1{border-top-color:var(--l1)} .rung.r2{border-top-color:var(--l2)}
.rung.r3{border-top-color:var(--l3)} .rung.r4{border-top-color:var(--l4)}
.rung .code{font-family:var(--font-mono);font-size:11px;font-weight:600;letter-spacing:.06em;color:var(--ink);display:block;margin-bottom:4px}
.rung .txt{font-family:var(--font-display);font-size:11.5px;line-height:1.34;color:var(--ink-2);display:block}
.rung.na{opacity:.42}
/* ---------- matrix ---------- */
.matrix-shell{display:grid;grid-template-columns:auto minmax(0,1fr);gap:12px;align-items:stretch;margin-bottom:14px}
.ylab{writing-mode:vertical-rl;transform:rotate(180deg);font-family:var(--font-mono);font-size:9.5px;letter-spacing:.14em;text-transform:uppercase;color:var(--ink-3);text-align:center;padding-bottom:22px}
.mgrid{display:grid;grid-template-columns:34px repeat(5,minmax(0,1fr));gap:3px}
.mcell{background:var(--surface);min-height:60px;padding:6px;display:flex;flex-direction:column;justify-content:flex-end;gap:4px;min-width:0}
.mcell.tint1{background:color-mix(in srgb,var(--l1) 26%,var(--surface))}
.mcell.tint2{background:color-mix(in srgb,var(--l2) 26%,var(--surface))}
.mcell.tint3{background:color-mix(in srgb,var(--l3) 24%,var(--surface))}
.mcell.tint4{background:color-mix(in srgb,var(--l4) 22%,var(--surface))}
.mcell.void{background:repeating-linear-gradient(135deg,transparent,transparent 5px,var(--rule) 5px,var(--rule) 6px);opacity:.55}
.rlab,.clab{font-family:var(--font-mono);font-size:10px;font-weight:600;letter-spacing:.05em;color:var(--ink-3);display:flex;align-items:center;justify-content:center}
.rlab{min-height:60px}
.clab{padding-top:7px;min-height:22px}
.pin{font-family:var(--font-mono);font-size:9.5px;font-weight:600;letter-spacing:.02em;background:var(--ink);color:var(--paper);padding:2px 5px;border-radius:2px;line-height:1.3;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pin.ghost{background:transparent;color:var(--ink-2);border:1px dashed var(--rule-strong)}
.mnote{display:flex;gap:22px;flex-wrap:wrap;font-family:var(--font-display);font-size:12px;color:var(--ink-3);padding-top:6px}
.mnote .k{display:flex;align-items:center;gap:7px}
.sw{width:13px;height:13px;flex:none;background:var(--ink)}
.sw.g{background:transparent;border:1px dashed var(--rule-strong)}
.sw.v{background:repeating-linear-gradient(135deg,transparent,transparent 4px,var(--rule) 4px,var(--rule) 5px);border:1px solid var(--rule)}
@media (max-width:640px){
.mgrid{grid-template-columns:28px repeat(5,minmax(0,1fr))}
.mcell{min-height:52px;padding:4px}
.pin{font-size:8px;padding:1px 3px}
.rlab{min-height:52px}
}
/* ---------- methodology ---------- */
.verbs{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:2px;background:var(--rule);border:1px solid var(--rule)}
.verb{background:var(--surface);padding:18px 18px 20px}
.verb h4{font-family:var(--font-display);font-weight:750;font-size:15px;margin:0 0 7px;letter-spacing:-.01em}
.verb p{font-family:var(--font-display);font-size:12.5px;line-height:1.46;color:var(--ink-2);margin:0;max-width:none}
.verb .step{font-family:var(--font-mono);font-size:9.5px;letter-spacing:.13em;color:var(--brass);display:block;margin-bottom:9px}
/* ---------- questions ---------- */
.qs{display:flex;flex-direction:column;gap:0;border-top:1px solid var(--rule-strong)}
.q{display:grid;grid-template-columns:34px minmax(0,1fr) 170px;gap:18px;padding:16px 0;border-bottom:1px solid var(--rule);align-items:start}
@media (max-width:760px){.q{grid-template-columns:28px minmax(0,1fr);gap:12px}.q .owner{grid-column:2}}
.q .qn{font-family:var(--font-mono);font-size:11px;color:var(--brass);padding-top:3px}
.q .qt{font-family:var(--font-display);font-size:14px;line-height:1.48;color:var(--ink-2)}
.q .qt b{color:var(--ink);font-weight:700;display:block;margin-bottom:2px;font-size:14.5px}
.owner{font-family:var(--font-mono);font-size:10px;letter-spacing:.05em;color:var(--ink-3);padding-top:4px}
.owner .tag{display:inline-block;border:1px solid var(--rule-strong);padding:2px 7px;border-radius:2px}
.owner .tag.need{border-color:var(--clay);color:var(--clay)}
/* ---------- misc ---------- */
.numbers{font-family:var(--font-mono);font-size:12.5px;line-height:1.85;background:var(--surface);border-left:3px solid var(--l3);padding:16px 20px;margin:0 0 22px;overflow-x:auto;max-width:var(--measure)}
.numbers .v{color:var(--ink);font-weight:600}
.numbers .k{color:var(--ink-3)}
pre{font-family:var(--font-mono);font-size:12.5px;line-height:1.68;background:var(--surface);border-left:3px solid var(--rule-strong);padding:16px 20px;overflow-x:auto;margin:0 0 22px;max-width:var(--measure);color:var(--ink-2)}
.alt{border-bottom:1px solid var(--rule);padding:14px 0;max-width:var(--measure)}
.alt:last-of-type{border-bottom:none}
.alt b{font-family:var(--font-display);font-size:14px;display:block;margin-bottom:3px}
.alt p{font-size:14.5px;margin:0;color:var(--ink-2)}
.alt .verdict{font-family:var(--font-mono);font-size:10px;letter-spacing:.1em;text-transform:uppercase;color:var(--clay)}
footer{border-top:2px solid var(--ink);margin-top:20px;padding-top:22px;font-family:var(--font-mono);font-size:11px;letter-spacing:.06em;color:var(--ink-3);display:flex;justify-content:space-between;gap:20px;flex-wrap:wrap}
.tm td,.tm th{text-align:center}
.tm td:first-child,.tm th:first-child{text-align:left}
.yes{color:var(--l4);font-weight:700}
.no{color:var(--clay);font-weight:700}
.kind{font-family:var(--font-mono);font-size:9px;letter-spacing:.09em;text-transform:uppercase;padding:2px 6px;border-radius:2px;white-space:nowrap;border:1px solid var(--rule-strong);color:var(--ink-3)}
.kind.adv{border-color:var(--clay);color:var(--clay)}
.routes{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:2px;background:var(--rule);border:1px solid var(--rule);margin:0 0 22px}
.route{background:var(--surface);padding:16px 18px}
.route h4{font-family:var(--font-display);font-weight:750;font-size:14px;margin:0 0 6px}
.route p{font-family:var(--font-display);font-size:12.5px;line-height:1.45;color:var(--ink-2);margin:0;max-width:none}
.route .tag{font-family:var(--font-mono);font-size:9px;letter-spacing:.1em;text-transform:uppercase;color:var(--brass);display:block;margin-bottom:8px}
a:focus-visible,.rail a:focus-visible{outline:2px solid var(--brass);outline-offset:3px}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
</style>
<div class="wrap"><header><div class="eyebrow"><span>netkingdom-tenancy-posture</span> <span class="stat">proposed · draft-8</span> <span>net-kingdom</span> <span>reviewed 2026-08-17</span><span>generated from canonical source — do not edit</span></div><h1>NetKingdom Tenancy Posture v0.1</h1><p class="sub">A framework for describing, holding and improving multi-tenancy — including where we are not there yet.</p><p class="sub">Source: <code>net-kingdom · canon/standards/tenancy-posture_v0.1.md · cced59d3aa1dc0aa08fc128fc8c76699f59dcd90</code></p><p class="sub">Review due: 2027-02-17</p></header><div class="layout"><nav class="rail" aria-label="Sections"><ol><li><a href="#status"><span class="n">·</span>Status</a></li><li><a href="#s0"><span class="n">0</span>Terminology: axes, not planes</a></li><li><a href="#s1"><span class="n">1</span>Context</a></li><li><a href="#s2"><span class="n">2</span>What this document is</a></li><li><a href="#s3"><span class="n">3</span>Six orthogonal axes</a></li><li><a href="#s4"><span class="n">4</span>Graduated levels</a></li><li><a href="#s5"><span class="n">5</span>The posture vector</a></li><li><a href="#s6"><span class="n">6</span>Conformance is accuracy, not altitude</a></li><li><a href="#s7"><span class="n">7</span>Portability across placement levels</a></li><li><a href="#s8"><span class="n">8</span>Placement triggers</a></li><li><a href="#s9"><span class="n">9</span>Credentials as a tenancy control</a></li><li><a href="#s10"><span class="n">10</span>Blast radius must be published</a></li><li><a href="#s11"><span class="n">11</span>Commercial expression</a></li><li><a href="#s12"><span class="n">12</span>Methodology — analyze, establish, improve, guard</a></li><li><a href="#s13"><span class="n">13</span>Evidence per level</a></li><li><a href="#s14"><span class="n">14</span>Adoption stance — structure, not tooling</a></li><li><a href="#s15"><span class="n">15</span>Alternatives considered</a></li><li><a href="#s16"><span class="n">16</span>Held against outside practice</a></li><li><a href="#s17"><span class="n">17</span>Scaling demands</a></li><li><a href="#s18"><span class="n">18</span>Consequences</a></li><li><a href="#s19"><span class="n">19</span>Review resolutions and residual questions</a></li><li><a href="#s20"><span class="n">20</span>Ratification path</a></li></ol></nav><main><section id="status"><h2>Status</h2>
<p><strong>Proposed, draft-8; ratification-ready.</strong> Relocated from <code>the-custodian/canon/architecture</code> on 2026-08-17: multi-tenancy is part of the IT-security framework NetKingdom provides, so this framework belongs in NetKingdom canon beside the IAM Profile and the tenant-engine boundary contract, not in the work-factory canon.</p>
<ul><li><strong>draft-1</strong> proposed a single model with fixed characteristics. Rejected: it could not describe a repo that is not there yet.</li><li><strong>draft-2</strong> reframed to graduated levels per axis. Externally corroborated (§16), but four of its statements were wrong and one thing it needed was missing.</li><li><strong>draft-3</strong> applied those corrections, added the retention axis, and recorded an adoption stance.</li><li><strong>draft-4</strong> closed the two gaps draft-3 left open: <code>R4</code> had no mechanism beyond waiting, and the noisy-neighbour evidence artifact asserted something shared infrastructure cannot provide.</li><li><strong>draft-5</strong> relocated to NetKingdom and renamed the dimensions from <em>planes</em> to <em>axes</em>, because the word was already taken (§0).</li><li><strong>draft-6</strong> applied <code>tenant-engine</code>'s review: five changes, including an axis that did not fit its data shape.</li><li><strong>draft-7</strong> applies <code>audit-core</code>, <code>railiance-platform</code> and <code>flex-auth</code>. Eleven further changes, two of them corrections to statements this document made as fact about other repos. <strong>Every posture I guessed was too generous, on every repo that has now self-reported.</strong></li><li><strong>draft-8</strong> applies <code>adaptive-pricing</code>'s review, the last of the six, and the consistency review across all declarations. It adds the missing availability axis, a canonical declaration schema, explicit authority for tier assurance, retention/placement coupling, downgrade propagation, and honest sanctioned customer language. It also corrects the distinction between an implemented control and an evidenced current level.</li></ul>
<p><strong>Reviewed by all six. The score:</strong> six repos found three live defects in their own code by reading the ladders — <code>tenant-engine</code>'s unfiltered event accessor, <code>audit-core</code>'s unfiltered read path, <code>flex-auth</code>'s unauthenticated <code>/v1/check</code> — and <code>railiance-platform</code> found <code>apps-pg</code> running with no backup configured at all while writing its §10.2 disclosure. The framework changed to fit the repos; no repo was told to fabricate a posture.</p>
<p>Informed by five external research digests plus their index in <code>the-custodian/research/2026-08-17-adr008-*</code>, which carry full citations for the external claims made here.</p>
</section>
<section id="s0"><h2><span class="sn">00</span>Terminology: axes, not planes</h2>
<p><code>docs/platform-identity-security-architecture.md</code> — accepted, 2026-07-23 — already uses <strong>plane</strong> for a trust and deployment layer: the <em>bootstrap plane</em>, the <em>platform control plane</em>, and <em>tenant planes</em>. That meaning is established, ratified, and owned by this repo.</p>
<p>Drafts 14 of this document, written elsewhere, used <strong>plane</strong> for something different: an independent dimension of concern. Two incompatible senses of one word inside one canon is exactly the concept-ownership collision the estate has been careful about elsewhere, and the newcomer yields.</p>
<p>This framework therefore describes six <strong>axes</strong>. They are orthogonal to NetKingdom's planes, not a subdivision of them:</p>
<ul><li>A <strong>plane</strong> is <em>where</em> something runs and what trust it carries — bootstrap, platform control, tenant.</li><li>An <strong>axis</strong> is <em>which property</em> of tenancy is being described — identity, authorization, enforcement, placement, retention, availability.</li></ul>
<p>A workload in the tenant plane has a position on all six axes. A platform control plane service does too. The two vocabularies compose and neither replaces the other.</p>
<p>The rename is also an improvement. A posture vector is literally a point in six-dimensional space, and "axis" says that where "plane" did not.</p>
</section>
<section id="s1"><h2><span class="sn">01</span>Context</h2>
<p>Drafts 14 opened by claiming the estate "has never written down what it is building". Relocation proved that wrong, and the correction is worth keeping visible: <code>docs/platform-identity-security-architecture.md</code> has described the trust model, the tenant model and a capability progression since 2026-07-23. The accurate claim is narrower — <strong>what was missing is a way to say how far a given service has got, and to hold several answers at once.</strong> Seven documents cover slices of the subject and none of them does that:</p>
<div class="scroll"><table><thead><tr><th>Document</th><th>Covers</th><th>Status</th></tr></thead><tbody><tr><td><code>iam-profile_v0.3</code> (NetKingdom)</td><td>Tenant identifier shape, <code>tenant_roles</code> claim, staleness rules</td><td>Ratified</td></tr><tr><td><code>tenant-engine-boundary-contract_v0.1</code> (NetKingdom)</td><td>Who owns tenant records, roles, plan assignment</td><td>Ratified</td></tr><tr><td><code>business-app-service-contract_v0.1</code> §1 (Custodian)</td><td>Business apps: instance-per-client, tenant-keyed data</td><td>Ratified</td></tr><tr><td><code>rapp-postgres</code> ADR-0001</td><td>Consumer + tenant isolation in PostgreSQL</td><td>Proposed, governs one repo</td></tr><tr><td><code>rapp-postgres</code> ADR-0002</td><td>Per-consumer retention and the erasure horizon</td><td>Proposed, governs one repo</td></tr><tr><td><code>shared-platform-relational-storage_v0.1</code></td><td>The stacked-boundary gap</td><td>Routed 2026-08-10, <strong>still unratified</strong></td></tr><tr><td><code>platform-identity-security-architecture</code> (NetKingdom)</td><td>Trust model, planes, tenant model, capability progression</td><td>Accepted 2026-07-23</td></tr></tbody></table></div>
<p>This document is downstream of that architecture and must not restate it. It answers one question the architecture leaves open: given the model, <strong>where is this particular service today, and how would anyone know?</strong></p>
<p>Four failures existed when drafting began.</p>
<p><strong>The gap was diagnosed once and the fix stalled.</strong> The v0.1 draft was written to fill this hole and has sat unratified in neither canon directory. §20 attaches a ratification path so this one does not join it.</p>
<p><strong>Placement was owned by nobody.</strong> <code>user-engine-pg</code> and <code>target-revenue-pg</code> are dedicated; <code>apps-pg</code>, <code>net-kingdom-pg</code>, <code>platform-pg</code>, <code>state-hub-db</code> and <code>forgejo-db</code> are shared. Both live, neither written down. <code>tenant-engine</code> raised this with <code>railiance-platform</code> on 2026-08-16. Draft-8 resolves the authority split in §8.2.</p>
<p><strong>Two contradictory defaults were already ratified.</strong> Business apps get instance-per-client; platform services pool. Nothing says which shape a new service takes, and no definition separates the categories. Decision 4.4.1 now supplies the default; §19.4 retains the missing classification rule.</p>
<p><strong>There is no honest way to describe a repo that is not there yet.</strong> The estate absorbs repos with weak or absent tenant separation. Today such a repo is simply non-conformant, leaving it two bad options: misrepresent its posture, or stay outside the framework.</p>
</section>
<section id="s2"><h2><span class="sn">02</span>What this document is</h2>
<p><strong>A framework, not a model.</strong> It specifies no single correct implementation. It supplies terminology (§3, §4), a declaration (§5), a conformance rule (§6), methodology (§12), and evidence definitions (§13).</p>
<p>A service is conformant when its declared posture is accurate and its trajectory recorded. A service is non-conformant when it claims a level it cannot evidence — regardless of how high or low that level is.</p>
</section>
<section id="s3"><h2><span class="sn">03</span>Six orthogonal axes</h2>
<p>"Is this multi-tenant?" is treated as one question. It is six, and they are independent:</p>
<div class="scroll"><table><thead><tr><th>Axis</th><th>Question</th><th>Vocabulary owner</th></tr></thead><tbody><tr><td><strong>Identity (I)</strong></td><td>How is a tenant named and validated?</td><td><code>tenant-engine</code> / IAM Profile</td></tr><tr><td><strong>Authorization (A)</strong></td><td>How is a request bound to the tenants it may act for?</td><td><code>flex-auth</code></td></tr><tr><td><strong>Enforcement (E)</strong></td><td>Where, mechanically, is the tenant boundary enforced?</td><td>This framework</td></tr><tr><td><strong>Placement (P)</strong></td><td>Which substrate holds a tenant's data?</td><td><code>railiance-platform</code></td></tr><tr><td><strong>Retention (R)</strong></td><td>How long does data persist, and how is it erased?</td><td>The storage platform; policy by the consumer</td></tr><tr><td><strong>Availability (V)</strong></td><td>What failure can the complete service path survive, and within what recovery objective?</td><td>The delivering service; substrate facts by its providers</td></tr></tbody></table></div>
<p>Conflation produces errors today. <code>rapp-postgres</code>'s <code>PostgresConsumer</code> carries <code>tenantIsolation: consumer-service-boundary</code> — an <strong>E</strong>-axis fact in a <strong>P</strong>-axis artifact, reading as though storage enforces something it does not. The "dedicated versus shared" argument mixes P (capacity, blast radius) with E (correctness).</p>
<p>The axes are separated <em>precisely so each may sit at a different level</em>.</p>
<p><span class="dec">Decision 3.1:</span> every document, declaration and plan tier that says "isolation" MUST name which axis it means.</p>
<p><span class="dec">Decision 3.2:</span> the axes couple at their tops and the couplings MUST be stated where they apply, not used to argue the axes are one:</p>
<ul><li><code>E4</code> is reachable only at <code>P3</code> or above.</li><li><code>R</code>'s erasure horizon is bounded below by <code>P</code> — on shared substrate, a consumer's horizon is the instance maximum (§4.5).</li><li><code>R4</code> by key destruction is bounded by the <strong>key boundary</strong>, which is an E-axis property. Shredding a single tenant's data requires the application to encrypt under a per-tenant key before writing; the storage platform cannot supply it. <strong>Reaching the top of the retention ladder is not a retention project.</strong></li><li><code>V</code> composes as the <strong>minimum across the critical request path</strong>, not the maximum of its components. A replicated application on a single-instance database is not V2. A tested degraded mode may remove a dependency from that path, but the bypass itself is part of the V evidence.</li></ul>
<p><span class="dec">Decision 3.3 — scope.</span> The P and R ladders describe a service's <strong>primary datastore</strong>. The V ladder describes the service's complete critical request path, including providers it synchronously depends on. Caches, search indices, message queues and background jobs are named leak surfaces in the external baselines and are assessed separately, not silently covered by a datastore level. A declaration names material secondary stores and asynchronous paths as exceptions rather than implying that one vector proves them safe.</p>
</section>
<section id="s4"><h2><span class="sn">04</span>Graduated levels</h2>
<p>Each axis carries an ordered ladder. Higher is stronger, not better: the right level is the one a service can evidence and its risk warrants.</p>
<h3>4.1 Identity (I)</h3>
<div class="breakout"><div class="ladders">
<div class="ladder"><div class="pname">Identity<span>axis I</span></div><div class="rungs"><div class="rung r0"><span class="code">I0</span><span class="txt">No tenant concept. Data not attributable to a tenant.</span></div><div class="rung r1"><span class="code">I1</span><span class="txt">A local tenant notion exists but is not canonical, <strong>or</strong> the tenant is taken from the request rather than from a verified token.</span></div><div class="rung r2"><span class="code">I2</span><span class="txt">Canonical identifiers, bound at the identity provider and carried as a verified claim, <strong>and verified by this service on its own inbound calls</strong>.</span></div><div class="rung r3"><span class="code">I3</span><span class="txt">I2 plus capability roles honoured, with live <code>tenant-engine</code> re-query for privileged, destructive, credential-vending or <code>aal2</code>-class decisions.</span></div><div class="rung na"><span class="code"></span><span class="txt">Ladder ends at I3.</span></div></div></div>
</div></div>
<p>I1 now explicitly absorbs request-supplied tenant identifiers. "Never trust client-supplied tenant IDs without validation" is a named anti-pattern; a service reading the tenant from a header is at I1 however canonical the string.</p>
<p><strong>An axis is assessed on a service's own inbound surface, never on its authority over the concept.</strong> <code>tenant-engine</code> is the source of existence for tenant records and is nonetheless at I1, because it takes the acting identity from the request body rather than from a verified token. Draft-5 conflated these by naming the authority inside the I2 definition, which made the level describing canonical identity unclaimable by the service that provides it. Corrected on tenant-engine's review — a reader would otherwise assume the authority must be at I2 by definition.</p>
<p><code>business-app-service-contract</code> §2.1 sets app-local accounts as the v1 baseline for business apps — a sanctioned low level with recorded triggers for moving up. That is the pattern this framework generalises.</p>
<h3>4.2 Authorization (A)</h3>
<div class="breakout"><div class="ladders">
<div class="ladder"><div class="pname">Authorization<span>axis A</span></div><div class="rungs"><div class="rung r0"><span class="code">A0</span><span class="txt">No authorization, or tenant context not carried.</span></div><div class="rung r1"><span class="code">A1</span><span class="txt">Ad-hoc checks scattered through handlers.</span></div><div class="rung r2"><span class="code">A2</span><span class="txt">A single local authorization boundary; tenant context bound once, centrally.</span></div><div class="rung r3"><span class="code">A3</span><span class="txt">Decisions delegated to <code>flex-auth</code> as PDP, with live re-query where the IAM Profile requires it.</span></div><div class="rung r4"><span class="code">A4</span><span class="txt">A3 over a <strong>standard</strong> PDP interface (OpenID AuthZEN Authorization API 1.0), so the decision point is swappable and the enforcement point is not coupled to one engine's request shape.</span></div></div></div>
</div></div>
<p><strong>This ladder describes enforcement points.</strong> A decision point cannot occupy A3 — "delegated to <code>flex-auth</code>" is not something <code>flex-auth</code> can do. A service that <em>is</em> a PDP declares <strong>two numbers</strong>: its own inbound level, and the maximum it enables for consumers. <code>flex-auth</code> reads <code>A0, enables A3</code> — accurate, and considerably more alarming than <code>A3</code>, which is the point. Raised by <code>flex-auth</code>, whose absence from the §5 worked examples was this surfacing implicitly.</p>
<p>A4 is new. The specification reached Final in January 2026 and Keycloak shipped experimental support in May; the argument for it is <strong>interoperability</strong> — a swappable decision point and an enforcement point not coupled to one engine's request shape.</p>
<p><em>Correction from flex-auth's review:</em> earlier drafts also justified A4 as ending the copying of action strings between repos. <strong>It does not.</strong> AuthZEN standardises the envelope — subject, action, resource, context, endpoint — and deliberately does not standardise the action vocabulary or the policy language. At A4, <code>tenant.guardrail.set</code> still has to be agreed and still gets copied. Those are two problems with different fixes, and the cheaper one is not A4: <code>flex-auth</code>'s registry already carries action definitions per system and could serve them read-only. The vocabulary argument is withdrawn.</p>
<p><strong>Internal service-to-service calls are in scope for this axis.</strong> "Skipping tenant validation for internal services" is a named anti-pattern and our estate is mostly internal calls.</p>
<p><em>Correction from flex-auth's review:</em> earlier drafts asserted that <code>flex-auth</code> calls <code>tenant-engine</code> synchronously on the authorization path. <strong>That is not true.</strong> The adapter is built and complete and has no non-test caller, so the IAM Profile's live re-query exists and is unwired — which is also why <code>flex-auth</code> cannot reach I3. Built-and-unwired is the worst of the three states because it reads as capability.</p>
<p>The requirement, narrowed on their proposal because the original was too strong to be met and would have made <code>tenant-engine</code> a hard availability dependency of every decision in the estate:</p>
<div class="rule-quote"><p>Tenant context MUST be carried on every internal hop and MUST NOT be re-derived from a service identity. It MUST be revalidated against <code>tenant-engine</code> at least once per request chain — at the service that holds or mutates the tenant's data, or before a privileged, destructive, credential-vending or <code>aal2</code>-class decision, whichever comes first. A hop that neither holds tenant data nor makes such a decision may carry the context without revalidating it.</p></div>
<p><strong>And carrying tenant context is worthless without an authenticated hop to carry it over.</strong> <code>flex-auth</code> found this in itself: it carries tenant context faithfully and cannot distinguish "user-engine asking on behalf of tenant X" from "any pod asking on behalf of tenant X".</p>
<h3>4.3 Enforcement (E)</h3>
<div class="breakout"><div class="ladders">
<div class="ladder"><div class="pname">Enforcement<span>axis E</span></div><div class="rungs"><div class="rung r0"><span class="code">E0</span><span class="txt">None. Data not tenant-keyed; separation incidental or absent.</span></div><div class="rung r1"><span class="code">E1</span><span class="txt">Data tenant-keyed, filtering applied per query at call sites.</span></div><div class="rung r2"><span class="code">E2</span><span class="txt">Filtering centralised at a single service-side choke point binding authenticated identity to permitted tenants.</span></div><div class="rung r3"><span class="code">E3</span><span class="txt">E2 <strong>plus</strong> platform-assisted filtering: row-level security keyed on a tenant GUC set transaction-locally, or an equivalent enforced data-access layer.</span></div><div class="rung r4"><span class="code">E4</span><span class="txt">Structural: the credential a workload holds cannot address another tenant's data at all. Requires per-tenant credentials and per-tenant substrate.</span></div></div></div>
</div></div>
<p><strong>Correction from draft-2.</strong> Draft-2 described E3 as something "the application cannot trivially route around". That is false and it was this document overclaiming in exactly the way §6 prohibits. Any session can re-issue <code>SET</code> on a custom GUC, so an attacker with SQL execution can reset the tenant and read across the boundary. What E3 buys is precise, and the ladder must say so:</p>
<div class="scroll"><table class="tm"><thead><tr><th>Threat</th><th>E1</th><th>E2</th><th>E3</th><th>E4</th></tr></thead><tbody><tr><td>A developer forgets a tenant predicate</td><td class="no"></td><td class="yes"></td><td class="yes"></td><td class="yes"></td></tr><tr><td>A new code path bypasses the choke point</td><td class="no"></td><td class="no"></td><td class="yes"></td><td class="yes"></td></tr><tr><td>SQL injection reaching the connection</td><td class="no"></td><td class="no"></td><td class="no"></td><td class="yes"></td></tr><tr><td>The application process is compromised</td><td class="no"></td><td class="no"></td><td class="no"></td><td class="yes"></td></tr></tbody></table></div>
<p>E3 is a strong control against <strong>accident</strong> — the common case, and the one that causes real breaches — and no control at all against <strong>compromise</strong>. Only E4 holds against both, because the credential itself cannot address another tenant's data.</p>
<p><strong>Correction: E3 layers on E2, it does not replace it.</strong> External practice treats application-layer and database-layer filtering as complementary. A service that dropped its choke point on reaching E3 would be <em>worse</em> off, since E3 fails open under injection. Claiming E3 therefore requires the E2 evidence artifact as well.</p>
<p><strong>Correction: the GUC is set transaction-locally.</strong> Draft-2 said "at pool checkout", which is session scope and the wrong instrument. Under a pooler in statement mode, <code>SET</code> leaks between clients and returns other tenants' rows — a failure that appears only under production concurrency and produces no error. Use <code>SET LOCAL</code> inside an explicit transaction.</p>
<p><strong>Platform enforcement is a platform obligation.</strong> Reaching E3 requires the storage platform to <em>offer</em> the mechanism: provisioned policies, a documented GUC contract, and a probe. Where a consumer wants E3 and the platform has not supplied it, the gap is the platform's. §19.6 asks <code>rapp-postgres</code> to define that contract, which must carry <code>FORCE ROW LEVEL SECURITY</code> on every tenant table (without it the table owner bypasses policies silently, and ADR-0001 already established that our migration role owns the tables it creates), no <code>BYPASSRLS</code> on leased roles, <code>SECURITY INVOKER</code> for ordinary logic, and an <code>EXPLAIN</code> comparison because RLS disables functional indexes built on non-leakproof functions.</p>
<p><strong>Not all data is tenant-keyed, and the ladder must not pretend otherwise.</strong> A registry whose rows <em>are</em> the tenants has no per-tenant predicate to scope a policy by; enforcing one would break the service's function rather than secure it. <code>tenant-engine</code>'s <code>tenants</code> table is the worked example — <code>key-cape</code> enumerates it at token issuance and <code>flex-auth</code> queries it live, both of which are cross-tenant reads by design.</p>
<p>A service with mixed data shapes declares <strong>E-level plus a registry exception</strong>: the level its tenant-keyed tables hold, and a named list of tables excluded because they are registries rather than tenant data. The exception is part of the claim and is reviewable; an unnamed exception is an overclaim. Without this, mixed-shape services either overclaim or stay at E2 permanently, and <code>tenant-engine</code> declined to claim E3 on precisely that reasoning.</p>
<p><strong>Default expectation</strong> for a new platform service: E2 at first serve, E3 recorded as target. Services whose cross-tenant exposure would be a reportable breach SHOULD target E3 or above.</p>
<h3>4.4 Placement (P)</h3>
<div class="breakout"><div class="ladders">
<div class="ladder"><div class="pname">Placement<span>axis P</span></div><div class="rungs"><div class="rung r0"><span class="code">P0</span><span class="txt">Shares a database with another consumer.</span></div><div class="rung r1"><span class="code">P1</span><span class="txt">Database per consumer, shared cluster.</span></div><div class="rung r2"><span class="code">P2</span><span class="txt">Dedicated cluster per consumer.</span></div><div class="rung r3"><span class="code">P3</span><span class="txt">Dedicated cluster per tenant.</span></div><div class="rung r4"><span class="code">P4</span><span class="txt">P3 plus separate region or jurisdiction.</span></div></div></div>
</div></div>
<p>Enforcement and placement are independent axes. Plotted together, with where each service actually sits — parenthesised entries are targets or defaults rather than current positions, and <code></code> marks a cell the coupling in §3.2 makes unreachable:</p>
<div class="matrix-shell"><div class="ylab">Enforcement →</div><div class="mgrid"><div class="rlab">E4</div><div class="mcell void"></div><div class="mcell void"></div><div class="mcell void"></div><div class="mcell tint4"><span class="pin ghost">business app</span></div><div class="mcell tint4"></div><div class="rlab">E3</div><div class="mcell tint3"></div><div class="mcell tint3"><span class="pin ghost">target</span></div><div class="mcell tint3"></div><div class="mcell tint3"></div><div class="mcell tint3"></div><div class="rlab">E2</div><div class="mcell tint2"><span class="pin ghost">tenant-engine</span></div><div class="mcell tint2"><span class="pin">audit-core</span></div><div class="mcell tint2"></div><div class="mcell tint2"></div><div class="mcell tint2"></div><div class="rlab">E1</div><div class="mcell tint1"><span class="pin ghost">absorbed repo</span></div><div class="mcell tint1"></div><div class="mcell tint1"></div><div class="mcell tint1"></div><div class="mcell tint1"></div><div class="rlab">E0</div><div class="mcell"></div><div class="mcell"></div><div class="mcell"></div><div class="mcell"></div><div class="mcell"></div><div class="rlab"></div><div class="clab">P0</div><div class="clab">P1</div><div class="clab">P2</div><div class="clab">P3</div><div class="clab">P4</div></div></div><div class="mnote"><span class="k"><span class="sw"></span>Where a service sits today</span><span class="k"><span class="sw g"></span>Target or default</span><span class="k"><span class="sw v"></span>Unreachable at this placement</span></div>
<p><strong>P0 → P1 → P2 is movement along the horizontal axis only.</strong> Those steps buy consumer isolation, capacity predictability, independent retention and a smaller operational blast radius. They do not raise the tenant boundary by one step. Only P3 makes E4 reachable. This is the most misusable fact in the framework and §11 governs how it may be described.</p>
<p><span class="dec">Decision 4.4.1:</span> P1 is the default for platform services; P3 for client-facing business apps, as already ratified. A service unsure which it is must resolve that first (§19.4).</p>
<p><span class="dec">Decision 4.4.2 — placement scopes to data substrate.</span> Identity-provider placement (realm-per-tenant versus Organizations) is the same silo/pool decision on a different substrate, is live in our estate, and is undecided. Realm-per-tenant carries a stated ceiling around 520 tenants, far below our target. Recorded here as a parallel question (§19.7), not folded into P.</p>
<h3>4.5 Retention and erasure (R)</h3>
<p>New in draft-3. Implemented abstractly by the storage platform for any dataset; policy is built on top of that interface by the consumer or its governance layer. Reference implementation: <code>rapp-postgres</code> ADR-0002.</p>
<div class="breakout"><div class="ladders">
<div class="ladder"><div class="pname">Retention<span>axis R</span></div><div class="rungs"><div class="rung r0"><span class="code">R0</span><span class="txt">No retention or deletion position. Data kept indefinitely by default; no deletion path exists.</span></div><div class="rung r1"><span class="code">R1</span><span class="txt">Platform default retention applies (N=30 days). The consumer has declared no requirement.</span></div><div class="rung r2"><span class="code">R2</span><span class="txt">Retention declared as N days per dataset; the <strong>erasure horizon</strong> is published, and the consumer makes no promise shorter than it.</span></div><div class="rung r3"><span class="code">R3</span><span class="txt">Policy-driven deletion: the consumer or its governance layer declares what is due, the platform sweeps whole datasets on that instruction and evidences each run.</span></div><div class="rung r4"><span class="code">R4</span><span class="txt">Verified erasure: data proven unrecoverable across live storage, backups and derived copies, by one of the two routes below.</span></div></div></div>
</div></div>
<p><strong>R4 has two routes and a service MUST name which one it uses.</strong></p>
<div class="scroll"><table><thead><tr><th>Route</th><th>Mechanism</th><th>Cost</th></tr></thead><tbody><tr><td><strong>Horizon-elapsed</strong></td><td>Wait out the published erasure horizon; the data ages out of every retained copy.</td><td>Available to everyone, proves little, and the wait is set by a co-resident's retention requirement rather than your own.</td></tr><tr><td><strong>Key-destroyed</strong></td><td>Encrypt per entity, then destroy the key. Retained copies survive but are unreadable.</td><td>Requires per-entity keys, strong encryption, and an auditable destruction record. Immediate.</td></tr></tbody></table></div>
<p><span class="dec">Decision 4.5.3 — key destruction is not sufficient on its own.</span> The key-destroyed route requires that <strong>no retained commitment reveals the erased content</strong>. Found by <code>audit-core</code>, and it is a general defect rather than a fact about them:</p>
<ul><li>A SHA-256 over a canonical record whose fields are low-entropy — event type, actor, tenant, subject, timestamp — is a <strong>confirmation oracle</strong>. Anyone holding the hash can guess the payload, hash the guess, and confirm a match. Destroying the key does not make the content unrecoverable while that hash survives.</li><li>Shreddability is <strong>not retrofittable</strong> onto an integrity chain that commits to cleartext. It has to be built as encrypt-then-hash at accept time, with the chain committing to ciphertext. Retrofitting means rewriting the chain — the exact thing a tamper-evident log exists to make detectable.</li></ul>
<p>So a service claiming R4 by key destruction must show that its retained commitments — hashes, chains, indexes, search keys — do not reveal what was erased. The remedies are an HMAC under a per-subject key that dies with the key, or a per-record salt destroyed alongside it. <strong><code>audit-core</code> cannot reach R4 under its current design and targets R2; a fleet R4 target must exempt it explicitly.</strong></p>
<p><strong>Regulatory standing of the key-destroyed route, stated carefully because overclaiming here is worse than anywhere else in this framework.</strong> Data protection authorities have accepted key destruction as erasure where physical deletion would be manifestly disproportionate, and the practice is recognised under conditions — strong encryption, irreversible destruction, and an auditable record of it. <strong>The EDPB has not formally endorsed it as Article 17 erasure.</strong> A service reaching R4 by key destruction is making a defensible claim, not a settled one, and must say so rather than reporting a clean "deleted".</p>
<p>Three further properties.</p>
<p><strong>The erasure horizon is the interval between deleting data and it ceasing to be recoverable from anything the platform holds.</strong> Deleting a row does not remove it from yesterday's backup. With an N-day window, deleted data remains recoverable for N days. That is the difference between "deleted" and "erased" and the estate had never written it down.</p>
<p><strong>On shared substrate, retention is not per-consumer.</strong> Physical backup is instance-wide — one WAL stream, one window — so the instance retention is <em>derived</em> as the maximum across co-resident consumers, and every consumer's horizon is that maximum. A consumer declaring 7 days beside one declaring 90 gets 90. This is the retention analogue of ADR-0001's blast-radius disclosure: state the coupling rather than imply an isolation that is not there.</p>
<p><strong>Retention is therefore a placement trigger.</strong> A consumer needing a horizon shorter than the instance floor cannot have one at P1. It moves to P2 for a reason with nothing to do with performance — which is exactly why it needs recording, since nobody looks for a retention argument when reviewing placement.</p>
<p><span class="dec">Decision 4.5.4 — a retention promise binds both R and P.</span> A tier making a retention claim records an R minimum and a maximum erasure horizon in days. It also requires P2 or above <strong>unless</strong> its provider contract guarantees that the shared-substrate horizon stays within that maximum and rejects or notifies before a co-resident change would extend it. A bare <code>R2</code> minimum is insufficient: at P1 another consumer can change the promise without changing the tier or its holder.</p>
<p>Deletion splits mechanism from policy. The platform deletes whole <strong>datasets</strong> on instruction and records an opaque policy reference it never interprets, so every deletion traces to what authorised it. Rows are not a dataset: row expiry is the consumer's own DML under its migration lease. Dropping a consumer's whole database is an operator-gated offboarding step, never a scheduled one.</p>
<h3>4.6 Availability (V)</h3>
<p>New in draft-8. <code>adaptive-pricing</code> found that §11 required availability claims to map to a minimum level while the framework supplied no availability vocabulary. Placement is not a substitute: a dedicated cluster can still be a single instance on a single node.</p>
<div class="breakout"><div class="ladders">
<div class="ladder"><div class="pname">Availability<span>axis V</span></div><div class="rungs"><div class="rung r0"><span class="code">V0</span><span class="txt">No availability or recovery position. Recovery is untested or depends on improvisation.</span></div><div class="rung r1"><span class="code">V1</span><span class="txt">Restart or recreate recovery in one failure domain is documented and exercised. Interruption is expected; this is recovery, not failover.</span></div><div class="rung r2"><span class="code">V2</span><span class="txt">Redundant instances provide automated service failover, with measured RTO/RPO; a shared failure domain or critical dependency may remain.</span></div><div class="rung r3"><span class="code">V3</span><span class="txt">The complete critical path survives loss of one declared failure domain, with measured RTO/RPO from an exercise.</span></div><div class="rung r4"><span class="code">V4</span><span class="txt">The complete critical path survives regional loss through tested multi-region failover, with measured RTO/RPO.</span></div></div></div>
</div></div>
<p><span class="dec">Decision 4.6.1 — V is end-to-end.</span> A service declares the minimum across the components and synchronous providers required to serve the operation. An application with three replicas over a V1 database is V1. A status page or replica count is not evidence of a higher level.</p>
<p><span class="dec">Decision 4.6.2 — availability claims name the operation.</span> A read-only degraded mode and a mutation path may have different V levels. Decision 5.2 applies: declare the paths and quote the minimum unless the customer-facing claim explicitly and unambiguously names the narrower operation.</p>
</section>
<section id="s5"><h2><span class="sn">05</span>The posture vector</h2>
<p>A service states one level per axis, plus a target, review dates, evidence and any exceptions. <code>current</code> is the highest <strong>evidenced</strong> level; a control present in code but still awaiting the evidence required by §13 goes in <code>implemented</code>, not in <code>current</code>:</p>
<pre>schema_version: &quot;0.1&quot;
framework: netkingdom-tenancy-posture
service: example-service
role: tenant-data-service
tenancy:
current: { I: 2, A: 3, E: 2, P: 1, R: 1, V: 1 }
implemented: { E: 3 }
target: { I: 2, A: 3, E: 3, P: 1, R: 2, V: 2 }
reviewed: &quot;2026-08-17&quot;
review_due: &quot;2027-02-17&quot;
service_class: interactive
gap:
E: &quot;RLS is implemented; the §13 E3 probe is still absent.&quot;
R: &quot;Retention declared; erasure horizon not yet published to consumers.&quot;
V: &quot;Automated failover is not implemented or exercised.&quot;
evidence:
A3: &quot;docs/evidence/authorization-denial.md&quot;
E2: &quot;docs/evidence/cross-tenant-review.md&quot;
P1: &quot;rapp-postgres/docs/evidence/isolation-2026-08-10.md&quot;</pre>
<p><strong>Placement exceptions.</strong> Draft-2 assigned one P level per service, which cannot express the vertically partitioned model — most tenants pooled, some dedicated — that §11's isolation tiers require. A tier requiring <code>P2</code> bought by three tenants would put the service at two levels at once, forcing an over- or under-claim. Placement is therefore declared as a default plus exceptions:</p>
<pre> placement_exceptions:
- tenants: [&quot;tenant:enterprise:*&quot;]
P: 3
reason: &quot;isolation tier; see adaptive-pricing tier definition&quot;</pre>
<p>A service with exceptions must be able to say which tenants are on which substrate. That mapping is a first-class artifact, not archaeology.</p>
<p><span class="dec">Decision 5.5 — a provider declares what it makes reachable, not where it sits.</span> The six ladders describe a <em>consumer</em> of infrastructure. They describe a <em>provider</em> of it badly, and <code>railiance-platform</code>'s review demonstrated how badly: <code>apps-pg</code> is <code>I0 A0 E0</code> because a database has no tenant concept, carries no tenant claim and applies no tenant predicate. Those zeros are <strong>structural, not weak</strong> — the cluster is exactly as strong as its consumers make it.</p>
<p>The sharp case is OpenBao at <code>E0</code>. Literally correct, and actively misleading: the mechanism in place is credential-scoped structural separation — <code>E4</code> machinery — pointed at a <em>consumer</em> boundary rather than a tenant one. A reader scanning a column of E values would rank it below a service doing per-query filtering in application code, inverting the real security position.</p>
<p>So a platform service additionally declares, per axis, <strong>the level available now, the maximum it can make reachable, and what a consumer must do to reach it</strong>. For <code>apps-pg</code>: E4 unreachable (shared credential per consumer, no per-tenant credential), E3 conditional on the GUC contract, R2 blocked on a backup target, V1 at most on the single-node rail. That is the sentence a consumer actually needs, and no arrangement of the consumer ladders produces it.</p>
<p>A provider's own <code>P</code> is <code>n/a</code>, not a number. <code>apps-pg</code> <em>provides</em> <code>P1</code>; it is not <em>at</em> <code>P1</code>, and writing <code>P: 1</code> there would later read as an isolation claim.</p>
<p>Worked examples after applying the evidence rule and minimum-across-paths rule consistently:</p>
<div class="scroll"><table><thead><tr><th>Service</th><th>Current</th><th>Notes</th></tr></thead><tbody><tr><td><code>tenant-engine</code></td><td><code>I1 A0 E1 P n/a R0 V0</code></td><td>Acting identity is caller-supplied; unauthorised read paths set the A minimum; E2-shaped child-table controls are not evidenced; SQLite is outside P; no erasure or availability evidence. This corrects draft-7, which quoted A2/E2 despite its own minimum/evidence rules.</td></tr><tr><td><code>audit-core</code></td><td><code>I1 A2 E1 P1 R2 V0</code></td><td>E2 is implemented on both paths but awaits the adversarial artifact, so current remains E1. Its 30-day retention and erasure horizon are now declared and published.</td></tr><tr><td><code>flex-auth</code></td><td><code>I1 A0 E1 P n/a R n/a V0</code></td><td>Enables A3 for consumers. <code>/v1/check</code> authenticates no caller; E2 is implemented but not evidenced.</td></tr><tr><td><code>platform-pg</code> (provider)</td><td><code>I0 A0 E0 P n/a R2 V1</code></td><td>Provides P1; backup/restore and single-node recovery are evidenced. Provides no tenant boundary by itself.</td></tr><tr><td><code>apps-pg</code> (provider)</td><td><code>I0 A0 E0 P n/a R0 V0</code></td><td>Zeros are structural, except R0/V0 are live gaps: no backup and no recovery evidence.</td></tr><tr><td><code>adaptive-pricing</code> observatory</td><td><code>I0 A0 E0 P n/a R n/a V0</code></td><td>Local, unauthenticated, single-user analysis surface; not a production service.</td></tr><tr><td>A newly absorbed repo</td><td><code>I1 A1 E1 P0 R0 V0</code></td><td>Conformant <strong>if declared</strong>, with a recorded path.</td></tr></tbody></table></div>
<p><span class="dec">Decision 5.1:</span> the posture vector is declared in the repo, not in the hub, consistent with local-files-are-source-of-truth.</p>
<p><span class="dec">Decision 5.2 — declare per path, quote the minimum.</span> A service whose mutations are authorized and whose reads are not is at the reads' level. The quoted number is the minimum across paths; the per-path detail is declared beside it.</p>
<p>Draft-6 required only the minimum, on <code>tenant-engine</code>'s review. <code>audit-core</code> then showed why that is insufficient on its own: a bare minimum destroys signal, because <code>E3</code>-write/<code>E1</code>-read declares identically to <code>E1</code>/<code>E1</code>. Bare per-path invites "our write path is E3", which is the sentence §6 exists to stop. Both, related explicitly, is the rule.</p>
<p>Two services found this shape in themselves within a day of each other — <code>tenant-engine</code> (writes authorized, three read routes not) and <code>audit-core</code> (write path tenant-filtered, read path not filtered at all). Most services enforce harder on write than read, so this is the common case, not the corner.</p>
<p><span class="dec">Decision 5.3 — <code>n/a</code> is a level, and it is conformant.</span> <code>P0</code> presupposes a shared database and <code>R0</code> presupposes retained data. A service holding nothing at rest — <code>flex-auth</code> runs with its registry and policy baked read-only into the image and no decision log persisted — is neither. A datastore outside a ladder's substrate vocabulary, such as <code>tenant-engine</code>'s current SQLite PVC, also uses <code>n/a</code> rather than inventing a level. Without an admissible <code>n/a</code>, a missing rung <strong>forces</strong> the fabrication §6 prohibits, which is precisely what draft-1 was rejected for. <code>n/a</code> is declared with a stated reason.</p>
<p><span class="dec">Decision 5.4 — the vector lives at <code>tenancy.yaml</code> in the repo root.</span> Draft-6 said "in the repo" and not where or in what shape, which left §12's guard needing per-repo archaeology. <code>flex-auth</code> adopted <code>tenancy.yaml</code> speculatively; adopted here as the convention. A repo representing one service uses the single-service form above. A layer repo uses the schema's <code>services</code> list in the same root file — one vector per service, never an average. The normative schema is <code>canon/schemas/tenancy-posture_v0.1.schema.json</code>; prose documents may explain a declaration but do not replace it. The schema carries <code>current</code>, <code>implemented</code>, <code>target</code>, <code>reviewed</code>, <code>review_due</code>, <code>gap</code>, <code>placement_exceptions</code>, <code>service_class</code> (§8.3), per-path detail (§5.2), and provider reachability (§5.5). From the <code>net-kingdom</code> repo, owners validate one or more declarations with <code>uv run tools/tenancy-posture/validate.py &lt;path&gt;...</code>; the validator applies the JSON Schema and the evidence, date, implemented/current and provider-range rules that JSON Schema alone cannot express.</p>
</section>
<section id="s6"><h2><span class="sn">06</span>Conformance is accuracy, not altitude</h2>
<div class="rule-quote"><p><strong>A service is conformant when its declared posture is accurate, its target is recorded, and it does not claim a level it cannot evidence. It is non-conformant when it overclaims — at any altitude.</strong></p></div>
<ul><li>Declaring <code>E0</code> is conformant. Concealing <code>E0</code> is not.</li><li>A repo may be absorbed at any posture. It may not be absorbed silently.</li><li>No service is blocked from the estate for being low on a ladder. Services MAY be blocked from <em>specific work</em> — serving a tenant grouping, holding a data class, carrying a plan tier — by requirements expressed as minimum levels.</li><li>Downgrading is permitted and must be declared. A regression found by guarding is a defect; a regression declared in advance is a decision.</li><li><strong>A low level may be permanent by design, and the declaration must be able to say so.</strong> <code>flex-auth</code> is <code>I1</code> and always will be: a decision point evaluates the claims it is handed, and verifying its own inputs would make it the identity provider its scope refuses to be. A <code>target</code> equal to <code>current</code> with a reason is a settled position, not a stalled trajectory, and §12's guard must not nag it as though it were one.</li></ul>
<p><span class="dec">Decision 6.1 — downgrades propagate.</span> Before a planned downgrade of a current level or a provider's available level, the declaring repo MUST resolve the tier definitions and consumers that reference it. A downgrade below a recorded minimum blocks the change until the claim is changed, the workload is moved, or the affected owner explicitly accepts the gap. An unplanned regression is an incident and triggers the same notifications. Updating <code>tenancy.yaml</code> without notifying dependants is declaration drift, not a completed downgrade.</p>
<p>Without the axis separation, "not rigorous about tenant separation" is one verdict a repo passes or fails. With it, the same repo is <code>I1 A1 E1 P0 R0 V0</code> with a path — a plan, not an indictment.</p>
</section>
<section id="s7"><h2><span class="sn">07</span>Portability across placement levels</h2>
<p>Movement between P levels must be operational, not a rebuild:</p>
<ul><li>Connect by injected credential only — no cluster, host, namespace or database name in source.</li><li>Own a whole database, never tables inside someone else's.</li><li>Idempotent schema creation.</li><li>No cross-database joins or co-location assumptions.</li></ul>
<p><span class="dec">Decision 7.1:</span> mandatory at P1 and above. At P3, SHOULD rather than MUST — a per-client instance that never moves is not misconformant for naming its own database.</p>
</section>
<section id="s8"><h2><span class="sn">08</span>Placement triggers</h2>
<p>Recorded at provisioning time: noisy neighbour on a latency-critical path; a compliance or residency requirement; a plan tier requiring a higher minimum; an erasure horizon that no longer fits (§4.5); connection or memory ceiling reached.</p>
<p><span class="dec">Decision 8.1:</span> triggers MUST be <em>monitored</em>, not merely recorded. A trigger in a YAML comment nobody re-reads is documentation, not control.</p>
<p><span class="dec">Decision 8.2 — split authority, machine-reconciled.</span> <code>railiance-platform</code> owns the placement rule; the package repo owns the substrate numbers and enforcement; the consuming repo owns its workload requirements; <code>adaptive-pricing</code> owns any tier minimum. <code>adaptive-pricing</code> declined a standing co-signature and the framework accepts the replacement: typed tier minima are joined to consumer and provider declarations at tier definition and whenever one changes. A machine-checkable constraint must not depend on somebody remembering to collect a signature.</p>
<p><span class="dec">Decision 8.2.1 — trigger monitoring has an owner.</span> The provider monitors capacity ceilings and co-residency; the consumer monitors latency, compliance and erasure requirements; <code>adaptive-pricing</code> monitors tier-definition changes. The placement owner reconciles those signals. A trigger marked <code>unmonitored</code> is an explicit gap and cannot support a customer assurance claim.</p>
<h3>8.3 Service class — a placement input, never a priority</h3>
<p>A latency-critical consumer and a batch consumer can share an instance today with nothing distinguishing them. <code>tenant-engine</code> sits on <code>flex-auth</code>'s synchronous authorization path and chose a 5s statement timeout for that reason; <code>audit-core</code>, co-resident, is not latency-critical. Nothing prioritises between them.</p>
<p><strong>The framework does not add a QoS axis, because the platform cannot enforce one.</strong> Community PostgreSQL has no resource governor: no per-role CPU or I/O priority, no resource queues, no workload classes. Those exist in EDB's enterprise variant, in Greenplum, and in SQL Server — not in what we run. A declared priority level would therefore be an unenforced claim sitting in a declaration, which is precisely what retiring <code>tenantIsolation</code> was about. An axis implies graduation and enforcement; this has neither.</p>
<p><span class="dec">Decision 8.3.1 — co-residents are equal.</span> On shared substrate no consumer's query yields to another's. A consumer whose latency requirement cannot survive an unprioritised neighbour must escalate to <code>P2</code>. That is the honest mechanism and it is the only one we have.</p>
<p><span class="dec">Decision 8.3.2 — service class is declared anyway</span>, as a category rather than a level: <code>latency-critical</code>, <code>interactive</code>, or <code>batch</code>. It buys three things, none of which is priority:</p>
<ul><li><strong>A placement input.</strong> Mixing <code>latency-critical</code> with <code>batch</code> on one instance is a recognised mismatch. It may still be the right call — it is right today — but it should be a decision, not an accident of who was provisioned when.</li><li><strong>A trigger.</strong> A <code>latency-critical</code> consumer acquiring a <code>batch</code> co-resident is a recorded placement trigger under §8, on the same footing as noisy neighbour.</li><li><strong>An acceptance criterion for evidence.</strong> The noisy-neighbour artifact in §13 asks whether measured degradation is <em>acceptable</em>; without a declared class that word has no referent. Degradation tolerable for <code>batch</code> may be an outage for <code>latency-critical</code>.</li></ul>
<p><span class="dec">Decision 8.3.3 — class mixture must be visible.</span> The platform reports which classes are co-resident. An unenforceable risk that nobody can see is strictly worse than one that is stated.</p>
<p>The known escalation short of P2 is gateway-level prioritisation — ordering submissions in a connection proxy by the requesting tenant's current consumption. It is real, it is where the industry puts this when it must, and it is new infrastructure we do not run. Recorded as the option, not adopted.</p>
</section>
<section id="s9"><h2><span class="sn">09</span>Credentials as a tenancy control</h2>
<p>Short-lived leased credentials re-read at connection checkout, with overlap-first rotation, bound the residual risk at every E level below E4: a leaked credential expires rather than persisting. Stronger than the industry norm of a long-lived per-service secret.</p>
<p><span class="dec">Decision 9.1:</span> static long-lived database credentials are not a sanctioned path for any service above E0.</p>
<p><span class="dec">Decision 9.2 — the rule extends to consumer-facing credentials.</span> Draft-6 named database access only. <code>audit-core</code> pointed out that its <em>ingest</em> credentials are static long-lived bearer tokens, rotated by publishing a second alongside the first — and that the argument applies with <strong>more</strong> force to the credential that actually carries the tenant claim than to the one that reaches the database behind it. Read as an accidental omission; it was. Consumer-facing credentials are named in. Where a service cannot yet meet this, it is a stated gap rather than a silent exclusion.</p>
</section>
<section id="s10"><h2><span class="sn">10</span>Blast radius must be published</h2>
<p><span class="dec">Decision 10.1:</span> every platform holding consumer data MUST publish, in concrete terms, what a leaked runtime credential can and cannot reach at the levels it operates. <code>rapp-postgres</code> ADR-0001 §5 is the reference. Where the model cannot provide a guarantee, the platform says so and names the escalation.</p>
<p><span class="dec">Decision 10.2 — quotas are disclosed, not discovered.</span> The same obligation extends from what a leaked credential can reach to what the platform will refuse to do for you. Every consumer MUST be told, at provisioning, the throttles and quotas enforced against it — connection limits, statement timeouts, idle-transaction timeouts — and told again when they change. A consumer learning its statement timeout by hitting it in production is a disclosure failure, not a consumer bug. This is how <code>tenant-engine</code> was provisioned, by good practice rather than by rule; the rule now exists.</p>
</section>
<section id="s11"><h2><span class="sn">11</span>Commercial expression</h2>
<ul><li><strong>11.1</strong> Plan tiers are expressed <em>internally</em> as typed assurance requirements. A tier may require <code>E3 P2 R2 V2</code> and a maximum erasure horizon; it need not print those labels anywhere customer-facing.</li><li><strong>11.2</strong> Marketing and product language is free. No requirement to expose level labels or this document. "Dedicated infrastructure", "isolated tenancy", "private instance" all remain available.</li><li><strong>11.3</strong> The constraint is on <strong>evidence, not vocabulary</strong>. A customer-facing isolation, availability or retention claim must map to a minimum level the delivering service actually holds, recorded once when the tier is defined. The review is internal and happens at tier definition — not per campaign.</li><li><strong>11.4</strong> Two hard lines, because these reach contracts and compliance questionnaires:</li><li>A claim that another tenant <strong>cannot</strong> reach the customer's data requires <strong>E4</strong>.</li><li>A claim that deleted data <strong>is gone</strong> requires <strong>R4</strong>, or an erasure horizon disclosed alongside it. Where R4 is reached by key destruction, the claim is defensible but not settled law (§4.5) — it may be made, and it may not be made in language that implies a regulator has blessed it.</li><li>A claim that service survives loss of a zone requires <strong>V3</strong>; regional-loss language requires <strong>V4</strong>. "High availability" without a named failure and measured recovery objective is not an assurance claim this framework can evidence.</li><li><strong>11.5 — sanctioned honest language.</strong> The strong prohibitions above must not leave a commercial writer with only silence:</li><li>E3 may be described as database-backed defence against an omitted tenant filter; it must not be paraphrased as "another tenant cannot reach".</li><li>P2 may be described as a dedicated service database cluster with an independent capacity and restore boundary; it is not tenant-dedicated.</li><li>R2 may state the declared retention and published erasure horizon.</li><li>V1 may state exercised restart recovery in one failure domain and must say that interruption and single-domain loss remain.</li><li><strong>11.6 — authority and reconciliation.</strong> The tier definition is authoritative for the minimum and customer wording. <code>tenancy.yaml</code> is authoritative for the delivering service's current level; provider declarations are authoritative for what infrastructure makes available. None is derived by copying another. Approval joins them and fails closed on a missing, stale or insufficient declaration. A performance-differentiated tier requires P2 or an enforceable resource governor; service class alone grants no priority.</li></ul>
</section>
<section id="s12"><h2><span class="sn">12</span>Methodology — analyze, establish, improve, guard</h2>
<p><strong>Analyze.</strong> Assess a repo against the ladders; produce <code>tenancy.current</code> with reasoning recorded. Applies to new and absorbed services alike.</p>
<p><strong>Establish.</strong> Declare the target and gap. The target is set by data class, tenant groupings served and plan tiers carried — not by ambition.</p>
<p><strong>Improve.</strong> Move one axis at a time. Raising P while leaving E untouched is the characteristic misstep.</p>
<p><strong>Guard.</strong> Verify continuously that the declared posture holds — <strong>against the service's own declaration</strong>, not a universal maximum. Nobody must prove every service is at E4; the check is that none is below what it declared.</p>
<p>Regression found by guarding is a defect; regression declared in advance is a decision. The estate has been bitten twice by silent pin rollbacks producing ordinary-looking 403s and 404s rather than errors. Posture regression looks the same — an RLS context leak returns correct-looking rows for the wrong tenant. Guarding must be designed for invisible failure, not for crashes.</p>
</section>
<section id="s13"><h2><span class="sn">13</span>Evidence per level</h2>
<p><span class="dec">Decision 13.1:</span> a current level is claimed only with its evidence artifact present. This turns §6's accuracy rule from an honour system into a check. <code>implemented</code> records a control observed in code or configuration whose required artifact is still absent; it never satisfies a tier minimum.</p>
<p><span class="dec">Decision 13.1a — the floor needs no artifact, only a reason.</span> Found independently by <code>audit-core</code> and <code>flex-auth</code>: the table below defines artifacts from <code>I2</code>, <code>A2</code>, <code>E1</code>, <code>P1</code>, <code>R2</code> upward and none below, so a literal 13.1 made the lowest rungs unclaimable — including §5's own worked example of a conformant absorbed repo, <code>I1 A1 E1 P0 R0</code>, which could not satisfy it on any axis. A rule that forbids the declaration §6 exists to permit is a defect in the rule.</p>
<p>At <code>I0/I1</code>, <code>A0/A1</code>, <code>E0</code>, <code>P0</code>, <code>R0/R1</code>, <code>V0</code>, or <code>n/a</code>, a declaration requires a <strong>stated reason</strong>, not an artifact. Evidence is what stops you overclaiming, and there is nothing to overclaim at those floors.</p>
<p><span class="dec">Decision 13.4 — an artifact must assert something achievable.</span> Draft-3's noisy-neighbour evidence required proof that a saturating consumer "does not breach" another's allowance. Shared infrastructure cannot provide that; the risk is inherent and cannot be wholly removed. An artifact that can only fail, or that passes by being run gently enough, is an overclaim wearing the costume of evidence. Where a property cannot be guaranteed, the artifact measures and records it instead.</p>
<p><span class="dec">Decision 13.2 — evidence is of two kinds, and conflating them is an overclaim.</span> <em>Mechanical</em> evidence is a structural assertion a machine can make and belongs in CI. <em>Adversarial</em> evidence is semantic, requires setting up separate tenant contexts and comparing responses, and carries a review date rather than a green build. Cross-tenant findings are the category external testing practice identifies as needing human review. <strong>A passing CI run is not E2 evidence.</strong></p>
<div class="scroll"><table><thead><tr><th>Level</th><th>Evidence</th><th>Kind</th></tr></thead><tbody><tr><td><strong>I2</strong></td><td>Identifiers validated against the vocabulary; rejection test for a malformed id; binding shown to come from a verified token</td><td><span class="kind ">Mechanical</span></td></tr><tr><td><strong>I3</strong></td><td>Live re-query demonstrated on an <code>aal2</code>-class path; cached-claim path shown unused there</td><td><span class="kind ">Mechanical</span></td></tr><tr><td><strong>A2</strong></td><td>Choke point identified; test that an unbound request is refused</td><td><span class="kind ">Mechanical</span></td></tr><tr><td><strong>A3</strong></td><td>Live decision with a denial observed at the endpoint, not only at the decision surface</td><td><span class="kind ">Mechanical</span></td></tr><tr><td><strong>A4</strong></td><td>Decision served over the standard interface; a second PDP substituted without PEP change, <strong>with the decision differences between the two recorded</strong> — substitution proves interface portability, not decision equivalence</td><td><span class="kind ">Mechanical</span></td></tr><tr><td><strong>E1</strong></td><td>Every tenant-owned table carries the tenant key</td><td><span class="kind ">Mechanical</span></td></tr><tr><td><strong>E2</strong></td><td>Choke point identified; identity bound to tenant A demonstrably cannot read tenant B</td><td><span class="kind adv">Adversarial, with a review date</span></td></tr><tr><td><strong>E3</strong></td><td><code>FORCE ROW LEVEL SECURITY</code> on every tenant table; no <code>BYPASSRLS</code> on leased roles; probe that a session without the GUC reads nothing; probe that a wrong GUC reads nothing; <code>EXPLAIN</code> comparison</td><td><span class="kind ">Mechanical</span></td></tr><tr><td><strong>E4</strong></td><td>Per-tenant credential demonstrated unable to connect to another tenant's substrate</td><td><span class="kind ">Mechanical</span></td></tr><tr><td><strong>P1P4</strong></td><td>Provisioning declaration plus the platform's isolation probes</td><td><span class="kind ">Mechanical</span></td></tr><tr><td><strong>Shared P1P2 capacity assurance</strong></td><td>A recorded baseline of per-consumer resource usage; a run in which one consumer saturates its declared allowance; evidence that the governance controls <strong>bind</strong> (the greedy consumer is held at its limits) and that the degradation co-residents experience is <strong>measured, recorded and judged acceptable against each one's declared service class</strong> (§8.3); the aggregate headroom at time of measurement</td><td><span class="kind adv">Adversarial, load-generated, with a review date</span></td></tr><tr><td><strong>R2</strong></td><td>Declared retention rendered; erasure horizon published and reported in the operator surface</td><td><span class="kind ">Mechanical</span></td></tr><tr><td><strong>R3</strong></td><td>Sweep evidence records: timestamp, dataset, identifiers removed, authorising policy reference</td><td><span class="kind ">Mechanical</span></td></tr><tr><td><strong>R4</strong></td><td>Erasure demonstrated across live data, backups and derived copies within the horizon</td><td><span class="kind adv">Adversarial</span></td></tr><tr><td><strong>V1</strong></td><td>Critical dependencies enumerated; restart/recreate recovery exercised; interruption and measured recovery time recorded</td><td><span class="kind ">Mechanical exercise</span></td></tr><tr><td><strong>V2</strong></td><td>One instance terminated while traffic continues or recovers automatically; measured RTO/RPO and remaining shared failure domains recorded</td><td><span class="kind adv">Adversarial, failure-injected</span></td></tr><tr><td><strong>V3</strong></td><td>Declared failure domain removed in an exercise; complete critical path and degraded modes observed against RTO/RPO</td><td><span class="kind adv">Adversarial, failure-injected</span></td></tr><tr><td><strong>V4</strong></td><td>Region made unavailable in an exercise; traffic and state recover in the alternate region against RTO/RPO</td><td><span class="kind adv">Adversarial, failure-injected</span></td></tr></tbody></table></div>
<p>The P1P4 artifact proves the declared placement topology. The shared-capacity artifact is additional: it is required before a P1/P2 service can claim that a noisy-neighbour control binds, that the trigger is actively guarded, or that a customer performance assurance survives co-residency. It is not required merely to report the true topology as P1 or P2. No such capacity artifact exists in the estate today, so §11 requires P2 or an enforceable governor for a performance-differentiated tier.</p>
<p><span class="dec">Decision 13.3:</span> the tenant-boundary E2/E3 and noisy-neighbour artifacts do not exist anywhere in the estate today. <code>rapp-postgres</code> runs 19 adversarial probes, all against the <em>consumer</em> boundary, none against the tenant boundary inside a consumer. Externally, what this framework calls a tenant boundary failure is <strong>Broken Object Level Authorization</strong> — OWASP API1, top of the API Security Top 10 since that list launched, and the most commonly exploited API vulnerability in published assessments. We have no coverage for the highest-ranked risk in our class of system. §19.3 records the owner.</p>
</section>
<section id="s14"><h2><span class="sn">14</span>Adoption stance — structure, not tooling</h2>
<p><span class="dec">Decision 14.1:</span> external research is design input. This estate adopts published standards and structural patterns; it does not adopt tooling unless that tooling is an established industry standard with broad application. Everything else is built ground-up, so it can be optimised and refactored as the estate sees fit.</p>
<div class="scroll"><table><thead><tr><th>Class</th><th>Stance</th></tr></thead><tbody><tr><td>Security baselines (OWASP Multi-Tenant Security Cheat Sheet, API Security Top 10)</td><td>Adopt as the external reference our ladders answer to</td></tr><tr><td>Standards bodies (OpenID AuthZEN 1.0)</td><td>Adopt — this is what A4 is</td></tr><tr><td>Reference taxonomies (Azure tenancy models, AWS SaaS Lens, cell architecture)</td><td>Adopt as structure</td></tr><tr><td>Engine behaviour (PostgreSQL RLS mechanics)</td><td>Facts, not tooling</td></tr><tr><td>Third-party analyzers and test frameworks</td><td><strong>Do not adopt.</strong> Take their rule taxonomies as checklists for probes we write ourselves</td></tr></tbody></table></div>
<p>The practical effect is small and good: <code>rapp-postgres</code> already owns a ground-up probe harness — bash and psql, no dependency tree — that found four real defects in its own provisioning SQL. The evidence artifacts in §13 become new probes in a tool we control. One idea worth reimplementing from the external survey is <strong>policy-diff classification</strong>: labelling a change to an enforcement policy as safe or breaking <em>before</em> it lands.</p>
</section>
<section id="s15"><h2><span class="sn">15</span>Alternatives considered</h2>
<p><strong>One fixed model with a single set of characteristics</strong> (draft-1). <em>Rejected:</em> cannot describe a repo that is not there yet, forcing absorbed repos to misrepresent their posture or stay outside. A framework that can only describe its own end state is not a framework.</p>
<p><strong>A maturity model with a single overall level.</strong> <em>Rejected:</em> collapses the axis separation. A service strong on identity and weak on enforcement has a specific, actionable gap; one composite score hides it and invites averaging.</p>
<p><strong>Prohibiting row-level security</strong> (draft-2's inherited position). <em>Rejected in draft-2, refined in draft-3:</em> RLS is a real rung against the common threat. The error was never RLS — it was describing E3 in E4's language.</p>
<p><strong>Schema-per-consumer in one database.</strong> <em>Rejected:</em> <code>pg_catalog</code> is readable per-database, so every co-resident enumerates every other's table and column names regardless of grants. Retained as a describable state, never a target.</p>
<p><strong>Mandating E4 for everyone.</strong> <em>Rejected:</em> the tenant taxonomy includes <code>consumer</code> (private individuals) and <code>family</code>. A cluster per private individual is economically impossible; the taxonomy is itself evidence pooling is required.</p>
<p><strong>Per-consumer physical backup retention.</strong> <em>Rejected:</em> CNPG retention is a property of the instance's WAL archive. There is no mechanism, and claiming it would be a fabricated guarantee. Hence the derived maximum in §4.5.</p>
<p><strong>Platform-scheduled row expiry.</strong> <em>Rejected:</em> requires the platform to hold DML authority over consumer schemas and interpret consumer data semantics, both forbidden by ADR-0001. The consumer's migration lease is the correct instrument.</p>
<p><strong>Leaving each repo to its own model.</strong> <em>Rejected:</em> the status quo, which produced two contradictory ratified defaults and an unowned placement question.</p>
</section>
<section id="s16"><h2><span class="sn">16</span>Held against outside practice</h2>
<p><strong>The graduated reframe is corroborated, not invented here.</strong> Microsoft's tenancy-model guidance states it almost verbatim: <em>"Instead of viewing isolation as a discrete property, consider it a spectrum. You can deploy components of your architecture that are more isolated or less isolated than other components in the same architecture."</em> The same guidance derives our E↔P coupling independently — shared deployment means enforcement lives in application code; dedicated deployment means it is structural.</p>
<p><strong>Stronger than typical.</strong> Most multi-tenancy literature models one boundary, tenant-to-tenant. This estate has <strong>two stacked boundaries</strong>: platform-service to platform-service, and tenant to tenant inside a consumer. Naming them separately and refusing to enforce both with one mechanism is uncommon and correct. Graduated per-axis levels also beat the silo/pool/bridge trichotomy, which is approximately our P axis with the other four missing — which is why it cannot express "pooled infrastructure, structurally enforced boundary".</p>
<p><strong>Weaker than typical.</strong> The pool model's standard mitigation is a <em>verified</em> enforcement layer every service is demonstrably routed through. We have the concept and none of the verification (§13.3).</p>
<p><strong>Adopted without naming it.</strong> Short-lived leased credentials re-read at checkout beat the long-lived-secret norm. §9 promotes it to a tenancy control.</p>
<p><strong>Still unexplored.</strong> Neither P nor R describes a <strong>cell</strong> — a slice of infrastructure with a <em>fixed maximum size</em>, sized so one cell's failure is survivable and cell count scales linearly. <code>platform-pg</code> is, in these terms, an uncapped cell: §17 computes a ceiling and nothing enforces it (§19.8).</p>
<p>Sources: the five research digests in <code>the-custodian/research/2026-08-17-adr008-*</code>, which carry full citations for the claims in this section.</p>
</section>
<section id="s17"><h2><span class="sn">17</span>Scaling demands</h2>
<p>Derived from the live <code>platform-pg</code> specification. Connection arithmetic is exact; the per-backend memory estimate remains unmeasured and is explicitly a gap in <code>rapp-postgres</code> ADR-0004.</p>
<pre>instances: 1 (no HA; single-node rail)
max_connections: 100
memory limit: 1Gi
per consumer: 14 connections (12 runtime + 2 migration)</pre>
<p><strong>The hard connection bound is roughly six declarations; the enforceable operational ceiling is four.</strong> Seven declarations request 98 of 100 connections before CNPG's instance manager, metrics exporter and reserved slots. Every one of them is politely inside its declared 14-connection allowance; the instance still fails. ADR-0004 sets four because memory is expected to bind first and fails by OOM-killing every co-resident rather than refusing one connection.</p>
<p>That distinction matters because our governance addresses the wrong shape. Per-consumer <code>connection_limit</code>, <code>statement_timeout</code> and <code>idle_in_transaction_session_timeout</code> guard well against <strong>one greedy consumer</strong>. They do nothing about <strong>the aggregate of many modest ones</strong>, which is the second and less intuitive noisy-neighbour failure and the one this number describes. Two workload consumers plus the isolation probe occupy three of the four declared slots. The next workload request must trigger measurement and the overflow decision before admission.</p>
<p><strong>Memory likely binds first.</strong> 100 backends against 1Gi is ~10MB per backend. Connection exhaustion errors clearly; memory pressure OOM-kills and degrades every co-resident at once.</p>
<p><strong>E3 and pooling.</strong> <em>Corrected from draft-2, which had this backwards.</em> Transaction-scoped context (<code>SET LOCAL</code> inside an explicit transaction) is what makes E3 <strong>safe</strong> under a pooler. Statement-level pooling is what breaks it, serving other tenants' rows under concurrency with no error. E3 constrains which pooling mode is available, not whether pooling is available.</p>
<p><strong>Retention consumes the volume.</strong> WAL accumulates with the window, and §4.5 makes the window the maximum across consumers. A consumer declaring a long retention extends everyone's horizon <em>and</em> everyone's storage draw against a 20Gi volume.</p>
<p><strong>Restore time couples all consumers.</strong> Physical backup is instance-wide, so a consumer's RTO is a function of <em>total</em> instance size, not its own.</p>
<p><strong><code>platform-pg</code> is V1.</strong> <code>instances: 1</code> on a single-node rail provides exercised restart recovery and no failover. P1 describes its consumer placement and says nothing about this availability fact; the new V axis carries it.</p>
</section>
<section id="s18"><h2><span class="sn">18</span>Consequences</h2>
<ul><li>The estate gains one vocabulary and a way to be honest about partial adoption.</li><li>Absorbed repos get a described state and a path instead of a failing grade.</li><li><code>tenantIsolation</code> in <code>PostgresConsumer</code> is revealed as a mislabelled field.</li><li>The verification problem becomes tractable: guard against declaration.</li><li>Draft-2's RLS prohibition is reversed and its E3 description corrected; <code>rapp-postgres</code> acquires an obligation to define and offer the mechanism.</li><li>Adding a consumer with long retention <strong>silently extends everyone's erasure horizon</strong>. This must reach the consumer review checklist, not only this document.</li><li>A service selling an isolation tier must maintain a tenant→substrate mapping it does not have today.</li><li>Availability becomes an end-to-end, evidenced property rather than an inference from replica count or placement.</li><li>Nothing here changes a running system.</li></ul>
</section>
<section id="s19"><h2><span class="sn">19</span>Review resolutions and residual questions</h2>
<ol><li><strong><code>tenantIsolation</code> field — resolved.</strong> <code>rapp-postgres</code> retired it. A consumer declaration asks for mechanisms; posture lives in the consumer's <code>tenancy.yaml</code>.</li><li><strong>Placement ownership — resolved.</strong> §8.2 records the split. The policy has one owner; typed tier requirements replace the declined commercial co-signature.</li><li><strong>E2, E3 and noisy-neighbour evidence</strong><strong>owned as of 2026-08-17</strong> by <code>whitehat-security</code> (WHITEHAT-WP-0001), an independent adversarial evidence facility seeded for this purpose. <code>audit-core</code> and <code>tenant-engine</code> were right to decline it as fleet-scope work; the answer was a home of its own rather than a volunteer.</li></ol>
<p><strong>Owned by NetKingdom</strong> — corrected 2026-08-17; an earlier revision of this section proposed otherwise on independence grounds and was overruled. Offensive security is security work and belongs with the repo that owns security. The facility is framed offensively rather than as a conformance checker: it is pointed at infrastructure we choose, our own estate among them, and conformance testing is one use of a general capability.</p>
<p>The residual tension is recorded rather than resolved: NetKingdom owns this framework <em>and</em> the facility that tests conformance to it, so those findings are NetKingdom assessing NetKingdom. The mitigation is that findings leave for <code>risk-nexus</code>, under <code>the-custodian</code>, rather than being closed in place. Proportionate, not perfect. Revisit if conformance findings start getting quietly closed.</p>
<p>Two consequences land back here. <strong>Cadence is now a security parameter, not a schedule</strong> — for any control whose guarantee is detection rather than prevention, the interval between probe runs <em>is</em> the exposure window, and <code>rapp-postgres</code> ADR-0003 leaves that number to the facility. And <strong>a passing suite is not proof of isolation</strong>; it is proof that the attacks attempted did not work. §13's evidence artifacts should be read with that distinction, because a green run recorded as "E2 verified" would be exactly the overclaim §6 prohibits.</p>
<ol><li><strong>Business app vs platform service — open.</strong> Custodian canon: a classification rule. Candidate: reuse <code>repo-classification-standard_v1.0</code>.</li><li><strong>Tier → minimum level mapping — policy resolved, implementation open.</strong> <code>adaptive-pricing</code> owns typed minima and wording; <code>tenant-engine</code> owns plan assignment by id. Current tiers make no assurance claims.</li><li><strong>The E3 mechanism — resolved.</strong> <code>rapp-postgres</code> ADR-0003 publishes the GUC contract with the <code>FORCE</code>/<code>BYPASSRLS</code>/<code>SECURITY INVOKER</code>/<code>EXPLAIN</code> requirements.</li><li><strong>Identity-provider placement — open.</strong> Owner of <code>key-cape</code>: realm-per-tenant or Organizations? Realm-per-tenant's ~520 tenant ceiling is below our target.</li><li><strong>Cell sizing — resolved for <code>platform-pg</code>.</strong> <code>rapp-postgres</code> ADR-0004 sets four consumers and names absent overflow target <code>platform-pg-2</code>; measurement and provisioning remain live gaps.</li><li><strong>Retention floor and ceiling — resolved as policy.</strong> Both exist; requests outside them fail validation and the package repo owns the numbers.</li><li><strong>Engine neutrality — open.</strong> The P ladder rests on a PostgreSQL property. State it engine-specifically and say so, or abstract it and risk a non-Postgres implementation that silently differs?</li><li><strong>Erasure versus audit — framework resolved.</strong> <code>audit-core</code>: crypto-shredding a tenant's audit records destroys the evidence the service exists to hold, and ADR-0001 §2 deliberately built the role model so history could not be rewritten. The usual resolution separates the <em>fact</em> of an event, retained, from its <em>personal payload</em>, encrypted per subject and shreddable. Raised because a naive "R4 everywhere" target would instruct the audit service to destroy its own evidence. <code>audit-core</code> targets R2 and is explicitly not a fleet R4 target. The legal basis for retaining audit facts remains a risk/legal question outside this framework.</li><li><strong>Quality of service</strong><strong>resolved 2026-08-17.</strong> Co-residents are equal; a declared <em>service class</em> informs placement but never grants priority. See §8.3. The question asked whether to add a QoS dimension; the answer is no, and the reason is that we could not enforce one.</li></ol>
<p><strong>Routed elsewhere, deliberately.</strong> The tenant identifier <code>tenant:&lt;grouping&gt;:&lt;name&gt;</code> embeds headcount bands (<code>small</code>, <code>medium</code>, <code>large</code>) that change as a tenant grows, contradicting the consensus that identifiers should not encode mutable attributes. That is a critique of ADR-0013, not of this framework, and belongs to <code>tenant-engine</code> and NetKingdom canon. Folding it in here would overreach.</p>
</section>
<section id="s20"><h2><span class="sn">20</span>Ratification path</h2>
<ol><li>Reviewed by <code>tenant-engine</code>, <code>flex-auth</code>, <code>audit-core</code>, <code>rapp-postgres</code>, <code>railiance-platform</code> and <code>adaptive-pricing</code> against §19. <strong>Complete in draft-8.</strong></li><li>Each publishes its own posture vector (§5) as part of review. <strong>The framework is validated by whether it can describe them accurately</strong> — if a repo cannot express itself in these six ladders, the ladders are wrong and this document changes, not the repo. <strong>Complete in draft-8; all six root declarations validate against the canonical schema.</strong></li><li>On acceptance, <strong>supersedes</strong> the routing of <code>rapp-postgres/docs/canon-drafts/shared-platform-relational-storage_v0.1-draft.md</code>, whose §§38 are absorbed here. That draft is withdrawn rather than left pending.</li><li>On acceptance, <code>rapp-postgres</code> ADR-0001 through ADR-0004 move to <code>accepted</code> and are annotated as the PostgreSQL implementation of the E, P, R and shared-capacity rules.</li></ol>
</section><footer><span>netkingdom-tenancy-posture · draft-8 · proposed</span><span>net-kingdom · canon/standards/tenancy-posture_v0.1.md · cced59d3aa1dc0aa08fc128fc8c76699f59dcd90</span></footer></main></div></div></html>

View file

@ -1,383 +1 @@
<title>Tenancy Posture</title> <!doctype html><html lang="en"><meta charset="utf-8"><meta http-equiv="refresh" content="0; url=/standards/tenancy-posture/v0.1/index.html"><title>NetKingdom Tenancy Posture v0.1</title><p>Moved permanently to <a href="/standards/tenancy-posture/v0.1/index.html">/standards/tenancy-posture/v0.1/index.html</a>.</p></html>
<style>
:root{
--paper:#EDEEF0; --surface:#F6F7F8; --surface-2:#E4E6E9;
--ink:#171D24; --ink-2:#4A5561; --ink-3:#737E8A;
--rule:#D3D7DC; --rule-strong:#B6BCC3;
--brass:#8A6A2E; --brass-soft:#EFE5CD; --brass-line:#C9AE74;
--clay:#8A3A2C; --clay-soft:#F2DFDA;
--l0:#DCE0E2; --l1:#B9C4C7; --l2:#8CA1A6; --l3:#567D84; --l4:#23555E;
--chip-fg:#F6F7F8;
--font-display:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",sans-serif;
--font-body:"Iowan Old Style","Palatino Linotype",Palatino,Georgia,serif;
--font-mono:ui-monospace,"SF Mono","Cascadia Code",Menlo,Consolas,monospace;
--measure:66ch;
}
@media (prefers-color-scheme:dark){
:root:not([data-theme="light"]){
--paper:#12161A; --surface:#191E24; --surface-2:#222831;
--ink:#E6E9EC; --ink-2:#A3ADB7; --ink-3:#78838E;
--rule:#2A3138; --rule-strong:#3B444D;
--brass:#C9A45C; --brass-soft:#33290F; --brass-line:#6B5426;
--clay:#D08A76; --clay-soft:#3A211B;
--l0:#262C32; --l1:#35424A; --l2:#4A626B; --l3:#6A939D; --l4:#97C4CD;
--chip-fg:#12161A;
}
}
:root[data-theme="dark"]{
--paper:#12161A; --surface:#191E24; --surface-2:#222831;
--ink:#E6E9EC; --ink-2:#A3ADB7; --ink-3:#78838E;
--rule:#2A3138; --rule-strong:#3B444D;
--brass:#C9A45C; --brass-soft:#33290F; --brass-line:#6B5426;
--clay:#D08A76; --clay-soft:#3A211B;
--l0:#262C32; --l1:#35424A; --l2:#4A626B; --l3:#6A939D; --l4:#97C4CD;
--chip-fg:#12161A;
}
*{box-sizing:border-box}
body{
margin:0; background:var(--paper); color:var(--ink);
font-family:var(--font-body); font-size:17px; line-height:1.62;
-webkit-font-smoothing:antialiased;
}
.wrap{max-width:1180px;margin:0 auto;padding:0 24px 96px}
.layout{display:grid;grid-template-columns:180px minmax(0,1fr);gap:56px;align-items:start}
@media (max-width:960px){.layout{grid-template-columns:1fr;gap:0}.rail{display:none}}
/* ---------- rail ---------- */
.rail{position:sticky;top:28px;padding-top:8px;font-family:var(--font-display);font-size:12px;line-height:1.5}
.rail ol{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:7px}
.rail a{color:var(--ink-3);text-decoration:none;display:flex;gap:9px}
.rail a:hover,.rail a:focus-visible{color:var(--brass)}
.rail .n{font-family:var(--font-mono);font-size:10px;color:var(--rule-strong);min-width:16px;padding-top:1px}
.rail .grp{margin-top:14px;font-size:9.5px;letter-spacing:.14em;text-transform:uppercase;color:var(--rule-strong)}
/* ---------- header ---------- */
header{padding:64px 0 40px;border-bottom:2px solid var(--ink);margin-bottom:44px}
.eyebrow{font-family:var(--font-mono);font-size:11.5px;letter-spacing:.13em;text-transform:uppercase;color:var(--ink-3);display:flex;flex-wrap:wrap;gap:14px;margin-bottom:22px}
.eyebrow .stat{color:var(--clay)}
h1{font-family:var(--font-display);font-weight:800;letter-spacing:-.035em;line-height:.94;font-size:clamp(46px,9vw,92px);margin:0 0 6px;text-wrap:balance}
.sub{font-family:var(--font-display);font-weight:500;font-size:clamp(16px,2.4vw,21px);letter-spacing:-.01em;color:var(--ink-2);margin:0 0 30px;max-width:34ch;line-height:1.3}
.metagrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:20px 28px;border-top:1px solid var(--rule);padding-top:20px}
.metagrid dt{font-family:var(--font-mono);font-size:10px;letter-spacing:.13em;text-transform:uppercase;color:var(--ink-3);margin-bottom:5px}
.metagrid dd{margin:0;font-family:var(--font-display);font-size:13.5px;line-height:1.45;color:var(--ink)}
/* ---------- typography ---------- */
section{margin-bottom:60px;scroll-margin-top:24px}
h2{font-family:var(--font-display);font-weight:750;letter-spacing:-.022em;font-size:clamp(24px,3.4vw,31px);line-height:1.12;margin:0 0 18px;text-wrap:balance;display:flex;gap:14px;align-items:baseline}
h2 .sn{font-family:var(--font-mono);font-size:12px;font-weight:400;color:var(--brass);letter-spacing:.06em;flex:none;padding-top:2px}
h3{font-family:var(--font-display);font-weight:700;font-size:16px;letter-spacing:-.008em;margin:34px 0 10px;color:var(--ink)}
p{margin:0 0 15px;max-width:var(--measure)}
ul,ol{max-width:var(--measure);margin:0 0 15px;padding-left:20px}
li{margin-bottom:7px}
strong{font-weight:600}
em{font-style:italic}
code{font-family:var(--font-mono);font-size:.855em;background:var(--surface-2);padding:1px 5px;border-radius:2px}
a{color:var(--brass)}
.lede{font-size:19px;line-height:1.55;color:var(--ink-2);max-width:60ch}
/* ---------- devices ---------- */
.callout{border-left:3px solid var(--brass);background:var(--brass-soft);padding:18px 22px;margin:0 0 24px;max-width:var(--measure)}
.callout p:last-child{margin-bottom:0}
.callout .lbl{font-family:var(--font-mono);font-size:10px;letter-spacing:.13em;text-transform:uppercase;color:var(--brass);display:block;margin-bottom:8px}
.rule-quote{border-top:2px solid var(--ink);border-bottom:2px solid var(--ink);padding:26px 0;margin:28px 0;max-width:var(--measure)}
.rule-quote p{font-family:var(--font-display);font-weight:600;font-size:19px;line-height:1.38;letter-spacing:-.014em;margin:0;text-wrap:balance}
.hard{border-left:3px solid var(--clay);background:var(--clay-soft);padding:18px 22px;margin:0 0 24px;max-width:var(--measure)}
.hard .lbl{font-family:var(--font-mono);font-size:10px;letter-spacing:.13em;text-transform:uppercase;color:var(--clay);display:block;margin-bottom:8px}
.hard p:last-child{margin-bottom:0}
.dec{font-family:var(--font-mono);font-size:10.5px;letter-spacing:.08em;color:var(--brass);text-transform:uppercase}
.vec{font-family:var(--font-mono);font-size:.9em;font-weight:600;background:var(--surface-2);padding:2px 7px;border-radius:2px;white-space:nowrap;letter-spacing:.04em}
/* ---------- tables ---------- */
.scroll{overflow-x:auto;margin:0 0 24px;-webkit-overflow-scrolling:touch}
table{border-collapse:collapse;width:100%;min-width:520px;font-family:var(--font-display);font-size:13.5px;line-height:1.45}
th{text-align:left;font-family:var(--font-mono);font-size:9.5px;letter-spacing:.13em;text-transform:uppercase;color:var(--ink-3);font-weight:400;padding:0 16px 8px 0;border-bottom:1px solid var(--rule-strong);vertical-align:bottom}
td{padding:11px 16px 11px 0;border-bottom:1px solid var(--rule);vertical-align:top;color:var(--ink-2)}
td:first-child{color:var(--ink);font-weight:600}
tbody tr:last-child td{border-bottom:none}
.lvl{font-family:var(--font-mono);font-weight:600;font-size:12px;letter-spacing:.04em;color:var(--ink)}
/* ---------- ladders ---------- */
.breakout{margin:34px 0 40px}
.bhead{display:flex;justify-content:space-between;align-items:baseline;gap:20px;border-bottom:1px solid var(--rule-strong);padding-bottom:9px;margin-bottom:22px;flex-wrap:wrap}
.bhead h3{margin:0;font-size:13px;letter-spacing:.1em;text-transform:uppercase;font-family:var(--font-mono);font-weight:400;color:var(--ink-3)}
.bhead .note{font-family:var(--font-display);font-size:12.5px;color:var(--ink-3)}
.ladders{display:grid;gap:26px}
.ladder{display:grid;grid-template-columns:126px minmax(0,1fr);gap:18px;align-items:start}
@media (max-width:700px){.ladder{grid-template-columns:1fr;gap:10px}}
.ladder .pname{font-family:var(--font-display);font-weight:700;font-size:14px;letter-spacing:-.01em;padding-top:2px}
.ladder .pname span{display:block;font-family:var(--font-mono);font-size:10px;font-weight:400;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-3);margin-top:3px}
.rungs{display:grid;gap:3px;grid-template-columns:repeat(5,minmax(0,1fr))}
@media (max-width:700px){.rungs{grid-template-columns:repeat(2,minmax(0,1fr))}}
.rung{padding:9px 10px 11px;background:var(--surface);border-top:4px solid var(--l0);min-width:0}
.rung.r1{border-top-color:var(--l1)} .rung.r2{border-top-color:var(--l2)}
.rung.r3{border-top-color:var(--l3)} .rung.r4{border-top-color:var(--l4)}
.rung .code{font-family:var(--font-mono);font-size:11px;font-weight:600;letter-spacing:.06em;color:var(--ink);display:block;margin-bottom:4px}
.rung .txt{font-family:var(--font-display);font-size:11.5px;line-height:1.34;color:var(--ink-2);display:block}
.rung.na{opacity:.42}
/* ---------- matrix ---------- */
.matrix-shell{display:grid;grid-template-columns:auto minmax(0,1fr);gap:12px;align-items:stretch;margin-bottom:14px}
.ylab{writing-mode:vertical-rl;transform:rotate(180deg);font-family:var(--font-mono);font-size:9.5px;letter-spacing:.14em;text-transform:uppercase;color:var(--ink-3);text-align:center;padding-bottom:22px}
.mgrid{display:grid;grid-template-columns:34px repeat(5,minmax(0,1fr));gap:3px}
.mcell{background:var(--surface);min-height:60px;padding:6px;display:flex;flex-direction:column;justify-content:flex-end;gap:4px;min-width:0}
.mcell.tint1{background:color-mix(in srgb,var(--l1) 26%,var(--surface))}
.mcell.tint2{background:color-mix(in srgb,var(--l2) 26%,var(--surface))}
.mcell.tint3{background:color-mix(in srgb,var(--l3) 24%,var(--surface))}
.mcell.tint4{background:color-mix(in srgb,var(--l4) 22%,var(--surface))}
.mcell.void{background:repeating-linear-gradient(135deg,transparent,transparent 5px,var(--rule) 5px,var(--rule) 6px);opacity:.55}
.rlab,.clab{font-family:var(--font-mono);font-size:10px;font-weight:600;letter-spacing:.05em;color:var(--ink-3);display:flex;align-items:center;justify-content:center}
.rlab{min-height:60px}
.clab{padding-top:7px;min-height:22px}
.pin{font-family:var(--font-mono);font-size:9.5px;font-weight:600;letter-spacing:.02em;background:var(--ink);color:var(--paper);padding:2px 5px;border-radius:2px;line-height:1.3;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pin.ghost{background:transparent;color:var(--ink-2);border:1px dashed var(--rule-strong)}
.mnote{display:flex;gap:22px;flex-wrap:wrap;font-family:var(--font-display);font-size:12px;color:var(--ink-3);padding-top:6px}
.mnote .k{display:flex;align-items:center;gap:7px}
.sw{width:13px;height:13px;flex:none;background:var(--ink)}
.sw.g{background:transparent;border:1px dashed var(--rule-strong)}
.sw.v{background:repeating-linear-gradient(135deg,transparent,transparent 4px,var(--rule) 4px,var(--rule) 5px);border:1px solid var(--rule)}
@media (max-width:640px){
.mgrid{grid-template-columns:28px repeat(5,minmax(0,1fr))}
.mcell{min-height:52px;padding:4px}
.pin{font-size:8px;padding:1px 3px}
.rlab{min-height:52px}
}
/* ---------- methodology ---------- */
.verbs{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:2px;background:var(--rule);border:1px solid var(--rule)}
.verb{background:var(--surface);padding:18px 18px 20px}
.verb h4{font-family:var(--font-display);font-weight:750;font-size:15px;margin:0 0 7px;letter-spacing:-.01em}
.verb p{font-family:var(--font-display);font-size:12.5px;line-height:1.46;color:var(--ink-2);margin:0;max-width:none}
.verb .step{font-family:var(--font-mono);font-size:9.5px;letter-spacing:.13em;color:var(--brass);display:block;margin-bottom:9px}
/* ---------- questions ---------- */
.qs{display:flex;flex-direction:column;gap:0;border-top:1px solid var(--rule-strong)}
.q{display:grid;grid-template-columns:34px minmax(0,1fr) 170px;gap:18px;padding:16px 0;border-bottom:1px solid var(--rule);align-items:start}
@media (max-width:760px){.q{grid-template-columns:28px minmax(0,1fr);gap:12px}.q .owner{grid-column:2}}
.q .qn{font-family:var(--font-mono);font-size:11px;color:var(--brass);padding-top:3px}
.q .qt{font-family:var(--font-display);font-size:14px;line-height:1.48;color:var(--ink-2)}
.q .qt b{color:var(--ink);font-weight:700;display:block;margin-bottom:2px;font-size:14.5px}
.owner{font-family:var(--font-mono);font-size:10px;letter-spacing:.05em;color:var(--ink-3);padding-top:4px}
.owner .tag{display:inline-block;border:1px solid var(--rule-strong);padding:2px 7px;border-radius:2px}
.owner .tag.need{border-color:var(--clay);color:var(--clay)}
/* ---------- misc ---------- */
.numbers{font-family:var(--font-mono);font-size:12.5px;line-height:1.85;background:var(--surface);border-left:3px solid var(--l3);padding:16px 20px;margin:0 0 22px;overflow-x:auto;max-width:var(--measure)}
.numbers .v{color:var(--ink);font-weight:600}
.numbers .k{color:var(--ink-3)}
pre{font-family:var(--font-mono);font-size:12.5px;line-height:1.68;background:var(--surface);border-left:3px solid var(--rule-strong);padding:16px 20px;overflow-x:auto;margin:0 0 22px;max-width:var(--measure);color:var(--ink-2)}
.alt{border-bottom:1px solid var(--rule);padding:14px 0;max-width:var(--measure)}
.alt:last-of-type{border-bottom:none}
.alt b{font-family:var(--font-display);font-size:14px;display:block;margin-bottom:3px}
.alt p{font-size:14.5px;margin:0;color:var(--ink-2)}
.alt .verdict{font-family:var(--font-mono);font-size:10px;letter-spacing:.1em;text-transform:uppercase;color:var(--clay)}
footer{border-top:2px solid var(--ink);margin-top:20px;padding-top:22px;font-family:var(--font-mono);font-size:11px;letter-spacing:.06em;color:var(--ink-3);display:flex;justify-content:space-between;gap:20px;flex-wrap:wrap}
.tm td,.tm th{text-align:center}
.tm td:first-child,.tm th:first-child{text-align:left}
.yes{color:var(--l4);font-weight:700}
.no{color:var(--clay);font-weight:700}
.kind{font-family:var(--font-mono);font-size:9px;letter-spacing:.09em;text-transform:uppercase;padding:2px 6px;border-radius:2px;white-space:nowrap;border:1px solid var(--rule-strong);color:var(--ink-3)}
.kind.adv{border-color:var(--clay);color:var(--clay)}
.routes{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:2px;background:var(--rule);border:1px solid var(--rule);margin:0 0 22px}
.route{background:var(--surface);padding:16px 18px}
.route h4{font-family:var(--font-display);font-weight:750;font-size:14px;margin:0 0 6px}
.route p{font-family:var(--font-display);font-size:12.5px;line-height:1.45;color:var(--ink-2);margin:0;max-width:none}
.route .tag{font-family:var(--font-mono);font-size:9px;letter-spacing:.1em;text-transform:uppercase;color:var(--brass);display:block;margin-bottom:8px}
a:focus-visible,.rail a:focus-visible{outline:2px solid var(--brass);outline-offset:3px}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
</style>
<div class="wrap"><header><div class="eyebrow"><span>netkingdom-tenancy-posture</span> <span class="stat">proposed · draft-5</span><span>generated from canon — do not edit</span></div><h1>Tenancy Posture</h1><p class="sub">A framework for describing, holding and improving multi-tenancy — including where we are not there yet.</p></header><div class="layout"><nav class="rail" aria-label="Sections"><ol><li><a href="#status"><span class="n">·</span>Status</a></li><li><a href="#s0"><span class="n">0</span>Terminology: axes, not planes</a></li><li><a href="#s1"><span class="n">1</span>Context</a></li><li><a href="#s2"><span class="n">2</span>What this document is</a></li><li><a href="#s3"><span class="n">3</span>Five orthogonal axes</a></li><li><a href="#s4"><span class="n">4</span>Graduated levels</a></li><li><a href="#s5"><span class="n">5</span>The posture vector</a></li><li><a href="#s6"><span class="n">6</span>Conformance is accuracy, not altitude</a></li><li><a href="#s7"><span class="n">7</span>Portability across placement levels</a></li><li><a href="#s8"><span class="n">8</span>Placement triggers</a></li><li><a href="#s9"><span class="n">9</span>Credentials as a tenancy control</a></li><li><a href="#s10"><span class="n">10</span>Blast radius must be published</a></li><li><a href="#s11"><span class="n">11</span>Commercial expression</a></li><li><a href="#s12"><span class="n">12</span>Methodology — analyze, establish, improve, guard</a></li><li><a href="#s13"><span class="n">13</span>Evidence per level</a></li><li><a href="#s14"><span class="n">14</span>Adoption stance — structure, not tooling</a></li><li><a href="#s15"><span class="n">15</span>Alternatives considered</a></li><li><a href="#s16"><span class="n">16</span>Held against outside practice</a></li><li><a href="#s17"><span class="n">17</span>Scaling demands</a></li><li><a href="#s18"><span class="n">18</span>Consequences</a></li><li><a href="#s19"><span class="n">19</span>Open questions</a></li><li><a href="#s20"><span class="n">20</span>Ratification path</a></li></ol></nav><main><section id="status"><h2>Status</h2>
<p><strong>Proposed, draft-5.</strong> Relocated from <code>the-custodian/canon/architecture</code> on 2026-08-17: multi-tenancy is part of the IT-security framework NetKingdom provides, so this framework belongs in NetKingdom canon beside the IAM Profile and the tenant-engine boundary contract, not in the work-factory canon.</p>
<ul><li><strong>draft-1</strong> proposed a single model with fixed characteristics. Rejected: it could not describe a repo that is not there yet.</li><li><strong>draft-2</strong> reframed to graduated levels per axis. Externally corroborated (§16), but four of its statements were wrong and one thing it needed was missing.</li><li><strong>draft-3</strong> applied those corrections, added the retention axis, and recorded an adoption stance.</li><li><strong>draft-4</strong> closed the two gaps draft-3 left open: <code>R4</code> had no mechanism beyond waiting, and the noisy-neighbour evidence artifact asserted something shared infrastructure cannot provide.</li><li><strong>draft-5</strong> relocates to NetKingdom and renames the dimensions from <em>planes</em> to <em>axes</em>, because the word was already taken (§0).</li></ul>
<p>Every correction so far was found by research or by relocation, not by review.</p>
<p>Informed by five external research digests in <code>research/2026-08-17-adr008-*</code>, which carry full citations for every external claim made here.</p>
<p>Reviewed by nobody yet. §19 lists what each owner is being asked to accept.</p>
</section>
<section id="s0"><h2><span class="sn">00</span>Terminology: axes, not planes</h2>
<p><code>docs/platform-identity-security-architecture.md</code> — accepted, 2026-07-23 — already uses <strong>plane</strong> for a trust and deployment layer: the <em>bootstrap plane</em>, the <em>platform control plane</em>, and <em>tenant planes</em>. That meaning is established, ratified, and owned by this repo.</p>
<p>Drafts 14 of this document, written elsewhere, used <strong>plane</strong> for something different: an independent dimension of concern. Two incompatible senses of one word inside one canon is exactly the concept-ownership collision the estate has been careful about elsewhere, and the newcomer yields.</p>
<p>This framework therefore describes five <strong>axes</strong>. They are orthogonal to NetKingdom's planes, not a subdivision of them:</p>
<ul><li>A <strong>plane</strong> is <em>where</em> something runs and what trust it carries — bootstrap, platform control, tenant.</li><li>An <strong>axis</strong> is <em>which property</em> of tenancy is being described — identity, authorization, enforcement, placement, retention.</li></ul>
<p>A workload in the tenant plane has a position on all five axes. A platform control plane service does too. The two vocabularies compose and neither replaces the other.</p>
<p>The rename is also an improvement. A posture vector is literally a point in five-dimensional space, and "axis" says that where "plane" did not.</p>
</section>
<section id="s1"><h2><span class="sn">01</span>Context</h2>
<p>Drafts 14 opened by claiming the estate "has never written down what it is building". Relocation proved that wrong, and the correction is worth keeping visible: <code>docs/platform-identity-security-architecture.md</code> has described the trust model, the tenant model and a capability progression since 2026-07-23. The accurate claim is narrower — <strong>what was missing is a way to say how far a given service has got, and to hold several answers at once.</strong> Seven documents cover slices of the subject and none of them does that:</p>
<div class="scroll"><table><thead><tr><th>Document</th><th>Covers</th><th>Status</th></tr></thead><tbody><tr><td><code>iam-profile_v0.3</code> (NetKingdom)</td><td>Tenant identifier shape, <code>tenant_roles</code> claim, staleness rules</td><td>Ratified</td></tr><tr><td><code>tenant-engine-boundary-contract_v0.1</code> (NetKingdom)</td><td>Who owns tenant records, roles, plan assignment</td><td>Ratified</td></tr><tr><td><code>business-app-service-contract_v0.1</code> §1 (Custodian)</td><td>Business apps: instance-per-client, tenant-keyed data</td><td>Ratified</td></tr><tr><td><code>rapp-postgres</code> ADR-0001</td><td>Consumer + tenant isolation in PostgreSQL</td><td>Proposed, governs one repo</td></tr><tr><td><code>rapp-postgres</code> ADR-0002</td><td>Per-consumer retention and the erasure horizon</td><td>Proposed, governs one repo</td></tr><tr><td><code>shared-platform-relational-storage_v0.1</code></td><td>The stacked-boundary gap</td><td>Routed 2026-08-10, <strong>still unratified</strong></td></tr><tr><td><code>platform-identity-security-architecture</code> (NetKingdom)</td><td>Trust model, planes, tenant model, capability progression</td><td>Accepted 2026-07-23</td></tr></tbody></table></div>
<p>This document is downstream of that architecture and must not restate it. It answers one question the architecture leaves open: given the model, <strong>where is this particular service today, and how would anyone know?</strong></p>
<p>Four failures follow.</p>
<p><strong>The gap was diagnosed once and the fix stalled.</strong> The v0.1 draft was written to fill this hole and has sat unratified in neither canon directory. §20 attaches a ratification path so this one does not join it.</p>
<p><strong>Placement is owned by nobody.</strong> <code>user-engine-pg</code> and <code>target-revenue-pg</code> are dedicated; <code>apps-pg</code>, <code>net-kingdom-pg</code>, <code>platform-pg</code>, <code>state-hub-db</code> and <code>forgejo-db</code> are shared. Both live, neither written down. <code>tenant-engine</code> raised this with <code>railiance-platform</code> on 2026-08-16; unanswered.</p>
<p><strong>Two contradictory defaults are already ratified.</strong> Business apps get instance-per-client; platform services pool. Nothing says which shape a new service takes, and no definition separates the categories.</p>
<p><strong>There is no honest way to describe a repo that is not there yet.</strong> The estate absorbs repos with weak or absent tenant separation. Today such a repo is simply non-conformant, leaving it two bad options: misrepresent its posture, or stay outside the framework.</p>
</section>
<section id="s2"><h2><span class="sn">02</span>What this document is</h2>
<p><strong>A framework, not a model.</strong> It specifies no single correct implementation. It supplies terminology (§3, §4), a declaration (§5), a conformance rule (§6), methodology (§12), and evidence definitions (§13).</p>
<p>A service is conformant when its declared posture is accurate and its trajectory recorded. A service is non-conformant when it claims a level it cannot evidence — regardless of how high or low that level is.</p>
</section>
<section id="s3"><h2><span class="sn">03</span>Five orthogonal axes</h2>
<p>"Is this multi-tenant?" is treated as one question. It is five, and they are independent:</p>
<div class="scroll"><table><thead><tr><th>Axis</th><th>Question</th><th>Vocabulary owner</th></tr></thead><tbody><tr><td><strong>Identity (I)</strong></td><td>How is a tenant named and validated?</td><td><code>tenant-engine</code> / IAM Profile</td></tr><tr><td><strong>Authorization (A)</strong></td><td>How is a request bound to the tenants it may act for?</td><td><code>flex-auth</code></td></tr><tr><td><strong>Enforcement (E)</strong></td><td>Where, mechanically, is the tenant boundary enforced?</td><td>This framework</td></tr><tr><td><strong>Placement (P)</strong></td><td>Which substrate holds a tenant's data?</td><td><code>railiance-platform</code></td></tr><tr><td><strong>Retention (R)</strong></td><td>How long does data persist, and how is it erased?</td><td>The storage platform; policy by the consumer</td></tr></tbody></table></div>
<p>Conflation produces errors today. <code>rapp-postgres</code>'s <code>PostgresConsumer</code> carries <code>tenantIsolation: consumer-service-boundary</code> — an <strong>E</strong>-axis fact in a <strong>P</strong>-axis artifact, reading as though storage enforces something it does not. The "dedicated versus shared" argument mixes P (capacity, blast radius) with E (correctness).</p>
<p>The axes are separated <em>precisely so each may sit at a different level</em>.</p>
<p><span class="dec">Decision 3.1:</span> every document, declaration and plan tier that says "isolation" MUST name which axis it means.</p>
<p><span class="dec">Decision 3.2:</span> the axes couple at their tops and the couplings MUST be stated where they apply, not used to argue the axes are one:</p>
<ul><li><code>E4</code> is reachable only at <code>P3</code> or above.</li><li><code>R</code>'s erasure horizon is bounded below by <code>P</code> — on shared substrate, a consumer's horizon is the instance maximum (§4.5).</li><li><code>R4</code> by key destruction is bounded by the <strong>key boundary</strong>, which is an E-axis property. Shredding a single tenant's data requires the application to encrypt under a per-tenant key before writing; the storage platform cannot supply it. <strong>Reaching the top of the retention ladder is not a retention project.</strong></li></ul>
<p><span class="dec">Decision 3.3 — scope.</span> The P and R ladders describe a service's <strong>primary datastore</strong>. Caches, search indices, message queues and background jobs are named leak surfaces in the external baselines and are assessed separately, not covered by a posture vector. Saying so is honest; implying the vector covers them would not be.</p>
</section>
<section id="s4"><h2><span class="sn">04</span>Graduated levels</h2>
<p>Each axis carries an ordered ladder. Higher is stronger, not better: the right level is the one a service can evidence and its risk warrants.</p>
<h3>4.1 Identity (I)</h3>
<div class="breakout"><div class="ladders">
<div class="ladder"><div class="pname">Identity<span>plane I</span></div><div class="rungs"><div class="rung r0"><span class="code">I0</span><span class="txt">No tenant concept. Data not attributable to a tenant.</span></div><div class="rung r1"><span class="code">I1</span><span class="txt">A local tenant notion exists but is not canonical, <strong>or</strong> the tenant is taken from the request rather than from a verified token.</span></div><div class="rung r2"><span class="code">I2</span><span class="txt">Canonical identifiers, bound at the identity provider and carried as a verified claim; <code>tenant-engine</code> is the source of existence.</span></div><div class="rung r3"><span class="code">I3</span><span class="txt">I2 plus capability roles honoured, with live <code>tenant-engine</code> re-query for privileged, destructive, credential-vending or <code>aal2</code>-class decisions.</span></div><div class="rung na"><span class="code"></span><span class="txt">Ladder ends at I3.</span></div></div></div>
</div></div>
<p>I1 now explicitly absorbs request-supplied tenant identifiers. "Never trust client-supplied tenant IDs without validation" is a named anti-pattern; a service reading the tenant from a header is at I1 however canonical the string.</p>
<p><code>business-app-service-contract</code> §2.1 sets app-local accounts as the v1 baseline for business apps — a sanctioned low level with recorded triggers for moving up. That is the pattern this framework generalises.</p>
<h3>4.2 Authorization (A)</h3>
<div class="breakout"><div class="ladders">
<div class="ladder"><div class="pname">Authorization<span>plane A</span></div><div class="rungs"><div class="rung r0"><span class="code">A0</span><span class="txt">No authorization, or tenant context not carried.</span></div><div class="rung r1"><span class="code">A1</span><span class="txt">Ad-hoc checks scattered through handlers.</span></div><div class="rung r2"><span class="code">A2</span><span class="txt">A single local authorization boundary; tenant context bound once, centrally.</span></div><div class="rung r3"><span class="code">A3</span><span class="txt">Decisions delegated to <code>flex-auth</code> as PDP, with live re-query where the IAM Profile requires it.</span></div><div class="rung r4"><span class="code">A4</span><span class="txt">A3 over a <strong>standard</strong> PDP interface (OpenID AuthZEN Authorization API 1.0), so the decision point is swappable and the enforcement point is not coupled to one engine's request shape.</span></div></div></div>
</div></div>
<p>A4 is new. <code>flex-auth</code> uses a bespoke <code>CheckRequest</code> and a bespoke action vocabulary, with action strings copied verbatim between repos to avoid re-derivation — exactly the coupling AuthZEN removes. The specification reached Final in January 2026 and Keycloak shipped experimental support in May. We are not wrong, we are pre-standard, and the ladder should have somewhere to go.</p>
<p><strong>Internal service-to-service calls are in scope for this axis.</strong> "Skipping tenant validation for internal services" is a named anti-pattern, and our estate is mostly internal calls — <code>flex-auth</code> calls <code>tenant-engine</code> synchronously on the authorization path. A service identity acting on behalf of a tenant must carry and revalidate tenant context to claim A2 or above.</p>
<h3>4.3 Enforcement (E)</h3>
<div class="breakout"><div class="ladders">
<div class="ladder"><div class="pname">Enforcement<span>plane E</span></div><div class="rungs"><div class="rung r0"><span class="code">E0</span><span class="txt">None. Data not tenant-keyed; separation incidental or absent.</span></div><div class="rung r1"><span class="code">E1</span><span class="txt">Data tenant-keyed, filtering applied per query at call sites.</span></div><div class="rung r2"><span class="code">E2</span><span class="txt">Filtering centralised at a single service-side choke point binding authenticated identity to permitted tenants.</span></div><div class="rung r3"><span class="code">E3</span><span class="txt">E2 <strong>plus</strong> platform-assisted filtering: row-level security keyed on a tenant GUC set transaction-locally, or an equivalent enforced data-access layer.</span></div><div class="rung r4"><span class="code">E4</span><span class="txt">Structural: the credential a workload holds cannot address another tenant's data at all. Requires per-tenant credentials and per-tenant substrate.</span></div></div></div>
</div></div>
<p><strong>Correction from draft-2.</strong> Draft-2 described E3 as something "the application cannot trivially route around". That is false and it was this document overclaiming in exactly the way §6 prohibits. Any session can re-issue <code>SET</code> on a custom GUC, so an attacker with SQL execution can reset the tenant and read across the boundary. What E3 buys is precise, and the ladder must say so:</p>
<div class="scroll"><table class="tm"><thead><tr><th>Threat</th><th>E1</th><th>E2</th><th>E3</th><th>E4</th></tr></thead><tbody><tr><td>A developer forgets a tenant predicate</td><td class="no"></td><td class="yes"></td><td class="yes"></td><td class="yes"></td></tr><tr><td>A new code path bypasses the choke point</td><td class="no"></td><td class="no"></td><td class="yes"></td><td class="yes"></td></tr><tr><td>SQL injection reaching the connection</td><td class="no"></td><td class="no"></td><td class="no"></td><td class="yes"></td></tr><tr><td>The application process is compromised</td><td class="no"></td><td class="no"></td><td class="no"></td><td class="yes"></td></tr></tbody></table></div>
<p>E3 is a strong control against <strong>accident</strong> — the common case, and the one that causes real breaches — and no control at all against <strong>compromise</strong>. Only E4 holds against both, because the credential itself cannot address another tenant's data.</p>
<p><strong>Correction: E3 layers on E2, it does not replace it.</strong> External practice treats application-layer and database-layer filtering as complementary. A service that dropped its choke point on reaching E3 would be <em>worse</em> off, since E3 fails open under injection. Claiming E3 therefore requires the E2 evidence artifact as well.</p>
<p><strong>Correction: the GUC is set transaction-locally.</strong> Draft-2 said "at pool checkout", which is session scope and the wrong instrument. Under a pooler in statement mode, <code>SET</code> leaks between clients and returns other tenants' rows — a failure that appears only under production concurrency and produces no error. Use <code>SET LOCAL</code> inside an explicit transaction.</p>
<p><strong>Platform enforcement is a platform obligation.</strong> Reaching E3 requires the storage platform to <em>offer</em> the mechanism: provisioned policies, a documented GUC contract, and a probe. Where a consumer wants E3 and the platform has not supplied it, the gap is the platform's. §19.6 asks <code>rapp-postgres</code> to define that contract, which must carry <code>FORCE ROW LEVEL SECURITY</code> on every tenant table (without it the table owner bypasses policies silently, and ADR-0001 already established that our migration role owns the tables it creates), no <code>BYPASSRLS</code> on leased roles, <code>SECURITY INVOKER</code> for ordinary logic, and an <code>EXPLAIN</code> comparison because RLS disables functional indexes built on non-leakproof functions.</p>
<p><strong>Default expectation</strong> for a new platform service: E2 at first serve, E3 recorded as target. Services whose cross-tenant exposure would be a reportable breach SHOULD target E3 or above.</p>
<h3>4.4 Placement (P)</h3>
<div class="breakout"><div class="ladders">
<div class="ladder"><div class="pname">Placement<span>plane P</span></div><div class="rungs"><div class="rung r0"><span class="code">P0</span><span class="txt">Shares a database with another consumer.</span></div><div class="rung r1"><span class="code">P1</span><span class="txt">Database per consumer, shared cluster.</span></div><div class="rung r2"><span class="code">P2</span><span class="txt">Dedicated cluster per consumer.</span></div><div class="rung r3"><span class="code">P3</span><span class="txt">Dedicated cluster per tenant.</span></div><div class="rung r4"><span class="code">P4</span><span class="txt">P3 plus separate region or jurisdiction.</span></div></div></div>
</div></div>
<p>Enforcement and placement are independent axes. Plotted together, with where each service actually sits — parenthesised entries are targets or defaults rather than current positions, and <code></code> marks a cell the coupling in §3.2 makes unreachable:</p>
<div class="matrix-shell"><div class="ylab">Enforcement →</div><div class="mgrid"><div class="rlab">E4</div><div class="mcell void"></div><div class="mcell void"></div><div class="mcell void"></div><div class="mcell tint4"><span class="pin ghost">business app</span></div><div class="mcell tint4"></div><div class="rlab">E3</div><div class="mcell tint3"></div><div class="mcell tint3"><span class="pin ghost">target</span></div><div class="mcell tint3"></div><div class="mcell tint3"></div><div class="mcell tint3"></div><div class="rlab">E2</div><div class="mcell tint2"></div><div class="mcell tint2"><span class="pin">tenant-engine</span><span class="pin">audit-core</span></div><div class="mcell tint2"></div><div class="mcell tint2"></div><div class="mcell tint2"></div><div class="rlab">E1</div><div class="mcell tint1"><span class="pin ghost">absorbed repo</span></div><div class="mcell tint1"></div><div class="mcell tint1"></div><div class="mcell tint1"></div><div class="mcell tint1"></div><div class="rlab">E0</div><div class="mcell"></div><div class="mcell"></div><div class="mcell"></div><div class="mcell"></div><div class="mcell"></div><div class="rlab"></div><div class="clab">P0</div><div class="clab">P1</div><div class="clab">P2</div><div class="clab">P3</div><div class="clab">P4</div></div></div><div class="mnote"><span class="k"><span class="sw"></span>Where a service sits today</span><span class="k"><span class="sw g"></span>Target or default</span><span class="k"><span class="sw v"></span>Unreachable at this placement</span></div>
<p><strong>P0 → P1 → P2 is movement along the horizontal axis only.</strong> Those steps buy consumer isolation, capacity predictability, independent retention and a smaller operational blast radius. They do not raise the tenant boundary by one step. Only P3 makes E4 reachable. This is the most misusable fact in the framework and §11 governs how it may be described.</p>
<p><span class="dec">Decision 4.4.1:</span> P1 is the default for platform services; P3 for client-facing business apps, as already ratified. A service unsure which it is must resolve that first (§19.4).</p>
<p><span class="dec">Decision 4.4.2 — placement scopes to data substrate.</span> Identity-provider placement (realm-per-tenant versus Organizations) is the same silo/pool decision on a different substrate, is live in our estate, and is undecided. Realm-per-tenant carries a stated ceiling around 520 tenants, far below our target. Recorded here as a parallel question (§19.7), not folded into P.</p>
<h3>4.5 Retention and erasure (R)</h3>
<p>New in draft-3. Implemented abstractly by the storage platform for any dataset; policy is built on top of that interface by the consumer or its governance layer. Reference implementation: <code>rapp-postgres</code> ADR-0002.</p>
<div class="breakout"><div class="ladders">
<div class="ladder"><div class="pname">Retention<span>plane R</span></div><div class="rungs"><div class="rung r0"><span class="code">R0</span><span class="txt">No retention or deletion position. Data kept indefinitely by default; no deletion path exists.</span></div><div class="rung r1"><span class="code">R1</span><span class="txt">Platform default retention applies (N=30 days). The consumer has declared no requirement.</span></div><div class="rung r2"><span class="code">R2</span><span class="txt">Retention declared as N days per dataset; the <strong>erasure horizon</strong> is published, and the consumer makes no promise shorter than it.</span></div><div class="rung r3"><span class="code">R3</span><span class="txt">Policy-driven deletion: the consumer or its governance layer declares what is due, the platform sweeps whole datasets on that instruction and evidences each run.</span></div><div class="rung r4"><span class="code">R4</span><span class="txt">Verified erasure: data proven unrecoverable across live storage, backups and derived copies, by one of the two routes below.</span></div></div></div>
</div></div>
<p><strong>R4 has two routes and a service MUST name which one it uses.</strong></p>
<div class="scroll"><table><thead><tr><th>Route</th><th>Mechanism</th><th>Cost</th></tr></thead><tbody><tr><td><strong>Horizon-elapsed</strong></td><td>Wait out the published erasure horizon; the data ages out of every retained copy.</td><td>Available to everyone, proves little, and the wait is set by a co-resident's retention requirement rather than your own.</td></tr><tr><td><strong>Key-destroyed</strong></td><td>Encrypt per entity, then destroy the key. Retained copies survive but are unreadable.</td><td>Requires per-entity keys, strong encryption, and an auditable destruction record. Immediate.</td></tr></tbody></table></div>
<p><strong>Regulatory standing of the key-destroyed route, stated carefully because overclaiming here is worse than anywhere else in this framework.</strong> Data protection authorities have accepted key destruction as erasure where physical deletion would be manifestly disproportionate, and the practice is recognised under conditions — strong encryption, irreversible destruction, and an auditable record of it. <strong>The EDPB has not formally endorsed it as Article 17 erasure.</strong> A service reaching R4 by key destruction is making a defensible claim, not a settled one, and must say so rather than reporting a clean "deleted".</p>
<p>Three further properties.</p>
<p><strong>The erasure horizon is the interval between deleting data and it ceasing to be recoverable from anything the platform holds.</strong> Deleting a row does not remove it from yesterday's backup. With an N-day window, deleted data remains recoverable for N days. That is the difference between "deleted" and "erased" and the estate had never written it down.</p>
<p><strong>On shared substrate, retention is not per-consumer.</strong> Physical backup is instance-wide — one WAL stream, one window — so the instance retention is <em>derived</em> as the maximum across co-resident consumers, and every consumer's horizon is that maximum. A consumer declaring 7 days beside one declaring 90 gets 90. This is the retention analogue of ADR-0001's blast-radius disclosure: state the coupling rather than imply an isolation that is not there.</p>
<p><strong>Retention is therefore a placement trigger.</strong> A consumer needing a horizon shorter than the instance floor cannot have one at P1. It moves to P2 for a reason with nothing to do with performance — which is exactly why it needs recording, since nobody looks for a retention argument when reviewing placement.</p>
<p>Deletion splits mechanism from policy. The platform deletes whole <strong>datasets</strong> on instruction and records an opaque policy reference it never interprets, so every deletion traces to what authorised it. Rows are not a dataset: row expiry is the consumer's own DML under its migration lease. Dropping a consumer's whole database is an operator-gated offboarding step, never a scheduled one.</p>
</section>
<section id="s5"><h2><span class="sn">05</span>The posture vector</h2>
<p>A service states one level per axis, plus a target, a date, and any placement exceptions:</p>
<pre>tenancy:
current: { I: 2, A: 3, E: 2, P: 1, R: 1 }
target: { I: 2, A: 3, E: 3, P: 1, R: 2 }
reviewed: &quot;2026-08-17&quot;
gap:
E: &quot;Choke point exists and is tested; RLS not provisioned. Blocked on
rapp-postgres publishing the GUC contract. Target Q4.&quot;
R: &quot;Retention declared; erasure horizon not yet published to consumers.&quot;</pre>
<p><strong>Placement exceptions.</strong> Draft-2 assigned one P level per service, which cannot express the vertically partitioned model — most tenants pooled, some dedicated — that §11's isolation tiers require. A tier requiring <code>P2</code> bought by three tenants would put the service at two levels at once, forcing an over- or under-claim. Placement is therefore declared as a default plus exceptions:</p>
<pre> placement_exceptions:
- tenants: [&quot;tenant:enterprise:*&quot;]
P: 3
reason: &quot;isolation tier; see adaptive-pricing tier definition&quot;</pre>
<p>A service with exceptions must be able to say which tenants are on which substrate. That mapping is a first-class artifact, not archaeology.</p>
<p>Worked examples, best-effort and subject to owner correction:</p>
<div class="scroll"><table><thead><tr><th>Service</th><th>Current</th><th>Notes</th></tr></thead><tbody><tr><td><code>tenant-engine</code></td><td><code>I2 A3 E2 P1 R1</code></td><td>Moving to P1 under TEN-WP-0009; retention declared, horizon not yet published.</td></tr><tr><td><code>audit-core</code></td><td><code>I2 A3 E2 P1 R1</code></td><td>Holds audit evidence, so both E3 and R2 are urgent targets.</td></tr><tr><td>A newly absorbed repo</td><td><code>I1 A1 E1 P0 R0</code></td><td>Conformant <strong>if declared</strong>, with a recorded path.</td></tr></tbody></table></div>
<p><span class="dec">Decision 5.1:</span> the posture vector is declared in the repo, not in the hub, consistent with local-files-are-source-of-truth.</p>
</section>
<section id="s6"><h2><span class="sn">06</span>Conformance is accuracy, not altitude</h2>
<div class="rule-quote"><p><strong>A service is conformant when its declared posture is accurate, its target is recorded, and it does not claim a level it cannot evidence. It is non-conformant when it overclaims — at any altitude.</strong></p></div>
<ul><li>Declaring <code>E0</code> is conformant. Concealing <code>E0</code> is not.</li><li>A repo may be absorbed at any posture. It may not be absorbed silently.</li><li>No service is blocked from the estate for being low on a ladder. Services MAY be blocked from <em>specific work</em> — serving a tenant grouping, holding a data class, carrying a plan tier — by requirements expressed as minimum levels.</li><li>Downgrading is permitted and must be declared. A regression found by guarding is a defect; a regression declared in advance is a decision.</li></ul>
<p>Without the axis separation, "not rigorous about tenant separation" is one verdict a repo passes or fails. With it, the same repo is <code>I1 A1 E1 P0 R0</code> with a path — a plan, not an indictment.</p>
</section>
<section id="s7"><h2><span class="sn">07</span>Portability across placement levels</h2>
<p>Movement between P levels must be operational, not a rebuild:</p>
<ul><li>Connect by injected credential only — no cluster, host, namespace or database name in source.</li><li>Own a whole database, never tables inside someone else's.</li><li>Idempotent schema creation.</li><li>No cross-database joins or co-location assumptions.</li></ul>
<p><span class="dec">Decision 7.1:</span> mandatory at P1 and above. At P3, SHOULD rather than MUST — a per-client instance that never moves is not misconformant for naming its own database.</p>
</section>
<section id="s8"><h2><span class="sn">08</span>Placement triggers</h2>
<p>Recorded at provisioning time: noisy neighbour on a latency-critical path; a compliance or residency requirement; a plan tier requiring a higher minimum; an erasure horizon that no longer fits (§4.5); connection or memory ceiling reached.</p>
<p><span class="dec">Decision 8.1:</span> triggers MUST be <em>monitored</em>, not merely recorded. A trigger in a YAML comment nobody re-reads is documentation, not control.</p>
<p><span class="dec">Decision 8.2:</span> placement policy ownership is proposed to <code>railiance-platform</code>, <strong>co-signed by <code>adaptive-pricing</code></strong>. Tenancy model selection is a commercial decision as much as a technical one; an operations-shaped repo should not hold it alone.</p>
</section>
<section id="s9"><h2><span class="sn">09</span>Credentials as a tenancy control</h2>
<p>Short-lived leased credentials re-read at connection checkout, with overlap-first rotation, bound the residual risk at every E level below E4: a leaked credential expires rather than persisting. Stronger than the industry norm of a long-lived per-service secret.</p>
<p><span class="dec">Decision 9.1:</span> static long-lived database credentials are not a sanctioned path for any service above E0.</p>
</section>
<section id="s10"><h2><span class="sn">10</span>Blast radius must be published</h2>
<p><span class="dec">Decision 10.1:</span> every platform holding consumer data MUST publish, in concrete terms, what a leaked runtime credential can and cannot reach at the levels it operates. <code>rapp-postgres</code> ADR-0001 §5 is the reference. Where the model cannot provide a guarantee, the platform says so and names the escalation.</p>
<p><span class="dec">Decision 10.2 — quotas are disclosed, not discovered.</span> The same obligation extends from what a leaked credential can reach to what the platform will refuse to do for you. Every consumer MUST be told, at provisioning, the throttles and quotas enforced against it — connection limits, statement timeouts, idle-transaction timeouts — and told again when they change. A consumer learning its statement timeout by hitting it in production is a disclosure failure, not a consumer bug. This is how <code>tenant-engine</code> was provisioned, by good practice rather than by rule; the rule now exists.</p>
</section>
<section id="s11"><h2><span class="sn">11</span>Commercial expression</h2>
<ul><li><strong>11.1</strong> Plan tiers are expressed <em>internally</em> as minimum levels. A tier may require <code>E3 P2 R2</code>; it need not print that anywhere customer-facing.</li><li><strong>11.2</strong> Marketing and product language is free. No requirement to expose level labels or this document. "Dedicated infrastructure", "isolated tenancy", "private instance" all remain available.</li><li><strong>11.3</strong> The constraint is on <strong>evidence, not vocabulary</strong>. A customer-facing isolation, availability or retention claim must map to a minimum level the delivering service actually holds, recorded once when the tier is defined. The review is internal and happens at tier definition — not per campaign.</li><li><strong>11.4</strong> Two hard lines, because these reach contracts and compliance questionnaires:</li><li>A claim that another tenant <strong>cannot</strong> reach the customer's data requires <strong>E4</strong>.</li><li>A claim that deleted data <strong>is gone</strong> requires <strong>R4</strong>, or an erasure horizon disclosed alongside it. Where R4 is reached by key destruction, the claim is defensible but not settled law (§4.5) — it may be made, and it may not be made in language that implies a regulator has blessed it.</li></ul>
</section>
<section id="s12"><h2><span class="sn">12</span>Methodology — analyze, establish, improve, guard</h2>
<p><strong>Analyze.</strong> Assess a repo against the ladders; produce <code>tenancy.current</code> with reasoning recorded. Applies to new and absorbed services alike.</p>
<p><strong>Establish.</strong> Declare the target and gap. The target is set by data class, tenant groupings served and plan tiers carried — not by ambition.</p>
<p><strong>Improve.</strong> Move one axis at a time. Raising P while leaving E untouched is the characteristic misstep.</p>
<p><strong>Guard.</strong> Verify continuously that the declared posture holds — <strong>against the service's own declaration</strong>, not a universal maximum. Nobody must prove every service is at E4; the check is that none is below what it declared.</p>
<p>Regression found by guarding is a defect; regression declared in advance is a decision. The estate has been bitten twice by silent pin rollbacks producing ordinary-looking 403s and 404s rather than errors. Posture regression looks the same — an RLS context leak returns correct-looking rows for the wrong tenant. Guarding must be designed for invisible failure, not for crashes.</p>
</section>
<section id="s13"><h2><span class="sn">13</span>Evidence per level</h2>
<p><span class="dec">Decision 13.1:</span> a level is claimed only with its evidence artifact present. This turns §6's accuracy rule from an honour system into a check.</p>
<p><span class="dec">Decision 13.4 — an artifact must assert something achievable.</span> Draft-3's noisy-neighbour evidence required proof that a saturating consumer "does not breach" another's allowance. Shared infrastructure cannot provide that; the risk is inherent and cannot be wholly removed. An artifact that can only fail, or that passes by being run gently enough, is an overclaim wearing the costume of evidence. Where a property cannot be guaranteed, the artifact measures and records it instead.</p>
<p><span class="dec">Decision 13.2 — evidence is of two kinds, and conflating them is an overclaim.</span> <em>Mechanical</em> evidence is a structural assertion a machine can make and belongs in CI. <em>Adversarial</em> evidence is semantic, requires setting up separate tenant contexts and comparing responses, and carries a review date rather than a green build. Cross-tenant findings are the category external testing practice identifies as needing human review. <strong>A passing CI run is not E2 evidence.</strong></p>
<div class="scroll"><table><thead><tr><th>Level</th><th>Evidence</th><th>Kind</th></tr></thead><tbody><tr><td><strong>I2</strong></td><td>Identifiers validated against the vocabulary; rejection test for a malformed id; binding shown to come from a verified token</td><td><span class="kind ">Mechanical</span></td></tr><tr><td><strong>I3</strong></td><td>Live re-query demonstrated on an <code>aal2</code>-class path; cached-claim path shown unused there</td><td><span class="kind ">Mechanical</span></td></tr><tr><td><strong>A2</strong></td><td>Choke point identified; test that an unbound request is refused</td><td><span class="kind ">Mechanical</span></td></tr><tr><td><strong>A3</strong></td><td>Live decision with a denial observed at the endpoint, not only at the decision surface</td><td><span class="kind ">Mechanical</span></td></tr><tr><td><strong>A4</strong></td><td>Decision served over the standard interface; a second PDP substituted without PEP change</td><td><span class="kind ">Mechanical</span></td></tr><tr><td><strong>E1</strong></td><td>Every tenant-owned table carries the tenant key</td><td><span class="kind ">Mechanical</span></td></tr><tr><td><strong>E2</strong></td><td>Choke point identified; identity bound to tenant A demonstrably cannot read tenant B</td><td><span class="kind adv">Adversarial, with a review date</span></td></tr><tr><td><strong>E3</strong></td><td><code>FORCE ROW LEVEL SECURITY</code> on every tenant table; no <code>BYPASSRLS</code> on leased roles; probe that a session without the GUC reads nothing; probe that a wrong GUC reads nothing; <code>EXPLAIN</code> comparison</td><td><span class="kind ">Mechanical</span></td></tr><tr><td><strong>E4</strong></td><td>Per-tenant credential demonstrated unable to connect to another tenant's substrate</td><td><span class="kind ">Mechanical</span></td></tr><tr><td><strong>P1P4</strong></td><td>Provisioning declaration plus the platform's isolation probes</td><td><span class="kind ">Mechanical</span></td></tr><tr><td><strong>P1P2 (noisy neighbour)</strong></td><td>A recorded baseline of per-consumer resource usage; a run in which one consumer saturates its declared allowance; evidence that the governance controls <strong>bind</strong> (the greedy consumer is held at its limits) and that the degradation co-residents experience is <strong>measured, recorded and judged acceptable</strong>; the aggregate headroom at time of measurement</td><td><span class="kind adv">Adversarial, load-generated, with a review date</span></td></tr><tr><td><strong>R2</strong></td><td>Declared retention rendered; erasure horizon published and reported in the operator surface</td><td><span class="kind ">Mechanical</span></td></tr><tr><td><strong>R3</strong></td><td>Sweep evidence records: timestamp, dataset, identifiers removed, authorising policy reference</td><td><span class="kind ">Mechanical</span></td></tr><tr><td><strong>R4</strong></td><td>Erasure demonstrated across live data, backups and derived copies within the horizon</td><td><span class="kind adv">Adversarial</span></td></tr></tbody></table></div>
<p><span class="dec">Decision 13.3:</span> the E2, E3 and noisy-neighbour artifacts do not exist anywhere in the estate today. <code>rapp-postgres</code> runs 15 adversarial probes, all against the <em>consumer</em> boundary, none against the tenant boundary inside a consumer. Externally, what this framework calls a tenant boundary failure is <strong>Broken Object Level Authorization</strong> — OWASP API1, top of the API Security Top 10 since that list launched, and the most commonly exploited API vulnerability in published assessments. We have no coverage for the highest-ranked risk in our class of system. §19.3 seeks an owner.</p>
</section>
<section id="s14"><h2><span class="sn">14</span>Adoption stance — structure, not tooling</h2>
<p><span class="dec">Decision 14.1:</span> external research is design input. This estate adopts published standards and structural patterns; it does not adopt tooling unless that tooling is an established industry standard with broad application. Everything else is built ground-up, so it can be optimised and refactored as the estate sees fit.</p>
<div class="scroll"><table><thead><tr><th>Class</th><th>Stance</th></tr></thead><tbody><tr><td>Security baselines (OWASP Multi-Tenant Security Cheat Sheet, API Security Top 10)</td><td>Adopt as the external reference our ladders answer to</td></tr><tr><td>Standards bodies (OpenID AuthZEN 1.0)</td><td>Adopt — this is what A4 is</td></tr><tr><td>Reference taxonomies (Azure tenancy models, AWS SaaS Lens, cell architecture)</td><td>Adopt as structure</td></tr><tr><td>Engine behaviour (PostgreSQL RLS mechanics)</td><td>Facts, not tooling</td></tr><tr><td>Third-party analyzers and test frameworks</td><td><strong>Do not adopt.</strong> Take their rule taxonomies as checklists for probes we write ourselves</td></tr></tbody></table></div>
<p>The practical effect is small and good: <code>rapp-postgres</code> already owns a ground-up probe harness — bash and psql, no dependency tree — that found four real defects in its own provisioning SQL. The evidence artifacts in §13 become new probes in a tool we control. One idea worth reimplementing from the external survey is <strong>policy-diff classification</strong>: labelling a change to an enforcement policy as safe or breaking <em>before</em> it lands.</p>
</section>
<section id="s15"><h2><span class="sn">15</span>Alternatives considered</h2>
<p><strong>One fixed model with a single set of characteristics</strong> (draft-1). <em>Rejected:</em> cannot describe a repo that is not there yet, forcing absorbed repos to misrepresent their posture or stay outside. A framework that can only describe its own end state is not a framework.</p>
<p><strong>A maturity model with a single overall level.</strong> <em>Rejected:</em> collapses the axis separation. A service strong on identity and weak on enforcement has a specific, actionable gap; one composite score hides it and invites averaging.</p>
<p><strong>Prohibiting row-level security</strong> (draft-2's inherited position). <em>Rejected in draft-2, refined in draft-3:</em> RLS is a real rung against the common threat. The error was never RLS — it was describing E3 in E4's language.</p>
<p><strong>Schema-per-consumer in one database.</strong> <em>Rejected:</em> <code>pg_catalog</code> is readable per-database, so every co-resident enumerates every other's table and column names regardless of grants. Retained as a describable state, never a target.</p>
<p><strong>Mandating E4 for everyone.</strong> <em>Rejected:</em> the tenant taxonomy includes <code>consumer</code> (private individuals) and <code>family</code>. A cluster per private individual is economically impossible; the taxonomy is itself evidence pooling is required.</p>
<p><strong>Per-consumer physical backup retention.</strong> <em>Rejected:</em> CNPG retention is a property of the instance's WAL archive. There is no mechanism, and claiming it would be a fabricated guarantee. Hence the derived maximum in §4.5.</p>
<p><strong>Platform-scheduled row expiry.</strong> <em>Rejected:</em> requires the platform to hold DML authority over consumer schemas and interpret consumer data semantics, both forbidden by ADR-0001. The consumer's migration lease is the correct instrument.</p>
<p><strong>Leaving each repo to its own model.</strong> <em>Rejected:</em> the status quo, which produced two contradictory ratified defaults and an unowned placement question.</p>
</section>
<section id="s16"><h2><span class="sn">16</span>Held against outside practice</h2>
<p><strong>The graduated reframe is corroborated, not invented here.</strong> Microsoft's tenancy-model guidance states it almost verbatim: <em>"Instead of viewing isolation as a discrete property, consider it a spectrum. You can deploy components of your architecture that are more isolated or less isolated than other components in the same architecture."</em> The same guidance derives our E↔P coupling independently — shared deployment means enforcement lives in application code; dedicated deployment means it is structural.</p>
<p><strong>Stronger than typical.</strong> Most multi-tenancy literature models one boundary, tenant-to-tenant. This estate has <strong>two stacked boundaries</strong>: platform-service to platform-service, and tenant to tenant inside a consumer. Naming them separately and refusing to enforce both with one mechanism is uncommon and correct. Graduated per-axis levels also beat the silo/pool/bridge trichotomy, which is approximately our P axis with the other four missing — which is why it cannot express "pooled infrastructure, structurally enforced boundary".</p>
<p><strong>Weaker than typical.</strong> The pool model's standard mitigation is a <em>verified</em> enforcement layer every service is demonstrably routed through. We have the concept and none of the verification (§13.3).</p>
<p><strong>Adopted without naming it.</strong> Short-lived leased credentials re-read at checkout beat the long-lived-secret norm. §9 promotes it to a tenancy control.</p>
<p><strong>Still unexplored.</strong> Neither P nor R describes a <strong>cell</strong> — a slice of infrastructure with a <em>fixed maximum size</em>, sized so one cell's failure is survivable and cell count scales linearly. <code>platform-pg</code> is, in these terms, an uncapped cell: §17 computes a ceiling and nothing enforces it (§19.8).</p>
<p>Sources: the four research digests in <code>research/2026-08-17-adr008-*</code>, which carry full citations for every claim in this section.</p>
</section>
<section id="s17"><h2><span class="sn">17</span>Scaling demands</h2>
<p>Measured against the live <code>platform-pg</code> specification, not estimated.</p>
<pre>instances: 1 (no HA; single-node rail)
max_connections: 100
memory limit: 1Gi
per consumer: 14 connections (12 runtime + 2 migration)</pre>
<p><strong>Connection ceiling: roughly six consumers — and this is the aggregate noisy-neighbour bound, not a capacity statistic.</strong> Seven consumers request 98 of 100 before CNPG's instance manager, metrics exporter and reserved slots. Every one of them is politely inside its declared 14-connection allowance; the instance still fails.</p>
<p>That distinction matters because our governance addresses the wrong shape. Per-consumer <code>connection_limit</code>, <code>statement_timeout</code> and <code>idle_in_transaction_session_timeout</code> guard well against <strong>one greedy consumer</strong>. They do nothing about <strong>the aggregate of many modest ones</strong>, which is the second and less intuitive noisy-neighbour failure and the one this number describes. Two consumers are provisioned. We are at roughly a third of the bound, and the third request will not feel like a scaling event.</p>
<p><strong>Memory likely binds first.</strong> 100 backends against 1Gi is ~10MB per backend. Connection exhaustion errors clearly; memory pressure OOM-kills and degrades every co-resident at once.</p>
<p><strong>E3 and pooling.</strong> <em>Corrected from draft-2, which had this backwards.</em> Transaction-scoped context (<code>SET LOCAL</code> inside an explicit transaction) is what makes E3 <strong>safe</strong> under a pooler. Statement-level pooling is what breaks it, serving other tenants' rows under concurrency with no error. E3 constrains which pooling mode is available, not whether pooling is available.</p>
<p><strong>Retention consumes the volume.</strong> WAL accumulates with the window, and §4.5 makes the window the maximum across consumers. A consumer declaring a long retention extends everyone's horizon <em>and</em> everyone's storage draw against a 20Gi volume.</p>
<p><strong>Restore time couples all consumers.</strong> Physical backup is instance-wide, so a consumer's RTO is a function of <em>total</em> instance size, not its own.</p>
<p><strong>No P1 tenant has HA.</strong> <code>instances: 1</code> means a tier promising uptime cannot be satisfied at P1 as built — an availability floor belongs in §11's minimum-level vocabulary alongside isolation.</p>
</section>
<section id="s18"><h2><span class="sn">18</span>Consequences</h2>
<ul><li>The estate gains one vocabulary and a way to be honest about partial adoption.</li><li>Absorbed repos get a described state and a path instead of a failing grade.</li><li><code>tenantIsolation</code> in <code>PostgresConsumer</code> is revealed as a mislabelled field.</li><li>The verification problem becomes tractable: guard against declaration.</li><li>Draft-2's RLS prohibition is reversed and its E3 description corrected; <code>rapp-postgres</code> acquires an obligation to define and offer the mechanism.</li><li>Adding a consumer with long retention <strong>silently extends everyone's erasure horizon</strong>. This must reach the consumer review checklist, not only this document.</li><li>A service selling an isolation tier must maintain a tenant→substrate mapping it does not have today.</li><li>Nothing here changes a running system.</li></ul>
</section>
<section id="s19"><h2><span class="sn">19</span>Open questions</h2>
<ol><li><strong><code>tenantIsolation</code> field</strong><code>rapp-postgres</code>: rename to name its axis and carry a level (<code>tenancy.E: 2</code>), or move it out of the storage declaration.</li><li><strong>Placement ownership</strong><code>railiance-platform</code> with <code>adaptive-pricing</code>: accept the ladder, triggers and the §8.1 monitoring obligation; appoint a recorded placement owner per workload.</li><li><strong>E2, E3 and noisy-neighbour evidence</strong><em>owner needed.</em> Now three artifacts of two kinds: E3 and noisy-neighbour are buildable as probes in the existing harness; E2 is adversarial and needs a review cadence. Both <code>audit-core</code> and <code>tenant-engine</code> have declined fleet-scope work on correct boundary reasoning, so this needs appointing. Highest-severity gap.</li><li><strong>Business app vs platform service</strong> — Custodian canon: a classification rule. Candidate: reuse <code>repo-classification-standard_v1.0</code>.</li><li><strong>Tier → minimum level mapping</strong><code>adaptive-pricing</code> and <code>tenant-engine</code>: required only for tiers making isolation, availability or retention claims.</li><li><strong>The E3 mechanism</strong><code>rapp-postgres</code>: publish the GUC contract with the <code>FORCE</code>/<code>BYPASSRLS</code>/<code>SECURITY INVOKER</code>/<code>EXPLAIN</code> requirements in §4.3.</li><li><strong>Identity-provider placement</strong> — owner of <code>key-cape</code>: realm-per-tenant or Organizations? Realm-per-tenant's ~520 tenant ceiling is below our target.</li><li><strong>Cell sizing</strong> — reframed from "should we adopt cells" to <strong>"what is <code>platform-pg</code>'s declared maximum size, and what is the overflow target?"</strong> The connection ceiling forces this whether or not we adopt the vocabulary.</li><li><strong>Retention floor and ceiling</strong> — should <code>backupRetentionDays</code> have a platform minimum (so a consumer asking for 1 day gets a validation error rather than a quiet disappointment) and a maximum (so nobody exhausts the volume)?</li><li><strong>Engine neutrality</strong> — the P ladder rests on a PostgreSQL property. State it engine-specifically and say so, or abstract it and risk a non-Postgres implementation that silently differs?</li><li><strong>Erasure versus audit</strong><code>audit-core</code>: crypto-shredding a tenant's audit records destroys the evidence the service exists to hold, and ADR-0001 §2 deliberately built the role model so history could not be rewritten. The usual resolution separates the <em>fact</em> of an event, retained, from its <em>personal payload</em>, encrypted per subject and shreddable. Raised because a naive "R4 everywhere" target would instruct the audit service to destroy its own evidence. The answer is <code>audit-core</code>'s, not this framework's.</li><li><strong>Quality of service</strong><em>owner needed.</em> The framework has no vocabulary for saying one consumer's latency matters more than another's. <code>tenant-engine</code> sits on <code>flex-auth</code>'s synchronous authorization path and chose a 5s statement timeout for that reason; it shares an instance with <code>audit-core</code>, which is not latency-critical. Nothing prioritises between them. Either add a QoS dimension or state that all co-residents are equal and latency-critical consumers must escalate to P2.</li></ol>
<p><strong>Routed elsewhere, deliberately.</strong> The tenant identifier <code>tenant:&lt;grouping&gt;:&lt;name&gt;</code> embeds headcount bands (<code>small</code>, <code>medium</code>, <code>large</code>) that change as a tenant grows, contradicting the consensus that identifiers should not encode mutable attributes. That is a critique of ADR-0013, not of this framework, and belongs to <code>tenant-engine</code> and NetKingdom canon. Folding it in here would overreach.</p>
</section>
<section id="s20"><h2><span class="sn">20</span>Ratification path</h2>
<ol><li>Reviewed by <code>tenant-engine</code>, <code>flex-auth</code>, <code>rapp-postgres</code>, <code>railiance-platform</code> and <code>adaptive-pricing</code> against §19.</li><li>Each publishes its own posture vector (§5) as part of review. <strong>The framework is validated by whether it can describe them accurately</strong> — if a repo cannot express itself in these five ladders, the ladders are wrong and this document changes, not the repo.</li><li>On acceptance, <strong>supersedes</strong> the routing of <code>rapp-postgres/docs/canon-drafts/shared-platform-relational-storage_v0.1-draft.md</code>, whose §§38 are absorbed here. That draft is withdrawn rather than left pending.</li><li>On acceptance, <code>rapp-postgres</code> ADR-0001 and ADR-0002 move to <code>accepted</code> and are annotated as the PostgreSQL implementation of the E, P and R ladders.</li></ol>
</section><footer><span>netkingdom-tenancy-posture · draft-5 · proposed</span><span>generated from the-custodian/canon</span></footer></main></div></div>

38
deploy/nginx.conf Normal file
View file

@ -0,0 +1,38 @@
map $uri $policy_cache_control {
default "no-cache";
~^/standards/.+/revisions/ "public, max-age=31536000, immutable";
}
server {
listen 8080 default_server;
listen [::]:8080 default_server;
server_name _;
server_tokens off;
absolute_redirect off;
root /usr/share/nginx/html;
index index.html;
charset utf-8;
etag on;
add_header Cache-Control $policy_cache_control always;
add_header Content-Security-Policy "default-src 'none'; style-src 'unsafe-inline'; img-src 'self' data:; font-src 'self'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'" always;
add_header Permissions-Policy "camera=(), geolocation=(), microphone=()" always;
add_header Referrer-Policy "no-referrer" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "DENY" always;
location = /healthz {
access_log off;
default_type text/plain;
return 200 "ok\n";
}
location = /tenancy-posture.html {
return 308 /standards/tenancy-posture/v0.1/index.html;
}
location / {
try_files $uri $uri/ $uri/index.html =404;
}
}

View file

@ -0,0 +1,60 @@
# ADR-0001 — policy addressing and permanence
- Status: accepted
- Date: 2026-08-18
- Owner: the-custodian
## Decision
A document has one stable current address and immutable revision addresses:
```text
/<kind>/<document>/<version>/
/<kind>/<document>/<version>/revisions/<revision>/
```
The publication manifest records both. Existing public paths become permanent
redirect aliases; the first is `/tenancy-posture.html`. No URL is derived from
a checkout path, branch name, build number or hosting implementation.
The current address advances only when the owning source publishes a new
revision. A revision address is write-once: the builder records the exact git
commit (or commit plus working-tree marker) and the full source-content digest.
It refuses to replace that revision with different content. Committing the
same bytes may update the current page's provenance but does not rewrite the
already-published revision page. The generated publication manifest makes the
source repository, path, revision and digest machine-readable.
Superseded and withdrawn documents are never deleted. The current page gains a
status banner and link to its successor; every historical revision continues
to resolve. “Withdrawn” means retained and visibly non-current. Deletion is not
a lifecycle state.
Source Git history remains the authority for versions that predate this site.
Once a revision is published, the built revision page is also retained by the
hosting artifact/release. Rollback republishes a previous complete build; it
does not rebuild old pages from a changed working tree.
## Permanence promise
A published URL is expected to resolve indefinitely. Breaking that promise
requires an explicit the-custodian decision plus a redirect/export plan. A DNS,
hosting or repository migration does not qualify: those must preserve paths.
This repo owns addressing, rendering and currency. It does not decide whether
a draft is accepted; ratification belongs to the canon owner/the-custodian.
## Publication scope
Canon `standards`, `architecture`, and `constitution` are in scope. `values`,
`tpsc`, and `projects` are out until their owner marks individual documents as
governing. Per-repo ADRs are in scope through explicit manifest entries.
Workplans, evidence, runbooks and general docs are not.
## Consequences
- Builds fail if a source disappears, an id differs, a path collides, or an
immutable revision would change; stale output is not silently called fresh.
- Pages show status, revision, owner, last review and exact source revision.
- Availability remains restart recovery on the single-node rail. This contract
promises stable addressing, not a high-availability SLA.

30
publication.json Normal file
View file

@ -0,0 +1,30 @@
{
"schema_version": 1,
"site": {
"title": "Coulomb Policy Nexus",
"base_url": "https://policy.coulomb.social"
},
"canon_scope": {
"standards": true,
"architecture": true,
"constitution": true,
"values": false,
"tpsc": false,
"projects": false
},
"repositories": {
"net-kingdom": {"path": "../net-kingdom"}
},
"documents": [
{
"id": "netkingdom-tenancy-posture",
"source_repo": "net-kingdom",
"source_path": "canon/standards/tenancy-posture_v0.1.md",
"canonical_path": "standards/tenancy-posture/v0.1/index.html",
"revision_path": "standards/tenancy-posture/v0.1/revisions/{revision}/index.html",
"legacy_paths": ["tenancy-posture.html"],
"subtitle": "A framework for describing, holding and improving multi-tenancy — including where we are not there yet.",
"review_interval": "6m"
}
]
}

197
tests/test_publication.py Normal file
View file

@ -0,0 +1,197 @@
from __future__ import annotations
import importlib.util
import json
import datetime as dt
import os
from pathlib import Path
import sys
import tempfile
import unittest
from unittest import mock
ROOT = Path(__file__).parents[1]
sys.path.insert(0, str(ROOT / "tools"))
SPEC = importlib.util.spec_from_file_location("build_site", ROOT / "tools/build_site.py")
build_site = importlib.util.module_from_spec(SPEC)
assert SPEC.loader is not None
SPEC.loader.exec_module(build_site)
def _fixture(tmp_path: Path) -> Path:
repo = tmp_path / "canon-repo"
source = repo / "canon/standards/example.md"
source.parent.mkdir(parents=True)
source.write_text(
"""---
id: example
title: "Example Standard"
status: proposed
revision: "draft-1"
owner: example-owner
last_reviewed: "2026-08-18"
review_interval: 6m
---
# Example
## 1. Rule
| Level | Meaning |
| --- | --- |
| **V0** | No position. |
| **V1** | Restart recovery. |
""",
encoding="utf-8",
)
manifest = tmp_path / "publication.json"
manifest.write_text(
json.dumps(
{
"schema_version": 1,
"site": {"title": "Test", "base_url": "https://example.invalid"},
"repositories": {"canon": {"path": "canon-repo"}},
"documents": [
{
"id": "example",
"source_repo": "canon",
"source_path": "canon/standards/example.md",
"canonical_path": "standards/example/v1/index.html",
"revision_path": "standards/example/v1/revisions/{revision}/index.html",
"legacy_paths": ["example.html"],
"review_interval": "6m",
}
],
}
),
encoding="utf-8",
)
return manifest
class PublicationTest(unittest.TestCase):
def test_archive_build_accepts_only_exact_source_revision_override(self) -> None:
with tempfile.TemporaryDirectory() as directory:
root = Path(directory)
repo = root / "net-kingdom"
source = repo / "canon/example.md"
source.parent.mkdir(parents=True)
source.write_text("example", encoding="utf-8")
key = "POLICY_NEXUS_SOURCE_REVISION_NET_KINGDOM"
with mock.patch.dict(os.environ, {key: "a" * 40}):
self.assertEqual("a" * 40, build_site._source_revision(repo, source))
with mock.patch.dict(os.environ, {key: "main"}):
with self.assertRaisesRegex(ValueError, "clean 40-hex Git commit"):
build_site._source_revision(repo, source)
def test_manifest_builds_index_current_revision_and_legacy_alias(self) -> None:
with tempfile.TemporaryDirectory() as directory:
root = Path(directory)
manifest = _fixture(root)
output = root / "site"
records = build_site.build(manifest, output, as_of=dt.date(2026, 8, 18))
self.assertEqual("2027-02-18", records[0]["review_due"])
self.assertTrue((output / "index.html").is_file())
current = (output / "standards/example/v1/index.html").read_text(
encoding="utf-8"
)
revision = output / "standards/example/v1/revisions/draft-1/index.html"
self.assertIn("Availability", current)
self.assertIn("policy-source-revision", current)
self.assertIn("policy-source-digest", current)
self.assertIn("Review due: 2027-02-18", current)
self.assertEqual(revision.read_text(encoding="utf-8"), current)
self.assertIn(
"/standards/example/v1/index.html",
(output / "example.html").read_text(encoding="utf-8"),
)
def test_revision_address_refuses_changed_source_under_same_revision(self) -> None:
with tempfile.TemporaryDirectory() as directory:
root = Path(directory)
manifest = _fixture(root)
output = root / "site"
build_site.build(manifest, output, as_of=dt.date(2026, 8, 18))
source = root / "canon-repo/canon/standards/example.md"
source.write_text(
source.read_text(encoding="utf-8") + "\nChanged.\n", encoding="utf-8"
)
with self.assertRaisesRegex(RuntimeError, "immutable revision"):
build_site.build(manifest, output, as_of=dt.date(2026, 8, 18))
def test_same_content_can_move_from_worktree_to_commit_provenance(self) -> None:
with tempfile.TemporaryDirectory() as directory:
root = Path(directory)
manifest = _fixture(root)
output = root / "site"
build_site.build(manifest, output, as_of=dt.date(2026, 8, 18))
revision = output / "standards/example/v1/revisions/draft-1/index.html"
original = revision.read_text(encoding="utf-8")
original_source_revision = build_site._source_revision
try:
build_site._source_revision = lambda _repo, _source: "new-commit"
build_site.build(manifest, output, as_of=dt.date(2026, 8, 18))
finally:
build_site._source_revision = original_source_revision
self.assertEqual(original, revision.read_text(encoding="utf-8"))
current = (output / "standards/example/v1/index.html").read_text(
encoding="utf-8"
)
self.assertIn('policy-source-revision" content="new-commit', current)
def test_stale_and_superseded_notices_do_not_mutate_revision_page(self) -> None:
with tempfile.TemporaryDirectory() as directory:
root = Path(directory)
manifest = _fixture(root)
document = json.loads(manifest.read_text(encoding="utf-8"))
document["documents"][0]["lifecycle"] = "superseded"
document["documents"][0]["successor"] = "/standards/example/v2/"
manifest.write_text(json.dumps(document), encoding="utf-8")
output = root / "site"
build_site.build(manifest, output, as_of=dt.date(2027, 2, 19))
current = (output / "standards/example/v1/index.html").read_text(
encoding="utf-8"
)
revision = (
output / "standards/example/v1/revisions/draft-1/index.html"
).read_text(encoding="utf-8")
self.assertIn("Superseded.", current)
self.assertIn("Review overdue.", current)
self.assertNotIn("Superseded.", revision)
self.assertNotIn("Review overdue.", revision)
def test_manifest_rejects_unsafe_publication_path(self) -> None:
with tempfile.TemporaryDirectory() as directory:
root = Path(directory)
manifest = _fixture(root)
document = json.loads(manifest.read_text(encoding="utf-8"))
document["documents"][0]["canonical_path"] = "../escape.html"
manifest.write_text(json.dumps(document), encoding="utf-8")
with self.assertRaisesRegex(ValueError, "unsafe publication path"):
build_site.load_manifest(manifest)
def test_build_rejects_missing_publication_owner(self) -> None:
with tempfile.TemporaryDirectory() as directory:
root = Path(directory)
manifest = _fixture(root)
source = root / "canon-repo/canon/standards/example.md"
source.write_text(
source.read_text(encoding="utf-8").replace(
"owner: example-owner\n", ""
),
encoding="utf-8",
)
with self.assertRaisesRegex(ValueError, "owner is required"):
build_site.build(manifest, root / "site")
if __name__ == "__main__":
unittest.main()

106
tests/test_release.py Normal file
View file

@ -0,0 +1,106 @@
from __future__ import annotations
import hashlib
import json
from pathlib import Path
import sys
import tempfile
import unittest
ROOT = Path(__file__).parents[1]
sys.path.insert(0, str(ROOT / "tools"))
from verify_release import verify
COMMIT = "1" * 40
SOURCE_DIGEST = "2" * 64
def _page(revision: str = COMMIT, digest: str = SOURCE_DIGEST) -> str:
return (
'<!doctype html><meta name="policy-source-revision" '
f'content="{revision}"><meta name="policy-source-digest" content="{digest}">'
)
def _release(root: Path) -> Path:
build = root / "build"
canonical = build / "standards/example/v1/index.html"
revision = build / "standards/example/v1/revisions/draft-1/index.html"
canonical.parent.mkdir(parents=True)
revision.parent.mkdir(parents=True)
canonical.write_text(_page(), encoding="utf-8")
revision.write_text(_page(), encoding="utf-8")
(build / "index.html").write_text("<!doctype html>", encoding="utf-8")
manifest = {
"schema_version": 1,
"generated_as_of": "2026-08-18",
"documents": [
{
"id": "example",
"title": "Example Standard",
"status": "proposed",
"revision": "draft-1",
"owner": "example-owner",
"last_reviewed": "2026-08-18",
"review_due": "2027-02-18",
"canonical_path": "standards/example/v1/index.html",
"revision_path": "standards/example/v1/revisions/draft-1/index.html",
"source_revision": COMMIT,
"source_digest": SOURCE_DIGEST,
}
],
}
(build / "publication-manifest.json").write_text(
json.dumps(manifest, sort_keys=True) + "\n", encoding="utf-8"
)
return build
class ReleaseVerificationTest(unittest.TestCase):
def test_accepts_clean_provenance_and_returns_manifest_digest(self) -> None:
with tempfile.TemporaryDirectory() as directory:
build = _release(Path(directory))
evidence = verify(build)
expected = hashlib.sha256(
(build / "publication-manifest.json").read_bytes()
).hexdigest()
self.assertEqual(expected, evidence["publication_manifest_digest"])
self.assertEqual(["example"], evidence["documents"])
def test_rejects_working_tree_source_revision(self) -> None:
with tempfile.TemporaryDirectory() as directory:
build = _release(Path(directory))
manifest_path = build / "publication-manifest.json"
manifest = json.loads(manifest_path.read_text(encoding="utf-8"))
dirty = COMMIT + "+working-tree." + SOURCE_DIGEST[:12]
manifest["documents"][0]["source_revision"] = dirty
manifest_path.write_text(json.dumps(manifest), encoding="utf-8")
canonical = build / manifest["documents"][0]["canonical_path"]
canonical.write_text(_page(revision=dirty), encoding="utf-8")
with self.assertRaisesRegex(ValueError, "clean 40-hex Git commit"):
verify(build)
def test_rejects_immutable_revision_built_from_dirty_source(self) -> None:
with tempfile.TemporaryDirectory() as directory:
build = _release(Path(directory))
revision = build / "standards/example/v1/revisions/draft-1/index.html"
revision.write_text(
_page(revision=COMMIT + "+working-tree." + SOURCE_DIGEST[:12]),
encoding="utf-8",
)
with self.assertRaisesRegex(ValueError, "immutable revision page"):
verify(build)
def test_rejects_page_digest_mismatch(self) -> None:
with tempfile.TemporaryDirectory() as directory:
build = _release(Path(directory))
canonical = build / "standards/example/v1/index.html"
canonical.write_text(_page(digest="3" * 64), encoding="utf-8")
with self.assertRaisesRegex(ValueError, "provenance differs"):
verify(build)
if __name__ == "__main__":
unittest.main()

300
tools/build_site.py Normal file
View file

@ -0,0 +1,300 @@
#!/usr/bin/env python3
"""Build the policy site atomically from an explicit source manifest."""
from __future__ import annotations
import argparse
import datetime as dt
import hashlib
import html
import json
import os
from pathlib import Path, PurePosixPath
import re
import shutil
import subprocess
import tempfile
from typing import Any
from render import STYLE, render_page, split_frontmatter
SOURCE_REVISION = re.compile(
r'<meta name="policy-source-revision" content="([^"]+)">'
)
SOURCE_DIGEST = re.compile(r'<meta name="policy-source-digest" content="([^"]+)">')
CLEAN_GIT_REVISION = re.compile(r"^[a-f0-9]{40}$")
def _safe_path(value: str) -> PurePosixPath:
path = PurePosixPath(value)
if path.is_absolute() or ".." in path.parts or not path.parts:
raise ValueError(f"unsafe publication path: {value!r}")
return path
def _source_revision(repo: Path, source: Path) -> str:
digest = hashlib.sha256(source.read_bytes()).hexdigest()
revision_env = "POLICY_NEXUS_SOURCE_REVISION_" + re.sub(
r"[^A-Z0-9]+", "_", repo.name.upper()
)
supplied_revision = os.environ.get(revision_env, "")
if supplied_revision:
if not CLEAN_GIT_REVISION.fullmatch(supplied_revision):
raise ValueError(
f"{revision_env} must be a clean 40-hex Git commit, got {supplied_revision!r}"
)
return supplied_revision
try:
head = subprocess.run(
["git", "-C", str(repo), "rev-parse", "HEAD"],
check=True,
capture_output=True,
text=True,
).stdout.strip()
relative = source.relative_to(repo)
dirty = subprocess.run(
["git", "-C", str(repo), "status", "--porcelain", "--", str(relative)],
check=True,
capture_output=True,
text=True,
).stdout.strip()
return f"{head}+working-tree.{digest[:12]}" if dirty else head
except (OSError, subprocess.CalledProcessError, ValueError):
return f"sha256:{digest}"
def _add_interval(reviewed: str, interval: str) -> dt.date:
date = dt.date.fromisoformat(reviewed)
match = re.fullmatch(r"([1-9][0-9]*)([dmy])", interval)
if not match:
raise ValueError(f"invalid review interval {interval!r}; expected Nd, Nm or Ny")
amount, unit = int(match.group(1)), match.group(2)
if unit == "d":
return date + dt.timedelta(days=amount)
months = amount * (12 if unit == "y" else 1)
month_index = date.month - 1 + months
year, month = date.year + month_index // 12, month_index % 12 + 1
month_lengths = (31, 29 if year % 4 == 0 and (year % 100 != 0 or year % 400 == 0) else 28,
31, 30, 31, 30, 31, 31, 30, 31, 30, 31)
return date.replace(year=year, month=month, day=min(date.day, month_lengths[month - 1]))
def load_manifest(path: Path) -> dict[str, Any]:
manifest = json.loads(path.read_text(encoding="utf-8"))
if manifest.get("schema_version") != 1:
raise ValueError("publication manifest schema_version must be 1")
if not manifest.get("documents"):
raise ValueError("publication manifest has no documents")
seen: set[PurePosixPath] = set()
for document in manifest["documents"]:
for raw in (
document["canonical_path"],
document["revision_path"].replace("{revision}", "revision"),
*document.get("legacy_paths", []),
):
path_value = _safe_path(raw)
if path_value in seen:
raise ValueError(f"duplicate publication path: {path_value}")
seen.add(path_value)
return manifest
def _redirect(target: str, title: str) -> str:
escaped = html.escape(target, quote=True)
return (
"<!doctype html><html lang=\"en\"><meta charset=\"utf-8\">"
f'<meta http-equiv="refresh" content="0; url={escaped}">'
f"<title>{html.escape(title)}</title>"
f'<p>Moved permanently to <a href="{escaped}">{escaped}</a>.</p></html>\n'
)
def _index_page(site: dict[str, Any], records: list[dict[str, str]]) -> str:
rows = []
for record in records:
rows.append(
"<tr>"
f'<td><a href="/{html.escape(record["canonical_path"], quote=True)}">'
f'{html.escape(record["title"])}</a></td>'
f'<td>{html.escape(record["status"])}</td>'
f'<td>{html.escape(record["lifecycle"])}</td>'
f'<td>{html.escape(record["revision"])}</td>'
f'<td>{html.escape(record["owner"])}</td>'
f'<td>{html.escape(record["last_reviewed"])}</td>'
f'<td>{html.escape(record["review_due"])}</td>'
f'<td>{html.escape(record["currency"])}</td>'
"</tr>"
)
return (
"<!doctype html><html lang=\"en\"><meta charset=\"utf-8\">"
f"<title>{html.escape(site['title'])}</title><style>{STYLE.read_text()}</style>"
'<div class="wrap"><header><div class="eyebrow"><span>policy surface</span>'
"<span>generated from canonical sources — do not edit</span></div>"
f"<h1>{html.escape(site['title'])}</h1>"
'<p class="sub">Canon and architecture decisions at stable addresses, with visible currency.</p>'
"</header><main><table><thead><tr><th>Document</th><th>Status</th>"
"<th>Lifecycle</th><th>Revision</th><th>Owner</th><th>Reviewed</th>"
"<th>Review due</th><th>Currency</th>"
f"</tr></thead><tbody>{''.join(rows)}</tbody></table></main></div></html>\n"
)
def build(
manifest_path: Path,
output: Path,
*,
as_of: dt.date | None = None,
) -> list[dict[str, str]]:
manifest_path = manifest_path.resolve()
manifest = load_manifest(manifest_path)
as_of = as_of or dt.date.today()
repository_paths = {
name: (manifest_path.parent / config["path"]).resolve()
for name, config in manifest["repositories"].items()
}
output_parent = output.resolve().parent
output_parent.mkdir(parents=True, exist_ok=True)
temporary = Path(tempfile.mkdtemp(prefix=f".{output.name}-", dir=output_parent))
if output.exists():
shutil.copytree(output, temporary, dirs_exist_ok=True)
records: list[dict[str, str]] = []
try:
for document in manifest["documents"]:
repo = repository_paths[document["source_repo"]]
source = (repo / document["source_path"]).resolve()
if not source.is_file() or repo not in source.parents:
raise FileNotFoundError(f"canonical source unavailable: {source}")
meta, _markdown = split_frontmatter(source.read_text(encoding="utf-8"))
if meta.get("id") != document["id"]:
raise ValueError(
f"{source}: manifest id {document['id']!r} does not match {meta.get('id')!r}"
)
for required_field in ("title", "status", "owner"):
if not meta.get(required_field):
raise ValueError(f"{source}: {required_field} is required for publication")
revision = meta.get("revision") or meta.get("version")
if not revision:
raise ValueError(f"{source}: revision or version is required")
source_revision = _source_revision(repo, source)
source_digest = hashlib.sha256(source.read_bytes()).hexdigest()
reviewed = meta.get("last_reviewed") or meta.get("updated")
interval = document.get("review_interval") or meta.get("review_interval")
if not reviewed or not interval:
raise ValueError(f"{source}: review date and interval are required")
review_due = _add_interval(reviewed, interval)
lifecycle = document.get("lifecycle", "active")
if lifecycle not in {"active", "superseded", "withdrawn"}:
raise ValueError(
f"{document['id']}: lifecycle must be active, superseded or withdrawn"
)
successor = document.get("successor", "")
if lifecycle == "superseded" and not successor:
raise ValueError(f"{document['id']}: superseded documents require successor")
publication = {
"source_repo": document["source_repo"],
"source_path": document["source_path"],
"source_revision": source_revision,
"source_digest": source_digest,
"review_due": review_due.isoformat() if review_due else "",
}
revision_page, meta, _sections = render_page(
source,
subtitle=document.get("subtitle", ""),
publication=publication,
)
current_publication = publication | {
"lifecycle": lifecycle,
"successor": successor,
"stale": "true" if review_due and review_due < as_of else "false",
}
current_page, _current_meta, _current_sections = render_page(
source,
subtitle=document.get("subtitle", ""),
publication=current_publication,
)
canonical = _safe_path(document["canonical_path"])
revision_path = _safe_path(document["revision_path"].format(revision=revision))
revision_target = temporary / revision_path
if revision_target.exists():
existing_revision = revision_target.read_text(encoding="utf-8")
old_revision = SOURCE_REVISION.search(existing_revision)
old_digest = SOURCE_DIGEST.search(existing_revision)
if not old_revision or not old_digest:
raise RuntimeError(
f"immutable revision {revision_path} has incomplete source metadata"
)
if html.unescape(old_digest.group(1)) != source_digest:
raise RuntimeError(
f"immutable revision {revision_path} already records content digest "
f"{old_digest.group(1)}; source is now {source_digest}. "
"Publish a new revision id."
)
canonical_target = temporary / canonical
canonical_target.parent.mkdir(parents=True, exist_ok=True)
canonical_target.write_text(current_page, encoding="utf-8")
if not revision_target.exists():
revision_target.parent.mkdir(parents=True, exist_ok=True)
revision_target.write_text(revision_page, encoding="utf-8")
for legacy in document.get("legacy_paths", []):
target = temporary / _safe_path(legacy)
target.parent.mkdir(parents=True, exist_ok=True)
canonical_url = "/" + canonical.as_posix()
target.write_text(_redirect(canonical_url, meta["title"]), encoding="utf-8")
records.append(
{
"id": document["id"],
"title": meta["title"],
"status": meta["status"],
"revision": revision,
"owner": meta["owner"],
"last_reviewed": reviewed,
"review_due": review_due.isoformat(),
"currency": "stale" if review_due < as_of else "current",
"lifecycle": lifecycle,
"canonical_path": canonical.as_posix(),
"revision_path": revision_path.as_posix(),
"source_revision": source_revision,
"source_digest": source_digest,
}
)
(temporary / "index.html").write_text(
_index_page(manifest["site"], records), encoding="utf-8"
)
(temporary / "publication-manifest.json").write_text(
json.dumps(
{
"schema_version": 1,
"generated_as_of": as_of.isoformat(),
"documents": records,
},
indent=2,
sort_keys=True,
)
+ "\n",
encoding="utf-8",
)
if output.exists():
shutil.rmtree(output)
os.replace(temporary, output)
except BaseException:
shutil.rmtree(temporary, ignore_errors=True)
raise
return records
def main() -> int:
parser = argparse.ArgumentParser()
parser.add_argument("manifest", type=Path)
parser.add_argument("--output", type=Path, default=Path("build"))
parser.add_argument("--as-of", type=dt.date.fromisoformat)
args = parser.parse_args()
records = build(args.manifest, args.output, as_of=args.as_of)
print(f"{args.output}: published {len(records)} document(s)")
return 0
if __name__ == "__main__":
raise SystemExit(main())

38
tools/check_currency.py Normal file
View file

@ -0,0 +1,38 @@
#!/usr/bin/env python3
from __future__ import annotations
import argparse
import datetime as dt
from pathlib import Path
from build_site import _add_interval, load_manifest
from render import split_frontmatter
def main() -> int:
parser = argparse.ArgumentParser()
parser.add_argument("manifest", type=Path)
parser.add_argument("--as-of", type=dt.date.fromisoformat, default=dt.date.today())
args = parser.parse_args()
manifest_path = args.manifest.resolve()
manifest = load_manifest(manifest_path)
stale = 0
for document in manifest["documents"]:
repo = manifest_path.parent / manifest["repositories"][document["source_repo"]]["path"]
source = (repo / document["source_path"]).resolve()
meta, _markdown = split_frontmatter(source.read_text(encoding="utf-8"))
reviewed = meta.get("last_reviewed") or meta.get("updated")
interval = document.get("review_interval") or meta.get("review_interval")
if not reviewed or not interval:
print(f"UNDECLARED {document['id']}: review date/interval missing")
stale += 1
continue
due = _add_interval(reviewed, interval)
state = "STALE" if due < args.as_of else "current"
print(f"{state} {document['id']}: reviewed {reviewed}, due {due}")
stale += state == "STALE"
return 1 if stale else 0
if __name__ == "__main__":
raise SystemExit(main())

View file

@ -19,7 +19,7 @@ Stdlib only, per the estate's structure-not-tooling stance: a publishing step
that needs its own toolchain is a publishing step that stops being run. that needs its own toolchain is a publishing step that stops being run.
Usage: Usage:
python3 tools/render-artifact.py <source.md> --output <page.html> \\ python3 tools/render.py <source.md> --output <page.html> \\
[--title "Name"] [--subtitle "..."] [--title "Name"] [--subtitle "..."]
""" """
@ -39,7 +39,7 @@ EM = re.compile(r"(?<![*\w])\*([^*]+)\*(?!\*)")
LINK = re.compile(r"\[([^\]]+)\]\(([^)]+)\)") LINK = re.compile(r"\[([^\]]+)\]\(([^)]+)\)")
HEADING = re.compile(r"^(#{1,4})\s+(.*)$") HEADING = re.compile(r"^(#{1,4})\s+(.*)$")
SECTION_NO = re.compile(r"^(\d+)\.\s+(.*)$") SECTION_NO = re.compile(r"^(\d+)\.\s+(.*)$")
LEVEL_CELL = re.compile(r"^\*\*([IAEPR])(\d)\*\*$") LEVEL_CELL = re.compile(r"^\*\*([IAEPRV])(\d)\*\*$")
DECISION = re.compile(r"^\*\*(Decision [\d.]+[^*]*)\*\*(.*)$", re.S) DECISION = re.compile(r"^\*\*(Decision [\d.]+[^*]*)\*\*(.*)$", re.S)
@ -91,10 +91,10 @@ def parse_table(lines: list[str], start: int) -> tuple[list[list[str]], int]:
def render_ladder(rows: list[list[str]]) -> str: def render_ladder(rows: list[list[str]]) -> str:
"""A level table becomes a stepped scale. Colour depth encodes strength.""" """A level table becomes a stepped scale. Colour depth encodes strength."""
body = rows[1:] body = rows[1:]
plane = LEVEL_CELL.match(body[0][0]).group(1) axis = LEVEL_CELL.match(body[0][0]).group(1)
names = { names = {
"I": "Identity", "A": "Authorization", "E": "Enforcement", "I": "Identity", "A": "Authorization", "E": "Enforcement",
"P": "Placement", "R": "Retention", "P": "Placement", "R": "Retention", "V": "Availability",
} }
rungs = [] rungs = []
for cells in body: for cells in body:
@ -104,15 +104,15 @@ def render_ladder(rows: list[list[str]]) -> str:
n = int(match.group(2)) n = int(match.group(2))
text = cells[1] if len(cells) > 1 else "" text = cells[1] if len(cells) > 1 else ""
rungs.append( rungs.append(
f'<div class="rung r{n}"><span class="code">{plane}{n}</span>' f'<div class="rung r{n}"><span class="code">{axis}{n}</span>'
f'<span class="txt">{inline(text)}</span></div>' f'<span class="txt">{inline(text)}</span></div>'
) )
while len(rungs) < 5: while len(rungs) < 5:
rungs.append('<div class="rung na"><span class="code">—</span>' rungs.append('<div class="rung na"><span class="code">—</span>'
f'<span class="txt">Ladder ends at {plane}{len(rungs) - 1}.</span></div>') f'<span class="txt">Ladder ends at {axis}{len(rungs) - 1}.</span></div>')
return ( return (
'<div class="ladder"><div class="pname">' '<div class="ladder"><div class="pname">'
f'{names.get(plane, plane)}<span>plane {plane}</span></div>' f'{names.get(axis, axis)}<span>axis {axis}</span></div>'
f'<div class="rungs">{"".join(rungs)}</div></div>' f'<div class="rungs">{"".join(rungs)}</div></div>'
) )
@ -326,25 +326,30 @@ def render_body(markdown: str) -> tuple[str, list[tuple[str, str, str]]]:
return "\n".join(out), rail return "\n".join(out), rail
def main() -> int: def render_page(
ap = argparse.ArgumentParser() source: pathlib.Path,
ap.add_argument("source", type=pathlib.Path) *,
ap.add_argument("--output", required=True, type=pathlib.Path) title: str | None = None,
ap.add_argument("--title", default=None) subtitle: str = "",
ap.add_argument("--subtitle", default="") publication: dict[str, str] | None = None,
args = ap.parse_args() ) -> tuple[str, dict, int]:
meta, markdown = split_frontmatter(source.read_text(encoding="utf-8"))
meta, markdown = split_frontmatter(args.source.read_text())
body, rail = render_body(markdown) body, rail = render_body(markdown)
title = args.title or meta.get("title", args.source.stem) resolved_title = title or meta.get("title", source.stem)
display = title.split(":")[0].strip() display = resolved_title.split(":")[0].strip()
eyebrow = " ".join( eyebrow = " ".join(
f"<span{' class=\"stat\"' if k == 'status' else ''}>{html.escape(v)}</span>" f"<span{' class=\"stat\"' if k == 'status' else ''}>{html.escape(v)}</span>"
for k, v in ( for k, v in (
("id", meta.get("id", "")), ("id", meta.get("id", "")),
("status", f"{meta.get('status', '')} · {meta.get('revision', '')}".strip(" ·")), ("status", f"{meta.get('status', '')} · {meta.get('revision', '')}".strip(" ·")),
("date", meta.get("date", "")), ("owner", meta.get("owner", "")),
(
"review",
f"reviewed {meta.get('last_reviewed', '')}"
if meta.get("last_reviewed")
else "",
),
) )
if v if v
) )
@ -353,23 +358,103 @@ def main() -> int:
for a, n, t in rail for a, n, t in rail
) )
publication = publication or {}
source_note = " · ".join(
item
for item in (
publication.get("source_repo", ""),
publication.get("source_path", ""),
publication.get("source_revision", ""),
)
if item
)
source_line = (
f'<p class="sub">Source: <code>{html.escape(source_note)}</code></p>'
if source_note
else ""
)
review_due = publication.get("review_due", "")
review_line = (
f'<p class="sub">Review due: {html.escape(review_due)}</p>'
if review_due
else ""
)
lifecycle = publication.get("lifecycle", "active")
successor = publication.get("successor", "")
lifecycle_notice = ""
if lifecycle == "superseded":
successor_link = (
f' <a href="{html.escape(successor, quote=True)}">Read its successor.</a>'
if successor
else ""
)
lifecycle_notice = (
'<div class="rule-quote"><p><strong>Superseded.</strong>'
f" This address is retained as part of the policy record.{successor_link}</p></div>"
)
elif lifecycle == "withdrawn":
lifecycle_notice = (
'<div class="rule-quote"><p><strong>Withdrawn.</strong> '
"This document is retained for historical reference and is not current policy."
"</p></div>"
)
currency_notice = (
'<div class="rule-quote"><p><strong>Review overdue.</strong> '
f"This document was due for review on {html.escape(review_due)}.</p></div>"
if review_due and publication.get("stale") == "true"
else ""
)
source_revision_meta = (
f'<meta name="policy-source-revision" content="'
f'{html.escape(publication.get("source_revision", ""), quote=True)}">\n'
if publication.get("source_revision")
else ""
)
source_digest_meta = (
f'<meta name="policy-source-digest" content="'
f'{html.escape(publication.get("source_digest", ""), quote=True)}">\n'
if publication.get("source_digest")
else ""
)
page = ( page = (
f"<title>{html.escape(display)}</title>\n" "<!doctype html>\n<html lang=\"en\"><meta charset=\"utf-8\">\n"
+ source_revision_meta
+ source_digest_meta
+ f"<title>{html.escape(display)}</title>\n"
f"<style>\n{STYLE.read_text()}\n</style>\n" f"<style>\n{STYLE.read_text()}\n</style>\n"
'<div class="wrap"><header>' '<div class="wrap"><header>'
f'<div class="eyebrow">{eyebrow}<span>generated from canon — do not edit</span></div>' f'<div class="eyebrow">{eyebrow}<span>generated from canonical source — do not edit</span></div>'
f"<h1>{html.escape(display)}</h1>" f"<h1>{html.escape(display)}</h1>"
+ (f'<p class="sub">{html.escape(args.subtitle)}</p>' if args.subtitle else "") + (f'<p class="sub">{html.escape(subtitle)}</p>' if subtitle else "")
+ source_line
+ review_line
+ '</header><div class="layout">' + '</header><div class="layout">'
f'<nav class="rail" aria-label="Sections"><ol>{rail_html}</ol></nav>' f'<nav class="rail" aria-label="Sections"><ol>{rail_html}</ol></nav>'
f"<main>{body}" f"<main>{lifecycle_notice}{currency_notice}{body}"
f'<footer><span>{html.escape(meta.get("id", ""))} · ' f'<footer><span>{html.escape(meta.get("id", ""))} · '
f'{html.escape(meta.get("revision", ""))} · {html.escape(meta.get("status", ""))}</span>' f'{html.escape(meta.get("revision", ""))} · {html.escape(meta.get("status", ""))}</span>'
"<span>generated from the-custodian/canon</span></footer>" f"<span>{html.escape(source_note or 'generated from canonical source')}</span></footer>"
"</main></div></div>\n" "</main></div></div></html>\n"
) )
args.output.write_text(page) return page, meta, len(rail)
print(f"{args.output}: {len(rail)} sections, {len(page)} bytes")
def main() -> int:
ap = argparse.ArgumentParser()
ap.add_argument("source", type=pathlib.Path)
ap.add_argument("--output", required=True, type=pathlib.Path)
ap.add_argument("--title", default=None)
ap.add_argument("--subtitle", default="")
args = ap.parse_args()
page, _meta, section_count = render_page(
args.source,
title=args.title,
subtitle=args.subtitle,
)
args.output.parent.mkdir(parents=True, exist_ok=True)
args.output.write_text(page, encoding="utf-8")
print(f"{args.output}: {section_count} sections, {len(page)} bytes")
return 0 return 0

126
tools/verify_release.py Normal file
View file

@ -0,0 +1,126 @@
#!/usr/bin/env python3
"""Fail closed unless a built policy site is safe to publish as an OCI release."""
from __future__ import annotations
import argparse
import hashlib
import html
import json
from pathlib import Path, PurePosixPath
import re
from typing import Any
HEX_DIGEST = re.compile(r"^[a-f0-9]{64}$")
CLEAN_GIT_REVISION = re.compile(r"^[a-f0-9]{40}$")
SOURCE_REVISION = re.compile(
r'<meta name="policy-source-revision" content="([^"]+)">'
)
SOURCE_DIGEST = re.compile(r'<meta name="policy-source-digest" content="([^"]+)">')
def _safe_relative(value: str) -> PurePosixPath:
path = PurePosixPath(value)
if path.is_absolute() or ".." in path.parts or not path.parts:
raise ValueError(f"unsafe release path: {value!r}")
return path
def _page_provenance(path: Path) -> tuple[str, str]:
page = path.read_text(encoding="utf-8")
revision = SOURCE_REVISION.search(page)
digest = SOURCE_DIGEST.search(page)
if not revision or not digest:
raise ValueError(f"{path}: missing source provenance metadata")
return html.unescape(revision.group(1)), html.unescape(digest.group(1))
def verify(build: Path) -> dict[str, Any]:
build = build.resolve()
if not build.is_dir():
raise ValueError(f"release directory does not exist: {build}")
for path in build.rglob("*"):
if path.is_symlink():
raise ValueError(f"release tree contains a symlink: {path.relative_to(build)}")
index = build / "index.html"
manifest_path = build / "publication-manifest.json"
if not index.is_file() or not manifest_path.is_file():
raise ValueError("release requires index.html and publication-manifest.json")
manifest_bytes = manifest_path.read_bytes()
manifest = json.loads(manifest_bytes)
if manifest.get("schema_version") != 1:
raise ValueError("publication manifest schema_version must be 1")
if not manifest.get("generated_as_of"):
raise ValueError("publication manifest generated_as_of is required")
documents = manifest.get("documents")
if not isinstance(documents, list) or not documents:
raise ValueError("publication manifest must contain at least one document")
verified: list[str] = []
for document in documents:
document_id = document.get("id", "<unknown>")
for field in (
"id",
"title",
"status",
"revision",
"owner",
"last_reviewed",
"review_due",
"canonical_path",
"revision_path",
):
if not document.get(field) or document.get(field) == "unknown":
raise ValueError(f"{document_id}: release metadata field {field} is required")
source_revision = document.get("source_revision", "")
source_digest = document.get("source_digest", "")
if not CLEAN_GIT_REVISION.fullmatch(source_revision):
raise ValueError(
f"{document_id}: production source_revision must be a clean 40-hex Git commit; "
f"got {source_revision!r}"
)
if not HEX_DIGEST.fullmatch(source_digest):
raise ValueError(f"{document_id}: invalid source_digest {source_digest!r}")
canonical = build / _safe_relative(document["canonical_path"])
revision = build / _safe_relative(document["revision_path"])
if not canonical.is_file() or not revision.is_file():
raise ValueError(f"{document_id}: canonical or immutable revision page is missing")
current_revision, current_digest = _page_provenance(canonical)
immutable_revision, immutable_digest = _page_provenance(revision)
if (current_revision, current_digest) != (source_revision, source_digest):
raise ValueError(f"{document_id}: canonical page provenance differs from manifest")
if immutable_digest != source_digest:
raise ValueError(f"{document_id}: immutable revision digest differs from manifest")
if not CLEAN_GIT_REVISION.fullmatch(immutable_revision):
raise ValueError(
f"{document_id}: immutable revision page was not built from a clean Git commit"
)
verified.append(document_id)
return {
"schema_version": "policy-nexus-release/v1",
"publication_manifest_digest": hashlib.sha256(manifest_bytes).hexdigest(),
"generated_as_of": manifest["generated_as_of"],
"documents": verified,
}
def main() -> int:
parser = argparse.ArgumentParser()
parser.add_argument("build", nargs="?", type=Path, default=Path("build"))
args = parser.parse_args()
try:
evidence = verify(args.build)
except (KeyError, OSError, ValueError, json.JSONDecodeError) as exc:
parser.error(str(exc))
print(json.dumps(evidence, sort_keys=True))
return 0
if __name__ == "__main__":
raise SystemExit(main())

View file

@ -4,11 +4,11 @@ type: workplan
title: "Stand up policy.coulomb.social as the permanent publication surface" title: "Stand up policy.coulomb.social as the permanent publication surface"
domain: infotech domain: infotech
repo: policy-nexus repo: policy-nexus
status: proposed status: active
owner: the-custodian owner: the-custodian
topic_slug: policy-nexus topic_slug: policy-nexus
created: "2026-08-17" created: "2026-08-17"
updated: "2026-08-17" updated: "2026-08-18"
--- ---
# POLICY-NEXUS-WP-0001 — permanent publication surface # POLICY-NEXUS-WP-0001 — permanent publication surface
@ -26,15 +26,15 @@ superseded versions, and can be reached by someone outside the estate.
## The forcing case ## The forcing case
`net-kingdom/canon/standards/tenancy-posture_v0.1.md` (*Tenancy Posture*, `net-kingdom/canon/standards/tenancy-posture_v0.1.md` (*Tenancy Posture*,
draft-5) needs review from six repos — draft-8) was reviewed by six repos —
`tenant-engine`, `flex-auth`, `rapp-postgres`, `railiance-platform`, `tenant-engine`, `flex-auth`, `rapp-postgres`, `railiance-platform`,
`adaptive-pricing`, `audit-core`. It is currently served from a private, `adaptive-pricing`, `audit-core`. It is currently served from a private,
disposable artifact URL. Routing a document that governs six repos to a link disposable artifact URL. Routing a document that governs six repos to a link
that may not resolve later is the problem this workplan exists to end. that may not resolve later is the problem this workplan exists to end.
Tenancy Posture is therefore the first publication and the acceptance test. If the site Tenancy Posture is therefore the first publication and the acceptance test. If the site
cannot carry it correctly — five ladders, a threat matrix, an E×P grid, twelve cannot carry it correctly — six ladders, a threat matrix, an E×P grid, and its
owner-attributed open questions — the site is not finished. owner-attributed questions and resolutions — the site is not finished.
## Existing structure this workplan must respect ## Existing structure this workplan must respect
@ -45,10 +45,11 @@ document rather than requiring extra markup. It was written because the page
and the source had diverged. T02 generalises it from one document to many; it and the source had diverged. T02 generalises it from one document to many; it
does not start from scratch. does not start from scratch.
**Source of truth stays upstream.** Canon lives in `the-custodian/canon`; **Source of truth stays upstream.** Canon lives in its owning repo — including
per-repo ADRs live in their own repos. This repo reads and never writes back. `the-custodian/canon` and `net-kingdom/canon` — while per-repo ADRs live in
A publication surface with write authority is a second source of truth, and the their own repos. This repo reads and never writes back. A publication surface
estate has a standing rule against that. with write authority is a second source of truth, and the estate has a standing
rule against that.
**The adoption stance applies** (Tenancy Posture §14): adopt published standards and **The adoption stance applies** (Tenancy Posture §14): adopt published standards and
structural patterns; build tooling ground-up unless it is an established structural patterns; build tooling ground-up unless it is an established
@ -73,6 +74,12 @@ credential come from the existing platform. If this repo needs storage it is a
### T01 — Addressing scheme and permanence contract ### T01 — Addressing scheme and permanence contract
```task
id: POLICY-NEXUS-WP-0001-T01
status: done
priority: high
```
Decide, once, how a document maps to a URL, and write down what the estate is Decide, once, how a document maps to a URL, and write down what the estate is
promising about that URL. promising about that URL.
@ -90,8 +97,18 @@ promising about that URL.
**Why first:** everything downstream bakes in the answer, and changing it later **Why first:** everything downstream bakes in the answer, and changing it later
breaks the one promise the repo exists to make. breaks the one promise the repo exists to make.
Completed 2026-08-18 in `docs/adr/ADR-0001-addressing-and-permanence.md`.
The contract distinguishes stable current addresses from immutable revision
addresses and retains superseded and withdrawn publications.
### T02 — Generalise the renderer ### T02 — Generalise the renderer
```task
id: POLICY-NEXUS-WP-0001-T02
status: done
priority: high
```
Lift `tools/render.py` from one document to many. Lift `tools/render.py` from one document to many.
- Multi-document: a manifest of sources rather than one path argument. - Multi-document: a manifest of sources rather than one path argument.
@ -100,13 +117,24 @@ Lift `tools/render.py` from one document to many.
- Index generation: a landing page listing documents with status and currency. - Index generation: a landing page listing documents with status and currency.
- Keep the convention recognisers (level ladders, threat matrix, E×P grid, - Keep the convention recognisers (level ladders, threat matrix, E×P grid,
evidence chips, section rail) and keep it stdlib-only. evidence chips, section rail) and keep it stdlib-only.
- Keep the "generated from canon — do not edit" marker on every page. - Keep the "generated from canonical source — do not edit" marker on every page.
**Acceptance:** Tenancy Posture renders byte-identically in substance to the current **Acceptance:** Tenancy Posture renders byte-identically in substance to the current
generated page, plus an index entry. generated page, plus an index entry.
Completed 2026-08-18. `publication.json` drives a stdlib-only multi-document
builder. It emits a current page, immutable revision, legacy alias, index and
machine-readable publication manifest. Tests cover path safety, revision
immutability, lifecycle notices and currency.
### T03 — Source ingestion ### T03 — Source ingestion
```task
id: POLICY-NEXUS-WP-0001-T03
status: progress
priority: high
```
Define how a document gets from its owning repo to this one. Define how a document gets from its owning repo to this one.
- Manifest format: source repo, path, publication URL, owner. - Manifest format: source repo, path, publication URL, owner.
@ -129,8 +157,19 @@ owning repo triggers on merge). Pull is simpler and keeps the direction of
dependency clean; push is fresher. Recommend pull with a manual trigger, and dependency clean; push is fresher. Recommend pull with a manual trigger, and
record the choice. record the choice.
2026-08-18: the explicit pull manifest and exact source-revision recording are
implemented, and missing or inconsistent sources fail the build. Tenancy
Posture is the first entry. Enumerating the remaining in-scope canon and ADR
corpus and connecting scheduled/manual checkout refresh remain open.
### T04 — Deploy to policy.coulomb.social ### T04 — Deploy to policy.coulomb.social
```task
id: POLICY-NEXUS-WP-0001-T04
status: progress
priority: high
```
- DNS, TLS, ingress via the existing platform packages. - DNS, TLS, ingress via the existing platform packages.
- Static hosting — the output is static files by construction, so the serving - Static hosting — the output is static files by construction, so the serving
layer should be the least interesting part of this workplan. layer should be the least interesting part of this workplan.
@ -141,8 +180,22 @@ record the choice.
- Smoke check after every deploy: the index resolves, Tenancy Posture resolves, and a - Smoke check after every deploy: the index resolves, Tenancy Posture resolves, and a
known superseded URL still resolves. known superseded URL still resolves.
2026-08-18: `policy-nexus` now owns a digest-pinned, non-root OCI artifact
contract and a Forgejo publication workflow. `rapp-policy-nexus` owns the
separately reviewable Helm package, runtime hardening, public smoke checks and
rollback; `railiance-apps` owns only the production digest binding. DNS already
resolves and the reef has the required Traefik/cert-manager substrate. A clean
source release, registry digest, server-side dry-run, deployment and live smoke
evidence remain before this task can close.
### T05 — Currency and staleness ### T05 — Currency and staleness
```task
id: POLICY-NEXUS-WP-0001-T05
status: done
priority: medium
```
The relevance half of the repo's purpose. A permanently available document that The relevance half of the repo's purpose. A permanently available document that
is quietly out of date is worse than no document. is quietly out of date is worse than no document.
@ -154,8 +207,18 @@ is quietly out of date is worse than no document.
unratified since 2026-08-10; that fact should be visible on the site, because unratified since 2026-08-10; that fact should be visible on the site, because
invisibility is precisely why it stalled. invisibility is precisely why it stalled.
Completed 2026-08-18 for the published corpus. Pages and the index expose
review due dates and overdue state; `make currency` exits non-zero for stale or
undeclared review metadata. Expansion follows T03 automatically.
### T06 — withdrawn ### T06 — withdrawn
```task
id: POLICY-NEXUS-WP-0001-T06
status: done
priority: low
```
Regulatory intake moved to `risk-nexus` on 2026-08-17. Deciding what a rule Regulatory intake moved to `risk-nexus` on 2026-08-17. Deciding what a rule
demands of the estate is a judgement about risk, not an act of publishing, and demands of the estate is a judgement about risk, not an act of publishing, and
it wanted a different owner and a different skill from everything above. it wanted a different owner and a different skill from everything above.
@ -218,11 +281,12 @@ The README's one-line description — "a convergence and publication point for
government policies" — reads broader than this. Worth updating so the repo does government policies" — reads broader than this. Worth updating so the repo does
not attract the wrong contributions. not attract the wrong contributions.
## Open questions for the operator ## Resolved publication scope
1. **Canon subdirectory scope.** `standards` and `architecture` are clearly ADR-0001 records the bounded answer: `standards`, `architecture` and
policy. Are `constitution`, `values`, `tpsc` and `projects` in or out? T03 `constitution` are in; `values`, `tpsc` and `projects` are out unless their
needs a yes or no per directory rather than a wildcard. owner explicitly identifies an individual governing document. T03 must still
enumerate each publication rather than globbing those trees.
## Deferred: controlled disclosure ## Deferred: controlled disclosure