mirror of
https://git.openapi.site/https://github.com/desirecore/agent-desirecore.git
synced 2026-09-05 17:43:47 +08:00
feat: 增加人机共管场景决策树 (#8)
Co-authored-by: yige <yige@yigedeMacBook-Neo.local>
This commit is contained in:
97
web/solver-report/decision-tree.schema.json
Normal file
97
web/solver-report/decision-tree.schema.json
Normal file
@@ -0,0 +1,97 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$id": "https://desirecore.com/schemas/solver-report-decision-tree.schema.json",
|
||||
"title": "Solver report human-Agent decision tree",
|
||||
"description": "A scenario-specific, evidence-bound decision tree that explains which facts humans confirm, which reasoning Agents perform, which gates can block delivery, and which path was actually taken.",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["schemaVersion", "rootNodeId", "nodes", "edges", "observed", "evidenceBindings"],
|
||||
"properties": {
|
||||
"schemaVersion": {
|
||||
"const": "solver.human-agent-decision-tree/v1",
|
||||
"description": "Version of the stable decision-tree interchange contract."
|
||||
},
|
||||
"rootNodeId": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"description": "ID of the first node on the scenario decision path."
|
||||
},
|
||||
"nodes": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"description": "Decision, gate, action, and outcome nodes. Business wording is derived from scenario evidence rather than UI code.",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["id", "kind", "owner", "title", "detail", "status", "evidenceRef"],
|
||||
"properties": {
|
||||
"id": { "type": "string", "pattern": "^[a-z][a-z0-9-]*$", "description": "Stable node identifier within one tree." },
|
||||
"kind": {
|
||||
"enum": ["context", "question", "action", "check", "outcome"],
|
||||
"description": "Visual and semantic role of the node."
|
||||
},
|
||||
"owner": {
|
||||
"enum": ["human", "agent", "shared", "validator", "platform"],
|
||||
"description": "Party responsible for confirming or performing this step."
|
||||
},
|
||||
"title": { "type": "string", "minLength": 1, "description": "Plain-language step or question shown to non-algorithm users." },
|
||||
"detail": { "type": "string", "minLength": 1, "description": "Scenario-specific explanation of the step, rule, or outcome." },
|
||||
"status": {
|
||||
"enum": ["pass", "guard", "blocked", "neutral"],
|
||||
"description": "Observed state in this evidence run; guard and blocked nodes explain non-delivery paths."
|
||||
},
|
||||
"evidenceRef": {
|
||||
"type": "string",
|
||||
"pattern": "^#[a-z0-9-]+$",
|
||||
"description": "In-page anchor where a reviewer can inspect the supporting evidence."
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"edges": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"description": "Directed branches between nodes. Exactly one selected path records what happened in the accepted run.",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["from", "to", "label", "tone", "selected"],
|
||||
"properties": {
|
||||
"from": { "type": "string", "description": "Source node ID." },
|
||||
"to": { "type": "string", "description": "Destination node ID." },
|
||||
"label": { "type": "string", "minLength": 1, "description": "Human-readable branch condition or observed answer." },
|
||||
"tone": { "enum": ["continue", "guard", "success"], "description": "Branch appearance and governance meaning." },
|
||||
"selected": { "type": "boolean", "description": "Whether this branch belongs to the observed evidence path." }
|
||||
}
|
||||
}
|
||||
},
|
||||
"observed": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["workflowKind", "runStatus", "solveStatus", "validationVerdict"],
|
||||
"description": "Observed workflow and verdicts parsed from the accepted Run, settled tool summaries, and receipts; oracle expectations never substitute for these values.",
|
||||
"properties": {
|
||||
"workflowKind": { "enum": ["optimization", "validation", "recovery"], "description": "Actual tool path used by this run." },
|
||||
"runStatus": { "type": "string", "minLength": 1, "description": "Observed case-run acceptance status." },
|
||||
"solveStatus": { "type": ["string", "null"], "description": "Observed settled solver status, or null when no solve was performed." },
|
||||
"validationVerdict": { "type": ["string", "null"], "enum": ["pass", "fail", null], "description": "Observed independent validation verdict, or null when the workflow has no validation step." }
|
||||
}
|
||||
},
|
||||
"evidenceBindings": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["scenarioPackSha256", "runId", "sourceMessagesSha256", "sourceSessionSha256", "sourceToolInvocationsSha256", "optimizationSpecSha256", "resultPayloadSha256", "validationReportSha256"],
|
||||
"description": "Immutable bindings that prevent a generic or stale tree from being presented as scenario evidence.",
|
||||
"properties": {
|
||||
"scenarioPackSha256": { "type": "string", "pattern": "^[a-f0-9]{64}$", "description": "SHA-256 of the source Scenario Pack." },
|
||||
"runId": { "type": "string", "minLength": 1, "description": "Accepted run that supplied observed outcomes." },
|
||||
"sourceMessagesSha256": { "type": "string", "pattern": "^[a-f0-9]{64}$", "description": "SHA-256 of the source conversation log." },
|
||||
"sourceSessionSha256": { "type": "string", "pattern": "^[a-f0-9]{64}$", "description": "SHA-256 of the session log containing settled solve, validation, or recovery-ledger summaries." },
|
||||
"sourceToolInvocationsSha256": { "type": "string", "pattern": "^[a-f0-9]{64}$", "description": "SHA-256 of the governed tool receipt log that proves which workflow actually ran." },
|
||||
"optimizationSpecSha256": { "type": ["string", "null"], "pattern": "^[a-f0-9]{64}$", "description": "OptimizationSpec hash when a solver path exists." },
|
||||
"resultPayloadSha256": { "type": ["string", "null"], "pattern": "^[a-f0-9]{64}$", "description": "Settled solver-result hash or recovery EvidenceLedger payload hash; null only for validation-only candidate workflows." },
|
||||
"validationReportSha256": { "type": ["string", "null"], "pattern": "^[a-f0-9]{64}$", "description": "Independent validation report hash when recorded." }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user