Repository navigation
fix: accept local admin-owned workflow allocator files - #11461
Conversation
|
Intent: Restore workflow startup on native Windows when elevated creation gives allocator files the local Administrators group owner, while retaining mandatory ownership, local-volume, DACL and run-identity checks. |
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
|
Local verification on bd48496:
The prerequisite patch is intentionally separate from the requested native Windows Memory V2 implementation. |
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Confirm CI's Windows lane actually executes the new [DESIGN-REVIEWED] 4b1264f |
First Principles Review (Fable 5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Verify the native Windows test ran elevated and non-elevated: with ownership loosened, the owner-only DACL lockdown alone now fences the counter from other admins. What this change shipsInventory (6 items) — 6 justifiedIntent: FIX — workflows refuse to start on elevated native Windows because the allocator rejects its own Administrators-owned run-number files.
Defect provenance: the new [FIRST-PRINCIPLES-REVIEWED] 4b1264f |
Opus 4.8 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
bd48496 to
e6bd6e3
Compare
|
CI triage on head e6bd6e3: all 10 red jobs (Backend Tests shards 1/5/6/8 on Linux and Windows, Coverage Gate, Real Adapter Contract Tests) are inherited from main. main's own push run 35469148028 at 39892f5 (the #12091 revert) fails the same 10 jobs, and the failing node ids match exactly per shard: shard 1 test_subagent_continuable.py (60), shard 5 test_spawn_reasoning_effort.py (7 errors), shard 6 test_real_adapter_gate.py (1), shard 8 test_acp_capability_sets_leaf.py::test_membership_is_unchanged_by_the_move (1). None touch this PR's 3 files. Holding the re-sync until main is green; rebasing onto a red main would only reproduce the same set. |
Elevated Windows processes create allocator objects with the local Administrators group as owner. Accept that owner only on a confirmed local volume, while retaining the current-user requirement and fail-loud DACL lockdown. Preserve private execution and binding checks.
e6bd6e3 to
4b1264f
Compare
|
Rebased onto main 891e6de (after #12088 restored the shard-1/8 tests). Head e6bd6e3 -> 4b1264f; patch-id identical, still 3 files. Local on the rebased head: test/test_workflows_run_identity.py 64 passed (the 3 inherited setup errors are gone on new main); isort/flake8/black/mypy clean on the changed files. |
Problem / Motivation
Workflows fail to start on native Windows when Kiro Crew runs as administrator. The caller sees
Workflow memory is unavailable, but startup fails while checking who owns the run-number files, before any agent starts.Why it matters
A normal Windows file-creation policy blocks every workflow on these installations. Choosing another member name or retrying cannot fix it.
What changed (motivation → approach → change)
Windows can make the local Administrators group the owner of files created by an elevated process. The workflow allocator required the owner's SID to equal the user's SID, so it rejected its own files.
src/kiro_crew/workflow_memory.pyaccepts that group owner only on a confirmed local volume. The same group SID on a network share belongs to another machine and remains rejected. Unknown users, unreadable owners and other owners remain rejected. The existing file-identity checks and required owner-only DACL writes stay in place. Ownership is not rewritten.🟩 added · 🟥 removed · 🟦 unchanged
docs/system-specs/modules/workflows.mdrecords this narrow rule. This does not change member memory provisioning, member bindings, or fall back to Global V1.Tests
test/test_workflows_run_identity.pycovers the owner/volume matrix, unreadable descriptors, unchanged POSIX ownership, and failure to tighten directory/lock/counter permissions without advancing the counter. Its native Windows test uses the real ACL writer and verifies all four objects retain their owner and receive protected owner-only permissions.The new owner and native-allocation checks fail on the old implementation. On the current base (
1c7f9637),test/test_workflows_run_identity.pypasses 61 tests; its 3test_simultaneous_services_never_share_run_identitycases error at setup on this Windows host withPrivate memory requires canonical member admission, identically on a cleanorigin/maincheckout, from thetest_workflows_private_execution.pyworldfixture, outside the allocator path.test_memv2_audit_d_workflows.py::test_global_parent_still_runs_when_private_members_exist, which fails onmainon an administrator-owned host withWorkflow allocator owner is invalid, passes all 14 cases on this branch.isort, flake8, black and mypy pass on the changed files. Full suites and non-Windows native execution remain for CI.
Manual verification
The original thread-allocation test reproduced the owner rejection on this native Windows administrator account. The native regression reads real security descriptors, allocates consecutive IDs and verifies the protected DACLs. Existing tests exercise separate real Windows processes, delayed lock creation, durable counters and crash recovery. No online configuration, private memory or credential contents were read or changed for these checks.
Related Issues
no linked issue: reported directly while preparing native Windows Memory V2 support; this PR fixes only the workflow startup prerequisite.
Pattern harvest
Not generalizable: owner SID equality is not a universal Windows ownership rule. This allocator permits only the specific local group used for elevated file creation; private execution and other trust boundaries retain their own rules.
Checklist
feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)