Implement RFC 001: RunInvocation companion schema and MAG tool_calls - #8
Conversation
Add the normative contract changes proposed by RFC 001 (run invocation
I/O and MAG tool_calls). Introduces an optional companion RunInvocation
schema capturing literal inputs/parameters and outputs.tool_calls
([{ id, name, input }]) behind a spine ExecutionContext, without
widening the mandatory spine.
- Add companion/schemas/run-invocation.schema.json + example fixture
- Register schema in core-v3-companion profile and validator mappings
- Document OpenAI/Anthropic interop and MAG normalization
Gap IDs: xrun-execution-context-io, xrun-outputs-tool-calls
Co-authored-by: Cursor <cursoragent@cursor.com>
|
The implementation direction looks good: The new doc says context_hash = hashlib.sha256(context_data.encode()).hexdigest()[:32]Meanwhile the new schema only requires I think this needs one explicit choice:
Right now the text suggests stronger linkage than the schema and platform implementation actually provide. |
|
The The doc defines the normative MAG shape as: [{ "id": "...", "name": "...", "input": { ... } }]and says That means all of these validate even though they do not satisfy the documented canonical shape: { "name": "run_simulation" }
{ "name": "run_simulation", "input": "not decoded object" }I would make |
|
The lifecycle semantics of As written,
I think the cleanest rule is: |
|
Because this companion artifact can persist literal prompts, parameters, messages, and decoded tool inputs, it should probably include some redaction / retention guidance.
Possible lightweight additions:
This will matter once |
|
A few smaller consistency nits:
|
…ening Tighten RunInvocation companion contract
There was a problem hiding this comment.
Follow-up after #9 was merged: this looks good to me now.
The implementation now makes the RunInvocation companion contract much tighter while preserving the original design choice not to widen the mandatory spine:
contextHashis now explicitly constrained to documented 32/64-hex digest forms instead of accepting any string.outputs.tool_callsnow matches the documented MAG shape more closely by requiringid,name, and decoded objectinput.- The interop note now draws the right boundary:
RunInvocationrecords MAG/model turns, while executed-tool telemetry stays in the event stream. - The docs now call out sensitivity/retention concerns for literal prompts, parameters, messages, and tool inputs.
I think this is a good contract-level landing point for RFC001. The remaining questions around executed tool events should be handled in RFC002 rather than folded back into this companion schema.
|
reviewed, updated, implemented, and tested |
Oaklight
left a comment
There was a problem hiding this comment.
Approved.
I rechecked the current PR head after #9 was merged. The RunInvocation companion contract now addresses the issues I raised earlier:
contextHashis constrained to documented 32/64-hex digest forms instead of accepting arbitrary strings.outputs.tool_calls[]now matches the documented MAG shape with requiredid,name, and decoded objectinput.- The interop note clearly separates MAG/model-turn records from executed-tool telemetry, which should remain in the event stream / RFC002 scope.
- The docs now call out sensitivity and retention concerns for literal prompts, parameters, messages, and decoded tool inputs.
From my side, this is a good contract-level landing point for RFC001. Any remaining executed-tool event questions should be handled in RFC002 rather than folded back into this companion schema.
Summary
Implements the normative contract changes proposed in RFC 001 (PR #2) for run invocation I/O and MAG
tool_calls.RunInvocation(run-invocation.schema.json) capturing literalinputs,parameters, andoutputs.tool_callsas[{ id, name, input }]behind a spineExecutionContexthash — without widening the mandatory spine.core-v3-companion, and wires validator coverage.run-invocation-interop.md.Gap IDs:
xrun-execution-context-io,xrun-outputs-tool-callsTest plan
make validate-v3-contractspassesrun-invocation.schema.jsonagainst platformExecutionContextSubmit,MagToolCall, andRunOutputsMade with Cursor