Skip to content

fix(s2-rm): reject a revoke whose object_type doesn't match (#123) - #132

Merged
dirkjanfaber merged 1 commit into
mainfrom
fix/123-revoke-object-type
Nov 30, 2026
Merged

dirkjanfaber merged 1 commit into
mainfrom
fix/123-revoke-object-type

Conversation

@dirkjanfaber

Copy link
Copy Markdown
Collaborator

The session tracked open instructions by ID only, so a RevokeObject naming another control type passed the check. A queued instruction was revoked anyway, and one already passed on to the flow got OK without a REVOKED, as no control-type node holds it under that type.

The session now keeps each open instruction's type and rejects a revoke whose object_type doesn't match with PERMANENT_ERROR. A PEBC revoke for an ID it doesn't know is still passed on to s2-pebc (#122).

Closes #123.

The session tracked open instructions by ID only, so a RevokeObject
naming another control type passed the check. A queued instruction was
revoked anyway, and one already passed on to the flow got OK without a
REVOKED, as no control-type node holds it under that type.

The session now keeps each open instruction's type and rejects a revoke
whose object_type doesn't match with PERMANENT_ERROR. A PEBC revoke for
an ID it doesn't know is still passed on to s2-pebc (#122).

Closes #123.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The test table’s union of row shapes makes destructuring open fail type-checking with TS2339 because most rows lack that property.

1 open issue
What changed in this PR

This PR addresses #123 by tracking each open instruction’s type in the shared S2 session and rejecting revokes that name a different instruction type. Unknown PEBC instructions remain forwarded to s2-pebc, preserving the behavior discussed in #122.

Changes:

  • Replace ID-only tracking with an instruction ID-to-type map.
  • Update revoke tests with matching instruction fixtures and mismatched-type cases.
  • Document the corrected behavior in the reference guide and changelog.
File Description
test/​lib/​session.test.ts Share typed instruction fixtures and add mismatched-type revoke cases.
src/​lib/​s2/​session.ts Track instruction types and reject mismatched revokes.
docs/​S2_REFERENCE.md Document rejection of revokes naming another instruction type.
CHANGELOG.md Record the revoke validation fix for s2-rm and s2-resource.

Review effort: Balanced

Comment thread test/lib/session.test.ts Resolved
@dirkjanfaber
dirkjanfaber merged commit 0cd9149 into main Nov 30, 2026
6 checks passed
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.

s2-rm accepts a revoke whose object_type doesn't match the open instruction

2 participants