Skip to content

docs(agent-ops): close late ledger review gaps - #109

Merged
JustAGhosT merged 4 commits into
mainfrom
fix/ledger-late-review
Aug 14, 2026
Merged

docs(agent-ops): close late ledger review gaps#109
JustAGhosT merged 4 commits into
mainfrom
fix/ledger-late-review

Conversation

@JustAGhosT

Copy link
Copy Markdown
Collaborator

Outcome

Closes five substantive Codex findings that arrived on merged PR #107 after its merge.

Contract fixes

  • separates shared MCP transport authentication from per-agent/user actor identity and fails actor-sensitive tools closed until request-scoped identity exists
  • emits observe-mode collision events only when a live lease actually conflicts
  • defines REST/MCP takeover authorization, fencing, idempotency, audit, and response semantics
  • restricts handoff acknowledgement to the recipient or current team member, with an explicitly named privileged override
  • carries immutable �videnceRevision for repository-relative evidence with REST/MCP parity

Verification

  • manual contract cross-check against SPEC-001 and current MCP shared-secret boundary
  • git diff --check

Documentation contract only; no runtime enforcement or identity mechanism is claimed as delivered.

@JustAGhosT

Copy link
Copy Markdown
Collaborator Author

@codex review

@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@JustAGhosT, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 54 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 70ce9bad-987e-4bc2-80ef-150965f42a77

📥 Commits

Reviewing files that changed from the base of the PR and between adcccfd and c879155.

📒 Files selected for processing (1)
  • docs/specs/SPEC-008-agent-ops-durable-ledger.md

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 751453b5ed

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

Comment thread docs/specs/SPEC-008-agent-ops-durable-ledger.md Outdated
Comment thread docs/specs/SPEC-008-agent-ops-durable-ledger.md Outdated
Comment thread docs/specs/SPEC-008-agent-ops-durable-ledger.md Outdated
@JustAGhosT

Copy link
Copy Markdown
Collaborator Author

@codex review

@JustAGhosT
JustAGhosT force-pushed the fix/ledger-late-review branch from a9512f3 to 2c9cb0b Compare August 14, 2026 07:56
@JustAGhosT

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2c9cb0b770

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

Comment thread docs/specs/SPEC-008-agent-ops-durable-ledger.md
@JustAGhosT

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2ae3b370c3

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

Comment thread docs/specs/SPEC-008-agent-ops-durable-ledger.md
Comment thread docs/specs/SPEC-008-agent-ops-durable-ledger.md
@JustAGhosT

Copy link
Copy Markdown
Collaborator Author

@codex review

@JustAGhosT
JustAGhosT merged commit ee8ac29 into main Aug 14, 2026
3 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c879155e20

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


`evidenceRevision` is required when `uri` is repository-relative and is normalized into `task_evidence.evidence_revision`; REST accepts the same field in the evidence request body. `takeover_task_lease` is exposed only to a validated user actor with `task.lease.takeover`, never to a shared-secret or agent-only context.

Handoff acknowledgement is recipient-scoped. For `to_actor_type = 'agent'` or `'user'`, the authenticated actor ID must equal `to_actor_id`. Only `pending -> acknowledged` or `pending -> declined` is accepted through the acknowledgement tool. A privileged human with `task.handoff.override` may perform the transition for recovery only when supplying the bounded `reason`; the event is named `handoff.acknowledgement_overridden` and never masquerades as recipient acceptance.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Map REST users to registry IDs before recipient checks

For user-addressed handoffs acknowledged through REST, this equality compares incompatible identities: creation persists the registry UUID, while the current REST actor context uses the JWT sub directly (backend/src/taskUtils.ts:14-20), with users.external_id being the field intended to hold that external subject. Unless those values coincidentally match, the intended authenticated recipient cannot acknowledge or decline the handoff; require REST actor construction to resolve the session subject to the active registry record before applying this check.

Useful? React with 👍 / 👎.

```

Handoff creation resolves every evidence ID inside the transaction and supplies the route task ID to the join row. The composite foreign keys prevent cross-task and cross-project evidence attachment. Handoff text is bounded and user-visible. It contains a summary, next action, blocker, and evidence references—not a transcript or chain of thought. A pending handoff is coordination state, not proof that the recipient accepted ownership.
Handoff creation resolves every evidence ID inside the transaction and supplies the route task ID to the join row. It also resolves `to_actor_id` against the active user or agent registry for the declared type and rejects unknown, inactive, or type-mismatched recipients with `422 invalid_handoff_recipient`; display names or request-body claims are never persisted as identity. The composite foreign keys prevent cross-task and cross-project evidence attachment. Handoff text is bounded and user-visible. It contains a summary, next action, blocker, and evidence references—not a transcript or chain of thought. A pending handoff is coordination state, not proof that the recipient accepted ownership.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject disabled agents as handoff recipients

When an agent has active = true but status = 'disabled', this rule can still accept it because the registry models those fields independently (backend/src/db/schema.ts:107-117) and allows that combination through PATCH. Such a recipient should not receive actor credentials and therefore cannot acknowledge the persisted handoff; explicitly reject status = 'disabled' in addition to inactive records and cover this state in the recipient tests.

Useful? React with 👍 / 👎.

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