Repository navigation
fix(access): support ownership migration when enabling enforcement - #2304
Conversation
hidb4ai
left a comment
There was a problem hiding this comment.
Two reproducible ownership/recovery defects remain in the offline and external-store migration paths. Please address the inline findings before merging.
2ff6e32 to
87d7e1f
Compare
|
@happy-v587 please fix the file confliction |
hidb4ai
left a comment
There was a problem hiding this comment.
@happy-v587 Re-reviewed 1ca415f5. The previously reported ownership/audit and Windows-path defects are addressed. A merge probe against current master 90355b8e still reports conflicts in desktop/VALIDATION.md, desktop/src-tauri/src/transport/operations.json, desktop/ui/src/generated/operations.ts, and release/upgrade-support.json. Please integrate current master, regenerate the combined contracts, recheck the Desktop qualification and persistence digest, and complete Main, including the newly added Windows cases, before merging.
hidb4ai
left a comment
There was a problem hiding this comment.
@happy-v587 Re-reviewed cf6741eb. The previously reported ownership/audit and Windows-path defects are fixed, and the merge conflicts reported on 1ca415f5 are resolved. I found no further blocking defect in the reviewed ownership migration paths. The merged Desktop contract has a matching qualification record, and the persistence-policy declaration is consistent. Current-head Main and acceptance checks are still pending; please complete those, including the affected Windows cases, before merging.
hidb4ai
left a comment
There was a problem hiding this comment.
Two ownership-maintenance defects remain: the offline preview schedules processing work, and HTTP migration drops the originating audit context. Please address the inline findings before merging.
|
@hireview001 @hidb4ai Please re-review current head The Handoff recovery-evidence gap, published-Handoff inventory gap, and static background-permission check are fixed. The static check also preserves revoked grants. All 11 review threads are resolved, with fix details and regression evidence in the relevant replies. Local ownership/authorization/recovery tests, contract checks, and The formal review-request action is unavailable to the current integration/account, so I am requesting re-review here. |
hidb4ai
left a comment
There was a problem hiding this comment.
Re-reviewed 2ee2da386b93e621404a96ac701233452ab19fc0. The previous custom Artifact and Handoff attribution cases are fixed. Two confirmed P2 cases remain:
- Prompt Candidate migration skips recorded owner-recovery evidence and can persist competing attribution: #2304 (comment)
- Static background permission preview falsely rejects supported long Scope IDs: #2304 (comment)
Please address these before merging.
|
@hidb4ai Please re-review the ownership-migration changes. All review threads are now resolved, including the Prompt Candidate recovery preflight and long-Scope permission-preview fixes in At The formal re-review request API returned 404 because this account has read-only access to the upstream repository, so I am requesting re-review here. |
hidb4ai
left a comment
There was a problem hiding this comment.
The ownership fixes are being revalidated. The newly qualified Desktop contract leaves the current setup guidance pointing at a disabled historical profile; please correct the guidance before merging.
hidb4ai
left a comment
There was a problem hiding this comment.
The Desktop qualification guidance is corrected. One P2 remains: on strict MySQL-compatible storage the long-Scope background plan can report ready even though static bootstrap cannot persist its key. See #2304 (comment). Please address this before merging.
|
Fixed the Python 3.11 CI failure in commit 0ba4f70. The test child writes its PID to a temporary file and atomically renames it to ready, so the parent cannot read a partially written PID. Validation passed locally: tests/test_native_command.py (22 passed) and make check (including 61 integration checks). The commit is pushed, and CI run 41698931373 has started. |
|
@hidb4ai Please re-review the current head 0ba4f70. It fixes the Python 3.11 test race by atomically publishing the child PID. The focused file has 22 passing tests and make check passes locally. GitHub Actions run 41698931373 is still queued before preflight, so remote CI has not produced a result yet. |
Resolve conflicts with ownership migration when enabling enforcement (oceanbase#2304), Source evidence declarations (oceanbase#2004), and the 13 other commits that landed since the previous merge. - `server/authz/keys.py` is new upstream; it lands in `builtin/authz/keys.py` and `builtin/authz/__init__.py` exports `bounded_idempotency_key` and `IDEMPOTENCY_KEY_LIMIT` from there. - `server/processing_security.py` keeps only `build_worker_security`. The upstream change to `WorkerSecurity` (bounded idempotency keys) is applied to `builtin/authz/worker.py`, where this branch moved that class. - `server/app.py`, `server/factory.py`, `server/cli.py`: keep the relocated `builtin.authz` imports and add only the names the new upstream code uses (`bounded_idempotency_key`, `OwnerRecovery`). `_scheduled_access_runners` stays deleted; its only upstream change was the bounded key. - `release/upgrade-support.json`: keep the rationale added upstream for the v1_5_0_002 and v1_5_0_003 revisions, append the sentence about this branch's code-organization changes, and recompute the persistence digest. The generated table and index DDL for all 75 tables is identical to master on the SQLite and MySQL dialects. Follow the moves into code that arrived with the merge: - `server/ownership.py`, `builtin/authz/service.py` (new `static_scope_bootstrap_would_grant`), and the new ownership-migration, artifact-plugin, and access-control tests import access control from `powercontext.builtin.authz`. - The new ownership-migration, Atomic Memory evidence, and Source evidence tests stop passing the removed `scheduler_path` argument. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Which issue or RFC does this PR close?
Closes #2299.
Rationale for this change
Data accepted with
ACCESS_MODE=disabledhas no Artifact owner or Candidate owner attestation. Enabling enforcement preserves reads but blocks old Artifact updates with403and Candidate approval with503 artifact_owner_pending. Administrators need explicit attribution and a check of the background Principal's permissions.What changes are included in this PR?
powercontext server access-ownership-migrateplan/apply, explicit ownership, Scope selection, maintenance confirmation, and a pre-switch--background-principalcheck.Are there any user-facing changes?
Administrators can preview and assign missing ownership before or after enabling enforcement. HTTP apply requires enforcement and
server.admin. Background checks without an Access store return an explicit unavailable error; the offline command supports this check before enforcement.Ownership assignments are immutable. Back up the database and select the correct Principal for each Scope before applying. Rolling back application code does not undo ownership assignments. The migration changes authorization metadata, preserves domain history, and uses the existing ownership recovery schema.
How was this change tested?
uv run --frozen pytest -q tests/e2e/test_access_ownership_migration.py tests/e2e/test_owner_recovery_http.py tests/test_owner_recovery.py tests/e2e/test_recall_manifest.py tests/e2e/test_atomic_memory_description_upgrade.py— 67 passed. These cover ownership migration, external recovery/audit retry, long identities, the merged manifest API, and description upgrades.make contract-test— 56 passed. Python, integration and Desktop artifacts were regenerated from the combined OpenAPI;pnpm --dir desktop generate:checkalso passes with the installed OpenJDK on PATH.UV_NO_SYNC=1 make check— passed, including lock checks, the combined persistence compatibility review, hooks, type checks and 61 integration-manifest tests.make js-test cindy-testwith Node 24.14.1 / pnpm 11.13.1 — passed, including 439 DSH unit tests, 9 DSH integration tests, 20 Cindy tests, package creation and committed-bundle drift checks.The existing
desktop/tests/real_server.pynative harness passed all four SQLite HTTP/TLS connection modes on clean Server sourcesdb9c8d6edc49166504b39e0d8038dd0082368dee. All 625 packaged runtime source files match that commit byte for byte, excluding generated version metadata. The immutable source/contract/wheel evidence is recorded underdesktop/VALIDATION.md#server-db9c8d6e-protocol-qualification; historical qualification records retain their original identities.Migration tests use temporary SQLite databases with fault-injected external relationship/audit delivery. Protocol qualification uses independent built-wheel Server processes on macOS ARM64. These results do not establish native Windows/Intel execution, installed Desktop UI/credential acceptance, seekDB/OceanBase upgrade acceptance or real spawned Worker migration acceptance. Windows CI retains the three offline path cases; new remote CI results are separate from local validation.
AI usage statement
Codex (GPT-6.1 and GPT-6 family models) assisted with implementation, code review, regression tests, documentation, and PR preparation. Validation commands and their results are listed above.