Skip to content

Commit 38d6678

Browse files
committed
FEATURE-ci-process-cleanup: Bound one native receipt probe for historical snapshot errors
Execute only the actual owned-zombie receipt contract for up to 30 iterations in a 60-second start window, with failfast and existing bounded command cleanup. Retain offending raw ps rows, source binding, and structured per-iteration results. Preserve the already verified full native contract proof by enforcing its exact helper/test hashes. Local diagnostic-runner verification passed 30 iterations (180 command cases) in 15.022s. The two historical unmodified native snapshot errors remain unexplained; this probe provides bounded evidence for review rather than a speculative parser fix.
1 parent 944fa19 commit 38d6678

1 file changed

Lines changed: 37 additions & 20 deletions

File tree

‎.github/workflows/v3-cleanup-diagnostic.yml‎

Lines changed: 37 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ jobs:
1313
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
1414
- name: Match Python prerequisite
1515
run: brew install python
16-
- name: Run native command contracts
16+
- name: Bound the unexplained native snapshot observation
1717
timeout-minutes: 2
1818
shell: bash
1919
run: |
2020
mkdir -p "$RUNNER_TEMP/v3-cleanup-contracts"
2121
cat > "$RUNNER_TEMP/v3-cleanup-command-contracts.py" <<'PYTHON'
22-
import hashlib, importlib.util, json, os, subprocess, sys, unittest
22+
import hashlib, importlib.util, json, os, subprocess, sys, time, unittest
2323
from pathlib import Path
2424
source = Path.cwd()
2525
output = Path(os.environ['RUNNER_TEMP'], 'v3-cleanup-contracts')
@@ -60,15 +60,30 @@ jobs:
6060
global current_test
6161
current_test = test.id()
6262
super().startTest(test)
63-
suite = unittest.defaultTestLoader.loadTestsFromTestCase(contracts.CommandsTest)
64-
expected = [test.id() for test in suite]
65-
result = unittest.TextTestRunner(verbosity=2, resultclass=Result).run(suite)
66-
report = dict(expected=expected, tests_run=result.testsRun, successful=result.wasSuccessful(),
67-
failures=[test.id() for test, _ in result.failures],
68-
errors=[test.id() for test, _ in result.errors],
69-
skipped=[dict(test=test.id(), reason=reason) for test, reason in result.skipped])
63+
started = time.monotonic()
64+
trials = []
65+
for iteration in range(1, 31):
66+
if time.monotonic() - started >= 60:
67+
break
68+
suite = unittest.TestSuite([contracts.CommandsTest(
69+
'test_owned_zombie_permission_denial_preserves_completed_receipts')])
70+
result = unittest.TextTestRunner(verbosity=2, resultclass=Result, failfast=True).run(suite)
71+
trial = dict(iteration=iteration, tests_run=result.testsRun, successful=result.wasSuccessful(),
72+
failures=[test.id() for test, _ in result.failures],
73+
errors=[test.id() for test, _ in result.errors],
74+
skipped=[dict(test=test.id(), reason=reason) for test, reason in result.skipped])
75+
trials.append(trial)
76+
report = dict(mode='bounded-owned-zombie-receipts', max_iterations=30, max_seconds=60,
77+
elapsed_seconds=time.monotonic() - started, trials=trials,
78+
successful=all(item['successful'] for item in trials),
79+
stop='first-failure' if not result.wasSuccessful() else 'running')
80+
(output / 'result.json').write_text(json.dumps(report, indent=2) + '\n')
81+
if not result.wasSuccessful():
82+
break
83+
report['stop'] = ('first-failure' if not report['successful'] else
84+
'iteration-limit' if len(trials) == 30 else 'time-limit')
7085
(output / 'result.json').write_text(json.dumps(report, indent=2) + '\n')
71-
raise SystemExit(not result.wasSuccessful())
86+
raise SystemExit(not report['successful'])
7287
PYTHON
7388
set +e
7489
python3 "$RUNNER_TEMP/v3-cleanup-command-contracts.py" 2>&1 | tee "$RUNNER_TEMP/v3-cleanup-contracts/commands-test.log"
@@ -210,15 +225,17 @@ jobs:
210225
assert receipt['python'] == binding['python']
211226
assert (contracts / 'exit-status').read_text().strip() == '0'
212227
result = json.loads((contracts / 'result.json').read_text())
213-
assert result['successful'] and not result['failures'] and not result['errors']
214-
assert result['tests_run'] == len(result['expected']) == 22
215-
assert len(set(result['expected'])) == 22
216-
expected_skips = {
217-
'native_contracts.CommandsTest.test_cleanup_discovery_failure_retains_original_error',
218-
'native_contracts.CommandsTest.test_new_live_member_delays_retirement_and_zombies_do_not',
219-
'native_contracts.CommandsTest.test_discovery_consumes_cleanup_deadline_without_restarting_wait'}
220-
assert len(result['skipped']) == 3
221-
assert {item['test'] for item in result['skipped']} == expected_skips
228+
assert result['mode'] == 'bounded-owned-zombie-receipts' and result['successful']
229+
assert result['max_iterations'] == 30 and result['max_seconds'] == 60
230+
assert 1 <= len(result['trials']) <= 30
231+
assert result['stop'] in ('iteration-limit', 'time-limit')
232+
for trial in result['trials']:
233+
assert trial['tests_run'] == 1 and trial['successful']
234+
assert not trial['failures'] and not trial['errors'] and not trial['skipped']
235+
# Full 22-contract native GREEN is retained from run 38838310419 for these helper/test hashes.
236+
assert hashes == {
237+
'scripts/lib/package_commands.py': 'e04b86a71ca0fc9085ea2bb527afaba0fc3bf030e0934ef02f78c44d46b344cb',
238+
'scripts/test-v3-installed-consumer.py': 'fa2b3e67ae3f0e5921c98e2dc10fa3653e401f5e0a31b9e4ff219b1d130f3492'}
222239
assert receipt['uname'][0] == 'Darwin'
223240
assert len(receipt['commands']) == 3
224241
assert all(item['result'] == 'success' for item in receipt['commands'])
@@ -253,7 +270,7 @@ jobs:
253270
assert control['zombie_group_signal_zero']['errno'] == 1
254271
assert control['zombie_helper_sigkill']['result'] == 'success'
255272
(output / 'semantic-proof.json').write_text(json.dumps(dict(status='passed', source_sha=source_sha,
256-
hashes=hashes, command_exits=[row['exit'] for row in records], native_contracts='passed'), indent=2) + '\n')
273+
hashes=hashes, command_exits=[row['exit'] for row in records], native_contracts='retained-run-38838310419', bounded_receipt_probe='passed'), indent=2) + '\n')
257274
PY
258275
- if: always()
259276
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02

0 commit comments

Comments
 (0)