Conversation
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
The binding comparison must include future fields automatically to resolve the remaining drift risk.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Centralizes delegation binding semantics across identity creation, idempotency checks, and recovery.
Changes:
- Adds a shared
delegationBindingmodel. - Refactors creation, comparison, and reconstruction.
- Adds round-trip regression coverage.
File summaries
| File | Review |
|---|---|
internal/delegation/store.go |
Stores requests using the shared binding. |
internal/delegation/recovery.go |
Reconstructs recovery requests through Identity.toRequest(). |
internal/delegation/identity.go |
Defines binding helpers; comparison still manually enumerates fields, leaving drift risk. |
internal/delegation/identity_test.go |
Adds round-trip coverage, but the assertion can miss matching helper omissions. |
Review details
Suppressed comments (1)
internal/delegation/identity_test.go:24
- This round-trip assertion reuses both helpers under test on each side, so matching omissions in
bindingFromRequestandequalsstill pass. Compare the reconstructed request directly with the original request (after replacing the computed TTL); that independently verifies every populated request field, including invocation expiry and the idempotency key.
restored := identity.toRequest()
require.Equal(t, req.IdempotencyKey, restored.IdempotencyKey)
assert.True(t, bindingFromRequest(req).equals(bindingFromRequest(restored)))
assert.Equal(t, identity.ExpiresAt.Sub(identity.CreatedAt), restored.RequestedTTL)
- Files reviewed: 4/4 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| func (b delegationBinding) equals(other delegationBinding) bool { | ||
| return b.RunID == other.RunID && | ||
| b.EnclaveBackend == other.EnclaveBackend && | ||
| b.EnclaveEntryID == other.EnclaveEntryID && | ||
| b.InvocationID == other.InvocationID && | ||
| b.Repository == other.Repository && | ||
| b.ToolPolicy == other.ToolPolicy && | ||
| b.SchemaHash == other.SchemaHash && | ||
| b.AdmittedDefaultBranchSHA == other.AdmittedDefaultBranchSHA && | ||
| b.InvocationExpiresAt.Equal(other.InvocationExpiresAt) | ||
| } |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@copilot address review feedback and fix failing ci lint check https://github.com/github/gh-aw-mcpg/actions/runs/34053570930/job/101567564808?pr=12603 |
This comment has been minimized.
This comment has been minimized.
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Addressed in cc7a407. Binding comparisons now normalize timestamps and compare the complete binding struct; the staticcheck lint failure is resolved. |
|
@copilot resolve merge conflicts and rebase to main |
…e-fix # Conflicts: # internal/delegation/identity.go # internal/delegation/store.go Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
🔒 mcpg Read-Only Stress — defaultSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE Notes:
|
🔒 mcpg Read-Only Stress — gVisorSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE Notes:
|
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
🔒 mcpg Read-Only Stress — docker-sbxSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE Notes:
|
Fixed the complete comparable binding comparison, preserved requested TTL recovery, and resolved the reported staticcheck lint issue.
Merged |
The delegation binding tuple was duplicated across identity creation, idempotency checks, and restart recovery, creating drift risk when fields change. This refactor establishes one shared representation for consistent binding semantics.
delegationBindingfor the nine security-relevant fields.bindingEqualscompares shared bindings.Identity.toRequest().