Skip to content

Qualify resource and watchdog accounting controls - #56

Merged
dovvnloading merged 3 commits into
mainfrom
codex/resource-watchdog-accounting
Jul 29, 2026
Merged

Qualify resource and watchdog accounting controls#56
dovvnloading merged 3 commits into
mainfrom
codex/resource-watchdog-accounting

Conversation

@dovvnloading

@dovvnloading dovvnloading commented Jul 29, 2026

Copy link
Copy Markdown
Owner

Summary

Adds the next Phase 2 release-gate slice for bounded resource and watchdog accounting.

What changed

  • Added immutable scratch.auto.v1 and artifact.transform.v1 resource budgets with hard ceilings for wall time, CPU, memory, messages, input/output bytes, console bytes, and observations.
  • Added monotonic wall/idle watchdog enforcement, cumulative sample validation, stable failure precedence, and fail-closed handling when required accounting is unavailable.
  • Integrated cumulative CPU/byte/message usage into the authenticated worker runtime; terminal reports explicitly mark missing peak-memory accounting as unavailable.
  • Added actual Windows Job Object basic accounting (CPU, memory, process, page-fault, and I/O fields) to the disposable native qualification path.
  • Added a deterministic 15-case resource-watchdog.v1 qualification corpus, Windows kill-on-close descendant reaping, regression tests, CI strict gating, and updated ADR/evidence documentation.
  • Integrated the resource qualification into the existing sandbox harness without authorizing provider launch.
  • Added a CPython-compatible HRESULT binding fallback; this fixes the CI-only failure on the repository's Python 3.11 runner.

Root cause

The prior qualification queried configured Job Object limits but did not prove actual accounting or deterministic logical watchdog behavior. While implementing the accounting query, the native probe exposed an ABI defect: the Windows basic accounting structure requires both per-period user and kernel-time fields; omitting the kernel field caused ERROR_BAD_LENGTH. The first remote run then exposed a second portability gap: CPython 3.11/3.12 does not expose ctypes.wintypes.HRESULT. Both the structure and the HRESULT binding are now corrected and covered.

Release interpretation

This closes the fixed-control resource/watchdog qualification gate only. Provider enablement remains blocked until the immutable signed worker generation, live broker identity binding, external security review, and production lifecycle health gates are complete. No host-process fallback or provider authorization was added.

Validation

  • python -m pytest -q — 289 passed, 1 expected Windows-platform skip, 1 warning on the GitHub Python 3.11 runner.
  • python tools/execution_spikes/resource_watchdog_qualification.py --json --strict — 15/15 passed on the GitHub Python 3.11 runner and local Python 3.12/3.14; corpus digest 5eac03e2b4981543.
  • python tools/execution_spikes/artifact_security_review.py --json --strict — 12/12 passed.
  • python -m compileall -q main.py backend tests tools/execution_spikes — passed.
  • Contract generation/diff verification — passed.
  • Frontend lint, typecheck, 39 unit tests, and production build — passed.
  • git diff --check — passed.

Ready for maintainer review and merge.

@dovvnloading
dovvnloading merged commit 541d651 into main Jul 29, 2026
1 check passed
@dovvnloading
dovvnloading deleted the codex/resource-watchdog-accounting branch July 29, 2026 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant