Skip to content

feat: convert schema.toml to machine-parseable format#30

Merged
houko merged 4 commits intomainfrom
feat/machine-parseable-schema
Mar 31, 2026
Merged

feat: convert schema.toml to machine-parseable format#30
houko merged 4 commits intomainfrom
feat/machine-parseable-schema

Conversation

@houko
Copy link
Copy Markdown
Contributor

@houko houko commented Mar 26, 2026

Summary

Convert schema.toml from comment-based documentation to structured TOML that can be parsed by RegistrySchema types in librefang core.

Changes

  • All 6 content types preserved: provider, agent, hand, integration, skill, plugin
  • Each field now has: type, required, description, example, default, options
  • Nested sections use sections with repeatable = true for array-of-tables patterns
  • Human-readable comments kept as section headers

Motivation

The core API endpoint GET /api/registry/schema (PR librefang/librefang#1715) needs to parse this file to serve schema metadata to the dashboard for dynamic form generation.

Format

[provider]
description = "LLM provider configuration"
file_pattern = "providers/*.toml"

[provider.fields.id]
type = "string"
required = true
description = "Unique provider identifier"
example = "anthropic"

Test plan

  • toml::from_str::<RegistrySchema>() parses successfully
  • All 6 content types present with correct fields
  • make validate still passes

Replace comment-based documentation format with structured TOML that
can be deserialized into the RegistrySchema Rust type. All 6 content
types (provider, agent, hand, integration, skill, plugin) preserved
with every field, description, enum option, and nested section.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fc92ff0cbe

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

schema.toml Outdated
type = "string"
required = false
description = "Integration category"
options = ["devtools", "communication", "storage", "monitoring", "data", "productivity"]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Expand integration category enum to include live categories

The new machine-readable enum omits categories already present in the registry (cloud and ai), so schema-driven validation/forms will reject or fail to round-trip existing integrations such as integrations/aws.toml, integrations/azure-mcp.toml, integrations/gcp-mcp.toml, integrations/brave-search.toml, and integrations/exa-search.toml.

Useful? React with 👍 / 👎.

type = "string"
required = true
description = "Type of requirement"
options = ["binary", "package", "service"]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add current requirement types to hand dependency enum

This enum currently allows only binary/package/service, but active hand manifests use additional requirement types (api_key, any_env_var), so tools consuming this schema as a whitelist will mark valid files as invalid (for example hands/twitter/HAND.toml, hands/reddit/HAND.toml, and hands/creator/HAND.toml).

Useful? React with 👍 / 👎.

type = "string"
required = true
description = "Display format for the metric value"
options = ["number", "currency", "percentage"]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Include existing dashboard metric formats in enum

The metric format enum is now machine-enforced but excludes formats already used by hands (text and duration), which will break schema-based editing/validation for current manifests like hands/collector/HAND.toml, hands/trader/HAND.toml, hands/apitester/HAND.toml, and hands/clip/HAND.toml.

Useful? React with 👍 / 👎.

type = "string"
required = false
description = "How often this hand runs"
options = ["continuous", "on-demand", "scheduled"]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Add currently used frequencies to hand metadata enum

The frequency enum omits values already present in the registry (daily, hourly), so schema consumers that trust options will incorrectly reject valid hand metadata (e.g., hands/linkedin/HAND.toml, hands/twitter/HAND.toml, hands/reddit/HAND.toml).

Useful? React with 👍 / 👎.

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@houko houko merged commit ae5d97d into main Mar 31, 2026
3 checks passed
@houko houko deleted the feat/machine-parseable-schema branch March 31, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant