merge: GEN2-SECRETS-001 into delegated authority

# Conflicts:
#	deploy/docker-compose.prod.yml
#	dev/ACTIVE_TASK.json
#	docs/CREDENTIALS_AND_SECRETS.md
This commit is contained in:
m
2026-08-31 13:26:28 +03:00
15 changed files with 811 additions and 1 deletions
+3 -1
View File
@@ -23,7 +23,9 @@ Each privileged runtime gets only its required secret/capability bindings. `comm
The Core SELF learning repository uses the existing `assistant_core_secrets` volume and credential-reference mechanism with `self_role` and `credential://domovoy/self/db-password/v1`. The secret is consumed from the fixed `/run/secrets/self_db_password` path; its value is never placed in Compose environment, Git, logs or ordinary configuration. The role and schema already exist; this wiring does not create a role or broaden privileges.
Delegated non-interactive control-plane work is separately authenticated. The external `assistant_core_secrets` control plane must materialize `control_plane_service_token`, mode `0400`, for `core-runtime` and the existing Authority/Commit runtime only. Compose carries only `credential://domovoy/control-plane/service-token/v1`; trusted runtimes resolve the fixed file below `/run/secrets`. The service token is not a Creator session, cannot impersonate a human, and must be rotated or withdrawn in the secret backend. Removing the token disables new delegated operations; revoking the durable Authority grant also blocks them without deleting audit history.
Delegated non-interactive control-plane work is separately authenticated. The local `secret-control-plane` one-shot control-plane service provisions `control_plane_service_token` with `crypto/rand` into the dedicated external `assistant_control_plane_service_secrets` volume. The token artifact is mode `0400`; metadata and audit are separate protected files and contain no value or reversible fingerprint. Only `core-runtime` and the existing Authority/Commit runtime mount that volume read-only at `/run/control-plane-secrets`; no model, Skill, SELF, creator-web, cognitive-worker or research-runtime receives the mount. Compose carries only the non-secret credential reference `credential://domovoy/control-plane/service-token/v1`.
The provisioner is idempotent: restart reuses an existing safe active artifact. Rotation creates a new value by atomic replacement, records non-secret metadata/audit, and never accepts a plaintext environment variable. The service token is not a Creator session, cannot impersonate a human, and never grants Authority by itself. Removing or rotating the token disables/refreshes service authentication; revoking the durable Authority grant also blocks new delegated operations without deleting audit history.
Creator authentication secrets are stored in the external Docker volume `assistant_core_secrets` and mounted read-only only at `/run/secrets` in `core-runtime`. The production container environment contains `_FILE` paths, not the secret values. Files are owned by runtime uid 100/gid 101 with mode 0400. `CREATOR_USERNAME` is not secret and remains an environment value. Development may continue to use direct environment values, but a direct value and its matching `_FILE` setting must never be configured together.
@@ -0,0 +1,53 @@
# GEN2-SECRETS-001 — local machine credential provisioning
Date: 2026-08-31
## Design evidence
`platform/secrets` is the existing technical protected-file mechanism. This
task extends it without adding a semantic Secrets owner, a database table, or
a Configuration/Memory writer.
The dedicated Docker volume is named
`assistant_control_plane_service_secrets`. Its sole writer is the one-shot
`secret-control-plane` control-plane container. Its only consumers are
`core-runtime` and `commit-runtime`, mounted read-only at
`/run/control-plane-secrets`. The metadata directory is distinct from the
token artifact and records purpose, owner, version, consumers, status,
generation method, and non-secret audit actions only.
The provisioner uses `crypto/rand`, writes via an atomic file replacement,
and has no plaintext environment input. It reports only safe operation status.
The data policy marks the artifact as not indexable, embeddable, retrievable,
or model-visible.
## Local FAST evidence
The following checks completed successfully before production execution:
- targeted `go test ./platform/secrets ./cmd/secret-control-plane`;
- targeted `go vet ./platform/secrets ./cmd/secret-control-plane`;
- POSIX shell regression for the provisioning wrapper, executed under Git
Bash because the Windows WSL shim cannot translate the mapped workspace;
- static Docker Compose validation for production and candidate files.
No credential value, fingerprint, length, header, or plaintext environment
value was read, printed, copied, committed, or included in this evidence.
## Production control-plane evidence
The one-shot provisioner was run from a detached `gen2-integration` worktree
on `docker.cin.su`. It created the dedicated external volume and provisioned
the credential once. A repeat `ensure` reported that the already active
artifact was reused. A bounded owner-requested rotation then completed.
For creation, idempotent ensure, and rotation, the stable Core, Commit,
Creator Web, Cognitive Worker, and Research Runtime container identities were
recorded before and after the one-shot operation and were unchanged. The
verification checked only artifact and separate metadata/audit file presence;
it did not read their content.
At this point the credential is provisioned but not yet used by the stable
runtime. Consumer mount and service-authentication acceptance are completed
only when `GEN2-AUTHORITY-001` is merged and deployed as its own controlled
candidate ReleaseSet.