gowalk-cicd 1.0.215 → 1.0.217

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -174,8 +174,8 @@ queueing, retries and provider work. Count conditional dependency priming as aux
174
174
 
175
175
  Promoted candidates now seed missing default-branch SDK/pub/Flutter Pods/Gradle caches through
176
176
  verified key/path/compression identities and dependency-only work. They never promote PR cache
177
- bytes or duplicate a compile. Default-branch macOS fallbacks transfer the IPA and leave Apple
178
- processing to a required Linux verification job. Apple must positively confirm the exact upload,
177
+ bytes or duplicate a compile. Every default-branch delivery, including reused IPA uploads on Linux,
178
+ transfers the IPA and leaves Apple processing to a required Linux verification job. Apple must confirm the exact upload,
179
179
  file, eligible build and app before delivery completes; its processing time remains external.
180
180
  The final complete upload receipt and verification proof are in `apple-verified-<run>-<attempt>`.
181
181
  See [candidate artifacts](docs/CANDIDATE_ARTIFACTS.md) and [cache behavior](docs/GRADLE_CACHE.md).
@@ -1273,6 +1273,24 @@ different bytes under the same number. Build numbers come from `/builds`,
1273
1273
  `/preReleaseVersions` **and** `/apps/{id}/buildUploads`, so an unfinished or refused
1274
1274
  reservation is never reused; delete such a reservation only after reading it back.
1275
1275
 
1276
+ Before 1.0.216, Linux candidate promotion waited inline and did not produce a verification handoff.
1277
+ If that original upload timed out with `processing_pending`, use the existing receipt recovery helper
1278
+ in an authorized same-repository Actions job on the default branch. Authenticate the original
1279
+ `apple-upload-<run>-<attempt>` artifact and its archive digest, retain its unchanged
1280
+ `apple-build-upload.json`, and invoke:
1281
+
1282
+ ```bash
1283
+ node .github/actions/swift-app/scripts/reconcile_apple_upload.cjs \
1284
+ DEPLOYMENT_ID ORIGINAL_RUN_ID ORIGINAL_ATTEMPT /path/to/apple-build-upload.json
1285
+ ```
1286
+
1287
+ Use the same permissions, credentials and serialized Mobile Deploy concurrency described below.
1288
+ This helper requires the original failed owner and fresh Apple upload/file/checksum/build/app proof;
1289
+ it never rebuilds or uploads. Retain its result and read back `uploaded` before rerunning the whole
1290
+ original deployment. Do not fabricate a handoff or substitute this command for missing provider proof.
1291
+ From 1.0.216, Linux promotion retains the same authenticated handoff as macOS delivery, so future
1292
+ processing failures use the managed recovery workflow below.
1293
+
1276
1294
  When an iOS deployment failed or was cancelled **after** both `Build and transfer iOS binary`
1277
1295
  and `Retain Apple verification handoff` succeeded, version 1.0.185 provides the managed
1278
1296
  `apple-upload-recovery.yml` workflow. Dispatch it on the repository's default branch with the
@@ -1392,7 +1410,10 @@ Each invocation uses a fresh local directory so a failed reader cannot publish a
1392
1410
 
1393
1411
  The backend action's `operation: runtime-diagnostics` reads the exact app project and expected deployed SHA,
1394
1412
  returning actual service count, effective limits, two bounded resource samples and private database-binding
1395
- provenance. Call it from the app's read-only diagnostic workflow with `diagnostic-service` and
1413
+ provenance. From 1.0.217 it also requests current-container restart count, OOM flag, start/finish timestamps
1414
+ and health status; install the published host runtime before adopting that client. A refused or missing
1415
+ observation stays unavailable, never a zero count or evidence that no historical restart occurred.
1416
+ Call it from the app's read-only diagnostic workflow with `diagnostic-service` and
1396
1417
  `expected-build-sha`, using its existing host/key/pin inputs. It requires the released host forced command as well
1397
1418
  as the updated action. See [the scoped runtime contract and host installer](docs/BACKEND_SSH_GATE.md#applied-runtime-readback).
1398
1419
  Identity failure logs and source Compose files do not establish this applied state.
@@ -34,7 +34,8 @@ def local(args, transport=None):
34
34
  if (not re.fullmatch(r'[A-Za-z0-9][A-Za-z0-9.-]{0,252}', args.host or '')
35
35
  or not re.fullmatch(r'[a-z_][a-z0-9_-]{0,31}', args.user)):
36
36
  raise RuntimeFailure('invalid_scope')
37
- command = shlex.join(['gowalk-backend', 'runtime-diagnostics', args.app, args.service, args.expected_build_sha])
37
+ command = shlex.join(['gowalk-backend', 'runtime-diagnostics', args.app, args.service,
38
+ args.expected_build_sha, 'lifecycle'])
38
39
  try:
39
40
  status, raw, errors = bounded(['ssh', '-T', '-i', str(Path.home() / '.ssh/backend_deploy'),
40
41
  '-o', 'IdentitiesOnly=yes', '-o', 'BatchMode=yes', '-o', 'StrictHostKeyChecking=yes',
@@ -57,6 +58,8 @@ def local(args, transport=None):
57
58
  raise RuntimeFailure('remote_invalid') from None
58
59
  if result['ok'] != (status == 0):
59
60
  raise RuntimeFailure('remote_invalid')
61
+ if result['ok'] and any('lifecycle' not in row for row in result['services']):
62
+ raise RuntimeFailure('remote_invalid')
60
63
  return result
61
64
 
62
65
 
@@ -1,4 +1,5 @@
1
1
  """Closed, credential-free envelope for one app's deployed runtime observations."""
2
+ import datetime
2
3
  import math
3
4
  import re
4
5
 
@@ -34,10 +35,31 @@ def number(value, *, integer=False, positive=False):
34
35
  raise RuntimeFailure('remote_invalid')
35
36
 
36
37
 
38
+ def lifecycle_record(row):
39
+ fields = {'restart_count', 'oom_killed', 'started_at', 'finished_at', 'health_status'}
40
+ if not isinstance(row, dict) or set(row) != fields:
41
+ raise RuntimeFailure('remote_invalid')
42
+ if (type(row['restart_count']) is not int or not 0 <= row['restart_count'] <= 2 ** 53 - 1
43
+ or type(row['oom_killed']) is not bool or not isinstance(row['health_status'], str)
44
+ or row['health_status'] not in {'none', 'starting', 'healthy', 'unhealthy'}):
45
+ raise RuntimeFailure('remote_invalid')
46
+ for name in ('started_at', 'finished_at'):
47
+ value = row[name]
48
+ if (not isinstance(value, str) or len(value) > 30
49
+ or not re.fullmatch(r'\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.\d{1,9})?Z', value)):
50
+ raise RuntimeFailure('remote_invalid')
51
+ try:
52
+ datetime.datetime.strptime(value[:19], '%Y-%m-%dT%H:%M:%S')
53
+ except ValueError:
54
+ raise RuntimeFailure('remote_invalid') from None
55
+
56
+
37
57
  def service_record(row):
38
58
  fields = {'service', 'container_id', 'image_id', 'running', 'limits', 'samples'}
39
- if not isinstance(row, dict) or set(row) != fields:
59
+ if not isinstance(row, dict) or set(row) not in (fields, fields | {'lifecycle'}):
40
60
  raise RuntimeFailure('remote_invalid')
61
+ if 'lifecycle' in row:
62
+ lifecycle_record(row['lifecycle'])
41
63
  for name, pattern in (('service', SERVICE), ('container_id', CID), ('image_id', 'sha256:' + CID)):
42
64
  if not isinstance(row[name], str) or not re.fullmatch(pattern, row[name]):
43
65
  raise RuntimeFailure('remote_invalid')
@@ -14,6 +14,9 @@ APPS = Path('/opt/gowalk-backends')
14
14
  PROFILES = Path('/opt/gowalk-backend-runtime')
15
15
  ROOT_UID = 0
16
16
  INSPECT = ('{"id":{{json .Id}},"image":{{json .Image}},"running":{{json .State.Running}},'
17
+ '"lifecycle":{"restart_count":{{json .RestartCount}},"oom_killed":{{json .State.OOMKilled}},'
18
+ '"started_at":{{json .State.StartedAt}},"finished_at":{{json .State.FinishedAt}},'
19
+ '"health_status":{{if .State.Health}}{{json .State.Health.Status}}{{else}}"none"{{end}}},'
17
20
  '"project":{{json (index .Config.Labels "com.docker.compose.project")}},'
18
21
  '"service":{{json (index .Config.Labels "com.docker.compose.service")}},'
19
22
  '"directory":{{json (index .Config.Labels "com.docker.compose.project.working_dir")}},'
@@ -119,16 +122,19 @@ def usage(rows):
119
122
  return result
120
123
 
121
124
 
122
- def public_row(row, samples):
125
+ def public_row(row, samples, lifecycle=False):
123
126
  cpus = row['nano_cpus'] / 1e9 if row['nano_cpus'] else (
124
127
  row['quota'] / row['period'] if row['quota'] > 0 and row['period'] > 0 else 0)
125
- return {'service': row['service'], 'container_id': row['id'], 'image_id': row['image'],
128
+ result = {'service': row['service'], 'container_id': row['id'], 'image_id': row['image'],
126
129
  'running': row['running'], 'limits': {'memory_bytes': row['memory'],
127
130
  'reservation_bytes': row['reservation'], 'cpu_limit': cpus, 'pids_limit': row['pids']},
128
131
  'samples': [sample[row['id']] for sample in samples] if row['running'] else []}
132
+ if lifecycle:
133
+ result['lifecycle'] = row['lifecycle']
134
+ return result
129
135
 
130
136
 
131
- def collect(app, service, expected):
137
+ def collect(app, service, expected, lifecycle=False):
132
138
  scope(app, service, expected)
133
139
  original_profile = profile(app)
134
140
  identifiers = containers(app)
@@ -143,7 +149,7 @@ def collect(app, service, expected):
143
149
  if profile(app) != original_profile:
144
150
  raise RuntimeFailure('profile_changed')
145
151
  result = dict(envelope(app, service, expected), observed_build_sha=expected,
146
- services=[public_row(row, samples) for row in rows], container_count=len(rows),
152
+ services=[public_row(row, samples, lifecycle) for row in rows], container_count=len(rows),
147
153
  database=binding,
148
154
  observed_at=datetime.datetime.now(datetime.timezone.utc).strftime('%Y-%m-%dT%H:%M:%SZ'))
149
155
  return validate(result, app, service, expected)
@@ -152,7 +158,9 @@ def collect(app, service, expected):
152
158
  def main():
153
159
  app, service, expected = (sys.argv[1:] + ['', '', ''])[:3]
154
160
  try:
155
- result = collect(app, service, expected)
161
+ if len(sys.argv) not in (4, 5) or len(sys.argv) == 5 and sys.argv[4] != 'lifecycle':
162
+ raise RuntimeFailure('invalid_scope')
163
+ result = collect(app, service, expected, len(sys.argv) == 5)
156
164
  except Exception as error:
157
165
  result = envelope(app, service, expected, error.code if isinstance(error, RuntimeFailure) else 'unclassified')
158
166
  print(json.dumps(result, separators=(',', ':')))
@@ -82,10 +82,12 @@ def authorize(owner, project, policy, may_claim):
82
82
  def helper_command(words):
83
83
  if words[:2] == ['gowalk-backend', 'network-diagnostics']:
84
84
  return network_command(words)
85
- if len(words) == 5 and words[:2] == ['gowalk-backend', 'runtime-diagnostics']:
85
+ if len(words) in (5, 6) and words[:2] == ['gowalk-backend', 'runtime-diagnostics']:
86
86
  from runtime_projection import RuntimeFailure, scope
87
87
  try:
88
- scope(*words[2:])
88
+ scope(*words[2:5])
89
+ if len(words) == 6 and words[5] != 'lifecycle':
90
+ raise RuntimeFailure('invalid_scope')
89
91
  except RuntimeFailure:
90
92
  raise ValueError('ssh_arguments_refused') from None
91
93
  return words[2], False, [sys.executable, str(HELPERS / 'runtime_readback.py'), *words[2:]]
@@ -62,7 +62,9 @@ Failures emit only `backend_ssh_refused`, never the original command or private
62
62
 
63
63
  The released backend action accepts `operation: runtime-diagnostics`, `diagnostic-service` (default `api`) and
64
64
  `expected-build-sha`. Its existing pinned CI SSH identity issues only
65
- `gowalk-backend runtime-diagnostics <project> <service> <40-character-SHA>`. The forced command checks the same
65
+ `gowalk-backend runtime-diagnostics <project> <service> <40-character-SHA> lifecycle` from version 1.0.217.
66
+ The optional final token selects lifecycle observations; older clients omit it and receive the original shape.
67
+ The forced command checks the same
66
68
  panel/project ownership and global freeze, then executes its own released `runtime_readback.py`. It never runs
67
69
  consumer code or an uploaded script. An older/refusing gate has no reader receipt and the client returns
68
70
  `runtime_reader_unavailable`; locally synthesized failures carry `reader_version: null`, never host-adoption proof.
@@ -77,6 +79,26 @@ Docker's display precision. CPU samples are Docker's bounded observations, not a
77
79
  collector never launches workload, reads logs, executes in containers or inspects a shared database's cgroup.
78
80
  Both container identity/configuration and the private profile are rechecked before returning success.
79
81
 
82
+ The opted-in response adds a closed `lifecycle` object to each service:
83
+
84
+ - `restart_count`: Docker's nonnegative restart count for that exact container, bounded to a safe JSON integer;
85
+ - `oom_killed`: Docker's boolean OOM observation for its current recorded state;
86
+ - `started_at` and `finished_at`: Docker UTC timestamps, with at most nine fractional digits;
87
+ - `health_status`: `none`, `starting`, `healthy` or `unhealthy`; `none` means no Docker healthcheck is present.
88
+
89
+ The Docker zero timestamp `0001-01-01T00:00:00Z` is retained as reported. No exit error, healthcheck command,
90
+ health log or raw state object is read or returned. The same container's lifecycle changing between resource
91
+ samples and the final inspect refuses `runtime_changed`, rather than joining observations across a restart.
92
+ These facts do not establish the cause of an HTTP 502. Zero restarts or `oom_killed: false` cannot exclude
93
+ earlier OOM/restarts on a replaced container; compare exact container IDs and separately observed app behavior.
94
+
95
+ Install the integrity-verified 1.0.217 host runtime through `install_runtime.py` below before adopting the new
96
+ client. New clients require the requested lifecycle fields; old hosts that refuse the fixed token produce
97
+ `runtime_reader_unavailable` with the existing transport observations, never invented lifecycle defaults or
98
+ automatic unrestricted recovery. The v1 schema and reader marker stay compatible; the install receipt and
99
+ forced-command release path prove host adoption. A new host still serves old clients the unchanged v1 response
100
+ when they omit the token. Read-only diagnostics never install or update the host helper themselves.
101
+
80
102
  The same artifact also retains `transport.json`, schema `gowalk-cicd/backend-runtime-transport.v1`.
81
103
  Its fixed fields also appear in the brace-free `backend_runtime_transport` notice. It reports the SSH child's
82
104
  `exit_status` (null when no complete exit was observed) and fixed `signals`: `gate_refused`,
@@ -67,7 +67,9 @@ Pods/gems caches keep their existing lockfile, Ruby, Xcode and architecture iden
67
67
 
68
68
  Verified candidate promotion already ran on Linux before 1.0.174. In 1.0.175, default-branch
69
69
  macOS fallback/retry releases also release the Mac after transfer and retain the exact IPA and
70
- hashed verification handoff. A required Linux job verifies Apple's exact upload, file membership,
70
+ hashed verification handoff. From 1.0.216, Linux candidate promotion uses that same handoff instead
71
+ of an inline wait that could time out without a managed recovery artifact.
72
+ A required Linux job verifies Apple's exact upload, file membership,
71
73
  VALID/APP_STORE_ELIGIBLE build and app identity before the owner is marked uploaded or release
72
74
  notes run. A prior producer attempt survives failed-only verifier retries without a second upload.
73
75
  A later required symbol-retention failure can still reconcile that exact successful transfer and
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gowalk-cicd",
3
- "version": "1.0.215",
3
+ "version": "1.0.217",
4
4
  "description": "Zero-config GitHub Actions delivery for iOS TestFlight and Android Google Play.",
5
5
  "type": "module",
6
6
  "bin": {
package/remedies.json CHANGED
@@ -2,8 +2,8 @@
2
2
  {
3
3
  "schema": "gowalk-cicd/apple-build-upload-failed.v2",
4
4
  "code": "processing_pending",
5
- "fixed_in": "1.0.184",
6
- "remedy": "Keep the original IPA and apple-build-upload receipt. From 1.0.184 recovery stages unchanged bytes as app.ipa so punctuation in the export filename cannot block retention. A PROCESSING upload summary can complete only after fresh proof of its completed matching asset/checksum and unique valid eligible iOS build, exact app/bundle and marketing version. Future receipts carry local MD5 as well as SHA-256. Run reconcile_apple_upload.cjs only in an authorized Actions recovery job with the original deployment, run, attempt and retained receipt; it never uploads. Read its owner completion back, then rerun the whole original deploy workflow. Missing original bytes or checksum proof remain unverified; never invent the digest, re-upload another binary under the same number or hand-edit the owner."
5
+ "fixed_in": "1.0.216",
6
+ "remedy": "Keep the original IPA and apple-build-upload receipt. From 1.0.216 default-branch Linux candidate promotion retains the same authenticated verification handoff as macOS delivery; adopt the action and generated workflow together. Earlier inline Linux processing_pending failures have no handoff: do not fabricate one or use the handoff-only recovery workflow. In an authorized same-repository default-branch Actions job, authenticate the original apple-upload-<run>-<attempt> artifact and archive digest, then run reconcile_apple_upload.cjs DEPLOYMENT_ID ORIGINAL_RUN_ID ORIGINAL_ATTEMPT /path/to/apple-build-upload.json with that unchanged receipt. Serialize with Mobile Deploy and preserve its original owner. The released helper requires fresh completed upload/file/checksum and unique VALID eligible iOS build/app proof; it never rebuilds or uploads. Retain its result, read back uploaded, then rerun the whole original deploy. Missing original bytes or checksum proof remain unverified; never invent digests, upload another binary under the same number or hand-edit ownership."
7
7
  },
8
8
  {
9
9
  "schema": "gowalk-cicd/mobile-release-refused.v1",
@@ -251,7 +251,7 @@ jobs:
251
251
  candidate-binary: ${{ steps.reuse.outputs.directory }}
252
252
  upload: ${{ inputs.candidate-build && 'false' || 'true' }}
253
253
  defer-provider-verification: >-
254
- ${{ !inputs.candidate-build && runner.os == 'macOS'
254
+ ${{ !inputs.candidate-build
255
255
  && github.ref_name == github.event.repository.default_branch && 'true' || 'false' }}
256
256
  auto-update: 'false' # the frozen source includes its reviewed action version
257
257
  run-tests: 'false' # tests belong to the CI gate, not the deploy path
Binary file