Module: Clacky::ExtensionVerifier

Defined in:
lib/clacky/extension/verifier.rb

Overview

Static checks layered on top of ExtensionLoader's structural validation.

ExtensionLoader already enforces required fields and file existence per unit while loading. The Verifier adds whole-program checks an AI author needs to close the feedback loop: unknown manifest keys, cross-unit reference integrity, and id collisions across layers (formal "override" warnings).

Output is a flat array of Issue records — { ext, unit, level, code, message, file, hint } — each individually addressable so callers can render them in any UI (CLI, Web, JSON for tooling).

Defined Under Namespace

Classes: Issue

Constant Summary collapse

KNOWN_TOP_KEYS =
%w[id name title description version origin author homepage license public license_required keywords contributes].freeze
KNOWN_CONTRIBUTES =
%w[panels api skills agents channels patches hooks].freeze
PANEL_KEYS =
%w[id title title_zh description description_zh view order attach].freeze
API_KEYS =
%w[id handler].freeze
SKILL_KEYS =
%w[id dir protected].freeze
AGENT_KEYS =
%w[id title title_zh description description_zh order prompt panels skills avatar].freeze
CHANNEL_KEYS =
%w[id platform adapter].freeze
PATCH_KEYS =
%w[target file fingerprint on_mismatch].freeze
HOOK_KEYS =
%w[event file].freeze
ATTACH_TOKEN_RE =
/\A(\*|[\w\-]+)\z/.freeze

Class Method Summary collapse

Class Method Details

.verify(result) ⇒ Object

Run all checks against a fully-loaded ExtensionLoader::Result. Returns an array of Issue. The result already contains structural Errors from the loader; those are converted to Issues so callers see one stream.



36
37
38
39
40
41
42
43
# File 'lib/clacky/extension/verifier.rb', line 36

def verify(result)
  issues = []
  issues.concat(loader_errors_as_issues(result))
  issues.concat(override_issues(result))
  issues.concat(manifest_schema_issues(result))
  issues.concat(reference_issues(result))
  issues
end