Skip to content

feat(bot): global dashboard, scoped admin tokens and Jev labeling - #449

Merged
AsperforMias merged 54 commits into
mainfrom
feat/bot-admin
Oct 7, 2026
Merged

AsperforMias merged 54 commits into
mainfrom
feat/bot-admin

Conversation

@hikariming

@hikariming hikariming commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

Bot administration now has a genuine global Dashboard, usable installation/account navigation, and stable Issue/PR lookup order. The console uses flat metrics, ruled tables and settings sections; statuses are plain text, and actions retain native links or forms.

  • Aggregate only current authenticated installation membership and live writable repositories. Global coverage is explicit and paginated (four accounts × 25 repositories); counts use actual retained jobs updated in the last 30 days. Account, repository, task and activity drill-downs keep the correct installation and locale. Empty accounts have actionable states without fabricated metrics.
  • Preserve repository filters, keyboard account menus, mobile navigation, unsaved-change confirmation and duplicate-submit protection. Processing, preview, explicit backfill and cleanup remain distinct operations with live permissions, same-origin/CSRF protection and scoped bot-token authorization.
  • Sort retained Issue/PR tasks by their shared GitHub number before SQL pagination, with current repository grouping and immutable ties. Parallel completion timestamps do not reorder modern tasks or legacy setup. Chronological activity and API recent-job summaries retain their intended order.
  • Preserve compatibility for existing scan-only tokens; bot access is an explicit scope in integrations and all three CLIs. Production Bot deployment is gated on a successful main-site release and smoke checks for the same current main SHA.
  • Jev compares only saved, existing allowed labels against their current descriptions, independently for each concrete intent and secondary PR change. It remains optional; comments and triage default off, and missing/invalid model decisions add no labels. Cleanup preserves human-owned content.

Validation: 271 tests across 16 files in the actual Worker/local D1 pool; repository lint and typechecks, Astro web/router typechecks, and Bot Wrangler dry-run build passed. Real browser checks cover global/account/catalog navigation, filters, numeric task pagination, unsaved/pending/Back behavior, zero/one/two accounts, English/Chinese/Arabic, desktop/mobile and Light/Dark/Auto. Focused visual regressions verify the scoped activity table keeps repository names and timestamps visible.

Real Jev evaluation used public Dify descriptions and actual Issue/PR bodies in two local repository groups. The final eight-case batch matched 7/8 predeclared expectations: a workflow-memory PR also received the broad Agent label at the inclusive 0.8 threshold. The documentation secondary-change miss was corrected generically; the remaining mismatch, unchanged threshold and all attempts are preserved. All GitHub source reads were GET-only, and all evaluation label writes were locally simulated; nothing was written to Dify online. This small evaluation is not a calibrated production accuracy claim. Reproduction scripts and safety boundaries are documented in platform/github-app/README.md.

A separate final integration used a native authenticated/CSRF-protected browser preview POST through the current production Worker bundle and ephemeral migrated D1. Real Jev suggested bug at 0.98 for public Dify issue #43536 content against saved local synthetic definitions. Actual jobs, audits, label ledgers and repository settings retained identical counts and full-row digests; GitHub write attempts stayed zero. This one-call integration check is separate from the eight-case exact-Dify-description benchmark.

History is organized into 54 semantic commits, all authored and committed by AsperforMias with SSH signatures registered to that GitHub account. Final files are byte-identical to the previously validated implementation. Intermediate review keeps provider tests, classifier ownership tests and job integration tests with the modules and hooks they exercise. All 54 intermediate commits passed Bot typechecks across 26 distinct Bot trees. Exact final head a50cf1d3ea8d4e7287a4573e9edc693205720ad2 passed all seven pre-merge CI checks, including Verify release; Delete preview worker was skipped as expected. The locally reconstructed signed chain was integrated by a non-force fast-forward to preserve original user signatures on main. Existing user-specific ruleset bypass permission was used for the pending code-owner review; no protection rules were changed.

Fixes #370.

@ghfind-review ghfind-review Bot added the review: top ghfind author score; see https://ghfind.com label Oct 6, 2026
hikariming added a commit that referenced this pull request Oct 6, 2026
Security and correctness review of #449:
- API: per-account rate limit (60/min, 600/h), one-minute cache of read
  permission checks and of denials so polling and probing cost no
  GitHub quota; every change still re-checks live. Not installed, no
  such repository and no write access all answer not_found.
- Retry closes the failed row first (no repeated clones) and keeps the
  job id prefix, so retried backfill items still send no email or
  comment and follow-ups stay follow-ups. Shared by web and API.
- Cleanup: the comment page cap no longer skips the label definitions
  phase; a failed queue send or transient D1 error retries instead of
  failing the cleanup; "." and ".." labels are never written.
- Triage: after an ambiguous label write, keep the record only for
  labels that landed.
- Cron steps run independently.
- Web admin: Activity card with the last 20 audit entries, 9 locales.
- CLIs: the token is sent only over https (http on localhost); Go no
  longer treats a "version" flag value as the version command.
- Python package gets ghfind bot, matching the npm and Go CLIs.
@AsperforMias AsperforMias changed the title feat(github-app): admin backend for repository settings feat(bot): scoped admin tokens, safe cleanup and complete dashboard Oct 7, 2026
@AsperforMias AsperforMias changed the title feat(bot): scoped admin tokens, safe cleanup and complete dashboard feat(bot): desktop console, scoped admin tokens and Jev intent labels Oct 7, 2026
@AsperforMias AsperforMias changed the title feat(bot): desktop console, scoped admin tokens and Jev intent labels feat(bot): global dashboard, scoped admin tokens and Jev labeling Oct 7, 2026
@AsperforMias
AsperforMias merged commit a50cf1d into main Oct 7, 2026
8 checks passed
@AsperforMias
AsperforMias deleted the feat/bot-admin branch October 7, 2026 13:02

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review: top ghfind author score; see https://ghfind.com

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ghfind Review 安装中间状态异常

2 participants