Reconcile Gitea Actions failure with order-stable runtime checks

This commit is contained in:
Codex
2026-09-29 16:21:30 +03:00
parent 1adc0a66b3
commit ae5adfbd63
6 changed files with 448 additions and 20 deletions
+43
View File
@@ -125,6 +125,49 @@ startup-error categories/counts, never raw container logs or tokens.
python3 infra/gitea-ci/build_actions_artifact.py --patch-id gitea-actions-enable-v1-<unique-id> --source-commit <full-sha> --output-dir <output-dir>
```
### Recovery of Actions enable attempt 20260929-001
The first Actions apply stopped before replacing `app.ini` or restarting Gitea,
with `Gitea Actions runtime changed before mutation`. Its rollback repeated the
same fingerprint comparison and failed. Treat the failed archive, journal and
backup as evidence, not as permission to replay the artifact.
The legacy fingerprint compares `docker inspect` JSON including array order.
Docker 24.0.2 constructs
[mount points from a Go map](https://github.com/moby/moby/blob/v24.0.2/container/container_unix.go#L425-L440)
and [default ulimits from a map](https://github.com/moby/moby/blob/v24.0.2/daemon/oci_linux.go#L1012-L1026).
Their order can change without changing the container. Local tests reproduce the
false drift and preserve rejection of changed values, ordered command/env arrays,
image, ports and container identity. This explains a possible failure; the live
NAS must prove that it explains this specific attempt before another apply.
`actions-enable.v2` is a separate, bounded recovery for exactly that failed
attempt. Its read-only `plan` checks the failed journal, failed archive and saved
receipt digests, unchanged disabled config, leftover v1 descriptor, fixed Compose
context, same healthy Gitea and all other container identities/uptimes. For each
of three fresh inspections it must reconstruct the saved legacy fingerprint by
permuting only Mounts and HostConfig.Ulimits, retaining every field and value.
The search is capped at 4096 permutations and rejects duplicate mount destinations
or limit names. Any unexplained difference rejects the plan before mutation.
Only after that plan has been reviewed can a separate apply repeat the audit
under the deploy lock and perform the same one-boolean transition. New comparison
and acceptance sort the two unordered collections. All other preservation checks
stay in force. A pre-mutation failure performs no Docker restart. A failure after
mutation restores the disabled config and removes only the v2 source descriptor;
the v1 marker and original failed evidence remain intact. The v2 backup records
the fingerprint version and reconciled attempt. Historical artifact bytes and
legacy Gitea recovery branches remain unchanged.
```sh
python3 infra/gitea-ci/build_actions_artifact.py --patch-id gitea-actions-enable-v2-<unique-id> --source-commit <full-sha> --output-dir <output-dir>
```
At preparation time, live order equivalence is still unverified and instance
Actions, build-runner registration and automatic production deployment remain
unfinished. Promote the reviewed root runner, run only a fresh read-only v2 plan,
review its three audit samples, and then decide the next registered action.
From a clean Platform commit:
```sh