Skip to content

Latest commit

 

History

History
1750 lines (1516 loc) · 105 KB

development.md

File metadata and controls

1750 lines (1516 loc) · 105 KB

Development

Prerequisites

All supported versions are declared in tools/versions.env. Run:

make tools

The check is exact and fails with an actionable list when a tool is absent or has drifted. The current foundation expects Go, Node.js, npm, Docker Compose, Docker Buildx, Terraform, Yandex Cloud CLI (yc), YDB CLI, and Goose. Cloud tools are validated here even though the first local process only needs Go and Docker.

Tool Pinned version Installation source
Go 1.26.8 go.dev/dl
Node.js 24.19.0 nodejs.org downloads
npm 11.17.0 npm install --global [email protected]
Docker Compose 5.3.1 Docker Compose install
Docker Buildx 0.36.0 Docker Buildx install
Terraform 1.15.5 HashiCorp releases
Yandex Cloud CLI 1.22.0 Yandex Cloud CLI install
YDB CLI 2.33.0 YDB CLI downloads
Goose 3.27.1 Goose releases

For Goose, the reproducible Go installation command is:

go install github.com/pressly/goose/v3/cmd/[email protected]

The vendor installers for yc and YDB may install a newer release. Run make tools afterward; update tools/versions.env in a reviewed change instead of silently using mixed versions.

Do not use a checked-in file for credentials. .env.example contains safe defaults and an empty token slot only. On macOS, a developer can place a token in Keychain once:

security add-generic-password -a "$USER" -s sessionless.telegram-bot-token -w

Inject it into the process environment for the current shell:

export TELEGRAM_BOT_TOKEN="$(security find-generic-password -a "$USER" -s sessionless.telegram-bot-token -w)"

On other systems, use the OS credential store or a password manager that can export into the child process environment. Never write service-account JSON or subscription credentials into this repository.

Fast path

Entity registry and state storage

Maintain the entity registry when table, primary-key, consumer or retention decisions change. It separates observed physical schema from the logical durability decisions in state storage simplification. Run make entity-registry-check and make entity-registry-test; both also run through make docs-check. These commands read source migrations and registry metadata only. They neither connect to YDB nor authorize schema application. Reports and unresolved reduction decisions belong in #205, not migration comments or the original task description.

Read-only local profile template validation

Build the checker with make local-profile-validate-build. It reads a finite operator-authored template from redirected standard input and the explicitly named worker executable/boot-host/network identity, not an installation or key:

.build/bin/local-profile-validate \
  --executable /absolute/workspace/sessionless/.build/bin/worker-runtime \
  < /absolute/workspace/private-input/operator-template.json

Use the existing localoperator.ManifestV1 shape, not a test fixture or another configuration format. Input is bounded to 256 KiB; no private input, paths or decoder details are printed. Redirect a finite file: the byte limit does not make an arbitrary blocking stdin reader interruptible. The executable is observed, never executed. Validation creates no Source, IDs, grant, receipt, key, file, SQL state, process or network request. It cannot prove possession of source.key, independent review, actual model capabilities, service-price truth or current Store authority.

The complete prepared template must explicitly supply:

  • Tenant, owner and billing owner; exact literal-loopback /v1 endpoint, model and response-model IDs, server/version/template identity, protocol and auth; capability/data-class declarations, model window, estimator and finite limits.
  • Existing profile/backend/substrate and cost declarations. Retain actual capability/review/calibration bodies and canonical owner-local invoice terms. The full agent profile also requires MCP grant and independent price/terms documents, plus search resource grant, expenditure and independent source documents. The restricted text profile must not contain those service declarations. Exact bytes/references and semantic correlations must agree. Hashes do not turn declarations into proof.
  • Observed worker/boot-host/network identity, original body hashes/lengths and key fingerprint. The checker validates the fingerprint's form only; it does not read, create, rotate or authenticate a key.

Leave installation-owned resource/installation/mutation IDs, revisions/state, backend-profile digest, OriginalSource and installed-manifest reference empty. The original installer, not this checker or a copied test, owns those fields. Internally, validation uses a private deterministic DATA-only projection to run the same installed-shape checks; no projected identity or authority is returned.

This complete-template check requires original calibration and the selected profile's exact evidence roles; it does not enable a tool or change the historical one-shot intake's contract. Windows, invoice and applicable service evidence use their canonical validators. The later installer still authenticates actual private files/key, current SQL publication and its real receipt independently.

Template preparation remains separate: the read-only checker neither authors evidence nor generates the private installation. Do not copy synthetic fixture evidence to make validation or installation pass.

Fresh private local profile preparation

Build the explicit tool with make local-profile-prepare-build. It is not a startup step, a model manager, or the profile installer. Supply genuine complete operator-authored ManifestV1 evidence as above, except leave these derived fields empty: key_fingerprint; configuration worker, host and network identity digests; and substrate host/network, outer-harness artifact, egress-proxy artifact/identity, egress-policy and admission-cost digests. Installation-owned fields must also remain empty. Nonempty derived fields are rejected, not silently replaced. All model/capability/price/invoice/MCP/search evidence and body/reference correlations applicable to the selected profile still come from the operator, not from this tool.

Select the mode explicitly in the template's profile.locator.profile before preparation; there is no separate CLI flag or browser override:

  • owned_agent_public_v1 retains the full bounded agent contract and all four actual provider/substrate/MCP/search authorizations. Its tool capability and independent service evidence must be qualified, not copied from a fixture.
  • owned_local_text_v1 is the restricted local qualification mode from configured local inference. Use the configured owner-local, no-auth endpoint, public text only, exactly one MODEL operation and an empty tool catalog. Declare tool-call capability as unknown or unsupported, never as proven supported. Disabled service, compaction and tool budgets are zero; MCP/search grant digests are empty, their cost objects and grant bodies are absent, and the manifest has no search expenditure/credential or extra service evidence bodies. Retain the actual capability, review, calibration and owner-local invoice-terms roles with their exact body references. Admission publishes exactly two actual provider/substrate funding records, not four zero-valued placeholders.

Neither mode is inferred from missing fields. An existing installation cannot be switched across these tags by editing its manifest or receipt; use the reviewed fresh-installation procedure if a different mode is required. The text mode does not support files/images, tools, search or derived compaction. It is not a replacement for the full managed or attached MVP path, and it does not authorize another model call. The same validation, preparation, installation and normal BFF/reconciler/worker commands below apply to either selected tag.

Choose an unused canonical absolute installation path whose existing parent is owned by the operator with exact mode 0700. Redirect a finite template file (at most 256 KiB), and explicitly confirm this private-file operation:

.build/bin/local-profile-prepare \
  --installation-root /absolute/workspace/private-local/new-installation \
  --executable /absolute/workspace/sessionless/.build/bin/worker-runtime \
  --confirm 'PREPARE LOCAL PROFILE' \
  < /absolute/workspace/private-input/operator-template.json

The tool observes the explicit executable and boot-host/network identity but never executes it. It derives their canonical digests and the existing connector/policy/cost digests, generates a 32-byte private key, and runs the complete template validator before creating output. It exclusively creates a 0700 installation containing only 0600 manifest.json and source.key, then syncs the files, directory and parent. Keys and template contents are not printed. Same-UID host trust remains unchanged; this is not a host sandbox.

An existing path, partial output or uncertain failure is never deleted, repaired, reused or overwritten. Reconcile it explicitly; do not automatically retry under another name or regenerate keys. A success message means private declaration files exist, not installation, independent evidence acceptance, endpoint qualification or permission to execute. The prepared manifest may be checked with the read-only checker above; actual private-file intake and SQL publication remain the separate installer below.

Preparation performs no Source intake, installation-ID allocation, grant, receipt, SQL operation, daemon start, download or endpoint request. Building and testing the tool does not authorize preparing a real owner profile or starting/calling a shared Ollama host; those require their own bounded approval.

Explicit local profile installation (operator tool)

Build with make local-profile-install-build. This tool does not run as part of stand startup or deployment. It neither creates operator declarations/keys nor downloads a model, starts a daemon or probes the model endpoint.

The operator must supply SESSIONLESS_ENVIRONMENT=local, YDB_CONNECTION_STRING, and three canonical absolute paths: WEB_LOCAL_INSTALLATION_ROOT (existing private source installation), WEB_LOCAL_WORKER_EXECUTABLE (the declared installed worker), and WEB_LOCAL_PROFILE_RECEIPT_FILE (an unused destination in a private directory). Attached mode must be disabled in this invocation. Run .build/bin/local-profile-install and enter the exact confirmation INSTALL LOCAL PROFILE. This is an actual profile publication, not a dry run; source/fixture test permission does not authorize running it against a service.

After database readiness, the tool durably reserves the unused receipt path, opens one fresh original Source, calls the existing Store publisher, accepts its exact receipt, and writes/syncs/closes that private receipt before reporting success. Existing, empty, partial or uncertain output is never overwritten or deleted. On failure, reconcile the original publication and retained slot; do not delete the file and reinstall with fresh IDs. The shared bounded reader returns historical DATA only. Normal startup must use that receipt with OpenExisting and retain current Source/Store checks, never reinstall per message or treat receipt text as execution permission.

This tool delivers the first-install handoff only. Worker and control-plane startup are described below. Their source wiring is not acceptance of the joined Web/queued/runtime scenario or the separately authorized real-model demo under #218. Defaults and schema are unchanged.

Local per-delivery worker ownership (library, default off)

worker.NewLocalRuntime accepts the original opened operator Source, its accepted profile receipt, borrowed DB/blob clients and ordinary worker configuration. Construction performs no SQL, socket or invocation effects. Each RunOnce(ctx, queue) creates fresh preparation/operation issuers, the original providerloopsession.LocalV1 factory and WorkerState() facade, then one ordinary Manager. The entered worker uses the shared finite agent engine; Runtime does not start or reserve a second invocation. Every return attempts bounded close/join of that delivery's session, including empty and duplicate deliveries. Cleanup failure remains an error, not evidence of completed joining or permission to replay work. It never closes the borrowed Source or DB. Do not open a fresh installation or retain one session/Manager across queue deliveries.

This library does not enable a profile. Controlled running-lease fixtures do not establish fresh canonical queued admission or real-model/Web outcomes.

Normal local worker startup (default off)

After the explicit installation, select WORKER_LOCAL_EXECUTION_ENABLED=true with SESSIONLESS_ENVIRONMENT=local and the same three canonical WEB_LOCAL_* paths above. The receipt destination now refers to the existing accepted receipt, not a new output path. Missing/malformed selection, disabled selection with stray local paths, mixed attached configuration and non-noauth profiles fail closed. There is no alias, endpoint discovery, automatic reinstall or paid-provider fallback. The ordinary deterministic worker remains the default when no local selection or paths are supplied.

worker-runtime reads that receipt and opens its original Source once for the process. Both its SQS path and each message of an HTTP-trigger batch use LocalRuntime.RunOnce with fresh invocation owners. The original Source is installed as all three profile/spending/effect-source verifiers; the existing four startup cutover checks remain mandatory. Process cancellation reaches active HTTP callbacks; shutdown denies late callbacks and waits up to 30 seconds for their invocation cleanup before Source and bounded database-client closure. An unproven drain is a failed process shutdown, not retirement proof: borrowed dependencies are not closed underneath active work. Local errors retain only content-free expected retry/redrive/cancel/policy classifications; invocation cleanup failure remains unexpected. The worker never starts/stops the operator's model server.

This is source wiring, not evidence that a new message can be admitted without a subscription. That separate canonical capacity/admission/release contract, Web integration, two productive messages and the authorized real-model demo remain under #218. No command, profile or cloud route is enabled by this code change; running against services requires its own operation authority.

Normal local control-plane startup (default off)

For an explicitly selected local deployment, set WEB_LOCAL_EXECUTION_ENABLED=true in both web-bff and reconciler, with SESSIONLESS_ENVIRONMENT=local and the same three existing WEB_LOCAL_* installation/executable/receipt paths described above. The worker separately requires WORKER_LOCAL_EXECUTION_ENABLED=true. Every process reopens the same original installation with OpenExisting; only the explicit installer publishes a profile. Missing/invalid paths, non-noauth profiles, cloud environments and mixed attached-resource configuration fail closed. No model server is started, downloaded, probed or implicitly substituted. The BFF never performs inference.

The BFF installs the original Source into the three Store verifier slots and borrows it for the trusted local binder and resource-status view. The allocating reconciler installs the same verifiers for ordinary dispatch/wake/recovery. Compute status reads current writable Session/member/participant and original profile/audit at database time, without creating an Attempt, publishing funding, reserving capacity or touching the inference endpoint. Its public kind=local_development observation has no subscription, entitlement or provider quota fields. The UI labels it as execution on the owner's machine, not managed cloud compute. Readiness permits submitting to the queue; it is not a reservation or a promise that execution capacity is currently free.

Submit retains duplicate-first canonical lookup. A new message uses the existing local binder and missing-component publisher/recovery path; canonical commit and scheduler admission independently recheck current authority. Endpoint, profile, owner and payer cannot be selected by the browser. Local runs keep the explicit no-subscription capacity association, including historical labels after the installation is closed. Default deterministic and explicit attached modes retain their existing behavior; this local deployment does not mix those modes in one configured Store or replace either required MVP route.

Before enabling local writers, apply the separately reviewed additive slot/expiry schema through its authorized procedure and drain executors that do not support the explicit local arm. Source/fixture permission does not authorize applying migrations, running the installer/stand, contacting a model or enabling a cloud profile. Joined normal Web ingress, refresh/re-login, worker integration and a finite owner-approved real-model run remain separate acceptance evidence.

Attached execution composition (default off)

The normal Web BFF can use the existing attached scheduler admission path with WEB_ATTACHED_EXECUTION_ENABLED=true and WEB_ATTACHED_RESOURCE_PINS containing a JSON array of sessionlessharness.AttachedResourcePin values. Each entry pins the tenant, owner, subscription resource, worker, enrollment generation, capability and policy digests, and an explicit expiring harness-binding template. The template has no run, attempt or placement digest; ingress fills those from the canonical request. Configuration is bounded to 64 entries and 64 KiB, rejects unknown fields, and cannot silently fall back to managed work. Enrollment rotation requires replacing the pin. Live worker authority is checked before ingress and again by the existing atomic AdmitDispatch transaction.

ATTACHED_WORKER_CONTROL_ENABLED=true with an explicit ATTACHED_WORKER_CONTROL_AUDIENCE mounts authenticated challenge, attach, exchange, sealed-input and output-receipt routes in the normal control API. This requires the existing YDB and Object Storage configuration, but not a Telegram token or webhook secret. With both Telegram and attached control off, the control API remains health-only. Both flags default to false; malformed or partial enabled configuration fails startup.

Generation-enabled subscription resources (default off)

For the server-side generation path, set ATTACHED_RESOURCE_GENERATION_ENABLED=true and ATTACHED_RESOURCE_GENERATION_CONFIG_FILE to an absolute, clean path to a trusted operator metadata file. The file contains exactly {"version":1,"baselines":[...]}; each entry is the complete AttachedResourceGenerationBaselineV1, including the approved scope-free binding, all six evidence bodies and explicit generation-only delegation. Digests alone, worker reports and an OAuth file cannot supply this baseline. It contains no provider credentials.

The loader permits at most 64 entries, 64 KiB per baseline and 1 MiB for the whole configuration. It rejects symlinks, non-regular or group/world-writable files and invalid/unknown fields; root-owned read-only metadata is allowed. Each Web BFF, control API and reconciler loads its own identical approved configuration once at startup, not per request. Within a process the Store and binder use the same immutable registry instance. There is no live reload or remote baseline-install endpoint.

The Web BFF still requires WEB_ATTACHED_EXECUTION_ENABLED=true; with a nonempty generation registry, WEB_ATTACHED_RESOURCE_PINS may be absent. Fixed pins may coexist only for different resource and worker identities within the exact tenant/owner scope. A collision or configured registry with Web attached execution disabled fails startup instead of selecting a fixture. The control API also requires its existing attached-control flag and audience. Only an installed nonempty registry mounts the metadata-only POST routes /attached-worker/v1/resource-generation/publish and /attached-worker/v1/resource-generation/read.

These routes use the existing current worker connection bearer, not provider credentials or a remotely supplied secret digest. The closed versioned DTOs are defined in resource_generation.go. Requests and successful responses are at most 4 KiB. The normal server bounds request reads to 15 seconds without adding a response write timeout to long polling. The service performs one transaction, without automatic mutation retry or hidden readback; the original Session client must keep publication and its one optional exact readback inside the same original 15-second window. An unknown result is not an ACK or permission to repeat credential/provider effects. The explicit native Session/client composition is described below.

Fresh admission rechecks the current metadata and full projected binding in the allocating transaction. It never upgrades an old outbox/job to a later generation. Historical exact reservation/job/attempt reconciliation keeps its original authority. Removing a registry does not make a resource with published metadata fall back to an unchecked fixed pin. The original fixed-resource path is preserved for resources with no generation metadata.

Migration 00132_add_attached_resource_generation.sql adds one nullable column to the existing subscription row; source changes do not authorize applying it. Generation publication does not activate entitlement, extend evidence expiry or enable native execution. Native consumption, joined proof and live resource activation retain their #234/#235/#133 owners; source composition is not rollout evidence.

The three generation-head counters use strict canonical decimal JSON strings, not JsonDocument numbers, across storage and nested metadata HTTP heads. The internal counters and checked CAS arithmetic remain uint64; existing unrelated baseline/evidence/authentication encodings do not change. Zero-head internal denial carriers may serialize but are never valid heads or success responses. This source-only correction precedes initial generation-head deployment; it does not authorize converting retained data or applying the additive migration.

Generation-aware native library composition (default off)

This is an explicit library path, not a command-line activation or promotion of an existing native profile. codexexec.NativePreparedConfigV3 contains a complete immutable baseline, an explicitly qualified NativeProfileV3, the concrete attachedresourcegenerationsession.OwnerV1, and the SAME concrete ownerlocalcredential.Lifecycle used for credential currentness and invocation. attachedworkerstack.NewNativeGenerationV3 selects this path. The separate NewNativeV3 constructor retains its fixed-evidence semantics; neither silently selects the other.

Use attachedworkersealedinput.NewNativeSubscriptionServiceV1 and attachedworkerdaemontransport.NewNativeSubscriptionBoundMaterializerV1 for the normal Codex subscription input path. It derives one IssueRequest from the canonical Run/Attempt/Lease and original resource, preserving content and accepted-attempt checks. The credentialless and test-provider constructors are not promoted. The actual initial/reconnect runtime constructors require the configured concrete metadata owner as their exchange factory and the same lifecycle; wrappers or matching declarations are not substitutes.

For an inline-output profile, explicitly construct attachedworkersealedinput.NewInlineSessionSourceFactoryV2 with the canonical HTTPS origin, HTTP client and original exchange factory. Use this SAME object as the generation owner's source delegate, the normal materializer's source, the V1 failure receipt publisher and the inline publisher. Only the genuine Session's one-shot Open supplies its accepted bearer; do not extract a token or construct a separately authenticated inline client. Input, failure and inline clients share retirement/cancellation, including while foreign Open is still pending. Ordinary source factories do not implement the inline-publisher interface. The factory adds no execution grant, retry, output journal or new deadline; the original adapter retains receipt burns and body ownership.

After the original Session is Ready, NewNativeGenerationPreparedAdapterV3 binds it to that Stack and synchronizes metadata before the first available heartbeat. Fresh idle polls synchronize again under the existing adapter serial gate. Unchanged state uses the exact current acknowledged head; changed metadata gets one publication and at most one exact point read within the original 15-second budget. Idle reconnect uses a fresh connection source and metadata owner with the same baseline/lifecycle, and reads the current head without rotation or another publication. After that exact recovery ACK, a later own WriteBack may publish its successor through the same bounded CAS path; the connection keeps its original reconnect identity. Retired sources and active recovery journals cannot be reused as fresh admission.

Each authentic accepted input is privately projected and checked against the current ACK before the original outer lifecycle's Issue. Its independent evidence stays with that attempt; no later generation mutates an old slot or shared configuration. The accepted dynamic policy digest remains distinct from the descriptor-pinned, recomputed static installation policy. V3 qualification does not reinterpret the V2 policy identity.

Own successful WriteBack may leave an original N receipt while local metadata has advanced to N+1. New-input ACK checks do not gate that original receipt, finalizer, journal, exact terminal ACK or retirement. Failed N+1 synchronization fences new work, not retained result ownership. No additional lifecycle, ACK table, timer, provider retry or credential store is introduced.

The existing attached-resource-generation-ydb-gate runs two sequential checks: the original generation SQL/CAS and uint64 suite, then the explicitly selected ydbintegration-tagged Stack joined test. The latter is not selected by the general ./test/ydbintegration/... package pattern. Both require the existing disposable GitHub CI database; the joined test checks the CI/disposable/loopback and true-data-transaction guards before opening any dependency. Do not run it against a developer's local or shared database or use scripting/fake transactions.

The joined fixture uses a closed installation-only test export, the original Connector/Session, normal native sealed source, canonical ingress and allocating Store transaction, original Stack/Supervisor/concrete credential lifecycle, and real inline receipt/terminal storage. Only its fixed shell workload, object-body peer and in-process HTTP wire are synthetic. Losing a response happens after the actual handler has committed publication or READY; reconciliation must not repeat that mutation/body. Local completion is not durable retirement: the next original poll must convey its ACK and retire the exact server attempt before a successor is admitted or the daemon is drained. Text, JSON, PNG and JPEG inputs, typed output bytes and original-N custody are checked independently of counters. A local tagged compile/skip is not a successful YDB run. A successful disposable run qualifies this source composition only, not physical HTTP-stream deadlines, real-engine isolation, native media/model behavior, OAuth or a WebUI/cloud demo.

Owned synthetic-process/transport tests qualify source composition only. Joined durable receipt proof, platform/profile qualification, real credentials and a useful WebUI turn remain separate gates; no engine, native workload, provider or cloud operation is enabled by these constructors.

Canonical context windows are retained and sealed using the same event/snapshot codecs as the managed worker. Materialization verifies the exact session, snapshot, event window, trigger, immutable references and size limits. Terminal publication uses a ready server-owned receipt, not caller-supplied completion material. This composition does not activate a real provider or grant a credential: the default sealed-input constructor remains credentialless, and the explicit native-subscription successor above is not mounted by default. The existing credential-bearing provider proof uses an integration-test adapter; real attached-provider activation remains the separately reviewed #133 workstream. It is required for the selected attached MVP path, independently of managed implementation. #176/#180 own the agent-harness minimum/design; #175 owns managed composition and #90/#92 its platform and rollout proof.

make web-ci
make generate
make test
make build
make integration

make web-ci performs a lockfile-only npm ci, checks generated OpenAPI types for drift, runs Prettier, ESLint, Svelte/TypeScript checks, unit/component tests, and builds the static WebUI. The build is copied into the Go Web BFF embed tree only after stale generated assets are removed. Node.js and npm are exact pins; use make web-tools when only the Web toolchain needs validation. The separately gated make web-browser-install installs pinned Chromium, and make web-browser-test runs the Playwright end-to-end and axe accessibility suites. CI adds Playwright's Linux system dependencies through the same target.

With the locked Web dependencies and Chromium already installed, run make web-produced-citations-test to join the offline two-SEARCH producer and the actual WebUI on desktop and mobile Chromium. The Go fixture writes only the public BFF history, matching history after fixture re-login, and a revoked-session denial to a private temporary directory. Playwright replays those raw bodies on the history route; other API routes remain browser fixtures. It checks ordered accessible links, reload and removal of the answer after a denied poll. It does not open the cited sites, use a real provider or prove live browser login. The existing Web browser CI job also runs this target, using the same pinned Go setup and cold-cache contract as the other Go jobs.

make test checks formatting, runs go vet, unit tests, and the race detector. It sets an explicit 15-minute per-package test deadline for the growing Store/worker conformance suites. The Go verification CI job has a separate 30-minute ceiling for make ci-core-base, including compilation, the first three ordinary race selections, builds, integration and policy checks. Parallel 30-minute go-local and go-connected jobs run make test-ordinary-ci-tail and make test-connected-ci over the complete package roots. A fourth parallel 30-minute Go job, go-runtime, runs the complete four-part make test-mcp-offline gate followed by make test-connected-worker-ci. It adds no Node setup, database/service or credential. Its theoretical twenty plus fifteen minutes of test ceilings exceed the job limit before setup/compilation; they do not prove the combined group fits: a new exact-head CI run must qualify the actual budget. Local make test runs ordinary and connected selections sequentially, even under make -j. Both retain the race detector and 15-minute per-binary bounds. YDB, isolated-security, local-stand and Terraform join all four Go jobs. The unchanged offline attached-worker-security-gate and complete serverless-egress-conformance run in the existing 25-minute isolated security job before YDB startup, without that job's YDB environment variables. All eleven CI jobs are required; images retain every prior dependency and directly join go-runtime. Local/release make ci still requires core, connected tests and both offline gates; see the partition contract. A package pass does not replace unfinished checks, and exact-head CI must measure whether the parallel and isolated jobs fit, including a cold cache miss. No cache hit is a gate or a substitute for checks. These are failure ceilings, not synchronization, correctness guarantees or permission to retry. Diagnose any further timeout at its actual stage rather than automatically increasing the ceiling again. Use the exact source, goroutine stacks and bounded test timings before changing a deadline; the test listed at expiry may have just started after earlier serial work. Individual I/O and cleanup operations keep their own tighter bounds, and no tests or race checks are excluded. The repository-wide rules for deterministic clocks, isolation, cleanup, diagnostics, repeated execution, and exact-commit CI evidence are in testing-best-practices.md. make build writes every component declared by the Makefile to .build/bin. This includes the control plane, Web BFF, local fixtures, isolated worker, and operator-only schema, reset, deployment-lock, and Web bootstrap commands. The Makefile is the authoritative component inventory; documentation deliberately does not duplicate a count that drifts as slices are added.

Private credentialed local session (not activation)

The explicit providerloopsession.NewCredentialedV1 composition implements the local direct-Bearer entry from the #185 credential-entry contract. It is separate from the unchanged noauth NewLocalV1. Its one-use Run consumes the genuine prepared entry, issues one scoped handle and encloses the existing finite MODEL/conditional-compaction engine in one synchronous materialization. Each effect still uses the original Store transaction and before-send gate, including the current canonical credential generation and revocation join. A credential acquired earlier is not later send permission.

The owned transport joins I/O and clears mutable header copies before the materializer returns. Release occurs outside its callback and mutex. The original entry fixes the active deadline and outer cleanup ceiling before Issue; the first final cleanup narrows one absolute deadline shared with Release and the original secret-free terminal owner. Returning that terminal owner is not canonical success: its existing output, cleanup and completion steps remain required. A failure or uncertain send never grants a retry.

The source-level arm does not register a worker/cloud profile, complete the tool/result loop, or enable real credentials, providers or network access. Scripted connected tests use only synthetic Bearer bytes and owned loopback peers. Run the existing make test-ordinary and make test-connected targets with GO_PACKAGE_PATTERNS scoped to ./internal/providerloopsession, ./internal/localloopback and ./internal/ydbstore for local development; required exact-head CI is still repository-wide.

Offline attached transport experiment preparation

The #129 Phase-0 plan prepares three 24-hour observation cohorts and their proposed limits. Run make attached-worker-experiment-plan to print schedule bounds from the canonical poller, and make attached-worker-experiment-test for the offline validator and existing cadence regressions. The planner neither contacts a control plane nor starts a worker; its result is always draft_not_authorized. It is a development command, excluded from deployed component/release assets. No measured cost or approved execution manifest is supplied by this target.

Retired Pi experiment record (historical only)

Pi-specific development targets and integration packages were removed under #213. #203 was cancelled, not delivered. The original snapshots remain recoverable at codex/archive-pi-main (fc47a5809e5411e517b77e48fd0e34cad83779d1) and codex/archive-pi-sdk-experiment (6a8f25c3e7b2a18e78bdc931d77e935543a49d0b); these refs are historical evidence, not active workflows. Local inference endpoint support is tracked separately in #212.

Offline observability configuration

The native observability YAML/runbook owns the configuration format, safe export and separately authorized rollout procedure. These developer commands use the repository-shared Go caches and no cloud client:

make observability-config-check
make observability-config-render
make observability-config-schema
make observability-config-test
make observability-config-fuzz
make observability-canary-render
make observability-canary-schema

The render default is a non-deployable preview under .build, with no private bindings, recipient data, credentials, Terraform plan/apply or notifications. The helper is not a deployed runtime component. The complete ordinary Go suites still cover its packages; ci-core also validates the checked-in YAML catalog.

The isolated synthetic canary has its own strict YAML manifest, separate from the production dashboard/profile validator. observability-config-check validates both sources. Canary render/schema use new owner-only directories selected by OBSERVABILITY_CANARY_OUTPUT and OBSERVABILITY_CANARY_SCHEMA_OUTPUT; the input is OBSERVABILITY_CANARY_INPUT. Outputs are offline PLAN_ONLY console/experiment sheets, not a writer or live permission. No Terraform, device/recipient data, API key or cloud access is needed for an unbound render. Normal cloud-dev alert selection is unchanged.

Content-free operational observations

The operational signal contract describes the closed ops_signal_v1 vocabulary and actual Web/queue owners. The execution owner matrix separates qualified managed/attached hooks from unavailable predicates and inactive profiles. To verify the offline schema, privacy, error classification and unchanged business outcomes:

make ops-signal-test
# Smaller isolated suites, without the scripted SQL/loopback connected fixture:
make ops-signal-unit-test

The target uses the shared Go caches, deterministic injected sinks and ordinary race/shuffle checks. It starts no database, container, cloud client or provider. Isolated signal cases repeat 20 times; the concrete local-owner fixture runs once and twice shuffled within the same three-minute per-command bound. That fixture uses scripted SQL and a test-owned loopback HTTP peer, not a YDB service. All packages remain in the ordinary CI test selection; this target is a focused developer entrypoint, not an alternative release gate.

Worktrees and Go caches

make resolves the repository's Git common directory and shares GOCACHE and GOMODCACHE below .git/sessionless-go-cache across every linked worktree. Go's build cache is content-addressed and safe for concurrent Go commands; the module cache is also normally shared by the Go toolchain.

The Make-backed GitHub workflows declare these same absolute checkout-relative paths at workflow level, before setup-go. Its restore and post-save discover paths through go env GOCACHE and go env GOMODCACHE; Make-only exports do not change the action's environment. See the upstream cache path commands and post-save implementation. This aligns cache contents, not measured performance: a cache miss must still execute every check and fit the unchanged job bounds. No cache is a correctness or readiness requirement; make go-cache-policy-test checks path agreement.

GOTMPDIR, .build/bin, and .build/dockerless stay inside each worktree. They may contain in-progress files, commit-specific binaries, process metadata, logs, and mutable service data and must not be shared.

Inspect the resolved paths with:

make go-cache-status

make clean removes only the current worktree's .build. After all Go commands in every linked worktree have stopped, make go-cache-clean removes the default shared cache. The cleanup target refuses SESSIONLESS_GO_CACHE_ROOT overrides (including those inside the Git common directory) and symlinked cache roots; it never passes an override to its shell cleanup command. Existing checkout-local caches are not migrated automatically.

The fast make ci contract uses fake registry fixtures to verify immutable publication failures and deterministic manifest/receipt separation. The real container identity gate is intentionally separate because it performs ten cold builds:

make image-reproducibility-test

It requires a running Docker daemon (Colima is supported), creates two temporary digest-pinned BuildKit builders and a pinned loopback registry, builds all five images twice from git archive HEAD, and compares config, diff-ID, layer, and manifest identities. Cleanup removes only those uniquely named temporary resources. CI runs this gate on every mirrored commit and retains the second verified set for trusted-main publication.

The Go builder is the Docker Official Image golang:1.26.8-alpine, pinned to OCI index sha256:ce864e7223ac17b1775e6fd0b4c0db580c2eb50e7953a427916379e4b92a1628. The reviewed linux/amd64 child manifest is sha256:6e5de3f5b9fb7e30b8bb2ffe8dcbcbdaa2990f0f31267456eabe83f870a623be, published from docker-library/golang revision f47489bcbda87966b421340c536f39a34d00b45f on 2026-09-01. These values are recorded in build/images.env; make image-build-inputs-test rejects drift between that image tag, its index provenance, tools/versions.env, go.mod, and both Dockerfile defaults. Before its first build, make image-reproducibility-test resolves the immutable index and rejects any linux/amd64 child digest, source URL/revision, or image-version annotation that differs from this reviewed record.

The bounded Codex App Server feasibility evidence, stable protocol subset, subscription-auth boundary, and still-open cloud/policy gates are documented in codex-subscription-worker.md. The selected integration surface, credential locality, and production gates are recorded in codex-integration-surface.md. That Phase A client is intentionally not wired into worker product state yet and never falls back to API-key billing.

The opt-in credential-free SDK/App Server/exec comparator, exact artifact provenance, sanitized aggregate schema, and explicit operator-consent boundary are in codex-surface-measurement.md. Its local Python environment and Codex binaries are research inputs and are not installed or invoked by normal developer or CI targets.

The current memory, tooling/MCP, attached-worker, AI-resource, metering, skills/automation, analytics, administration, and evaluation research is indexed in research/README.md. Those reports preserve evidence, alternatives, open questions, and proposed epic decomposition; they are not production contracts and do not close their research issues by themselves.

The implemented AW-01 owner-scoped identity, enrollment, generation, and deny-first revocation boundary is documented in attached-worker-identity.md. It is a domain and persistence contract only; it does not start a daemon or enable remote work.

The feature-disabled AW-03 bootstrap, immediate heartbeat transport, and presence persistence boundary is documented in attached-worker-transport.md. It does not claim reconnect, dispatch, long polling, or cloud wake-up.

The AW-05a Go daemon core, exact process-supervision contract, credential finalization order, and explicit unsupported-isolation boundary are documented in attached-worker-daemon.md. No developer command or production binary enables it yet.

The feature-disabled AW-05b OCI isolation profile and its explicit opt-in real-engine matrix are documented in attached-worker-oci.md. Run only against a reviewed, explicit local engine endpoint with make attached-worker-oci-integration; the ordinary test/CI path uses deterministic fake-client coverage.

The #132 local execution-stack assembly verifies the manifest-pinned Docker CLI and harness artifacts, reconciles installation-owned OCI residue, and composes the supervisor with the existing credential runner. It remains a library boundary: attached-worker run does not call it and ordinary tests do not contact an engine or provider.

The #137 service package staging and local control adds a single lease-holding, still feature-disabled attached-worker serve mode, a versioned permission-bound local status/doctor/drain/stop endpoint, and exact launchd/systemd-user/rootless-container artifact plan/apply/rollback receipts. make attached-worker-build builds only its native binary; make attached-worker-package-test repeats its focused race/shuffle tests. The opt-in make attached-worker-crash-integration builds that exact binary, starts a test-owned synthetic/denied-credential service, kills its exact PID, and verifies authenticated idle reconnect and lease retirement after restart. make attached-worker-active-crash-integration forks the command dispatch in a test binary with an injected clock, kills its active attempt owner, and verifies that restart fences the non-idle checkpoint without replaying input. The shipped binary retains the 15-minute minimum heartbeat interval; this bounded test does not claim exact-binary active-crash coverage. These fixtures need no provider credentials, Docker engine, OS service registration, or cloud resources; ordinary make test skips both process-kill fixtures. The #79 make attached-worker-security-gate makes the two-owner transport collision/secret-theft and cloned-identity reconnect checks, sealed-input owner and credential denials, HTTP client/poller response-loss fencing (no retry before reconciliation while the peer continues), in-flight active-heartbeat settlement before terminal reporting (or fail-closed cleanup timeout), protocol cancel/revoke fencing, CLI attempt-root/sentinel checks, and both crash/restart fixtures non-optional in make ci. The YDB CI job separately runs make attached-worker-security-ydb-gate after migration: two distinct owners in one tenant hold live claimed attempts under a deliberately colliding worker ID and identity key, cross-owner sealed-input requests are denied, and revoking one worker does not revoke the other's claim. Tagged releases also require this exact-YDB gate before image publication. The YDB target needs YDB_CONNECTION_STRING and credentials appropriate for the already migrated test database. Neither gate enables real provider access. The bounded #79/#166 gate is now closed; rollout-platform isolation and egress remain #133's responsibility, not a new exhaustive #79 reopening condition. CI also runs the focused joined-provider gate first, then the complete security gate, in its own job with a newly started YDB Local alongside the full YDB integration job. Both jobs must pass before runtime images are checked. The provider-first order distinguishes failure on a fresh database from contention or accumulated state after other integration cases without dropping coverage. The tagged YDB gate includes TestAW07TwoActivatedProviderDaemonReceipts: two activated daemons with colliding worker IDs use distinct test-only subscription resources, credential generations, sealed inputs, credential file mounts, receipt publication, and canonical terminal commits. For a focused local diagnosis against migrated YDB, run make attached-worker-joined-provider-ydb-gate. The fake provider issues no real secret and the fake OCI client cannot execute a provider call. The race-enabled joined YDB fixture uses a bounded 45-second per-exchange budget for Docker-backed CI contention; shipped activation retains its 15-second operation and HTTP request timeouts. The YDB gate also holds an owner-A terminal pending, revokes A, and verifies that server-side materialization cannot turn the stale terminal evidence into canonical run finalization while owner B remains authorized. The terminal commit checks the current unrevoked owner-scoped worker and connection head in the same transaction as the canonical write; an already committed terminal may still be replayed idempotently. The same gate reconnects an idle owner A while owner B retains a claimed job, then proves that A's old bearer and generation stay fenced after A claims a new job and after A is revoked; B's claim remains authorized throughout. It also runs a joined TLS/YDB response-loss test: A's presence update commits before its HTTP response is dropped, B progresses through the same control plane, A requires reconciliation without replay, and revoking A does not revoke B's sealed-input authority. This response-loss case alone is not the two-daemon process, artifact, and provider-resource canary proof. The same YDB gate now drives two claimed owners through the real HTTPS sealed-input endpoint with separate context and artifact bytes. A's artifact read is held across revocation: B remains readable, while A's post-read authority check discards the held bytes. Cross-owner bearer borrowing is denied before any object read. This sealed-input case alone does not prove the two-daemon process or provider-resource boundaries. The gate additionally repeats this held-read/revocation case with A and B as separate test-owned OS client processes. Each child receives only an owner-scoped HTTPS bearer and request, not inherited YDB or object-store credentials: a cross-owner request cannot open an object, B reads its own context and artifact while A is held, and A receives no material after revocation. This covers the network/process boundary of sealed-input delivery. By itself it is not an OS sandbox, credential-path, activated-daemon OCI, or provider-resource proof. The YDB gate also starts two separately activated daemon processes with colliding worker locator and identity key against the same TLS/YDB control plane. Each claims its own job and reads its own sealed context and artifact. The synthetic OCI client is test-owned, so this proves transport-to-daemon composition, exact owner-specific object reads, active A revocation without stopping B, B cancellation-to-pending-terminal behavior, exact digest fail-closure, and attempt-root/sentinel cleanup, not a real OCI or provider resource boundary. The joined provider test above adds the test credential and receipt path and completed the narrowed #79 gate. It does not claim a real provider turn or an exhaustive rootless two-owner crash/reconnect matrix. The receipt YDB gate separately pins distinct test-only provider resource IDs and credential generations to the two owners. It rejects a successful receipt without credential-release evidence, then proves an owner-A canonical receipt and TerminalAck leave owner B's run untouched. This is a storage and protocol authority check by itself. The joined provider test above now exercises the activated test-only credential lifecycle. Actual rollout-platform egress and isolation proof remains required by #133 before enabling real credentials. The opt-in make attached-worker-native-integration exercises one exact test-owned launchd or systemd user-service lifecycle. The separate opt-in make attached-worker-rootless-integration runs the same lifecycle on Linux against an already provisioned rootless Docker engine and preloaded immutable execution-base image; the pinned CI gate provisions those inputs. See attached-worker-packaging.md for the registration/start/inspect/drain/stop contract and the #137 evidence. Staging does not register or start an OS service or container. With no explicit private activation profile, the foreground owner remains feature-disabled. The opt-in #165 synthetic/denied-credential path is described in attached-worker-packaging.md; it never enables provider credentials or provider calls. #137/#165 are closed, including the explicit activated rootless service path using narrowly configured host-engine authority. The default unactivated rootless service remains offline. This synthetic platform proof does not enable a real provider or remove #133's rollout-specific egress/isolation gate.

The owner-facing AW-06a information architecture, read-model safety boundary, and control-action gates are documented in attached-worker-ux.md. WebUI and CLI implementations must consume that contract rather than deriving lifecycle state client-side.

The minimum #78/#170 private owner onboarding uses make attached-worker-admin ARGS="..." with existing operator YDB authority and typed confirmation, and make attached-worker-setup ARGS="..." on the owner host. It retains a private pending identity before claim delivery, registers one exact owner resource through production APIs, and completes local state only from the matching receipt. No SQL fixture edits, service startup, provider credentials or activation are implied. Eligibility remains unknown; lost responses replay the same private grant/claim/rotation, not a new key.

The provider-neutral local credential binding, invocation handle, secure materialization, crash recovery, write-back, and deny-first revocation contract is documented in credential-lifecycle.md. Phase B0 is intentionally not activated in worker runtime until the selected profile's credential/isolation/rollout evidence passes. Telegram rollout #18 is not a managed-cloud MVP prerequisite.

The feature-disabled serverless authority, local isolation supervisor, and attested provider-egress/credential composition boundaries are documented in serverless-harness.md, serverless-isolation.md, serverless-egress.md, and the PR-03d Yandex substrate evidence plan. None registers a concrete cloud launcher, provider proxy, secret backend, or production route. The current MVP plan requires this managed cloud path without user-maintained compute alongside the required attached route. #176 research and #180 accepted design precede linked implementation of the bounded loop, compaction, useful constrained MCP and web search; #175 joins that harness into normal Web/control/worker flow, including admitted file/image processing. #90/#92 remain managed evidence gates; #129/#133 independently gate attached rollout. This scope correction does not enable runtime, authorize live calls or import ambient credentials.

The local credentialed session's typed-MCP increment derives its MODEL tool schema and one prepared tools/call only from the original retained grant and durable normalized MODEL response. Call/result pairs are atomic historical context units. The separate original-keeper HTTPS arm implements a deliberately closed stateless POST subset: initialize, initialized notification, one exact catalog and one gated tools/call. It denies session IDs, GET/DELETE, reconnect, resumption and authentication instead of improvising those protocols. Provider Bearer bytes are never included in MCP requests. This is source infrastructure, not the complete #193 client or proof that the public endpoint supports it.

The current transport has no authoritative measured MCP billing channel. A known parsed result is retained with unknown service usage and stops the Attempt; an installed known-free declaration does not become an observed zero bill or authorize a second MODEL. This increment alone does not pass the joined MODEL/tool/MODEL, canonical WebUI, cloud-isolation or live-qualification gates of #190/#191. No public service/model calls or profile activation are required by the offline DATA/authority regression tests.

make test-mcp-offline checks the joined original Source/Store/keeper path against test-owned loopback MODEL and TLS MCP peers. It adds exactly two build-tagged fixture files through a fixed Go overlay to reach private instance-scoped DNS/dial/root dependencies before session start; it does not replace production files, ownership checks, Store, issuer or send authority. Normal packages are separately built without the overlay. Synthetic DNS/IP and certificate identities are offline test inputs, not real public endpoint or network-isolation attestation. The gate runs under race/shuffle in make test-connected and the required connected CI job. It makes no public traffic, reads no credentials, and does not activate a profile.

For a Dockerless, credential-free check of the prepared authority-to-egress seam, run:

make serverless-egress-conformance

This runs vet, uncached race/shuffle package suites and 50 repeated joined cases using the real registry, invocation capability and PR-03c boundary with test-only credential/proxy ports. It does not contact an external provider, enable a runtime profile or prove normal worker credential custody, canonical terminal commit, cloud isolation or billed cost. See the substrate evidence boundary for what remains. The same target is included in make ci.

The feature-disabled native direct OpenRouter reference backend pins one non-streaming Chat Completions request and strict observed-route response contract. Its tests use only a local fake boundary; no production HTTP boundary, key lookup, DNS request, or provider call is enabled.

The native provider composition accepts four explicit pinned drivers and assembles their disabled registrations below the existing exact-match harness registry. It performs no profile or executable discovery, does not select a default backend, and is not wired into worker-runtime.

Run make provider-conformance for the credential-free provider registry matrix. It performs vet plus repeated race-enabled tests over strict fixtures, including the native feature-disabled Codex/OpenRouter, OpenCode/OpenRouter, and direct OpenRouter profiles plus their closed composition. It reads no provider secret, starts no provider process, performs no network call, and does not enable Codex, OpenCode, or direct OpenRouter. Pi conformance is no longer an active gate; see the retirement note above. A generic fake result reports native backend protocol as skipped, even when its exact registry tuple passes.

The closed Codex JSONL parser recognizes a well-formed turn.failed only after turn.started. It validates the error object without publishing its private message, discards any partial final candidate and rejects every later frame. ProtocolResultV1.Terminal continues to mean a successful turn with a final candidate: a native failed turn has Terminal=false and a failure code. The prepared driver maps this to provider failure, never a completed result or checkpoint; the legacy adapter retains its conservative accepted/ambiguous classification. Neither result grants replay authority. This grammar support does not enable a native profile or attest its model effects.

Deployment-aware cleanup of those immutable registry images is a separate, fenced operational workflow. Its evidence bridge, dry-run/delete controls, and audit reports are documented in registry-gc.md. Never replace that workflow with an age-only or tag-count cleanup.

Local stack

The bounded Apple Silicon source-build spike for YDB 25.3.1.25 reached a conditional no-go. Do not replace the pinned Linux container with an unvalidated native binary; see the native macOS YDB evidence and rerun conditions.

Start and initialize the complete local stand:

make dev-up
curl http://127.0.0.1:8080/healthz
curl http://127.0.0.1:8081/healthz

make dev-up first starts pinned YDB Local, Silo (a MinIO fork), ElasticMQ, and the deterministic Telegram fake. It waits for the infrastructure endpoints, creates the local bucket, and applies the embedded YDB migrations. Only after that schema barrier does it start the control API, queue-driven Telegram sender, and queue-driven reconciler, then idempotently loads the synthetic Telegram fixture. A fresh-volume YDB storage-pool initialization is retried without starting schema consumers. Its YDB_MIGRATION_MAX_ATTEMPTS bound defaults to 60. Once HTTP monitoring is live, only the exact SDK failed to dial timeout for loopback localhost, 127.0.0.1, or [::1] is also retryable; its independent YDB_LOCAL_DIAL_MAX_ATTEMPTS bound defaults to 3 and covers raw or slog-escaped quotes. Boot-storage markers take precedence. Generic deadlines, remote endpoints, authentication/configuration errors, and DDL failures remain fail-fast. Neither readiness path resets or deletes local data. The stand does not require cloud credentials or a real Telegram token.

The worker is intentionally not kept alive by the default Compose profile. Local mode consumes at most one queue message and exits; cloud mode serves one bounded trigger-delivered batch per HTTP request. After an admitted local run is present:

make worker-once

This starts the isolated worker-runtime profile, consumes at most one queue message with the deterministic harness, stores checkpoints/artifacts/results, then exits. An empty queue is a successful no-op. Scratch is a private tmpfs and the container runs read-only as the distroless nonroot user.

The control API uses the YDB SDK single-connection balancer only inside the Compose stand. This keeps the client on the Docker-resolvable ydb-local endpoint instead of replacing it with YDB Local's host-facing discovery address. Cloud deployments retain normal endpoint discovery and balancing.

Web authentication development

Cloud preflight is Dockerless: it checks the cloud toolchain, billing gate and Terraform configuration, not a local container engine. make terraform-ci includes a credential-free regression with Docker absent from its command path. It also checks Terraform's actual mocked, targeted Web plan: Web readiness must wait for its registry, YDB, Object Storage, Lockbox, KMS and logging permissions, without pulling publication/GC identity activation or unrelated runtime modules into that graph. This is a dependency boundary, not permission to skip the reviewed full deployment plan or to use targeting for ordinary deployments.

For release scope, see the WebUI-first MVP delivery plan. The WebUI-first login supports explicitly configured Yandex ID OAuth, Telegram OIDC, or both. There is no default provider or credential fallback. Telegram Web login is independent of the deferred Telegram messaging edge and bot transport rollout.

Dual-provider identity V2 groundwork (not enabled)

The accepted dual-provider design is being implemented in #238–#240. New closed V2 identity/session domain and private row helpers are groundwork only: they do not install a serving V2 reader, expose linking routes or migrate existing records. Ordinary dual-provider login configuration does not install V2 storage authority. Do not write V2 rows into a serving V1 deployment.

Ordinary V2 identity resolution and Web-session create/authorize/tenant-switch/ logout source is exercised through the existing store ports under a private test installation. There is deliberately no public option, environment setting or command that installs this partial serving mode. Unsupported V1 challenge, enrollment, bootstrap and Telegram writers fail closed in that mode; they are not implemented V2 flows. All direct/transitive protected consumers and the bounded retained-data cutover remain required before installation is exposed. The ordinary resolver receives a fresh server-generated candidate UserID, never a browser-selected existing user; it checks both reverse-identity and membership prefixes in its owning transaction before initializing revision 1. These bounded checks do not prove global user nonexistence under arbitrary orphan/corrupt rows. The mandatory cutover inventory must establish canonical/ reverse correspondence and retain ownership tombstones; inconsistencies are maintenance failures, not an automatic login repair or account-link grant.

make web-identity-v2-ydb-gate is restricted to the existing disposable GitHub CI database, with real data transactions and no go_fake_tx. It checks actual JsonDocument decimal-string revision roundtrips at 2^53−1, 2^53, 2^53+1 and MaxUint64, the bounded reverse/canonical join, and old-cookie denial after a committed identity-revision or membership change. It does not start YDB, create a schema or use a provider. Controlled-driver tests are separate offline evidence; passing these primitives is not proof of the pending complete operation/proof/audit/cookie protocol or live account linking.

The separate make web-consent-identity-v2-ydb-gate selects the tagged native consent identity scenarios in the existing disposable GitHub CI database. It uses real data transactions, the original race/repeat/shuffle checks and a five-minute test-binary bound, without extending the YDB job's deadline. The target requires the CI guard and explicit disposable-current-reader flags; it does not start YDB or apply migrations. These scenarios exercise the existing MODEL-to-consent-to-reservation/before-send composition with synthetic transport, not a provider call, public V2 installation or live account-linking proof. Controlled SQL tests remain separate evidence.

Identity V2 retention and cutover prerequisites

The operator-only identity-maintenance.v1 source implements the bounded inventory/preparation/CAS contract for #238; it is not permission to change a retained environment or evidence that a cutover has occurred. The accepted design and migration safety protocol remain authoritative. No migration, reset, credential/provider operation or deployment was executed by authoring these sources. Keep V2 serving and sensitive operations disabled until the bounded maintenance implementation is qualified, all V2 writers and transaction-local consumers, genuine disposable-YDB cases and exact-source independent review are complete. A successful primitive gate is not that proof.

The forward source order is deliberately two one-statement files:

  1. 00130 adds nullable delete_after Timestamp; existing cells are NULL and the original expires_at TTL remains active at this step.
  2. 00131 changes the SAME table's physical TTL to delete_after. The original 00053 CREATE and every applied checksum remain unchanged. The ordinary runner applies all pending files; it has no maintenance pause between them.

These forms follow the official YDB v25.3 ADD COLUMN and TTL SET syntax. YDB's TTL contract states that NULL TTL cells do not expire and physical deletion is asynchronous. Logical expiry is therefore always enforced by the record/transaction, never by assuming a row was already deleted.

Before separately authorized application, require this complete ordered plan:

  1. Pin the exact environment, source commit, migration checksums and trusted provider/client/callback/proof-policy manifest. Inspect actual column types, primary keys, current TTL and Goose/checksum histories; source layout alone is not a schema preflight. Preserve content-free inventory and drain evidence. schema-migrate status bootstraps its metadata tables and is not a purely read-only schema-inspection substitute.
  2. Freeze all auth starts, callbacks, operation continuation/confirmation and identity/session writers BEFORE either migration: every BFF revision and direct/private invoker, bootstrap and EnsureTelegramIdentity included. Stop new invocations and prove old work has drained; a traffic switch or sleeping for a guessed interval is not proof. Respect the original 15-second sensitive-handler/10-second exchange/5-second transaction bounds; do not extend an old operation to survive maintenance. The schema lease does not freeze application writers on its own.
  3. Apply the forward metadata only through the separately authorized runner. Check actual nullable column type and final zero-delay delete_after TTL. Old rows can remain NULL after both files: do not unfreeze a writer that omits this column, and do not mistake absence of TTL deletion for validity. writeChallenge's V1 physical field equals its ORIGINAL ExpiresAt; it is not a V2 decoder, lifetime extension, identity migration or rollout gate.
  4. Complete a separately implemented/reviewed bounded maintenance pass while writers remain frozen. Enumerate each of the fixed 16 hash buckets in primary-key order, with an exclusive last-key cursor, finite page/byte/time and total-run bounds, and durable content-free progress. Inventory every legacy/NULL delete_after row, including expired rows TTL has not removed. Re-read each exact (shard_bucket,state_digest) row in its serializable maintenance transaction; verify its original kind, immutable timestamps, full current record and scalar correspondence before changing anything. An earlier inventory is not a CAS. identity-maintenance.v1 retires a valid V1 challenge by exact-row deletion, including original NULL delete_after; it has no retention-backfill mode. Never extend it or create V2 authority from it. Valid V2 records remain unchanged; partial/malformed V2 stops. Malformed/mismatched rows stop the pass for explicit classification, not a guessed expiry, unbounded UPDATE, blind overwrite or broad deletion. Reconcile exact outcomes after an ambiguous commit before advancing progress. Prove complete coverage/no remaining NULL cells with all writers still stopped; per-page success or an operational TTL delay is not full coverage.
  5. Separately validate forward/reverse identity correspondence, unique immutable ownership, maximum two active methods/one per provider, common positive revision and no tombstone reactivation. The versioned executor below reports anomalies rather than repairing them; its candidates are not account grants. Retire outstanding V1 challenges and V1 Web cookies by bounded exact-key work under the same freeze. Do not change canonical conversation Sessions, history, memberships, actors or resource ownership; deterministic Telegram-user mismatch remains a denial, not a migration.
  6. Install explicit V2 mode only after EVERY writer and direct transactional Web reader checks current same-user active identity/revision, existing membership/session/participant/CSRF rules and trusted configuration. No V1 JSON, missing revision or NULL retention field is a compatibility fallback. Require terminal privacy pruning in both JsonDocument and physical scalar fields before extending a receipt to original creation plus 24 hours; pending/proof records stay at the original deadline. Receipt reads require current same-user authorization and cannot restore a lost replacement cookie. Reconfirm complete coverage and exclusive writer/manifest pins, then unfreeze only through the separately accepted rollout. Configuration changes require the design's freeze/drain across every old revision, not just a digest match.

ADD COLUMN has no assumed already-exists replay guarantee here. If DDL may have succeeded before Goose/checksum completion, STOP: preserve the exact source, pending checksum, Goose state and actual column/TTL observations. Do not blindly retry the ADD, edit an applied file, ignore a schema error, or manually advance migration metadata. The current runner has no semantic ambiguous-ADD repair; an exact reviewed incident-recovery procedure is still required before resume. This limitation must not be disguised as automatic idempotence. Rollback keeps revision-aware V2 readers and tombstones, disables new operations, and retains forward schema/receipts. It never restores V1 readers, TTL on expires_at, old writers that omit retention, a destructive Down, or provider-token replay.

Immutable identity runtime and retired writers

cmd/web-bff requires exact WEB_IDENTITY_VERSION=1 (pre-cutover) or 2. V2 also requires exact WEB_IDENTITY_SENSITIVE_OPERATIONS=true or false; V1 accepts absent or exact false, never true. Empty, padded, aliased or unknown values fail before dependencies open. The local stand explicitly selects V1/false unless the operator supplies another exact value. The version is never autodetected from JSON or inferred from a callback/cookie.

V2 startup uses ydbstore.NewWebIdentityRuntimeV2 to construct a new immutable Store and paired account service before publishing either. The SAME Store reaches BFF, session API, ingress, compute/explanation/consent/canonical readers. Ordinary login and proof exchange reuse the SAME actual adapter instances and existing SESSION_API_ID_HMAC_KEY; no new key/table/sidecar or public Store setter exists. WebIdentityManifestDigestV2 derives the operator maintenance pin from the exact ordered provider bindings and accepted versioned proof policy, excluding secrets, HMAC, time, source commit and the sensitive-operations gate. A digest or version does not prove the external schema/data/writer cutover described above.

V2 sensitive OFF keeps V2 ordinary login, tombstone/revision authorization, methods and same-user retained receipt reads, safe cancellation and terminal receipt-only repeated confirmation. New Start/Continue/proof/pending Confirm remain denied. Turning OFF never switches the Store to V1 or unmounts the service. Changing bindings/proof configuration still needs the accepted freeze/drain; OFF is not evidence that old directly invokable revisions have stopped.

Writer inventory for this rollout:

For an explicitly selected owner-local worker, WEB_IDENTITY_VERSION=2 also selects strict V2 consent consumption in its original per-invocation Store. Provide the same nonsecret WEB_LOGIN_PROVIDERS, WEB_BASE_URL, selected YANDEX_LOGIN_CLIENT_ID / TELEGRAM_OIDC_CLIENT_ID and optional fixed TELEGRAM_OIDC_ISSUER pins as the BFF, plus the existing exact sensitive-operation flag required by the shared version parser. No OAuth secret, proof adapter or HMAC key is needed for the worker's identity reader. Public library constructors use validated, copied WebIdentityReadModeV2 through the existing Store options; nil deliberately retains pre-cutover V1. Neither choice is inferred from stored cookies. This does not enable local execution, grant database permissions, configure a cloud worker or establish the required external cutover.

Writer/consumer V2 disposition
Ordinary resolver/login/challenge/session/switch/logout Existing strict V2 branches through the one new Store; no V1 fallback or automatic membership
Account proofs/link/unlink/outcomes Same paired Store/service, original transaction and expiry bounds
Direct Web compute, explanation, search-consent, canonical transaction readers Same Store, existing current identity/revision plus membership/session/participant checks
Store.Enroll Retired in V2; explicit deny, no production caller admitted
cmd/web-bootstrap, both subject and no-subject variants Retired in V2; canonical mode validation/refusal before grant/stdin/DB; V1 bootstrap must be completed before cutover
cmd/control-api Telegram chat webhook → EnsureTelegramIdentity Retired in V2; configured webhook plus V2 refuses startup before DB/Bot/queue; no silent webhook removal. Attached-only/health control remains allowed
Older binaries/revisions/private invokers Must actually be stopped/drained by the operator; new command guards cannot fence old code

Terraform's web_identity_version and web_identity_sensitive_operations reach the Web container as exact strings (defaults explicitly select V1/false). The separate runtime module still declares legacy chat V1; a Web-only plan does NOT retire either control slot, its old revisions, bootstrap jobs or private callers. Keep those writers stopped through maintenance and admit only the V2 Web runtime. Telegram login is distinct from deferred Telegram chat; retiring the latter does not remove the former or disable attached workers. Creating new enrollment/bootstrap features is not a prerequisite for linking an already provisioned account. Do not claim those retired writers are V2 capable.

No constructor performs SQL, migrations, inventory, repair, registration or provider probes. Complete the accepted schema130/131, bounded maintenance, ZERO-legacy correspondence and all-writer retirement under separate authority before admitting V2 traffic. Native HTTP/SQL fixtures prove only controlled integration, not real registered-client/browser compatibility or deployment.

Ordinary login provider configuration

Set WEB_LOGIN_PROVIDERS explicitly to exactly yandex, telegram, or yandex,telegram, in that order without spaces. Empty, missing, reversed, duplicate or unknown selections fail startup. Remove WEB_LOGIN_PROVIDER entirely: its presence is rejected even when its value is empty. Every enabled provider needs its complete client configuration and its own secret; a missing client never selects another provider implicitly.

The /login chooser reads GET /auth/login/methods, a read-only response with methods entries containing provider, label (Yandex or Telegram) and the fixed start_path. It renders same-origin form submissions to POST /auth/login/yandex/start or POST /auth/login/telegram/start. Starts require the exact Origin and application/x-www-form-urlencoded, with only one optional local return_to; they do not accept a provider selector from the form. The former state-changing GET starts /auth/login/start and /auth/telegram/start are removed, not compatibility aliases. Callback paths remain /auth/login/callback for Yandex and /auth/telegram/callback for Telegram, each pinned to WEB_BASE_URL and the corresponding client/issuer.

For an existing installation, prepare this migration before a separately authorized deployment:

  1. Remove the retired environment variable and Terraform web_login_provider setting from all runtime, loader and operator configuration. Set the same explicit list in WEB_LOGIN_PROVIDERS and Terraform web_login_providers.
  2. Complete registration/configuration of every enabled client and its exact callback under the appropriate external authority. Create a new Web Lockbox payload version outside Terraform with separate yandex-login-client-secret and/or telegram-oidc-client-secret entries. The old shared oidc-client-secret key is not a fallback.
  3. Pin the approved image/revision and new secret version together with the non-secret client IDs. Co-land the BFF, chooser/UI and gateway POST/discovery routes; do not mix the old GET-start frontend or gateway with the new BFF.
  4. Under separate rollout authority, run metadata/start smoke for every selected provider and then real callback/session checks. Source changes, fixture tests and these instructions do not register clients, load secrets or deploy them.

This ordinary-login increment does not finish dual-proof linking (#172/#239) or account settings (#240), automatically link accounts, or grant membership.

Bounded identity maintenance command

Follow the normative identity-maintenance.v1 appendix in the accepted design. This command is separate from partition-backfill, which handles lifecycle indexes and cannot establish identity correspondence or writer retirement. Before any separately authorized database use, retain the exact environment, source/migration/configuration pins and ALL-ingress freeze/drain/exclusive-old- writer evidence described above. No --freeze-verified flag exists: neither the program nor a digest can prove that operational prerequisite.

Use the existing YDB credential chain, never a credential in ARGS or a DSN. The three pin arguments are required in every mode; the following schematic values are placeholders, not a runnable environment authorization:

make identity-maintenance ARGS='inventory --environment-digest <64hex> --manifest-digest <64hex> --source-commit <40hex>'
make identity-maintenance ARGS='prepare --environment-digest <64hex> --manifest-digest <64hex> --source-commit <40hex> --kind identity --selector <private-owner-id> --candidate /private/operator/new-candidate.json'
make identity-maintenance ARGS='apply --environment-digest <64hex> --manifest-digest <64hex> --source-commit <40hex> --candidate /private/operator/new-candidate.json'
make identity-maintenance ARGS='reconcile --environment-digest <64hex> --manifest-digest <64hex> --source-commit <40hex> --candidate /private/operator/new-candidate.json'

Prepare accepts only identity plus original UserID, or cookie/challenge plus exact stored digest. It never accepts a subject reassignment, account merge, table name or arbitrary SQL. It creates one new private regular file, mode 0600, without overwriting/following a symlink; protect its parent directory. Apply/reconcile reject public, oversized, symlinked or hard-linked candidates. Selectors stay private; stdout/logs contain only redacted counts, closed status codes and hashes, never raw records, subjects, cookie/CSRF/state digests, PKCE/nonce, credentials or driver errors. Keep private candidates out of public issue evidence, shell history exports and report archives.

Every invocation verifies actual four-table schema/TTL and exact applied 130/131 checksum/Goose state without bootstrap/DDL. Every apply/reconcile then restarts a COMPLETE four-table, sixteen-bucket inventory; an older report or cursor is never coverage permission. Bounds are 128 pages (16 accepted rows plus a seventeenth sentinel), 2048 accepted rows, 134 transactions/160 SQL statements, 128 MiB logical material, five seconds per transaction and one original ten-minute whole-command deadline. These are refusal caps, not server RU/native-memory guarantees. Over-cap/incomplete input stops; do not raise caps, skip buckets, use a cursor to bypass coverage or launch a background sweep.

For a coherent all-V1 user group only, conversion atomically writes active V2 revision 1, using already-persisted microsecond creation/update instants; it does not preserve original JSON nanosecond representation. It keeps exact owner/subject and reverse-created time, and reports only a precisionProjected count. Existing V2/tombstone timestamps are never normalized. V1 cookie revoke uses the candidate's immutable SQL-sampled intent time without renewing any expiry; V1 challenge retirement is exact deletion, never a purpose conversion.

Do not infer rollback from an error or absent report. On possiblyCommitted, preserve the original candidate and explicitly reconcile; do not repeat provider work, prepare a replacement or auto-retry apply. An exact postimage is an observation, not attribution. A missing challenge after uncertain DELETE is desiredAbsentObservedActorUnknown, not proof our transaction committed. A partial candidate/report write is likewise not rollback. Final fresh inventory under the continuing external freeze must show ZERO V1 forward identities, no unrevoked V1 cookie, no V1 challenge, no NULL challenge retention and no correspondence anomaly. Only the separately accepted rollout may then unfreeze.

make identity-maintenance-test runs only offline CLI/controlled SQL tests. The existing guarded web-identity-v2-ydb-gate additionally selects the native maintenance scenario, using its own unique schema namespace and original disposable-CI guard/deadline. That source is not permission to run native YDB locally, not proof of shared-environment freeze, and not a public V2 installer.

Yandex ID login

Include yandex in WEB_LOGIN_PROVIDERS, set YANDEX_LOGIN_CLIENT_ID to the registered application's client ID, and inject YANDEX_LOGIN_CLIENT_SECRET from the operator's credential store. WEB_BASE_URL is the exact public HTTPS origin; register its /auth/login/callback URL with Yandex ID. Browser sign-in starts at the /login chooser's POST /auth/login/yandex/start form. Request only the login:info permission, not email or avatar access. The BFF uses these pinned production endpoints:

Operation Endpoint
Browser authorization https://oauth.yandex.ru/authorize
Server-side code exchange https://oauth.yandex.ru/token
Verified account information https://login.yandex.ru/info?format=json

This is Authorization Code OAuth with S256 PKCE, not OIDC: there is no Yandex ID-token/JWKS/nonce verification path. The callback consumes a single-use, browser-bound challenge with the selected provider and client binding. The BFF exchanges the code privately, then calls the account API with the transient access token in the Authorization: OAuth header. It accepts the JSON account id only after client_id matches the configured application exactly. The canonical identity is (yandex, id); email, login and display name never select the user. Access/refresh tokens are not persisted or sent to the browser. See the official code exchange and account API contracts.

For Yandex-only cloud configuration, select Terraform web_login_providers = "yandex" and set non-secret yandex_login_client_id. Load the secret with the existing Web Lockbox loading workflow, using the matching WEB_LOGIN_PROVIDERS=yandex in the loader environment. Lockbox yandex-login-client-secret maps only to YANDEX_LOGIN_CLIENT_SECRET; telegram-oidc-client-secret maps only to TELEGRAM_OIDC_CLIENT_SECRET when Telegram is enabled. Both entries are required for yandex,telegram, with no shared-key fallback. Never put the client secret in Terraform variables/state, command arguments, checked-in files, container images or logs.

Successful provider verification alone grants no tenant access. Pilot access requires a separate audited operator invitation or the existing cloud-development membership bootstrap for the canonical Sessionless user. A new identity without active membership cannot create a Web session, read another user's sessions or inherit quota. Equal Telegram/Yandex subject strings or emails are not account links. Explicit late linking of two proved accounts remains unfinished under #172/#239, with account settings under #240; ordinary login does not complete those proof flows.

For operator-assisted first access in cloud-dev, the existing make web-bootstrap accepts optional WEB_BOOTSTRAP_EXTERNAL_PROVIDER=yandex and WEB_BOOTSTRAP_EXTERNAL_SUBJECT with the operator-verified canonical numeric Yandex account id (not its email or username). Supply the existing target WEB_BOOTSTRAP_USER_ID, tenant, role, operator and reason as documented in the bootstrap runbook. The typed confirmation becomes exactly BOOTSTRAP <user> INTO <tenant> FOR yandex:<id>. Identity provisioning, membership and its audit are one transaction. A subject owned by another user or a target user with any different external identity is rejected; this is first-identity provisioning, not a privileged shortcut for late linking. Without both optional variables, the original bootstrap still requires an existing external identity. Neither mode is available in production or accepts authority-bearing arguments.

YANDEX_LOGIN_AUTHORIZATION_ENDPOINT, YANDEX_LOGIN_TOKEN_ENDPOINT and YANDEX_LOGIN_INFO_ENDPOINT overrides are accepted only for explicit loopback fixtures when SESSIONLESS_ENVIRONMENT=local; they are not cloud proxy knobs. Repository adapter/BFF/YDB/browser checks use synthetic accounts, not a real provider login. Registered-client callback, Yandex endpoint reachability from the deployed runtime and cloud browser smoke remain #34/#35 rollout evidence; access to the Yandex Cloud console does not prove these endpoints reachable.

The configured-provider cloud smoke has a credential-free local entry point:

make cloud-web-smoke-test

It runs Node.js standard-library fixtures with fake curl/yc clients and checks read-only methods discovery followed by an Origin/form POST for each selected provider, positive redirects, fail-closed configuration/response handling, redaction and temporary-file cleanup. No Docker, YDB, cloud token or provider login is needed. Repository CI runs the same target under the pinned Node.js version. The live make cloud-web-smoke command requires separately approved cloud rollout authority and explicit provider/public client configuration; see the cloud runbook. A passing login-start check never follows provider redirects and does not prove an actual account callback or logged-in session.

Existing Telegram fixture

The Web BFF and Telegram-shaped OIDC fixture are separate Go processes. The fixture generates an ephemeral RS256 key at process start and refuses to start unless SESSIONLESS_ENVIRONMENT=local. Production and cloud-development processes selecting Telegram use its real issuer and receive the client secret from the process environment or Lockbox. Explicit WEB_LOGIN_PROVIDERS=telegram selects this fixture alone; its /auth/telegram/callback registration remains unchanged, and its start is POST /auth/login/telegram/start from /login. These fixture values do not configure Yandex login.

Build the binaries and run the credential-free repository checks:

make build
make test

Secure browser cookies and exact-origin checks are never weakened for local development. A manual browser flow therefore needs a local HTTPS reverse proxy for https://web.localhost; the fixture endpoints may remain loopback HTTP and are accepted only when the BFF itself runs in the local environment. See web-bff.md for the route contract, environment variables, bootstrap procedure, and threat boundary.

The Web canonical API additionally needs the existing Object Storage and scheduler-wake queue coordinates. Local static S3 credentials use Silo in the Compose stand and MinIO in the native dockerless stand; cloud deployments set S3_IAM_METADATA_CREDENTIALS=true so both exact-object operations and short-lived Yandex Object Storage capabilities use the workload service account. SESSION_API_ID_HMAC_KEY must be at least 32 bytes and stable across replicas because it derives upload, event, run, and dispatch identities. WEB_MAX_UPLOAD_BYTES configures a positive upload limit (default 32 MiB), and WEB_ALLOWED_MCP_SERVERS is an optional comma-separated allowlist copied into Web-created jobs. WEB_OBJECT_STORAGE_ORIGIN is the exact browser-facing origin of every direct upload/download capability and is added to CSP connect-src; wildcards, paths, credentials, query strings, and non-HTTPS origins are rejected. Only exact loopback HTTP is accepted when SESSIONLESS_ENVIRONMENT=local (for example http://localhost:9000).

The direct upload sequence is intent, exact presigned PUT, commit, and then message submission. Reusing an idempotency key retries the same logical operation. Poll point runs with the returned ETag and delay headers, and use after_sequence to project newly appended events. Do not persist capability URLs or include them in logs, test snapshots, or browser analytics.

Run the adapter contracts and stop the stack:

make migrate-local
make local-integration
make e2e-local
make dev-down

Normal stop/start preserves the YDB and Object Storage named volumes. ElasticMQ and the Telegram fake are intentionally ephemeral transport fixtures. The complete topology, endpoint table, local-only credentials, persistence test, and Apple Silicon requirements are documented in local-development-stand.md. The e2e-local target starts the stand when needed, builds the isolated worker, and executes the two-tenant product flow and recovery scenarios documented in local-e2e.md.

After the YDB monitoring endpoint is ready, apply or inspect the schema:

export YDB_CONNECTION_STRING='grpc://127.0.0.1:2136/local?go_query_mode=scripting&go_fake_tx=scripting&go_query_bind=declare,numeric'
export YDB_ANONYMOUS_CREDENTIALS=1
make migrate-local
make migration-status
make partition-status
make ydb-integration

The repository-owned migration binary embeds the SQL set and uses Goose as a library. It adds a YDB-backed fenced lock, pre-execution checksums, one idempotent DDL operation per file, and a forward-only production policy. See migrations/ydb/README.md for crash repair and docs/ydb-state-store.md for keys and transaction procedures.

Run explanation storage (#187) has a separate true-transaction proof target.

The existing disposable GitHub YDB job also runs make attached-inline-output-ydb-gate for inline V2 output (#200). It uses the original signed worker claim and real serializable transactions to observe body-claim commitment before the first body read and complete canonical write custody before physical Put. Controlled immutable blobs exercise lost Put acknowledgement without replay. The target requires disposable GitHub CI and a migrated loopback database; it starts no local service. A skipped local test is compilation evidence only, not native YDB, Object Storage, producer or rollout qualification. Existing job/test deadlines and all prior gates remain unchanged.

The read-only conversation explanation drawer (#141) is absent in default WebUI builds. VITE_RUN_EXPLANATION_ENABLED=true make web-stage opts the frontend build in only after the deployment's writer/schema cutover receipt has been checked and the BFF's separately guarded explanation route has been enabled. The build flag is not evidence of deployment readiness, does not enable the BFF, and does not authorize migration or cloud activation. Rollback rebuilds without the flag and disables the route; canonical conversations remain usable. Playwright opts in against its intercepted canonical API fixtures, not a live deployment.

The drawer is a bounded nonmodal in-flow panel, not a new primary page. Opening focuses its heading once; Escape from inside or Close returns to the trigger, enabled composer, or conversation heading. Its close/refresh header stays reachable while the secondary evidence scrolls. Refresh never resets input or focus. Explain uses an authorized event's optional run_id or the exact loaded Run's trigger_event_id; generic notices and adjacent events are never guessed.

Display or control Authorized source and meaning
Canonical Run, timestamps RunExplanationV1.run_id/status/created_at/updated_at; only canonical status denotes completion
Admission admission closed reason/outcome and observation time; last recorded decision, not current entitlement
Terminal reason terminal closed supported reason; unknown is not diagnosed from raw notice payloads
Selected Attempt attempt exact selector/number/state/update time; not a process heartbeat or history
Attached receipt/freshness attached closed fact and server assessment at read_at; not physical liveness or canonical completion
Partial/unknown coverage coverage per source; never inferred as success, readiness, or complete history
Explain/Refresh Existing bounded explanation GET only; no compute refresh, repair, capability, provider or command calls
Close Local disposal/focus only, not cancellation of execution

State is memory-only and fenced by actual /me user/provider, exactly one active tenant, Session, Run and request generation. Identity is read during ordinary view initialization/visibility revalidation, not drawer open/refresh (the existing identity route can renew session idle time). There is no new identity poller or invented browser-session epoch. Hidden/unmounted/closed views discard pending explanation responses, including transports that ignore abort. An observed scope change clears old private drafts/history; actual canonical read authorization loss clears private view state. Opaque explanation denial removes only explanation authority, leaving separately authorized transcript access. Compute-write denial does not revoke participant reads. Recoverable transport failures retain drafts; retained evidence is explicitly historical. The shared controller enforces single-flight and a five-second identity/tenant floor across close/reopen/Run selection, with server backoff and no explanation polling. Existing send/upload/archive/compute/download operations capture their original view generation and AbortSignal too: after observed authorization change or unmount, every asynchronous continuation checks scope before the next request, state update, capability use or focus change. Old uploads never adopt a new scope's signal. Already submitted operations may have committed; disposal is not rollback, and no automatic resubmission or undo is attempted.

Against an explicitly approved disposable YDB only, use:

YDB_CONNECTION_STRING='grpc://127.0.0.1:2136/local?go_query_mode=data&go_query_bind=declare,numeric' \
YDB_ANONYMOUS_CREDENTIALS=1 make run-explanation-ydb-gate

The target runs only TestRunExplanationYDB fixtures with race detection, three uncached shuffled repeats and a five-minute timeout. It rejects any fake-transaction option or non-data mode; the legacy scripting suite skips these serialized proofs instead of claiming fake commits prove atomicity. Fixtures apply embedded test schema only in that disposable database, use random test-scoped tenant identities, and register bounded cleanup immediately. No route, provider, runtime or production migration is activated by this test.

For the canonical monetary successor, make admission-cost-ydb-gate uses the same explicit true-data DSN and disposable-database requirement. It exercises the actual serializable deployment backfill: earlier markers are insufficient, each dispatch/job/effect backlog denies the transition, dry-run writes no monetary receipt, and an empty-backlog commit records database time. A repeated backfill preserves that exact receipt even after new jobs exist. The test refuses every source inventory traversed by that full backfill before changing schema state. It restores all six exact prior receipt rows, including the lifecycle-index receipt and original absence; the serving-marker fixture also restores both rows it touches. A nested cleanup regression verifies prior absence and timestamp. Only random owned backlog fixtures are removed; the gate never resets existing tenant data. It does not certify a real deployment or authorize old writers to remain active during cutover.

make partition-status emits the live primary keys, partition settings, counts, and contract drift as JSON. The bucketed ready/expiry expand/backfill/cutover procedure is documented in ydb-partitioning.md. make partition-backfill is a deployment migration command for lifecycle indexes, not a normal serving operation. Before deploying v2-only ready/expiry code with retained work, use the compatible dual-writing predecessor pinned in #206 execution comments to backfill those four projections and verify their tuples. The current command does not scan their legacy tables; its lifecycle marker does not prove this separate ready/expiry handoff. No environment operation is authorized by a source or unit-test pass.

make ready-expiry-repair plans or applies one authorized ready/expiry v2 metadata repair from retained source records. It does not perform a batch backfill or repeat an external effect. Follow the operator procedure for exact selectors, source and output limits, deletion fences and ambiguous-commit handling. make ready-expiry-repair-test runs offline CLI/store race tests without opening a database.

Pending migrations 00126–00129 retire exactly four legacy discovery indexes. make migrate-local applies pending destructive definitions; it is not an inventory-only command. Retained environments must satisfy the coverage/drain and rollback requirements and have separate environment-operation authority first. The repository-only make ready-expiry-retirement-ydb-gate executes existing/missing four-table controls only in explicitly authorized disposable GitHub CI. Local author validation compiles that integration package without executing it.

Local defaults use YDB_ANONYMOUS_CREDENTIALS=1. Cloud deployments use the YDB environment credential chain and metadata credentials; do not place access tokens in the connection string or command line.

To delete local Compose volumes, use the guarded command:

CONFIRM_LOCAL_RESET=sessionless-dev make dev-reset

The reset target affects only the fixed sessionless-dev Compose project. It does not remove source directories or arbitrary Docker resources.

After a reviewed pre-production migration-baseline rebase, inspect and execute the separately guarded cloud-dev application-data reset:

make cloud-app-reset-plan
CONFIRM_CLOUD_APP_RESET='reset-sessionless-cloud-dev:<folder-id>:<artifact-bucket>' \
  make cloud-app-reset

The command resolves its target from the selected Terraform state and preserves cloud infrastructure and unrelated object prefixes. The complete prerequisites, typed-confirmation derivation, and preservation boundary are documented in cloud-development.md. It is not a production migration or an ordinary deployment step.

Single-session archive, legal hold, bounded dry-run, and exact-object deletion are documented in session-lifecycle.md. Use only the Make targets in that runbook; the destructive command requires the digest of the resolved inventory and has no prefix-delete mode.

Images and CI

make images
make ci

make ci includes the deterministic WebUI checks and static build before Go verification and embedding. Go package commands use explicit repository package roots so they never descend into web/node_modules; a layout guard fails if a new project Go root is added without joining that inventory.

The control plane uses a small distroless runtime. The worker has a separate Dockerfile. Its deterministic harness validates lifecycle behavior now; a later decision can add OpenCode, Codex, Claude, Hermes, or another CLI without expanding the webhook/control-plane attack surface.

GitCode is the source of truth for branches and merge requests. Its push mirror replicates every commit to github.com/urandon/sessionless, where GitHub Actions runs the full CI contract across make ci-core, make test-connected and the isolated security job, then make image-reproducibility-test, for every mirrored branch or tag push. The workflow is .github/workflows/ci.yml; a GitHub pull request is not required.

Ordinary branch and main CI never requests a GitHub OIDC token and never contacts Yandex Container Registry. It still builds every runtime image twice in independent clean rooms and uploads deterministic reproducibility evidence. Publishing requires an explicit Publish runtime images workflow dispatch on the exact current, converged GitCode/GitHub main SHA with a matching typed confirmation. That separate job repeats the clean-room proof before requesting OIDC and publishing the five immutable images. Publication creates a deployment manifest; it does not deploy Terraform or a runtime revision. See cloud-development.md.

When reviewing a GitCode merge request, match the GitHub Actions run to the GitCode head commit SHA. Automatic propagation of that status back into the GitCode merge-request UI is a separate integration; until it exists, this SHA check is the merge gate.

Publishing GitHub release artifacts back into GitCode is intentionally outside this CI workflow and tracked separately in issue #15. Branch CI does not receive a GitCode publication token.

Tag-driven GitHub Releases use a separate protected workflow and a dedicated Yandex identity. The tag formats, GitCode/GitHub provenance checks, environment gate, five-image asset contract, and same-tag retry procedure are documented in releases.md.

Cloud development environment procedures are documented in cloud-development.md. They use separate bootstrap and environment state, a folder-scoped external budget gate, immutable image digests with guarded commit-SHA tags, Lockbox payload injection outside Terraform, and blue/green API Gateway promotion.