Skip to content

fix(client): the admission examines each nested call that its caller does not declare - #600

Open
mark1russell7 wants to merge 2 commits into
mainfrom
fix/nested-call-edge
Open

mark1russell7 wants to merge 2 commits into
mainfrom
fix/nested-call-edge

Conversation

@mark1russell7

Copy link
Copy Markdown
Owner

The change

The admission skips a nested call when its caller is a procedure of code with declared effects and the same capability. Before, this exemption covered each nested call of such a caller, also a caller without metadata.calls. checkEffects() examines only the callers with calls, so no check examined the other edges.

The exemption covers a declared edge only:

  • An entry of the calls of the caller names the callee (callMatches).
  • The effects of the callee are in the declaration of the caller. edgeFaults() gives this rule, and checkEffects() uses the same function. A callee that registers after the static check, through a pattern entry, gets the same examination.

The admission examines each other nested call. With no capability, nothing changes.

API

examinesNestedCall() gets the optional parameter callee. Without it, the function cannot name the edge, so it gives true. The API report has the new signature.

Tests

capability.test.ts gets five rows:

  • a caller with effects and no calls under a read-only capability: the nested write is refused before its handler.
  • a callee that the calls of the caller do not name.
  • a pattern entry whose callee writes more than the caller declares.
  • a declared callee without effects.
  • examinesNestedCall() without the callee.

A flip run with the old rule: the five rows fail, and the other 40 rows pass. With the fix, the 45 rows pass. The related tests of the package passed: 2192 passed, 7 skipped.

Docs

CAPABILITIES.md and the decision record state the rule of one edge.

PATCH: a fix of the admission, and a new optional parameter.

🤖 Generated with Claude Code

…does not declare

A procedure of code with declared effects answered for each of its
nested calls, also without metadata.calls. Now the exemption covers one
declared edge: an entry of the calls of the caller names the callee, and
the effects of the callee are in the declaration of the caller.

- examinesNestedCall() gets the optional parameter callee. Without it,
  the function gives true.
- edgeFaults() is the one rule of an edge. checkEffects() and the
  admission use it.
- Five tests: a caller without calls, a callee outside the calls, a
  pattern entry with more effects, a callee without effects, and no
  callee. Each one fails with the old rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant