Skip to content

feat: bind native entitlement to broker identity#641

Merged
100yenadmin merged 9 commits into
mainfrom
feat/612-broker-entitlement-binding
Jul 18, 2026
Merged

feat: bind native entitlement to broker identity#641
100yenadmin merged 9 commits into
mainfrom
feat/612-broker-entitlement-binding

Conversation

@100yenadmin

Copy link
Copy Markdown
Member

Related: #612
Related: #613
Tracker: #610

Summary

  • add the production license-store entitlement resolver at the existing single GitHub token-issuance seam
  • bind private issuance to the authenticated broker device and exact activated repository
  • carry the Keychain-owned Activation Key only through bounded stdin for activation and the fixed-origin broker HTTPS request body for private issuance
  • keep public-repository issuance independent of the license authority
  • wire the resolver into the production server dependency graph while preserving the existing broker kill switch
  • document the exact secret and rollout boundary

Bounded acceptance criteria

  1. Private/internal token issuance requires an active, unexpired, private-capable license activated for the authenticated broker device and exact requested repository.
  2. Missing, invalid, revoked, expired, wrong-device, and wrong-repository states fail closed before any installation token mint.
  3. All-public requests omit the Activation Key in the native call path and never invoke the entitlement authority.
  4. The raw Activation Key remains Keychain-owned, never enters argv/config/logs/broker storage, and is never reflected in responses.
  5. Native activation uses the broker device ID and one canonical selected repository as the license machine/repository binding.
  6. The shipping composition remains quarantined and the production broker kill switch remains off.

Explicit non-goals

Failing-first proof

  • production resolver test first failed because the resolver module did not exist
  • native license test first proved the request still used the legacy local host hash instead of the broker device ID
  • Swift contract tests first failed because neither activation nor token issuance accepted the required binding inputs

Focused validation

  • license-api entitlement + mint-path tests: 20 passed
  • license-api TypeScript build: passed
  • native activation/GitHub broker tests: 16 passed
  • AppCore activation binding test: 1 passed
  • native Core smoke: passed
  • root native-binding Vitest: passed
  • root build TypeScript no-emit compile: passed
  • secret scan: passed (777 tracked files)
  • public-claims scan: passed
  • git diff --check: passed

Broad repository validation is delegated to current-head GitHub Actions.

Agent-authored change. No secrets, customer data, runtime mutation, deployment, or release action is included.

@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Priority Level: P4/NIT (optional)

No actionable P0–P3 issues identified. The changes consistently enforce device/repository-bound entitlements, bounded Activation Key handling, fail-closed validation, and production resolver wiring. Focused validation coverage is appropriate; broad validation remains delegated to CI.

Walkthrough

The PR binds native license activation and private-repository token issuance to a Keychain-backed broker device identity and exact repository. Activation keys remain bounded to stdin and broker request handling, while production entitlement resolution validates license, device, and repository state.

Changes

Native activation and identity binding

Layer / File(s) Summary
Native activation identity contract
apps/neondiff-desktop/Sources/..., src/cli.ts, src/license.ts, apps/neondiff-desktop/Tests/..., tests/*
Desktop activation requires the production broker gate, one valid enabled repository, and a stored device identity. CLI activation validates and forwards machineId and repo, while activation keys remain on stdin.
Activation repository binding
services/license-api/src/http.ts, services/license-api/src/service.ts, services/license-api/src/store.ts, services/license-api/test/*
Activation requests require canonical repositories, reject rebinding with scope_mismatch, and preserve the original repository scope.

Broker activation-key transport

Layer / File(s) Summary
Broker activation-key transport
apps/neondiff-desktop/Sources/.../GitHubBrokerClient.swift, services/license-api/src/github-broker/service.ts, services/license-api/test/*
Token issuance optionally includes a validated activation key, passes it through the in-memory entitlement context, and continues to skip entitlement resolution for public-only requests.

Production entitlement resolution

Layer / File(s) Summary
Production entitlement resolution
services/license-api/src/github-broker/*, services/license-api/src/server.ts, services/license-api/test/*
A LicenseStore resolver validates license status, activation-key hashing, broker device binding, private coverage, and exact repository scope before issuing tokens.

Rollout and boundary documentation

Layer / File(s) Summary
Rollout and boundary documentation
README.md, docs/*
Documentation records bounded key channels, identity and repository binding, public-request behavior, rollout kill-switch status, and remaining legacy identity paths.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant DesktopActivationLicenseClient
  participant NeonDiffCLI
  participant LicenseAPI
  participant GitHubBrokerClient
  participant GitHubBrokerService
  participant LicenseStore

  DesktopActivationLicenseClient->>NeonDiffCLI: activate with machineId and repo
  DesktopActivationLicenseClient->>NeonDiffCLI: send activation key via stdin
  NeonDiffCLI->>LicenseAPI: submit licenseKey, machineId, and repo
  GitHubBrokerClient->>GitHubBrokerService: request token with activationKey and repositories
  GitHubBrokerService->>LicenseStore: validate device, license, and repository entitlement
  LicenseStore-->>GitHubBrokerService: entitlement result
  GitHubBrokerService-->>GitHubBrokerClient: minted token or rejection
Loading

Possibly related issues

  • electricsheephq/evaos-code-review-bot-neondiff#612 — Covers the native activation and entitlement handoff implemented here.
  • electricsheephq/evaos-code-review-bot-neondiff#613 — Covers the managed GitHub App broker and device/repository-bound token flow.

Possibly related PRs

Suggested labels: review-policy

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 9.09% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: binding native entitlement to broker identity.
Description check ✅ Passed The description matches the PR: production resolver, broker-bound issuance, key-flow boundaries, rollout kill switch, and fail-closed behavior.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/612-broker-entitlement-binding

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

@coderabbitai coderabbitai Bot added the license Licensing, activation, entitlement, or commercial-boundary work label Jul 18, 2026
@evaos-code-review-bot

evaos-code-review-bot Bot commented Jul 18, 2026

Copy link
Copy Markdown

evaOS review status: completed

PR: #641 - feat: bind native entitlement to broker identity
Head: 3cc4127eceab12e36676e0e9a77c4ebe18387ba0
Updated: 2026-07-18T15:20:30.433Z

evaOS review completed for this PR head.

Automation note: agents should wait for this comment to reach completed, stale_head, closed_or_merged_before_review, skipped, or failed before treating evaOS review as settled for this head. provider_deferred means evaOS still intends to retry.

PR URL: #641

Review URL: #641 (review)

@coderabbitai coderabbitai 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.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@services/license-api/src/github-broker/license-entitlement.ts`:
- Around line 26-31: Update the expiry validation in the license entitlement
resolver around the existing license status and expiresAt predicate to fail
closed: when expiresAt is present but Date.parse returns a non-finite value,
treat the license as expired/denied. Preserve the current behavior for
explicitly expired licenses and valid timestamps, including valid future dates
remaining active.

In `@services/license-api/test/github-broker-production-entitlement.test.ts`:
- Around line 126-162: Extend the HTTPS token issuance test around startBroker
and the existing activate call with a second authorized private repository, then
request that repository using a key activated for PRIVATE_REPO. Assert the
response is denied and verify fake.createInstallationAccessToken was never
called, while preserving the existing successful issuance assertion for
PRIVATE_REPO.

In `@src/cli.ts`:
- Around line 367-369: Update the machineId construction in the CLI argument
handling to check whether args["license-machine-id"] is !== undefined rather
than relying on truthiness, ensuring empty supplied values reach
parseLicenseMachineIdArg and are rejected. Preserve omission only when the
option is absent, and add a focused CLI test covering an empty
--license-machine-id value.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 1d85135e-8b8d-4d66-848f-c58f61c9d390

📥 Commits

Reviewing files that changed from the base of the PR and between 0e6c713 and 3cc4127.

📒 Files selected for processing (21)
  • README.md
  • apps/neondiff-desktop/Sources/NeonDiffDesktopAppCore/Models/NeonDiffDesktopModel.swift
  • apps/neondiff-desktop/Sources/NeonDiffDesktopAppCore/Services/DesktopActivationLicenseClient.swift
  • apps/neondiff-desktop/Sources/NeonDiffDesktopCore/Services/ActivationLicenseClient.swift
  • apps/neondiff-desktop/Sources/NeonDiffDesktopCore/Services/GitHubBrokerClient.swift
  • apps/neondiff-desktop/Tests/NeonDiffDesktopAppCoreTests/DesktopActivationLicenseClientTests.swift
  • apps/neondiff-desktop/Tests/NeonDiffDesktopCoreTests/ActivationLicenseClientTests.swift
  • apps/neondiff-desktop/Tests/NeonDiffDesktopCoreTests/GitHubBrokerClientTests.swift
  • docs/SETUP.md
  • docs/github-app-setup.md
  • docs/license-boundary.md
  • services/license-api/src/github-broker/index.ts
  • services/license-api/src/github-broker/license-entitlement.ts
  • services/license-api/src/github-broker/service.ts
  • services/license-api/src/server.ts
  • services/license-api/test/github-broker-entitlement.test.ts
  • services/license-api/test/github-broker-production-entitlement.test.ts
  • services/license-api/test/github-broker-support.ts
  • src/cli.ts
  • src/license.ts
  • tests/license.test.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: Swift desktop smoke
  • GitHub Check: Build, test, and package
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use focused local tests or smoke checks by default; treat npm test and npm run build as broad GitHub CI checks unless reproducing CI, a focused harness is unavailable, or the user explicitly requests broad validation.

Files:

  • services/license-api/src/github-broker/index.ts
  • services/license-api/src/github-broker/license-entitlement.ts
  • tests/license.test.ts
  • services/license-api/test/github-broker-entitlement.test.ts
  • services/license-api/test/github-broker-support.ts
  • services/license-api/src/server.ts
  • services/license-api/test/github-broker-production-entitlement.test.ts
  • src/cli.ts
  • services/license-api/src/github-broker/service.ts
  • src/license.ts
docs/SETUP.md

📄 CodeRabbit inference engine (AGENTS.md)

Read and maintain docs/SETUP.md before changing installation, GitHub App, provider, daemon, or first-run behavior; keep first-run detail there.

Files:

  • docs/SETUP.md
{README.md,docs/SETUP.md,docs/github-app-setup.md}

📄 CodeRabbit inference engine (AGENTS.md)

For setup or GitHub App setup changes, update README.md, docs/SETUP.md, and docs/github-app-setup.md before claiming the first-run path is fixed.

Files:

  • docs/SETUP.md
  • docs/github-app-setup.md
  • README.md
README.md

📄 CodeRabbit inference engine (AGENTS.md)

Keep README.md as the public landing page containing product value, installation, setup, first dry-run review, safety boundaries, and links; do not put long release ledgers, raw local command dumps, un contextualized internal paths, or active sprint churn there.

Files:

  • README.md
🧠 Learnings (1)
📚 Learning: 2026-07-13T18:34:30.267Z
Learnt from: 100yenadmin
Repo: electricsheephq/evaos-code-review-bot-neondiff PR: 531
File: apps/neondiff-desktop/Sources/NeonDiffDesktop/App/NeonDiffDesktopApp.swift:204-227
Timestamp: 2026-07-13T18:34:30.267Z
Learning: In the apps/neondiff-desktop Swift codebase, avoid flagging the SwiftLint `required_deinit` issue for types that do not actually own resources needing explicit cleanup. Only require an explicit `deinit` when the class/struct owns resources that must be released (e.g., strong references that need breaking, observers/timers/event subscriptions, file handles, unmanaged/unsafe resources). For cases like AppDelegate in NeonDiffDesktopApp.swift that don’t own such cleanup requirements, do not report missing `deinit` just to satisfy the rule, especially since the repo does not currently enforce it via an owned SwiftLint config/merge gate.

Applied to files:

  • apps/neondiff-desktop/Tests/NeonDiffDesktopAppCoreTests/DesktopActivationLicenseClientTests.swift
  • apps/neondiff-desktop/Tests/NeonDiffDesktopCoreTests/GitHubBrokerClientTests.swift
  • apps/neondiff-desktop/Sources/NeonDiffDesktopAppCore/Services/DesktopActivationLicenseClient.swift
  • apps/neondiff-desktop/Sources/NeonDiffDesktopAppCore/Models/NeonDiffDesktopModel.swift
  • apps/neondiff-desktop/Tests/NeonDiffDesktopCoreTests/ActivationLicenseClientTests.swift
  • apps/neondiff-desktop/Sources/NeonDiffDesktopCore/Services/GitHubBrokerClient.swift
  • apps/neondiff-desktop/Sources/NeonDiffDesktopCore/Services/ActivationLicenseClient.swift
🪛 ast-grep (0.44.1)
src/license.ts

[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { spawnSync } from "node:child_process";
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)


[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { spawnSync } from "node:child_process";
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)


[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { spawnSync } from "node:child_process";
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)


[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { spawnSync } from "node:child_process";
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)


[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { spawnSync } from "node:child_process";
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)

🪛 LanguageTool
docs/github-app-setup.md

[uncategorized] ~62-~62: The official name of this software platform is spelled with a capital “H”.
Context: ...uth) during > installation" and set the /github/connect/callback URL; that > registrat...

(GITHUB)


[uncategorized] ~69-~69: The official name of this software platform is spelled with a capital “H”.
Context: ...ory to the license API. A later private /github/token request carries the Keychain-own...

(GITHUB)

🔇 Additional comments (19)
README.md (1)

141-147: LGTM!

docs/SETUP.md (1)

208-217: LGTM!

docs/github-app-setup.md (1)

59-76: LGTM!

docs/license-boundary.md (1)

84-91: LGTM!

apps/neondiff-desktop/Sources/NeonDiffDesktopAppCore/Models/NeonDiffDesktopModel.swift (1)

1141-1162: LGTM!

apps/neondiff-desktop/Sources/NeonDiffDesktopAppCore/Services/DesktopActivationLicenseClient.swift (1)

13-29: LGTM!

Also applies to: 50-51

apps/neondiff-desktop/Sources/NeonDiffDesktopCore/Services/ActivationLicenseClient.swift (1)

10-14: LGTM!

Also applies to: 40-49, 137-152, 174-175

src/cli.ts (1)

3315-3315: LGTM!

Also applies to: 3690-3699

src/license.ts (1)

124-125: LGTM!

Also applies to: 190-190, 216-216, 504-504, 521-521

apps/neondiff-desktop/Tests/NeonDiffDesktopAppCoreTests/DesktopActivationLicenseClientTests.swift (1)

7-35: LGTM!

apps/neondiff-desktop/Tests/NeonDiffDesktopCoreTests/ActivationLicenseClientTests.swift (1)

34-42: LGTM!

Also applies to: 88-91

tests/license.test.ts (1)

451-486: LGTM!

apps/neondiff-desktop/Sources/NeonDiffDesktopCore/Services/GitHubBrokerClient.swift (1)

529-549: LGTM!

apps/neondiff-desktop/Tests/NeonDiffDesktopCoreTests/GitHubBrokerClientTests.swift (1)

198-199: LGTM!

Also applies to: 223-223

services/license-api/src/github-broker/service.ts (1)

43-53: LGTM!

Also applies to: 360-360, 402-403, 487-503, 549-585

services/license-api/test/github-broker-entitlement.test.ts (1)

88-92: LGTM!

Also applies to: 102-105, 127-131

services/license-api/src/github-broker/index.ts (1)

28-28: LGTM!

services/license-api/src/server.ts (1)

6-6: LGTM!

Also applies to: 20-20, 43-48

services/license-api/test/github-broker-support.ts (1)

195-202: LGTM!

Comment thread services/license-api/src/github-broker/license-entitlement.ts Outdated
Comment thread src/cli.ts

@evaos-code-review-bot evaos-code-review-bot 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.

Walkthrough

PR: #641 - feat: bind native entitlement to broker identity
Head: 3cc4127eceab12e36676e0e9a77c4ebe18387ba0 into main. Review event: COMMENT.
Provider: GLM/Z.ai through ZCode (zcode-glm, zcode, model GLM-5.2).

Estimated review effort: 2/5 (~34 min)

Changed Files

File Status Churn Purpose Risk
README.md modified +7/-0 Documentation Low
docs/SETUP.md modified +10/-0 Documentation Moderate: validated P2 finding
docs/github-app-setup.md modified +15/-3 Documentation Low
docs/license-boundary.md modified +8/-0 Documentation Low
src/cli.ts modified +15/-0 Runtime code Moderate: validated P3 finding
src/license.ts modified +6/-1 Runtime code Moderate: runtime path
tests/license.test.ts modified +37/-0 Test coverage Moderate: validated P2 finding

Review Signal

Validated inline findings: 3 (P0: 0, P1: 0, P2: 2, P3: 1).
Dropped findings before posting: 2. High-severity findings: 0.

Risk Taxonomy

  • Data loss: 1
  • Proof gap: 1
  • Security boundary: 1

Validation and Proof

1 required validation/proof recommendation(s) selected from changed files.

  • required: TypeScript/web build or CI proof - Runtime TypeScript/web files or package/config files changed. Proof: npm run build; typecheck; focused Vitest; green GitHub check.
    Proof status: sufficient - PR metadata mentions acceptable proof for each required validation recommendation.
    Profile validation hints: Current-head, App-authored, no-secret, no-duplicate, and no-repo-mutation invariants outrank style feedback.
    Profile proof expectations: Require focused tests, TypeScript build, App-backed doctor, release-status proof, and launchd heartbeat before live promotion.

Related Context

Related issues/PRs: #612, #613, #610, #630, #517.
Suggested labels: docs, tests.
Suggested reviewers: none from current metadata.

Review Settings Preview

  • Profile: assertive
  • Enabled sections: Review summary (inline_review); Walkthrough (inline_review); Changed-files table (walkthrough); Effort estimate (walkthrough); Related issues/PRs (walkthrough); Suggested labels (suggestion_only); Review status comment (sticky_status)
  • Path instructions: src/github.ts - Treat GitHub App identity or token-mode regressions as high risk.
  • Path instructions: src/state.ts - Check duplicate suppression, leases, processed heads, and migration safety.
  • Path instructions: src/worker.ts - Check stale-head guards, repo mutation protection, and review posting policy.
  • Path instructions: src/zcode.ts - Check read-only ZCode policy, prompt constraints, and output parsing.
  • Label suggestions: bot, regression-hardening, release
  • Reviewer suggestions: none
  • Suggestion behavior: suggestions only; labels and reviewers are not auto-applied.
  • Roadmap-only settings: auto-apply labels; auto-request reviewers; required status checks

Pre-merge checklist

  • Inline comments target current RIGHT-side diff lines.
  • No secret-like content survived into posted inline comments.
  • REQUEST_CHANGES is only used when eligible P0/P1 findings survive validation.
  • Required behavior proof is present or not applicable.
  • Labels and reviewers are suggestions only; the bot did not auto-apply them.

Comment thread tests/license.test.ts
Comment thread docs/SETUP.md
Comment thread src/cli.ts

@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: 3cc4127ece

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

@evaos-code-review-bot

evaos-code-review-bot Bot commented Jul 18, 2026

Copy link
Copy Markdown

evaOS review status: completed

PR: #641 - feat: bind native entitlement to broker identity
Head: 6ca5c8056f200c182550846fee315a5b26ed3d23
Updated: 2026-07-18T15:35:16.100Z

evaOS review completed for this PR head.

Automation note: agents should wait for this comment to reach completed, stale_head, closed_or_merged_before_review, skipped, or failed before treating evaOS review as settled for this head. provider_deferred means evaOS still intends to retry.

PR URL: #641

Review URL: #641 (review)

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 18, 2026

@evaos-code-review-bot evaos-code-review-bot 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.

Walkthrough

PR: #641 - feat: bind native entitlement to broker identity
Head: 6ca5c8056f200c182550846fee315a5b26ed3d23 into main. Review event: COMMENT.
Provider: GLM/Z.ai through ZCode (zcode-glm, zcode, model GLM-5.2).

Estimated review effort: 3/5 (~44 min)

Changed Files

File Status Churn Purpose Risk
README.md modified +7/-0 Documentation Low
docs/SETUP.md modified +10/-0 Documentation Low
docs/github-app-setup.md modified +15/-3 Documentation Low
docs/license-boundary.md modified +8/-0 Documentation Low
src/cli.ts modified +15/-0 Runtime code Moderate: runtime path
src/license.ts modified +6/-1 Runtime code Elevated: validated P1 finding
tests/license.test.ts modified +37/-0 Test coverage Moderate: validated P2 finding

Review Signal

Validated inline findings: 3 (P0: 0, P1: 1, P2: 2, P3: 0).
Dropped findings before posting: 0. High-severity findings: 1.

Risk Taxonomy

  • Proof gap: 1
  • Runtime correctness: 1
  • Security boundary: 1

Validation and Proof

1 required validation/proof recommendation(s) selected from changed files.

  • required: TypeScript/web build or CI proof - Runtime TypeScript/web files or package/config files changed. Proof: npm run build; typecheck; focused Vitest; green GitHub check.
    Proof status: sufficient - PR metadata mentions acceptable proof for each required validation recommendation.
    Profile validation hints: Current-head, App-authored, no-secret, no-duplicate, and no-repo-mutation invariants outrank style feedback.
    Profile proof expectations: Require focused tests, TypeScript build, App-backed doctor, release-status proof, and launchd heartbeat before live promotion.

Related Context

Related issues/PRs: #612, #613, #610, #630, #517.
Suggested labels: bug, docs, tests.
Suggested reviewers: none from current metadata.

Review Settings Preview

  • Profile: assertive
  • Enabled sections: Review summary (inline_review); Walkthrough (inline_review); Changed-files table (walkthrough); Effort estimate (walkthrough); Related issues/PRs (walkthrough); Suggested labels (suggestion_only); Review status comment (sticky_status)
  • Path instructions: src/github.ts - Treat GitHub App identity or token-mode regressions as high risk.
  • Path instructions: src/state.ts - Check duplicate suppression, leases, processed heads, and migration safety.
  • Path instructions: src/worker.ts - Check stale-head guards, repo mutation protection, and review posting policy.
  • Path instructions: src/zcode.ts - Check read-only ZCode policy, prompt constraints, and output parsing.
  • Label suggestions: bot, regression-hardening, release
  • Reviewer suggestions: none
  • Suggestion behavior: suggestions only; labels and reviewers are not auto-applied.
  • Roadmap-only settings: auto-apply labels; auto-request reviewers; required status checks

Pre-merge checklist

  • Inline comments target current RIGHT-side diff lines.
  • No secret-like content survived into posted inline comments.
  • REQUEST_CHANGES is only used when eligible P0/P1 findings survive validation.
  • Required behavior proof is present or not applicable.
  • Labels and reviewers are suggestions only; the bot did not auto-apply them.

Comment thread src/license.ts
Comment thread src/license.ts
Comment thread tests/license.test.ts
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 18, 2026
@evaos-code-review-bot

evaos-code-review-bot Bot commented Jul 18, 2026

Copy link
Copy Markdown

evaOS review status: completed

PR: #641 - feat: bind native entitlement to broker identity
Head: 8bc02cf9bc9cc3a02f21d5ddcf41d30fb9c4b407
Updated: 2026-07-18T15:49:18.027Z

evaOS review completed for this PR head.

Automation note: agents should wait for this comment to reach completed, stale_head, closed_or_merged_before_review, skipped, or failed before treating evaOS review as settled for this head. provider_deferred means evaOS still intends to retry.

PR URL: #641

Review URL: #641 (review)

@evaos-code-review-bot evaos-code-review-bot 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.

Walkthrough

PR: #641 - feat: bind native entitlement to broker identity
Head: 8bc02cf9bc9cc3a02f21d5ddcf41d30fb9c4b407 into main. Review event: COMMENT.
Provider: GLM/Z.ai through ZCode (zcode-glm, zcode, model GLM-5.2).

Estimated review effort: 3/5 (~46 min)

Changed Files

File Status Churn Purpose Risk
README.md modified +9/-0 Documentation Low
docs/SETUP.md modified +12/-0 Documentation Low
docs/github-app-setup.md modified +17/-3 Documentation Low
docs/license-boundary.md modified +10/-0 Documentation Low
src/cli.ts modified +15/-0 Runtime code Moderate: validated P3 finding
src/license.ts modified +16/-1 Runtime code Moderate: runtime path
tests/license.test.ts modified +76/-0 Test coverage Moderate: validated P3 finding
tests/public-cli.test.ts modified +4/-0 Test coverage Low

Review Signal

Validated inline findings: 2 (P0: 0, P1: 0, P2: 0, P3: 2).
Dropped findings before posting: 0. High-severity findings: 0.

Risk Taxonomy

  • API compatibility: 1
  • Proof gap: 1

Validation and Proof

1 required validation/proof recommendation(s) selected from changed files.

  • required: TypeScript/web build or CI proof - Runtime TypeScript/web files or package/config files changed. Proof: npm run build; typecheck; focused Vitest; green GitHub check.
    Proof status: sufficient - PR metadata mentions acceptable proof for each required validation recommendation.
    Profile validation hints: Current-head, App-authored, no-secret, no-duplicate, and no-repo-mutation invariants outrank style feedback.
    Profile proof expectations: Require focused tests, TypeScript build, App-backed doctor, release-status proof, and launchd heartbeat before live promotion.

Related Context

Related issues/PRs: #612, #613, #610, #630, #517.
Suggested labels: docs, tests.
Suggested reviewers: none from current metadata.

Review Settings Preview

  • Profile: assertive
  • Enabled sections: Review summary (inline_review); Walkthrough (inline_review); Changed-files table (walkthrough); Effort estimate (walkthrough); Related issues/PRs (walkthrough); Suggested labels (suggestion_only); Review status comment (sticky_status)
  • Path instructions: src/github.ts - Treat GitHub App identity or token-mode regressions as high risk.
  • Path instructions: src/state.ts - Check duplicate suppression, leases, processed heads, and migration safety.
  • Path instructions: src/worker.ts - Check stale-head guards, repo mutation protection, and review posting policy.
  • Path instructions: src/zcode.ts - Check read-only ZCode policy, prompt constraints, and output parsing.
  • Label suggestions: bot, regression-hardening, release
  • Reviewer suggestions: none
  • Suggestion behavior: suggestions only; labels and reviewers are not auto-applied.
  • Roadmap-only settings: auto-apply labels; auto-request reviewers; required status checks

Pre-merge checklist

  • Inline comments target current RIGHT-side diff lines.
  • No secret-like content survived into posted inline comments.
  • REQUEST_CHANGES is only used when eligible P0/P1 findings survive validation.
  • Required behavior proof is present or not applicable.
  • Labels and reviewers are suggestions only; the bot did not auto-apply them.

Comment thread src/cli.ts
Comment thread tests/license.test.ts
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 18, 2026

@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: 8bc02cf9bc

ℹ️ 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 services/license-api/src/github-broker/license-entitlement.ts
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 18, 2026
@evaos-code-review-bot

evaos-code-review-bot Bot commented Jul 18, 2026

Copy link
Copy Markdown

evaOS review status: completed

PR: #641 - feat: bind native entitlement to broker identity
Head: 3f0252e0ee2ed3430524735d771771d975d54f5e
Updated: 2026-07-18T16:12:03.134Z

evaOS review completed for this PR head.

Automation note: agents should wait for this comment to reach completed, stale_head, closed_or_merged_before_review, skipped, or failed before treating evaOS review as settled for this head. provider_deferred means evaOS still intends to retry.

PR URL: #641

Review URL: #641 (review)

@evaos-code-review-bot evaos-code-review-bot 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.

Walkthrough

PR: #641 - feat: bind native entitlement to broker identity
Head: 3f0252e0ee2ed3430524735d771771d975d54f5e into main. Review event: COMMENT.
Provider: GLM/Z.ai through ZCode (zcode-glm, zcode, model GLM-5.2).

Estimated review effort: 3/5 (~46 min)

Changed Files

File Status Churn Purpose Risk
README.md modified +9/-0 Documentation Low
docs/SETUP.md modified +12/-0 Documentation Low
docs/github-app-setup.md modified +17/-3 Documentation Low
docs/license-boundary.md modified +10/-0 Documentation Low
src/cli.ts modified +19/-1 Runtime code Moderate: validated P3 finding
src/license.ts modified +16/-1 Runtime code Moderate: runtime path
tests/license.test.ts modified +76/-0 Test coverage Low
tests/public-cli.test.ts modified +37/-28 Test coverage Low

Review Signal

Validated inline findings: 1 (P0: 0, P1: 0, P2: 0, P3: 1).
Dropped findings before posting: 0. High-severity findings: 0.

Risk Taxonomy

  • Runtime correctness: 1

Validation and Proof

1 required validation/proof recommendation(s) selected from changed files.

  • required: TypeScript/web build or CI proof - Runtime TypeScript/web files or package/config files changed. Proof: npm run build; typecheck; focused Vitest; green GitHub check.
    Proof status: sufficient - PR metadata mentions acceptable proof for each required validation recommendation.
    Profile validation hints: Current-head, App-authored, no-secret, no-duplicate, and no-repo-mutation invariants outrank style feedback.
    Profile proof expectations: Require focused tests, TypeScript build, App-backed doctor, release-status proof, and launchd heartbeat before live promotion.

Related Context

Related issues/PRs: #612, #613, #610, #630, #517.
Suggested labels: docs, tests.
Suggested reviewers: none from current metadata.

Review Settings Preview

  • Profile: assertive
  • Enabled sections: Review summary (inline_review); Walkthrough (inline_review); Changed-files table (walkthrough); Effort estimate (walkthrough); Related issues/PRs (walkthrough); Suggested labels (suggestion_only); Review status comment (sticky_status)
  • Path instructions: src/github.ts - Treat GitHub App identity or token-mode regressions as high risk.
  • Path instructions: src/state.ts - Check duplicate suppression, leases, processed heads, and migration safety.
  • Path instructions: src/worker.ts - Check stale-head guards, repo mutation protection, and review posting policy.
  • Path instructions: src/zcode.ts - Check read-only ZCode policy, prompt constraints, and output parsing.
  • Label suggestions: bot, regression-hardening, release
  • Reviewer suggestions: none
  • Suggestion behavior: suggestions only; labels and reviewers are not auto-applied.
  • Roadmap-only settings: auto-apply labels; auto-request reviewers; required status checks

Pre-merge checklist

  • Inline comments target current RIGHT-side diff lines.
  • No secret-like content survived into posted inline comments.
  • REQUEST_CHANGES is only used when eligible P0/P1 findings survive validation.
  • Required behavior proof is present or not applicable.
  • Labels and reviewers are suggestions only; the bot did not auto-apply them.

Comment thread src/cli.ts

@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: 3f0252e0ee

ℹ️ 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 src/cli.ts
Comment thread src/license.ts Outdated
@evaos-code-review-bot

evaos-code-review-bot Bot commented Jul 18, 2026

Copy link
Copy Markdown

evaOS review status: completed

PR: #641 - feat: bind native entitlement to broker identity
Head: c091c25e13f7f9fb4000602a0af37bfd72244ec5
Updated: 2026-07-18T16:25:39.175Z

evaOS review completed for this PR head.

Automation note: agents should wait for this comment to reach completed, stale_head, closed_or_merged_before_review, skipped, or failed before treating evaOS review as settled for this head. provider_deferred means evaOS still intends to retry.

PR URL: #641

Review URL: #641 (review)

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@README.md`:
- Line 149: Rephrase the paragraph beginning with “#630” so it starts with
descriptive text, such as “Issue `#630` must wire those runtime callers before the
managed path can be enabled,” preventing markdownlint MD018 from interpreting
the issue reference as a heading marker.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: bdd6b149-ce6e-4b0e-9b11-bdee532d12db

📥 Commits

Reviewing files that changed from the base of the PR and between 3cc4127 and c091c25.

📒 Files selected for processing (10)
  • README.md
  • docs/SETUP.md
  • docs/github-app-setup.md
  • docs/license-boundary.md
  • services/license-api/src/github-broker/license-entitlement.ts
  • services/license-api/test/github-broker-production-entitlement.test.ts
  • src/cli.ts
  • src/license.ts
  • tests/license.test.ts
  • tests/public-cli.test.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (3)
  • GitHub Check: Swift desktop smoke
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Build, test, and package
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use focused local tests or smoke checks by default; treat npm test and npm run build as broad GitHub CI checks unless reproducing CI, a focused harness is unavailable, or the user explicitly requests broad validation.

Files:

  • tests/public-cli.test.ts
  • src/cli.ts
  • services/license-api/test/github-broker-production-entitlement.test.ts
  • tests/license.test.ts
  • src/license.ts
  • services/license-api/src/github-broker/license-entitlement.ts
README.md

📄 CodeRabbit inference engine (AGENTS.md)

Keep README.md as the public landing page containing product value, installation, setup, first dry-run review, safety boundaries, and links; do not put long release ledgers, raw local command dumps, un contextualized internal paths, or active sprint churn there.

Files:

  • README.md
{README.md,docs/SETUP.md,docs/github-app-setup.md}

📄 CodeRabbit inference engine (AGENTS.md)

For setup or GitHub App setup changes, update README.md, docs/SETUP.md, and docs/github-app-setup.md before claiming the first-run path is fixed.

Files:

  • README.md
  • docs/SETUP.md
  • docs/github-app-setup.md
docs/SETUP.md

📄 CodeRabbit inference engine (AGENTS.md)

Read and maintain docs/SETUP.md before changing installation, GitHub App, provider, daemon, or first-run behavior; keep first-run detail there.

Files:

  • docs/SETUP.md
🧠 Learnings (1)
📚 Learning: 2026-07-18T15:32:32.800Z
Learnt from: 100yenadmin
Repo: electricsheephq/evaos-code-review-bot-neondiff PR: 641
File: services/license-api/test/github-broker-production-entitlement.test.ts:136-172
Timestamp: 2026-07-18T15:32:32.800Z
Learning: In the TypeScript GitHub broker entitlement flow tests under services/license-api/test, it’s acceptable to keep the coverage split across the existing “production license-store repo binding” assertion and the separate “HTTPS authorization/mint boundary” assertion. Treat the seam between resolver output and mint authorization as covered as long as there is no new transformation or bypass introduced between the resolver output and the mint/authorization step.

Specifically, retain the pattern where: (1) the wrong requested private repository results in `{ status: "active", coveredPrivateRepositories: [] }`, and (2) when there is empty active coverage the system denies with `entitlement_scope_insufficient` and makes zero `createInstallationAccessToken` calls. Only flag as under-tested if the change adds a new mapping/filtering/caching step or alternative path between resolver output and mint authorization.

Applied to files:

  • services/license-api/test/github-broker-production-entitlement.test.ts
🪛 ast-grep (0.44.1)
tests/public-cli.test.ts

[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { execFile } from "node:child_process";
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)

src/license.ts

[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { spawnSync } from "node:child_process";
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)

🪛 markdownlint-cli2 (0.23.0)
README.md

[warning] 149-149: No space after hash on atx style heading

(MD018, no-missing-space-atx)

🔇 Additional comments (9)
docs/SETUP.md (1)

208-218: LGTM!

docs/github-app-setup.md (1)

55-77: LGTM!

docs/license-boundary.md (1)

84-92: LGTM!

src/cli.ts (1)

361-370: LGTM!

Also applies to: 3623-3644

src/license.ts (1)

120-259: LGTM!

Also applies to: 534-534

tests/license.test.ts (1)

426-427: LGTM!

Also applies to: 453-540, 626-627

services/license-api/src/github-broker/license-entitlement.ts (1)

15-53: LGTM!

services/license-api/test/github-broker-production-entitlement.test.ts (1)

77-110: LGTM!

Also applies to: 145-176

tests/public-cli.test.ts (1)

150-150: 🎯 Functional Correctness

No duplicate failure declarations here. The loop declares failure once and assigns it in the catch; there’s no duplicate block-scoped declaration in this block. Confidence 98%.

			> Likely an incorrect or invalid review comment.

Comment thread README.md

@evaos-code-review-bot evaos-code-review-bot 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.

Walkthrough

PR: #641 - feat: bind native entitlement to broker identity
Head: c091c25e13f7f9fb4000602a0af37bfd72244ec5 into main. Review event: COMMENT.
Provider: GLM/Z.ai through ZCode (zcode-glm, zcode, model GLM-5.2).

Estimated review effort: 4/5 (~56 min)

Changed Files

File Status Churn Purpose Risk
README.md modified +9/-0 Documentation Low
docs/SETUP.md modified +12/-0 Documentation Low
docs/github-app-setup.md modified +17/-3 Documentation Low
docs/license-boundary.md modified +10/-0 Documentation Low
src/cli.ts modified +19/-1 Runtime code Moderate: validated P2 finding
src/license.ts modified +36/-1 Runtime code Moderate: runtime path
tests/license.test.ts modified +130/-0 Test coverage Low
tests/public-cli.test.ts modified +37/-28 Test coverage Moderate: validated P3 finding

Review Signal

Validated inline findings: 2 (P0: 0, P1: 0, P2: 1, P3: 1).
Dropped findings before posting: 0. High-severity findings: 0.

Risk Taxonomy

  • Auth: 1
  • Runtime correctness: 1

Validation and Proof

1 required validation/proof recommendation(s) selected from changed files.

  • required: TypeScript/web build or CI proof - Runtime TypeScript/web files or package/config files changed. Proof: npm run build; typecheck; focused Vitest; green GitHub check.
    Proof status: sufficient - PR metadata mentions acceptable proof for each required validation recommendation.
    Profile validation hints: Current-head, App-authored, no-secret, no-duplicate, and no-repo-mutation invariants outrank style feedback.
    Profile proof expectations: Require focused tests, TypeScript build, App-backed doctor, release-status proof, and launchd heartbeat before live promotion.

Related Context

Related issues/PRs: #612, #613, #610, #630, #517.
Suggested labels: docs, tests.
Suggested reviewers: none from current metadata.

Review Settings Preview

  • Profile: assertive
  • Enabled sections: Review summary (inline_review); Walkthrough (inline_review); Changed-files table (walkthrough); Effort estimate (walkthrough); Related issues/PRs (walkthrough); Suggested labels (suggestion_only); Review status comment (sticky_status)
  • Path instructions: src/github.ts - Treat GitHub App identity or token-mode regressions as high risk.
  • Path instructions: src/state.ts - Check duplicate suppression, leases, processed heads, and migration safety.
  • Path instructions: src/worker.ts - Check stale-head guards, repo mutation protection, and review posting policy.
  • Path instructions: src/zcode.ts - Check read-only ZCode policy, prompt constraints, and output parsing.
  • Label suggestions: bot, regression-hardening, release
  • Reviewer suggestions: none
  • Suggestion behavior: suggestions only; labels and reviewers are not auto-applied.
  • Roadmap-only settings: auto-apply labels; auto-request reviewers; required status checks

Pre-merge checklist

  • Inline comments target current RIGHT-side diff lines.
  • No secret-like content survived into posted inline comments.
  • REQUEST_CHANGES is only used when eligible P0/P1 findings survive validation.
  • Required behavior proof is present or not applicable.
  • Labels and reviewers are suggestions only; the bot did not auto-apply them.

Comment thread src/cli.ts
Comment thread tests/public-cli.test.ts Outdated
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 18, 2026

@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: c091c25e13

ℹ️ 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 services/license-api/src/github-broker/license-entitlement.ts
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 18, 2026
@evaos-code-review-bot

evaos-code-review-bot Bot commented Jul 18, 2026

Copy link
Copy Markdown

evaOS review status: completed

PR: #641 - feat: bind native entitlement to broker identity
Head: 24c57e081762ec6e2959953d4aa9476f4da47aa5
Updated: 2026-07-18T16:48:06.499Z

evaOS review completed for this PR head.

Automation note: agents should wait for this comment to reach completed, stale_head, closed_or_merged_before_review, skipped, or failed before treating evaOS review as settled for this head. provider_deferred means evaOS still intends to retry.

PR URL: #641

Review URL: #641 (review)

@evaos-code-review-bot evaos-code-review-bot 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.

Walkthrough

PR: #641 - feat: bind native entitlement to broker identity
Head: 24c57e081762ec6e2959953d4aa9476f4da47aa5 into main. Review event: COMMENT.
Provider: GLM/Z.ai through ZCode (zcode-glm, zcode, model GLM-5.2).

Estimated review effort: 4/5 (~56 min)

Changed Files

File Status Churn Purpose Risk
README.md modified +9/-0 Documentation Low
docs/SETUP.md modified +12/-0 Documentation Low
docs/github-app-setup.md modified +17/-3 Documentation Low
docs/license-boundary.md modified +10/-0 Documentation Low
src/cli.ts modified +19/-1 Runtime code Moderate: validated P3 finding
src/license.ts modified +36/-1 Runtime code Moderate: runtime path
tests/license.test.ts modified +130/-0 Test coverage Low
tests/public-cli.test.ts modified +37/-28 Test coverage Moderate: validated P3 finding

Review Signal

Validated inline findings: 2 (P0: 0, P1: 0, P2: 0, P3: 2).
Dropped findings before posting: 0. High-severity findings: 0.

Risk Taxonomy

  • Runtime correctness: 1
  • Security boundary: 1

Validation and Proof

1 required validation/proof recommendation(s) selected from changed files.

  • required: TypeScript/web build or CI proof - Runtime TypeScript/web files or package/config files changed. Proof: npm run build; typecheck; focused Vitest; green GitHub check.
    Proof status: sufficient - PR metadata mentions acceptable proof for each required validation recommendation.
    Profile validation hints: Current-head, App-authored, no-secret, no-duplicate, and no-repo-mutation invariants outrank style feedback.
    Profile proof expectations: Require focused tests, TypeScript build, App-backed doctor, release-status proof, and launchd heartbeat before live promotion.

Related Context

Related issues/PRs: #612, #613, #610, #630, #517.
Suggested labels: docs, tests.
Suggested reviewers: none from current metadata.

Review Settings Preview

  • Profile: assertive
  • Enabled sections: Review summary (inline_review); Walkthrough (inline_review); Changed-files table (walkthrough); Effort estimate (walkthrough); Related issues/PRs (walkthrough); Suggested labels (suggestion_only); Review status comment (sticky_status)
  • Path instructions: src/github.ts - Treat GitHub App identity or token-mode regressions as high risk.
  • Path instructions: src/state.ts - Check duplicate suppression, leases, processed heads, and migration safety.
  • Path instructions: src/worker.ts - Check stale-head guards, repo mutation protection, and review posting policy.
  • Path instructions: src/zcode.ts - Check read-only ZCode policy, prompt constraints, and output parsing.
  • Label suggestions: bot, regression-hardening, release
  • Reviewer suggestions: none
  • Suggestion behavior: suggestions only; labels and reviewers are not auto-applied.
  • Roadmap-only settings: auto-apply labels; auto-request reviewers; required status checks

Pre-merge checklist

  • Inline comments target current RIGHT-side diff lines.
  • No secret-like content survived into posted inline comments.
  • REQUEST_CHANGES is only used when eligible P0/P1 findings survive validation.
  • Required behavior proof is present or not applicable.
  • Labels and reviewers are suggestions only; the bot did not auto-apply them.

Comment thread src/cli.ts
Comment thread tests/public-cli.test.ts

@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: 24c57e0817

ℹ️ 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 src/license.ts Outdated
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 18, 2026
@evaos-code-review-bot

evaos-code-review-bot Bot commented Jul 18, 2026

Copy link
Copy Markdown

evaOS review status: completed

PR: #641 - feat: bind native entitlement to broker identity
Head: 204fdafbcd578fb0013752de2e728b6448009a87
Updated: 2026-07-18T17:10:45.849Z

evaOS review completed for this PR head.

Automation note: agents should wait for this comment to reach completed, stale_head, closed_or_merged_before_review, skipped, or failed before treating evaOS review as settled for this head. provider_deferred means evaOS still intends to retry.

PR URL: #641

Review URL: #641 (review)

@evaos-code-review-bot evaos-code-review-bot 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.

Walkthrough

PR: #641 - feat: bind native entitlement to broker identity
Head: 204fdafbcd578fb0013752de2e728b6448009a87 into main. Review event: COMMENT.
Provider: GLM/Z.ai through ZCode (zcode-glm, zcode, model GLM-5.2).

Estimated review effort: 4/5 (~56 min)

Changed Files

File Status Churn Purpose Risk
README.md modified +9/-0 Documentation Low
docs/SETUP.md modified +12/-0 Documentation Low
docs/github-app-setup.md modified +17/-3 Documentation Low
docs/license-boundary.md modified +10/-0 Documentation Low
src/cli.ts modified +19/-1 Runtime code Moderate: validated P3 finding
src/license.ts modified +46/-1 Runtime code Moderate: validated P3 finding
tests/license.test.ts modified +166/-0 Test coverage Low
tests/public-cli.test.ts modified +37/-28 Test coverage Moderate: validated P3 finding

Review Signal

Validated inline findings: 3 (P0: 0, P1: 0, P2: 0, P3: 3).
Dropped findings before posting: 0. High-severity findings: 0.

Risk Taxonomy

  • Auth: 1
  • Runtime correctness: 1
  • Security boundary: 1

Validation and Proof

1 required validation/proof recommendation(s) selected from changed files.

  • required: TypeScript/web build or CI proof - Runtime TypeScript/web files or package/config files changed. Proof: npm run build; typecheck; focused Vitest; green GitHub check.
    Proof status: sufficient - PR metadata mentions acceptable proof for each required validation recommendation.
    Profile validation hints: Current-head, App-authored, no-secret, no-duplicate, and no-repo-mutation invariants outrank style feedback.
    Profile proof expectations: Require focused tests, TypeScript build, App-backed doctor, release-status proof, and launchd heartbeat before live promotion.

Related Context

Related issues/PRs: #612, #613, #610, #630, #517.
Suggested labels: docs, tests.
Suggested reviewers: none from current metadata.

Review Settings Preview

  • Profile: assertive
  • Enabled sections: Review summary (inline_review); Walkthrough (inline_review); Changed-files table (walkthrough); Effort estimate (walkthrough); Related issues/PRs (walkthrough); Suggested labels (suggestion_only); Review status comment (sticky_status)
  • Path instructions: src/github.ts - Treat GitHub App identity or token-mode regressions as high risk.
  • Path instructions: src/state.ts - Check duplicate suppression, leases, processed heads, and migration safety.
  • Path instructions: src/worker.ts - Check stale-head guards, repo mutation protection, and review posting policy.
  • Path instructions: src/zcode.ts - Check read-only ZCode policy, prompt constraints, and output parsing.
  • Label suggestions: bot, regression-hardening, release
  • Reviewer suggestions: none
  • Suggestion behavior: suggestions only; labels and reviewers are not auto-applied.
  • Roadmap-only settings: auto-apply labels; auto-request reviewers; required status checks

Pre-merge checklist

  • Inline comments target current RIGHT-side diff lines.
  • No secret-like content survived into posted inline comments.
  • REQUEST_CHANGES is only used when eligible P0/P1 findings survive validation.
  • Required behavior proof is present or not applicable.
  • Labels and reviewers are suggestions only; the bot did not auto-apply them.

Comment thread tests/public-cli.test.ts
Comment thread src/cli.ts
Comment thread src/license.ts

@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: 204fdafbcd

ℹ️ 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 services/license-api/src/github-broker/license-entitlement.ts
Comment thread src/license.ts Outdated
@evaos-code-review-bot

evaos-code-review-bot Bot commented Jul 18, 2026

Copy link
Copy Markdown

evaOS review status: completed

PR: #641 - feat: bind native entitlement to broker identity
Head: 3e836a6856780db63f373b06d002fceb12d2abd6
Updated: 2026-07-18T17:33:25.123Z

evaOS review completed for this PR head.

Automation note: agents should wait for this comment to reach completed, stale_head, closed_or_merged_before_review, skipped, or failed before treating evaOS review as settled for this head. provider_deferred means evaOS still intends to retry.

PR URL: #641

Review URL: #641 (review)

@coderabbitai coderabbitai Bot added review-policy Review behavior, filters, severity routing, or posting policy and removed license Licensing, activation, entitlement, or commercial-boundary work labels Jul 18, 2026

@coderabbitai coderabbitai 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
services/license-api/src/service.ts (1)

154-167: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Make repository binding an atomic compare-and-upsert. Confidence: 96%.

The current read/check/write sequence allows concurrent processes to return success for different repositories on the same activation, while SQLite silently retains only one binding.

  • services/license-api/src/service.ts#L154-L167: consume an atomic store result and return repositoryBindingMismatchResult() when the requested repository conflicts.
  • services/license-api/src/store.ts#L1002-L1005: condition the conflict update on compatible repository values and report whether the write succeeded.

Add a focused two-connection race test; broad npm test or build validation can remain in GitHub CI.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@services/license-api/src/service.ts` around lines 154 - 167, Make repository
binding atomic across services/license-api/src/service.ts lines 154-167 and
services/license-api/src/store.ts lines 1002-1005: update the store upsert
operation to condition writes on compatible repository values and return whether
the write succeeded, then have the activation flow consume that result and
return repositoryBindingMismatchResult() on conflict. Add a focused
two-connection race test covering concurrent activation requests for different
repositories.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@services/license-api/src/service.ts`:
- Around line 154-167: Make repository binding atomic across
services/license-api/src/service.ts lines 154-167 and
services/license-api/src/store.ts lines 1002-1005: update the store upsert
operation to condition writes on compatible repository values and return whether
the write succeeded, then have the activation flow consume that result and
return repositoryBindingMismatchResult() on conflict. Add a focused
two-connection race test covering concurrent activation requests for different
repositories.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f77ff847-3b00-4c45-9a59-103b53d80c53

📥 Commits

Reviewing files that changed from the base of the PR and between c091c25 and 3e836a6.

📒 Files selected for processing (9)
  • services/license-api/src/http.ts
  • services/license-api/src/service.ts
  • services/license-api/src/store.ts
  • services/license-api/test/http.test.ts
  • services/license-api/test/service.test.ts
  • src/cli.ts
  • src/license.ts
  • tests/license.test.ts
  • tests/public-cli.test.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (3)
  • GitHub Check: Swift desktop smoke
  • GitHub Check: Build, test, and package
  • GitHub Check: Analyze (javascript-typescript)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use focused local tests or smoke checks by default; treat npm test and npm run build as broad GitHub CI checks unless reproducing CI, a focused harness is unavailable, or the user explicitly requests broad validation.

Files:

  • services/license-api/src/store.ts
  • services/license-api/test/http.test.ts
  • services/license-api/src/http.ts
  • services/license-api/test/service.test.ts
  • services/license-api/src/service.ts
  • tests/public-cli.test.ts
  • tests/license.test.ts
  • src/license.ts
  • src/cli.ts
🪛 ast-grep (0.44.1)
tests/public-cli.test.ts

[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { execFile } from "node:child_process";
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)


[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { execFile } from "node:child_process";
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)

src/license.ts

[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { spawnSync } from "node:child_process";
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)


[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { spawnSync } from "node:child_process";
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)


[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { spawnSync } from "node:child_process";
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)

🔇 Additional comments (8)
src/cli.ts (1)

367-369: LGTM!

Also applies to: 3315-3315, 3634-3637, 3693-3703

src/license.ts (1)

22-24: LGTM!

Also applies to: 127-128, 161-206, 239-239, 265-265, 553-553, 570-570

tests/license.test.ts (1)

28-28: LGTM!

Also applies to: 427-428, 454-644, 692-693

tests/public-cli.test.ts (1)

28-29: LGTM!

Also applies to: 148-185

services/license-api/src/http.ts (1)

48-49: LGTM!

Also applies to: 320-330

services/license-api/src/service.ts (1)

116-124: LGTM!

services/license-api/test/http.test.ts (1)

76-92: LGTM!

services/license-api/test/service.test.ts (1)

57-74: LGTM!

@evaos-code-review-bot evaos-code-review-bot 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.

Walkthrough

PR: #641 - feat: bind native entitlement to broker identity
Head: 3e836a6856780db63f373b06d002fceb12d2abd6 into main. Review event: COMMENT.
Provider: GLM/Z.ai through ZCode (zcode-glm, zcode, model GLM-5.2).

Estimated review effort: 4/5 (~56 min)

Changed Files

File Status Churn Purpose Risk
README.md modified +9/-0 Documentation Low
docs/SETUP.md modified +12/-0 Documentation Low
docs/github-app-setup.md modified +17/-3 Documentation Low
docs/license-boundary.md modified +10/-0 Documentation Low
src/cli.ts modified +19/-1 Runtime code Moderate: validated P3 finding
src/license.ts modified +55/-1 Runtime code Moderate: validated P3 finding
tests/license.test.ts modified +196/-0 Test coverage Low
tests/public-cli.test.ts modified +39/-28 Test coverage Low

Review Signal

Validated inline findings: 2 (P0: 0, P1: 0, P2: 0, P3: 2).
Dropped findings before posting: 0. High-severity findings: 0.

Risk Taxonomy

  • Migration: 1
  • Runtime correctness: 1

Validation and Proof

1 required validation/proof recommendation(s) selected from changed files.

  • required: TypeScript/web build or CI proof - Runtime TypeScript/web files or package/config files changed. Proof: npm run build; typecheck; focused Vitest; green GitHub check.
    Proof status: sufficient - PR metadata mentions acceptable proof for each required validation recommendation.
    Profile validation hints: Current-head, App-authored, no-secret, no-duplicate, and no-repo-mutation invariants outrank style feedback.
    Profile proof expectations: Require focused tests, TypeScript build, App-backed doctor, release-status proof, and launchd heartbeat before live promotion.

Related Context

Related issues/PRs: #612, #613, #610, #630, #517.
Suggested labels: docs, tests.
Suggested reviewers: none from current metadata.

Review Settings Preview

  • Profile: assertive
  • Enabled sections: Review summary (inline_review); Walkthrough (inline_review); Changed-files table (walkthrough); Effort estimate (walkthrough); Related issues/PRs (walkthrough); Suggested labels (suggestion_only); Review status comment (sticky_status)
  • Path instructions: src/github.ts - Treat GitHub App identity or token-mode regressions as high risk.
  • Path instructions: src/state.ts - Check duplicate suppression, leases, processed heads, and migration safety.
  • Path instructions: src/worker.ts - Check stale-head guards, repo mutation protection, and review posting policy.
  • Path instructions: src/zcode.ts - Check read-only ZCode policy, prompt constraints, and output parsing.
  • Label suggestions: bot, regression-hardening, release
  • Reviewer suggestions: none
  • Suggestion behavior: suggestions only; labels and reviewers are not auto-applied.
  • Roadmap-only settings: auto-apply labels; auto-request reviewers; required status checks

Pre-merge checklist

  • Inline comments target current RIGHT-side diff lines.
  • No secret-like content survived into posted inline comments.
  • REQUEST_CHANGES is only used when eligible P0/P1 findings survive validation.
  • Required behavior proof is present or not applicable.
  • Labels and reviewers are suggestions only; the bot did not auto-apply them.

Comment thread src/license.ts
Comment thread src/cli.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-policy Review behavior, filters, severity routing, or posting policy

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant