Skip to content

feat(agent-harness): expose named authorized resource reads - #5718

Open
iscekic wants to merge 1 commit into
shared-agent-harness-3bb0-s18from
shared-agent-harness-3bb0-s19
Open

feat(agent-harness): expose named authorized resource reads#5718
iscekic wants to merge 1 commit into
shared-agent-harness-3bb0-s18from
shared-agent-harness-3bb0-s19

Conversation

@iscekic

@iscekic iscekic commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

No new behavior — the product does not yet use these additions.


Summary

executeHarnessRead implements kilo.organizations, kilo.members, kilo.usage, and kilo.repositories with strict InvocationSchema validation and dispatch-bound authorization.
The adapter takes scope only from authority and reuses authorized procedures, so existing permissions and consumer contracts remain unchanged.
Results must fit 64 kibibytes (KiB); lists contain at most 50 items without a cursor, and provider failures remain errors instead of partial success.

Files
  • apps/web/src/lib/agent-harness/kilo-reads.ts — source, added; 179 lines. Validates and lowercases conversation and operation identifiers, rejects extra invocation fields and unknown reads, and accepts only empty tool arguments. Capability checks bind the audience, conversation, operation, definition version, input digest, dispatch identifier, and backend target. Organization results deduplicate direct and inherited memberships within the authorized scope before limiting and expose only identifiers and names. Member reads require an organization and return public identifiers, emails, and roles; pending invitations use email identifiers. Usage uses day granularity and cost-based totals for the previous 30 days, adds explicit dates, and selects personal-only or organization-wide reads. Repository reads combine bounded GitHub, GitLab, then organization-only Bitbucket results without forced refresh, returning provider-prefixed identifiers and full names. If no integration is available, the read produces a precondition error; an available provider can return an empty list. Temporary failures, setup failures, permission failures, bad requests, and size limits keep distinct errors, including after earlier providers fill the page. If GitHub or GitLab reports no explicit failure state, a missing status or provider error message produces a sanitized service error. Output schemas validate results and exclude extra fields before the adapter enforces the serialized byte limit.

Tests: 1 file added, apps/web/src/lib/agent-harness/kilo-reads.test.ts (424 lines), covering scope, validation, deduplication, limits, empty results, and provider failures.
Generated: 0 files changed.


Verification

No manual tests ran because this level adds adapters without activating the harness.
Composition, presentation, and live proof belong to later slices.

Visual Changes

Visual Changes: N/A

Reviewer Notes

  • Scope: level 19 only, between shared-agent-harness-3bb0-s18 and shared-agent-harness-3bb0-s19.
  • Repository: Kilo-Org/cloud; worktree: /Users/igor/Projects/.worktrees/shared-agent-harness-3bb0.
  • The supplied evidence records four passing scoped checks: oxlint, Jest, oxfmt, and git diff --check, including 141 pure tests.
  • The tests mock authorization and router dependencies; they do not prove live authority or provider access.

Human steps

No human steps are required before merge or after merge.

Notes

Runtime verification remains pending at the stack tip. This level adds named resource adapters without activating the harness.

Stacked PRs — merge bottom to top. Each level shows only its own diff.

Runtime verification (E2E, user advocacy, simplify) runs on the tip PR over every level.
Every level keeps its own checks, its own bot review, and its own threads; each one is answered on its own PR.
Each level is its own deliverable: it builds and passes its own checks alone.
A finding on a level is repaired on that level, then carried upward with stack.sh forward.

  1. shared-agent-harness-3bb0chore(agent-harness): register workspaces and enforce CI boundaries #5632
  2. shared-agent-harness-3bb0-s2feat(agent-harness): define portable domain and snapshots #5637
  3. shared-agent-harness-3bb0-s3feat(agent-harness): define commands tools and permission policy #5639
  4. shared-agent-harness-3bb0-s4feat(agent-harness): share client state and cursor recovery #5643
  5. shared-agent-harness-3bb0-s5feat(agent-harness): persist command intents and execution receipts #5647
  6. shared-agent-harness-3bb0-s6feat(db): add harness ingress grants and retirement fences #5655
  7. shared-agent-harness-3bb0-s7feat(agent-harness): deliver legacy history and project durable text #5659
  8. shared-agent-harness-3bb0-s8feat(agent-harness): authorize durable grants and registered clients #5662
  9. shared-agent-harness-3bb0-s9feat(agent-harness): fence retirement and retry payload cleanup #5667
  10. shared-agent-harness-3bb0-s10feat(agent-harness): persist authoritative state in SQLite #5675
  11. shared-agent-harness-3bb0-s11feat(agent-harness): admit durable runs and revisioned commands #5678
  12. shared-agent-harness-3bb0-s12feat(agent-harness): recover queued runs and stream checkpointed steps #5688
  13. shared-agent-harness-3bb0-s13feat(agent-harness): resolve interactions and dispatch tools sequentially #5693
  14. shared-agent-harness-3bb0-s14feat(agent-harness): fence designated client tool execution #5697
  15. shared-agent-harness-3bb0-s15feat(agent-harness): synchronize durable snapshots and legacy history #5701
  16. shared-agent-harness-3bb0-s16feat(agent-harness): reuse authorized invitations with durable replay #5704
  17. shared-agent-harness-3bb0-s17feat(integrations): bound repository transport for harness reads #5710
  18. shared-agent-harness-3bb0-s18feat(integrations): expose bounded authorized repository reads #5714
  19. shared-agent-harness-3bb0-s19feat(agent-harness): expose named authorized resource reads #5718 ← this PR
  20. shared-agent-harness-3bb0-s20feat(sessions): bound history transport for harness reads #5724
  21. shared-agent-harness-3bb0-s21feat(agent-harness): read scoped Cloud Agent context and progress #5726 (tip)

@kilo-code-bot

kilo-code-bot Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • apps/web/src/lib/agent-harness/kilo-reads.ts
  • apps/web/src/lib/agent-harness/kilo-reads.test.ts

Reviewed by grok-4.6 · Input: 348.6K · Output: 20.9K · Cached: 1.5M

Review guidance: REVIEW.md from base branch shared-agent-harness-3bb0-s18

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