oficina / agent-access Public

Clone
git clone https://amadan.net/oficina/agent-access

Plain git — no account needed to clone.

Download this file

Connection service platform runtime

Bounded deployment prerequisite: the current standalone flags cannot satisfy CARLOS socket activation, serve argv, persistent state directory, health/version probes or config delivery. Keep the existing standalone -config/-listen/-db mode. Add an explicit deployment mode selected by nonempty OFICINA_CONNECT_CONFIG_BASE64, decoded as the same strict public configuration JSON, with a deployment-only 64 KiB decoded cap (at most 87384 base64 bytes, below Linux per-environment-string limits). Standalone file input retains its 2 MiB cap; larger deployment catalogs must be split/reduced until file delivery is explicitly implemented. Secrets remain only OFICINA_CONNECT_DEK and OFICINA_DIRECTORY_TOKEN; reject malformed or ambiguous configuration without logging payloads.

Deployment mode uses the already pinned Rastrillo Resolve/Serve contract, default DB oficina-connect.db under STATE_DIRECTORY, optional socket/addr/db activation arguments, health/version probes, graceful signal handling and existing request timeouts. Open the database exactly once, run the same connection.New service, then clear Options.DBPath before Serve. Mount the existing host-checked service handler under the framework mux. App consent/handoff headers retain their existing behavior. No Home claims or permission rules change.

Test the actual subprocess via a Unix socket using CARLOS-style argv, verify metadata/health/version, DB location and graceful termination; exercise malformed public config and missing secret startup refusal without sensitive diagnostic output. Retain standalone compatibility tests and full module vet/race checks. Independent source/evidence review precedes a canary deployment. Live infrastructure work requires a separate concrete scoped approval under the CARLOS platform AGENTS rule.

Release builds must stamp the exact release version token (the full git SHA in this release recipe) into amadan.net/rastrillo/rastrillo.BuildVersion via -X, record artifact SHA256, and verify that non-dev value from /api/version. Tests build an executable with a fixed non-dev stamp. The env branch runs before any standalone flag parsing; mixed env with standalone -config or -listen flags fails; shared platform -db remains valid.

The pinned framework has no MaxHeaderBytes option. Platform mode intentionally uses its bounded net/http default network parser limit (1 MiB, as the existing Oficina apps do), plus the retained ten-second header deadline. A wrapper additionally refuses application requests with more than 16 KiB of header names/values and request target before app/session/OAuth handling. This application budget does not claim to reduce the framework parser's allocation bound. Probe routes use the framework's parser limit. Standalone remains 16 KiB at the network parser. Tests distinguish these bounds. This avoids upgrading all app dependencies solely to add a transport option; converge on an upstream explicit MaxHeaderBytes option later.

The release recipe passes the same full SHA to both the BuildVersion linker stamp and carlos deploy --version; CARLOS compares those byte-for-byte. For carlos vet --boot, supply a synthetic valid public configuration, synthetic DEK and synthetic directory token through inherited environment. Never add a configless healthy mode. The synthetic configuration performs no upstream calls on boot and uses reserved test origins.