Skip to main content

[!FROZEN] MPLP Protocol v1.0.0 Frozen Specification Freeze Date: 2025-12-03 Status: FROZEN (no breaking changes permitted) Governance: MPLP Protocol Governance Committee (MPGC) License: Apache-2.0 Note: Any normative change requires a new protocol version.

Learning Sample Schema Reference

1. Purpose

This document provides the normative reference for all Learning Sample schemas defined in the MPLP v1.0 protocol. Content is derived directly from the frozen JSON schemas in schemas/v2/learning/.


2. Schema Architecture

Schema Hierarchy:

  • Core Schema: Defines universal fields for all learning samples
  • Family-Specific Schemas: Extend core with specialized input/state/output structures
  • Common Schema: Alternative structure with additional metrics fields

3. Core Schema (mplp-learning-sample-core.schema.json)

Schema ID: https://mplp.dev/schemas/v1.0/learning/mplp-learning-sample-core.schema.json

3.1 Required Fields

FieldTypeDescription
sample_idstring (uuid)Unique identifier of the learning sample (UUID v4)
sample_familystringLearningSample family identifier (e.g., intent_resolution, delta_impact, pipeline_outcome, confirm_decision, graph_evolution, multi_agent_coordination)
created_atstring (date-time)ISO 8601 timestamp when sample was generated
inputobjectAbstracted representation of input conditions, intent, context
outputobjectAbstracted representation of actual outcomes, decisions, changes

3.2 Optional Fields

FieldTypeDescription
stateobjectSnapshot of relevant system state before execution (PSG summary, config, roles)
metaobjectMetadata, labels, quality signals, provenance IDs

3.3 Meta Object Structure

FieldTypeDescription
source_flow_idstringFlow ID that generated this sample (e.g., FLOW-01, SA-01, MAP-01)
source_event_idsarray<uuid>Observability event IDs referenced by this sample
project_idstring (uuid)Project context identifier
human_feedback_labelenumHuman quality assessment: approved, rejected, not_reviewed
quality_scorenumber (0.0-1.0)Automated quality score

4. Intent Resolution Schema (mplp-learning-sample-intent.schema.json)

Schema ID: https://mplp.dev/schemas/v1.0/learning/mplp-learning-sample-intent.schema.json

Family: intent_resolution

Extends Core Schema via allOf reference.

4.1 Input Fields

FieldTypeRequiredDescription
intent_idstringIntent identifier from IntentEvent or Plan.intent_model
raw_request_summarystringAbstracted summary of original user request (PII-scrubbed if needed)
constraints_summarystringKey constraints mentioned (timeline, budget, resources)
dialog_turns_countintegerNumber of dialog exchanges before intent resolution

4.2 State Fields

FieldTypeDescription
project_phasestringProject state: greenfield, brownfield, maintenance, etc.
psg_node_countintegerPSG size before intent application
existing_plan_countintegerNumber of existing plans in context

4.3 Output Fields

FieldTypeRequiredDescription
final_intent_summarystringRefined/clarified intent after resolution process
plan_idstring (uuid)Generated Plan identifier (if plan created)
plan_step_countintegerNumber of steps in generated plan
resolution_quality_labelenumQuality label: good, acceptable, bad, unknown

4.4 Meta Extensions

FieldTypeDescription
clarification_roundsintegerClarification rounds needed before resolution
ambiguity_flagsarray<string>Detected ambiguity types (vague_scope, missing_constraints, etc.)

5. Delta Impact Schema (mplp-learning-sample-delta.schema.json)

Schema ID: https://mplp.dev/schemas/v1.0/learning/mplp-learning-sample-delta.schema.json

Family: delta_impact

Extends Core Schema via allOf reference.

5.1 Input Fields

FieldTypeRequiredDescription
delta_idstringDelta Intent identifier
intent_idstringOriginal intent being modified
change_summarystringAbstracted summary of requested change
delta_typeenumType: refinement, correction, expansion, reduction, pivot

5.2 State Fields

FieldTypeDescription
affected_artifact_countintegerNumber of artifacts potentially affected
risk_levelenumRisk level: low, medium, high, critical
psg_complexity_scorenumberPSG complexity metric before change

5.3 Output Fields

FieldTypeRequiredDescription
actual_impact_summarystringSummary of actual impact after analysis
impact_scopeenumScope: local, module, system, global
comp_plan_requiredbooleanWhether compensation plan was needed
comp_plan_appliedbooleanWhether compensation was actually applied
rollback_usedbooleanWhether rollback mechanism was triggered

5.4 Meta Extensions

FieldTypeDescription
impact_analysis_duration_msintegerTime spent on impact analysis
predicted_vs_actual_accuracyenumPrediction accuracy: accurate, underestimated, overestimated

6. Common Learning Sample Schema (common/learning-sample.schema.json)

Schema ID: https://schemas.mplp.dev/v1.0/common/learning-sample.schema.json

This is an alternative comprehensive schema with additional fields for metrics and governance.

6.1 Required Fields

FieldTypeDescription
sample_id$ref identifiers.schema.jsonUnique identifier
project_idstringProject identifier
success_flagbooleanWhether the action/intent succeeded
timestamps.started_atdate-timeExecution start time (required)

6.2 Intent & Plan Fields

FieldTypeDescription
intent_beforeobjectStructured representation of the original intent
planobjectStructured representation of the plan used
delta_intentsarray<object>Array of delta intents proposed/applied

6.3 Graph State Fields

FieldTypeDescription
graph_beforeobjectSnapshot/summary of knowledge graph before change
graph_afterobjectSnapshot/summary of knowledge graph after change

6.4 Execution Metrics

FieldTypeDescription
pipeline_patharray<string>Sequence of pipeline stages traversed
execution_time_msnumberExecution time in milliseconds
impact_scorenumber (0.0-1.0)Impact score

6.5 Token Usage Object

{
"token_usage": {
"total_tokens": 12500,
"prompt_tokens": 8000,
"completion_tokens": 4500,
"by_agent": [
{ "agent_id": "agent-001", "role": "planner", "tokens": 5000 },
{ "agent_id": "agent-002", "role": "executor", "tokens": 7500 }
]
}
}

6.6 User Feedback Object

FieldTypeValues
decisionenumapprove, reject, override, unknown
commentstringHuman comment
ratingnumber0-5 rating scale

6.7 Error Info Object

{
"error_info": {
"error_code": "VALIDATION_ERROR",
"error_message": "Schema validation failed",
"stack_trace": "..."
}
}

6.8 Governance and Extensions

FieldTypeDescription
governance_decisionsarray<object>Governance rules evaluated during execution
metadataobjectAdditional metadata (extensibility point)
vendor_extensionsobjectVendor-specific extensions (MUST NOT conflict with core fields)

7. Sample Families Reference

Based on Core Schema sample_family examples:

Family IDDescriptionPrimary Schema
intent_resolutionUser intent clarification and plan generationmplp-learning-sample-intent.schema.json
delta_impactChange effect analysis and compensation planningmplp-learning-sample-delta.schema.json
pipeline_outcomePipeline stage success/failure patternsCore Schema
confirm_decisionApproval/rejection decisions and reasoningCore Schema
graph_evolutionPSG structural changes over timeCore Schema
multi_agent_coordinationSA/MAP collaboration patternsCore Schema

8. Schema References

  • Core Schema: schemas/v2/learning/mplp-learning-sample-core.schema.json
  • Intent Schema: schemas/v2/learning/mplp-learning-sample-intent.schema.json
  • Delta Schema: schemas/v2/learning/mplp-learning-sample-delta.schema.json
  • Common Schema: schemas/v2/common/learning-sample.schema.json
  • Invariants: schemas/v2/invariants/learning-invariants.yaml

End of Learning Sample Schema Reference

2025 Bangshi Beijing Network Technology Limited Company Licensed under the Apache License, Version 2.0.