test(connector-opencode): assert the event channel is core's derivation by identity, not one sampled value - #714
Merged
Conversation
…on by identity, not one sampled value The events-arm suite proved the OpenCode connector declares an event channel and that its derivation matched core's for one sample principal, by value. A re-implementation that returned the right string for that principal would pass unchanged; nothing asserted the connector's field IS core's function rather than a copy of it, which is the property that keeps the grant the manager mints and the subject the session publishes to deciding the channel in one place. Add the function-identity assertion, mirroring the codex events-arm suite, so the cell fails the moment the assignment is replaced by a re-implementation. The existing by-value cell stays: it additionally proves the derivation is keyed on the principal. Test-only; the property is already true in the shipped connector. Closes #601.
…s discrimination The inline check name read as if the value cell catches a clone; it does not. Under a clone that reproduces the subject for one principal, the value cell passes and only the function-identity assertion fails. The block comment above already stated this correctly; align the cell label with it. Label only, no behavior change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The
events-armsuite for the OpenCode connector asserted that the connector'sdeclared event channel matched core's derivation for one sample principal, by value:
That is the right comparison at the wrong strength. A re-implementation of the
derivation that returned the correct string for
ollieand diverged elsewhere wouldpass the cell unchanged. What makes the property true in the shipped connector is not
the sampled value: it is that the connector's field IS core's function rather than a
copy, so the channel the manager mints the grant for and the subject the session
publishes to are decided in exactly one place.
This adds the function-identity assertion:
mirroring the assertion the codex
events-armsuite already carries. The existingby-value cell stays, because it additionally proves the derivation is keyed on the
principal rather than the display name.
Test-only. The property is already true; no behaviour changes. Closes #601.
Proof
smoke:opencode-events-armreports 16 passed, 0 failed.eventChannel: (p) => eventChannel(p): KILLED,red on the named assertion "not a re-implementation";
mutation-proofreports thesuite discriminates.
identity cell, and the by-value cell is among the 15 that pass. The by-value cell
alone could not have caught the clone; the new cell does.
pnpm typecheckexits 0.Sibling gap, filed separately
The claude-code
events-armsuite has the identical weakness (it asserts the declaredchannel by value on one principal and no cell asserts function identity). Rather than
widen this PR past the issue it closes, that is filed as #713 so the weakness is on the
record with its reason, which is the disposition #601 itself argued for.