Expand description
Actionable suggestion engine — 0.7.1.
Derives concrete add-this-field suggestions from
(schema, context). Every suggestion is a thin descriptor the
admin UI can turn into a button; clicking the button runs the
planner, the review layer, and finally the executor — the
standard chain. Nothing here bypasses safety gates.
§Scope (0.7.1)
Only AddField suggestions for industry-required fields that a
model is missing. Destructive / renaming / type-changing
suggestions are explicitly out of scope — they need their own
review pass and are deferred.
§What this module does NOT do
- It does not call the planner or executor itself. It only
produces structured data (
Suggestion) that describes what the user could opt into. Wiring lives inadmin.rs. - It does not touch the filesystem or database.
Structs§
- Suggestion
- One proposed action shown next to a dashboard alert.
Enums§
- Confidence
- How sure the suggestion engine is that this is the right action.
Functions§
- derive_
relation_ suggestions - 0.8.0 — propose linking an orphan
<thing>_idcolumn to a known model when the schema has noRelationrecorded for it. Fired from&Schemadirectly because relation metadata lives there (not on admin entries). - derive_
suggestions - Enumerate every suggestion for the current project. Empty when
no context is loaded or when no model overlaps the industry’s
convention list. Deterministic: iteration follows the order of
entriesthenindustry_schema.required_fields. - derive_
suggestions_ from_ entries - 0.7.3 schema-backed variant. Same rules as
derive_suggestionsbut reads field names fromDynamicAdminEntry, which the admin builds fresh fromcrate::admin::schema_cacheon every dashboard render. When the cache sees an updatedrustio.schema.json— e.g. afterrustio ai apply+rustio schema+[Reload schema]— the suggestion for the just-added field disappears on the next response, without restarting the process. - find_
relation_ suggestion - Companion to
derive_relation_suggestions— locate one by(admin_name, field). Same rejection-of-crafted-URLs story asfind_suggestion. - find_
suggestion - Look up a specific suggestion by
(admin_name, field). ReturnsNoneif the pair isn’t in the current derived set — this is how the route handlers reject crafted URLs. An operator can only click through suggestions the engine actually produced. - find_
suggestion_ from_ entries - Schema-backed counterpart to
find_suggestion.