feat: surface the job authority descriptor to subscribers (§7.6)#149
Conversation
The runtime now populates `budget` (current per-currency counters) on `job.subscribed`, alongside the `lease_constraints` it already sent, so an observing principal can render a job's authority surface — the expiry clock and budget gauge — without being the submitter. The cap is derivable from the lease's `cost.budget` pattern; subsequent `cost.budget.remaining` metric events keep the gauge live. The client's `JobSubscription` now exposes the full descriptor: `currentStatus`, `agent`, `lease`, `leaseConstraints`, `budget`, and (submitter-only) `credentials`. Credentials remain redacted for non-submitters per §14. Backward-compatible — only additive fields. Adds a runtime test asserting an observer receives budget + lease_constraints but never credentials. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
WalkthroughThe runtime's ChangesObserver authority descriptor on job.subscribed
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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
packages/client/src/client.tsMultiple projects found, consider using a single Oops! Something went wrong! :( ESLint: 10.5.0 TypeError: Error while loading rule 'import/no-default-export': Cannot use 'in' operator to search for 'sourceType' in undefined packages/client/src/types.tsMultiple projects found, consider using a single Oops! Something went wrong! :( ESLint: 10.5.0 TypeError: Error while loading rule 'import/no-default-export': Cannot use 'in' operator to search for 'sourceType' in undefined packages/runtime/src/server-subscribe.tsMultiple projects found, consider using a single Oops! Something went wrong! :( ESLint: 10.5.0 TypeError: Error while loading rule 'import/no-default-export': Cannot use 'in' operator to search for 'sourceType' in undefined 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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
What
Surfaces a job's authority descriptor to subscribers, so an observing
principal (a dashboard/console) can render a job's authority surface — expiry
clock and budget gauge — without being the job's submitter.
job.subscribednow populatesbudget(current per-currencycounters), alongside the
lease_constraintsit already sent. The budgetcap is derivable from the lease's
cost.budgetpattern; subsequentcost.budget.remainingmetric events keep the gauge live.JobSubscriptionnow exposes the full descriptor —currentStatus,agent,lease,leaseConstraints,budget, and(submitter-only)
credentials.credentialsremain redacted for non-submitters (§14) —unchanged.
Why
The
JobSubscribedPayloadSchemaalready declared these fields and the clientalready captured
lease/budget/lease_constraintsinto invocation state,but the runtime never sent
budgetandJobSubscriptionexposed none of it.This finishes that path and documents it in spec §7.6.
Compatibility
Backward-compatible — only additive optional fields.
minorforruntime+client(changeset included).Tests
Adds a runtime test asserting an observer receives
budget+lease_constraintson
job.subscribedbut nevercredentials. Full suite green.Spec change: agentruntimecontrolprotocol/spec (§7.6).
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Tests