Skip to content

fix: budget pytest tmpfs from measured cgroup overhead - #3948

Merged
Sinity merged 21 commits into
masterfrom
feature/fix/tmpfs-resource-budget
Aug 11, 2026
Merged

Sinity merged 21 commits into
masterfrom
feature/fix/tmpfs-resource-budget

Conversation

@Sinity

@Sinity Sinity commented Aug 11, 2026 •

Copy link
Copy Markdown
Owner

Summary

Make the managed pytest harness select, supervise, and reclaim test storage from measured process, cgroup-overhead, basetemp, host-headroom, and filesystem envelopes.

Problem

The previous policy could admit a tmpfs cap from predicted demand while ignoring the larger allowed cap, and it could double-count or omit the cgroup charge around tmpfs pages. Broad suites then either filled shared memory or refused under misleading arithmetic. Real xdist progress was also written to per-worker event files that the live stall supervisor did not read, while nested benchmark pytest could consume tmpfs without that supervisor enforcing the cap. Explicit basetemp roots below /dev/shm bypassed the common budget, and legacy read-only fixture trees could survive the stale-directory sweep indefinitely.

Solution

Use the observed 6,278,623,232-byte cgroup peak, separate fixed process/cgroup overhead from adjustable tmpfs demand, and cap host capacity by the smallest remaining ancestor cgroup allowance. Worker-memory admission remains active for explicit scratch roots. Focused tests retain bounded tmpfs by default. Full-suite and seed-testmon runs default to NVMe scratch because the fixture tree can exceed the supervised 2 GiB tmpfs ceiling; an explicit tmpfs broad run remains bounded.

The live supervisor reads both per-worker event files and the merged event artifact, so flowing controller output cannot mask wedged workers. Nested benchmark pytest preserves managed admission and run identity while using scratch because its parent is not a pytest supervisor. Explicit /dev/shm roots now use the same cap and cleanup path. Stale basetemp ownership binds PID plus process-start identity, and stale read-only fixture publications are made owner-writable only after liveness adjudication so cleanup can finish.

The full-suite diagnostic also exposed a test fixture that created current durable tier files without fresh-bootstrap authority. The mutation-actuator fixture now initializes the active archive through the production bootstrap route.

Verification

  • direnv exec . devtools test tests/unit/devtools/test_verify.py tests/unit/test_pytest_temp_policy.py tests/unit/operations/test_mutation_actuators.py: 216 passed in 28.12s
  • direnv exec . devtools test -k managed_pytest_policy_bounds_explicit_tmpfs_root: 1 passed, 21,312 deselected
  • direnv exec . devtools test tests/unit/devtools/test_run_tests.py tests/unit/test_pytest_temp_policy.py: 33 passed in 1.91s
  • direnv exec . devtools verify --quick: all 25 steps passed in 108.08s at a0da69269458fdd7c90b717109434f05df8ac603
  • A scratch-backed seed-testmon diagnostic collected 21,313 nodes and ran for 1,492 seconds without tmpfs termination. It exposed 125 genuine failed calls before intentional termination because the branch had changed and the 45-minute cap could not produce an exact-head terminal receipt. Those reds remain repair work; they were not silenced or treated as a passing baseline.
  • The real-process progress-stall regression writes only gw0.jsonl while continuously emitting output; it is terminated by the progress timeout rather than the output-silence timeout.
  • Exact-head automated review is requested for a0da69269458fdd7c90b717109434f05df8ac603.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Pytest verification now parses all supported xdist worker forms, applies measured resource budgets, selects basetemp storage from demand, manages nested benchmark runs, and reads progress artifacts from repository-anchored configurable paths.

Changes

Pytest resource policy

Layer / File(s) Summary
Worker requests and artifact flow
devtools/verify.py, devtools/run_tests.py, tests/unit/devtools/test_run_tests.py, tests/unit/devtools/test_verify.py
Worker parsing supports all listed xdist forms. Parsed concurrency and suite scope reach runtime policy and workload receipts. Progress readers and writers use configured event paths rooted at the checkout.
Cgroup memory headroom
polylogue/core/metrics.py, tests/unit/core/test_metrics_cgroup_memory_limits.py
The new reader calculates finite cgroup headroom across hierarchy levels and returns zero when finite-limit usage cannot be read.
Measured runtime budgeting
devtools/verify_runs.py, tests/unit/devtools/test_verify.py
Runtime policy uses measured memory envelopes and worker-aware reserves. It computes worker capacity and predicted tmpfs demand, validates explicit worker counts, and serializes the prediction.
Managed basetemp and nested runs
devtools/verify_runs.py, devtools/verify_slos.py, tests/conftest.py, tests/unit/test_pytest_temp_policy.py, TESTING.md, CLAUDE.md, tests/unit/operations/test_mutation_actuators.py
Managed policy selects scratch or tmpfs from configured and predicted demand. Bare pytest runs normalize leaked settings. Stale cleanup validates process identity and removes read-only trees. Benchmark children receive managed policy settings.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant PytestCommand
  participant Verify
  participant RuntimePolicy
  participant CgroupMetrics
  participant BasetempPlacement
  PytestCommand->>Verify: provide worker options and suite scope
  Verify->>RuntimePolicy: pass policy overrides
  RuntimePolicy->>CgroupMetrics: read cgroup memory headroom
  CgroupMetrics-->>RuntimePolicy: available memory
  RuntimePolicy-->>Verify: worker count and predicted demand
  Verify->>BasetempPlacement: evaluate configured and predicted demand
  BasetempPlacement-->>Verify: select tmpfs or scratch
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 17.72% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the primary change: budgeting pytest tmpfs using measured cgroup overhead.
Description check ✅ Passed The description includes the required summary, problem, solution, verification, and bead disposition details; omitted optional sections are not needed.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/fix/tmpfs-resource-budget

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 90af040608

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread devtools/verify_runs.py Resolved
Comment thread devtools/verify_runs.py Resolved
Comment thread devtools/verify_runs.py Resolved
Comment thread devtools/verify_runs.py Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 17703e74be

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread devtools/verify.py Resolved
Sinity added 5 commits August 11, 2026 11:07
Problem: the ce4dd62 full suite had 15,190 MiB available but the 10 percent tmpfs heuristic imposed a 1,519 MiB cap and terminated the run at 1,521.6 MiB.

What changed: reserve host and command-worker headroom before deriving the bounded tmpfs cap, and pass the parsed pytest concurrency into that admission decision. The monitor remains active and low-headroom commands fail before launch.
Problem: xdist option parsing under-reserved several production command forms, and a 768 MiB per-worker estimate admitted a four-worker run on a 4 GiB host despite the measured process, tmpfs, and cgroup envelope.

What changed: parse all supported xdist spellings, reserve logical CPU concurrency for auto, and derive admission from the measured four-worker envelope. The cgroup measurement already includes tmpfs charging, so admission uses it as a composite bound while separately constraining a proposed tmpfs cap.
Problem: the four-worker resource measurements were divided into worker-only
costs, so default selection, low-worker admission, and basetemp placement
could disagree at launch.

What changed: retain fixed controller and cgroup components, scale only the
marginal worker cost, reserve the full-run basetemp as aggregate demand, and
compare inherited tmpfs caps before selecting the basetemp root.

The default selector now uses the same envelope as launch admission, including
the conservative ceiling of the observed 1,521.6 MiB basetemp peak.
@Sinity
Sinity force-pushed the feature/fix/tmpfs-resource-budget branch from 17703e7 to fb74235 Compare August 11, 2026 09:16
@Sinity

Sinity commented Aug 11, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@devtools/verify_runs.py`:
- Around line 677-680: Remove the unconditional PytestResourceError for a
missing or unreadable /dev/shm in the resource-admission flow, while preserving
worker-memory checks and disabling tmpfs usage. Ensure
apply_managed_pytest_runtime_policy continues to resolve placement through
resolve_pytest_basetemp_root so scratch is selected when capacity permits, and
add coverage for this unavailable-tmpfs path.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 4ef9c4b0-a766-4938-bde5-07df2b93d056

📥 Commits

Reviewing files that changed from the base of the PR and between 9510463 and fb74235.

📒 Files selected for processing (4)
  • devtools/verify.py
  • devtools/verify_runs.py
  • tests/unit/devtools/test_run_tests.py
  • tests/unit/devtools/test_verify.py

Comment thread devtools/verify_runs.py Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fb74235e0f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread devtools/verify_runs.py Resolved
Comment thread devtools/verify.py Resolved
@Sinity

Sinity commented Aug 11, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: efe9b8f282

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread devtools/verify_runs.py Resolved
@Sinity

Sinity commented Aug 11, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8e7b431a3b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread devtools/verify_runs.py Resolved
Comment thread devtools/verify_runs.py Resolved
Sinity added 2 commits August 11, 2026 11:41
Clamp inherited tmpfs limits to the measured host-safe policy, account serial pytest runs without inventing an xdist worker, and route unsupervised bare pytest basetemps to NVMe scratch.\n\nAdd production-route regression coverage for each admission boundary.\n\nCo-Authored-By: OpenAI Codex <[email protected]>
Cap pytest admission by the smallest remaining ancestor cgroup allowance, keep worker-memory checks active for explicit basetemp roots, and reserve the measured full-suite basetemp only for broad runs.\n\nExercise the hierarchy reader, explicit-root refusal, focused placement, and runner scope propagation through production policy paths.\n\nCo-Authored-By: OpenAI Codex <[email protected]>
@Sinity

Sinity commented Aug 11, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8647d622e7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread devtools/verify.py Resolved
Reserve the measured full-suite basetemp only for seed, full, load-sensitive, and broad-testmon steps. Ordinary affected testmon runs retain the focused disk requirement.\n\nCover every managed pytest label class through the production runner.\n\nCo-Authored-By: OpenAI Codex <[email protected]>
@Sinity

Sinity commented Aug 11, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c74810e0dd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread devtools/verify_runs.py Resolved
Comment thread tests/conftest.py Resolved
Comment thread devtools/verify_runs.py Resolved
Use the focused controller and proportional cgroup envelope for non-broad runs, preserve measured full-suite disk demand on explicit scratch roots, and normalize leaked cloud basetemp configuration before bare pytest selects storage.

Cover low-memory focused admission, explicit-root disk refusal, and workstation cloud-default normalization.

Co-Authored-By: OpenAI Codex <[email protected]>
@Sinity

Sinity commented Aug 11, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 2c11231da2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@devtools/run_tests.py`:
- Line 50: Update _subprocess_env in devtools/run_tests.py to construct pytest
artifact paths from ROOT instead of Path.cwd(), matching the checkout-root
behavior already used by _managed_env and ensuring paths remain correct when
devtools test runs from a subdirectory.

In `@devtools/verify.py`:
- Around line 1727-1730: In the concurrency argument, remove the unreachable
None fallback and use the already-assigned pytest_concurrency value directly,
while preserving the minimum concurrency of 1 via max. Do not call
_pytest_command_concurrency again or read the policy-mutated env.

In `@tests/conftest.py`:
- Around line 105-114: Update devtools/verify_slos.py so _run_benchmarks()
launches pytest with the managed pytest environment, preserving
POLYLOGUE_VERIFY_RUN_ID, POLYLOGUE_PYTEST_BASETEMP_ROOT, and
POLYLOGUE_PYTEST_TMPFS from the parent managed step. Ensure the nested pytest
receives the configured tmpfs budget instead of triggering the bare-pytest
fallback in tests/conftest.py.

In `@tests/unit/devtools/test_verify.py`:
- Around line 1917-1930: Patch verify_runs.read_cgroup_memory_headroom_bytes in
test_managed_policy_uses_scratch_when_tmpfs_is_unavailable to return an
effectively unlimited memory headroom value, matching the other tests in this
file. Keep the existing _meminfo, _pressure, os.cpu_count, and _fs_usage patches
unchanged so the policy assertions are independent of the host cgroup
configuration.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 1c5dd074-09db-4006-a3e6-054e865b1224

📥 Commits

Reviewing files that changed from the base of the PR and between fb74235 and 2c11231.

📒 Files selected for processing (9)
  • devtools/run_tests.py
  • devtools/verify.py
  • devtools/verify_runs.py
  • polylogue/core/metrics.py
  • tests/conftest.py
  • tests/unit/core/test_metrics_cgroup_memory_limits.py
  • tests/unit/devtools/test_run_tests.py
  • tests/unit/devtools/test_verify.py
  • tests/unit/test_pytest_temp_policy.py
💤 Files with no reviewable changes (1)
  • tests/unit/devtools/test_run_tests.py

Comment thread devtools/run_tests.py Resolved
Comment thread devtools/verify.py Resolved
Comment thread tests/conftest.py Resolved
Comment thread tests/unit/devtools/test_verify.py Resolved
Problem: focused and nested benchmark pytest launches could lose checkout-scoped artifacts or managed tmpfs context when invoked from a subdirectory.\n\nWhat changed: anchor inherited artifact paths to the checkout, pass managed policy and run markers through the SLO parent and child, and make the supervisor read the event ledger supplied to pytest. The concurrency receipt now uses its already-parsed value, and the scratch fallback test isolates cgroup state.
@Sinity

Sinity commented Aug 11, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 16d1cb7e3c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread devtools/verify.py Resolved
Give the output-stall and progress-stall supervisor tests independent VerifyRun artifact directories. This prevents one invocation's event stream from changing another invocation's termination classification while preserving the real process-control route.\n\nCo-Authored-By: OpenAI Codex <[email protected]>
@Sinity

Sinity commented Aug 11, 2026

Copy link
Copy Markdown
Owner Author

@codex review

Please review exact head 4f671d8ad, including the test-only per-run event-artifact isolation added after a 194-pass/1-fail parallel gate exposed shared legacy event state.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4f671d8ad2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread devtools/verify.py Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7f8c57d9a8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread devtools/verify.py Resolved
Comment thread devtools/verify_runs.py Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 72dfe5e3b7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread devtools/verify_runs.py Resolved
Comment thread tests/conftest.py Resolved
Comment thread devtools/verify_runs.py Resolved
@Sinity

Sinity commented Aug 11, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CLAUDE.md`:
- Around line 516-517: Update the documentation sentence describing
POLYLOGUE_PYTEST_TMPFS=1 to state that it requests bounded tmpfs, but is honored
only when the effective budget satisfies the declared basetemp requirement;
retain the existing POLYLOGUE_PYTEST_BASETEMP_MIN_FREE_MB override description.

In `@devtools/verify.py`:
- Around line 1817-1819: Update _subprocess_env in devtools/verify.py to export
POLYLOGUE_PYTEST_EVENTS_DIR rooted at ROOT / PYTEST_EVENTS_DIR, alongside the
existing rooted pytest paths. In tests/unit/devtools/test_run_tests.py lines
58-65, extend the environment assertions to verify this variable resolves under
the checkout root.

In `@tests/conftest.py`:
- Around line 192-212: Update _remove_stale_basetemp in tests/conftest.py to
return immediately when the top-level entry is a symbolic link, before os.walk
or any permission changes. In tests/unit/test_pytest_temp_policy.py lines
289-303, add coverage for a stale top-level symbolic link and verify the linked
target tree’s permissions remain unchanged.

In `@tests/unit/test_pytest_temp_policy.py`:
- Around line 273-303: Update both stale-cleanup tests, especially
test_sweep_stale_polylogue_basetemps_reclaims_reused_pid_identity and
test_sweep_stale_polylogue_basetemps_reclaims_read_only_fixture_tree, to accept
the frozen_clock fixture and derive each entry’s mtime relative to its frozen
timestamp instead of using the hard-coded old = 1.0 value. Keep the existing
stale-reclamation assertions unchanged.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 478f1985-4e38-4a74-8095-e9b94f7a901e

📥 Commits

Reviewing files that changed from the base of the PR and between 2c11231 and 5e3c097.

📒 Files selected for processing (11)
  • CLAUDE.md
  • TESTING.md
  • devtools/verify.py
  • devtools/verify_runs.py
  • devtools/verify_slos.py
  • tests/conftest.py
  • tests/unit/devtools/test_run_tests.py
  • tests/unit/devtools/test_slo_catalog.py
  • tests/unit/devtools/test_verify.py
  • tests/unit/operations/test_mutation_actuators.py
  • tests/unit/test_pytest_temp_policy.py

Comment thread CLAUDE.md Resolved
Comment thread devtools/verify.py Resolved
Comment thread tests/conftest.py Resolved
Comment thread tests/unit/test_pytest_temp_policy.py Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5e3c097539

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread devtools/verify_runs.py Resolved
@Sinity

Sinity commented Aug 11, 2026

Copy link
Copy Markdown
Owner Author

@codex review

Please review exact head 5d479aa057bb21ef6d45f48eae76da18e4ada0c7, including the rooted worker-event directory and stale top-level symlink refusal added after exact-head review.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5d479aa057

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread devtools/verify_runs.py Resolved
@Sinity

Sinity commented Aug 11, 2026

Copy link
Copy Markdown
Owner Author

@codex review

Please review exact head a0da69269458fdd7c90b717109434f05df8ac603, which applies tmpfs headroom accounting to explicitly configured /dev/shm roots.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: a0da692694

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Sinity
Sinity merged commit c27af7d into master Aug 11, 2026
3 checks passed
@Sinity
Sinity deleted the feature/fix/tmpfs-resource-budget branch August 11, 2026 16:51
@Sinity

Sinity commented Oct 1, 2026

Copy link
Copy Markdown
Owner Author

Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.

  • 55.F109 / P2: fixed-already at the checked revision: Live progress telemetry reads each worker ledger from its retained byte offset (devtools/pytest_slot.py:901) and advances that offset only across complete records (devtools/pytest_slot.py:904). It no longer materializes every growing ledger on each progress poll.

Only the rows listed above are dispositioned. Held findings remain open.

@Sinity

Sinity commented Oct 1, 2026

Copy link
Copy Markdown
Owner Author

Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.

  • 57.F038 / P2: stale at the checked revision: The full_suite=True default in adaptive_pytest_worker_count and its basetemp envelope have been removed. Current launch sizing selects a charge profile at devtools/pytest_slot.py:1123 and resizes at devtools/pytest_slot.py:1124; devtools/worker_memory.py:654 explicitly uses the pytest cgroup rather than the reported host-memory/full-suite admission calculation.
  • 57.F039 / P2: stale at the checked revision: The TMPFS key-presence opt-in and rewrite-to-1 branch are absent from the active placement route. devtools/pytest_slot.py:221-224 reads only the basetemp-root override and otherwise selects checkout-local scratch, so a blank POLYLOGUE_PYTEST_TMPFS cannot switch a broad run back onto /dev/shm through that mechanism.
  • 57.F040 / P2: stale at the checked revision: The adaptive configured-tmpfs headroom/cap calculation has been removed, rather than retained with a different label. devtools/pytest_slot.py:222-224 now selects an explicitly requested root or checkout-local scratch without publishing the former automatic headroom admission guarantee.
  • 57.F041 / P2: stale at the checked revision: The setdefault-based full-suite demand floor and BASETEMP_REQUIRED_MB admission input are no longer in the execution path. devtools/pytest_slot.py:224 uses checkout-local scratch and devtools/verify_runs.py:3 delegates temporary-storage lifecycle to AgentCTL, so the reported zero override does not suppress a local measured-demand gate.
  • 57.F042 / P2: stale at the checked revision: The branch that disabled TMPFS supervision while retaining a configured /dev/shm root is absent, together with that adaptive cap policy. devtools/pytest_slot.py:222-224 directly selects the explicit root or checkout-local scratch; it does not claim to apply the removed cap and then silently disable it below the declared demand.

Only the rows listed above are dispositioned. Held findings remain open.

@Sinity

Sinity commented Oct 1, 2026

Copy link
Copy Markdown
Owner Author

Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.

  • 77.F081 / P2: stale at the checked revision: The root conftest no longer resolves a bare pytest basetemp from POLYLOGUE_PYTEST_BASETEMP_ROOT. Custom root resolution belongs to the managed contained runner, while the root hook performs admission rather than choosing the former unsupervised tmpfs directory. See tests/conftest.py:85.

Only the rows listed above are dispositioned. Held findings remain open.

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