Skip to main content

Module suggestions

Module suggestions 

Source
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 in admin.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>_id column to a known model when the schema has no Relation recorded for it. Fired from &Schema directly 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 entries then industry_schema.required_fields.
derive_suggestions_from_entries
0.7.3 schema-backed variant. Same rules as derive_suggestions but reads field names from DynamicAdminEntry, which the admin builds fresh from crate::admin::schema_cache on every dashboard render. When the cache sees an updated rustio.schema.json — e.g. after rustio 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 as find_suggestion.
find_suggestion
Look up a specific suggestion by (admin_name, field). Returns None if 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.