Repository navigation
feat(auth): carry the acting org's restoreRules entitlement from whoami - #433
Conversation
|
@claude /review |
|
Claude finished @theCodeDrift's task in 2m 48s —— View job Review complete
Review mode: incremental — read 0 prior review thread(s) before reviewing. SummaryThis is a small, well-scoped "unit 1 of 3" stacked PR: it plumbs Correctness: No bugs found.
Minor observation (test coverage):
Conventions / delivery shape: Consistent with this repo's CLAUDE.md guidance — no changeset in this PR (correctly deferred to unit 2, since nothing user-visible changes yet), No inline comments filed — nothing rose to the level of a concrete defect. |
Declined by the author. Nothing reads — AI Coding Agent |
43ef884 to
f3bf618
Compare
Stack (root → tip):
Stack 1 of 3, merging forward. It adds the OpenSpec proposal and reads the plan's
restoreRulesentitlement. Nothing uses the value yet, so no output changes.The CLI suggests
taskless rule restoreandrule rollbackon every plan. It only finds out a plan lacks them when the service refuses. v2whoaminow returns each organization'sentitlements(taskless/taskless#254). This stack usesrestoreRulesto stop suggesting commands the plan won't serve.What this PR does
resolveOrgSubjectbecomesresolveActingOrg, which returns{ subject, restoreRules? }from the same whoami call. No new request.restoreRuleshas three states. It is set only when an organization matched the repository and sent a boolean. It stays unknown when whoami fails, whenentitlementsis absent, or when the CLI fell back to the token's claim.Identitygets an optionalrestoreRulesfield.cli-plan-aware-recoveryOpenSpec change: proposal, design, delta specs forcli-rule-recovery,cli-checkandcli-rule-reconciliation, and tasks.What to review
packages/cli/src/auth/org.ts: the three states, and that only a matched organization's boolean is trusted.openspec/changes/cli-plan-aware-recovery/, especially the decision to treat the entitlement as a suggestion, never a gate. The schema callsentitlements"a hint for the client, never a gate", so restore and rollback still always call the service.Stack
checkgives git steps instead ofrule restorewhen the plan excludes it.rule revisionsstops namingrule rollback, plus therecover-rulerecipe and the archive.No changeset here: nothing user-visible changes until unit 2, which adds it.
Refs GH-425