ACTIVITY-WP-0043: owner-return pickup adapter (STATE-WP-0094-T03 owner side)
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 1s
Build and Publish Container Image / build-and-push (push) Successful in 1m28s

Disabled reviewed definition, pinned profile/grant, server-side unique
submission adapter with receipts, and opt-in activation plan. No schedule,
deployment or dispatch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Assistant: claude-code
Assistant-Model: opus
Assistant-Process: 671493@bnt-lap001
Assistant-Session: 60d7b11f-78f9-4731-9367-918511b2762d
This commit is contained in:
tegwick 2026-10-04 12:42:43 +02:00
parent ab10835a0c
commit 5a9012453c
5 changed files with 541 additions and 0 deletions

View file

@ -0,0 +1,84 @@
---
id: ACTIVITY-WP-0043
type: workplan
title: "Owner-return pickup adapter for State Hub STATE-WP-0094-T03"
domain: infotech
repo: activity-core
status: active
owner: claude-activity-core
topic_slug: activity-core
created: "2026-10-04"
updated: "2026-10-04"
---
Origin: State Hub STATE-WP-0094-T03 ("Integrate deduplicated owner wakeups with
the supported runner"). Contract: `state-hub/docs/owner-return-handoff.md`
sections "Remaining T03 integration" and "Current eligibility guard". State Hub
already ships the offline planner `scripts/owner_return_handoff.py`; this plan
is the Activity Core owner half. Source level only: no schedule, deployment,
Helm change, credential handling or real ops-run dispatch.
Pinned identities:
- ActivityDefinition `owner-return-pickup` (UUID = uuid5 of the slug under the
`activity-core:activity-definition` namespace, as `sync_activity_definitions`)
- Harness profile `harness.agent-dev-local@1.0.0`
- Repository grant v1: `allowed_paths: [workplans]`, commits 1..1, `publish: false`
- Event binding `owner-return:sha256([repo, task_record_id, message_id])`,
recomputed and verified on intake; ops-run source_id `<repo>/<task_record_id>`
## Reviewed source definition (not activated)
```task
id: ACTIVITY-WP-0043-T01
status: done
priority: medium
```
`activity-definitions/owner-return-pickup.md`: `enabled: false`, far-future
scheduled shape, rule condition `False`. Pins profile and documents identities.
## Submission/receipt adapter with server-side uniqueness
```task
id: ACTIVITY-WP-0043-T02
status: done
priority: high
```
`src/activity_core/owner_return_pickup.py`: validates planner candidates
(repo/task/message identity, definition UUID, event hash), inserts only
`reviewable` uncorrelated candidates through `create_ops_run_from_spec`
(`ON CONFLICT (idempotency_key) DO NOTHING`), and on conflict reports the
existing row server-side. Lease, retry and exact-repeat terminal close remain
`ops_run_queue` semantics. Refuses before any write unless
`ACTIVITY_CORE_OWNER_RETURN_PICKUP_ENABLED` is set, the queue is enabled, the
caller asserts paginated collection, and every candidate binds. Tests:
`tests/test_owner_return_pickup.py` (20 passed; full suite 696 passed, 1 skipped).
## Paginated message collection (dependency on State Hub)
```task
id: ACTIVITY-WP-0043-T03
status: wait
priority: high
needs_human: false
blocking_reason: "State Hub C-25 fetches at most 200 replies per counterpart; pagination belongs in state-hub (STATE-WP-0094-T03)"
```
The adapter requires `collection_complete=True`. The caller (State Hub C-25 /
planner collection) must page through all replies per awaited agent before a
run may claim complete coverage. Not edited here; dependency on state-hub.
## Founder-reviewed activation
```task
id: ACTIVITY-WP-0043-T04
status: wait
priority: medium
needs_human: true
blocking_reason: "Activation is a separately reviewed founder action"
```
Plan: `docs/owner-return-pickup-activation-plan.md`. Requires T03 and an
eligibility-source binding (fresh authoritative `current_tasks`).