Module: Parse::Core::Describe
- Included in:
- Object
- Defined in:
- lib/parse/model/core/describe.rb
Overview
Operator-facing introspection mixin. Extended onto Parse::Object so ‘Model.describe` aggregates local model declarations, server schema, CLP, and Atlas Search index state into a single Hash.
SECURITY POSTURE — mirrors Agent::Describe. This is operator-side observability, NOT data exposed to an LLM. Output is never included in tool responses, MCP ‘tools/list`, or any `parse.agent.*` notification payload. Surfacing it via a console or debug endpoint requires auth-gating on the operator boundary.
Network policy mirrors ‘agent.describe`: local-only by default. Opt in to server fetches with `network: true`. Each section degrades gracefully (`false, reason: …`) instead of raising when the underlying service is unreachable or unconfigured.
Constant Summary collapse
- LOCAL_SECTIONS =
%i[model acl].freeze
- NETWORK_SECTIONS =
%i[schema clp atlas indexes].freeze
- ALL_SECTIONS =
(LOCAL_SECTIONS + NETWORK_SECTIONS).freeze
- CORE_FIELD_KEYS =
Core/built-in field keys we don’t report under ‘:model` —they’re inherited from Parse::Object (in both snake_case and camelCase form) and add noise to every output.
%i[ id object_id created_at updated_at acl session_token objectId createdAt updatedAt ACL sessionToken ].freeze
Instance Method Summary collapse
-
#describe(*sections, pretty: false, network: false, usage: false, master: false, client: nil) ⇒ Hash, String
Aggregate introspection for the class.
Instance Method Details
#describe(*sections, pretty: false, network: false, usage: false, master: false, client: nil) ⇒ Hash, String
Valid sections: :model :acl :schema :clp :atlas :indexes.
Aggregate introspection for the class. Local-only by default; pass ‘network: true` to include server schema, CLP, and Atlas Search.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/parse/model/core/describe.rb', line 56 def describe(*sections, pretty: false, network: false, usage: false, master: false, client: nil) requested = sections.flatten.map(&:to_sym) active = if requested.empty? network ? ALL_SECTIONS : LOCAL_SECTIONS else requested end data = { class_name: parse_class } active.each do |s| data[s] = describe_section(s, client: client, network: network, usage: usage, master: master) end pretty ? describe_pretty(data) : data end |