# Metadata Verification

> Shared rules for Kingdee form, field, enum, table, and DB routing verification.

---

## Authority Order

Use this order when facts disagree:

1. Verified runtime metadata from **Agent-guided readonly SQL + LLM parse** (not metadata MCP; FKERNELXML/fdata; see kcode-pi `skills/_shared/metadata-db-query.md`) or platform export. If connection info is missing, ask the user first.

2. Source code constants and local project conventions
3. Product profile in `project-context.md`
4. User-provided identifiers in the current request
5. Captions or screenshots, only as hints

Never treat localized captions as stable identifiers.

---

## Must Verify Before Use

- Product family: Cosmic Java vs Enterprise C# vs IronPython
- Form ID / bill ID / entity ID
- Field key, entry key, DB column, field type
- Enum/dropdown values and labels
- Operation keys such as save, submit, audit, close, push
- DB key, DB name, dialect, and cross-database routing
- Base data references and relation fields

---

## Stop Conditions

Stop and list pending facts when:

- A table or field is guessed from a caption.
- Enum values are unknown.
- A KSQL/data-fix script would update rows without verified impact scope.
- A change writes across different DB names and the strategy is not confirmed.
- The task asks for a product line that conflicts with loaded skills or project profile.

---

## Minimal Verification Record

When metadata matters, include this in implementation notes or script comments:

```text
Product family: <Cosmic Java | Enterprise C# | IronPython>
Form/entity: <verified id and source>
Fields: <field key -> DB column/type/source>
Operation: <operation key/source>
DB route: <dbKey/dbName/dialect/source>
Verification source: <readonly SQL + LLM parse, metadata export, source file>

```


