← Open Source Catalog

Swarma Credential Broker

View on GitHub

swarma-credential-broker

B1 lab construction (not an installed daemon)

The broker_lab build contains private recovery/custody adapter construction and disjoint lab store identities. The recovery addendum is private to B1, never an external consumer input or export; external journal bytes remain frozen. The existing lease engine and protected fsync/CAS store are reused. Default constructors and the stopped production owner retain their production behavior. The internal tagged engine constructor is not an authority factory: synthetic test authorities and clocks are not installed or admitted by a daemon.

The construction coverage map lists every incomplete B1 acceptance row and the named mutation controls. The C0c manager-owned capability resolves the former native access stop. The tagged Unix observation client and C0b reader have paired adversarial construction tests. C0d now supplies durable publication-pair versus periodic single consumption: singles advance S, never F or publication, and independent freshness/containment fences close continued use. The native managed adapter reuses the protected projection and generation journal. These internal APIs are not an installed authority factory. The historical timing stop is resolved; the accepting daemon remains blocked on the protected installation binding record. No real-key enrollment, vendor call, native qualification or production activation follows from these construction tests.

PR #83 B1a keeps an independent publication fence and prior engine UNKNOWN sticky. Fix round 2 separates observation-owned uncertainty: only a new, non-reused admitted pair reconciles it, never a single, cached CAS or engine confirmation. Both uncertainty reasons independently close projection/material. Recovering a nonempty observation record reinstates its pair-only fence. Paired regressions cover reconciliation, the delivered timing, recovery joins, response IDs and observed-time upper bound. The prior untagged service/store parameterization is still present; only its production-default behavior is claimed unchanged, not that every file in the original PR has a lab tag.

Tools: from an absolute isolated test checkout, replay the B1a Go source-overlay catalogue with python3 tests/lab-b1/mutants.py --out "$B1_SCRATCH/mutants". The checkout, absolute HOME/config/caches/temp directories and mutants/ must share that task-owned scratch root. The runner first checks unmutated valid and negative controls, then records exact edits, source hashes, named assertion failures, commands, PIDs and real exit codes in mutants/; setup/compiler errors and skipped tests are not kills. No live authority or network vendor call runs. Go builds/tests the adapter (go test -tags=broker_lab ./internal/labv0), the C0 catalogue (go test ./internal/labcontractv0) and production regression packages (go test ./internal/service ./internal/store ./internal/claude). The actual tagged C0b/C0c reader catalogue runs with go test -tags=broker_lab -run '^TestLabRuntime' ./internal/labcontractv0; go test -tags=broker_lab -run '^TestLabObservation' ./internal/labv0 runs the client, composed timing witnesses and private fake server. They are not installed/native qualification or compliant A09 success controls. Run them in an absolute task-owned scratch checkout with private HOME/caches, as required by the project test-environment instructions, not an inherited HOME. Git supplies signed source commits and source-overlay diffs; gofmt -d checks changed Go files. Logs, overlays and exact exits belong in .temp/; the task handoff maps acceptance limitations and mutant evidence. Python is used only for task-local JSON fixture/overlay generation, never product execution.

The credential broker is Merovingian in the platform’s codenames.

A credential broker for agent systems. It runs under its own OS user, holds subscription and API credentials in its own store, and leases them to authorised agent launches over a Unix socket whose peer it identifies through the kernel (getpeereid / SO_PEERCRED).

Status: experimental Linux daemon core and runner. The daemon covers protected static policy, metadata storage, kernel peer admission, the refresher transport subset and lease bookkeeping. The Linux external-token runner uses a protected static authority and broker wire client. The shipped owner adapter refuses issuance and the production qualified release set is empty; the real contained auth owner and release qualification remain pending. A tested offline migration script is available for review; real deployment requires the site integrations and qualification described in the migration guide. The broader broker remains a design. The specification is spec/broker.md; diagrams are in diagrams/. The proposed Codex refresher v0 profile extracts the auth owner and external-token runner ahead of slice 0, with accepted interim rulings and pending release qualification. The remaining activation gates still apply.

What it is for

Linux integrations can import the v0 worker client and separate static-policy observer at github.com/relux-works/swarma-credential-broker/brokerclient. The observer receives no lease material and its observation is not launch authority.

The fixed demo executor adds sealed FD3 intake, protected P1 launch-record consumption and durable demo renewal caps. It is not curator-run; P1 executor approval, protected owner enrolment and live qualification remain required before execution.

These bullets describe the readable-token broker baseline. The separately versioned secret-free mode proposal is inactive: only the broker and admitted credential-spending services hold vendor-valid material; a harness receives a launch-bound placeholder through a qualified configured endpoint. The minimal broker owns credential lifecycle; a separate gateway owns request adapters, and the action service owns all external shared-state writes. Service compromise remains in the trusted base. Legacy v0 still delivers real external tokens; failed new-mode qualification grants no fallback. Local-only scope and closed gates retain interception and donor B/C as closed, separate scopes. The separate proposed gateway contract and equal provider adapter profiles specify semantic write refusal, two current authorities per use and account-wide containment; all new-mode runtime witnesses remain UNRUN.

  • One person, one subscription: a subscription is enrolled once and handed to the launches that person authorised, instead of a separate login per managed home.
  • Trusted local agents run as separate OS users; a launch asks the broker for a lease for its profile and harness, and receives the credential only in the launched process.
  • Authority is a signed grant (credential.lease on an account, for a profile, until a time), verifiable down to a root key; delegation can only narrow.
  • An account may require a network profile, so its traffic leaves only through a named egress.
  • Codex personal plans: a single auth owner refreshes the account with a required writer-lifecycle gate across daemon replacement; launches receive external access tokens and never hold a refresh token.
  • Muse subscription qualification is prioritized (owner, 2026-10-13). Proposed channel (b) uses one minting owner to lease the provider API key minted by device-code OAuth, never OAuth tokens, with fallback (c) if key billing or re-mint revocation prevents it. Qualification stays open; the API-key lane remains separate.

The configured operator and every subscription/API account’s owner are swarma-operator, a separate account that never hosts agent sessions and holds the v0 Ed25519 software root. The main path uses a phone-held, hardware-backed operator device key: biometric confirmation signs each exact operator act, SSH over the tailnet reaches a forced operator command with no shell, and the machine verifies the pinned phone key. Terminal fallback uses password-authenticated sudo into swarma-operator, no NOPASSWD and timestamp_timeout=0. Widening acts need content confirmation and are refused inside agent sessions; revocation needs authentication only. Mandatory swarma-observer reads status, accounts, grants and bindings without confirmation. Operator custody and acts are design requirements; operator format and phone-key lifecycle publication remain open.

The broker’s v0 trusted-process exception is explicit: the harness can read and copy its leased token. Revocation and the journaled R-ALLSTOP node-wide freeze stop new leases and renewals; a copied token remains usable until expiry or vendor revocation. See the exposure limits and the required injection qualification.

R-UNTRUSTED accounts never receive a broker binding or lease; admission-class evidence from the dispatcher is mandatory, and slice 0/user-manager v0 refuse the class. A workplace has zero egress and its loop stays at the donor. Circle membership, placement and enforcement class are separate predicates: membership alone grants neither a local host loop nor a review role. Review requires positive role admission; optional local-only reviewer and requester-exclusion policies remain open and off. Local trusted agents reach only model-provider endpoints through the bound profile proxy. No web tool is the default: tasks carry read-only resources, and trusted-circle web access is an explicit opt-in. The platform web-tool search key is a service credential, never an agent lease; custody remains open.

R-ALLSTOP freezes all broker leases and renewals durably, including delivery after asynchronous refresh. Recovery is explicit; a partial or unknown node-wide result keeps admission closed. Already delivered tokens keep their vendor lifetime. The phone or terminal operator path admits the node-wide act; agent sessions cannot invoke it.

R-TRANSFER makes code leave an isolated account only as platform-exported data after account-wide process absence. Export precedes retirement unless an operator explicitly waives the cleanup obligation. The orchestrator imports a repository-signed candidate through the board, obtains review of that exact commit and integrates through its existing path. Builds, tests and any execution of worker code belong only to R-VERIFY ephemeral runners on another machine; R-EXEC allows qualified light checks in agent accounts.

The shared time provider is available at github.com/relux-works/swarma-credential-broker/timeconf. Services use the same policy and collector implementation; see the embedding example. Pin a commit until a tagged version exists. The production collector and protected policy loaders require Linux, and CollectorEntry() must run first in main. The qualified-time consumer contract specifies the required durable continuity and fresh pre-pin path; production consumption remains inactive. The approved local handoff contract, generic window-profile template and mandatory macOS parity requirements publish the next interfaces and gates without a codec or accepting adapter.

How it fits

The Claude service source slice implements Core’s secret-free decisions: protected custody, service bindings, two-authority leases on the existing socket, revocation polling and durable lessee-triggered hold with a confirmed account-owner lift. A worker receives only its placeholder environment. Secret-free selection never falls back to an exposed lane. Protocol and durable replay records follow the accepted service dialect at the landed 0.13 service specification. The standalone daemon remains closed pending protected authority-reader integration and runtime qualification. Explicit activation gates:

  • The provider enforces spec §2.2 (service-account record, disjoint roles): a user-manager service-account record, never an agent or workplace record, admitted local placement, a class other than untrusted, and disjoint service and agent roles (§5.1 step 3, negative-table row 10).
  • Protected identity-reader availability is required for containment: hold admission still checks the fixed principal, and unbind closes its connections.
  • Journal retention and resource admission preserve the ability to place a durable account hold at exhaustion, including protected hold headroom.

See unresolved integration points.

The production assembly contract stop records the unaccepted operator-act, protected-facts, activation and enrollment contracts that prevent safe assembly. The accompanying broker specification §3.2 is PROPOSED, inactive, and defines no activation switch or new command. The operator and activation v0 proposal supplies PROPOSED contracts, not installed behavior. Its Owner decisions (2026-11-19) record the repository owner’s choices: A for DN-01 through DN-08, with their conditions, and A for DN-09 production. Curator Core acceptor review remains separate; nothing in C is in force pending the owners’ residual-risk and exact time-amendment decisions. Revision 4 defines the pinned composer/sealed FD0 and witnessed single-launcher freeze/thaw/refreeze, admits only direct SSH ceremonies with no server-side successor TTY reader, keeps both unbind paths independent of widening history, and preserves issuer revocation’s grant-evidence requirement. Root-authority ownership and DN-09 C’s time-witness/replacement-history exceptions are explicit conflicts with exact proposed amendments. C1 burns the old installation/time scope; only an accepted new-scope exception permits a fresh history. Retired W/hold bounds and the off-VM retirement instant are refusal-only floors, never admitting history; a held same-source reinstall cannot reopen use without protected recovery qualification. Off-VM pre-start approval also checks expiry against an off-VM clock. C requires protected test-account selection and independent qualified-VM identity evidence; production remains DN-09 A. No review, test-profile decision or documentation change activates the stopped daemon.

The binding managed-identity projection decision of 2026-11-19 resolves the historical P2-UM-LEDGER-CONTRACT stop. The Linux production service identity provider, service.NewManagedAuthority(root, protectedFacts), reads protected lib/user-manager/identities.json and the current generation journal together; it maps only trusted active local service records and fails closed otherwise. Future activation selects it explicitly at service.New(authority, accounts, now); the default daemon still installs no provider or service controller. No new CLI activation selector, static UID fallback or installation is added. Missing use facts, installation, trusted time/continuity and journal restore/high-water integration remain activation gates. Material handoff rechecks the live principal; transport completion within its read window still requires native qualification. See the provider contract and shared fixtures and custody gates.

For the inactive new-mode topology, credential-holding services authenticate as themselves and need their own lease and the originating caller’s current narrowing authority for every use. The agent-side runner receives only a placeholder; board/session hosts retain the dispatcher boundary. Local release, service-use closure, account hold, session stop and vendor invalidation have distinct lifetimes and outcomes. The figures retain their legacy flow and add a separately labeled proposed flow; neither is qualification evidence. New-mode delivery has its own publication gates and unrun qualification witnesses; existing synthetic, native, fake-503 and version evidence keeps its scope.

  • Curator composes the plan on the caller’s side. The first broker consumer is curator-run under the agent account: its narrow one-shot mode verifies and executes that plan, obtains the lease and starts the harness (owner decision D-EXECUTOR, 2026-10-11). The board runner and session host ask swarma-dispatcher to launch through curator-run; they do not embed broker clients.
  • swarma-user-manager creates the per-agent OS users the broker identifies.
  • curator-network-profiles names the egress an account may require.
  • curator-trust and swarma-envelope define the long-term grant and signature forms. Broker v0 verifies its closed local envelope; a versioned adapter reconciles the forms before 1.0.

Accepted cycle-2 contracts add binding replacement for the same UID/generation with no widening or lease carry-over, durable time watermark and monotonic destruction gates, and receiver-owned bind/unbind outcome tables. The root helper has no broker principal; unconfirmed cleanup after direct retirement remains a dispatcher/operator obligation. Broker proxy-only egress is a v1 service-profile capability requiring qualification; login/refresh and resolver routes remain publication gates. The machine owns the child network binding, and the user manager owns the shared process fate table. R-LOCK forbids holding the state lock across synchronous platform-service calls.

The dispatcher is a Unix-socket service from the first slice, with no caller sudo entry. Configured dispatchers use revocation.check for current admission evidence; bind/unbind reconciliation uses receiver-owned effect.observe. Fenced local restoration keeps authorization and auto-start closed until acknowledged revocations are recovered against evidence outside the restored failure domain, or old authorization roots are replaced and rights explicitly reissued. Publication and qualification gates remain open; these are design requirements.

The first protected provider launch is Claude with an explicitly enrolled setup-token; Codex personal-plan external tokens follow in slice 1. The provider × source × channel × phase table distinguishes those targets from retained per-home authentication and later or unresolved lanes. Source-policy v1 keeps per-home when no entry is configured; v2 requires an explicit entry and migrates existing logins to explicit per-home. The first node and broker stores use protected 0600 files on macOS and Linux; Keychain and Secret Service backends are later work.

The repository, standalone binary and service account are named swarma-credential-broker; curator broker is the Curator front end. The earlier curator-broker CLI spelling is historical design text, with no shipped alias or migration. Signed domain tags are swarma-credential-broker grant/1 and swarma-credential-broker revocation/1; broker/1 remains the peer-authenticated transport. The grant dialect boundary and key classes distinguish this v0 design from the future keeper model. Managed identity checks read the root-owned ledger at /opt/swarma/lib/user-manager/ledger.json (§4.2). These are design contracts, not runtime qualification claims.

The registration, launch, enrolment, Codex renewal binding replacement and revocation sequences describe the intended flows. The module figures below show their component, recovery, state and storage boundaries. All are design contracts; visible “unspecified in spec” notes preserve gaps rather than supply implementation decisions.

Launch-time lease lifetimes distinguish an env launcher replaced by exec from a live external-token client that can renew and release. The cleanup policy remains open where the design does not publish a release point or record-reclamation rule.

Figure PlantUML source Defining specification
M-CB1 — v0 components and process identities components.puml §3 Components, §3.1 First consumer, §4 Identities
M-CB2 — lease refusal and recovery lease-recovery.puml §6.4 Revocation, §8 Leases, §9 Codex auth owner, §15.4 Fenced restore, §15.5 Node-wide freeze
M-CB3 — account, binding, lease and grant states record-states.puml §5.1 Account record, §6.4 Revocation, §7 Bindings, §13.2 Observations and verdicts, §8.3 Lease record
M-CB4 — owned storage, socket and removal storage-layout.puml §5.3 Secret store, §12.4 Files, §15 Installation and lifecycle

See qualification for the protected release-evidence record and the pending qualify-codex administrative command. Its isolated candidate observers measure version, schema and catalog. Private synthetic admission controls now cover account, release qualification and ended leases; seven fake owner-core pairs exercise durable store loss, absence recovery, ambiguous refresh, rotation crashes, interrupted cleanup, daemon death and competing replacements. The lifecycle pairs use independently supervised singleton synthetic writers; they supply no real vendor-subtree absence evidence. The remaining pending rows still prevent production qualification.

An inactive immutable storage fixture provides bounded content retention and exact reads; it has no production consumer or current-root authority.

An inactive generation selection fixture adds shared RAM-local comparison, attempt reconciliation and outcome fencing over retained immutable units. It grants no production currentness or durable recovery authority.

Tools

The tagged B2 lab time/continuity slice documents its isolated Go test/build and Python 3 overlay commands, outputs and native gates. In its absolute task-owned scratch checkout run go test -count=1 -tags broker_lab ./internal/labtimev0 ./timeconf ./internal/labcontractv0 ./internal/assemblyv0 and python3 tests/lab-b2/mutants.py --out "$B2_SCRATCH/mutants"; retain logs and receipts below that scratch .temp/. Full untagged tests/build remain mandatory. Lab composition is in internal/labtimev0; the tagged timeconf seam imports no lab package. The graph check includes the shipped tree and negative forwarding plants. This library does not record C-OPEN-OWNERS or qualify a live VM.

The lab-only C0 contract and fixtures freeze bytes, not runtime admission. In an isolated checkout run go test -count=1 -v ./internal/labcontractv0 ./internal/assemblyv0 and python3 contracts/lab-v0/probe/test_probe.py -v. The probe guide gives exact Python 3, libseccomp, strace and timeout entrypoints, plus curl/tar/SHA-512/sha256sum verification of the pinned public client without package install hooks. All logs, new HOME/caches and synthetic observations stay in absolute task-owned scratch; no live credential or production acceptance is exercised.

The protected-reader mutation driver replays ordinary decision mutations with go run ./internal/protectedio/testdata/mutation (the linked instructions specify mandatory scratch/output flags). Its separate privileged-protectedio PR CI job uses sudo -- unshare --mount --propagation private and tagged Linux/amd64 test-only tmpfs/chroot and syscall-fault fixtures to replay exactly the 18 residual rows of PR #75. go test -count=1 ./internal/protectedio/testdata/mutation checks the evidence classifier and audit export with positive and negative controls. Receipts, command exit codes and the evidence-gated results.tsv export go to the protectedio-privileged-residual CI artifact; local logs remain under task-owned .temp/. Neither root privileges nor fixture code is added to production binaries or the ordinary test job.

The owner-close timeout fixture uses a test-only Go overlay to acknowledge a post-startup supervisor pause before exercising the real two-second timeout. Run GO="$(command -v go)" go test -race -count=1 -run "^TestOwnerCloseTimeoutSnapshot" ./internal/qualify for the positive lifecycle and the late-capture mutation control. The mutation must fail its nested timeout assertion while its clean and cancelled controls pass; that expected child failure is not a failing parent test. The existing egress missing-task and runner qualification controls likewise require specific negative child verdicts. Preserve command logs under task-owned .temp/ scratch; overlay sources and manifests live in test temporary directories. These synthetic checks do not qualify a live owner or provision host fixtures.

The runner proc-disappearance fixture synchronizes on successful strace open/stop events, joining unfinished/resumed opens by thread ID before releasing the stopped group. go test -race -run "^Test(CommandProcDisappearance|ProcTraceOpenCompletion)$" ./internal/runner checks the real lifecycle plus deterministic complete/split/failed trace records. Trace reads have a thirty-second deadline; fixture cleanup pins stopped groups with pidfds so a failed trace cannot leave its owned processes stopped.

The inactive assembly v0 construction contract and applicability register cover U00/U01 declarations, closed record sum codecs and synthetic vectors only. They install no activation file or daemon wiring and leave owner/specification acceptance gates open. U05 adds an inactive service journal and shared-gate bridge, with explicit fresh /2 storage, complete narrowing reservations and synthetic fault controls. It does not wire the daemon, replace the existing /1 reader, authenticate operators or select a production custody role. The linked note documents APIs, test commands and task-owned .temp/ evidence locations. Its fix-round controls cover bounded re-entry refusal, maximal narrowing and hold-first reserves, held-account delivery refusal and transitive import isolation. U01 review-round controls remain in the fix-round evidence.

Construction stage C1 additionally authorizes the inactive U02 protected reader and authority equality windows. These libraries are not imported by the daemon and do not satisfy activation, dedicated-human history or final acceptor gates.

Their shared fixture preflight fails with protected_fixture_temp_ancestry before any valid-control assertion when the temporary root has an unsafe ancestor. Linux CI creates a checked mode-0700 root under RUNNER_TEMP and exports it as both TMPDIR and GOTMPDIR for all subsequent Go steps. The helper validates the actual fixture tree (including when those variables differ) and explicitly sets its test-owned leaf to 0700 before the unchanged reader check. The umask-022 regression witness retains an adjacent refusal for a widened leaf; repository validation covers both umask 022 and 077.

For diagram-source validation, an installed PlantUML can render both labeled views in each source with plantuml -o <absolute-scratch-directory> diagrams/*.puml. Keep generated images and validation logs in private scratch, outside versioned source. This command is documentation validation, not runtime qualification; an unavailable renderer leaves rendering UNRUN. Python 3 temporary checks may validate local links, anchors and exact changed paths; finite text checks do not prove semantic correctness or absence of secrets.

This repository contains specifications, PlantUML sources, declarative JSON vectors, a Linux Go daemon and runner with fixture tests, and a service-user migration script. The standalone runner command refuses execution until protected policy and broker transport are integrated. Only isolated fixture tests are supplied for the migration tool; real installation and writer-lifecycle qualification remain pending. The module uses Go 1.26.0 or later to reuse the user-manager generation verifier at its pinned published revision, rather than copying that protocol. The contained owner adds the pinned github.com/godbus/dbus/v5 v5.1.0 dependency for user-manager D-Bus and private Unix descriptor passing; production never invokes systemd-run. Development checks use Go 1.26.10 through CURATOR_GO, with GOTOOLCHAIN=local; preserve the configured GOCACHE and GOPATH. Tests use synthetic tokens and local fixtures. Default tests run a synthetic Go vendor; tagged manager tests run only isolated helpers and that fake vendor, with fresh homes. No logged-in home is used.

Tool Purpose and command Outputs
Inactive assembly construction vectors (Go) go test ./internal/assemblyv0 ./internal/statev0; explicit corpus refresh: go test ./internal/assemblyv0 -run '^TestConstructionVectors$' -update-assembly-vectors then go test ./internal/statev0 -run '^TestJournalNonEmptyVectors$' -update-state-vectors; review every byte change against the pinned spec Exact synthetic CCJ-1/preimage files and source-line/digest index in internal/assemblyv0/testdata/construction-v0/, non-empty journal files in internal/statev0/testdata/construction-v0/; private logs/plants under task-owned .temp/. Closed inactive record codecs only; no admission validator, gate implementation or activation
Inactive protected authority construction (Go) go test -race ./internal/protectedio ./internal/authorityv0 ./internal/assemblyv0; go vet ./...; go test -race ./...; row and plant map Synthetic kernel-backed file/directory/flock witnesses and inert source narrowing patches in the new packages; exact exits and plant logs under task-owned .temp/. No daemon wiring, provisioning, activation or native qualification.
Linux pre-release template (Bash 4+, Go 1.26.10, Git, GNU coreutils, Python 3) On main: .scripts/release-admit.sh v1.2.3; GO=/absolute/path/to/go .scripts/release-build.sh /absolute/new/dist /absolute/source; gh workflow run release.yml --ref main -f tag=v1.2.3; see release trust and isolated build setup Linux amd64/arm64 binaries, SHA256SUMS, provenance.json, canonical release-set.json; workflow creates a PRE-RELEASE draft
OpenSSH / GitHub CLI optional bot signature GO=/absolute/path/to/go .scripts/release-sign.sh v1.2.3; independent rebuild and exact digest comparison before local signature/upload SHA256SUMS.sig; .temp/release-sign.* rebuild/readback evidence; agent-held key, proves nothing about origin
Python 3 metadata / digest verification .scripts/release-verify.sh /absolute/assets EXPECTED_FRAGMENT_SHA256; builder invokes .scripts/release-metadata.py create, verifier invokes check Canonical metadata and digest consistency; installer trusts only the aggregate set digest approved by the owner in person before any root step; tag allowlist is no trust root
Release fixture controls / actionlint (optional) GO=/absolute/path/to/go .scripts/release-test.sh /absolute/new/scratch; actionlint .github/workflows/release.yml when installed Real Git/SSH/Go/cgo positive and negative controls, receipt-input and compiler-target refusals, physical/symlinked policy exclusion, a cancellable-draft checker, scoped bundle transfer and observable scratch-home Git trust controls; local GitHub CLI double; named logs in isolated scratch; lint output
Optional native cgo release profile (Python 3, pinned GCC/libc image) Main-owned .github/release/cgo-packages is empty here; python3 .scripts/release-profile.py info /absolute/main-policy; native build, exact-set collect and check entry points are documented in releasing Two independent native builds per selected package/architecture; toolchain receipts in provenance; unchanged pure-Go outputs with an empty policy; private build evidence under absolute TMPDIR
Claude service / custody / worker fixtures go test -race -p=1 -count=1 -timeout=20m ./internal/service ./internal/claude ./internal/server ./internal/wire ./internal/claudeworker ./internal/store ./internal/qualify; scope and validation Synthetic protected broker records, broker/1 socket exchanges and a placeholder-only child under private absolute TMPDIR; task logs in .temp/. No live credential, installation or release qualification
Managed service identity provider / fixture seals "$GO" test ./internal/service -run "^TestManaged" -count=1; sha256sum --check SHA256SUMS inside internal/service/testdata/identities-v1/; read contract and activation limits Final producer-canonical e26eaff cases.json drives all 110 consumer checks and 43 adjacent decision-rule pairs: decode verdicts, UID-only service lookups with each case’s verified journal and exact Principal/refusal, and temporary-filesystem custody refusals including a buffered FIFO. Ten producer-only transitions declare consumer=none and are skipped with a recorded reason. Inventory and seal controls detect unlisted or missing projections and journals. Logs and plant overlays stay in task-owned .temp/ or private scratch. No daemon activation or root-installation qualification
Go immutable storage fixture GOTOOLCHAIN=local GOMAXPROCS=2 GO="$CURATOR_GO" SWARMA_TEST_UNPRIVILEGED=1 "$CURATOR_GO" test -p=2 ./internal/freshstore ./internal/store -run '^(TestFresh|TestImmutable)' -count=1; bounded contract and build command Synthetic files under isolated TMPDIR; full logs and overlay controls in private scratch outside Git
Go generation selection fixture GOTOOLCHAIN=local GOMAXPROCS=2 go test -p=2 -count=1 -timeout=90s ./internal/generationcas; contract and focused validation Synthetic files under isolated TMPDIR; full logs and overlay controls in private scratch outside Git
Bash migration tool (5.3 or later) bash scripts/migrate-service-user close-admission <absolute-config>, then operator reconciliation, then bash scripts/migrate-service-user migrate <absolute-config>; see the operator guide for prerequisites and required site driver Protected run directory: preflight metadata, append-only intent/recovery journal and phase records; fixed sanitized stderr
Bash / Python 3 fixture tests bash -n scripts/migrate-service-user; bash -n tests/migration/run; bash tests/migration/run <absolute-fresh-scratch-directory>; Python standard-library doubles simulate privileged commands Isolated account/filesystem/manager models, call records, canaries and narrowing-control logs in the supplied scratch directory
GNU coreutils / Linux process table sleep 0.05 bounds child-completion probes; /proc/<pid>/stat checks direct parent and start time before signaling. See the operator guide for tri-state observations and the remaining numeric PID race Unconfirmed owned PIDs are reported on sanitized stderr; no process-table contents are copied
strace (Linux fixture tests) MIGRATION_TEST_FILTER='ProcessLookup*' bash tests/migration/run <absolute-fresh-scratch-directory> injects EACCES/EIO into actual process metadata syscalls; Python’s standard-library ctypes enables a test-only subreaper for abandoned fixture children Exact injected-call traces, child/reclose evidence and narrowing-control logs under the supplied scratch directory
Git Review whitespace with git diff --check; verify signed changes with git log --format='%G? %an %s' origin/main..HEAD Terminal; capture private evidence in a scratch .tmp directory outside the versioned tree
Go importable v0 client GO="$CURATOR_GO" "$CURATOR_GO" test ./brokerclient -count=1; API and observer protocol Synthetic socket/external-module fixtures in test-owned TMPDIR; use a short isolated root for Unix socket limits and private logs outside Git. No provider or cross-UID deployment qualification
Go 1.26.0+ Build with go build -o ../.tmp/swarma-credential-broker ./cmd/swarma-credential-broker; build the fake with go build -o ../.tmp/fake-app-server ./internal/runner/testdata/appserver; check with go vet ./internal/runner ./cmd/swarma-credential-broker, gofmt -l internal/runner cmd/swarma-credential-broker, and GO="$CURATOR_GO" GOTOOLCHAIN=local "$CURATOR_GO" test -race ./internal/runner -count=1 Set CURATOR_GO to the selected Go executable. Helper builds use explicit GO or the running toolchain GOROOT, and verify the same Go version. Binary in private scratch; tests build the fake app-server and command under TMPDIR (set it to a scratch directory outside the versioned tree)
strace (Linux tests) Reproduce real proc metadata disappearance with GO="$CURATOR_GO" GOTOOLCHAIN=local "$CURATOR_GO" test -race ./internal/runner -run 'Test(CommandProcDisappearance|StopProcDisappearance)$' -count=1 -v; development runs skip with UNVERIFIED when strace or ptrace permission is unavailable (a native typed-errno probe runs first). Require every observation row with RUNNER_QUALIFICATION=1 GO="$CURATOR_GO" GOTOOLCHAIN=local "$CURATOR_GO" test -race ./internal/runner -count=1; unavailable strace/ptrace or a skipped required row fails with a named UNVERIFIED diagnostic Test-owned syscall traces under TMPDIR; no errno substitution or live account access
Python 3 / Linux seccomp (fixture control) GO="$CURATOR_GO" GOTOOLCHAIN=local "$CURATOR_GO" test -race ./internal/runner -run '^TestTraceAvailability$' -count=1 -v; the x86_64 testdata/ptrace_denied.py wrapper returns EPERM only for ptrace in its own subprocess tree Named unavailable and applied-assertion controls in test output; no host policy changes
Qualified-time provider (inactive) go test ./timeconf -count=1 -v; go test ./cmd/swarma-credential-broker -run '^TestQualification(AuthorityContainment|Containment|TimeFixture)' -count=1 -v; see API and settlement format. NewConsumer always returns typed activation refusals on consumption until the independent witness and native path are qualified Isolated test-owned records, original evidence and receipt files under TMPDIR; logs belong in private scratch. No real clock service or account access
Handoff arithmetic consistency (Python 3) python3 tests/time-handoff-vectors.py; checks the documented vectors, source/reserve/cap assumptions, exact negative predicates and strict deadline neighbour Unit-check output only; no codec, native timing, consumer-use implementation or qualification evidence. Logs belong in private scratch
Retained-original interface (inactive, Linux) go build ./timeconf; go vet ./timeconf; go test ./timeconf -run '^TestClosedOriginalReader$' -count=1; see reader semantics Compile and typed closed-refusal evidence only; no accepting reader, handoff or native qualification. Capture logs in private scratch with the same toolchain/TMPDIR rules below
Consumer time fixtures (Linux, tests only) go test -tags=swarma_timeconf_fixture ./timeconftest -count=1; default imports refuse activation. Import only from tagged _test.go files; see consumer fixture guidance Synthetic records and receipts in test-owned empty mode-0700 directories under TMPDIR; fixture authority is excluded from default production builds
Inactive handoff controls (Linux) `go test ./timeconf -run ’^(TestHandoff TestVerifyWindowCompiledPurity)’; go test -tags=swarma_timeconf_fixture ./timeconf -run ‘^TestHandoff’`; API and limits
Go public time provider Build the separate consumer with go test ./timeconf -run '^TestExternalModuleConsumer$' -count=1 -v; its test module lives in testdata/timeconf-consumer and also checks that test-only exports are unavailable Consumer executables in test-owned temporary directories; no system policy or collector is accessed
chrony / chronyc (optional, Linux) Independent time reports through fixed bounded commands and protected recursive sourcedir/confdir inventory; collector execution requires Linux 5.11+, proc access and the explicit timeconf.CollectorEntry() hook for descriptor isolation. Run the read-only diagnostic with go test -tags=timeconf_smoke ./timeconf -run '^TestHostTimeConfidenceSmoke$' -count=1 -v; see time confidence Parsed numeric verdicts in private scratch logs; no source or system changes
x/sys/unix Pin process identities with Linux pidfds before signalling owned descendants; pinned by go.mod, downloaded by Go commands Go module cache
go-toml/v2 Parse credential-source configuration, including nested and quoted keys; pinned by go.mod, downloaded automatically by Go commands Go module cache; no generated repository artifacts
Python 3 Parse vector JSON with the command in vectors/v0; strict canonical-byte/link checks use temporary validation scripts Terminal and private scratch logs; scripts are not shipped tooling
Codex CLI Measure a protected selected release through swarma-credential-broker qualify-codex --executable "$CANDIDATE" --evidence-dir "$EVIDENCE" --fixtures; the isolated version/help/schema/catalog commands and tagged checks are in qualification Bounded measurements in private run.json; every candidate process runs under the egress boundary in a fresh empty HOME/CODEX_HOME, removed afterwards
systemd user tools (Linux) Inspect containment with systemctl --user show <probe-unit>; a bounded probe can use systemd-run --user --unit=<probe-unit> --property=KillMode=control-group --property=RuntimeMaxSec=5s /usr/bin/true User-manager state and private scratch evidence; stop only the probe’s own unit
godbus/dbus v5.1.0 Direct D-Bus transport in internal/authowner; fetch with "$CURATOR_GO" mod download github.com/godbus/dbus/v5; checks below exercise it Module cache and go.sum; no token material in unit properties
Synthetic owner lifecycle controls GO="$CURATOR_GO" GOTOOLCHAIN=local "$CURATOR_GO" test ./internal/qualify -run '^TestOwner(TransientAmbiguousPair|TransientBackoffResolution|RotationCrashPair|CleanupInterruptedPair|DaemonDeathPair|ReplacementContentionPair|Parallel.*|LifecycleRows)$' -count=1 -v; see scope and budgets and closed close-timeout diagnostics Generated roots, synthetic native bytes and parent-bound artifacts under test-owned TMPDIR; no real account or network endpoint
Owner close regression overlays GO="$CURATOR_GO" "$CURATOR_GO" test -race -p=1 -count=1 ./internal/qualify ./internal/egress -run '^Test(OwnerClose.*|OriginStopTerminalTransition|OriginOvertakenCloneStrictRefusal|OriginMissingTaskLeaderTransition)$'; diagnostic contract, closed labels and overlay controls Test-only overlays under TMPDIR; optional absolute OWNER_CLOSE_OVERLAY_DIR retains diagnostic overlays. Nested diagnostic tests inherit race instrumentation automatically
Qualification command swarma-credential-broker qualify-codex --executable "$CANDIDATE" --evidence-dir "$EVIDENCE" --fixtures; live syntax, tagged real-candidate checks and exit codes in qualification Owner-only run.json with isolated measurements, egress summaries and typed launcher diagnostics; protected admission fence beside static configuration. With protected --fixture-config, thirteen transport/admission/lease rows and seven fake owner-core rows execute paired controls with attested origin and protected artifacts; two runner rows also pass under the measured-code testimony contract; peer remains UNRUN pending its origin authority (see Execution evidence origin), so no qualified entry is published
Synthetic owner checks (Linux/amd64) go test ./internal/qualify -run '^TestOwner' -count=1 -v; generated private state, fake manager/native peer/time and real owner/store/lease libraries Test temporary roots are removed after both attested owner epochs join; row artifacts use the selected private evidence directory. No actual account, vendor execution or production activation
Go egress launcher GO="$CURATOR_GO" GOTOOLCHAIN=local "$CURATOR_GO" build -o "$TMPDIR/egress-launcher" ./internal/egress/cmd/launcher; narrow checks and tagged version/HTTP probes are in egress boundary Explicit private scratch: executable, bounded boundary JSON and connect trace; no account access
Go Build with "$CURATOR_GO" build -o "$TMPDIR/swarma-credential-broker" ./cmd/swarma-credential-broker; vet with "$CURATOR_GO" vet ./...; format-check with "$("$CURATOR_GO" env GOROOT)/bin/gofmt" -l . Binary and captured logs in the selected private scratch directory; format-check output must be empty
Runner trace origin (Linux/amd64, no row credit) GO="$CURATOR_GO" GOTOOLCHAIN=local "$CURATOR_GO" test -race ./internal/egress -run '^TestRunnerOrigin' -count=1 -v; see testimony scope Synthetic runtime/runner fixtures and nested boundary reports under TMPDIR; capture logs in private scratch, using the host resource wrapper when required
Runner completion exchange (Linux/amd64, no row credit) GO="$CURATOR_GO" GOTOOLCHAIN=local "$CURATOR_GO" test -race ./internal/qualify -run '^TestRunnerTestimony' -count=1 -v; closed post-Command exchange and typed outcome checks Private short TMPDIR for the measured case, seqpacket listener and synthetic app-server; capture logs in private scratch with the required host wrapper
Runner parent effect integration (Linux/amd64) GO="$CURATOR_GO" GOTOOLCHAIN=local "$CURATOR_GO" test -race ./internal/qualify -run '^TestRunner(Parent.*|WatcherCompleteness|AdmissionExecOnly)$' -count=1 -v; traced/testimony pairs with parent broker, store and filesystem checks Synthetic cases and bounded observer data under a short private TMPDIR; logs in private scratch with the required host wrapper; observations alone cannot grant artifact credit
Runner artifact gate (Linux/amd64) GO="$CURATOR_GO" GOTOOLCHAIN=local "$CURATOR_GO" test -race ./internal/qualify -run '^Test(RunnerArtifact.*|RunnerParentImageMeasurement|RowsHarness)$' -count=1 -v; accepted-image, outcome, private proof and paired artifact checks Protected synthetic row artifacts and explicit measured-code-testimony report entries under test-owned TMPDIR; use the host resource wrapper; no production tuple publication
Hosted Linux CI .github/workflows/linux-ci.yml; exact local module/build/vet/format/test commands and the host-fixture inventory are in Linux CI. The test step uses SWARMA_TEST_UNPRIVILEGED=1 and adds a bounded egress/wire/store race check Verbose hosted job logs; local logs and fixture scratch belong outside the versioned tree; no account credentials or qualified entries

Create a short, real scratch path outside the versioned tree (no symlink), then run these package-scoped checks. Socket tests provision their own mode-0755 subdirectories; the scratch directory can remain private. The default eight-second deadline is exercised separately; -short excludes only that longer test. The optional peer qualification is a separate binary whose PENDING exit cannot be mistaken for a green package test.

export TMPDIR="$(mktemp -d /tmp/broker.XXXXXX)"
export GOTOOLCHAIN=local
"$CURATOR_GO" build -o "$TMPDIR/swarma-credential-broker" ./cmd/swarma-credential-broker
"$CURATOR_GO" vet ./...
"$("$CURATOR_GO" env GOROOT)/bin/gofmt" -l .
"$CURATOR_GO" test -short -count=1 -timeout=180s ./internal/wire ./internal/policy ./internal/store ./internal/owner ./internal/lease ./internal/server ./cmd/swarma-credential-broker
"$CURATOR_GO" test -short -race -count=1 -timeout=180s ./internal/lease ./internal/server
"$CURATOR_GO" test -short=false -count=1 -timeout=15s -run '^TestDefaultRenewDeadline$' ./internal/lease
"$CURATOR_GO" test -c -tags=peeraccounts -o "$TMPDIR/peer-qualification" ./internal/server
"$TMPDIR/peer-qualification" -test.run '^TestConfiguredPeers$' -test.v
"$TMPDIR/peer-qualification" -test.run '^TestConfiguredPeerConnect$' -test.v

The standalone qualification commands require BROKER_TEST_PEER_CONFIG, pointing to a broker-owned 0600 JSON fixture configuration with exactly allowed_peer, foreign_peer, socket_directory, and helper_executable. The first two values are configured OS account names, resolved privately at runtime. The foreign UID must differ from broker and allowed UIDs. The socket directory must already be daemon-owned mode 0755, with intended ancestor permissions, and the helper must be an operator-installed copy of the same peer-qualification binary accessible to those accounts. The gate uses sudo -n -u only for these configured accounts and verifies the helper’s effective UID. It never creates accounts or changes socket permissions. The helper keeps tokens in memory and emits only a lease ID. Missing configuration, unusable accounts, an inaccessible helper or socket returns 69, PENDING, with no qualification credit. A protocol assertion failure returns 1. Normal tests always exercise the actual same-UID kernel path; injected peer failures are model coverage and do not qualify foreign-account behavior. The separate connection test treats a started helper’s inability to connect as an assertion failure; its positive control uses the same configuration and binary.

Daemon configuration and current boundary

This is the existing static extraction policy, not service-principal or use-through-service authorization. The proposed mode requires a separately published compatible dialect and policy; no new configuration field, method or credential-holding service is enabled by these daemon commands.

Run swarma-credential-broker daemon --config <protected-config> and swarma-credential-broker status --config <protected-config>. Use --init-store with daemon only to create new, empty metadata directories; it never adopts a nonempty store whose installation marker is missing. Existing socket paths are refused. The socket is created with mode 0666 in an existing daemon-owned directory of exactly mode 0755 outside the store. Startup refuses unsafe directories, ancestors and existing socket-path entries; it does not change directory permissions. Kernel peer credentials and the static UID allowlist authorize clients. The socket permission notes describe the checked R2 ancestor guarantees and the stricter dedicated-service requirements. Cross-UID reachability is an installation qualification gate. Store directories are 0700; records and stable lock files are 0600. Configuration is a regular, broker-owned 0600 file, with no symlink, duplicate or unknown member. JSON lists must use arrays, including [] for an empty allowlist.

Configuration member Required value
socket_path, store_root Operator-selected absolute paths; distinct socket and protected metadata locations
policy.installation_id Random, never-reused installation identity
policy.policy_generation Positive, monotonically increasing safe integer
policy.broker_uid Configured broker UID; must match the daemon’s effective UID
policy.executable, policy.executable_sha256 Approved absolute executable path and lowercase SHA-256
policy.max_lease_seconds Positive finite duration, normally 3600
policy.time_confidence Optional protected time-confidence policy; absent means off, broker backward tolerance must be zero, production owner remains stopped
policy.accounts Array of the account entries below

Each account has label, vendor_account_id, allowed_uids, profiles, endpoint, release_version, qualification_id, enabled, and network_required. Account labels and vendor IDs are unique. Endpoints use HTTPS. Static admission requires the kernel UID, profile and account allowlist; clients cannot supply authority through a binding. The refresher subset uses release 0.163.0, the external-token channel and no enforced network profile. A qualification reference in configuration does not activate an owner.

SIGHUP rereads protected configuration, requires a higher generation in the same installation and unchanged socket/store locations, then closes old connections. Newly added accounts require their protected stores to be prepared and the daemon restarted. SIGTERM and SIGINT stop this daemon’s listener and connections. Diagnostics contain fixed codes only.

The auth-owner interface is in internal/owner. Its adapter must establish writer absence, durable outcome, account identity, independent freshness, trusted time and the exact release qualification before returning a usable snapshot. Qualification carries the matching policy generation, immutable evidence reference and executable digest; a stale qualification cannot survive policy replacement. Its refresh method receives the expected generation and must serialize writers across replacement. The lease engine holds no state mutex during owner I/O. After that I/O, it checks lease state and authority and registers the publication under policy/account fences, then writes outside those state locks. Release closes new publication admission for the lease, revokes its registered writes and waits for them to stop before durable release acknowledgement. Policy replacement closes admission and does the same for the old generation before publishing its durable successor. Revocation interrupts the affected write with an expired socket deadline. The writer waits for that interrupt to finish before retirement or reuse of the connection, so a fully written frame preserves the connection for its following release receipt. A partial frame fails its write and closes the connection; it is never a successful delivery. The write deadline also ends at the lease/token/account authorization limit.

Arrival deadlines start before lookup. A lease-label index avoids locking unrelated accounts, state admission is cancellable, and expired-waiter cleanup never holds up the caller’s timeout response. When the last waiter leaves a queued operation, cleanup removes both its admission entry and physical FIFO entry while preserving the order of remaining operations. Per-connection writer contention keeps the original request deadline; a non-draining socket cannot serialize other leases’ state transitions. Filesystem publication also uses revision CAS outside the request state lock. The owner scheduler uses the shared proactive gate; admitted demand suppresses proactive work. The normative connection request lifecycle defines ID reservation and retirement, response completion, and the separate queue, waiter, writer and publication resources. Before admitting a refresh after a snapshot, the engine checks for live demand. An already admitted attempt may reconcile under the manager lifetime, even when its response waiters disappear; an abandoned snapshot starts no new refresh. Durable time watermarking, attempt intent, containment, vendor-store reload, recovery and backoff belong to that adapter. Integrations must supply the conservative authorization clock through lease options. No command enables the test fake or bypasses the stopped production adapter.

The store root reserves policy-watermark.json (policy-watermark/1) for the installation’s monotonic policy floor. It is flushed before initial authority or a replacement generation becomes visible, including when no lease has yet been written. Startup refuses a policy below that floor or any retained lease record; uncertain watermark publication closes admission until restart. Missing watermark evidence is initialized only in a fresh store, never reconstructed from an existing account directory. Older experimental stores need explicit offline migration; --init-store cannot erase this fence.

Within account directories, lease-<id>.json belongs to the lease engine and owner-*.json is reserved for the contained owner (intent, evidence, checkpoints and qualification). The store still checks canonical bytes and protection for all records. The owner must validate and reconcile its namespace before returning a usable snapshot; the lease engine ignores that namespace and rejects unknown non-owner records. Checkpoints use expected-revision atomic Account.Put; attempt history uses immutable Account.Append with attempt-wide increasing revisions.

All record writers share the readers’ inclusive 1 MiB canonical-byte ceiling. Oversized writes return store.ErrTooLarge before filesystem mutation and retain the previous record; see record size and caller handling.

Lease metadata contains only protected digests, generations and authority. Tokens remain in memory and framed socket responses. The canary lifecycle test scans all metadata writes at durability checkpoints and all status output, including full token and digest prefixes. This in-process test does not capture daemon stdout/stderr and supplies no process-log qualification. Tests also cover canonical framing, schema closure, queue/capacity bounds, lost responses, cancellation, FIFO, policy replacement, expiry, uncertain publication, symlinks and restart.

The vector tests instantiate role UIDs, binding digests and access tokens from fixtures. All transport and renewal vectors exercise their core contracts; renew-late uses a shortened deadline and the real eight-second default has its own test. Runner callback/turn effects and admission source/home-conflict vectors are covered by the runner fixture tests; live release qualification remains pending. The contained owner now exercises refresh recovery with a fake manager and vendor; the core’s older snapshot tests remain separate evidence. Enrolment, cutover, independent restore reconciliation and actual vendor qualification remain deferred. See the owner coverage and limits.

Contained owner checks

Owner tests build the focused, race-enabled internal/authowner/testdata/vendor fixture once with GO (or the current Go toolchain), under TMPDIR, and remove it at exit. Every owner construction still hashes that executable; large test sequence tables are excluded from the fixture image.

internal/authowner implements the refresh adapter as a library. The daemon command still uses its stopped adapter: enrolment, exact release qualification and independent time/restore confidence must precede activation. The library constructor performs recovery before admitting snapshots. A real manager also requires a successful empty-home Probe using an approved token-free echo helper, and the owner process must belong to the configured daemon service. The helper is supplied explicitly by installation; no ambient executable is selected.

Run only the affected packages. Put TMPDIR in an absolute private scratch directory outside the checkout and preserve the configured caches:

export GOTOOLCHAIN=local
"$CURATOR_GO" test -race -short -count=1 -timeout=90s ./internal/authowner ./internal/store ./internal/owner ./internal/lease
"$CURATOR_GO" test -race -tags=realmanager -count=1 -timeout=60s ./internal/authowner -run '^TestReal'
"$CURATOR_GO" vet ./internal/authowner ./internal/store ./internal/owner ./internal/lease ./cmd/swarma-credential-broker

The second command needs a reachable systemd user bus, cgroup v2 and required service sandbox features. Failure is a failed gate, never a skipped success. Each test creates a random scb-test-<random>- prefix for its own daemon, readiness probes and writers. Daemon unit and writer prefix are configurable. Cleanup stops and unloads only allocated names on every test path, then requires an exact not-found response for each name. Never substitute a deployed daemon name or perform manager-wide cleanup. Verbose test logs contain each allocated name and its cleanup result; capture those logs in private scratch.

Real-manager tests verify the 120-second configured ceiling and exercise runtime expiry using a shorter control. They measure the two-second stop timeout with a SIGTERM-ignoring grandchild and confirm recursive cgroup absence. They do not measure a full 120-second elapsed run or qualify the native vendor. Native-vendor refresh rows remain PENDING: a refresh URL override does not isolate background vendor egress, so no native-vendor test entry point is shipped.

License

Apache License 2.0 — see LICENSE and NOTICE.

With protected fixtures on Linux/amd64, the qualification row harness credits twenty attested transport/admission/lease/owner pairs and two runner pairs with protected artifacts. Runner entries use the explicit measured-code testimony class. Peer remains UNRUN pending its supervisor-origin decision; see Execution evidence origin.

Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   APPENDIX: How to apply the Apache License to your work.

      To apply the Apache License to your work, attach the following
      boilerplate notice, with the fields enclosed by brackets "[]"
      replaced with your own identifying information. (Don't include
      the brackets!)  The text should be enclosed in the appropriate
      comment syntax for the file format. We also recommend that a
      file or class name and description of purpose be included on the
      same "printed page" as the copyright notice for easier
      identification within third-party archives.

   Copyright [yyyy] [name of copyright owner]

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.