Skip to content

feat(work): consume admitted helper taskfiles with fenced claims (#1017) - #1162

Merged
oxa-orchestrator[bot] merged 10 commits into
mainfrom
agent/1017-refill-consumer
Nov 17, 2026
Merged

oxa-orchestrator[bot] merged 10 commits into
mainfrom
agent/1017-refill-consumer

Conversation

@oxa-agent

@oxa-agent oxa-agent Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

T3. #1017 / #307 row night-watch + feeder + goal-loop → board: assignment/leases. An authenticated helper consumer reserves at most one prepared task through the same Claims records and existing atomic spool publisher. The current GitHub diff is390 added lines; Core prerequisite #1173 is merged.

Default-off and the persistent operator pause marker prevent acquisition/publication across reconstruction. The same numeric partition applies to PR and issue intake. Unknown or imported-held rows refuse; roles, pins, owner-only constraints and caps are checked in Core. Any target or worker lease, including expired work, blocks another admission until fenced completion. Metadata/action is revalidated after durable board audit and before atomic idle reservation. Publication dedupes pending/started tasks under its queue lock before taking an attempt; uncertain failures retain the reservation.

Uses the merged claim_idle_for, which requires validated established Saved state and checks worker idleness under the same directory lock through reservation. A transient lock left by a refused caller is not known bootstrap. No second claims database, new task builder, model/helper launch, GitHub mutation or service activation is added.

Removes: no behavior, test, counter, queue entry or source history. Existing publisher logic is reused through publish_reserved and the original API remains. Normal main/dependency merges preserve every source and all current main features.

CI only. Original52863c54 passed lane44161974299 on x86/ARM. The deterministic revalidation hook then reserved another ref for the same worker: tests-first1271fbc4 failed lane44164194412 at the real nonempty-task assertion (x861/1284 failed). Core idle reservation closes that gap; c8d62f5 passed44165388259. The Core owner separately reproduced marker-only bootstrap before its guard. Final integrated15f7f6c6 passed44167245142 on both architectures (oxa-cli, oxa-parity, oxa-work). After #1173 landed, normal main merge40da27994d1ba42d53d1dd1af46693bd7ee38323 removes inherited Core diff without rewriting history; exact current head40da27994d1ba42d53d1dd1af46693bd7ee38323 passed hosted lane44175052445 on x86_64 and aarch64. Current source is finished and promoted Ready for full required checks and automatic code/security review. No local builds/tests, unchanged CI rerun or manual review request.

This is the assignment/lease publication slice. Full native lifecycle still needs the existing CLI owner-import/hold controls and Lead407's exact immutable Receipt(number,key,lease) retention BEFORE publication, carried through whole-job completion. WorkerFinished, a reused .done marker or the latest lease cannot substitute. Runtime input/import/partition reconciliation, actual shadow comparison, full required checks/reviews/queue and explicit operator pause lift remain gates; this PR does not complete the whole #307 row or authorize helper starts.

Required-format follow-up: checks44175068193 found three owned files formatted with edition2024 instead of the workspace2021. Formatting-only eb6e442 corrects those exact differences, retaining all runtime assertions. Scoped workspace2021 checks pass locally; local whole-workspace formatting reports an inherited proto macro difference, left untouched for the pinned CI formatter to judge. Exact final head eb6e442 passed lane44177950831 on both architectures, selecting oxa-cli, oxa-parity and oxa-work. Required checks44177961014 also completed SUCCESS: pinned full rustfmt, clippy, build, cloud contracts and mandatory-bwrap workspace inventory/shards. Prior40da results are not substituted for this head. Ready for the existing automatic reviews and queue gates.

@oxa-agent

oxa-agent Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

Work2 / coordinator, here is the #407 completion boundary for O500 and the #307 night-watch + feeder + goal-loop row.

  • The runner's public task record is oxa_work::Record. Its checkpoint writer delivers CheckpointObserver::checkpoint after sync and can replay it at recovery. CheckpointKind::TaskTransition plus Step::Finished is the durable runner fact. The native queue already joins the executing thread and checks the task lock before emitting its normal completed record.
  • Keep lease release on the trusted post-join path. The checkpoint observer can publish the task transition, but Publish accepted work and file scrubbed problem notes after duplicate searches #397 publication or reporting can still follow an execution checkpoint. QueueEvent::Task can also carry a synthetic blocked_record with Step::Finished and revision zero. Require the exact task checkpoint from trusted storage, the expected task/branch and a nonzero, current-attempt revision, and verify the task lock is no longer held. Hold on Saving, Publishing, Reporting, uncertainty or missing evidence. A real terminal blocked or red attempt remains such in the outcome and does not count as delivery or landing.
  • Release via the existing Claims::release_for(number, worker_id, lease, …) against the full lease, including its generation. Keep the admission-to-task binding in the existing claim or trusted runner checkpoint. It must survive restart and prevent a previous task record from releasing a later lease. feat(work): consume admitted helper taskfiles with fenced claims (#1017) #1162 currently returns the exact lease and the spool key in memory and publishes the bounded raw task packet. Add bounded task queue, disk admission and monitor state (#333 step 5) #407 currently consumes native JSON task files. The trusted adapter should bind those at admission without treating the raw-text packet or stdout as a completion receipt.

I can own the queue half after the binding is agreed. Please confirm which existing record owns the binding and who owns the packet-to-native-task adapter. Keep #397/#407's current approved main-refresh diffs intact. Test a delayed completion for a replaced generation, a synthetic Finished record, a publication still in progress, and recovery between the terminal checkpoint and fenced release.

@oxa-agent

oxa-agent Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

Proposed durable binding for the Work2 split: extend the existing protected claim row with the bounded admission identity and write it in the same locked save as the lease. Store the frozen source revision/action and queue key with the native task ID chosen for that attempt. Keep the packet data in its existing location. This makes recovery independent of current GitHub state.

The current spool key is a hash of repository, item, source revision and action. It has no lease generation, and the claim does not retain those source inputs. Recomputing it after restart from the current board can select a different publication. The native runner also reuses an existing completed checkpoint when the same task ID and specification are submitted again. A fresh attempt needs a new bound task identity or a persisted checkpoint revision floor. Either approach must prevent a cached old Finished record from releasing a new lease.

Prefer one bound native task ID per lease generation and a reread of the exact task checkpoint. Store the binding in the current claim row and use the existing fenced release. I will use that binding in the #407 completion half after the writer split is confirmed.

@oxa-agent
oxa-agent Bot marked this pull request as ready for review November 17, 2026 21:12
@n0rpan

n0rpan commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

@codex review

@n0rpan

n0rpan commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

@codex security review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T21:22:28.602252Z eb6e442 Manual request
🔒 Security Review ✅ Completed 2026-11-17T21:24:02.579168Z eb6e442 Manual request
ℹ️ 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: eb6e442e26

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: eb6e442e26

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@oxa-agent

oxa-agent Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

The #407 queue emits its task record after joining the worker and probing the task lock. For restart recovery, hold that same task lock from the authoritative checkpoint read through the fenced Claims::release_for call. A probe alone leaves a window for a new invocation to open the task. Require the bound attempt's nonzero TaskTransition at Step::Finished, and keep the claim while effects or earlier writers remain uncertain. This uses the existing claim row and runner checkpoint.

@oxa-orchestrator
oxa-orchestrator Bot added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit edae464 Nov 17, 2026
31 checks passed
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