Skip to content

docs(design): fix 1 Kilo + 5 CodeRabbit security findings on cross-user-collab spec#2024

Merged
jaylfc merged 1 commit into
jaylfc:docs/cross-user-collab-specfrom
hognek:fix/cross-user-collab-bot-findings
Jul 18, 2026
Merged

docs(design): fix 1 Kilo + 5 CodeRabbit security findings on cross-user-collab spec#2024
jaylfc merged 1 commit into
jaylfc:docs/cross-user-collab-specfrom
hognek:fix/cross-user-collab-bot-findings

Conversation

@hognek

@hognek hognek commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Task: t_ad230474. Fixes findings on #2011.

Addresses all 6 bot findings from the #2011 review:

CodeRabbit findings

  1. Handshake replay protection (line 124): Added canonical envelope serialization, audience binding, freshness window on ts (300s), and persistent replay cache keyed by (contact_id, kind, nonce).
  2. Peer-token vs. project-level authorization (line 131): Added requirement that per-operation peer requests carrying a project_id must verify active member_kind="human" membership, beyond just contact identity.
  3. Fail-closed revocation checks (line 255): Added runtime check on every delegated request (sponsor-contact status + project membership), not just token issuance. Queued outbox purged, in-flight tasks unclaimed atomically on revoke.
  4. Project-bound claims (line 251): Added requirement that project_tasks and canvas_read grants carry non-null, owner-validated, immutable project_id in the minted JWT.
  5. Message deduplication constraint (line 328): Added atomic uniqueness constraint on (contact_id, channel_id, remote_msg_id), insert-before-ack, conflict = successful duplicate.

Kilo finding

  1. project.visibility clarification (line 524): Changed from implying an existing column to explicitly noting it as a future schema addition (projects.visibility TEXT DEFAULT 'private').

Tests: N/A (docs-only, no code changes).

…s-user-collab spec

CR #1 — Add replay protection, canonical serialization, audience binding,
freshness window, and persistent replay cache to envelope handshake (line 124).

CR #2 — Add peer-token vs. project-level authorization: contact identity
authenticates the route family, but per-operation project membership,
policy, and channel membership are independently enforced (line 131).

CR jaylfc#3 — Add fail-closed runtime checks on every delegated request: verify
current sponsor-contact status and project membership at call time, not
just at token issuance; purge outbox and unclaim in-flight tasks on revoke
(line 255).

CR jaylfc#4 — Require non-null, owner-validated, immutable project_id claim in
minted JWTs for project_tasks and canvas_read scopes (line 251).

CR jaylfc#5 — Require atomic uniqueness constraint on (contact_id, channel_id,
remote_msg_id) in chat_messages, insert-before-ack, treat conflicts as
successful duplicates (line 328).

Kilo #1 — Clarify project.visibility as a future schema addition
(projects.visibility TEXT DEFAULT 'private'), not an existing column on
hub posts (line 524).
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (2)
  • master
  • dev

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b921106c-e226-4100-8f40-6fb66de71c39

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@hognek
hognek marked this pull request as ready for review July 18, 2026 19:23
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@gitar-bot

gitar-bot Bot commented Jul 18, 2026

Copy link
Copy Markdown

Important

You are using the Gitar free plan. Upgrade to unlock code review, CI analysis, auto-apply, custom automations, and more.

Gitar

@kilo-code-bot

kilo-code-bot Bot commented Jul 18, 2026

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

This is a docs-only PR that clarifies the cross-user-collaboration design spec in response to the 6 prior review findings (1 Kilo + 5 CodeRabbit). The added prose correctly and consistently captures:

  • Replay protection: canonical envelope serialization, to-audience binding, 300s freshness window, persistent (contact_id, kind, nonce) replay cache (lines 121-133).
  • Separation of peer-token identity from project-level authorization, with independent enforcement of membership/policy/channel on every peer op (lines 142-149).
  • Fail-closed runtime revocation checks on every delegated request, atomic outbox purge + task unclaim (lines 264-271).
  • Project-bound, immutable project_id claims for project_tasks/canvas_read scopes (lines 274-278).
  • Atomic (contact_id, channel_id, remote_msg_id) uniqueness constraint with insert-before-ack and conflict-as-duplicate semantics (lines 356-360).
  • Clarification that projects.visibility is a future schema addition, not an existing column (lines 558-562).

No functional, security, or logic defects were introduced. The changes are confined to prose and accurately reflect the intended security posture. Minor cosmetic punctuation/line-wrap inconsistencies (e.g. em-dash vs hyphen, the wrapped line 559) are stylistic only and do not affect correctness.

Files Reviewed (1 file)
  • docs/design/cross-user-collaboration.md

Reviewed by hy3:free · Input: 36.5K · Output: 1.5K · Cached: 106.1K

@jaylfc
jaylfc merged commit f261ab8 into jaylfc:docs/cross-user-collab-spec Jul 18, 2026
6 checks passed
jaylfc added a commit that referenced this pull request Jul 18, 2026
* docs(design): cross-user collaboration spec (contacts, human collaborators, agent delegation, human DM)

Flagship epic: add another taOS user as a contact (hub friend edge), invite
them as a human project collaborator, receive their delegated agents (normal
external-selfjoin identities tagged with a sponsor contact), and chat
human-to-human over an instance-to-instance peer channel. Rides the shipped
invite/consent/registry rails; rejects registry-abuse and bus-federation.
Phased plan with a pilot-first path (hogne) and lanes for lead/hognek/fleet.
Awaiting owner decisions (section 10).

* docs(design): add Milestone F - collaborator community view (stats, leaderboard, live kanban, community chat)

When a user collaborates on a remote project, their Projects app gets a rich
read-mostly community view (a mini social-GitHub for the shared project) so
they see their contribution/involvement and feel part of the team. Introduces
a scoped read-only project projection served over the peer channel (never
direct API access, never sensitive fields) - the read counterpart to the
write-delegation in Milestone D. Refines Decision 2: rich read surface, still
zero board/file write for the human. Member-scoped in v1; public view a later
toggle on the same machinery.

* docs(design): address 1 Kilo + 5 CodeRabbit security findings on cross-user-collab spec (#2024)

CR #1 — Add replay protection, canonical serialization, audience binding,
freshness window, and persistent replay cache to envelope handshake (line 124).

CR #2 — Add peer-token vs. project-level authorization: contact identity
authenticates the route family, but per-operation project membership,
policy, and channel membership are independently enforced (line 131).

CR #3 — Add fail-closed runtime checks on every delegated request: verify
current sponsor-contact status and project membership at call time, not
just at token issuance; purge outbox and unclaim in-flight tasks on revoke
(line 255).

CR #4 — Require non-null, owner-validated, immutable project_id claim in
minted JWTs for project_tasks and canvas_read scopes (line 251).

CR #5 — Require atomic uniqueness constraint on (contact_id, channel_id,
remote_msg_id) in chat_messages, insert-before-ack, treat conflicts as
successful duplicates (line 328).

Kilo #1 — Clarify project.visibility as a future schema addition
(projects.visibility TEXT DEFAULT 'private'), not an existing column on
hub posts (line 524).

Co-authored-by: Hogne <227774406+hognek@users.noreply.github.com>

---------

Co-authored-by: hognek <hognek@gmail.com>
Co-authored-by: Hogne <227774406+hognek@users.noreply.github.com>
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.

2 participants