Repository navigation
refactor(cli): remove foreground resource policy - #718
Conversation
When --reparse is used to fix derived metadata (e.g. sort_key after a timestamp parsing fix), the write path was doing a full DELETE-all + INSERT-all cycle for content_blocks, action_events, and attachments even though content had not changed. On a 23GB database this made reparsing impractically slow (~60s per large conversation). With this change, force_write (signaled via POLYLOGUE_FORCE_WRITE=1 from the CLI --reparse path) only forces conversation and message upserts. Content blocks, action events, and attachments are only replaced when the content hash actually differs. Also added sort_key to the conversation upsert WHERE clause so sort_key-only changes trigger an UPDATE (matching the existing message upsert behavior). Co-Authored-By: Claude Opus 4.7 <[email protected]>
Problem: Polylogue CLI had grown a host-policy resource boundary with a public --resource-mode flag, systemd transient-scope launch, nice/ionice demotion, and an explicit off escape hatch. That makes workstation scheduling policy a product concern and lets heavy runs bypass Sinnix supervision. What changed: remove the resource-mode options from run and doctor, delete the maintenance resource helper, stop emitting resource boundary data in doctor output, and update docs/snapshots/tests. Heavy local policy now belongs in Sinnix services/wrappers or future polylogued-managed execution, while Polylogue keeps product behavior portable. Verification: .venv/bin/python -m pytest -q tests/unit/cli/test_run_command_runtime.py tests/unit/cli/test_check_support_runtime.py tests/unit/cli/test_check_rendering_plain_runtime.py tests/unit/cli/test_check.py tests/unit/cli/test_terminal_snapshots.py; .venv/bin/ruff check changed Python files; git diff --check.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (31)
📝 WalkthroughWalkthroughResource isolation functionality is removed from the Polylogue CLI—the ChangesResource Isolation Mode Removal
GitHub Workflows Configuration
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related issues
Possibly related PRs
Suggested labels
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Tip 💬 Introducing [Slack Agent](https://www.coderabbit.ai/agent): Turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 👉 Get your free trial and get 200 agent minutes per Slack user (a $50 value). 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. Review rate limit: 0/1 reviews remaining, refill in 60 minutes.Comment |
Polylogue Proof PackRefs: Affected Domains
Additional routed domains with zero affected claims
Focused Gates
Required PR Gates
Optional Confidence Gates
Known Gaps
Additional gaps in zero-claim routed domains
Oracle / Cost
|
Problem: GitHub Actions billing is unavailable for the next month, so automatic push, pull_request, and schedule triggers create red checks without producing useful verification.\n\nWhat changed: keep the workflows available for manual workflow_dispatch only. PR-payload-only workflows now contain explicit disabled placeholders instead of pretending to validate unavailable event data.\n\nVerification: python YAML parse of all .github/workflows/*.yml and trigger inspection confirmed workflow_dispatch-only triggers.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 37675efdcb
ℹ️ 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".
## Summary Removes the Polylogue CLI resource-policy layer and keeps workstation resource policy in the host/daemon boundary. The branch also includes the existing local reparse write-amplification fix so metadata-only reparses do not cascade through DELETE+INSERT behavior. ## Problem The 2026-05-02 workstation pressure incident showed that `polylogue run --reparse ...` could become an opaque, heavy foreground workload. The first resource-boundary fix made that a Polylogue CLI concern via `--resource-mode`, transient systemd scopes, nice/ionice demotion, and an `off` escape hatch. That was the wrong ownership boundary: Polylogue is portable product code, while Sinnix and future `polylogued` supervision should own concrete workstation scheduling/storage policy. The same incident also exposed unnecessary write amplification during same-hash reparse writes: metadata-only updates could still travel through a heavier replacement path instead of updating the changed fields in place. ## Solution - Remove `--resource-mode` from `polylogue run` and `polylogue doctor`. - Delete the CLI-side resource helper that launched systemd scopes or applied process-local demotion. - Stop emitting `resource_mode`/`resource_boundary` fields from doctor output. - Update CLI snapshots, generated docs, topology/proof docs, and tests for the smaller CLI surface. - Keep the reparse ingest fix that avoids DELETE+INSERT cascades for same-hash metadata updates. - Record the corrected design direction on #708/#716: Polylogue should expose workload facts and execution history; Sinnix/polylogued should own host policy. ## Verification - `.venv/bin/python -m pytest -q tests/unit/pipeline/test_ingest_batch.py tests/unit/pipeline/test_parsing_service.py tests/unit/cli/test_run_command_runtime.py tests/unit/cli/test_check_support_runtime.py tests/unit/cli/test_check_rendering_plain_runtime.py tests/unit/cli/test_check.py tests/unit/cli/test_terminal_snapshots.py` -> 135 passed. - `.venv/bin/python -m pytest -q tests/unit/cli/test_run_command_runtime.py tests/unit/cli/test_check_support_runtime.py tests/unit/cli/test_check_rendering_plain_runtime.py tests/unit/cli/test_check.py tests/unit/cli/test_terminal_snapshots.py` -> 93 passed before the ingest-helper mypy cleanup. - `.venv/bin/ruff check` on changed Python files -> all checks passed. - `direnv exec /realm/project/polylogue .venv/bin/mypy tests/unit/pipeline/test_ingest_batch.py` -> success. - `git diff --check` -> clean. - Pre-push `devtools verify --quick` under `direnv exec /realm/project/polylogue` -> all checks passed: ruff, mypy, render-all, topology, layering, file budgets, test ownership, schema roundtrip, cross-cuts, suppressions, manifests, witness lifecycle, proof-pack. Refs #708. Refs #716.
Bumps [pytest-randomly](https://github.com/pytest-dev/pytest-randomly) from 4.0.1 to 4.1.0. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/pytest-dev/pytest-randomly/blob/main/CHANGELOG.rst">pytest-randomly's changelog</a>.</em></p> <blockquote> <h2>4.1.0 (2026-04-20)</h2> <ul> <li> <p>Fix a crash with Faker installed when explicitly enabling and disabling the plugin (via <code>-p randomly -p no:randomly</code>).</p> <p>Thanks to mojosan77 for the report in <code>Issue [#718](pytest-dev/pytest-randomly#718) <https://github.com/pytest-dev/pytest-randomly/issues/718></code>__.</p> </li> <li> <p>Drop Python 3.9 support.</p> </li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/pytest-dev/pytest-randomly/commit/c412c8d6d328224a6a0cb9e4324438c62b46f4f5"><code>c412c8d</code></a> Version 4.1.0</li> <li><a href="https://github.com/pytest-dev/pytest-randomly/commit/657d9c356d1970bbe664b36446d4f8a9461e4988"><code>657d9c3</code></a> Upgrade dependencies (<a href="https://redirect.github.com/pytest-dev/pytest-randomly/issues/722">#722</a>)</li> <li><a href="https://github.com/pytest-dev/pytest-randomly/commit/49c8c1bb487d03ca1bda2ac7567e4205bf82aae6"><code>49c8c1b</code></a> Fix a crash with Faker installed and plugin disabled (<a href="https://redirect.github.com/pytest-dev/pytest-randomly/issues/721">#721</a>)</li> <li><a href="https://github.com/pytest-dev/pytest-randomly/commit/c9181c28607e990123ee480200ae2e684f58e7b6"><code>c9181c2</code></a> Bump django from 5.2.12 to 5.2.13 (<a href="https://redirect.github.com/pytest-dev/pytest-randomly/issues/717">#717</a>)</li> <li><a href="https://github.com/pytest-dev/pytest-randomly/commit/1292cc060c8892d3cccc2bd67c44b3405a6693d4"><code>1292cc0</code></a> Upgrade pre-commit to Python 3.14 (<a href="https://redirect.github.com/pytest-dev/pytest-randomly/issues/716">#716</a>)</li> <li><a href="https://github.com/pytest-dev/pytest-randomly/commit/56d13889650fa7f71df504c8ab810967fd3fb44e"><code>56d1388</code></a> [pre-commit.ci] pre-commit autoupdate (<a href="https://redirect.github.com/pytest-dev/pytest-randomly/issues/715">#715</a>)</li> <li><a href="https://github.com/pytest-dev/pytest-randomly/commit/43702c107ada21dca7e59836a8547ed1e62e77aa"><code>43702c1</code></a> Upgrade dependencies (<a href="https://redirect.github.com/pytest-dev/pytest-randomly/issues/714">#714</a>)</li> <li><a href="https://github.com/pytest-dev/pytest-randomly/commit/c3dc97c20e2931b7557ab529703a6bf754df9110"><code>c3dc97c</code></a> Bump pygments from 2.19.2 to 2.20.0 (<a href="https://redirect.github.com/pytest-dev/pytest-randomly/issues/713">#713</a>)</li> <li><a href="https://github.com/pytest-dev/pytest-randomly/commit/a2dee8a6b620f0ceaf385acfb1d0b778b0fd2892"><code>a2dee8a</code></a> Improve Coverage.py configuration (<a href="https://redirect.github.com/pytest-dev/pytest-randomly/issues/712">#712</a>)</li> <li><a href="https://github.com/pytest-dev/pytest-randomly/commit/fed476639744207a10bc1742d7420fc413b555bf"><code>fed4766</code></a> Upgrade dependencies (<a href="https://redirect.github.com/pytest-dev/pytest-randomly/issues/711">#711</a>)</li> <li>Additional commits viewable in <a href="https://github.com/pytest-dev/pytest-randomly/compare/4.0.1...4.1.0">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…1766) ## Summary Restores the `push` / `pull_request` CI triggers that were **accidentally removed** by #718, re-enabling automatic test/lint/nix gating on `master` and PRs. ## Problem #718 (`refactor(cli): remove foreground resource policy`) — a PR whose scope was entirely CLI resource policy, with **no mention of CI** — silently reverted the trigger blocks on four workflows, leaving each with only `workflow_dispatch:` (manual-only): | Workflow | Before #718 | After #718 | |----------|-------------|------------| | `ci.yml` (lint + test ×3 Python) | push + pull_request | **dispatch only** | | `nix.yml` (nix build + flake check) | push + pull_request | **dispatch only** | | `actionlint.yml` | pull_request | **dispatch only** | | `dep-audit.yml` | push + pull_request + weekly schedule | **dispatch only** | Consequence: the CI test gate has not run automatically since **2026-05-02** (the last `ci.yml`/`nix.yml` runs are on `9029a37a`). Across the ~20 commits merged since, **~61 unit-test failures accumulated undetected** — see #1765. This is the root cause of the test debt. (`pr-policy.yml` and `proof-comment.yml` were also gutted by #718, but those stay deleted — that was the intentional ceremonial-verification cleanup in #1737, not collateral. `codeql.yml` retains a working trigger and is unaffected.) ## Solution Restore the exact pre-#718 `on:` blocks (verified against `git show 8b2b0fa~1:.github/workflows/<f>.yml`): - `ci.yml` / `nix.yml`: `push: [master]` + `pull_request: [master]` (opened/reopened/synchronize/ready_for_review) - `actionlint.yml`: `pull_request: [master]` (paths: `.github/workflows/**`, `.github/actions/**`) - `dep-audit.yml`: push/pull_request (paths: `pyproject.toml`, `uv.lock`, the workflow) + weekly `cron: 0 6 * * 1` ## Verification ``` python3 -c "import yaml; ..." # all four on: blocks parse with push/pull_request restored ``` ##⚠️ Expected: re-enabling CI surfaces the pre-existing failures Once merged, `ci.yml` will run on `master` and PRs and will be **red** until the inherited test failures are cleared. That is the intended signal, not a regression introduced here. The known failures are partly fixed in **#1765** (collection error, keyset, config, stale tests) and partly still open (a handful of real-bug candidates triaged in #1765's body). Recommended order: merge #1765, work the remaining real failures, then this fix's CI will go green. Merging this first is also fine — it just makes the existing red state visible. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Enhanced workflow triggers to automatically run validation checks on pull requests and commits targeting the master branch, improving consistency of continuous integration checks. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
Summary
Removes the Polylogue CLI resource-policy layer and keeps workstation resource policy in the host/daemon boundary. The branch also includes the existing local reparse write-amplification fix so metadata-only reparses do not cascade through DELETE+INSERT behavior.
Problem
The 2026-05-02 workstation pressure incident showed that
polylogue run --reparse ...could become an opaque, heavy foreground workload. The first resource-boundary fix made that a Polylogue CLI concern via--resource-mode, transient systemd scopes, nice/ionice demotion, and anoffescape hatch. That was the wrong ownership boundary: Polylogue is portable product code, while Sinnix and futurepolyloguedsupervision should own concrete workstation scheduling/storage policy.The same incident also exposed unnecessary write amplification during same-hash reparse writes: metadata-only updates could still travel through a heavier replacement path instead of updating the changed fields in place.
Solution
--resource-modefrompolylogue runandpolylogue doctor.resource_mode/resource_boundaryfields from doctor output.Verification
.venv/bin/python -m pytest -q tests/unit/pipeline/test_ingest_batch.py tests/unit/pipeline/test_parsing_service.py tests/unit/cli/test_run_command_runtime.py tests/unit/cli/test_check_support_runtime.py tests/unit/cli/test_check_rendering_plain_runtime.py tests/unit/cli/test_check.py tests/unit/cli/test_terminal_snapshots.py-> 135 passed..venv/bin/python -m pytest -q tests/unit/cli/test_run_command_runtime.py tests/unit/cli/test_check_support_runtime.py tests/unit/cli/test_check_rendering_plain_runtime.py tests/unit/cli/test_check.py tests/unit/cli/test_terminal_snapshots.py-> 93 passed before the ingest-helper mypy cleanup..venv/bin/ruff checkon changed Python files -> all checks passed.direnv exec /realm/project/polylogue .venv/bin/mypy tests/unit/pipeline/test_ingest_batch.py-> success.git diff --check-> clean.devtools verify --quickunderdirenv exec /realm/project/polylogue-> all checks passed: ruff, mypy, render-all, topology, layering, file budgets, test ownership, schema roundtrip, cross-cuts, suppressions, manifests, witness lifecycle, proof-pack.Refs #708.
Refs #716.
Summary by CodeRabbit
Release Notes
Removed Features
--resource-modeoption frompolylogue runandpolylogue doctorcommands. Resource policy management is now handled by the host environment.New Features
POLYLOGUE_FORCE_WRITEenvironment variable to control forced-write behavior.Changes