Skip to content

fix(schedules): a schedule says what tier its runs get, the owner can take it over, and a restricted run is named, marked, alerted and counted (#4281) - #4427

Draft
AndriiPasternak31 wants to merge 67 commits into
AndriiPasternak31/ent165-guardrail-eventsfrom
AndriiPasternak31/issue-4281-schedule-run-tier
Draft

AndriiPasternak31 wants to merge 67 commits into
AndriiPasternak31/ent165-guardrail-eventsfrom
AndriiPasternak31/issue-4281-schedule-run-tier

Conversation

@AndriiPasternak31

@AndriiPasternak31 AndriiPasternak31 commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Closes #4281.

Draft until the manual UI sign-off is given. The Schedules tab's run-tier badge, the take-over review, the Run-now confirm and the restricted-run marker have not been visually accepted in a browser, in either theme or at phone width. This PR stays a draft until that sign-off.

Builds on #4425 (abilityai/trinity-enterprise#165). The refusal count on execution reads uses that PR's guardrail event store, its reporting state and the agent-side forwarder, so this branch contains #4425's branch. It targets #4425's branch, so its diff shows only the schedule change. The workflows that run only on PRs into dev (backend unit tests, CodeQL, journey impact) do not run on it while it targets that branch; they run again once it is pointed back at dev after #4425 merges. That is done by hand: this repository keeps merged branches, so GitHub does not retarget it on its own. Merge #4425 first.

Why

A schedule is rated by its creator. When the creator is neither an admin nor the agent's owner, every run is a shared person's turn — no shell, no owner-added MCP servers — and nothing said so: not the schedule, not the run, not the hook's message, which told the model the turn was "for a person the agent is shared with". The run still ended success; the issue's case was 78 hook denials over about 25 hours with every execution reading success. And a share holder's schedule could not be fixed in place: its runs kept the creator's access until someone re-created it.

This PR gives one answer to "what tier will this schedule's runs get, and why", shows it on every schedule read and in every refusal, records it on the run, tells the owner once per creator, lets the owner (or an admin) take the schedule over after reading exactly what it does, and puts an honest refusal count on the run.

What changes

One run-tier rule, visible on every schedule read

  • A schedule-backed turn whose schedule cannot be read is never owner-capable. When the schedule is gone, belongs to another agent, or the read raises, services/turn_tier_service.turn_actor rates the turn as a shared person's turn with no person attached, (share, person, None). Through the existing functions: shell_allowed is False; restricts_standing_work is True, so the agent key's owner-tier, resource and standing-work routes are fenced for the rest of that run; the key's reads narrow to the no-rows id. (share, person, None) is already a value on the wire, so the turn-tier reply contract is unchanged. Live, readable schedules, the no-recorded-creator rule (the owner's) and channel and public-link visitors are unchanged. The stated cost: an owner whose own schedule disappears mid-run loses the shell for the rest of that run.
  • One run-tier function, schedule_run_tier(db, agent_name, schedule) -> RunTier(tier, kind, cause, creator_id). turn_actor's schedule branch calls the same tier half and projects it, so the rule does not move; a frozen matrix pins turn_actor's output. A recorded creator is rated through dev's _person_tier, so a registered member creator rates (owner, member, creator) exactly as the member's own turn does, and turn_actor returns the creator as the person whenever kind is set.
    • Causes: creator_owner_tier, no_recorded_creator, creator_not_owner_tier, agent_has_no_owner, creator_missing, schedule_unreadable, unknown. The cause is total and never raises, is never on the fence path, and answers unknown rather than contradict the tier when two reads of the schedule disagree.
    • Remedies: creator_not_owner_tier and creator_missing → take_over; agent_has_no_owner → repair_agent_owner; otherwise none.
  • The turn-tier answer (turn_tier_answer, moved into the service so the router does no execution read) adds cause, schedule, creator and remedy for a schedule-backed shared turn, all null on any other turn. Labels have control and format characters stripped; the schedule name is cut to 80 characters and the creator label to 64 (display name, else username, anything after @ dropped). Worst case ≤2048 bytes.
  • Every schedule read — ScheduleResponse (list, get, create, PUT), the enable and disable bodies, and GET /api/ops/schedules — carries runs_as (owner | shared_person | null when it could not be computed), runs_as_reason {code, message}, created_by_you, created_by and can_take_over (a person at owner tier, not the creator, runs_as == shared_person, cause creator_not_owner_tier or creator_missing). created_by is shown only to the owner tier and to the agent's own key (not while that key acts for a shared person); the creator's id is not exposed. No N+1: a per-request RunTierLookups memo; the fleet read preloads it with two bulk reads (db.get_agent_owners, db.get_users_by_ids) and falls back to per-row reads if they fail.
  • Runtimes other than Claude Code. Switching on a schedule that rates as a shared person (create with enabled, POST …/enable, a PUT that enables) on an agent whose runtime is not Claude Code is refused with 409 schedule_cannot_run_for_creator_on_runtime ({code, message, runtime, cause}), because such a run can never start there. Every Claude Code runtime spelling (claude-code, claude) is Claude Code; a Docker fault falls back to Claude Code, so it warns rather than refuses. On Claude Code the schedule is created and flagged.
  • MCP: the Schedule type and the list_agent_schedules / get_agent_schedule descriptions cover the new fields (pass-through).

A refusal caused by a schedule's creator names the schedule

  • The hook (hooks/turn-tier-guard.py). ask_turn returns (tier, shell, kind, schedule); schedule is the reply's detail for a share answer whose cause matches the event-code shape, with remedy kept only if it is a known key. Labels are bounded again on the agent side (80 / 64 characters, non-printable characters replaced, an email's domain dropped).
    • Shell, MCP, path and search refusals use the schedule text when there is a detail, after the unreachable branch and before today's branches, which are unchanged. The text keys on cause, never on kind.
    • Creator causes: "This run is the scheduled task '', not a chat." Then, by cause, who the creator is (creator_not_owner_tier), "an account that no longer exists" (creator_missing), "This agent has no owner on record…" (agent_has_no_owner), or a generic line for unknown and any newer cause; what is not available; and "say in your answer that this schedule needs ". schedule_unreadable has its own text.
    • A cause never refuses a turn the platform lets use the shell: shell: true still allows first.
    • Deny records carry code="schedule_creator_tier" or code="schedule_unreadable", plus cause= and turn_kind=, beside the codes the guardrail event record (feat(guardrails): guardrail events reach the platform with fleet counts, and credentials in tool output are hidden from the model (abilityai/trinity-enterprise#165) #4425) gives every other deny.
  • The agent server (agent_server/services/turn_scope.py), the refusal path for runtimes other than Claude Code: fetch_turn returns the same 4-tuple and require_owner_tier uses the schedule texts when there is a detail; neither mentions switching runtime. Status 403 and error_code: turn_refused are unchanged.
  • One remedy table in both copies (a parity test pins them): take_over, recreate, repair_agent_owner, and a fallback.
  • Skew: an answer with no cause gets today's four hook texts and today's refusals byte for byte (pinned literally). Six runtime test files that stub turn_scope.fetch_turn gain the fourth element, and so does the turn stub in test_ent165_guardrail_spool.py.

A restricted run is recorded on the run and raised to the owner once per creator

  • The stamp. apply_result rates the run once, before either branch, through schedule_tier_alerts.run_restriction_by_id (which uses the new turn_tier_service.schedule_backed_run_tier: the same "schedule-backed" test turn_actor applies, then schedule_run_tier). A run whose tier is not owner writes turn_integrity.restricted_turn = {tier, kind, cause, schedule_id, creator_id, shell: false} into the existing Background task killed at CLI exit leaves no trace — execution records clean success while the work is lost #2467 column, merged beside the Background task killed at CLI exit leaves no trace — execution records clean success while the work is lost #2467 keys. The rating is total: a lookup that raises records nothing and never changes the outcome. Success and failure branches are both stamped (a refused run on another runtime is a failure), and so are the pull sink's two writes; the Background task killed at CLI exit leaves no trace — execution records clean success while the work is lost #2467 derivation and the stamp sit in separate try blocks. Owner-tier and non-schedule runs write exactly what they wrote before; a manual "Run now" carries its clicker and is not stamped. No status change.
  • The alert. A new platform-alert kind schedule_runs_restricted (priority medium) on the existing seam: one operator-queue row per agent × creator, subject schedule_runs_restricted:<creator id>. Its text names the creator (display name, else username; "an account that no longer exists" for a missing one), the cause, the remedy and up to 5 schedule names; its context carries ids and codes only (≤20 schedule ids plus a count). cause is the only material key, and a person's ending is final. The id prefix is reserved (an agent cannot pre-create the row), and the row is owner-only and about a person: the owner and admins see it; other share holders, the creator and every machine key do not.
  • One decision point, schedule_tier_alerts.sync(agent, creator_id): it reads that creator's live, enabled schedules on the agent and rates them in one memo; any shared-person schedule observes the row, none clears it. A rating that raises, or a set whose every cause is unknown, decides nothing, so a transient lookup failure never re-files a row a person ended. It never raises.
  • Callers, each after its own write committed: the create, PUT, delete, enable, disable and take-over routes (take-over decides it for the former creator and the taker); the ops pause and resume and the emergency stop (one read per distinct agent × creator); /api/internal/execute-task after the idempotency gate (so a replay does not sync); and apply_result on the status-CAS-winning branch only. Re-reading the live schedules is what makes a run that ends after a disable file nothing. Rows go with the agent (operator_queue CASCADE) and follow a rename. No background loop, so one reading has one writer; racing readings meet the seam's per-agent lock and partial unique index.

The owner takes a share holder's schedule over in place

  • POST /api/agents/{name}/schedules/{schedule_id}/take-over (take_over_schedule). require_person (agent, system and connector keys and the loopback get 403 person_required) plus OwnedAgent (owner or admin, uniform 404); a Workspace-only person is refused at the operator floor.
  • The owner adopts exactly what they reviewed. Body {expected_updated_at, reviewed: {message, allowed_tools, model, validation_enabled, validation_prompt}, delivery?: "clear"|"keep", keep_delivery_to?}; every reviewed field is required and echoed from the read. db.reassign_schedule_creator compares owner_id, updated_at (as an instant), every reviewed field and the delivery, then makes one UPDATE whose WHERE pins every one of those columns (IS NOT DISTINCT FROM), deleted_at IS NULL and the absence of a queued/running/pending_retry run of the schedule. Zero rows → 409 schedule_run_in_progress, schedule_changed_since_review or 404 schedule_not_found. The same UPDATE sets the new creator, revokes the schedule's webhook and clears the delivery when asked. Already the creator → 200, no write. Rated owner tier → 409 schedule_not_restricted. A rating that raises propagates (500), so a schedule that cannot be rated is never changed.
  • Workspace delivery. A delivery to anyone but the taker needs clear, or keep with keep_delivery_to repeating the address (trimmed, case-insensitive); otherwise 409 schedule_delivers_to_another_person naming it.
  • Creator-bound writes. update_schedule and delete_schedule add owner_id = <caller> for a non-admin, and a share-tier webhook mint is bound to the creator (a 0-row mint is 403 webhook_owner_or_creator), so a former creator's in-flight write cannot land after a take-over.
  • Run now on a shared person's schedule. A person's Run now is unchanged (the UI asks first, below). Any non-person principal — agent, system and connector keys — gets 409 schedule_runs_as_shared_person before the scheduler is called.
  • MCP trigger_agent_schedule reports already_running only for the real running-lock 409 ({"detail": "Schedule is already executing"}); any other 409 reaches the calling agent as {status: "refused", code, message, retryable: false} with the backend's code and message. The backend's scheduler relay likewise passes the lock text only for the scheduler's already_running and otherwise relays {code, message} (scheduler_conflict when the scheduler sent no code).
  • Audit: schedule_taken_over with the schedule, both creator ids, webhook revoked and delivery cleared.
  • Census and headers: agent_route_tiers.json lists the route as owner tier with standing work; routers/schedules.py gains its first-line # mcp: header (take-over is a human-only grant, refused to agent keys); test_ent164_self_change_grants.py classifies the route as person-only.

A schedule run reads its refusal count, honestly

  • services/execution_refusals.py (new). readings(agent, rows) makes one count_by_execution call (feat(guardrails): guardrail events reach the platform with fleet counts, and credentials in tool output are hidden from the model (abilityai/trinity-enterprise#165) #4425's seam) per page, only over schedule-backed ids. The count is the sum of turn_tier_guard:* refusals (credential events and Bash denies never count).

  • Two fields on ExecutionSummary and ExecutionResponse: guardrail_refusals: int | null and guardrail_reporting, a marker that explains any doubt. In order, the most severe first:

    Condition guardrail_refusals guardrail_reporting
    the counts cannot be read null unavailable (logged; the read still returns 200)
    the agent never reported; or the run started before the agent's first report; or a start is missing; or the run was redelivered null (or the refusals that did arrive) never
    the reporter is not Claude Code n if any, else null not_claude_code
    the reporter is stale n stale
    the run is still going, or the agent has not reported since it ended n pending
    otherwise n (0 when none) null = complete
    not schedule-backed null null
    • "Before the first report" compares the run's start with the agent's first_report_at: for the count to be complete every hook call of the run must come after coverage began, and the earliest one can fire is the start. Both times come from the backend clock.
    • A redelivered run reads never, because the re-queue keeps no record of its first attempt's start.
    • pending lasts until the agent's next report after the run ended (each successful post carries the spool's backlog), at most one keepalive interval — up to 5 minutes, clean and refused runs alike.
  • Routes: the executions list, the execution detail and a schedule's history each call readings once, after the existing row narrowing, so a share holder gets readings for their own rows only. No new route.

  • MCP: get_execution_result forwards both fields (??, so a complete 0 stays 0); list_recent_executions and get_schedule_executions pass rows through and now describe the fields; ScheduleExecution in types.ts gains them.

  • Stated limits (also in the requirement): coverage is a lower bound (a lost fast store moves the start later); a run started in the first seconds after boot reads never; events are pruned after the retention window (90 days by receive time) while the coverage start is kept, so a run older than that can read a complete 0 once its events are gone; dropped spool records are not tied to runs, so a run a drop may cover still reads complete.

The Schedules tab shows the run tier, offers take-over and marks a restricted run

  • Row badge. "Runs without shell" next to the status, only when runs_as === 'shared_person' (owner and null show nothing; null means "not computed" and never reads as owner), with the server's reason and a creator line (created_by, else "You created this schedule"). The title row wraps, so the badge does not push the action icons off a 390 px screen.
  • Take over (only when can_take_over === true) opens ScheduleTakeOverDialog.vue on a deep copy of the read, so a list refetch while it is open cannot change what is sent. It shows the full prompt, allowed tools, model, validation and its prompt, the Workspace delivery, the webhook state (live, none, or "couldn't read; taking over revokes any webhook URL either way") and what the creator loses.
    • Another person's delivery gets radios with "Stop delivering" preselected, reset for every version shown; the taker's own delivery reads "stays as it is". An unknown viewer email is never treated as the taker's own.
    • The request (stores/schedules.js → utils/scheduleRunTier.js::takeOverBody) echoes the reviewed copy verbatim, with clear or keep + the address for another person's delivery; with no decision it throws rather than send an undecided request.
    • "Take over" is marked destructive (focus starts on a safe control) and is enabled only while the shown version has can_take_over. Backdrop and Esc are blocked while the request is in flight.
    • 200 closes and reloads. A refusal that means the review is out of date — schedule_changed_since_review, schedule_not_restricted, schedule_delivers_to_another_person, or the schedule deleted — reloads the list and shows the current version (or disables Confirm when nothing is left to adopt); if that reload fails, the dialog says so instead of presenting the old version as current. Each code has words; a raw code is never shown. For a creator account that no longer exists, the review says so.
  • Run now (owner tier, on a shared person's schedule) goes through a confirm ("Run once with my access"): this one run has the clicker's access, and the scheduled runs keep the restricted access. A share holder cannot trigger at all, so they see no such prompt.
  • Create dialog: a share holder sees a notice that their schedule's runs will have their access, not the owner's. The save error renders a named 409's message (apiErrorMessage) instead of the raw object.
  • Restricted-run marker (RestrictedRunMarker.vue, badge or line, each surface with its own required testid) on the Schedules history and execution modal, the Tasks list and the execution page, read from turn_integrity.restricted_turn with a sentence by cause. A malformed record or an inherited key (toString, constructor) renders nothing rather than throwing in a list.
  • ownerTier prop on SchedulesPanel from agent.can_share (the flag the owner-only tabs use), defaulting to true so no false warning appears. Design-system tokens only; the ratchets are unchanged.

Docs

requirements/auth.md §2.12 and §2.12.1 (the run tier, the refusal texts, the stamp and alert, take-over, the refusal reading and its limits, the UI) and requirements/scheduling.md; architecture/security.md §5g, api-endpoints.md, backend.md, execution.md, frontend.md and mcp-server.md; the operating-room, scheduling, task-execution, Tasks-tab, execution-detail and guardrails feature flows; the user doc automation/scheduling.md.

Tests

  • Run tier: test_ent926_turn_tier.py replaces the two tests that covered the unreadable-schedule rows with test_a_schedule_backed_turn_whose_schedule_cannot_be_read_is_never_owner_capable (15 cases: gone / another agent's / read error × schedule, webhook, retry, validation and manual triggers) and test_the_route_answers_no_shell_for_a_turn_whose_schedule_cannot_be_read (3, with a channel-visitor control); test_ent926_agent_key_turn_scope.py adds test_a_schedule_backed_turn_whose_schedule_cannot_be_read_is_fenced_through_auth (2: the real get_current_user and the standing-work fence; an owner-tier route and POST /reminders get 403 while such a run is running, after a precondition that a channel visitor's run does not fence them). New test_4281_turn_actor_frozen_matrix.py (119: 58 rows × visitor_shell on/off over a spec'd fake that mirrors the real joins, checking the triple, turn_tier, turn_actor(execution=), shell_allowed, restricts_standing_work and turn_person), test_4281_schedule_run_tier.py and test_4281_schedule_read_fields.py (real routers, get_current_user, JWTs and an agent key on the unit SQLite: the cause per row, the disclosure rules, the runtime refusal for both Claude spellings and two other runtimes, query counts — a 20-row list costs what a 2-row list does, the fleet read the same on 3 and 30 agents — and test_a_member_creator_rates_as_the_members_turn_does).
  • Refusal texts: test_ent926_turn_tier_hook.py and test_ent926_runtime_turn_scope.py gain each cause (including schedule_unreadable fed with both kind: person and kind: visitor, proving the text keys on cause), the deny record's code and turn_kind, the shell-allowed guard, the label bounds and the hook/agent-server table parity.
  • Stamp and alert: new test_4281_restricted_run_stamp.py (the real apply_result and the pull sink on the unit SQLite) and test_4281_restricted_schedule_condition.py (the real schedules, ops and operator-queue routers, the internal handler, real JWTs and agent key, the real seam; four threads behind a barrier calling sync → exactly one row; a failing alert never failing a committed write; the take-over cases test_taking_over_the_last_schedule_ends_the_former_creators_row, test_taking_over_one_of_two_keeps_the_row_for_the_other, test_a_refused_take_over_leaves_the_row, test_a_take_over_also_ends_the_takers_own_stale_row). Edited guards: test_2372_platform_alert_ack.py (the prefix is reserved) and test_3254_unended_kinds.py (the final kinds).
  • Take-over: new test_4281_schedule_take_over.py (61; only the scheduler hop and the audit sink replaced): the edited prompt after the review, a prompt changed without touching updated_at, each echoed field differing, and a write landing between the snapshot and the UPDATE (each 409, the new prompt not adopted); the delivery rules; the bound creator writes, each race test asserting that its hook fired inside the targeted DB method; Run now for agent and system keys; the relay's three conflict shapes; the lock detail pinned to the MCP server's constant. New src/mcp-server/src/tools/schedules.trigger-conflict.test.ts (7).
  • Refusal reading: new test_4281_execution_refusal_counts.py (38): events go in through the real ingest, the reporter state lives in fakeredis, reads go through the real schedules router over a real DB, so the wire JSON is asserted — late events, uncounted kinds, another agent's event naming this run ignored, every marker, the pending window, a count failure → unavailable with 200, one count query per page, runs before/after/straddling the first report, a lost fast store, redelivered runs, the full precedence matrix. New executions.refusals.test.ts (4). test_1474_read_boundary_z and test_2467_turn_integrity gain redelivery_count in their hand-written table DDL (real installs have the column on both tracks).
  • UI: new scheduleRunTier4281.spec.js (33), schedulesPanelRunTier4281.mount.spec.js (29, mounts the real SchedulesPanel), restrictedRunMarker4281.mount.spec.js (5, the marker plus the real TasksPanel and ExecutionDetail).
  • Red before: on the base, the stamp and alert files are 37 failed / 9 passed (the 9 are no-noise controls, each proven by a mutant instead); 48 of the first 55 take-over tests fail (the 7 that pass are route-absent 404s and guards that the Run-now refusal does not reach a person); the refusal-reading route tests fail on the missing fields and count call, and the MCP tests 4/4; before any UI code the panel spec is 16 failed / 3 passed (the 3 are no-noise controls). The frozen matrix passes unchanged on the base and on this branch.
  • Mutation runs (features), each from a scratch copy restored byte-identical and each red. Run tier: the creator shown on an owner row (19); VISITOR↔PERSON on the unreadable row (30) and the non-owner-creator row (40); the tier read through get_agent_owner (17); a non-total cause (2); a failed rating shown as owner (1); created_by for everyone (3); no fleet preload (the 3-vs-30 count); a view built per row (the 2-vs-20 count); no runtime check (4). Stamp and alert: subject per schedule; sync ignoring enabled; no sync at any of its callers; the ending not final; no material key; the prefix not owner-only, not about-a-person or not reserved; owner runs stamped; a rating raise propagating; a manual run rated by its creator; the merge replacing the Background task killed at CLI exit leaves no trace — execution records clean success while the work is lost #2467 keys; the failure branch or the pull writer not stamped; an unknown cause counted; sync raising. Take-over: no require_person; AuthorizedAgent for OwnedAgent; updated_at compared as a string (24); no reviewed-field compare (6); no pinned predicate; no in-flight check (3); webhook kept; owner tier not refused; delivery never decided (5); the update, delete or mint unbound; no Run-now refusal or one narrowed to agent keys; can_take_over for anyone; the remedy back to recreate; MCP every 409 the lock (6); relay every scheduler 409 the lock (3); no former-creator sync (3); no taker sync (1). Refusal reading: count every hook (2); no runtime rule (4); never reads 0 (2); no pending window (3); stale read as complete (2); one query per row (1); no coverage check (8); the end compared instead of the start (5); no redelivery clause (3). UI: the badge on null; the Run-now confirm removed or ignoring the owner tier; Take over without can_take_over; the dialog reading the live list; the delivery default keep; keep without the address; no reload on an out-of-date refusal; a failed webhook read shown as "none"; the raw save error; the marker ignoring the record or removed from a surface; Take over first in focus order; allowed_tools not echoed; no reset of the delivery choice between versions; Esc closing while in flight; an array accepted as the record.

Validation: each area was re-run on dev at 13d32e22f before the areas were merged into this branch — run tier: test_ent926_turn_tier.py + test_ent926_agent_key_turn_scope.py 520 passed; the 24-file run-tier set (with the ent926 census, agent-key, runtime and Workspace scope, ent875 READ_SITES, ent629, ent872, 2996, models-centralized, facade delegation, 4284 ×2) 2231 passed; dev's test_ent1148_* 71 passed; seeds 11, 222 and 3333 over the #4281 files, ent926 turn-tier and ent1148 delegation 439 passed each; refusal texts: the runtime-scope, hook and six runtime files 417 passed with only the 39 macOS-only failures; stamp and alert 166 passed; take-over: the 13-file set 1203 passed, with the stamp and alert files 1295 passed; refusal reading 332 passed; MCP npm test 1378 passed and tsc --noEmit clean; UI: the three specs, the raw-colour, loading-gate and source-text ratchets and eight neighbour specs 169 passed, npm run check:tokens OK, vite build rc 0. Wider sets earlier on the pre-dev base: 91 files (every #4281 file, ent926 except the hook file, ent875, 2372, 3246, 3254, 1310, 2996, ent164, ent872, ent629, ent866, ent715, 4053, 2467, 1482, 1474, 918, 1028, models-centralized, facade, cleanup parity, 1677, operator-queue edges, task execution, pull, schedules, ops, internal, 1823, 929, 2323, 293, 186) 3820 passed, with 21 failures and 21 errors identical on the untouched base (local APScheduler 3.11.0 vs the 3.11.3 pin in test_3940_cron_dst_fold, three test_ent751 paid A2A tests, PostgreSQL-only fixtures); 83 files around the execution reads 2755 passed, 0 failed; the full frontend unit run 504 files, 7705 tests passed. test_ent926_turn_tier_hook.py fails 39 cases on macOS only (/home resolves under /System/Volumes/Data), the same ids on untouched dev; on Linux (Python 3.13, dash) it passed 163/163. On this branch, with #4425 underneath, test_ent165_guardrail_spool.py passes 89/89 with the 4-tuple turn stub. The merges into this branch conflicted in docs, tests/registry.json, turn-tier-guard.py (the event code= on each deny kept beside the schedule branch), models.py and routers/schedules.py (both sides kept). After merging #4425's branch with dev at 97a86f1dc (conflict only in tests/registry.json, both sets kept): one Alembic head; this PR's test files (without the macOS-only hook file), every test using the route census or the turn-tier world, and dev's ent#1148, ent#1202 and schedule-status suites 3697 passed, 1 skipped. The first full unit run on this PR (it runs only for a PR into dev) found 11 failures in tests that reached dev since, each caused by this change and fixed here: the two #3408 Gemini files still stubbed the three-element fetch_turn answer (9 cases, 4b9403ec1); the #1970 guard read a fixed 4000-character prefix of trigger_schedule, and the share-holder refusal moved the scheduler POST's json= from character 3934 to 4013, so it now reads the whole handler through ast with its assertions unchanged (d14cf6b62); and the schedule-restricted- comments took operator_queue_service/__init__.py to 801 lines, over #3785's 800-line threshold, now 798 (bce82d4f9). Those files then passed with this PR's tests and every test that reads the operator queue's id prefixes: 1419 passed, 7 xfailed. dev at b99c23f6e (#4447, tests only) came in afterwards through #4425's branch without conflicts.

Mutation: each fix reverted on its own from a scratch copy, restored byte-identical. With turn_tier_service.py restored to dev's version, the 20 new run-tier cases go red: test_a_schedule_backed_turn_whose_schedule_cannot_be_read_is_never_owner_capable ×15, test_the_route_answers_no_shell_for_a_turn_whose_schedule_cannot_be_read ×3, test_a_schedule_backed_turn_whose_schedule_cannot_be_read_is_fenced_through_auth ×2. With the hook and turn_scope.py restored to dev's versions and the new tests kept, 44 fail on the behaviour across test_ent926_turn_tier_hook.py and test_ent926_runtime_turn_scope.py (the "shared with" or channel text where the schedule text is expected, a missing code in the deny record, a three-element answer); the 22 that pass are the skew guards (today's text byte for byte, a cause never refusing a shell-allowed turn). Refusal-text mutants: no domain strip (1), any cause shape accepted (6), kind= for turn_kind= (2), unbounded labels (2), the unreadable case logged as the creator code (8), the schedule shell branch removed (21), the cause checked before the shell: true allow (3), the turn_scope schedule text removed (14), no control-character strip (2). The stamp, alert, take-over, refusal-reading and UI tests are red on the base as listed under Tests.

Unverified: the manual UI sign-off (pending, below); the member-creator rating resolved against dev's member rule is newer than the live run (unit-tested only, including test_a_member_creator_rates_as_the_members_turn_does); the live run predates the merge of dev at 97a86f1dc (through #4425's branch); PostgreSQL-parametrized unit tests for get_agent_owners, get_users_by_ids, reassign_schedule_creator and the bound creator writes (they ran live on PostgreSQL only); an agent image from this PR against a backend without the run-tier answer fields (the byte-for-byte skew is pinned by unit tests); a Slack or public-link visitor with visitor_shell on, end to end; a no-path Grep live (the pinned CLI offers no Grep tool); a redelivered run on the pull pilot reading never live (unit-tested through the real requeue); blocking the forwarder's egress after a refused run (unit-tested); Python 3.13 and the full unit suite (CI).

Verified on a live stack

Production images (backend, scheduler, MCP server, frontend and the agent image) built from one tree holding these changes together with the public ent#165 and ent#863 changes on the dev of that time, on the prod compose stack (PostgreSQL 16, Redis with ACL users, two backend workers), with real agent containers on Claude Code CLI 2.1.281. The first pass used a scripted model endpoint. The refusal texts were then read again with real model turns, through a pass-through logging proxy that recorded what the model received, and the MCP trigger and refusal-reading cases were re-run on rebuilt images:

  • Run tier: a share holder's create answered runs_as: shared_person and created_by: null in their own view; the owner's view showed created_by; /api/ops/schedules and MCP list_agent_schedules (user key) carried the fields. During a share holder's cron run the turn-tier answer carried cause: creator_not_owner_tier, the schedule name, the creator label and the remedy, in 142 bytes. For a schedule-backed run whose schedule could no longer be read, the turn-tier route answered {"tier":"share","kind":"person","shell":false,"cause":"schedule_unreadable",…} and the agent key got 403 on an owner-tier route during that run (200 with no such run). On a Gemini agent an enabled create and a switch-on were refused 409 schedule_cannot_run_for_creator_on_runtime; the same create on a Claude Code agent was 201. The two bulk reads ran on PostgreSQL.
  • Refusal texts: on a share holder's cron run, Bash, an owner MCP tool and Write ~/CLAUDE.md were refused with "This run is the scheduled task 'p-sched-1', not a chat …", naming the creator; none said "shared with"; the records carried code: schedule_creator_tier and turn_kind: person. The text as the model received it: "…It runs with the access of the person who created it, pshare, … say in your answer that this schedule needs the agent's owner or an admin to take it over." A schedule that could no longer be read mid-run gave its own text and code: schedule_unreadable. A Gemini agent's share-rated cron run failed with the schedule, creator and take-over text, and no "switch to Claude Code". An owner chat or task kept the shell; a shared person's chat still got the "shared with" text.
  • Stamp and alert: the new module is packaged in the backend image. A share holder's create filed one owner-only row naming them; they and another share holder saw none; a second enabled schedule kept one row, now naming both. The share holder's cron run ended success with turn_integrity.restricted_turn.cause = creator_not_owner_tier; the owner's own schedule run kept turn_integrity null. The owner disabling both schedules ended the row (cancelled, by the platform); re-enabling filed a new one; an admin's pause and resume did the same.
  • Take-over: can_take_over: true for the owner; take-over → 200, runs_as: owner, webhook revoked; an agent key → 403 person_required. REST Run now with the agent key and the system key → 409 schedule_runs_as_shared_person; MCP trigger_agent_schedule with the agent key → {"status":"refused","code":"schedule_runs_as_shared_person",…,"retryable":false}, no poll text. With a real held lock, of four concurrent MCP triggers on the owner's schedule one was triggered and three already_running. reassign_schedule_creator outcomes taken_over, in_progress, changed and gone, and the share holder's update, delete and webhook mint, ran on PostgreSQL. Take-over ended the alert row (audit schedule_taken_over and platform_cleared); taking one of two schedules kept the row for the other. The API flows behind the dialog: an edit between open and confirm → 409 schedule_changed_since_review; an in-flight run → 409 schedule_run_in_progress; a deleted schedule → 404; a missing creator → creator_missing, take-over 200; a delivery to the share holder's Workspace → 409 schedule_delivers_to_another_person, then clear → 200 and the delivery null.
  • Refusal reading: the list returned 200 with both fields on every row. A refused share-tier cron run read (0, pending) while running, (3, pending), then (3, null); an owner-tier run read (0, pending) and then (0, null) about 215 s after it ended. A Gemini agent's run read (null, not_claude_code); an agent on an older image (null, never). On an image with no forwarder, an owner Run now and a refused cron run both read (null, never); after the agent was recreated on the forwarder image, both older runs still read (null, never), and a run started after the first keepalive read (0, pending), (1, pending), then (1, null). MCP get_execution_result and list_recent_executions carried both fields.
  • UI build: the frontend image built with the new chunks present; every dialog path's API flow is listed above.

Pending

  • Manual UI sign-off: the row badge and reason, the take-over review (including the 409 paths above, the delivery radios and the webhook line), the Run-now confirm, the share holder's create notice, and the "ran without shell" marker on the Schedules history, the Tasks row and the execution page — both themes and phone width. Not driven in a real browser against a live stack yet. The PR stays a draft until it is given.

Unfiled follow-ups

  • Show the refusal reading on the restricted-run marker — a count with its marker, never a bare 0; the fields are on the wire, the UI does not render them yet.
  • The fleet GET /api/executions does not carry the refusal fields.
  • Keep the first attempt's start on a redelivered run (a column on both tracks), so redelivered runs need not read never.
  • Treat runs older than the retention window as never, closing the pruned-events case.
  • Keep the runtime when Redis loses the reporter hash, so a flush does not read every run as not_claude_code until the next keepalive.
  • A schedule whose creator is a registered member reads runs_as: owner with cause creator_owner_tier, whose message says "created by the agent's owner or an admin" — the tier is right, the text is not; a creator_member cause or a reworded message.
  • turn_tier_answer reads the schedule twice per hook call — one read would save a query on every guarded tool call of a shared-person schedule run.
  • The ops emergency-stop resume re-enables schedules without the runtime check.
  • Webhook context is built and then dropped before the scheduler call (routers/webhooks.py).
  • OWNER_ONLY / SEARCH_OWNER_ONLY say "a person the agent is shared with" to a channel visitor whose path is denied — predates this PR; only the schedule variants change here.
  • Admin schedule recovery (routers/admin_recovery.py recover_schedule) does not decide the alert — it heals at the next dispatch.
  • A sync that read before a disable can file after the disable's clear — the row then stays until the next write for that creator; re-read after observe, or a per-agent × creator lock.
  • person_ending_is_final consults only the newest person ending per subject, and retention prunes final endings — shared by every final kind on the seam.
  • One extra get_execution per terminal on every run, schedule or not (cost nit).
  • The scheduler releases a schedule's run lock once a manual trigger is dispatched — a second trigger during a run starts a second concurrent run, so already_running only fires inside the short dispatch window (observed live; src/scheduler is unchanged here).
  • The webhook route maps every scheduler 409 to already_running (routers/webhooks.py) — accurate today, because the scheduler's only 409 is the lock.
  • Bind the webhook secret and revoke writers and the webhook read to the creator, as update, delete and mint are here.
  • Check other owner-checked writers for an update by id alone (the pattern fixed here for update, delete and mint).
  • An MCP take-over tool for user keys.
  • _is_person in the schedules router duplicates the person half of dependencies.person_or_capability_admits — one shared predicate would keep one rule.
  • The webhook-status read in the take-over review has no test for an out-of-order reply.
  • SchedulesPanel.vue still makes its other calls through raw axios (predates this PR).
  • The schedule row's text column is narrow at phone width, because the action icons take a fixed share.
  • ScheduleAnalyticsCard throws on a summary missing duration_ms (seen with a stubbed backend only).
  • test_ent926_agent_key_turn_scope.py defines test_an_unreadable_ledger_fails_closed twice (F811 on dev), so the first definition never runs — predates this PR.

Journey Impact

Journey Impact: extends: J05

…ead is never owner-capable (#4281)

A turn backed by a schedule that can no longer be read has no known
creator. It is rated a shared person with no account, so it gets no
shell, no owner-tier routes and no standing work, whatever the visitor
switch says.
…is never owner-capable (#4281)

A schedule-backed run is rated by its schedule's creator. When the
schedule cannot be read (gone, another agent's, or a failed read) there
is no known creator, and the run used to rate as a visitor. A visitor
has the shell, and the agent key's owner-tier routes and standing work,
while the owner's `visitor_shell` switch is on, which is the default. So
a run that could not be tied to an owner-tier creator could still act at
owner capability, against the ent#926 ruling that only a known owner-tier
creator's schedule runs that way.

Such a run now rates as a shared person with no account: no shell, no
Gemini/Codex turn, no owner-tier routes, no standing work, and reads
narrowed to nothing, whatever `visitor_shell` says. Live, readable
schedules are rated as before, and channel and public-link visitors keep
their `visitor_shell` behaviour.

Tests: test_ent926_turn_tier.py had two tests (a schedule that is gone,
a schedule of another agent) that pinned the visitor rating as intended.
They are replaced by tests asserting the shared-person rating, no shell
and the standing-work fence, with `visitor_shell` explicitly on, over
gone / another agent's / read error and every schedule trigger. The
turn-tier route answers shell=false for those runs, while a channel turn
on the same stub still gets the shell, so the stub is shown to reach the
code. test_ent926_agent_key_turn_scope.py gains a test through the real
`get_current_user`: the fence refuses the agent key with and without the
turn header. With the fix reverted, all 20 new cases fail.
…rates a shared person (#4281)

Describe the rule in the turn-tier section: such a run has no known
creator, so it is a shared person with no account, never a visitor, and
`visitor_shell` does not apply to it. State the cost to an owner whose
own schedule disappears while it runs.
…#4281)

The schedule half of turn_actor is about to move into one run-tier function
that every schedule read shares. The rule must not move with it, so this pins
the full input matrix first: a user id (owner, admin, share, dangling,
non-int), the Workspace branch, every owner-configured trigger plus
`__manual__` and `""`, schedule-backed runs (live, soft-deleted, read error,
another agent's, no recorded creator), each kind of creator, and an agent
whose owner's user row is gone. Each row, with the visitor switch on and off,
asserts the whole triple (no person id on an owner row), shell_allowed,
restricts_standing_work and turn_person.

The fake derives every answer from one table of users and one ownership map,
with the real methods' semantics (get_agent_owner's INNER JOIN, get_schedule's
soft-delete filter); any other method raises. A MagicMock cannot catch a
refactor that reads the tier through a different lookup.

Characterization test: 119 passed against the unmodified
turn_tier_service.py at 35041e532 (a separate worktree).
…answer names the cause (#4281)

`turn_tier_service.schedule_run_tier(db, agent, schedule) -> RunTier(tier,
kind, cause, creator_id)` is now the one home of the creator rule.
turn_actor's schedule branch reads its tier half and keeps the person id None
on an owner row, so the rating does not change (the frozen matrix stays green).

The cause (creator_owner_tier, no_recorded_creator, creator_not_owner_tier,
creator_missing, agent_has_no_owner, schedule_unreadable) is a separate,
total function: a failed lookup gives `unknown` and leaves the tier as it is.
The fences never call it, so its lookups add no new way for an agent-key
request to fail.

RunTierLookups memoises the four lookups for one request, and its preload
fills them with two bulk reads (new db.get_agent_owners, db.get_users_by_ids)
for the fleet read.

The hook's GET .../turn-tier answer adds cause, schedule (name, <=80 chars),
creator (display name, else the username without any email domain, <=64
chars) and remedy for a schedule-backed shared turn, all null otherwise.
Control and format characters are stripped, and the worst case is <=2048
bytes. Old hooks read only tier/kind/shell.

Mutants, each red: leaking the creator on an owner row (14 matrix cases),
PERSON->VISITOR on an unreadable schedule (8) or a non-owner creator (18),
reading the tier through get_agent_owner (4), a non-total cause, an
email-keeping label, and unbounded labels.
ScheduleResponse (list, get, create, PUT), the enable/disable bodies and the
admin fleet read GET /api/ops/schedules now carry:
- runs_as: owner | shared_person | null. Null means it was not computed;
  it is never a guessed owner.
- runs_as_reason: {code, message}.
- created_by_you.
- created_by: display name, else username. Shown only to the agent's owner
  tier and to an agent key that is not acting for a shared person.
The creator's id stays unexposed.

Each request computes the viewer's tier and a lookup memo once, so a 20-row
list costs the same queries as a 2-row one. The fleet read preloads creators
and owners in two bulk queries, so its cost is the same on 3 agents and on 30.

D1/D2: on Claude Code a shared-person schedule is created or enabled, and the
response says how it runs. On a Gemini or Codex agent it could never run, so
switching one on is refused with 409
`schedule_cannot_run_for_creator_on_runtime`. That covers create while
enabled, POST .../enable, and a PUT that turns a disabled schedule on. The
runtime read falls back to Claude Code, so a Docker fault warns instead of
refusing.

Mutants, each red: no preload on the fleet read, a view built per row, the
creator named to every viewer, no D2 check, and a failed rating read as
owner.
…s Claude Code (#4281)

The check that refuses switching on a shared-person schedule where it could
never run compared the runtime label to "claude-code" only. "claude" is an
accepted spelling that selects Claude Code too (agent_service.helpers
CLAUDE_RUNTIME_NAMES, and the agent's runtime factory), and Claude Code runs
the turn-tier hook. On an agent labelled "claude" a share holder's schedule
was refused with 409, naming "claude" as a runtime that cannot run it.

The check now allows every name in CLAUDE_RUNTIME_NAMES.

Test: the Claude Code case runs for both spellings, on create and on
enable. Before the fix the "claude" case answered 409.
…le read (#4281)

GET /api/ops/schedules preloads the run-tier memo with two bulk reads so its
cost stays flat in the fleet size. When either bulk read raised, the error
left the route and the whole fleet read failed, where every other schedule
read answers `runs_as: null` for a rating it could not compute.

The preload is an optimisation, so its failure is now logged and the rows are
rated by the per-row lookups, showing `runs_as: null` when those fail too.

Test: each bulk read failing still answers 200 with every row rated; the bulk
and per-row owner reads failing together never rate a share holder's
schedule as owner. Before the fix the route raised.
…ains (#4281)

The turn-tier answer reads the schedule once for the tier and again for the
detail. When the first read failed and the second succeeded, the turn was
rated a shared person (fail closed, as intended), but the cause was then
worked out against a readable schedule created by the agent's owner, and the
answer named the owner as "not this agent's owner or an admin", with the
recreate remedy.

`schedule_run_cause` now answers `unknown` when the creator it finds is an
admin or the agent's owner while the tier it was given is a shared person's.
It reads nothing new: the user row and the owner row were read already. The
tier is unchanged.

Tests: the cause for an owner-tier creator given a shared-person tier is
unknown (owner, admin, admin on an agent with no owner on record); a schedule
read that fails once gives `share`, no shell, and no cause, creator or remedy.
Before the fix all four answered creator_not_owner_tier or
agent_has_no_owner. The fleet-reach guard lists the new role compare: it
reads a schedule creator's user row, never the caller's.
…as the member's own turn does (#4281)

Under the member rule (trinity-enterprise#1148) a person the registered
provider rates the owner of one agent runs there at owner tier, kind
`member`. The one home of the creator rule (`_schedule_tier`) rates the
creator through the same `_person_tier`, so a schedule read and the turn
agree for a member too. Pinned here: red when `_schedule_tier` rates the
creator by role and ownership only.

The security notes now say a member's owner row keeps the creator as the
person, where they said every owner row names none.
…dule fields too (#4281)

The turn-tier answer gained `cause`, `schedule`, `creator` and `remedy`
(null on every turn that is not a schedule-backed shared one). The
trinity-enterprise#1148 check that a member's and a delegated turn get the
shell compared the whole answer, so it now expects those four nulls as
every other answer check in this file does.
…the schedule, not a chat (#4281)

A schedule's runs are rated by its creator. When the creator is not owner
tier, every shell, MCP, owner-only path and search refusal in such a run said
"This turn is for a person the agent is shared with", and a run whose schedule
could not be read was told it came from "a channel or a public link". Neither
is what happened.

The turn-tier answer now carries `cause`, `schedule`, `creator` and `remedy`
for a schedule-backed shared turn. The hook keys its text on `cause`, never on
`kind`: a creator cause names the scheduled task, whose access it runs with
and what it needs (from a fixed table keyed by the remedy code; an unknown code
gets generic text), and `schedule_unreadable` gets its own text. The labels are
bounded here as well as by the platform (control and format characters
replaced, whitespace folded, 80/64 characters, an email's domain dropped).

Each such deny is logged with its own code (`schedule_creator_tier`,
`schedule_unreadable`) and the turn's kind as `turn_kind`, never `kind`.
An answer with no cause (an older backend, or any other turn) keeps today's
text byte for byte.

Red before: 30 of the new hook cases fail on the unchanged hook (wrong text,
no `code` in the record, three-element answer, an unhashable remedy); 17 skew
guards are green on both by design. Mutants (no domain strip, any cause shape, `kind=` for
`turn_kind=`, unbounded labels, unreadable logged as the creator code) each
turn at least one case red.
…tor names the schedule (#4281)

On Gemini CLI and Codex a run of a schedule whose creator is not owner tier
already fails `turn_refused`, but its text called it a person the agent is
shared with and told the owner to switch the agent to Claude Code, which would
not give that run the shell either.

`turn_scope.fetch_turn` now also returns the answer's schedule detail (a
fourth element, None for any other turn), bounded as in the hook, and
`require_owner_tier` keys the refusal on `cause`: the scheduled task, whose
access it runs with, that the runtime cannot limit such a turn, and what the
schedule needs; `schedule_unreadable` has its own text. No runtime switch is
suggested. An answer with no cause keeps REFUSED / REFUSED_VISITOR as they
are. The status code and `error_code` are unchanged.

The six owner stubs of `fetch_turn` in other runtime test files gain the
fourth element. A parity test pins the hook and the agent server to the same
remedy table, creator sentence and label bounds.

Red before: 16 of the new cases fail on the unchanged module; 5 skew guards
are green on both by design.
…ds restricted_turn (#4281)

A schedule's runs are rated by their creator. When the creator is neither an
admin nor the agent's owner, every run is a shared person's turn, with no shell
and no owner-added tools, and the run still ended a clean success.

The terminal write now records restricted_turn in the existing turn_integrity
JSON column, beside the #2467 keys: tier, kind, cause, schedule id, creator id
and shell false, codes and ids only. Written by both branches of apply_result
and by the pull-mode result writer. No status change and no migration. The
rating is total: a lookup that raises writes no record and never changes the
outcome, and an owner-tier run writes exactly what it wrote before.
… platform alert per agent (#4281)

The agent's operator now hears of it on the one-row-per-subject seam: kind
schedule_runs_restricted, subject per agent x creator. The text names the
creator, the cause, the remedy and up to five schedules; the context carries
ids and codes only. The row count is bounded by the agent's share list, so
many schedules or many runs by one person stay one row. A person's ending is
final for that cause; a new cause files again.

schedule_tier_alerts.sync is the single owner of the observe/clear decision and
reads the creator's live enabled schedules, so it is called after every write
that can change the answer: the schedule routes, the admin pause, resume and
emergency stop, the dispatch of a schedule-backed run (which also covers
terminals that never reach apply_result) and the winning terminal write. A run
that ends after its schedule was disabled therefore files nothing. No loop is
added; two racing readings meet the seam's lock and its unique pending subject.

The row names a person, so its reserved prefix is owner-only and
about-a-person: a share holder and machine keys do not see it.
#4281)

architecture/execution.md gains the Restricted Schedule Runs section (the
stamp, its terminal-time and sticky semantics, the readers that pass the
column through, the alert's callers). backend.md lists schedule_tier_alerts
and the new kind; the scheduling, task-execution and operating-room flows
describe the stamp, the per-creator alert and its bound.
…e wire codes, so it still loads once take-over replaces recreate (#4281)

The take-over slice removes turn_tier_service.REMEDY_RECREATE. The two
branches merge without a conflict on those lines, and the merged backend
then failed to import services.schedule_tier_alerts, which the task applier
and the internal router import.
…a failing alert never fails a schedule write (#4281)

Both are stated contracts of schedule_tier_alerts.sync with no test: removing
the unknown-cause guard, or the never-raise boundary, stayed green.
…edule in place (#4281)

POST /api/agents/{name}/schedules/{schedule_id}/take-over makes the caller
the schedule's creator, so its runs get owner tier from then on. A grant,
so require_person plus OwnedAgent: agent, system and connector keys are
refused, and there is no MCP tool.

- The body echoes expected_updated_at (compared as an instant) and the
  reviewed prompt fields of the ScheduleResponse the person read.
  db.reassign_schedule_creator is one UPDATE pinned to the snapshot it
  compared, with NOT EXISTS a queued/running/pending_retry run, and it
  nulls the webhook columns (shared with revoke_webhook_token).
- 409 schedule_changed_since_review / schedule_run_in_progress /
  schedule_not_restricted / schedule_delivers_to_another_person; a delivery
  to another person's Workspace is cleared, or kept only when the request
  repeats the address (D8). Taking over twice is a no-op.
- A share holder's update, delete and webhook mint are bound to the creator
  they authorized against, so one authorized just before a take-over is
  403 after it. An admin's writes keep their own rule.
- An agent or other non-person key cannot Run now a schedule rated a
  shared person: 409 schedule_runs_as_shared_person (D9).
- ScheduleResponse.can_take_over; audit authorization/schedule_taken_over;
  route census, agent-route tier and # mcp: header entries.
…talog, security notes, user guide and scheduling flow (#4281)
…tor account as a person the agent is shared with (#4281)
…ate reloads it, including the delivery refusal, a deleted schedule and a reload that fails (#4281)
…l text read only their own keys, so a malformed cause never throws in a list (#4281)
…issue-4281-schedule-run-tier

# Conflicts:
#	docker/base-image/hooks/turn-tier-guard.py
…issue-4281-schedule-run-tier

# Conflicts:
#	docs/memory/feature-flows.md
#	docs/memory/requirements/auth.md
#	tests/registry.json
…issue-4281-schedule-run-tier

# Conflicts:
#	docs/memory/architecture/api-endpoints.md
#	docs/memory/architecture/backend.md
#	docs/memory/architecture/frontend.md
#	docs/memory/feature-flows/execution-detail-page.md
#	docs/memory/feature-flows/tasks-tab.md
#	docs/memory/requirements/auth.md
#	src/backend/models.py
#	src/backend/routers/schedules.py
#	tests/registry.json
…ail #4281 B added to ask_turn (Abilityai/trinity-enterprise#165)

Integration of ent#165 S2 and #4281 B: whichever lands second carries this.
…asternak31/issue-4281-schedule-run-tier

Brings current dev (through the guardrail branch's merge of it) and the
guardrail event store's revision renumbered to 0124. tests/registry.json
keeps both sets of entries.
@AndriiPasternak31
AndriiPasternak31 changed the base branch from AndriiPasternak31/ent165-guardrail-events to dev November 10, 2026 22:01
path = os.path.join(tmp, "tool-results", "smoke.txt")
os.makedirs(os.path.dirname(path))
with open(path, "w") as f:
f.write("build output\n" * 3000 + "token=" + SECRET + "\n")
… four-element answer (#4281)

`fetch_turn` answers (tier, owner_capable, kind, cause) since this
change; the other runtime test files already stub four elements. The two
#3408 files that reached dev meanwhile still returned three, so every
headless Gemini case in them failed to unpack before it tested anything.
…er, not its first 4000 characters (#4281)

The guard looked for the scheduler POST's `json=` in a fixed 4000-character
prefix of `trigger_schedule`. On dev it sat at character 3934; the
share-holder refusal this change adds in front of it moved it to 4013,
so the guard reported the identity as dropped while the body was still
sent. It now reads the handler's own source through `ast`, so a guard
added in front cannot push the call out of view. Every assertion is
unchanged, and replacing `json=source_payload` still fails it.
… 800-line threshold (#4281)

The `schedule-restricted-` entries took `operator_queue_service/__init__.py`
from 791 to 801 lines, over the per-module threshold #3785 pins. The two
comments say the same in fewer lines (798); no code changes.
…asternak31/issue-4281-schedule-run-tier

Brings dev's #4447 through the guardrail branch. No conflicts.
@github-actions

Copy link
Copy Markdown

⚠️ Nightly unit-suite check skipped — merge conflict against dev.

Resolve by running git merge dev locally and pushing the result. The next nightly run will re-test once the conflict is gone.

@github-actions

Copy link
Copy Markdown

⚠️ Live-instance suite skipped — merge conflict against dev.

Resolve by merging dev locally and pushing the result; the next nightly re-tests.

@AndriiPasternak31
AndriiPasternak31 changed the base branch from dev to AndriiPasternak31/ent165-guardrail-events November 11, 2026 20:20
…il-events' into AndriiPasternak31/issue-4281-schedule-run-tier
At 390px the run-tier reason box's "Created by <email>" line held the row's
text column wider than the space beside the action icons: an email is one
unbreakable word, so the page scrolled sideways and Delete sat past the
screen edge (401px of 390). The creator line may now break anywhere, and
below sm the box stacks the text above Take over; side by side the text was
left a few pixels wide. From sm up the desktop box is unchanged.

The new hermetic e2e measures it at 390px and 1280px in both themes; with
the change reverted it fails on the page overflow, the icons past the row
and the button beside the text.

This branch has not been deployed

No deployments
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.

2 participants