Inline and file-referenced code is meant to be a sandbox: for C# we do not expect a namespace or a class, just the method body, and usually not even the signature — because a predictable context is in scope. The context differs for a command, a query, a rule and a policy.
Two of those four do not exist.
Today
The whole of Contexts/ is:
Causation.cs
CausedBy.cs
CommandContext.cs
QueryContext.cs
TenantId.cs
So:
- Command context — defined (
Contexts/CommandContext.cs:21-26), documented.
- Query context — defined (
Contexts/QueryContext.cs:22-27), documented.
- Rule context — does not exist.
ValidationRuleKind.Rule (Syntax/CommandSyntax.cs:76) accepts a file reference or an inline csharp block, and validate csharp accepts a block, with no declared contract for either.
- Policy context — does not exist.
PolicySyntax.Code (Syntax/PolicySyntax.cs:34) accepts an inline block against nothing.
The two that do exist are also the same shape rather than differentiated, and $context.identity is accepted by the expression parser (Syntax/Expressions.cs:43-44) and documented, while appearing on neither record.
Why this blocks more than it looks
Autocompletion for the inline languages has to limit itself to the scope the inline method actually has. That scope is the context. So inline-language autocompletion cannot be built for rules or policies at all until this lands — the work is strictly downstream of it.
A policy context in particular needs claims and roles; CausedBy today exposes only subject, name and userName.
Inline and file-referenced code is meant to be a sandbox: for C# we do not expect a namespace or a class, just the method body, and usually not even the signature — because a predictable
contextis in scope. The context differs for a command, a query, a rule and a policy.Two of those four do not exist.
Today
The whole of
Contexts/is:Causation.csCausedBy.csCommandContext.csQueryContext.csTenantId.csSo:
Contexts/CommandContext.cs:21-26), documented.Contexts/QueryContext.cs:22-27), documented.ValidationRuleKind.Rule(Syntax/CommandSyntax.cs:76) accepts afilereference or an inlinecsharpblock, andvalidate csharpaccepts a block, with no declared contract for either.PolicySyntax.Code(Syntax/PolicySyntax.cs:34) accepts an inline block against nothing.The two that do exist are also the same shape rather than differentiated, and
$context.identityis accepted by the expression parser (Syntax/Expressions.cs:43-44) and documented, while appearing on neither record.Why this blocks more than it looks
Autocompletion for the inline languages has to limit itself to the scope the inline method actually has. That scope is the context. So inline-language autocompletion cannot be built for rules or policies at all until this lands — the work is strictly downstream of it.
A policy context in particular needs claims and roles;
CausedBytoday exposes onlysubject,nameanduserName.