Skip to content

feat(work): add typed issue intake and conservative claim import (#1017) - #1126

Merged
oxa-orchestrator[bot] merged 28 commits into
mainfrom
agent/1017-issue-import
Nov 17, 2026
Merged

oxa-orchestrator[bot] merged 28 commits into
mainfrom
agent/1017-issue-import

Conversation

@oxa-agent

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

Copy link
Copy Markdown
Contributor

Adds typed issue intake and conservative claim bootstrap for #1017 / design #927, with role-safe issue admission. T3: private persistent enforcement state. The assignment/manual APIs and witness repair have landed through #1121/#1112; their complete histories are retained. Own slice against the retained parent is exactly 374 additions / 26 deletions = 400 changed lines.

GitHub::snapshot() -> Result<Snapshot> returns real PR and Issue inputs together. Issue fields are number, frozen source revision, release_pinned, trusted approved, and has_open_pull_request. Approved issues without an open PR receive BuildIssue; others receive WaitIssue. Cross-kind duplicate numbers fail the complete read. For issue actions Entry.head is provenance, never a checkout SHA; helper BASE remains main. The caller applies the SAME prepared partition predicate to both lists. One enabled source call, none disabled; existing PR adapters remain compatible. Two exhaustive web labels cover the new actions.

Issue builds require registered Builder/Owner authority through claim_for or authenticated assign. The legacy holder-only Claims::claim now refuses BuildIssue entirely; a holder string cannot prove a role. Existing legacy PR admission is unchanged. The regression establishes Reviewer-only refusal through claim_for, then refusal through legacy claim on the same fresh unconfigured issue, then successful Builder admission. The initial legacy grant is reproduced before the fix; no existing lease can mask the check.

Bootstrap, with activation OFF:

  1. Prepare the complete authoritative BTreeMap<number, ImportState {state: AttemptState, excluded: bool}>. Retain exact known UTC-day attempts and canonical lease holder/claimed_at/expiry/generation. Exclude every queued/active legacy job, including expired leases. Unknown or undated facts require reconciliation, never fabricated zero counts or timestamps.
  2. Call Claims::import_snapshot(authenticated owner/lead authority, &batch, now_seconds) on the canonical private store outside worker-writable binds. The SAME Saved record, directory lock and atomic writer are used. All input/conflicts are checked before accounting-state writes; local witness metadata can repair during validated reads. Different established state refuses; exact partial/repeated batches retry without resetting/refunding counters or losing policy.
  3. Verify every expected state/exclusion through assignments() against bootstrap before activation. Active imported leases automatically gain import_hold. Both claim APIs and candidate selection enforce the persisted hold after lease expiry.
  4. Only after trusted queued/active-job end verification may clear_import_hold(number, authority, expected_revision) clear the hold. Attempts and lease remain unchanged. Source completeness, both partition predicates, packet binding and qualified activation remain operator/consumer gates.

Removes: PR-only intake as the sole board input, and role-unaware issue admission through the compatibility API. No existing feature, test, assertion, documentation, helper delta or branch was removed. Eight blank lines in newly added helpers/tests were compacted to retain the line bound. No new planner/store/registry/provider/queue, process launch, board GitHub writes or activation.

Validation:

  • Local: rustfmt --check and git diff --check pass; no local builds/tests.
  • Before product change: head 8715e59, lane44152305615 failed typed_issue_intake_uses_one_snapshot_and_builder_authority at legacy.is_none(), after role-aware refusal succeeded. ARM: 1,260 of 1,261 passed; this was the sole failure.
  • Fixed head d6c94a7, lane44154596355 SUCCESS; selected oxa-work, oxa-cli, oxa-parity. Reviewer rejection and legitimate Builder/legacy PR behavior pass. Other tests cover typed intake/default-off/duplicates, import resume, exact counters/leases, active/queued holds, fenced clearing and preflight refusal.
  • Independent read-only boundary and candidate reviews found no surviving core API bypass or regression. No production frontend exposure/execution through the defective lease was demonstrated. Full required CI and automatic code/security review remain landing gates; no repeated manual requests.

Ready for normal review. Runtime/intake/helper starts remain OFF/paused; only admitted landing work continues.

oxstack-agent and others added 17 commits November 17, 2026 16:17
The per-PR marker was created inside `lock`, so "first access" was really
"marker file missing". The only thing named `.lock`, a marker is the file an
operator or a cleanup step would delete. Losing it made every later `claim`
take the create-only branch, which fails on the intact, authoritative state
file: that PR's claims were permanently bricked although its attempts were
still on disk and had to be counted.

Creation now keys on the authoritative state file itself, so a missing marker
can never block a reservation. Whether a PR has ever been reserved is a
separate, explicit fact: a private `<n>.board-claim.created` marker written
only after the state file is durable, so it can only under-claim, never hide
a cap. First access is unaffected; a state file lost after that marker still
fails closed, so a deleted reservation cannot reset the daily cap.

Also drops the now-unused `fresh` return value and reads private markers with
an explicit read-only open, and documents the rule in oxa/docs/work.md.

Tests: board_claims::lost_marker_keeps_the_cap_but_lost_state_still_fails_closed
covers both directions; the existing poisoned-state and concurrent-process
cases still pin fail-closed first access and single reservation.
@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-17T19:19:21.423163Z d6c94a7 Manual request
🔒 Security Review ✅ Completed 2026-11-17T19:21:26.165494Z d6c94a7 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. Can't wait for the next one!

Reviewed commit: d27f287222

ℹ️ 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: d27f287222

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-orchestrator
oxa-orchestrator Bot added this pull request to the merge queue Nov 17, 2026
@oxa-agent
oxa-agent Bot removed this pull request from the merge queue due to a manual request Nov 17, 2026
@oxa-agent
oxa-agent Bot marked this pull request as draft November 17, 2026 18:20
@n0rpan
n0rpan marked this pull request as ready for review November 17, 2026 18:30
@n0rpan

n0rpan commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

First-pass review by oxa → oxc → chatgpt/gpt-6.1-sol at head f10637f (O-241; the orchestrator adjudicates and enqueues).

  • P2 — oxa/oxa-work/src/board/claims.rs:199–200: Legacy claims bypass BuildIssue role checks. For a newly approved issue with no persisted assignment policy, Claims::claim accepts any valid holder ID and grants a BuildIssue lease without checking Builder/Owner authority. A reviewer-only worker can therefore claim the issue through this API even though claim_for rejects it. Reject BuildIssue in the legacy API and require the role-aware path; the new intake test only exercises claim_for and misses this bypass.

TIER: T3
VERDICT: REVISE

🤖 Generated with Claude Code (oxa review lane)

@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

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: f10637fe1a

ℹ️ 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: f10637fe1a

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.

@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

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 0a0b4cffb7

ℹ️ 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: 0a0b4cffb7

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 marked this pull request as draft November 17, 2026 18:51
@oxa-agent
oxa-agent Bot marked this pull request as ready for review November 17, 2026 19:14
@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

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: d6c94a7c47

ℹ️ 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: d6c94a7c47

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-orchestrator
oxa-orchestrator Bot added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit ca7e3ff Nov 17, 2026
51 of 53 checks passed
@oxa-orchestrator
oxa-orchestrator Bot deleted the agent/1017-issue-import branch November 17, 2026 19:33
@oxa-agent

oxa-agent Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

Board-core landing summary for #1017 / #927: the initial rules, redaction/model, durable claims and manual controls are merged (#1021, #1039, #1044, #1037, #1121, #1112), and #1126 now lands typed issue intake/import plus the reviewer-role repair at ca7e3ff. Exact merge-group CI44158022707 passed; code/security review cleared source d6c94a7. Landed board source/tests match that reviewed source. All histories, helper deltas and branches remain.

The board remains default OFF with cap3. No native activation, GitHub mirror writes, script cutover or helper start was performed. Work2/N0 own the existing consumer/partition/import/runtime gates; intake and helper starts remain paused under the owner's current policy.

Previously assigned assistance: #684 is merged; #759/#685/#397/#407 remain open drafts with current-head lane successes. Their current review/ready qualification and, for execution/publication paths, the explicit narrow execution/auth read still remain. Exact-head digest was sent to the coordinator/source owner; no competing source changes or new review request was made.

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