feat(agent): ship output channels, ContextPackV2, and effect ledger

Open AgentOutputV1/ContextPackV2 capability bits and add EffectLedgerRecordV1
so CheckpointV2 write auto-resume only unlocks on a safe watermark.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-10-27 13:28:03 +08:00
1 parent 4683f2e067
commit 6bd90bb2d0
9 files changed
+1577 -18

No files matched your search

@@ -0,0 +1,46 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "marqdo://contracts/EffectLedgerRecordV1",
"title": "EffectLedgerRecordV1",
"type": "object",
"required": [
"schema",
"schema_version",
"operation_id",
"idempotency_key",
"args_digest",
"effect_class",
"state"
],
"properties": {
"schema": { "const": "EffectLedgerRecordV1" },
"schema_version": { "const": 1 },
"operation_id": { "type": "string" },
"idempotency_key": { "type": "string" },
"args_digest": { "type": "string" },
"resource_scope": { "type": ["string", "null"] },
"expected_revision": { "type": ["string", "null"] },
"effect_class": {
"type": "string",
"enum": ["read", "write", "execute", "external_write", "none"]
},
"result_ref": { "type": ["string", "null"] },
"state": {
"type": "string",
"enum": [
"prepared",
"started",
"committed",
"failed_no_effect",
"unknown",
"reconciled_committed",
"reconciled_no_effect",
"needs_input"
]
},
"logical_run_id": { "type": ["string", "null"] },
"step_id": { "type": ["string", "null"] },
"attempt_id": { "type": ["string", "null"] }
},
"additionalProperties": true
}
+11 -4
View File
@@ -136,6 +136,12 @@ fn ma0_agent_reliability_protocol_freeze() {
assert_eq!(legacy["id"], "legacy_resume_01");
let ledger = fixture("effect_ledger_v1.json");
assert_required(
&ledger,
&schema("EffectLedgerRecordV1.schema.json"),
"effect_ledger",
);
assert_eq!(ledger["schema"], "EffectLedgerRecordV1");
assert_eq!(ledger["state"], "prepared");
assert_eq!(ledger["effect_class"], "write");
@@ -182,13 +188,12 @@ fn ma0_agent_reliability_protocol_freeze() {
let caps = mlsp("capabilities", serde_json::json!({}));
assert_eq!(caps["ok"], true, "{caps}");
let features = &caps["result"]["features"];
for bit in ["agent.output_channels_v1", "agent.context_pack_v2"] {
assert_eq!(features[bit], 0, "{bit} must stay 0 until emitters land");
}
// M-A1–M-A3: error + checkpoint + tool schema + resource view emitters are live.
// M-A1–M-A4: agent reliability emitters are live.
assert_eq!(features["agent.error_v1"], 1);
assert_eq!(features["agent.checkpoint_v2"], 1);
assert_eq!(features["agent.tool_schema_v1"], 1);
assert_eq!(features["agent.output_channels_v1"], 1);
assert_eq!(features["agent.context_pack_v2"], 1);
assert_eq!(features["resource.view_v1"], 1);
let formats = caps["result"]["extract_formats"]
@@ -220,6 +225,8 @@ fn ma0_agent_reliability_protocol_freeze() {
assert_eq!(down["result"]["features"]["agent.error_v1"], 1);
assert_eq!(down["result"]["features"]["agent.checkpoint_v2"], 1);
assert_eq!(down["result"]["features"]["agent.tool_schema_v1"], 1);
assert_eq!(down["result"]["features"]["agent.output_channels_v1"], 1);
assert_eq!(down["result"]["features"]["agent.context_pack_v2"], 1);
assert_eq!(down["result"]["features"]["resource.view_v1"], 1);
}