Skip to content

Draft: Agent Access design review and CLI POC - #1615

Draft
hgaol wants to merge 21 commits into
apache:devfrom
hgaol:agentic-exp
Draft

hgaol wants to merge 21 commits into
apache:devfrom
hgaol:agentic-exp

Conversation

@hgaol

@hgaol hgaol commented Sep 14, 2026

Copy link
Copy Markdown
Member

Relates to #1614

Summary

This draft PR presents the Agent Access design for review and discussion, together with the current proof-of-concept code on agentic-exp.

The design covers Personal Access Tokens, answer-cli, and the Answer Agent Skill. The initial PAT scope set is intentionally limited and can be extended in future releases.

Review focus

  • PAT authentication, scopes, lifecycle, and authorization model
  • answer-cli interface and deterministic output contract
  • Answer Skill workflow and safety rules
  • Delivery phases and acceptance criteria

This is a design-review and discussion PR with POC code; it is not presented as the complete production implementation.

@hgaol

hgaol commented Sep 14, 2026

Copy link
Copy Markdown
Member Author

Admin setting to globally enable PAT or not.
image

User setting to create a PAT with expiration and scopes
image

Preserve CLI build targets alongside upstream UI checks. Keep the Vite migration and port PAT UI tests to Vitest, including their DOM dependencies. Update the upstream middleware test for PAT authorization and remove the duplicate feature translation.
The nested PAT scope labels shared a group with description, a reserved go-i18n message key. The server interpreted the group as a single message, rejected the English bundle, and panicked during request validation. Rename the UI description key and exercise real bundled English translation loading in a regression test.
Add user-owned expiring and revocable credentials, strict Bearer authentication, semantic route scopes, current account resolution, recent-authentication checks, account lifecycle hooks, and default-off admin controls. Include account-settings management, HTTP documentation, and end-to-end coverage for two eligible users creating content and voting through PATs.
Build MCP participation on scoped PAT identity with current account checks, per-tool authorization, credential-bound SSE sessions, and default-off write controls. Reuse guarded REST actions in process for questions, answers, comments, votes, reactions, own-content edits, and answer acceptance. Add side-effect-free previews, duplicate handling, structured results, admin/token-scope UI, and end-to-end/preview/race coverage.
Integrate user-bound MCP participation for apache#1679 while retaining the
Answer CLI and Agent Skill. Resolve the parallel PAT history additions.

Validation exposed SQL cleanup retaining pooled Gin contexts in reaction
and acceptance operations. Snapshot the standard request context and its
language/short-link settings before calling write services, with a
regression test covering Gin reuse and request cancellation.

Validated with the full Go suite, build, vet, lint, UI tests/build,
asset/translation/license checks, generated-file checks, and three
consecutive two-user MCP integration runs under the race detector.
Restore the upstream MCP admin UI and enabled-only configuration. Remove
separate global write access, per-tool switches, and configuration tool
catalogs; discovery and invocation use the caller's PAT scopes instead.
Legacy site API keys remain limited to MCP reads.

Map MCP tools to the existing REST operation scope policy. Question and
answer reads each require only their own read scope, public profile REST
reads honor user.read, and semantic search checks all returned content
categories. Force the question search target independently of user query
operators so question-only tokens cannot retrieve answer excerpts.

Validate scope parity, scope-filtered discovery, real REST/MCP read and
write flows, ignored obsolete config fields, and transport disablement.
Update documentation and regenerate the API schemas.

This branch has not been deployed

No deployments
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