create_pending_proposal
Validate and persist a pending rule, lesson, or update proposal so it can be reviewed before approval commits it to team rules or lessons.
Instructions
Validate and persist a pending proposal of type 'rule', 'lesson', or 'update' (private tags stripped from proposed_text and metadata). The body goes in proposed_text and the other block fields in metadata; a full rendered atomic block in proposed_text is split into the two. For type='update', target_id must reference an existing RN-/LL- id and the proposal inherits that target's scope_id. Does not write to rules/lessons or any .md file — approve_proposal does that after human review.
Access level: analyze. Returns: the new proposal's id, as a plain string.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | Proposal type: 'rule', 'lesson', or 'update'. | |
| metadata | No | JSON object with the block fields other than the body. Rule keys: category, severity (low|medium|high|critical), applies_to, tags (list or comma-separated), source. Lesson keys: project, date_occurred, severity, area_affected, tags, impact, root_cause, resolution, originated_rule_id. For type='update', omitted keys keep the target's current values. | |
| target_id | No | For type='update': the existing RN-*/LL-* id this proposal will replace. | |
| source_ref | No | Provenance reference, e.g. a meeting id or PR link. | |
| source_type | No | Provenance type, e.g. 'transcript' or 'manual'. | |
| target_type | No | For type='update': 'rule' or 'lesson'; inferred from target_id's prefix if omitted. | |
| proposed_text | Yes | The body only: the rule text (goes under **Regla:**) or what happened (goes under **Qué pasó:**). Put the other block fields in `metadata`. A full rendered atomic block is also accepted and split into body + metadata. Private tags are stripped before storage. | |
| suggested_scope_id | Yes | Scope to attach the proposal to if approved. Ignored for type='update', which inherits the target's own scope. | |
| suggested_attributes | No | JSON array of {"key": ..., "value": ...} dynamic attributes (ADR-002) to attach if approved. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |