Skip to content

[Repository Standards] Remove orphaned toolkit API hooks#558

Open
jentic-harness[bot] wants to merge 2 commits into
mainfrom
harness/cron/job-repo-standards/2026-07-06
Open

[Repository Standards] Remove orphaned toolkit API hooks#558
jentic-harness[bot] wants to merge 2 commits into
mainfrom
harness/cron/job-repo-standards/2026-07-06

Conversation

@jentic-harness

@jentic-harness jentic-harness Bot commented Jul 6, 2026

Copy link
Copy Markdown

Human decisions required

  1. Remove ServerConfig from shared/__init__.py __all__ServerConfig
    (src/jentic_one/shared/config.py:738) is re-exported from the shared package
    (src/jentic_one/shared/__init__.py:20) but has no importer outside
    config.py itself. It sits in a curated public config-types surface next to
    AppConfig/DatabaseConfig, so it may be exported deliberately for API
    completeness. Options: (a) leave as-is (treat as intentional public surface),
    (b) drop it from __all__ and the import line. I left it untouched pending a
    call on whether the shared config surface is a stable public contract.

  2. Prune unused repository-tier client functionsui/src/modules/toolkits/api/client.ts
    exposes deleteKey, listPermissions, and patchPermissions that now have no
    service-tier hook consumer (after this PR removes the two dead hooks). These
    look like a deliberate 1:1 mirror of the backend API surface (the repository
    tier is the sanctioned @/shared/api wrapper), so removing them would break
    that pattern. Options: (a) keep the full mirror (current state), (b) trim
    repository functions with no hook. Left as-is; this is a convention call for
    the frontend owners.

To act on these: add a PR comment that starts with /ai-implement listing
the decision numbers you want complete (e.g. /ai-implement implement 1 and 3 option A).

Changes

  1. Removed dead useDeleteKey hook (ui/src/modules/toolkits/api/index.ts) —
    the TanStack Query hook was exported but never imported by any view, test, or
    mock. There is no "delete API key" UI (the toolkit key UI only revokes), so the
    hook was orphaned. Verified with a full grep sweep and a passing tsc/ESLint
    run after removal.

  2. Removed dead useToolkitPermissions hook (ui/src/modules/toolkits/api/index.ts) —
    the read-side permissions hook had no consumers; CredentialPermissionEditor
    loads existing rules from initialRules (sourced from the bindings response)
    and only uses the write-side useReplacePermissions. Verified orphaned via
    grep across ui/src.

  3. Documented intentional patterns in the job steering file
    (.harness/GARBAGE_COL_STANDARDS.md) — recorded that repository-tier
    client.ts files intentionally mirror the full backend API surface and that
    shared/__init__.py __all__ is a curated public surface, so future runs
    don't re-flag them as dead code.

Configuration: https://harness.jentica.jentic.io/repos/jentic/jentic-one

@jentic-harness

jentic-harness Bot commented Jul 6, 2026

Copy link
Copy Markdown
Author

[Orchestrator] Scheduled run for job-repo-standards skipped — this PR from the previous run is still open.

@jentic-harness jentic-harness Bot added the ai-review-and-trigger-implement Trigger AI review that cascades to implement label Jul 6, 2026
@jentic-harness jentic-harness Bot requested a review from ren-jentic July 6, 2026 08:01
@jentic-harness

jentic-harness Bot commented Jul 6, 2026

Copy link
Copy Markdown
Author

[Orchestrator] Session started — ai-review-and-trigger-implement

@jentic-harness jentic-harness Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

[ReviewAgent] Approved — verified this is a clean removal of two genuinely orphaned TanStack Query hooks.

Checks performed:

  • No dangling references: grep across ui/ for useDeleteKey and useToolkitPermissions returns zero matches (views, tests, mocks) — both hooks were truly unused.
  • Claims confirmed: CredentialPermissionEditor.tsx sources rules from initialRules (bindings response, ToolkitDetailBody.tsx:568) and only consumes the write-side useReplacePermissions, so the read-side permissions hook was correctly identified as dead.
  • No collateral breakage: the kept repository-tier functions (client.ts deleteKey/listPermissions/patchPermissions) still exist, consistent with the documented 1:1 backend-mirror convention; the toolkitKeys.permissions key builder remains legitimately used for invalidation in useReplacePermissions.
  • Conventions: change respects the Router→Service→Repository (view→hooks→client) layering; no barrel/registry files touched.
  • Test coverage / security: nothing lost — no test exercised the removed hooks, and no behaviour/security surface changes.

Non-blocking notes (deferred human decisions, no action needed here): the two decisions flagged in the PR body (ServerConfig in shared/__init__.py __all__, and pruning the unused repository-tier client.ts functions) were intentionally left untouched and documented in .harness/GARBAGE_COL_STANDARDS.md — reasonable calls to leave for the respective owners.

@jentic-harness jentic-harness Bot removed the ai-review-and-trigger-implement Trigger AI review that cascades to implement label Jul 6, 2026
@jentic-harness

jentic-harness Bot commented Jul 6, 2026

Copy link
Copy Markdown
Author

[Orchestrator] @ren-jentic @Manuel-Jentic — Agent review concluded approved. Ready for human 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.

0 participants