{"id":11912,"plugin_id":"plugin_asdk_app_6a6759afdd20819185b27e68d2eccbad","kind":"skill","collection_source":null,"comparison_source":null,"observed_at":"2026-09-30T23:00:31.644Z","digest":"e82652a0ee0b9d59af24b7d10e6a0160238b37ea8ab04e445d70f1c066f56edf","against":null,"payload":{"name":"june-manage-facts","description":"Read, interpret, create, and update Case Facts and Document Facts in JUNE using their live schemas. Use when a user asks about structured case data, extracted document fields, fact schemas, field groups, allowed values, or requests a change to a Case Fact or Document Fact.","included_files":[{"relative_path":"agents/openai.yaml","size_in_bytes":437}],"skill_md_contents":"---\nname: june-manage-facts\ndescription: Read, interpret, create, and update Case Facts and Document Facts in JUNE using their live schemas. Use when a user asks about structured case data, extracted document fields, fact schemas, field groups, allowed values, or requests a change to a Case Fact or Document Fact.\n---\n\n# Manage JUNE facts\n\nTreat Case Facts and Document Facts as separate systems. Always read the live schema before writing, use exact keys from that schema, and preserve unrelated current values.\n\n## Work with Case Facts\n\n1. Resolve the case with `get_case_by_reference`, then call `get_case_context`.\n2. Read from the context:\n   - `mandate_id`\n   - mandate-specific values and version in `case_facts`\n   - global values and version in `case_facts_without_mandate`\n   - `is_archived` and `is_read_only`; do not write facts when either blocks changes\n3. Load both applicable schema scopes:\n   - `get_casefact_schema(mandate_id=<case mandate>)`\n   - `get_casefact_schema(mandate_id=-1)` for global Case Facts\n4. Use `get_all_casefact_schemas` only for cross-mandate discovery. Use `list_mandates` when a mandate name must be resolved.\n5. Match the requested field by schema label, then retain its exact `guid_key`, `data_type`, allowed values, `disabled`, `is_fieldgroup`, and source mandate. Never guess a GUID or treat a global field as mandate-specific. Do not write a disabled field.\n\nFor a scalar Case Fact:\n\n1. Check allowed values in the schema.\n2. Call `format_casefact_value` with the schema's data type and the user's raw value.\n3. Stop if formatting fails or an enum value is not allowed. If the user includes a unit or currency but the schema field is numeric, confirm that only the numeric component will be stored; do not silently encode the unit in a number field.\n4. Use the version from the matching current facts block. If no block exists, use a version only when the matching schema or tool result establishes it; otherwise ask instead of guessing.\n5. Call `update_casefact` with the exact case ID, GUID key, formatted value, matching mandate ID, and version.\n\nFor a Case Fact with `is_fieldgroup=true`:\n\n1. Call `get_fieldgroup_schema(field_group_keys=[<casefact guid>])`.\n2. Use only returned column GUID keys and data types.\n3. Read and preserve the current `fieldGroupValues`. The tool replaces the complete row collection for that field; never send only a partial row update.\n4. Show the full resulting row collection and obtain explicit confirmation before calling `update_casefact` with `{\"fieldGroupValues\": [...]}`.\n5. Stop if the field-group schema is missing or the current rows cannot be represented without loss.\n\n## Work with Document Facts\n\n1. Resolve the document and verify that it belongs to the intended case. Read that case with `get_case_context` and do not write facts when the case is archived or read-only.\n2. Call `get_document_facts(document_id)` for current values.\n3. Always call `get_document_fact_schema(document_id)` before a write. Use the exact returned field label or key, type, `allowed_values`, and `group` flag.\n4. Stop for `group=true`; the exposed create and update tools support only single-value Document Facts.\n5. Use `create_document_facts` only for schema-defined fields that are currently absent.\n6. Use `update_document_facts` only for fields that already exist, with labels or keys exactly as returned by `get_document_facts`.\n7. If the stored value already equals the requested value, make no write.\n8. Treat each mapping as all-or-nothing: an unknown, grouped, already-present, or invalid field rejects the complete request. Do not mix creates and updates in one call.\n\n## Confirm, write, and verify\n\nBefore `update_casefact` or `update_document_facts`, show the old value, new value, target case or document, schema field, and scope, then obtain explicit confirmation unless the latest user instruction already states that exact change. For creates, summarize the exact new fields and target.\n\nCall each write once. Separate Case-Fact and Document-Fact calls are not one transaction: execute them in the confirmed order, verify each result, and stop the remaining writes after a failure while reporting any partial success. After an error or timeout, read the facts again before retrying. After success, re-read with `get_case_context` or `get_document_facts` and report the stored value, target ID, field label, and field key.\n"},"changes":[],"summary":"First saved snapshot. No earlier version is available for comparison.","summary_kind":"deterministic","summary_metadata":{}}