Skip to content

feat(conduct): configure execution limits and reconcile owner policy safely - #3211

Merged
4444J99 merged 7 commits into
mainfrom
feat/execution-limits-configurable-20261024
Oct 25, 2026
Merged

4444J99 merged 7 commits into
mainfrom
feat/execution-limits-configurable-20261024

Conversation

@4444J99

@4444J99 4444J99 commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

Execution admission limits were hardcoded, and the owner controls lived in a local-only script. This makes all five limits owner-configurable in the Worker and Python mirror, and moves the limit/resource/lane flags into scripts/reconcile-execution-policy.py. Policy installation uses shared validation, generation fencing, immutable private rollback, exact-runtime fencing and bounded propagation readback.

The schedule-census aggregate fixture now uses explicit launchd observations and verifies that absent fixture labels still make the report fail. The original owner script is archived byte-for-byte in the delivery evidence directory before local retirement.

Exact-head local validation

Head: 33825a3.

env LIMEN_GATE_PYTHON=CHECKOUT_LOCAL_PYTHON LIMEN_HOST_ADMISSION_SWAP_FRACTION=0.60 LIMEN_HOST_ADMISSION_DISK_MIB_PER_SECOND=1024 LIMEN_VITALS_WARN_SUSTAIN=10 LIMEN_VERIFY_JOBS=2 PYTEST_XDIST_AUTO_NUM_WORKERS=4 bash scripts/verify-scoped.sh --total-timeout-seconds 1200 --require-base

Exit 0. CLI: 9717 passed, 60 skipped, 10 subtests passed. API: 52 passed. Worker: 421 passed. All 35 cheap gates passed, including both type-check groups, lint/format, schedules, the eight offline reconciler tests, and implicated governance gates. No persistent host setting changed; the human authorized these process-local overrides and all continuation through completion. Remote checks remain advisory on this fast lane.

Related completed work

ACE #13 was already merged by a peer via ACE #15 and retained in #16; fresh verification at e29015f passed 20 path tests, catalog validation and all 73 tools tests. Domus #563 is merged/applied, with 137 template checks passing and both global instruction surfaces verified identical.

Rollout

After exact-head squash merge, deploy the merged source with its runtime Git SHA, authenticate readback, dry-run then install max_active_runs=5 through the canonical CLI, verify containment and unrelated fields are preserved, then retire only custody-qualified scratch state. Deployment and cleanup receipts are owned by docs/continuations/execution-limits-20261025.

Summary by Sourcery

Make execution admission limits owner-configurable and reconcile them safely through the canonical policy CLI.

New Features:

  • Make all five execution admission limits configurable through the execution policy in both the Worker and Python admission implementations.
  • Move execution-limit, resource, and lane controls into the canonical reconciliation CLI with dry-run, installation, rollback, fencing, and propagation verification support.

Bug Fixes:

  • Ensure malformed execution policies fail closed and prevent unsafe policy installation or admission.
  • Make schedule-census fixtures deterministic by using explicit launchd observations and verifying missing labels fail the report.

Enhancements:

  • Document owner-configurable execution limits, their defaults, bounds, and separation from host admission controls.
  • Preserve the retired owner script and delivery evidence while adding offline reconciliation coverage and governance gating.

CI:

  • Add a cheap governance gate for offline execution-policy reconciliation tests.

Deployment:

  • Add runtime identity fencing, immutable private rollback preservation, generation checks, and bounded authenticated readback to execution-policy installation.

Documentation:

  • Add execution-limit delivery and continuation evidence documenting canonical controls, rollout safeguards, and historical script custody.

Tests:

  • Add Worker and CLI coverage for configurable limits, validation, admission behavior, policy preservation, generation fencing, rollback, and propagation readback.

The keeper's admission limits were literals in code: one active run in recovery
(two otherwise), 1800 s attempts, a 7200 s outcome budget, a 600 s verification
window and two root attempts. The live policy already carries an
`execution_limits` block, but nothing read it, so no owner policy could change
them.

Add executionLimits() (Worker) and execution_limits() (CLI mirror) and route every
site through them: concurrency, outcome budget, corrective-retry ceiling, attempt
deadline and reservation, recorded verification window, the allowance report's
limit_seconds, and the verification-reservation deadline.

Keys: max_active_runs, attempt_seconds, verification_seconds, cumulative_seconds,
max_root_attempts. An absent key keeps today's default (and the mode-keyed
active-run cap), so an unmodified policy admits exactly as before. A present key
that is malformed or out of bounds fails closed as execution_policy_invalid;
unknown keys are ignored so a newer policy cannot brick admission.

Host admission, the storage latch and the other fail-closed rails are separate and
unchanged; raising max_active_runs does not raise what the host will admit.

Verified: 421/421 Worker tests (8 new, including a fifth concurrent run admitted
and a sixth refused at max_active_runs=5), 34 CLI tests across the new file and the
existing admission/policy files, and the cheap scoped wave. The cap-of-5 scenario was
A/B'd against the parent commit: refused there, admitted here. Heavy wave
(python-typecheck, pytest-cli, pytest-api) was refused by host admission and is not
claimed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XAB98KVPv8punwxd1dpmgm
@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@sourcery-ai

sourcery-ai Bot commented Oct 24, 2026

Copy link
Copy Markdown

Reviewer's Guide

The PR introduces owner-configurable execution admission limits through the live policy’s execution_limits block, implements identical validated readers in the Worker and CLI, routes all relevant admission and allowance behavior through those readers, and adds documentation plus comprehensive parity tests while leaving host admission controls unchanged.

Sequence diagram for owner-configured execution admission

sequenceDiagram
    participant Owner
    participant Policy as LivePolicy
    participant Worker
    participant Limits as executionLimits()
    participant Admission as executionAdmission()
    participant Kernel as ConductKernel

    Owner->>Policy: Install execution_limits via reconcile route
    Worker->>Policy: Read execution policy
    Worker->>Limits: executionLimits(policy)
    Limits-->>Worker: Validated limits or execution_policy_invalid
    Worker->>Admission: executionAdmission(policy, state, packet, now)
    Admission->>Admission: Apply max_active_runs
    Admission->>Admission: Apply attempt_seconds and cumulative_seconds
    Admission->>Admission: Apply max_root_attempts
    Admission-->>Worker: Admission record with deadlines and reservations
    Worker->>Kernel: Reserve verification
    Kernel->>Limits: Read configured cumulative_seconds
    Kernel-->>Worker: Allowance with limit_seconds
Loading

File-Level Changes

Change Details Files
Added a shared owner-configurable execution-limit parser with historical defaults, bounds validation, cross-field consistency checks, and fail-closed handling.
  • Added configurable limits for active runs, attempt duration, verification duration, cumulative budget, and root attempts.
  • Ignored unknown keys while rejecting malformed blocks and invalid limit relationships.
  • Mirrored the implementation between the Worker and CLI admission paths.
web/worker/src/conduct/inventory-admission.js
cli/src/limen/inventory_admission.py
Replaced hard-coded admission and reporting values with the resolved execution limits throughout execution lifecycle handling.
  • Applied configured limits to concurrency, outcome budgets, corrective retries, deadlines, reservations, and recorded verification windows.
  • Used the configured cumulative budget in allowance responses.
  • Used the admission-recorded verification window when creating verification reservations, preserving legacy records with a 600-second fallback.
web/worker/src/conduct/inventory-admission.js
web/worker/src/conduct/keeper.js
cli/src/limen/inventory_admission.py
Documented the execution_limits policy contract and its separation from host-level admission controls.
  • Documented defaults, bounds, governed behaviors, failure semantics, and installation through the existing reconcile route.
  • Clarified that host admission rails and storage latching remain unaffected.
docs/architecture/finite-workspace-recovery.md
Added parallel Worker and CLI coverage for defaults, overrides, validation, budget behavior, concurrency, retries, and allowance reporting.
  • Verified historical behavior and mode-specific active-run defaults.
  • Covered configured deadlines, reservations, cumulative budgets, root-attempt ceilings, unknown keys, and malformed policies.
  • Verified the allowance endpoint reports configured cumulative limits and rejects invalid policy data.
web/worker/test/execution-limits.test.js
web/worker/test/execution-policy-storage.test.js
cli/tests/test_execution_limits.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@4444J99 4444J99 changed the title feat(conduct): make execution admission limits owner-configurable feat(conduct): configure execution limits and reconcile owner policy safely Oct 25, 2026
@4444J99
4444J99 marked this pull request as ready for review October 25, 2026 12:08
@sourcery-ai

sourcery-ai Bot commented Oct 25, 2026

Copy link
Copy Markdown

Sorry @4444J99, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 5 days and 16 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-25T12:10:07.158095Z 33825a3 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@4444J99
4444J99 merged commit 057f49f into main Oct 25, 2026
8 checks passed
@4444J99
4444J99 deleted the feat/execution-limits-configurable-20261024 branch October 25, 2026 12:08
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