fix(startup): reconcile profiles before bounded activation

Co-authored-by: GPT-6 <gpt-6@openai.com>
This commit is contained in:
ZeusinaandGPT-6 Bot committed 2026-10-10 23:27:53 +03:00
1 parent b1e458a0a5
commit e2cfccedf1
9 files changed
+338 -25

No files matched your search

+15 -3
View File
@@ -1,6 +1,6 @@
# Fresh managed-test target contract (not deployed)
`managed init|status|active-ids|apply` is exclusively for a **new dedicated container**
`managed init|reconcile|status|active-ids|apply` is exclusively for a **new dedicated container**
which owns its entire config. The existing/dev/production container must refuse
these commands. A role env or CLI-created identity is not enough. Provisioning
must supply all of the following before any managed command can run:
@@ -160,7 +160,7 @@ DB/safety/journal/runner failures stop nonzero; joined cancellation plus a clean
failure is also fatal. A qualified frontend at startup is probed immediately,
not rescanned merely because the process restarted.
Entrypoint ordering is SS children → listener → managed init/status → zapret start
Entrypoint ordering is SS children → listener → fresh managed init if needed → managed reconcile → zapret start
→ one installed `/usr/local/bin/zapret-autotune managed monitor` child. It supervises
all three children; monitor exit is fatal even if it exits zero unexpectedly.
SIGTERM/SIGINT cancels and waits the monitor before target-local zapret stop and
@@ -197,6 +197,12 @@ Pins constrain build inputs; they do not establish live acceptance or guarantee
bit-for-bit builds on different platforms. Record the source commit, platform,
builder/runtime digests and resulting image digest for every release.
Both Dockerfiles require BuildKit for the compilation-cache mount at
`/root/.cache/go-build` (enable with `DOCKER_BUILDKIT=1` if not already default).
This cache only speeds rebuilds; it is not copied into the final runtime image
and is not a secret store. No deployment credentials are needed or passed to
the build; keep secrets out of build arguments and cache contents.
Example (replace registry and release; never reuse a release tag):
```sh
@@ -317,7 +323,13 @@ be reported as complete playback health.
A restored legacy/live/unverifiable recovery owner can fail closed; never
clear its lease or unlink the lock merely to force startup.
On drift, pending transaction, rollback failure, or exhausted systemd start
On startup, `managed reconcile` accepts no flags and uses only the fixed private
`/var/lib/zapret-autotune/target/candidates.db`. Known interrupted prepared state
is rolled back to qualified committed bytes before any reload/start; fresh
baseline and known committed state are idempotent. Unknown/legacy state, drift,
missing qualification or failed rollback blocks startup with a non-retry exit.
On drift, unreconcilable pending transaction, rollback failure, or exhausted systemd start
limit, leave state intact and service stopped. Diagnose using sanitized status
and private artifacts; repair the actual provisioning/configuration issue or
restore a known consistent backup. Only then manually start (and reset the