Skip to content

feat(adt-mcp): add delegated assistant read scope#147

Closed
ThePlenkov wants to merge 2 commits into
mainfrom
feat/delegated-assistant-read-scope
Closed

feat(adt-mcp): add delegated assistant read scope#147
ThePlenkov wants to merge 2 commits into
mainfrom
feat/delegated-assistant-read-scope

Conversation

@ThePlenkov

@ThePlenkov ThePlenkov commented Jul 25, 2026

Copy link
Copy Markdown
Member

Summary

  • Add a product-neutral delegated-assistant read invocation envelope
  • Keep tool catalogue and dispatch policy server-owned
  • Reject tool allowlists, limits, write, and safe-execute authority
  • Replace the obsolete repeated commit/push confirmation rule with autonomous scoped feature delivery

Verification

  • 20 focused policy, catalogue, and signed-JWT tests pass
  • Scoped ESLint and Prettier pass
  • Strict OpenSpec validation passes

Technical Details

This change introduces a new delegated-assistant signed invocation policy that allows interactive MCP clients to discover and call read tools on behalf of an authenticated principal without duplicating the server's tool catalogue. The policy is product-neutral and does not include product-specific agent names or workflows.

The change also updates the repository's git workflow rules to enable autonomous delivery of verified feature work to scoped branches, replacing the previous "no auto-commit" rule with a more flexible "autonomous delivery" rule that still gates destructive operations and protected-branch updates.


Open in Devin Review

Summary by cubic

Adds a product-neutral delegated-assistant read scope to packages/adt-mcp, enabling MCP clients to discover and call server-owned read tools via a signed credential. Also updates repo rules to allow autonomous, verified commits to scoped branches.

  • New Features

    • Add a signed delegated-assistant read policy bound to principal, threadId, executionId, and one System/Destination.
    • Server-owned catalogue: tools/list and dispatch expose only server/read; deny write and safe_execute; no client allowlists or limits.
    • Update HTTP verifier and exports (parseDelegatedAssistantReadPolicy, types); add focused policy/catalogue/HTTP tests and OpenSpec docs.
  • Refactors

    • Replace git/no-auto-commit with git/autonomous-delivery to commit and push verified feature work to scoped branches; destructive and protected actions remain gated.

Written for commit 4bf4cde. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features

    • Added delegated-assistant read access for MCP interactions, scoped to a single authenticated context, thread, execution, System, and Destination.
    • Read-only tool discovery and dispatch now support approved server and read operations while excluding write, execution, unknown, and out-of-scope actions.
    • Added strict validation to reject malformed or overly broad access policies.
  • Documentation

    • Updated delivery guidance to support automatic commits and pushes of verified changes after authorization.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@netlify

netlify Bot commented Jul 25, 2026

Copy link
Copy Markdown

Deploy Preview for adt-cli canceled.

Name Link
🔨 Latest commit 4bf4cde
🔍 Latest deploy log https://app.netlify.com/projects/adt-cli/deploys/6a650e9bcfca670008009e62

@gitar-bot

gitar-bot Bot commented Jul 25, 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

@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c0f9b6a6-1345-4760-9449-7b580de8d43d

📥 Commits

Reviewing files that changed from the base of the PR and between 41a624b and 4bf4cde.

📒 Files selected for processing (29)
  • .agents/repo-guide.md
  • .agents/rules/git/autonomous-delivery.md
  • .agents/rules/git/no-auto-commit.md
  • docs/roadmap/README.md
  • docs/roadmap/epics/_template.md
  • docs/roadmap/epics/e01-include.md
  • docs/roadmap/epics/e02-function.md
  • docs/roadmap/epics/e03-badi.md
  • docs/roadmap/epics/e04-strust.md
  • docs/roadmap/epics/e05-format-plugin-api.md
  • docs/roadmap/epics/e06-gcts-format-plugin.md
  • docs/roadmap/epics/e07-gcts-command-plugin.md
  • docs/roadmap/epics/e08-checkin.md
  • docs/roadmap/epics/e09-acds-parser.md
  • docs/roadmap/epics/e10-rap-bdef.md
  • docs/roadmap/epics/e11-rap-srvd.md
  • docs/roadmap/epics/e12-rap-srvb.md
  • docs/roadmap/epics/e13-startrfc.md
  • docs/roadmap/epics/e14-flp.md
  • docs/roadmap/epics/e15-wb.md
  • openspec/changes/add-delegated-assistant-read-scope/design.md
  • openspec/changes/add-delegated-assistant-read-scope/proposal.md
  • openspec/changes/add-delegated-assistant-read-scope/specs/adt-mcp/spec.md
  • openspec/changes/add-delegated-assistant-read-scope/tasks.md
  • packages/adt-mcp/src/index.ts
  • packages/adt-mcp/src/lib/http/invocation.ts
  • packages/adt-mcp/tests/delegated-assistant-catalogue.test.ts
  • packages/adt-mcp/tests/delegated-assistant-policy.test.ts
  • packages/adt-mcp/tests/http-invocation.test.ts

📝 Walkthrough

Walkthrough

The change replaces no-auto-commit guidance with authorized autonomous delivery instructions and adds a delegated-assistant read-scope policy to ADT MCP, including strict claim parsing, public exports, catalogue restrictions, dispatch support, and tests.

Changes

Autonomous delivery guidance

Layer / File(s) Summary
Autonomous delivery rules and roadmap prompts
.agents/..., docs/roadmap/README.md, docs/roadmap/epics/*
Replaces approval-gated commit instructions with verified commit and push instructions for scoped feature branches, while documenting retained delivery gates.

Delegated assistant read scope

Layer / File(s) Summary
Read-scope contract
openspec/changes/add-delegated-assistant-read-scope/*
Defines the exact signed policy, server-owned read catalogue, authority restrictions, scenarios, and implementation checklist.
Policy parsing and exports
packages/adt-mcp/src/lib/http/invocation.ts, packages/adt-mcp/src/index.ts
Adds the delegated-assistant identity, strict read-policy parser, dispatch support, and public exports.
Policy and catalogue validation
packages/adt-mcp/tests/*delegated-assistant*, packages/adt-mcp/tests/http-invocation.test.ts
Tests accepted credentials, malformed or widened policies, read-only catalogue filtering, tool authorization, and HTTP verification.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Assistant
  participant InvocationVerifier
  participant MCPToolCatalogue
  participant MCPDispatch
  Assistant->>InvocationVerifier: Submit signed delegated-assistant read claims
  InvocationVerifier->>MCPToolCatalogue: Filter server/read tools
  MCPToolCatalogue-->>Assistant: Return permitted tools
  Assistant->>MCPDispatch: Invoke a read tool
  MCPDispatch->>MCPDispatch: Recheck class and Destination
Loading

Suggested labels: baz: pending

✨ 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/delegated-assistant-read-scope
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch feat/delegated-assistant-read-scope

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed: dependency version conflict. Check your lock file or package.json.


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.

@amazon-q-developer amazon-q-developer Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The delegated-assistant read scope implementation is well-structured and secure. The code correctly implements product-neutral, principal-scoped read access with proper validation and test coverage. All verification gates pass and the implementation follows established security patterns for fail-closed policy enforcement.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

@ThePlenkov ThePlenkov closed this Jul 25, 2026
@ThePlenkov
ThePlenkov deleted the feat/delegated-assistant-read-scope branch July 25, 2026 19:30
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Add delegated-assistant read policy for ADT MCP

✨ Enhancement 🧪 Tests 📝 Documentation ⚙️ Configuration changes 🕐 40+ Minutes

Grey Divider

AI Description

• Introduce a signed delegated-assistant read-only invocation envelope for MCP clients.
• Keep tool discovery and dispatch server-owned; reject allowlists, limits, write, and safe_execute.
• Replace no-auto-commit guidance with an autonomous, scoped feature delivery workflow rule.
Diagram

graph TD
  A["Interactive MCP client"] --> B[["Signed JWT\n(delegated-assistant)"]] --> C["ADT MCP HTTP server"] --> D["Invocation verifier"] --> E["Delegated read policy\nparser"] --> F["Server tool catalogue\n(class-based)"] --> G["Tool dispatch\n(read only)"] --> H[("Destination lease")]

  subgraph Legend
    direction LR
    _c["Component"] ~~~ _a[["Credential/Artifact"]] ~~~ _d[("Resource")]
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Extend existing system-assistant policy with thread/execution fields
  • ➕ Avoids introducing a new agentId and policy name
  • ➕ Keeps fewer code paths in dispatch eligibility checks
  • ➖ Harder to preserve backwards compatibility while tightening constraints
  • ➖ Blurs semantics between compatibility identity and delegated client identity
2. Issue per-tool read grants (tool-scoped JWTs) instead of a coarse read envelope
  • ➕ Even tighter least-privilege: each JWT authorizes exactly one tool call
  • ➕ Simplifies server-side catalogue filtering for delegated sessions
  • ➖ Requires the client to round-trip for each tool selection
  • ➖ Increases token issuance volume and adds UX latency

Recommendation: The PR’s approach (a coarse, product-neutral delegated-assistant read envelope with server-owned catalogue/classification) is the best trade-off: it prevents client drift, keeps dispatch decisions centralized, and still enforces strict non-widening constraints (no tool lists, no limits, no write/safe_execute). Alternatives either overload the legacy system-assistant identity or add significant issuance/latency overhead.

Files changed (28) +380 / -25

Enhancement (2) +41 / -1
index.tsExport delegated-assistant policy parser and types +2/-0

Export delegated-assistant policy parser and types

• Re-exports the delegated-assistant read policy parser and its type from the package public entrypoint.

packages/adt-mcp/src/index.ts

invocation.tsAdd delegated-assistant trusted identity and strict read-policy parsing +39/-1

Add delegated-assistant trusted identity and strict read-policy parsing

• Adds delegated-assistant to trusted agent IDs and introduces DelegatedAssistantReadPolicy parsing with exact constraint keys, UUID/system SID validation, single Destination binding, and empty limits requirement. Extends dispatch-policy support checks to accept only valid delegated read envelopes.

packages/adt-mcp/src/lib/http/invocation.ts

Tests (3) +162 / -0
delegated-assistant-catalogue.test.tsTest delegated read envelope lists full server-owned read catalogue +56/-0

Test delegated read envelope lists full server-owned read catalogue

• Adds tests asserting read tools are listed, and write/safe_execute/unknown tools are not listed or allowed under delegated read access.

packages/adt-mcp/tests/delegated-assistant-catalogue.test.ts

delegated-assistant-policy.test.tsAdd unit tests for delegated-assistant read policy claim validation +84/-0

Add unit tests for delegated-assistant read policy claim validation

• Introduces tests verifying the exact claim shape is accepted and that tool lists, limits, extra classes/Destinations, and malformed constraints are rejected.

packages/adt-mcp/tests/delegated-assistant-policy.test.ts

http-invocation.test.tsAdd signed-JWT integration test for delegated-assistant dispatch support +22/-0

Add signed-JWT integration test for delegated-assistant dispatch support

• Extends invocation verifier tests to sign and verify a delegated-assistant-read-v1 credential and confirm it is dispatch-policy supported.

packages/adt-mcp/tests/http-invocation.test.ts

Documentation (22) +151 / -24
repo-guide.mdSwitch always-on git rule reference to autonomous delivery +7/-7

Switch always-on git rule reference to autonomous delivery

• Replaces the always-on rule entry from no-auto-commit to autonomous-delivery and updates the table description accordingly.

.agents/repo-guide.md

README.mdUpdate roadmap guidance to match autonomous delivery rule +3/-1

Update roadmap guidance to match autonomous delivery rule

• Replaces the previous 'no commits without approval' guidance with autonomous delivery wording and points readers to the new rule file.

docs/roadmap/README.md

_template.mdUpdate epic template commit guidance for autonomous delivery +1/-1

Update epic template commit guidance for autonomous delivery

• Adjusts the epic template instructions to permit committing/pushing verified scoped changes without an extra prompt.

docs/roadmap/epics/_template.md

e01-include.mdAlign epic instructions with autonomous delivery workflow +1/-1

Align epic instructions with autonomous delivery workflow

• Replaces the explicit commit-approval requirement with autonomous delivery wording for scoped feature branches.

docs/roadmap/epics/e01-include.md

e02-function.mdAlign epic instructions with autonomous delivery workflow +1/-1

Align epic instructions with autonomous delivery workflow

• Updates the epic header guidance to allow committing/pushing verified scoped changes without a separate confirmation prompt.

docs/roadmap/epics/e02-function.md

e03-badi.mdAlign epic instructions with autonomous delivery workflow +1/-1

Align epic instructions with autonomous delivery workflow

• Replaces 'do not commit without approval' with autonomous delivery wording in the epic preface.

docs/roadmap/epics/e03-badi.md

e04-strust.mdAlign epic instructions with autonomous delivery workflow +1/-1

Align epic instructions with autonomous delivery workflow

• Updates commit/push guidance in the epic header to match the autonomous delivery rule.

docs/roadmap/epics/e04-strust.md

e05-format-plugin-api.mdAlign epic instructions with autonomous delivery workflow +1/-1

Align epic instructions with autonomous delivery workflow

• Updates the epic instructions to allow autonomous commit/push to the scoped feature branch after verification.

docs/roadmap/epics/e05-format-plugin-api.md

e06-gcts-format-plugin.mdAlign epic instructions with autonomous delivery workflow +1/-1

Align epic instructions with autonomous delivery workflow

• Replaces commit gating language with autonomous delivery wording for verified scoped changes.

docs/roadmap/epics/e06-gcts-format-plugin.md

e07-gcts-command-plugin.mdAlign epic instructions with autonomous delivery workflow +1/-1

Align epic instructions with autonomous delivery workflow

• Updates the epic guidance to commit and push verified changes without a separate confirmation prompt.

docs/roadmap/epics/e07-gcts-command-plugin.md

e08-checkin.mdAlign epic instructions with autonomous delivery workflow +1/-1

Align epic instructions with autonomous delivery workflow

• Updates the epic preface commit guidance to match the new autonomous delivery rule.

docs/roadmap/epics/e08-checkin.md

e09-acds-parser.mdAlign epic instructions with autonomous delivery workflow +1/-1

Align epic instructions with autonomous delivery workflow

• Replaces 'do not commit without approval' guidance with autonomous delivery wording.

docs/roadmap/epics/e09-acds-parser.md

e10-rap-bdef.mdAlign epic instructions with autonomous delivery workflow +1/-1

Align epic instructions with autonomous delivery workflow

• Updates the epic header to permit autonomous commit/push for verified scoped work.

docs/roadmap/epics/e10-rap-bdef.md

e11-rap-srvd.mdAlign epic instructions with autonomous delivery workflow +1/-1

Align epic instructions with autonomous delivery workflow

• Updates the epic guidance to commit and push verified scoped changes without an extra prompt.

docs/roadmap/epics/e11-rap-srvd.md

e12-rap-srvb.mdAlign epic instructions with autonomous delivery workflow +1/-1

Align epic instructions with autonomous delivery workflow

• Replaces commit gating language with autonomous delivery wording in the epic preface.

docs/roadmap/epics/e12-rap-srvb.md

e13-startrfc.mdAlign epic instructions with autonomous delivery workflow +1/-1

Align epic instructions with autonomous delivery workflow

• Updates the epic header commit guidance to match autonomous delivery for scoped branches.

docs/roadmap/epics/e13-startrfc.md

e14-flp.mdAlign epic instructions with autonomous delivery workflow +1/-1

Align epic instructions with autonomous delivery workflow

• Replaces the 'do not commit without approval' instruction with autonomous delivery wording.

docs/roadmap/epics/e14-flp.md

e15-wb.mdAlign epic instructions with autonomous delivery workflow +1/-1

Align epic instructions with autonomous delivery workflow

• Updates epic header guidance to allow committing/pushing verified changes without a separate confirmation prompt.

docs/roadmap/epics/e15-wb.md

design.mdDocument delegated-assistant read envelope design and rejected alternatives +44/-0

Document delegated-assistant read envelope design and rejected alternatives

• Adds the design decision for a product-neutral delegated-assistant identity, exact claim shape, and enforcement rules. Captures rejected alternatives like product-specific agent IDs, client allowlists, and safe_execute.

openspec/changes/add-delegated-assistant-read-scope/design.md

proposal.mdAdd OpenSpec change proposal for delegated-assistant read scope +28/-0

Add OpenSpec change proposal for delegated-assistant read scope

• Introduces a proposal describing motivation, scope, non-goals, and validation strategy for delegated-assistant read-only invocation.

openspec/changes/add-delegated-assistant-read-scope/proposal.md

spec.mdAdd OpenSpec requirements for delegated read catalogue and non-widening scope +40/-0

Add OpenSpec requirements for delegated read catalogue and non-widening scope

• Defines acceptance requirements and scenarios for delegated assistant tool listing and dispatch denial of write/safe_execute/out-of-Destination operations.

openspec/changes/add-delegated-assistant-read-scope/specs/adt-mcp/spec.md

tasks.mdAdd implementation task checklist and verification notes +13/-0

Add implementation task checklist and verification notes

• Tracks completed tasks for defining and implementing the policy, plus notes about broader build blockers due to pre-existing dependency issues.

openspec/changes/add-delegated-assistant-read-scope/tasks.md

Other (1) +26 / -0
autonomous-delivery.mdAdd autonomous commit/push policy for scoped feature work +26/-0

Add autonomous commit/push policy for scoped feature work

• Introduces a new always-on rule allowing verified atomic commits and pushes after initial authorization. Explicitly lists actions that remain gated (force-pushes, protected branches, releases, and scope expansion).

.agents/rules/git/autonomous-delivery.md

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 21 complexity · 2 duplication

Metric Results
Complexity 21
Duplication 2

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@sonarqubecloud

Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

Open in Devin Review

Comment thread .agents/repo-guide.md
| [`verification/after-changes`](rules/verification/after-changes.md) | Build, typecheck, test, lint, format checklist |
| Rule | Description |
| ------------------------------------------------------------------------------- | ------------------------------------------------------------ |
| [`git/autonomous-delivery`](rules/git/autonomous-delivery.md) | Commit and push authorized feature work without re-prompting |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📝 Info: no-auto-commit references fully removed

The PR deletes .agents/rules/git/no-auto-commit.md and replaces it with .agents/rules/git/autonomous-delivery.md, updating the rules index and all epic Devin prompt blocks. I grepped the entire repo for no-auto-commit and found zero remaining references, so no dangling links to the removed rule file exist. The .agents/repo-guide.md index row and docs/roadmap/README.md conventions were both updated consistently.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@baz-reviewer

baz-reviewer Bot commented Jul 25, 2026

Copy link
Copy Markdown

Merger

Could not evaluate merge readiness.

Commit 4bf4cde · Evaluated 2026-07-25 19:31 UTC


Review this PR on Baz | Customize your next review

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